:root {
  --ink: #18323a;
  --muted: #64757a;
  --paper: #fffdf8;
  --surface: #ffffff;
  --teal: #0f766e;
  --teal-dark: #0a5954;
  --teal-soft: #dff4ef;
  --blue: #2878a8;
  --blue-soft: #e5f2fa;
  --amber: #d58b22;
  --amber-soft: #fff1d2;
  --coral: #d9614c;
  --coral-soft: #fee9e4;
  --line: #dce7e4;
  --shadow: 0 18px 50px rgba(29, 69, 70, .11);
  --radius: 24px;
  font-family: "M PLUS Rounded 1c", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 85% 0%, #ddf4ef 0, transparent 30rem), var(--paper); }
button, input { font: inherit; }
button { color: inherit; }
a { color: var(--teal); }
img { max-width: 100%; height: auto; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .7rem 1rem; background: var(--ink); color: white; border-radius: .5rem; }
.skip-link:focus { top: 1rem; }

.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 0 clamp(1rem, 4vw, 4rem); background: rgba(255, 253, 248, .9); border-bottom: 1px solid rgba(205, 221, 217, .7); backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; color: white; background: var(--teal); border-radius: 13px 13px 13px 4px; font-weight: 800; letter-spacing: -.04em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.02rem; }
.brand small { margin-top: .05rem; color: var(--muted); font-size: .68rem; }
.header-actions { display: flex; align-items: center; gap: .55rem; }
.furigana-toggle { display: flex; align-items: center; gap: .4rem; min-height: 40px; padding: .4rem .65rem; color: var(--teal-dark); border: 1px solid #9acfc5; border-radius: 999px; background: var(--teal-soft); font-size: .76rem; font-weight: 700; cursor: pointer; }
.furigana-toggle strong { display: grid; place-items: center; min-width: 28px; padding: .16rem .3rem; color: white; background: var(--teal); border-radius: 999px; font-size: .68rem; }
.furigana-toggle[aria-pressed="false"] { color: var(--muted); border-color: var(--line); background: white; }
.furigana-toggle[aria-pressed="false"] strong { color: var(--muted); background: #e8eeec; }
.beginner-toggle { color: #8a4c13; border-color: #e7bd78; background: #fff4df; }
.beginner-toggle strong { background: #bd671e; }
.beginner-toggle-icon { font-size: 1rem; line-height: 1; }
.profile-button { display: flex; align-items: center; gap: .55rem; padding: .45rem .8rem .45rem .45rem; border: 1px solid var(--line); border-radius: 999px; background: white; cursor: pointer; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--teal-dark); background: var(--teal-soft); font-weight: 800; }

ruby { ruby-align: center; }
rt { color: var(--teal); font-size: .52em; font-weight: 500; letter-spacing: 0; }
body[data-furigana="off"] rt { display: none; }

main { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 3rem 0 7rem; }
.hero { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; min-height: 455px; padding: 2rem 0 3.5rem; }
.eyebrow { display: inline-block; color: var(--teal); font-weight: 800; font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; }
.hero h1, .page-title h1 { margin: .8rem 0 1rem; font-size: clamp(2.4rem, 4.4vw, 3.9rem); line-height: 1.12; letter-spacing: -.055em; }
.hero h1 span, .hero h1 em { display: block; white-space: nowrap; }
.hero h1 em { color: var(--teal); font-style: normal; }
.hero-copy > p { max-width: 42rem; margin: 0; color: var(--muted); font-size: 1.08rem; line-height: 1.9; }
.hero-actions, .study-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }
.button { min-height: 48px; padding: .7rem 1.25rem; border: 0; border-radius: 14px; font-weight: 800; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid rgba(15, 118, 110, .26); outline-offset: 2px; }
.button:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.button-primary { color: white; background: var(--teal); box-shadow: 0 8px 24px rgba(15, 118, 110, .2); }
.button-primary:hover { background: var(--teal-dark); }
.button-quiet { color: var(--teal-dark); background: var(--teal-soft); }

.hero-visual { display: grid; grid-template-columns: 1fr; justify-items: center; padding: 2rem; border: 1px solid rgba(255,255,255,.8); border-radius: 32px; background: rgba(255,255,255,.65); box-shadow: var(--shadow); }
.flow-card { display: grid; grid-template-columns: 48px 1fr; width: min(100%, 360px); padding: 1rem; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 25px rgba(27,75,73,.07); }
.flow-card span { grid-row: span 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--teal); background: var(--teal-soft); font-weight: 800; }
.flow-card strong { align-self: end; font-size: 1rem; }
.flow-card small { color: var(--muted); }
.flow-card.active { border-color: #80c9bc; transform: translateX(-18px); }
.flow-line { width: 2px; height: 22px; background: #a8d8cf; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-top: -1rem; }
.stat-card { padding: 1.35rem; border: 1px solid var(--line); border-top: 4px solid var(--teal); border-radius: 18px; background: var(--surface); box-shadow: 0 8px 25px rgba(27,75,73,.05); }
.stat-card > span, .stat-card > p { color: var(--muted); font-size: .78rem; }
.stat-card strong { display: block; margin: .3rem 0; font-size: 2rem; }
.stat-card strong small { margin-left: .15rem; font-size: .85rem; }
.stat-card p { margin: 0; }
.accent-amber { border-top-color: var(--amber); }
.accent-blue { border-top-color: var(--blue); }
.accent-coral { border-top-color: var(--coral); }

.progress-dashboard { margin-top: 2rem; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(135deg, #f3fbf8, #fff); box-shadow: 0 10px 30px rgba(27,75,73,.06); }
.progress-dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.progress-dashboard-heading h2 { margin: .25rem 0 0; font-size: 1.55rem; }
.progress-dashboard-heading p { margin: 0; color: var(--muted); font-size: .88rem; }
.progress-dashboard-grid { display: grid; grid-template-columns: minmax(220px, .72fr) 1.8fr; gap: 1.3rem; align-items: stretch; }
.progress-ring-wrap, .progress-chart-panel { padding: 1.2rem; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.88); }
.progress-ring-wrap { display: grid; justify-items: center; align-content: center; }
.progress-ring { --progress: 0; display: grid; place-items: center; width: 154px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--teal) calc(var(--progress) * 1%), #e6efec 0); box-shadow: inset 0 0 0 1px rgba(15,118,110,.05); transition: background .35s ease; }
.progress-ring > div { display: grid; place-items: center; align-content: center; width: 112px; aspect-ratio: 1; border-radius: 50%; background: white; box-shadow: 0 5px 18px rgba(29,69,70,.08); }
.progress-ring strong { color: var(--teal-dark); font-size: 1.8rem; line-height: 1; }
.progress-ring span { margin-top: .3rem; color: var(--muted); font-size: .7rem; }
.progress-ring-wrap p { margin: .8rem 0 0; color: var(--muted); font-size: .82rem; font-weight: 700; }
.progress-chart-panel h3 { margin: 0 0 .9rem; font-size: 1rem; }
.progress-bar-list { display: grid; gap: .85rem; }
.progress-bar-row { display: grid; gap: .35rem; }
.progress-bar-label { display: flex; justify-content: space-between; gap: 1rem; font-size: .8rem; }
.progress-bar-label span { color: var(--muted); }
.progress-bar-track { height: 12px; overflow: hidden; border-radius: 99px; background: #e8efed; }
.progress-bar-track i { display: block; height: 100%; min-width: 0; border-radius: inherit; background: var(--teal); transition: width .35s ease; }
.progress-bar-row.management .progress-bar-track i { background: var(--amber); }
.progress-bar-row.technology .progress-bar-track i { background: var(--blue); }

.section-block { margin-top: 5rem; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 1.4rem; }
.section-heading h2 { margin: .25rem 0 0; font-size: 1.8rem; }
.section-heading p { color: var(--muted); }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.menu-card { position: relative; display: grid; grid-template-columns: 56px 1fr auto; gap: 1rem; align-items: center; min-height: 114px; padding: 1.2rem; text-align: left; border: 1px solid var(--line); border-radius: 20px; background: white; cursor: pointer; box-shadow: 0 8px 25px rgba(27,75,73,.05); transition: border-color .15s, transform .15s, box-shadow .15s; }
.menu-card:hover { transform: translateY(-2px); border-color: #8bcfc2; box-shadow: var(--shadow); }
.menu-card strong, .menu-card small { display: block; }
.menu-card strong { margin-bottom: .3rem; font-size: 1.04rem; }
.menu-card small { color: var(--muted); line-height: 1.55; }
.dataset-card { cursor: default; }
.dataset-picker { display: block; margin-top: .55rem; }
.dataset-picker select { width: 100%; min-height: 40px; padding: .45rem 2.2rem .45rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: .9rem; }
.dataset-start { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--blue); color: white; font-size: 1.35rem; cursor: pointer; }
.dataset-start:hover { filter: brightness(.94); }
.area-start { background: var(--teal); }
.menu-icon.mock { color: #6c3ea1; background: #f1e9fb; }
.menu-icon.search { color: #215c98; background: #e7f1fb; }
.search-menu-card { border-color: #bdd8ee; background: linear-gradient(135deg, #fff, #f3f9fe); }
.mock-menu-card { border-color: #d9c6ed; background: linear-gradient(135deg, #fff, #fbf7ff); }
.mastery-menu-card { border-color: #a9d9bf; background: linear-gradient(135deg, #fff, #f2fbf5); }
.mock-ratio { margin-top: .2rem; color: #6c3ea1 !important; font-size: .7rem !important; font-weight: 700; }
.menu-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; font-weight: 800; }
.menu-icon.teal { color: var(--teal); background: var(--teal-soft); }
.menu-icon.blue { color: var(--blue); background: var(--blue-soft); font-size: .85rem; }
.menu-icon.amber { color: var(--amber); background: var(--amber-soft); }
.menu-icon.coral { color: var(--coral); background: var(--coral-soft); }
.menu-icon.mastery { color: #207443; background: #e4f6e9; }
.arrow { color: var(--muted); font-size: 1.5rem; }
.guest-access-note { display: flex; align-items: center; gap: .8rem; margin: -0.35rem 0 1rem; padding: .85rem 1rem; color: #5c4a31; border: 1px solid #efd5a7; border-radius: 14px; background: #fff9ed; }
.guest-access-note > span { font-size: 1.15rem; }
.guest-access-note p { margin: 0; font-size: .8rem; line-height: 1.55; }
body[data-access="student"] .guest-access-note { display: none; }
body[data-access="guest"] [data-guest-lock] { cursor: not-allowed; filter: saturate(.45); }
body[data-access="guest"] .menu-card[data-guest-lock] { padding-top: 2.55rem; opacity: .68; }
body[data-access="guest"] .menu-card[data-guest-lock]::after { content: "🔒 ログインで利用"; position: absolute; top: .65rem; right: .75rem; padding: .22rem .5rem; color: #75531f; border: 1px solid #ead3ac; border-radius: 99px; background: #fff8ea; font-size: .66rem; font-weight: 800; }
body[data-access="guest"] .hero-actions [data-guest-lock]::after { content: " 🔒"; }
body[data-access="guest"] .bottom-nav [data-guest-lock] { position: relative; }
body[data-access="guest"] .bottom-nav [data-guest-lock] span::after { content: "🔒"; position: absolute; margin: -.2rem 0 0 -.15rem; font-size: .52rem; }
.source-note { margin-top: 3rem; padding: 1.4rem 1.6rem; color: #526469; background: #f3f6f4; border-radius: 18px; font-size: .82rem; line-height: 1.7; }
.source-note strong { color: var(--ink); }
.source-note p { margin: .25rem 0 .4rem; }

.qualification-card { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; margin-top: 1rem; padding: 1.2rem 1.4rem; border: 1px solid var(--line); border-radius: 20px; background: #f4f6f5; }
.qualification-card.passed { border-color: #8acdbf; background: linear-gradient(135deg, var(--teal-soft), #fff); box-shadow: 0 10px 28px rgba(15,118,110,.08); }
.qualification-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: white; font-size: 1.35rem; }
.qualification-card h3 { margin: .18rem 0; font-size: 1.12rem; }
.qualification-card p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.6; }

.study-topbar { display: grid; grid-template-columns: 1fr minmax(170px, 420px) 1fr; align-items: center; gap: 1rem; margin: 0 auto 1.5rem; max-width: 860px; }
.back-button, .icon-button { border: 0; background: transparent; font-weight: 800; cursor: pointer; }
.icon-button { justify-self: end; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: white; font-size: 1.4rem; }
.icon-button.bookmarked { color: var(--amber); background: var(--amber-soft); border-color: #e5b65a; }
.study-progress { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: .78rem; font-weight: 700; }
.study-progress > div { flex: 1; height: 8px; overflow: hidden; background: #e4ece9; border-radius: 99px; }
.study-progress i { display: block; width: 10%; height: 100%; background: var(--teal); border-radius: inherit; transition: width .25s ease; }
.study-card { max-width: 860px; margin: 0 auto; padding: clamp(1.3rem, 4vw, 3rem); border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.question-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .7rem; margin-bottom: 1.2rem; color: var(--muted); font-size: .8rem; }
.question-meta span:first-child { padding: .3rem .65rem; color: var(--teal-dark); background: var(--teal-soft); border-radius: 99px; font-weight: 700; }
.phase-label { display: inline-block; margin-bottom: .65rem; color: var(--teal); font-size: .74rem; font-weight: 800; letter-spacing: .08em; }
.study-card h2 { margin: .2rem 0 .8rem; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.lesson-lead { color: var(--muted); line-height: 1.85; }
.beginner-banner { display: flex; flex-wrap: wrap; gap: .45rem .8rem; align-items: center; margin-bottom: 1rem; padding: .8rem 1rem; color: #7d3d10; border: 1px solid #efc781; border-radius: 14px; background: #fff6e6; }
.beginner-banner strong { padding: .28rem .55rem; color: white; border-radius: 99px; background: #bd671e; font-size: .75rem; }
.beginner-banner span { font-size: .84rem; line-height: 1.6; }
.easy-words-panel { margin: 1.2rem 0; padding: 1rem; border: 2px solid #f1d39d; border-radius: 17px; background: #fffbf2; }
.easy-words-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; margin-bottom: .75rem; }
.easy-words-heading strong { color: #86450f; }
.easy-words-heading span { color: var(--muted); font-size: .72rem; }
.easy-word-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.easy-word-card { display: grid; grid-template-columns: minmax(90px, .42fr) 1fr; gap: .2rem .7rem; align-items: start; padding: .75rem; text-align: left; border: 1px solid #ecd6ae; border-radius: 12px; background: white; cursor: pointer; }
.easy-word-card:hover { border-color: #d99143; box-shadow: 0 5px 15px rgba(150,92,21,.08); }
.easy-word-card strong, .easy-word-card small { display: block; }
.easy-word-card strong { color: #7d3d10; }
.easy-word-card small { margin-top: .05rem; color: #a46b36; font-size: .68rem; }
.easy-word-card p { grid-column: 2; grid-row: 1 / span 2; margin: 0; color: #4f5d61; font-size: .78rem; line-height: 1.55; }
.concept-visual { margin: 1.7rem 0; padding: 1.4rem; border: 1px solid #cfe4de; border-radius: 18px; background: linear-gradient(135deg, #effaf6, #f7fbfa); }
.concept-row { display: flex; align-items: stretch; justify-content: center; gap: .8rem; }
.concept-node { flex: 1; min-width: 0; padding: 1rem; text-align: center; background: white; border: 1px solid var(--line); border-radius: 14px; }
.concept-node strong, .concept-node small { display: block; }
.concept-node strong { color: var(--teal-dark); }
.concept-node small { margin-top: .3rem; color: var(--muted); line-height: 1.45; }
.concept-arrow { display: grid; place-items: center; color: var(--teal); font-size: 1.4rem; font-weight: 800; }
.key-point { margin: 1.2rem 0; padding: 1rem 1.1rem; border-left: 5px solid var(--amber); border-radius: 0 12px 12px 0; background: var(--amber-soft); line-height: 1.75; }
.key-point strong { color: #965d0b; }
.term-list { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.2rem; }
.term-chip { padding: .45rem .75rem; color: var(--teal-dark); background: var(--teal-soft); border: 0; border-radius: 99px; font-size: .8rem; font-weight: 700; cursor: pointer; }
.study-actions { justify-content: flex-end; padding-top: 1rem; border-top: 1px solid var(--line); }

.question-body { font-size: 1.02rem; line-height: 1.9; }
.question-body ol, .question-body ul { padding-left: 1.5rem; }
.question-body table, .choice-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.question-body td, .question-body th, .choice-content td, .choice-content th { padding: .55rem; border: 1px solid var(--line); }
.question-body img { display: block; margin: 1.2rem auto; }
.choices { display: grid; gap: .7rem; margin: 1.5rem 0 0; padding: 0; border: 0; }
.choice { display: grid; grid-template-columns: 38px 1fr; gap: .8rem; align-items: start; width: 100%; padding: 1rem; text-align: left; border: 2px solid var(--line); border-radius: 14px; background: white; cursor: pointer; }
.choice:hover { border-color: #90cbc1; background: #f9fdfc; }
.choice.selected { border-color: var(--teal); background: var(--teal-soft); }
.choice-letter { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--teal-dark); background: #edf4f2; font-weight: 800; }
.choice.selected .choice-letter { color: white; background: var(--teal); }
.choice-content { align-self: center; line-height: 1.7; }
.choice-content img { max-height: 210px; object-fit: contain; }
.result-heading { padding: 1.2rem; text-align: center; border-radius: 16px; }
.result-heading.correct { color: #08614b; background: var(--teal-soft); }
.result-heading.incorrect { color: #9c3629; background: var(--coral-soft); }
.result-heading strong { display: block; font-size: 1.7rem; }
.answer-compare { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin: 1.3rem 0; color: var(--muted); }
.answer-compare strong { color: var(--ink); }
.explanation-box { margin-top: 1.5rem; padding: 1.4rem; border: 1px solid var(--line); border-radius: 18px; background: #fcfdfc; line-height: 1.85; }
.explanation-box h2 { font-size: 1.35rem; }
.answer-choice-review, .reasoning-steps, .explanation-figure { margin: 1rem 0; padding: 1rem; border: 1px solid #cfe4de; border-radius: 14px; background: #f4fbf8; }
.answer-choice-review > strong, .reasoning-steps > strong, .explanation-figure > strong { display: block; margin-bottom: .45rem; color: var(--teal-dark); }
.answer-choice-review small { display: block; margin-top: .45rem; color: var(--muted); }
.answer-choice-content { font-weight: 700; }
.reasoning-steps ol { margin: .35rem 0 0; padding-left: 1.4rem; }
.reasoning-steps li + li { margin-top: .35rem; }
.explanation-figure-content { overflow-x: auto; }
.explanation-figure img, .answer-choice-review img, .choice-comparison img { display: block; max-width: 100%; max-height: 340px; margin: .8rem auto; object-fit: contain; }
.explanation-figure table, .answer-choice-review table, .choice-comparison table { width: 100%; margin: .8rem 0; border-collapse: collapse; }
.explanation-figure td, .explanation-figure th, .answer-choice-review td, .answer-choice-review th, .choice-comparison td, .choice-comparison th { padding: .45rem; border: 1px solid var(--line); }
.choice-comparison { margin: 1rem 0; border: 1px solid var(--line); border-radius: 14px; background: white; }
.choice-comparison summary { padding: .85rem 1rem; color: var(--teal-dark); font-weight: 800; cursor: pointer; }
.choice-comparison ul { display: grid; gap: .55rem; margin: 0; padding: 0 1rem 1rem; list-style: none; }
.choice-comparison li { padding: .75rem; border: 1px solid var(--line); border-radius: 11px; }
.choice-comparison li.is-correct { border-color: #81c9b8; background: var(--teal-soft); }
.choice-comparison li > strong { color: var(--teal-dark); }
.choice-comparison li small { display: block; margin-top: .35rem; color: var(--muted); line-height: 1.55; }
.choice-review-content { margin-top: .2rem; }
.review-note { padding: .8rem 1rem; color: var(--muted); border-left: 4px solid var(--amber); background: var(--amber-soft); }

.mock-result-shell { max-width: 820px; margin: 0 auto; }
.mock-result-hero { display: grid; justify-items: center; padding: clamp(1.5rem, 5vw, 3rem); text-align: center; border: 1px solid var(--line); border-radius: 26px; background: white; box-shadow: var(--shadow); }
.mock-result-hero.passed { border-color: #8acdbf; background: linear-gradient(160deg, #f0fbf7, white); }
.mock-result-hero.failed { border-color: #efc0b7; background: linear-gradient(160deg, #fff4f1, white); }
.mock-score-ring { --score: 0; display: grid; place-items: center; width: 180px; aspect-ratio: 1; margin: 1.2rem 0; border-radius: 50%; background: conic-gradient(var(--teal) calc(var(--score) * 1%), #e7eeec 0); }
.mock-score-ring > div { display: grid; place-items: center; align-content: center; width: 132px; aspect-ratio: 1; border-radius: 50%; background: white; box-shadow: 0 5px 18px rgba(29,69,70,.08); }
.mock-score-ring strong { font-size: 2.25rem; line-height: 1; }
.mock-score-ring span { margin-top: .4rem; color: var(--muted); font-size: .78rem; }
.mock-result-hero h1 { margin: .2rem 0 .5rem; font-size: clamp(2rem, 6vw, 3rem); }
.mock-result-hero p { margin: 0; color: var(--muted); line-height: 1.75; }
.mock-breakdown-card { margin-top: 1rem; padding: 1.5rem; border: 1px solid var(--line); border-radius: 20px; background: white; }
.mock-breakdown-card h2 { margin-top: 0; font-size: 1.2rem; }
.mock-rule-note { margin: 1.2rem 0 0; color: var(--muted); font-size: .78rem; }
.mock-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: 1.2rem; }
.mock-history { display: grid; gap: .65rem; }
.mock-history-item { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 14px; }
.mock-history-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; font-weight: 800; }
.mock-history-item.passed .mock-history-mark { color: var(--teal-dark); background: var(--teal-soft); }
.mock-history-item.failed .mock-history-mark { color: #9c3629; background: var(--coral-soft); }
.mock-history-item strong, .mock-history-item small { display: block; }
.mock-history-item small { color: var(--muted); }
.mock-history-item > time { color: var(--muted); font-size: .75rem; }

.page-title { margin: 0 auto 2rem; max-width: 960px; }
.page-title .back-button { display: block; margin-bottom: 2.5rem; padding: 0; }
.page-title h1 { margin: .4rem 0; font-size: clamp(2.2rem, 5vw, 3.6rem); }
.page-title > p { color: var(--muted); }
.report-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 1rem; max-width: 960px; margin: 0 auto; }
.report-card { padding: 1.5rem; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 8px 25px rgba(27,75,73,.05); }
.report-card h2 { margin-top: 0; font-size: 1.2rem; }
.report-wide { grid-column: 1 / -1; }
.report-help { margin: -.5rem 0 1rem; color: var(--muted); font-size: .82rem; }
.dataset-progress-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.4rem; }
.dataset-progress-grid .progress-bar-track { height: 9px; }
.bar-item { margin: 1.1rem 0; }
.bar-label { display: flex; justify-content: space-between; margin-bottom: .35rem; font-size: .83rem; }
.bar-track { height: 10px; overflow: hidden; background: #e9efed; border-radius: 99px; }
.bar-track i { display: block; height: 100%; background: var(--teal); border-radius: inherit; }
.wrong-list { display: grid; gap: .7rem; }
.wrong-item { display: grid; grid-template-columns: 44px 1fr auto; gap: .8rem; align-items: center; padding: .8rem; border: 1px solid var(--line); border-radius: 14px; }
.wrong-number { display: grid; place-items: center; width: 42px; height: 42px; color: var(--coral); background: var(--coral-soft); border-radius: 12px; font-weight: 800; }
.wrong-item strong, .wrong-item small { display: block; }
.wrong-item small { color: var(--muted); }
.mini-button { padding: .4rem .7rem; border: 0; border-radius: 9px; color: var(--teal-dark); background: var(--teal-soft); font-size: .76rem; font-weight: 800; cursor: pointer; }
.empty-state { padding: 2rem 1rem; text-align: center; color: var(--muted); background: #f7f9f8; border-radius: 14px; }

.search-box { display: flex; align-items: center; gap: .7rem; max-width: 680px; margin: 0 auto 1rem; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; }
.filter-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 1rem 0 1.5rem; }
.filter-chip { padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 99px; background: white; font-size: .78rem; cursor: pointer; }
.filter-chip.active { color: white; background: var(--teal); border-color: var(--teal); }
.glossary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.glossary-card { padding: 1.2rem; text-align: left; border: 1px solid var(--line); border-radius: 17px; background: white; cursor: pointer; }
.glossary-card:hover { border-color: #8bcfc2; box-shadow: 0 8px 25px rgba(27,75,73,.07); }
.glossary-card span { color: var(--teal); font-size: .72rem; font-weight: 700; }
.glossary-card strong { display: block; margin: .25rem 0; font-size: 1.05rem; }
.glossary-card .glossary-reading { display: block; margin: -.15rem 0 .35rem; color: var(--teal-dark); font-size: .72rem; font-weight: 500; }
.glossary-card p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.65; }

.question-search-panel { max-width: 960px; margin: 0 auto 1rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 8px 25px rgba(27,75,73,.05); }
.question-search-box { max-width: none; margin: 0 0 .8rem; background: #f9fbfa; }
.question-search-filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.question-search-filters label span { display: block; margin-bottom: .3rem; color: var(--muted); font-size: .72rem; font-weight: 800; }
.question-search-filters select { width: 100%; min-height: 44px; padding: .55rem .7rem; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; background: white; font: inherit; }
.search-suggestions { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin-top: .8rem; }
.search-suggestions span { color: var(--muted); font-size: .72rem; font-weight: 800; }
.search-suggestions button { padding: .35rem .65rem; color: var(--blue); border: 1px solid #bad7e9; border-radius: 99px; background: var(--blue-soft); font-size: .74rem; cursor: pointer; }
.question-search-summary { max-width: 960px; margin: 1rem auto; color: var(--muted); font-size: .84rem; font-weight: 700; }
.question-search-results { display: grid; gap: .75rem; max-width: 960px; margin: 0 auto; }
.question-search-result { display: grid; grid-template-columns: 1fr auto; gap: .8rem 1rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: 0 6px 18px rgba(27,75,73,.04); }
.question-search-result-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .45rem; }
.question-search-result-meta span { padding: .25rem .52rem; color: var(--teal-dark); border-radius: 99px; background: var(--teal-soft); font-size: .7rem; font-weight: 800; }
.question-search-result-meta .search-status { color: var(--muted); background: #edf1f0; }
.question-search-result-meta .search-status.wrong { color: #9c3629; background: var(--coral-soft); }
.question-search-result-meta .search-status.correct { color: #08614b; background: var(--teal-soft); }
.question-search-result h2 { margin: 0 0 .35rem; font-size: 1.02rem; }
.question-search-result p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.65; }
.question-search-actions { display: flex; flex-direction: column; justify-content: center; gap: .45rem; }
.question-search-actions button { white-space: nowrap; }
.search-result-limit { padding: 1rem; text-align: center; color: var(--muted); background: #f5f8f7; border-radius: 14px; font-size: .8rem; }

.bottom-nav { display: none; }
.app-dialog { width: min(520px, calc(100% - 2rem)); padding: 0; border: 0; border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.24); }
.app-dialog::backdrop { background: rgba(19, 43, 46, .55); backdrop-filter: blur(4px); }
.dialog-card { position: relative; padding: 2rem; }
.dialog-card h2 { margin: .4rem 0; }
.dialog-card > p { color: var(--muted); line-height: 1.65; }
.dialog-close { position: absolute; top: 1rem; right: 1rem; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #edf2f0; cursor: pointer; }
.profile-list { display: grid; gap: .5rem; margin: 1.2rem 0; }
.profile-option { display: flex; justify-content: space-between; align-items: center; padding: .75rem; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: pointer; }
.profile-option.active { border-color: var(--teal); background: var(--teal-soft); }
.field-label { display: block; margin: 1rem 0 .4rem; font-size: .8rem; font-weight: 800; }
.inline-form { display: flex; gap: .5rem; }
.inline-form input { flex: 1; min-width: 0; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; }
.login-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 1rem 0 .7rem; }
.login-grid label span { display: block; margin-bottom: .3rem; font-size: .76rem; font-weight: 800; }
.login-grid input { width: 100%; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; }
.button-full { width: 100%; }
.form-error { margin: .2rem 0 .7rem !important; color: #a83e31 !important; font-size: .8rem; font-weight: 700; }
.dialog-divider { display: flex; align-items: center; gap: .7rem; margin: 1.4rem 0 .5rem; color: var(--muted); font-size: .75rem; }
.dialog-divider::before, .dialog-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.remote-session { display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; align-items: center; margin: 1rem 0; padding: .9rem; border: 1px solid #9dd5ca; border-radius: 14px; background: var(--teal-soft); }
.remote-session span { color: var(--muted); font-size: .72rem; }
.remote-session strong { grid-column: 1; }
.remote-session-actions { grid-column: 2; grid-row: 1 / span 2; display: grid; gap: .35rem; }
.remote-session-actions .mini-button { text-align: center; text-decoration: none; }
.term-dialog-card { max-height: 80vh; overflow: auto; }
.term-reading { margin: -.25rem 0 1rem !important; font-size: .8rem; }
.term-short { color: var(--ink) !important; font-size: 1.05rem; font-weight: 700; }
.term-detail { line-height: 1.85; }
.toast { position: fixed; left: 50%; bottom: 5.5rem; z-index: 80; max-width: calc(100% - 2rem); padding: .7rem 1rem; color: white; background: #173f43; border-radius: 10px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-visual { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .progress-dashboard-grid { grid-template-columns: 1fr; }
  .report-layout { grid-template-columns: 1fr; }
  .report-wide { grid-column: auto; }
  .glossary-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .site-header { min-height: 64px; padding: 0 .8rem; }
  .brand strong { font-size: .88rem; }
  .brand small { display: none; }
  .header-actions { gap: .35rem; }
  .furigana-toggle { min-height: 38px; padding: .35rem .45rem; }
  .furigana-label { font-size: 0; }
  .furigana-label::after { content: "あ"; font-size: .8rem; }
  .profile-button { max-width: 118px; }
  #profileLabel { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  main { width: min(100% - 1rem, 1180px); padding: 1.3rem 0 6.5rem; }
  .hero { padding: 1.2rem .4rem 2.4rem; }
  .hero h1 { font-size: 2.55rem; }
  .hero-copy > p { font-size: .96rem; }
  .hero-actions .button { width: 100%; }
  .stats-grid { gap: .55rem; }
  .stat-card { padding: 1rem; }
  .stat-card strong { font-size: 1.55rem; }
  .progress-dashboard { margin-top: 1rem; padding: 1rem; }
  .progress-dashboard-heading { display: block; }
  .progress-dashboard-heading p { margin-top: .35rem; }
  .progress-dashboard-grid { gap: .75rem; }
  .progress-ring { width: 138px; }
  .progress-ring > div { width: 100px; }
  .dataset-progress-grid { grid-template-columns: 1fr; }
  .section-block { margin-top: 3.2rem; }
  .section-heading { display: block; padding: 0 .35rem; }
  .section-heading > p { margin: .4rem 0; }
  .menu-grid { grid-template-columns: 1fr; }
  .menu-card { min-height: 96px; padding: 1rem; }
  .qualification-card { grid-template-columns: auto 1fr; padding: 1rem; }
  .qualification-card .button { grid-column: 1 / -1; width: 100%; }
  .mock-result-actions .button { width: 100%; }
  .mock-history-item { grid-template-columns: auto 1fr; }
  .mock-history-item > time { grid-column: 2; }
  .source-note { margin: 2rem .2rem 0; }
  .study-topbar { grid-template-columns: auto 1fr auto; padding: 0 .35rem; }
  .study-card { padding: 1.15rem; border-radius: 18px; }
  .concept-row { flex-direction: column; }
  .easy-word-grid { grid-template-columns: 1fr; }
  .concept-arrow { transform: rotate(90deg); }
  .study-actions .button { width: 100%; }
  .glossary-grid { grid-template-columns: 1fr; }
  .question-search-filters { grid-template-columns: 1fr; }
  .question-search-result { grid-template-columns: 1fr; }
  .question-search-actions { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; }
  .wrong-item { grid-template-columns: 40px 1fr; }
  .wrong-item .mini-button { grid-column: 2; justify-self: start; }
  .bottom-nav { position: fixed; inset: auto 0 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); padding: .45rem max(.5rem, env(safe-area-inset-right)) calc(.45rem + env(safe-area-inset-bottom)) max(.5rem, env(safe-area-inset-left)); background: rgba(255,255,255,.94); border-top: 1px solid var(--line); backdrop-filter: blur(16px); }
  .bottom-nav button { display: grid; justify-items: center; gap: .1rem; padding: .25rem; color: var(--muted); background: transparent; border: 0; font-size: .64rem; font-weight: 700; }
  .bottom-nav button span { font-size: 1.15rem; }
  .bottom-nav button.active { color: var(--teal); }
  .dialog-card { padding: 1.5rem; }
}

@media (max-width: 420px) {
  .site-header { gap: .45rem; }
  .brand { flex: 0 0 auto; }
  .brand > span:last-child { display: none; }
  .profile-button { width: 40px; padding: .3rem; }
  #profileLabel { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
