/*
 * ミニアプリの見た目。診断の持ち方 3.1「画面の作り込み」（2026-11-01 ユーザーの指摘）。
 * シンプルなまま、安っぽく見えないようにする: 角丸は小さく（4px、大きい面も 6px まで）、影をやめて 1px の線、
 * 文字は 本文 15px・画面の見出し 22px・区切りの見出し 16px・注意書き 12px。上に深緑の帯、下に固定のタブ。
 * 色は変数にまとめる（ブランドの色は同じ文書の表）。アクセントの #55A38A は白の上の文字に使わない（コントラストが足りない）。
 */

:root {
  color-scheme: light;
  --bg: #f6f8f6;
  --surface: #ffffff;
  --text: #26302c;
  --muted: #5a6661;
  --line: #d9e0dd;
  --accent: #2b5346;
  --accent-strong: #1f3f35;
  --accent-soft: #e6ede9;
  --accent-ink: #ffffff;
  --accent-ink-soft: #d9e0dd;
  --beige: #d9c9a8;
  /* 目盛りの問いの色（左＝明るい緑、右＝明るい琥珀。パッと見で左右が分かるように強い色。文字は少し濃くして読めるように。2026-11-01 ユーザーの指摘） */
  --scale-left: #3fae8a;
  --scale-left-ink: #227a5c;
  --scale-right: #f0a53a;
  --scale-right-ink: #b66d12;
  --danger: #a3261e;
  --danger-soft: #fbeceb;
  --notice: #fff4c2;
  --radius: 6px;
  --radius-sm: 4px;
  --fs-body: 15px;
  --fs-h1: 22px;
  --fs-h2: 16px;
  --fs-small: 12px;
  --gutter: 16px;
  --header-h: 44px;
  --tabbar-h: 56px;
  --banner-h: 0px; /* 検証用の帯の高さ（main.js が入れる） */
  /* 問いの画面で、絵のほかに要る高さ: 帯 44＋余白 4＋戻る 36＋進み具合 3＋問いの文 51＋選択肢の文 2 つ 80＋すき間 38＋下の余白 12 */
  --quiz-chrome: 268px;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  /* 上の帯（と検証用の帯）は固定なので、そのぶん中身を下げる */
  padding-top: calc(var(--banner-h) + var(--header-h) + env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

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

a { color: var(--accent-strong); text-underline-offset: 3px; }

h1, h2, p, ul, figure { margin: 0; }

h1 { font-size: var(--fs-h1); line-height: 1.4; letter-spacing: 0.01em; }
h1:focus { outline: none; }

.app {
  flex: 1 0 auto;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--gutter) var(--gutter) calc(24px + env(safe-area-inset-bottom));
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: 12px;
  outline: none;
}
.has-tabs .app { padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }

.env-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 3px var(--gutter);
  background: var(--notice);
  color: #4a3d00;
  font-size: var(--fs-small);
  line-height: 1.5;
  text-align: center;
}

/* ---- 上の帯・下のタブ（どちらも固定。中身だけが動く。2026-11-01 ユーザー判断） ---- */

.app-header {
  position: fixed;
  top: var(--banner-h);
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--gutter) 0;
  background: var(--accent-strong);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.app-header-icon { flex: none; width: 26px; height: 26px; border-radius: var(--radius-sm); background: var(--surface); }
/* 文字は 1 行（幅 320px でも収まる長さ）。診断の名前は 418BASE の横に */
.app-header-title { min-width: 0; white-space: nowrap; }
.app-header-brand { letter-spacing: 0.08em; }
.app-header-name { margin-left: 4px; }

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tabbar[hidden] { display: none; }
.tab {
  flex: 1 1 0;
  max-width: 140px;
  height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.tab-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--accent); font-weight: 700; box-shadow: inset 0 2px 0 var(--accent); }
