/* ============================================================
   DĚJEPIS — styl
   ============================================================ */
:root {
  --bg: #f6f2ea;
  --paper: #fffdf8;
  --ink: #2b2620;
  --muted: #7a7160;
  --line: #e4dccb;
  --accent: #8d5a2b;
  --ok: #2e7d32;
  --no: #c62828;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(60, 45, 20, .08), 0 6px 18px rgba(60, 45, 20, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(rgba(141, 90, 43, .04) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  line-height: 1.55;
}
.wrap { max-width: 1020px; margin: 0 auto; padding: 20px 16px 80px; }

/* ---------- hlavička ---------- */
header { margin-bottom: 18px; }
.eyebrow { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
h1 { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(1.7rem, 4.5vw, 2.4rem); margin-bottom: 2px; }
.subtitle { color: var(--muted); margin-bottom: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  padding: 8px 14px; border-radius: 999px; font: inherit; font-size: .92rem; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.tab:hover { border-color: var(--accent); }
.tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.view { display: none; }
.view.show { display: block; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

.view-intro { color: var(--muted); margin: 10px 0 18px; max-width: 70ch; }

/* ---------- pás ér ---------- */
.eraband { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 6px; }
.erachip {
  border: none; border-radius: 10px; padding: 10px 12px; cursor: pointer; text-align: left;
  background: var(--c); color: #fff; font: inherit; box-shadow: var(--shadow); transition: transform .15s;
}
.erachip:hover { transform: translateY(-2px); }
.erachip b { display: block; font-size: .95rem; letter-spacing: .06em; }
.erachip span { font-size: .75rem; opacity: .85; }

.toolbar { display: flex; justify-content: flex-end; margin: 8px 0; }
.btn {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  padding: 8px 16px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; transition: all .15s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #443c30; }

/* ---------- časová osa ---------- */
#timeline { position: relative; padding-left: 30px; }
#timeline::before {
  content: ''; position: absolute; left: 14px; top: 8px; bottom: 8px; width: 3px;
  background: linear-gradient(#8d6e42, #3d5a80 75%, #4a4e8f); border-radius: 2px;
}
.erahead {
  position: relative; margin: 26px 0 12px; padding: 12px 16px;
  background: color-mix(in srgb, var(--c) 12%, var(--paper));
  border-left: 5px solid var(--c); border-radius: 0 var(--radius) var(--radius) 0;
}
.erahead-name { font-family: 'Playfair Display', serif; font-size: 1.25rem; font-weight: 700; color: var(--c); letter-spacing: .04em; }
.erahead-range { font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.erahead p, .era-note p { font-size: .9rem; color: var(--ink); }
.era-note {
  margin: 22px 0 12px; padding: 12px 16px; border: 2px dashed var(--c); border-radius: var(--radius);
  background: color-mix(in srgb, var(--c) 7%, var(--paper));
}
.era-note .erahead-name { font-size: 1.05rem; }
.era-note small { font-weight: 400; font-size: .78rem; color: var(--muted); }

.tl-item { position: relative; margin: 14px 0; }
.tl-dot {
  position: absolute; left: -30px; top: 14px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--c);
  display: flex; align-items: center; justify-content: center; font-size: 15px; z-index: 1;
}
.tl-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-left: 14px; }
.tl-head {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "years arrow" "name arrow" "tag arrow" "sub arrow";
  width: 100%; text-align: left; border: none; background: none; font: inherit; cursor: pointer; padding: 14px 16px;
}
.tl-head:hover { background: color-mix(in srgb, var(--c) 5%, var(--paper)); }
.tl-years { grid-area: years; font-size: .8rem; font-weight: 700; color: var(--c); letter-spacing: .04em; }
.tl-name { grid-area: name; font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 700; }
.tl-tag { grid-area: tag; font-size: .92rem; color: var(--muted); font-style: italic; }
.tl-sub { grid-area: sub; font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }
.tl-arrow { grid-area: arrow; align-self: center; color: var(--muted); transition: transform .25s; font-size: 1.1rem; }
.tl-item.open .tl-arrow { transform: rotate(180deg); }
.tl-body { display: none; padding: 0 16px 16px; border-top: 1px dashed var(--line); }
.tl-item.open .tl-body { display: block; animation: fadein .2s; }
.facts { list-style: none; margin-top: 12px; }
.facts li { padding: 6px 0 6px 22px; position: relative; font-size: .95rem; }
.facts li::before { content: '›'; position: absolute; left: 6px; color: var(--c); font-weight: 700; }
.persons { margin-top: 12px; background: color-mix(in srgb, var(--c) 6%, var(--paper)); border-radius: 10px; padding: 10px 14px; }
.persons h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--c); margin-bottom: 6px; }
.person { font-size: .92rem; padding: 3px 0; }
.chips-line { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 14%, var(--paper)); color: color-mix(in srgb, var(--c) 80%, black);
}

