/* monpadel: личный кабинет.
   Палитра по референсам владельца: светлый фон с дымкой, мяч-лайм, небесно-голубой, чёрные кнопки.
   Причины решений в DESIGN.md */

:root {
  --bg: #F1F3EF;
  --haze-lime: rgba(205, 238, 84, .38);
  --haze-sky: rgba(160, 200, 222, .45);
  --surface: #FFFFFF;
  --surface-2: #EDF0EA;
  --ink: #101411;
  --muted: #545E57;
  --line: #DFE4DC;
  --lime: #D3F25A;
  --lime-ink: #18200A;
  --sky: #AFD0E2;
  --sky-ink: #0F2733;
  --sky-muted: #2E4C5A;
  --pill: #101411;
  --pill-ink: #FFFFFF;
  --hero: linear-gradient(135deg, #DDF572 0%, #B5D94A 45%, #86A934 100%);
  --hero-ink: #101411;
  --court-line: rgba(255, 255, 255, .85);
  --ok: #2F6B12;
  --ok-bg: #E6F6C2;
  --err: #A8231C;
  --err-bg: #FBE3E0;
  --focus: #101411;
  --glass: rgba(255, 255, 255, .55);
  --glass-line: rgba(255, 255, 255, .75);
  --toast-accent: #D3F25A;
  --shadow-lift: 0 24px 48px -24px rgba(16, 20, 17, .35);
  --r-s: 10px;
  --r-m: 18px;
  --r-l: 28px;
  --font: "Onest", "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1210; --haze-lime: rgba(160, 200, 50, .14); --haze-sky: rgba(90, 140, 170, .18);
    --surface: #171C19; --surface-2: #202722; --ink: #EEF2EC; --muted: #A6B1A9; --line: #2A332D;
    --sky: #23404F; --sky-ink: #E6F1F7; --sky-muted: #B4CCD8; --pill: #EEF2EC; --pill-ink: #101411;
    --ok: #B8E86A; --ok-bg: #26331A; --err: #FF9A90; --err-bg: #3A1915; --focus: #D3F25A;
    --glass: rgba(16, 20, 17, .74); --glass-line: rgba(255, 255, 255, .18); --toast-accent: #4C6B10;
    --shadow-lift: 0 24px 48px -24px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1210; --haze-lime: rgba(160, 200, 50, .14); --haze-sky: rgba(90, 140, 170, .18);
  --surface: #171C19; --surface-2: #202722; --ink: #EEF2EC; --muted: #A6B1A9; --line: #2A332D;
  --sky: #23404F; --sky-ink: #E6F1F7; --sky-muted: #B4CCD8; --pill: #EEF2EC; --pill-ink: #101411;
  --ok: #B8E86A; --ok-bg: #26331A; --err: #FF9A90; --err-bg: #3A1915; --focus: #D3F25A;
  --glass: rgba(16, 20, 17, .74); --glass-line: rgba(255, 255, 255, .18); --toast-accent: #4C6B10;
  --shadow-lift: 0 24px 48px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  /* дымка из референсов: лайм слева сверху, небо справа. Только фон, текст всегда на поверхностях или тёмный */
  background:
    radial-gradient(55% 45% at 0% 0%, var(--haze-lime), transparent 70%),
    radial-gradient(45% 50% at 100% 0%, var(--haze-sky), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.02em; }
h1 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 500; letter-spacing: -.03em; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { display: block; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }

.skip { position: absolute; left: 12px; top: -60px; background: var(--pill); color: var(--pill-ink); padding: 10px 14px; border-radius: 999px; z-index: 50; }
.skip:focus { top: 12px; }

/* ---------- Каркас ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 16px; height: calc(100vh - 32px); margin: 16px 0 16px 16px;
  display: flex; flex-direction: column; gap: 28px;
  padding: 22px 14px; background: var(--surface); border-radius: var(--r-l);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 8px; }
/* логотип monpadel из assets/monpadel-sprite.svg: «mon» цветом текста (следует теме), «padel» фирменным лаймом логотипа */
.brand { min-height: 44px; }
.brand-logo { display: block; height: 26px; width: auto; aspect-ratio: 2138 / 324; overflow: visible; }
.brand-logo .mp-mon { fill: var(--ink); }
.brand-logo .mp-padel { fill: #BBF002; }
.brand:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 10px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px;
  border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500;
}
.nav a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; flex: none; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--pill-ink); background: var(--pill); }
.side-foot { margin-top: auto; padding: 16px; background: var(--surface-2); border-radius: var(--r-m); font-size: 13px; color: var(--muted); display: grid; gap: 8px; }
.soon { font-size: 12px; font-weight: 600; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px clamp(16px, 3vw, 36px);
}
#view { padding: 8px clamp(16px, 3vw, 36px) 64px; outline: none; flex: 1; }

