/* US免許ナビ — "Highway" design system.
   US guide-sign green, warning-sign amber and asphalt, with Overpass (an open
   font derived from the Highway Gothic sign alphabet) for Latin text and
   numbers. Japanese text uses each device's own gothic font. */

@font-face {
  font-family: "Overpass";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/overpass-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f3f1ea;
  --surface: #ffffff;
  --surface-2: #f8f6f0;
  --surface-3: #ebe8de;
  --text: #15171a;
  --muted: #596067;
  --line: #dcd8cc;
  --line-strong: #c4bfb0;
  --sign: #0d5c3a;
  --sign-deep: #08442a;
  --sign-sheen: #137049;
  --amber: #ffc72c;
  --amber-deep: #e0a800;
  --amber-ink: #1b1600;
  --asphalt: #17191c;
  --asphalt-2: #2a2e33;
  --primary: #0d5c3a;
  --primary-ink: #ffffff;
  --primary-soft: #e4f0e9;
  --ok: #0f7a47;
  --ok-soft: #e6f4ec;
  --ng: #c0322a;
  --ng-soft: #fcebe9;
  --warn: #7a5800;
  --warn-soft: #fff4cc;
  --focus: #15171a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(21, 23, 26, .05), 0 8px 24px -16px rgba(21, 23, 26, .25);
  --shadow-lift: 0 2px 4px rgba(21, 23, 26, .06), 0 22px 40px -22px rgba(21, 23, 26, .45);
  --latin: "Overpass", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --font: "Overpass", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1113;
    --surface: #181b1f;
    --surface-2: #1d2125;
    --surface-3: #272c32;
    --text: #eef0f2;
    --muted: #a6aeb6;
    --line: #2e343b;
    --line-strong: #444c55;
    --sign: #0e6340;
    --sign-deep: #094a30;
    --sign-sheen: #15784f;
    --primary: #74d6a4;
    --primary-ink: #04261a;
    --primary-soft: #16301f;
    --ok: #6bd69c;
    --ok-soft: #12291c;
    --ng: #ff8f85;
    --ng-soft: #33191a;
    --warn: #ffd166;
    --warn-soft: #2f2712;
    --focus: #ffc72c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lift: 0 22px 40px -22px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1113;
  --surface: #181b1f;
  --surface-2: #1d2125;
  --surface-3: #272c32;
  --text: #eef0f2;
  --muted: #a6aeb6;
  --line: #2e343b;
  --line-strong: #444c55;
  --sign: #0e6340;
  --sign-deep: #094a30;
  --sign-sheen: #15784f;
  --primary: #74d6a4;
  --primary-ink: #04261a;
  --primary-soft: #16301f;
  --ok: #6bd69c;
  --ok-soft: #12291c;
  --ng: #ff8f85;
  --ng-soft: #33191a;
  --warn: #ffd166;
  --warn-soft: #2f2712;
  --focus: #ffc72c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lift: 0 22px 40px -22px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 28px 24px 72px; outline: none; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .5em; font-weight: 900; word-break: auto-phrase; text-wrap: balance; letter-spacing: .005em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem); }
h2 { font-size: clamp(1.25rem, 1.05rem + .9vw, 1.65rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .9em; }
a { color: var(--primary); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--amber); color: var(--amber-ink); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--surface); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lift); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.num, .latin { font-family: var(--latin); font-variant-numeric: tabular-nums; }
kbd { font-family: var(--latin); font-size: .78rem; font-weight: 700; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; background: var(--surface); }
[data-lang="en"] .ja, [data-lang="ja"] .en { display: none !important; }

/* Eyebrow labels read like the small route text on a sign. */
.eyebrow { font-family: var(--latin); font-weight: 900; font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--primary); margin: 0 0 6px; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar-inner { max-width: 1160px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 14px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 4px 0; cursor: pointer; text-align: left; color: inherit; text-decoration: none; }
a.brand { color: inherit; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 10px; background: var(--sign); color: #fff;
  box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 5px #fff, 0 6px 14px -8px rgba(8, 68, 42, .8);
  font: 900 .92rem/1 var(--latin); letter-spacing: .04em; padding-top: 2px;
  transition: transform .4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.04); }
