/*
 * 口コミ番人 スタイル。
 * ビルド工程を持たない（共用サーバーに Node が無く、デプロイを FTP/rsync だけで完結させるため）。
 * Tailwind 等は使わず、このファイル1枚で完結させる。
 */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #1f2328;
  --text-muted: #61676e;
  /*
   * ブランドカラーはロゴとキャラクターから採った（docs/資料/キャラビジュ.png）。
   * 濃紺 #002040・青 #3080D0・金 #F0C020 が指定色。
   * --brand は白文字を載せる背景にも使うので、原色そのままではなく読める濃さに寄せている。
   */
  --brand: #1b3a63;
  --brand-dark: #102540;
  --brand-soft: #eaf1f9;
  --brand-accent: #3080d0;
  --brand-gold: #e0a800;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --warning: #8a5a00;
  --warning-soft: #fdf3e0;
  --success: #1f6f4a;
  --success-soft: #eaf4ee;
  --info: #1a5f8a;
  --info-soft: #e8f2f8;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
}

* { box-sizing: border-box; }

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

a { color: var(--brand); }

/* ---------- ヘッダー ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 60px;
  flex-wrap: wrap;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
}

/* ロゴは意味を持たない装飾。alt を空にしてあるので、読み上げでは店名だけが読まれる。 */
.site-header__brand img { display: block; }

.site-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
}

.site-nav a:hover { background: var(--bg); color: var(--text); }
.site-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

.site-header__user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- レイアウト ---------- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.container--narrow { max-width: 460px; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.page-head p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* ---------- カード ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
}

/* 見出しと、その場で使う操作を横に並べる。 */
.card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.card__head .card__title { margin: 0; }

/* ---------- 統計 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.stat--alert {
  background: var(--danger-soft);
  border-color: #f5c9c5;
}

.stat--alert .stat__value { color: var(--danger); }

.stat__label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.stat__value { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat__value small { font-size: 14px; font-weight: 400; color: var(--text-muted); }

/* ---------- フォーム ---------- */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="search"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

textarea { resize: vertical; min-height: 140px; line-height: 1.8; }

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
  border-color: var(--brand);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
}

