/* jpanki.cc — light, calm, made for long study sessions.
   One indigo for everything you can press; each JLPT level has its own
   colour (--lv), used for badges, bands and progress. */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --tint: #eef0f6;
  --line: #e3e6ef;
  --line-strong: #cfd4e2;
  --text: #161a2b;
  --muted: #545b70;
  --faint: #8a90a3;
  --primary: #3b4fd8;
  --primary-hover: #2e3fb8;
  --primary-soft: #eceffe;
  --brand: #c8402a;
  --good: #17804a;
  --good-soft: #e3f5ea;
  --bad: #c0392b;
  --bad-soft: #fdecea;
  --warn: #b7791f;
  --lv: #3b4fd8;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(22, 26, 43, 0.06);
  --shadow: 0 1px 2px rgba(22, 26, 43, 0.05), 0 8px 24px rgba(22, 26, 43, 0.06);
  --shadow-lg: 0 2px 6px rgba(22, 26, 43, 0.06), 0 24px 48px rgba(22, 26, 43, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
[lang="ja"] { font-family: var(--font-ja); }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.9rem, 4.4vw, 2.8rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.8vw, 1.8rem); font-weight: 760; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
kbd { font: 600 0.72rem var(--font); background: rgba(0, 0, 0, 0.06); border-radius: 5px; padding: 1px 6px; color: inherit; opacity: 0.75; }
.i { flex: 0 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 800px; }
.narrow-wide { max-width: 960px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 650; }
.skip:focus { left: 12px; color: #fff; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------------ header */

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(1.5) blur(12px); -webkit-backdrop-filter: saturate(1.5) blur(12px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: 0 0 auto; }
.brand:hover { color: var(--text); }
.brand-mark { display: inline-grid; place-items: center; font-weight: 700; font-size: 0.86rem; color: #fff; background: var(--brand); border-radius: 9px; padding: 5px 7px; line-height: 1.15; box-shadow: 0 2px 6px rgba(200, 64, 42, 0.3); }
.brand-name { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.main-nav { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 0; }
.nav-levels, .nav-more { display: flex; gap: 2px; }
.nav-levels { padding: 3px; background: var(--tint); border-radius: 999px; }
.main-nav a { position: relative; text-decoration: none; color: var(--muted); font-weight: 650; font-size: 0.93rem; padding: 6px 12px; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.main-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.9); }
.nav-levels a[aria-current] { background: var(--surface); color: var(--lv); box-shadow: var(--shadow-sm); }
.nav-more a[aria-current] { color: var(--primary); background: var(--primary-soft); }
.due-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 0.72rem; font-weight: 750; display: inline-grid; place-items: center; }
.header-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--text); background: transparent; border: 0; cursor: pointer; font-size: 1.5rem; line-height: 1; }
.icon-btn:hover { background: var(--tint); color: var(--text); }
.lang-switch { font-weight: 750; font-size: 0.82rem; text-decoration: none; color: var(--text); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; }
.lang-switch:hover { border-color: var(--primary); color: var(--primary); }
@media (max-width: 900px) {
  .header-row { flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; }
  .main-nav { order: 3; flex-basis: 100%; overflow-x: auto; padding-bottom: 10px; gap: 10px; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
}

/* ----------------------------------------------------------------- buttons */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 680; font-size: 1rem; line-height: 1.2; text-decoration: none; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 11px 18px; min-height: 46px; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s; }
.btn-lg { padding: 14px 22px; min-height: 52px; font-size: 1.04rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(59, 79, 216, 0.28); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--primary); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--primary); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-done { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-done:hover { border-color: var(--good); color: var(--good); }
.btn-done[aria-pressed="true"] { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.btn-done .when-on, .btn-done[aria-pressed="true"] .when-off { display: none; }
.btn-done[aria-pressed="true"] .when-on, .btn-done .when-off { display: inline-flex; align-items: center; gap: 8px; }

.lv-badge { display: inline-grid; place-items: center; min-width: 40px; padding: 2px 9px; border-radius: 8px; font-weight: 800; font-size: 0.85rem; color: #fff; background: var(--lv); letter-spacing: 0; vertical-align: middle; }
.lv-badge-lg { font-size: 1.05rem; padding: 4px 12px; border-radius: 10px; }

.bar { height: 8px; background: var(--tint); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--lv); border-radius: inherit; transition: width 0.35s ease; }

/* ------------------------------------------------------------------ common */

.section { padding: 64px 0; }
.section-soft { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 24px; max-width: 760px; }
.section-head p { color: var(--muted); margin-top: 8px; }
.section-head.row { display: flex; align-items: center; justify-content: space-between; max-width: none; gap: 16px; }
.section-head.row h2 { display: flex; align-items: center; gap: 10px; }
.section-head h2 small { font-size: 0.95rem; color: var(--faint); font-weight: 600; }
.block { margin-top: 56px; }
.lead { font-size: 1.12rem; color: var(--muted); margin-top: 14px; max-width: 42em; }
.page-head { padding: 8px 0 28px; }
.lesson-eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-weight: 650; font-size: 0.92rem; margin-bottom: 10px; }

.crumbs { padding: 18px 0 10px; font-size: 0.88rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li { color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--faint); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--primary); text-decoration: underline; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.93rem; cursor: pointer; user-select: none; }
.switch input { width: 18px; height: 18px; accent-color: var(--primary); }