/* ---------- Поиск ---------- */
.search { position: relative; flex: 1; max-width: 460px; }
.search > svg { position: absolute; left: 16px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; pointer-events: none; }
.search input {
  width: 100%; min-height: 48px; padding: 0 16px 0 44px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid transparent; border-radius: 999px;
}
.search input:hover { border-color: var(--line); }
.search input::placeholder { color: var(--muted); }
.search-results {
  position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border-radius: var(--r-m);
  box-shadow: var(--shadow-lift); max-height: 380px; overflow: auto; padding: 8px;
}
.search-results a { display: block; padding: 10px 12px; border-radius: var(--r-s); text-decoration: none; }
.search-results a small { display: block; color: var(--muted); font-size: 12px; }
.search-results a[aria-selected="true"], .search-results a:hover { background: var(--surface-2); }
.search-results .empty { padding: 14px 12px; color: var(--muted); }
mark { background: var(--lime); color: var(--lime-ink); border-radius: 3px; }

.top-right { display: flex; align-items: center; gap: 10px; }
.streak { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; white-space: nowrap; background: var(--surface); min-height: 48px; padding: 0 16px 0 12px; border-radius: 999px; }
.streak .ball-ico { width: 22px; height: 22px; }
.profile { position: relative; }
.avatar-btn {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 5px 14px 5px 5px;
  background: var(--surface); border: 1px solid transparent; border-radius: 999px; cursor: pointer;
}
.avatar-btn:hover { border-color: var(--line); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--sky); color: var(--sky-ink); font-weight: 700; font-size: 15px; }
.who { display: grid; text-align: left; line-height: 1.2; }
.who small { color: var(--muted); font-size: 12px; }
.chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 230px; padding: 8px;
  background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow-lift);
}
.menu button { display: block; width: 100%; text-align: left; min-height: 44px; padding: 0 14px; border: 0; background: none; border-radius: var(--r-s); cursor: pointer; font-weight: 500; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); }
.menu .danger { color: var(--err); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--ink); }
/* главное действие: чёрная таблетка с лаймовым кружком, как кнопка Results в референсе */
.btn-ball, .btn-court { background: var(--pill); color: var(--pill-ink); border-color: transparent; padding-left: 8px; }
.btn-court { padding-left: 22px; }
.btn-ball:hover, .btn-court:hover { border-color: transparent; opacity: .9; }
.btn-ball svg { width: 32px; height: 32px; padding: 8px; border-radius: 50%; background: var(--lime); fill: var(--lime-ink); }
.btn-ghost { background: transparent; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.link { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.link:hover { text-decoration-color: currentColor; }

/* ---------- Общие блоки ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin: 8px 0 24px; }
.page-head p { color: var(--muted); margin-top: 8px; max-width: 60ch; }
.panel { background: var(--surface); border-radius: var(--r-l); padding: 24px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink); }
.tag-ok { background: var(--lime); color: var(--lime-ink); }

/* Прогресс-линия: линия корта с мячом на конце (фирменный мотив) */
.track { position: relative; height: 8px; background: var(--surface-2); border-radius: 4px; }
.track > i { position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: var(--ink); border-radius: 4px; }
.track > i::after {
  content: ""; position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; translate: 0 -50%;
  border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 2px var(--ink);
}
.track.is-zero > i::after { right: auto; left: 0; }

/* ---------- Главная: корт ---------- */
.hello { margin: 4px 0 22px; }
.hello p { color: var(--muted); margin-top: 8px; font-size: 16px; }
.court-hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  background: var(--hero); color: var(--hero-ink); border-radius: var(--r-l); overflow: hidden; isolation: isolate;
}
.court-hero::before {
  /* мягкий блик, как свет на мячах в референсе; под стеклом карточки он даёт видимое размытие */
  content: ""; position: absolute; z-index: -1; width: 420px; height: 420px; right: 8%; top: -30%;
  background: radial-gradient(circle, rgba(255,255,255,.75), rgba(255,255,255,0) 65%);
}
.court-hero::after {
  content: ""; position: absolute; z-index: -1; width: 360px; height: 360px; right: -6%; bottom: -45%;
  background: radial-gradient(circle, rgba(70, 110, 20, .55), rgba(70, 110, 20, 0) 65%);
}
.court-map { padding: 26px 26px 22px; display: grid; gap: 18px; }
.court-map h2 { font-size: 15px; font-weight: 600; }
.court-svg { width: 100%; height: auto; }
.court-svg .ln { stroke: var(--court-line); stroke-width: 2; fill: none; }
.court-svg .glass { fill: rgba(255,255,255,.45); }
.court-svg .net { stroke: #101411; stroke-width: 4; stroke-dasharray: 2 5; }
.court-svg .trail { stroke: #101411; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 8; }
.court-svg .ball-marker { transition: transform .8s cubic-bezier(.3,.7,.2,1); }
.zones { display: grid; grid-template-columns: 30fr 40fr 30fr; gap: 8px; }
.zone { text-decoration: none; padding: 10px 14px; border-radius: var(--r-m); background: rgba(255,255,255,.4); display: grid; gap: 2px; min-height: 44px; }
.zone:hover { background: rgba(255,255,255,.65); }
.zone b { font-size: 13px; font-weight: 600; }
.zone small { font-size: 12px; color: #26301A; }
.zone.is-current { background: #101411; color: #fff; }
.zone.is-current small { color: #D3F25A; }

/* Стекло №1: карточка следующего урока поверх градиента корта */
.next-card {
  margin: 16px 16px 16px 0; padding: 24px; border-radius: 24px;
  background: var(--glass); border: 1px solid var(--glass-line); color: var(--ink);
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
  display: flex; flex-direction: column; gap: 12px;
}
.next-card .eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); }
.next-card h3 { font-size: 22px; line-height: 1.2; font-weight: 600; }
.next-card .meta { color: var(--muted); font-size: 14px; }
.next-card .btn { align-self: flex-start; margin-top: auto; }
.next-card .track { background: rgba(16, 20, 17, .12); }
:root[data-theme="dark"] .next-card .track { background: rgba(255,255,255,.15); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .next-card .track { background: rgba(255,255,255,.15); } }
.up-next { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; font-size: 14px; }
.up-next li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid rgba(127, 140, 130, .3); }
.up-next small { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Главная: сводка ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; }
/* небесная карточка уровня: как карточка счёта в референсе, выделяет главное число */
.panel-sky { background: var(--sky); color: var(--sky-ink); }
.panel-sky .muted, .panel-sky .lvl-ring .num small { color: var(--sky-muted); }
.panel-sky .link { color: var(--sky-ink); }
.panel-sky .stat-row { border-color: rgba(15, 39, 51, .15); }
:root[data-theme="dark"] .panel-sky .stat-row { border-color: rgba(255,255,255,.12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .panel-sky .stat-row { border-color: rgba(255,255,255,.12); } }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 20px 28px; align-items: center; }
.lvl-ring { width: 128px; height: 128px; position: relative; }
.lvl-ring svg { width: 100%; height: 100%; rotate: -90deg; }
.lvl-ring circle { fill: none; stroke-width: 10; }
.lvl-ring .bg { stroke: rgba(255,255,255,.5); }
:root[data-theme="dark"] .lvl-ring .bg { stroke: rgba(255,255,255,.12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lvl-ring .bg { stroke: rgba(255,255,255,.12); } }
.lvl-ring .fg { stroke: var(--sky-ink); stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.lvl-ring .num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.lvl-ring .num b { font-size: 44px; font-weight: 300; line-height: 1; letter-spacing: -.04em; }
.lvl-ring .num small { font-size: 12px; margin-top: 4px; }
.stat-list { display: grid; gap: 12px; }
.stat-row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.stat-row:last-child { border-bottom: 0; padding-bottom: 0; }
.stat-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
/* неделя: плитки дней с лаймовой галочкой, как месяцы в референсе с платежами */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 6px; }
.week span { display: grid; gap: 8px; justify-items: center; align-content: start; padding: 10px 2px; font-size: 12px; border-radius: 14px; background: rgba(255,255,255,.4); }
:root[data-theme="dark"] .week span { background: rgba(255,255,255,.06); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .week span { background: rgba(255,255,255,.06); } }
.week i { width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed currentColor; opacity: .45; display: grid; place-items: center; }
.week i svg { width: 14px; height: 14px; fill: var(--lime-ink); }
.week .on i { border: 0; opacity: 1; background: var(--lime); }
.week .today { font-weight: 700; outline: 1.5px solid currentColor; }

.fixer-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: var(--pill); color: var(--pill-ink); border-color: var(--pill); }
.chip[aria-current="page"] small { color: inherit; opacity: .75; }
.fix-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; }
.fix-list a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 2px; border-top: 1px solid var(--line); text-decoration: none; min-height: 44px; align-items: center; }
.fix-list a:hover b { text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 3px; }
.fix-list b { font-weight: 500; }
.fix-list small { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.fast { display: grid; gap: 14px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days a, .days span {
  display: grid; place-items: center; aspect-ratio: 1; min-height: 40px; border-radius: 14px;
  background: var(--surface-2); font-weight: 600; font-size: 12px; text-decoration: none; text-align: center; line-height: 1.1;
}
.days a:hover { outline: 1.5px solid var(--ink); }
.days .done { background: var(--lime); color: var(--lime-ink); }
.days .now { background: var(--pill); color: var(--pill-ink); }

.ach-strip { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Программы ---------- */
.path-list { display: grid; gap: 12px; }
.path-item {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) 220px; gap: 22px; align-items: center;
  padding: 22px 24px; background: var(--surface); border: 1px solid transparent; border-radius: var(--r-l); text-decoration: none;
}
.path-item:hover { border-color: var(--ink); }
.path-step { font-size: 54px; font-weight: 300; line-height: 1; letter-spacing: -.05em; }
.path-item p { color: var(--muted); margin-top: 6px; }
.path-item .side-info { display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.extra-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
.extra { display: grid; gap: 10px; padding: 20px; border-radius: var(--r-l); background: rgba(255,255,255,.5); text-decoration: none; align-content: start; border: 1px solid var(--surface); }
:root[data-theme="dark"] .extra { background: rgba(255,255,255,.04); border-color: var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .extra { background: rgba(255,255,255,.04); border-color: var(--line); } }
.extra:hover { border-color: var(--ink); }
.extra p { color: var(--muted); font-size: 14px; }
.extra .meta { font-size: 13px; font-weight: 600; }
.extra .track { background: var(--line); }
.section-title { margin: 36px 0 6px; }

/* ---------- Курс ---------- */
.course-head { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; margin-bottom: 26px; }
.course-head p.lead { color: var(--muted); margin-top: 10px; max-width: 62ch; font-size: 16px; }
.course-box { display: grid; gap: 14px; }
.course-box .big { font-size: 56px; font-weight: 300; line-height: 1; letter-spacing: -.04em; }
.sections { display: grid; gap: 10px; }
.sec { background: var(--surface); border-radius: var(--r-m); }
.sec-toggle {
  width: 100%; display: grid; grid-template-columns: 36px minmax(0,1fr) auto 24px; gap: 14px; align-items: center;
  padding: 16px 20px; background: none; border: 0; text-align: left; cursor: pointer; min-height: 68px; border-radius: var(--r-m);
}
.sec-num { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sec-toggle h3 { font-size: 16px; font-weight: 600; }
.sec-toggle small { color: var(--muted); font-size: 13px; display: block; margin-top: 3px; }
.sec-toggle .chev { transition: rotate .2s; }
.sec-toggle[aria-expanded="true"] .chev { rotate: 180deg; }
.sec-prog { width: 110px; }
.sec-body { padding: 0 20px 14px 70px; }
.sec-body > p { color: var(--muted); margin-bottom: 10px; max-width: 70ch; }
.lessons { list-style: none; margin: 0; padding: 0; }
.lessons a {
  display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 12px; align-items: center;
  padding: 9px 10px; min-height: 46px; border-radius: 14px; text-decoration: none;
}
.lessons a:hover { background: var(--surface-2); }
.lessons a[aria-current="true"] { background: var(--surface-2); font-weight: 600; }
.lessons small { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.l-ico { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; }
.l-ico svg { width: 12px; height: 12px; fill: var(--muted); }
.lessons a:hover .l-ico, .lessons a[aria-current="true"] .l-ico { background: var(--surface); }
.is-done .l-ico, .lessons a.is-done:hover .l-ico { background: var(--lime); }
.is-done .l-ico svg { fill: var(--lime-ink); width: 14px; height: 14px; }
.is-off { opacity: .7; }

/* ---------- Урок ---------- */
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-l); overflow: hidden; color: #fff; background: radial-gradient(80% 90% at 75% 20%, #9FBF3C 0%, #4E6A1A 45%, #1A2410 100%); }
.player-poster { position: absolute; inset: 0; width: 100%; height: 100%; }
.player-poster .ln { stroke: rgba(255,255,255,.3); stroke-width: 1.5; fill: none; }
.player-title { position: absolute; left: 26px; top: 24px; right: 220px; display: grid; gap: 6px; }
.player-title b { font-size: clamp(20px, 2.8vw, 32px); font-weight: 500; line-height: 1.1; letter-spacing: -.02em; max-width: 18ch; }
.player-title small { font-size: 13px; color: rgba(255,255,255,.88); }
.play-big {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 84px; height: 84px; border-radius: 50%;
  border: 0; background: var(--lime); color: var(--lime-ink); cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 0 0 12px rgba(211, 242, 90, .25);
}
.play-big svg { width: 30px; height: 30px; fill: currentColor; margin-left: 4px; }
.play-big:hover { box-shadow: 0 0 0 16px rgba(211, 242, 90, .32); }
.demo-note { position: absolute; right: 16px; top: 16px; font-size: 12px; font-weight: 600; background: rgba(0,0,0,.5); padding: 6px 12px; border-radius: 999px; }
/* Стекло №2: панель плеера поверх кадра */
.controls {
  position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 12px;
  padding: 6px 16px 6px 6px; border-radius: 999px; background: rgba(255, 255, 255, .16);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.25);
}
.controls button { width: 44px; height: 44px; border: 0; background: #fff; color: #101411; cursor: pointer; display: grid; place-items: center; border-radius: 50%; flex: none; }
.controls button svg { width: 18px; height: 18px; fill: currentColor; }
.controls input[type="range"] { flex: 1; accent-color: var(--lime); min-width: 0; height: 24px; }
.controls time { font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.player .buffer { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: none; }
.player.is-buffering .play-big, .player.is-playing .play-big { display: none; }
.player.is-buffering .buffer { display: block; }

.lesson-info { margin-top: 22px; display: grid; gap: 16px; }
.lesson-info h1 { font-size: clamp(24px, 2.8vw, 32px); }
.lesson-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.subtabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border-radius: 999px; justify-self: start; }
.subtabs button { min-height: 42px; padding: 0 18px; background: none; border: 0; border-radius: 999px; cursor: pointer; font-weight: 500; color: var(--muted); }
.subtabs button[aria-selected="true"] { color: var(--pill-ink); background: var(--pill); }
.tabpanel { padding-top: 4px; max-width: 70ch; }
textarea {
  width: 100%; min-height: 150px; padding: 14px 16px; font: inherit; color: var(--ink); resize: vertical;
  background: var(--surface); border: 1px solid transparent; border-radius: var(--r-m);
}
textarea:hover { border-color: var(--line); }
.note-status { font-size: 13px; color: var(--muted); margin-top: 6px; min-height: 20px; }
.reading { background: var(--surface); border-radius: var(--r-l); padding: clamp(22px, 4vw, 40px); display: grid; gap: 16px; }
.reading .lead { font-size: 18px; line-height: 1.6; max-width: 62ch; }
.aside-list { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; padding: 18px 14px; }
.aside-list .panel-head { padding: 0 10px; }

/* ---------- Тест ---------- */
.quiz { max-width: 720px; display: grid; gap: 20px; }
.q-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.q-dots i { width: 30px; height: 8px; border-radius: 4px; background: var(--surface); display: block; }
.q-dots .ok { background: var(--lime); }
.q-dots .bad { background: var(--err); }
.q-dots .cur { background: var(--ink); }
.q-card { display: grid; gap: 16px; background: var(--surface); padding: clamp(20px, 3vw, 32px); border-radius: var(--r-l); }
.q-card h2 { font-size: clamp(19px, 2.4vw, 24px); line-height: 1.3; font-weight: 500; }
.options { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.options legend { margin-bottom: 14px; padding: 0; }
.opt {
  display: flex; gap: 12px; align-items: center; min-height: 54px; padding: 10px 16px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); font-weight: 500;
}
.opt input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; margin: 0; }
.opt:hover { border-color: var(--ink); }
.opt.is-right { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.opt.is-wrong { border-color: var(--err); background: var(--err-bg); color: var(--err); }
.feedback { font-weight: 600; min-height: 24px; }
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--err); }
.result { display: grid; gap: 14px; }
.score { font-size: clamp(64px, 11vw, 104px); font-weight: 300; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.score small { font-size: .35em; color: var(--muted); }

/* ---------- Достижения ---------- */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ach { display: grid; grid-template-columns: 56px minmax(0,1fr); gap: 14px; align-items: center; padding: 18px; border-radius: var(--r-l); background: rgba(255,255,255,.5); border: 1px solid var(--surface); }
:root[data-theme="dark"] .ach { background: rgba(255,255,255,.04); border-color: var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ach { background: rgba(255,255,255,.04); border-color: var(--line); } }
.ach p { font-size: 13px; color: var(--muted); }
.ach .track { margin-top: 8px; }
.medal { width: 56px; height: 56px; }
.medal .rim { fill: var(--surface-2); }
.medal .core { fill: var(--line); }
.medal .glyph { fill: var(--muted); }
.ach.is-on { background: var(--surface); border-color: var(--surface); }
.ach.is-on .rim, .ach-mini .rim { fill: var(--pill); }
.ach.is-on .core, .ach-mini .core { fill: var(--lime); }
.ach.is-on .glyph, .ach-mini .glyph { fill: var(--lime-ink); }
.ach-mini { display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: 13px; }
.ach-mini .medal { width: 34px; height: 34px; }

/* ---------- Разбор ошибок ---------- */
.fix-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; align-items: start; }
.fix-nav { display: grid; gap: 6px; }
.fix-nav .chip { justify-content: space-between; width: 100%; }

/* ---------- Состояния ---------- */
.state { display: grid; justify-items: start; gap: 12px; padding: 32px; background: var(--surface); border-radius: var(--r-l); max-width: 640px; }
.state-loading { place-items: center; justify-items: center; background: none; margin: 12vh auto; text-align: center; }
.state-error { background: var(--err-bg); }
.state-error h2 { color: var(--err); }
.state p { color: var(--muted); }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--ink); animation: spin .8s linear infinite; }
.spinner.light { border-color: rgba(255,255,255,.25); border-top-color: var(--lime); }
.empty-inline { color: var(--muted); padding: 16px; background: var(--surface-2); border-radius: var(--r-m); }
@keyframes spin { to { rotate: 360deg; } }

/* ---------- Тосты и диалог ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 60; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px; max-width: 360px; border-radius: 999px;
  background: var(--pill); color: var(--pill-ink); font-weight: 500; box-shadow: var(--shadow-lift);
  animation: toast-in .25s ease-out;
}
.toast b { font-weight: 700; color: var(--toast-accent); }
@keyframes toast-in { from { translate: 0 12px; opacity: 0; } }

dialog { border: 0; border-radius: var(--r-l); padding: 0; background: var(--surface); color: var(--ink); width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow-lift); }
dialog::backdrop { background: rgba(16, 20, 17, .45); }
.dialog-body { padding: 26px; display: grid; gap: 16px; }
.dialog-body p { color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .aside-list { position: static; max-height: none; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .course-head { grid-template-columns: minmax(0, 1fr); }
  .path-item { grid-template-columns: 64px minmax(0, 1fr); }
  .path-item .side-info { grid-column: 2; }
}
@media (max-width: 900px) {
  .court-hero { grid-template-columns: minmax(0, 1fr); }
  .next-card { margin: 0 12px 12px; }
}
@media (max-width: 760px) {
  body { padding-bottom: 92px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  /* на телефоне меню становится плавающей стеклянной панелью внизу, как в первом референсе.
     Стекло карточки урока на главной при этом остаётся вторым и последним */
  .side {
    position: fixed; z-index: 40; top: auto; bottom: 12px; left: 12px; right: 12px; height: auto; margin: 0;
    padding: 6px; border-radius: 999px; flex-direction: row; gap: 0;
    background: rgba(255, 255, 255, .62); border: 1px solid rgba(255,255,255,.8);
    backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
    box-shadow: var(--shadow-lift);
  }
  :root[data-theme="dark"] .side { background: rgba(23, 28, 25, .7); border-color: rgba(255,255,255,.12); }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; width: 100%; gap: 2px; }
  .nav a { flex: 1; flex-direction: column; gap: 2px; justify-content: center; min-height: 54px; padding: 4px 2px; font-size: 11px; text-align: center; }
  .top { padding: 12px 16px; gap: 8px; }
  .who, .chev, .streak .label { display: none; }
  .avatar-btn { padding: 5px; }
  .streak { padding: 0 14px 0 10px; }
  #view { padding: 4px 16px 32px; }
  .court-map { padding: 18px 16px 14px; }
  .zones { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .stat-list { width: 100%; }
  .sec-toggle { grid-template-columns: 26px minmax(0,1fr) 24px; padding: 14px 16px; }
  .sec-prog { display: none; }
  .sec-body { padding: 0 8px 12px; }
  .fix-layout { grid-template-columns: minmax(0, 1fr); }
  .fix-nav { display: flex; flex-wrap: wrap; }
  .fix-nav .chip { width: auto; }
  .panel { padding: 20px; }
  .controls time { display: none; }
  .play-big { width: 62px; height: 62px; top: 40%; }
  .player-title { display: none; }
  .toasts { left: 16px; right: 16px; bottom: 96px; }
  .toast { max-width: none; }
}
@media (max-width: 760px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .side { background: rgba(23, 28, 25, .7); border-color: rgba(255,255,255,.12); }
}