.tab[aria-current="page"] .tab-icon { stroke-width: 2; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---- 見出し・文 ---- */

.page-header { display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; }
.brand { font-size: var(--fs-small); font-weight: 700; letter-spacing: 0.12em; color: var(--accent); }
.eyebrow { font-size: var(--fs-small); font-weight: 700; color: var(--accent); }
.lead { color: var(--muted); }
.muted { color: var(--muted); font-size: var(--fs-small); }
.error-code { color: var(--muted); font-size: var(--fs-small); text-align: center; }
.noscript { padding: 24px var(--gutter); }

/* ---- 機能のカード（ホーム・一覧。絵は 3:2） ---- */

.tool-card { padding-top: 0; overflow: hidden; }
.tool-image { width: calc(100% + 32px); max-width: none; margin: 0 -16px 4px; aspect-ratio: 3 / 2; object-fit: cover; background: var(--accent-soft); }
.tool-card.is-coming-soon { background: var(--surface); }
.tool-card.is-coming-soon .tool-image { opacity: 0.55; }
.tool-card.is-coming-soon .card-title { color: var(--muted); }

/* ---- ホームの診断の入口（4 つの機能の小さな絵を 2×2 に → /tools。診断のカードは診断のページだけ） ---- */

.home-tools { padding-top: 0; overflow: hidden; }
.tool-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: calc(100% + 32px); margin: 0 -16px 4px; background: var(--line); }
.tool-thumb { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--accent-soft); }
.tool-thumb.is-coming-soon { opacity: 0.55; }

/* ---- カード（区切り） ---- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-muted { background: transparent; }
.card-muted p { color: var(--muted); }
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--accent-strong);
  font-size: var(--fs-h2);
  line-height: 1.5;
}

/* 枠なしの区切り（中にカードを並べるとき） */
.section-plain { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }

.badge {
  flex: none;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1.6;
}

.facts { padding-left: 1.2em; color: var(--muted); }
.resume, .last-result { font-weight: 700; }
.provisional-note { font-size: var(--fs-small); color: var(--muted); text-align: center; }

.menu-list { list-style: none; padding: 0; display: flex; flex-direction: column; }
.menu-list li + li { border-top: 1px solid var(--line); }
.menu-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}
.menu-list a::after { content: "›"; color: var(--muted); font-size: 20px; line-height: 1; }

/* ---- ボタン ---- */

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

.btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  font: inherit;
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease;
}
.btn:focus-visible, .option:focus-visible, .back-button:focus-visible, .next-card:focus-visible, .neighbor:focus-visible { outline: 2px solid #1a73e8; outline-offset: 2px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:active { background: var(--accent-strong); }
.btn-secondary { background: var(--surface); color: var(--accent-strong); }
.btn-secondary:active { background: var(--accent-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent-strong); min-height: 44px; text-decoration: underline; text-underline-offset: 4px; font-weight: 600; }
.btn-note { font-size: var(--fs-small); font-weight: 600; }

.sticky-actions {
  position: sticky;
  bottom: 0;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(246, 248, 246, 0), var(--bg) 30%);
}

/* ---- 設問（タブを出さない。帯と進み具合だけ） ---- */

.is-focus .app { padding-top: 4px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); gap: 8px; }