/* -------------------------------------------------------------------- home */

.hero { position: relative; overflow: hidden; padding: 60px 0 0; background:
  radial-gradient(700px 360px at 8% 0%, rgba(59, 79, 216, 0.10), transparent 70%),
  radial-gradient(600px 340px at 92% 10%, rgba(200, 64, 42, 0.09), transparent 70%),
  radial-gradient(500px 300px at 60% 100%, rgba(35, 148, 106, 0.08), transparent 70%), var(--surface);
  border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; gap: 40px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.25fr 0.75fr; } }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.86rem; color: var(--good); background: var(--good-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2rem, 4.8vw, 3.2rem); max-width: 16em; }
.hero-search { display: flex; align-items: center; gap: 10px; margin-top: 28px; padding: 8px 8px 8px 16px; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow); max-width: 640px; }
.hero-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow); }
.hero-search .i { color: var(--faint); }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 1.05rem; background: transparent; color: var(--text); padding: 8px 0; }
.hero-try { margin-top: 12px; color: var(--muted); font-size: 0.92rem; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.hero-try a { text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-weight: 600; }
.hero-try a:hover { border-color: var(--primary); }

.hero-visual { position: relative; height: 340px; display: none; }
@media (min-width: 960px) { .hero-visual { display: block; } }
.stack-card { position: absolute; left: 50%; top: 50%; width: 270px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.stack-card.c3, .stack-card.c2 { height: 300px; display: grid; place-items: center; font-size: 4.2rem; font-weight: 700; color: var(--line-strong); }
.stack-card.c3 { transform: translate(-30%, -54%) rotate(10deg); }
.stack-card.c2 { transform: translate(-64%, -50%) rotate(-7deg); }
.stack-card.c1 { transform: translate(-50%, -50%); padding: 26px 22px 18px; display: grid; justify-items: center; gap: 2px; text-align: center; }
.sc-read { color: var(--muted); letter-spacing: 0.18em; }
.sc-front { font-size: 4.4rem; font-weight: 700; line-height: 1.15; }
.sc-hv { font-weight: 800; letter-spacing: 0.14em; color: var(--brand); font-size: 0.9rem; }
.sc-mean { font-weight: 650; margin-top: 2px; }
.sc-rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; margin-top: 16px; }
.sc-rate span { font-size: 0.75rem; font-weight: 700; padding: 6px 0; border-radius: 8px; background: var(--tint); color: var(--muted); }
.sc-rate span.on { background: var(--primary); color: #fff; }

.stats-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 48px; background: var(--line); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
@media (min-width: 760px) { .stats-strip { grid-template-columns: repeat(4, 1fr); } }
.stats-strip li { background: var(--surface); padding: 18px 20px; display: flex; flex-direction: column; }
.stats-strip strong { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; }
.stats-strip span { color: var(--muted); font-size: 0.92rem; }

.today { padding: 40px 0 0; }
.today h2 { font-size: 1.25rem; margin-bottom: 14px; }
.today-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .today-grid { grid-template-columns: 1fr 1fr; } }
.today-card { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: var(--radius); text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-left: 5px solid var(--primary); }
.today-card:hover { color: var(--text); border-color: var(--primary); }
.today-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 650; font-size: 0.9rem; }
.today-main { font-weight: 750; font-size: 1.1rem; }

