/*
 * Каталог пробников и страница пробников предмета.
 *
 * По макету mocks_d.html: шапка-герой, полка вариантов и врезка «как
 * считается балл». Герой и миниатюра предмета взяты из desk.css как есть —
 * страница подключает только свой файл, поэтому эти правила повторены здесь.
 */

  .page.mocks { padding-top: 26px; padding-bottom: 76px; }

  /* ---------- хлебные крошки ---------- */
  .crumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 14px;
  }
  .crumbs a { font-weight: 500; }
  .crumbs a:hover { color: var(--accent); }
  .crumbs b { color: var(--ink); font-weight: 600; }
  .crumbs .mi { font-size: 15px; color: var(--muted-2); }

  /* ---------- герой (из desk.css) ---------- */
  .hero-main {
    position: relative;
    border-radius: var(--radius-xl);
    padding: 28px 30px;
    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;
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
  }
  .hero-main::before, .hero-main::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
  }
  .hero-main::before {
    width: 260px; height: 260px;
    right: -70px; top: -90px;
    background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 70%);
  }
  .hero-main::after {
    width: 180px; height: 180px;
    right: 90px; bottom: -70px;
    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: 18px;
    position: relative;
    z-index: 2;
  }
  .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(30px, 3.2vw, 40px);
    line-height: 1.05;
    letter-spacing: -0.015em;
    margin-bottom: 8px;
  }
  .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: 58ch;
    color: rgba(255,255,255,0.78);
    font-size: 14px;
    margin-bottom: 0;
  }
  .shelf-hero .hero-top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
  }
  .shelf-hero .hero-top .btn { flex: none; }
  .hero-main .lede.skip-lede { margin-top: 8px; font-size: 13px; color: rgba(255,255,255,0.62); }
  .hero-mini-stats {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 22px;
  }
  .hero-mini-stats .item .v {
    font-family: "Instrument Serif", serif;
    font-size: 30px;
    line-height: 1;
    margin-bottom: 2px;
    font-variant-numeric: tabular-nums;
  }
  .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;
  }

  /* ---------- полка вариантов ---------- */
  .shelf-h { padding-top: 24px; }
  .sec-lede {
    font-size: 13.5px;
    color: var(--muted);
    max-width: 82ch;
    margin: -8px 0 18px;
  }
  .sec-lede b { color: var(--ink); font-weight: 600; }

  .shelf {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 36px;
  }
  .shelf .mock {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  }
  .shelf .mock:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
  }

  .vstrip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }
  .vstrip.done { background: var(--green-soft); color: var(--green); }
  .vstrip .mi { font-size: 15px; }

  .vbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    padding: 16px;
  }
  .vhead { display: flex; gap: 12px; align-items: flex-start; }
  .mock-thumb {
    width: 46px; height: 46px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-family: "Instrument Serif", serif;
    font-size: 20px;
    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); }

  .vtitle { min-width: 0; }
  .vtitle h4 {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.005em;
    margin-bottom: 3px;
  }
  .vtitle .desc { font-size: 12.5px; color: var(--muted); }
  .wave {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 7px;
  }
  .w-demo { background: var(--accent-50); color: var(--accent-700); }
  .w-author { background: var(--ink); color: var(--surface); }

  .vstats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 11px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .vstats dt { font-size: 10.5px; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
  .vstats dd {
    font-family: "Instrument Serif", Georgia, serif;
    font-size: 21px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }
  .vstats dd small {
    font-family: "Geist", sans-serif;
    font-size: 11px;
    color: var(--muted-2);
  }

  .vfoot { margin-top: auto; display: flex; align-items: center; gap: 8px; }
  .vbtn {
    flex: 1;
    justify-content: center;
    padding: 10px 14px;
    font-size: 13px;
  }
  .vicon {
    width: 38px; height: 38px;
    flex: none;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    display: grid;
    place-items: center;
  }
  .vicon:hover { background: var(--accent-50); color: var(--accent-700); }
  .vicon .mi { font-size: 18px; }

  .made-note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 14px 0 24px;
    padding: 14px 16px;
    background: var(--surface-2);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--muted);
  }
  .made-note .ic {
    width: 30px; height: 30px;
    flex: none;
    border-radius: 9px;
    background: var(--surface);
    color: var(--accent-700);
    display: grid;
    place-items: center;
  }

  /* ---------- сборка своего варианта ---------- */
  .panel { margin-bottom: 24px; }
  .panel-head .link.muted { color: var(--muted-2); font-weight: 500; cursor: default; }
  .builder-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 22px;
    padding: 4px 22px 18px;
  }
  .builder-form .fld { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
  .builder-form select {
    font: inherit;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--ink);
    min-width: 240px;
  }
  .builder-form .chk {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    cursor: pointer;
  }
  .builder-form .chk small { color: var(--muted-2); font-size: 12px; }
  .builder-form .chk input { width: 16px; height: 16px; accent-color: var(--accent); }
  .builder-form .btn { margin-left: auto; }
  .builder-note { padding: 0 22px 20px; font-size: 12.5px; color: var(--muted-2); }

  .builder-numbers { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 16px; }
  .num-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    gap: 6px;
  }
  .num-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 9px 6px 7px;
    border-radius: 11px;
    background: var(--surface-2);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
  }
  .num-cell:hover { background: var(--surface-3); }
  .num-cell b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .num-cell small { font-size: 10px; color: var(--muted); white-space: nowrap; }
  .num-cell input { position: absolute; opacity: 0; width: 0; height: 0; }
  .num-cell.on {
    background: var(--accent-50);
    border-color: var(--accent);
    color: var(--accent-700);
  }
  /* Фокус — не выбор: раньше у них был один стиль, и клетка, с которой только
     что сняли отметку, оставалась «выбранной», пока на ней стоял фокус. Обводка
     только для клавиатуры: у щелчка мышью :focus-visible не срабатывает. */
  .num-cell:has(input:focus-visible) { outline: 2px solid var(--accent-200); outline-offset: 1px; }
  /* «Только первая часть»: вторая часть в вариант не попадёт, отметки на ней
     остаются, но клетки бледнеют, чтобы это было видно до сборки. */
  .num-cell.off { opacity: 0.35; }
  .builder-sum { display: inline-flex; align-items: center; gap: 10px; }
  .builder-reset {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-size: 12.5px;
    color: var(--accent);
    cursor: pointer;
  }
  .builder-reset:hover { color: var(--accent-700); text-decoration: underline; }
  .num-cell.on small { color: var(--accent-700); }
  .num-cell.empty { opacity: 0.4; cursor: not-allowed; }
  .num-cell.empty:hover { background: var(--surface-2); }
  .num-cell.audio b { text-decoration: line-through; }
  .builder-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }

  /* ---------- структура и баллы ---------- */
  .spec-panel .spec-lede {
    padding: 0 22px 16px;
    max-width: 78ch;
    font-size: 13.5px;
    color: var(--muted);
  }
  .spec-lede p + p { margin-top: 8px; }
  .spec-lede b { color: var(--ink); font-weight: 600; }

  /* полоса частей: ширина куска — его доля в первичных баллах */
  .spec-split { display: flex; gap: 8px; padding: 2px 22px 0; }
  .spec-split .seg { flex: 1 1 0; min-width: 104px; }
  .spec-split .seg-bar {
    display: block;
    height: 10px;
    border-radius: 6px;
    background: var(--accent-200);
    margin-bottom: 9px;
  }
  .spec-split .p2 .seg-bar { background: var(--accent); }
  .spec-split .oral .seg-bar { background: var(--accent-700); }
  .spec-split .expert .seg-bar {
    background: repeating-linear-gradient(
      -45deg, var(--surface-3) 0 4px, var(--surface) 4px 8px);
    box-shadow: inset 0 0 0 1px var(--border-strong);
  }
  .spec-split .seg b { display: block; font-size: 13px; font-weight: 600; }
  .spec-split .seg > span:last-child {
    display: block;
    font-size: 11.5px;
    color: var(--muted-2);
    font-variant-numeric: tabular-nums;
  }
  .spec-total {
    padding: 10px 22px 0;
    text-align: right;
    font-size: 12px;
    color: var(--muted-2);
  }

  /* сколько заданий сколько стоит */
  .weights { list-style: none; padding: 10px 22px 4px; }
  .weights li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
  }
  .weights li:last-child { border-bottom: none; }
  .w-badge {
    flex: 0 0 84px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
  }
  .w-badge small { font-weight: 500; font-size: 11.5px; }
  .w2 .w-badge { background: var(--accent-50); color: var(--accent-700); }
  .w3 .w-badge { background: var(--accent-100); color: var(--accent-700); }
  .w4 .w-badge { background: var(--accent); color: #fff; }
  .w-nums {
    flex: 1 1 auto;
    min-width: 0;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 12.5px;
    color: var(--ink-body);
  }
  .w-count { flex: 0 0 auto; font-size: 12px; color: var(--muted-2); white-space: nowrap; }
  .w-bar {
    flex: 0 0 120px;
    height: 6px;
    border-radius: 4px;
    background: var(--surface-2);
    overflow: hidden;
  }
  .w-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent-200); }
  .w3 .w-bar i, .w4 .w-bar i { background: var(--accent); }
  .w-sum {
    flex: 0 0 56px;
    text-align: right;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }
  .w-sum small { font-weight: 400; color: var(--muted-2); }

  /* подзаголовок внутри панели */
  .spec-sub {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 16px 22px 0;
    padding-top: 14px;
    border-top: 1px solid var(--border);
  }
  .spec-sub h4 { font-size: 14px; font-weight: 600; }
  .spec-sub span { font-size: 12px; color: var(--muted-2); }

  /* карточки шкалы */
  .scale-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 8px;
    padding: 12px 22px 0;
  }
  .sc {
    position: relative;
    padding: 8px 10px 10px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1.5px solid transparent;
    text-align: center;
  }
  .sc-tag {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted-2);
  }
  .sc-big {
    display: block;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
  }
  .sc-sub { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
  .sc-fill {
    display: block;
    height: 4px;
    margin-top: 8px;
    border-radius: 3px;
    background: var(--surface-3);
    overflow: hidden;
  }
  .sc-fill i { display: block; height: 100%; border-radius: 3px; background: var(--accent-200); }
  .sc.on {
    background: var(--accent-50);
    border-color: var(--accent-200);
  }
  .sc.on .sc-tag, .sc.on .sc-big { color: var(--accent-700); }
  .sc.on .sc-fill i { background: var(--accent); }

  .scale-cards.grades .sc-big { font-size: 28px; }
  .grades .g2 { background: var(--red-tint); }
  .grades .g2 .sc-big { color: var(--red); }
  .grades .g3 { background: var(--yellow-soft); }
  .grades .g4 { background: var(--blue-soft); }
  .grades .g4 .sc-big { color: var(--blue); }
  .grades .g5 { background: var(--green-soft); }
  .grades .g5 .sc-big { color: var(--green); }

  .spec-foot {
    margin-top: 18px;
    padding: 14px 22px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 12px;
    color: var(--muted);
  }
  .spec-foot p + p { margin-top: 6px; }
  .spec-foot .src { color: var(--muted-2); }

  /* ---------- адаптив ---------- */
  @media (max-width: 1000px) {
    .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shelf-hero .hero-top { flex-direction: column; }
    .hero-mini-stats { gap: 20px; }
    .spec-lede, .spec-split, .spec-total, .weights, .scale-cards { padding-left: 16px; padding-right: 16px; }
    .spec-sub, .spec-foot { margin-left: 0; margin-right: 0; padding-left: 16px; padding-right: 16px; }
    .builder-form { padding: 4px 16px 16px; }
    .builder-form .btn { margin-left: 0; }
  }
  @media (max-width: 640px) {
    .shelf { grid-template-columns: minmax(0, 1fr); }
    .builder-form select { min-width: 0; width: 100%; }
    .spec-split { flex-wrap: wrap; }
    .spec-split .seg { flex: 1 1 128px; }
    .weights li { flex-wrap: wrap; gap: 8px 12px; }
    .w-nums { flex: 1 1 100%; order: 3; }
    .w-count { flex: 1 1 auto; }
    .w-bar { display: none; }
  }
