/* ==========================================================================
   Monday visual layer — carries the login page's language into the app:
   white gradient background, soft white cards, the blue gradient, halftone dots.
   Loaded after monday.css; only changes look, never layout logic.
   ========================================================================== */

:root {
  --grad-1: #BBCFF4;  /* powder   */
  --grad-2: #7FA3F3;  /* cornflower */
  --grad-3: #2B60E5;  /* electric */
  --grad-4: #153893;  /* navy     */
  --grad-5: #020B29;  /* midnight */
  --grad: linear-gradient(90deg, var(--grad-2) 0%, var(--grad-3) 55%, var(--grad-4) 100%);
  --grad-deep: linear-gradient(135deg, var(--grad-3) 0%, var(--grad-4) 70%, var(--grad-5) 100%);
  --bar: #0A1A5C;           /* top bars and hero banners: one plain dark blue */
  --card-shadow: 0 1px 2px rgba(14, 14, 14, .04), 0 10px 30px rgba(26, 40, 90, .07);
  --dot: rgba(120, 128, 150, .28);
}
[data-theme="dark"] {
  --bar: #141414;
  --card-shadow: none;
  --dot: rgba(255, 255, 255, .08);
}

/* ---------------------------------------------------------------- background */

/* no rubber-band overscroll: pulling past the top/bottom must not reveal an empty strip; the root also gets the
   page's base colour in case a browser still bounces */
html, body { overscroll-behavior-y: none; }
html { background: #FFFFFF; }
html[data-theme="dark"] { background: #0D0D0D; }

/* the page background is painted on <body>; on short pages the body ended mid-screen and the white <html> showed
   below it, so the body always fills at least the window */
body:not(.auth-body) {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1000px 600px at 100% -10%, #EAF0FA 0%, rgba(234, 240, 250, 0) 70%),
    linear-gradient(160deg, #FFFFFF 0%, #F7F8FB 45%, #EEF1F6 100%) fixed;
}
[data-theme="dark"] body:not(.auth-body) {
  background: #0D0D0D;
}
.topbar { background: var(--surface); border-bottom-color: var(--line); z-index: 35; }

/* ---------------------------------------------------------------- floating menu */

:root { --rail: 100px; --topbar: 88px; }
.rail {
  top: 16px; height: calc(100vh - 28px); margin: 16px 0 12px 12px; padding: 10px 8px; gap: clamp(5px, 0.9vh, 14px);
  border: var(--bw, 1px) solid var(--line); border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px);
  box-shadow: var(--card-shadow);
}
.rail__item { width: 62px; height: 56px; margin-inline: auto; padding: 0 4px; border-radius: 14px; font-size: 9.5px; letter-spacing: -.02em; line-height: 1.15; justify-content: center; flex: none; }
.rail__item .ic { --ic: 19px; }
.rail__item svg { stroke-width: 1.9; }
.rail__label { display: inline; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail__logo { width: 40px; height: 40px; margin-bottom: clamp(10px, 1.8vh, 20px); flex: none; }
.rail__foot { display: flex; flex-direction: column; align-items: center; gap: clamp(5px, 0.9vh, 14px); padding-top: 2px; flex: none; }
[data-theme="dark"] .rail { border-color: var(--line); }
.rail__item.is-active,
[data-theme="dark"] .rail__item.is-active { background: var(--accent-soft); color: var(--accent); border-radius: 14px; }
.rail__item.is-active .ic,
.rail__item.is-active .rail__label,
.rail__item.is-active svg { color: var(--accent); }

/* Dropdown links inside top-right account menu (secondary teacher/admin tools) */
.acct-menu__links { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.acct-menu__link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); text-decoration: none; font: 600 13.5px/1.2 var(--font); }
.acct-menu__link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.acct-menu__link.is-active { background: var(--accent-soft); color: var(--accent); }
.acct-menu__badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 11.5px; font-weight: 800; display: inline-grid; place-items: center; }

/* Teacher settings tools grid + unified Student-style frosted 22px cards */
.t-tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.t-tool-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s, background .15s; }
.t-tool-link:hover { border-color: var(--accent); background: var(--surface); transform: translateY(-1px); text-decoration: none; }
.t-tool-link__ic { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.t-tool-link > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.t-tool-link b { font-size: 14px; font-weight: 700; }
.t-tool-link small { font-size: 12px; color: var(--muted); }
@media (max-width: 640px) { .t-tools-grid { grid-template-columns: minmax(0, 1fr); } }
/* Solid rectangular background blocks on every page with .page-sky so dots never bleed through */
.page-sky ~ .app .card,
.page-sky ~ .app .list,
.page-sky ~ .app .table-wrap,
.page-sky ~ .app .people,
.page-sky ~ .app .admin-tabs,
.page-sky ~ .app fieldset {
  border-radius: 20px;
  background: var(--surface);
  border-color: var(--line);
}
.page-sky ~ .app .people-bar {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.page-sky ~ .app fieldset {
  position: relative;
  padding-top: 46px;
}
.page-sky ~ .app fieldset > legend {
  position: absolute;
  top: 18px;
  left: 24px;
  right: 24px;
  width: auto;
  float: none;
  padding: 0;
  margin: 0;
  line-height: 1.2;
  text-align: left;
  justify-content: flex-start;
}
.page-sky ~ .app fieldset:is(.cb__filter, .bank-filter) {
  padding-top: 42px;
}
.page-sky ~ .app fieldset:is(.cb__filter, .bank-filter) > legend {
  top: 12px;
  left: 14px;
  right: 14px;
  width: auto;
  float: none;
}
@media (max-width: 640px) {
  .page-sky ~ .app fieldset { padding-top: 42px; }
  .page-sky ~ .app fieldset > legend { top: 14px; left: 18px; right: 18px; }
  .page-sky ~ .app fieldset:is(.cb__filter, .bank-filter) { padding-top: 40px; }
  .page-sky ~ .app fieldset:is(.cb__filter, .bank-filter) > legend { top: 12px; left: 14px; right: 14px; }
}
.page-sky ~ .app .page-head,
.page-sky ~ .app .an-head {
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.page-sky ~ .app .empty {
  border-radius: 20px;
  background: var(--surface);
  border: var(--bw, 1px) solid var(--line);
  box-shadow: var(--shadow);
}
.page-sky ~ .app .page-head .page-head__text h1,
.page-sky ~ .app .an-head .page-head__text h1 {
  margin: 0;
}
.page-sky ~ .app .t-today { border-radius: 20px; padding: 18px 22px; }
.page-sky ~ .app .card.t-hero-bar,
.page-sky ~ .app .t-hero-bar,
.t-hero-bar { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; width: 100%; padding: 0; border-radius: 0; background: transparent; border: 0; box-shadow: none; }
.works-top-card { gap: 16px; }
.pub-grid { align-items: start; }
.pub-card .card__head { align-items: baseline; gap: 12px; }
.pub-card__meta { white-space: nowrap; flex: none; }
.pub-card__foot { align-items: center; }
.pub-card__foot .btn { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.pub-work { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); align-items: center; }
.pub-work[hidden] { display: none; }
.pub-work__title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-work__meta { white-space: nowrap; font-size: 12px; }
.pub-work__acts { display: inline-flex; gap: 4px; align-items: center; }
.pub-card__more { align-self: flex-start; padding: 4px 8px; font-size: 12.5px; font-weight: 700; color: var(--accent-ink); }
.pub-card.is-expanded { grid-column: 1 / -1; }
.pub-card.is-expanded .pub-works { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 10px; }
.pub-card.is-expanded .pub-work { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 6px 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); align-items: start; }
.pub-card.is-expanded .pub-work__title { grid-column: 1 / -1; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.pub-card.is-expanded .pub-work__meta { align-self: center; }
.pub-card.is-expanded .pub-work__acts { justify-self: end; }
.t-hero-bar__title { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; text-align: left; gap: 4px; flex: 1 1 320px; min-width: 0; }
.t-hero-bar__title h1 { margin: 0; font: 800 28px/1.15 var(--font-display); letter-spacing: -.02em; }
.t-hero-bar__title p { margin: 0; font-size: 14px; color: var(--muted); }
.t-hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none; }
.t-hero-actions--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; flex: none; }
.t-hero-actions--grid > .btn,
.t-hero-actions--grid > .pk-basket-wrap,
.t-hero-actions--grid > .pk-basket-wrap > .btn { width: 100%; }
@media (max-width: 680px) { .t-hero-actions--grid { width: 100%; } }
.t-add-card { padding: 18px 24px; }
.t-add-card__sum { list-style: none; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; text-align: center; cursor: pointer; font-weight: 700; font-size: 15px; padding: 4px 12px; border-radius: 10px; }
.t-add-card__sum::-webkit-details-marker { display: none; }
.t-add-card__sum::before { content: "▸"; font-size: 18px; line-height: 1; color: var(--text-2); transition: transform .15s; }
.t-add-card[open] .t-add-card__sum::before,
details[open] > .t-add-card__sum::before { transform: rotate(90deg); }
.t-add-card__sum:focus { outline: none; }
.t-add-card__sum:focus-visible { outline: 2px solid var(--line-strong); outline-offset: 2px; }
.btn--min { min-height: 38px; padding: 0 14px; border-radius: 11px; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px; line-height: 1; }
.btn--min.btn--secondary { background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); }
.btn--min.btn--secondary:hover { background: var(--surface-2); border-color: var(--text-2); }
.icon-btn--xs { width: 32px; height: 32px; border-radius: 9px; }

/* Student-view Question Redactor modal */
.q-redact-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(2, 11, 41, .45); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; }
.q-redact-backdrop[hidden] { display: none; }
.q-redact-dialog { width: min(1160px, 100%); max-height: calc(100vh - 40px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: 0 24px 70px rgba(2, 11, 41, .28); display: flex; flex-direction: column; overflow: hidden; }
.q-redact-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.q-redact-dialog__head h2 { margin: 0; font: 800 18px/1.2 var(--font-display); }
.q-redact-dialog__body { overflow-y: auto; padding: 20px 22px; }
.q-redact-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.q-redact-preview { border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; background: var(--surface-2); display: flex; flex-direction: column; gap: 14px; }
.q-redact-tools { display: flex; flex-direction: column; gap: 12px; }
.q-redact-opt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; }
.q-redact__kbd { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.q-redact__key { min-width: 34px; height: 32px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 700 13px var(--font); cursor: pointer; display: inline-grid; place-items: center; transition: border-color .15s, background .15s, color .15s, transform .1s; }
.q-redact__key:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--accent-ink); }
.q-redact__key:active { transform: translateY(1px); }
.math-kbd { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.math-kbd__btn { min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: 600 13px/1 var(--font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .12s, border-color .12s; }
.math-kbd__btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
@media (max-width: 900px) { .q-redact-grid { grid-template-columns: minmax(0, 1fr); } }
.rail__logo {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  --logo-ink: linear-gradient(90deg, #7FA3F3, #4275E9, #2B60E5, #2456D9, #153893, #020B29);   /* the wordmark's letters, left to right */
  border: 2px solid transparent; font-size: 19px; color: transparent; -webkit-text-fill-color: transparent;
  background: var(--logo-ink) text, linear-gradient(var(--surface), var(--surface)) padding-box, var(--logo-ink) border-box;
  -webkit-background-clip: text, padding-box, border-box;
}
[data-theme="dark"] .rail__logo { color: #F2F2F2; -webkit-text-fill-color: #F2F2F2; border-color: #363636; background: var(--surface-2); -webkit-background-clip: border-box; }

/* ---------------------------------------------------------------- cards */

.card, .q-card, .explain, fieldset, .list, .table-wrap {
  border-radius: 22px;
  box-shadow: var(--card-shadow);
}
.card, .q-card, .explain, fieldset { background: color-mix(in srgb, var(--surface) 92%, transparent); }
[data-theme="dark"] .card, [data-theme="dark"] .q-card, [data-theme="dark"] fieldset { border-color: var(--line); }
.table-wrap { background: var(--surface); }   /* tables sit on a solid block, so the sky never shows through the rows */
.card--soft { box-shadow: none; }
.card--dashed { box-shadow: none; background: transparent; }

/* ---------------------------------------------------------------- gradient accents */

.bar > span { background: var(--btn-bg); }
.session-bar { background: var(--bar); }

/* ---------------------------------------------------------------- hero: gradient + halftone + orbit */

.hero { position: relative; isolation: isolate; box-shadow: 0 24px 60px rgba(21, 56, 147, .25); }
.hero > *:not(.hero__canvas):not(.hero__orbit) { position: relative; z-index: 2; }
.hero::before {           /* film grain, like the reference gradient */
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .18; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.hero__orbit { position: absolute; inset: 0; pointer-events: none; }   /* no z-index: items go behind or in front of the number */
.hero__orbit .sp-item {
  position: absolute; left: 0; top: 0; white-space: nowrap; color: #FFFFFF; transform-origin: 50% 50%;
  font-size: 18px; padding: 7px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(4px);
}
.hero__orbit .sp-item.is-bare { background: transparent; border: 0; font-size: 26px; padding: 0; }
.hero__orbit .katex { color: inherit; }

/* ---------------------------------------------------------------- halftone texture for empty states */

.empty { position: relative; overflow: hidden; border-style: solid; border-color: var(--line); background: color-mix(in srgb, var(--surface) 80%, transparent); }
.empty::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, var(--dot) 1.6px, transparent 2px);
  background-size: 12px 12px;
  -webkit-mask-image: radial-gradient(120% 90% at 100% 100%, #000 0%, transparent 70%);
          mask-image: radial-gradient(120% 90% at 100% 100%, #000 0%, transparent 70%);
}
.empty > * { position: relative; }

/* ---------------------------------------------------------------- mobile */

@media (max-width: 760px) {
  .rail { top: auto; height: auto; margin: 0; border-radius: 22px 22px 0 0; }
  .rail__logo { display: none; }
  .hero__orbit { display: none; }   /* the hero stacks on phones — no free space for the orbit */
}
@media (prefers-reduced-motion: reduce) {
  .hero__orbit { display: none; }
}

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

.profile-head { flex-direction: row; align-items: center; gap: 24px; flex-wrap: wrap; }
.profile-head h1 { font-size: 30px; }
.avatar--xl { width: 104px; height: 104px; font-size: 36px; }
.profile-head__pick { position: relative; display: block; cursor: pointer; border-radius: 50%; }
.profile-head__overlay {
  position: absolute; inset: 0; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: rgba(2, 11, 41, .55); color: #FFFFFF; font-size: 12px; font-weight: 700; opacity: 0; transition: opacity .15s;
}
.profile-head__pick:hover .profile-head__overlay, .profile-head__pick:focus-within .profile-head__overlay { opacity: 1; }
.profile-head__text { min-width: 0; }

/* ---------------------------------------------------------------- Home */

.hero--home { flex-direction: column; align-items: stretch; justify-content: space-between; gap: 30px; padding: 48px 48px 36px; min-height: 460px;
  /* white card with a stroke; the bitmap sky draws in blue (--sky-ink is read by hero.js) */
  --sky-ink: 43, 96, 229; --hero-muted: var(--text-2);
  background: var(--surface); color: var(--text); border: 1.5px solid var(--line-strong);
  box-shadow: 0 18px 40px rgba(21, 56, 147, .08); }
.hero--home::before { display: none; }
.hero--home .hero__number { color: var(--accent); }
.hero--home .eyebrow, .hero--home .hero__unit { color: var(--text); }
[data-theme="dark"] .hero--home { --sky-ink: 196, 196, 196; border-color: var(--line); box-shadow: none; }
/* readability: normal-case greeting, date in the main text colour, larger strip labels */
.home-hero__hello { font-size: 16px; font-weight: 600; color: var(--text); }
.hero--home .hero-muted { color: var(--text); font-weight: 600; font-size: 15px; }
.hero--home .home-hero__line { color: var(--text-2); }
.home-hero { display: flex; justify-content: space-between; align-items: center; gap: 28px; flex-wrap: wrap; }
.home-hero__count { display: flex; flex-direction: column; gap: 6px; }
.home-hero__count .hero__unit { display: flex; flex-direction: column; line-height: 1.15; }
/* the two lines next to the number end level with the foot of the digits, not hanging below their baseline */
.home-hero__count .hero__count { align-items: flex-end; }
.home-hero__count .hero__count .hero__unit { padding-bottom: .12em; }
.home-hero__line { font-size: 17px; font-weight: 500; color: var(--hero-muted); letter-spacing: 0; }

.home-ring { position: relative; width: 168px; height: 168px; flex: none; }
.home-ring svg { width: 100%; height: 100%; display: block; }
.home-ring__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.home-ring__value { font: 800 40px/1 var(--font-display); letter-spacing: -.03em; }
.home-ring__label { margin-top: 6px; font-size: 12px; line-height: 1.35; color: var(--hero-muted); font-weight: 600; }

.home-goal { display: flex; flex-direction: column; gap: 10px; min-width: 260px; padding: 18px 22px; border-radius: 20px;
  background: var(--surface); border: var(--bw, 1px) solid var(--line); box-shadow: 0 6px 18px rgba(21, 56, 147, .06); }
.home-goal__nums { display: flex; align-items: flex-end; gap: 14px; }
.home-goal__nums > span:not(.home-goal__arrow) { display: flex; flex-direction: column; }
.home-goal__nums b { font: 800 40px/1 var(--font-display); letter-spacing: -.03em; }
.home-goal__nums small { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.home-goal__arrow { font-size: 24px; color: var(--hero-muted); padding-bottom: 18px; }
.home-goal__bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.home-goal__bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.home-goal__line { margin: 0; font-size: 14px; color: var(--text); text-decoration: none; }
.home-hero__note { margin: 0; align-self: flex-start; display: grid; gap: 4px; padding: 12px 18px; border-radius: 16px; font-size: 15px; font-weight: 600;
  color: var(--text); background: var(--surface); border: var(--bw, 1px) solid var(--line); }
.home-hero__note b { font-weight: 800; }

/* Mondays to the exam: one square per week, like a contribution chart — passed weeks filled, this week outlined, the rest empty */
.home-strip { display: flex; flex-direction: column; gap: 6px; margin-top: 20px; }
.home-strip__month { display: flex; align-items: center; gap: 6px; }
.home-strip__month small { width: 40px; flex: none; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--text); opacity: .75; }
/* the Monday's date inside each square, so a row reads like a calendar */
.home-strip__month .home-strip__dot { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.home-strip__month .home-strip__dot.is-past { color: var(--accent); }
.home-strip__month .home-strip__dot.is-now { color: #fff; }
.home-strip__key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--text-2); }
.home-strip__key span { display: inline-flex; align-items: center; gap: 6px; }
.home-strip__key .home-strip__dot { width: 12px; height: 12px; border-radius: 3px; animation: none; box-shadow: none; }
.home-strip__dot { width: 16px; height: 16px; border-radius: 4px; flex: none; background: var(--surface-2); border: var(--bw, 1px) solid var(--line); }
.home-strip__dot.is-past { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); border-color: transparent; }
.home-strip__dot.is-now { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
  animation: strip-pulse 2.4s ease-in-out infinite; }
.home-strip__end { margin-left: auto; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
@keyframes strip-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 8%, transparent); } }

.home-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.home-task { justify-content: space-between; gap: 14px; padding: 28px; }
.home-task__title { font: 800 30px/1.15 var(--font-display); letter-spacing: -.02em; }
.home-task .btn { align-self: flex-start; }
.home-task__path { font-weight: 600; }

.home-portrait { color: inherit; text-decoration: none; gap: 18px; transition: border-color .15s; }
.home-portrait:hover { border-color: var(--accent); text-decoration: none; }
.portrait { display: flex; flex-wrap: wrap; gap: 18px 22px; align-items: flex-end; }
.portrait__group { display: flex; flex-direction: column; gap: 8px; }
.portrait__dots { display: grid; grid-template-columns: repeat(3, 18px); gap: 6px; align-items: center; justify-items: center; }
.portrait__dot { display: inline-block; border-radius: 50%; width: 8px; height: 8px; background: #BBCFF4; }
.portrait__dot.is-new { width: 7px; height: 7px; background: transparent; border: 1.5px solid #BBCFF4; }
.portrait__dot.is-progress { width: calc(8px + var(--a, .5) * 8px); height: calc(8px + var(--a, .5) * 8px); background: color-mix(in srgb, #2B60E5 calc(var(--a, .5) * 100%), #BBCFF4); }
.portrait__dot.is-mastered { width: 17px; height: 17px; background: #153893; }
[data-theme="dark"] .portrait__dot.is-mastered { background: #7FA3F3; }
.portrait__label { font-size: 11px; font-weight: 700; color: var(--muted); max-width: 96px; line-height: 1.25; overflow-wrap: break-word; }
.portrait__legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: auto; }
.portrait__legend span { display: inline-flex; align-items: center; gap: 6px; }
.portrait__legend .portrait__dot.is-mastered { width: 12px; height: 12px; }

/* session modes: one row each, the length of the bar is the length of the session on a 0–30 min scale (see .ts below) */
@media (max-width: 760px) {
  .hero--home { padding: 24px 20px 20px; }
  .home-ring { width: 132px; height: 132px; }
  .home-ring__value { font-size: 30px; }
  .home-row { grid-template-columns: minmax(0, 1fr); }
  .home-task__title { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { .home-strip__dot.is-now { animation: none; } }

/* ---------------------------------------------------------------- dots everywhere: skill map, session steps, mode dots */

.dot-cell { width: 20px; height: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.portrait__dot.is-outside { width: 7px; height: 7px; background: transparent; border: 1.5px dashed var(--line-strong); }
.skills-strip { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; min-height: 18px; }
.skills-strip .portrait__dot { flex: none; }

.steps { gap: 8px; align-items: center; flex: 0 1 auto; }
.steps span { flex: none; width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .25); }
.steps span.is-done { background: #FFFFFF; }
.steps span.is-wrong { background: #FF8A8A; }
.steps span.is-current { width: 14px; height: 14px; background: transparent; border: 2px solid #FFFFFF; box-shadow: 0 0 0 4px rgba(255, 255, 255, .18); }

.mode-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; border: 1px solid rgba(21, 56, 147, .2); }
.mode-dot.shade-1 { background: #E8EEFB; } .mode-dot.shade-2 { background: #C9D8F7; } .mode-dot.shade-3 { background: #9DB8F2; }
.mode-dot.shade-4 { background: #2B60E5; } .mode-dot.shade-5 { background: #153893; }

.hero .home-ring { margin-right: 8px; }
.hero > .home-ring + .stack-sm { flex: 1 1 260px; min-width: 0; }
.hero:has(> .home-ring) { justify-content: flex-start; gap: 36px; align-items: center; }
.home-ring__value.is-long { font-size: 30px; }
/* on the white Home card the ring draws in the accent blue instead of white */
.hero--home .home-ring circle { fill: var(--line-strong); }
.hero--home .home-ring circle.is-on { fill: var(--accent); }
.hero--home .home-ring__value { color: var(--accent); }
.hero--home .btn--primary { background: var(--btn-bg); color: var(--btn-text); }
/* result: the Home card, sized to its content — ring and text side by side, the sky on the right */
.hero--result { min-height: 0; padding: 40px 48px; flex-wrap: nowrap; }   /* a wrapping column card sizes itself as if the ring and text were stacked */
.result-hero { display: flex; align-items: center; gap: 36px; flex-wrap: wrap; max-width: 760px; }
.result-hero > .stack-sm { flex: 1 1 260px; min-width: 0; }
.hero--result .hero__unit { font-size: 26px; }
@media (max-width: 760px) { .hero--result { padding: 24px 20px; } .result-hero { gap: 20px; } .hero--result .hero__unit { font-size: 22px; } }
.hero:has(> .home-ring) .hero__unit { font-size: 26px; }

/* ---------------------------------------------------------------- test player */

.test-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 24px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 85%, transparent); position: sticky; top: 64px; z-index: 14; backdrop-filter: blur(8px); }
.test-page { padding-bottom: 120px; }
.q-screen { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }
.is-paged .q-screen { margin-bottom: 0; }
.q-head { display: flex; align-items: center; gap: 6px; border: var(--bw, 1px) solid var(--line-strong); border-radius: 14px; overflow: hidden; background: var(--surface); }
.q-head__num { background: var(--btn-bg); color: var(--btn-text); font-weight: 800; min-width: 48px; align-self: stretch; display: grid; place-items: center; font-size: 17px; }
.q-head__btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; font: 700 14px var(--font); color: var(--text); padding: 12px 14px; cursor: pointer; border-radius: 10px; }
.q-head__btn:hover { background: var(--surface-2); }
.q-head__btn[aria-pressed="true"] { color: var(--accent); }
.q-head__btn[data-mark][aria-pressed="true"] .ic { color: var(--mark); }
.q-card--test { box-shadow: none; }

.q-review { display: flex; flex-direction: column; gap: 14px; padding: 28px; border: var(--bw, 1px) solid var(--line); border-radius: 22px; background: var(--surface); }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; }
.q-grid--big { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
.q-grid button { height: 40px; border-radius: 10px; border: 1.5px dashed var(--line-strong); background: var(--surface); font: 700 14px var(--font); color: var(--text); cursor: pointer; position: relative; }
.q-grid--big button { height: 52px; font-size: 16px; }
.q-grid button.is-answered { background: var(--btn-bg); color: var(--btn-text); border: 1.5px solid var(--btn-bg); }
.q-grid button.is-current { outline: 2px solid var(--accent); outline-offset: 2px; }
.q-grid button.is-marked::after { content: ""; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--mark); border: 2px solid var(--surface); }
.q-grid__legend { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.q-grid__legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border-radius: 4px; border: 1.5px dashed var(--line-strong); display: inline-block; position: relative; }
.lg.is-answered { background: var(--btn-bg); border: 0; }
.lg.is-marked { border: 0; background: var(--mark); border-radius: 50%; width: 10px; height: 10px; }

.test-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.test-foot__mid { position: relative; }
.test-foot__counter { font-weight: 800; border: 1.5px solid var(--line-strong); }
.q-grid-pop { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); width: min(520px, 90vw); background: var(--surface); border: var(--bw, 1px) solid var(--line-strong); border-radius: 18px; padding: 16px; box-shadow: 0 20px 50px rgba(2, 11, 41, .2); }
.test-body:not(:has(.is-paged)) .test-foot { display: none; }

/* ORT paper layout */
.ort-page { display: flex; flex-direction: column; gap: 16px; }
.ort-instruction { border: 1.5px solid var(--text); border-radius: 10px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; background: var(--surface); }
.ort-main { min-width: 0; container-type: inline-size; container-name: ort-main; }
.ort-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: var(--bw, 1px) solid var(--line-strong); border-radius: 16px; background: var(--surface); }
.ort-q { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding: 18px 20px; border-bottom: 1px solid var(--line); scroll-margin-top: 140px; transition: background .3s; min-width: 0; }
.ort-q:nth-child(odd) { border-right: 1px solid var(--line); }
.ort-q.is-flash { background: var(--accent-soft); }
.ort-q__num { font-weight: 800; font-size: 17px; }
.ort-q__body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ort-q__text { font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.ort-q__options { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 16px; min-width: 0; }
.ort-q__options li { min-width: 0; overflow-wrap: anywhere; }
.ort-q .katex-display { overflow-x: auto; max-width: 100%; }
.ort-q .q-columns__body { font-size: 18px; padding: 14px 8px; }
/* pictures in ORT cards: compact, on white like the paper, left-aligned with the text */
.ort-q .q-figure { align-items: flex-start; }
.ort-q .q-figure__frame { background: #fff; padding: 6px; justify-content: flex-start; }
.ort-q .q-figure img { width: auto; max-width: 100%; max-height: 190px; }
.ort-q .q-figure figcaption { display: none; }
.ort-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px 0; }
.ort-pager__dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.ort-pager__dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: var(--line-strong); cursor: pointer; }
.ort-pager__dots button.is-current { background: var(--btn-bg); width: 22px; border-radius: 5px; }
.test-body:not(:has(.is-paged)) .ort-pager { display: none; }
.ort-sheet { border: var(--bw, 1px) solid var(--line); border-radius: 22px; padding: 24px; background: var(--surface); box-shadow: var(--card-shadow); }
.ort-sheet h2 { color: var(--accent); text-align: center; margin-bottom: 16px; }
.ort-sheet__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 5), auto); grid-auto-flow: column; gap: 6px 28px; }
.ort-sheet__row { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 10px; }
.ort-sheet__row.is-answered { background: var(--accent-soft); }
.ort-sheet__num { width: 28px; text-align: right; font-weight: 800; color: var(--text); text-decoration: none; margin-right: 4px; }
.ort-sheet__input { min-height: 34px; max-width: 140px; font-size: 14px; }
.bubble { position: relative; }
.bubble input { position: absolute; opacity: 0; pointer-events: none; }
.bubble span { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.bubble input:checked + span { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-text); }
.bubble input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* drawers */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 40; background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: -20px 0 60px rgba(2, 11, 41, .18); display: flex; flex-direction: column; }
.drawer--wide { width: min(640px, 100vw); }
.drawer--left { left: 0; right: auto; border-left: 0; border-right: 1px solid var(--line-strong); box-shadow: 20px 0 60px rgba(2, 11, 41, .18); }
.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 18px; }
.drawer__body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; flex: 1; }
.drawer__body--flush { padding: 0; }
.desmos-box { flex: 1; min-height: 420px; height: 100%; }
.sheet-view h3 { font-size: 16px; margin-bottom: 8px; }
.sheet-view__branch { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 10px 0 6px; }
.sheet-view__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 10px; }
.sheet-entry { border: var(--bw, 1px) solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); }
.sheet-entry img { width: 100%; max-height: 110px; object-fit: contain; background: #FFFFFF; border-radius: 8px; cursor: zoom-in; }
.sheet-entry__topic { font-size: 13px; font-weight: 700; }
.sheet-entry__formula { font-size: 14px; overflow-x: auto; padding-block: 2px; }
.sheet-entry__formula .katex { white-space: nowrap; }   /* a long formula stays on one line */

@media (max-width: 760px) {
  .ort-grid { grid-template-columns: minmax(0, 1fr); }
  .ort-sheet__grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .ort-q:nth-child(odd) { border-right: 0; }
  .test-tools { top: 56px; padding: 8px 14px; }
  .q-head__btn span { display: none; }
  .test-foot { padding: 10px 12px; }
}

/* formulas page */
.sheet-card.is-off { opacity: .7; }
.sheet-view__grid--page { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.sheet-entry { position: relative; }
.sheet-entry__del { position: absolute; top: 6px; right: 6px; }
.sheet-entry__del button { width: 22px; height: 22px; border-radius: 50%; border: var(--bw, 1px) solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--muted); opacity: 0; transition: opacity .15s; }
.sheet-entry:hover .sheet-entry__del button, .sheet-entry__del button:focus-visible { opacity: 1; }

/* file picker */
.file-pick { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 7px 8px 7px 7px; border: 1.5px dashed var(--line-strong); border-radius: 14px; background: var(--surface); cursor: pointer; min-width: 0; transition: border-color .15s; }
.file-pick:hover, .file-pick:focus-within { border-color: var(--accent); }
.file-pick__btn { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 14px; }
.file-pick:focus-within .file-pick__btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-pick__name { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-pick.has-file .file-pick__name { color: var(--text); font-weight: 600; }

/* Desmos pane: docked on the left like Bluebook; content moves right; right edge drags */
:root { --calc-w: 460px; --calc-top: 124px; --calc-bottom: 0px; }
.calc-pane { position: fixed; left: 0; top: var(--calc-top); bottom: var(--calc-bottom); width: var(--calc-w); z-index: 30; background: var(--surface); border-right: 1px solid var(--line-strong); box-shadow: 18px 0 50px rgba(2, 11, 41, .12); display: flex; flex-direction: column; }
.calc-pane__head { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--line); }
.calc-pane__head b { font-size: 15px; white-space: nowrap; }
.calc-pane__hint { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-pane .desmos-box { flex: 1; min-height: 0; height: auto; }
.calc-pane__resize { position: absolute; top: 0; bottom: 0; right: -7px; width: 14px; cursor: col-resize; display: grid; place-items: center; z-index: 2; touch-action: none; }
.calc-pane__resize span { width: 6px; height: 56px; border-radius: 3px; background: var(--line-strong); border: 1px solid var(--surface); transition: background .15s, height .15s; }
.calc-pane__resize:hover span, .calc-pane__resize:focus-visible span, .is-resizing .calc-pane__resize span { background: var(--accent); height: 88px; }
.calc-pane__resize:focus-visible { outline: none; }
.is-resizing { cursor: col-resize; user-select: none; }
.is-resizing .desmos-box { pointer-events: none; }
.has-calc .calc-shift { margin-left: calc(var(--calc-w) + 28px) !important; margin-right: 28px !important; width: auto !important; max-width: none !important; min-width: 0; max-height: calc(100vh - var(--calc-top, 124px)); overflow-y: auto; }
.page.bank-page:has(.ort-layout.bb) { --sheet-gap: 24px; max-width: none; width: 100%; margin-inline: 0; padding-inline: var(--sheet-gap); }
.has-calc .page.bank-page.calc-shift:has(.ort-layout.bb) { margin-left: var(--calc-w) !important; margin-right: 0 !important; padding-inline: var(--sheet-gap) !important; }
.bank-page.calc-shift { container-type: inline-size; container-name: calc-page; }
.has-calc .test-foot { z-index: 35; }
[data-calc-open][aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
@media (max-width: 899px) {
  .calc-pane { left: 0; right: 0; top: auto; bottom: 0; width: 100%; height: min(72vh, 560px); border-right: 0; border-top: 1px solid var(--line-strong); border-radius: 18px 18px 0 0; box-shadow: 0 -16px 40px rgba(2, 11, 41, .16); z-index: 45; }
  .calc-pane__resize, .calc-pane__hint { display: none; }
  .has-calc .calc-shift, .has-calc .page.bank-page.calc-shift:has(.ort-layout.bb) { margin-left: auto !important; margin-right: auto !important; max-height: none; overflow-y: visible; }
}
.cb-chip.is-disabled { opacity: .55; cursor: not-allowed; }
.jxg-calc { display: flex; flex-direction: column; gap: 8px; padding: 10px; width: 100%; min-width: 0; height: 100%; min-height: 340px; box-sizing: border-box; }
.jxg-calc > * { flex-shrink: 0; }
.jxg-calc > .jxg-calc__stage { flex-shrink: 1; }
.jxg-calc__notice { padding: 6px 10px; border-radius: 8px; background: var(--warn-soft, #FDF6DD); color: var(--warn, #9A6A00); border: 1px solid var(--line); }
.jxg-calc__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.jxg-calc__title { font-weight: 700; font-size: 14px; }
.jxg-calc__list { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.jxg-calc__row { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.jxg-calc__line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.jxg-calc__swatch { flex: none; width: 10px; height: 28px; border-radius: 999px; }
.jxg-calc__input { flex: 1; min-width: 0; }
.jxg-calc__row.is-bad .jxg-calc__input { border-color: var(--bad); }
.jxg-calc__del { flex: none; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.jxg-calc__del:hover { color: var(--bad); border-color: var(--bad); }
.jxg-calc__katex { min-height: 26px; margin-left: 16px; padding: 3px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); overflow-x: auto; }
.jxg-calc__katex[hidden] { display: none; }
.jxg-calc__err { margin-left: 16px; color: var(--bad, #C93A3A); }
.jxg-calc__add { align-self: flex-start; }
.jxg-calc__add[hidden] { display: none; }
.jxg-calc__keys { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.jxg-calc__key { flex: none; min-width: 36px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: 600 13px/1 var(--font); cursor: pointer; }
.jxg-calc__key:hover { border-color: var(--line-strong); }
.jxg-calc__sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px 10px; min-width: 0; }
.jxg-calc__sliders[hidden], .jxg-calc__slider[hidden] { display: none; }
.jxg-calc__slider { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); min-width: 0; }
.jxg-calc__slider input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); }
.jxg-calc__sname { font-weight: 700; white-space: nowrap; }
.jxg-calc__sval { min-width: 28px; text-align: right; color: var(--muted); }
.jxg-calc__stage { position: relative; flex: 1 1 auto; min-width: 0; display: flex; }
.jxg-calc__tools { position: absolute; top: 8px; right: 8px; z-index: 5; display: flex; align-items: center; gap: 4px; }
.jxg-calc__readout { padding: 4px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--text); }
.jxg-calc__readout[hidden] { display: none; }
.jxg-calc__tool { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 700 14px/1 var(--font); cursor: pointer; }
.jxg-calc__tool--wide { font-size: 12px; }
.jxg-calc__board { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 300px; aspect-ratio: 1 / 1; height: auto; border-radius: 10px; border: 1px solid var(--line); background: #FFFFFF; overflow: hidden; }
[data-theme="dark"] .jxg-calc__board { background: var(--surface-2); }
.jxg-calc__board svg { display: block; width: 100% !important; height: 100% !important; }

/* ---------------------------------------------------------------- question bank */
.bank-exam .select { min-width: 140px; }
.bank-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.bank-stat { gap: 8px; }
.bank-stat__value { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.bank-stat__value small { font-size: 18px; margin-left: 4px; color: var(--muted); }
.bank-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.bank-filter { margin: 0; padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bank-filter legend { float: left; width: 100%; padding: 0; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.bank-filter legend + * { clear: both; }
.bank-filter__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bank-chip { position: relative; }
.bank-chip input { position: absolute; opacity: 0; pointer-events: none; }
.bank-chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 15px; cursor: pointer; transition: border-color .12s, background .12s; }
.bank-chip span:hover { border-color: var(--text); }
.bank-chip input:checked + span { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }
.bank-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.bank-tree { display: flex; flex-direction: column; gap: 14px; }
.bank-topic { position: relative; border: var(--bw, 1px) solid var(--line); border-radius: 20px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--card-shadow); }
.bank-topic.has-picked { border-color: var(--accent); }
.bank-topic summary { list-style: none; display: flex; align-items: center; gap: 16px; padding: 20px 88px 20px 22px; cursor: pointer; border-radius: 20px; }
.bank-topic summary::-webkit-details-marker { display: none; }
.bank-topic summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bank-topic__icon { width: 48px; height: 48px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--accent); }
.bank-topic__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.bank-topic__text b { font-size: 19px; }
.bank-topic__chev { transition: transform .2s; color: var(--muted); }
details[open] > summary .bank-topic__chev { transform: rotate(180deg); }
.bank-play { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; flex: none; padding: 0; }
.bank-play:hover:not(:disabled) { border-color: var(--btn-bg); background: var(--btn-bg); color: var(--btn-text); }
.bank-play:disabled { opacity: .35; cursor: not-allowed; }
.bank-play--topic { position: absolute; right: 22px; top: 22px; width: 46px; height: 46px; }
.bank-topic__body { padding: 0 22px 18px; display: flex; flex-direction: column; gap: 6px; }
.bank-sub { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.bank-row { display: flex; align-items: center; gap: 14px; padding: 8px 10px; border-radius: 12px; }
.bank-row:hover { background: var(--surface-2); }
.bank-row--sub .bank-row__name { font-weight: 800; }
.bank-row--node { padding-left: 46px; }
.bank-row.is-empty { opacity: .5; }
.bank-row__name { flex: 1; min-width: 0; }
.bank-row__count { color: var(--muted); font-weight: 700; min-width: 32px; text-align: right; }
.bank-row .bank-play { width: 36px; height: 36px; border-radius: 10px; }
.bank-check { position: relative; display: inline-grid; }
.bank-check input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.bank-check span { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; pointer-events: none; }
.bank-check input:checked + span { background: var(--btn-bg); border-color: var(--btn-bg); }
.bank-check input:checked + span::after { content: ""; width: 6px; height: 11px; border: solid var(--btn-text); border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.bank-check input:indeterminate + span { border-color: var(--btn-bg); }
.bank-check input:indeterminate + span::after { content: ""; width: 10px; height: 2.5px; background: var(--btn-bg); border-radius: 2px; }
.bank-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.bank-check input:disabled + span { opacity: .4; }
.bank-start { position: sticky; bottom: 16px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px 14px 22px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 94%, transparent); border: var(--bw, 1px) solid var(--line-strong); box-shadow: 0 16px 40px rgba(2, 11, 41, .14); backdrop-filter: blur(10px); }
.bank-start__text { font-weight: 600; }

/* bank player */
.bank-tools { display: grid; grid-template-columns: 1fr auto 1fr; }
.bank-tools > .row:last-child { justify-content: flex-end; }
.bank-timer { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; font-weight: 800; font-size: 17px; background: var(--surface); }
.bank-meta { position: relative; }
.bank-meta__pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 25; width: 400px; background: var(--surface); border: var(--bw, 1px) solid var(--line-strong); border-radius: 16px; padding: 16px 18px; box-shadow: 0 20px 50px rgba(2, 11, 41, .2); }
.bank-meta__pop .kv { grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.bank-meta__pop dt { color: var(--muted); white-space: nowrap; }
.bank-meta__pop dd { margin: 0; font-weight: 600; }
.bank-page .q-screen { gap: 22px; margin-top: 8px; }
.q-card--flat { border: 0; background: transparent !important; padding: 8px 0 0; box-shadow: none; }
.q-card--flat .q-layout--single { max-width: none; }
.q-head__btn--static { cursor: default; }
.q-head__btn--static:hover { background: transparent; }
.q-head__badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--btn-bg); color: var(--btn-text); font-size: 12px; display: inline-grid; place-items: center; }
.bank-foot__mid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bank-foot__progress { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.q-grid a { height: 40px; border-radius: 10px; border: 1.5px dashed var(--line-strong); background: var(--surface); font: 700 14px var(--font); color: var(--text); display: grid; place-items: center; text-decoration: none; position: relative; }
.q-grid a.is-ok { background: var(--ok-soft); border: 1.5px solid var(--ok); }
.q-grid a.is-bad { background: var(--bad-soft); border: 1.5px solid var(--bad); }
.q-grid a.is-current { outline: 2px solid var(--accent); outline-offset: 2px; }
.q-grid a.is-marked::after { content: ""; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--mark); border: 2px solid var(--surface); }
.q-grid-pop .q-grid { max-height: 320px; overflow-y: auto; padding: 4px; }
.lg.is-ok { background: var(--ok-soft); border: 1.5px solid var(--ok); }
.lg.is-bad { background: var(--bad-soft); border: 1.5px solid var(--bad); }
.q-head__btn[data-bank-mark][aria-pressed="true"], .q-head__btn[data-mark][aria-pressed="true"] { color: #C98A00; }
.q-head__btn[data-bank-mark][aria-pressed="true"] svg, .q-head__btn[data-mark][aria-pressed="true"] svg { fill: var(--mark); stroke: var(--mark-line); }
@media (max-width: 1000px) {
  .bank-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .bank-stats, .bank-filters { grid-template-columns: minmax(0, 1fr); }
  .bank-tools { grid-template-columns: 1fr; justify-items: start; }
  .bank-row--node { padding-left: 18px; }
  .bank-foot__progress { display: none; }
}
[data-theme="dark"] .option input:checked + .option__box:not(.is-correct):not(.is-wrong) { background: rgba(36, 86, 217, .2); }

/* ---------------------------------------------------------------- admin */
.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.admin-stat { flex-direction: row; align-items: center; gap: 16px; text-decoration: none; color: inherit; transition: transform .15s, border-color .15s; border-radius: 22px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); }
.admin-stat:hover { transform: translateY(-2px); border-color: var(--line-strong); text-decoration: none; }
.admin-stat__ic { width: 48px; height: 48px; border-radius: 14px; background: #0A0A0A; color: #FFFFFF; display: grid; place-items: center; flex: none; }
[data-theme="dark"] .admin-stat__ic { background: #FFFFFF; color: #0A0A0A; }
.admin-stat > span:last-child { display: flex; flex-direction: column; }
.admin-stat b { font: 800 30px/1.1 var(--font-display); letter-spacing: -.02em; }
.admin-stat > span:last-child > span { font-size: 13px; color: var(--muted); }
.admin-stat.is-hot .admin-stat__ic { background: var(--warn-soft); color: var(--warn); }
.admin-tabs { display: flex; gap: 4px; padding: 4px; border: var(--bw, 1px) solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--surface) 88%, transparent); overflow-x: auto; backdrop-filter: blur(8px); }
.admin-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.admin-tabs a:hover { background: var(--surface-2); color: var(--text); }
.admin-tabs a.is-active { background: var(--btn-bg); color: var(--btn-text); }
.admin-tabs__n { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--surface-2); color: var(--text-2); font-size: 12px; display: inline-grid; place-items: center; }
.admin-tabs a.is-active .admin-tabs__n { background: rgba(255, 255, 255, .78); color: var(--text); }
.admin-tabs__n.is-hot { background: #E8A400; color: #1A1200; }
.admin-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.admin-kpis small { font-size: 16px; font-weight: 700; }
.admin-two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.bars { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 4px; height: 160px; align-items: end; padding-top: 8px; }
.bars__col { height: 100%; display: flex; align-items: flex-end; }
.bars__col i { display: block; width: 100%; height: max(var(--h), 3px); border-radius: 4px 4px 2px 2px; background: var(--btn-bg); opacity: .9; }
.bars__col:hover i { background: var(--accent); }
.thin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 340px; overflow-y: auto; }
.thin-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.thin-list__dots { display: inline-flex; gap: 3px; flex: none; }
.thin-list__dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.thin-list__dots i.is-on { background: var(--btn-bg); }
.thin-list__name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
.app-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.app-card { gap: 14px; }
.app-card__name { font-size: 18px; }
.mod-card { flex-direction: row; justify-content: space-between; gap: 24px; align-items: flex-start; }
.mod-card__body { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }
.mod-card__text { font-weight: 600; font-size: 17px; }
.mod-card__img { max-width: 260px; background: #FFFFFF; border-radius: 10px; cursor: zoom-in; }
.mod-card__opts { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.mod-card__opts > span { padding: 6px 12px; border-radius: 10px; border: var(--bw, 1px) solid var(--line-strong); }
.mod-card__opts > span.is-right { border-color: var(--ok); background: var(--ok-soft); }
.people-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border: var(--bw, 1px) solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); }
.people-bar .search { flex: 1 1 240px; }
.people-bar .select { width: auto; min-height: 44px; }
.people-bar__count { margin-left: auto; }
.people { border: var(--bw, 1px) solid var(--line); border-radius: 20px; background: color-mix(in srgb, var(--surface) 92%, transparent); }
.people__row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) 130px 110px 40px; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.people__row:last-child { border-bottom: 0; }
.people__row:hover { background: var(--surface-2); }
.people__row:first-child { border-radius: 20px 20px 0 0; }
.people__row:last-child { border-radius: 0 0 20px 20px; }
.people__row.is-blocked .people__who { opacity: .55; }
.people__who { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; }
.people__who:hover { text-decoration: none; }
.people__who:hover b { color: var(--accent); }
.people__name { display: flex; flex-direction: column; min-width: 0; }
.people__name b, .people__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people__info { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.people__info .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; font-size: 18px; font-weight: 800; line-height: 1; }
.menu summary::-webkit-details-marker { display: none; }
.menu__pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; padding: 6px; background: var(--surface); border: var(--bw, 1px) solid var(--line-strong); border-radius: 14px; box-shadow: 0 20px 50px rgba(2, 11, 41, .2); display: flex; flex-direction: column; }
.menu__pop a, .menu__pop button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; font: 600 14px var(--font); color: var(--text); cursor: pointer; text-decoration: none; }
.menu__pop a:hover, .menu__pop button:hover { background: var(--surface-2); text-decoration: none; }
.menu__pop .is-danger { color: var(--bad); }
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; }
.pager__n { min-width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; text-decoration: none; color: var(--text); border: var(--bw, 1px) solid var(--line); }
.pager__n.is-current { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }
.drawer--panel { width: min(460px, 100vw); }
.drawer-layer { position: fixed; inset: 0; z-index: 70; display: flex; justify-content: flex-end; pointer-events: none; }
.drawer-layer[hidden] { display: none !important; }
.drawer-layer__backdrop { position: absolute; inset: 0; background: rgba(2, 11, 41, .28); backdrop-filter: blur(2px); opacity: 0; transition: opacity .18s ease; pointer-events: auto; }
.drawer-layer .drawer { position: relative; height: 100%; height: 100dvh; pointer-events: auto; transform: translateX(28px); opacity: 0; transition: transform .18s ease, opacity .18s ease; }
.drawer-layer.is-open .drawer-layer__backdrop { opacity: 1; }
.drawer-layer.is-open .drawer { transform: translateX(0); opacity: 1; }
.drawer__titlewrap { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.drawer__sub { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer__head-right { display: flex; align-items: center; gap: 6px; flex: none; flex-wrap: wrap; }
.drawer__actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.drawer__actions[hidden] { display: none; }
.drawer__foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: sticky; bottom: 0; z-index: 2; }
.drawer__foot[hidden] { display: none; }
.drawer__loading { display: grid; place-items: center; padding: 48px 16px; }
@media (prefers-reduced-motion: reduce) {
  .drawer-layer__backdrop, .drawer-layer .drawer { transition: none; }
}

/* Shared Searchable Combobox (.cbx) */
.cbx { position: relative; min-width: 190px; }
.cbx__control { position: relative; display: flex; align-items: center; }
.cbx__input { padding-right: 54px; min-height: 38px; font-size: 13.5px; border-radius: 10px; }
.mgr-filter-row .cbx__input { height: 38px; min-height: 38px; }
.cbx__clear, .cbx__toggle {
  position: absolute; top: 50%; transform: translateY(-50%); border: 0; background: transparent;
  color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; line-height: 1;
}
.cbx__clear { right: 26px; width: 22px; height: 22px; font-size: 17px; border-radius: 50%; }
.cbx__clear:hover, .cbx__clear:focus-visible { background: var(--surface-2); color: var(--text); outline: none; }
.cbx__toggle { right: 6px; width: 22px; height: 22px; }
.cbx__list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 80;
  max-height: 270px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: 0 14px 36px rgba(2, 11, 41, .16); display: flex; flex-direction: column; gap: 2px;
}
.cbx__list[hidden] { display: none !important; }
.cbx__group { padding: 6px 8px 3px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.cbx__sep { height: 1px; background: var(--line); margin: 4px 6px; }
.cbx__opt {
  padding: 8px 10px; border-radius: 9px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px;
}
.cbx__opt:hover, .cbx__opt.is-highlighted { background: var(--surface-2); }
.cbx__opt.is-selected { background: var(--accent-soft); color: var(--accent-ink, var(--accent)); font-weight: 700; }
.cbx__opt--special { font-weight: 600; }
.cbx__opt-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbx__opt-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; flex: none; }
.cbx__empty { padding: 10px 12px; font-size: 13px; color: var(--muted); text-align: center; }

