/* Відкрита бібліотека — стилі тільки для сторінок /biblioteka.
   Окремий файл, щоб не чіпати styles.css і не скидати його кеш решті сайту. */

.bib-crumb {
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, #6b6b63);
  margin-bottom: 10px;
}
.bib-crumb a { color: inherit; text-decoration: none; border-bottom: 1px solid currentColor; }

/* ── список тем ───────────────────────────────────────────── */
.bib-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 26px; }
.bib-card {
  display: block; padding: 24px 24px 26px; border-radius: 14px;
  border: 1px solid rgba(0,0,0,.1); background: #fff; text-decoration: none;
  color: inherit; transition: border-color .18s ease, transform .18s ease;
}
a.bib-card:hover { border-color: var(--pen, #1d3b38); transform: translateY(-2px); }
.bib-card h3 { margin: 8px 0 8px; font-size: 1.12rem; }
.bib-card p { margin: 0; font-size: .95rem; line-height: 1.55; }
.bib-card .bib-nr { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted, #6b6b63); }
.bib-card.soon { background: rgba(0,0,0,.025); border-style: dashed; }
.bib-card.soon h3 { color: var(--muted, #6b6b63); }
.bib-state { display: inline-block; margin-top: 12px; font-size: .8rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; }
.bib-card.soon .bib-state { color: var(--muted, #6b6b63); }

/* ── теорія ───────────────────────────────────────────────── */
.theo { margin: 0 0 26px; }
.theo + .theo { border-top: 1px solid rgba(0,0,0,.09); padding-top: 24px; }
.theo h3 { margin: 0 0 6px; font-size: 1.1rem; }
.theo p { margin: 0 0 10px; }
.term {
  display: inline-block; margin: 0 0 10px; padding: 3px 10px; border-radius: 999px;
  background: rgba(29,59,56,.08); color: var(--pen, #1d3b38);
  font-size: .82rem; font-weight: 600;
}
.f {
  display: inline-block; margin: 6px 10px 6px 0; padding: 7px 13px;
  border: 1px solid rgba(0,0,0,.12); border-radius: 8px; background: #fff;
  font-family: "Cambria Math", Georgia, serif; font-size: 1.02rem;
}
.trap {
  margin: 22px 0 0; padding: 18px 20px; border-radius: 0 10px 10px 0;
  border-left: 4px solid #b5503c; background: rgba(181,80,60,.07);
}
/* блоком робимо лише заголовок пастки, а не кожне виділення в тексті */
.trap > strong:first-child { display: block; margin-bottom: 6px; }

/* ── завдання ─────────────────────────────────────────────── */
.auf { margin: 0 0 22px; padding: 22px 24px 20px; border-radius: 12px;
  border: 1px solid rgba(0,0,0,.1); background: #fff; }
.auf-nr { font-size: .8rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted, #6b6b63); margin: 0 0 6px; }
.auf-stem { margin: 0 0 4px; font-weight: 600; }
.auf-q { margin: 0 0 10px; }
.opts { margin: 0; padding-left: 26px; }
.opts li { margin-bottom: 6px; }
details.loes { margin-top: 14px; border-top: 1px solid rgba(0,0,0,.09); padding-top: 12px; }
details.loes > summary {
  cursor: pointer; font-weight: 700; font-size: .92rem; list-style: none;
  color: var(--pen, #1d3b38);
}
details.loes > summary::-webkit-details-marker { display: none; }
details.loes > summary::after { content: " ↓"; }
details.loes[open] > summary::after { content: " ↑"; }
.loes-body { margin-top: 10px; font-size: .96rem; line-height: 1.6; }
.loes-body p { margin: 0 0 8px; }
.loes-key { font-weight: 700; }

@media (max-width: 640px) {
  .auf { padding: 18px 18px 16px; }
  .opts { padding-left: 22px; }
}

/* ── друк: лишається сам матеріал ─────────────────────────── */
@media print {
  .site-header, .site-footer, .bib-crumb, .no-print { display: none !important; }
  .page-offset { padding-top: 0 !important; }
  .auf, .bib-card { break-inside: avoid; border-color: #ccc; }
  details.loes > summary { display: none; }
  /* на папері ні сітка, ні щедрі відступи сайту не потрібні */
  body, .container, .section { background-image: none !important; }
  body { background: #fff; }
  .section { padding: 10px 0 !important; }
  .section + .section { border-top: 1px solid #e3e3df; }
  h1 { margin-top: 0; }
  .section-heading { margin: 6px 0 10px !important; }
  .large-copy { margin: 0 0 10px !important; }
}

/* ── вигляд задачі (18.11.2026) ──────────────────────────────
   Заголовок номера, підпункти з літерами, складені дроби. */
.auf-bsp { display: inline-block; margin: 0 0 4px; padding: 2px 10px;
  border-radius: 999px; background: #11171a; color: #fff;
  font-size: .76rem; font-weight: 700; letter-spacing: .06em; }
.auf-title { margin: 4px 0 12px; font-size: 1.22rem; line-height: 1.3; }
.auf .auf-stem { font-weight: 400; font-size: 1.02rem; line-height: 1.65;
  margin: 0 0 6px; }
ol.teile { list-style: none; margin: 12px 0 2px; padding: 0;
  display: grid; gap: 10px; }
ol.teile > li { display: flex; gap: 12px; align-items: flex-start;
  line-height: 1.6; }
.teil { flex: none; display: inline-flex; align-items: center;
  justify-content: center; width: 1.65em; height: 1.65em; margin-top: .05em;
  border-radius: 50%; background: #1d3b38; color: #fff;
  font-size: .8rem; font-weight: 700; }
.teil-o { background: transparent; color: #1d3b38;
  border: 1.5px solid #1d3b38; }
ul.rymski { list-style: none; margin: 6px 0 0; padding: 0 0 0 4px; }
ul.rymski li { margin: 3px 0; }
.rym { display: inline-block; min-width: 2.1em; color: #6b6b63;
  font-weight: 600; }
.fr { display: inline-flex; flex-direction: column; align-items: center;
  vertical-align: middle; margin: 0 .2em; font-size: .94em; line-height: 1.2; }
.fr-n { padding: 0 .3em .12em; border-bottom: 1.4px solid currentColor; }
.fr-d { padding: .12em .3em 0; }
.loes-body .sol-teil { display: flex; gap: 10px; align-items: flex-start; }
.loes-body .sol-teil > span:last-child { flex: 1; }
@media print {
  .auf-bsp, .teil { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* продовження підпункту в розвʼязку — під текстом, а не під літерою */
.loes-body .sol-teil ~ p:not(.sol-teil) { padding-left: calc(1.65 * .8rem + 10px); }
.eq { display: inline-block; white-space: nowrap; }

/* ── Самоперевірка (20.11.2026) ── */
.test-bar { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center;
  justify-content: space-between; margin: 0 0 22px; padding: 16px 20px;
  border: 1px solid var(--line); border-left: 4px solid var(--pen);
  border-radius: 12px; background: var(--card); position: sticky; top: 70px; z-index: 5;
  box-shadow: var(--shadow); }
.test-bar-info { flex: 1 1 320px; font-size: .95rem; line-height: 1.5; color: var(--ink-soft); }
.test-bar-info b { color: var(--ink); }
.test-bar-ctl { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.test-timer, .auf-check .check { font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 999px; padding: 9px 18px; border: 1px solid var(--ink); background: var(--ink);
  color: #fff; }
.test-timer.timer-on { background: #fff; color: var(--ink); font-variant-numeric: tabular-nums; }
.test-timer.timer-out { border-color: var(--pen); color: var(--pen); }
.test-score { font-size: .95rem; white-space: nowrap; }
.test-score b { font-size: 1.15rem; color: var(--ok); }
.auf-boss { border-color: rgba(216, 54, 42, .35); }
.boss { display: inline-block; margin-left: 10px; padding: 1px 9px; border-radius: 999px;
  background: var(--pen); color: #fff; font-size: .72rem; letter-spacing: .08em; }
.opts li[data-ok] { list-style-position: outside; }
.pick { display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  padding: 6px 8px; margin-left: -8px; border-radius: 8px; transition: background .15s; }
.pick:hover { background: rgba(17, 23, 26, .04); }
.pick input { margin-top: 5px; width: 17px; height: 17px; flex: none; accent-color: var(--ink); }
.pick-ok .pick { background: rgba(14, 124, 102, .10); }
.pick-bad .pick { background: rgba(216, 54, 42, .10); }
.pick-ok .pick::after { content: "✓"; margin-left: auto; color: var(--ok); font-weight: 700; }
.pick-bad .pick::after { content: "✗"; margin-left: auto; color: var(--pen); font-weight: 700; }
.auf-check { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 12px; }
.auf-check .check { background: #fff; color: var(--ink); }
.auf-check .check:hover { background: var(--ink); color: #fff; }
.verdict { font-size: .93rem; font-weight: 600; }
.verdict.v-ok { color: var(--ok); }
.verdict.v-bad { color: var(--pen-dark); }
.zvit { margin-top: 26px; padding: 24px 26px; border-radius: 12px; background: var(--ink); color: #fff; }
.zvit-score { margin: 0 0 6px; font-size: 1.5rem; font-weight: 700; }
.zvit-text { margin: 0 0 14px; line-height: 1.6; color: rgba(255, 255, 255, .86); }
.zvit-cta { margin: 0 0 16px; line-height: 1.6; }
@media (max-width: 640px) {
  .test-bar { position: static; padding: 14px 16px; }
  .zvit { padding: 20px 18px; }
}
@media print {
  .test-bar, .auf-check, .zvit, .pick input { display: none !important; }
  .pick { padding: 0; margin: 0; }
  .pick::after { content: none !important; }
}
.zvit .button.primary { background: var(--pen); border-color: var(--pen); color: #fff; }
.zvit .button.primary:hover { background: var(--pen-dark); border-color: var(--pen-dark); }

/* ── 3D-моделі до задач EPM (20.11.2026) ── */
.m3d { margin: 16px 0 6px; border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(180deg, #fbfcfa, #f1f4f0); overflow: hidden; }
.m3d canvas { display: block; width: 100%; height: 400px; cursor: grab; touch-action: pan-y; }
.m3d canvas:active { cursor: grabbing; }
.m3d-ctl { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  padding: 10px 14px; border-top: 1px solid var(--line); background: var(--card); }
.m3d-ctl label { display: flex; gap: 10px; align-items: center; flex: 1 1 260px; font-size: .9rem; }
.m3d-ctl input[type=range] { flex: 1; accent-color: var(--pen); }
.m3d-ctl b { min-width: 3.2em; font-variant-numeric: tabular-nums; }
.m3d-ctl button { font: inherit; font-size: .88rem; cursor: pointer; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.m3d-ctl button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.m3d-ctl .m3d-spin { margin-left: auto; }
.m3d figcaption { padding: 0 14px 12px; background: var(--card); font-size: .88rem;
  line-height: 1.55; color: var(--ink-soft); }
@media (max-width: 640px) { .m3d canvas { height: 300px; } }
@media print { .m3d { display: none !important; } }
.m3d-ctl label span { white-space: nowrap; }
/* 3D-моделі більші (20.11.2026, прохання Максима) */
.m3d canvas { height: 500px; }
@media (max-width: 640px) { .m3d canvas { height: 380px; } }