.brand-text { font-weight: 900; font-size: 1.06rem; line-height: 1.2; letter-spacing: .01em; }
.brand-text small { display: block; font-weight: 500; font-size: .7rem; color: var(--muted); letter-spacing: .02em; margin-top: 2px; }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.lang-switch { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--surface-3); flex-shrink: 0; }
.lang-switch button { border: 0; background: transparent; padding: 6px 12px; font-size: .8rem; font-weight: 700; cursor: pointer; min-height: 34px; border-radius: 999px; color: var(--muted); transition: background .2s, color .2s; }
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-checked="true"] { background: var(--asphalt); color: #fff; }
:root[data-theme="dark"] .lang-switch button[aria-checked="true"] { background: var(--amber); color: var(--amber-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lang-switch button[aria-checked="true"] { background: var(--amber); color: var(--amber-ink); } }
.account-nav { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 16px 0 12px; border-radius: 999px; border: 1.5px solid var(--text); background: transparent; cursor: pointer; flex-shrink: 0; font-weight: 800; }
.account-nav svg { width: 20px; height: 20px; display: block; }
.account-nav:hover { background: var(--text); color: var(--bg); }
.account-nav[data-signed-in="true"] { border-color: var(--primary); color: var(--primary); }
.account-nav[data-signed-in="true"]:hover { background: var(--primary); color: var(--primary-ink); }
.account-label { font-size: .84rem; white-space: nowrap; }
.home-add-nav { color: var(--text); text-decoration: none; }
.home-add-nav:hover { text-decoration: none; }
.inline-icon { display: inline-block; width: 1.15em; height: 1.15em; margin: 0 .25em; vertical-align: -.2em; color: var(--sign); }

/* ---------- buttons, chips, cards ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text);
  cursor: pointer; font-weight: 800; line-height: 1.4; text-decoration: none; text-align: center;
  transition: transform .18s var(--ease), box-shadow .18s, background-color .18s, border-color .18s, color .18s;
}
.btn:hover { border-color: var(--text); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--sign); border-color: var(--sign); color: #fff; box-shadow: 0 3px 0 var(--sign-deep); }
.btn-primary:hover { background: var(--sign-sheen); border-color: var(--sign-sheen); box-shadow: 0 4px 0 var(--sign-deep), 0 14px 24px -14px rgba(8, 68, 42, .9); }
.btn-primary:active { box-shadow: 0 1px 0 var(--sign-deep); }
.btn-amber { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); box-shadow: 0 3px 0 var(--amber-deep); }
.btn-amber:hover { background: #ffd04f; border-color: #ffd04f; box-shadow: 0 4px 0 var(--amber-deep), 0 14px 26px -14px rgba(0, 0, 0, .6); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-light { background: transparent; border-color: rgba(255, 255, 255, .85); color: #fff; }
.btn-light:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.btn-danger { color: var(--ng); border-color: color-mix(in srgb, var(--ng) 45%, var(--line)); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .arrow, .go-arrow { font-family: var(--latin); font-weight: 900; transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.chip, .badge, .tag, .access-label {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: .74rem; font-weight: 800; line-height: 1.2; letter-spacing: .02em;
  padding: 5px 9px 4px; border-radius: 7px; border: 0;
  background: var(--primary-soft); color: var(--primary);
}
.badge-exam, .chip-amber, .tag-free, .access-label.is-free { background: var(--warn-soft); color: var(--warn); }
.chip-dark { background: var(--asphalt); color: #fff; }
.notice {
  position: relative; background: var(--warn-soft); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--amber-deep) 35%, transparent);
  border-radius: var(--radius-sm); padding: 14px 16px 14px 58px; font-size: .9rem; margin-bottom: 18px;
}
.notice::before {
  content: "!"; position: absolute; left: 17px; top: 15px; width: 24px; height: 24px;
  display: grid; place-items: center; background: var(--amber); color: var(--amber-ink);
  font: 900 .85rem/1 var(--latin); border-radius: 4px; transform: rotate(45deg);
}
.notice strong { color: var(--warn); }
.notice > * { position: relative; }
.stats-line { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; color: var(--muted); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.history-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.history-table th, .history-table td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.history-table th { color: var(--muted); font-weight: 800; font-size: .76rem; letter-spacing: .04em; }
.history-table tbody tr:hover { background: var(--surface-2); }
details.panel > summary, .wrong-item summary { cursor: pointer; font-weight: 800; list-style: none; }
details.panel > summary::-webkit-details-marker, .wrong-item summary::-webkit-details-marker { display: none; }
details.panel > summary::before, .wrong-item summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 6px; background: var(--surface-3); font: 900 .95rem/1 var(--latin); vertical-align: 1px; transition: transform .25s var(--ease); }
details[open].panel > summary::before, .wrong-item[open] summary::before { content: "−"; }

/* ---------- sign components ---------- */
/* A green guide sign: reflective sheen, white inset border, white legend. */
.board {
  --focus: var(--amber);
  position: relative; color: #fff; isolation: isolate;
  background: radial-gradient(120% 140% at 0% 0%, var(--sign-sheen) 0%, transparent 55%), var(--sign);
  border-radius: 26px; padding: clamp(28px, 4.4vw, 54px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 34px 60px -34px rgba(8, 68, 42, .75);
}
.board::before { content: ""; position: absolute; inset: 10px; border: 3px solid rgba(255, 255, 255, .94); border-radius: 18px; pointer-events: none; z-index: -1; }
.board a:not(.btn):not(.tile) { color: #fff; }
.board .lead { color: rgba(255, 255, 255, .86); font-size: 1.04rem; line-height: 1.9; max-width: 34em; }
.board h1 { color: #fff; margin: 18px 0 16px; font-size: clamp(1.9rem, 1.1rem + 2.6vw, 2.75rem); line-height: 1.2; }
.board h1 em { font-style: normal; color: var(--amber); }
.h-line { display: inline-block; }
.exit-tag { display: inline-flex; align-items: stretch; margin: 0; background: #fff; color: var(--sign); border-radius: 7px; padding: 4px; font: 900 .74rem/1 var(--latin); letter-spacing: .16em; }
.exit-tag b { background: var(--sign); color: #fff; border-radius: 4px; padding: 5px 8px 3px; }
.exit-tag span { padding: 5px 9px 3px; }
.board-stats { display: flex; flex-wrap: wrap; gap: 14px 34px; margin: 30px 0 0; padding: 22px 0 0; border-top: 1px dashed rgba(255, 255, 255, .38); }
.board-stats div { display: flex; flex-direction: column-reverse; }
.board-stats dt { font-size: .76rem; color: rgba(255, 255, 255, .74); letter-spacing: .04em; }
.board-stats dd { margin: 0 0 4px; font: 900 clamp(1.6rem, 1.2rem + 1.2vw, 2.15rem)/1 var(--latin); font-variant-numeric: tabular-nums; }
.board-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.board-ctas .btn { min-height: 54px; padding: 12px 24px; font-size: 1rem; border-radius: 14px; }

/* Big state plate (state hero). */
.big-plate { display: grid; place-items: center; text-align: center; aspect-ratio: 1.25; width: min(100%, 330px); margin-left: auto; background: #fff; color: var(--sign); border-radius: 22px; padding: 10px; box-shadow: 0 30px 50px -30px rgba(0, 0, 0, .6); transform: rotate(-3deg); }
.big-plate > span { display: grid; place-items: center; width: 100%; height: 100%; border: 4px solid var(--sign); border-radius: 15px; }
.big-plate b { display: block; font: 900 clamp(4.5rem, 3rem + 6vw, 7.6rem)/.9 var(--latin); letter-spacing: -.02em; padding-top: .08em; }
.big-plate small { display: block; font: 800 .82rem/1 var(--latin); letter-spacing: .2em; text-transform: uppercase; margin-top: 6px; }

/* Mile marker, lane progress and warning diamond. */
.mile { display: inline-block; flex-shrink: 0; background: var(--sign); color: #fff; border-radius: 9px; padding: 4px; text-align: center; box-shadow: 0 8px 16px -10px rgba(8, 68, 42, .9); }
.mile > span { display: block; min-width: 48px; border: 2px solid #fff; border-radius: 6px; padding: 5px 8px 3px; }
.mile small { display: block; font: 900 .6rem/1 var(--latin); letter-spacing: .16em; }
.mile b { display: block; font: 900 1.45rem/1.05 var(--latin); font-variant-numeric: tabular-nums; }
.progress, .lane { position: relative; height: 14px; border-radius: 999px; background: var(--asphalt); overflow: hidden; margin: 0; border: 0; }
.progress::after, .lane::after { content: ""; position: absolute; left: 10px; right: 10px; top: 6px; height: 2px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .55) 0 14px, transparent 14px 28px); z-index: 0; }
.progress > span, .lane > span { position: relative; z-index: 1; display: block; height: 100%; min-width: 14px; border-radius: 999px; background: linear-gradient(90deg, var(--amber-deep), var(--amber)); transition: width .6s var(--ease); }
.diamond { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; margin: 7px; background: var(--amber); color: var(--amber-ink); border-radius: 5px; transform: rotate(45deg); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--amber-ink); }
.diamond > * { transform: rotate(-45deg); font: 900 1rem/1 var(--latin); }

/* ---------- hero (simple) ---------- */
.hero { margin: 4px 0 26px; }
.hero h1 { margin-bottom: .3em; }
.hero p { color: var(--muted); max-width: 46em; }
.crumbs { font-size: .82rem; color: var(--muted); margin: 0 0 14px; }
.crumbs a { color: inherit; }
.state-back { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 700; margin-bottom: 14px; }

/* ---------- hero board (home, state, guide, premium menu) ---------- */
.hero-board { margin: 6px 0 36px; animation: sign-in .9s var(--ease) both; }
.hero-board .board { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero-board .board-copy { min-width: 0; }
.hero-guide .board { grid-template-columns: minmax(0, 1fr) auto; }
.hero-guide .big-plate { width: 220px; }
.hero-compact .board { padding-block: clamp(24px, 3.4vw, 40px); }
.hero-compact .big-plate { width: min(100%, 250px); }
.hero-compact h1 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.3rem); }
.board .state-back { margin: 0 0 14px; display: flex; width: fit-content; opacity: .85; }
.board .state-back:hover { opacity: 1; }
.meta-chips .mile { margin-right: 4px; }
.meta-chips .mile b { font-size: 1.15rem; }

/* Tile map of the US: released states glow amber and link to their page. */
.tilemap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(3px, .5vw, 6px); }
.tile { aspect-ratio: 1; display: grid; place-items: center; border-radius: clamp(4px, .6vw, 8px); background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .38); font: 800 clamp(.5rem, .35rem + .4vw, .68rem)/1 var(--latin); letter-spacing: .02em; padding-top: 2px; text-decoration: none; }
.tile-gap { visibility: hidden; }
a.tile { background: var(--amber); color: var(--amber-ink); font-weight: 900; font-size: clamp(.58rem, .4rem + .5vw, .8rem); box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .55); transition: transform .25s var(--ease), background .2s, box-shadow .25s; animation: tile-in .6s var(--ease) both; animation-delay: calc(.35s + var(--d, 0) * 55ms); }
a.tile:hover, a.tile:focus-visible { transform: translateY(-3px) scale(1.12); background: #fff; color: var(--sign); box-shadow: 0 12px 22px -8px rgba(0, 0, 0, .6); z-index: 1; }
a.tile.is-last { background: #fff; color: var(--sign); outline: 3px solid var(--amber); outline-offset: 2px; }
.tilemap-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; margin: 14px 0 0; font-size: .76rem; color: rgba(255, 255, 255, .74); }
.tilemap-cap .key-dot::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--amber); margin-right: 6px; vertical-align: -1px; }

.board-map { min-width: 0; }
.board-plate { min-width: 0; }
.board-stats dd small, .facts dd small { font-size: .5em; font-weight: 800; margin-left: 2px; letter-spacing: 0; }

/* ---------- sections ---------- */
.section { margin: 0 0 44px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 18px; margin-bottom: 18px; }
.section-head h2 { margin: 0; }
.section-head .eyebrow { width: 100%; }
.section-head p:not(.eyebrow) { margin: 0 0 0 auto; color: var(--muted); font-size: .88rem; }

/* State cards on the home page: each is a small guide-sign plate. */
.state-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.dir-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; animation: rise .7s var(--ease) both; animation-delay: calc(var(--d, 0) * 45ms); }
.dir-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--sign); }
.dir-card-main { display: flex; flex-direction: column; gap: 2px; padding: 16px 16px 12px; color: inherit; text-decoration: none; flex: 1; border-radius: var(--radius) var(--radius) 0 0; }
.dir-card-main:hover { text-decoration: none; }
.dir-card-main:focus-visible { outline-offset: -3px; }
.plate { display: flex; background: var(--sign); color: #fff; border-radius: 11px; padding: 5px; margin-bottom: 12px; }
.plate > span { flex: 1; display: flex; align-items: center; justify-content: space-between; border: 2px solid #fff; border-radius: 7px; padding: 9px 12px 7px; }
.plate b { font: 900 2.1rem/1 var(--latin); letter-spacing: .02em; }
.plate .go-arrow { font-size: 1.35rem; }
.dir-card:hover .go-arrow { transform: translateX(4px); }
.dir-name { font-size: 1.08rem; font-weight: 900; line-height: 1.4; }
.dir-en { font-family: var(--latin); font-size: .82rem; color: var(--muted); }
.dir-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.road { display: block; position: relative; height: 8px; border-radius: 999px; background: var(--asphalt-2); overflow: hidden; margin-top: 14px; }
.road::after { content: ""; position: absolute; left: 6px; right: 6px; top: 3.5px; height: 1px; background: repeating-linear-gradient(90deg, rgba(255, 199, 44, .75) 0 8px, transparent 8px 16px); }
.road > span { position: absolute; inset: 0 auto 0 0; z-index: 1; width: calc(var(--progress, 0) * 100%); background: var(--amber); border-radius: 999px; transition: width .8s var(--ease); }
.dir-progress { font-size: .76rem; color: var(--muted); margin-top: 6px; min-height: 1.3em; }
.dir-progress:empty::before { content: "まだ挑戦していません"; }
.dir-guide { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--line); padding: 10px 16px 12px; font-size: .8rem; font-weight: 700; text-decoration: none; border-radius: 0 0 var(--radius) var(--radius); }
.dir-guide::after { content: "→"; font-family: var(--latin); font-weight: 900; }
.dir-guide:hover { background: var(--surface-2); }
.resume-link { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; color: inherit; text-decoration: none; border: 2px solid var(--sign); background: linear-gradient(90deg, var(--primary-soft), var(--surface) 70%); }
.resume-link:hover { box-shadow: var(--shadow-lift); text-decoration: none; }
.resume-link .mode-go { font-weight: 900; color: var(--primary); }

/* Feature tiles */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; padding: 0; margin: 0; list-style: none; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature h3 { margin: 14px 0 6px; font-size: 1.02rem; }
.feature p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.8; }
.feature-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--sign); color: #fff; box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 5px #fff; }
.feature-icon svg { width: 24px; height: 24px; }
.feature-icon.is-amber { background: var(--amber); color: var(--amber-ink); box-shadow: none; border-radius: 6px; transform: rotate(45deg) scale(.82); }
.feature-icon.is-amber svg { transform: rotate(-45deg); }
.guide-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; padding: 0; margin: 0; list-style: none; }
.guide-links a { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--text); font-weight: 700; font-size: .92rem; transition: border-color .2s, transform .25s var(--ease); }
.guide-links a:hover { border-color: var(--sign); transform: translateX(3px); }
.guide-links a::after { content: "→"; margin-left: auto; font-family: var(--latin); font-weight: 900; color: var(--primary); }
.guide-links b { display: grid; place-items: center; min-width: 40px; height: 32px; border-radius: 7px; background: var(--sign); color: #fff; font: 900 .85rem/1 var(--latin); letter-spacing: .04em; padding-top: 2px; box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 3.5px #fff; }

/* ---------- menus (state page and premium app) ---------- */
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-bottom: 18px; }
.mode-card {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: 16px; row-gap: 4px;
  text-align: left; padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow); cursor: pointer; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.mode-card > :not(.mode-icon) { grid-column: 2; }