.level-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .level-grid { grid-template-columns: repeat(2, 1fr); } }
.level-card { position: relative; height: 100%; display: flex; flex-direction: column; gap: 12px; padding: 24px; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform 0.15s, box-shadow 0.15s; }
.level-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--lv); }
.level-card:hover { color: var(--text); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.level-card-top { display: flex; align-items: center; gap: 12px; }
.level-card .lv-badge { font-size: 1.15rem; padding: 4px 12px; border-radius: 10px; }
.level-tier { font-weight: 700; color: var(--muted); }
.level-about { color: var(--text); }
.level-figures { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 4px 22px; color: var(--muted); font-size: 0.88rem; }
.level-figures span { display: flex; flex-direction: column; }
.level-figures strong { color: var(--text); font-size: 1.15rem; font-weight: 800; }
@media (max-width: 460px) { .level-figures { grid-template-columns: repeat(2, auto); } }
.level-progress { display: grid; gap: 4px; font-size: 0.86rem; color: var(--good); font-weight: 650; }
.level-cta { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--lv); font-weight: 750; }

.feature-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
.feature { height: 100%; display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: var(--radius); text-decoration: none; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); transition: border-color 0.15s, transform 0.15s; }
.feature:hover { color: var(--text); border-color: var(--primary); transform: translateY(-2px); }
.feature-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); margin-bottom: 6px; }
.feature-title { font-weight: 750; font-size: 1.08rem; }
.feature-text { color: var(--muted); font-size: 0.95rem; }

.split { display: grid; gap: 32px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .split { grid-template-columns: 1.6fr 0.8fr; } }
.steps { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .steps { grid-template-columns: 1fr 1fr; } }
.step { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step-num { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; }
.step p { color: var(--muted); margin-top: 4px; font-size: 0.96rem; }

.kotd { position: sticky; top: 96px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; text-align: center; }
.kotd-label { font-weight: 750; color: var(--muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; }
.kotd-link { display: grid; justify-items: center; text-decoration: none; color: var(--text); margin-top: 6px; }
.kotd-link:hover { color: var(--text); }
.kotd-char { font-size: 6rem; font-weight: 700; line-height: 1.2; }
.kotd-hv { font-weight: 800; letter-spacing: 0.16em; color: var(--brand); }
.kotd-level { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.kotd-more { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 650; font-size: 0.92rem; margin-top: 10px; }

.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 10px; }
.faq-item summary { cursor: pointer; list-style: none; padding: 16px 20px; font-weight: 680; display: flex; justify-content: space-between; gap: 16px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--primary); font-weight: 700; font-size: 1.3rem; line-height: 1; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 0 20px 18px; color: var(--muted); }

/* --------------------------------------------------------------- level hub */

.level-hero { background: linear-gradient(180deg, color-mix(in srgb, var(--lv) 9%, white), var(--surface)); border-bottom: 1px solid var(--line); }
.level-hero-grid { display: grid; gap: 28px; grid-template-columns: 1fr; padding: 6px 0 28px; align-items: start; }
@media (min-width: 960px) { .level-hero-grid { grid-template-columns: 1.5fr 0.8fr; } }
.level-hero-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; color: var(--muted); font-size: 0.92rem; }
.facts strong { color: var(--text); font-size: 1.05rem; margin-right: 2px; }
.progress-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: grid; gap: 10px; }
.progress-title { font-weight: 750; }
.progress-count { color: var(--muted); }
.progress-count strong { color: var(--text); font-size: 1.4rem; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; text-decoration: none; color: var(--muted); font-weight: 680; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--lv); border-bottom-color: var(--lv); }

