/* 画面共通のスタイル。トークンは tokens.css 側で定義する。 */

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 {
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 700;
}

p { margin: 0; }
a { color: inherit; }

/* 数字は必ず等幅で。カウントダウンの桁が揺れると道具として安っぽくなる */
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ---------------------------------------------------------------- 骨格 */

.shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-8);
}

.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-6); }
.stack-sm > * + * { margin-top: var(--space-2); }

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
}
.wordmark b { color: var(--tier); transition: color var(--dur) var(--ease-out); }

.page-title {
  font-size: var(--text-xl);
  text-wrap: balance;
}

.lede {
  color: var(--ink-soft);
  font-size: var(--text-md);
  text-wrap: pretty;
}

.meta {
  color: var(--ink-faint);
  font-size: var(--text-sm);
}

/* ---------------------------------------------------------------- 倍率の計器 */

/*
 * 画面の主役。数字より先に「色の温度」で今の状態を伝えたいので、
 * 面ごと tier の色で染める。
 */
.gauge {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--tier-edge);
  background: var(--tier-soft);
  padding: var(--space-5) var(--space-5) var(--space-4);
  transition: background var(--dur-slow) var(--ease-out),
              border-color var(--dur-slow) var(--ease-out);
}

.gauge-label {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--tier);
  transition: color var(--dur-slow) var(--ease-out);
}

.gauge-figure {
  display: flex;
  align-items: baseline;
  gap: 0.1em;
  margin-top: var(--space-1);
  color: var(--tier);
  transition: color var(--dur-slow) var(--ease-out);
}

.gauge-value {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.04em;
}

.gauge-unit {
  font-size: var(--text-lg);
  font-weight: 700;
}

.gauge-note {
  margin-top: var(--space-3);
  color: var(--ink-soft);
  font-size: var(--text-sm);
}
.gauge-note strong { color: var(--ink); }

/* 残り時間を物理的に減っていく帯として見せる */
.gauge-track {
  margin-top: var(--space-3);
  height: 6px;
  border-radius: var(--radius-pill);
  background: color-mix(in oklch, var(--tier) 16%, transparent);
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--tier);
  transform-origin: left center;
  /* 幅ではなく transform を動かす。レイアウトを起こさないため */
  transform: scaleX(var(--fill, 1));
  transition: transform 1s linear, background var(--dur-slow) var(--ease-out);
}

.gauge-countdown {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--ink-soft);
}
.gauge-countdown b {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-md);
  color: var(--tier);
}

/* 残り1時間を切ったら脈を打たせる。動かすのは opacity だけ */
.gauge[data-urgent="true"] .gauge-value {
  animation: pulse 2.4s var(--ease-out) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.62; }
}

/* ---------------------------------------------------------------- 面 */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.card-flush { padding: 0; overflow: hidden; }

.callout {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper-sunk);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--ink-soft);
}
.callout-tier {
  border-color: var(--tier-edge);
  background: var(--tier-soft);
}
.callout strong { color: var(--ink); }

/* ---------------------------------------------------------------- 候補日と○▲× */

.date-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.date-row {
  display: grid;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-4);
  border-bottom: 1px solid var(--line);
}
.date-row:last-child { border-bottom: 0; }

