/* GOM LMS student cabinet: one stylesheet, four cascade layers. A later layer wins over an earlier one
   regardless of selector specificity, so new screen styles override components without !important.
   tokens - named values; base - element defaults; components - classes (R0: in their original order);
   screens - per-screen styles, filled screen by screen during the redesign. */
@layer tokens, base, components, screens;

@layer tokens {
  :root {
    --ink: #171717;
    --accent: #e80827;
    --hover: var(--accent-hover);
    /* Redesign round 2: DESIGN-SPEC (Talia, 17.10.2026), section 1 */
    --accent-hover: #b8061e;
    --accent-press: #9c0519;
    --subtle: #f7f7f5;
    --fill: #efefec;
    --fill-hover: #e5e5e1;
    --fill-press: #dcdcd8;
    --line: #e6e6e3;
    --field: #aaa;
    --current: #fff3f3;
    --success-bg: #e8f5ec;
    --disabled-bg: #ececeb;
    --disabled-ink: #676767;
    --dark: #171717;
    --fs-h1: 28px;
    --fs-h2: 20px;
    --fs-h3: 16px;
    --fs-lead: 19px;
    --fs-read: 18px;
    --fs-ui: 15px;
    --fs-meta: 14px;
    --fs-micro: 12px;
    --radius-card: 8px;
    --ctl-h: 44px;
    --sh-1: 0 1px 2px rgba(23,23,23,.06),0 0 0 1px rgba(23,23,23,.035);
    --sh-2: 0 6px 20px rgba(23,23,23,.08),0 1px 2px rgba(23,23,23,.06);
    --sh-3: 0 12px 32px rgba(23,23,23,.16),0 0 0 1px rgba(23,23,23,.05);
    --ease: cubic-bezier(.2,.7,.2,1);
    --duration-mid: .2s;
    --duration-slow: .6s;
    --page: #f2f2f0;
    --muted: #666464;
    --border: #e1e1e1;
    --surface: #fff;
    --prose: #2b2a20;
    --bottom: 88px;
    --on-dark: #fff;
    --on-dark-muted: #d0d0d0;
    --on-accent: #fcfcfc;
    --muted-alt: #716f6f;
    --dark-raised: #272727;
    --dark-border: #666;
    --danger: #a0061b;
    --success: #1d7a3e;
    --overlay: #0009;
    --black: #000;
    --font-body: Montserrat,Arial,sans-serif;
    --font-display: Unbounded,Arial,sans-serif;
    --font-mono: ui-monospace,Menlo,Consolas,monospace;
    --radius: 6px;
    --radius-round: 50%;
    --shadow-popover: var(--sh-3);
    --duration-fast: .15s;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
  }
}

@layer base {
  * {
    box-sizing: border-box;
  }
  html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
  }
  body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font: 400 16px/1.6 var(--font-body);
  }
  h1,
  h2,
  h3,
  p,
  ul,
  ol,
  figure {
    margin: 0;
  }
  h1,
  h2 {
    font-family: var(--font-display);
    font-weight: 600;
    overflow-wrap: anywhere;
  }
  h1 {
    font-size: 36px;
    line-height: 1.25;
  }
  h2 {
    font-size: 24px;
    line-height: 1.35;
  }
  h3 {
    font-size: 18px;
    line-height: 1.4;
    font-weight: 700;
  }
  p+p {
    margin-top: var(--space-4);
  }
  a {
    color: inherit;
  }
  button,
  input,
  select,
  textarea {
    font: inherit;
    color: inherit;
  }
  button,
  a,
  input,
  select,
  textarea,
  summary {
    -webkit-tap-highlight-color: transparent;
  }
  svg {
    display: inline-block;
    vertical-align: middle;
  }
  input,
  select,
  textarea {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    border: 1px solid #aaa;
    border-radius: var(--radius);
    background: var(--surface);
    padding: 11px var(--space-3);
  }
  textarea {
    min-height: 112px;
    resize: vertical;
  }
  label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-2);
  }
  label:has(input),
  label:has(select) {
    margin: 0;
  }
  fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
  }
  legend {
    font-weight: 600;
    margin-bottom: var(--space-4);
  }
  img {
    max-width: 100%;
    display: block;
  }
  summary {
    cursor: pointer;
    min-height: 44px;
    padding: 10px 0;
  }
  ul,
  ol {
    padding-left: var(--space-5);
  }
  li+li {
    margin-top: var(--space-3);
  }
  @media (max-width:1023px) {
    h1 {
      font-size: 24px;
      line-height: 1.3;
    }
    h2 {
      font-size: 20px;
    }
  }
  @media (max-width:350px) {
    h1 {
      font-size: 22px;
    }
  }
  /* V5b (Taliya ACCEPT-V4 P-v): the page H1 on the screens with the cabinet's header (sign-in, 404, 403, catalog,
     support, project, «Курс ще не відкрито») - 28 / 21 like «Мій кабінет». :where keeps it a plain h1 rule, so the
     certificate, «Курс пройдено», the quiz and the lecture keep their own sizes (components and screens layers) */
  :where(.slim-body, .project-body) h1 {
    font-size: 28px;
    line-height: 1.3;
  }
  @media (max-width:767px) {
    :where(.slim-body, .project-body) h1 {
      font-size: 21px;
    }
  }
  select {
    -webkit-appearance: none;
    appearance: none;
    min-height: 48px;
    padding-right: var(--space-6);
    background-image: linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
    background-position: calc(100% - 17px) 52%,calc(100% - 12px) 52%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
  }
}

