/*
 * Рабочий стол экзамена. Общая основа — в app.css, здесь только то, что
 * есть на этой странице: геройский блок, сторис, сетка пробников, сетка
 * предметов и липкая колонка справа.
 */


  /* HERO ROW */
  .hero {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 20px;
    margin-bottom: 36px;
  }

  .hero-main {
    position: relative;
    border-radius: var(--radius-xl);
    padding: 36px;
    background:
      radial-gradient(120% 100% at 0% 0%, rgba(255,255,255,0.18), transparent 50%),
      linear-gradient(135deg, #1a1530 0%, #2a1f55 35%, var(--accent) 100%);
    color: white;
    overflow: hidden;
    min-height: 360px;
    display: flex;
    flex-direction: column;
  }

  /* декоративные пузыри */
  .hero-main::before, .hero-main::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
  }
  .hero-main::before {
    width: 320px; height: 320px;
    right: -80px; top: -80px;
    background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 70%);
  }
  .hero-main::after {
    width: 220px; height: 220px;
    right: 120px; bottom: -60px;
    background: radial-gradient(circle, rgba(255, 184, 0, 0.35), transparent 70%);
  }

  .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 6px 12px 6px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.13);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.18);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 22px;
  }
  .hero-badge .pulse {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 4px rgba(74,222,128,0.25);
    animation: pulse 1.8s infinite;
  }
  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
  }

  .hero-main h1 {
    font-family: "Instrument Serif", serif;
    font-weight: 400;
    font-size: clamp(36px, 4vw, 54px);
    line-height: 1.05;
    letter-spacing: -0.015em;
    max-width: 18ch;
    margin-bottom: 14px;
  }
  .hero-main h1 em {
    font-style: italic;
    background: linear-gradient(90deg, #ffd966, #ff9eb6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .hero-main .lede {
    max-width: 46ch;
    color: rgba(255,255,255,0.78);
    font-size: 15px;
    margin-bottom: 28px;
  }

  .hero-cta-row {
    display: flex;
    gap: 10px;
    margin-top: auto;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
  }
  .hero-mini-stats {
    position: absolute;
    bottom: 24px; right: 28px;
    display: flex;
    gap: 22px;
    z-index: 2;
  }
  .hero-mini-stats .item .v {
    font-family: "Instrument Serif", serif;
    font-size: 30px;
    line-height: 1;
    margin-bottom: 2px;
  }
  .hero-mini-stats .item .v small { font-size: 16px; opacity: 0.7; }
  .hero-mini-stats .item .l {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
  }

  /* HERO SIDE — карточка готовности */
  .readiness {
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
  }
  .readiness-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
  }
  .readiness-head .ttl {
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 2px;
  }
  .readiness-head .exam {
    font-weight: 600;
    font-size: 15px;
  }
  .readiness-head .chip {
    padding: 5px 10px;
    background: var(--accent-50);
    color: var(--accent-700);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
  }

  .readiness-score {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
  }
  .ring {
    --p: 73;
    width: 90px; height: 90px;
    flex-shrink: 0;
    border-radius: 50%;
    background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0);
    display: grid;
    place-items: center;
    position: relative;
  }
  .ring::before {
    content: "";
    position: absolute;
    inset: 6px;
    background: white;
    border-radius: 50%;
  }
  .ring span {
    position: relative;
    font-weight: 600;
    font-size: 22px;
    letter-spacing: -0.02em;
  }
  .readiness-score .big {
    font-family: "Instrument Serif", serif;
    font-size: 44px;
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
  }
  .readiness-score .big small {
    font-size: 22px;
    color: var(--muted-2);
  }
  .readiness-score .sub {
    font-size: 12px;
    color: var(--muted);
  }
  .delta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--green);
    font-weight: 600;
    background: var(--green-soft);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 12px;
  }

  .subj-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
  }
  .subj {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    font-size: 13px;
  }
  .subj-name { font-weight: 500; }
  .subj-meta {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .subj-bar {
    grid-column: 1 / -1;
    height: 6px;
    background: var(--surface-2);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
  }
  .subj-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    width: var(--w, 50%);
    background: var(--c, var(--accent));
    border-radius: 99px;
  }
  .subj-pct {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--ink);
  }

  /* ============== STORIES ============== */
  .stories {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(176px, 1fr);
    gap: 14px;
    margin-bottom: 44px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }
  .stories::-webkit-scrollbar { height: 6px; }
  .stories::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

  .story {
    aspect-ratio: 9/14;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s;
    box-shadow: var(--shadow-sm);
  }
  .story:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
  }
  .story .bg { position: absolute; inset: 0; z-index: 1; }
  .story.s1 .bg { background: linear-gradient(160deg, #725DFF 0%, #4632c4 60%, #2a1565 100%); }
  .story.s2 .bg { background: linear-gradient(170deg, #2a8eff 0%, #1665d8 70%, #0a3b85 100%); }
  .story.s3 .bg { background: linear-gradient(150deg, #ff7a1a 0%, #ef3b3b 80%, #b41010 100%); }
  .story.s4 .bg { background: linear-gradient(170deg, #1aae5b 0%, #0d7a3e 70%, #043d1f 100%); }
  .story.s5 .bg { background: linear-gradient(160deg, #f5b800 0%, #ce8800 70%, #6b4500 100%); }
  .story.s6 .bg { background: linear-gradient(170deg, #ff4d8d 0%, #c0276a 70%, #6e1240 100%); }

  .story .bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      radial-gradient(circle at 30% 15%, rgba(255,255,255,0.18), transparent 50%);
  }

  .story .pbar {
    position: absolute;
    top: 10px; left: 10px; right: 10px;
    height: 2px;
    background: rgba(255,255,255,0.3);
    border-radius: 99px;
    z-index: 3;
    overflow: hidden;
  }
  .story .pbar::after {
    content: "";
    position: absolute;
    inset: 0;
    width: var(--p, 0%);
    background: white;
    border-radius: 99px;
  }

  .story-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 22px 14px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
  }
  .story-tag {
    align-self: flex-start;
    padding: 4px 9px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 99px;
    font-size: 10px;
    font-weight: 600;
  }
  .story h4 {
    font-family: "Instrument Serif", serif;
    font-weight: 400;
    font-size: 22px;
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
  }
  .story .foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    opacity: 0.92;
  }
  .play {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.35);
    display: grid;
    place-items: center;
    font-size: 10px;
  }

  .story.add {
    background: var(--surface);
    border: 2px dashed var(--border-strong);
    display: grid;
    place-items: center;
    text-align: center;
    box-shadow: none;
    color: var(--muted);
  }
  .story.add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-50); }
  .story.add .plus {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--ink);
    color: white;
    display: grid;
    place-items: center;
    font-size: 20px;
    margin-bottom: 10px;
  }
  .story.add:hover .plus { background: var(--accent); }
  .story.add .lbl { font-size: 12px; font-weight: 600; }

  /* ============== MAIN GRID — MOCKS + LEADERBOARD ============== */
  .main-grid {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 20px;
    margin-bottom: 44px;
  }

  /* mock cards */
  .mocks { padding: 6px 10px 14px; }
  .mock {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
  }
  .mock:hover { background: var(--surface-2); }

  .mock-thumb {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-family: "Instrument Serif", serif;
    font-size: 24px;
    font-weight: 500;
    color: white;
    flex-shrink: 0;
  }
  .mock-thumb.violet { background: linear-gradient(135deg, var(--accent), #4632c4); }
  .mock-thumb.blue { background: linear-gradient(135deg, var(--blue), #1665d8); }
  .mock-thumb.green { background: linear-gradient(135deg, var(--green), #0d7a3e); }
  .mock-thumb.orange { background: linear-gradient(135deg, var(--orange), var(--red)); }
  .mock-thumb.pink { background: linear-gradient(135deg, var(--pink), #c0276a); }

  .mock-body h4 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.005em;
    margin-bottom: 3px;
  }
  .mock-body .desc {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
  }
  .mock-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
  .mock-meta {
    text-align: right;
    flex-shrink: 0;
  }
  .mock-meta .time {
    font-family: "Instrument Serif", serif;
    font-size: 22px;
    line-height: 1;
    margin-bottom: 4px;
  }
  .mock-meta .lbl {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 6px;
  }
  .diff {
    display: inline-flex;
    gap: 2px;
    justify-content: flex-end;
  }
  .diff i {
    width: 5px; height: 10px;
    border-radius: 99px;
    background: var(--surface-2);
  }
  .diff i.on { background: var(--accent); }

  /* leaderboard */
  .lb-switch {
    display: flex;
    gap: 4px;
    padding: 3px;
    background: var(--surface-2);
    border-radius: 99px;
    font-size: 12px;
  }
  .lb-switch a {
    padding: 5px 11px;
    border-radius: 99px;
    color: var(--muted);
    font-weight: 500;
  }
  .lb-switch a.active {
    background: white;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
  }

  .lb-list { padding: 6px 10px 14px; }
  .lb-row {
    display: grid;
    grid-template-columns: 28px 36px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius);
    transition: background 0.15s;
  }
  .lb-row:hover { background: var(--surface-2); }
  .lb-row.me {
    background: var(--accent-50);
    border: 1px solid var(--accent-100);
  }
  .lb-row.me:hover { background: var(--accent-50); }

  .lb-rank {
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--muted);
  }
  .lb-rank.medal {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    font-size: 12px;
    margin: 0 auto;
  }
  .lb-rank.gold { background: linear-gradient(135deg, #ffcb45, #c98a00); }
  .lb-rank.silver { background: linear-gradient(135deg, #d4d4d6, #8a8a8e); }
  .lb-rank.bronze { background: linear-gradient(135deg, #d99565, #8c4e21); }

  .lb-ava {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
  }
  .lb-info {
    line-height: 1.2;
    min-width: 0;
  }
  .lb-info .nm {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
  }
  .lb-info .sub {
    font-size: 11px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .streak {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--orange);
    font-weight: 600;
  }
  .lb-pts {
    text-align: right;
  }
  .lb-pts .v {
    font-weight: 600;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
  }
  .lb-pts .delta-up {
    font-size: 11px;
    color: var(--green);
    font-weight: 600;
  }
  .lb-pts .delta-down {
    font-size: 11px;
    color: var(--red);
    font-weight: 600;
  }

  /* ============== TOPICS ============== */
  .topics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
  .topic {
    display: block;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    color: inherit;
  }
  .topic:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
  }

  /* Предмет без задач не открывается, поэтому и не поднимается под курсором. */
  .topic[aria-disabled="true"] {
    background: transparent;
    border-style: dashed;
    cursor: default;
  }
  .topic[aria-disabled="true"]:hover { transform: none; box-shadow: none; border-color: var(--border); }
  .topic[aria-disabled="true"] h4 { color: var(--muted); }
  .topic[aria-disabled="true"] .topic-icon { background: var(--surface-2); color: var(--muted-2); }
  .topic-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-family: "Instrument Serif", serif;
    font-size: 22px;
    margin-bottom: 14px;
    font-style: italic;
  }

  .topic-num {
    position: absolute;
    top: 18px; right: 20px;
    font-family: "Geist Mono", monospace;
    font-size: 11px;
    color: var(--muted-2);
    font-weight: 500;
  }
  .topic h4 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.005em;
    line-height: 1.25;
    margin-bottom: 16px;
    min-height: 2.4em;
  }
  .topic-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
  }
  .topic-foot .pct { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
  .topic .pgbar {
    height: 4px;
    background: var(--surface-2);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
  }
  .topic .pgbar::after {
    content: "";
    position: absolute;
    inset: 0;
    width: var(--w, 50%);
    background: var(--c, var(--accent));
    border-radius: 99px;
  }

  .topic .badge {
    position: absolute;
    top: 16px; right: 16px;
    padding: 3px 8px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .badge-hot { background: var(--red); color: white; }
  .badge-new { background: var(--accent); color: white; }
  .badge-pro { background: var(--ink); color: white; }

  .flow > .panel { margin-bottom: 30px; }
  .flow .stories { margin-bottom: 30px; }
  .hero-slot { margin-bottom: 30px; }


  /* ============== ГЕРОЙСКИЙ БЛОК В КОЛОНКЕ ============== */
  .hero-main.compact {
    min-height: 0;
    padding: 28px 30px;
    margin-bottom: 0;
  }
  .hero-main.compact h1 {
    font-size: clamp(30px, 3.2vw, 40px);
    max-width: 17ch;
    margin-bottom: 10px;
  }
  .hero-main.compact .lede {
    font-size: 14px;
    max-width: 54ch;
    margin-bottom: 20px;
  }
  .hero-main.compact .hero-badge { margin-bottom: 18px; }
  .hero-main.compact::before { width: 260px; height: 260px; right: -70px; top: -90px; }
  .hero-main.compact::after { width: 180px; height: 180px; right: 90px; bottom: -70px; }

  /* ============== СТОРИС УЗКОЙ ЛЕНТОЙ ============== */
  .stories-sm { grid-auto-columns: minmax(134px, 1fr); gap: 10px; }
  .stories-sm .story { aspect-ratio: 9/13; border-radius: var(--radius); }
  .stories-sm .story-content { padding: 18px 11px 11px; }
  .stories-sm .story-tag { font-size: 9px; padding: 3px 7px; }
  .stories-sm .story h4 { font-size: 17px; margin-bottom: 6px; }
  .stories-sm .story .foot { font-size: 10px; }
  .stories-sm .play { width: 22px; height: 22px; font-size: 9px; }
  .stories-sm .story.add .plus { width: 34px; height: 34px; font-size: 17px; margin-bottom: 7px; }
  .stories-sm .story.add .lbl { font-size: 11px; }

  /* ============== ПРОДОЛЖИТЬ ============== */
  .resume {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 8px 22px 18px;
  }
  .resume-body h4 {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-bottom: 4px;
  }
  .resume-sub { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
  .resume-bar {
    height: 6px;
    max-width: 340px;
    background: var(--surface-2);
    border-radius: 99px;
    position: relative;
    overflow: hidden;
  }
  .resume-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    width: var(--w, 50%);
    background: var(--accent);
    border-radius: 99px;
  }
  .resume-timer { text-align: right; }
  .resume-timer .t {
    font-family: "Instrument Serif", serif;
    font-size: 32px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }
  .resume-timer .l { font-size: 11px; color: var(--muted); font-weight: 500; }
  .btn-dark { padding: 11px 18px; }
  .btn-dark:hover { background: var(--accent); }

  .resume-alt {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 22px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 13px;
    color: var(--muted);
  }
  .resume-alt .ic {
    width: 30px; height: 30px;
    border-radius: 9px;
    background: var(--orange-soft);
    color: var(--orange);
    display: grid;
    place-items: center;
    flex: none;
  }
  .resume-alt b { color: var(--ink); font-weight: 600; }
  .resume-alt a { margin-left: auto; color: var(--accent); font-weight: 600; white-space: nowrap; }

  .mocks-empty { padding: 4px 22px 24px; font-size: 13px; color: var(--muted); }
  .mocks-empty a { color: var(--accent); font-weight: 600; }

  /* ============== ТЕМЫ В ТРИ КОЛОНКИ ============== */
  .topics-3 { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .topics-3 .topic { padding: 16px; }
  .topics-3 .topic-icon { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; margin-bottom: 12px; }
  .topics-3 .topic-num { top: 15px; right: 16px; }
  .topics-3 .topic h4 { font-size: 14px; margin-bottom: 12px; min-height: 2.5em; }

  .empty-note { padding: 4px 22px 24px; font-size: 13px; color: var(--muted); }
  .empty-note a { color: var(--accent); font-weight: 600; }

  /* ============== КАРТОЧКИ ЛИПКОЙ КОЛОНКИ ============== */
  .rail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 18px;
  }
  .rail-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
  }
  .rail-h h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
  .rail-h .link { font-size: 12px; color: var(--muted); font-weight: 500; }
  .rail-h .link:hover { color: var(--accent); }
  .rail-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 14px;
    padding: 10px;
    border-radius: 999px;
    background: var(--ink);
    color: white;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
  }
  .rail-btn:hover { background: var(--accent); }
  .rail-btn.quiet { background: var(--surface-2); color: var(--ink); }
  .rail-btn.quiet:hover { background: var(--accent-50); color: var(--accent-700); }

  .rail .readiness { padding: 18px; border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); }
  .rail .readiness-head { margin-bottom: 16px; }
  .rail .readiness-score { gap: 14px; margin-bottom: 0; }
  .rail .ring { width: 74px; height: 74px; }
  .rail .ring span { font-size: 18px; }
  .rail .readiness-score .big { font-size: 36px; }
  .rail .readiness-score .big small { font-size: 19px; }

  .goal {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }
  .goal-bar {
    height: 8px;
    border-radius: 99px;
    background: var(--surface-2);
    position: relative;
  }
  .goal-bar::after {
    content: "";
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: var(--now, 73%);
    background: var(--accent);
    border-radius: 99px;
  }
  .goal-bar i {
    position: absolute;
    top: -4px; bottom: -4px;
    left: var(--goal, 85%);
    width: 2px;
    background: var(--ink);
    border-radius: 99px;
  }
  .goal-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 9px;
    font-size: 11px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .goal-legend b { color: var(--ink); font-weight: 600; }

  .count-row { display: flex; align-items: flex-end; gap: 16px; }
  .count-big {
    font-family: "Instrument Serif", serif;
    font-size: 52px;
    line-height: 0.9;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
  }
  .count-lbl { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 5px; }
  .count-stats {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 9px;
    text-align: right;
  }
  .count-stats .v {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-weight: 600;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
  }
  .count-stats .v svg { color: var(--orange); }
  .count-stats .l { font-size: 11px; color: var(--muted); }
  .streak-week { display: flex; gap: 4px; margin-top: 16px; }
  .streak-week i { flex: 1; height: 6px; border-radius: 99px; background: var(--accent); }
  .streak-week i.off { background: var(--surface-2); }

  .weak { display: flex; flex-direction: column; gap: 13px; }
  .weak-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 4px 10px;
    align-items: center;
  }
  .weak-num {
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 11px;
    color: var(--muted-2);
    font-weight: 500;
  }
  .weak-name { font-size: 13px; font-weight: 500; }
  .weak-pct { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .weak-bar {
    grid-column: 1 / -1;
    height: 5px;
    background: var(--surface-2);
    border-radius: 99px;
    position: relative;
    overflow: hidden;
  }
  .weak-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    width: var(--w, 50%);
    background: var(--c, var(--accent));
    border-radius: 99px;
  }

  .mini-lb { margin: 0 -8px; }
  .mini-lb .lb-row {
    grid-template-columns: 22px 28px 1fr auto;
    gap: 9px;
    padding: 8px;
    border-radius: var(--radius-sm);
  }
  .mini-lb .lb-ava { width: 28px; height: 28px; font-size: 12px; }
  .mini-lb .lb-rank { font-size: 13px; }
  .mini-lb .lb-rank.medal { width: 22px; height: 22px; font-size: 11px; }
  .mini-lb .lb-info .nm { font-size: 13px; }
  .mini-lb .lb-info .sub { font-size: 10px; }
  .mini-lb .lb-pts .v { font-size: 13px; }
  .lb-gap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 8px;
    color: var(--muted-2);
    font-size: 10px;
    font-family: "Geist Mono", ui-monospace, monospace;
  }
  .lb-gap::before, .lb-gap::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
  }

  .note { display: flex; gap: 12px; align-items: flex-start; }
  .note-ic {
    width: 38px; height: 38px;
    border-radius: 11px;
    background: var(--accent-50);
    color: var(--accent-700);
    display: grid;
    place-items: center;
    flex: none;
  }
  .note b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 3px; }
  .note .m { font-size: 12px; color: var(--muted); }

  /* Сетка предметов — общая с каталогом задач, стили в common.css. Здесь
     только отступ: у .flow нет своего gap, и сетка слипалась с пробниками. */
  .flow > .subj-grid, .flow > .subj-empty { margin-bottom: 30px; }

  /* ============== МОБИЛЬНЫЙ ============== */
  @media (max-width: 1000px) {
    /* колонки распадаются в одну ленту: карточка готовности и отсчёт
       поднимаются сразу под геройский блок */
    .desk { display: flex; flex-direction: column; gap: 16px; }
    .flow, .rail { display: contents; }
    .flow > * { order: 4; }
    .flow > *:nth-child(1) { order: 1; }
    .rail > * { order: 5; }
    .rail > *:nth-child(1) { order: 2; }
    .rail > *:nth-child(2) { order: 3; }
    .hero-slot, .flow > .panel, .flow .stories { margin-bottom: 0; }
    .exam-switch { margin-left: 0; }
    .topics-3 { grid-template-columns: repeat(2, 1fr); }
    .resume { grid-template-columns: 1fr auto; gap: 12px 14px; padding: 6px 16px 16px; }
    .resume > .mock-thumb { display: none; }
    .resume .btn-dark { grid-column: 1 / -1; justify-content: center; }
    .resume-alt { flex-wrap: wrap; padding: 13px 16px; }
    .hero-main.compact { padding: 24px 20px; }
    .hero-main.compact h1 { font-size: 30px; }
  }
  @media (max-width: 430px) {
    .topics-3 { grid-template-columns: 1fr; }
    .topics-3 .topic h4 { min-height: 0; }
    /* заголовок и счётчик предметов на узком экране не помещаются в строку */
    .section-h { flex-wrap: wrap; gap: 2px 12px; }
    /* поиск занимает свою строку целиком, подпись остаётся читаемой */
    .search-pill .kbd { display: none; }
    .search-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  }