/* 広い画面では日付と選択肢を横に並べる。狭い画面では縦積み */
@media (min-width: 34rem) {
  .date-row {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.date-when {
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.date-when .at-time { color: var(--ink-faint); font-weight: 500; }
.date-sub { font-size: var(--text-sm); color: var(--ink-faint); }

/* 3分割のセグメント。中身は radio なのでキーボードと読み上げがそのまま効く */
.choice {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--paper-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 13.5rem;
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice label {
  display: grid;
  place-items: center;
  /* 親指で押す前提の当たり判定 */
  min-height: 2.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--ink-faint);
  cursor: pointer;
  user-select: none;
  background: transparent;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}

@media (hover: hover) {
  .choice label:hover { background: var(--surface); color: var(--ink-soft); }
}
.choice label:active { transform: scale(0.96); }

.choice input:focus-visible + label {
  outline: 2px solid var(--tier);
  outline-offset: 2px;
}

.choice input:checked + label {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.choice input[value="maru"]:checked + label { color: var(--maru); background: var(--maru-soft); }
.choice input[value="sankaku"]:checked + label { color: var(--sankaku); background: var(--sankaku-soft); }
.choice input[value="batsu"]:checked + label { color: var(--batsu); background: var(--batsu-soft); }

/* 未選択が残っているときに目印を出す */
.date-row[data-answered="false"] .choice {
  border-color: var(--line-strong);
  border-style: dashed;
}

/* ---------------------------------------------------------------- 操作 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.875rem;
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--tier); outline-offset: 2px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--tier);
  color: var(--paper);
  box-shadow: var(--shadow);
}
@media (hover: hover) {
  .btn-primary:not([disabled]):hover { box-shadow: var(--shadow-lg); }
}

.btn-outline { border-color: var(--line-strong); }
@media (hover: hover) {
  .btn-outline:hover { background: var(--paper-sunk); }
}

.btn-ghost { background: transparent; color: var(--ink-soft); padding: 0 var(--space-3); }
@media (hover: hover) {
  .btn-ghost:hover { background: var(--paper-sunk); color: var(--ink); }
}

.btn-block { width: 100%; }
.btn-sm { min-height: 2.25rem; padding: 0 var(--space-3); font-size: var(--text-sm); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* 回答ボタンは画面下に貼り付けて、長い候補リストでも常に押せるようにする */
.sticky-action {
  position: sticky;
  bottom: 0;
  margin-top: var(--space-5);
  padding: var(--space-3) 0 max(var(--space-3), env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 62%, transparent);
}

/* ---------------------------------------------------------------- 入力 */

.field { display: block; }
.field-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-1);
}
.field-hint { font-size: var(--text-xs); color: var(--ink-faint); margin-top: var(--space-1); }

.input,
.textarea {
  width: 100%;
  min-height: 2.875rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.textarea { min-height: 5rem; resize: vertical; line-height: 1.6; }

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--tier);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--tier) 18%, transparent);
}

.input-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.input-row .input { flex: 1 1 auto; min-width: 0; }
/* 添えるボタンは縮ませない。縮むと「削 除」のように文字が折り返る */
.input-row .btn { flex: 0 0 auto; white-space: nowrap; }

/* ---------------------------------------------------------------- 表示部品 */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.15em 0.6em;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--paper-sunk);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill-1 { background: var(--tier-1-soft); color: var(--tier-1); border-color: var(--tier-1-edge); }
.pill-2 { background: var(--tier-2-soft); color: var(--tier-2); border-color: var(--tier-2-edge); }
.pill-3 { background: var(--tier-3-soft); color: var(--tier-3); border-color: var(--tier-3-edge); }
.pill-out { background: var(--batsu-soft); color: var(--batsu); border-color: transparent; }

.roster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}
.roster li {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.25em 0.7em;
  border-radius: var(--radius-pill);
  background: var(--paper-sunk);
  border: 1px solid var(--line);
  font-size: var(--text-sm);
}
.roster li[data-pending="true"] {
  background: transparent;
  border-style: dashed;
  color: var(--ink-faint);
}

/* 結果表。横に長くなるので、はみ出しは表の中だけで吸収する */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  white-space: nowrap;
}
.grid-table th,
.grid-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.grid-table thead th {
  font-size: var(--text-xs);
  color: var(--ink-faint);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.grid-table tbody th {
  text-align: left;
  font-weight: 600;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
}
.grid-table td[data-choice="maru"] { color: var(--maru); font-weight: 700; }
.grid-table td[data-choice="sankaku"] { color: var(--sankaku); font-weight: 700; }
.grid-table td[data-choice="batsu"] { color: var(--batsu); font-weight: 700; }
.grid-table col.is-winner,
.grid-table .is-winner { background: var(--maru-soft); }

/* 計算過程。落選した候補は薄く、落ちた理由を添える */
.trace {
  list-style: none;
  margin: 0;
  padding: 0;
}
.trace li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-1) var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}
.trace li:last-child { border-bottom: 0; }
.trace li[data-dropped="true"] { color: var(--ink-faint); }
.trace li[data-winner="true"] {
  background: var(--maru-soft);
  border-left: 3px solid var(--maru);
}
.trace-why {
  grid-column: 1 / -1;
  font-size: var(--text-xs);
  color: var(--ink-faint);
}
.trace-fig {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
}

.winner-banner {
  border-radius: var(--radius-lg);
  border: 1px solid var(--maru);
  background: var(--maru-soft);
  padding: var(--space-5);
}
.winner-when {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: var(--space-1);
}

/* ---------------------------------------------------------------- 状態 */

.notice {
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  border: 1px solid;
}
.notice-error { background: var(--batsu-soft); border-color: var(--batsu); color: var(--batsu); }
.notice-ok { background: var(--maru-soft); border-color: var(--maru); color: var(--maru); }
[hidden] { display: none !important; }

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--paper-sunk), var(--line), var(--paper-sunk));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  min-height: 4rem;
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

