:root {
  color-scheme: light;
  --background: #f8f9fb;
  --surface: #ffffff;
  --ink: #1a1c1e;
  --muted: #565e6b;
  --line: #e0e5ed;
  --blue: #155fc3;
  --primary: #1668d4;
  --on-primary: #ffffff;
  --blue-soft: #e6f0ff;
  --tile: #e5f0fc;
  --tile-hover: #dcecff;
  --success: #17673b;
  --success-soft: #e5f5eb;
  --error: #a02938;
  --error-soft: #fdebed;
  --amber-soft: #ffeddd;
  --elevation: 0 4px 16px rgb(29 60 118 / 7%);
  --nav-elevation: 0 9px 26px rgb(26 115 232 / 20%);
  --body: -apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #1a1c1e;
  --surface: #242628;
  --ink: #f0f1f4;
  --muted: #bbc3ce;
  --line: #424952;
  --blue: #a8c8ff;
  --primary: #9ac2ff;
  --on-primary: #192e4d;
  --blue-soft: #273c57;
  --tile: #233248;
  --tile-hover: #2c4262;
  --success: #9be0b2;
  --success-soft: #244334;
  --error: #ffbdc4;
  --error-soft: #4c2c35;
  --amber-soft: #49371f;
  --elevation: 0 4px 16px rgb(0 0 0 / 18%);
  --nav-elevation: 0 7px 24px rgb(0 0 0 / 32%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-block: 1rem 6rem; }
body { margin: 0; background: var(--background); color: var(--ink); font: 1rem/1.45 var(--body); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
a { color: var(--blue); text-underline-offset: .18em; }
:is(button, a, summary):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
::selection { color: var(--on-primary); background: var(--primary); }
.shell { width: min(calc(100% - clamp(1.5rem, 10vw, 2.5rem)), 41rem); margin-inline: auto; }

.top { padding-top: env(safe-area-inset-top, 0px); }
.top-inner { min-height: 4.55rem; display: flex; align-items: center; gap: .65rem; }
.brand { display: flex; align-items: center; gap: .65rem; font-size: 1.2rem; font-weight: 750; letter-spacing: -.02em; }
.mark { display: block; border-radius: .72rem; width: 2.5rem; height: 2.5rem; }
.home-profile { width: 100%; padding: 0; min-height: 2.75rem; border: 0; border-radius: 1rem; background: transparent; display: flex; align-items: center; text-align: start; gap: .75rem; }
.avatar { width: 2.75rem; height: 2.75rem; flex: none; border: 1.5px solid var(--blue); border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; }
.avatar i { position: relative; width: 1.24rem; height: 1.18rem; }
.avatar i::before, .avatar i::after { content: ""; position: absolute; background: currentColor; left: 50%; translate: -50% 0; }
.avatar i::before { width: .52rem; height: .52rem; top: .02rem; border-radius: 50%; }
.avatar i::after { width: .94rem; height: .46rem; bottom: .04rem; border-radius: .45rem .45rem .17rem .17rem; }
.user-name { min-width: 0; flex: 1; line-height: 1.15; }
.user-name strong { display: block; font-size: 1rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.user-name small { margin-bottom: .13rem; }
.xp { display: grid; justify-items: center; align-content: center; flex: none; min-width: 4rem; min-height: 2.75rem; padding: .2rem .65rem; border: 1px solid color-mix(in srgb, var(--blue) 35%, transparent); border-radius: 2rem; background: var(--blue-soft); line-height: 1.05; }
.xp strong { color: var(--blue); font-size: 1rem; }
.xp small { font-size: .7rem; letter-spacing: .07em; font-weight: 750; }
.top.subpage { position: sticky; top: 0; z-index: 2; background: var(--background); }
.top.subpage .top-inner { min-height: 3.3rem; }
.back-button { width: 2.75rem; min-height: 2.75rem; border-radius: 50%; border: 0; background: var(--surface); color: var(--blue); display: grid; place-items: center; }
.back-button span { width: .56rem; height: .56rem; border: solid currentColor; border-width: 0 0 2px 2px; rotate: 45deg; margin-inline-start: .15rem; }
.header-title { min-width: 0; font-size: 1.1rem; line-height: 1.2; font-weight: 750; }
.attempt-language { margin-inline-start: auto; flex: none; min-height: 2.75rem; padding: .25rem .65rem; border: 0; border-radius: 2rem; background: var(--blue-soft); color: var(--blue); font-size: .8rem; font-weight: 700; }
.exam-status:not(:empty) { margin-top: .65rem; color: var(--muted); }

.quiet { min-height: 2.75rem; padding: .4rem .75rem; border: 0; border-radius: .75rem; background: transparent; color: var(--blue); font-weight: 650; }
.quiet:hover { background: var(--tile-hover); }

#screen { padding-block: .85rem calc(6.3rem + env(safe-area-inset-bottom, 0px)); }
#app-header[hidden] + #screen { padding-top: calc(1.2rem + env(safe-area-inset-top, 0px)); }
#app-header.subpage + #screen { padding-block: .48rem max(1.2rem, env(safe-area-inset-bottom, 0px)); }
h1, h2 { line-height: 1.2; letter-spacing: -.025em; }
h1:focus { outline: none; }
h1 { font-size: clamp(1.55rem, 5.5vw, 2.15rem); margin: 0 0 .8rem; }
h2 { font-size: 1.15rem; margin: 0 0 .3rem; }
p { margin: 0 0 .75rem; }
small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.section-title { font-size: 1.2rem; margin-bottom: .75rem; }
.exercises-heading { margin-top: 1.55rem; }
.demo { margin: 1rem 0 0; color: var(--muted); font-size: .8rem; }

.statistics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 1.15rem .2rem; border-radius: 1.35rem; background: var(--surface); box-shadow: var(--elevation); }
.stat { position: relative; display: grid; grid-template-rows: auto auto; justify-items: center; text-align: center; gap: .4rem; padding-inline: .1rem; }
.stat + .stat::before { content: ""; width: 1px; position: absolute; left: 0; top: 27%; bottom: 20%; background: var(--line); }
.stat dt { grid-row: 2; color: var(--muted); font-size: .74rem; }
.stat dd { grid-row: 1; display: grid; justify-items: center; gap: .55rem; margin: 0; font-size: 1.23rem; line-height: 1.12; font-weight: 750; font-variant-numeric: tabular-nums; }
.stat-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: .9rem; }
.stat-icon i { width: 1.5rem; height: 1.5rem; background: currentColor; mask: var(--icon) center / contain no-repeat; }
.stat-questions { --icon: url("/brand/questions.svg"); background: var(--blue-soft); color: var(--blue); }
.stat-learn { --icon: url("/brand/learn.svg"); background: var(--success-soft); color: var(--success); }
.stat-fire { --icon: url("/brand/fire.svg"); background: var(--amber-soft); color: #c95012; }
:root[data-theme="dark"] .stat-fire { color: #ffb884; }
.readiness { display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; margin-top: .9rem; border-radius: 1.35rem; background: var(--surface); box-shadow: var(--elevation); }
.readiness strong { display: block; margin-bottom: .12rem; font-size: 1rem; }
.readiness-meter { position: relative; display: grid; place-items: center; flex: 0 0 3.5rem; height: 3.5rem; border: 5px solid var(--line); border-radius: 50%; font-size: .78rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.readiness-meter meter { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.readiness-meter canvas { position: absolute; width: 3.5rem; height: 3.5rem; color: var(--error); }
.readiness-meter.medium canvas { color: #b75b12; }
.readiness-meter.high canvas { color: var(--success); }
.resume-card { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .9rem 1rem; margin-top: .85rem; border-radius: 1.1rem; background: var(--blue-soft); }
.resume-card h2 { margin: 0 0 .15rem; }

.exercise-hero, .exercise-card { width: 100%; min-width: 0; border: 0; text-align: start; background: var(--tile); }
.exercise-hero:hover, .exercise-card:hover { background: var(--tile-hover); }
.exercise-hero { display: flex; align-items: center; justify-content: space-between; gap: .25rem; min-height: 6.85rem; padding: .25rem .65rem .25rem 1.15rem; border-radius: 1.35rem; }
.hero-content { display: grid; min-width: 0; justify-items: start; gap: .4rem; }
.hero-content strong { font-size: clamp(1.08rem, 4.9vw, 1.25rem); line-height: 1.2; letter-spacing: -.02em; }
.hero-action { display: inline-flex; gap: .5rem; align-items: center; color: var(--blue); background: var(--blue-soft); font-size: .8rem; font-weight: 700; padding: .35rem .65rem; border-radius: 2rem; }
.arrow { width: .7rem; height: .45rem; position: relative; }
.arrow::before { content: ""; position: absolute; top: 50%; left: 0; width: 100%; border-top: 1.5px solid currentColor; }
.arrow::after { content: ""; position: absolute; top: calc(50% - .15rem); right: 0; width: .3rem; height: .3rem; border: solid currentColor; border-width: 1.5px 1.5px 0 0; rotate: 45deg; }
.exercise-hero img { flex: none; width: clamp(5rem, 27vw, 6.55rem); height: auto; object-fit: contain; }
.exercise-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-top: .65rem; }
.exercise-card { isolation: isolate; position: relative; border-radius: 1.2rem; min-height: 5.55rem; padding: .72rem .45rem .72rem .85rem; display: flex; align-items: start; }
.exercise-card span { position: relative; z-index: 1; max-width: 100%; padding-right: .2rem; font-size: .91rem; font-weight: 700; line-height: 1.25; }
.exercise-card img { position: absolute; right: .15rem; bottom: .05rem; width: clamp(2.65rem, 14.5vw, 4.1rem); height: auto; object-fit: contain; }
.first-ticket { margin-top: .8rem; }

.primary, .secondary { min-height: 2.85rem; display: inline-grid; place-items: center; padding: .5rem .95rem; border-radius: .85rem; font-weight: 700; text-decoration: none; text-align: center; }
.primary { border: 1px solid var(--primary); background: var(--primary); color: var(--on-primary); }
.primary:hover { filter: brightness(.94); }
.secondary { border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.secondary[aria-pressed="true"], .secondary:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.list, .result-items, .profile-list, .saved { border-radius: 1.1rem; background: var(--surface); overflow: hidden; }
.row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; width: 100%; min-height: 3.45rem; padding: .7rem .9rem; border: 0; background: var(--surface); text-align: start; text-decoration: none; }
.row + .row { border-top: 1px solid var(--line); }
.row:hover { color: var(--blue); background: var(--blue-soft); }
.row:focus-visible { outline-offset: -3px; }
.list-row strong { display: block; }
.list-row small { margin-top: .12rem; }
.list-row > :last-child { font-size: 1.4rem; line-height: 1; color: var(--blue); }

.tabs { position: fixed; z-index: 2; inset: auto 0 calc(.75rem + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
.tabs-inner { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); pointer-events: auto; background: var(--surface); border-radius: 2rem; padding-inline: .38rem; box-shadow: var(--nav-elevation); }
.tabs button { min-height: 3.75rem; border: 0; border-radius: 1.6rem; background: transparent; padding: .35rem .2rem; display: grid; gap: .18rem; justify-items: center; align-content: center; color: var(--muted); font-size: .71rem; font-weight: 650; }
@media (hover: hover) {
  .tabs button:hover { background: var(--blue-soft); }
}
.tabs [aria-current] { color: var(--blue); }
.tab-icon { width: 1.25rem; height: 1.25rem; background: currentColor; mask: var(--icon) center / contain no-repeat; }
.icon-home { --icon: url("/brand/home.svg"); }
.icon-home-fill { --icon: url("/brand/home_fill.svg"); }
.icon-ranking { --icon: url("/brand/ranking.svg"); }
.icon-ranking-fill { --icon: url("/brand/ranking_fill.svg"); }
.icon-settings { --icon: url("/brand/settings.svg"); }
.icon-settings-fill { --icon: url("/brand/settings_fill.svg"); }

.question-steps { position: sticky; top: calc(3.3rem + env(safe-area-inset-top, 0px)); z-index: 1; background: var(--background); display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding: .2rem .18rem .7rem; margin-bottom: .2rem; }
.question-steps::-webkit-scrollbar { display: none; }
.question-step { min-width: 2.75rem; height: 2.75rem; flex: none; border-radius: .8rem; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .85rem; font-weight: 750; }
.question-step:is([aria-current],.marked) { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }
.question-step.right { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.question-step.wrong { background: var(--error-soft); color: var(--error); border-color: var(--error); }
.question-step[aria-current] { border-width: 2px; }
.question-card { padding: .32rem 1rem .9rem; background: var(--tile); border-radius: 1.25rem; margin-bottom: .72rem; }
.question-meta { color: var(--blue); display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .86rem; font-weight: 700; min-height: 2.75rem; }
.save-question { padding-inline: .5rem; font-size: .83rem; }
.question-title { font-size: 1.04rem; line-height: 1.5; letter-spacing: 0; font-weight: 600; margin: .05rem 0 0; overflow-wrap: anywhere; }
.question-image { width: 100%; display: block; border: 1px solid var(--line); border-radius: 1.15rem; padding: .3rem; background: var(--surface); overflow: hidden; margin-bottom: .85rem; }
.question-image img { display: block; width: 100%; max-height: 15.5rem; object-fit: contain; border-radius: .8rem; }
.options { display: grid; gap: .5rem; }
.option { width: 100%; display: flex; align-items: center; gap: .65rem; min-height: 3.3rem; text-align: start; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); overflow-wrap: anywhere; }
.option:hover:not(:disabled), .option.selected { border-color: var(--blue); background: var(--blue-soft); }
.option.right { background: var(--success-soft); border-color: var(--success); }
.option.wrong { background: var(--error-soft); border-color: var(--error); }
.letter { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; flex: none; background: var(--blue-soft); border-radius: .55rem; color: var(--blue); font-weight: 750; }
.option.right .letter { background: var(--success); color: var(--surface); }
.option.wrong .letter { background: var(--error); color: var(--surface); }
.option.right small, .exam-outcome.pass { color: var(--success); }
.option.wrong small, .danger, .exam-outcome.fail { color: var(--error); }
.explanation { margin-top: .75rem; padding: .9rem 1rem; border-radius: 1rem; background: var(--blue-soft); }
.explanation p { white-space: pre-wrap; overflow-wrap: anywhere; }
.actions, .report-actions, .languages, .filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.actions { margin-top: .9rem; }
.actions .primary { flex: 1; }
details { padding: .7rem .85rem; border-bottom: 1px solid var(--line); }
details:last-child { border-bottom: 0; }
details p { margin: .6rem 0 0; white-space: pre-wrap; }
summary { cursor: pointer; }
.report, .result-items { margin-top: .8rem; }
.report { padding-inline: 0; }
.report summary { color: var(--muted); }
.score { background: var(--blue-soft); border-radius: 1.2rem; padding: 1rem; margin-bottom: 1rem; }
.score strong { font-size: 2.75rem; line-height: 1; }
.score strong span { color: var(--muted); font-size: 1.35rem; margin-left: .35rem; }
.score dl { display: flex; flex-wrap: wrap; gap: .5rem 1.15rem; margin: .65rem 0 0; }
.score dd { margin: 0; font-weight: 800; }
.profile-section { margin-block: 1.1rem .85rem; padding: .9rem; }
.profile-section h2 { margin-bottom: .7rem; }
.profile-list { margin-bottom: .45rem; }
.saved { padding: .4rem .85rem .4rem 2rem; }
.saved li { padding-block: .45rem; }
.empty-state { padding: .85rem 1rem; border-radius: 1.1rem; background: var(--surface); color: var(--muted); }
.notice:not(:empty) { position: fixed; z-index: 3; bottom: calc(4.65rem + env(safe-area-inset-bottom, 0px)); left: 50%; translate: -50%; padding: .65rem .85rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--surface); box-shadow: var(--elevation); }
dialog { width: min(48rem, calc(100% - 1.5rem)); padding: .65rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgb(15 23 39 / 77%); }
.language-dialog { width: min(23rem, calc(100% - 1.5rem)); padding: 1rem; }
.language-dialog h2 { margin-bottom: .8rem; }
.language-dialog form { margin: .7rem 0 0; }
.language-status:empty { display: none; }
.language-status:not(:empty) { margin: .7rem 0 0; color: var(--error); }

dialog form { text-align: end; margin-bottom: .45rem; }
dialog img { display: block; width: 100%; max-height: 75dvh; object-fit: contain; }
.filters { margin-block: .6rem 1rem; }
.screen-reader-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ticket-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.ticket-card { display: grid; align-content: start; gap: .28rem; text-align: start; padding: .8rem; min-height: 7.4rem; border: 1px solid var(--line); border-radius: 1.1rem; background: var(--surface); }
.ticket-card:is(.active,.completed) { border-color: var(--blue); }
@media (hover: hover) {
  .ticket-card:hover { border-color: var(--blue); }
}
.ticket-card strong { line-height: 1.25; font-size: .94rem; }
.ticket-card-top { display: flex; min-height: 2.45rem; align-items: center; justify-content: space-between; gap: .3rem; margin-bottom: .45rem; }
.ticket-card-icon { display: grid; place-items: center; flex: 0 0 2.5rem; height: 2.5rem; border-radius: .72rem; background: var(--blue-soft); color: var(--blue); }
.ticket-card-icon i { width: 1.12rem; height: 1.12rem; background: currentColor; mask: url("/brand/questions.svg") center / contain no-repeat; }
.ticket-status { text-align: end; font-size: .7rem; }
.ticket-card.completed .ticket-status { color: var(--success); }
.timer { background: var(--blue-soft); border-radius: .65rem; color: var(--blue); padding: .3rem .6rem; font-variant-numeric: tabular-nums; }
.exam-outcome { font-weight: 750; }

@media (min-width: 34rem) {
  .exercise-card { min-height: 5.9rem; padding-inline: 1rem; }
  .exercise-card span { padding-inline-end: 4rem; }
  .exercise-card img { width: 4.7rem; right: .45rem; bottom: .05rem; }
  .exercise-hero { padding-inline: 1.2rem; }
}


.rules-home { margin-top: 1.55rem; }
.rules-heading { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .75rem; }
.rules-heading .section-title { margin: 0; }
.rules-all { min-height: 2.75rem; padding: .3rem .75rem; border: 1px solid var(--blue); border-radius: .65rem; background: var(--surface); color: var(--blue); font-size: .84rem; font-weight: 650; }
.rules-rail, .rule-grid { display: grid; gap: .75rem; }
.rules-rail { grid-auto-flow: column; grid-auto-columns: minmax(7.35rem, 31%); overflow-x: auto; scroll-snap-type: x proximity; padding: .15rem .18rem .55rem; margin-inline: -.18rem; }
.rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rule-tile { position: relative; display: flex; align-items: flex-start; min-width: 0; min-height: 5.9rem; padding: .55rem .65rem; border: 0; border-radius: 1rem; background: var(--tile); color: var(--ink); scroll-snap-align: start; text-align: start; }
.rule-tile span { position: relative; z-index: 1; font-size: .84rem; font-weight: 650; line-height: 1.27; overflow-wrap: anywhere; }
.rule-tile img { position: absolute; right: .2rem; bottom: .15rem; width: 3.6rem; height: 3.6rem; object-fit: contain; }
.rule-tile:hover, .rules-all:hover { background: var(--tile-hover); }

#app-header.learning-top { background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / 12%); }
#app-header.learning-top .top-inner { min-height: 3.75rem; gap: .45rem; }
.learning-top .back-button { margin-inline-start: -.45rem; background: transparent; color: var(--ink); }
.learning-top .back-button span { position: relative; }
.learning-top .back-button span::after { content: ""; position: absolute; top: .13rem; left: -.16rem; width: .9rem; height: 1.5px; background: currentColor; rotate: -45deg; }
.learning-top .header-title { font-size: 1.13rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#app-header.learning-top + #screen { padding-block: .9rem max(1rem, env(safe-area-inset-bottom, 0px)); }
.native-learning { width: min(calc(100% - 2rem), 41rem); }

.native-flash-page { min-height: calc(100dvh - 5.65rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: .85rem; }
.learn-progress { margin: 0; color: var(--muted); font-size: .86rem; font-variant-numeric: tabular-nums; }
.study-progress { width: 100%; height: .27rem; border: 0; border-radius: 2rem; overflow: hidden; background: var(--blue-soft); accent-color: var(--primary); }
.study-progress::-webkit-progress-bar { background: var(--blue-soft); }
.study-progress::-webkit-progress-value { background: var(--primary); }
.study-progress::-moz-progress-bar { background: var(--primary); }
.flash-stage { flex: 1; min-height: 16rem; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; }
.flash-card { width: 100%; min-height: 15.5rem; display: grid; border-radius: 1.75rem; overflow: hidden; background: linear-gradient(var(--blue-soft), var(--surface)); }
.flash-card.shown { align-self: stretch; grid-template-rows: minmax(11rem, 1fr) minmax(9rem, 1fr); }
.flash-image-wrap { display: grid; place-items: center; padding: .85rem; }
.flash-image-circle { display: grid; place-items: center; width: clamp(8.25rem, 45vw, 12.5rem); aspect-ratio: 1; border-radius: 50%; background: color-mix(in srgb, var(--blue) 8%, transparent); }
.flash-card.shown .flash-image-circle { width: clamp(7rem, 41vw, 10.25rem); }
.flash-image-circle img { display: block; width: 75%; height: 75%; object-fit: contain; }
.flash-description { min-width: 0; align-content: center; padding: .7rem 1.35rem 1.1rem; text-align: center; }
.flash-description h2 { margin: .6rem 0 .4rem; }
.flash-description p { margin: 0; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.flash-toggle { align-self: center; display: inline-flex; align-items: center; justify-content: center; gap: .65rem; min-height: 2.9rem; padding: .45rem 1.25rem; border: 0; border-radius: 2rem; background: var(--primary); color: var(--on-primary); font-size: .87rem; font-weight: 700; }
.flash-toggle.shown { background: var(--blue-soft); color: var(--blue); }
.flash-info { display: grid; place-items: center; width: 1rem; height: 1rem; border-radius: 50%; border: 1px solid currentColor; font-size: .72rem; line-height: 1; }
.flash-toggle .native-chevron { rotate: 45deg; }
.flash-toggle.shown .native-chevron { rotate: 225deg; }
.native-flash-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.native-flash-actions > button, .game-next, .study-summary-actions > button { min-height: 3.25rem; border-radius: 1rem; }
.native-flash-actions .secondary { color: var(--blue); background: transparent; }

.native-game-page { display: grid; gap: .75rem; }
.game-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.game-meta strong { color: var(--blue); font-weight: 650; }
.game-sign { display: grid; justify-items: center; gap: .5rem; padding: 1.2rem 1rem; border-radius: 1rem; background: var(--surface); box-shadow: 0 1px 4px rgb(0 0 0 / 14%); text-align: center; }
.game-sign img { width: 8.75rem; height: 8.75rem; object-fit: contain; }
.game-sign h2 { margin: 0; font-size: .88rem; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.native-game-options { display: grid; gap: .75rem; }
.native-game-options .option { display: block; padding: .82rem 1rem; min-height: 3rem; border-radius: 1rem; }
.native-study-summary { min-height: calc(100dvh - 9rem); display: flex; flex-direction: column; justify-content: center; gap: .8rem; }
.native-study-summary .score { margin: 0; padding: 1.5rem 1rem; text-align: center; border-radius: 1rem; }
.native-study-summary .score h2 { margin: 0; font-size: 1.55rem; }
.native-study-summary .score p { margin: .55rem 0 0; }
.study-summary-actions { display: grid; gap: .65rem; }

.native-rule-list { display: grid; gap: .75rem; }
.native-rule-row, .native-rule-article { background: var(--surface); border: 0; border-radius: 1rem; box-shadow: var(--elevation); color: var(--ink); }
.native-rule-row { width: 100%; display: flex; gap: .85rem; align-items: center; min-height: 4.55rem; padding: .8rem 1rem; text-align: start; }
button.native-rule-row:hover { background: var(--tile); }
.native-rule-row-text { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.native-rule-row-text small:first-child { color: var(--blue); }
.native-rule-row-text strong { display: block; font-size: .96rem; line-height: 1.35; }
.native-rule-row-text small:last-child { margin-top: .12rem; }
.rule-number, .native-rule-image { display: grid; place-items: center; flex: 0 0 3rem; height: 3rem; background: var(--blue-soft); color: var(--blue); font-weight: 750; border-radius: 50%; }
.native-rule-image { background: #fff; border-radius: .65rem; }
.native-rule-image img { display: block; width: 2.65rem; height: 2.65rem; object-fit: contain; }
.native-chevron { flex: none; width: .42rem; height: .42rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; color: inherit; rotate: -45deg; }
.native-rule-row .native-chevron { color: var(--blue); }
.native-rule-intro { margin: 0 0 .75rem; padding: .9rem 1rem; border-radius: .8rem; background: var(--tile); color: var(--muted); }
.native-rule-article { padding: 1rem; }
.native-rule-article > strong { color: var(--blue); }
.native-rule-article p { margin: .45rem 0 0; white-space: pre-line; line-height: 1.57; overflow-wrap: anywhere; }
.native-rule-article h2 { margin: .55rem 0 .4rem; }
.native-rule-detail { display: grid; gap: .8rem; }
.rule-detail-art { display: grid; justify-items: center; gap: 1rem; padding: 1.5rem; border-radius: 1.25rem; background: var(--surface); box-shadow: var(--elevation); text-align: center; }
.rule-detail-art h2 { margin: 0; font-size: 1.3rem; }
.rule-detail-image { display: grid; place-items: center; width: min(58vw, 10rem); aspect-ratio: 1; background: #f3f5f8; border-radius: 1rem; }
.rule-detail-art img { width: 87.5%; height: 87.5%; object-fit: contain; }
.hazard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.vehicle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
:is(.hazard-grid,.vehicle-grid) .native-rule-row { display: grid; justify-items: center; gap: .35rem; text-align: center; padding: .6rem .3rem; }
:is(.hazard-grid,.vehicle-grid) .native-rule-image { width: 3.7rem; height: 3.7rem; }
:is(.hazard-grid,.vehicle-grid) .native-chevron { display: none; }
.hazard-grid .native-rule-row-text small { display: none; }
.rule-code { display: inline-flex; align-items: center; padding: .24rem .65rem; border-radius: 2rem; background: var(--blue-soft); color: var(--blue); font-size: .84rem; font-weight: 750; }
.rule-source { display: inline-flex; align-items: center; min-height: 2.75rem; margin-top: .65rem; font-size: .87rem; }
.marking-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: .8rem; background: var(--surface); }
.marking-tabs button { border: 0; border-bottom: 2px solid var(--line); background: transparent; padding: .55rem .25rem; min-height: 3rem; color: var(--muted); font-size: .9rem; }
.marking-tabs [aria-pressed="true"] { border-color: var(--blue); color: var(--blue); font-weight: bold; }
.speed-cards article { overflow: hidden; background: var(--surface); border-radius: 1.1rem; }
.speed-cards h2 { padding: .8rem 1rem; margin: 0; font-size: .98rem; line-height: 1.35; background: var(--blue-soft); }
.speed-cards article:nth-child(2n) h2 { background: var(--success-soft); }
.speed-cards article:nth-child(3n) h2 { background: var(--amber-soft); }
.speed-cards p { margin: 0; padding: .65rem 1rem; text-align: end; color: var(--muted); }
.speed-cards p strong { color: var(--blue); font-size: 1.15rem; }
.fine-search { width: 100%; min-height: 3rem; padding: .55rem .85rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); color: var(--ink); font: inherit; }
.fine-search:focus { outline: 2px solid var(--blue); outline-offset: 2px; }
.fine-chips { display: flex; align-items: center; gap: .45rem; padding: .15rem .14rem .4rem; margin: .7rem 0; overflow-x: auto; }
.fine-chips .secondary { flex: none; border-radius: 2rem; font-size: .84rem; }
.fine-results h2 { margin: .2rem 0 0; }
@media (min-width: 34rem) {
  .rules-rail { grid-auto-columns: minmax(8rem, 23%); }
  .rule-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