/* ---------- srovnání ---------- */
.cmp { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin: 12px 0; overflow: hidden; }
.cmp-head { display: flex; justify-content: space-between; align-items: center; width: 100%; border: none; background: none; font: inherit; cursor: pointer; padding: 14px 16px; }
.cmp-head h3 { font-family: 'Playfair Display', serif; font-size: 1.08rem; }
.cmp-head:hover { background: #faf6ee; }
.cmp-body { display: none; }
.cmp.open .cmp-body { display: block; }
.cmp.open .cmp-head .tl-arrow { transform: rotate(180deg); }
.cmp-scroll { overflow-x: auto; padding: 0 12px 14px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
.cmp-table thead th {
  padding: 10px 12px; text-align: left; color: #fff; background: var(--c); font-size: .88rem;
}
.cmp-table thead th:first-child { background: none; }
.cmp-table thead th:nth-child(2) { border-radius: 8px 0 0 0; }
.cmp-table thead th:last-child { border-radius: 0 8px 0 0; }
.cmp-table tbody th {
  padding: 9px 12px; text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); vertical-align: top; width: 120px; border-bottom: 1px solid var(--line);
}
.cmp-table tbody td {
  padding: 9px 12px; vertical-align: top; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--c) 5%, var(--paper));
}
.cmp-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--c) 10%, var(--paper)); }

/* ---------- vývojové linie ---------- */
.themebar { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.themechip {
  border: 1px solid var(--line); background: var(--paper); font: inherit; font-size: .9rem; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; transition: all .15s;
}
.themechip:hover { border-color: var(--accent); }
.themechip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
#themeline { position: relative; padding-left: 26px; }
#themeline::before { content: ''; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 3px; background: var(--line); border-radius: 2px; }
.step { position: relative; margin: 10px 0; }
.step-marker {
  position: absolute; left: -26px; top: 10px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--c); color: #fff; font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; z-index: 1;
}
.step-card {
  margin-left: 12px; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--c);
  border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow);
}
.step-period { font-size: .8rem; font-weight: 700; color: var(--c); }
.step-period small { color: var(--muted); font-weight: 400; }
.step-text { font-size: .95rem; }

/* ---------- test ---------- */
#quiz-setup h2 { font-family: 'Playfair Display', serif; margin: 14px 0 12px; }
.qgroups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.qgroup {
  text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius);
  padding: 14px 16px; font: inherit; cursor: pointer; box-shadow: var(--shadow); transition: all .15s;
}
.qgroup:hover { border-color: var(--accent); transform: translateY(-2px); }
.qgroup b { display: block; font-size: 1rem; }
.qgroup span { font-size: .82rem; color: var(--muted); }
.qlen { margin-top: 16px; display: flex; gap: 14px; align-items: center; font-size: .92rem; color: var(--muted); flex-wrap: wrap; }
.qlen label { cursor: pointer; font-weight: 600; color: var(--ink); }