/* ---------------------------------------------------------------- ルール説明 */

/*
 * 紹介ページ・作成画面・回答画面で使い回す図解。
 * 文章で書くと読まれないので、目で追える形にしている。
 */

.rules { display: grid; gap: var(--space-6); }
.rules-compact { gap: var(--space-5); }

.rules-part { display: grid; gap: var(--space-3); }

.rules-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-md);
  letter-spacing: -0.01em;
}
.rules-compact .rules-head { font-size: var(--text-base); }

.rules-step-tag {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--tier);
  border: 1px solid var(--tier-edge);
  background: var(--tier-soft);
  border-radius: var(--radius-pill);
  padding: 0.1em 0.7em;
  white-space: nowrap;
}

.rules-lead, .rules-note {
  color: var(--ink-soft);
  font-size: var(--text-sm);
  text-wrap: pretty;
}
.rules-lead b, .rules-note b { color: var(--ink); }

/* ---- 倍率のはしご ---- */

.ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.ladder-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 11rem) 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
}

/* 段ごとに左端へ色の帯。上ほど熱く、下ほど冷たい */
.ladder-row { border-left: 3px solid transparent; }
.ladder-row[data-tier="1"] { border-left-color: var(--tier-1); }
.ladder-row[data-tier="2"] { border-left-color: var(--tier-2); }
.ladder-row[data-tier="3"] { border-left-color: var(--tier-3); }
/* 0倍は「熱い」のではなく「力を失った」状態。1.5倍と同じ赤にすると意味が逆転して見える */
.ladder-row[data-tier="0"] { border-left-color: var(--tier-0); background: var(--paper-sunk); }

.ladder-when {
  font-size: var(--text-sm);
  font-weight: 600;
}
.ladder-row[data-tier="0"] .ladder-when { color: var(--ink-soft); }

.ladder-track {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--paper-sunk);
  overflow: hidden;
  min-width: 2rem;
}

.ladder-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  /* 初期は0。読み込み後に本来の長さへ伸ばす */
  width: var(--bar, 0%);
  transform-origin: left center;
  transform: scaleX(0);
  animation: ladder-grow var(--dur-slow) var(--ease-out) forwards;
}
.ladder-row[data-tier="1"] .ladder-bar { background: var(--tier-1); }
.ladder-row[data-tier="2"] .ladder-bar { background: var(--tier-2); animation-delay: 80ms; }
.ladder-row[data-tier="3"] .ladder-bar { background: var(--tier-3); animation-delay: 160ms; }

@keyframes ladder-grow { to { transform: scaleX(1); } }

.ladder-weight {
  display: flex;
  align-items: baseline;
  gap: 0.25em;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  justify-self: end;
  white-space: nowrap;
}
.ladder-weight b { font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.03em; }
.ladder-weight small { font-size: var(--text-xs); color: var(--ink-faint); }
.ladder-weight em {
  font-family: var(--font-ui);
  font-style: normal;
  font-size: var(--text-xs);
  color: var(--ink-faint);
  margin-left: 0.4em;
}
.ladder-row[data-tier="1"] .ladder-weight b { color: var(--tier-1); }
.ladder-row[data-tier="2"] .ladder-weight b { color: var(--tier-2); }
.ladder-row[data-tier="3"] .ladder-weight b { color: var(--tier-3); }
.ladder-row[data-tier="0"] .ladder-weight b { color: var(--tier-0); }
/* 状態は灰色、その結果だけ赤。警告は読めるまま、序列は崩さない */
.ladder-row[data-tier="0"] .ladder-weight em { color: var(--batsu); font-weight: 700; }

/* 狭い画面では帯を捨てて、いつ・何倍かの2列にする */
@media (max-width: 30rem) {
  .ladder-row { grid-template-columns: 1fr auto; }
  .ladder-track { display: none; }
}

/* ---- 決め方の順番 ---- */

.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.flow-step {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

/* 段の間を線でつないで、順番に進むことを示す */
.flow-step + .flow-step::before {
  content: "";
  position: absolute;
  top: calc(var(--space-3) * -1 - 1px);
  left: calc(var(--space-4) + 0.9rem);
  width: 2px;
  height: var(--space-3);
  background: var(--line-strong);
}

.flow-num {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--paper-sunk);
  border: 1px solid var(--line-strong);
  font-family: var(--font-num);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink-soft);
}

/* 最後の段だけが「早さで決まる」ところ。ここを目立たせる */
.flow-step[data-tone="hot"] {
  border-color: var(--tier-1-edge);
  background: var(--tier-1-soft);
}
.flow-step[data-tone="hot"] .flow-num {
  background: var(--tier-1);
  border-color: var(--tier-1);
  color: var(--paper);
}
.flow-step[data-tone="hot"] .flow-head { color: var(--tier-1); }

