/* Aktovka: svět „Úřední spis“. Papír, inkoust, úřední modř, zvýrazňovač a razítka. */

@font-face { font-family: "Bricolage"; src: url(/fonts/bricolage.woff2) format("woff2"); font-weight: 400 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage"; src: url(/fonts/bricolage-ext.woff2) format("woff2"); font-weight: 400 800; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif"; src: url(/fonts/serif.woff2) format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif"; src: url(/fonts/serif-ext.woff2) format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif"; font-style: italic; src: url(/fonts/serif-italic.woff2) format("woff2"); font-weight: 400 600; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif"; font-style: italic; src: url(/fonts/serif-italic-ext.woff2) format("woff2"); font-weight: 400 600; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Razitko"; src: url(/fonts/stamp.woff2) format("woff2"); font-weight: 700 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Razitko"; src: url(/fonts/stamp-ext.woff2) format("woff2"); font-weight: 700 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --desk: #E2E7EE;          /* stůl pod papíry */
  --paper: #F7F8FA;         /* list papíru */
  --paper-2: #EEF1F5;       /* kolonky formuláře */
  --rule: #C9D1DC;          /* linky formuláře */
  --ink: #1B2333;           /* text, inkoust */
  --ink-2: #4A5468;         /* vedlejší text */
  --blue: #1F3C88;          /* úřední modř */
  --blue-ink: #FFFFFF;
  --blue-soft: #DCE3F4;
  --marker: #FFE14D;        /* zvýrazňovač */
  --marker-ink: #1B2333;
  --ok: #1E7B4F;            /* razítko KONFORMNÍ */
  --ok-soft: #DDEFE5;
  --bad: #C4312F;           /* razítko NEKONFORMNÍ */
  --bad-soft: #F7DEDC;
  --violet: #5A3E9E;        /* razítko K OPAKOVÁNÍ */
  --violet-soft: #E6E0F4;
  --wood: #A8703F;          /* Štemplova rukojeť */
  --wood-2: #7E4F28;

  --d1: #2D5BB8; --d1-p: #DCE6F7;
  --d2: #0E7472; --d2-p: #D3ECEA;
  --d3: #6A4CB0; --d3-p: #E4DDF3;
  --d4: #A85A12; --d4-p: #F6E3CF;
  --d5: #A63A63; --d5-p: #F3DCE5;
  --d6: #2E7D45; --d6-p: #DAEEDC;

  --shadow: 0 1px 1px rgba(27, 35, 51, .06), 0 6px 16px -6px rgba(27, 35, 51, .18);
  --shadow-lift: 0 2px 2px rgba(27, 35, 51, .06), 0 14px 28px -10px rgba(27, 35, 51, .28);
  --r-sheet: 3px;
  --r-tab: 10px;
  --ui: "Bricolage", system-ui, sans-serif;
  --doc: "Source Serif", Georgia, serif;
  --stamp: "Razitko", "Bricolage", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --desk: #12161F; --paper: #1B2130; --paper-2: #232A3B; --rule: #343D52; --ink: #E8ECF3; --ink-2: #A9B2C4;
    --blue: #8FA8EE; --blue-ink: #0F1424; --blue-soft: #263256; --marker: #F2D23C; --marker-ink: #1B2333;
    --ok: #5CC28E; --ok-soft: #1D3A2C; --bad: #F07A6E; --bad-soft: #3F2423; --violet: #B6A2EE; --violet-soft: #2D2647;
    --wood: #C48A55; --wood-2: #8E5E33;
    --d1: #8DB0F2; --d1-p: #22304D; --d2: #6CC9C4; --d2-p: #183736; --d3: #B9A3EE; --d3-p: #2C2545;
    --d4: #EBA766; --d4-p: #3A2A18; --d5: #EE93B4; --d5-p: #3C2230; --d6: #8ACB98; --d6-p: #1F3524;
    --shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 8px 18px -8px rgba(0, 0, 0, .6);
    --shadow-lift: 0 2px 2px rgba(0, 0, 0, .3), 0 16px 30px -10px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --desk: #12161F; --paper: #1B2130; --paper-2: #232A3B; --rule: #343D52; --ink: #E8ECF3; --ink-2: #A9B2C4;
  --blue: #8FA8EE; --blue-ink: #0F1424; --blue-soft: #263256; --marker: #F2D23C; --marker-ink: #1B2333;
  --ok: #5CC28E; --ok-soft: #1D3A2C; --bad: #F07A6E; --bad-soft: #3F2423; --violet: #B6A2EE; --violet-soft: #2D2647;
  --wood: #C48A55; --wood-2: #8E5E33;
  --d1: #8DB0F2; --d1-p: #22304D; --d2: #6CC9C4; --d2-p: #183736; --d3: #B9A3EE; --d3-p: #2C2545;
  --d4: #EBA766; --d4-p: #3A2A18; --d5: #EE93B4; --d5-p: #3C2230; --d6: #8ACB98; --d6-p: #1F3524;
  --shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 8px 18px -8px rgba(0, 0, 0, .6);
  --shadow-lift: 0 2px 2px rgba(0, 0, 0, .3), 0 16px 30px -10px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--desk); color: var(--ink); font: 400 1rem/1.5 var(--ui);
  font-optical-sizing: auto; min-height: 100dvh;
}
::selection { background: var(--marker); color: var(--marker-ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 2px; }
a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--ink); caret-color: var(--blue); }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); font-weight: 750; }
h2 { font-size: clamp(1.25rem, 1.1rem + .8vw, 1.6rem); font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
* { scrollbar-color: var(--rule) transparent; scrollbar-width: thin; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- hlavička ---------- */
.head {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 8px) var(--gutter) 8px; background: var(--blue); color: var(--blue-ink);
}
:root[data-theme="dark"] .head { background: #1A2442; color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .head { background: #1A2442; color: var(--ink); } }
.brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 34px; display: block; }
.head-meta { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: .9rem; min-width: 0; }
.hm-item { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.hm-item svg { width: 18px; height: 18px; flex: none; }
.hm-level { display: grid; gap: 3px; min-width: 0; }
.hm-level b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 38vw; }
.hm-bar { height: 5px; width: clamp(80px, 18vw, 180px); background: rgba(255, 255, 255, .25); border-radius: 3px; overflow: hidden; }
.hm-bar i { display: block; height: 100%; background: var(--marker); border-radius: 3px; }
@media (max-width: 520px) { .hm-hide-sm { display: none; } .hm-level b { max-width: 34vw; } }

/* ---------- plocha ---------- */
main { padding: 18px var(--gutter) calc(110px + env(safe-area-inset-bottom)); max-width: 1120px; margin: 0 auto; outline: none; }
main:focus, main:focus-visible { outline: none; }
.page { display: grid; gap: 20px; }
.page-head { display: grid; gap: 6px; }
.page-head p { color: var(--ink-2); max-width: 62ch; }
.crumbs { font-size: .9rem; }
.crumbs a { color: var(--ink-2); }

/* list papíru */
.sheet {
  background: var(--paper); border-radius: var(--r-sheet); box-shadow: var(--shadow); padding: clamp(16px, 3vw, 28px);
  position: relative;
}
.sheet-ref { font-size: .85rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.sheet-ref b { color: var(--ink); font-weight: 650; }

/* formulářová pole */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); margin-top: 14px; }
@media (min-width: 900px) { .form-grid { grid-template-columns: repeat(3, 1fr); } }
.cell { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 8px 12px 10px; display: grid; gap: 2px; min-width: 0; }
.cell > span { font-size: .78rem; color: var(--ink-2); }
.cell > strong { font-size: 1.35rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.cell > small { color: var(--ink-2); font-size: .85rem; }
.cell.mark > strong { background: linear-gradient(transparent 55%, var(--marker) 55%, var(--marker) 92%, transparent 92%); width: fit-content; color: var(--ink); }

.ruler { height: 10px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 2px; position: relative; overflow: hidden; margin-top: 4px; }
.ruler i { position: absolute; inset: 0 auto 0 0; background: var(--blue); }
.ruler.marker i { background: var(--marker); }
.ruler .line { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--bad); }

