:root {
  color-scheme: light;
  --page: #f5f7f5;
  --surface: #fff;
  --subtle: #edf2ef;
  --ink: #172722;
  --muted: #52665d;
  --line: #dce5df;
  --accent: #126653;
  --accent-strong: #105544;
  --accent-soft: #dceee6;
  --feature: #163d35;
  --feature-end: #20584c;
  --feature-paper: #d5f3dd;
  --on-accent: #fff;
  --good: #087343;
  --good-bg: #e4f4e9;
  --bad: #ae3039;
  --bad-bg: #fcebed;
  --amber: #ab5a17;
  --shadow: 0 2px 6px #19362d0a;
  --edge: clamp(16px, 4vw, 40px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --top: env(safe-area-inset-top, 0px);
  --nav-width: 231px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #151c1c; --surface: #1c2826; --subtle: #263430; --ink: #f2f7f3;
  --muted: #a7bbb0; --line: #344941; --accent: #9ce0bc; --accent-strong: #b0f0ce;
  --accent-soft: #2a473c; --feature: #223f36; --feature-end: #315d4d;
  --on-accent: #142a21; --good: #8de2ad; --good-bg: #203d31;
  --bad: #ffafb2; --bad-bg: #442a2d; --amber: #eea467;
  --shadow: 0 2px 6px #0002;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --page: #151c1c; --surface: #1c2826; --subtle: #263430; --ink: #f2f7f3;
    --muted: #a7bbb0; --line: #344941; --accent: #9ce0bc; --accent-strong: #b0f0ce;
    --accent-soft: #2a473c; --feature: #223f36; --feature-end: #315d4d;
    --on-accent: #142a21; --good: #8de2ad; --good-bg: #203d31;
    --bad: #ffafb2; --bad-bg: #442a2d; --amber: #eea467;
    --shadow: 0 2px 6px #0002;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 0; -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; background: var(--page); color: var(--ink); font-size: 16px; line-height: 1.5; }
button, select, input { font: inherit; }
button, a, select, summary, .review-center { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, select, summary { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: default; opacity: .46; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong, button span { overflow-wrap: anywhere; }
svg { flex: 0 0 auto; vertical-align: middle; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 3; width: var(--nav-width); padding: 32px 19px 24px;
  display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line);
}
.brand { display: inline-flex; gap: 11px; align-items: center; width: fit-content; font-weight: 750; font-size: 1.38rem; letter-spacing: -.045em; }
.sidebar .brand { margin: 0 9px 43px; }
.brand-mark { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #d5f3dd; background: #255f51; }
.sidebar nav { display: grid; gap: 7px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 13px; padding: 12px 13px; min-height: 48px; border-radius: 12px;
  color: var(--muted); font-weight: 620;
}
.sidebar nav a[aria-current], .sidebar nav a:hover { background: var(--accent-soft); color: var(--accent); }
.sidebar-status, .mobile-status, .settings-offline { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; }
.sidebar-status { margin-top: auto; padding: 12px 9px 0; }
.signal { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: var(--amber); }
.signal[data-status="ready"] { background: var(--good); }
.signal[data-status="failed"] { background: var(--bad); }
.mobile-head, .tabs { display: none; }
.main { max-width: 1190px; margin-inline: var(--nav-width) 0; padding: 39px var(--edge) 52px; }
.narrow, .lesson-page { max-width: 800px; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 0 25px; }
.page-intro h1 { font-size: clamp(1.95rem, 3.3vw, 3.28rem); font-weight: 760; line-height: 1.08; letter-spacing: -.048em; }
.eyebrow { color: var(--muted); font-size: .76rem; font-weight: 740; text-transform: uppercase; letter-spacing: .075em; margin-bottom: 8px; }
.course-status { min-width: 151px; padding-bottom: 3px; color: var(--muted); font-size: .85rem; }
.course-status > span { display: flex; align-items: center; gap: 6px; white-space: nowrap; margin-bottom: 7px; }
.course-status svg, .course-status strong { color: var(--accent); }
.meter { height: 6px; display: block; overflow: hidden; border-radius: 99px; background: var(--subtle); }
.meter span { display: block; height: 100%; width: var(--value); background: var(--accent); border-radius: inherit; transition: width 180ms ease-out; }
.feature { isolation: isolate; overflow: hidden; position: relative; min-height: 249px; border-radius: 25px; padding: 33px clamp(22px, 4vw, 43px); background: linear-gradient(110deg, var(--feature), var(--feature-end)); color: #f6fcf8; display: flex; align-items: center; }
.feature-content { z-index: 1; position: relative; min-width: 0; max-width: 65%; }
.feature .eyebrow { color: #bce2cc; }
.feature h2 { font-size: clamp(1.78rem, 3vw, 2.92rem); line-height: 1.08; letter-spacing: -.042em; max-width: 560px; margin: 0 0 22px; }
.feature-art { position: absolute; inset: 0 0 0 53%; pointer-events: none; }
.feature-ring { border: 1px solid #d5f3dd24; border-radius: 50%; width: 265px; height: 265px; position: absolute; inset: 50% auto auto 55%; transform: translate(-50%, -50%); }
.second-ring { width: 350px; height: 350px; }
.art-card { position: absolute; border-radius: 27px; top: 50%; left: 55%; width: 122px; height: 113px; }
.art-back { transform: translate(-27%, -66%) rotate(16deg); background: #78ba9a; display: grid; align-content: center; gap: 10px; padding: 26px; }
.art-back span { width: 45px; height: 5px; background: #275b4b60; border-radius: 5px; justify-self: end; }
.art-back span:last-child { width: 33px; }
.art-front { transform: translate(-75%, -35%) rotate(-12deg); background: var(--feature-paper); color: #255f51; display: grid; place-items: center; box-shadow: 0 10px 24px #132f2866; }
.button, .icon-button, .back-button, .word-button, .tool, .mode-card, .lesson-card {
  transition: background-color 140ms ease, border-color 140ms ease, transform 110ms ease;
}
.button:active, .icon-button:active, .word-button:active, .tool:active, .mode-card:active, .lesson-card:active { transform: scale(.977); }
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 13px; padding: 10px 15px; font-size: .94rem; font-weight: 700; text-align: center; }
.feature-button { background: var(--feature-paper); color: #173d32; }
.feature-button:hover { background: #ecfff0; }
.primary { background: var(--accent); color: var(--on-accent); }
.primary:hover { background: var(--accent-strong); }
.secondary, .back-button, .icon-button { background: var(--surface); border: 1px solid var(--line); }
.secondary:hover, .back-button:hover, .icon-button:hover { background: var(--subtle); }
.danger-outline { color: var(--bad); border-color: var(--line); background: var(--surface); }
.danger { color: var(--surface); background: var(--bad); }
.icon-button { display: inline-grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px; border-radius: 13px; }
.back-button { display: inline-flex; align-items: center; gap: 6px; min-height: 45px; border-radius: 12px; padding: 6px 12px 6px 7px; font-size: .93rem; font-weight: 650; }
.page-back { margin-bottom: 21px; }
.top-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.course-list { margin-top: 31px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 13px; }
.section-title h2, .lesson-launch h2, .settings-group h2, .exam-result h2 { font-size: 1.34rem; line-height: 1.25; letter-spacing: -.02em; }
.section-title > span { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.lesson-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.lesson-card, .mode-card {
  text-align: left; min-width: 0; display: flex; align-items: center; gap: 13px; border: 1px solid var(--line);
  background: var(--surface); border-radius: 16px; padding: 14px; min-height: 78px; box-shadow: var(--shadow);
}
.lesson-card:hover, .mode-card:hover { border-color: var(--accent); }
.lesson-num, .mode-icon {
  display: inline-grid; place-items: center; flex: 0 0 43px; width: 43px; height: 43px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); font-weight: 760; font-size: 1.02rem; font-variant-numeric: tabular-nums;
}
.lesson-card:disabled .lesson-num { color: var(--muted); background: var(--subtle); }
.lesson-info, .mode-info { display: grid; gap: 3px; min-width: 0; flex: 1; }
.lesson-info strong, .mode-info strong { line-height: 1.25; }
.lesson-info small, .mode-info small { font-size: .81rem; color: var(--muted); line-height: 1.3; }
.lesson-info .meter, .mode-info .meter { margin-top: 5px; max-width: 205px; height: 4px; }
.lesson-end, .mode-percent { display: inline-flex; align-items: center; justify-content: flex-end; color: var(--muted); font-size: .9rem; font-weight: 700; }
.lesson-launch {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 22px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow);
}
.lesson-launch p, .settings-group p, .exam-result p { margin-top: 7px; color: var(--muted); }
.lesson-launch .meter, .lesson-launch .button { grid-column: 1 / -1; }
.rating { display: grid; text-align: center; background: var(--accent-soft); color: var(--accent); min-width: 64px; padding: 8px; border-radius: 13px; line-height: 1.18; }
.rating strong { font-size: 1.32rem; font-variant-numeric: tabular-nums; }
.rating span { font-size: .76rem; }
.mode-grid { display: grid; gap: 11px; margin-top: 14px; }

.trainer {
  display: flex; flex-direction: column; width: min(100%, 702px); min-height: 100vh; min-height: 100dvh;
  margin: 0 auto; padding: calc(12px + var(--top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
.trainer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.train-stats { display: flex; justify-content: end; flex-wrap: wrap; gap: 5px; }
.train-stat { display: inline-flex; align-items: center; justify-content: center; gap: 3px; border-radius: 9px; background: var(--subtle); padding: 5px 8px; font-size: .85rem; font-weight: 700; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.train-stat small { font-size: .71rem; }
.train-stat.score { color: var(--accent); background: var(--accent-soft); }
.train-stat.stat-ok { color: var(--good); background: var(--good-bg); }
.train-stat.stat-bad { color: var(--bad); background: var(--bad-bg); }
.prompt-card { padding: clamp(14px, 3.1vw, 23px); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); margin: 8px 0 11px; }
.prompt-card h1, .prompt-card h2 { font-size: clamp(1.38rem, 5vw, 2.05rem); line-height: 1.17; letter-spacing: -.025em; }
.prompt-card .eyebrow { margin-bottom: 5px; }
.construction {
  display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; min-height: 61px; padding: 10px;
  border: 1px dashed var(--line); border-radius: 15px; background: var(--subtle);
}
.construction span { max-width: 100%; overflow-wrap: anywhere; padding: 4px 9px; border-radius: 8px; background: var(--surface); font-size: 1.02rem; font-weight: 630; }
.construction .placeholder { color: var(--muted); background: transparent; font-size: .91rem; font-weight: 450; padding-top: 7px; }
.practice-area { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 16px 0 10px; }
.word-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.word-button {
  min-width: 0; min-height: 51px; padding: 9px 7px; border: 1px solid var(--line); box-shadow: var(--shadow);
  border-radius: 13px; background: var(--surface); font-size: clamp(1rem, 3.9vw, 1.2rem); line-height: 1.23;
  font-weight: 640; overflow-wrap: anywhere; display: flex; align-items: center; justify-content: center; gap: 5px;
}
@media (hover: hover) { .word-button:hover { border-color: var(--accent); background: var(--subtle); } }
.text-button { align-self: flex-end; border: 0; min-height: 44px; padding: 4px 10px; background: transparent; color: var(--accent); font-size: .88rem; font-weight: 640; }
.trainer-footer { position: sticky; bottom: 0; z-index: 2; background: var(--page); padding: 9px 0 calc(10px + var(--bottom)); }
.answer-history { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 3px; margin: 0 1px 9px; }
.answer-history span { height: 5px; background: var(--line); border-radius: 5px; }
.answer-history .ok { background: var(--good); }
.answer-history .bad { background: var(--bad); }
.training-tools { display: flex; gap: 6px; align-items: stretch; justify-content: stretch; }
.tool {
  min-width: 0; flex: 1; display: grid; justify-items: center; align-content: center; gap: 3px; padding: 6px 2px;
  min-height: 58px; border: 1px solid var(--line); border-radius: 12px; font-size: .75rem; font-weight: 620; line-height: 1.15;
  background: var(--surface); text-align: center; color: var(--accent);
}
.next-tool { color: var(--on-accent); background: var(--accent); }
.feedback { display: grid; gap: 8px; }
.answer-result { padding: 12px 14px; border-radius: 13px; overflow-wrap: anywhere; }
.answer-result strong { display: flex; align-items: center; gap: 6px; font-size: .81rem; }
.answer-result p { margin: 4px 0 0; font-size: clamp(1.18rem, 4vw, 1.47rem); line-height: 1.32; color: var(--ink); }
.answer-right { background: var(--good-bg); color: var(--good); }
.answer-wrong { background: var(--bad-bg); color: var(--bad); }
mark { background: transparent; font-weight: 770; text-decoration: underline; text-underline-offset: .15em; }
mark.good { color: var(--good); }
mark.bad { color: var(--bad); }
.review-center { min-height: 147px; flex: 1; display: grid; justify-content: center; justify-items: center; align-content: center; gap: 8px; color: var(--muted); font-size: .86rem; cursor: pointer; }
.review-replay { display: grid; justify-items: center; gap: 8px; border: 0; padding: 8px; border-radius: 16px; background: transparent; }
.speaker { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; color: var(--on-accent); background: var(--good); transition: transform 110ms ease; }
.review-replay:active .speaker { transform: scale(.96); }
.voice-box { padding: 10px 13px; background: var(--accent-soft); border-radius: 12px; }
.voice-box .button { margin-top: 6px; }
.vocab-title { font-size: clamp(1.45rem, 5vw, 2.05rem); line-height: 1.14; letter-spacing: -.03em; margin-bottom: 12px; }
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; border-radius: 13px; padding: 4px; background: var(--subtle); }
.segmented button { min-height: 44px; border-radius: 10px; padding: 4px; background: transparent; border: 0; color: var(--muted); font-size: .9rem; font-weight: 650; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.vocab-prompt { display: flex; justify-content: space-between; gap: 8px; }
.vocab-prompt small { display: block; margin-top: 5px; color: var(--muted); }
.vocab-grid .word-button { min-height: 60px; }
.word-button.correct { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.word-button.incorrect { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.vocab-feedback { color: var(--muted); font-size: .88rem; }
.memory-dots { display: inline-flex; gap: 3px; align-items: center; min-height: 25px; flex: 0 0 auto; color: var(--amber); }
.memory-dots i { width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 50%; position: relative; }
.memory-dots i.filled { background: currentColor; }
.memory-dots i + i::before { content: ''; height: 1px; width: 4px; background: currentColor; position: absolute; top: 2.5px; left: -5px; }
.progress-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: .87rem; }
.vocab-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.dictionary { list-style: none; margin: 11px 0 auto; padding: 0; }
.dictionary li { display: flex; gap: 8px; align-items: center; min-height: 62px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dictionary li > div { flex: 1; min-width: 0; display: grid; }
.dictionary li > div > span { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.dictionary .icon-button { height: 44px; width: 44px; flex-basis: 44px; }

.theory-content, .settings-group, .exam-result { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; margin-bottom: 13px; }
.theory-content > p, .sheet-body > p { margin-bottom: 13px; }
.rules { border-collapse: collapse; table-layout: fixed; width: 100%; text-align: left; font-size: .92rem; }
.rules th, .rules td { padding: 9px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; vertical-align: top; }
.rules thead { background: var(--accent-soft); color: var(--accent); }
.rules th:first-child { width: 23%; }
.rules td small { display: block; margin-top: 3px; color: var(--muted); font-size: .83rem; }
.mistake { margin-top: 16px; padding: 13px; border-radius: 12px; background: var(--bad-bg); }
.mistake h3 { font-size: 1rem; color: var(--bad); }
.settings-group > h2 { margin-bottom: 10px; }
.setting-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; min-height: 58px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row span { flex: 1 1 120px; min-width: 0; }
.setting-row small { display: block; color: var(--muted); }
.setting-row select { max-width: 55%; width: 230px; min-height: 44px; padding: 6px 10px; color: var(--ink); background: var(--subtle); border: 1px solid var(--line); border-radius: 9px; }
.switch { appearance: none; margin: 0; flex: 0 0 49px; width: 49px; height: 30px; border-radius: 30px; background: var(--line); position: relative; }
.switch::after { content: ''; position: absolute; inset: 4px auto 4px 4px; width: 22px; border-radius: 50%; background: var(--surface); transition: transform 150ms ease; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(19px); }
.settings-group > .button, .sheet-body > .button, .settings-help { margin-top: 12px; }
.settings-group .voice-state { margin: 11px 0 2px; font-size: .88rem; }
.settings-group .voice-unavailable { color: var(--bad); }
.voice-example select { text-overflow: ellipsis; }
.settings-help summary, .exam-result summary { min-height: 44px; padding: 8px 0; color: var(--accent); font-weight: 650; }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.exam-launch { margin-bottom: 14px; grid-template-columns: auto 1fr; }
.exam-score { display: flex; align-items: baseline; gap: 8px; color: var(--accent); margin: 10px 0; }
.exam-score strong { font-size: 2rem; }
.exam-result details { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.exam-result details > .feedback { margin-bottom: 8px; }

#sheet {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 0;
  width: min(680px, calc(100% - 24px)); max-width: none; max-height: 86vh; max-height: 86dvh; box-shadow: 0 18px 66px #102e2450;
}
#sheet::backdrop { background: #10251c70; }
.sheet-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; position: sticky; top: 0; z-index: 1; background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 16px; }
.sheet-head h2 { font-size: 1.19rem; line-height: 1.2; }
.sheet-body { padding: 15px 16px; }
#notice {
  pointer-events: none; opacity: 0; transition: opacity 150ms ease; position: fixed; z-index: 8; left: 50%; transform: translateX(-50%);
  bottom: calc(75px + var(--bottom)); max-width: min(420px, calc(100% - 32px)); width: max-content;
  border-radius: 13px; padding: 10px 13px; background: var(--ink); color: var(--surface); font-size: .89rem; text-align: center; box-shadow: var(--shadow);
}
#notice.visible { opacity: 1; }

@media (max-width: 1020px) and (min-width: 761px) {
  :root { --nav-width: 183px; --edge: 24px; }
  .sidebar { padding-inline: 14px; }
  .lesson-card { padding: 10px; gap: 8px; }
}

@media (max-width: 760px) {
  .sidebar { display: none; }
  .mobile-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: calc(10px + var(--top)) max(var(--edge), env(safe-area-inset-right)) 6px max(var(--edge), env(safe-area-inset-left));
  }
  .mobile-head .brand { font-size: 1.24rem; min-height: 44px; }
  .mobile-head .brand-mark { width: 35px; height: 35px; border-radius: 11px; }
  .mobile-status { font-size: .74rem; }
  .main { padding: 17px max(var(--edge), env(safe-area-inset-right)) calc(86px + var(--bottom)) max(var(--edge), env(safe-area-inset-left)); margin: 0 auto; }
  .tabs {
    position: fixed; z-index: 4; inset: auto 0 0; display: flex; justify-content: space-around;
    background: var(--surface); border-top: 1px solid var(--line); padding: 5px env(safe-area-inset-right) calc(5px + var(--bottom)) env(safe-area-inset-left);
  }
  .tabs a { flex: 1; display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 53px; color: var(--muted); font-size: .74rem; font-weight: 640; }
  .tabs a svg { width: 36px; height: 26px; padding: 3px 8px; box-sizing: content-box; border-radius: 12px; }
  .tabs a[aria-current] { color: var(--accent); }
  .tabs a[aria-current] svg { background: var(--accent-soft); }
  .page-intro { margin-bottom: 18px; align-items: flex-start; flex-direction: column; gap: 11px; }
  .course-status { width: 100%; }
  .course-status .meter { max-width: 176px; }
  .feature { min-height: 194px; padding: 21px 16px; border-radius: 19px; }
  .feature-content { max-width: 68%; }
  .feature h2 { font-size: clamp(1.48rem, 5.7vw, 2.13rem); margin-bottom: 17px; }
  .feature .eyebrow { letter-spacing: .045em; font-size: .69rem; }
  .feature-art { inset-inline-start: 69%; opacity: .85; }
  .feature-ring { width: 145px; height: 145px; }
  .second-ring { width: 195px; height: 195px; }
  .art-card { height: 59px; width: 66px; border-radius: 14px; }
  .art-front svg { width: 38px; height: 38px; }
  .art-back { padding: 12px; gap: 6px; }
  .art-back span { width: 24px; height: 3px; }
  .art-back span:last-child { width: 17px; }
  .course-list { margin-top: 24px; }
  .lesson-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lesson-card { min-height: 70px; padding: 11px; }
  .lesson-launch { padding: 15px; }
}

@media (max-width: 520px) {
  .rules, .rules tbody, .rules tr, .rules th, .rules td { display: block; width: 100%; }
  .rules thead { position: absolute; clip-path: inset(50%); overflow: hidden; width: 1px; height: 1px; }
  .rules tr { padding: 9px 0; border-bottom: 1px solid var(--line); }
  .rules th:first-child { width: 100%; }
  .rules th, .rules td { padding: 2px 0; border: 0; }
  .rules th { color: var(--accent); }
  .settings-group { padding: 14px; }
  .setting-row { gap: 8px; }
  #sheet { margin: auto auto 0; width: 100%; border-radius: 20px 20px 0 0; }
  .sheet-body { padding-bottom: calc(15px + var(--bottom)); }
}

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