.flow-head { font-size: var(--text-base); margin: 0 0 var(--space-1); }
.flow-text { font-size: var(--text-sm); color: var(--ink-soft); text-wrap: pretty; }
.flow-text b { color: var(--ink); }
.flow-step[data-tone="hot"] .flow-text b { color: var(--tier-1); }

/* ---- 一行版 ---- */

.rules-brief {
  font-size: var(--text-sm);
  color: var(--ink-soft);
  text-wrap: pretty;
}
.rules-brief b { color: var(--ink); }

/* ---------------------------------------------------------------- 紹介ページ */

.lp-section {
  padding-block: var(--space-section);
  border-top: 1px solid var(--line);
}
.lp-section:first-of-type { border-top: 0; padding-top: var(--space-4); }

.lp-eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tier);
  margin-bottom: var(--space-2);
}

/* 主役の見出しだけスケールを飛ばして、階層を作る */
.lp-hero-title {
  font-size: clamp(2rem, 1.2rem + 4.2vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.lp-hero-title .accent {
  color: var(--tier-1);
  /* 下線を文字の下に敷いて、紙にペンで引いたような重みを出す */
  background-image: linear-gradient(var(--tier-1-soft), var(--tier-1-soft));
  background-size: 100% 0.38em;
  background-position: 0 88%;
  background-repeat: no-repeat;
}

.lp-lead {
  font-size: var(--text-md);
  color: var(--ink-soft);
  max-width: 34rem;
  text-wrap: pretty;
}

.lp-section-title {
  font-size: var(--text-xl);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

/* 悩みの列挙。カードを均一に並べず、引用のように左線で揃える */
.pain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}
.pain-list li {
  border-left: 2px solid var(--line-strong);
  padding-left: var(--space-4);
  font-size: var(--text-md);
  color: var(--ink-soft);
}
.pain-list li b { color: var(--ink); }

/* 具体例の対比。2枚を並べ、右（採用後）を持ち上げる */
.compare {
  display: grid;
  gap: var(--space-3);
}
@media (min-width: 40rem) {
  .compare { grid-template-columns: 1fr 1fr; align-items: start; }
}

.compare-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: var(--surface);
}
.compare-card[data-kind="after"] {
  border-color: var(--maru);
  background: var(--maru-soft);
  box-shadow: var(--shadow);
}
.compare-title {
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--ink-soft);
}
.compare-card[data-kind="after"] .compare-title { color: var(--maru); }

.compare-result {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}
.compare-note { font-size: var(--text-sm); color: var(--ink-soft); text-wrap: pretty; }
.compare-note b { color: var(--ink); }

/* 最後の一押し。面を反転させて、ページの終わりだと分からせる */
.lp-final {
  border-radius: var(--radius-lg);
  border: 1px solid var(--tier-edge);
  background: var(--tier-soft);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  display: grid;
  gap: var(--space-4);
  justify-items: center;
}
.lp-final .lp-section-title { max-width: 26rem; }

.btn-lg {
  min-height: 3.25rem;
  padding: 0 var(--space-6);
  font-size: var(--text-md);
}

/* デモの計器。実物と同じ見た目で、状態が移り変わるところを見せる */
.demo-tag {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.1em 0.6em;
  background: var(--surface);
}

/* 回答画面の折りたたみ。開かない人にも要点だけは届くようにする */
.card-rules { padding: 0; }

.rules-summary {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-lg);
  transition: background var(--dur-fast) var(--ease-out);
}
.rules-summary::-webkit-details-marker { display: none; }
@media (hover: hover) {
  .rules-summary:hover { background: var(--paper-sunk); }
}
.rules-summary:focus-visible { outline: 2px solid var(--tier); outline-offset: -2px; }

.rules-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
}
/* 開閉の向きを三角で示す。marker を消しているので自前で出す */
.rules-summary-head::after {
  content: "▾";
  color: var(--ink-faint);
  font-size: var(--text-xs);
  transition: transform var(--dur) var(--ease-out);
}
[open] > .rules-summary .rules-summary-head::after { transform: rotate(180deg); }

.rules-summary-brief {
  font-size: var(--text-sm);
  color: var(--ink-soft);
  text-wrap: pretty;
}
.rules-summary-brief b { color: var(--ink); }

#rules-slot { padding: 0 var(--space-4) var(--space-4); }
.card > #rules-slot { padding: 0; }