.lesson-list { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .lesson-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .lesson-list { grid-template-columns: 1fr 1fr 1fr; } }
.lesson-item { display: grid; grid-template-columns: 38px 1fr auto 20px; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; text-decoration: none; color: var(--text); transition: border-color 0.15s; }
.lesson-item:hover { color: var(--text); border-color: var(--lv); }
.lesson-num { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--tint); color: var(--muted); font-weight: 750; font-size: 0.88rem; }
.lesson-name { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-count { color: var(--faint); font-size: 0.84rem; white-space: nowrap; }
.lesson-done { color: var(--good); visibility: hidden; display: inline-flex; }
.is-done .lesson-done { visibility: visible; }
.is-done .lesson-num { background: var(--good-soft); color: var(--good); }

.wide-card { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 22px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.wide-card:hover { color: var(--text); border-color: var(--lv); }
.wide-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; color: var(--lv); background: color-mix(in srgb, var(--lv) 12%, white); }
.wide-text { flex: 1 1 300px; display: flex; flex-direction: column; gap: 2px; }
.wide-text span { color: var(--muted); }

.test-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.test-card { height: 100%; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: border-color 0.15s, transform 0.15s; }
.test-card:hover { color: var(--text); border-color: var(--lv); transform: translateY(-1px); }
.test-name { font-weight: 720; }
.test-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--muted); font-size: 0.86rem; }
.test-best { align-self: flex-start; font-size: 0.8rem; font-weight: 750; padding: 2px 10px; border-radius: 999px; background: var(--tint); color: var(--muted); }
.is-pass .test-best { background: var(--good-soft); color: var(--good); }

.kanji-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); }
.kanji-grid a { display: flex; flex-direction: column; align-items: center; padding: 10px 4px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: border-color 0.15s, transform 0.15s; }
.kanji-grid a:hover { border-color: var(--lv); color: var(--text); transform: translateY(-1px); }
.kanji-grid span { font-size: 1.85rem; line-height: 1.2; }
.kanji-grid small { color: var(--muted); font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.kanji-grid.compact { margin-bottom: 16px; }

/* ------------------------------------------------------------------ lesson */

.course { display: grid; gap: 24px; grid-template-columns: 1fr; padding-bottom: 32px; }
@media (min-width: 980px) { .course { grid-template-columns: 270px 1fr; gap: 36px; } }
.toc { min-width: 0; }
@media (min-width: 980px) { .toc-box { position: sticky; top: 88px; } }
.toc-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toc-box summary { cursor: pointer; padding: 12px 16px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; }
.toc-box summary::-webkit-details-marker { display: none; }
.toc-box summary::after { content: "▾"; color: var(--muted); }
.toc-box[open] summary { border-bottom: 1px solid var(--line); }
.toc-box[open] summary::after { content: "▴"; }
.toc-list { max-height: min(72vh, 680px); overflow-y: auto; padding: 6px; }
.toc-item { display: grid; grid-template-columns: 28px 1fr 18px; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 9px; text-decoration: none; color: var(--text); font-size: 0.93rem; }
.toc-item:hover { background: var(--tint); color: var(--text); }
.toc-item.is-current { background: color-mix(in srgb, var(--lv) 12%, white); color: var(--lv); font-weight: 700; }
.toc-num { color: var(--faint); font-size: 0.8rem; text-align: right; }
.toc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lesson { min-width: 0; }
.lesson-head { padding: 4px 0 18px; }
.lesson-head h1 { font-size: clamp(1.9rem, 4.2vw, 2.6rem); }
.lesson-topic { font-size: 1.12rem; color: var(--muted); margin-top: 4px; }
.lesson-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }

