/* 店舗マスタ — 濃紺ダーク基調 + 青アクセント（プレビューと世界観を統一） */
:root {
  --bg: #070d1a;
  --bg2: #0c1730;
  --panel: #111d36;
  --panel2: #0b1528;
  --line: #22335a;
  --ink: #e9effc;
  --sub: #9db1d6;
  --faint: #64769c;
  --accent: #3b8cff;
  --accent2: #38bdf8;
  --grad: linear-gradient(135deg, #2563eb, #38bdf8);
  --gold: #b98a1c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  font-size: 18px;
  line-height: 1.65;
  background: radial-gradient(1200px 600px at 50% -80px, var(--bg2), var(--bg));
  background-color: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
.app-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: rgba(10, 19, 38, .92); color: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(6px);
}
.app-title { color: #fff; font-weight: 800; font-size: 19px; text-decoration: none; letter-spacing: .02em; }
.header-user { margin-left: auto; font-size: 14px; color: var(--sub); }
.header-logout { color: var(--accent2); font-size: 14px; }
.container { max-width: 720px; margin: 0 auto; padding: 16px 14px 110px; }
.page-title { font-size: 26px; margin: 6px 0 16px; }
.flashes { margin-bottom: 14px; }
.flash { background: rgba(34, 197, 94, .14); border: 1.5px solid rgba(34, 197, 94, .55);
  color: #b9f4cd; border-radius: 10px; padding: 12px 16px; margin: 0 0 8px; font-size: 16px; }

/* 下部固定ナビ */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; background: rgba(9, 16, 32, .97);
  border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.45); }
.bottom-nav a { flex: 1; text-align: center; color: var(--sub); text-decoration: none;
  font-size: 16px; font-weight: 700; padding: 15px 4px calc(15px + env(safe-area-inset-bottom)); }
.bottom-nav a.active { color: #fff; background: rgba(59, 140, 255, .18);
  box-shadow: inset 0 3px 0 var(--accent); }

/* ボタン類 */
.btn { display: inline-block; padding: 13px 20px; font-size: 17px; font-weight: 700;
  background: var(--panel); color: var(--ink); border: 1.5px solid var(--line);
  border-radius: 12px; text-decoration: none; text-align: center; cursor: pointer; }
.btn.primary { background: var(--grad); color: #fff; border: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .35); }
.btn.danger { border-color: #b3402e; color: #ff9a86; background: var(--panel); }
.btn.small { padding: 9px 14px; font-size: 15px; }
.btn.wide { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; align-items: center; }
.btn-row.top { margin-top: 0; }
.status-chip { display: inline-block; background: rgba(59, 140, 255, .15); color: #a9ccff;
  border: 1px solid rgba(59, 140, 255, .5); border-radius: 999px; padding: 2px 12px;
  font-size: 14px; font-weight: 700; }

/* 実績バッジ・スコア内訳 */
.stats-badge { display: inline-block; margin-top: 10px; padding: 5px 14px;
  background: rgba(59, 140, 255, .13); border: 1px solid rgba(59, 140, 255, .55);
  color: #9cc8ff; border-radius: 999px; font-size: 15px; font-weight: 800;
  letter-spacing: .01em; }
.score-breakdown { color: var(--sub); font-size: 14px; font-weight: 700; margin: -2px 0 8px; }
.card a .stats-badge, a.card .stats-badge { text-decoration: none; }

/* ホーム */
.home-sec { margin-bottom: 30px; }
.home-sec h2 { font-size: 21px; margin: 0 0 12px; }
.search-form.big input { padding: 17px 18px; font-size: 19px; }
.mini-card { display: flex; align-items: center; gap: 10px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px; margin-bottom: 10px;
  text-decoration: none; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.mini-name { font-size: 19px; font-weight: 800; }
.mini-owner { color: var(--faint); font-size: 14px; margin-left: auto; }
.empty-note { color: var(--sub); font-size: 16px; }
.cand-select { display: flex; gap: 8px; margin-bottom: 14px; }
.cand-select select { flex: 1; padding: 13px; font-size: 16px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel2); color: var(--ink); min-width: 0; }
.cand-select button { padding: 13px 20px; font-size: 16px; font-weight: 700;
  background: var(--grad); color: #fff; border: none; border-radius: 10px; }
.score-badge { display: inline-block; background: var(--grad); color: #fff; font-weight: 800;
  font-size: 15px; border-radius: 999px; padding: 3px 14px; margin-bottom: 8px;
  box-shadow: 0 3px 10px rgba(37, 99, 235, .4); }
.score-badge.big { font-size: 19px; padding: 5px 18px; }

/* カード内の比較チェック・比較バー・アクション */
.card-main { display: block; text-decoration: none; color: var(--ink); }
.cmp-check { display: flex; align-items: center; gap: 10px; font-size: 16px;
  color: var(--sub); cursor: pointer; }
.cmp-check input { width: 24px; height: 24px; accent-color: var(--accent); }
.cmp-check input:disabled { opacity: .35; }
.card > .cmp-check, .card-actions .cmp-check { margin-top: 0; }
.card > .cmp-check { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.card-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.compare-bar { position: sticky; bottom: 84px; margin-top: 18px; }
.compare-bar button { width: 100%; padding: 16px; font-size: 17px; font-weight: 800;
  background: var(--grad); color: #fff; border: none; border-radius: 12px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .45); }
.card-sub { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 10px; color: var(--sub); font-size: 15px; }

/* マッチング理由 */
.match-note { color: var(--sub); font-size: 15px; line-height: 1.7; margin-bottom: 16px; }
.reasons { margin-top: 12px; border-radius: 10px; padding: 10px 14px; }
.reasons.good { background: rgba(34, 197, 94, .12); }
.reasons.check { background: rgba(245, 158, 11, .12); }
.reasons-title { margin: 0 0 4px; font-weight: 800; font-size: 15px; }
.reasons ul { margin: 0; padding-left: 20px; }
.reasons li { font-size: 15px; line-height: 1.6; }

/* 月収シミュレーション */
.sim-block { border: 1px solid rgba(59, 140, 255, .45); }
.sim-controls { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.sim-controls label { font-size: 15px; font-weight: 700; color: var(--sub);
  display: flex; align-items: center; gap: 8px; }
.sim-controls input { width: 84px; padding: 11px 12px; font-size: 19px; font-weight: 800;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel2);
  color: var(--ink); text-align: center; }
.sim-cond { color: var(--sub); font-size: 15px; margin: 8px 0 2px; }
.sim-value { font-size: 31px; font-weight: 800; color: var(--accent2);
  margin: 2px 0 8px; letter-spacing: .01em; }
.sim-line { margin-top: 12px; font-size: 16px; color: var(--sub); font-weight: 700; }
.sim-line .sim-value { font-size: 21px; }
.sim-note { color: var(--faint); font-size: 13.5px; line-height: 1.6; margin: 6px 0 0; }

/* 提案 */
.proposal-text { width: 100%; padding: 14px; font-size: 16px; line-height: 1.75;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel2);
  color: var(--ink); font-family: inherit; resize: vertical; }
.proposal-card-img { width: 100%; max-width: 420px; display: block; margin: 4px auto 6px;
  border-radius: 14px; border: 1px solid var(--line); }
.copy-done { color: #7ce6a3; font-weight: 800; font-size: 15px; }

/* 比較表（画面幅に収まる固定レイアウト・横スクロールなし） */
.compare-wrap { background: var(--panel); border-radius: 14px;
  border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.compare-table { border-collapse: collapse; width: 100%; table-layout: fixed;
  font-size: 13px; }
.compare-table th, .compare-table td { padding: 9px 7px; text-align: left;
  border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.5;
  overflow-wrap: anywhere; word-break: break-word; }
.compare-table thead th { background: #16264a; color: #fff; font-size: 14px; }
.compare-table thead th a { color: #fff; }
.compare-table .row-head { background: #131f3a;
  font-weight: 700; color: var(--sub); font-size: 12px; }
.compare-table thead .row-head { background: #16264a; color: #fff; }
.cmp-meta { font-size: 11px; font-weight: 400; opacity: .85; }

/* フォーム（候補者・管理者） */
.edit-form { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 18px; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.edit-form label { display: block; font-size: 16px; font-weight: 700; color: var(--ink);
  margin-bottom: 16px; }
.edit-form input[type="text"], .edit-form input[type="number"], .edit-form input[type="password"],
.edit-form select, .edit-form textarea { width: 100%; margin-top: 6px; padding: 13px;
  font-size: 17px; font-weight: 400; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel2); color: var(--ink); font-family: inherit; }
.edit-form fieldset { border: 1px solid var(--line); border-radius: 9px;
  margin: 0 0 16px; padding: 10px 14px; }
.edit-form legend { font-size: 16px; font-weight: 700; color: var(--ink); padding: 0 6px; }
.check-line { display: flex !important; align-items: center; gap: 10px;
  font-weight: 400 !important; margin-bottom: 8px !important; }
.check-line input { width: 24px; height: 24px; accent-color: var(--accent); }
.edit-form.compact { box-shadow: none; padding: 0; border: none; background: transparent; }

/* 管理者 */
.admin-shop-list { list-style: none; margin: 0; padding: 0; }
.admin-shop-list li { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 17px; }
.admin-shop-list li:last-child { border-bottom: none; }
.admin-user { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.admin-user:last-of-type { border-bottom: none; }
.admin-user-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.admin-user-head strong { font-size: 18px; }
.user-meta { color: var(--faint); font-size: 14px; }
.admin-user-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.pw-form { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.pw-form input { flex: 1; padding: 9px 12px; font-size: 15px; border: 1px solid var(--line);
  border-radius: 8px; min-width: 0; background: var(--panel2); color: var(--ink); }
.admin-sub { font-size: 17px; margin: 22px 0 10px; }

/* 閲覧履歴 */
.log-list { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 8px 18px; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.log-row { display: flex; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line);
  font-size: 16px; flex-wrap: wrap; }
.log-row:last-child { border-bottom: none; }
.log-time { color: var(--faint); font-size: 14px; }
.log-user { font-weight: 700; }

/* ログイン */
.login-box { max-width: 380px; margin: 48px auto 0; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px;
  box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.login-box h1 { margin: 0 0 4px; font-size: 26px; }
.login-sub { margin: 0 0 20px; color: var(--faint); font-size: 14px; }
.login-form label { display: block; margin-bottom: 14px; font-size: 15px; }
.login-form input { width: 100%; padding: 12px; font-size: 17px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); color: var(--ink); }
.login-form button { width: 100%; padding: 13px; font-size: 17px; font-weight: 700;
  background: var(--grad); color: #fff; border: none; border-radius: 8px; }
.error { color: #ff9a86; font-size: 15px; }

/* 一覧 */
.search-form { display: flex; gap: 8px; margin-bottom: 14px; }
.search-form input { flex: 1; padding: 15px 16px; font-size: 18px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); color: var(--ink); }
.search-form input::placeholder { color: var(--faint); }
.search-form button { padding: 15px 22px; font-size: 17px; font-weight: 700;
  background: var(--grad); color: #fff; border: none; border-radius: 12px; }
.chips { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; align-items: center; }
.chip { white-space: nowrap; padding: 12px 20px; border-radius: 999px;
  background: var(--panel); border: 1.5px solid var(--line); color: var(--sub);
  text-decoration: none; font-size: 16px; line-height: 1.2; }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; font-weight: 700; }
.count { color: var(--sub); font-size: 15px; margin: 10px 2px 14px; }
.count strong { font-size: 22px; color: #fff; }
.count span { color: var(--faint); font-size: 14px; }
.cards { display: flex; flex-direction: column; gap: 18px; }
.card { display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px; text-decoration: none; color: var(--ink);
  box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.card-name { font-size: 25px; font-weight: 800; letter-spacing: .01em; }
.card-meta { color: var(--sub); font-size: 16px; margin-top: 3px; }
.card-pay { font-size: 20px; font-weight: 800; color: var(--accent2); margin-top: 10px; }
.card-daily { color: var(--sub); font-size: 16px; margin-top: 3px; }
.empty { color: var(--sub); text-align: center; padding: 40px 0; font-size: 17px; line-height: 1.8; }

/* 詳細 */
.back { color: var(--accent2); text-decoration: none; font-size: 15px; }
.shop-name { font-size: 27px; margin: 10px 0 2px; }
.shop-meta { color: var(--sub); margin: 0 0 18px; }
.block { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; margin-bottom: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.block h2 { font-size: 19px; margin: 0 0 12px; padding: 10px 14px;
  background: linear-gradient(135deg, #1b3263, #14264c); color: #fff;
  border-radius: 9px; letter-spacing: .02em; }
.block.internal { border: 2px solid var(--gold); background: #221d0e; }
.block.internal h2 { background: #8a6d1c; }
.block dl { margin: 0; }
.row { display: flex; gap: 14px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; padding-bottom: 2px; }
.row dt { flex: 0 0 116px; color: var(--sub); font-size: 16px; font-weight: 700; }
.row dd { margin: 0; flex: 1; min-width: 0; line-height: 1.7; overflow-wrap: anywhere; }
.row dd.pr { white-space: pre-wrap; }
.raw { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 18px; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.raw summary { font-weight: 700; cursor: pointer; }
.raw pre { white-space: pre-wrap; word-break: break-word; font-size: 14px;
  font-family: inherit; margin: 12px 0 4px; color: var(--sub); }

html, body { overflow-x: clip; }

/* エリア選択（地域グループ＋ピル型チェック） */
.area-group { margin: 4px 0 10px; }
.area-group-name { font-size: 13px; font-weight: 700; color: var(--accent2);
  letter-spacing: .08em; margin: 10px 0 6px; }
.pill-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-check { position: relative; display: inline-block; margin: 0 !important; }
.pill-check input { position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; margin: 0; cursor: pointer; }
.pill-check span { display: inline-block; padding: 8px 14px; font-size: 14px;
  font-weight: 400; color: var(--ink); background: var(--panel2);
  border: 1.5px solid var(--line); border-radius: 999px; }
.pill-check:has(input:checked) span { background: var(--accent);
  border-color: var(--accent); color: #fff; font-weight: 700; }

/* ホームのプリセット条件・エリ�ア別店舗数ピル */
.preset-pill { display: inline-block; padding: 8px 14px; font-size: 14px;
  color: var(--ink); background: var(--panel2);
  border: 1.5px solid var(--line); border-radius: 999px; text-decoration: none; }
.preset-pill .cnt { color: var(--accent2); font-weight: 700; }

.preset-pill.active { background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 700; }
.region-row { align-items: center; margin-bottom: 10px; }
.region-label { font-size: 13px; font-weight: 700; color: var(--accent2);
  letter-spacing: .08em; margin-right: 2px; white-space: nowrap; flex: none; }

/* エリアタブの地域色分け */
.rg-tokyo { --rg: #3b8cff; }
.rg-nagoya { --rg: #2fbf9a; }
.rg-osaka { --rg: #ff9f43; }
.rg-kyoto { --rg: #a78bfa; }
.rg-other { --rg: #8b98b8; }
.chip[class*="rg-"] { border-color: var(--rg);
  background: color-mix(in srgb, var(--rg) 15%, transparent); }
.chip[class*="rg-"].active { background: var(--rg); border-color: var(--rg); color: #fff; }
.preset-pill[class*="rg-"] { border-color: var(--rg);
  background: color-mix(in srgb, var(--rg) 15%, transparent); }
.preset-pill[class*="rg-"].active { background: var(--rg); border-color: var(--rg); color: #fff; }
.preset-pill[class*="rg-"] .cnt { color: var(--rg); }
.preset-pill[class*="rg-"].active .cnt { color: #fff; }
.area-group-name[class*="rg-"] { color: var(--rg); }
.pill-check[class*="rg-"] span { border-color: var(--rg); }
.pill-check[class*="rg-"]:has(input:checked) span { background: var(--rg);
  border-color: var(--rg); color: #fff; }