.mode-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--text); }
.mode-card .mode-icon { grid-row: 1 / span 3; align-self: start; }
.mode-card .mode-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 1.12rem; font-weight: 900; line-height: 1.4; color: var(--text); }
.mode-card .mode-desc, .mode-card > span:not([class]) { color: var(--muted); font-size: .9rem; line-height: 1.75; }
.mode-card .mode-go { margin-top: 10px; font-weight: 900; color: var(--primary); }
.mode-card .mode-go::after { content: ""; }
.mode-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 13px; background: var(--sign); color: #fff; box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 5px #fff; }
.mode-icon svg { width: 26px; height: 26px; }
.mode-card.is-free .mode-icon { background: var(--amber); color: var(--amber-ink); box-shadow: inset 0 0 0 3px var(--amber), inset 0 0 0 5px var(--amber-ink); }
.access-label { font-size: .68rem; padding: 4px 7px 3px; }
.mode-card .access-label { background: var(--primary-soft); color: var(--primary); }
.mode-card.is-free .access-label { background: var(--warn-soft); color: var(--warn); }
.resume { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; border: 2px solid var(--sign); }
[data-progress] { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 12px; margin: -10px 0 26px; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: .9rem; font-weight: 700; line-height: 1.6; color: var(--text); }
[data-progress]::before { content: ""; width: 10px; height: 10px; margin-top: .45em; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 30%, transparent); flex-shrink: 0; }
[data-progress]:empty { display: none; }