/* Active filter chips bar & quick toggle */
.mgr-active-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mgr-active-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text); text-decoration: none;
}
.mgr-active-chip:hover { border-color: var(--bad, #e5484d); color: var(--bad, #e5484d); text-decoration: none; }
.mgr-check-pill {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none;
}
.mgr-check-pill input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }
@media (max-width: 640px) {
  .cbx { width: 100%; }
  .cbx__input { font-size: 16px !important; }
}
.person { display: flex; flex-direction: column; gap: 20px; }
.person__head { display: flex; gap: 16px; align-items: center; }
.person__name { font-size: 20px; }
.person .kv, .adm-subcard .kv { grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.person .kv dt, .adm-subcard .kv dt { color: var(--muted); }
.person .kv dd, .adm-subcard .kv dd { margin: 0; font-weight: 600; }
.person__nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.person__nums > div { border: var(--bw, 1px) solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); }
.person__nums b { font-size: 20px; }
.person__list { list-style: none; margin: 0; padding: 0; }
.person__list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }

/* Admin drawer structured rounded sub-cards & skeleton */
.adm-drawer-stack { display: flex; flex-direction: column; gap: 12px; }
.adm-subcard { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.adm-subcard--head { background: var(--surface); }
.adm-subcard--danger { border-color: color-mix(in srgb, var(--bad) 32%, var(--line)); background: color-mix(in srgb, var(--bad-soft) 35%, var(--surface)); }
.adm-subcard__title { margin: 0; font-size: 11px; letter-spacing: .06em; }
.adm-subcard__section { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.adm-subcard__meta { padding-top: 8px; border-top: 1px solid var(--line); }
.adm-email-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.adm-email-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-copy-btn { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); border-radius: 8px; padding: 2px 8px; font-size: 11.5px; font-weight: 600; cursor: pointer; line-height: 1.5; }
.adm-copy-btn:hover { background: var(--surface-2); color: var(--text); }
.adm-role-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.adm-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.adm-subrow { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.adm-helper { margin: 6px 0 0; }
.drawer-skel { display: flex; flex-direction: column; gap: 12px; }
.drawer-skel__card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.drawer-skel__head { display: flex; align-items: center; gap: 12px; }
.drawer-skel__avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--line); flex: none; animation: admSkelPulse 1.3s ease-in-out infinite; }
.drawer-skel__lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.drawer-skel__line { display: block; height: 12px; border-radius: 6px; background: var(--line); animation: admSkelPulse 1.3s ease-in-out infinite; }
.drawer-skel__line--lg { width: 65%; height: 15px; }
.drawer-skel__line--sm { width: 42%; height: 10px; }
.drawer-skel__line--btn { width: 100%; height: 34px; border-radius: 10px; }
@keyframes admSkelPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .drawer-skel__avatar, .drawer-skel__line { animation: none; }
}
.btn--danger-line { border: 1.5px solid var(--bad); color: var(--bad); background: transparent; }
.btn--danger-line:hover { background: var(--bad-soft); }
@media (max-width: 1000px) {
  .admin-stats, .admin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-two { grid-template-columns: minmax(0, 1fr); }
  .people__row { grid-template-columns: minmax(0, 1fr) auto 40px; }
  .people__info, .people__state { display: none; }
}
@media (max-width: 600px) {
  .people__seen { display: none; }
  .people__row { grid-template-columns: minmax(0, 1fr) 40px; }
  .mod-card { flex-direction: column; }
}
.thin-list__ex { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 45%; }