.quiz-top { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 6px; font-size: .9rem; color: var(--muted); }
.barwrap { background: var(--line); border-radius: 99px; height: 8px; overflow: hidden; margin-bottom: 16px; }
#quiz-prog { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
#quiz-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.q-period {
  display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 14%, var(--paper)); color: color-mix(in srgb, var(--c) 80%, black); margin-bottom: 10px;
}
.q-text { font-size: 1.15rem; font-weight: 600; margin-bottom: 16px; }
.q-answers { display: grid; gap: 8px; }
.ans {
  display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; font-size: .98rem;
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 11px 14px; cursor: pointer; transition: all .15s;
}
.ans:hover:not(:disabled) { border-color: var(--accent); background: #faf6ee; }
.ans .key {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; background: var(--line); font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ans.ok { border-color: var(--ok); background: #e8f5e9; }
.ans.ok .key { background: var(--ok); color: #fff; }
.ans.no { border-color: var(--no); background: #ffebee; }
.ans.no .key { background: var(--no); color: #fff; }
.ans:disabled { cursor: default; opacity: .9; }
.q-next { margin-top: 16px; text-align: right; }
.note { margin-top: 10px; font-size: .8rem; color: var(--muted); }
kbd { background: var(--line); border-radius: 4px; padding: 1px 6px; font-family: inherit; font-size: .75rem; }

#quiz-result { text-align: center; padding: 24px 0; }
.result-big { font-family: 'Playfair Display', serif; font-size: 3.4rem; font-weight: 700; }
.result-sub { color: var(--muted); }
.result-grade { font-size: 1.1rem; margin: 12px 0 20px; }
#quiz-result h3 { font-family: 'Playfair Display', serif; margin-bottom: 10px; }
.wronglist { display: grid; gap: 8px; text-align: left; max-width: 640px; margin: 0 auto; }
.wrong-item { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; padding: 10px 14px; }
.wi-q { font-weight: 600; font-size: .95rem; }
.wi-a { color: var(--ok); font-size: .92rem; margin-top: 2px; }
.wi-p { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.perfect { font-size: 1.05rem; }
.result-btns { margin-top: 20px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- seřaď události ---------- */
#order-info { margin: 12px 0; font-size: .95rem; }
#order-line { display: grid; gap: 6px; margin-bottom: 18px; }
.ord-empty { color: var(--muted); font-style: italic; padding: 10px 0; }
.ord-placed {
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--c);
  border-radius: 8px; padding: 8px 12px; font-size: .92rem; animation: fadein .25s;
}
.ord-num { color: var(--muted); font-size: .82rem; }
#order-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.ord-chip {
  border: 1px solid var(--line); background: #fff; font: inherit; font-size: .9rem; font-weight: 500;
  padding: 9px 14px; border-radius: 999px; cursor: pointer; transition: all .15s; box-shadow: var(--shadow);
}
.ord-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.ord-chip.shake { animation: shake .4s; border-color: var(--no); background: #ffebee; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); } 75% { transform: translateX(5px); }
}

footer { margin-top: 50px; text-align: center; font-size: .8rem; color: var(--muted); }
footer a { color: var(--accent); }

@media (max-width: 640px) {
  .eraband { grid-template-columns: 1fr; }
  .tl-head { padding: 12px; }
  .cmp-table tbody th { width: 90px; }
}

/* ---------- mýty a fakta (kartičky) ---------- */
#mythlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-items: start; }
.myth {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; cursor: pointer; transition: transform .12s;
}
.myth:hover { transform: translateY(-2px); }
.myth .myth-back { display: none; }
.myth.open .myth-front { display: none; }
.myth.open .myth-back { display: block; }
.myth-tag {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .07em;
  color: #fff; background: var(--no); border-radius: 999px; padding: 3px 10px; margin-bottom: 9px;
}
.myth-tag.ok { background: var(--ok); }
.myth-text { font-size: .95rem; }
.myth-front .myth-text { font-weight: 600; font-style: italic; }
.myth-flip { margin-top: 10px; font-size: .8rem; color: var(--muted); }
.myth-fig { margin: 12px 0 0; text-align: center; }
.myth-fig img { max-width: 100%; max-height: 230px; border-radius: 8px; object-fit: contain; }
.myth-fig figcaption { font-size: .76rem; color: var(--muted); margin-top: 5px; }

/* ---------- pojmy (kartičky s odkrytím) ---------- */
#termlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.term {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 12px 14px; cursor: pointer;
}
.term b { color: var(--accent); font-size: .98rem; }
.term .def { display: none; margin-top: 6px; font-size: .88rem; }
.term .hint { display: block; margin-top: 6px; font-size: .76rem; color: var(--muted); }
.term.open .def { display: block; }
.term.open .hint { display: none; }
.toolbar { text-align: center; margin-bottom: 12px; }

/* ---------- srovnávací tabulka vložená do výkladu ---------- */
.cmp.inline { margin: 6px 0 18px 44px; }
.cmp.inline .cmp-head h3 { font-size: 1rem; }
@media (max-width: 640px) { .cmp.inline { margin-left: 0; } }

/* ---------- TISK ---------- */
@media print {
  /* skutečné okraje stránky — platí na každé stránce; URL/čísla stránek
     vypni v tiskovém dialogu volbou „Záhlaví a zápatí“ (pamatuje si to) */
  @page { margin: 14mm 12mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff !important; background-image: none !important; }
  .wrap { max-width: 100%; padding: 0 !important; }

  /* skrýt ovládání a interaktivní části */
  .tabs, .toolbar, .btn, .tl-arrow, .print-btn, footer,
  .eyebrow, .subtitle, header p, .eraband,
  #v-test, #v-serad, .note { display: none !important; }

  /* časová osa bez ozdobné linky a teček — v tisku žádné krabičky,
     jen nadpisy s linkou a text (zlom stránky pak nic nerozřízne) */
  #timeline { padding-left: 0; }
  #timeline::before { display: none; }
  .tl-dot { display: none; }
  .tl-card { margin-left: 0; border: none; border-radius: 0; box-shadow: none; background: none; overflow: visible; }
  .tl-item { margin: 4px 0 14px; }
  .tl-head { padding: 10px 0 5px; border-bottom: 2px solid var(--c, #444); }
  .tl-body { border-top: none; padding: 0 0 10px; }
  .persons { break-inside: auto; page-break-inside: auto; }
  .persons .person { break-inside: avoid; page-break-inside: avoid; }

  /* zobrazit všechny sekce a rozbalit vše */
  .view { display: block !important; margin-top: 0; }
  .view-intro { display: none; }
  .tl-body { display: block !important; }
  .cmp-body { display: block !important; }
  .term .def { display: block !important; }
  .term .hint { display: none !important; }
  .myth .myth-back { display: block !important; }
  .myth .myth-front .myth-flip { display: none !important; }
  .myth.open .myth-front { display: block !important; }

  /* nadpisy sekcí (na obrazovce je nahrazují záložky) */
  #v-srovnani::before, #v-vyvoj::before, #v-myty::before, #v-pojmy::before {
    display: block; font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem; font-weight: 700; margin: 0 0 12px;
    border-bottom: 2px solid #333; padding-bottom: 4px;
  }
  #v-srovnani::before { content: "⚖️ Srovnání na první pohled"; }
  #v-vyvoj::before { content: "📈 Jak se co vyvíjelo"; }
  #v-myty::before { content: "🔍 Mýty a fakta"; }
  #v-pojmy::before { content: "🏛️ Pojmy z antiky"; }

  /* konce stránek: dlouhé karty se dělit smějí, malé celky ne —
     jinak po vysokých kapitolách zůstávají prázdné stránky */
  .cmp, .myth, .term, .step, .erahead, .era-note, figure,
  .persons, .cmp-table tr, .facts li, .chips-line { break-inside: avoid; page-break-inside: avoid; }
  .tl-head { break-inside: avoid; break-after: avoid; page-break-after: avoid; }
  .cmp-head { break-after: avoid; page-break-after: avoid; }
  .keep-print { break-inside: avoid; page-break-inside: avoid; }
  .tl-card { box-shadow: none; }
  .cmp, .myth, .term { box-shadow: none; }
  #v-srovnani, #v-vyvoj, #v-myty, #v-pojmy { break-before: page; page-break-before: always; }
  .cmp.inline { margin-left: 0; }

  /* tabulky přes celou šířku, bez scrollu */
  .cmp-scroll { overflow: visible !important; }
  .cmp-table { width: 100%; font-size: .82rem; }

  /* obrázky ať nepřetečou stránku */
  img { max-height: 220px !important; }

  /* mřížky kartiček na 2 sloupce, ať se šetří papír */
  #mythlist { grid-template-columns: 1fr 1fr; }
  #termlist { grid-template-columns: 1fr 1fr 1fr; }

  header h1 { font-size: 1.6rem; }
  a { text-decoration: none; color: inherit; }
  header p a { display: none; }
}

/* ---------- panel výběru tisku ---------- */
.print-panel {
  margin-top: 10px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 12px 16px;
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: .9rem;
  text-align: left;
}
.print-panel[hidden] { display: none; }
.print-panel b { width: 100%; }
.print-panel label { display: flex; gap: 7px; align-items: center; cursor: pointer; }
.print-panel .pp-btns { width: 100%; display: flex; gap: 8px; margin-top: 4px; }
@media print {
  .print-panel, .noprint { display: none !important; }
  .first-print { break-before: auto !important; page-break-before: auto !important; }
}

/* ---------- souvislý výklad (ucelený text místo odrážek) ---------- */
.story { margin-top: 12px; }
.story p { margin: 0 0 12px; font-size: .96rem; line-height: 1.65; text-align: justify; }
.story p:last-child { margin-bottom: 0; }
.story b { color: color-mix(in srgb, var(--c) 75%, black); }
@media print {
  .story p { orphans: 3; widows: 3; }
}

/* ---------- interaktivní osa s náhledem (hover) ---------- */
#hoverline { margin: 16px 0 6px; }
.hl-track { display: flex; align-items: flex-start; overflow-x: auto; padding: 10px 4px 6px; position: relative; }
.hl-track::before {
  content: ''; position: absolute; left: 8px; right: 8px; top: 29px; height: 4px;
  background: linear-gradient(90deg, #8d6e42, #9a8c98 45%, #3d5a80 70%, #4a4e8f);
  border-radius: 2px;
}
.hl-node {
  position: relative; flex: 1 0 62px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 0; cursor: pointer; font: inherit; padding: 0;
}
.hl-ico {
  width: 38px; height: 38px; border-radius: 50%; background: var(--paper); border: 3px solid var(--c);
  display: grid; place-items: center; font-size: 17px; z-index: 1;
  transition: transform .15s, box-shadow .15s;
}
.hl-node:hover .hl-ico, .hl-node.on .hl-ico { transform: scale(1.28); box-shadow: 0 4px 12px rgba(60,45,20,.25); }
.hl-lab { font-size: .68rem; font-weight: 600; color: var(--muted); max-width: 76px; text-align: center; line-height: 1.2; }
.hl-node.on .hl-lab { color: var(--ink); }
.hl-tip {
  margin: 8px 4px 0; background: color-mix(in srgb, var(--c) 8%, var(--paper));
  border-left: 4px solid var(--c); border-radius: 10px; padding: 10px 14px;
  animation: fadein .15s ease;
}
.hl-tip-head b { font-family: 'Playfair Display', serif; font-size: 1.05rem; }
.hl-tip-head span { color: var(--muted); font-size: .85rem; }
.hl-tip-tag { font-size: .9rem; color: var(--muted); font-style: italic; }
.hl-tip-txt { font-size: .88rem; margin-top: 6px; }
.hl-tip-more { font-size: .75rem; color: var(--muted); margin-top: 6px; }
@media print { #hoverline { display: none !important; } }

/* ---------- obsah kapitol ---------- */
#toc { margin: 4px 0 6px; }
.toc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.toc-item {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--c);
  border-radius: 10px; padding: 9px 12px; font: inherit; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .12s;
}
.toc-item:hover { transform: translateY(-2px); border-color: var(--c); }
.toc-ico { font-size: 20px; }
.toc-item b { display: block; font-size: .92rem; line-height: 1.25; }
.toc-item small { color: var(--muted); font-size: .74rem; }
@media print { #toc { display: none !important; } }

/* ---------- režim kapitol (jen jedna kapitola najednou) ---------- */
.chapter-mode { padding-left: 0; }
.chapter-mode::before { display: none; }
.chapter-mode .tl-dot { display: none; }
.chapter-mode .tl-card { margin-left: 0; }
.chapter-mode .tl-item, .chapter-mode .cmp.inline, .chapter-mode .erahead, .chapter-mode .era-note { display: none; }
.chapter-mode .tl-item.current { display: block; animation: fadein .2s ease; }
.chapter-mode .cmp.inline.current { display: block; margin-left: 0; }
#chapnav { display: flex; gap: 8px; align-items: center; margin: 12px 0 6px; flex-wrap: wrap; }
#chapnav[hidden] { display: none; }
#ch-title { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.05rem; flex: 1; text-align: center; }
#chapnav .btn:disabled { opacity: .4; cursor: default; }
.toc-item.on { background: color-mix(in srgb, var(--c) 14%, var(--paper)); }
@media print {
  #chapnav { display: none !important; }
  .chapter-mode .tl-item, .chapter-mode .cmp.inline, .chapter-mode .erahead { display: block !important; }
}

/* ---------- štítek data výuky ---------- */
.toc-when {
  display: inline-block; font-size: .64rem; font-weight: 700; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 1px 8px; margin-left: 4px; vertical-align: 2px; white-space: nowrap;
}

/* ---------- data a osoby (přehled k tisku) ---------- */
.dl-h { font-family: 'Playfair Display', serif; font-size: 1.25rem; margin: 20px 0 10px; border-bottom: 2px solid var(--line); padding-bottom: 4px; }
.dl-years { display: flex; flex-direction: column; gap: 6px; }
.dl-row { display: flex; gap: 12px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 9px; padding: 7px 12px; font-size: .92rem; }
.dl-year { flex: 0 0 96px; text-align: center; font-weight: 800; color: #fff; background: var(--c); border-radius: 7px; padding: 2px 6px; font-size: .8rem; }
.dl-group { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.dl-gname { font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.dl-person { font-size: .92rem; padding: 2px 0; }
@media print {
  #v-dataosoby { break-before: page; page-break-before: always; }
  .dl-row, .dl-group, .dl-person { break-inside: avoid; page-break-inside: avoid; }
  .dl-h { break-after: avoid; page-break-after: avoid; }
}

/* při otevřené kapitole se zobrazuje pouze ona — obsah a osa se schovají */
body.chapter-open #toc,
body.chapter-open #hoverline,
body.chapter-open #v-osa > .view-intro { display: none; }
.eraband[hidden] { display: none !important; }