.modes-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 30px 0 14px; font-size: 1.02rem; }
.modes-sub::before { content: ""; align-self: center; width: 22px; height: 3px; border-radius: 2px; background: var(--sign); }
.modes-sub small { font: 700 .8rem/1.4 var(--font); color: var(--muted); }
.modes-free .mode-card { border-width: 2px; border-color: color-mix(in srgb, var(--amber-deep) 55%, var(--line)); }
.modes-free .mode-card:hover { border-color: var(--text); }
.mode-card:hover .arrow { transform: translateX(4px); }
.mode-go .arrow { display: inline-block; }
.back-link { margin: 26px 0 0; font-weight: 700; }
.back-btn { margin: 0 0 14px -12px; }
.compare-card h2 { margin-bottom: 14px; }
.resume-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 16px 22px 16px 16px; }
.resume-link .plate { margin: 0; }
.resume-link .plate b { font-size: 1.5rem; }
.resume-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.resume-copy .eyebrow { margin: 0; }
.resume-copy strong { font-size: 1.04rem; }

/* Free vs premium table */
.compare-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; margin-bottom: 18px; table-layout: fixed; }
.compare-table th, .compare-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.compare-table th:first-child { width: 54%; }
.compare-table thead th { font-size: .78rem; color: var(--muted); font-weight: 800; letter-spacing: .04em; border-bottom: 2px solid var(--text); }
.compare-table thead th + th, .compare-table td { text-align: center; }
.compare-table thead th:last-child { color: var(--primary); }
.compare-table tbody th { font-weight: 600; }
.compare-table td:last-child { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.compare-table tbody tr:last-child td:last-child { border-radius: 0 0 10px 10px; }
.compare-table .tag-ok { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ok); color: #fff; font-size: .8rem; }
.count-col { white-space: nowrap; text-align: right; font-family: var(--latin); font-variant-numeric: tabular-nums; }
.cta-card, .upsell { position: relative; overflow: hidden; border: 0; background: var(--asphalt); color: #fff; --focus: var(--amber); }
.cta-card::before, .upsell::before { content: ""; position: absolute; left: 0; right: 0; bottom: 18px; height: 3px; background: repeating-linear-gradient(90deg, rgba(255, 199, 44, .55) 0 22px, transparent 22px 44px); }
.cta-card > *, .upsell > * { position: relative; }
.cta-card h2, .upsell h2 { color: #fff; }
.cta-card p, .upsell p { color: rgba(255, 255, 255, .82); }
.cta-card a:not(.btn) { color: var(--amber); }
.cta-card .btn:not(.btn-primary):not(.btn-amber), .upsell .btn:not(.btn-primary):not(.btn-amber) { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.cta-card .btn-primary, .upsell .btn-primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); box-shadow: 0 3px 0 var(--amber-deep); }
.cta-card { padding-bottom: 46px; }
.upsell { padding-bottom: 46px; }

/* ---------- question screen ---------- */
.drive { max-width: 1060px; margin: 0 auto; }
.choices > li { margin: 0; }
.kbd-hint { margin: 16px 0 0; }
.feedback { scroll-margin-bottom: 120px; animation: rise .45s var(--ease) both; }
.feedback dd.right-answer { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.feedback dd.right-answer .en, .feedback dd.right-answer .ja { display: block; }
.feedback dd b.latin { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--ok); color: #fff; font-size: .82rem; margin-right: 6px; vertical-align: 1px; padding-top: 1px; }
.feedback dd .en + .ja { margin-top: 2px; }
#portal.no-enter > * { animation: none; }

.drive-head, .quiz-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.drive-head .lane { flex: 1; }
.drive-count { font: 800 .9rem/1 var(--latin); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.quiz-head { flex-wrap: wrap; justify-content: space-between; gap: 10px 14px; margin-bottom: 12px; }
.quiz-head > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.quiz-head + .progress { margin-bottom: 20px; }
.qnum { font: 900 1.05rem/1.2 var(--latin); }
.meta-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.meta-chips .qnum { margin-right: 6px; }
.qcard { padding: clamp(22px, 3vw, 40px); }
@media (min-width: 900px) {
  .qcard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); column-gap: 40px; align-items: start; }
  .qcard > * { grid-column: 1 / -1; }
  .qcard > .q-main, .qcard > .meta-chips, .qcard > .q-text, .qcard > .question-image { grid-column: 1; }
  .qcard > .choices { grid-column: 2; grid-row: 1 / span 3; }
  .qcard > .meta-chips { grid-row: 1; } .qcard > .q-text { grid-row: 2; } .qcard > .question-image { grid-row: 3; margin-top: 0; }
}
.q-text { font-size: 1.12rem; font-weight: 700; line-height: 1.6; margin: 0 0 18px; }
.q-text .en { display: block; font-family: var(--latin); font-size: clamp(1.18rem, 1.02rem + .6vw, 1.5rem); line-height: 1.42; font-weight: 750; letter-spacing: -.005em; }
.q-text .ja { display: block; color: var(--muted); font-weight: 500; margin-top: 10px; font-size: 1rem; line-height: 1.8; }
[data-lang="ja"] .q-text .ja { color: var(--text); font-weight: 800; font-size: clamp(1.12rem, 1rem + .5vw, 1.35rem); margin-top: 0; }
.choices { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.choice {
  width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  text-align: left; padding: 13px 16px 13px 13px; border: 2px solid var(--line); border-radius: 15px; background: var(--surface);
  cursor: pointer; min-height: 64px; color: var(--text);
  transition: border-color .18s, background-color .18s, transform .2s var(--ease), box-shadow .2s;
}
.choice:hover:not([disabled]) { border-color: var(--text); transform: translateX(3px); box-shadow: var(--shadow); }
.choice[disabled] { cursor: default; }
.choice .key { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-3); font: 900 1.02rem/1 var(--latin); padding-top: 2px; transition: background .2s, color .2s; }
.choice .en { display: block; font-family: var(--latin); font-weight: 700; font-size: 1rem; line-height: 1.45; }
.choice .ja { display: block; color: var(--muted); font-size: .88rem; line-height: 1.6; margin-top: 3px; }
[data-lang="ja"] .choice .ja { color: var(--text); margin-top: 0; font-size: .98rem; font-weight: 600; }
.choice .mark { font-weight: 900; font-size: .74rem; white-space: nowrap; }
.choice .mark:empty { display: none; }
.choice.selected { border-color: var(--sign); background: var(--primary-soft); }
.choice.selected .key { background: var(--sign); color: #fff; }
.choice.is-correct { border-color: var(--ok); background: var(--ok-soft); opacity: 1; }
.choice.is-correct .key { background: var(--ok); color: #fff; }
.choice.is-correct .mark { color: var(--ok); }
.choice.is-wrong { border-color: var(--ng); background: var(--ng-soft); opacity: 1; }
.choice.is-wrong .key { background: var(--ng); color: #fff; }
.choice.is-wrong .mark { color: var(--ng); }
.choice.is-correct { animation: pop .45s var(--ease); }
.choice.is-wrong.just-answered { animation: nudge .4s var(--ease); }
.choice[disabled]:not(.is-correct):not(.is-wrong) { opacity: .62; }
.choice .mark.sign-ok, .choice .mark.sign-ng { display: grid; place-items: center; width: 28px; height: 28px; color: #fff; font: 900 .9rem/1 var(--latin); }
.choice .mark.sign-ok { background: var(--ok); border-radius: 50%; }
.choice .mark.sign-ng { background: var(--ng); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.portal-choices { margin: 0; }

.feedback { margin-top: 22px; border-radius: 16px; padding: 18px 20px 18px 74px; position: relative; background: var(--surface-2); border: 1px solid var(--line); }
.feedback::before { content: "!"; position: absolute; left: 21px; top: 22px; width: 30px; height: 30px; display: grid; place-items: center; background: var(--amber); color: var(--amber-ink); border-radius: 5px; transform: rotate(45deg); font: 900 1rem/1 var(--latin); box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--amber-ink); }
.feedback > * { position: relative; }
.feedback .verdict { font-size: 1.16rem; font-weight: 900; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.feedback.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok-soft) 70%, var(--surface)); }
.feedback.ng { border-color: color-mix(in srgb, var(--ng) 40%, var(--line)); background: color-mix(in srgb, var(--ng-soft) 70%, var(--surface)); }
.feedback.ok::before { content: "✓"; background: var(--ok); color: #fff; transform: none; border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.feedback.ng::before { content: "×"; background: var(--ng); color: #fff; transform: none; border-radius: 0; clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); box-shadow: none; width: 32px; height: 32px; }
.feedback.ok .verdict { color: var(--ok); }
.feedback.ng .verdict { color: var(--ng); }
.verdict .sym { display: none; }
.feedback dl { margin: 8px 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; font-size: .93rem; }
.feedback dt { color: var(--muted); font-weight: 800; }
.feedback dd { margin: 0; }
.feedback dd .en, .feedback dd .ja { display: block; }
.source { font-size: .8rem; color: var(--muted); border-top: 1px dashed var(--line); margin: 12px 0 0; padding-top: 10px; word-break: break-word; }
.feedback .source a { font-weight: 800; }

.quiz-nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 18px 0; }
.quiz-nav .spacer { flex: 1; }
.flag-btn[aria-pressed="true"] { background: var(--warn-soft); border-color: var(--amber-deep); color: var(--warn); }
.kbd-hint { font-size: .78rem; color: var(--muted); margin-top: 14px; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; margin-top: 14px; }
.palette button { position: relative; min-height: 42px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font: 700 .86rem/1 var(--latin); font-variant-numeric: tabular-nums; transition: transform .15s, border-color .15s; }
.palette button:hover { border-color: var(--text); transform: translateY(-1px); }
.palette button span { font-size: .7rem; margin-left: 2px; }
.palette button.answered { background: var(--surface-3); border-color: var(--line-strong); font-weight: 900; }
.palette button.current { background: var(--asphalt); color: #fff; border-color: var(--asphalt); }
.palette button.flagged::after { content: ""; position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; background: var(--amber); transform: rotate(45deg); border-radius: 2px; box-shadow: 0 0 0 2px var(--surface); }
.palette button.p-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.palette button.p-ng { background: var(--ng-soft); border-color: var(--ng); color: var(--ng); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .76rem; color: var(--muted); margin-top: 10px; }

/* ---------- results ---------- */
.score-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin: 4px 0 6px; }
.score-big .num { font: 900 clamp(3rem, 2.2rem + 3vw, 4.6rem)/1 var(--latin); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.score-big .num small, .score-big .num .small { font-size: 1.05rem; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.score-big .pct { font: 800 1.2rem/1 var(--latin); color: var(--muted); }
.passbar { position: relative; height: 18px; border-radius: 999px; background: var(--asphalt); margin: 22px 0 34px; }
.passbar::after { content: ""; position: absolute; left: 12px; right: 12px; top: 8px; height: 2px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .5) 0 14px, transparent 14px 28px); }
.passbar-fill { position: absolute; inset: 0 auto 0 0; z-index: 1; width: var(--score, 0%); min-width: 18px; border-radius: 999px; background: linear-gradient(90deg, var(--amber-deep), var(--amber)); animation: fill 1.1s var(--ease) both; }
.passbar.is-pass .passbar-fill { background: linear-gradient(90deg, #0b6b3e, #23a565); }
.passbar-line { position: absolute; z-index: 2; top: -8px; bottom: -8px; left: var(--pass, 80%); width: 3px; background: var(--text); border-radius: 2px; }
.passbar-line em { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); font: 800 .72rem/1 var(--latin); font-style: normal; white-space: nowrap; color: var(--text); }
.target { margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-weight: 700; display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); }
.target.ok { background: var(--ok-soft); color: var(--ok); }
.target.ng { background: var(--ng-soft); color: var(--ng); }
.cat-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) 72px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.cat-row > span:nth-child(2) { font-family: var(--latin); font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.bar { display: block; height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--sign); border-radius: 999px; }
.wrong-item { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; background: var(--surface); transition: border-color .2s; }
.wrong-item:hover { border-color: var(--line-strong); }
.wrong-item[open] { border-color: var(--text); }
.wrong-item summary .en, .wrong-item summary .ja { display: block; }
.wrong-item summary .en { font-family: var(--latin); }
.wrong-item summary .ja { font-weight: 500; color: var(--muted); margin-top: 2px; }
.wrong-item summary { display: block; }
.wrong-item summary::before { float: left; margin-top: 2px; }
.wrong-item .ans-line { font-size: .9rem; margin: 8px 0 4px; }
.ans-line .lbl { display: inline-block; min-width: 7em; color: var(--muted); font-weight: 700; font-size: .8rem; }
.ans-line .en, .ans-line .ja { display: inline; }
.ans-line .ja::before { content: " / "; color: var(--muted); }
[data-lang] .ans-line .en:only-child::after { content: ""; }
.tag-ng { color: var(--ng); font-weight: 800; }
.tag-ok { color: var(--ok); font-weight: 800; }

/* ---------- plans ---------- */
.plan-board { margin-bottom: 32px; }
.plan-board h2 { color: #fff; font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.6rem); margin: 18px 0 4px; }
.plan-board p:not(.exit-tag) { color: rgba(255, 255, 255, .86); max-width: 40em; }
.plan-board { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(24px, 4vw, 56px); align-items: center; }
.price-plate { width: 260px; }
.price-plate b { font-size: clamp(3.6rem, 2.6rem + 3vw, 5.4rem); }
.price-plate small { letter-spacing: .14em; }
.plan-board .plan-price { color: #fff; }
.plan-board .plan-price .latin { font-size: 2.6rem; }
.plan-board .plan-price span:not(.latin) { color: rgba(255, 255, 255, .8); }
.plan-board .btn-row { margin: 22px 0 14px; }
.plan-board .btn-row .btn { min-height: 54px; padding: 12px 26px; font-size: 1rem; }
.plan-board .plan-note { color: rgba(255, 255, 255, .72); margin: 0 0 6px; }
.plan-board .plan-note a { color: #fff; }
.plan-board .btn-primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); box-shadow: 0 3px 0 var(--amber-deep); }
.result-card .eyebrow { margin-bottom: 4px; }

.plan-price { font: 900 2.6rem/1.1 var(--latin); margin: 6px 0 10px; letter-spacing: -.02em; }
.plan-price span:not(.latin) { font: 600 .95rem/1 var(--font); color: var(--muted); letter-spacing: 0; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.plan-card { display: flex; flex-direction: column; }
.plan-card ul { padding-left: 1.3em; line-height: 1.95; flex: 1; }
.plan-premium { border: 2px solid var(--sign); }
.plan-actions { display: grid; gap: 10px; }
.purchase-steps { padding-left: 1.5em; line-height: 2; }
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 16px; }
.shots figure { margin: 0; font-size: .85rem; line-height: 1.6; }
.shots img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 10px; box-shadow: var(--shadow-lift); transition: transform .35s var(--ease); background: var(--surface-2); }
.shots figure:hover img { transform: translateY(-4px) rotate(-1deg); }

/* ---------- guide page ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin: 0 0 18px; }
.facts div { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; }
.facts dt { font-size: .74rem; font-weight: 800; color: var(--muted); letter-spacing: .04em; }
.facts dd { margin: 4px 0 0; font-weight: 700; line-height: 1.6; }
.facts dd.big { font: 900 1.7rem/1.1 var(--latin); }
.legal-list { display: grid; grid-template-columns: minmax(8em, 13em) minmax(0, 1fr); gap: 10px 20px; margin: 0; }
.legal-list dt { font-weight: 800; }
.legal-list dd { margin: 0; }
.plain-list { margin: 0; padding-left: 1.1em; }
.sample-list { display: grid; gap: 16px; counter-reset: sample; }
.sample-q { margin: 0; }
.sample-q h3 { display: flex; align-items: center; gap: 10px; font-size: .78rem; letter-spacing: .14em; color: var(--muted); font-family: var(--latin); margin-bottom: 12px; }
.sample-q h3 .mile { font-size: initial; letter-spacing: 0; }
.sample-q .q-text .en, .sample-q .q-text .ja { display: block; }
.sample-choices { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.sample-choices li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; }
.sample-choices .key { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-3); font: 900 .92rem/1 var(--latin); padding-top: 2px; }
.sample-choices .en, .sample-choices .ja { display: block; }
.sample-choices .en { font-family: var(--latin); font-weight: 700; }
.sample-choices .ja { color: var(--muted); font-size: .9rem; }
.sample-q details > summary { display: inline-flex; align-items: center; min-height: 40px; padding: 4px 14px 4px 8px; border-radius: 10px; background: var(--surface-3); }
.sample-q details[open] > summary { margin-bottom: 10px; }
.guide-page details p .en, .guide-page details p .ja { display: inline; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: step; position: relative; padding: 12px 14px 12px 58px; background: var(--surface-2); border-radius: 14px; line-height: 1.7; }
.steps li::before { content: counter(step); position: absolute; left: 14px; top: 12px; width: 30px; height: 30px; display: grid; place-items: center; background: var(--sign); color: #fff; border-radius: 7px; font: 900 .95rem/1 var(--latin); padding-top: 2px; box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 3.5px #fff; }
.faq h3 { margin-top: 1.2em; }
.faq h3::before { content: "Q"; display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px; border-radius: 6px; background: var(--amber); color: var(--amber-ink); font: 900 .85rem/1 var(--latin); vertical-align: 1px; padding-top: 2px; }
.feature-list { padding-left: 1.3em; line-height: 1.9; }

.sample-label { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sample-label .tag { letter-spacing: .02em; font-family: var(--font); }
.answer-body { padding: 4px 2px 0; }
.answer-line .en, .answer-line .ja { display: inline; }
.answer-line .ja::before { content: " / "; color: var(--muted); }
[data-lang="ja"] .answer-line .ja::before { content: ""; }
.cat-table .bar-col { width: 34%; }
.cat-table td.bar-col { vertical-align: middle; }
.fine-print { margin: 16px 0 0; }

/* ---------- premium app reference screens ---------- */
.question-image { margin: 18px auto 24px; max-width: 420px; text-align: center; }
.question-image img { display: block; width: 100%; height: auto; background: #eef3f6; border: 1px solid var(--line); border-radius: 16px; }
.question-image figcaption { margin-top: 8px; font-size: .78rem; color: var(--muted); }
.question-image figcaption .en, .question-image figcaption .ja { display: block; }
.guide-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.guide-filters .btn { min-height: 40px; border-radius: 999px; padding: 6px 16px; }
.guide-filters [aria-pressed="true"] { background: var(--asphalt); color: #fff; border-color: var(--asphalt); }
.guide-section { margin: 32px 0; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.guide-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; min-width: 0; box-shadow: var(--shadow); transition: transform .3s var(--ease), box-shadow .3s; }
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.guide-card .question-image { margin: 0; padding: 14px; background: var(--surface-2); max-width: none; }
.guide-card .question-image img { aspect-ratio: 400 / 260; object-fit: contain; border: 0; background: transparent; }
.guide-card figcaption { font-size: .72rem; }
.guide-copy { padding: 18px; }
.guide-copy h3 { margin: 0; font-size: 1.05rem; }
.guide-copy .en, .guide-copy .ja { display: block; }
.guide-copy h3 .en { font-family: var(--latin); }
.guide-copy p { font-size: .9rem; line-height: 1.7; }
.guide-copy .ja { margin-top: 5px; }
.guide-copy details { margin-top: 14px; font-size: .8rem; }
.guide-copy .source { overflow-wrap: anywhere; }
.notes-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 24px 0; }
.notes-toolbar select { font: inherit; color: var(--text); background: var(--surface); padding: 10px 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; max-width: 100%; }
.note-card { margin: 18px 0; }
.note-card h3 { color: var(--primary); font-size: 1.05rem; }
.note-answer { background: var(--primary-soft); padding: 16px; border-radius: 14px; }
.note-answer .en, .note-answer .ja { display: block; }
.note-explanation { line-height: 1.95; }
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.comparison-grid section { background: var(--surface-2); padding: 18px; border-radius: 14px; border-top: 4px solid var(--sign); }
.comparison-grid section:first-child { border-top-color: var(--ng); }
.comparison-grid h4 { margin: 0 0 8px; }
.comparison-grid p { margin: 0; line-height: 1.9; }
.note-reference { border-top: 1px dashed var(--line); margin-top: 16px; padding-top: 16px; }
.note-reference .en, .note-reference .ja { display: block; }
.premium-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.premium-heading h2 { margin: 0; }

/* Development directory (static build only) */
.state-search { margin: 24px 0; }
.state-search label { display: block; font-weight: 800; margin-bottom: 6px; }
.state-search input { width: 100%; font: inherit; padding: 13px 16px; color: var(--text); background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 14px; }
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.state-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--muted); }
.state-card.ready { border: 2px solid var(--sign); color: var(--text); }
.state-card.ready:hover { background: var(--primary-soft); }
.state-code { display: grid; place-items: center; height: 40px; border-radius: 8px; background: var(--sign); color: #fff; font: 900 .95rem/1 var(--latin); padding-top: 2px; box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 3.5px #fff; }
.state-card:not(.ready) .state-code { background: var(--surface-3); color: var(--muted); box-shadow: none; }
.state-en { display: block; font-size: .84rem; font-family: var(--latin); }
.state-status { grid-column: 2; font-size: .84rem; }
.ready .state-status { color: var(--primary); font-weight: 800; }

/* ---------- legal ---------- */
.legal-hero .eyebrow { margin-bottom: 8px; }
.legal-toc ul a { text-decoration: none; }
.legal-toc ul a::before { content: "→ "; font-family: var(--latin); color: var(--muted); }

.legal .hero { margin-bottom: 22px; }
.legal nav.card ul { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; font-weight: 800; }
.legal h3 { margin-top: 1.4em; font-size: 1rem; }
.legal .card { max-width: 860px; }

/* ---------- account dialog ---------- */
.dialog { border: 0; border-radius: 22px; padding: 26px; max-width: 440px; width: calc(100% - 32px); background: var(--surface); color: var(--text); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55); }
.dialog::backdrop { background: rgba(15, 17, 19, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog[open] { animation: dialog-in .35s var(--ease); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.account-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.account-heading h2 { margin: 0; font-size: 1.25rem; }
.account-dialog { max-height: calc(100dvh - 40px); overflow: auto; }
.account-dialog .btn-row { margin-top: 14px; }
.account-dialog label { display: block; font-weight: 800; font-size: .88rem; }
.account-input { display: block; width: 100%; max-width: 420px; padding: 13px 14px; margin: 8px 0 16px; font: inherit; color: var(--text); background: var(--surface-2); border: 1.5px solid var(--line-strong); border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
.account-input:focus { outline: none; border-color: var(--sign); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sign) 22%, transparent); }
#account-message:not(:empty) { padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); font-size: .9rem; }

/* ---------- footer ---------- */
.footer { position: relative; background: var(--asphalt); color: rgba(255, 255, 255, .72); font-size: .8rem; margin-top: 24px; --focus: var(--amber); }
.footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: repeating-linear-gradient(90deg, var(--amber) 0 36px, transparent 36px 64px); opacity: .9; }
.footer-inner { max-width: 1160px; margin: 0 auto; padding: 40px 24px 36px; }
.footer a { color: #fff; }
.footer strong { color: #fff; }
.footer ul { margin: 4px 0 10px; padding-left: 1.2em; }
.footer p:last-child { margin-bottom: 0; }
.footer-inner > p:last-child a { font-weight: 700; }

.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; padding-bottom: 24px; margin-bottom: 22px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.footer-brand { color: #fff; }
.footer-brand .brand-text small { color: rgba(255, 255, 255, .6); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-weight: 700; font-size: .84rem; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-notes { max-width: 52em; line-height: 1.85; }

/* ---------- ads (free pages) ---------- */
.ad-box { margin: 32px 0; }
.ad-box .ad-label { margin: 0 0 6px; font-size: .72rem; color: var(--muted); letter-spacing: .08em; }
.ad-box:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }

/* ---------- motion ---------- */
@keyframes sign-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes tile-in { from { opacity: 0; transform: scale(.4); } 60% { opacity: 1; transform: scale(1.12); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.98); } 45% { transform: scale(1.015); } 100% { transform: none; } }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 60% { transform: translateX(4px); } }
@keyframes fill { from { width: 0; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
#portal > *, #app > * { animation: rise .5s var(--ease) both; }
#portal > :nth-child(2), #app > :nth-child(2) { animation-delay: .04s; }
#portal > :nth-child(3), #app > :nth-child(3) { animation-delay: .08s; }
#portal > :nth-child(n+4), #app > :nth-child(n+4) { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Programmatic focus targets (for screen readers) don't need a visible ring. */
#feedback:focus, #qtitle:focus, main:focus { outline: none; }

/* While a question or result is on screen, the state hero steps aside. */
.is-driving .hero-board, .is-driving .crumbs + .hero-board { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 899px) {
  .hero-board .board { grid-template-columns: minmax(0, 1fr); }
  .hero-state .board-plate, .hero-guide .board-plate { display: none; }
  .board-map { max-width: 560px; }
  .plan-grid, .comparison-grid { grid-template-columns: minmax(0, 1fr); }
  .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  html { scroll-padding-top: 72px; }
  main { padding: 16px 14px 56px; }
  .topbar-inner { padding: 8px 14px; min-height: 60px; gap: 8px; }
  .brand-mark { width: 38px; height: 38px; font-size: .84rem; }
  .brand-text { font-size: .98rem; }
  .brand-text small { display: none; }
  .lang-switch button { padding: 6px 9px; font-size: .74rem; min-height: 32px; }
  .account-nav { padding: 0 12px 0 9px; min-height: 40px; }
  .card { padding: 20px 16px; border-radius: 16px; }
  .board { border-radius: 20px; padding: 30px 22px 26px; }
  .board::before { inset: 7px; border-radius: 14px; border-width: 2.5px; }
  .board h1 { font-size: clamp(1.7rem, 1rem + 4.6vw, 2.2rem); }
  .board .lead { font-size: .95rem; }
  .board-ctas .btn { width: 100%; }
  .board-stats { gap: 12px 26px; margin-top: 24px; padding-top: 18px; }
  .hero-board { margin-bottom: 30px; }
  .section { margin-bottom: 36px; }
  .section-head p:not(.eyebrow) { margin: 2px 0 0; width: 100%; }
  .state-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dir-card-main { padding: 12px 12px 10px; }
  .plate { padding: 4px; margin-bottom: 10px; border-radius: 9px; }
  .plate > span { padding: 7px 9px 5px; border-radius: 6px; }
  .plate b { font-size: 1.6rem; }
  .plate .go-arrow { font-size: 1.1rem; }
  .dir-name { font-size: .95rem; }
  .dir-meta .tag { font-size: .66rem; padding: 4px 6px 3px; }
  .dir-guide { padding: 9px 12px 10px; font-size: .74rem; }
  .mode-card { padding: 18px 16px; column-gap: 14px; }
  .mode-icon { width: 44px; height: 44px; border-radius: 11px; }
  .mode-icon svg { width: 22px; height: 22px; }
  .choice { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; padding: 11px 12px 11px 10px; min-height: 58px; }
  .choice .key { width: 34px; height: 34px; border-radius: 9px; }
  .choice:hover:not([disabled]) { transform: none; }
  .feedback { padding: 16px 16px 16px; }
  .feedback::before { left: 16px; top: 16px; width: 28px; height: 28px; }
  .feedback .verdict { padding-left: 42px; min-height: 30px; }
  .plan-board { grid-template-columns: minmax(0, 1fr); }
  .plan-board .board-plate { display: none; }
  .feedback dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .feedback dd { margin-bottom: 8px; }
  .quiz-nav .btn { flex: 1 1 40%; }
  .quiz-nav .spacer { display: none; }
  .cat-row { grid-template-columns: minmax(0, 1fr) 60px; }
  .cat-row .bar { grid-column: 1 / -1; }
  .legal-list { grid-template-columns: minmax(0, 1fr); }
  .legal-list dd { margin-bottom: 8px; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); }
  .guide-card .question-image img { max-height: 200px; }
  .shots { grid-template-columns: repeat(3, minmax(150px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .shots figure { scroll-snap-align: start; }
  .compare-table { font-size: .84rem; }
  .compare-table th, .compare-table td { padding: 10px 6px; }
  .compare-table thead th { font-size: .7rem; letter-spacing: 0; }
  .compare-table th:first-child { width: 58%; }
  .portal-actions { position: sticky; bottom: 0; z-index: 6; margin: 18px -14px 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .portal-actions .btn { flex: 1 1 auto; }
  .drive-head { gap: 10px; }
  .footer-inner { padding: 34px 16px 30px; }
}
@media (max-width: 480px) {
  .account-label { display: none; }
  .account-nav { width: 40px; padding: 0; justify-content: center; }
  .header-actions { gap: 6px; }
  .brand { gap: 9px; }
}
@media (max-width: 420px) {
  /* Room for login and add-to-home: keep the brand name for screen readers only. */
  .topbar .brand-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 340px) {
  .topbar-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; }
  .header-actions { display: contents; }
  .account-nav { grid-column: 2; grid-row: 1; justify-self: end; }
  .topbar-inner .lang-switch { grid-column: 1 / -1; grid-row: 2; justify-self: end; }
}
@media (min-width: 900px) {
  .portal-actions { margin-top: 18px; }
  .hero-home h1 { font-size: clamp(1.9rem, 3.3vw, 2.75rem); }
  .hero-home .h-line { white-space: nowrap; }
  .sample-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .sample-q .q-text .en { font-size: 1.12rem; }
  .state-cards, .guide-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 700px) {
  .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* License guides (/{state}/license/) */
.fact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fact-list li { padding: 12px 14px 12px 40px; background: var(--surface-2); border-radius: 14px; line-height: 1.8; position: relative; }
.fact-list li::before { content: ""; position: absolute; left: 15px; top: 20px; width: 10px; height: 10px; border-radius: 2px; background: var(--amber); transform: rotate(45deg); }
.fact-list strong { display: block; }
.cite { display: block; margin-top: 4px; font-size: .78rem; color: var(--muted); word-break: break-word; }
.cite a { color: inherit; }
.steps .cite { margin-top: 6px; }
.route-cards .feature { display: flex; flex-direction: column; }
.route-cards .cite { margin-top: 10px; }
.route-link { margin-top: auto; padding-top: 14px; font-weight: 800; text-decoration: none; color: var(--primary); }
.license-page .btn-row { margin-top: 16px; }
.bring-group + .bring-group { margin-top: 18px; }
.bring-group h3 { margin: 0 0 8px; font-size: 1rem; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.check-list li { padding: 10px 14px; background: var(--surface-2); border-radius: 12px; line-height: 1.7; }
.check-list label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check-list input { flex: none; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--sign); }
.check-list input:checked + span { color: var(--muted); text-decoration: line-through; }
.check-list .cite { margin-left: 30px; }
.license-page .legal-toc ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 6px 24px; }