.checkbox input { margin-top: 4px; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn--secondary:hover { background: var(--bg); }

.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #8c1e17; }
.btn--block { display: block; width: 100%; }
.btn--small { padding: 5px 11px; font-size: 13px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- 通知 ---------- */
.alert {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid transparent;
}

/*
 * 操作後は元の位置へ戻すため、通知が画面外にならないよう上端に貼り付ける。
 * 親（main）の範囲でのみ効くので、ページを離れれば自然に消える。
 */
.alerts {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: 8px;
  margin: -8px 0 0;
  background: var(--bg);
}

.alert--success { background: var(--success-soft); color: var(--success); border-color: #c6e2d2; }
.alert--error { background: var(--danger-soft); color: var(--danger); border-color: #f5c9c5; }
.alert--warning { background: var(--warning-soft); color: var(--warning); border-color: #f0dcb4; }
.alert--info { background: var(--info-soft); color: var(--info); border-color: #c7dfee; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- バッジ ---------- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge--neutral { background: #eceef1; color: #4a5057; }
.badge--brand   { background: var(--brand-soft); color: var(--brand-dark); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger  { background: var(--danger-soft); color: var(--danger); }
.badge--info    { background: var(--info-soft); color: var(--info); }
.badge--faint   { background: #f2f3f5; color: #7c828a; }

/* ---------- 口コミ ---------- */
.review-list { display: flex; flex-direction: column; gap: 12px; }

.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  display: block;
}

.review-item:hover { border-color: #c9cfd6; }

.review-item__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.review-item__meta { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.review-item__body { color: var(--text); margin: 0; }
.review-item__store { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

.stars { color: #d99000; letter-spacing: 1px; font-size: 14px; }
.stars--empty { color: var(--text-muted); font-size: 12px; letter-spacing: 0; }

.quote {
  background: var(--bg);
  border-left: 3px solid var(--border);
  padding: 12px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  white-space: pre-wrap;
  margin: 0;
}

/* ---------- テーブル ---------- */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th { font-size: 13px; color: var(--text-muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* ---------- 横棒（分析） ---------- */
.bars__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.bars__label {
  flex: 0 0 92px;
  font-size: 13px;
  color: var(--text-muted);
}

.bars__track {
  flex: 1 1 auto;
  height: 10px;
  min-width: 60px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.bars__fill {
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
}

.bars__fill--negative { background: var(--danger); }

.bars__value {
  flex: 0 0 auto;
  font-size: 13px;
  min-width: 110px;
  text-align: right;
}

/* ---------- ブランド ---------- */
.brand-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 24px 0 20px;
}

.brand-head__logotype { display: block; height: auto; }

/* タグラインはロゴに添える文。本文より一段落として、視線を奪わない。 */
.brand-head__tagline { margin: 0; font-size: 13px; color: var(--text-muted); }

/* ---------- 導入（キャラクターつき） ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero__character { flex: 0 0 auto; }
.hero__body { flex: 1 1 340px; }
.hero__body h1 { margin: 0 0 6px; }
.hero__body p { margin: 0; color: var(--text-muted); }

.hero__note {
  margin-top: 8px !important;
  font-size: 13px;
}

.empty--character {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: left;
  flex-wrap: wrap;
}

/* ---------- 公開デモ ---------- */
.demo {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .demo { grid-template-columns: minmax(0, 1fr); }
}

.demo__samples { display: flex; flex-direction: column; gap: 8px; }

.demo__sample {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  background: var(--surface);
}

.demo__sample:hover { border-color: var(--brand); }

.demo__sample:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* 選択中は左の帯で示す。背景を塗ると本文が読みにくくなる。 */
.demo__sample.is-selected {
  border-color: var(--brand);
  border-left-color: var(--brand);
  background: var(--brand-soft);
}

.demo__sample-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 14px;
}

.demo__sample-body {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.demo__tones { display: flex; flex-wrap: wrap; gap: 8px; }

.demo__tone {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
}

.demo__tone:hover { border-color: var(--brand); color: var(--text); }

.demo__tone:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.demo__tone.is-selected {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

.demo__result { display: flex; flex-direction: column; gap: 16px; }
.demo__result > * { margin-bottom: 0; }

.demo__notes {
  margin: 0 0 12px;
  padding-left: 1.2em;
  font-size: 13px;
  color: var(--text-muted);
}

.demo__notes li { margin-bottom: 4px; }

/* ---------- 上位プランの案内 ---------- */
.upsell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  background: var(--brand-soft);
  border: 1px solid #c6ded1;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.upsell__body { flex: 1 1 340px; }
.upsell__title { font-weight: 700; margin: 0 0 4px; color: var(--brand-dark); }
.upsell__text { font-size: 14px; color: var(--text-muted); margin: 0; }

/* 数値を伏せた見本。項目の並びだけを見せる。 */
.locked {
  filter: blur(3px);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

/* ---------- フィルタ ---------- */
.filters {
  display: flex;
  gap: 10px 14px;
  flex-wrap: wrap;
  /* 説明文が付く項目とそうでない項目が混ざるので、下端ではなく上端で揃える。 */
  align-items: flex-start;
}

.filters .field { margin-bottom: 0; min-width: 160px; }

/* 解除リンクは、入力欄と同じ高さの行に置く。 */
.filters .btn-row { padding-top: 24px; }

/* ---------- ページネーション ---------- */
.pagination {
  display: flex;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  flex-wrap: wrap;
}

.pagination a, .pagination span {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  font-size: 13px;
  color: var(--text-muted);
}

.pagination .active span { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- その他 ---------- */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.muted { color: var(--text-muted); font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.divider { height: 1px; background: var(--border); margin: 20px 0; border: 0; }

details summary { cursor: pointer; font-size: 14px; color: var(--text-muted); }
details[open] summary { margin-bottom: 10px; }

/* ---------- プラン ---------- */
.plan-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.plan {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.plan__name {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--brand);
}

.plan__price {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.plan__price small { font-size: 13px; font-weight: 400; color: var(--text-muted); }

.plan__features {
  margin: 0 0 18px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}

.plan__features li { margin-bottom: 4px; }

/* ---------- 運営者向け ---------- */
.admin-bar {
  background: var(--info-soft);
  color: var(--info);
  border-bottom: 1px solid #c7dfee;
  padding: 8px 20px;
  font-size: 13px;
  text-align: center;
}

.admin-steps {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.9;
}

.admin-steps .muted { font-size: 13px; }

/* 運営者向けの画面どうしを行き来する帯。ヘッダーのナビは一般利用者と共通なので分ける。 */
.subnav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.subnav a {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
}

.subnav a:hover { border-color: #c9cfd6; color: var(--text); }

.subnav a[aria-current="page"] {
  background: var(--brand-soft);
  border-color: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}

/* ---------- AI返信案 ---------- */
.ai-gen {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--bg);
  margin-bottom: 12px;
}

.ai-gen:last-child { margin-bottom: 0; }

.ai-gen__meta {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.ai-gen__notes {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--warning);
}

.ai-gen__notes li { margin-bottom: 4px; }