/* ---------------------------------------------------------------- teacher: today */
.t-hero-stats { display: flex; gap: 26px; margin-top: 12px; flex-wrap: wrap; }
.t-hero-stats a { display: flex; flex-direction: column; color: #FFFFFF; text-decoration: none; }
.t-hero-stats b { font-size: 28px; line-height: 1.1; }
.t-hero-stats span { font-size: 13px; color: var(--hero-muted); }
.t-hero-stats a:hover span { color: #FFFFFF; }
.t-lessons-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.t-lesson-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35); color: #FFFFFF; font-size: 13px; font-weight: 600; }
.t-lesson-chip.is-past { opacity: .5; }
.t-lesson-chip.is-next { background: #FFFFFF; color: var(--accent-strong, #153893); border-color: #FFFFFF; }
.t-list { display: flex; flex-direction: column; }
.t-list__row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.t-list__row--link:hover { text-decoration: none; background: var(--surface-2); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 12px; }
.t-list__grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.t-list__grow b, .t-list__grow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-list__time { width: 50px; flex: none; }
.t-list__who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.t-list__who > span { display: flex; flex-direction: column; min-width: 0; }
.t-list__who:hover b { color: var(--accent); }
.att { display: flex; gap: 4px; flex: none; }
.att__btn { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px; border-radius: 10px; border: var(--bw, 1px) solid var(--line-strong); background: var(--surface); color: var(--text-2); font: 700 12px var(--font); cursor: pointer; }
.att__btn:hover { border-color: var(--text); color: var(--text); }
.att__btn--present[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #FFFFFF; }
.att__btn--late[aria-pressed="true"] { background: #E8A400; border-color: #E8A400; color: #1A1200; }
.att__btn--absent[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); color: #FFFFFF; }
.t-score { font-weight: 800; font-size: 14px; padding: 2px 10px; border-radius: 999px; }
.t-score--green { background: var(--ok-soft); color: var(--ok); }
.t-score--yellow { background: var(--warn-soft); color: var(--warn); }
.t-score--red { background: var(--bad-soft); color: var(--bad); }
.t-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.t-week__day { border: var(--bw, 1px) solid var(--line); border-radius: 16px; padding: 10px; min-height: 150px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); transition: border-color .15s, background .15s; }
.t-week__day.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.t-week__day.is-over { background: var(--accent-soft); border-style: dashed; border-color: var(--accent); }
.t-week__head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.t-week__head b { font-size: 18px; color: var(--text); letter-spacing: 0; }
.t-week__items { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.t-hw { display: grid; grid-template-columns: 8px minmax(0, 1fr); column-gap: 7px; align-items: center; padding: 7px 9px; border-radius: 10px; background: var(--surface-2); border: var(--bw, 1px) solid var(--line); color: inherit; text-decoration: none; font-size: 12px; cursor: grab; }
.t-hw:hover { text-decoration: none; border-color: var(--line-strong); }
.t-hw b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-hw__work { grid-column: 2; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-hw.is-dragging { opacity: .4; }
.t-hw.is-moved { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok-soft); }
.t-hw__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.t-hw--new .t-hw__dot, .t-hw__dot.t-hw--new { background: var(--line-strong); }
.t-hw--in_progress .t-hw__dot, .t-hw__dot.t-hw--in_progress { background: var(--accent); }
.t-hw--submitted .t-hw__dot, .t-hw__dot.t-hw--submitted { background: #E8A400; }
.t-hw--checked .t-hw__dot, .t-hw__dot.t-hw--checked { background: var(--ok); }
.t-hw--overdue .t-hw__dot, .t-hw__dot.t-hw--overdue { background: var(--bad); }
.t-hw--overdue { border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.t-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.t-legend span { display: inline-flex; align-items: center; gap: 6px; }
.t-dots-wrap { overflow-x: auto; }
.t-dots { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.t-dots th, .t-dots td { padding: 6px 8px; text-align: center; }
.t-dots thead th { vertical-align: bottom; height: 120px; }
.t-dots__topic { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; font-weight: 700; color: var(--text-2); max-height: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-dots tbody th { text-align: left; white-space: nowrap; font-size: 14px; font-weight: 600; padding-right: 18px; position: sticky; left: 0; background: var(--surface); }
.t-dots tbody th a { color: inherit; text-decoration: none; }
.t-dots tbody th a:hover { color: var(--accent); }
.t-dots tbody tr:hover td, .t-dots tbody tr:hover th { background: var(--surface-2); }
.t-dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; }
.t-dot--green { background: var(--ok); }
.t-dot--yellow { background: #E8A400; }
.t-dot--red { background: var(--bad); }
.t-dot--none { background: transparent; border: 2px solid var(--line-strong); width: 12px; height: 12px; }
.t-dot--off { background: transparent; border: 2px dashed var(--line); width: 12px; height: 12px; }
.t-mon { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.t-mon__avg { display: flex; flex-direction: column; }
.t-mon__avg b { font-size: 44px; line-height: 1; letter-spacing: -.02em; }
.t-up { color: var(--ok); font-weight: 800; }
.t-down { color: var(--bad); font-weight: 800; }
.t-mon__rows { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.t-mon__rows li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); counter-increment: r; }
.t-mon__rows li::before { content: counter(r); width: 22px; font-weight: 800; color: var(--muted); }
.t-hard { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: var(--bw, 1px) solid var(--line); border-radius: 12px; font-size: 14px; }
.t-hard__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-behind__bar { display: flex; align-items: center; gap: 8px; width: 160px; flex: none; }
@media (max-width: 1000px) {
  .t-week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .t-week { grid-template-columns: minmax(0, 1fr); }
  .t-week__day { min-height: 0; }
  .att__btn span { display: none; }
  .t-behind__bar { display: none; }
}

/* ---------------------------------------------------------------- teacher: question bank */
.tbank-filters { display: flex; flex-direction: column; gap: 14px; }
.tbank-filters__top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tbank { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.tbank-tree { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 14px; gap: 2px; }
.tbank-tree a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14px; }
.tbank-tree a:hover { background: var(--surface-2); text-decoration: none; }
.tbank-tree a.is-active { background: var(--btn-bg); color: var(--btn-text); }
.tbank-tree a .num { color: var(--muted); font-size: 12px; font-weight: 700; }
.tbank-tree a.is-active .num { color: inherit; opacity: .8; }
.tbank-tree__all { font-weight: 800; }
.tbank-tree details summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.tbank-tree details summary::-webkit-details-marker { display: none; }
.tbank-tree details summary::before { content: "›"; width: 14px; color: var(--muted); font-weight: 800; transition: transform .15s; display: inline-block; }
.tbank-tree details[open] summary::before { transform: rotate(90deg); }
.tbank-tree summary a { flex: 1; font-weight: 700; }
.tbank-tree summary > .num { display: none; }
.tbank-tree__sub { margin-left: 14px; font-weight: 600; }
.tbank-tree__node { margin-left: 28px; color: var(--text-2) !important; }
.tbank-tree__node.is-active { color: var(--btn-text) !important; }
.tbank-list { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tbank-q { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; padding: 18px 20px; border: var(--bw, 1px) solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--surface) 92%, transparent); transition: border-color .12s; }
.tbank-q.is-picked { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tbank-q__check { margin-top: 2px; }
.tbank-q__body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tbank-q__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tbank-q__preview .q-layout { gap: 16px; }
.tbank-q__preview .q-layout--single { max-width: none; }
.tbank-q__preview .q-text { font-size: 16px; }
.tbank-q__preview .options { gap: 6px; }
.tbank-q__preview .option__box { min-height: 42px; font-size: 15px; padding: 6px 14px; gap: 12px; }
.tbank-q__preview .option__letter { width: 24px; height: 24px; font-size: 12px; }
.tbank-q__preview .q-figure img { max-height: 220px; }
.tbank-bar .select { min-height: 44px; }
@media (max-width: 1000px) {
  .tbank { grid-template-columns: minmax(0, 1fr); }
  .tbank-tree { position: static; max-height: 320px; }
}
.t-behind__bar .bar { flex: 1; }
.t-dots { min-width: 0; width: auto; }
.t-dots tbody th { min-width: 180px; }
.t-dots th:not(:first-child), .t-dots td { width: 44px; }
.tbank-q__preview .options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------------------------------------------------------------- teacher: student card */
.sd-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sd-num { gap: 10px; }
.sd-num__v { font-size: 42px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.sd-num__v small { font-size: 18px; color: var(--muted); margin-left: 2px; }
.sd-att { display: flex; gap: 5px; flex-wrap: wrap; min-height: 14px; }
.sd-att__m { width: 14px; height: 14px; border-radius: 50%; }
.sd-att__m--present { background: var(--ok); }
.sd-att__m--late { background: #E8A400; }
.sd-att__m--absent { background: var(--bad); }
.sd-num .att { flex-wrap: wrap; }
.sd-trend { width: 100%; height: auto; }
.sd-trend__band--g { fill: var(--ok-soft); }
.sd-trend__band--y { fill: var(--warn-soft); opacity: .6; }
.sd-trend__band--r { fill: var(--bad-soft); opacity: .45; }
.sd-trend__line { fill: none; stroke: var(--btn-bg); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.sd-trend__dot { fill: var(--surface); stroke: var(--btn-bg); stroke-width: 3; }
@media (max-width: 1000px) { .sd-top { grid-template-columns: minmax(0, 1fr); } }
.sd-num .att > span.small { width: 100%; margin: 0 0 2px; }

/* content map: "new topic" sits on top */
.tree-new-topic { flex-direction: row; align-items: center; gap: 24px; flex-wrap: wrap; border: 1.5px dashed var(--accent); }
.tree-new-topic__text { flex: 1 1 300px; display: flex; flex-direction: column; gap: 4px; }
.tree-new-topic__text h2 { font-size: 20px; display: flex; align-items: center; gap: 8px; color: var(--accent); }
.tree-new-topic form { flex: 1 1 420px; }
.tree-jump a { text-decoration: none; }
.tree-topic { scroll-margin-top: 24px; }
.mod-card__qs { margin: 10px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; max-height: 360px; overflow-y: auto; }

/* ---------------------------------------------------------------- questions of the day */
.daily-t__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.daily-t__col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.daily-t__q { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: var(--bw, 1px) solid var(--line); border-radius: 14px; background: var(--surface); }
.daily-t__n { width: 28px; height: 28px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-text); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.daily-t__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.daily-t__text { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-t__stat { display: flex; align-items: center; gap: 8px; flex: none; font-size: 13px; }
.daily-t__slot { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1.5px dashed var(--line-strong); border-radius: 14px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.daily-t__slot:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
@media (max-width: 760px) { .daily-t__cols { grid-template-columns: minmax(0, 1fr); } }
.daily { gap: 18px; }
.daily__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.daily__title { font-size: 20px; }
.daily__streak { font-size: 13px; color: var(--text-2); padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); }
.daily__streak b { color: var(--accent-ink); }
.daily__tabs { display: flex; gap: 6px; }
.daily__tab { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); font: 800 14px var(--font); color: var(--text); cursor: pointer; }
.daily__tab[aria-selected="true"] { border-color: var(--btn-bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.daily__tab.is-ok { background: var(--ok); border-color: var(--ok); color: #FFFFFF; }
.daily__tab.is-bad { background: var(--bad); border-color: var(--bad); color: #FFFFFF; }
.daily__panel { display: flex; flex-direction: column; gap: 16px; }
.daily__panel .q-layout--single { max-width: none; }
.daily__foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.daily__foot .feedback { font-size: 16px; }

/* leave-test dialog */
.exit-dialog { border: var(--bw, 1px) solid var(--line-strong); border-radius: 22px; padding: 26px 28px; max-width: 480px; width: calc(100vw - 32px); background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(2, 11, 41, .3); }
.exit-dialog::backdrop { background: rgba(2, 11, 41, .45); backdrop-filter: blur(3px); }
.exit-dialog h2 { font-size: 20px; margin-bottom: 8px; }
.exit-dialog p { color: var(--text-2); font-size: 15px; line-height: 1.5; }
.exit-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.exit-dialog h2:last-child, .exit-dialog h2 + .exit-dialog__actions { margin-bottom: 0; }
.btn--danger-solid { background: var(--bad); color: #FFFFFF; border-color: var(--bad); }

/* ---------------------------------------------------------------- question picker */
.page:has(.pk-layout), .page:has(.pk-page) { max-width: 1480px; }
.pk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.pk-field { min-width: 0; }
.pk-order { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; border-radius: 22px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); }
.pk-filter-box { display: flex; flex-direction: column; gap: 12px; border-radius: 22px; padding: 14px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); }
.pk { display: flex; flex-direction: column; gap: 14px; }
.pk-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pk-bar__search { flex: 1 1 240px; }
.pk-bar .select { min-height: 44px; }
.pk-chips { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 14px; border: var(--bw, 1px) solid var(--line); border-radius: 14px; background: var(--surface-2); }
.pk-chips__group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pk-chips__label { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.bank-chip--sm span { min-height: 30px; padding: 0 11px; font-size: 13px; }
.pk-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.pk-tree { position: static; max-height: none; overflow: visible; border: var(--bw, 1px) solid var(--line); border-radius: 20px; padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.pk-tree__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pk-tree__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; align-items: stretch; }
.pk-tree__item { display: flex; justify-content: space-between; gap: 6px; width: 100%; text-align: left; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; font: 600 13px var(--font); color: var(--text); cursor: pointer; }
.pk-tree__item:hover { background: var(--surface-2); }
.pk-tree__item.is-active { background: var(--btn-bg); color: var(--btn-text); }
.pk-tree__item .num { color: var(--muted); font-size: 11px; font-weight: 700; }
.pk-tree__item.is-active .num { color: inherit; opacity: .8; }
.pk-tree__all { font-weight: 800; }
.pk-tree__topic summary { list-style: none; display: flex; align-items: center; }
.pk-tree__topic summary::-webkit-details-marker { display: none; }
.pk-tree__caret { width: 14px; flex: none; color: var(--muted); font-weight: 800; transition: transform .15s; cursor: pointer; text-align: center; }
.pk-tree__topic[open] .pk-tree__caret { transform: rotate(90deg); }
.pk-tree__t { font-weight: 800; }
.pk-tree__s { padding-left: 22px; }
.pk-tree__n { padding-left: 34px; font-weight: 500; color: var(--text-2); }
.pk-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pk-quick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pk-plan { position: relative; }
.pk-plan summary { list-style: none; }
.pk-plan summary::-webkit-details-marker { display: none; }
.pk-plan__pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 15; width: 380px; padding: 14px; border: var(--bw, 1px) solid var(--line-strong); border-radius: 14px; background: var(--surface); box-shadow: 0 20px 50px rgba(2, 11, 41, .2); display: flex; flex-direction: column; gap: 10px; }
.pk-list { display: flex; flex-direction: column; border: var(--bw, 1px) solid var(--line); border-radius: 22px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); transition: opacity .15s; }
.pk-list.is-loading { opacity: .5; }
.pk-list__head { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.pk-list .pager { padding: 12px; }
.pk-list .empty { margin: 12px; }
.pk-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.pk-row:last-of-type { border-bottom: 0; }
.pk-row.is-picked { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.pk-row__check { margin-top: 2px; }
.pk-row__main { display: flex; flex-direction: column; gap: 4px; min-width: 0; text-align: left; border: 0; background: transparent; padding: 0; cursor: pointer; color: inherit; font: inherit; }
.pk-row__text { font-weight: 600; font-size: 15px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pk-row__main[aria-expanded="true"] .pk-row__text { -webkit-line-clamp: unset; }
.pk-row__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pk-row__stats { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.pk-row__preview { grid-column: 2 / 4; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.pk-preview { display: flex; flex-direction: column; gap: 10px; }
.pk-preview .q-layout--single { max-width: none; }
.pk-preview .q-text { font-size: 16px; }
.pk-preview .options { gap: 6px; }
.pk-preview .option__box { min-height: 40px; font-size: 15px; padding: 6px 12px; }
.pk-preview .option__letter { width: 24px; height: 24px; font-size: 12px; }
.pk-diff { display: inline-flex; gap: 2px; align-items: flex-end; vertical-align: middle; }
.pk-diff i { width: 4px; border-radius: 1px; background: var(--line-strong); }
.pk-diff i:nth-child(1) { height: 6px; } .pk-diff i:nth-child(2) { height: 9px; } .pk-diff i:nth-child(3) { height: 12px; }
.pk-diff--1 i:nth-child(1), .pk-diff--2 i:nth-child(-n+2), .pk-diff--3 i { background: var(--btn-bg); }
.order-totals { display: flex; flex-direction: column; gap: 6px; }
.order-totals:empty { display: none; }
.order-totals__line { font-size: 14px; }
.order-totals__diff { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.order-list li { cursor: grab; }
.order-list li.is-dragging { opacity: .4; }
.order-list__grip { color: var(--muted); font-size: 12px; letter-spacing: -2px; flex: none; }
.order-list__text { flex: 1; min-width: 0; }
@media (max-width: 1200px) {
  .pk-layout { grid-template-columns: minmax(0, 1fr); }
  .pk-order { position: static; max-height: none; }
}
@media (max-width: 800px) {
  .pk-body { grid-template-columns: minmax(0, 1fr); }
  .pk-tree { position: static; max-height: none; }
}
.order-list li { grid-template-columns: 24px 12px minmax(0, 1fr) auto; }
.pk-order .order-list li { padding: 8px 10px; gap: 8px; }
.pk-order .order-list .tools button[data-move] { display: none; }
.pk-order .order-list li:hover .tools button[data-move], .pk-order .order-list li:focus-within .tools button[data-move] { display: inline-grid; place-items: center; }
.pk-order .order-list .tools button { width: 26px; height: 26px; }
.pk-order .order-list__text { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------------------------------------------------------------- import + review */
.imp-paste__area { min-height: 320px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 14px; line-height: 1.5; }
.imp-help__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.imp-help ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.imp-help__code { margin: 6px 0 0; padding: 12px; border-radius: 12px; background: var(--surface); border: var(--bw, 1px) solid var(--line); font-size: 12px; overflow-x: auto; }
.imp { display: flex; flex-direction: column; gap: 14px; }
.imp-summary { flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; position: sticky; top: 12px; z-index: 5; }
.imp-q { gap: 12px; border-left: 4px solid transparent; }
.imp-q.has-problem { border-left-color: var(--bad); }
.imp-q.is-off { opacity: .55; }
.imp-q__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.imp-q__n { font-size: 17px; }
.imp-q__flags { display: flex; gap: 6px; flex-wrap: wrap; }
.imp-q__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.imp-q__edit { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.imp-q__type { align-self: flex-start; }
.imp-q__type label { position: relative; }
.imp-q__type input { position: absolute; opacity: 0; }
.imp-q__type span { display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--text-2); cursor: pointer; }
.imp-q__type input:checked + span { background: var(--nav-active-bg); color: var(--nav-active-text); }
.imp-q__opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.imp-opt { display: flex; align-items: center; gap: 8px; }
.imp-opt input[type=radio] { width: 18px; height: 18px; accent-color: var(--ok); flex: none; }
.imp-opt__l { font-weight: 800; width: 16px; }
.imp-opt .input { min-height: 40px; }
.imp-q__preview { position: sticky; top: 80px; padding: 16px; border-radius: 16px; background: var(--surface-2); border: var(--bw, 1px) solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.imp-q__preview .q-text { font-size: 17px; }
.imp-pv-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.imp-pv-opts li { padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--surface); display: flex; gap: 10px; }
.imp-pv-opts li.is-right { border-color: var(--ok); background: var(--ok-soft); }
.rv-card { gap: 12px; outline: none; }
.rv-card:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.rv-card__meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rv-card__body .q-layout--single { max-width: none; }
.rv-card__body .options { gap: 6px; }
.rv-card__body .option__box { min-height: 44px; font-size: 16px; }
.rv-card__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rv-card__note { flex: 1 1 220px; min-height: 36px; }
kbd { font: 700 10px var(--font); padding: 1px 5px; border-radius: 4px; border: 1px solid currentColor; opacity: .6; margin-left: 2px; }
.mine-row { grid-template-columns: minmax(0, 1fr) auto auto !important; }
.mine-row__main { display: flex; flex-direction: column; gap: 3px; color: inherit; text-decoration: none; min-width: 0; }
.mine-row__text { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-row__note { color: var(--warn); display: flex; gap: 6px; align-items: center; }
@media (max-width: 900px) { .imp-q__grid, .imp-help__grid { grid-template-columns: minmax(0, 1fr); } .imp-q__preview { position: static; } }
/* picker tree: exam views, checkboxes at any level */
.pk-tree__topic { display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; background: var(--surface-2); }
.pk-tree__topic.is-open { grid-column: 1 / -1; background: var(--surface); border-color: var(--line-strong); padding: 12px 14px; }
.pk-tree__head { display: flex; align-items: center; gap: 4px; }
.pk-tree__caret { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 20px; line-height: 1; font-weight: 800; cursor: pointer; transition: transform .15s, background .15s; flex: none; padding: 0; display: inline-grid; place-items: center; }
.pk-tree__caret:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.pk-tree__topic.is-open .pk-tree__caret { transform: rotate(90deg); }
.pk-tree__kids { display: none; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 18px; align-items: start; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.pk-tree__topic.is-open .pk-tree__kids { display: grid; }
.pk-tree__group { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pk-tree__row { display: flex; align-items: flex-start; gap: 9px; width: 100%; padding: 6px 8px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); }
.pk-tree__row:hover { background: var(--surface-2); }
.pk-tree__row input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--btn-bg); flex: none; cursor: pointer; }
.pk-tree__row:has(input:checked) { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pk-tree__name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pk-tree__name small { font-size: 11px; font-weight: 500; color: var(--muted); }
.pk-tree__row .num { color: var(--muted); font-size: 11px; font-weight: 700; }
.pk-tree__row.is-zero { color: var(--muted); font-weight: 500; }
.pk-tree__row.is-zero .num { opacity: .6; }
.pk-tree__t { font-weight: 800; padding-left: 2px; }
.pk-tree__s { padding-left: 6px; font-weight: 700; }
.pk-tree__n { padding-left: 22px; font-weight: 500; }
.bank-row--flat { padding-left: 10px; }
.bank-row__name { display: flex; flex-direction: column; }
.bank-row__en { font-size: 12px; font-weight: 500; }

/* questions of the day: slim card on home, own screen */
.daily-card { flex-direction: row; align-items: center; gap: 18px; padding: 16px 20px; text-decoration: none; color: inherit; border-left: 4px solid var(--accent); transition: transform .15s, box-shadow .15s; }
.daily-card:hover { text-decoration: none; transform: translateY(-1px); }
.daily-card.is-done { border-left-color: var(--ok); }
.daily-card__icon { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.daily-card.is-done .daily-card__icon { background: var(--ok-soft); color: var(--ok); }
.daily-card__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.daily-card__title { font-size: 17px; }
.daily-card__dots { display: flex; gap: 6px; }
.daily-card__dots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); }
.daily-card__dots i.is-ok { background: var(--ok); border-color: var(--ok); }
.daily-card__dots i.is-bad { background: var(--bad); border-color: var(--bad); }
.daily-card__streak { padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); white-space: nowrap; }
.daily-card__go { flex: none; pointer-events: none; }
.daily-page { max-width: 900px; margin: 0 auto; padding-bottom: 80px; }
.daily-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.daily__tab--end { display: inline-grid; place-items: center; }
.daily-end { align-items: center; text-align: center; gap: 12px; padding: 40px 28px; }
.daily-end__icon { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
@media (max-width: 700px) {
  .daily-card { flex-wrap: wrap; }
  .daily-card__streak, .daily-card__dots { display: none; }
  .daily-card__go { width: 100%; justify-content: center; }
}
/* teacher picker: the same filter cards as the student bank */
.pk-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pk-layout .pk-filters .bank-filter { padding: 16px 16px 18px; gap: 12px; }
@media (max-width: 1350px) { .pk-field .pk-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .pk-filters { grid-template-columns: minmax(0, 1fr); } }
.pk-filters .pk-filter--tag { grid-column: 1 / -1; }
.pk-filters .pk-filter--used { grid-column: span 2; }
@media (max-width: 1350px) { .pk-field .pk-filters .pk-filter--used { grid-column: auto; } }
@media (max-width: 700px) { .pk-filters .pk-filter--used { grid-column: auto; } }
.pk-order { top: 88px; max-height: calc(100vh - 104px); }
.pk-layout--bank { grid-template-columns: minmax(0, 1fr); }
.pk-basket-wrap { position: relative; }
.pk-basket-wrap .pk-basket-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 45; width: min(380px, calc(100vw - 32px)); max-height: min(74vh, 560px); overflow-y: auto; box-shadow: 0 20px 60px rgba(2, 11, 41, .22); border: 1px solid var(--line-strong); }
.pk-basket-pop .card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
@media (max-width: 900px) { .pk-basket-wrap .pk-basket-pop { left: 0; right: auto; } }

/* picker: 1-by-1 student review split card */
.pk-review-card { display: flex; flex-direction: column; align-items: stretch; gap: 18px; width: 100%; padding: 20px 24px; border-bottom: 0; background: var(--surface); }
.pk-review-card.is-picked { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.pk-review-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; width: 100%; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pk-review-head__meta, .pk-review-head__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pk-pick-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); font-size: 13px; font-weight: 700; cursor: pointer; user-select: none; transition: border-color .15s, background .15s, color .15s; }
.pk-pick-pill:has(input:checked) { border-color: var(--btn-bg); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent-ink); }
.pk-pick-pill input { accent-color: var(--btn-bg); margin: 0; cursor: pointer; }
.pk-review-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 28px; align-items: stretch; width: 100%; }
@media (max-width: 860px) { .pk-review-split { grid-template-columns: minmax(0, 1fr); } }
.pk-review-left .explain { margin-top: auto; }
.pk-review-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pk-review-material { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 14px; line-height: 1.55; }
.pk-review-q { font-size: 17px; font-weight: 600; line-height: 1.55; color: var(--text); }
.pk-review-img img { max-width: 100%; max-height: 280px; border-radius: 12px; border: 1px solid var(--line); object-fit: contain; }
.pk-review-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pk-review-opts { display: flex; flex-direction: column; gap: 8px; }
.pk-review-opts .option__box { min-height: 44px; padding: 8px 14px; cursor: default; }
.pk-review-answer { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; border: 1.5px solid var(--ok); background: var(--ok-soft); }
.pk-review-answer strong { font-size: 18px; color: var(--text); }

/* picker: SAT-style jump grid footer with difficulty dots */
.pk-jump-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
.pk-jump-pop { width: min(560px, 92vw); z-index: 30; }
.pk-jump-grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); max-height: 280px; overflow-y: auto; padding: 4px; }
.pk-jump-btn { position: relative; }
.pk-jump-dot { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 14px; height: 3px; border-radius: 999px; }
.pk-jump-btn--d1 .pk-jump-dot, .pk-lg-d1 { background: var(--ok); border-color: var(--ok); }
.pk-jump-btn--d2 .pk-jump-dot, .pk-lg-d2 { background: #E8A400; border-color: #E8A400; }
.pk-jump-btn--d3 .pk-jump-dot, .pk-lg-d3 { background: var(--bad); border-color: var(--bad); }
.pk-jump-btn.is-answered .pk-jump-dot { background: rgba(255, 255, 255, .85); }

/* picker: inline editing directly inside review card */
.pk-inline-edit { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.pk-inline-diff { min-height: 30px; padding: 2px 10px; font-size: 12px; width: auto; }
.pk-inline-kbd { margin: 0; }
.pk-inline-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border: 0; background: transparent; padding: 0; }
.pk-inline-cols .q-columns__col { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; display: flex; flex-direction: column; padding: 0; transition: border-color .15s, box-shadow .15s; }
.pk-inline-cols .q-columns__col:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.pk-inline-cols .q-columns__title { padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); text-align: center; }
.pk-inline-col-input { width: 100%; border: 0; border-radius: 0; background: transparent; padding: 12px 14px; text-align: center; font: 600 15px/1.45 var(--font); color: var(--text); resize: none; outline: none; box-shadow: none; }
.pk-inline-q, .pk-inline-explain { width: 100%; resize: vertical; font: inherit; line-height: 1.5; }
.pk-inline-q { font-size: 16px; font-weight: 600; }
.pk-inline-opt { gap: 10px; padding: 6px 12px; }
.pk-inline-opt__pick { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; flex: none; margin: 0; }
.pk-inline-opt__pick input { accent-color: var(--ok); margin: 0; cursor: pointer; }
.pk-inline-opt__input { flex: 1; min-width: 0; border: 0; background: transparent; font: 600 15px var(--font); color: var(--text); outline: none; padding: 4px 0; }
.pk-inline-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.pk-inline-note { flex: 1 1 240px; min-height: 36px; }
.pk-inline-foot__btns { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pk-inline-status.is-ok { color: var(--ok); font-weight: 700; }
.pk-inline-status.is-err { color: var(--bad); font-weight: 700; }

/* translated question: link back to the original text */
.q-lang { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; font-weight: 600;
  color: var(--text-2); text-decoration: none; }
.q-lang:hover { color: var(--text); text-decoration: underline; }

/* ---------------------------------------------------------------- phone navigation: 5 in the bar, the rest in a side menu */
.nav-burger { display: none; position: relative; }
.nav-drawer { display: none; }
/* sideways phones get the same phone layout (they used to lose the rail and the top bar entirely) */
@media (orientation: landscape) and (max-height: 520px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 30; margin: 0;
    flex-direction: row; align-items: center; padding: 4px 12px calc(4px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
  }
  .rail__logo, .rail__sep, .rail .spacer { display: none; }
  .rail__item { flex-direction: row; gap: 8px; width: auto; }
  .main { padding-bottom: 60px; }
  .topbar { height: 52px; padding: 0 16px; }
}
@media (max-width: 760px), (orientation: landscape) and (max-height: 520px) {
  .rail__item--extra, .rail__foot { display: none !important; }
  .rail__label { display: inline; }
  .rail { overflow-x: visible; justify-content: space-around; padding-left: 8px; padding-right: 8px; }
  .rail__item { flex: 1 1 0; width: auto; height: auto; max-width: 92px; padding: 8px 2px; font-size: 11px; gap: 4px; border-radius: 14px; display: flex; flex-direction: column; }
  .rail__item .ic { width: 23px; height: 23px; }
  .nav-burger { display: inline-flex; margin-right: 6px; flex: none; }
  .nav-burger.has-active::after { content: ""; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%;
    background: var(--grad-3); box-shadow: 0 0 0 2px var(--bg); }
  .topbar { gap: 4px; }

  .nav-drawer:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 60; }
  .nav-drawer__backdrop { position: absolute; inset: 0; background: rgba(2, 11, 41, .45); opacity: 0; transition: opacity .2s ease; }
  .nav-drawer__panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(300px, 82vw); background: var(--bg);
    border-radius: 0 22px 22px 0; box-shadow: 8px 0 40px rgba(2, 11, 41, .25); display: flex; flex-direction: column;
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); transform: translateX(-102%); transition: transform .22s ease; overflow-y: auto; }
  .nav-drawer.is-open .nav-drawer__backdrop { opacity: 1; }
  .nav-drawer.is-open .nav-drawer__panel { transform: none; }
  .nav-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
  /* same wordmark as the welcome page: capitals, one shade of blue per letter */
  .nav-drawer__logo { font: 800 22px/1 var(--font-display); letter-spacing: -.02em; }
  .nav-drawer__logo span:nth-child(1) { color: #7FA3F3; }
  .nav-drawer__logo span:nth-child(2) { color: #4275E9; }
  .nav-drawer__logo span:nth-child(3) { color: #2B60E5; }
  .nav-drawer__logo span:nth-child(4) { color: #2456D9; }
  .nav-drawer__logo span:nth-child(5) { color: #153893; }
  .nav-drawer__logo span:nth-child(6) { color: #020B29; }
  [data-theme="dark"] .nav-drawer__logo span:nth-child(6) { color: #BBCFF4; }
  .nav-drawer__list { display: flex; flex-direction: column; gap: 4px; }
  .nav-drawer__sep { height: 1px; background: var(--line); margin: 8px 6px 4px; }
  .nav-drawer__item { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 14px; border-radius: 14px;
    font-weight: 600; font-size: 16px; color: var(--text); text-decoration: none; }
  .nav-drawer__item:hover { background: var(--surface-2); text-decoration: none; }
  .nav-drawer__item.is-active { background: var(--accent-soft); color: var(--accent); }
  .nav-drawer__item .ic { width: 22px; height: 22px; color: inherit; }
  body.nav-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-drawer__panel, .nav-drawer__backdrop { transition: none; }
}

/* ==========================================================================
   Test screens on phones (upright and sideways): one-row header, icon tools,
   one-row footer, readable maths. Desktop is unchanged.
   ========================================================================== */
.cnt-short { display: none; }
/* maths inside answers: fractions were tiny next to the big answer boxes */
.option__box .katex { font-size: 1.35em; }
.q-text .katex { font-size: 1.15em; }
.q-text .katex, .option__box .katex { white-space: nowrap; }   /* keep short formulas on one line */

@media (max-width: 760px), (orientation: landscape) and (max-height: 520px) {
  /* header: a single row — close, title (shortened), progress, timer, theme */
  .session-bar { flex-wrap: nowrap; gap: 10px; min-height: 52px; padding: 6px 12px; }
  .session-bar__left { gap: 10px !important; min-width: 0; flex: 1 1 auto; flex-wrap: nowrap !important; }
  .session-bar__label { flex-wrap: nowrap !important; }
  .session-bar__right { flex-wrap: nowrap !important; }
  .session-bar:has(.steps) .session-bar__counter { display: none; }   /* the dots already show progress */
  .session-bar__label { min-width: 0; font-size: 15px; }
  .session-bar__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .session-bar__right { flex: none; gap: 6px !important; }
  .session-bar__avatar { display: none; }
  .session-bar .icon-btn { width: 40px; height: 40px; }
  .session-bar .steps { flex: 0 1 96px; min-width: 56px; }
  .session-bar .timer { font-size: 16px; }

  /* tool row: icons only, one line */
  .test-tools { top: 52px; padding: 6px 12px; gap: 6px; flex-wrap: nowrap; }
  .bank-tools { display: flex; justify-content: space-between; }
  .bank-tools .row { gap: 6px !important; flex-wrap: nowrap; }
  .bank-tools .btn { padding: 0 10px; min-height: 38px; }
  .btn-label { display: none; }
  .bank-timer { padding: 4px 10px; font-size: 15px; border-radius: 10px; }
  .bank-meta__pop { left: 0; right: auto; max-width: calc(100vw - 24px); }

  /* question header: icons were hidden together with the labels — keep the icons */
  .q-head__btn span { display: revert; }
  .q-head__btn > span:not(.ic) { display: none; }
  .q-head__btn { padding: 10px 12px; }
  .q-head__num { min-width: 42px; font-size: 16px; }

  /* footer: one row — ← · 1 / 17 ▾ · Проверить · → */
  .test-foot { flex-wrap: nowrap; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .test-foot .btn { min-height: 46px; }
  .bank-foot > .btn:first-child { width: 46px; padding: 0; justify-content: center; flex: none; }
  .bank-foot__mid { flex: 1 1 auto; min-width: 0; }
  .bank-foot__progress { display: none; }
  .cnt-long { display: none; }
  .cnt-short { display: inline; }
  .test-foot__counter { padding: 0 12px; white-space: nowrap; }
  .bank-foot__actions { gap: 8px !important; flex: none; flex-wrap: nowrap; }
  .bank-foot__actions .btn--primary { padding: 0 16px; }
  .bank-foot__actions .btn--secondary { width: 46px; padding: 0; justify-content: center; }
  .bank-foot__actions .btn--secondary:not([data-next-link]) { width: auto; padding: 0 14px; }
  .test-page { padding-bottom: 96px; }
  .q-grid-pop { position: fixed; left: 12px; right: 12px; width: auto; bottom: calc(72px + env(safe-area-inset-bottom)); transform: none; max-height: 50vh; overflow: auto; }
}

/* sideways phones: very little height — let the tool row scroll away and keep the header slim */
@media (orientation: landscape) and (max-height: 520px) {
  .session-bar { min-height: 46px; padding: 4px 16px; }
  .test-tools { position: static; }
  .test-page { padding-top: 10px; }
  .q-head { margin-bottom: 4px; }
  .q-head__btn { padding: 6px 10px; }
  .test-tools { padding: 4px 16px; }
  .test-tools .btn, .bank-timer { min-height: 34px; }
  /* plenty of width, little height: answers in two columns */
  .q-layout--single .options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .option__box { min-height: 48px; padding: 6px 12px; }
  .test-foot { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .test-foot .btn { min-height: 42px; }
  .test-page { padding-bottom: 76px; }
}
.ort-q__text .katex, .ort-q__options .katex { font-size: 1.15em; }

/* phones: a search field in the top bar takes the free space instead of the exam label */
@media (max-width: 760px) {
  .topbar:has(.search) .topbar__context { display: none; }
  .topbar__tools:has(.search) { flex: 1 1 auto; min-width: 0; }
  .topbar .search { width: auto !important; max-width: none !important; flex: 1 1 auto; min-width: 0; }
  .topbar .search input { min-width: 0; }
}

/* phones: «Собрать по плану» opens as a bottom sheet instead of running off the right edge */
@media (max-width: 760px), (orientation: landscape) and (max-height: 520px) {
  .pk-plan__pop { position: fixed; left: 12px; right: 12px; width: auto; top: auto; z-index: 40;
    bottom: calc(76px + env(safe-area-inset-bottom)); max-height: 70vh; overflow: auto; }
}

/* phones: «Мои вопросы» rows — question text on its own line, status and button underneath */
@media (max-width: 760px) {
  .mine-row { grid-template-columns: minmax(0, 1fr) auto !important; row-gap: 8px; }
  .mine-row__main { grid-column: 1 / -1; }
  .mine-row__text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .rail__item { max-width: 180px; white-space: nowrap; }
}
/* tests on phones: tool row stays on one line (icons, format tag, answered count) */
@media (max-width: 760px), (orientation: landscape) and (max-height: 520px) {
  .test-tools > .row { flex-wrap: nowrap; gap: 6px !important; min-width: 0; }
  .test-tools .btn--sm { padding: 0 10px; min-height: 36px; }
  .test-tools__status { flex: none; }
  .test-tools__answered { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
  .test-tools .save-state { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .test-tools .tag { white-space: nowrap; }
}
@media (min-width: 761px) and (min-height: 521px) { .test-tools__answered .ic { display: none; } }

/* test tool row in three parts: info left, timer centre, tools right */
.test-tools--3 { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); flex-wrap: nowrap; }
.test-tools--3 .test-tools__left { justify-self: start; min-width: 0; }
.test-tools--3 .test-tools__right { justify-self: end; }
.test-tools--3 .test-tools__center { justify-self: center; }
.timer-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border: var(--bw, 1px) solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.timer-pill .timer { font-size: 20px; letter-spacing: .04em; }
.test-tools .test-tools__status .save-state { white-space: nowrap; }
@media (max-width: 760px), (orientation: landscape) and (max-height: 520px) {
  .test-tools--3 { grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
  .timer-pill { padding: 4px 10px; }
  .timer-pill .ic { display: none; }
  .timer-pill .timer { font-size: 16px; }
  .test-tools--3 .save-state { display: none; }
}

/* ---------------------------------------------------------------- test review, one question at a time */
.page--rv { max-width: 1240px; }
.rv-screen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 0; background: var(--surface); border: var(--bw, 1px) solid var(--line); border-radius: 20px; overflow: hidden; margin-top: 16px; }
.rv.is-paged .rv-screen[hidden] { display: none; }
.rv-explain { padding: 24px; border-right: 1px solid var(--line); background: var(--accent-soft); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rv-explain__title { font-size: 16px; margin: 4px 0 0; }
.rv-explain .explain__text { font-size: 15px; line-height: 1.65; }
.rv-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.rv-answers > div { background: var(--surface); border: var(--bw, 1px) solid var(--line); border-radius: 12px; padding: 10px 12px; }
.rv-answers dt { font-size: 12px; color: var(--text-2); font-weight: 600; }
.rv-answers dd { margin: 2px 0 0; font-size: 18px; font-weight: 800; }
.rv-question { padding: 24px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.rv-question .q-text { font-size: 18px; }
.rv-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.rv-pop__head { font-size: 12px; font-weight: 700; color: var(--text-2); margin: 4px 0 8px; }
.rv-pop__head ~ .rv-pop__head { margin-top: 14px; }
.rv-grid button.is-ok, .lg.is-ok { background: var(--ok-soft); color: var(--ok); border: 1.5px solid var(--ok); }
.rv-grid button.is-bad, .lg.is-bad { background: var(--bad-soft); color: var(--bad); border: 1.5px solid var(--bad); }
@media (min-width: 901px) {
  .rv.is-paged .rv-screen { height: var(--rv-h, 70vh); }
  .rv.is-paged .rv-explain, .rv.is-paged .rv-question { overflow-y: auto; overscroll-behavior: contain; }
  .rv .q-figure img { max-height: min(240px, 27vh); }
  .rv-question { gap: 14px; padding: 20px 24px; }
  .rv-question .q-text { font-size: 17px; line-height: 1.5; }
  .rv-question .options { gap: 8px; }
  .rv-question .option__box { min-height: 48px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; }
  .rv .q-figure__frame { padding: 10px; }
  .rv .q-figure figcaption { display: none; }
}
@media (max-width: 900px) {
  .rv-screen { grid-template-columns: minmax(0, 1fr); }
  .rv-question { order: -1; }
  .rv-explain { border-right: 0; border-top: 1px solid var(--line); }
  .rv-foot { padding: 8px 12px; z-index: 31; gap: 8px; }
  .rv-foot .btn { min-height: 42px; padding: 0 14px; }
  .rv-foot .btn-label, .rv-foot__word { display: none; }
}

/* ---------------------------------------------------------------- Lab journal: one block per day */
.jr-days { display: flex; flex-direction: column; gap: 18px; }
.jr-day { padding: 0; overflow: hidden; }
.jr-day__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding: 20px 24px 14px; }
.jr-day__title { font-size: 22px; font-weight: 800; display: flex; align-items: baseline; gap: 10px; margin: 0 0 2px; }
.jr-day__date { font-size: 15px; font-weight: 600; color: var(--text-2); }
.jr-topics { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 60%; }
.jr-topics .tag b { font-weight: 800; margin-left: 2px; }
.jr-group { border-top: 1px solid var(--line); }
.jr-group__head { display: flex; align-items: center; gap: 12px; padding: 14px 24px; cursor: pointer; list-style: none; }
.jr-group__head::-webkit-details-marker { display: none; }
.jr-group__head:hover { background: var(--accent-soft); }
.jr-group__kind { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.jr-group__title { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-group__meta { white-space: nowrap; }
.jr-group > summary .ic { transition: transform .2s; flex: none; }
.jr-group[open] > summary .ic { transform: rotate(180deg); }
.jr-list { border: 0; border-radius: 0; margin: 0; }
.jr-list .list__row { padding-left: 24px; padding-right: 24px; }
@media (max-width: 760px) {
  .jr-day__head, .jr-group__head { padding-left: 16px; padding-right: 16px; }
  .jr-topics { max-width: 100%; justify-content: flex-start; }
  .jr-group__head { flex-wrap: wrap; row-gap: 2px; }
  .jr-group__title { flex-basis: 100%; order: 3; white-space: normal; }
}

/* SAT reference sheet in the formulas drawer */
.sat-ref__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sat-ref figure { margin: 0; padding: 10px 8px 8px; border: var(--bw, 1px) solid var(--line); border-radius: 12px; background: var(--surface); text-align: center; }
.sat-ref svg { width: 100%; max-width: 150px; height: auto; color: var(--text); fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.sat-ref svg text { fill: currentColor; stroke: none; font: italic 10px "Times New Roman", serif; }
.sat-ref svg .dot { fill: currentColor; }
.sat-ref svg .dash { stroke-dasharray: 3 2.5; }
.sat-ref figcaption { font-size: 14px; margin-top: 4px; line-height: 1.5; }
.sat-ref__facts { margin: 12px 0 18px; padding-left: 18px; display: grid; gap: 4px; }
.sat-ref__wide { grid-column: span 2; }
.sat-ref__wide svg { width: 48%; }
.sat-ref__mine { font-size: 18px; margin: 6px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
/* ORT sheet: a corrected answer is a square; the row is then final */
.bubble--square span { border-radius: 6px; }
.ort-sheet__row.is-fixed .bubble input:disabled + span { opacity: .45; cursor: not-allowed; }

/* ORT in two parts (math: 1–30 comparisons, 31–60): part tabs, one answer key, compact comparison cards */
.ort-part { display: flex; flex-direction: column; gap: 16px; }
.ort-parts { display: flex; gap: 8px; margin-bottom: 14px; scroll-margin-top: 150px; }
.test-body:not(:has(.is-paged)) .ort-parts { display: none; }
.ort-parts__tab { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 16px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.ort-parts__tab span { font-size: 13px; color: var(--muted); }
.ort-parts__tab.is-current { border-color: var(--btn-bg); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--btn-bg); }
.ort-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 16px; border: 1.5px solid var(--text); border-radius: 12px; background: var(--surface); font-size: 14px; }
.ort-key i { font-style: normal; font-weight: 800; display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 4px; border-radius: 50%; border: 1.5px solid var(--line-strong); font-size: 12px; }
.ort-grid--cmp { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ort-grid--cmp .ort-q { border: 0; box-shadow: 1px 1px 0 var(--line); padding: 14px 14px 16px; grid-template-columns: 28px minmax(0, 1fr); gap: 4px; }
.ort-grid--cmp .ort-q__num { font-size: 16px; }
.ort-grid--cmp .ort-q__body { gap: 8px; }
.ort-grid--cmp .ort-q__text { font-size: 15px; line-height: 1.45; }
.ort-grid--cmp .q-columns__title { padding: 6px 10px; font-size: 12px; }
.ort-grid--cmp .q-columns__body { font-size: 17px; padding: 10px 6px; min-height: 56px; }
.ort-sheet__sub { text-align: center; font-weight: 700; color: var(--muted); font-size: 14px; margin: -6px 0 12px; }
.ort-sheet__next { display: flex; flex-direction: column; gap: 8px; padding: 12px; margin-bottom: 12px; border-radius: 14px; background: var(--accent-soft); font-size: 14px; }
.ort-sheet__next .btn { justify-content: center; }
@media (max-width: 1100px) { .ort-grid--cmp { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1240px) and (max-width: 1439px) { .ort-grid--cmp { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ort-grid--cmp { grid-template-columns: minmax(0, 1fr); } }

/* ORT: answer sheet with the hand-in box under it */
.ort-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ort-submit { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: var(--bw, 1px) solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--card-shadow); }
.ort-submit .btn--lg { width: 100%; justify-content: center; }
.ort-submit p { margin: 0; }

/* ORT "paper" layout on wide screens: questions on the left, the answer sheet stays on the right */
@media (min-width: 1240px) {
  .ort-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
  /* compact enough that a whole part (15 rows × 2) fits on a laptop screen at 100% zoom */
  .ort-side { position: sticky; top: 141px; max-height: calc(100vh - 157px); }
  .ort-layout .ort-sheet { flex: 0 1 auto; min-height: 0; overflow: auto; padding: 14px 14px 16px; border-radius: 18px; }
  .ort-layout .ort-submit { padding: 12px 14px; border-radius: 18px; }
  .ort-layout .ort-submit .btn--lg { min-height: 44px; padding-block: 8px; }
  .ort-layout .ort-submit .text-2 { font-size: 12px; line-height: 1.4; }
  .ort-layout .ort-sheet h2 { font-size: 17px; margin-bottom: 4px; }
  .ort-layout .ort-sheet__sub { margin: 0 0 8px; font-size: 13px; }
  .ort-layout .ort-sheet__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(var(--rows2, 10), auto); gap: 2px 10px; }
  .ort-layout .ort-sheet .bubble span { width: 24px; height: 24px; font-size: 11px; }
  /* five options (А–Д) must fit in a half-width column of the sidebar */
  .ort-layout .ort-sheet__row { gap: 3px; padding: 1px 2px; }
  .ort-layout .ort-sheet__num { width: 22px; margin-right: 2px; }
  .ort-layout:has(.ort-sheet__row .bubble:nth-of-type(5)) { grid-template-columns: minmax(0, 1fr) 400px; }
  .ort-layout .ort-sheet__row:has(.bubble:nth-of-type(5)) .bubble span { width: 22px; height: 22px; font-size: 10px; }
  .ort-layout .ort-sheet__next { padding: 10px; gap: 6px; margin-bottom: 8px; font-size: 13px; }
}

/* work editor: what the chosen test format gives */
.fmt-info__list { list-style: none; margin: 8px 0 0; padding: 10px 12px; border: var(--bw, 1px) solid var(--line); border-radius: 12px; background: var(--surface-2, var(--surface)); display: grid; gap: 6px; font-size: 13px; }
.fmt-info__list li { display: flex; gap: 8px; align-items: flex-start; }
.fmt-info__list .ic { flex: none; margin-top: 2px; color: var(--accent); }
.jr-group__intro { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 20px; }
/* formula sheets: rows of new formulas with a math keyboard */
.formula-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px; border: var(--bw, 1px) solid var(--line); border-radius: 14px; background: var(--surface); }
.formula-row__del { position: absolute; top: 8px; right: 8px; }
.formula-row__preview { min-height: 30px; margin-top: 8px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2, #f4f3ee); font-size: 18px; overflow-x: auto; }
.formula-row__preview:empty { display: none; }
.mathkb { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.mathkb button { min-width: 34px; height: 30px; padding: 0 8px; border: var(--bw, 1px) solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: 600 13px/1 "Times New Roman", serif; cursor: pointer; }
.mathkb button:hover { border-color: var(--accent); color: var(--accent); }
.sheet-view__branch.row { display: flex; align-items: center; }
@media (max-width: 900px) { .formula-row { grid-template-columns: 1fr; } }
.input--file { padding: 8px; font-size: 13px; color: var(--muted); }
.input--file::file-selector-button { margin-right: 10px; padding: 8px 12px; border: 0; border-radius: 10px; background: var(--accent-soft, #e8edff); color: var(--accent); font-weight: 700; cursor: pointer; }
/* mistakes review page (journal → one test) */
.jr-group__intro .btn--primary { margin-left: auto; }
.mr-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin: 12px 0 18px; }
.mr-title { font-size: 34px; margin: 2px 0; }
.mr-progress { min-width: 260px; display: grid; gap: 8px; }
.mr-progress .progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.mr-progress .progress span { display: block; height: 100%; background: var(--btn-bg); border-radius: inherit; }
.mr-filters { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.mr-filters .chips { margin: 0; }
.mr-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.mr-topics a { text-decoration: none; }
.mr-screen { display: grid !important; }
.mr-actions { display: grid; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.mr-strip { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.mr-strip__nums { flex: 1; display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px; }
.mr-num { flex: none; min-width: 34px; height: 34px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 10px; border: 1.5px solid var(--btn-bg); color: var(--btn-bg); font-weight: 700; font-size: 13px; text-decoration: none; background: var(--surface); }
.mr-num.is-blank { border-style: dashed; border-color: var(--line-strong); color: var(--muted); }
.mr-num.is-done { background: #e6f4ea; border-color: #2e7d4f; color: #2e7d4f; }
.mr-num.is-current { outline: 3px solid var(--accent); outline-offset: 2px; }
.mr-legend { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.mr-legend .mr-num { min-width: 22px; height: 22px; font-size: 11px; }
.btn.is-disabled { pointer-events: none; opacity: .45; }
#mr { scroll-margin-top: 90px; }

/* "+N" chip: opens the rest of the list, "Свернуть" folds it back */
.chip-more { cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 700; line-height: inherit; }
.chip-more__rest:not([hidden]) { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
/* mistakes review: bottom bar with a number picker */
body.has-rv-foot .page { padding-bottom: 110px; }
.mr-grid a { height: 40px; border-radius: 10px; display: grid; place-items: center; font: 700 14px var(--font); text-decoration: none; border: 1.5px dashed var(--line-strong); color: var(--muted); background: var(--surface); }
.mr-grid a.is-open, .lg.is-open { border: 1.5px solid var(--btn-bg); color: var(--btn-bg); }
.mr-grid a.is-done { background: var(--ok-soft); border: 1.5px solid var(--ok); color: var(--ok); }
.mr-grid a.is-current { outline: 2px solid var(--accent); outline-offset: 2px; }
.mr-letter { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-weight: 800; color: #fff; }
.mr-letter--bad { background: var(--bad); }
.mr-letter--ok { background: var(--ok); }
/* folded-out chip list: a plain "Свернуть ↑" link on the right instead of a chip */
.chip-more.is-open { margin-left: auto; border: 0; background: none; padding: 4px 2px; color: var(--btn-bg); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.chip-more.is-open::after { content: ""; width: 7px; height: 7px; border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: translateY(2px) rotate(45deg); }
.chip-more.is-open:hover { text-decoration: underline; }

/* fluid widths: on wide windows (or when the page is zoomed out) content grows to the sides
   instead of staying a fixed column in the middle; small screens are unchanged */
.page { max-width: clamp(1180px, 84vw, 1760px); padding-inline: clamp(16px, 3vw, 64px); }
.page--narrow { max-width: clamp(820px, 60vw, 1180px); }
.page--rv { max-width: clamp(1240px, 90vw, 1880px); }
.page:has(.pk-layout), .page:has(.pk-page) { max-width: clamp(1480px, 94vw, 2000px); }

/* ================================================================ Monday test hero: the scene of the day is the whole background */
.mh { position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: center;
  min-height: clamp(420px, 46vw, 620px); padding: clamp(24px, 3.4vw, 56px); border-radius: 28px;
  background: radial-gradient(120% 140% at 85% 20%, #1d2fa8 0%, #0c1872 45%, #070f4d 100%); color: #fff;
  box-shadow: 0 30px 70px rgba(12, 24, 114, .35); }
.mh__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; opacity: .75; cursor: pointer; transition: opacity 1.4s ease; touch-action: manipulation;
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, .55) 35%, #000 60%);
          mask-image: linear-gradient(90deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, .55) 35%, #000 60%); }
.mh.is-live .mh__canvas { opacity: .85; }
.mh .mh__canvas.is-fading { opacity: 0; }
.mh__greet { transition: opacity 1.4s ease; }
.mh__greet.is-fading { opacity: 0; }
.mh__text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 18px; max-width: 640px; min-width: 0; pointer-events: none; }
.mh__text a, .mh__text button, .mh__text form { pointer-events: auto; }
.mh__top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mh__top .eyebrow { color: rgba(255, 255, 255, .78); }
.mh__week { padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .3); font-size: 12px; font-weight: 700; }
.mh__title { font-size: clamp(28px, 3.8vw, 60px); line-height: .98; margin: 0; letter-spacing: -.02em; hyphens: none; text-shadow: 0 2px 24px rgba(7, 15, 77, .6); }
.mh__status { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); backdrop-filter: blur(6px); font-size: 13px; font-weight: 700; }
.mh__status--live { background: #fff; color: #0c1872; }
.mh__status--live i { width: 8px; height: 8px; border-radius: 50%; background: #e5484d; animation: mh-pulse 1.6s infinite; }
.mh__status--done { background: rgba(46, 160, 101, .22); color: #bff0d4; }
@keyframes mh-pulse { 70% { box-shadow: 0 0 0 10px rgba(229, 72, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); } }
.mh__count { display: flex; gap: 10px; }
.mh__cell { min-width: 74px; padding: 10px 12px 8px; border-radius: 14px; background: rgba(7, 15, 77, .45); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .16); display: grid; gap: 2px; text-align: center; }
.mh__cell b { font-size: clamp(26px, 2.6vw, 38px); line-height: 1; font-weight: 800; }
.mh__pix { display: block; margin: 2px auto 4px; opacity: .85; image-rendering: pixelated; }
.mh__cell span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .65); }
.mh__meta { margin: 0; color: rgba(255, 255, 255, .78); font-size: 14px; }
.mh__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.btn--light { background: #fff; color: #0c1872; border-color: #fff; }
.btn--light:hover { background: #e9edff; color: #0c1872; }
.btn--light:disabled { background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .7); border-color: transparent; cursor: default; }
.mh.is-live .btn--light { box-shadow: 0 0 0 6px rgba(255, 255, 255, .12); }
.mh__greet { position: absolute; z-index: 1; right: clamp(20px, 3vw, 48px); bottom: clamp(18px, 2.4vw, 32px); margin: 0; max-width: 46%;
  text-align: right; font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, .9); text-shadow: 0 1px 12px rgba(7, 15, 77, .8); pointer-events: none; }
.mh__badge, .mh__score { position: absolute; z-index: 1; top: clamp(16px, 2vw, 28px); right: clamp(16px, 2vw, 28px); pointer-events: none; }
.mh__badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; background: rgba(7, 15, 77, .72);
  font: 600 11px/1 'IBM Plex Mono', ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; }
.mh__badge i { width: 8px; height: 8px; border-radius: 50%; background: #e5484d; animation: mh-pulse 1.6s infinite; }
.mh__score { display: grid; gap: 2px; padding: 10px 14px; border-radius: 14px; background: rgba(7, 15, 77, .78); text-align: right; }
.mh__score b { font: 700 26px/1 'IBM Plex Mono', ui-monospace, monospace; }
.mh__score span { font: 500 11px/1.2 'IBM Plex Mono', ui-monospace, monospace; color: rgba(201, 211, 255, .85); }
@media (max-width: 900px) {
  .mh { min-height: 0; align-items: start; padding-bottom: 72px; }
  .mh__canvas { -webkit-mask-image: none; mask-image: none; opacity: .4; }
  .mh__greet { left: 24px; right: 24px; max-width: none; text-align: left; }
  .mh__cell { min-width: 0; flex: 1; }
}

/* the Monday test is the key section: it leads the menu and pulses while the test is open */
.rail__item--key { position: relative; color: var(--accent); }
.rail__live { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #e5484d;
  box-shadow: 0 0 0 2px var(--surface); animation: mh-pulse 1.6s infinite; }

/* ================================================================ Monday ranking */
.rk-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.rk-side { display: grid; gap: 20px; }
.rk { display: grid; gap: 18px; padding: clamp(18px, 2vw, 28px); }
.rk__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rk__head h2 { font-size: 20px; margin: 0; }
/* segmented switch with a sliding highlight */
.seg-switch { position: relative; display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-2, #eef1fb); isolation: isolate; }
.seg-switch__opt { position: relative; z-index: 1; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--text-2, var(--muted)); text-decoration: none; transition: color .3s; }
.seg-switch__opt[aria-selected="true"] { color: #fff; }
.seg-switch__thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: 999px; background: var(--btn-bg); transition: transform .45s cubic-bezier(.2,.8,.2,1), width .45s cubic-bezier(.2,.8,.2,1); }
/* podium: 2nd · 1st · 3rd, columns of pixel squares */
.rk__podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 2vw, 22px); align-items: end; min-height: 40px; }
.rk-col { display: grid; gap: 8px; justify-items: center; text-align: center; min-width: 0; }
.rk-col__who { display: grid; gap: 1px; justify-items: center; min-width: 0; }
.rk-col__who b { font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-col__who span { font-size: 12px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-col__bar { position: relative; width: 100%; display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 3px; padding: 6px; border-radius: 12px 12px 4px 4px; background: rgba(39, 71, 216, .06); }
.rk-col__bar i { aspect-ratio: 1; border-radius: 2px; background: var(--btn-bg); opacity: 0; transform: translateY(-14px); }
.rk-col--1 .rk-col__bar i { background: #1d34c4; }
.rk-col--3 .rk-col__bar i { background: #6f86ea; }
.rk-col__bar em { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font: 700 22px/1 'IBM Plex Mono', ui-monospace, monospace; font-style: normal; color: #fff; text-shadow: 0 1px 8px rgba(7, 15, 77, .5); opacity: 0; transition: opacity .5s 1s; }
.rk.is-in .rk-col__bar i { animation: rk-drop .45s cubic-bezier(.2,.9,.3,1.2) forwards; animation-delay: calc(var(--d) * 22ms + var(--col-delay, 0ms)); }
.rk.is-in .rk-col__bar em { opacity: 1; }
.rk-col--3 { --col-delay: 0ms; } .rk-col--2 { --col-delay: 260ms; } .rk-col--1 { --col-delay: 520ms; }
@keyframes rk-drop { to { opacity: 1; transform: none; } }
.rk-col--1 .rk-col__bar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); background-size: 250% 100%; animation: rk-shine 3.2s ease-in-out 1.6s infinite; opacity: .8; }
@keyframes rk-shine { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.rk-col.is-me .rk-col__who b { color: var(--accent); }
/* rows 4–10 */
.rk__list { list-style: none; margin: 0; padding: 0; display: grid; }
.rk-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 52px; gap: 12px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--line); }
.rk-row__place { font: 700 15px/1 'IBM Plex Mono', ui-monospace, monospace; color: var(--accent); }
.rk-row__who { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; }
.rk-row__who b { font-weight: 700; }
.rk-row__who > span:not(.rk-delta) { color: var(--muted); font-size: 13px; }
.rk-row__score { font: 700 14px/1 'IBM Plex Mono', ui-monospace, monospace; text-align: right; font-variant-numeric: tabular-nums; }
.rk-row.is-me { background: rgba(39, 71, 216, .06); border-radius: 10px; }
.rk.is-in .rk-row:not(.is-kept) { animation: rk-row .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 45ms + 700ms); }
@keyframes rk-row { from { opacity: 0; transform: translateX(-12px); } }
.rk-dots { display: inline-flex; gap: 3px; }
.rk-dots i { width: 7px; height: 7px; border-radius: 2px; background: var(--line-strong); }
.rk-dots i.is-on { background: var(--btn-bg); }
.rk.is-in .rk-dots i.is-on { animation: rk-dot .3s ease both; animation-delay: calc(var(--d) * 40ms + var(--i, 0) * 45ms + 900ms); }
@keyframes rk-dot { from { background: var(--line-strong); transform: scale(.4); } }
.rk-delta { font: 600 11px/1 'IBM Plex Mono', ui-monospace, monospace; color: var(--muted); }
.rk-delta--up { color: var(--ok); } .rk-delta--down { color: var(--bad); } .rk-delta--new { color: var(--accent); }
.rk__more { margin: -6px 0 0; }
.rk__more:empty { display: none; }
/* your own row: fills like a progress bar up to your score */
.rk-me { position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  padding: 14px 16px; border-radius: 14px; background: #0c1872; color: #fff; isolation: isolate; }
.rk-me::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #2747d8, #3e5bf0); transform-origin: left; transform: scaleX(0); transition: transform 1.2s cubic-bezier(.2,.8,.2,1) .9s; }
.rk.is-in .rk-me::before { transform: scaleX(var(--fill)); }
.rk-me__place { font: 700 16px/1 'IBM Plex Mono', ui-monospace, monospace; }
.rk-me__who { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.rk-me__who > span:not(.rk-delta) { color: rgba(255, 255, 255, .75); font-size: 13px; }
.rk-me .rk-delta { color: #cfd8ff; } .rk-me .rk-delta--up { color: #9ff0c2; } .rk-me .rk-delta--down { color: #ffb3b5; }
.rk-me__gap { font: 500 12px/1.2 'IBM Plex Mono', ui-monospace, monospace; color: #dfe5ff; }
.rk-me__score { font: 700 15px/1 'IBM Plex Mono', ui-monospace, monospace; }
/* last test card */
.rk-last { display: grid; gap: 14px; }
.rk-last h2 { font-size: 18px; margin: 0; }
.rk-last__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.rk-last__stats canvas { display: block; margin-bottom: 6px; }
.rk-strip { display: flex; gap: 5px; }
.rk-strip i { flex: 1; max-width: 26px; height: 10px; border-radius: 3px; background: var(--line); }
.rk-last.is-in .rk-strip i.is-ok { background: var(--ok); animation: rk-dot .35s ease both; animation-delay: calc(var(--d) * 60ms + 200ms); }
.rk-last.is-in .rk-strip i.is-bad { background: var(--bad); opacity: .75; animation: rk-dot .35s ease both; animation-delay: calc(var(--d) * 60ms + 200ms); }
.rk-link { font-weight: 700; }
/* school duel: pixel squares fill from both sides */
.rk-duel { display: grid; gap: 12px; background: radial-gradient(120% 140% at 85% 0%, #1d2fa8 0%, #0c1872 55%, #070f4d 100%); color: #fff; border-color: transparent; }
.rk-duel .eyebrow { color: rgba(255, 255, 255, .7); }
.rk-duel__names { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 18px; }
.rk-duel__names span { opacity: .6; font-size: 13px; }
.rk-duel__bar { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; }
.rk-duel__bar i { aspect-ratio: 1; border-radius: 2px; opacity: 0; transform: scale(.3); }
.rk-duel__bar i.is-mine { background: #8fa6ff; }
.rk-duel__bar i.is-rival { background: rgba(255, 255, 255, .35); }
.rk-duel.is-in .rk-duel__bar i { animation: rk-pop .35s cubic-bezier(.2,.9,.3,1.3) forwards; animation-delay: calc(var(--d) * 35ms); }
@keyframes rk-pop { to { opacity: 1; transform: none; } }
.rk-duel__bar.is-lead i.is-mine { box-shadow: 0 0 10px rgba(143, 166, 255, .7); }
.rk-duel__avg { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; opacity: .85; }
.rk-duel__verdict { margin: 0; font-weight: 700; }
@media (max-width: 1000px) { .rk-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .rk-row { grid-template-columns: 28px minmax(0, 1fr) 44px; grid-template-areas: "p w s" ". d d"; row-gap: 6px; }
  .rk-row__place { grid-area: p; } .rk-row__who { grid-area: w; } .rk-row__score { grid-area: s; } .rk-row .rk-dots { grid-area: d; }
  .rk-me { grid-template-columns: auto minmax(0, 1fr) auto; }
  .rk-me__gap { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .rk-col__bar i, .rk-duel__bar i { opacity: 1; transform: none; animation: none !important; }
  .rk-col--1 .rk-col__bar::after { animation: none; display: none; }
}
/* the right column matches the ranking's height: the school duel stretches to fill it */
@media (min-width: 1001px) {
  .rk-grid { align-items: stretch; }
  .rk-side { grid-template-rows: auto 1fr; }
  .rk-duel { align-content: space-between; grid-template-rows: auto auto 1fr auto auto; }
  .rk-duel__score { align-self: center; }
}

/* podium place: a solid badge on top of the column, readable in both themes */
.rk-col__bar em { top: -14px; bottom: auto; left: 50%; transform: translate(-50%, 0); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface); color: var(--text); border: 2px solid currentColor; font-size: 15px; text-shadow: none; box-shadow: 0 4px 12px rgba(7, 15, 77, .18); z-index: 1; }
.rk-col--1 .rk-col__bar em { color: #c8930d; }
.rk-col--2 .rk-col__bar em { color: #7d8597; }
.rk-col--3 .rk-col__bar em { color: #b06a3b; }
.rk-col__bar { margin-top: 18px; }
/* dark theme: empty score dots dim, the 1st-place shine softer */
[data-theme="dark"] .rk-dots i:not(.is-on) { background: rgba(255, 255, 255, .14); }
[data-theme="dark"] .rk-dots i.is-on { background: #6f86ff; }
[data-theme="dark"] .rk-col__bar { background: rgba(143, 166, 255, .08); }
[data-theme="dark"] .rk-col--1 .rk-col__bar::after { opacity: .35; }
[data-theme="dark"] .rk-strip i { background: rgba(255, 255, 255, .12); }

/* school duel: both averages as large pixel numbers, so the card has content instead of empty space */
.rk-duel__score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; padding: 8px 0; }
.rk-duel__score > div:last-child { justify-self: end; text-align: right; }
.rk-duel__score > div:last-child canvas { margin-left: auto; }
.rk-duel__score canvas { display: block; max-width: 100%; margin-bottom: 6px; }
.rk-duel__vs { font-size: 13px; opacity: .55; padding-bottom: 26px; }
.rk-duel__lbl { font-size: 12px; font-weight: 600; opacity: .7; }

/* skills map: one collapsible block per topic (same pattern as the question bank) */
.skills-tools { gap: 12px; flex-wrap: wrap; }
.skills-tree { margin-top: 4px; }
.sk-topic.is-weak { border-color: var(--accent); }
.sk-ring { --p: 0; width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.sk-ring > span { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.sk-topic .bank-topic__text { gap: 4px; }
.sk-topic .skills-strip { margin-top: 4px; }
.sk-sub { padding: 2px 10px 4px; }
.sk-row { padding-left: 14px; }
.sk-row .dot-cell { width: 18px; display: inline-grid; place-items: center; flex: none; }
.sk-row__meta { color: var(--muted); font-weight: 700; white-space: nowrap; }
.sk-row.is-empty .bank-row__name { color: var(--muted); }
@media (max-width: 560px) {
  .sk-topic > details > summary { gap: 12px; padding: 16px 70px 16px 16px; }
  .sk-ring { width: 44px; height: 44px; } .sk-ring > span { width: 35px; height: 35px; font-size: 11px; }
  .sk-topic .bank-play--topic { right: 14px; top: 18px; width: 42px; height: 42px; }
  .sk-topic .bank-topic__body { padding: 0 12px 14px; }
}
@media (max-width: 720px) {
  .skills-tools .skills-legend { flex-direction: row; flex-wrap: wrap; gap: 6px 16px !important; }
}

/* skills map as square tiles, four in a row; an opened tile takes the whole row, the rest close the gap */
.sk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; grid-auto-flow: row dense; margin-top: 4px; }
.sk-grid .sk-topic { min-width: 0; }
.sk-grid .sk-topic > details > summary { flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px;
  aspect-ratio: 1; padding: 20px; transition: background .15s; }
.sk-grid .sk-topic > details > summary:hover { background: var(--surface-2); }
.sk-grid .sk-topic .bank-topic__text { flex: none; width: 100%; }
.sk-grid .sk-topic .bank-topic__text b { font-size: 18px; line-height: 1.2; }
.sk-grid .sk-topic .bank-topic__text b .tag { display: inline-block; margin-top: 4px; vertical-align: middle; }
.sk-grid .sk-topic .bank-topic__chev { position: absolute; right: 18px; bottom: 18px; }
.sk-grid .sk-topic .bank-play--topic { right: 18px; top: 18px; width: 42px; height: 42px; }
.sk-grid .sk-topic .skills-strip { padding-right: 28px; }
/* opened: full row, header back to one line */
.sk-grid .sk-topic:has(> details[open]), .sk-grid .sk-topic.is-open { grid-column: 1 / -1; }
.sk-grid .sk-topic:has(> details[open]) > details > summary, .sk-grid .sk-topic.is-open > details > summary { aspect-ratio: auto; flex-direction: row; align-items: center; padding: 20px 88px 20px 22px; }
.sk-grid .sk-topic:has(> details[open]) .bank-topic__text, .sk-grid .sk-topic.is-open .bank-topic__text { flex: 1; width: auto; }
.sk-grid .sk-topic:has(> details[open]) .bank-topic__chev, .sk-grid .sk-topic.is-open .bank-topic__chev { position: static; }
.sk-grid .sk-topic:has(> details[open]) .bank-play--topic, .sk-grid .sk-topic.is-open .bank-play--topic { right: 22px; top: 22px; width: 46px; height: 46px; }
@media (max-width: 1100px) { .sk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .sk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 560px) {
  .sk-grid .sk-topic > details > summary { padding: 14px; gap: 10px; }
  .sk-grid .sk-topic .bank-topic__text b { font-size: 15px; }
  .sk-grid .sk-topic .bank-topic__text > .small { font-size: 12px; }
  .sk-grid .sk-topic .skills-strip { display: none; }
  .sk-grid .sk-topic .bank-play--topic { right: 12px; top: 12px; width: 36px; height: 36px; }
  .sk-grid .sk-topic .bank-topic__chev { right: 12px; bottom: 12px; }
  .sk-grid .sk-topic:has(> details[open]) > details > summary, .sk-grid .sk-topic.is-open > details > summary { padding: 16px 64px 16px 16px; }
  .sk-grid .sk-topic:has(> details[open]) .skills-strip { display: flex; }
}
@media (min-width: 1001px) {
  .sk-grid .sk-topic .bank-topic__body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
}
@media (max-width: 560px) { .sk-grid .sk-topic .bank-topic__text { padding-right: 20px; } }

/* skills map: the student's own exam carries a small dot in the exam filter */
.sk-own { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-left: 6px; vertical-align: middle; opacity: .7; }

/* «Сообщить об ошибке» popover */
.qr { position: relative; display: inline-block; }
.qr__btn { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 6px 10px; border-radius: 10px; border: 1px solid transparent; user-select: none; }
.qr__btn::-webkit-details-marker { display: none; }
.qr__btn:hover, .qr[open] .qr__btn { color: var(--text); border-color: var(--line); background: var(--surface); }
.qr__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qr__panel { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(340px, 86vw); display: grid; gap: 10px; padding: 16px;
  background: var(--surface); color: var(--text); border: var(--bw, 1px) solid var(--line-strong); border-radius: 16px; box-shadow: 0 18px 40px rgba(7, 15, 77, .18); }
.qr--right .qr__panel { left: auto; right: 0; }
.qr__title { font-size: 14px; }
.qr__opts { display: grid; gap: 6px; }
.qr__opt { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.qr__opt input { accent-color: var(--accent); }
.qr__msg { min-height: 72px; padding: 10px 14px; resize: vertical; font-size: 14px; line-height: 1.45; }
.qr__ok { color: var(--ok); font-weight: 600; }
.qr__err { color: var(--bad); font-weight: 600; }
.rv-explain .qr, .mr-screen .qr { margin-top: 4px; }
.rv-explain .qr__panel { top: auto; bottom: calc(100% + 6px); }
.rail__count { position: absolute; top: 4px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff;
  font-style: normal; font-size: 11px; font-weight: 800; display: grid; place-items: center; line-height: 1; }

/* teacher map: same tiles as the student's map, plus gaps, counts and edit tools */
.tm-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tm-gaps { width: 52px; height: 52px; border-radius: 16px; flex: none; display: grid; place-items: center; align-content: center; gap: 0;
  background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); line-height: 1; }
.tm-gaps b { font-size: 20px; }
.tm-gaps small { font-size: 10px; font-weight: 700; }
.tm-gaps.is-full { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); }
.tm-gaps.is-new { background: var(--surface-2); color: var(--accent); }
.tm-topic.is-archived, .tm-sub.is-archived, .tm-row.is-archived { opacity: .55; }
.tm-bar { display: flex; gap: 6px; justify-content: flex-end; }
.tm-sub__head { display: flex; align-items: center; gap: 6px; padding: 2px 10px 4px; }
.tm-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; }
.tm-row:hover { background: var(--surface-2); }
.tm-row__name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 14px; }
.tm-row__name small { font-size: 11px; }
.tm-count { min-width: 44px; height: 30px; padding: 0 8px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font-weight: 800; font-size: 13px; color: var(--text); background: var(--surface-2); text-decoration: none; }
.tm-count small { font-size: 10px; font-weight: 700; }
.tm-count.is-gap { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.tm-move { display: inline-flex; gap: 2px; }
.tm-move .icon-btn { width: 28px; height: 28px; }
.tm-sub .tree-add { margin: 6px 10px 2px; }
.tm-sub--new { border-top: 1px dashed var(--line-strong); }
.tm-topic--new { border-style: dashed; border-color: var(--line-strong); }
.tm-new { aspect-ratio: 1; padding: 20px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.tm-new .tm-gaps { margin-bottom: auto; }
.tm-new .tree-add { flex-wrap: wrap; }
.tm-grid .sk-topic:has(> details[open]) .tm-body .tm-span { grid-column: 1 / -1; }
.tm-grid .tree-edit__panel { right: 0; }
@media (max-width: 560px) { .tm-new { aspect-ratio: auto; } .tm-row { flex-wrap: wrap; } }

.rp-reply { align-items: center; }
.rp-reply > span { flex: 1; }
.rp { display: grid; gap: 12px; }
.rp__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rp__msg { margin: 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; font-size: 14px; }
.rp__q { display: grid; gap: 8px; padding: 14px; border: var(--bw, 1px) solid var(--line); border-radius: 14px; }
.rp__opts { margin: 0; padding-left: 22px; display: grid; gap: 4px; list-style: upper-alpha; }
.rp__opts li.is-key { color: var(--ok); font-weight: 700; }
.rp__actions { display: grid; gap: 10px; }
.rp-filters { margin-bottom: 14px; }
.rp__author { font-weight: 700; color: var(--accent); text-decoration: none; }
.rp__author:hover, .rp__author:focus-visible { text-decoration: underline; }
.rp-role { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.25; border: 1px solid transparent; }
.rp-role--student { background: var(--accent-soft); color: var(--accent-ink, var(--accent)); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.rp-role--teacher { background: color-mix(in srgb, var(--ok, #16a34a) 15%, var(--surface)); color: var(--ok, #16a34a); border-color: color-mix(in srgb, var(--ok, #16a34a) 30%, transparent); }
.rp-role--assistant { background: color-mix(in srgb, var(--warn, #d97706) 15%, var(--surface)); color: var(--warn, #b45309); border-color: color-mix(in srgb, var(--warn, #d97706) 30%, transparent); }
.rp-role--manager { background: color-mix(in srgb, #6366f1 16%, var(--surface)); color: #4338ca; border-color: color-mix(in srgb, #6366f1 32%, transparent); }
.rp-role--supervisor { background: color-mix(in srgb, #8b5cf6 16%, var(--surface)); color: #6d28d9; border-color: color-mix(in srgb, #8b5cf6 32%, transparent); }
.rp-role--admin { background: color-mix(in srgb, var(--bad, #e5484d) 15%, var(--surface)); color: var(--bad, #dc2626); border-color: color-mix(in srgb, var(--bad, #e5484d) 32%, transparent); }
[data-theme="dark"] .rp-role--assistant { color: #fbbf24; }
[data-theme="dark"] .rp-role--manager { color: #a5b4fc; }
[data-theme="dark"] .rp-role--supervisor { color: #c4b5fd; }
[data-theme="dark"] .rp-role--admin { color: #fca5a5; }
.bank-topic .tree-edit > summary { width: 32px; height: 32px; padding: 0; gap: 0; justify-content: center; border-radius: 9px; aspect-ratio: auto; background: none; }
.bank-topic .tree-edit > summary:hover { background: var(--surface-2); }
.bank-topic .tree-edit { display: inline-block; }

/* ---------- «Своя сессия» builder ---------- */
.sb { display: grid; gap: 18px; }
.sb__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sb__head h2 { margin: 0; font-size: 22px; }
.sb__presets .chip { display: inline-flex; align-items: center; gap: 6px; }
.sb__presets .chip.is-active { border-color: var(--btn-bg); box-shadow: inset 0 0 0 1px var(--btn-bg); }
.chip--own { display: inline-flex; align-items: center; gap: 2px; padding-right: 4px; }
.chip--own > button, .chip--own form button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 0; }
.chip--own form button { width: 22px; height: 22px; justify-content: center; border-radius: 50%; color: var(--muted); font-size: 16px; }
.chip--own form button:hover { background: var(--surface-2); color: var(--bad); }
.sb__form { display: grid; gap: 16px; }
.sb__row { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.sb__row legend { font-weight: 700; font-size: 14px; padding: 0; margin-bottom: 8px; display: flex; align-items: baseline; gap: 10px; }
.sb__count { font-size: 22px; font-weight: 800; color: var(--accent); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-height: 42px; padding: 8px 14px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.seg span small { font-weight: 600; font-size: 11px; color: var(--muted); }
.seg label:hover span { border-color: var(--text); }
.seg input:checked + span { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-text); }
.seg input:checked + span small { color: inherit; opacity: .8; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.sb__range { width: 100%; accent-color: var(--accent); height: 28px; }
.sb__ticks { display: flex; justify-content: space-between; margin-top: -4px; }
.sb__note { margin: 0; }
.sb__topics { display: flex; flex-wrap: wrap; gap: 8px; }
.sb__pace { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14px; font-weight: 600; }
.sb__pace.is-ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.sb__pace.is-tight { background: color-mix(in srgb, #e9a23b 16%, var(--surface)); }
.sb__pace.is-bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--text); }
.sb__fix { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.sb__actions { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.sb__save { position: relative; }
.sb__save > summary { list-style: none; }
.sb__save > summary::-webkit-details-marker { display: none; }
.sb__save-panel { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; width: min(320px, 86vw); display: grid; gap: 8px; padding: 14px;
  background: var(--surface); border: var(--bw, 1px) solid var(--line-strong); border-radius: 14px; box-shadow: 0 16px 36px rgba(7, 15, 77, .16); }
.sb-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; margin-top: 12px; }

/* daily goal */
.goal { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: 16px; border: var(--bw, 1px) solid var(--line); background: var(--surface); }
.goal__ring { --p: 0; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--surface-2) 0); }
.goal__ring span { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.goal__text { display: flex; flex-direction: column; gap: 1px; font-size: 14px; }
/* goal not reached yet: tint the chip so it reads as today's to-do, not a static stat */
.goal--todo { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 16%, transparent); }
.goal--todo .goal__ring { width: 52px; height: 52px; background: conic-gradient(var(--accent) calc(var(--p) * 1%), color-mix(in srgb, var(--accent) 18%, var(--surface)) 0); }
.goal--todo .goal__ring span { width: 40px; height: 40px; color: var(--accent); }
.goal--todo .goal__text b { font-size: 15px; }
.goal--todo .goal__text .small { color: var(--accent); font-weight: 600; }
.goal--done { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.select--sm { min-height: 34px; padding: 4px 30px 4px 10px; font-size: 13px; width: auto; }

/* in a session */
.q-clock { display: inline-flex; align-items: center; gap: 4px; }
.timer--soft { background: rgba(255, 255, 255, .12); }
.hint-box { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, #e9a23b 14%, var(--surface)); }
.hint-box .ic { color: #b7791f; flex: none; }
.time-up { position: sticky; bottom: 16px; z-index: 6; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-radius: 16px; background: var(--btn-bg); color: var(--btn-text); box-shadow: 0 16px 40px rgba(7, 15, 77, .25); }
.time-up > div { display: flex; flex-direction: column; gap: 2px; }
.time-up .btn--primary { background: var(--btn-text); color: var(--btn-bg); border-color: var(--btn-text); }

/* results */
.sd-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.sd-level { display: grid; gap: 4px; padding: 14px; border: var(--bw, 1px) solid var(--line); border-radius: 16px; background: var(--surface); }
.sd-level.is-empty { opacity: .55; }
.sd-level b { font-size: 20px; }
.sd-level--top b { font-size: 15px; }
.sd-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.sd-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.sd-steps { display: flex; gap: 4px; }
.sd-steps i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); }
.sd-steps i.is-on { background: var(--ok); }
.sd-next { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sd-next > div { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 560px) { .goal__text b { font-size: 13px; } }
.sd-next { flex-direction: row !important; text-align: left; align-items: center !important; }

/* ==========================================================================
   CSCA Academy Official Test Layout
   ========================================================================== */

.test-page--csca {
  max-width: 1240px !important;
  margin: 16px auto !important;
  padding: 0 16px 60px !important;
}

.csca-layout {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  align-items: stretch !important;
  width: 100% !important;
}

/* Top Block: Question Display & Options Grid */
.csca-main {
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  min-width: 0 !important;
  background: var(--surface) !important;
  border: var(--bw, 1px) solid var(--line-strong) !important;
  border-radius: 18px !important;
  padding: 28px 32px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
  box-sizing: border-box !important;
}

.csca-main .q-screen {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  margin-bottom: 0 !important;
  min-height: 260px !important;
}

.csca-main .q-screen[hidden] {
  display: none !important;
}

/* Bottom Block: Student Photo/Info + 48-circle Palette */
.csca-sidebar {
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  background: var(--surface) !important;
  border: var(--bw, 1px) solid var(--line-strong) !important;
  border-radius: 18px !important;
  padding: 20px 28px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
  position: static !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  box-sizing: border-box !important;
}

.csca-student-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.csca-student-avatar {
  width: 58px;
  height: 64px;
  border-radius: 8px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

.csca-student-info {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}

.csca-student-info b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

/* 8 columns of circular buttons for the 48 questions */
.csca-grid {
  display: grid !important;
  grid-template-columns: repeat(8, 32px) !important;
  justify-content: space-between !important;
  row-gap: 12px !important;
  padding: 0 !important;
}

.csca-grid button {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 1.5px solid var(--line-strong) !important;
  background: var(--surface) !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: var(--muted) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.12s ease !important;
}

.csca-grid button:hover {
  border-color: #059669 !important;
  color: #059669 !important;
}

.csca-grid button.is-current {
  border: 2px solid #059669 !important;
  color: #059669 !important;
  background: rgba(5, 150, 105, 0.12) !important;
  font-weight: 800 !important;
}

.csca-grid button.is-answered {
  background: #E6F4EA !important;
  border-color: #34A853 !important;
  color: #137333 !important;
}

.csca-grid button.is-marked {
  border-color: #F59E0B !important;
  background: #FEF3C7 !important;
  color: #B45309 !important;
}

/* Right Main Area */
.csca-main {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  background: var(--surface) !important;
  border: var(--bw, 1px) solid var(--line-strong) !important;
  border-radius: 18px !important;
  padding: 28px 32px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
  box-sizing: border-box !important;
}

.csca-main .q-screen {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  margin-bottom: 0 !important;
}

.csca-main .q-screen[hidden] {
  display: none !important;
}

.csca-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.csca-q-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.csca-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.csca-btn-report {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
}
.csca-btn-report:hover {
  background: var(--surface-2);
  color: var(--text);
}

.csca-btn-submit {
  background: #059669 !important;
  color: #FFFFFF !important;
  border: 0 !important;
  font-weight: 700 !important;
  padding: 8px 22px !important;
  border-radius: 999px !important;
  cursor: pointer;
  font-size: 14px;
  transition: opacity 0.15s;
}
.csca-btn-submit:hover {
  opacity: 0.9;
}

.csca-subbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.csca-subbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.csca-btn-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.csca-btn-mark[aria-pressed="true"] {
  color: #F59E0B;
  font-weight: 700;
}

.csca-subbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.csca-btn-nav {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: var(--bw, 1px) solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
.csca-btn-nav:hover:not(:disabled) {
  background: var(--line);
}
.csca-btn-nav--primary {
  background: #2563EB !important;
  color: #FFFFFF !important;
  border-color: #2563EB !important;
}

.csca-timer-display {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  margin-left: 8px;
}

.csca-instruction-banner {
  background: #334155;
  color: #F8FAFC;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
}
[data-theme="dark"] .csca-instruction-banner {
  background: #1E293B;
}

.csca-question-body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 28px;
}

/* 2x2 Clean Horizontal Options Grid */
.csca-options-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  column-gap: 40px !important;
  row-gap: 24px !important;
  margin-top: 12px !important;
}

.csca-option-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 14px !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  border: 1.5px solid transparent !important;
  transition: all 0.15s ease !important;
}

.csca-option-item:hover {
  background: var(--surface-2) !important;
}

.csca-option-item input[type="radio"] {
  width: 18px !important;
  height: 18px !important;
  accent-color: #2563EB !important;
  cursor: pointer !important;
  margin: 0 !important;
  flex: none !important;
}

.csca-option-label {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.csca-option-label .opt-letter {
  font-weight: 700 !important;
  color: var(--muted) !important;
}

.csca-option-item input[type="radio"]:checked ~ .csca-option-label .opt-letter {
  color: #2563EB !important;
}

@media (max-width: 760px) {
  .csca-main {
    padding: 20px 18px !important;
  }
  .csca-sidebar {
    padding: 16px 16px !important;
  }
  .csca-grid {
    grid-template-columns: repeat(8, 28px) !important;
    row-gap: 8px !important;
  }
  .csca-grid button {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    font-size: 11px !important;
  }
  .csca-options-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   Laboratory Journal 4-Column Square Day Cards (Compact Height)
   ========================================================================== */

.jr-grid {
  gap: 14px !important;
}

/* Reduced height & compact padding */
.jr-card {
  padding: 14px 16px !important;
  gap: 8px !important;
  border-radius: 16px !important;
  border: var(--bw, 1px) solid var(--line) !important;
  background: var(--surface) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 200px !important;
  position: relative !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease !important;
}

.jr-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(10, 26, 92, 0.08) !important;
  border-color: var(--line-strong) !important;
}

/* Header */
.jr-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.jr-card__day-badge {
  font-size: 16px !important;
  font-weight: 850 !important;
  letter-spacing: -0.015em !important;
  padding: 5px 12px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
}

.jr-card__date-text {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: var(--text-2) !important;
  white-space: nowrap;
}

/* Day hierarchy: highlight Today only; keep other days neutral */
.jr-day--today {
  background: var(--btn-bg);
  color: var(--btn-text);
}
.jr-card--today {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
}

.jr-day--yesterday,
.jr-day--this-week,
.jr-day--last-week,
.jr-day--older {
  background: var(--surface-2);
  color: var(--text-2);
  border: var(--bw, 1px) solid var(--line);
}

/* Stats (More compact) */
.jr-card__stats {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.jr-card__count {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.jr-card__count b {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}

.jr-card__count span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.jr-card__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.tag--xs {
  font-size: 11px !important;
  padding: 2px 6px !important;
  border-radius: 5px !important;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag--xs > b {
  flex: none;
}

.jr-reasons-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 16px;
}
.jr-reason-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.jr-reason-row .dot {
  transform: translateY(1px);
}
.jr-reason-row__label {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: break-word;
}
.jr-reason-row .num {
  margin-left: auto;
  flex: none;
}

.jr-card__works {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
  margin-bottom: auto;
  max-height: 90px;
  overflow-y: auto;
}

.jr-card__work-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  text-decoration: none;
  color: var(--text);
  font-size: 11.5px;
  transition: background 0.12s ease;
}

.jr-card__work-row:hover {
  background: var(--line);
}

.jr-card__work-kind {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.04em;
  flex: none;
}

.jr-card__work-title {
  flex: 1 1 auto;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  font-weight: 600;
}

.jr-card__work-count {
  flex: none;
  font-weight: 700;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  border: var(--bw, 1px) solid var(--line);
  padding: 0 6px;
  border-radius: 999px;
}

.jr-card__btn {
  margin-top: auto;
  min-height: 36px;
  font-size: 13px;
  font-weight: 700;
}
.jr-card__btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ------------------------------------------------------------
   Investigation Card Enhancement (Modern & Clear)
   ------------------------------------------------------------ */

.jr-shell {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: var(--bw, 1px) solid var(--line);
  border-radius: 22px;
  box-shadow: 0 8px 28px rgba(2, 11, 41, .05);
  padding: clamp(16px, 2.4vw, 26px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.jr-head {
  margin-bottom: 0;
}
.jr-head h1 {
  margin: 0;
}
.jr-head p {
  margin: 4px 0 0;
}
.jr-hero__cta {
  min-height: 44px;
  font-weight: 700;
  border-radius: 999px !important;
}
.jr-hero__cta .ic,
.jr-hero__cta .ic path {
  fill: currentColor;
}
.jr-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.95fr);
  gap: 0;
  padding: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.jr-hero__main {
  padding: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: var(--r);
  min-width: 0;
}
.jr-hero__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--r-sm);
  flex-wrap: wrap;
}
.jr-hero__title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.jr-hero__total {
  border-radius: 999px;
  padding: 4px 10px;
}
.jr-hero__bar {
  display: flex;
  height: 16px;
  border-radius: var(--r-sm);
  overflow: hidden;
  gap: 3px;
  background: var(--surface-2);
}
.jr-hero__seg {
  border: 0;
  padding: 0;
  min-width: 8px;
  cursor: pointer;
  opacity: 0.78;
  transition: opacity 0.15s ease;
}
.jr-hero__seg:hover,
.jr-hero__seg.is-active {
  opacity: 1;
}
.jr-hero__seg:focus-visible,
.jr-reason-chip:focus-visible,
.jr-reason-zero:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.jr-reason-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}
.jr-reason-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: var(--bw, 1px) solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.jr-reason-chip:hover {
  border-color: var(--line-strong);
}
.jr-reason-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.jr-reason-chip .dot,
.jr-reason-zero .dot {
  border-radius: 4px;
}
.jr-reason-chip__label {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.3;
  font-weight: 600;
}
.jr-reason-chip__stat {
  flex: none;
  font-weight: 700;
}
.jr-reason-zeros {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding-top: 4px;
}
.jr-reason-zero {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: var(--bw, 1px) solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.jr-reason-zero:hover,
.jr-reason-zero.is-active {
  border-color: var(--accent);
  color: var(--text);
}
.jr-hero__insight {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: var(--bw, 1px) solid var(--line);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-2);
}
.jr-hero__insight .ic {
  color: var(--accent);
  flex: none;
  margin-top: 2px;
}
.jr-hero__action {
  padding: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface-2);
  border-left: var(--bw, 1px) solid var(--line);
}
.jr-hero__action-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.jr-hero__action-label {
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
}
.jr-hero__action-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.jr-hero__bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.jr-hero__pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.jr-hero__pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: var(--bw, 1px) solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.jr-hero__pill .ic {
  color: var(--muted);
  flex: none;
}
.jr-hero .jr-hero__cta.btn--primary {
  background: var(--btn-bg) !important;
  color: var(--btn-text) !important;
  border-color: var(--btn-bg) !important;
  min-height: 44px;
  font-weight: 700;
  border-radius: 999px !important;
}
.jr-hero .jr-hero__cta.btn--primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent) !important;
}
.jr-hero .jr-hero__cta.btn--primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.jr-hero .jr-hero__cta.btn--primary:disabled {
  opacity: 0.55;
  pointer-events: none;
}
.jr-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.jr-toolbar__left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.jr-main-heading {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.jr-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.jr-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-2);
  margin: 0;
}
.jr-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.jr-card {
  height: 100%;
}
.jr-card__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-height: 24px;
}
@media (max-width: 960px) {
  .jr-hero {
    grid-template-columns: 1fr;
  }
  .jr-hero__action {
    border-left: 0;
    border-top: var(--bw, 1px) solid var(--line);
  }
}

.jr-investigation-card {
  border-radius: 20px !important;
  padding: 22px 24px !important;
  background: linear-gradient(135deg, rgba(43, 96, 229, 0.05) 0%, rgba(21, 56, 147, 0.02) 100%), var(--surface) !important;
  border: 1.5px solid rgba(43, 96, 229, 0.22) !important;
  box-shadow: 0 4px 18px rgba(43, 96, 229, 0.06) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}

.jr-investigation-features {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.jr-inv-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(43, 96, 229, 0.08);
  color: var(--accent);
}

@media (max-width: 1200px) {
  .jr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 860px) {
  .jr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 520px) {
  .jr-grid { grid-template-columns: 1fr !important; }
}

/* ------------------------------------------------------------
   Journal Timeline Section Dividing Headers (Prominent & Clear)
   ------------------------------------------------------------ */

.jr-timeline {
  display: flex !important;
  flex-direction: column !important;
  gap: 44px !important;
  margin-top: 14px !important;
}

.jr-section {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  position: relative !important;
}

.jr-section + .jr-section {
  padding-top: 24px !important;
  border-top: 1.5px dashed var(--line-strong) !important;
}

.jr-section__head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: baseline !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  padding-bottom: 6px !important;
}

.jr-section__title {
  font-size: 26px !important;
  font-weight: 850 !important;
  letter-spacing: -0.025em !important;
  margin: 0 !important;
  color: var(--text) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.jr-section__sub,
.hw-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: var(--bw, 1px) solid var(--line);
  box-shadow: 0 2px 8px rgba(14, 14, 14, .04);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.2;
}
.hw-count-pill {
  padding: 4px 11px;
  background: color-mix(in srgb, var(--pulse, #0F1DF3) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--pulse, #0F1DF3) 22%, var(--line));
}
.jr-section__sub b,
.hw-count-pill b {
  font-weight: 800;
  color: var(--pulse, #0F1DF3);
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .jr-section__sub b,
[data-theme="dark"] .hw-count-pill b {
  color: #7FA3F3;
}
.hw-sub-pill__sep {
  font-style: normal;
  color: var(--line-strong);
}

.dot--section {
  width: 14px !important;
  height: 14px !important;
  border-radius: 50% !important;
  flex: none !important;
  box-shadow: 0 0 0 3px rgba(43, 96, 229, 0.15) !important;
}

.dot--section-recent {
  background: #2B60E5 !important;
}

.dot--section-week {
  background: #3E5170 !important;
  box-shadow: 0 0 0 3px rgba(62, 81, 112, 0.15) !important;
}

.dot--section-month {
  background: #64748B !important;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.15) !important;
}

/* ------------------------------------------------------------
   Section Hierarchy Fix: "Записи" Main Heading Scale
   ------------------------------------------------------------ */

.jr-main-heading {
  font-size: 34px !important;
  font-weight: 850 !important;
  letter-spacing: -0.03em !important;
  margin: 0 !important;
  color: var(--text) !important;
}

/* Secondary Subsection Titles (Недавние записи, 1–2 недели назад...) */
.jr-section__title {
  font-size: 20px !important;
  font-weight: 800 !important;
  letter-spacing: -0.015em !important;
  margin: 0 !important;
  color: var(--text) !important;
}


/* ------------------------------------------------------------
   Sessions Redesign: Tab Navigation & 4-Card Ready Modes
   ------------------------------------------------------------ */

.sessions-tabs-nav {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  border: var(--bw, 1px) solid var(--line);
  padding: 5px;
  border-radius: 16px;
  gap: 6px;
  margin-bottom: 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sessions-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  transition: all .18s cubic-bezier(0.16, 1, 0.3, 1);
}

.sessions-tab-btn:hover,
.sessions-tab-btn:active {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.sessions-tab-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(10, 26, 92, 0.08);
}

[data-theme="dark"] .sessions-tab-btn.is-active {
  background: #192749;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sessions-tab-btn .badge-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(43, 96, 229, 0.12);
  color: #2B60E5;
}

[data-theme="dark"] .sessions-tab-btn .badge-pill {
  background: rgba(157, 184, 242, 0.2);
  color: #9DB8F2;
}

/* 4 Ready Modes Grid */
.ready-modes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1100px) {
  .ready-modes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .ready-modes-grid {
    grid-template-columns: 1fr;
  }
}

.rm-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  min-height: 380px;
}

.rm-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 14px 30px rgba(10, 26, 92, 0.09);
}

.rm-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.rm-card__time {
  font-size: 12.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent);
}

.rm-card__badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.rm-card__header {
  margin-bottom: 14px;
}

.rm-card__title {
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.rm-card__subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin: 0;
  line-height: 1.35;
}

.rm-card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.rm-card__features li {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-2);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.rm-card__features li b {
  color: var(--text);
}

.rm-card__features li .ic {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--ok);
}

.rm-card__fact {
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 16px;
  line-height: 1.4;
  border-left: 3px solid var(--accent);
}

.rm-card__fact b {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 2px;
  color: var(--text-2);
}

.rm-card__form {
  margin-top: auto;
}

.rm-card__btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 750;
  border: 0;
  cursor: pointer;
  transition: transform .12s ease, filter .15s ease, box-shadow .15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.rm-card__btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Card Individual Accents */
.rm-card--franklin .rm-card__time { background: rgba(43, 96, 229, 0.1); color: #2B60E5; }
.rm-card__btn--franklin { background: #2B60E5; color: #FFFFFF; }

.rm-card--feynman .rm-card__time { background: rgba(27, 56, 136, 0.1); color: #1B3888; }
.rm-card__btn--feynman { background: #1B3888; color: #FFFFFF; }

.rm-card--darwin .rm-card__time { background: rgba(46, 71, 125, 0.1); color: #2E477D; }
.rm-card__btn--darwin { background: #2E477D; color: #FFFFFF; }

.rm-card--einstein .rm-card__time { background: rgba(18, 11, 60, 0.1); color: #120B3C; }
.rm-card__btn--einstein { background: #120B3C; color: #FFFFFF; }

[data-theme="dark"] .rm-card--franklin .rm-card__time { background: rgba(43, 96, 229, 0.25); color: #7CA1FF; }
[data-theme="dark"] .rm-card--feynman .rm-card__time { background: rgba(60, 95, 190, 0.25); color: #A0BBFF; }
[data-theme="dark"] .rm-card--darwin .rm-card__time { background: rgba(75, 105, 170, 0.25); color: #B5CBFF; }
[data-theme="dark"] .rm-card--einstein .rm-card__time { background: rgba(120, 140, 220, 0.25); color: #D0DDFF; }

[data-theme="dark"] .rm-card__btn--einstein { background: #2A2454; }

/* Tesla Banner */
.rm-soon-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 14px;
  border: 1.5px dashed var(--line-strong);
  background: var(--surface-2);
  margin-bottom: 28px;
}

.rm-soon-banner__text {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-2);
}

.rm-soon-banner__icon {
  font-size: 20px;
}

.rm-soon-banner__tag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  border: var(--bw, 1px) solid var(--line);
  white-space: nowrap;
}

/* Sessions tab navigation wrapper */
.sessions-tabs-wrap {
  display: flex;
  margin-bottom: -8px;
}

.rm-card__emoji {
  font-size: 22px;
  line-height: 1;
}

/* Custom Session Builder - Balanced Rows Grid */
.sb__row legend {
  font-weight: 750 !important;
  font-size: 13px !important;
  letter-spacing: .05em !important;
  text-transform: uppercase !important;
  color: var(--text-2) !important;
  padding: 0 !important;
  margin-bottom: 8px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.sb__row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.sb__row-header legend {
  margin-bottom: 0 !important;
}

.sb__grid-time {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.sb__grid-level {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.sb__grid-topics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sb__grid-explain {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 520px;
  gap: 8px;
}

.sb__pace {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 5px 12px !important;
  border-radius: 999px !important;
  background: var(--surface-2) !important;
  font-size: 12.5px !important;
  font-weight: 650 !important;
  color: var(--text-2) !important;
  min-height: 28px !important;
}

.sb__pace.is-ok {
  background: rgba(31, 174, 116, 0.12) !important;
  color: #0E6240 !important;
}
[data-theme="dark"] .sb__pace.is-ok {
  background: rgba(31, 174, 116, 0.22) !important;
  color: #72E6B6 !important;
}

.sb__pace.is-tight {
  background: rgba(233, 162, 59, 0.14) !important;
  color: #8C5405 !important;
}
[data-theme="dark"] .sb__pace.is-tight {
  background: rgba(233, 162, 59, 0.25) !important;
  color: #FFC97A !important;
}

.sb__pace.is-bad {
  background: rgba(239, 90, 86, 0.14) !important;
  color: #991B1B !important;
}
[data-theme="dark"] .sb__pace.is-bad {
  background: rgba(239, 90, 86, 0.25) !important;
  color: #FFA5A2 !important;
}

.sb__seg-btn {
  position: relative;
  display: flex;
  width: 100%;
}

.sb__seg-btn input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.sb__seg-btn span {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
  min-height: 46px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}

.sb__seg-btn span small {
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
}

.sb__seg-btn:hover span {
  border-color: var(--text);
}

.sb__seg-btn input:checked + span {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-text);
}

.sb__seg-btn input:checked + span small {
  color: inherit;
  opacity: .85;
}

.sb__seg-btn input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .sb__grid-time {
    grid-template-columns: repeat(4, 1fr);
  }
  .sb__grid-level {
    grid-template-columns: repeat(3, 1fr);
  }
  .sb__grid-topics {
    grid-template-columns: repeat(2, 1fr);
  }
  .sb__grid-explain {
    max-width: none;
  }
}


/* ------------------------------------------------------------
   Recent Sessions: 4-Block Grid (Matching Journal Style)
   ------------------------------------------------------------ */

.sc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1080px) {
  .sc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .sc-grid {
    grid-template-columns: 1fr;
  }
}

.sc-card {
  padding: 14px 16px !important;
  gap: 10px !important;
  border-radius: 16px !important;
  border: var(--bw, 1px) solid var(--line) !important;
  background: var(--surface) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 200px !important;
  position: relative !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease !important;
}

.sc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(10, 26, 92, 0.08) !important;
  border-color: var(--line-strong) !important;
}

.sc-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* the mode name as a coloured label: each mode has its own colour */
.sc-card__mode-badge {
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
  display: inline-flex !important;
  align-items: center !important;
  padding: 5px 10px;
  border-radius: 8px;
  line-height: 1.25;
  background: var(--mode-bg, var(--accent-soft));
  color: var(--mode-ink, var(--accent-ink));
}
.sc-mode--franklin { --mode-bg: #FCE6E6; --mode-ink: #B42323; }   /* weak topics — red */
.sc-mode--darwin   { --mode-bg: #FFEBD9; --mode-ink: #B4500A; }   /* work on mistakes — orange */
.sc-mode--feynman  { --mode-bg: #FDF3D0; --mode-ink: #8A6200; }   /* explain it — yellow */
.sc-mode--tesla    { --mode-bg: #DDF5F1; --mode-ink: #0D7466; }   /* graphs — teal */
.sc-mode--einstein { --mode-bg: #EEE7FD; --mode-ink: #6236C9; }   /* hard problems — purple */
.sc-mode--custom   { --mode-bg: #E3ECFD; --mode-ink: #1F4FC9; }   /* own session — blue */
[data-theme="dark"] .sc-mode--franklin { --mode-bg: #3A1515; --mode-ink: #FF8E8E; }
[data-theme="dark"] .sc-mode--darwin   { --mode-bg: #3A2412; --mode-ink: #FFB273; }
[data-theme="dark"] .sc-mode--feynman  { --mode-bg: #33290F; --mode-ink: #F2CC5C; }
[data-theme="dark"] .sc-mode--tesla    { --mode-bg: #0F2D29; --mode-ink: #63DECB; }
[data-theme="dark"] .sc-mode--einstein { --mode-bg: #261C42; --mode-ink: #BFA5FF; }
[data-theme="dark"] .sc-mode--custom   { --mode-bg: #13234A; --mode-ink: #9DBBFF; }
/* the builder's ready-mode buttons wear the same colours as the session cards */
.cb__preset[class*="sc-mode--"] { background: var(--mode-bg); color: var(--mode-ink); box-shadow: none; }
.cb__preset[class*="sc-mode--"]:hover { box-shadow: inset 0 0 0 1.5px var(--mode-ink); }
.cb__preset[class*="sc-mode--"].is-active { box-shadow: inset 0 0 0 2px var(--mode-ink); }

.sc-card__date-text {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--text-2) !important;
  white-space: nowrap;
}

.sc-card__stats {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.sc-card__score {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.sc-card__score b {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sc-card__total {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.sc-card__percent {
  font-size: 12px;
  font-weight: 800;
  color: var(--ok);
  margin-left: 4px;
}

.sc-card__state-txt {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 2px;
}

.sc-tag--progress {
  color: #D97706 !important;
  border-color: rgba(217, 119, 6, 0.35) !important;
  background: rgba(217, 119, 6, 0.08) !important;
  font-weight: 750 !important;
}

[data-theme="dark"] .sc-tag--progress {
  color: #FBBF24 !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
  background: rgba(251, 191, 36, 0.12) !important;
}

.sc-card__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  justify-content: center;
}

.sc-card__desc {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-2);
}

.sc-card__time-spent {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.sc-card__btn {
  margin-top: 4px;
  font-weight: 700;
}


/* Своя сессия — header, stat cards, filter cards, topic rows */
.cb { display: flex; flex-direction: column; background: var(--surface); border: var(--bw, 1px) solid var(--line); border-radius: 24px; padding: clamp(20px, 3vw, 40px); }
.cb form { display: flex; flex-direction: column; gap: 24px; }
.cb__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.cb__title { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
.cb__lead { margin: 0; color: var(--text-2); max-width: 70ch; }
.cb__presets { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: var(--bw, 1px) solid var(--line); }
.cb__preset, .cb__preset--own > button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-weight: 600; font-size: 14px; color: inherit; cursor: pointer; transition: background .16s ease, color .16s ease, box-shadow .16s ease; }
.cb__preset--own { padding: 0; display: inline-flex; align-items: center; }
.cb__preset--own > button + button { padding: 8px 8px 8px 0; color: var(--text-2); }
.cb__preset:hover, .cb__preset:active, .cb__preset.is-active, .cb__preset--own > button:hover, .cb__preset--own > button:active, .cb__preset--own > button.is-active { background: var(--accent); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.cb__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cb__stat { border: var(--bw, 1px) solid var(--line); border-radius: 18px; padding: 20px 24px; display: flex; flex-direction: column; gap: 6px; }
.cb__eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.cb__big { font-size: 36px; font-weight: 800; line-height: 1.1; color: var(--text); }
.cb__big small { font-size: 18px; margin-left: 4px; color: var(--text-2); }
.cb__sub { color: var(--text-2); font-size: 15px; }
.cb__stat .sb__range { width: 100%; }
.cb__stat .sb__pace { font-size: 13px; }
.cb__sec { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.cb__h { font-size: 24px; font-weight: 800; margin: 0 0 4px; }
.cb__filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cb__filter { border: var(--bw, 1px) solid var(--line); border-radius: 18px; padding: 20px; margin: 0; min-width: 0; }
.cb__filter legend { float: left; width: 100%; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 0;
  font-size: 13px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--text); }
.cb__filter legend .ic { color: var(--accent); }
.cb__chips { clear: both; display: flex; flex-wrap: wrap; gap: 8px; }
.cb-chip input { position: absolute; opacity: 0; pointer-events: none; }
.cb-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; border: var(--bw, 1px) solid var(--line);
  font-weight: 600; font-size: 15px; cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.cb-chip span small { font-weight: 500; opacity: .6; }
.cb-chip span:hover, .cb-chip span:active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.cb-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.cb-chip input:checked + span:hover, .cb-chip input:checked + span:active { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.cb-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cb__note { margin: 10px 0 0; font-size: 13px; color: var(--text-2); }
.cb__topics { display: flex; flex-direction: column; gap: 12px; }
.cb__topic { display: flex; align-items: center; gap: 12px; border: var(--bw, 1px) solid var(--line); border-radius: 18px; padding: 14px 16px 14px 20px; }
.cb__topic:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.cb__topic-main { flex: 1; display: flex; align-items: center; gap: 16px; cursor: pointer; min-width: 0; }
.cb__topic-main input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.cb__topic-main b { display: block; font-size: 17px; }
.cb__topic-main small { color: var(--text-2); font-size: 14px; }
.cb__topic-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--accent); }
.cb__play { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; cursor: pointer;
  border: var(--bw, 1px) solid var(--line); background: var(--surface); color: var(--accent);
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
.cb__play:hover, .cb__play:focus-visible, .cb__play:active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}
.cb__actions .btn--secondary:hover, .cb__actions .btn--secondary:active,
.sc-card__btn.btn--secondary:hover, .sc-card__btn.btn--secondary:active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}
.cb__actions .btn--primary:hover, .cb__actions .btn--primary:active,
.sc-card__btn.btn--primary:hover, .sc-card__btn.btn--primary:active {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 6px 18px color-mix(in srgb, var(--accent) 28%, transparent);
}
.cb__actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; padding-top: 20px; border-top: 1px solid var(--line); }
@media (max-width: 1100px) { .cb__filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .cb__stats, .cb__filters { grid-template-columns: 1fr; } .cb__title { font-size: 26px; } }

/* Своя сессия — compact: the whole builder fits one screen */
.cb { padding: 20px 24px; border-radius: 20px; }
.cb form { gap: 14px; }
.cb__title { font-size: 22px; margin-bottom: 2px; }
.cb__lead { font-size: 14px; }
.cb__sec .cb__lead { display: none; }
.cb__sec { margin-top: 2px; align-items: center; }
.cb__h { font-size: 17px; margin: 0; }
.cb__presets { padding: 3px; }
.cb__preset, .cb__preset--own > button { padding: 6px 10px; font-size: 13px; }
.cb__stats { gap: 12px; }
.cb__stat { padding: 12px 16px; gap: 2px; border-radius: 14px; }
.cb__eyebrow { font-size: 11px; }
.cb__big { font-size: 24px; }
.cb__big small { font-size: 14px; }
.cb__sub { font-size: 13px; }
.cb__filters { gap: 12px; }
.cb__filter { padding: 12px 14px; border-radius: 14px; }
.cb__filter legend { margin-bottom: 8px; font-size: 12px; }
.cb__chips { gap: 6px; }
.cb-chip span { padding: 5px 12px; font-size: 14px; }
.cb__note { margin-top: 6px; font-size: 12px; }
.cb__topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.cb__topic { padding: 6px 8px 6px 12px; border-radius: 12px; gap: 8px; }
.cb__topic-main { gap: 10px; }
.cb__topic-main b { font-size: 14px; line-height: 1.25; }
.cb__topic-main small { font-size: 12px; }
.cb__topic-ic { display: none; }
.cb__play { width: 32px; height: 32px; border-radius: 9px; }
.cb__actions { padding-top: 14px; }
.cb__actions .btn--lg { min-height: 44px; }
/* …and fits a laptop screen (≈ 1440×800) at 100%: title and templates on one row, slider next to the count,
   smaller chips, «Сбросить» next to «Начать сессию» */
.cb { padding: 16px 22px; }
.cb form { gap: 12px; }
.cb__head { flex-wrap: nowrap; align-items: center; }
.cb__head > .cb__title { min-width: 0; }
.cb__lead--wide { max-width: none; margin-top: -6px; }   /* under the title row, one line on a laptop */
.cb__lead { font-size: 13px; line-height: 1.4; }
.cb__presets { flex: none; }
.cb__stat { padding: 10px 16px; }
.cb__count { display: flex; align-items: center; gap: 14px; }
.cb__count .sb__range { flex: 1; min-width: 0; height: 22px; }
.cb__stat .sb__pace { padding: 6px 10px; font-size: 12px; border-radius: 10px; }
.cb__filter { padding: 10px 12px; }
.cb__filter legend { margin-bottom: 6px; }
.cb-chip span { padding: 4px 10px; font-size: 13px; }
.cb__chips { gap: 5px; }
.cb__note { margin-top: 4px; }
.cb__actions { padding-top: 12px; }
.cb__start { margin-left: auto; }
.cb__actions { align-items: center; }
/* filter names readable at a glance */
.cb__filter legend { font-size: 15px; gap: 10px; margin-bottom: 10px; }
.cb__filter legend .ic { width: 20px; height: 20px; }
/* pace hint: small text, small fix chips, same height whatever it says (no jumping) */
.cb__stat .sb__pace { display: flex !important; flex-wrap: wrap; align-content: center; gap: 4px 8px !important; min-height: 56px !important;
  padding: 6px 10px !important; border-radius: 10px !important; font-size: 12px !important; line-height: 1.35; }
.cb__stat .sb__fix { gap: 6px; }
.cb__stat .sb__fix .chip { padding: 2px 10px; min-height: 0; font-size: 12px; line-height: 1.5; }
/* counts like «182 задачи» read better with normal digits (fixed-width ones look like «1 8 2») */
/* the ladder note keeps its place when another level is picked, so the topics below don't jump */
.cb__note[hidden] { display: block !important; visibility: hidden; }
/* questions + time in one block: two sliders side by side, the pace hint across the bottom */
.cb__stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); }
.cb__stat--size { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; }
.cb__stat--size .sb__pace { grid-column: 1 / -1; min-height: 0 !important; }
.cb__slider { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0 14px; }
.cb__slider .cb__eyebrow { grid-column: 1 / -1; }
.cb__slider .cb__big { min-width: 2ch; white-space: nowrap; }
.cb__slider .sb__range { height: 22px; }
.cb__filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .cb__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cb__stat--size { grid-column: 1 / -1; } }
@media (max-width: 760px) { .cb__stats, .cb__filters, .cb__stat--size { grid-template-columns: 1fr; } }
/* topic cards: name and «182 задачи» sit close together */
.cb__topic-main b { line-height: 1.2; }
.cb__topic-main small { display: block; line-height: 1.2; margin-top: 2px; }
/* topic cards: a bit more room — taller cards, larger name, checkbox and ▶ */
.cb__topics { gap: 10px; }
.cb__topic { padding: 12px 12px 12px 16px; min-height: 64px; }
.cb__topic-main { gap: 12px; }
.cb__topic-main b { font-size: 15px; }
.cb__topic-main small { font-size: 13px; }
.cb__topic-main input { width: 20px; height: 20px; }
.cb__play { width: 36px; height: 36px; }
/* Сессии page: the tabs sit 14px above the builder / ready modes (was 48px) */
.sessions-tabs-nav { margin-bottom: 0; }
/* phones: the two tabs share the width (no sideways overflow that zooms the whole page out) */
@media (max-width: 560px) {
  .sessions-tabs-nav { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .sessions-tab-btn { justify-content: center; padding: 9px 8px; font-size: 13px; gap: 6px; text-align: center; }
  .sessions-tab-btn .badge-pill { display: none; }
}
.sessions-tabs-wrap { margin-bottom: -14px; }
@media (max-width: 1100px) { .cb__head { flex-wrap: wrap; } }

/* ---------------------------------------------------------------- home: «Сегодня», free-practice strip, three tiles */
.home-today { gap: 14px; padding: 24px; }
.home-today__head { display: flex; justify-content: space-between; align-items: baseline; }
.home-today__head h2 { margin: 0; font: 800 26px/1.15 var(--font-display); letter-spacing: -.02em; }
.home-today__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.home-today__item { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 10px; }
.home-today__check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line-strong); display: grid; place-items: center; color: #fff; }
.home-today__item.is-done .home-today__check { background: #1E9E6A; border-color: #1E9E6A; }
.home-today__link { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px;
  border: var(--bw, 1px) solid var(--line); background: var(--surface); color: inherit; text-decoration: none; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.home-today__link:hover { border-color: var(--accent); text-decoration: none; }
.home-today__link > .ic:last-child { color: var(--text-2); }
.home-today__item.is-next .home-today__link { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.home-today__item.is-done .home-today__link { opacity: .6; }
.home-today__item.is-done b { text-decoration: line-through; }
.home-today__ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.home-today__text { display: grid; gap: 1px; min-width: 0; }
.home-today__text b { font-size: 15px; }
.home-today__text small { font-size: 12.5px; color: var(--text-2); }
.home-today__go { align-self: flex-start; margin-top: 4px; }
.home-today__done { margin: 0; font-weight: 600; color: #1E9E6A; }

/* Главная: practice goal as one plain row at the end of the page */
.home-goal-row { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 20px; }
.home-goal-row .goal { flex: 1; min-width: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.home-goal-row .goal__set { margin-left: auto; }

.home-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.home-tile { gap: 4px; padding: 20px; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.home-tile:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.home-tile__ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent); }
.home-tile__label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.home-tile__big { font: 800 30px/1.1 var(--font-display); letter-spacing: -.02em; }
.home-tile__sub { font-size: 13px; color: var(--text-2); }
@media (max-width: 760px) { .home-tiles { grid-template-columns: minmax(0, 1fr); } }

/* assistant: next steps, review comments, error reports */
.asst-next { gap: 12px; }
.asst-next__card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px 18px; color: inherit; text-decoration: none; }
.asst-next__card > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.asst-next__card.is-hot { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.asst-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.asst-notes a { color: inherit; text-decoration: none; display: block; padding: 6px 8px; border-radius: 10px; }
.asst-notes a:hover { background: var(--surface-2); }
.fix-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; }
.fix-card__msg { margin: 0; font-weight: 600; }

/* Сегодня (teacher): the day in one row instead of a hero; the class map folds */
.t-today { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)); align-items: center; gap: 8px; padding: 14px 18px; }
.t-today__main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.t-today__main > b { font: 800 44px/1 var(--font-display); color: var(--accent); }
.t-today__main > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.t-today__stat { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 14px; color: inherit; text-decoration: none; border-left: 1px solid var(--line); }
a.t-today__stat:hover { background: var(--surface-2); }
.t-today__stat b { font: 800 24px/1.1 var(--font-display); }
.t-today__stat span { font-size: 13px; color: var(--text-2); }
.t-today__stat.is-hot b { color: var(--accent); }
.t-fold > summary { list-style: none; cursor: pointer; }
.t-fold > summary::-webkit-details-marker { display: none; }
.t-fold > summary::after { content: "▾"; margin-left: 8px; color: var(--text-2); }
.t-fold[open] > summary::after { content: "▴"; }
.t-fold:not([open]) > summary { margin-bottom: 0; }
@media (max-width: 1100px) { .t-today { grid-template-columns: repeat(2, minmax(0, 1fr)); } .t-today__main { grid-column: 1 / -1; } .t-today__stat { border-left: 0; } }

/* question picker (teacher bank, work editor): filters as a row of dropdowns */
.pk-drops { display: flex; flex-wrap: wrap; gap: 8px; }
.pk-drop { position: relative; }
.pk-drop > summary { list-style: none; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px 0 13px;
  border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); font-weight: 650; font-size: 13.5px; cursor: pointer; user-select: none; }
.pk-drop > summary::-webkit-details-marker { display: none; }
.pk-drop > summary svg:last-child { color: var(--muted); transition: transform .15s; }
.pk-drop[open] > summary svg:last-child { transform: rotate(180deg); }
.pk-drop:has(input:checked) > summary { border-color: var(--btn-bg); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.pk-drop__menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; display: flex; flex-wrap: wrap; gap: 8px; min-width: 240px; max-width: 340px;
  padding: 10px; border-radius: 14px; border: var(--bw, 1px) solid var(--line); background: var(--surface); box-shadow: 0 16px 36px rgba(2, 11, 41, .16); }

/* Карта (teacher): closed topics are compact rows, not squares — gaps badge, name, counts, chevron */
.tm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tm-grid .sk-topic > details > summary { aspect-ratio: auto; flex-direction: row; align-items: center; gap: 14px; padding: 12px 16px; }
.tm-grid .sk-topic .bank-topic__text { flex: 1; width: auto; }
.tm-grid .sk-topic .bank-topic__text b { font-size: 16px; }
.tm-grid .sk-topic .bank-topic__chev { position: static; }
@media (max-width: 760px) { .tm-grid { grid-template-columns: minmax(0, 1fr); } }

/* work editor steps */
.we-steps { display: flex; gap: 8px; position: sticky; top: 72px; z-index: 5; padding: 6px; border-radius: 16px; background: var(--surface-2); border: var(--bw, 1px) solid var(--line); width: max-content; max-width: 100%; }
.we-steps button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 0; border-radius: 12px; background: transparent; font: inherit; font-weight: 700; color: var(--text-2); cursor: pointer; }
.we-steps button b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--line); color: var(--text); font-size: 12px; }
.we-steps button.is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(10, 26, 92, .1); }
.we-steps button.is-on b { background: var(--btn-bg); color: var(--btn-text); }

/* Question bank booklet (bank_sheet.html): short questions two in a row, long ones a full row, sheet beside */
.bb-grid .ort-q { border-right: 0; }
.bb-grid .ort-q.bb-left { border-right: 1px solid var(--line); }
.bb-grid .ort-q.bb-wide { grid-column: 1 / -1; }
.bb-grid .ort-q.is-ok { background: var(--ok-soft); }
.bb-grid .ort-q.is-bad { background: var(--bad-soft); }
.bb-options label { display: flex; gap: 6px; align-items: baseline; cursor: pointer; }
.bb-options input { accent-color: var(--accent); margin: 0; flex: none; }
.bb-fb { display: flex; align-items: center; gap: 10px; }
.ort-q.is-ok .bb-fb b { color: var(--ok); }
.ort-q.is-bad .bb-fb b { color: var(--bad); }
.bb-explain { margin: 0; padding: 12px 14px; }
.bb-sheet__rows { display: flex; flex-direction: column; gap: 6px; }
.bb-sheet .ort-sheet__row.is-ok { background: var(--ok-soft); }
.bb-sheet .ort-sheet__row.is-bad { background: var(--bad-soft); }
.bb-check { width: 100%; justify-content: center; margin-top: 14px; }
.bb-pages { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 4px; }
.bb-pages a { flex: none; width: 32px; height: 32px; border-radius: 8px; border: var(--bw, 1px) solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; line-height: 1; color: var(--muted); text-decoration: none; }
.bb-pages a.is-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--text); }
.bb-pages a.is-part { border-color: var(--accent); color: var(--text); }
.bb-pages a.is-current { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-text); }
@media (max-width: 760px) {
  .bb-grid .ort-q.bb-left { border-right: 0; }
}
.bb-pages__gap { flex: none; width: 18px; height: 32px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; color: var(--muted); }
.bb-hint { margin: -4px 0 10px; text-align: center; }
/* the bank page has a tools bar under the header: the sticky sheet starts below both and scrolls inside */
@media (min-width: 1240px) {
  .ort-layout.bb .ort-sheet { top: 140px; max-height: calc(100vh - 160px); }
}
.bb-sheet .ort-sheet__row { gap: 6px; }
.bb-sheet .ort-sheet__num { width: 34px; margin-right: 4px; flex: none; text-align: right; }
.bb-sheet .ort-sheet__input { max-width: 170px; }
/* the booklet always has two columns (the ORT test's comparison grid has three) and room for 3-digit numbers */
.bb-grid, .bb-grid.ort-grid--cmp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bb-grid .ort-q, .bb-grid.ort-grid--cmp .ort-q { grid-template-columns: 46px minmax(0, 1fr); gap: 6px; padding: 18px 20px; box-shadow: none; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) {
  .bb-grid, .bb-grid.ort-grid--cmp { grid-template-columns: minmax(0, 1fr); }
}
@container ort-main (max-width: 700px) {
  .bb-grid, .bb-grid.ort-grid--cmp, .ort-grid { grid-template-columns: minmax(0, 1fr); }
  .bb-grid .ort-q.bb-left, .ort-q:nth-child(odd) { border-right: 0; }
}
@container calc-page (max-width: 820px) {
  .ort-layout.bb { grid-template-columns: minmax(0, 1fr); }
  .ort-layout.bb .ort-main { grid-column: 1; grid-row: auto; }
  .ort-layout.bb .bb-sheet { grid-column: 1; grid-row: auto; position: static; max-height: none; }
  .ort-layout.bb .bb-nav { grid-column: 1; grid-row: auto; }
}
/* the answer sheet is as tall as the question column; the check button, progress and pages sit at its bottom */
@media (min-width: 1240px) {
  .ort-layout.bb { align-items: stretch; }
  .ort-layout.bb .ort-main { display: flex; flex-direction: column; }
  .ort-layout.bb .ort-main .bb-grid { flex: 1; align-content: start; }
  .ort-layout.bb .ort-sheet { position: static; max-height: none; display: flex; flex-direction: column; }
  .ort-layout.bb .bb-progress { margin-top: auto; }
}
/* page switcher under the questions: back · page map · next */
.bb-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0; }
.bb-jump { position: relative; }
.bb-jump > summary { list-style: none; cursor: pointer; font-weight: 700; }
.bb-jump > summary::-webkit-details-marker { display: none; }
.bb-jump__pop { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 30; width: min(560px, 86vw);
  max-height: min(400px, 50vh); overflow: auto; padding: 16px; border-radius: 16px; background: var(--surface); border: var(--bw, 1px) solid var(--line); box-shadow: var(--card-shadow); }
.bb-jump__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-bottom: 12px; }
.bb-jump__grid a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 52px; border-radius: 10px;
  border: var(--bw, 1px) solid var(--line-strong); color: var(--text); text-decoration: none; line-height: 1.1; }
.bb-jump__grid a small { font-size: 11px; color: var(--muted); }
.bb-jump__grid a.is-ok { background: var(--ok-soft); border-color: var(--ok); }
.bb-jump__grid a.is-part { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.bb-jump__grid a.is-current { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-text); }
.bb-jump__grid a.is-current small { color: var(--btn-text); opacity: .8; }
.lg.bb-lg-part { border: 1.5px solid var(--accent); }
.bb-progress { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.bb-progress p { margin: 0; }
@media (min-width: 1240px) {
  .ort-layout.bb .ort-main { grid-column: 1; grid-row: 1; }
  .ort-layout.bb .bb-sheet { grid-column: 2; grid-row: 1; }
  .ort-layout.bb .bb-nav { grid-column: 1; grid-row: 2; margin-top: 0; }
}
.bb-jump__pop { position: absolute; }
.bb-jump__grid { position: relative; }
/* line breaks written in a question (I. / II. / III. lists) show as new lines */
.ort-q__text { white-space: pre-line; }

/* ---------------------------------------------------------------- session bar: white, wordmark in the middle */
.session-bar { position: sticky; background: #FFFFFF; color: var(--text); border-bottom: 1px solid var(--line); overflow: hidden; isolation: isolate; }
.session-bar > :not(.session-bar__brand) { position: relative; z-index: 2; }
.session-bar__brand { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1; pointer-events: none;
  font: 800 26px/1 var(--font-display); letter-spacing: -.02em; white-space: nowrap; }
.session-bar__brand span:nth-child(1) { color: #7FA3F3; }
.session-bar__brand span:nth-child(2) { color: #4275E9; }
.session-bar__brand span:nth-child(3) { color: #2B60E5; }
.session-bar__brand span:nth-child(4) { color: #2456D9; }
.session-bar__brand span:nth-child(5) { color: #153893; }
.session-bar__brand span:nth-child(6) { color: #020B29; }
.session-bar:has(.steps) .session-bar__brand { display: none; }   /* practice sessions keep their progress dots in the middle */
.session-bar .icon-btn { background: #FFFFFF; color: var(--text); border-color: var(--line-strong); }
.session-bar .icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.session-bar .avatar { background: var(--btn-bg); color: var(--btn-text); }
.session-bar .steps span { background: var(--line-strong); }
.session-bar .steps span.is-done { background: var(--accent); }
.session-bar .steps span.is-wrong { background: var(--bad); }
.session-bar .steps span.is-current { background: transparent; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
[data-theme="dark"] .session-bar { background: var(--surface); border-bottom-color: var(--line); }
[data-theme="dark"] .session-bar .icon-btn { background: transparent; color: #F2F2F2; border-color: var(--line-strong); }
[data-theme="dark"] .session-bar__brand span { color: #FFFFFF; }
@media (max-width: 900px) { .session-bar__brand { display: none; } }
/* question selector: two pages — answers and difficulty */
.q-grid-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 12px; background: var(--bg-soft, rgba(10, 26, 92, .06)); }
.q-grid-tabs button { flex: 1; height: 36px; border: 0; border-radius: 9px; background: transparent; font: 700 14px var(--font); color: var(--muted); cursor: pointer; }
.q-grid-tabs button.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(2, 11, 41, .12); }
.q-grid--levels a { border-style: solid; }
.q-grid--levels a.lvl-1, .lg.lvl-1 { background: var(--lvl-1-soft); border: 1.5px solid var(--lvl-1); }
.q-grid--levels a.lvl-2, .lg.lvl-2 { background: var(--lvl-2-soft); border: 1.5px solid var(--lvl-2); }
.q-grid--levels a.lvl-3, .lg.lvl-3 { background: var(--lvl-3-soft); border: 1.5px solid var(--lvl-3); }
/* sheet bottom: progress first, then the check button, always with room above them */
.bb-sheet .bb-progress { padding-top: 18px; }
.bb-sheet .bb-check { margin-top: 14px; }
.view-switch { width: 40px; padding: 0; justify-content: center; }

/* dark theme: crisp neutral dark-gray hairline outlines on controls */
[data-theme="dark"] { --line-strong: #363636; }
[data-theme="dark"] :is(.btn, .icon-btn, .input, .option__box, .q-head, .timer-pill, .bank-timer, .q-grid a, .bb-jump__grid a,
  .bb-pages a, .q-columns, .ort-instruction) { border-width: 1px; }
[data-theme="dark"] .bubble span { border-width: 1px; }


/* selectors stay where they open but are short (three rows, scroll for more), so the question stays visible */
.q-grid-pop .q-grid { max-height: 148px; }
.q-grid-pop .q-grid-tabs { margin-bottom: 10px; }
.q-grid-pop .q-grid-tabs button { height: 30px; }
.bb-jump__pop { max-height: 172px; }

/* every blue button in the app uses one colour: Pulse #0F1DF3 (both themes). --btn-bg covers primary buttons, question
   numbers, badges and current markers; the rules below catch the buttons that had their own blue. */
:root, [data-theme="dark"] { --btn-bg: #0F1DF3; --btn-text: #FFFFFF; --pulse: #0F1DF3; --nav-active-bg: #0F1DF3; --nav-active-text: #FFFFFF; }
.btn--accent { background: var(--pulse); border-color: var(--pulse); color: #FFFFFF; }
.rm-card__btn--franklin { background: var(--pulse); }
.jr-day--today { background: var(--pulse) !important; color: #FFFFFF !important; }
.avatar, .session-bar .avatar, [data-theme="dark"] .avatar { background: var(--pulse); color: #FFFFFF; }
.author .avatar, .hwd__who .avatar { background: #FFFFFF; color: #000000; border: 1px solid var(--line); }
[data-theme="dark"] .author .avatar, [data-theme="dark"] .hwd__who .avatar { background: #000000; color: #FFFFFF; border: 1px solid var(--line); }
.cb-chip input:checked + span { background: var(--pulse); border-color: var(--pulse); color: #FFFFFF; }
body .mt-stage, [data-theme="dark"] body .mt-stage { --mt-here: var(--pulse); }

/* dark theme: every block (cards, panels, filter groups, bars) gets a crisp 1px dark-gray hairline outline */
[data-theme="dark"] { --bw: 1px; }
[data-theme="dark"] :is(.card, .q-card, fieldset, .rail, .hero--home, .mh, .mt-stage, .search, .jr-investigation-card, .empty) {
  border-width: 1px; border-style: solid; border-color: var(--line);
}
[data-theme="dark"] .mt-stage { border: 1px solid var(--line) !important; }
[data-theme="dark"] .jr-investigation-card, [data-theme="dark"] .jr-card--yesterday { border: 1px solid var(--line) !important; }
[data-theme="dark"] .jr-card--today { border: 1px solid var(--line-strong) !important; }
[data-theme="dark"] .daily-t__slot { border-width: 1px; }

/* ---------------------------------------------------------------- session modes as a time scale
   name and points on the left, a bar as long as the session on a 0–30 min scale, a round start button on the right.
   Each bar is in its mode's own colour. */
.ts { background: var(--surface); border: var(--bw, 1px) solid var(--line); border-radius: 22px; padding: 18px 24px 8px; }
.ts__scale, .ts__row { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr) 48px; column-gap: 24px; align-items: center; }
.ts__ticks { position: relative; height: 20px; border-bottom: 1px solid var(--line); }
.ts__ticks span { position: absolute; bottom: 5px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--muted); }
.ts__ticks span:first-child { transform: none; }
.ts__ticks span:last-child { transform: translateX(-100%); }
.ts__ticks i { position: absolute; bottom: -1px; width: 1px; height: 5px; background: var(--line-strong); opacity: .5; }
.ts__item { margin: 0; }
.ts__row { width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit;
  text-align: left; cursor: pointer; border-radius: 0; }
.ts__item:last-child .ts__row { border-bottom: 0; }
.ts__name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ts__name b { font-size: 17px; font-weight: 700; line-height: 1.2; }
.ts__pts { font-size: 13px; line-height: 1.4; color: var(--muted); }
.ts__pts span + span::before { content: " · "; }
.ts__track { position: relative; height: 42px; }
.ts__bar { height: 100%; min-width: 74px; border-radius: 12px; display: flex; align-items: center; gap: 6px; padding: 0 14px;
  transition: filter .15s ease, transform .15s ease; transform-origin: left center; }
.ts__bar b { font: 800 18px/1 var(--font-display); letter-spacing: -.02em; }
.ts__bar small { font-size: 11px; font-weight: 700; opacity: .75; }
.ts__go { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--text); display: grid; place-items: center; justify-self: end;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
button.ts__row:hover .ts__go, button.ts__row:focus-visible .ts__go, button.ts__row:active .ts__go {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
button.ts__row:hover .ts__bar { filter: brightness(1.06); transform: scaleX(1.01); }
button.ts__row:focus-visible { outline: 2px solid var(--pulse); outline-offset: 2px; border-radius: 12px; }
.ts__soon { justify-self: end; font-size: 12px; font-weight: 600; color: var(--muted); border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 12px; }
.ts__row.is-soon { cursor: default; }
.ts__row.is-soon .ts__name { opacity: .6; }
/* each mode in its own colour — the same pair as its tag on the past-session cards */
.ts__bar[class*="sc-mode--"] { background: var(--mode-bg); color: var(--mode-ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--mode-ink) 22%, transparent); }
/* a mode that isn't ready yet: the same colour, striped */
.ts__row.is-soon .ts__bar { background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--surface) 55%, transparent) 8px 16px), var(--mode-bg); }
@media (max-width: 760px) {
  .ts { padding: 6px 16px 4px; }
  .ts__scale { display: none; }
  .ts__row { grid-template-columns: minmax(0, 1fr) 44px; row-gap: 10px; }
  .ts__name { grid-column: 1 / -1; }
  .ts__track { height: 38px; }
}

/* the MONDAY wordmark sits in the middle of every top bar, not only in tests */
.topbar__brand { z-index: 0; pointer-events: auto; text-decoration: none; cursor: pointer; }   /* a link home; tests use the session bar, where the same word is not one */
.topbar > :not(.topbar__brand) { position: relative; z-index: 1; }
@media (max-width: 900px) { .topbar__brand { display: none; } }

/* ================================================================ layout rules (all test-like screens)
   1. one centred frame: tools bar, content and bottom bar line up to the same edges
   2. main column + fixed side column; page-wide things (page navigation) span both
   3. blocks are as tall as their content, side-by-side blocks align to the top
   4. text inside blocks is left-aligned; only a lone status in the middle of a bar is centred
   5. inputs and buttons inside a block fill its width
   6. each piece of information is shown once
   7. spacing from 8 / 16 / 24 / 32, blocks have 24px padding and 24px gaps */
.test-body { --frame: clamp(1120px, 78vw, 1560px); --frame-pad: clamp(16px, 3vw, 64px); }
.bank-body { --frame: clamp(1040px, 78vw, 1480px); }
.test-body:has(.test-page--ort) { --frame: clamp(1440px, 94vw, 2000px); }
.test-body:has(.test-page--csca) { --frame: 1240px; }
.test-body .test-page { max-width: var(--frame); margin-inline: auto; }
@media (min-width: 761px) { .test-body .test-tools, .test-body .test-foot { padding-inline: max(24px, calc((100% - var(--frame)) / 2 + var(--frame-pad))); } }
/* the test title never runs under the wordmark */
@media (min-width: 901px) { .session-bar__left { min-width: 0; max-width: calc(50% - 130px); } }
.session-bar__label { min-width: 0; }
.session-bar__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* booklet: questions | answer sheet, navigation under both */
@media (min-width: 1240px) {
  .ort-layout.bb { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: var(--sheet-gap, 24px); }
  .ort-layout.bb .ort-main { display: block; }
  .ort-layout.bb .ort-main .bb-grid { flex: none; }
  .ort-layout.bb .bb-nav { grid-column: 1 / -1; margin: 0; }
  .ort-layout.bb .bb-progress { margin-top: 0; }
}
.bb-nav { margin: 24px 0 0; }
.bank-nav { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; position: relative; }
/* question player: Назад / counter / Проверить / Далее pinned to the bottom of the screen, no card around them */
.bank-nav.bank-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0; border-radius: 0; box-shadow: none;
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 0; border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.bank-nav.bank-foot > .bank-nav__row { width: 100%; max-width: 840px; margin: 0 auto; }
.has-calc .bank-nav.bank-foot { z-index: 35; }
body:has(.bank-nav.bank-foot) main { padding-bottom: 96px; }
.bank-nav__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.bank-nav__mid { position: relative; display: flex; align-items: center; justify-content: center; }
.bank-nav .q-grid-pop { bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); z-index: 35; }
.bank-scale-wrap { display: flex; flex-direction: column; gap: 6px; }
.bank-scale__head { display: flex; align-items: center; justify-content: flex-end; }
.bank-scale__toggle { background: none; border: 0; padding: 0; font: 600 12px/1.2 var(--font); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.bank-scale__toggle .is-on { color: var(--text); font-weight: 700; }
.bank-scale { display: flex; align-items: center; gap: 3px; width: 100%; }
.bank-scale__seg { flex: 1 1 0; min-width: 2px; height: 8px; border-radius: 999px; background: var(--line-strong); transition: transform .12s, outline-color .12s; }
.bank-scale[data-scale-mode="status"] .bank-scale__seg.is-ok { background: var(--ok); }
.bank-scale[data-scale-mode="status"] .bank-scale__seg.is-bad { background: var(--bad); }
.bank-scale[data-scale-mode="status"] .bank-scale__seg.is-marked:not(.is-ok):not(.is-bad) { background: var(--mark); }
.bank-scale[data-scale-mode="levels"] .bank-scale__seg.lvl-1 { background: var(--lvl-1); }
.bank-scale[data-scale-mode="levels"] .bank-scale__seg.lvl-2 { background: var(--lvl-2); }
.bank-scale[data-scale-mode="levels"] .bank-scale__seg.lvl-3 { background: var(--lvl-3); }
.bank-scale__seg { position: relative; }
.bank-scale__seg::after { content: ""; position: absolute; inset: -14px 0; }
.bank-scale__seg.is-current { outline: 2px solid var(--accent); outline-offset: 1px; transform: translateY(-1px); height: 10px; }
.bank-nav__progress { display: flex; flex-direction: column; gap: 6px; }
.bank-nav__progress p { margin: 0; }
.bank-nav__bar { height: 8px; border-radius: 999px; }
@media (max-width: 760px) {
  .bank-nav__row { justify-content: center; }
  .bank-nav__mid { order: -1; width: 100%; }
  .bank-nav .q-grid-pop { left: 12px; right: 12px; width: auto; transform: none; }
}
.bb-sheet { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.bb-sheet h2 { text-align: left; color: var(--text); margin: 0; }
.bb-sheet .bb-hint { text-align: left; margin: -4px 0 2px; font-size: 12.5px; line-height: 1.35; }
.bb-sheet .ort-sheet__row { padding: 0; }
.bb-sheet .ort-sheet__num { width: auto; min-width: 28px; text-align: left; }
.bb-sheet .ort-sheet__input { max-width: none; flex: 1; min-width: 0; }
.bb-sheet .bb-progress { padding-top: 0; }
.bb-sheet .bb-check { margin-top: 0; }
.bb-note { margin: 0; }
.bank-tools > .row:last-child { grid-column: 3; }
@media (min-width: 1240px) { .ort-layout.bb .bb-sheet { padding: 24px; border-radius: 22px; } }
.bb-grid .ort-q, .bb-grid.ort-grid--cmp .ort-q { padding: 24px; }
@media (min-width: 1061px) {
  .bank-tools { grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); }
  .bank-tools > .row { flex-wrap: nowrap; }
}
/* when the frame is narrow, the left tools show icons only so the bar stays inside the frame */
@media (max-width: 1439px) {
  .bank-tools > .row:first-child .btn-label, .bank-tools > .row:first-child .qr__btn > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bank-tools > .row:first-child .btn--sm { padding-inline: 10px; }
}
/* answer sheets: heading left-aligned in the text colour (the part is already named by the tabs above the questions) */
.ort-sheet h2 { text-align: left; color: var(--text); }
/* CSCA: Question block on top, answer palette on bottom; both stretch to full width */
.test-body:has(.test-page--csca) { --frame: 1240px; --frame-pad: 16px; }
.session-bar__left { flex-wrap: nowrap !important; }
/* a single question inside a card starts at the card's padding, not centred in it, and uses full card width */
.q-card .q-layout--single { margin-inline: 0; max-width: none; }
/* review: every question gets the same block, so moving between them doesn't make the page jump; long ones scroll inside */
@media (min-width: 901px) {
  .rv.is-paged .rv-screen { height: min(var(--rv-h, 70vh), 540px); }
}
@media (min-width: 761px) and (max-width: 900px) {
  .rv.is-paged .rv-screen { height: auto; }
  .rv.is-paged .rv-explain, .rv.is-paged .rv-question { max-height: var(--rv-h, 70vh); }
}
/* the page already leaves room for the bottom bar; extra padding on the body would push the side menu up the screen */
@media (min-width: 761px) { body.has-rv-foot { padding-bottom: 0 !important; } }
/* review footer lines up with the review page's frame (right of the side menu) */
@media (min-width: 761px) {
  .rv-foot { left: var(--rail); --rv-area: calc(100vw - var(--rail));
    padding-inline: max(24px, calc((var(--rv-area) - min(var(--rv-area), clamp(1240px, 90vw, 1880px))) / 2 + clamp(16px, 3vw, 64px))); }
}

/* profile: two columns — identity, teachers and sign-out | settings */
.page--profile { max-width: clamp(1080px, 80vw, 1440px); }
.profile-cols { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.profile-cols__side, .profile-cols__main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.profile-cols__side .profile-head { flex-direction: column; align-items: flex-start; gap: 16px; }
.profile-cols__side .profile-head h1 { font-size: 26px; }
.profile-cols__side #join form.row { flex-wrap: wrap; }
.profile-cols__side #join form .btn { width: 100%; justify-content: center; }
.profile-cols__side > form .btn--danger { width: 100%; justify-content: center; }
@media (max-width: 900px) { .profile-cols { grid-template-columns: minmax(0, 1fr); } }

/* profile settings blocks */
.settings-card { gap: 16px; }
.settings-row { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.settings-row__label { flex: 0 0 140px; font-weight: 700; font-size: 14px; }
.settings-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-chips .cb-chip span { padding: 7px 14px; }
.cb-chip input[type="checkbox"]:checked + span { background: var(--pulse); border-color: var(--pulse); color: #FFFFFF; }
.cb-chip input:checked + span { background: var(--pulse); border-color: var(--pulse); }
.cb-chip input:focus-visible + span { outline: 2px solid var(--pulse); outline-offset: 2px; }
.settings-danger { border-top: 1px solid var(--line); padding-top: 16px; }
.settings-danger > summary { cursor: pointer; font-weight: 700; color: var(--bad); list-style: none; }
.settings-danger > summary::-webkit-details-marker { display: none; }
.settings-danger[open] > summary { margin-bottom: 12px; }
@media (max-width: 560px) { .settings-row__label { flex-basis: 100%; } }

/* larger text: the whole interface scales a little */
html[data-text="large"] body { zoom: 1.1; }
/* less motion: transitions and animations are switched off */
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important;
}

/* ---------------------------------------------------------------- site footer */
.site-foot { margin-top: 32px; border-top: 1px solid var(--line); padding: 32px clamp(16px, 3vw, 64px) calc(24px + env(safe-area-inset-bottom)); }
.site-foot__in, .site-foot__base { max-width: calc(clamp(1180px, 84vw, 1760px) - 2 * clamp(16px, 3vw, 64px)); margin-inline: auto; }
.site-foot__in { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto; gap: 24px; align-items: center; }
.site-foot__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-foot__brand b { display: block; font: 800 18px/1.2 var(--font-display); }
.site-foot__brand div span { display: block; font-size: 13px; color: var(--muted); }
.site-foot__logo { flex: none; margin: 0; width: 40px; height: 40px; font-size: 17px; }
.site-foot__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-foot__links a { font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; }
.site-foot__links a:hover { color: var(--pulse); }
.site-foot__social { display: flex; gap: 8px; }
.site-foot__social .icon-btn:hover { background: var(--pulse); border-color: var(--pulse); color: #FFFFFF; }
.site-foot__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.site-foot__addr { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 900px) {
  .site-foot__in { grid-template-columns: minmax(0, 1fr); }
  .site-foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }  /* room for the phone tab bar */
}
/* pages with a fixed bottom bar (review) keep the footer clear of it */
body:has(.rv-foot) .site-foot { padding-bottom: 96px; }

/* ---------------------------------------------------------------- info pages */
.info-card { gap: 16px; }
.info-card h1 { font-size: 32px; }
.info-card h2 { font-size: 19px; margin-top: 8px; }
.info-card p, .info-list { line-height: 1.6; color: var(--text); }
.info-lead { font-size: 17px; }
.info-list { display: flex; flex-direction: column; gap: 8px; padding-left: 20px; margin: 0; }
.info-contacts { display: flex; flex-wrap: wrap; gap: 8px; }
.info-addr { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.info-public__head { display: flex; justify-content: space-between; align-items: center; padding: 16px clamp(16px, 3vw, 64px); max-width: 900px; margin: 0 auto; }
.info-public__head .rail__logo { margin: 0; text-decoration: none; }
.site-foot .site-foot__logo, .info-public__head .rail__logo { display: grid !important; }  /* the side-menu logo is hidden on phones; these copies stay */

/* ---------------------------------------------------------------- account menu under the avatar */
.acct-menu { position: relative; }
.acct-menu > summary { list-style: none; cursor: pointer; border-radius: 50%; display: block; }
.acct-menu > summary::-webkit-details-marker { display: none; }
.acct-menu > summary:focus-visible { outline: 2px solid var(--pulse); outline-offset: 2px; }
.acct-menu__pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 280px; padding: 16px; display: flex; flex-direction: column; gap: 16px;
  background: var(--surface); border: var(--bw, 1px) solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(10, 10, 40, .14); }
.acct-menu__who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.acct-menu__who > div { min-width: 0; }
.acct-menu__who b { display: block; font-size: 15px; }
.acct-menu__who span:not(.avatar) { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu__out { width: 100%; justify-content: center; }

/* profile as rows of three cards (replaces the two long columns) */
.page--profile { max-width: clamp(1180px, 84vw, 1760px); }
.profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.profile-grid > .card { margin: 0; min-width: 0; }
.profile-grid > .pg-wide { grid-column: span 2; }
.profile-grid .profile-head { flex-direction: column; align-items: flex-start; justify-content: center; gap: 16px; }
.profile-grid .profile-head h1 { font-size: 26px; }
.profile-grid > .card:not(.pg-wide) .grid-2 { grid-template-columns: minmax(0, 1fr); }
.profile-grid .settings-row { flex-direction: column; align-items: flex-start; gap: 8px; }
.profile-grid .settings-row__label { flex: none; }
.profile-grid > .card > div:last-child:has(> .btn[type="submit"]), .profile-grid > form.card > div:last-child { margin-top: auto; }
.profile-grid #join form.row { flex-wrap: wrap; }
.profile-grid #join form .btn { width: 100%; justify-content: center; }
@media (max-width: 1100px) { .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .profile-grid > .pg-wide { grid-column: 1 / -1; } }
@media (max-width: 700px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- settings: shared templated row-card UI across all roles */
.page--settings { max-width: calc(860px + 2 * clamp(16px, 3vw, 64px)); }
.set-hero { display: flex; align-items: center; gap: 22px; padding: 24px 28px; border-radius: 20px; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--card-shadow); }
[data-theme="dark"] .set-hero { box-shadow: none; }
.set-hero__photo { flex: none; }
.set-hero__who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.set-hero__who h1 { font-size: 40px; line-height: 1.1; overflow-wrap: break-word; font-weight: 800; color: inherit; margin: 0; letter-spacing: -.015em; }
.set-hero__who span { color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-hero__badge { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; font-size: 13px; }
.set-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; flex-wrap: wrap; }
.set-tabs a { padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--muted); text-decoration: none; transition: color .14s, background .14s; }
.set-tabs a:hover { color: var(--text); }
.set-tabs a.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
[data-theme="dark"] .set-tabs a.is-active { box-shadow: inset 0 0 0 1px var(--line-strong); }
.set-pane, .set-stack { display: flex; flex-direction: column; gap: 14px; }
.set-pane[hidden] { display: none; }
.set-row { display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-shadow); }
[data-theme="dark"] .set-row { box-shadow: none; }
.set-row__head { display: flex; align-items: center; gap: 10px; }
.set-row__head h3 { font-size: 18px; font-weight: 700; margin: 0; color: var(--text); }
.set-row__desc { margin: 0; color: var(--muted); font-size: 14px; }
.set-line, .set-edit > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.set-line__main { min-width: 0; flex: 1 1 220px; }
.set-line + .set-line,
.set-edit + .set-edit,
.set-line + .set-edit,
.set-edit + .set-line,
.set-stack + .set-line,
form + .set-line { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.set-edit__value { font-size: 15.5px; font-weight: 500; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.set-edit__sub { margin-top: 2px; }
.set-edit > summary { list-style: none; cursor: pointer; }
.set-edit > summary::-webkit-details-marker { display: none; }
.set-edit[open] > summary .btn,
.set-edit[open] > summary .set-btn { display: none; }
.set-edit__form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.set-edit__form :is(.input, .select) { flex: 1 1 220px; min-width: 0; min-height: 42px; }
.set-row--danger { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad) 5%, var(--surface)); }
.set-row--danger .set-row__head { color: var(--bad); }
.set-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 15px; border-radius: 12px; border: 1px solid transparent; font: 600 13.5px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .14s ease, border-color .14s ease, color .14s ease; }
.set-btn:hover { text-decoration: none; }
.set-btn--sm { min-height: 36px; padding: 0 13px; border-radius: 10px; }
.set-btn--primary { background: var(--accent); color: #fff; }
.set-btn--primary:hover { background: var(--accent-strong); }
.set-btn--secondary { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.set-btn--secondary:hover { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 42%, transparent); }
[data-theme="dark"] .set-btn--secondary { background: #1B1B1B; color: #F2F2F2; border-color: #363636; }
[data-theme="dark"] .set-btn--secondary:hover { background: #242424; border-color: #4A4A4A; }
.set-btn--danger { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 26%, transparent); }
.set-btn--danger:hover { background: color-mix(in srgb, var(--bad) 18%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
/* on/off switch */
.set-switch { position: relative; display: inline-flex; cursor: pointer; }
.set-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.set-switch > span { width: 46px; height: 28px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s ease; }
.set-switch > span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; transition: transform .15s ease; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.set-switch input:checked + span { background: var(--pulse); }
.set-switch input:checked + span::after { transform: translateX(18px); }
.set-switch input:focus-visible + span { outline: 2px solid var(--pulse); outline-offset: 2px; }
[data-theme="dark"] .set-switch > span { background: rgba(255, 255, 255, .25); }
@media (max-width: 640px) {
  .set-hero { flex-wrap: wrap; padding: 18px 20px; gap: 14px; }
  .set-row { padding: 18px; }
}

/* session results: facts as chips, a fixed column for tags so the chevrons line up, a «½» mark for hinted answers */
.sd-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sd-facts > span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line); }
.sd-levels { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.tag--warn { background: var(--warn-soft, #FFF3D6); color: #9A6A00; }
[data-theme="dark"] .tag--warn { background: #33290F; color: #F2CC5C; }

/* comparison questions: text, then the two columns, then the four answers two by two */
.q-layout--cmp .q-main { display: flex; flex-direction: column; gap: 20px; }
.q-layout--cmp .q-material { margin: 0; }
.q-layout--cmp .options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .q-layout--cmp .options { grid-template-columns: minmax(0, 1fr); } }
/* the columns read as one table: titles centred over their values, values in one size and weight */
.q-columns__title { text-align: center; }
.q-columns__body { font-weight: 500; font-size: 20px; line-height: 1.4; }
.q-columns__body .katex { font-size: 1.1em; }
/* keyboard focus on an answer: one Pulse border with a soft halo, not a second ring around the grey border */
.option input:focus-visible + .option__box { outline: none; border-color: var(--pulse); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pulse) 22%, transparent); }

/* shared plain results header (sessions & test results) */
.result-header { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 28px; padding: 28px 32px; background: var(--surface); border-radius: var(--r-xl, 22px); }
.result-header__score { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 140px; }
.result-header__pct { font: 800 clamp(52px, 5vw, 72px)/1 var(--font-display); letter-spacing: -.03em; color: var(--text); }
.result-header__sub { font-size: 16px; font-weight: 600; color: var(--muted); }
.result-header__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.result-header__over { font-size: 14px; color: var(--muted); }
.result-header__title { font: 800 clamp(26px, 3vw, 40px)/1.12 var(--font-display); letter-spacing: -.02em; margin: 0; color: var(--text); }
.result-header__time { font-size: 18px; font-weight: 600; color: var(--text-2); }
.result-header__actions { margin-top: 6px; }
.result-header__btn { height: 36px; min-height: 36px; padding: 8px 14px; font-size: 14px; }
@media (max-width: 760px) {
  .result-header { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 22px 20px; }
}

/* results hero: the mode as the title, the time highlighted under it */
.sd-title { font: 700 26px/1.2 var(--font-display); letter-spacing: -.02em; margin: 0; color: var(--text); }
.sd-time { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; margin-top: 8px; padding: 10px 16px; border-radius: 14px;
  background: color-mix(in srgb, var(--pulse) 10%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--pulse) 35%, transparent); color: var(--pulse); font-size: 17px; font-weight: 600; }
.sd-time b { font-weight: 800; }
.sd-hint { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 14px; font-weight: 600; color: var(--muted); }
.result-hero > .stack-sm { display: flex; flex-direction: column; gap: 8px; }
[data-theme="dark"] .sd-time { background: color-mix(in srgb, var(--pulse) 25%, #000); color: #FFFFFF; border-color: var(--pulse); }
@media (max-width: 760px) { .sd-title { font-size: 21px; } }
/* answer rows: mark, tag and chevron all sit on the row's middle line */

/* results: «Что дальше» as action tiles */
.sd-next-actions { display: flex; flex-direction: column; gap: 12px; }
.sd-next-actions .eyebrow { margin: 0; }
.sd-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.sd-actions > form { display: flex; margin: 0; }
.sd-act { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; border-radius: 18px; text-align: left;
  font: inherit; color: var(--text); text-decoration: none; cursor: pointer; background: var(--surface); border: var(--bw, 1px) solid var(--line);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.sd-act .ic { color: var(--pulse); margin-bottom: 6px; }
.sd-act b { font-size: 16px; line-height: 1.25; }
.sd-act > span:last-child { font-size: 13px; color: var(--muted); line-height: 1.35; }
.sd-act:hover { border-color: var(--pulse); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 29, 243, .12); }
.sd-act:focus-visible { outline: 2px solid var(--pulse); outline-offset: 2px; }
.sd-act.is-main { background: var(--pulse); border-color: var(--pulse); color: #FFFFFF; }
.sd-act.is-main .ic, .sd-act.is-main > span:last-child { color: rgba(255, 255, 255, .85); }
.sd-act.is-main:hover { filter: brightness(1.08); box-shadow: 0 12px 28px rgba(15, 29, 243, .3); }
/* answer list without the cross/check column: a thin status line on the left, the tag says the rest */
.sd-next-actions__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sd-next-actions__head a { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--pulse); text-decoration: none; }
.sd-next-actions__head a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- home: dotted sky behind the page, three cards on top */
.page-sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; --sky-ink: 43, 96, 229; }
.page-sky ~ .app { position: relative; z-index: 0; }   /* a script tag sits between them, so not "+": the dots must stay behind the page */
.page-sky .hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
[data-theme="dark"] .page-sky { --sky-ink: 196, 196, 196; }
@media print { .page-sky { display: none; } }
.hc-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.hc { display: flex; flex-direction: column; gap: 20px; padding: 24px; border-radius: 22px; min-width: 0; }
.hc__head { display: flex; align-items: center; gap: 14px; }
.hc__head h2 { margin: 0; font: 800 22px/1.15 var(--font-display); letter-spacing: -.02em; }
.hc__ic { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: #0A0A0A; color: #FFFFFF; }
[data-theme="dark"] .hc__ic { background: #FFFFFF; color: #0A0A0A; }
.hc__count { margin-left: auto; }
.hc__line { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.45; }
.hc__line b { color: var(--text); }
.hc__link { margin-top: auto; align-self: center; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.hc__link:hover { color: var(--pulse); }
.hc__btn { margin-top: auto; align-self: center; min-width: 140px; justify-content: center; }
/* countdown: four boxes, the days a little wider */
.hc-count { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; gap: 8px; }
.hc-count > div { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hc-count b { width: 100%; display: grid; place-items: center; padding: 16px 4px; border-radius: 16px; background: var(--surface); border: var(--bw, 1px) solid var(--line);
  box-shadow: 0 4px 14px rgba(10, 10, 40, .06); font: 800 clamp(24px, 2.3vw, 36px)/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hc-count small { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
/* target score */
.hc-goal { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.hc-goal small { font-size: 14px; color: var(--muted); font-weight: 600; }
.hc-goal > b { font: 800 clamp(56px, 6vw, 84px)/.95 var(--font-display); letter-spacing: -.04em; }
.hc-goal__bar { width: 100%; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.hc-goal__bar i { display: block; height: 100%; background: var(--pulse); border-radius: 4px; }
/* plan card keeps its list, just in the card's spacing */
.hc.home-today { padding: 24px; gap: 16px; }
.hc.home-today .home-today__go { margin-top: auto; }
.home-row--one { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1180px) { .hc-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hc.home-today { grid-column: 1 / -1; } }
@media (max-width: 720px) { .hc-row { grid-template-columns: minmax(0, 1fr); } }
.home-hello { margin: 0; font: 800 clamp(26px, 2.4vw, 34px)/1.1 var(--font-display); letter-spacing: -.02em; }
.hc__head h2 { font-size: 20px; }
.hc__count { white-space: nowrap; align-self: flex-start; padding-top: 4px; }
.hc-strip { margin-top: 4px; }
.hc-goal__stats { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.hc-goal__stats > span { display: flex; flex-direction: column; gap: 2px; padding: 12px 6px; border-radius: 14px; background: var(--surface-2); }
.hc-goal__stats b { font: 800 20px/1 var(--font-display); }
.hc-goal__stats small { font-size: 12px; color: var(--muted); font-weight: 600; }
.hc-goal { flex: 1; justify-content: center; }
.home-portrait { padding: 24px; border-radius: 22px; }

/* collection cards: no description; the test's overall difficulty as a pill next to the question count */
.work-card__count { width: 100%; }
.level-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.level-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.level-pill--1 { background: #E3F6EC; color: #137A4B; }
.level-pill--2 { background: #FFF1D6; color: #9A6A00; }
.level-pill--3 { background: #FDE4E4; color: #B42323; }
[data-theme="dark"] .level-pill--1 { background: #0F2D1F; color: #5BD69A; }
[data-theme="dark"] .level-pill--2 { background: #33290F; color: #F2CC5C; }
[data-theme="dark"] .level-pill--3 { background: #3A1515; color: #FF8E8E; }
.work-card__count .nw { white-space: nowrap; }
.level-pill { white-space: nowrap; flex: none; }

/* home cards, second pass: one-line headers, boxes that fit, one cool palette (Pulse + neutral greys) */
.hc { --hc-soft: #F2F4FA; --hc-soft-line: #E3E7F2; }
[data-theme="dark"] .hc { --hc-soft: #1B1B1B; --hc-soft-line: #262626; }
.hc__head { min-height: 48px; }
.hc__head h2 {
  font-size: 20px;
  min-width: 0;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  line-height: 1.2;
}
.hc__pill { margin-left: auto; flex: none; padding: 5px 12px; border-radius: 999px; background: var(--hc-soft); color: var(--text-2); font-size: 13px; font-weight: 700; white-space: nowrap; }
/* countdown: boxes share the card width exactly; digits sized to the box */
.hc-count { grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 8px; }
.hc-count b { padding: 14px 0; font-size: clamp(20px, 1.9vw, 30px); background: var(--hc-soft); border: 0; box-shadow: none; border-radius: 14px; }
.hc-count small { font-size: 10.5px; letter-spacing: .08em; }
/* Monday calendar in Pulse: past = soft Pulse, this week = Pulse, ahead = neutral */
.hc-strip .home-strip__month small { width: 36px; color: var(--muted); opacity: 1; }
.hc-strip .home-strip__dot { background: var(--hc-soft); border: 0; color: var(--text-2); }
.hc-strip .home-strip__dot.is-past { background: color-mix(in srgb, var(--pulse) 14%, var(--surface)); color: var(--pulse); }
.hc-strip .home-strip__dot.is-now { background: var(--pulse); color: #FFFFFF; box-shadow: 0 0 0 3px color-mix(in srgb, var(--pulse) 25%, transparent); }
[data-theme="dark"] .hc-strip .home-strip__dot.is-past { background: color-mix(in srgb, var(--pulse) 35%, #000); color: #FFFFFF; }
/* target: stats on the same cool grey */
.hc-goal__stats > span { background: var(--hc-soft); }
.hc-goal__bar { background: var(--hc-soft); }
/* today: done = Pulse check, items in neutral boxes, the button stays inside the card */
.hc.home-today .home-today__item.is-done .home-today__check { background: var(--pulse); border-color: var(--pulse); }
.hc.home-today .home-today__check { border-color: var(--hc-soft-line); }
.hc.home-today .home-today__link { border-color: var(--hc-soft-line); }
.hc.home-today .home-today__item.is-next .home-today__link { border-color: var(--pulse); background: color-mix(in srgb, var(--pulse) 6%, var(--surface)); }
.hc.home-today .home-today__ic { background: var(--hc-soft); color: var(--pulse); }
.hc.home-today .home-today__go { align-self: stretch; max-width: 100%; justify-content: center; min-width: 0; }
.home-today__go-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* card titles: a plain semibold sans, icon without a black tile */
.hc__head h2, .home-hello { font-family: "Helvetica Neue", Helvetica, Arial, var(--font); font-weight: 600; letter-spacing: -.01em; }
.hc__head h2 { font-size: 20px; }
.home-hello { font-size: clamp(24px, 2.2vw, 30px); }
.hc__head { min-height: 0; gap: 10px; }
.hc__ic, [data-theme="dark"] .hc__ic { width: auto; height: auto; background: none; color: var(--text-2); border-radius: 0; }

/* home: the three lower cards — title, one line on what it is for, the fact, an action */
.hc-row--tiles { margin-top: 0; }
.hc-tile .hc__ic .ic { --ic: 24px; }
.hc-tile .hc__ic svg { stroke-width: 2.25; }
.hc-tile { color: inherit; text-decoration: none; gap: 14px; transition: border-color .15s ease, transform .15s ease; }
.hc-tile:hover { border-color: var(--pulse); transform: translateY(-2px); text-decoration: none; }
.hc-tile__fact { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--hc-soft); }
.hc-tile__fact b { font-size: 20px; font-weight: 700; }
.hc-tile__fact span { font-size: 14px; color: var(--text-2); }
.hc-tile__go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--pulse); }
.hc__pill--live { display: inline-flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); }
.hc__pill--live i { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }

/* page backgrounds (home sky, Monday scene) sit only in the content area: right of the side menu, under the top bar */
.page-sky { inset: var(--topbar, 72px) 0 0 var(--rail); }
@media (max-width: 760px) { .page-sky { inset: var(--topbar, 56px) 0 0 0; } }
.hc__head { min-height: 32px; }
.hc__pill { line-height: 18px; }
.hc-count { margin: auto 0; }
.hc__line--center { text-align: center; }
.hc-count { margin: auto 0 0; }
.hc-count + .hc__line--center { margin-bottom: auto; }
/* countdown card: the exam and its date up top, highlighted; the timer under it */
.hc-exam { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: auto; padding: 16px; border-radius: 16px; text-align: center;
  background: color-mix(in srgb, var(--pulse) 8%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--pulse) 30%, transparent); }
.hc-exam__name { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pulse); }
.hc-exam { container-type: inline-size; }
.hc-exam__date { font: 800 22px/1.2 var(--font-display); font-size: clamp(18px, 8.4cqi, 28px); letter-spacing: -.03em; color: var(--text); }   /* the countdown digits' font */
[data-theme="dark"] .hc-exam { background: var(--surface-2); border-color: var(--line-strong); }
[data-theme="dark"] .hc-exam__name { color: var(--text-2); }
.hc-exam + .hc-count { margin: 0 0 auto; }
/* home text set tight: tabular digits pad a narrow 1 out to a full digit width ("2 1 4"), so numbers here use their natural
   widths, and the larger headings and facts are tracked in a little */
.hc-count b { font-variant-numeric: normal; }
.hc__head h2, .home-hello { letter-spacing: -.025em; word-spacing: -.06em; }
.hc-tile__fact b { letter-spacing: -.02em; word-spacing: -.06em; }
.hc-goal__stats b { letter-spacing: -.04em; }

/* divider between questions and answer sheet (split.js): a thin grip in the gap, drag it to widen either side */
.split-handle { display: none; }
@media (min-width: 1240px) {
  .ort-layout[data-split] { position: relative; }
  .split-handle { display: flex; align-items: center; justify-content: center; position: absolute; top: 0; height: var(--split-height, 100%); right: var(--split-side, 360px); width: 24px; cursor: col-resize; touch-action: none; z-index: 2; border-radius: 12px; }
  /* the grip stays in view on a tall page and in the middle of a short one; a small arrow on each side of it */
  .split-handle span { position: sticky; top: 160px; bottom: 40px; display: block; width: 4px; height: 56px; border-radius: 4px; background: var(--line-strong); transition: background .15s; }
  .split-handle span::before, .split-handle span::after { content: ""; position: absolute; top: 50%; margin-top: -5px; border-block: 5px solid transparent; transition: border-color .15s; }
  .split-handle span::before { right: 7px; border-right: 6px solid var(--muted); }
  .split-handle span::after { left: 7px; border-left: 6px solid var(--muted); }
  .split-handle:hover span, .split-handle:focus-visible span, .is-splitting .split-handle span { background: var(--accent); }
  .split-handle:hover span::before, .split-handle:focus-visible span::before, .is-splitting .split-handle span::before { border-right-color: var(--accent); }
  .split-handle:hover span::after, .split-handle:focus-visible span::after, .is-splitting .split-handle span::after { border-left-color: var(--accent); }
  .split-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .is-splitting, .is-splitting * { cursor: col-resize !important; user-select: none; }
}
/* the booklet uses more of a wide screen; the number takes only the room it needs, so the text sits next to it */
.page:has(.ort-layout.bb) { max-width: clamp(1180px, 92vw, 1800px); }
.bb-grid .ort-q, .bb-grid.ort-grid--cmp .ort-q { grid-template-columns: max-content minmax(0, 1fr); gap: 12px; }
/* the sheet can be dragged narrow: the check button's label and tick stay on one line inside it */
.bb-sheet .bb-check { font-size: 14px; gap: 6px; padding-inline: 10px; white-space: nowrap; min-height: 44px; }
.bb-sheet .bb-check svg { width: 15px; height: 15px; flex: none; }


/* the answer sheet grows with its panel: everything is sized from two values tied to the panel's width,
   --k (bubble) and --t (text), so dragging the divider scales the whole sheet together */
@media (min-width: 1240px) {
  .ort-layout[data-split] .bb-sheet, .ort-layout[data-split] .ort-side { container-type: inline-size; }
  .ort-layout[data-split="bank"] { --k: clamp(22px, 12cqi, 76px); --t: clamp(14px, 4.4cqi, 26px); --row-gap: calc(var(--k) * .24); --bubble-gap: calc(var(--k) * .2); }
  .ort-layout[data-split="test"] { --k: clamp(24px, 6cqi, 46px); --t: clamp(13px, 3.25cqi, 20px); --row-gap: calc(var(--k) * .1); --bubble-gap: calc(var(--k) * .12); }
  .ort-layout[data-split="test"] .ort-sheet__row:has(.bubble:nth-of-type(5)) { --k: clamp(22px, 5.5cqi, 46px); }

  .ort-layout[data-split] .ort-sheet__row:has(.bubble) .bubble span { width: var(--k); height: var(--k); font-size: calc(var(--k) * .45); }
  .ort-layout[data-split] .ort-sheet__row { gap: var(--bubble-gap); }
  .ort-layout[data-split] .ort-sheet__num { width: calc(var(--k) * 1.1); min-width: 22px; margin-right: calc(var(--k) * .1); flex: none; font-size: calc(var(--t) * 1.2); text-align: left; white-space: nowrap; }
  .ort-layout[data-split] .ort-sheet h2 { font-size: calc(var(--t) * 1.35); }
  .ort-layout[data-split] .ort-sheet__sub, .ort-layout[data-split] .bb-note { font-size: var(--t); }
  .ort-layout[data-split] .bb-hint { font-size: clamp(11.5px, 3.3cqi, 13px); line-height: 1.35; }
  .ort-layout[data-split] .ort-sheet__input { flex: 1; min-width: 0; max-width: none; min-height: max(34px, calc(var(--k) * 1.05)); font-size: var(--t); }

  .ort-layout[data-split="bank"] .bb-sheet { padding: clamp(20px, calc(var(--split-side, 400px) * .06), 36px); }
  .ort-layout[data-split="bank"] .bb-sheet__rows { gap: var(--row-gap); }
  .ort-layout[data-split] .bb-progress p { font-size: var(--t); }
  .ort-layout[data-split] .bb-progress .bar { height: calc(var(--t) * .55); }
  .ort-layout[data-split] .bb-sheet .bb-check { min-height: max(44px, calc(var(--k) * 1.2)); font-size: var(--t); }
  .ort-layout[data-split] .bb-sheet .bb-check .ic { --ic: 1.1em; }
  .ort-layout[data-split] .bb-sheet .bb-check svg { width: 1.1em; height: 1.1em; }

  .ort-layout[data-split="test"] .ort-sheet { padding: clamp(14px, 3.5cqi, 28px); }
  .ort-layout[data-split="test"] .ort-sheet__grid { gap: var(--row-gap) clamp(10px, 2.6cqi, 28px); }
  .ort-layout[data-split="test"] .ort-submit { padding: clamp(12px, 3cqi, 24px) clamp(14px, 3.5cqi, 28px); }
  .ort-layout[data-split="test"] .ort-submit .btn--lg { min-height: max(44px, calc(var(--k) * 1.4)); font-size: calc(var(--t) * 1.2); }
  .ort-layout[data-split="test"] .ort-submit .text-2 { font-size: calc(var(--t) * .92); }
}

/* question player: a slim bottom bar, the session count beside the question counter instead of above it */
@media (min-width: 761px) {
  .bank-foot { padding-top: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .bank-foot .btn { min-height: 38px; padding-inline: 16px; font-size: 14px; border-radius: 10px; }
  .bank-foot__mid { flex-direction: row; gap: 10px; }
  .bank-foot .q-grid-pop { bottom: calc(100% + 18px); }
  .bank-foot__progress { min-height: 38px; padding-inline: 14px; }
}

/* a checked row's colour reaches past the number and the bubbles, so nothing touches its edge; unchecked rows stay in line with the heading */
.bb-sheet .ort-sheet__row { padding: 4px 8px; margin-inline: -8px; }
@media (min-width: 1240px) {
  .ort-layout[data-split] .bb-sheet .ort-sheet__row { padding: calc(var(--k) * .12) calc(var(--k) * .26); margin-inline: calc(var(--k) * -.26); border-radius: calc(var(--k) * .34); }
  .ort-layout[data-split="bank"] { --row-gap: calc(var(--k) * .04); }
}

/* a small dark window that says what a button does, on hover; only where a mouse exists */
.tip-host { display: inline-flex; }
@media (hover: hover) {
  [data-tip] { position: relative; }
  [data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 40; width: max-content; max-width: 240px; padding: 7px 10px; border-radius: 8px; background: var(--text); color: var(--surface); font: 500 12.5px/1.35 var(--font); letter-spacing: 0; text-align: left; white-space: normal; box-shadow: 0 8px 22px rgba(2, 11, 41, .22); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s; }
  [data-tip]:hover::after { opacity: 1; visibility: visible; transition-delay: .15s; }
  .test-tools > .row:first-child [data-tip]::after { left: 0; transform: none; }   /* the bar's ends: stay on the page */
  .test-tools > .row:last-child [data-tip]::after { left: auto; right: 0; transform: none; }
  [data-tip][aria-expanded="true"]::after, .qr[open] > [data-tip]::after { display: none; }   /* its own panel is open */
}

/* booklet: the «Решение» button lights up around its edge on hover */
[data-reveal-btn] { transition: box-shadow .18s ease, border-color .18s ease, background-color .18s ease; }
[data-reveal-btn]:hover, [data-reveal-btn]:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: 0 0 0 1px var(--accent), 0 0 14px 2px color-mix(in srgb, var(--accent) 55%, transparent); filter: none; outline: none; }

/* light theme: filter chips and the sort box sit on the dotted background, so they get a solid fill and a dark outline */
:root:not([data-theme="dark"]) .chip:not(.is-active) { border-color: var(--line-strong); background-color: var(--surface); }
:root:not([data-theme="dark"]) form[role="search"] .select { border-color: var(--line-strong); background-color: var(--surface); }
:root:not([data-theme="dark"]) .chip:not(.is-active):hover { background-color: var(--surface-2); }

/* question player: a reading width for the question; the bars above and below stay full width */
.bank-page .q-screen { width: 100%; max-width: 840px; margin-inline: auto; }

/* formulas open beside the page, not over it: the question moves left and stays readable; small screens keep the overlay */
@media (min-width: 1000px) {
  .has-ref .calc-shift { margin-left: 28px !important; margin-right: calc(var(--ref-w, 420px) + 28px) !important; width: auto !important; max-width: none !important; }
  .has-calc.has-ref .calc-shift { margin-left: calc(var(--calc-w) + 28px) !important; }
  .has-ref .session-bar, .has-ref .test-tools { margin-right: var(--ref-w, 420px); }
  .has-ref .test-foot { right: var(--ref-w, 420px); flex-wrap: nowrap; }
  .has-ref .test-tools, .has-ref .test-foot { padding-inline: 24px; }
  .has-ref .drawer[data-drawer="ref"] { box-shadow: none; }
}

/* night theme: the question block stays frameless like in the day theme; the rule that outlines every card must not reach it */
[data-theme="dark"] .q-card--flat { border: 0; }

/* question player: the open explanation sits on the left and the question moves right, so both stay in view;
   the rule keys on the section being shown, so the existing open and close code drives it */
@media (min-width: 1100px) {
  .bank-page .q-screen:has(> .explain:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; row-gap: 22px; align-items: start; align-content: start; max-width: none; }
  .bank-page .q-screen:has(> .explain:not([hidden])) > * { grid-column: 2; min-width: 0; }
  .bank-page .q-screen:has(> .explain:not([hidden])) .q-layout--cmp .options { grid-template-columns: minmax(0, 1fr); }   /* half a page is too narrow for two columns of answers */
  .bank-page .q-screen > .explain:not([hidden]) { grid-column: 1; grid-row: 1 / span 5; position: sticky; top: 148px; max-height: calc(100vh - 148px - 72px); overflow-y: auto; overscroll-behavior: contain; }
}

/* liquid glass: blocks over the dotted background are see-through and blur what's behind them, so the dots turn into a soft
   glow and never fight the text. Blocks with dropdowns stay as they are: glass would trap a menu under the next block. */
:root { --glass: color-mix(in srgb, var(--surface) 62%, transparent); --glass-soft: color-mix(in srgb, var(--surface) 38%, transparent); --glass-blur: blur(14px) saturate(1.5); }
.page-sky ~ .app :is(.rv-screen, .work-card, .bank-topic, .bk-filter-box, .bk-stat, .mt-stage, .mt-next, .sp-index, .sp-head, .set-hero, .fx-topics, .fx-card, .card:not(:has(details, select))) {
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.page-sky ~ .app .rv-explain { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.page-sky ~ .app .rv-answers > div { background: var(--glass-soft); }
@media (max-width: 760px), (prefers-reduced-transparency: reduce) {
  .page-sky ~ .app :is(.rv-screen, .work-card, .bank-topic, .bk-filter-box, .bk-stat, .mt-stage, .mt-next, .sp-index, .sp-head, .set-hero, .fx-topics, .fx-card, .card:not(:has(details, select))) {
    background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}

/* side menu on wide screens: no box of its own, just the items on the page; phones keep their tab bar */
@media (min-width: 761px) and (min-height: 521px) {
  .rail, [data-theme="dark"] .rail { background: transparent; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* review: a question with its picture and answers fits the block without scrolling; the answer is already on the left */
@media (min-width: 901px) {
  .rv .q-figure img { max-height: 170px; }
  .rv .q-figure__frame { padding: 6px; }
  .rv-question { gap: 10px; padding: 16px 20px; }
  .rv-question .q-text { font-size: 16px; line-height: 1.4; }
  .rv-question .options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .rv-question .option__box { min-height: 42px; padding: 6px 10px; gap: 10px; font-size: 15px; }
  .rv-question .option__letter { width: 26px; height: 26px; font-size: 12px; }
  .rv-question .answer-input .input { min-height: 40px; }
  .rv-question .answer-input + p { display: none; }
}

/* result ring: a soft track and a rounded arc that fills to the score when the page opens */
.score-ring { position: relative; flex: none; width: 176px; height: 176px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.score-ring circle { fill: none; stroke-width: 9; }
.score-ring__track { stroke: color-mix(in srgb, var(--accent) 13%, transparent); }
.score-ring__bar { stroke-linecap: round; stroke-dasharray: var(--p) 100; animation: score-ring-fill .9s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes score-ring-fill { from { stroke-dasharray: 0 100; } }
@media (prefers-reduced-motion: reduce) { .score-ring__bar { animation: none; } }
.score-ring__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.score-ring__value { font: 800 40px/1 var(--font-display); letter-spacing: -.03em; color: var(--text); }
.score-ring__value small { margin-left: 2px; font-size: .5em; font-weight: 700; color: var(--accent); }
.score-ring__label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }

/* calendar: replaces the browser's date popup */
.date-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; }
.date-field svg { flex: none; color: var(--muted); }
.date-field.is-empty span { color: var(--muted); }
.dp { position: fixed; z-index: 80; width: 296px; padding: 14px; border: var(--bw, 1px) solid var(--line); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: 0 18px 44px rgba(2, 11, 41, .18); font-family: var(--font); }
.dp__head { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.dp__title { flex: 1; padding-left: 8px; font-size: 15px; font-weight: 800; }
.dp button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.dp__nav { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; }
.dp__nav:hover { background: var(--surface-2); }
.dp__week, .dp__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); justify-items: center; }
.dp__week { margin-bottom: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: capitalize; }
.dp__days { row-gap: 2px; }
.dp__days button { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dp__days button:hover:not(:disabled) { background: var(--accent-soft); }
.dp__days button:disabled { opacity: .3; cursor: not-allowed; }
.dp__days .is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.dp__days .is-chosen, .dp__days .is-chosen:hover:not(:disabled) { background: var(--pulse); color: #FFFFFF; font-weight: 800; box-shadow: none; }
.dp button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dp__foot { display: flex; justify-content: space-between; margin-top: 10px; padding: 0 2px; }
.dp__foot button { padding: 6px 10px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--accent); }
.dp__foot button:hover { background: var(--accent-soft); }

/* a short screen can't fit every menu item: the menu still scrolls, without a scrollbar beside the buttons */
.rail { scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }

/* tapping the background is part of the Monday test's ripple, and buttons are for pressing: neither should select text */
.mh, .btn, .chip, .rail__item, .bank-play { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }

/* the second subject beside the exam name in the top bar */
.topbar__switch-form { display: inline; margin: 0; }
.topbar__switch { display: inline-block; margin-left: 10px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--accent); font: inherit; letter-spacing: inherit; text-transform: inherit; text-decoration: none; cursor: pointer; }
.topbar__switch:hover { border-color: var(--accent); }

/* session results: each level in its hardness colour */
.sd-level--1 { --lv: var(--ok); --lv-text: var(--ok); }
.sd-level--2 { --lv: #E8A400; --lv-text: var(--warn); }
.sd-level--3 { --lv: var(--bad); --lv-text: var(--bad); }
.sd-level[class*="sd-level--"]:not(.sd-level--top) { border-color: color-mix(in srgb, var(--lv) 40%, var(--line)); }
.sd-level[class*="sd-level--"]:not(.sd-level--top) > .small { color: var(--lv-text); font-weight: 600; }
.sd-level[class*="sd-level--"]:not(.sd-level--top) .sd-bar { background: color-mix(in srgb, var(--lv) 16%, transparent); }
.sd-level[class*="sd-level--"]:not(.sd-level--top) .sd-bar i { background: var(--lv); }

/* Monday formula templates: topics on the left, formulas with worked examples on the right */
.fx-top { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 26px 30px; margin-bottom: 18px; border-radius: 22px;
  background: var(--surface); border: var(--bw, 1px) solid var(--line); box-shadow: 0 4px 16px rgba(2, 11, 41, .05); }
.fx-top h1 { margin: 0; }
.fx-top p { margin: 0; color: var(--text-2); max-width: 720px; }
.fx-tabs { margin: 6px 0 0; padding: 5px; border-radius: 18px; }
.sheet-card__foot { display: flex; justify-content: flex-end; margin: 4px 0 0; }
.sheet-del:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.fx-tabs a { padding: 12px 24px; border-radius: 13px; font-size: 16px; }   /* a little bigger than the settings tabs */
.fx { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.fx-topics { position: sticky; top: 88px; display: grid; gap: 2px; padding: 8px; border: var(--bw, 1px) solid var(--line); border-radius: 16px; background: var(--surface); max-height: calc(100vh - 110px); overflow-y: auto; }
.fx-topics a { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-2); text-decoration: none; }
.fx-topics a:hover { color: var(--text); background: var(--surface-2); }
.fx-topics a.is-active { color: var(--accent); background: var(--accent-soft); }
.fx-topics small { flex: none; font-weight: 600; color: var(--muted); }
.fx-main { display: grid; gap: 14px; min-width: 0; }
.page-head, .fx-head { scroll-margin-top: calc(var(--topbar, 72px) + env(safe-area-inset-top, 0px) + 16px); }
.fx-head { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; text-align: left; }
.fx-head h2 { margin: 0; font-size: 22px; }
.fx-head p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }
.page-head__text--csca { gap: 12px; align-items: flex-start; min-width: 0; max-width: 100%; }
.fx-head--csca > div { min-width: 0; max-width: 100%; }
.page-head__text--csca p,
.fx-head--csca p { width: fit-content; max-width: 100%; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); color: var(--text-2); text-align: left; }
.fx-head--csca p { margin: 12px 0 0; }
.fx-head__tools { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-head__tools form { margin: 0; }
.fx-card { display: grid; gap: 14px; padding: 18px 20px; border: var(--bw, 1px) solid var(--line); border-radius: 18px; background: var(--surface); scroll-margin-top: 90px; }
.fx-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.fx-card__top h3 { margin: 0; font-size: 17px; }
.fx-card__top span.small { color: var(--text-2); }
.fx-card__top form { margin: 0; flex: none; }
.fx-card__formula { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 16px 18px; border-radius: 14px; background: var(--accent-soft); }
.fx-card__formula--split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); align-items: center; gap: 18px; }
.fx-card__formula--split .fx-card__figure { padding: 12px 14px; }
.fx-card__formula--split .fx-card__figure img { width: 100%; max-height: 260px; }
.fx-card__desc { font-size: 14px; line-height: 1.5; color: var(--text-2); margin-top: 6px; }
@media (max-width: 760px) { .fx-card__formula--split { grid-template-columns: minmax(0, 1fr); } }
.fx-card__tex { display: flex; flex-direction: column; gap: 8px; min-width: 0; font-size: 20px; overflow-x: auto; }
.fx-card__eq { min-width: 0; }
.fx-card__figure { position: relative; display: flex; justify-content: center; align-items: center; padding: 14px 16px; border-radius: 12px; background: #FFFFFF; border: var(--bw, 1px) solid var(--line); cursor: zoom-in; }
.fx-card__figure img { width: min(100%, 640px); height: auto; max-height: 340px; object-fit: contain; cursor: zoom-in; display: block; }
.fx-card__zoom { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, .94); border: var(--bw, 1px) solid var(--line); font-size: 12px; font-weight: 600; color: var(--text-2); cursor: zoom-in; }
.fx-card__zoom:hover { border-color: var(--accent); color: var(--accent); }
.fx-card__formula img[src$="trig_signs.svg"] { width: min(100%, 560px); max-height: none; }
.sheet-entry img[src$="trig_signs.svg"] { width: 100%; max-height: 150px; object-fit: contain; }
.fx-examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fx-example { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: var(--bw, 1px) solid var(--line); border-radius: 14px; min-width: 0; }
.fx-example__q { font-size: 18px; line-height: 1.45; font-weight: 700; color: var(--text); }
.fx-example--split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr); gap: 22px; align-items: stretch; padding: 20px 22px; }
.fx-example__left { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fx-example__sol-label { font-size: 15.5px; font-weight: 800; color: var(--text); margin-top: 2px; }
.fx-example__right { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.fx-example__figure { position: relative; display: flex; justify-content: center; align-items: center; width: 100%; padding: 12px 14px; border-radius: 12px; background: #FFFFFF; border: var(--bw, 1px) solid var(--line); cursor: zoom-in; }
.fx-example__figure img { width: 100%; height: auto; max-height: 300px; object-fit: contain; display: block; cursor: zoom-in; }
@media (max-width: 820px) { .fx-example--split { grid-template-columns: minmax(0, 1fr); } }

/* Guided example stepper + programmatic SVG visual panel */
.hl { padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.fx-stepper { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(310px, 0.9fr); gap: 20px; align-items: start; padding: 18px 20px; outline: none; }
@media (max-width: 900px) { .fx-stepper { grid-template-columns: minmax(0, 1fr); } }
.fx-stepper__left { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fx-stepper__task { font-size: 18px; font-weight: 700; line-height: 1.45; color: var(--text); }
.fx-stepper__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--text-2); }
.fx-rule-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 700; text-decoration: none; border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.fx-rule-chip:hover { border-color: var(--accent); text-decoration: none; }
.fx-rule-chip--sm { padding: 2px 8px; font-size: 11.5px; margin-left: 6px; }
.fx-stepper__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; }
.fx-stepper__nav { display: inline-flex; align-items: center; gap: 6px; }
.fx-stepper__steps { display: flex; flex-direction: column; gap: 8px; }
.fx-step { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 6px; transition: opacity .15s, border-color .15s; }
.fx-step[hidden] { display: none; }
.fx-step.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent); }
.fx-step.is-past { opacity: .6; background: var(--surface-2); }
.fx-step__action { font-size: 14px; font-weight: 700; color: var(--text); }
.fx-step__num { color: var(--accent-ink); margin-right: 4px; }
.fx-step__math { font-size: 16px; overflow-x: auto; padding: 2px 0; }
.fx-step__why { font-size: 13.5px; line-height: 1.45; color: var(--text-2); }
.fx-check { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.fx-check__table { width: auto; border-collapse: collapse; font-size: 13px; }
.fx-check__table th, .fx-check__table td { padding: 4px 14px 4px 0; text-align: left; border-bottom: 1px solid var(--line); }
.fx-pitfall { padding: 10px 14px; border-radius: 12px; border-left: 3px solid #E8A400; background: var(--warn-soft); font-size: 13.5px; line-height: 1.45; color: var(--text); }
.fx-answer-card { padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--ok); background: var(--ok-soft); font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fx-stepper__right { display: flex; flex-direction: column; }
.fx-visual-panel { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.fx-visual__formula { text-align: center; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-size: 15px; overflow-x: auto; }
.fx-visual__canvas { position: relative; border-radius: 10px; background: var(--surface); cursor: zoom-in; }
.fx-visual__svg { width: 100%; height: auto; display: block; }
.fx-svg-grid line { stroke: var(--line); stroke-width: 1; }
.fx-svg-axes line { stroke: var(--muted); stroke-width: 1.5; }
.fx-svg-tick { fill: var(--muted); font: 600 11px var(--font); }
.fx-svg-axis-lbl { fill: var(--text-2); font: italic 700 13px var(--font); }
.fx-svg-curve { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; transition: stroke-width .15s; }
.fx-svg-curve.is-hl { stroke-width: 4; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 45%, transparent)); }
.fx-svg-guide { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; }
.fx-svg-halo { fill: color-mix(in srgb, var(--accent) 18%, transparent); }
.fx-svg-hole { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.fx-svg-point { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.fx-svg-label { fill: var(--accent-ink); font: 700 12.5px var(--font); }
.fx-example__text { font-size: 15.5px; line-height: 1.6; color: var(--text-2); }
.fx-example__steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; font-size: 16px; line-height: 1.7; }
.fx-example__use { padding: 8px 12px; border-left: 3px solid var(--accent); border-radius: 4px; font-size: 15.5px; overflow-x: auto; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.fx-example__answer { margin-top: auto; padding-top: 6px; font-size: 16px; line-height: 1.5; }
@media (max-width: 900px) {
  .fx { grid-template-columns: minmax(0, 1fr); }
  .fx-topics { position: static; display: flex; overflow-x: auto; max-height: none; }
  .fx-topics a { flex: none; }
}
@media (max-width: 1100px) { .fx-examples { grid-template-columns: minmax(0, 1fr); } }

/* where a formula sheet shows */
.sheet-places { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-top: 12px; }
.sheet-view__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sheet-view__head h3 { margin: 0; }
.sheet-view.is-off .sheet-view__body { display: none; }
.sheet-view.is-off h3 { color: var(--muted); }
.set-switch--sm > span { width: 36px; height: 22px; }
.set-switch--sm > span::after { left: 3px; top: 3px; width: 16px; height: 16px; }
.set-switch--sm input:checked + span::after { transform: translateX(14px); }


/* a collection with an unfinished attempt: carry on, or start again from zero */
.work-resume { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.work-resume form { margin: 0; display: grid; }
.work-resume .btn { width: 100%; justify-content: center; }
@media (max-width: 560px) { .work-resume { grid-template-columns: 1fr; } }

/* support page (/support) */
.sup-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 20px; align-items: start; }
.sup-side { display: grid; gap: 20px; }
.sup-card { display: flex; flex-direction: column; gap: 14px; padding: clamp(20px, 2.4vw, 28px); }
.sup-card h2 { margin: 0; font-size: 19px; font-weight: 700; }
.sup-sub { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.45; }
.sup-form { display: grid; gap: 14px; }
.sup-form textarea.input { min-height: 120px; padding-block: 12px; resize: vertical; }
.sup-form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.sup-links { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.sup-link { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.sup-link:hover { text-decoration: underline; }
.sup-faq { display: grid; gap: 8px; }
.sup-faq details { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface-2, rgba(43, 96, 229, .04)); }
.sup-faq summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.sup-faq summary::after { content: "+"; color: var(--muted); font-weight: 700; }
.sup-faq details[open] summary::after { content: "−"; color: var(--accent); }
.sup-faq p { margin: 10px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.sup-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.sup-item { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); display: grid; gap: 6px; }
.sup-item__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sup-badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.sup-badge.is-done { background: color-mix(in srgb, var(--ok, #16a34a) 14%, var(--surface)); color: var(--ok, #16a34a); }
.sup-badge.is-rej { background: color-mix(in srgb, var(--bad, #e5484d) 14%, var(--surface)); color: var(--bad, #e5484d); }
.sup-item__msg { margin: 0; font-size: 13.5px; color: var(--text); line-height: 1.4; }
.sup-item__reply { padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); font-size: 13px; color: var(--text); }
.sup-attach-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sup-count { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.sup-drop {
  border: 1.5px dashed var(--line-strong); border-radius: 16px; padding: 14px;
  background: var(--surface-2, rgba(43, 96, 229, .04)); display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  transition: border-color .15s ease, background-color .15s ease;
}
.sup-drop.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.sup-drop__hint { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.sup-pick-btn { min-height: 44px; }
.sup-previews { list-style: none; margin: 2px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.sup-preview { position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.sup-preview__thumb { border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer; display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; }
.sup-preview__thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sup-preview__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sup-preview__meta { padding: 5px 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); border-top: 1px solid var(--line); }
.sup-preview__remove {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text); font-size: 18px; line-height: 1; display: grid; place-items: center; cursor: pointer;
}
.sup-preview__remove:hover, .sup-preview__remove:focus-visible { border-color: var(--bad, #e5484d); color: var(--bad, #e5484d); outline: 2px solid var(--accent); outline-offset: 1px; }
.sup-error {
  padding: 10px 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--bad, #e5484d) 45%, var(--line));
  background: color-mix(in srgb, var(--bad, #e5484d) 12%, var(--surface)); color: var(--bad, #e5484d); font-size: 13.5px; font-weight: 600;
}
.sup-progress { display: grid; gap: 6px; }
.sup-progress__track { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.sup-progress__bar { display: block; height: 100%; width: 0%; background: var(--accent); border-radius: 999px; transition: width .15s ease; }
.sup-progress__label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.sup-item__atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.sup-att-item { position: relative; }
.sup-att-del { position: absolute; top: 4px; right: 4px; margin: 0; }
.sup-att-del button {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--text);
  font-size: 15px; line-height: 1; display: grid; place-items: center; cursor: pointer; padding: 0;
}
.sup-att-del button:hover, .sup-att-del button:focus-visible { border-color: var(--bad, #e5484d); color: var(--bad, #e5484d); outline: 2px solid var(--accent); outline-offset: 1px; }
.sup-att-btn {
  padding: 0; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden;
  width: 82px; height: 64px; background: var(--surface-2); cursor: pointer; display: block;
}
.sup-att-btn:hover, .sup-att-btn:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
.sup-att-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sup-att-deleted { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 10px; border: 1px dashed var(--line-strong); font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .sup-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .sup-form .input, .sup-form .select, .sup-form .textarea { font-size: 16px; }
  .sup-pick-btn, .sup-form__foot .btn { width: 100%; min-height: 46px; }
}

/* buttons only: use the rail active blue (var(--accent-soft) + var(--accent)) instead of solid #0F1DF3 */
.btn--primary,
.btn--accent,
.hero--home .btn--primary,
.chip.is-active,
.cb-chip input:checked + span,
.cb-chip span:hover,
.cb-chip span:active,
.cb__play:hover,
.cb__play:focus-visible,
.cb__play:active,
.cb__preset:hover,
.cb__preset:active,
.cb__preset.is-active,
.cb__preset--own > button:hover,
.cb__preset--own > button:active,
.cb__preset--own > button.is-active,
.cb__actions .btn--secondary:hover,
.cb__actions .btn--secondary:active,
.sc-card__btn.btn--secondary:hover,
.sc-card__btn.btn--secondary:active,
.bank-chip input:checked + span,
.bank-play:hover:not(:disabled),
.seg input:checked + span,
.bubble input:checked + span,
.admin-tabs a.is-active,
.pk-tree__item.is-active,
.bb-pages a.is-current,
.bb-jump__grid a.is-current,
.rm-card__btn--franklin,
.jr-card__btn,
.jr-card--today .jr-card__btn,
.jr-card--yesterday .jr-card__btn,
.jr-card--this-week .jr-card__btn,
.jr-card--last-week .jr-card__btn,
.jr-card--older .jr-card__btn {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  border-color: color-mix(in srgb, var(--accent) 28%, transparent) !important;
}

.btn--primary:hover,
.btn--accent:hover,
.hero--home .btn--primary:hover,
.cb__actions .btn--primary:hover,
.cb__actions .btn--primary:active,
.sc-card__btn.btn--primary:hover,
.sc-card__btn.btn--primary:active {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface)) !important;
  color: var(--accent) !important;
  border-color: color-mix(in srgb, var(--accent) 42%, transparent) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent) !important;
}

/* Clean Question Bank–matched Sessions layout */
.cb--clean {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: var(--bw, 1px) solid var(--line);
  border-radius: 22px;
  box-shadow: 0 8px 28px rgba(2, 11, 41, .05);
  padding: clamp(16px, 2.4vw, 26px);
  display: flex; flex-direction: column; gap: 16px;
}
.cb--clean form { display: flex; flex-direction: column; gap: 14px; }
.cb--clean .cb__head { margin-bottom: 0; }
.cb--clean .cb__title { font-size: 28px; font-weight: 850; letter-spacing: -0.02em; margin: 0 0 4px; }
.cb--clean .cb__lead { font-size: 14px; color: var(--text-2); margin: 0; }
.cb--clean .cb__stats--two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cb--clean .cb__stat {
  background: var(--surface); border: var(--bw, 1px) solid var(--line); border-radius: 18px;
  padding: 16px 20px; box-shadow: 0 4px 16px rgba(2, 11, 41, .04); gap: 6px;
}
.cb--clean .cb__eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.cb--clean .cb__big { font-family: var(--font-display); font-size: 34px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cb--clean .cb__big small { font-size: 16px; font-weight: 700; }
.cb--clean .cb__sub { font-size: 14px; color: var(--text-2); }
.cb--clean .cb__filter-box {
  background: var(--surface); border: var(--bw, 1px) solid var(--line); border-radius: 18px;
  padding: 12px 18px 14px; box-shadow: 0 4px 16px rgba(2, 11, 41, .04);
  display: flex; flex-direction: column; gap: 10px;
}
.cb--clean .cb__sec--filters { align-items: center; margin-top: 0; }
.cb--clean .cb__filter-box__title {
  font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 7px;
}
.cb--clean .cb__filter-box__title svg,
.cb--clean .cb__filter legend svg { stroke-width: 2.3; }
.cb--clean .cb__h { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.cb--clean .cb__filters--four { grid-template-columns: 1.55fr 1.05fr 0.75fr 1.15fr; gap: 10px; }
.cb--clean .cb__filter { padding: 12px 14px; border-radius: 14px; background: var(--surface); }
.cb--clean .cb__filter legend { font-size: 14px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); gap: 7px; margin-bottom: 9px; }
.cb--clean .cb__filter legend .ic { width: 18px; height: 18px; }
.cb--clean .cb-chip span { padding: 6px 13px; font-size: 14px; font-weight: 600; }
.cb--clean .cb__filter--size { display: flex; flex-direction: column; gap: 7px; }
.cb--clean .cb__mini-sliders { clear: both; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cb--clean .cb__mini-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; color: var(--text-2); margin-bottom: 2px; }
.cb--clean .cb__mini-row b { color: var(--text); font-size: 15px; }
.cb--clean .cb__mini-slider .sb__range { width: 100%; height: 16px; }
.cb--clean .cb__pace-inline { font-size: 12.5px; padding: 4px 10px; min-height: 0 !important; border-radius: 8px; }
.cb--clean .cb__topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cb--clean .cb__topic { background: var(--surface); border-radius: 18px; box-shadow: 0 4px 16px rgba(2, 11, 41, .04); }
.cb--clean .cb__topic-main input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 36px; height: 36px; border-radius: 9px; flex: none; margin: 0;
  border: var(--bw, 1px) solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.cb--clean .cb__topic-main input[type="checkbox"]:checked {
  background: var(--accent); border-color: var(--accent);
}
.cb--clean .cb__play svg,
.cb--clean .cb__play svg polygon,
.cb--clean .cb__play svg path { fill: currentColor; }
.cb--clean .cb__actions--end {
  justify-content: space-between; align-items: center; padding: 14px 18px;
  background: var(--surface); border: var(--bw, 1px) solid var(--line); border-radius: 18px;
  box-shadow: 0 4px 16px rgba(2, 11, 41, .04);
}
@media (max-width: 1120px) { .cb--clean .cb__filters--four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .cb--clean .cb__stats--two, .cb--clean .cb__filters--four, .cb--clean .cb__topics, .cb--clean .cb__mini-sliders { grid-template-columns: minmax(0, 1fr); } }


/* ==========================================================================
   CRM / Manager workspace (reuses Monday design tokens: dense, fast, clear status colors)
   ========================================================================== */

.crm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.crm-kpi { padding: 16px 18px; gap: 4px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.crm-kpi:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.crm-kpi--hot { border-color: var(--bad) !important; background: var(--bad-soft) !important; }
.crm-kpi--hot .stat-value { color: var(--bad); }
@media (max-width: 900px) { .crm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.crm-funnel { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.crm-funnel__step {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface-2); text-decoration: none; color: var(--text);
  transition: border-color .15s, background .15s;
}
.crm-funnel__step:hover { border-color: var(--accent); background: var(--surface); text-decoration: none; }
.crm-funnel__n { font-size: 22px; font-weight: 800; line-height: 1.1; }
.crm-funnel__lbl { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 960px) { .crm-funnel { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }

.crm-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.crm-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.crm-status--new { background: var(--accent-soft); color: var(--accent-ink); }
.crm-status--contacted { background: var(--mode-purple-soft); color: #5B2FA6; }
.crm-status--trial_scheduled { background: var(--warn-soft); color: var(--warn); }
.crm-status--trial_done { background: var(--mode-orange-soft); color: #A65209; }
.crm-status--negotiation { background: #E6F4F1; color: #0F6B5B; }
.crm-status--won { background: var(--ok-soft); color: var(--ok); }
.crm-status--lost { background: var(--bad-soft); color: var(--bad); }
[data-theme="dark"] .crm-status--contacted { background: #261842; color: #CBB0FF; }
[data-theme="dark"] .crm-status--trial_done { background: #33200D; color: #FFB673; }
[data-theme="dark"] .crm-status--negotiation { background: #0E2B26; color: #67E3CE; }

.crm-sla { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.crm-sla--hot { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.crm-sla--ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }

.crm-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crm-filters .input--sm, .crm-filters .select--sm { width: auto; min-width: 140px; min-height: 38px; padding: 0 10px; font-size: 13.5px; }
.crm-filters .crm-search { flex: 1 1 220px; min-width: 180px; }

.crm-table th { padding: 10px 12px; font-size: 11.5px; }
.crm-table td { padding: 10px 12px; font-size: 13.5px; }
.crm-inline-select { min-height: 32px; padding: 0 8px; font-size: 12.5px; border-radius: 8px; width: auto; max-width: 165px; }

.crm-split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .crm-split { grid-template-columns: minmax(0, 1fr); } }

.crm-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.crm-timeline__item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.crm-timeline__item:first-child { border-top: 0; padding-top: 0; }
.crm-timeline__badge { padding: 3px 8px; border-radius: 8px; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--text-2); align-self: start; white-space: nowrap; }
.crm-timeline__body { font-size: 14px; line-height: 1.45; white-space: pre-line; }
.crm-timeline__meta { font-size: 12px; color: var(--muted); margin-top: 3px; }

.crm-task { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.crm-task--overdue { border-color: var(--bad); background: var(--bad-soft); }
.crm-task--done { opacity: .6; }
.crm-task__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.crm-board { display: grid; grid-template-columns: repeat(7, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.crm-col { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 220px; }
.crm-col__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.crm-col__cards { display: flex; flex-direction: column; gap: 8px; }
.crm-lead-card { padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.crm-lead-card--hot { border-color: var(--bad); }
.crm-lead-card__name { font-weight: 700; font-size: 14px; color: var(--text); text-decoration: none; }
.crm-lead-card__name:hover { color: var(--accent); }
.crm-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); word-break: break-all; }

@media (max-width: 640px) {
  .crm-board { grid-template-columns: minmax(0, 1fr); overflow-x: visible; }
  .crm-filters .input--sm, .crm-filters .select--sm { width: 100%; }
}

/* Phase A CRM + Academic Multi-View Grids & Attendance Pills */
.crm-board--4 { grid-template-columns: repeat(4, minmax(240px, 1fr)); }
.crm-task-board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 4px; align-items: start; }
@media (max-width: 960px) { .crm-board--4, .crm-task-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .crm-board--4, .crm-task-board { grid-template-columns: minmax(0, 1fr); overflow-x: visible; } }

.crm-meter { height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.crm-meter > span { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.crm-meter--warn > span { background: var(--warn); }
.crm-meter--bad > span { background: var(--bad); }

.acad-week-grid { display: grid; grid-template-columns: repeat(7, minmax(175px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
@media (max-width: 900px) { .acad-week-grid { grid-template-columns: minmax(0, 1fr); overflow-x: visible; } }
.acad-day-col { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 170px; }
.acad-day-col--today { border-color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
.acad-day-col__head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }

.acad-event { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface-2); text-decoration: none; color: var(--text); font-size: 12.5px; transition: border-color .15s, transform .12s; }
.acad-event:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.acad-event--online { border-left-color: var(--accent); background: var(--accent-soft); }
.acad-event--offline { border-left-color: var(--ok); }
.acad-event--conflict { border-color: var(--bad) !important; border-left-width: 4px; background: var(--bad-soft) !important; }
[data-theme="dark"] .acad-event--online { background: #1B1B1B; }

.acad-matrix th.is-sticky, .acad-matrix td.is-sticky { position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--line); min-width: 170px; }
.acad-matrix th.is-sticky { background: var(--surface-2); z-index: 3; }
.acad-matrix td { vertical-align: top; min-width: 155px; }

.att-pills { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.att-pill { position: relative; cursor: pointer; }
.att-pill input { position: absolute; opacity: 0; pointer-events: none; }
.att-pill span { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); transition: background .12s, border-color .12s, color .12s; }
.att-pill input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.att-pill--present input:checked + span { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.att-pill--late input:checked + span, .att-pill--excused input:checked + span { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.att-pill--absent input:checked + span { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }

/* CRM & Academic Solid Workspace Container, 3-Level Hierarchy, High-Contrast Buttons & Fit-to-Screen Grids */
.page.page--wide { max-width: 1440px; padding: 24px 28px 56px; gap: 16px; }
@media (max-width: 1024px) { .page.page--wide { padding: 18px 18px 44px; } }
@media (max-width: 640px) { .page.page--wide { padding: 14px 12px 36px; gap: 12px; } }

.page-sky ~ .app .crm-workspace,
.crm-workspace {
  background: #F6F8FC;
  border: var(--bw, 1px) solid var(--line);
  border-radius: 22px;
  padding: 22px 24px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
[data-theme="dark"] .page-sky ~ .app .crm-workspace,
[data-theme="dark"] .crm-workspace {
  background: var(--surface);
  border-color: var(--line);
}
.crm-detail-page .crm-workspace { gap: 12px; }
.crm-workspace.is-compact { padding: 16px 18px; gap: 10px; }
@media (max-width: 640px) { .page-sky ~ .app .crm-workspace, .crm-workspace { padding: 14px 12px; border-radius: 18px; gap: 12px; } }

.page-sky ~ .app .crm-workspace .card,
.page-sky ~ .app .crm-workspace .table-wrap {
  background: var(--surface);
  border: var(--bw, 1px) solid var(--line);
  border-radius: 18px;
  box-shadow: 0 1px 3px rgba(2, 11, 41, .04);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.page-sky ~ .app .crm-workspace .card {
  padding: 15px 17px;
  gap: 11px;
}
.crm-detail-page .crm-workspace .card { padding: 14px 16px; gap: 10px; }
.crm-detail-page .crm-split { gap: 14px; }
.crm-workspace.is-compact .card { padding: 12px 14px; gap: 8px; border-radius: 14px; }
.crm-workspace.is-compact .crm-split { gap: 12px; }
.crm-workspace.is-compact .crm-table th,
.crm-workspace.is-compact .crm-table td { padding: 7px 10px; font-size: 13px; }
.crm-workspace.is-compact .crm-kpi { padding: 11px 14px; }
[data-theme="dark"] .page-sky ~ .app .crm-workspace .card,
[data-theme="dark"] .page-sky ~ .app .crm-workspace .table-wrap {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}

.page-sky ~ .app .crm-workspace .t-hero-bar { padding-bottom: 12px; border-bottom: 1px solid var(--line); gap: 12px; }
[data-theme="dark"] .page-sky ~ .app .crm-workspace .t-hero-bar { border-bottom-color: var(--line); }

/* High-contrast calm soft-green primary hierarchy inside Manager CRM & Lead Drawer */
.crm-workspace .btn--primary,
.crm-drawer .btn--primary {
  background: #E8F6EE !important;
  color: #116A3F !important;
  border-color: #B6E2C9 !important;
}
.crm-workspace .btn--primary:hover,
.crm-workspace .btn--primary:focus-visible,
.crm-drawer .btn--primary:hover,
.crm-drawer .btn--primary:focus-visible {
  background: #DAF0E3 !important;
  color: #116A3F !important;
  border-color: #96D4B2 !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, #116A3F 14%, transparent) !important;
}
[data-theme="dark"] .crm-workspace .btn--primary,
[data-theme="dark"] .crm-drawer .btn--primary {
  background: rgba(34, 197, 94, 0.16) !important;
  color: #86EFAC !important;
  border-color: rgba(74, 222, 128, 0.35) !important;
}
[data-theme="dark"] .crm-workspace .btn--primary:hover,
[data-theme="dark"] .crm-workspace .btn--primary:focus-visible,
[data-theme="dark"] .crm-drawer .btn--primary:hover,
[data-theme="dark"] .crm-drawer .btn--primary:focus-visible {
  background: rgba(34, 197, 94, 0.24) !important;
  color: #86EFAC !important;
  border-color: rgba(74, 222, 128, 0.5) !important;
}
.crm-workspace .btn--secondary,
.crm-drawer .btn--secondary {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--line-strong) !important;
}
.crm-workspace .btn--secondary:hover,
.crm-workspace .btn--secondary:focus-visible,
.crm-drawer .btn--secondary:hover,
.crm-drawer .btn--secondary:focus-visible {
  background: var(--surface-2) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
[data-theme="dark"] .crm-workspace .btn--secondary,
[data-theme="dark"] .crm-drawer .btn--secondary {
  background: #1B1B1B !important;
  color: #F2F2F2 !important;
  border-color: #363636 !important;
}
[data-theme="dark"] .crm-workspace .btn--secondary:hover,
[data-theme="dark"] .crm-workspace .btn--secondary:focus-visible,
[data-theme="dark"] .crm-drawer .btn--secondary:hover,
[data-theme="dark"] .crm-drawer .btn--secondary:focus-visible {
  background: #242424 !important;
  border-color: #4A4A4A !important;
  color: #F2F2F2 !important;
}
.crm-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}

.crm-workspace .segmented { background: var(--surface); border: var(--bw, 1px) solid var(--line-strong); }
.crm-workspace .segmented a.is-active { background: var(--btn-bg) !important; color: var(--btn-text) !important; }
.crm-workspace .chips .chip {
  background: var(--surface);
  border-color: var(--line-strong);
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
}
.crm-workspace .chips .chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.crm-workspace .chips .chip.is-active {
  background: var(--btn-bg) !important;
  color: var(--btn-text) !important;
  border-color: var(--btn-bg) !important;
}
.crm-workspace .admin-tabs a.is-active {
  background: var(--btn-bg) !important;
  color: var(--btn-text) !important;
  border-color: var(--btn-bg) !important;
}

.crm-workspace .hc__head { min-height: 32px; display: flex; align-items: center; gap: 10px; }
.crm-workspace .hc__ic { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.crm-workspace .hc__head h2 { font-size: 15.5px; font-weight: 700; margin: 0; line-height: 1.2; }
.crm-workspace .hc__pill { padding: 3px 10px; font-size: 12.5px; }

/* Semantic KPI Strip Accents */
.crm-kpis { gap: 12px; }
.crm-kpi { padding: 14px 16px; border-left: 3px solid var(--line-strong); }
.crm-kpi--accent { border-left-color: var(--accent) !important; }
.crm-kpi--accent .eyebrow { color: var(--accent); }
.crm-kpi--ok { border-left-color: var(--ok) !important; }
.crm-kpi--ok .eyebrow { color: var(--ok); }
.crm-kpi--warn { border-left-color: var(--warn) !important; background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)) !important; }
.crm-kpi--warn .eyebrow, .crm-kpi--warn .stat-value { color: var(--warn); }
.crm-kpi--hot { border-left-color: var(--bad) !important; border-color: color-mix(in srgb, var(--bad) 45%, var(--line)) !important; background: color-mix(in srgb, var(--bad-soft) 60%, var(--surface)) !important; }
[data-theme="dark"] .crm-kpi--warn { background: color-mix(in srgb, var(--warn-soft) 70%, var(--surface)) !important; }
[data-theme="dark"] .crm-kpi--hot { background: color-mix(in srgb, var(--bad-soft) 75%, var(--surface)) !important; }

.crm-bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; align-items: start; }
.crm-span-12 { grid-column: span 12; min-width: 0; }
.crm-span-8 { grid-column: span 8; min-width: 0; }
.crm-span-6 { grid-column: span 6; min-width: 0; }
.crm-span-4 { grid-column: span 4; min-width: 0; }
@media (max-width: 1024px) { .crm-span-8, .crm-span-6, .crm-span-4 { grid-column: span 12; } }

/* Leads Filter Bar: Row 1 Quick Status Chips + Row 2 Single Horizontal Toolbar (>=1100px) */
.crm-status-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crm-filter-bar { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px 10px; box-shadow: 0 1px 2px rgba(2, 11, 41, .03); }
[data-theme="dark"] .crm-filter-bar { background: var(--surface); border-color: var(--line); }
.crm-filter-grid { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; }
.crm-filter-grid .crm-filter-search { flex: 1 1 200px; min-width: 170px; min-height: 36px; height: 36px; border-radius: 10px; padding: 0 11px; }
.crm-filter-grid .crm-filter-search input { font-size: 13.5px; }
.crm-filter-grid .select.input--sm { flex: 0 1 155px; min-width: 118px; width: auto; height: 36px; min-height: 36px; font-size: 13px; padding: 0 28px 0 10px; border-radius: 10px; }
.crm-filter-grid .crm-filter-date { flex: 0 0 135px; width: 135px; height: 36px; min-height: 36px; font-size: 13px; padding: 0 8px; border-radius: 10px; }
.crm-filter-grid .btn--min { height: 36px; min-height: 36px; flex: none; padding: 0 12px; }
@media (max-width: 1099px) {
  .crm-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-filter-grid .crm-filter-search { grid-column: 1 / -1; width: 100%; }
  .crm-filter-grid .select.input--sm,
  .crm-filter-grid .crm-filter-date { width: 100%; min-width: 0; }
}
@media (max-width: 640px) { .crm-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 440px) { .crm-filter-grid { grid-template-columns: minmax(0, 1fr); } }

/* Lead Detail Compact Controls & Expandable Activity Note */
.crm-activity-note { min-height: 58px; resize: vertical; transition: min-height .15s ease; }
.crm-activity-note:focus { min-height: 108px; }
.crm-convert-details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.crm-convert-details > summary::-webkit-details-marker { display: none; }
.crm-convert-details > summary::after { content: "▾"; font-size: 13px; color: var(--muted); transition: transform .15s; }
.crm-convert-details[open] > summary::after { transform: rotate(180deg); }
.crm-convert-details[open] > summary { padding-bottom: 10px; border-bottom: 1px solid var(--line); }

/* Manager Account 2-Column Layout */
.crm-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 900px) { .crm-account-grid { grid-template-columns: minmax(0, 1fr); } }
.crm-profile-meta { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
[data-theme="dark"] .crm-profile-meta { background: var(--surface-2); border-color: var(--line); }
.crm-perm-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.crm-perm-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.crm-perm-list li svg { color: var(--ok); flex: none; }
.crm-shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .crm-shortcut-grid { grid-template-columns: minmax(0, 1fr); } }

@media (min-width: 1280px) {
  .crm-board { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; overflow-x: visible; }
  .crm-board--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .crm-col { padding: 10px; gap: 8px; border-radius: 16px; min-height: 180px; }
  .crm-lead-card { padding: 10px; gap: 5px; border-radius: 12px; }
}

.crm-drawer-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(2, 11, 41, .45); backdrop-filter: blur(4px); display: flex; justify-content: flex-end; }
.crm-drawer-backdrop[hidden] { display: none; }
.crm-drawer { width: min(460px, 100vw); height: 100%; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line-strong); padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: -12px 0 40px rgba(2, 11, 41, .2); }
.crm-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }

/* Unified 80% Frosted Rectangular Workspace Shell (adjustable via --shell-alpha) */
.app-shell-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: color-mix(in srgb, var(--surface) calc(var(--shell-alpha, 80) * 1%), transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow: var(--card-shadow);
}
[data-theme="dark"] .app-shell-panel {
  background: color-mix(in srgb, #141414 calc(var(--shell-alpha, 80) * 1%), transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-color: #262626;
  box-shadow: none;
}
@media (max-width: 640px) {
  .app-shell-panel {
    padding: 16px 14px;
    border-radius: 18px;
    gap: 14px;
  }
}

[data-theme="dark"] .app-shell-panel .card,
[data-theme="dark"] .app-shell-panel .people,
[data-theme="dark"] .app-shell-panel .table-wrap,
[data-theme="dark"] .app-shell-panel .admin-tabs,
[data-theme="dark"] .app-shell-panel .empty,
[data-theme="dark"] .app-shell-panel fieldset {
  background: #141414;
  border-color: #262626;
}
[data-theme="dark"] .app-shell-panel .an-live,
[data-theme="dark"] .app-shell-panel .an-row,
[data-theme="dark"] .app-shell-panel .pub-card.is-expanded .pub-work,
[data-theme="dark"] .app-shell-panel .t-tool-link {
  background: #1B1B1B;
  border-color: #262626;
}

/* Shared Shell Opacity Slider (Teacher & Admin Account Settings) */
.shell-row-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.shell-alpha-ctrl { display: inline-flex; align-items: center; gap: 12px; }
.shell-range { width: 170px; accent-color: var(--accent); cursor: pointer; }
.shell-alpha-val { min-width: 44px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }

/* Role badge inside top-right profile popover & Admin Settings 2-column layout matching /manager/account */
.acct-menu__role { display: inline-block; margin-top: 3px; font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.adm-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.adm-account-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 900px) { .adm-account-grid { grid-template-columns: minmax(0, 1fr); } }
.adm-card { display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-shadow); }
[data-theme="dark"] .adm-card { background: #141414; border-color: #262626; box-shadow: none; }
.adm-card__head { display: flex; align-items: center; gap: 10px; }
.adm-card__head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text); }
.adm-card__desc { margin: 0; font-size: 14px; color: var(--muted); }
.adm-row-line, .adm-row-edit > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.adm-row-line + .adm-row-line, .adm-row-line + .adm-row-edit { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.adm-row-val { font-size: 15px; font-weight: 600; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.adm-row-edit > summary { list-style: none; cursor: pointer; }
.adm-row-edit > summary::-webkit-details-marker { display: none; }
.adm-row-edit[open] > summary .adm-btn { display: none; }
.adm-row-edit__form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.adm-row-edit__form .input { flex: 1 1 200px; min-width: 0; min-height: 40px; }
.adm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 15px; border-radius: 12px; border: 1px solid transparent; font: 700 13.5px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .14s ease, border-color .14s ease; }
.adm-btn:hover { text-decoration: none; }
.adm-btn--sm { min-height: 34px; padding: 0 13px; border-radius: 10px; }
.adm-btn--primary { background: #E8F6EE; color: #116A3F; border-color: #B6E2C9; }
.adm-btn--primary:hover { background: #DAF0E3; border-color: #96D4B2; }
[data-theme="dark"] .adm-btn--primary { background: rgba(34, 197, 94, 0.16); color: #86EFAC; border-color: rgba(74, 222, 128, 0.35); }
[data-theme="dark"] .adm-btn--primary:hover { background: rgba(34, 197, 94, 0.24); border-color: rgba(74, 222, 128, 0.5); }
.adm-btn--secondary { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.adm-btn--secondary:hover { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 42%, transparent); }
[data-theme="dark"] .adm-btn--secondary { background: #1B1B1B; color: #F2F2F2; border-color: #363636; }
[data-theme="dark"] .adm-btn--secondary:hover { background: #242424; border-color: #4A4A4A; }
.adm-quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .adm-quick-grid { grid-template-columns: minmax(0, 1fr); } }
.adm-quick-link { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 13.5px; font-weight: 600; text-decoration: none; transition: border-color .14s, background .14s; }
.adm-quick-link:hover { border-color: #96D4B2; background: #E8F6EE; color: #116A3F; text-decoration: none; }
[data-theme="dark"] .adm-quick-link { background: #1B1B1B; border-color: #262626; }
[data-theme="dark"] .adm-quick-link:hover { border-color: rgba(74, 222, 128, .4); background: rgba(34, 197, 94, .14); color: #86EFAC; }

/* Admin role simulation bar + persistent top exit banner */
.adm-sim-bar { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 16px 20px; text-align: left; }
.adm-sim-bar__top { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.adm-sim-bar__info { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.adm-sim-bar__btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adm-sim-bar__btns form, .sim-banner__actions form, .adm-sim-table form { margin: 0; }
.adm-sim-creds { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.adm-sim-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.adm-sim-table th, .adm-sim-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.adm-sim-table tr:last-child td { border-bottom: 0; }
.adm-sim-table code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; padding: 2px 7px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); user-select: all; }
[data-theme="dark"] .adm-sim-table code { background: #1B1B1B; border-color: #262626; }
.sim-banner-host { position: sticky; top: 0; z-index: 120; padding: 8px 14px 0; pointer-events: none; }
.sim-banner {
  pointer-events: auto;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-left: 4px solid #1E9E6A;
  box-shadow: 0 6px 20px rgba(2, 11, 41, .1);
  color: var(--text);
  font-size: 13.5px;
}
[data-theme="dark"] .sim-banner { background: #141414; border-color: #262626; border-left-color: #22C55E; box-shadow: none; }
.sim-banner__who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sim-banner__dot { width: 8px; height: 8px; border-radius: 999px; background: #1E9E6A; flex: none; }
.sim-banner__actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* practice session: same frame as the question bank */
.session-region { display: contents; }
.session-foot__counter { display: inline-flex; align-items: center; padding: 8px 14px; font-weight: 700; }
details.bank-meta > summary { list-style: none; }
details.bank-meta > summary::-webkit-details-marker { display: none; }
.session-after { margin-top: 18px; }

/* booklet: navigation pinned to the bottom, no card */
.bb-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.bb-foot .bank-nav__row { width: 100%; max-width: var(--frame, 1240px); justify-content: space-between; }
.has-calc .bb-foot { z-index: 35; }
.test-body:has(.bb-foot) .test-page { padding-bottom: 110px; }
.bb-foot .q-grid-pop { bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); z-index: 35; }

/* mobile tap targets: at least 36×36 on phones */
@media (max-width: 640px) {
  .hc__link, .sup-link, .legal-links a { display: inline-flex; align-items: center; min-height: 36px; }
  details > summary { padding-block: 8px; }
  .bank-body .bubble span { width: 36px; height: 36px; font-size: 13px; }
  .bank-body .ort-sheet__num { display: inline-flex; align-items: center; justify-content: flex-end; min-height: 36px; min-width: 36px; }
}
@media (max-width: 760px) {
  .set-hero { flex-wrap: wrap; }
  .set-hero__who { flex: 1 1 150px; }
  .set-hero__who h1 { font-size: 30px; }
}

/* JSXGraph in the side pane: like Desmos, the graph fills the room between the expressions and the bottom bar;
   when there is too little room the pane scrolls instead of cutting the graph off */
.calc-pane .desmos-box:has(.jxg-calc) { overflow-y: auto; overscroll-behavior: contain; }
.calc-pane .jxg-calc { min-height: 100%; height: auto; }
.calc-pane .jxg-calc__stage { flex: 1 1 0; min-height: 240px; }
.calc-pane .jxg-calc__board { aspect-ratio: auto; height: auto; min-height: 240px; }
/* long expression lists scroll on their own before they squeeze the graph */
.calc-pane .jxg-calc__list { max-height: 38vh; overflow-y: auto; }