.quiz-bar { display: flex; align-items: center; justify-content: space-between; min-height: 36px; margin-bottom: -4px; }
.back-button {
  min-height: 36px;
  padding: 0 12px 0 0;
  border: none;
  background: none;
  color: var(--accent-strong);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.progress-label { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress { height: 3px; background: var(--line); overflow: hidden; }
.progress-fill { display: block; height: 100%; background: var(--accent); transition: width 0.25s ease; }

.question-header { display: flex; flex-direction: column; gap: 2px; }
.question-header .eyebrow { line-height: 1.5; }
.question-text { font-size: var(--fs-h1); line-height: 1.4; }
.question-image { border-radius: var(--radius-sm); }

.options { display: flex; flex-direction: column; gap: 8px; }
.option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 52px;
  padding: 12px 44px 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.option:active { background: var(--accent-soft); }
.option-mark {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 1px solid #8a9690;
  border-radius: 50%;
  background: var(--surface);
}
.option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.option[aria-pressed="true"] .option-mark { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--accent-soft); }
.option-note { font-size: var(--fs-small); font-weight: 400; line-height: 1.6; color: var(--muted); }

/*
 * 絵で選ぶ問い: 2 枚を縦に並べて 1 画面に収める（絵は 3:2）。
 * 背の低い画面（LINE の中のスマホ・高さ 667px など）では、枠の高さを画面に合わせて縮める（切り抜くだけで、絵は歪まない）。
 * 枠の幅 100% は変えない。dvh を読めない古い端末は 100vh のまま
 */
.options-images .option { padding: 0; gap: 0; min-height: 0; overflow: hidden; }
.option-image {
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: max(132px, calc((100vh - var(--banner-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--quiz-chrome)) / 2));
  max-height: max(132px, calc((100dvh - var(--banner-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--quiz-chrome)) / 2));
  object-fit: cover;
  background: var(--accent-soft);
}
.options-images .option-text { width: 100%; padding: 8px 40px 8px 12px; line-height: 1.5; }
.options-images .option-mark { top: auto; bottom: 11px; right: 12px; margin-top: 0; }

/* ---- 目盛りの問い（家づくりタイプ診断。両端に言葉、同じ大きさの正円 4 つ。左 2 つが深緑・右 2 つが茶。外側は濃く、内側は薄く） ---- */

.scale { gap: 10px; padding-top: 8px; }
.scale-labels { display: flex; justify-content: space-between; gap: 12px; }
.scale-label { flex: 1 1 0; font-size: 13px; font-weight: 700; line-height: 1.5; }
.scale-label.is-left { color: var(--scale-left-ink); text-align: left; }
.scale-label.is-right { color: var(--scale-right-ink); text-align: right; }
.scale-dots { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px; }
.scale-dot {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  min-height: 0;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  border: 4px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.scale-dot.is-left { border-color: var(--scale-left); }
.scale-dot.is-right { border-color: var(--scale-right); }
.scale-dot.is-left.is-lean { border-color: rgba(63, 174, 138, 0.5); }
.scale-dot.is-right.is-lean { border-color: rgba(240, 165, 58, 0.5); }
.scale-dot[aria-pressed="true"].is-left { background: var(--scale-left); border-color: var(--scale-left); }
.scale-dot[aria-pressed="true"].is-right { background: var(--scale-right); border-color: var(--scale-right); }
.scale-dot[aria-pressed="true"].is-lean { box-shadow: inset 0 0 0 6px var(--surface); }
.scale-dot:focus-visible { outline: 2px solid #1a73e8; outline-offset: 2px; }

/* ---- 家づくりタイプ診断のレポート（レーダーチャート・横棒・こだわり・妥協点） ---- */

.cover-sub { margin-top: 6px; font-size: 14px; color: var(--accent-ink-soft); }
.radar { display: block; width: 100%; max-width: 400px; height: auto; margin: 0 auto; }
.radar-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.radar-axis { stroke: var(--line); stroke-width: 1; }
.radar-shape { fill: rgba(43, 83, 70, 0.22); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.radar-dot { fill: var(--accent); }
.radar-label { font-size: 13px; font-weight: 700; fill: var(--text); }
.radar-label-pct { font-weight: 400; fill: var(--muted); }
.score-bars { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.score-bar { display: grid; grid-template-columns: 5.5em 1fr 3em; align-items: center; gap: 8px; font-size: 13px; }
.score-bar-label { font-weight: 700; }
.score-bar-track { display: block; height: 10px; border-radius: 5px; background: var(--accent-soft); overflow: hidden; }
.score-bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.score-bar-pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.score-bar.is-strong .score-bar-label { color: var(--accent-strong); }
.score-bar.is-flexible .score-bar-fill { background: var(--beige); }
.score-bar.is-flexible .score-bar-label { color: var(--muted); }
.axis-block { display: flex; flex-direction: column; gap: 6px; }
.axis-block + .axis-block { padding-top: 10px; border-top: 1px solid var(--line); }
.axis-title { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: var(--fs-h2); line-height: 1.5; color: var(--accent-strong); }
.axis-tagline { font-size: 13px; font-weight: 400; color: var(--muted); }
.fit-lead { font-weight: 700; color: var(--accent-strong); }
.ask-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ask-item { padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface); font-weight: 700; line-height: 1.6; }

/* ---- 見直し ---- */

.check { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.review { list-style: none; padding: 0; }
.review-row {
  display: grid;
  grid-template-columns: 5.5em 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 0;
}
.review-row + .review-row { border-top: 1px solid var(--line); }
.review-label { color: var(--muted); font-size: 13px; }
.review-value { font-weight: 700; }
.review-edit { font-size: 13px; padding: 8px 4px; }

/* ---- 読み込み・分析中 ---- */

.loading { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 64px 0; color: var(--muted); }
.analyzing .loading { padding: 120px 0; font-size: 16px; font-weight: 700; color: var(--text); }
.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
}

/* ---- レポート・紹介ページ ---- */

/* 表紙の帯: 画面の端まで深緑の面（上の帯より少し明るい色で続ける） */
.cover {
  margin: calc(var(--gutter) * -1) calc(var(--gutter) * -1) 0;
  padding: 24px var(--gutter) 28px;
  background: var(--accent);
  color: var(--accent-ink);
  text-align: center;
}
.cover-label { font-size: var(--fs-small); font-weight: 700; letter-spacing: 0.24em; color: var(--beige); }
.cover-label::after { content: ""; display: block; width: 24px; height: 1px; margin: 10px auto 12px; background: var(--beige); }
.cover-name { font-size: 28px; line-height: 1.35; letter-spacing: 0.04em; }
.cover-date { margin-top: 8px; font-size: var(--fs-small); color: var(--accent-ink-soft); }

/* 部屋の写真: 表紙の帯に続けて、画面の端まで */
.result-figure { margin: -12px calc(var(--gutter) * -1) 4px; background: var(--surface); }
.result-image { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.result-image.is-placeholder { object-fit: contain; padding: 32px; background: var(--accent-soft); }
.result-caption { padding: 8px 12px; font-size: var(--fs-small); color: var(--muted); text-align: center; }

.points { padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.points li::marker { color: var(--accent); }

/* おすすめアイテム（帯の絵と名前）・おすすめカラー（丸を画面で描く） */
.items-image { width: 100%; height: auto; }
.items { list-style: none; padding: 0; display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.item + .item { border-top: 1px solid var(--line); }
.item-image { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.palette { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; text-align: center; }
.palette-item { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.palette-swatch { display: block; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background-size: cover; background-position: center; }
.palette-name { font-size: var(--fs-small); line-height: 1.4; color: var(--muted); text-wrap: balance; }

/* 次の一歩: ボタンの並びでなく、大きなカード（名前・一言・矢印）。押せるものの 1 つ目を深緑の面で */
.next-cards { display: flex; flex-direction: column; gap: 8px; }
.next-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease;
}
a.next-card:active { background: var(--accent-soft); }
.next-card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.next-card-title { font-size: 16px; font-weight: 700; line-height: 1.5; color: var(--accent-strong); }
.next-card-desc { font-size: 13px; line-height: 1.6; color: var(--muted); }
.phrase { display: inline-block; }
.next-card-note { font-size: var(--fs-small); font-weight: 700; color: var(--accent-strong); }
.next-card-arrow { flex: none; width: 9px; height: 9px; margin-right: 3px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: rotate(45deg); }
.next-card.is-primary { min-height: 84px; border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
a.next-card.is-primary:active { background: var(--accent-strong); }
.next-card.is-primary .next-card-title { font-size: 17px; color: var(--accent-ink); }
.next-card.is-primary .next-card-desc { color: var(--accent-ink-soft); }
.next-card.is-primary .next-card-note { color: var(--beige); }
.next-card.is-primary .next-card-arrow { border-color: var(--accent-ink); }
.next-card.is-coming-soon { background: var(--bg); cursor: not-allowed; }
.next-card.is-coming-soon .next-card-title { color: var(--muted); }

/* 近いスタイル */
.neighbors { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.neighbor { display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); text-decoration: none; }
.neighbor-image { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--accent-soft); }
.neighbor-text { display: flex; flex-direction: column; padding: 6px 8px 8px; }
.neighbor-label { font-size: var(--fs-small); line-height: 1.5; color: var(--muted); }
.neighbor-name { font-size: var(--fs-body); font-weight: 700; line-height: 1.5; }
.share-status { font-size: var(--fs-small); color: var(--muted); min-height: 1em; }

.advice { display: flex; flex-direction: column; gap: 10px; }
.advice + .advice { border-top: 1px solid var(--line); padding-top: 10px; }

/* ---- 履歴 ---- */

.history { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
}
.history-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-h2); font-weight: 700; }
.history-meta { font-size: var(--fs-small); color: var(--muted); }

/* ---- 資金シミュレーション（pages/sim-budget.js） ---- */

.sim-result { gap: 12px; }
.sim-headline { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 2px; }
.sim-headline-label { font-size: var(--fs-small); font-weight: 700; letter-spacing: 0.08em; color: var(--accent); }
.sim-headline-value { font-size: 32px; font-weight: 700; line-height: 1.25; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.sim-basis { font-size: var(--fs-small); line-height: 1.6; color: var(--muted); text-align: center; }
.sim-invalid { padding: 16px 0; font-weight: 700; color: var(--danger); text-align: center; }
.sim-facts { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; }
.sim-facts dt { font-size: 13px; color: var(--muted); }
.sim-facts dd { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sim-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sim-table-caption { padding-bottom: 6px; text-align: left; font-weight: 700; color: var(--accent-strong); caption-side: top; }
.sim-table th, .sim-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; vertical-align: middle; }
.sim-table thead th { font-size: var(--fs-small); color: var(--muted); }
.sim-table th[scope="row"] .badge { margin-left: 6px; vertical-align: middle; }
.sim-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sim-table .is-basis th, .sim-table .is-basis td { font-weight: 700; color: var(--accent-strong); }

.sim-field { display: flex; flex-direction: column; gap: 4px; }
.sim-field + .sim-field { padding-top: 10px; border-top: 1px solid var(--line); }
.sim-field-label { font-size: 13px; font-weight: 700; }
.sim-field-note { font-weight: 400; color: var(--muted); }
.sim-input-wrap { display: flex; align-items: center; gap: 8px; }
.sim-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 17px; /* 16px 未満だと iOS が入力のときに画面を拡大する */
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sim-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.sim-input[aria-invalid="true"] { border-color: var(--danger); }
.sim-unit { flex: none; min-width: 2.5em; font-size: 13px; color: var(--muted); }
.sim-field-error { font-size: var(--fs-small); font-weight: 700; color: var(--danger); }
.sim-field-error[hidden] { display: none; }

.sim-prefill { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 0 2px; font-size: 13px; color: var(--muted); }
.link-button { padding: 0; border: none; background: none; color: var(--accent-strong); font: inherit; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sim-save-note { font-size: var(--fs-small); line-height: 1.7; color: var(--muted); }
.sim-save-status { display: flex; flex-direction: column; gap: 8px; }
.sim-save-status:empty { display: none; }
.sim-input-group { display: flex; flex-direction: column; gap: 6px; }
.sim-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sim-input-group + .sim-input-group { padding-top: 10px; border-top: 1px solid var(--line); }
.sim-group-title { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.sim-note { font-size: var(--fs-small); color: var(--muted); text-align: center; }

/* ---- 接続テスト（/diag。開発用・検証用のビルドだけ） ---- */

.diag-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.diag-head .card-title { flex: 1 1 100%; }
.diag-badge {
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}
.diag-badge.is-ok { background: #e3f4e6; color: #1d6b2c; }
.diag-badge.is-ng { background: var(--danger-soft); color: var(--danger); }
.diag-badge.is-wait { background: var(--line); color: var(--muted); }
.diag-ms { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.diag-body { display: flex; flex-direction: column; gap: 8px; }
.diag-message { font-weight: 700; }
.diag-rows {
  display: grid;
  grid-template-columns: minmax(7em, auto) 1fr;
  gap: 4px 12px;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}
.diag-rows dt { color: var(--muted); }
.diag-rows dd { margin: 0; overflow-wrap: anywhere; }
.diag-summary {
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: var(--fs-small);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  -webkit-user-select: text;
  user-select: text;
}

/* ---- 新着の土地情報（src/pages/land.js。2026-11-23） ---- */

.option.is-multi .option-mark { border-radius: var(--radius-sm); }
.option.is-multi[aria-pressed="true"] .option-mark { box-shadow: none; }
.option.is-multi[aria-pressed="true"] .option-mark::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
  border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.land-step { display: flex; flex-direction: column; gap: 12px; }
.options.land-grid { display: grid; grid-template-columns: 1fr 1fr; }
.land-grid .option { min-height: 48px; padding: 10px 36px 10px 12px; }
.land-grid .option-mark { right: 10px; }
.land-area { display: flex; flex-direction: column; gap: 4px; }
.land-area + .land-area { margin-top: 8px; }
.land-towns { margin: 0 0 4px 12px; }
.land-towns > summary { padding: 8px 2px; font-size: 13px; font-weight: 700; color: var(--accent-strong); cursor: pointer; }
.land-towns .options { padding: 4px 0 8px; }
.land-towns .option { min-height: 44px; padding-top: 8px; padding-bottom: 8px; font-weight: 400; }
.land-count { font-size: 13px; color: var(--muted); }
.land-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.badge-on { background: var(--accent); color: var(--accent-ink); }
.badge-off { background: var(--line); color: var(--text); }
.land-confirm { font-weight: 700; line-height: 1.7; }
.land-seed { padding: 0 2px; font-size: 13px; color: var(--muted); }
.land-estimate { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.land-estimate-count { font-weight: 700; }
.notice-box { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }
/* 市 → 町 → 字（2026-11-23） */
.land-area-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 8px; }
.land-area-chips .muted { width: 100%; }
.land-chip { min-height: 36px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.land-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.land-search { width: 100%; min-height: 44px; margin: 4px 0 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; font-size: 16px; }
.land-groups { display: flex; flex-direction: column; gap: 6px; }
.land-kana-rows { display: flex; flex-direction: column; gap: 6px; }
.land-kana { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.land-kana > .land-kana-row { padding: 12px 14px; font-weight: 700; cursor: pointer; }
.land-kana > .land-groups { padding: 0 10px 10px; }
.land-kana[hidden], .land-group[hidden] { display: none; }
.land-group { display: flex; flex-direction: column; gap: 2px; }
.option[aria-disabled="true"] { opacity: 0.55; cursor: default; }
.gift-card .card-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.land-map { width: 100%; height: 60vh; min-height: 320px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.land-map-until { display: inline-block; margin-top: 4px; padding: 4px 10px; border-radius: var(--radius-sm); background: var(--notice); font-size: 13px; font-weight: 700; }
.land-map-list { padding-left: 1.2em; font-size: 14px; line-height: 1.8; }
.gift-region-note { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--notice); font-size: 13px; font-weight: 700; line-height: 1.6; }

/* 配信の設定（/settings。2026-11-23）: ふつうのチェックボックス（押せる面は行ぜんたい）。すべて を選ぶと、ほかの行は選んだ状態で押せない */
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 700;
  line-height: 1.5;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.check-input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.check-input:focus-visible { outline: 2px solid #1a73e8; outline-offset: 2px; }
.check-row.is-disabled { color: var(--muted); background: var(--bg); cursor: default; }
.settings-notes { margin: 12px 0 0; font-size: 13px; line-height: 1.7; }
.settings-land-name { font-size: var(--fs-body); font-weight: 700; color: var(--text); }
.settings-save { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }

/* ---- お問い合わせ（src/pages/inquiry.js。2026-11-23） ---- */
.iq-input { text-align: left; font-weight: 400; }
.iq-select { appearance: auto; }
.iq-textarea { min-height: 7.5em; line-height: 1.6; resize: vertical; }
.iq-date-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.iq-land-sent { display: inline-block; margin-left: 8px; padding: 1px 6px; border-radius: 4px; background: var(--notice); font-size: 11px; font-weight: 700; vertical-align: middle; }
.iq-required { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-strong); font-size: 11px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