@layer components {
  .stack>p+p,
  .card-body>p+p {
    margin-top: 0;
  }
  p.meta+p:not(.meta) {
    margin-top: var(--space-1);
  }
  .stack>.eyebrow {
    margin-bottom: -12px;
  }
  button,
  .button {
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--fill);
    color: var(--ink);
    min-height: var(--ctl-h);
    min-width: 44px;
    padding: 9px 18px;
    font-weight: 600;
    font-size: var(--fs-ui);
    line-height: 1.3;
    transition: background-color var(--duration-fast) var(--ease),color var(--duration-fast) var(--ease),box-shadow var(--duration-fast) var(--ease),transform var(--duration-fast) var(--ease);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    gap: var(--space-2);
    justify-content: center;
    align-items: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  button:hover,
  .button:hover {
    background: var(--fill-hover);
  }
  button:active,
  .button:active {
    background: var(--fill-press);
    transform: translateY(1px);
  }
  button.primary,
  .button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
  }
  button.primary:hover,
  .button.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
  }
  button.primary:active,
  .button.primary:active {
    background: var(--accent-press);
    border-color: var(--accent-press);
  }
  button.tertiary,
  .button.tertiary {
    background: transparent;
  }
  button.tertiary:hover,
  .button.tertiary:hover {
    background: var(--fill);
  }
  button.tertiary:active,
  .button.tertiary:active {
    background: var(--fill-hover);
  }
  button.small,
  .button.small {
    min-height: 36px;
    padding: 6px 12px;
    font-size: var(--fs-meta);
  }
  button.dark {
    background: var(--ink);
    color: var(--on-dark);
    border-color: var(--ink);
  }
  button:disabled {
    cursor: default;
    background: var(--disabled-bg);
    color: var(--disabled-ink);
    border-color: transparent;
    transform: none;
  }
  button.text {
    background: transparent;
    border-color: transparent;
    text-decoration: underline;
    text-underline-offset: 4px;
  }
  button.icon {
    padding: 10px;
    flex-shrink: 0;
  }
  button.active {
    border-color: var(--ink);
    box-shadow: inset 0 -3px var(--ink);
  }
  button svg,
  .button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
  input[type=range] {
    padding: 0;
    border: 0;
    accent-color: var(--accent);
    min-width: 0;
  }
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  button:focus-visible,
  a:focus-visible,
  summary:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
  }
  .darkbar :focus-visible,
  .player :focus-visible {
    outline-color: var(--on-dark);
  }
  .container {
    width: min(1320px,calc(100% - 120px));
    margin-inline: auto;
    min-width: 0;
  }
  .top {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .top-inner {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    min-height: 80px;
    padding-block: var(--space-3);
    flex-wrap: wrap;
  }
  .brand {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    min-width: 92px;
    flex-shrink: 0;
  }
  .brand img {
    width: 92px;
    height: auto;
  }
  .top-title {
    flex: 1;
    min-width: 140px;
    font-weight: 600;
  }
  .top-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-left: auto;
  }
  .top-actions .support {
    max-width: none;
    white-space: nowrap;
  }
  .darkbar {
    background: var(--ink);
    color: var(--on-dark);
    padding: var(--space-6) 0;
  }
  .darkbar .eyebrow {
    color: #ddd;
  }
  .navtabs {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-5);
  }
  .navtabs button {
    background: transparent;
    color: var(--on-dark);
    border-color: var(--dark-border);
    min-width: 145px;
  }
  .navtabs button.active {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--on-dark);
    box-shadow: none;
  }
  .page {
    padding-block: 40px var(--space-8);
    min-height: 50vh;
  }
  .stack {
    display: grid;
    gap: var(--space-5);
  }
  .gap-sm {
    gap: var(--space-3);
  }
  .row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
  }
  .between {
    justify-content: space-between;
  }
  .panel {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: var(--space-5);
    min-width: 0;
    border-radius: var(--radius);
  }
  .read {
    max-width: 760px;
    margin-inline: auto;
  }
  .form-width {
    max-width: 520px;
    margin-inline: auto;
  }
  .eyebrow {
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: var(--space-3);
  }
  .meta {
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
  }
  .muted {
    color: var(--muted);
  }
  .error {
    color: var(--danger);
    font-size: 16px;
  }
  .error:empty {
    display: none;
  }
  .notice {
    padding: var(--space-4);
    border: 1px solid var(--border);
    background: #f8f8f6;
  }
  .success {
    border-left: 4px solid var(--ink);
  }
  .badge {
    display: inline-block;
    font-size: 14px;
    line-height: 1.5;
    padding: 5px var(--space-2);
    background: #eeeeec;
    font-weight: 600;
  }
  .option-label {
    background: #fff1e5;
    border: 1px solid #9f5e20;
    padding: var(--space-4);
    font-weight: 700;
  }
  .courses {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: var(--space-5);
  }
  .course-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .cover {
    width: 100%;
    aspect-ratio: 1672/941;
    object-fit: contain;
    background: var(--ink);
  }
  .card-body {
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    flex: 1;
  }
  .card-body button {
    margin-top: auto;
    width: 100%;
  }
  .bar {
    height: 5px;
    background: #e5e5e5;
    width: 100%;
  }
  .bar span {
    display: block;
    height: 100%;
    background: var(--accent);
  }
  .continue {
    display: grid;
    grid-template-columns: 280px minmax(0,1fr);
    gap: var(--space-5);
    align-items: center;
  }
  .continue .cover {
    border: 1px solid var(--border);
    object-fit: cover;
  }
  .continue h2 {
    margin-bottom: var(--space-3);
  }
  .continue .primary {
    margin-top: 20px;
  }
  .course-list {
    display: grid;
    gap: var(--space-6);
  }
  .empty {
    padding: var(--space-7) var(--space-5);
    text-align: center;
    display: grid;
    gap: var(--space-5);
    justify-items: center;
  }
  .account-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    padding-block: var(--space-5);
    border-top: 1px solid var(--border);
  }
  .account-row:first-child {
    border-top: 0;
  }
  .account-row div {
    min-width: 0;
  }
  .account-row .purchase {
    grid-column: 1 / -1;  /* K3: the purchase and its refund block under the course line, full width */
  }
  .email {
    overflow-wrap: anywhere;
  }
  .footer {
    border-top: 1px solid #d7d7d4;
    padding: var(--space-5) 0 var(--space-6);
  }
  .footer-inner {
    display: flex;
    justify-content: space-between;
    gap: var(--space-5);
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .demo {
    max-width: 440px;
    width: 100%;
  }
  .demo .row {
    flex-wrap: nowrap;
  }
  .demo select {
    flex: 1;
    min-width: 0;
  }
  .footer a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }
  .footer .demo {
    width: auto;
    margin-left: auto;
  }
  .lesson-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
  }
  .ring {
    width: 56px;
    height: 56px;
    padding: 5px;
    border-radius: var(--radius-round);
    background: conic-gradient(var(--accent) var(--progress),#ddd 0);
    border: none;
  }
  .ring span {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-round);
    background: var(--surface);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
  }
  .progress-wrap {
    position: relative;
  }
  .popover {
    position: absolute;
    z-index: 20;
    right: 0;
    top: 60px;
    width: 300px;
    display: grid;
    gap: var(--space-1);
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--ink);
    box-shadow: var(--shadow-popover);
    font-weight: 400;
  }
  .popover p+p {
    margin-top: 0;
  }
  .study {
    display: grid;
    grid-template-columns: minmax(0,1fr) 320px;
    gap: var(--space-5);
    align-items: start;
  }
  .study.expanded {
    grid-template-columns: minmax(0,1fr);
  }
  .main-column {
    min-width: 0;
  }
  /* V5b (Taliya ACCEPT-V4): «Відео готується» follows the lecture sheet in the markup, so a screen reader starts with
     the lecture H1; order draws it in the player's place, as before */
  .main-column.has-pending {
    display: flex;
    flex-direction: column;
  }
  .main-column.has-pending>.video-pending {
    order: -1;
  }
  .sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    max-height: 1100px;
    overflow-y: auto;
    min-width: 0;
  }
  .sidebar-title {
    padding: var(--space-5);
    border-bottom: 1px solid var(--border);
  }
  .sidebar-title h2 {
    font-size: 20px;
  }
  .sidebar-title .meta {
    margin-top: 6px;
  }
  .program-section {
    border-bottom: 1px solid var(--border);
  }
  .section-toggle {
    width: 100%;
    padding: 18px var(--space-4);
    background: #f7f7f5;
    display: flex;
    justify-content: space-between;
    text-align: left;
    border: 0;
    border-radius: 0;
  }
  .section-toggle>span {
    min-width: 0;
  }
  .section-toggle strong {
    display: block;
    font-size: 16px;
  }
  .section-toggle .meta {
    display: block;
    margin-top: var(--space-2);
    font-weight: 400;
  }
  .program-item {
    display: grid;
    grid-template-columns: minmax(0,1fr) 44px;
    border-top: 1px solid var(--border);
    border-left: 4px solid transparent;
  }
  .program-item.current {
    border-left-color: var(--accent);
    background: #fff3f3;
  }
  .step-button {
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: left;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    padding: 14px var(--space-3);
    min-width: 0;
    font-weight: 400;
  }
  .step-copy {
    min-width: 0;
  }
  .step-copy>span {
    display: block;
  }
  .step-copy .meta {
    margin-top: 6px;
  }
  .step-icon {
    margin-top: 3px;
    flex-shrink: 0;
  }
  .resource-button {
    border: 0;
    border-radius: 0;
    padding: 10px;
    align-self: stretch;
    background: transparent;
    min-height: 44px;
  }
  .player {
    width: 100%;
    position: relative;
    background: var(--ink);
    color: var(--on-dark);
    aspect-ratio: 16/9;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-5);
    min-width: 0;
  }
  .player-caption {
    font-size: 14px;
    color: var(--on-dark-muted);
  }
  .player-center {
    display: grid;
    justify-items: center;
    gap: var(--space-4);
    text-align: center;
    margin: auto;
    padding: var(--space-3);
  }
  .player-center>button {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-round);
    border: 1px solid #888;
    background: var(--surface);
    color: var(--ink);
  }
  .player-center>button svg {
    width: 24px;
    height: 24px;
  }
  .player-controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
  }
  .player-controls button {
    background: var(--dark-raised);
    color: var(--on-dark);
    border-color: var(--dark-border);
  }
  .player-controls select {
    background-color: var(--dark-raised);
    color: var(--on-dark);
    border-color: var(--dark-border);
    width: 110px;
    min-width: 0;
  }
  .player-controls .time {
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    white-space: nowrap;
    margin-right: auto;
  }
  .seek {
    width: 100%;
    height: 44px;
    margin: 0;
  }
  .player-bottom {
    width: 100%;
  }
  .quality-wrap {
    position: relative;
  }
  .quality-menu {
    position: absolute;
    bottom: 56px;
    right: 0;
    padding: var(--space-2);
    background: var(--ink);
    border: 1px solid #777;
    z-index: 5;
  }
  .lesson-title {
    margin: var(--space-5) 0 var(--space-4);
  }
  .lesson-title h1 {
    font-size: 24px;
    line-height: 1.4;
  }
  .lesson-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
  }
  .lesson-nav .row {
    flex: 1;
  }
  .nextbar {
    display: flex;
    justify-content: flex-end;
  }
  .tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-wrap: wrap;
  }
  .tabs button {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 14px var(--space-4);
    min-height: 52px;
    font-weight: 600;
  }
  .tabs button.active {
    box-shadow: inset 0 -3px var(--accent);
  }
  .tabs button.mobile-only {
    display: none;
  }
  .tab-panel {
    padding: var(--space-6) var(--space-5);
    background: var(--surface);
    min-height: 240px;
  }
  .tab-panel .prose {
    max-width: 760px;
    font-size: 18px;
    line-height: 1.7;
  }
  .tab-panel .prose h2 {
    font-size: 20px;
    line-height: 1.35;
  }
  .prose h2 {
    margin-top: var(--space-6);
    margin-bottom: var(--space-4);
  }
  .prose h2:first-child {
    margin-top: 0;
  }
  .prose ul,
  .prose ol {
    margin-block: var(--space-4);
  }
  .prose p {
    overflow-wrap: anywhere;
  }
  .note {
    border-top: 1px solid var(--border);
    padding-top: var(--space-4);
  }
  .note-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .note .text {
    padding-left: 0;
  }
  .file-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    justify-content: space-between;
    padding: var(--space-4);
    border: 1px solid var(--border);
    flex-wrap: wrap;
  }
  .file-card .file-name {
    flex: 1;
    min-width: 130px;
  }
  .quiz-progress {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
  }
  .quiz-progress span {
    height: 5px;
    flex: 1;
    background: #ddd;
  }
  .quiz-progress .filled {
    background: var(--accent);
  }
  .answers {
    display: grid;
    gap: var(--space-3);
  }
  .answer {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    width: 100%;
    text-align: left;
    justify-content: flex-start;
    padding: var(--space-4);
  }
  .answer .dot {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 1px solid #777;
    border-radius: var(--radius-round);
    margin-top: 3px;
  }
  .answer.chosen {
    border: 2px solid var(--ink);
    padding: 15px;
  }
  .answer.chosen .dot {
    background: var(--ink);
    box-shadow: inset 0 0 0 4px var(--surface);
  }
  .answer.locked {
    cursor: default;
    background: #f6f6f4;
    color: var(--ink);
    border-color: #bbb;
  }
  .answer .explanation {
    font-weight: 400;
    margin-top: var(--space-3);
    display: block;
  }
  .answer .verdict {
    font-weight: 700;
    display: block;
    margin-bottom: var(--space-1);
  }
  .answer.correct {
    border: 2px solid var(--success);
    padding: 15px;
    background: var(--surface);
  }
  .answer.correct .verdict {
    color: var(--success);
  }
  .answer.chosen.locked:not(.correct) .verdict {
    color: var(--danger);
  }
  .result-number {
    font: 600 48px/1.2 var(--font-display);
  }
  .stats {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: var(--space-4);
    margin: var(--space-6) 0;
  }
  .stat {
    background: #f5f5f3;
    padding: 20px var(--space-3);
    text-align: center;
  }
  .stat strong {
    display: block;
    font: 600 24px/1.4 Unbounded,sans-serif;
  }
  /* Certificate page (brief 05.11.2026): the canvas is the rendered picture, never wider than the screen */
  .cert-canvas {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    background: #fff;
  }
  .cert-page fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
  }
  .cert-fmt {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }
  .cert-confirm > summary {
    list-style: none;
    cursor: pointer;
  }
  .cert-confirm > summary::-webkit-details-marker {
    display: none;
  }
  .cert-confirm[open] > summary {
    display: none;
  }
  .cert-li {
    display: grid;
    gap: var(--space-3);
    margin: 0;
  }
  .cert-li dt {
    font-size: 14px;
    color: var(--muted);
  }
  .cert-li dd {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-3);
    overflow-wrap: anywhere;
  }
  .cert-page input[readonly] {
    width: 100%;
  }
  .certificate {
    border: 2px solid var(--ink);
    padding: 40px;
    text-align: center;
  }
  .certificate h1 {
    font-size: 30px;
  }
  .certificate-name {
    font-family: Unbounded,sans-serif;
    font-size: 28px;
    margin-block: var(--space-6);
  }
  #admin-form {
    width: 100%;
    max-width: 640px;
    margin-inline: 0;
  }
  .admin-table {
    display: grid;
    gap: 0;
  }
  .admin-record {
    display: grid;
    grid-template-columns: 1.5fr 1.3fr 1fr 1fr;
    gap: var(--space-5);
    padding: var(--space-5) 0;
    border-top: 1px solid var(--border);
  }
  .admin-record>div {
    min-width: 0;
  }
  .admin-record .meta {
    display: block;
    margin-bottom: var(--space-2);
  }
  .modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--overlay);
    display: grid;
    align-items: center;
    justify-items: center;
    padding: var(--space-5);
  }
  .dialog {
    position: relative;
    width: min(620px,100%);
    max-height: calc(100dvh - 48px);
    overflow: auto;
    background: var(--surface);
    padding: var(--space-5);
    border: 1px solid var(--ink);
  }
  .dialog .dialog-top {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    gap: var(--space-4);
    justify-content: space-between;
    align-items: flex-start;
    margin: 0;
  }
  .dialog-top h2 {
    font-size: 20px;
  }
  .dialog .brand {
    margin-bottom: var(--space-5);
  }
  .fullscreen {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: var(--ink);
    overflow: auto;
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .fullscreen>.row {
    justify-content: space-between;
    color: var(--on-dark);
    margin-bottom: var(--space-3);
  }
  .fullscreen .player {
    width: 100%;
    max-height: calc(100dvh - 110px);
    min-height: 300px;
    aspect-ratio: auto;
    flex: 1;
  }
  .fullscreen .brand img {
    width: 76px;
  }
  .fullscreen .player-center {
    max-height: none;
  }
  .sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
  }
  .skip {
    position: fixed;
    left: 16px;
    top: -100px;
    z-index: 300;
    padding: var(--space-3);
    background: var(--surface);
    min-height: 44px;
  }
  .skip:focus {
    top: 16px;
  }
  .desktop-only {
    display: inline-flex;
  }
  .mobile-only {
    display: none;
  }
  .auth-logo {
    width: 110px;
    margin-bottom: var(--space-5);
  }
  .divider {
    height: 1px;
    background: var(--border);
    margin-block: var(--space-2);
  }
  .mail {
    border-top: 5px solid var(--accent);
  }
  .mail-from {
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    overflow-wrap: anywhere;
  }
  .spaced {
    margin-top: var(--space-5);
  }
  .tab-panel:empty {
    display: none;
  }
  @media (min-width:1024px) {
    .top-title.course-title {
      max-width: 500px;
    }
    .sidebar .step-button {
      font-size: 16px;
    }
    .study.expanded .tab-program {
      display: flex;
    }
    .review-only {
      display: none;
    }
  }
  @media (max-width:1023px) {
    .container {
      width: calc(100% - 32px);
    }
    .top-inner {
      gap: var(--space-3);
      min-height: 64px;
    }
    .brand,
    .brand img {
      width: 76px;
      min-width: 76px;
    }
    .top-title {
      font-size: 16px;
    }
    .top-actions {
      width: 100%;
      justify-content: space-between;
      gap: var(--space-2);
    }
    .top-actions .support {
      max-width: none;
      flex: 1 1 100%;
      order: 3;
      white-space: normal;
    }
    .top-actions>button:not(.support):not(.ring) {
      flex: 1;
    }
    .darkbar {
      padding: var(--space-5) 0;
    }
    .navtabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: var(--space-2);
    }
    .navtabs button {
      min-width: 0;
      padding-inline: 10px;
    }
    .page {
      padding-block: var(--space-5) 40px;
    }
    .panel {
      padding: var(--space-4);
    }
    .courses {
      grid-template-columns: 1fr;
    }
    .card-body {
      padding: var(--space-4);
    }
    .continue {
      grid-template-columns: 1fr;
      gap: var(--space-4);
    }
    .continue .cover {
      max-width: 100%;
    }
    .continue .primary {
      width: 100%;
    }
    .course-list {
      gap: var(--space-5);
    }
    .study {
      display: block;
    }
    .sidebar {
      display: none;
    }
    .desktop-only {
      display: none!important;
    }
    .mobile-only {
      display: inline-flex;
    }
    .lesson-page {
      padding-bottom: calc(var(--bottom) + var(--space-4));
    }
    .player {
      padding: var(--space-3);
      aspect-ratio: 16/9;
      min-height: 201px;
    }
    .player-center {
      gap: var(--space-1);
      padding: 0;
    }
    .player-center>button {
      width: 44px;
      height: 44px;
    }
    .player-center p {
      font-size: 14px;
    }
    .player-caption {
      display: none;
    }
    .player-controls {
      gap: var(--space-1);
    }
    .player-controls select {
      width: 92px;
      padding: 10px 6px;
    }
    .player-controls button {
      padding: 10px;
    }
    .player-controls .time {
      margin-right: 0;
    }
    .seek {
      height: 44px;
      min-height: 44px;
    }
    .player-center {
      position: absolute;
      left: 12px;
      right: 12px;
      top: 8px;
      height: 72px;
    }
    .player-bottom {
      margin-top: var(--space-8);
    }
    .player-controls .time {
      font-size: 14px;
    }
    .lesson-title {
      margin-block: 20px var(--space-4);
    }
    .lesson-title h1 {
      font-size: 20px;
      line-height: 1.45;
    }
    .lesson-nav {
      margin-bottom: 20px;
    }
    .lesson-nav>.row {
      width: 100%;
      flex: unset;
    }
    .lesson-nav .mark {
      flex: 1;
    }
    .nextbar {
      position: fixed;
      z-index: 40;
      bottom: 0;
      left: 0;
      right: 0;
      padding: var(--space-2) var(--space-4) calc(var(--space-2) + env(safe-area-inset-bottom));
      background: var(--surface);
      border-top: 1px solid var(--border);
    }
    .nextbar button {
      width: 100%;
      min-height: 48px;
    }
    .keyboard-open .nextbar {
      position: static;
      padding: var(--space-2) 0;
    }
    .tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      border: 1px solid var(--border);
    }
    .tabs button {
      font-size: 16px;
      min-height: 48px;
      padding: var(--space-3) var(--space-2);
    }
    .tabs button.mobile-only {
      display: flex;
    }
    .tabs .desktop-materials {
      display: none;
    }
    .tab-panel {
      padding: var(--space-5) var(--space-4);
    }
    .tab-panel.program-panel {
      padding: 0;
    }
    .tab-panel .prose {
      font-size: 16px;
      line-height: 1.65;
    }
    .tab-panel .prose h2 {
      font-size: 18px;
    }
    .section-toggle {
      padding: var(--space-4);
    }
    .program-item {
      grid-template-columns: minmax(0,1fr) 44px;
    }
    .step-button {
      padding: 14px 10px;
    }
    .step-copy {
      font-size: 16px;
    }
    .account-row {
      grid-template-columns: 1fr;
      gap: var(--space-3);
    }
    .stats {
      gap: var(--space-2);
      grid-template-columns: 1fr;
      margin-block: var(--space-5);
    }
    .stat {
      padding: var(--space-4);
    }
    .result-number {
      font-size: 36px;
    }
    .certificate {
      padding: var(--space-5) var(--space-4);
    }
    .certificate h1 {
      font-size: 22px;
    }
    .certificate-name {
      font-size: 22px;
    }
    .admin-record {
      grid-template-columns: 1fr;
      gap: var(--space-4);
    }
    .modal-backdrop {
      padding: 0;
      align-items: stretch;
    }
    .dialog {
      max-height: 100dvh;
      width: 100%;
      padding: var(--space-5) var(--space-4);
    }
    .dialog .dialog-top {
      gap: var(--space-2);
      right: 16px;
    }
    .footer-inner {
      gap: var(--space-4);
    }
    .footer {
      padding-bottom: var(--space-6);
    }
    .lesson-page~.footer {
      padding-bottom: calc(var(--bottom) + var(--space-6));
    }
    .popover {
      right: 0;
      width: min(300px,calc(100vw - 32px));
    }
    .fullscreen {
      padding: var(--space-3);
    }
    .fullscreen .player {
      min-height: 240px;
    }
    .fullscreen .player-center {
      position: static;
      height: auto;
      margin: auto;
    }
    .fullscreen .player-bottom {
      margin-top: var(--space-4);
    }
  }
  @media (max-width:350px) {
    .player {
      min-height: 240px;
      aspect-ratio: auto;
    }
    .player-center {
      height: 68px;
    }
    .player-bottom {
      margin-top: 68px;
    }
    .player-controls .time {
      flex: 1;
    }
    .player-controls {
      display: grid;
      grid-template-columns: 44px 1fr 92px;
    }
    .quality-wrap {
      grid-column: 1/3;
    }
    .quality-wrap>button {
      width: 100%;
    }
    .player-controls .full-btn {
      width: 92px;
    }
    .lesson-header {
      gap: var(--space-2);
    }
    .top-title.course-title {
      font-size: 16px;
    }
    .footer .demo .row {
      flex-wrap: wrap;
    }
    .demo .row button {
      width: 100%;
    }
    .navtabs button {
      font-size: 16px;
    }
  }
  .player:fullscreen {
    width: 100vw;
    height: 100dvh;
    aspect-ratio: auto;
    min-height: 0;
    padding: var(--space-5);
  }
  .player:fullscreen .player-center {
    position: static;
    height: auto;
    margin: auto;
  }
  .player:fullscreen .player-bottom {
    margin-top: var(--space-5);
  }
  .player:fullscreen::backdrop {
    background: var(--ink);
  }
  .row input {
    min-width: 0;
  }
  .fullscreen-exit {
    display: none!important;
  }
  .player:fullscreen .fullscreen-exit {
    display: inline-flex!important;
  }
  .player:fullscreen .player-center>button {
    width: 64px;
    height: 64px;
  }
  @media (max-width:1023px) {
    .player-controls .play-small {
      display: none;
    }
    .lesson-nav>.row {
      display: grid;
      grid-template-columns: 44px 44px minmax(0,1fr);
      gap: var(--space-2);
    }
    .lesson-nav .mark {
      grid-column: 3;
      min-width: 0;
      padding-inline: 10px;
    }
    .lesson-nav .mobile-only {
      grid-column: 1/-1;
      width: 100%;
    }
    .player-controls select {
      padding-right: var(--space-5);
    }
  }
  @media (max-width:350px) {
    .player-controls .time {
      grid-column: 1/3;
    }
    .player-controls select {
      grid-column: 3;
    }
    .player-controls .quality-wrap {
      grid-column: 1/3;
    }
    .player-controls .full-btn {
      grid-column: 3;
    }
  }
  #login-form [data-action="show-password"],
  .quality-wrap button {
    flex-shrink: 0;
    width: max-content;
    white-space: nowrap;
    overflow-wrap: normal;
  }
  .player-center>button.player-recovery {
    width: auto;
    height: auto;
    min-height: 48px;
    max-width: 100%;
    border-radius: var(--radius);
    white-space: nowrap;
    overflow-wrap: normal;
    font-size: 16px;
  }
  @media (max-width:1023px) {
    .continue>div {
      grid-row: 1;
    }
    .continue>.cover {
      grid-row: 2;
    }
    .player-center:has(.player-recovery) {
      height: 84px;
      gap: var(--space-2);
    }
    .player:has(.player-recovery) {
      min-height: 224px;
    }
    .player:has(.player-recovery) .player-bottom {
      margin-top: 88px;
    }
  }
  @media (max-width:350px) {
    .player:has(.player-recovery) {
      min-height: 264px;
    }
  }
  a.button {
    color: inherit;
  }
  a.button.primary {
    color: var(--on-accent);
  }
  a.button.primary:hover {
    background: var(--hover);
    border-color: var(--hover);
  }
  a.button.text {
    background: transparent;
    border-color: transparent;
    text-decoration: underline;
    text-underline-offset: 4px;
  }
  .navtabs a.button {
    background: transparent;
    color: var(--on-dark);
    border-color: var(--dark-border);
    min-width: 145px;
  }
  .navtabs a.button.active {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--on-dark);
    box-shadow: none;
  }
  .navtabs a.button:hover {
    border-color: var(--on-dark);
  }
  .staff-tabs {
    flex-wrap: wrap;
  }
  .flash {
    margin-bottom: var(--space-5);
  }
  details.program-section>summary {
    list-style: none;
  }
  details.program-section>summary::-webkit-details-marker {
    display: none;
  }
  details.program-section>summary svg {
    transition: transform var(--duration-fast);
  }
  details.program-section[open]>summary svg {
    transform: rotate(180deg);
  }
  .section-toggle {
    cursor: pointer;
    align-items: center;
    gap: var(--space-3);
  }
  a.step-button {
    display: flex;
    gap: var(--space-2);
    color: inherit;
    text-decoration: none;
    border: 0;
    min-height: 44px;
  }
  a.step-button:hover {
    background: #f5f5f4;
  }
  .course-program {
    max-height: none;
  }
  .read-wide {
    max-width: 860px;
  }
  .tabs .tab-program {
    display: none;
  }
  .study.expanded .sidebar {
    display: none;
  }
  .study.expanded .tabs .tab-program {
    display: flex;
  }
  .player.has-video {
    aspect-ratio: auto;
    padding: 0;
    display: block;
    min-height: 0;
    overflow: hidden;
  }
  .player.has-video .player-video {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
    background: var(--black);
    border: 0;
    object-fit: contain;
  }
  .player.has-video .player-center {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    aspect-ratio: 16/9;
    height: auto;
    display: grid;
    place-content: center;
    margin: 0;
    pointer-events: none;
  }
  .player.has-video .player-center>* {
    pointer-events: auto;
  }
  .player.has-video.playing .player-center>button {
    display: none;
  }
  .player.has-video .player-status {
    font-size: 16px;
    line-height: 1.5;
    color: var(--on-dark);
    max-width: calc(100% - 24px);
  }
  .player.has-video .player-status:not(:empty) {
    background: var(--ink);
    padding: var(--space-2) var(--space-3);
  }
  .player.has-video .player-bottom {
    padding: var(--space-2) var(--space-3) var(--space-3);
    margin-top: 0;
    background: var(--ink);
  }
  .player .player-note {
    font-size: 14px;
    color: var(--on-dark-muted);
    max-width: 420px;
  }
  .autonext-panel {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 12px;
    background: var(--surface);
    color: var(--ink);
    padding: var(--space-4);
    border: 1px solid var(--ink);
    z-index: 3;
    display: grid;
    gap: var(--space-2);
  }
  .autonext-panel[hidden] {
    display: none;
  }
  .player:fullscreen.has-video {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
  }
  .player:fullscreen.has-video .player-video {
    max-height: calc(100dvh - 110px);
  }
  .answer input.sr {
    position: absolute;
  }
  label.answer {
    font-weight: 600;
    margin: 0;
  }
  label.answer:has(input:checked) {
    border: 2px solid var(--ink);
    padding: 15px;
  }
  label.answer:has(input:checked) .dot {
    background: var(--ink);
    box-shadow: inset 0 0 0 4px var(--surface);
  }
  label.answer:has(input:focus-visible) {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
  }
  div.answer {
    cursor: default;
  }
  .mobile-program {
    display: none;
  }
  .staff-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
    gap: var(--space-4);
  }
  .staff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
  }
  .staff-table th,
  .staff-table td {
    text-align: left;
    padding: 10px var(--space-2);
    border-top: 1px solid var(--border);
    vertical-align: top;
    overflow-wrap: anywhere;
  }
  .staff-table td.when {
    white-space: nowrap;
  }
  @media (min-width:1024px) {
    .staff-table td,
    .staff-table td.email {
      overflow-wrap: break-word;
    }
    .staff-table td.email {
      white-space: nowrap;
    }
  }
  .staff-table th {
    font-weight: 600;
    color: var(--muted);
  }
  .mail-body p {
    margin-top: var(--space-3);
  }
  .mail-body a {
    overflow-wrap: anywhere;
  }
  .note .row {
    flex-wrap: nowrap;
  }
  @media (max-width:1023px) {
    .tabs .tab-program {
      display: flex;
    }
    .mobile-program {
      display: block;
    }
    .navtabs a.button {
      min-width: 0;
      padding-inline: 10px;
    }
    .staff-tabs {
      grid-template-columns: 1fr 1fr;
    }
    .player.has-video {
      min-height: 0;
    }
    .player.has-video .player-center {
      height: auto;
      top: 0;
      left: 0;
      right: 0;
    }
    .player.has-video .player-bottom {
      margin-top: 0;
    }
    .player.has-video .player-center>button {
      width: 56px;
      height: 56px;
    }
    .course-program {
      display: block;
    }
    .lesson-nav .mark-form {
      grid-column: 3;
      min-width: 0;
    }
    .lesson-nav .mark-form .mark {
      width: 100%;
      min-width: 0;
      padding-inline: 10px;
    }
    .staff-table,
    .staff-table tbody,
    .staff-table tr,
    .staff-table td {
      display: block;
    }
    .staff-table thead {
      display: none;
    }
    .staff-table tr {
      padding: var(--space-4) 0;
      border-top: 1px solid var(--border);
    }
    .staff-table td {
      border: 0;
      padding: var(--space-1) 0;
      overflow-wrap: anywhere;
      font-size: 16px;
      line-height: 1.5;
      color: var(--ink);
    }
    .staff-table td[data-label]::before {
      content: attr(data-label);
      display: block;
      font: 400 14px/1.5 var(--font-body);
      color: var(--muted-alt);
    }
    .staff-table td:empty {
      display: none;
    }
    .staff-table td.when {
      white-space: nowrap;
    }
    .staff-table td.email {
      overflow-wrap: anywhere;
    }
    .staff-table td.act .button {
      width: 100%;
      min-height: 48px;
      margin-top: var(--space-2);
      font-size: 16px;
    }
    .nextbar .button {
      width: 100%;
      min-height: 48px;
    }
    .top-actions>.button:not(.support) {
      flex: 1;
    }
  }
  @media (max-width:350px) {
    .player.has-video {
      min-height: 0;
    }
    .player.has-video .player-bottom {
      margin-top: 0;
    }
    .player.has-video .player-center {
      height: auto;
    }
  }
  @media print {
    .top,
    .footer,
    .skip,
    .row,
    .flash {
      display: none!important;
    }
    .page {
      padding: 0;
    }
    .certificate {
      border: 2px solid #000;
    }
  }
  [hidden] {
    display: none!important;
  }
  .player.no-video {
    justify-content: center;
    align-items: center;
  }
  .player.no-video .player-center {
    position: static!important;
    height: auto!important;
    margin: auto;
    gap: var(--space-2);
  }
  [data-action="autonext"][aria-pressed="true"] {
    box-shadow: inset 0 -3px var(--accent);
  }
  .mail-body,
  .mail-body p {
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
  }
  .staff-actions form {
    align-content: start;
  }
  @media (max-width:350px) {
    .player-controls [data-action="autonext"] {
      grid-column: 1/3;
      width: 100%;
    }
    .player-controls .full-btn {
      grid-column: 3;
    }
  }
  details.files>summary {
    font-weight: 600;
  }
  .project-body details.files>summary,
  .project-body .mobile-program>summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    cursor: pointer;
  }
  .check-row {
    flex-wrap: nowrap;
    align-items: flex-start;
    font-weight: 400;
    min-height: 44px;
  }
  .check-row input {
    width: 24px;
    min-height: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--accent);
  }
  .question-text {
    font: 700 20px/1.45 var(--font-body);
  }
  .task-prose {
    max-width: 760px;
    font-size: 18px;
    line-height: 1.7;
  }
  .record-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .no-name {
    font-weight: 400;
    color: var(--muted-alt);
  }
  .footer button.text {
    padding-inline: 0;
  }
  .pending-notice .button {
    justify-self: start;
  }
  .video-pending {
    background: var(--page);
    border: 1px solid var(--border);
    padding: var(--space-5);
    display: grid;
    gap: var(--space-3);
    justify-items: start;
  }
  .video-pending h2 {
    font: 600 20px/1.3 var(--font-display);
  }
  .video-pending p {
    color: var(--muted-alt);
    font-size: 16px;
    line-height: 1.6;
    max-width: 640px;
  }
  .video-pending button {
    min-height: 48px;
    background: var(--surface);
  }
  input[aria-invalid="true"] {
    border: 2px solid var(--danger);
  }
  .self-start {
    justify-self: start;
  }
  .staff-actions {
    align-items: start;
  }
  button.danger {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--surface);
  }
  @media (max-width:1023px) {
    .question-text {
      font-size: 18px;
    }
    .task-prose {
      font-size: 16px;
      line-height: 1.65;
    }
    .video-pending {
      padding: var(--space-4);
    }
    .video-pending h2 {
      font-size: 18px;
    }
  }
  .support-mail a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  /* L-01: phones keep the small play/pause in the panel - the big button hides while the video plays. */
  @media (max-width:1023px) {
    .player-controls .play-small {
      display: inline-flex;
    }
  }
  @media (max-width:479px) {
    .player-controls {
      display: grid;
      grid-template-columns: 44px minmax(0,1fr) 92px;
      gap: var(--space-1);
    }
    .player-controls .play-small {
      grid-column: 1;
    }
    .player-controls .time {
      grid-column: 2;
    }
    .player-controls select {
      grid-column: 3;
      width: 92px;
    }
    .player-controls [data-action="autonext"] {
      grid-column: 1/3;
      width: 100%;
    }
    .player-controls .full-btn {
      grid-column: 3;
      width: 92px;
    }
  }
  /* L-03: fenced prompts in lecture texts */
  .prose pre {
    margin-block: var(--space-4);
    padding: var(--space-4);
    background: #f5f5f3;
    border: 1px solid var(--border);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: 400 15px/1.6 var(--font-mono);
  }
  .prose pre code {
    font: inherit;
  }
  @media (max-width:1023px) {
    .prose pre {
      padding: var(--space-3);
      font-size: 14px;
    }
  }
  .prose code {
    font-family: var(--font-mono);
    font-size: .9em;
  }
  .note-edit>summary {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
    display: inline-flex;
    align-items: center;
  }
  .note-edit[open]>summary {
    margin-bottom: var(--space-2);
  }
  /* L-17: nothing but the certificate on paper */
  @media print {
    .no-print {
      display: none!important;
    }
  }
  /* L-13: in fullscreen the frame fills the space above the panel and the big button sits on the frame */
  .player:fullscreen.has-video {
    display: grid;
    grid-template-rows: minmax(0,1fr) auto;
    grid-template-columns: minmax(0,1fr);
  }
  .player:fullscreen.has-video .player-video {
    grid-area: 1/1;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
    min-height: 0;
  }
  .player:fullscreen.has-video .player-center {
    grid-area: 1/1;
    position: static;
    aspect-ratio: auto;
    height: auto;
    align-self: stretch;
  }
  .player:fullscreen.has-video .player-bottom {
    grid-area: 2/1;
    margin-top: 0;
  }
}

