/*
 * Mamou Free Tools - 文章一括整形ツール
 * 既存テーマ(SWELL)のCSSクラスに依存しない自己完結スタイル。
 * すべて .mamou-tool 配下にスコープする。
 */

.mamou-tool {
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
  margin: 0 0 2em;
  padding: 1.25em;
  background: #ffffff;
  border: 1px solid #d9dde3;
  border-radius: 12px;
  color: #222222;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.6;
}

.mamou-tool *,
.mamou-tool *::before,
.mamou-tool *::after {
  box-sizing: inherit;
}

.mamou-tool__notice {
  margin: 0 0 1em;
  padding: 0.75em 1em;
  background: #f4f7fb;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  font-size: 0.9em;
  color: #33475b;
}

.mamou-tool__noscript {
  margin: 0;
  padding: 1em;
  background: #fff4f4;
  border: 1px solid #f0c9c9;
  border-radius: 8px;
  color: #8a2c2c;
}

.mamou-tool__section {
  margin: 0 0 1.25em;
}

.mamou-tool__label {
  display: block;
  margin: 0 0 0.5em;
  font-weight: 700;
  font-size: 0.95em;
  color: #222222;
}

.mamou-tool__textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 160px;
  padding: 0.75em;
  background: #fafbfc;
  border: 1px solid #ccd2da;
  border-radius: 8px;
  color: #222222;
  font-size: 0.95em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.5;
  resize: vertical;
}

.mamou-tool__textarea:focus {
  outline: 2px solid #4c8bf5;
  outline-offset: 1px;
}

.mamou-tool__textarea[readonly] {
  background: #f2f4f6;
}

.mamou-tool__counters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 1.25em;
  margin-top: 0.4em;
  font-size: 0.85em;
  color: #5a6472;
}

.mamou-tool__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em 1.5em;
  margin: 0;
  padding: 0;
  border: 0;
}

.mamou-tool__options legend {
  width: 100%;
  margin-bottom: 0.5em;
  padding: 0;
  font-weight: 700;
  font-size: 0.95em;
}

.mamou-tool__option {
  display: flex;
  align-items: flex-start;
  gap: 0.4em;
  font-size: 0.9em;
  max-width: 100%;
}

.mamou-tool__option input {
  margin-top: 0.2em;
  flex-shrink: 0;
}

.mamou-tool__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em;
  margin: 1em 0;
}

.mamou-tool__button {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.6em 1.2em;
  background: #2c6fe0;
  border: 1px solid #2c6fe0;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95em;
  font-weight: 700;
  cursor: pointer;
  max-width: 100%;
}

.mamou-tool__button:hover {
  background: #2258b8;
  border-color: #2258b8;
}

.mamou-tool__button:focus-visible {
  outline: 2px solid #143d7a;
  outline-offset: 2px;
}

.mamou-tool__button--secondary {
  background: #ffffff;
  border: 1px solid #ccd2da;
  color: #2c3440;
}

.mamou-tool__button--secondary:hover {
  background: #f2f4f6;
  border-color: #ccd2da;
}

.mamou-tool__status {
  min-height: 1.2em;
  margin-top: 0.4em;
  font-size: 0.85em;
  color: #2c8a4f;
}

.mamou-tool__status[data-state="error"] {
  color: #c0392b;
}

@media (max-width: 480px) {
  .mamou-tool {
    padding: 1em;
    border-radius: 8px;
  }

  .mamou-tool__textarea {
    min-height: 140px;
    font-size: 0.9em;
  }

  .mamou-tool__button {
    flex: 1 1 auto;
    justify-content: center;
  }
}
