/* SNS-TOOLBOX 共通スタイル。
   方針: モバイルファースト、不要なアニメーションなし、ボタンは大きく、
   広告タグを後から挿入してもレイアウトが崩れにくいよう、コンテンツ幅を
   中央固定カラム(.page)に収め、広告スロット(.ad-slot)は独立した
   ブロック要素として最初から確保しておく。 */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1a1d23;
  --text-muted: #5b6270;
  --border: #e2e5ea;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 10px;
  --max-width: 720px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif;
  line-height: 1.7;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.site-logo span { color: var(--accent); }
.site-nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}

h1 { font-size: 1.5rem; margin: 4px 0 10px; }
h2 { font-size: 1.2rem; margin: 24px 0 10px; }
h3 { font-size: 1.05rem; margin: 16px 0 8px; }
.lede { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 18px; }

textarea.tool-input {
  width: 100%;
  min-height: 160px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}
textarea.tool-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.counter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 0.95rem;
  flex-wrap: wrap;
  gap: 8px;
}
.counter-badge {
  font-weight: 700;
  font-size: 1.1rem;
}
.counter-badge.is-over { color: var(--danger); }
.counter-badge.is-ok { color: var(--success); }

.progress-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar__fill {
  height: 100%;
  background: var(--accent);
}
.progress-bar__fill.is-over { background: var(--danger); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.btn:hover { background: var(--accent-dark); }
.btn:active { background: var(--accent-dark); }
.btn.secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 8px;
}
.spec-table th, .spec-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 6px;
  text-align: left;
}
.spec-table th { color: var(--text-muted); font-weight: 600; }

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 560px) {
  .tool-grid { grid-template-columns: 1fr 1fr; }
}
.tool-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--text);
}
.tool-card:hover { border-color: var(--accent); text-decoration: none; }
.tool-card__title { font-weight: 700; margin-bottom: 4px; }
.tool-card__desc { color: var(--text-muted); font-size: 0.88rem; }

.notice {
  background: #eef4ff;
  border: 1px solid #cfe0ff;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.88rem;
  color: #1e3a8a;
  margin: 12px 0;
}
.notice.privacy {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #14532d;
}

.faq dt { font-weight: 700; margin-top: 14px; }
.faq dd { margin: 4px 0 0; color: var(--text-muted); }

.image-tool__preview {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  margin-top: 12px;
}
.image-tool__preview img { margin: 0 auto; border-radius: 6px; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
select.tool-select {
  width: 100%;
  min-height: 46px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 1rem;
  background: var(--surface);
}

/* 広告を後から挿入するためのスロット。中身が空でもレイアウトが
   大きく崩れないよう、最小限のマージンだけ持たせておく。 */
.ad-slot {
  margin: 20px 0;
  min-height: 0;
}
.ad-slot[data-filled="true"] {
  min-height: 90px;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 24px 16px 40px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.site-footer nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.toast.is-visible { opacity: 1; }

.muted { color: var(--text-muted); font-size: 0.85rem; }