/* Lesson screen, redesign round 2: the approved mock (design/mock-lesson.html) and DESIGN-SPEC sections 2-4.
   Scoped to body.lesson-body; the layer wins over the components above without !important. */
@layer screens {
  .lesson-body {
    --gutter: 60px;
  }
  .lesson-body h2,
  .lesson-body h3 {
    font-family: var(--font-body);
    font-weight: 700;
  }
  .lesson-body :focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
  }
  .lesson-body .player :focus-visible {
    outline-color: var(--on-dark);
  }

  /* header: 72 on a computer, 56 and sticky on a phone (back, course title, ring, menu) */
  :is(.lesson-body,.slim-body) .top {
    border-bottom: 0;
    box-shadow: 0 1px 0 var(--line);
  }
  :is(.lesson-body,.slim-body) .top-inner {
    min-height: 72px;
    padding-block: 0;
    flex-wrap: nowrap;
  }
  :is(.lesson-body,.slim-body) .top-title {
    font-size: var(--fs-ui);
    line-height: 1.3;
    min-width: 0;
  }
  :is(.lesson-body,.slim-body) .top-actions {
    flex-wrap: nowrap;
    gap: var(--space-3);
    width: auto;
    flex: none;
  }
  :is(.lesson-body,.slim-body) .icon-btn {
    width: var(--ctl-h);
    min-width: var(--ctl-h);
    padding: 0;
  }
  .lesson-body .ring {
    width: 44px;
    height: 44px;
    padding: 4px;
    min-height: 0;
    min-width: 0;
    background: conic-gradient(var(--accent) var(--progress),var(--fill) 0);
    transform: none;
  }
  .lesson-body .ring span {
    width: 36px;
    height: 36px;
    font: 600 11px/1 var(--font-display);
    letter-spacing: 0;
  }
  .lesson-body .ring:hover span {
    background: var(--subtle);
  }
  :is(.lesson-body,.slim-body) .popover {
    top: calc(100% + 8px);
    width: auto;
    min-width: 240px;
    padding: var(--space-4);
    gap: 6px;
    border: 0;
    border-radius: var(--radius-card);
    box-shadow: var(--sh-3);
    font-size: var(--fs-meta);
  }
  :is(.lesson-body,.slim-body) .popover[hidden] {
    display: none;
  }
  :is(.lesson-body,.slim-body) .popover strong {
    font-size: var(--fs-ui);
  }
  :is(.lesson-body,.slim-body) .popover.menu {
    padding: var(--space-2);
    gap: 0;
    width: max-content;
  }
  :is(.lesson-body,.slim-body) .popover.menu a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
  }
  :is(.lesson-body,.slim-body) .popover.menu a:hover {
    background: var(--fill);
  }
  .lesson-body .bar {
    display: block;
    height: 4px;
    border-radius: 999px;
    background: var(--fill);
    overflow: hidden;
  }
  .lesson-body .bar>span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    animation: lms-grow var(--duration-slow) var(--ease);
  }
  @keyframes lms-grow {
    from {
      width: 0;
    }
  }

  /* page grid: content + program 360 on the right */
  .lesson-body .lesson-page {
    padding-block: var(--space-5) var(--space-7);
  }
  .lesson-body .study {
    grid-template-columns: minmax(0,1fr) 360px;
    gap: var(--space-5);
  }
  .lesson-body .study.expanded {
    grid-template-columns: minmax(0,1fr);
  }
  .lesson-body .study.expanded .sidebar-wrap {
    display: none;
  }

  /* player */
  .lesson-body .player {
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--dark);
    box-shadow: var(--sh-1);
  }
  .lesson-body .player.has-video .player-center {
    transition: background-color var(--duration-mid) var(--ease);
  }
  .lesson-body .player.has-video:not(.playing) .player-center {
    background: rgba(23,23,23,.12);
  }
  .lesson-body .player-center>.play-big {
    width: 84px;
    height: 58px;
    min-height: 0;
    border: 0;
    border-radius: var(--radius);
    background: rgba(23,23,23,.86);
    color: var(--on-dark);
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
  }
  .lesson-body .player-center>.play-big:hover {
    background: var(--accent);
  }
  .lesson-body .player-center>.play-big svg {
    width: 28px;
    height: 28px;
    margin-left: 3px;
  }
  .lesson-body [data-action="play"] svg {
    fill: currentColor;
  }
  .lesson-body .player.has-video .player-bottom {
    margin-top: 0;
    padding: 0 var(--space-3) var(--space-2);
    background: var(--dark);
  }
  /* the bar is 16 px like the mock; the hit area grows upward over the frame (24 on a computer, 44 on a phone),
     so the panel keeps its 68 px */
  .lesson-body .seek {
    --seek: 0%;
    --seek-reach: 8px;
    position: relative;
    display: block;
    height: calc(16px + var(--seek-reach));
    min-height: 0;
    margin: calc(-1*var(--seek-reach)) 0 0;
    padding: var(--seek-reach) 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
  }
  .lesson-body .seek::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg,var(--accent) var(--seek),rgba(255,255,255,.22) var(--seek));
  }
  .lesson-body .seek::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg,var(--accent) var(--seek),rgba(255,255,255,.22) var(--seek));
  }
  .lesson-body .seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(232,8,39,.25);
    transform: scale(0);
    transition: transform var(--duration-fast) var(--ease);
  }
  .lesson-body .seek::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    transform: scale(0);
  }
  .lesson-body .seek:hover::-webkit-slider-thumb,
  .lesson-body .seek:focus-visible::-webkit-slider-thumb {
    transform: scale(1);
  }
  .lesson-body .seek:hover::-moz-range-thumb,
  .lesson-body .seek:focus-visible::-moz-range-thumb {
    transform: scale(1);
  }
  .lesson-body .seek:hover::-webkit-slider-runnable-track,
  .lesson-body .seek:focus-visible::-webkit-slider-runnable-track {
    height: 6px;
  }
  /* F4 (Taliya P3): the focus ring goes round the whole hit area, and its top edge lies on the frame; white 2 px with
     a dark 1 px line outside stays visible on a light slide too */
  .lesson-body .seek:focus-visible {
    outline: 2px solid var(--on-dark);
    outline-offset: 0;
    box-shadow: 0 0 0 3px var(--dark);
  }
  .lesson-body .player-controls {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--space-1);
    color: var(--on-dark);
  }
  .lesson-body .player-controls button,
  .lesson-body .on-dark {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--on-dark);
  }
  .lesson-body .player-controls button:hover {
    background: rgba(255,255,255,.12);
  }
  .lesson-body .player-controls button:active {
    background: rgba(255,255,255,.2);
  }
  .lesson-body .player-controls [data-action="autonext"][aria-pressed="true"] {
    background: rgba(255,255,255,.14);
    box-shadow: none;
  }
  .lesson-body .player-controls .time {
    margin: 0 0 0 var(--space-2);
    font: 500 var(--fs-meta)/1 var(--font-body);
    font-variant-numeric: tabular-nums;
  }
  .lesson-body .player-controls .grow {
    flex: 1;
  }
  .lesson-body .player-controls select.speed {
    width: auto;
    min-width: max-content;
    min-height: 44px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--on-dark);
    font: 600 var(--fs-meta)/1 var(--font-body);
    appearance: none;
    -webkit-appearance: none;
    background-image: none;
    cursor: pointer;
  }
  .lesson-body .player-controls select.speed:hover {
    background: rgba(255,255,255,.12);
  }
  .lesson-body .player-controls select.speed option {
    color: var(--ink);
  }
  .lesson-body .autonext-panel {
    border: 0;
    border-radius: var(--radius-card);
    box-shadow: var(--sh-3);
  }
  .lesson-body .video-pending {
    background: var(--surface);
    border: 0;
    border-radius: var(--radius-card);
    box-shadow: var(--sh-1);
    padding: var(--space-5) var(--space-6);
    display: grid;
    gap: var(--space-3);
    justify-items: start;
  }
  .lesson-body .video-pending button {
    min-height: var(--ctl-h);
    background: var(--fill);
  }
  .lesson-body .video-pending button:hover {
    background: var(--fill-hover);
  }
  .lesson-body .video-pending h2 {
    font-size: var(--fs-h2);
    line-height: 1.35;
  }
  .lesson-body .video-pending p {
    max-width: 68ch;
    color: var(--muted);
  }

  /* lesson sheet: title, actions, tabs, panels */
  .lesson-body .sheet {
    margin-top: var(--space-4);
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--sh-1);
    padding: var(--space-5) var(--space-6) var(--space-6);
  }
  .lesson-body .lesson-title {
    margin: 0;
  }
  .lesson-body .lesson-title .meta {
    font-size: var(--fs-meta);
  }
  .lesson-body .lesson-title h1 {
    margin-top: 6px;
    max-width: 30ch;
    font: 600 var(--fs-h1)/1.3 var(--font-display);
    letter-spacing: -.01em;
  }
  .lesson-body .lesson-nav {
    margin: var(--space-5) 0 0;
    gap: var(--space-3);
  }
  .lesson-body .lesson-nav .row {
    display: flex;
    align-items: center;
    flex: 1;
    gap: var(--space-2);
    flex-wrap: wrap;
  }
  .lesson-body .lesson-nav .icon {
    width: var(--ctl-h);
    min-width: var(--ctl-h);
    padding: 0;
  }
  .lesson-body .lesson-nav .mark-form {
    margin-left: var(--space-2);
  }
  .lesson-body .mark[aria-pressed="true"],
  .lesson-body .mark[aria-pressed="true"]:disabled {
    background: var(--success-bg);
    color: var(--success);
  }
  .lesson-body .mark[aria-pressed="true"] svg {
    animation: lms-pop var(--duration-mid) var(--ease);
  }
  @keyframes lms-pop {
    from {
      transform: scale(.6);
    }
  }
  .lesson-body .next-inline .button,
  .lesson-body .nextbar .button {
    white-space: nowrap;
  }
  .lesson-body .nextbar {
    display: none;
  }
  .lesson-body .tabs-wrap {
    position: relative;
    margin-top: var(--space-5);
    box-shadow: inset 0 -1px 0 var(--line);
  }
  .lesson-body .ltabs {
    display: flex;
    gap: var(--space-5);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .lesson-body .ltabs::-webkit-scrollbar {
    display: none;
  }
  .lesson-body .tab {
    position: relative;
    min-height: 48px;
    padding: 0 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font: 600 var(--fs-ui)/1 var(--font-body);
    white-space: nowrap;
    flex-shrink: 0;
    transition: color var(--duration-fast) var(--ease);
  }
  .lesson-body .tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform var(--duration-mid) var(--ease);
  }
  .lesson-body .tab:hover,
  .lesson-body .tab.active {
    color: var(--ink);
    background: transparent;
    transform: none;
  }
  .lesson-body .tab.active::after {
    transform: scaleX(1);
  }
  .lesson-body .tab:focus-visible {
    outline-offset: -2px;
    border-radius: var(--radius);
  }
  .lesson-body .tab .count {
    margin-left: 8px;
  }
  .lesson-body .tab.active .count {
    background: var(--ink);
    color: var(--surface);
  }
  .lesson-body .tab-program {
    display: none;
  }
  .lesson-body .study.expanded .tab-program {
    display: inline-flex;
  }
  .lesson-body .tabs-wrap.has-more::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 1px;
    width: 48px;
    pointer-events: none;
    background: linear-gradient(90deg,rgba(255,255,255,0),var(--surface));
  }
  .lesson-body .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--fill);
    color: var(--ink);
    font: 700 var(--fs-micro)/1 var(--font-body);
  }
  .lesson-body .lpanel {
    padding-top: var(--space-6);
  }
  .lesson-body .lpanel[hidden] {
    display: none;
  }
  .lesson-body .panel-h {
    font: 700 var(--fs-h2)/1.35 var(--font-body);
    margin: 0;
  }
  .lesson-body .empty {
    margin-top: var(--space-5);
    color: var(--muted);
    list-style: none;
  }

  /* «Огляд»: the lesson first, then the course in brief */
  .lesson-body .lead {
    margin-top: var(--space-3);
    max-width: 68ch;
    font: 500 var(--fs-lead)/1.55 var(--font-body);
  }
  .lesson-body .ov-fallback {
    margin-top: var(--space-3);
    max-width: 68ch;
    font-size: var(--fs-lead);
    line-height: 1.55;
  }
  .lesson-body .brief-grid {
    display: grid;
    grid-template-columns: minmax(0,1.2fr) minmax(0,1fr);
    gap: var(--space-4);
    margin-top: var(--space-5);
    align-items: start;
  }
  .lesson-body .brief-grid.single {
    grid-template-columns: minmax(0,1fr);
  }
  .lesson-body .take,
  .lesson-body .files-card,
  .lesson-body .author,
  .lesson-body .req {
    background: var(--subtle);
    border-radius: var(--radius-card);
  }
  .lesson-body .take,
  .lesson-body .files-card {
    padding: 20px var(--space-5);
  }
  .lesson-body .take {
    box-shadow: inset 4px 0 0 var(--ink);
  }
  .lesson-body .take p {
    margin-top: var(--space-2);
    line-height: 1.6;
  }
  .lesson-body .card-h {
    display: flex;
    align-items: center;
    gap: 8px;
    font: 700 var(--fs-h3)/1.4 var(--font-body);
  }
  .lesson-body .file-list {
    display: grid;
    gap: var(--space-2);
    margin: var(--space-4) 0 0;
    padding: 0;
    list-style: none;
  }
  .lesson-body .file-row {
    display: grid;
    grid-template-columns: 20px minmax(0,1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 0;
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--sh-1);
    transition: box-shadow var(--duration-fast) var(--ease);
  }
  .lesson-body .file-row:hover {
    box-shadow: var(--sh-2);
  }
  .lesson-body .file-list.compact {
    margin-top: var(--space-3);
    gap: 2px;
  }
  .lesson-body .compact .file-row {
    grid-template-columns: 20px minmax(0,1fr);
    padding: 6px 0;
    background: transparent;
    box-shadow: none;
  }
  .lesson-body .file-ic {
    color: var(--muted);
  }
  .lesson-body .file-copy {
    display: grid;
    min-width: 0;
  }
  .lesson-body .file-copy strong {
    font-size: var(--fs-meta);
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  .lesson-body .file-copy .meta {
    font-size: var(--fs-micro);
  }
  .lesson-body .link-more {
    margin: var(--space-2) 0 0 -12px;
  }
  .lesson-body .sep {
    border: 0;
    height: 1px;
    background: var(--line);
    margin: var(--space-7) 0 var(--space-6);
  }
  .lesson-body .lpanel>.sep:first-child {
    display: none;
  }
  .lesson-body .ov-course .sub {
    margin-top: 4px;
    max-width: 68ch;
  }
  .lesson-body .facts,
  .lesson-body .checks,
  .lesson-body .req-list {
    padding: 0;
    list-style: none;
  }
  /* list components space their items with the grid gap; the base li+li margin is for prose («Текст») only */
  .lesson-body .facts li,
  .lesson-body .checks li,
  .lesson-body .req-list li,
  .lesson-body .file-list>li {
    margin: 0;
  }
  .lesson-body .author-copy>p+p {
    margin-top: 0;
  }
  .lesson-body .facts {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: var(--space-3) var(--space-6);
    margin-top: var(--space-5);
  }
  .lesson-body .facts li {
    display: grid;
    grid-template-columns: 20px minmax(0,1fr);
    gap: var(--space-3);
    align-items: start;
    font: 500 var(--fs-ui)/1.5 var(--font-body);
  }
  .lesson-body .facts svg {
    color: var(--muted);
    margin-top: 1px;
  }
  .lesson-body .block-h {
    margin-top: var(--space-6);
    font: 700 18px/1.4 var(--font-body);
  }
  .lesson-body .checks {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: var(--space-4) var(--space-6);
    margin-top: var(--space-4);
  }
  .lesson-body .checks li {
    display: grid;
    grid-template-columns: 18px minmax(0,1fr);
    gap: var(--space-3);
    font-size: var(--fs-ui);
    line-height: 1.55;
  }
  .lesson-body .chk {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    stroke-width: 2;
  }
  .lesson-body .more-learn {
    margin-top: var(--space-3);
  }
  .lesson-body details>summary {
    list-style: none;
  }
  .lesson-body details>summary::-webkit-details-marker {
    display: none;
  }
  .lesson-body summary.button {
    width: fit-content;
    margin-left: -12px;
  }
  .lesson-body details .chev {
    transition: transform var(--duration-mid) var(--ease);
  }
  .lesson-body details[open]>summary .chev {
    transform: rotate(180deg);
  }
  .lesson-body .when-open {
    display: none;
  }
  .lesson-body details[open]>summary .when-open {
    display: inline;
  }
  .lesson-body details[open]>summary .when-closed {
    display: none;
  }
  .lesson-body .author {
    display: grid;
    grid-template-columns: 72px minmax(0,1fr);
    gap: var(--space-4);
    margin-top: var(--space-6);
    padding: 20px var(--space-5);
  }
  .lesson-body .author.no-photo {
    grid-template-columns: minmax(0,1fr);
  }
  .lesson-body .author img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-card);
    object-fit: cover;
  }
  .lesson-body .author-copy p {
    max-width: 72ch;
    font-size: var(--fs-ui);
    line-height: 1.6;
  }
  .lesson-body .author-copy .eyebrow {
    margin-bottom: 4px;
    color: var(--muted);
    font: 700 var(--fs-micro)/1.4 var(--font-body);
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .lesson-body .author-more {
    margin-top: var(--space-1);
  }
  .lesson-body .author-more>p {
    margin: var(--space-2) 0;
  }
  .lesson-body .req {
    margin-top: var(--space-4);
  }
  .lesson-body .req>summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 var(--space-5) 0 20px;
    border-radius: var(--radius-card);
    font: 700 var(--fs-h3)/1.4 var(--font-body);
    cursor: pointer;
    transition: background-color var(--duration-fast) var(--ease);
  }
  .lesson-body .req>summary:hover {
    background: var(--fill);
  }
  .lesson-body .req>summary .chev {
    margin-left: auto;
  }
  .lesson-body .req-list {
    display: grid;
    gap: var(--space-3);
    margin: 0;
    padding: 0 var(--space-5) 20px 20px;
  }
  .lesson-body .req-list li {
    position: relative;
    max-width: 72ch;
    padding-left: 18px;
    font-size: var(--fs-ui);
    line-height: 1.6;
  }
  .lesson-body .req-list li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: .72em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
  }

  /* «Текст», «Нотатки» */
  .lesson-body .reading {
    max-width: 720px; /* 62-68 characters; 68ch at 18 px Montserrat is 811 */
    color: var(--prose);
    font-size: var(--fs-read);
    line-height: 1.7;
  }
  .lesson-body .reading .panel-h {
    color: var(--ink);
    margin-bottom: var(--space-4);
  }
  .lesson-body .note-form {
    display: grid;
    gap: var(--space-3);
    max-width: 68ch;
    margin-top: var(--space-4);
  }
  .lesson-body .note-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
  }
  .lesson-body .time-chip {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--fill);
    font: 600 var(--fs-micro)/1 var(--font-body);
    font-variant-numeric: tabular-nums;
  }
  .lesson-body textarea {
    border: 1px solid var(--field);
    border-radius: var(--radius);
  }
  .lesson-body textarea:hover {
    border-color: var(--ink);
  }
  .lesson-body .notes {
    display: grid;
    gap: var(--space-4);
    max-width: 68ch;
    margin-top: var(--space-5);
  }

  /* program on the right: the wrapper sticks, the card scrolls inside, a fade at the bottom while there is more */
  .lesson-body .sidebar-wrap {
    position: sticky;
    top: var(--space-5);
    min-width: 0;
  }
  .lesson-body .sidebar-wrap.has-more::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    border-radius: 0 0 var(--radius-card) var(--radius-card);
    pointer-events: none;
    background: linear-gradient(180deg,rgba(255,255,255,0),var(--surface) 85%);
  }
  .lesson-body .sidebar {
    position: relative;
    max-height: calc(100vh - 2*var(--space-5));
    overflow: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: var(--radius-card);
    box-shadow: var(--sh-1);
    scrollbar-width: thin;
  }
  .lesson-body .sidebar-title {
    padding: 20px 20px var(--space-4);
    border-bottom: 0;
  }
  .lesson-body .sidebar-title h2 {
    font: 700 18px/1.35 var(--font-body);
  }
  .lesson-body .sidebar-title .meta {
    margin-top: 2px;
  }
  .lesson-body .program-section {
    border-bottom: 0;
    box-shadow: inset 0 1px 0 var(--line);
  }
  .lesson-body .section-toggle {
    align-items: flex-start;
    gap: var(--space-3);
    padding: 14px 20px;
    background: transparent;
    cursor: pointer;
    transition: background-color var(--duration-fast) var(--ease);
  }
  .lesson-body .section-toggle:hover {
    background: var(--subtle);
  }
  .lesson-body .section-toggle>span {
    display: grid;
    gap: 4px;
    flex: 1;
  }
  .lesson-body .section-toggle strong {
    font: 700 var(--fs-ui)/1.4 var(--font-body);
  }
  .lesson-body .section-toggle .meta {
    margin: 0;
    font-size: 13px;
  }
  .lesson-body .section-toggle .bar {
    height: 3px;
    margin-top: 4px;
    max-width: 160px;
  }
  .lesson-body .section-toggle .chev {
    margin-top: 2px;
    color: var(--muted);
    flex-shrink: 0;
  }
  .lesson-body .program-item {
    display: block;
    border: 0;
  }
  .lesson-body .program-item.current {
    background: transparent;
  }
  .lesson-body .step-button {
    display: grid;
    grid-template-columns: 20px minmax(0,1fr);
    gap: var(--space-3);
    min-height: 0;
    padding: 10px 20px 10px 17px;
    border: 0;
    border-left: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    font-size: var(--fs-meta);
    font-weight: 500;
    transform: none;
  }
  .lesson-body .step-button:hover {
    background: var(--subtle);
  }
  .lesson-body .step-button:focus-visible {
    outline-offset: -2px;
  }
  .lesson-body .step-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
    font-size: inherit; /* the old phone .step-copy 16px leaked here: the title keeps the step's 14 (SPEC-R3 2, 10) */
    line-height: 1.45;
  }
  .lesson-body .step-copy .meta {
    margin-top: 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
  }
  .lesson-body .step-icon {
    color: var(--muted);
    margin-top: 1px;
  }
  .lesson-body .program-item.current .step-button {
    background: var(--current);
    border-left-color: var(--accent);
    font-weight: 700;
  }
  .lesson-body .program-item.current .step-icon {
    color: var(--accent);
  }
  .lesson-body .done-dot {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
  }
  .lesson-body .done-dot .step-icon {
    width: 14px;
    height: 14px;
    margin: 0;
    color: var(--success);
    stroke-width: 2.2;
  }
  .lesson-body .footer {
    border-top: 1px solid var(--line);
  }

  /* tablet: one column, the program becomes the first tab */
  @media (max-width:1023px) {
    .lesson-body {
      --gutter: 24px;
    }
    .lesson-body .seek {
      --seek-reach: 28px;
    }
    .lesson-body .container {
      width: calc(100% - 2*var(--gutter));
    }
    .lesson-body .study {
      display: block;
    }
    .lesson-body .sidebar-wrap {
      display: none;
    }
    .lesson-body .tab-program {
      display: inline-flex;
    }
    .lesson-body .lesson-page {
      padding-bottom: var(--space-7);
    }
    .lesson-body .lesson-page~.footer {
      padding-bottom: 0;
    }
    .lesson-body .program-panel {
      padding-top: var(--space-4);
      margin-inline: calc(-1*var(--space-6));
    }
    .lesson-body .program-panel .sidebar-title {
      padding-inline: var(--space-6);
    }
    :is(.lesson-body,.slim-body) .top {
      position: sticky;
      top: 0;
      z-index: 30;
    }
    :is(.lesson-body,.slim-body) .top-inner {
      min-height: 56px;
      gap: var(--space-2);
    }
    .lesson-body .brand {
      display: none;
    }
    :is(.lesson-body,.slim-body) .top-title {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    :is(.lesson-body,.slim-body) .top-actions {
      gap: 4px;
    }
    /* the ring looks 36 (mock) but the touch target stays 44: the button is transparent, the span draws the ring */
    .lesson-body .ring {
      width: 44px;
      height: 44px;
      padding: 0;
      background: transparent;
    }
    .lesson-body .ring span {
      position: relative;
      z-index: 0;
      width: 36px;
      height: 36px;
      background: conic-gradient(var(--accent) var(--progress),var(--fill) 0);
      font-size: 9.5px;
    }
    .lesson-body .ring span::before {
      content: "";
      position: absolute;
      z-index: -1;
      inset: 3.5px;
      border-radius: 50%;
      background: var(--surface);
    }
    .lesson-body .ring:hover span {
      background: conic-gradient(var(--accent) var(--progress),var(--fill) 0);
    }
    .lesson-body .ring:hover span::before {
      background: var(--subtle);
    }
    .lesson-body .player {
      padding: 0;
      min-height: 0;
    }
  }

  /* phone: player and sheet edge to edge, «Наступна лекція» in a sticky bar at the bottom */
  @media (max-width:767px) {
    .lesson-body {
      --gutter: 0px;
      --fs-h1: 21px;
      --fs-h2: 18px;
      --fs-lead: 17px;
      --fs-read: 17px;
    }
    .lesson-body .container {
      width: 100%;
    }
    .lesson-body .top-inner {
      padding-inline: 4px;
    }
    .lesson-body .lesson-page {
      padding: 0;
    }
    .lesson-body .player,
    .lesson-body .video-pending {
      border-radius: 0;
      box-shadow: none;
    }
    .lesson-body .video-pending {
      padding: var(--space-4);
    }
    .lesson-body .sheet {
      margin-top: 0;
      border-radius: 0;
      box-shadow: none;
      padding: var(--space-4) var(--space-4) var(--space-6);
    }
    .lesson-body .lesson-nav {
      margin-top: var(--space-4);
    }
    .lesson-body .lesson-nav .row {
      flex-wrap: nowrap;
      width: 100%;
    }
    .lesson-body .lesson-nav .mark-form {
      flex: 1 1 0;
      min-width: 0;
    }
    .lesson-body .lesson-nav .mark {
      width: 100%;
      padding-inline: 12px;
    }
    .lesson-body .next-inline {
      display: none;
    }
    .lesson-body .button.small {
      min-height: 44px;
    }
    .lesson-body .nextbar {
      display: block;
      position: sticky;
      bottom: 0;
      left: auto;
      right: auto;
      z-index: 30;
      border-top: 0;
      background: var(--surface);
      box-shadow: 0 -1px 0 var(--line),0 -6px 20px rgba(23,23,23,.06);
      padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
    }
    .lesson-body .nextbar .button {
      width: 100%;
      min-height: 48px;
    }
    .lesson-body.keyboard-open .nextbar {
      position: static;
    }
    .lesson-body .tabs-wrap {
      margin: var(--space-4) calc(-1*var(--space-4)) 0;
    }
    .lesson-body .ltabs {
      padding-inline: var(--space-4);
      scroll-padding-inline: var(--space-4);
    }
    .lesson-body .lpanel {
      padding-top: var(--space-5);
    }
    .lesson-body .program-panel {
      margin-inline: calc(-1*var(--space-4));
      padding-top: var(--space-2);
    }
    .lesson-body .program-panel .sidebar-title,
    .lesson-body .program-panel .section-toggle {
      padding-inline: var(--space-4);
    }
    .lesson-body .program-panel .step-button {
      padding: 10px var(--space-4) 10px 13px;
    }
    .lesson-body .brief-grid,
    .lesson-body .checks,
    .lesson-body .facts {
      grid-template-columns: minmax(0,1fr);
    }
    .lesson-body .facts {
      gap: var(--space-3);
    }
    .lesson-body .take,
    .lesson-body .files-card,
    .lesson-body .author {
      padding: var(--space-4);
    }
    .lesson-body .author {
      grid-template-columns: 56px minmax(0,1fr);
      gap: var(--space-3);
    }
    .lesson-body .author img {
      width: 56px;
      height: 56px;
    }
    .lesson-body .sep {
      margin: var(--space-6) 0 var(--space-5);
    }
    .lesson-body .req>summary {
      padding-inline: var(--space-4);
    }
    .lesson-body .req-list {
      padding: 0 var(--space-4) var(--space-4);
    }
    .lesson-body .player-center>.play-big {
      width: 64px;
      height: 44px;
    }
    .lesson-body .player-center>.play-big svg {
      width: 22px;
      height: 22px;
    }
    .lesson-body .player.has-video .player-bottom {
      padding-inline: var(--space-2);
    }
    .lesson-body .footer-inner {
      padding-inline: var(--space-4);
    }
  }

  /* 320-379: the actions row wraps, arrows on one line, «Позначити пройденою» full width below (the spec says
     <=359; at 360 the label already breaks into two lines inside the button, so the row wraps up to 379) */
  @media (max-width:379px) {
    .lesson-body .lesson-nav .row {
      flex-wrap: wrap;
    }
    .lesson-body .lesson-nav .mark-form {
      flex: 1 1 100%;
      margin-left: 0;
    }
    .lesson-body .player-controls {
      gap: 2px;
    }
    .lesson-body .player-controls .time {
      margin-left: 4px;
    }
    .lesson-body .player-controls select.speed {
      padding: 0 6px;
    }
  }

  /* Redesign round 3 (17.10.2026): «Мої курси», course page, quiz - design/r3/mock-*.html and SPEC-R3. The three
     screens carry lesson-body too, so the R2 header, ring, menu, program and buttons apply as they are; the rules
     below are only what is new or different. The dark band is shared with «Акаунт», so it is not scoped. */
  .band {
    background: var(--dark);
    color: var(--on-dark);
  }
  .band-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-5);
    padding-top: var(--space-5);
  }
  .band-id {
    padding-bottom: var(--space-4);
    min-width: 0;
  }
  .band-name {
    margin: 0;
    font: 500 var(--fs-meta)/1.45 var(--font-body);
    color: rgba(255,255,255,.72);
  }
  .band h1 {
    margin: 2px 0 0;
    font: 600 var(--fs-h1)/1.3 var(--font-display);
    letter-spacing: -.01em;
    color: var(--on-dark);
  }
  .navtabs {
    display: flex;
    gap: var(--space-5);
  }
  .navtab {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 2px;
    color: rgba(255,255,255,.72);
    font: 600 var(--fs-ui)/1 var(--font-body);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease);
  }
  .navtab:hover {
    color: var(--on-dark);
  }
  .navtab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform var(--duration-mid) var(--ease);
  }
  .navtab[aria-current=page] {
    color: var(--on-dark);
  }
  .navtab[aria-current=page]::after {
    transform: scaleX(1);
  }
  .navtab:focus-visible {
    outline: 2px solid var(--on-dark);
    outline-offset: -2px;
    border-radius: var(--radius);
  }

  /* header of «Мої курси» and the course page: the tagline instead of the course title, the logo stays on a phone */
  :is(.lesson-body,.slim-body) .top-tagline {
    font: 600 var(--fs-ui)/1.3 var(--font-body);
    color: var(--muted);
  }
  :is(.lesson-body,.slim-body) .top-tagline~.top-actions {
    margin-left: auto;
  }
  .lesson-body .eyebrow {
    margin: 0;
    font: 700 var(--fs-micro)/1.4 var(--font-body);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .lesson-body .prog {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-4);
    flex-wrap: wrap;
  }
  .lesson-body .prog .bar {
    width: min(240px,100%);
  }
  .lesson-body .prog .meta {
    margin: 0;
    font-size: 13px;
  }
  .lesson-body .cover-fallback {
    display: grid;
    place-items: center;
    aspect-ratio: 16/9;
    width: 100%;
    background: linear-gradient(135deg,var(--subtle),var(--fill));
    color: #b9b9b4;
  }
  .lesson-body .cover-fallback svg {
    width: 44px;
    height: 44px;
    stroke-width: 1.2;
  }
  .lesson-body .mobile-bar {
    display: none;
  }

  /* «Мої курси» */
  .cab-body .cab {
    padding-block: var(--space-6) var(--space-7);
  }
  .cab-body .resume {
    display: grid;
    grid-template-columns: 400px minmax(0,1fr);
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--sh-1);
    overflow: hidden;
  }
  .cab-body .resume-thumb {
    display: none;
  }
  .cab-body .resume-cover {
    aspect-ratio: 16/9;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--subtle);
  }
  .cab-body .resume-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: var(--space-5) var(--space-6);
  }
  .cab-body .resume-course {
    margin: var(--space-2) 0 0;
    font: 600 var(--fs-meta)/1.45 var(--font-body);
    color: var(--muted);
  }
  .cab-body .resume h2 {
    margin: 2px 0 0;
    max-width: 44ch;
    font: 700 22px/1.35 var(--font-body);
    overflow-wrap: anywhere;
  }
  .cab-body .resume-meta {
    margin: var(--space-2) 0 0;
  }
  .cab-body .resume-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
    flex-wrap: wrap;
  }
  .cab-body .resume-access {
    margin: var(--space-3) 0 0;
    font-size: 13px;
  }
  .cab-body .courses {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: var(--space-5);
    margin-top: var(--space-5);
  }
  .cab-body .ccard {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--sh-1);
    overflow: hidden;
    transition: box-shadow var(--duration-fast) var(--ease);
  }
  .cab-body .ccard:hover {
    box-shadow: var(--sh-2);
  }
  .cab-body .ccard-cover {
    aspect-ratio: 16/9;
    width: 100%;
    height: auto;
    object-fit: cover;
    background: var(--subtle);
  }
  .cab-body .ccard-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: var(--space-4) 20px 20px;
  }
  .cab-body .ccard h3 {
    margin: 0;
    font: 700 17px/1.35 var(--font-body);
  }
  .cab-body .ccard h3 a {
    color: inherit;
    text-decoration: none;
  }
  /* the whole card is the title link; the small button in the corner is a picture of it for the eye */
  .cab-body .ccard h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius-card);
  }
  .cab-body .ccard h3 a:focus-visible {
    outline: 0;
  }
  .cab-body .ccard:has(h3 a:focus-visible) {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
  }
  .cab-body .ccard-sub {
    margin: 6px 0 0;
    font-size: var(--fs-meta);
    line-height: 1.5;
    color: var(--muted);
  }
  .cab-body .ccard-meta,
  .cab-body .ccard-access {
    margin: var(--space-2) 0 0;
    font-size: 13px;
  }
  .cab-body .ccard-access {
    margin-top: 2px;
  }
  .cab-body .ccard-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: auto;
    padding-top: var(--space-4);
    flex-wrap: wrap;
  }
  .cab-body .state {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--fill);
    font: 600 var(--fs-micro)/1 var(--font-body);
    color: var(--ink);
    white-space: nowrap;
  }
  .cab-body .ccard .button {
    position: relative;
    z-index: 1;
  }
  .cab-body .ccard:hover .button:not(.primary) {
    background: var(--fill-hover);
  }
  .cab-body .empty {
    margin: 0;
    padding: var(--space-6);
    border: 0;
    border-radius: var(--radius-card);
    box-shadow: var(--sh-1);
    color: var(--ink);
  }

  /* course page: the hero card, then the description on the left and the program (360, sticky) on the right */
  .course-body .course-page {
    padding-block: var(--space-5) var(--space-7);
  }
  .course-body .course-hero {
    display: grid;
    grid-template-columns: 440px minmax(0,1fr);
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--sh-1);
    overflow: hidden;
  }
  .course-body .course-hero.no-cover {
    grid-template-columns: minmax(0,1fr);
  }
  .course-body .resume-cover {
    aspect-ratio: 16/9;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--subtle);
  }
  .course-body .hero-body {
    min-width: 0;
    padding: var(--space-6);
  }
  .course-body .hero-body h1 {
    margin: 6px 0 0;
    font: 600 var(--fs-h1)/1.3 var(--font-display);
    letter-spacing: -.01em;
    overflow-wrap: anywhere;
  }
  .course-body .hero-sub {
    margin: var(--space-2) 0 0;
    max-width: 60ch;
    font: 500 17px/1.55 var(--font-body);
  }
  .course-body .hero-facts {
    margin: var(--space-3) 0 0;
  }
  .course-body .hero-cta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-5);
    flex-wrap: wrap;
  }
  .course-body .hero-cta .meta {
    margin: 0;
    max-width: 36ch;
  }
  .course-body .course-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) 360px;
    gap: var(--space-5);
    align-items: start;
    margin-top: var(--space-5);
  }
  .course-body .course-grid .sidebar-wrap {
    grid-column: 2;
    grid-row: 1;
  }
  .course-body .course-grid .about {
    grid-column: 1;
    grid-row: 1;
  }
  /* a course without a description (no course_meta): the program alone, as wide as the description would be */
  .course-body .course-grid.no-about {
    grid-template-columns: minmax(0,760px);
  }
  .course-body .course-grid.no-about .sidebar-wrap {
    grid-column: 1;
    position: static;
  }
  .course-body .course-grid.no-about .sidebar {
    max-height: none;
  }
  .course-body .about {
    padding: var(--space-6);
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--sh-1);
  }
  .course-body .about-h {
    margin: 0;
    font: 700 var(--fs-h2)/1.35 var(--font-body);
  }
  .course-body .about-sec+.about-sec {
    margin-top: var(--space-7);
  }
  .course-body .about .checks,
  .course-body .about .facts {
    margin-top: var(--space-4);
  }
  .course-body .about .author {
    grid-template-columns: 96px minmax(0,1fr);
    margin-top: var(--space-4);
  }
  .course-body .about .author.no-photo {
    grid-template-columns: minmax(0,1fr);
  }
  .course-body .about .author img {
    width: 96px;
    height: 96px;
  }
  .course-body .about .req-list {
    margin-top: var(--space-4);
    padding: 0;
  }

  /* quiz: a 760 column without the program (focus mode), the action under the options */
  .quiz-body .quiz-page {
    padding-block: var(--space-5) var(--space-7);
  }
  .quiz-body .quiz-col {
    width: min(760px,100%);
    margin-inline: auto;
  }
  .quiz-body .back-link {
    margin-left: -12px;
  }
  .quiz-body .quiz-sheet {
    margin-top: var(--space-3);
    padding: var(--space-5) var(--space-6) var(--space-6);
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--sh-1);
  }
  .quiz-body .quiz-h1 {
    margin: 0;
    font: 600 var(--fs-ui)/1.45 var(--font-body);
    color: var(--ink);
  }
  .quiz-body .quiz-meta {
    margin: 2px 0 0;
  }
  .quiz-body .quiz-lead {
    margin: var(--space-5) 0 0;
    max-width: 62ch;
    font: 500 17px/1.55 var(--font-body);
  }
  .quiz-body .qprog {
    margin-top: var(--space-5);
  }
  .quiz-body .qprog-row {
    margin: 0;
    font-size: var(--fs-meta);
  }
  .quiz-body .qprog-row strong {
    font: 700 var(--fs-meta)/1.45 var(--font-body);
    font-variant-numeric: tabular-nums;
  }
  .quiz-body .segs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 4px;
    margin-top: var(--space-2);
  }
  .quiz-body .segs span {
    height: 4px;
    border-radius: 999px;
    background: var(--fill);
  }
  .quiz-body .segs span.on {
    background: var(--accent);
  }
  .quiz-body .question {
    margin: var(--space-5) 0 0;
    max-width: 62ch;
    font: 600 20px/1.5 var(--font-body);
    overflow-wrap: anywhere;
  }
  .quiz-body .answers {
    display: grid;
    gap: var(--space-2);
    min-width: 0;
    margin: var(--space-5) 0 0;
    padding: 0;
    border: 0;
  }
  .quiz-body .opt {
    position: relative;
    display: grid;
    grid-template-columns: 22px minmax(0,1fr);
    gap: var(--space-3);
    align-items: start;
    justify-content: stretch;
    min-height: 0;
    padding: 14px 20px;
    border: 0;
    border-radius: var(--radius-card);
    background: var(--subtle);
    color: var(--ink);
    font: 500 16px/1.55 var(--font-body);
    text-align: left;
    white-space: normal;
    cursor: pointer;
    transform: none;
    transition: background-color var(--duration-fast) var(--ease),box-shadow var(--duration-fast) var(--ease);
  }
  .quiz-body .opt:hover {
    background: var(--fill);
  }
  .quiz-body .opt:has(input:focus-visible) {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
  }
  .quiz-body .radio {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--muted);
    transition: box-shadow var(--duration-fast) var(--ease);
  }
  .quiz-body .opt:has(input:checked) {
    background: var(--surface);
    box-shadow: inset 0 0 0 2px var(--ink);
  }
  .quiz-body .opt:has(input:checked) .radio {
    box-shadow: inset 0 0 0 7px var(--ink);
  }
  /* after the check: right = green, your wrong one = ink frame, the rest muted; the sign and the word carry the
     state, not the colour alone; no red on a wrong answer (red is only «Далі» and the progress) */
  .quiz-body .answers.locked .opt {
    cursor: default;
  }
  .quiz-body .answers.locked .opt:hover {
    background: var(--subtle);
  }
  .quiz-body .verdict {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--space-2);
    font: 700 13px/1.4 var(--font-body);
  }
  .quiz-body .expl {
    display: block;
    margin-top: 2px;
    font: 400 15px/1.55 var(--font-body);
    color: var(--ink);
  }
  .quiz-body .opt-text {
    display: block;
  }
  .quiz-body .mark {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border-radius: 50%;
  }
  .quiz-body .mark svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.4;
  }
  .quiz-body .opt.is-correct,
  .quiz-body .answers.locked .opt.is-correct:hover {
    background: var(--success-bg);
    box-shadow: inset 4px 0 0 var(--success);
  }
  .quiz-body .opt.is-correct .mark {
    background: var(--success);
    color: var(--on-dark);
  }
  .quiz-body .opt.is-correct .verdict {
    color: var(--success);
  }
  .quiz-body .opt.is-wrong.is-chosen,
  .quiz-body .answers.locked .opt.is-wrong.is-chosen:hover {
    background: var(--surface);
    box-shadow: inset 0 0 0 2px var(--ink);
  }
  .quiz-body .opt.is-wrong.is-chosen .mark {
    background: var(--ink);
    color: var(--on-dark);
  }
  .quiz-body .opt.is-other .mark {
    box-shadow: inset 0 0 0 1.5px #c4c4c0;
  }
  .quiz-body .opt.is-other .opt-text,
  .quiz-body .opt.is-other .verdict,
  .quiz-body .opt.is-other .expl {
    color: var(--muted);
  }
  .quiz-body .quiz-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
  }
  .quiz-body .quiz-actions form {
    margin: 0;
  }
  .quiz-body .result-number {
    margin: var(--space-5) 0 0;
  }
  .quiz-body .quiz-takeaways {
    margin-top: var(--space-5);
  }

  @media (max-width:1199px) {
    .cab-body .courses {
      grid-template-columns: repeat(2,minmax(0,1fr));
    }
    .cab-body .resume {
      grid-template-columns: 320px minmax(0,1fr);
    }
    .course-body .course-hero {
      grid-template-columns: 360px minmax(0,1fr);
    }
  }
  @media (max-width:1023px) {
    .cab-body .brand,
    .course-body .brand {
      display: flex;
    }
    .course-body .course-grid,
    .course-body .course-grid.no-about {
      grid-template-columns: minmax(0,1fr);
    }
    .course-body .course-grid .sidebar-wrap {
      display: block;
      position: static;
      grid-column: 1;
      grid-row: 1;
    }
    .course-body .course-grid .about {
      grid-column: 1;
      grid-row: 2;
    }
    .course-body .course-grid .sidebar {
      display: block;
      max-height: none;
    }
    .course-body .course-hero {
      grid-template-columns: minmax(0,1fr);
    }
    .course-body .course-hero .resume-cover {
      height: auto;
      max-height: 280px;
    }
  }

  /* phone: the main action of the course page and the quiz moves to the sticky bar at the bottom */
  @media (max-width:767px) {
    .band-inner {
      flex-direction: column;
      align-items: stretch;
      gap: var(--space-2);
      padding: var(--space-4) var(--space-4) 0;
    }
    .band-id {
      padding-bottom: 0;
    }
    .band h1 {
      font-size: 21px;
    }
    .band .navtabs {
      margin: 0 calc(-1 * var(--space-4)); /* the base .navtabs margin-top 24 made the band 146 px, not 122 */
      padding: 0 var(--space-4);
    }
    .course-body .top-tagline {
      display: none;
    }
    .cab-body .cab {
      padding: var(--space-4) var(--space-4) var(--space-6);
    }
    .cab-body .resume {
      grid-template-columns: minmax(0,1fr);
    }
    .cab-body .resume-cover {
      display: none;
    }
    .cab-body .resume-body {
      padding: var(--space-4);
    }
    .cab-body .resume-head {
      display: grid;
      grid-template-columns: 96px minmax(0,1fr);
      gap: var(--space-3);
      align-items: center;
    }
    .cab-body .resume-thumb {
      display: block;
      width: 96px;
      height: auto;
      aspect-ratio: 16/9;
      border-radius: 6px;
      object-fit: cover;
    }
    .cab-body .resume-head .resume-course {
      margin-top: 2px;
    }
    .cab-body .resume h2 {
      margin-top: var(--space-3);
      font-size: 18px;
    }
    .cab-body .resume-actions {
      margin-top: var(--space-4);
    }
    .cab-body .resume-actions .primary {
      width: 100%;
      min-height: 48px;
    }
    .cab-body .resume-actions .tertiary {
      margin-left: -12px;
    }
    .cab-body .courses {
      grid-template-columns: minmax(0,1fr);
      gap: var(--space-3);
      margin-top: var(--space-4);
    }
    .cab-body .ccard {
      display: grid;
      grid-template-columns: 96px minmax(0,1fr);
      gap: 0 var(--space-3);
      padding: var(--space-4);
    }
    .cab-body .ccard-cover,
    .cab-body .ccard .cover-fallback {
      grid-row: 1/4;
      width: 96px;
      border-radius: 6px;
      align-self: start;
    }
    .lesson-body .cover-fallback svg {
      width: 24px;
      height: 24px;
    }
    .cab-body .ccard-body {
      display: contents;
    }
    .cab-body .ccard h3 {
      grid-column: 2;
      font-size: 16px;
      align-self: end;
    }
    .cab-body .ccard-meta,
    .cab-body .ccard-access {
      grid-column: 2;
      margin-top: 2px;
      align-self: start;
    }
    .cab-body .ccard-sub {
      display: none;
    }
    .cab-body .ccard-foot {
      grid-column: 1/-1;
      padding-top: var(--space-3);
    }
    .cab-body .ccard .button.small {
      min-height: 44px;
    }
    .course-body .course-page {
      padding: 0 0 var(--space-6);
    }
    .course-body .course-hero {
      border-radius: 0;
      box-shadow: none;
    }
    .course-body .course-hero .resume-cover {
      display: none;
    }
    .course-body .hero-body {
      padding: var(--space-4);
    }
    .course-body .hero-sub {
      font-size: 16px;
    }
    .course-body .hero-cta .primary {
      display: none;
    }
    .course-body .hero-cta {
      margin-top: var(--space-3);
    }
    .course-body .course-grid {
      margin-top: var(--space-3);
      gap: var(--space-3);
    }
    .course-body .course-grid .sidebar {
      border-radius: 0;
      box-shadow: none;
    }
    .course-body .about {
      padding: var(--space-5) var(--space-4);
      border-radius: 0;
      box-shadow: none;
    }
    .course-body .about .author {
      grid-template-columns: 56px minmax(0,1fr);
    }
    .course-body .about .author img {
      width: 56px;
      height: 56px;
    }
    .course-body .about .req-list {
      padding: 0;
    }
    .course-body .mobile-bar,
    .quiz-body .quiz-actions {
      position: sticky;
      bottom: 0;
      z-index: 30;
      background: var(--surface);
      box-shadow: 0 -1px 0 var(--line),0 -6px 20px rgba(23,23,23,.06);
      padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
    }
    .course-body .mobile-bar {
      display: block;
    }
    .course-body .mobile-bar:empty {
      display: none;
    }
    .course-body .mobile-bar .button,
    .quiz-body .quiz-actions .primary {
      width: 100%;
      min-height: 48px;
    }
    .lesson-body.keyboard-open .mobile-bar,
    .lesson-body.keyboard-open .quiz-actions {
      position: static;
    }
    .quiz-body .quiz-page {
      padding: 0 0 var(--space-6);
    }
    .quiz-body .back-link {
      min-height: 44px;
      margin: var(--space-2) 0 0 4px;
    }
    .quiz-body .quiz-sheet {
      margin-top: var(--space-2);
      padding: var(--space-4) var(--space-4) 0;
      border-radius: 0;
      box-shadow: none;
    }
    .quiz-body .question {
      margin-top: var(--space-4);
      font-size: 17px;
    }
    .quiz-body .answers {
      margin-top: var(--space-4);
    }
    .quiz-body .opt {
      padding: 12px var(--space-4);
      font-size: 15px;
    }
    .quiz-body .quiz-actions {
      margin: var(--space-4) calc(-1*var(--space-4)) 0;
    }
    .quiz-body .quiz-actions:has(form+.primary) .primary,
    .quiz-body .quiz-actions form {
      flex: 1 1 0;
      width: auto;
    }
    .quiz-body .quiz-actions form button {
      width: 100%;
      min-height: 48px;
    }
  }

  /* V3 (Taliya D3): the ring never wraps its number; a full ring shows a check instead of '100%', which lay on the
     outline at 390 and broke into two lines at 1440 */
  .lesson-body .ring span {
    white-space: nowrap;
  }
  .lesson-body .ring .ring-check {
    width: 16px;
    height: 16px;
    color: var(--accent);
    stroke-width: 2.4;
  }

  /* V4 (18.10.2026). P1: the other screens (вхід, 404, 403, каталог, підтримка...) carry slim-body and share the
     compact header above. P3: the «Акаунт» headings are Montserrat 700 20 on every width */
  .cab-body .account h2 {
    font: 700 20px/1.3 var(--font-body);
  }
  /* the slim header sits where the lesson-body one does: the same gutter on a tablet, edge to edge on a phone */
  @media (max-width:1023px) {
    .slim-body .top .container {
      width: calc(100% - 48px);
    }
  }
  @media (max-width:767px) {
    .slim-body .top .container {
      width: 100%;
    }
    .slim-body .top-inner {
      padding-inline: 4px;
    }
    /* P7: a lecture without video - a grey strip in the place of the player, so it reads as the video's place and
       the lecture H1 below is the first heading */
    .lesson-body .video-pending {
      background: var(--fill);
    }
    .lesson-body .video-pending h2 {
      font-size: 16px;
    }
    .lesson-body .video-pending button {
      background: var(--surface);
    }
    .lesson-body .video-pending button:hover {
      background: var(--subtle);
    }
    /* Nika P4: the tab row wraps instead of scrolling past the right edge, so «Нотатки» and the «Матеріали» badge
       are always on screen; each tab carries the row line, so a wrapped row keeps its own line */
    .lesson-body .tabs-wrap {
      box-shadow: none;
    }
    .lesson-body .ltabs {
      flex-wrap: wrap;
      overflow-x: visible;
      gap: 0;
    }
    .lesson-body .tab {
      flex: 1 0 auto;
      padding: 0 12px;
      box-shadow: inset 0 -1px 0 var(--line);
    }
    .lesson-body .tabs-wrap.has-more::after {
      display: none;
    }
  }
  /* P5: the tagline does not fit next to the logo and the menu */
  @media (max-width:389px) {
    :is(.lesson-body,.slim-body) .top-tagline {
      display: none;
    }
  }
  /* P6: the lecture H1 took 4-5 lines of Unbounded 21 at 320 */
  @media (max-width:359px) {
    .lesson-body .lesson-title h1 {
      font-size: 19px;
    }
  }

  /* V5 (18.10.2026, Taliya SPEC-V5). «Курс пройдено»: the cover and the course title above H1, the summary on the
     green strip of a right answer, «Інші курси» the main action while the catalog has a course the student lacks */
  .slim-body .done-page {
    padding-block: var(--space-6) var(--space-7);
  }
  .done-page .done-col {
    width: min(760px,100%);
    margin-inline: auto;
  }
  .done-page .done-sheet {
    padding: var(--space-6);
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--sh-1);
  }
  .done-page .done-head {
    display: grid;
    grid-template-columns: 240px minmax(0,1fr);
    gap: var(--space-5);
    align-items: center;
  }
  .done-page .done-cover {
    display: block;
    width: 240px;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 6px;
    background: var(--subtle);
  }
  .done-page .cover-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg,var(--subtle),var(--fill));
    color: #b9b9b4;
  }
  .done-page .cover-fallback svg {
    width: 44px;
    height: 44px;
    stroke-width: 1.2;
  }
  .done-page .done-course {
    margin: 0;
    font: 600 var(--fs-meta)/1.45 var(--font-body);
    color: var(--muted);
  }
  .done-page .done-head h1 {
    margin: 2px 0 0;
    font: 600 var(--fs-h1)/1.3 var(--font-display);
    letter-spacing: -.01em;
  }
  .done-page .done-lead {
    margin: var(--space-2) 0 0;
    font: 500 17px/1.55 var(--font-body);
  }
  .done-page .done-stats {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    margin: var(--space-6) 0 0;
    padding: 0;
    list-style: none;
    background: var(--success-bg);
    border-radius: var(--radius-card);
  }
  .done-page .done-stats li {
    display: grid;
    grid-template-columns: 22px minmax(0,1fr);
    gap: 4px var(--space-3);
    align-items: center;
    padding: var(--space-4) 20px;
  }
  .done-page .done-stats li+li {
    box-shadow: inset 1px 0 0 rgba(29,122,62,.18);
  }
  /* the base 'li+li' margin would push the 2nd and 3rd cell (and the recap / takeaway rows) down */
  .done-page .done-stats li,
  .quiz-body .recap-list li,
  .quiz-body .quiz-takeaways li {
    margin: 0;
  }
  .done-page .done-stats .mark {
    display: grid;
    place-items: center;
    grid-row: 1/3;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--success);
    color: var(--on-dark);
  }
  .done-page .done-stats .mark svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.4;
  }
  .done-page .done-stats strong,
  .done-page .done-stats .lbl {
    grid-column: 2;
  }
  .done-page .done-stats strong {
    font: 700 22px/1.2 var(--font-body);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .done-page .done-stats .lbl {
    font: 500 var(--fs-meta)/1.4 var(--font-body);
    color: var(--muted);
  }
  .done-page .done-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-6);
  }
  .done-page .done-actions .tertiary {
    margin-left: auto;
  }

  /* V5 quiz intro: the quiz title is the heading (22, was 15/600 under a 17 lead), the lead a step below it */
  .quiz-body .quiz-h1.is-intro {
    max-width: 44ch;
    font: 700 22px/1.35 var(--font-body);
    overflow-wrap: anywhere;
  }
  .quiz-body .quiz-lead {
    font: 400 16px/1.55 var(--font-body);
    text-wrap: pretty;
  }
  /* V5 quiz result: the score panel - green like a right answer, or neutral ink «варто повторити» (no red: red is
     only the action and the progress); the state is carried by the sign and the word too, not the colour alone */
  .quiz-body .score {
    display: grid;
    grid-template-columns: 40px minmax(0,1fr);
    gap: 0 var(--space-4);
    margin-top: var(--space-5);
    padding: 20px var(--space-5);
    border-radius: var(--radius-card);
  }
  .quiz-body .score p {
    margin: 0;
  }
  .quiz-body .score .mark {
    width: 40px;
    height: 40px;
    margin-top: 2px;
    color: var(--on-dark);
  }
  .quiz-body .score .mark svg {
    width: 22px;
    height: 22px;
  }
  .quiz-body .score-label {
    font: 700 13px/1.4 var(--font-body);
  }
  .quiz-body .score .score-num {
    margin-top: 2px;
    font: 700 36px/1.15 var(--font-body);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
  }
  .quiz-body .score .segs {
    width: min(200px,100%);
    margin-top: var(--space-3);
  }
  .quiz-body .score .segs span {
    height: 6px;
  }
  .quiz-body .score .score-hist {
    margin-top: var(--space-3);
  }
  .quiz-body .score.is-good {
    background: var(--success-bg);
    box-shadow: inset 4px 0 0 var(--success);
  }
  .quiz-body .score.is-good .mark,
  .quiz-body .score.is-good .segs span.on {
    background: var(--success);
  }
  .quiz-body .score.is-good .score-label {
    color: var(--success);
  }
  .quiz-body .score.is-low {
    background: var(--subtle);
    box-shadow: inset 4px 0 0 var(--ink);
  }
  .quiz-body .score.is-low .mark,
  .quiz-body .score.is-low .segs span.on {
    background: var(--ink);
  }
  .quiz-body .score.is-low .score-label {
    color: var(--ink);
  }
  /* V5c (Taliya ACCEPT-V5 З1): an empty segment on the panel tint - --fill is about 1:1 on --success-bg */
  .quiz-body .score.is-good .segs span:not(.on) {
    background: rgba(29,122,62,.18);
  }
  .quiz-body .score.is-low .segs span:not(.on) {
    background: rgba(23,23,23,.12);
  }
  .quiz-body .recap {
    grid-column: 1/-1;
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    box-shadow: inset 0 1px 0 var(--line);
  }
  .quiz-body .score .recap-lead {
    max-width: 62ch;
    font: 600 var(--fs-ui)/1.45 var(--font-body);
  }
  .quiz-body .recap-list {
    display: grid;
    gap: 6px;
    margin: var(--space-3) 0 0;
    padding: 0;
    list-style: none;
  }
  .quiz-body .recap-list a {
    display: grid;
    grid-template-columns: 20px 36px minmax(0,1fr) auto;
    gap: var(--space-2);
    align-items: center;
    min-height: var(--ctl-h);
    padding: 10px var(--space-4);
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--sh-1);
    color: var(--ink);
    font: 500 var(--fs-ui)/1.4 var(--font-body);
    text-decoration: none;
    transition: background-color var(--duration-fast) var(--ease);
  }
  .quiz-body .recap-list a:hover {
    background: var(--fill);
  }
  .quiz-body .recap-list a:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
  }
  .quiz-body .recap-list svg {
    color: var(--muted);
  }
  .quiz-body .recap-code {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }
  .quiz-body .recap-min {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
  }
  .quiz-body .quiz-takeaways {
    margin-top: var(--space-6);
  }
  .quiz-body .quiz-takeaways h2 {
    margin: 0;
    font: 700 17px/1.4 var(--font-body);
  }
  .quiz-body .quiz-takeaways ul {
    display: grid;
    gap: var(--space-2);
    max-width: 62ch;
    margin: var(--space-3) 0 0;
    padding: 0;
    list-style: none;
  }
  .quiz-body .quiz-takeaways li {
    position: relative;
    padding-left: 20px;
    font: 400 16px/1.55 var(--font-body);
  }
  .quiz-body .quiz-takeaways li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: .68em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ink);
  }

  @media (max-width:767px) {
    .slim-body .done-page {
      width: 100%;
      padding: 0 0 var(--space-6);
    }
    .done-page .done-sheet {
      padding: 0 0 var(--space-5);
      border-radius: 0;
      box-shadow: none;
    }
    .done-page .done-head {
      grid-template-columns: minmax(0,1fr);
      gap: 0;
    }
    .done-page .done-cover {
      width: 100%;
      border-radius: 0;
    }
    .done-page .done-head>div:last-child {
      padding: var(--space-4) var(--space-4) 0;
    }
    .done-page .done-head h1 {
      font-size: 21px;
    }
    .done-page .done-lead {
      font-size: 16px;
    }
    .done-page .done-stats {
      margin: var(--space-5) var(--space-4) 0;
    }
    .done-page .done-stats li {
      grid-template-columns: minmax(0,1fr);
      justify-items: start;
      align-content: start;
      gap: 2px;
      padding: var(--space-3);
    }
    .done-page .done-stats .mark {
      grid-row: auto;
      width: 20px;
      height: 20px;
      margin: 0 0 4px;
    }
    .done-page .done-stats strong,
    .done-page .done-stats .lbl {
      grid-column: 1;
    }
    .done-page .done-stats strong {
      font-size: 18px;
    }
    .done-page .done-stats .lbl {
      font-size: 13px;
    }
    .done-page .done-actions {
      flex-direction: column;
      align-items: stretch;
      gap: var(--space-2);
      margin: var(--space-5) var(--space-4) 0;
    }
    .done-page .done-actions .button {
      width: 100%;
      min-height: 48px;
    }
    .done-page .done-actions .tertiary {
      min-height: 44px;
      margin-left: 0;
    }
    .quiz-body .quiz-h1.is-intro {
      font-size: 19px;
    }
    .quiz-body .quiz-lead {
      margin-top: var(--space-4);
    }
    .quiz-body .score {
      grid-template-columns: 32px minmax(0,1fr);
      gap: 0 var(--space-3);
      padding: var(--space-4);
    }
    .quiz-body .score .mark {
      width: 32px;
      height: 32px;
    }
    .quiz-body .score .mark svg {
      width: 18px;
      height: 18px;
    }
    .quiz-body .score .score-num {
      font-size: 30px;
    }
    .quiz-body .recap-list a {
      grid-template-columns: 32px minmax(0,1fr);
      padding: 10px var(--space-3);
    }
    .quiz-body .recap-list svg {
      display: none;
    }
    .quiz-body .recap-min {
      grid-column: 2;
      margin-top: -6px;
    }
    .quiz-body .quiz-takeaways {
      margin-top: var(--space-5);
    }
    /* the result: «Пройти ще раз» stays in the body at full width, only the next step rides the sticky bar */
    .quiz-body .quiz-actions.result-actions {
      display: contents;
    }
    .quiz-body .result-actions form {
      display: block;
      margin-top: var(--space-5);
    }
    .quiz-body .result-next {
      position: sticky;
      bottom: 0;
      z-index: 30;
      margin: var(--space-4) calc(-1*var(--space-4)) 0;
      padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
      background: var(--surface);
      box-shadow: 0 -1px 0 var(--line),0 -6px 20px rgba(23,23,23,.06);
    }
    .lesson-body.keyboard-open .result-next {
      position: static;
    }
    .quiz-body .result-next .primary {
      width: 100%;
      min-height: 48px;
    }
  }

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

/* K2 payment page: a checkbox beside its text (the lawyer's text in regular weight, as it is a sentence, not a label) */
.buy-check { display: flex; gap: 12px; align-items: flex-start; flex-wrap: nowrap; font-weight: 400; }
.buy-check input[type=checkbox] { width: 24px; min-height: 24px; height: 24px; flex: 0 0 24px; margin: 2px 0 0; }
.buy-volume { font-weight: 600; }
.offer-text { overflow-wrap: anywhere; }
.offer-text .meta { word-break: break-all; }
/* 16.11: the requisites (offer section 16) - a two-column table; on a phone each row stacks label over value */
.offer-text .table-wrap { margin: 0 0 1em; }
.offer-text table { width: 100%; border-collapse: collapse; }
.offer-text th, .offer-text td { padding: .5em .75em .5em 0; border-bottom: 1px solid var(--border); text-align: left;
  vertical-align: top; }
.offer-text td:first-child { width: 34%; color: var(--muted); }
@media (max-width: 560px) {
  .offer-text tr, .offer-text td, .offer-text td:first-child { display: block; width: auto; }
  .offer-text td { border-bottom: 0; padding: .1em 0; }
  .offer-text tr { padding: .5em 0; border-bottom: 1px solid var(--border); }
}