/* tlačítka */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px;
  border-radius: 6px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); font-weight: 650;
  cursor: pointer; text-decoration: none; transition: transform .12s var(--ease), background .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--paper-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--paper-2); }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .92rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 3px; font-size: .82rem; font-weight: 600;
  background: var(--paper-2); color: var(--ink); border: 1px solid var(--rule); white-space: nowrap;
}
.chip.ref { background: var(--marker); color: var(--marker-ink); border-color: transparent; font-variant-numeric: tabular-nums; }
.chip.dom { border: 0; color: var(--dc); background: var(--dp); }
.chip.art { font-family: var(--doc); font-weight: 600; }
.d1 { --dc: var(--d1); --dp: var(--d1-p); } .d2 { --dc: var(--d2); --dp: var(--d2-p); } .d3 { --dc: var(--d3); --dp: var(--d3-p); }
.d4 { --dc: var(--d4); --dp: var(--d4-p); } .d5 { --dc: var(--d5); --dp: var(--d5-p); } .d6 { --dc: var(--d6); --dp: var(--d6-p); }

/* ---------- Štempl ---------- */
.stempl { width: 100%; height: 100%; display: block; overflow: visible; }
.stempl .knob { fill: var(--wood); }
.stempl .neck { fill: var(--wood-2); }
.stempl .body { fill: #2B3A6B; }
.stempl .rubber { fill: var(--violet); }
.stempl .eye { fill: #fff; }
.stempl .pupil { fill: #141A2A; transition: transform .25s var(--ease); }
.stempl .mouth { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.stempl .cheek { fill: #F28AA0; opacity: 0; transition: opacity .2s; }
.stempl .lid { fill: #2B3A6B; transform-box: fill-box; transform-origin: top; transform: scaleY(0); transition: transform .12s; }
.stempl.happy .cheek { opacity: .8; }
.stempl.sad .lid { transform: scaleY(.45); }
.stempl.sleepy .lid { transform: scaleY(.6); }
.stempl.wink .lid.r { transform: scaleY(1); }
.stempl .blink { animation: blink 6s infinite; transform-box: fill-box; transform-origin: top; }
@keyframes blink { 0%, 96%, 100% { transform: scaleY(0); } 98% { transform: scaleY(1); } }

.stempl-dock {
  position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; align-items: flex-end; gap: 8px; pointer-events: none;
}
.stempl-dock .who { width: 56px; height: 64px; pointer-events: auto; cursor: pointer; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25)); }
.stempl-dock .who.bounce { animation: thump .5s var(--ease); }
@keyframes thump { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(8px) scale(1.06, .9); } 60% { transform: translateY(-6px) scale(.97, 1.04); } 100% { transform: none; } }
.bubble {
  max-width: min(300px, 70vw); background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 12px 12px 2px 12px;
  padding: 9px 12px; font-size: .92rem; box-shadow: var(--shadow); pointer-events: none; opacity: 0; transform: translateY(6px);
  transition: opacity .25s, transform .25s var(--ease);
}
.bubble.on { opacity: 1; transform: none; }
@media (min-width: 900px) {
  .stempl-dock { bottom: 24px; right: auto; left: max(8px, calc(50% - 560px - 130px)); width: 130px; flex-direction: column-reverse; align-items: flex-start; }
  .stempl-dock .who { width: 64px; height: 72px; margin-left: 26px; }
  .bubble { max-width: 160px; border-radius: 12px 12px 12px 2px; }
}

/* ---------- kartotéka (navigace) ---------- */
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; justify-content: center; gap: 4px;
  padding: 0 8px env(safe-area-inset-bottom); background: var(--blue); box-shadow: 0 -6px 18px -10px rgba(0, 0, 0, .4);
}
:root[data-theme="dark"] .drawer { background: #1A2442; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .drawer { background: #1A2442; } }
.drawer a {
  flex: 1; max-width: 140px; display: grid; justify-items: center; gap: 2px; padding: 9px 4px 10px; margin-top: -10px;
  background: var(--tab, var(--paper-2)); color: var(--ink); text-decoration: none; font-size: .76rem; font-weight: 650;
  border-radius: var(--r-tab) var(--r-tab) 0 0; transform: translateY(10px); transition: transform .2s var(--ease);
  box-shadow: 0 -2px 6px -3px rgba(0, 0, 0, .3); -webkit-tap-highlight-color: transparent;
}
.drawer a svg { width: 22px; height: 22px; }
.drawer a[aria-current="page"] { transform: translateY(0); background: var(--paper); }
.drawer a:hover { transform: translateY(4px); }
.drawer a[aria-current="page"]:hover { transform: translateY(0); }
@media (min-width: 900px) {
  .drawer { top: 60px; bottom: auto; left: max(8px, calc(50% - 560px - 130px)); right: auto; width: 116px; flex-direction: column;
    background: transparent; box-shadow: none; padding: 16px 0; gap: 6px; }
  :root[data-theme="dark"] .drawer { background: transparent; }
  .drawer a { max-width: none; margin: 0; transform: translateX(-10px); border-radius: 0 var(--r-tab) var(--r-tab) 0; padding: 10px 6px; font-size: .8rem; }
  .drawer a[aria-current="page"], .drawer a:hover, .drawer a[aria-current="page"]:hover { transform: translateX(0); }
  main { padding-bottom: 48px; }
}
@media (min-width: 900px) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .drawer { background: transparent; } }

/* kartotéka režimů na stole: šuplík se záložkami */
.files { display: grid; gap: 0; padding-top: 18px; }
.file {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px;
  padding: 14px 16px 16px; margin-top: -6px; background: var(--fp, var(--paper)); color: var(--ink); text-decoration: none;
  border-radius: 0 6px 6px 6px; box-shadow: 0 -1px 0 rgba(27, 35, 51, .08), 0 -6px 14px -10px rgba(27, 35, 51, .35);
  transition: transform .2s var(--ease);
}
.file::before {
  content: attr(data-tab); position: absolute; bottom: calc(100% - 1px); left: min(var(--tx, 0%), calc(100% - 15ch)); padding: 6px 14px 4px; font-size: .95rem; font-weight: 750;
  background: var(--fp, var(--paper)); color: var(--fc, var(--ink)); border-radius: 8px 8px 0 0; white-space: nowrap; letter-spacing: -.01em;
}
.file:hover, .file:focus-visible { transform: translateY(-4px); }
.file p { color: var(--ink); font-size: .95rem; grid-column: 1; }
.file .count { grid-row: 1 / span 2; grid-column: 2; font-weight: 800; font-size: 1.4rem; font-variant-numeric: tabular-nums; color: var(--fc, var(--ink)); }
.file + .file { margin-top: 30px; }
.files { padding-top: 30px; }
.files .file:first-child { margin-top: 10px; }

/* ---------- sekce a lekce ---------- */
.days { display: grid; gap: 22px; }
.day h2 { margin-bottom: 10px; }
.sec-list { display: grid; gap: 8px; }
.sec {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 14px; background: var(--paper);
  border-radius: var(--r-sheet); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; position: relative;
}
.sec:hover { box-shadow: var(--shadow-lift); }
.sec .sid { font-weight: 800; font-size: 1.05rem; color: var(--dc, var(--blue)); font-variant-numeric: tabular-nums; }
.sec .st { font-weight: 650; }
.sec .meta { grid-column: 2; color: var(--ink-2); font-size: .85rem; display: flex; gap: 10px; flex-wrap: wrap; }
.sec .mini-stamp { grid-row: 1 / span 2; grid-column: 3; }
.mini-stamp {
  font-family: var(--stamp); font-weight: 800; font-size: .78rem; padding: 2px 7px; border: 2px solid currentColor; border-radius: 4px;
  transform: rotate(-6deg); color: var(--ok); opacity: .9;
}
.mini-stamp.read { color: var(--blue); }
.mini-stamp.none { color: var(--rule); }

.lesson { display: grid; gap: 18px; }
.lesson .doc { font-family: var(--doc); font-size: 1.07rem; line-height: 1.65; max-width: 68ch; }
.lesson .doc p + p { margin-top: .8em; }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.points li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.points li::before { content: ""; width: 12px; height: 12px; margin-top: 6px; border: 2px solid var(--blue); border-radius: 2px; }
.points .refs { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: 6px; vertical-align: 1px; }
.fw { display: grid; gap: 8px; }
.fw ol { margin: 0; padding-left: 1.4em; display: grid; gap: 4px; font-family: var(--doc); }
.fw ol li::marker { font-weight: 700; color: var(--blue); font-family: var(--ui); }
.trap { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 12px; background: var(--bad-soft); border-radius: 4px; }
.trap .bang { width: 30px; height: 30px; border: 2px solid var(--bad); color: var(--bad); border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-family: var(--stamp); transform: rotate(-8deg); }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table th { font-size: .8rem; color: var(--ink-2); font-weight: 650; }
.table td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.scroll-x { overflow-x: auto; }

/* ---------- otázka jako formulář ---------- */
.quiz { display: grid; gap: 16px; }
.quiz-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .9rem; color: var(--ink-2); }
.quiz-top .prog { height: 6px; flex: 1 1 120px; background: var(--paper-2); border-radius: 3px; overflow: hidden; min-width: 80px; }
.quiz-top .prog i { display: block; height: 100%; background: var(--blue); }
.combo { font-weight: 800; color: var(--violet); font-variant-numeric: tabular-nums; }
.combo.hot { color: var(--bad); }
.qsheet { overflow: hidden; }
.qsheet .stem { font-family: var(--doc); font-size: clamp(1.08rem, 1rem + .4vw, 1.3rem); line-height: 1.55; margin: 12px 0 16px; max-width: 70ch; }
.opts { display: grid; gap: 10px; }
.opt {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; text-align: left; width: 100%;
  padding: 12px 14px; min-height: 56px; background: var(--paper-2); border: 1.5px solid var(--rule); border-radius: 4px; cursor: pointer;
  font-family: var(--doc); font-size: 1.04rem; line-height: 1.45; transition: border-color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.opt:hover:not(:disabled) { border-color: var(--ink); }
.opt .box {
  width: 30px; height: 30px; border: 2px solid var(--ink); border-radius: 3px; display: grid; place-items: center;
  font-family: var(--ui); font-weight: 800; font-size: .95rem; position: relative; background: var(--paper);
}
.opt.picked .box::after, .opt.is-right .box::after, .opt.is-wrong .box::after {
  content: ""; position: absolute; inset: -6px -4px; background: no-repeat center/contain;
}
.opt.picked { border-color: var(--blue); background: var(--blue-soft); }
.opt.picked .box { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); }
.opt.is-right { border-color: var(--ok); background: var(--ok-soft); }
.opt.is-right .box { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.is-wrong .box { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt:disabled { cursor: default; color: var(--ink); }
.opt .ex { grid-column: 2; font-family: var(--ui); font-size: .92rem; color: var(--ink-2); margin-top: 4px; }

/* razítko na listu */
.imprint {
  position: absolute; z-index: 3; top: 18px; right: 14px; pointer-events: none; transform: rotate(-9deg);
  font-family: var(--stamp); font-weight: 900; font-size: clamp(1.5rem, 1.1rem + 2vw, 2.4rem); letter-spacing: .02em; line-height: 1;
  padding: 8px 14px 6px; border: 4px solid currentColor; border-radius: 8px; outline: 2px solid currentColor; outline-offset: 3px;
  color: var(--ok); opacity: .88; mix-blend-mode: multiply; filter: url(#ink);
}
:root[data-theme="dark"] .imprint { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .imprint { mix-blend-mode: screen; } }
.imprint.bad { color: var(--bad); transform: rotate(7deg); }
.imprint.violet { color: var(--violet); }
.imprint.land { animation: land .32s var(--ease) both; }
@keyframes land { 0% { opacity: 0; transform: rotate(-9deg) scale(1.8); filter: blur(3px); } 70% { opacity: .95; } 100% { opacity: .88; transform: rotate(-9deg) scale(1); filter: url(#ink); } }
.imprint.bad.land { animation-name: land-bad; }
@keyframes land-bad { 0% { opacity: 0; transform: rotate(7deg) scale(1.8); filter: blur(3px); } 100% { opacity: .88; transform: rotate(7deg) scale(1); filter: url(#ink); } }

/* rozhodnutí */
.decision { display: grid; gap: 14px; border-top: 2px solid var(--ink); padding-top: 14px; margin-top: 16px; }
.decision h3 { font-family: var(--doc); font-weight: 700; font-size: 1.02rem; }
.decision .doc { font-family: var(--doc); line-height: 1.6; max-width: 70ch; }
.why-not { display: grid; gap: 8px; }
.why-not div { display: grid; grid-template-columns: 26px 1fr; gap: 8px; font-family: var(--doc); }
.why-not b { font-family: var(--ui); color: var(--bad); }
.poucen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.xp-pop { position: absolute; z-index: 4; right: 22px; bottom: 18px; font-weight: 800; color: var(--violet); animation: pop 1.2s var(--ease) both; pointer-events: none; }
@keyframes pop { 0% { opacity: 0; transform: translateY(8px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-22px); } }

/* scénář */
.case { display: grid; gap: 16px; }
@media (min-width: 900px) { .case.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; } .case.split .case-text { position: sticky; top: 76px; max-height: calc(100dvh - 100px); overflow: auto; } }
.case-text .doc { font-family: var(--doc); font-size: 1.02rem; line-height: 1.65; }
.case-text .doc p + p { margin-top: .75em; }
.seals { display: flex; gap: 6px; }
.seal { width: 26px; height: 26px; border-radius: 50%; border: 2px dashed var(--rule); }
.seal.ok { border: 0; background: var(--ok); box-shadow: inset 0 0 0 3px var(--ok-soft); }
.seal.bad { border: 0; background: var(--bad); box-shadow: inset 0 0 0 3px var(--bad-soft); }
details.fold > summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; gap: 8px; align-items: center; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "+"; width: 22px; height: 22px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 3px; font-weight: 800; }
details.fold[open] > summary::before { content: "−"; }

/* simulace */
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.15rem; }
.timer.low { color: var(--bad); }
.navgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 5px; }
.navgrid button {
  height: 36px; border: 1.5px solid var(--rule); background: var(--paper); border-radius: 3px; font-size: .8rem; font-weight: 650;
  font-variant-numeric: tabular-nums; cursor: pointer; position: relative;
}
.navgrid button.done { background: var(--blue-soft); border-color: var(--blue); }
.navgrid button.cur { outline: 2px solid var(--ink); outline-offset: 1px; }
.navgrid button.flag::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; background: var(--marker); border: 1px solid var(--ink); border-radius: 50%; }
.navgrid button.right { background: var(--ok-soft); border-color: var(--ok); }
.navgrid button.wrong { background: var(--bad-soft); border-color: var(--bad); }
.result-head { display: grid; gap: 10px; justify-items: start; position: relative; min-height: 120px; }
.result-head .imprint { position: absolute; top: 0; right: 6px; }
.bigscore { font-size: clamp(2.6rem, 2rem + 4vw, 4.2rem); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }

/* krabička */
.boxes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-items: end; }
.lbox { display: grid; gap: 6px; justify-items: center; text-align: center; font-size: .82rem; color: var(--ink-2); }
.lbox .tray { width: 100%; background: var(--paper-2); border: 1.5px solid var(--ink); border-top: 0; border-radius: 0 0 6px 6px; display: flex; align-items: flex-end; justify-content: center; position: relative; overflow: hidden; }
.lbox .tray i { display: block; width: 78%; background: repeating-linear-gradient(0deg, var(--paper) 0 3px, var(--rule) 3px 4px); border-radius: 2px 2px 0 0; }
.lbox b { font-size: 1.1rem; color: var(--ink); font-variant-numeric: tabular-nums; }

/* kartičky */
.flash { perspective: 1200px; }
.flash-card { position: relative; min-height: 260px; transform-style: preserve-3d; transition: transform .45s var(--ease); cursor: pointer; }
.flash-card.flip { transform: rotateY(180deg); }
.flash-face { position: absolute; inset: 0; backface-visibility: hidden; display: grid; place-items: center; text-align: center; padding: 28px; background: var(--paper); border-radius: 6px; box-shadow: var(--shadow-lift); background-image: repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px); background-position: 0 56px; }
.flash-face.back { transform: rotateY(180deg); font-family: var(--doc); font-size: 1.08rem; line-height: 1.55; }
.flash-face.front { font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); font-weight: 700; }
.flash-face .chip { margin-top: 10px; }

/* hry */
.game-item { font-family: var(--doc); font-size: 1.12rem; line-height: 1.55; min-height: 5.5em; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.choices .btn { min-height: 54px; }
.choices .btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.choices .btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.clock { font-weight: 800; font-size: 1.6rem; font-variant-numeric: tabular-nums; }

/* mapa */
.search { display: flex; gap: 8px; }
.search input { flex: 1; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--paper); }
.hits { display: grid; gap: 6px; }
.hit { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 10px 12px; background: var(--paper); border-radius: var(--r-sheet); box-shadow: var(--shadow); }
.hit .chip { grid-row: 1 / span 2; align-self: start; }
.hit b { font-weight: 650; }
.hit small { color: var(--ink-2); grid-column: 2; }
mark { background: var(--marker); color: var(--marker-ink); padding: 0 1px; }

/* dekret a toasty */
.toasts { position: fixed; top: calc(70px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 40; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 6px; padding: 10px 14px; box-shadow: var(--shadow-lift); pointer-events: auto; animation: toast-in .35s var(--ease) both; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.toast .t-ic { font-family: var(--stamp); font-weight: 900; color: var(--violet); border: 2px solid currentColor; border-radius: 4px; padding: 0 5px; transform: rotate(-6deg); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.decree-wrap { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: rgba(18, 22, 31, .55); padding: 20px; animation: toast-in .3s both; }
.decree { width: min(460px, 100%); text-align: center; display: grid; gap: 12px; padding: 34px 26px 26px; border-top: 6px double var(--blue); }
.decree h2 { font-family: var(--doc); font-size: 1.15rem; font-weight: 600; }
.decree .title { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2rem); font-weight: 800; color: var(--blue); }
.decree .who { width: 70px; height: 80px; margin: 0 auto; }
.decree .imprint { position: static; justify-self: center; margin: 4px 0; }

/* výkaz */
.dom-rows { display: grid; gap: 10px; }
.dom-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 56px; gap: 10px; align-items: center; }
.dom-row .name { display: flex; gap: 8px; align-items: center; min-width: 0; line-height: 1.25; }
.dom-row .ruler i { background: var(--dc); }
.dom-row .pct { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .dom-row { grid-template-columns: minmax(0, 1fr) 90px 48px; } }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
.bars div { flex: 1; background: var(--blue); border-radius: 2px 2px 0 0; min-height: 2px; position: relative; }
.bars div.goal { background: var(--ok); }
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ach .a { padding: 12px; background: var(--paper); border-radius: var(--r-sheet); box-shadow: var(--shadow); display: grid; gap: 4px; position: relative; }
.ach .a.no { opacity: .62; box-shadow: none; background: var(--paper-2); }
.ach .a b { font-weight: 700; }
.ach .a small { color: var(--ink-2); font-size: .82rem; }
.ach .a .mini-stamp { position: absolute; top: 8px; right: 8px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: .85rem; color: var(--ink-2); }
.field input, .field select, .field textarea { min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--paper); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 42px; padding: 6px 14px; border: 1.5px solid var(--ink); background: var(--paper); border-radius: 6px; cursor: pointer; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-2); display: grid; gap: 12px; justify-items: center; }
.note { font-size: .88rem; color: var(--ink-2); }
.grid2 { display: grid; gap: 20px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; align-items: start; } }
details.fw { border-bottom: 1px solid var(--rule); padding: 8px 0; }
details.fw > summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-weight: 650; }
details.fw > summary::marker { color: var(--blue); }
details.fw[open] > summary { margin-bottom: 8px; }

/* přihlášení */
.login-page { display: grid; place-items: center; min-height: 100dvh; padding: 20px; }
.login { width: min(420px, 100%); }
.login-sheet { display: grid; gap: 16px; }
.login-ref { color: var(--ink-2); font-size: .85rem; }
.login-lead { color: var(--ink-2); }
.login-error { color: var(--bad); font-weight: 600; }

/* tisk taháku */
@media print {
  .head, .drawer, .stempl-dock, .toasts, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 10pt; }
  main { padding: 0; max-width: none; }
  .sheet { box-shadow: none; padding: 0; break-inside: avoid-page; }
  .notes-sec { break-inside: avoid; }
  .chip.ref { border: 1px solid #000; background: #fff; }
}
.notes { display: grid; gap: 18px; }
.notes-sec { display: grid; gap: 8px; }
.notes-sec h3 { border-bottom: 2px solid var(--ink); padding-bottom: 4px; }
.notes-sec ul { margin: 0; padding-left: 1.2em; display: grid; gap: 3px; font-size: .95rem; }

/* záložky jen pro širokou obrazovku */
.drawer a.wide-only { display: none; }
@media (min-width: 900px) { .drawer a.wide-only { display: grid; } }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