.study-bar { position: sticky; top: 66px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; background: var(--bg); padding: 10px 0; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
@media (max-width: 900px) { .study-bar { top: 104px; } }
.study-label { font-weight: 700; color: var(--muted); font-size: 0.9rem; }
.toggle { font: inherit; font-size: 0.9rem; font-weight: 650; cursor: pointer; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; }
.toggle:hover { border-color: var(--primary); }
.toggle[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.study-hint { color: var(--muted); font-size: 0.88rem; }

.word-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.word { display: grid; grid-template-columns: 30px minmax(150px, 0.9fr) 1.4fr 42px; align-items: center; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line); scroll-margin-top: 140px; }
.word:first-child { border-top: 0; }
.word:nth-child(even) { background: var(--surface-2); }
.word:target { background: color-mix(in srgb, var(--lv) 10%, white); }
.word-num { color: var(--faint); font-size: 0.82rem; text-align: right; }
.word-jp { display: flex; flex-direction: column; }
.word-front { font-size: 1.65rem; font-weight: 600; line-height: 1.3; }
.word-read { color: var(--muted); font-size: 0.98rem; }
.word-mean { display: flex; flex-direction: column; gap: 2px; }
.word-hv { font-size: 0.78rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); }
.word-gloss { font-size: 1.02rem; }
.word-kanji { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.word-kanji a { font-size: 0.85rem; text-decoration: none; padding: 0 7px; border-radius: 6px; background: var(--tint); color: var(--muted); }
.word-kanji a:hover { background: var(--primary-soft); color: var(--primary); }
.say { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--primary); cursor: pointer; }
.say:hover { border-color: var(--primary); background: var(--primary-soft); }
@media (max-width: 620px) {
  .word { grid-template-columns: 1fr 42px; grid-template-areas: "jp say" "mean mean"; gap: 4px 12px; padding: 12px 14px; }
  .word-num { display: none; }
  .word-jp { grid-area: jp; flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .word-mean { grid-area: mean; }
  .say { grid-area: say; }
}
.hide-meaning .word, .hide-reading .word { cursor: pointer; }
.hide-meaning .word-mean, .hide-reading .word-read { position: relative; color: transparent !important; user-select: none; }
.hide-meaning .word-mean *, .hide-reading .word-read * { visibility: hidden; }
.hide-meaning .word-mean::after, .hide-reading .word-read::after { content: ""; position: absolute; inset: 2px 0; background: var(--tint); border-radius: 6px; }
.word.revealed .word-mean, .word.revealed .word-read { color: inherit !important; user-select: auto; }
.word.revealed .word-read { color: var(--muted) !important; }
.word.revealed .word-mean *, .word.revealed .word-read * { visibility: visible; }
.word.revealed .word-mean::after, .word.revealed .word-read::after { display: none; }

.pager { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: 28px; }
.pager-link { display: flex; flex-direction: column; gap: 2px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; min-width: 0; }
.pager-link:hover { border-color: var(--primary); }
.pager-link.next { text-align: right; grid-column: 2; }
.pager-dir { font-size: 0.85rem; color: var(--muted); }
.pager-name { font-weight: 700; color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------------------------------------------------------------- flashcards */

.flash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(22, 26, 43, 0.55); backdrop-filter: blur(4px); }
.flash-box { width: min(560px, 100%); background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 18px 20px 22px; display: grid; gap: 14px; }
.flash-top { display: flex; justify-content: space-between; align-items: center; }
.flash-count { font-weight: 700; color: var(--muted); }
.flash-card { min-height: 280px; display: grid; place-content: center; text-align: center; gap: 8px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); padding: 24px; }
.fc-level { color: var(--faint); font-size: 0.85rem; font-weight: 650; }
.fc-front { font-size: clamp(2.6rem, 9vw, 3.8rem); font-weight: 700; line-height: 1.2; }
.fc-back { display: grid; gap: 4px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.fc-read { font-size: 1.3rem; color: var(--muted); }
.fc-hv { font-weight: 800; letter-spacing: 0.14em; color: var(--brand); font-size: 0.9rem; }
.fc-mean { font-size: 1.2rem; font-weight: 650; }
.rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rate button { display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; cursor: pointer; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
.rate button small { color: var(--muted); font-size: 0.76rem; }
.rate button[data-rate="0"] { color: var(--bad); }
.rate button[data-rate="0"]:hover { background: var(--bad-soft); border-color: var(--bad); }
.rate button[data-rate="1"]:hover { background: #fff6e5; border-color: var(--warn); }
.rate button[data-rate="2"] { color: var(--good); }
.rate button[data-rate="2"]:hover { background: var(--good-soft); border-color: var(--good); }
.rate button[data-rate="3"] { color: var(--primary); }
.rate button[data-rate="3"]:hover { background: var(--primary-soft); border-color: var(--primary); }
.flash-done { text-align: center; display: grid; gap: 10px; padding: 18px 8px; }
.flash-done-title { font-size: 1.5rem; font-weight: 800; }
.flash-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.flash .bar span { background: var(--primary); }

/* ------------------------------------------------------------------ review */

.review-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.review-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; }
.review-stats strong { font-size: 2rem; font-weight: 800; }
.review-stats span { color: var(--muted); font-size: 0.9rem; }
.review-empty, .review-clear { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; display: grid; gap: 10px; justify-items: start; }
.review-empty p, .review-clear p { color: var(--muted); }

/* ------------------------------------------------------------------ search */

.inline-search { display: flex; align-items: center; gap: 10px; margin-top: 20px; max-width: 520px; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 10px 14px; }
.inline-search input { flex: 1; border: 0; outline: 0; font: inherit; background: transparent; }
.inline-search .i { color: var(--faint); }
.search-status { color: var(--muted); font-weight: 650; margin: 4px 0 14px; }
.result-list { display: grid; gap: 8px; }
.result { display: grid; grid-template-columns: minmax(140px, 0.8fr) 1.4fr auto; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.result:hover { color: var(--text); border-color: var(--primary); }
.result-jp { display: flex; flex-direction: column; }
.result-front { font-size: 1.35rem; font-weight: 600; }
.result-read { color: var(--muted); font-size: 0.92rem; }
.result-mean em { font-style: normal; font-weight: 750; color: var(--brand); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.06em; }
@media (max-width: 560px) { .result { grid-template-columns: 1fr auto; } .result-mean { grid-column: 1 / -1; grid-row: 2; } }

/* ------------------------------------------------------------------- kanji */

.kanji-hero { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: center; padding: 8px 0 12px; }
@media (min-width: 700px) { .kanji-hero { grid-template-columns: auto 1fr; gap: 36px; } }
.kanji-big { width: 200px; height: 200px; display: grid; place-items: center; font-size: 8.5rem; line-height: 1; font-weight: 600; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 100% 50%, 50% 100%; background-position: center; }
.kanji-hero h1 { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; font-size: 2.6rem; }
.kanji-hv { font-size: 1.4rem; font-weight: 800; letter-spacing: 0.14em; color: var(--brand); }
.kanji-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 14px 0 16px; }
.kanji-facts dt { color: var(--muted); font-weight: 650; }
.kanji-facts dd { margin: 0; font-weight: 650; }
.kanji-words { margin-top: 36px; }
.kanji-words h2 { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; margin-bottom: 12px; }
.kanji-words h2 small { color: var(--faint); font-size: 0.95rem; }
.kw-list { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .kw-list { grid-template-columns: 1fr 1fr; } }
.kw { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "front read" "mean mean"; gap: 0 12px; align-items: baseline; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.kw:hover { color: var(--text); border-color: var(--lv); }
.kw-front { grid-area: front; font-size: 1.4rem; font-weight: 600; }
.kw-front mark { background: none; color: var(--lv); }
.kw-read { grid-area: read; color: var(--muted); }
.kw-mean { grid-area: mean; font-size: 0.95rem; }
.kw-mean em { font-style: normal; color: var(--brand); font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ----------------------------------------------------------------- grammar */

.quiz { margin: 4px 0 32px; }
.quiz-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.quiz-count { font-weight: 750; }
.quiz-score { color: var(--muted); }
.quiz-top .bar { flex-basis: 100%; }
.quiz .bar span { background: var(--lv); }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.q-sentence { font-size: 1.45rem; line-height: 1.9; font-weight: 500; }
.blank { display: inline-block; min-width: 3.2em; text-align: center; color: var(--primary); border-bottom: 2px solid var(--primary); line-height: 1.3; margin: 0 2px; }
.answered .blank { color: var(--good); border-color: var(--good); font-weight: 650; }
.q-hint { color: var(--muted); margin-top: 6px; }
.choices { display: grid; gap: 10px; grid-template-columns: 1fr; margin-top: 22px; }
@media (min-width: 600px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice { display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; font: inherit; font-family: var(--font-ja); font-size: 1.12rem; color: var(--text); background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; min-height: 54px; transition: border-color 0.15s, background 0.15s; }
.choice:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); }
.choice:disabled { cursor: default; }
.choice-key, .opt-key { flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: var(--tint); color: var(--muted); font-family: var(--font); font-size: 0.8rem; font-weight: 750; }
.choice.correct { border-color: var(--good); background: var(--good-soft); }
.choice.correct .choice-key { background: var(--good); color: #fff; }
.choice.wrong { border-color: var(--bad); background: var(--bad-soft); }
.choice.wrong .choice-key { background: var(--bad); color: #fff; }
.feedback { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.q-result { font-weight: 750; font-size: 1.08rem; margin-bottom: 14px; }
.q-result.good { color: var(--good); }
.q-result.bad { color: var(--bad); }
.explain { display: grid; grid-template-columns: 1fr; gap: 2px 20px; margin: 0 0 20px; }
@media (min-width: 600px) { .explain { grid-template-columns: 150px 1fr; gap: 10px 20px; } }
.explain dt { color: var(--muted); font-size: 0.88rem; font-weight: 700; padding-top: 2px; }
.explain dd { margin: 0 0 10px; }
@media (min-width: 600px) { .explain dd { margin: 0; } }
.quiz-summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.summary-score { font-size: 1.15rem; margin-top: 8px; }
.summary-score strong { color: var(--primary); font-size: 1.5rem; }
.quiz-summary h3 { margin-top: 24px; }
.missed { margin-top: 10px; display: grid; gap: 8px; }
.missed li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.missed-sentence { font-size: 1.08rem; }
.missed-point { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.summary-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ------------------------------------------------------------------- exams */

.exam-intro { max-width: 820px; padding-bottom: 24px; }
.exam-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 20px 0; }
@media (min-width: 700px) { .exam-facts { grid-template-columns: repeat(4, 1fr); } }
.exam-facts li { display: flex; align-items: center; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--muted); font-size: 0.92rem; }
.exam-facts li .i { color: var(--lv); }
.exam-facts strong { color: var(--text); font-size: 1.1rem; }
.exam-rules { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; display: grid; gap: 14px; justify-items: start; }
.exam-rules h2 { font-size: 1.2rem; }
.exam-rules ul { display: grid; gap: 8px; }
.exam-rules li { position: relative; padding-left: 22px; color: var(--muted); }
.exam-rules li::before { content: ""; position: absolute; left: 4px; top: 0.7em; width: 7px; height: 7px; border-radius: 50%; background: var(--lv); }
.exam-best { font-weight: 700; color: var(--good); }

.exam { display: grid; gap: 24px; grid-template-columns: 1fr; padding-bottom: 32px; }
@media (min-width: 1000px) { .exam { grid-template-columns: 1fr 300px; } }
.exam-main { min-width: 0; }
.exam-toolbar { display: flex; justify-content: flex-end; padding: 6px 0 12px; }
.ex-sec { margin-bottom: 28px; }
.ex-sec-title { font-family: var(--font-ja); font-size: 1.2rem; padding: 10px 16px; border-radius: 12px; background: color-mix(in srgb, var(--lv) 10%, white); color: var(--lv); margin-bottom: 14px; }
.ex-passage { background: #fffdf7; border: 1px solid #efe6cf; border-radius: var(--radius); padding: 22px 24px; margin-bottom: 14px; }
.ex-passage-title { font-weight: 700; color: var(--muted); font-size: 0.9rem; margin-bottom: 10px; }
.ex-passage-text { font-size: 1.12rem; line-height: 2.05; }
.ex-q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 12px; scroll-margin-top: 96px; }
.ex-qhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ex-qnum { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--tint); font-weight: 800; }
.ex-flag { font: inherit; font-size: 0.82rem; font-weight: 650; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.ex-flag.on { background: #fff6e5; color: var(--warn); border-color: var(--warn); }
.ex-prompt { font-size: 1.1rem; line-height: 1.95; }
.ex-prompt u { text-decoration-thickness: 2px; text-underline-offset: 4px; }
.ex-opts { display: grid; gap: 8px; margin-top: 14px; }
@media (min-width: 640px) { .ex-opts { grid-template-columns: 1fr 1fr; } }
.ex-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; border: 1.5px solid var(--line-strong); cursor: pointer; font-size: 1.05rem; transition: border-color 0.15s, background 0.15s; }
.ex-opt:hover { border-color: var(--primary); }
.ex-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ex-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.ex-opt:has(input:checked) .opt-key { background: var(--primary); color: #fff; }
.ex-opt:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
.ex-opt.correct { border-color: var(--good); background: var(--good-soft); }
.ex-opt.correct .opt-key { background: var(--good); color: #fff; }
.ex-opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.ex-opt.wrong .opt-key { background: var(--bad); color: #fff; }
.exam-body rt { display: none; }
.exam-body.show-furigana rt { display: ruby-text; font-size: 0.55em; color: var(--muted); }
.exam-body.only-wrong .ex-q.is-right { display: none; }
.ex-expl { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 4px; }
.ex-expl-head { font-weight: 750; }
.is-right .ex-expl-head { color: var(--good); }
.is-wrong .ex-expl-head { color: var(--bad); }
.ex-expl-label { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.exam-submit-row { display: flex; justify-content: center; padding: 12px 0; }
.exam.is-done .exam-submit-row { display: none; }

.exam-side { position: relative; }
.exam-panel { position: sticky; top: 86px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: grid; gap: 12px; }
.exam-timer { display: flex; align-items: center; gap: 8px; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.exam-timer.low { color: var(--bad); }
.exam-answered { color: var(--muted); font-weight: 650; }
.qmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 5px; max-height: 42vh; overflow-y: auto; padding: 2px; }
.qmap-sec { grid-column: 1 / -1; font-size: 0.74rem; font-weight: 750; color: var(--faint); margin-top: 4px; }
.qmap button { height: 32px; font: inherit; font-size: 0.8rem; font-weight: 700; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); cursor: pointer; }
.qmap button.answered { background: var(--primary); border-color: var(--primary); color: #fff; }
.qmap button.flagged { box-shadow: inset 0 -3px 0 var(--warn); }
.qmap-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 0.8rem; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.lg.answered { background: var(--primary); }
.lg.flagged { background: var(--surface); box-shadow: inset 0 -3px 0 var(--warn); border: 1px solid var(--line-strong); }
@media (max-width: 999px) {
  .exam-side { position: sticky; bottom: 0; z-index: 20; order: 2; }
  .exam-panel { position: static; border-radius: 16px 16px 0 0; padding: 10px 14px 12px; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 12px; }
  .exam-panel .bar { grid-column: 1 / -1; grid-row: 2; height: 6px; }
  .exam-panel .qmap, .exam-panel .qmap-legend { display: none; }
  .exam-panel .btn { width: auto; min-height: 40px; padding: 8px 14px; font-size: 0.92rem; }
  .exam-timer { font-size: 1.15rem; }
  .exam-answered { white-space: nowrap; font-size: 0.88rem; }
}

.exam-result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; margin: 8px 0 32px; }
.result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-bottom: 24px; }
.score-ring { --pct: 0; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--lv) calc(var(--pct) * 1%), var(--tint) 0); position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); }
.score-ring span { position: relative; font-size: 1.8rem; font-weight: 800; }
.result-line { font-size: 1.1rem; margin-top: 6px; }
.result-note { color: var(--muted); margin-top: 6px; max-width: 34em; }
.breakdown { display: grid; gap: 8px; margin: 12px 0 24px; }
.breakdown li { display: grid; grid-template-columns: 80px 1fr 56px; align-items: center; gap: 12px; font-size: 0.95rem; }
.bd-name { font-family: var(--font-ja); font-weight: 700; }
.bd-score { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.breakdown li.weak .bar span { background: var(--bad); }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.result-actions .switch { margin-right: auto; }

/* ------------------------------------------------------------------ footer */

.site-footer { margin-top: 72px; background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.93rem; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 28px; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 1.4fr 0.8fr 1.2fr; } }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.footer-title { font-weight: 750; color: var(--text); margin-bottom: 8px; }
.footer-links { display: grid; gap: 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--primary); }
.sp { white-space: nowrap; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 16px; padding-bottom: 28px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--faint); }

.lang-hint { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 8px; background: var(--text); color: #fff; border-radius: 999px; padding: 8px 8px 8px 18px; box-shadow: var(--shadow-lg); }
.lang-hint a { color: #fff; font-weight: 650; text-decoration: none; }
.lang-hint button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 1.1rem; cursor: pointer; }

.terms-sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 12px; }
.terms-sec h2 { font-size: 1.15rem; margin-bottom: 6px; }
.terms-sec p { color: var(--muted); }

.not-found { padding: 64px 20px; }
.nf-code { font-size: 4rem; font-weight: 700; color: var(--line-strong); }
.not-found .btn { margin-top: 24px; }
