:root {
  /* ---- shared, mode-only tokens (light values here; dark overrides at bottom) ---- */
  --ink: #15181B;
  --ink-2: #454B52;
  --ink-3: #656B72;
  --rule: #D9DEE1;
  --rule-2: #E6E9EC;
  --amber: #7A4E0E;
  --amber-wash: #F5ECDC;
  --red: #8A2E2B;
  --red-wash: #F6E6E4;
  --red-border: #EBCFCB;
  --border-hover: #C2C8CC;
  --scrollbar: #C5CBCF;
  --shadow: 21 24 27;
  /* Toast is always a dark chip with light text, on either page background - not remapped below. */
  --toast-bg: #15181B;
  --toast-fg: #FFFFFF;
  --a-firma: #34506B;
  --a-majetek: #86652A;
  --a-finance: #2F6B6B;
  --a-rodina: #4E6A39;
  --a-zdravi: #9C4B42;
  --a-osobni: #5D5371;
  --a-nezarazeno: #858A90;

  /* ---- graficky styl (point 14): raw light/dark pairs for ground, paper, akcent ----
     Klasický is the default and stays here with no [data-style] selector, so a missing or
     unknown localStorage value falls back to it for free. */
  --ground-l: #F1F3F4; --ground-d: #131619;
  --paper-l: #FFFFFF;  --paper-d: #1B1F23;
  --accent-l: #1F4D3A;      --accent-d: #6CC6A0;
  --accent-deep-l: #173B2C; --accent-deep-d: #8FDABB;
  --accent-wash-l: #E4EDE7; --accent-wash-d: #17291F;
  --accent-fill-l: #1F4D3A;       --accent-fill-d: #2E6B4E;
  --accent-fill-hover-l: #173B2C; --accent-fill-hover-d: #24593F;
  --on-accent-l: #FFFFFF; --on-accent-d: #F3FBF7;

  /* ---- mode (point 13): light is the baseline, dark blocks below override ---- */
  --ground: var(--ground-l);
  --paper: var(--paper-l);
  --accent: var(--accent-l);
  --accent-deep: var(--accent-deep-l);
  --accent-wash: var(--accent-wash-l);
  --accent-fill: var(--accent-fill-l);
  --accent-fill-hover: var(--accent-fill-hover-l);
  --on-accent: var(--on-accent-l);

  --sans: "Avenir Next", "Avenir", "Seravek", -apple-system, system-ui, sans-serif;
  --num: "Didot", "Bodoni 72", "Iowan Old Style", Georgia, serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --r: 10px;
  color-scheme: light;
}

:root[data-style="tepla"] {
  --ground-l: #F3ECE0; --ground-d: #191410;
  --paper-l: #FFFBF4;  --paper-d: #221B14;
  --accent-l: #9A4B2E;      --accent-d: #E29A72;
  --accent-deep-l: #78391F; --accent-deep-d: #F0B692;
  --accent-wash-l: #F1E0D0; --accent-wash-d: #2D2015;
  --accent-fill-l: #9A4B2E;       --accent-fill-d: #A05633;
  --accent-fill-hover-l: #78391F; --accent-fill-hover-d: #96502F;
  --on-accent-l: #FFFFFF; --on-accent-d: #FFF7F0;
}

:root[data-style="bridlice"] {
  --ground-l: #EAEEF2; --ground-d: #10151C;
  --paper-l: #FAFCFD;  --paper-d: #181F27;
  --accent-l: #2C4A6E;      --accent-d: #8EB6E0;
  --accent-deep-l: #1E3450; --accent-deep-d: #B0CEEC;
  --accent-wash-l: #E1E8F0; --accent-wash-d: #182432;
  --accent-fill-l: #2C4A6E;       --accent-fill-d: #3E6996;
  --accent-fill-hover-l: #1E3450; --accent-fill-hover-d: #305680;
  --on-accent-l: #FFFFFF; --on-accent-d: #F2F8FD;
}

/* ---- mode: dark, explicit choice ----
   Keep this block and the @media one below in sync - same declarations, different selector. */
:root[data-mode="dark"] {
  --ink: #ECEEEF;
  --ink-2: #B7BEC4;
  --ink-3: #868D93;
  --rule: #2B2F34;
  --rule-2: #24282C;
  --amber: #E0A855;
  --amber-wash: #2E2413;
  --red: #E38A85;
  --red-wash: #35201E;
  --red-border: #5A342F;
  --border-hover: #454B51;
  --scrollbar: #454B51;
  --shadow: 0 0 0;
  --ground: var(--ground-d);
  --paper: var(--paper-d);
  --accent: var(--accent-d);
  --accent-deep: var(--accent-deep-d);
  --accent-wash: var(--accent-wash-d);
  --accent-fill: var(--accent-fill-d);
  --accent-fill-hover: var(--accent-fill-hover-d);
  --on-accent: var(--on-accent-d);
  --a-firma: #6E93B8;
  --a-majetek: #C79A4B;
  --a-finance: #5FAFA8;
  --a-rodina: #8BAD68;
  --a-zdravi: #D08277;
  --a-osobni: #9A8FB5;
  --a-nezarazeno: #B0B5BA;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    --ink: #ECEEEF;
    --ink-2: #B7BEC4;
    --ink-3: #868D93;
    --rule: #2B2F34;
    --rule-2: #24282C;
    --amber: #E0A855;
    --amber-wash: #2E2413;
    --red: #E38A85;
    --red-wash: #35201E;
    --red-border: #5A342F;
    --border-hover: #454B51;
    --scrollbar: #454B51;
    --shadow: 0 0 0;
    --ground: var(--ground-d);
    --paper: var(--paper-d);
    --accent: var(--accent-d);
    --accent-deep: var(--accent-deep-d);
    --accent-wash: var(--accent-wash-d);
    --accent-fill: var(--accent-fill-d);
    --accent-fill-hover: var(--accent-fill-hover-d);
    --on-accent: var(--on-accent-d);
    --a-firma: #6E93B8;
    --a-majetek: #C79A4B;
    --a-finance: #5FAFA8;
    --a-rodina: #8BAD68;
    --a-zdravi: #D08277;
    --a-osobni: #9A8FB5;
    --a-nezarazeno: #B0B5BA;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
}
::selection { background: color-mix(in srgb, var(--accent) 25%, var(--paper)); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 10px; border: 3px solid var(--ground); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--ground) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top); }
.top-in { max-width: 1320px; margin: 0 auto; padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.brand h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.today { margin: 0; color: var(--ink-3); font-size: 15px; white-space: nowrap; }
.owner-name { margin: 0; font-size: 24px; font-weight: 500; color: var(--ink); letter-spacing: -.01em; }
.owner-name-header { flex: 1; min-width: 0; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-name-mobile { display: none; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.switch { display: inline-flex; background: var(--rule-2); border-radius: 999px; padding: 3px; }
.switch button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease); }
.switch button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
.icon-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--rule); background: var(--paper); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: border-color .2s, color .2s; }
.icon-btn:hover { border-color: var(--border-hover); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.viewer-note { max-width: 1320px; margin: 0 auto; padding: 10px 32px; display: flex; align-items: center; gap: 10px; color: var(--accent-deep); font-size: 15px; }
.viewer-note svg { width: 18px; height: 18px; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 28px 32px 96px; }

/* ---------- ask ---------- */
/* user 30. 9.: not the full width and clearly apart from the page around it */
.ask { position: relative; display: flex; align-items: center; gap: 6px; width: 100%; max-width: 760px; margin-inline: auto;
  background: var(--paper); border: 1px solid var(--border-hover); border-radius: 16px; padding: 4px 6px 4px 18px;
  box-shadow: 0 6px 20px rgb(var(--shadow) / .12); transition: border-color .25s, box-shadow .25s var(--ease); }
.ask-mic { height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--rule); background: transparent; color: inherit;
  display: flex; align-items: center; gap: 6px; font: inherit; font-size: 15px; cursor: pointer; }
.ask-mic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.ask-mic.rec { background: var(--red); border-color: var(--red); color: #fff; animation: pulse-rec 1.6s ease-in-out infinite; }
@keyframes pulse-rec { 50% { opacity: .75; } }
@media (max-width: 480px) { .ask-mic span { display: none; } .ask-mic { padding: 0 11px; } }
.ask:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--paper)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent); }
.ask-ico { color: var(--ink-3); width: 22px; height: 22px; }
.ask input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 14px 14px; font-size: 18px; outline: none; }
.ask input::placeholder { color: var(--ink-3); }
.ask-go { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--accent-fill); color: var(--on-accent); display: grid; place-items: center; transition: background .2s, transform .2s var(--ease); }
.ask-go:hover { background: var(--accent-fill-hover); }
.ask-go:active { transform: scale(.96); }
.ask-go[disabled] { opacity: .6; cursor: progress; }

.answer { margin: 12px 0 0; background: var(--paper); border: 1px solid var(--rule); border-radius: 16px; padding: 18px 22px; animation: rise .5s var(--ease); }
.answer-q { margin: 0 0 6px; color: var(--ink-3); font-size: 14px; }
.answer-a { margin: 0; font-size: 19px; line-height: 1.45; max-width: 70ch; text-wrap: pretty; }
.answer-src { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.answer-src button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); background: var(--ground); border-radius: 999px; padding: 5px 12px; font-size: 14px; color: var(--ink-2); }
.answer-src button:hover { color: var(--ink); border-color: var(--border-hover); }
.answer-src svg { width: 16px; height: 16px; }
.answer.thinking .answer-a { color: var(--ink-3); }
.answer-ai { margin: 12px 0 0; color: var(--ink-3); font-size: 13px; }
.answer-warn { margin: 10px 0 0; display: flex; gap: 6px; align-items: center; color: var(--ink-2); font-size: 15px; }
.answer-warn svg { width: 16px; height: 16px; flex: none; }

/* ---------- grid ---------- */
.grid > * { min-width: 0; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; grid-template-areas: "rail side" "papers side"; grid-template-rows: auto 1fr; column-gap: 56px; row-gap: 48px; margin-top: 40px; align-items: start; }
.rail-col { grid-area: rail; }
.dnes { margin: 0 0 16px; border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; }
.side-col { grid-area: side; }
.papers-col { grid-area: papers; display: grid; row-gap: 48px; min-width: 0; }

/* user 28. 9.: fill the width before wrapping, no early balanced break */
.summary { margin: 0; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.25; letter-spacing: -.015em; font-weight: 500; text-wrap: pretty; }
/* user 28. 9.: a fixed height, so switching tabs never makes the tabs below jump up and down */
.summary { min-height: 2.5em; }
@media (max-width: 520px) { .summary { min-height: 3.75em; } }
.summary em { font-style: normal; color: var(--accent); }
.summary .d { font-family: var(--num); font-weight: 400; font-size: 1.12em; letter-spacing: -.01em; }

.areas { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 24px 0 8px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.areas button { border: 0; background: none; padding: 4px 0; font-size: 15px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 8px; position: relative; transition: color .2s; }
.areas button:hover { color: var(--ink); }
.areas button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.areas button[aria-pressed="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -15px; height: 2px; background: var(--ink); }
.areas .n { font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 400; }
.tick { width: 3px; height: 14px; border-radius: 2px; background: var(--a, var(--a-nezarazeno)); flex: none; }

/* ---------- rail ---------- */
.rail { position: relative; }
.group { margin-top: 30px; }
.group-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.group-h span { font-weight: 400; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 20px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--rule-2); background: none; padding: 16px 8px 16px 0; transition: background .25s var(--ease); border-radius: 0; }
.row:hover { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--paper) 90%, transparent) 12%, color-mix(in srgb, var(--paper) 90%, transparent)); }
.date { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.date b { font-family: var(--num); font-weight: 400; font-size: 44px; letter-spacing: -.02em; font-variant-numeric: lining-nums; }
.date i { font-style: normal; margin-top: 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.row-t { min-width: 0; }
.row-t p, .card-veta, .brief-b, .answer-a, .cite { font-variant-numeric: tabular-nums; }
.row-t p { margin: 0; font-size: 17px; line-height: 1.35; text-wrap: pretty; }
.row-t .meta { margin-top: 5px; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); min-width: 0; }
.row-t .meta span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.past { opacity: .62; }
.row.settle { animation: settle .9s var(--ease); }

.state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.state svg { width: 15px; height: 15px; }
.state.ok { color: var(--accent); background: var(--accent-wash); }
.state.wait { color: var(--amber); background: var(--amber-wash); }
.state.gone { color: var(--ink-3); background: var(--rule-2); }

.empty { margin: 34px 0 0; padding: 30px 0; border-top: 1px solid var(--rule-2); color: var(--ink-3); font-size: 17px; max-width: 46ch; }
.empty strong { display: block; color: var(--ink); font-weight: 500; font-size: 20px; margin-bottom: 6px; }

/* ---------- side column ---------- */
.side-col { display: flex; flex-direction: column; gap: 44px; position: sticky; top: 86px; }
.papers .paper-list { columns: 2; column-gap: 40px; }
.papers .paper-list li { break-inside: avoid; }
.col-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.col-head h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.005em; }
.count { color: var(--ink-3); font-size: 15px; font-variant-numeric: tabular-nums; }

.drop { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; padding: 18px 20px; border: 1.5px dashed var(--border-hover); border-radius: 14px; background: color-mix(in srgb, var(--paper) 50%, transparent); cursor: pointer; transition: border-color .25s, background .25s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-wash); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop svg { grid-row: span 2; width: 26px; height: 26px; color: var(--accent); }
.drop-t { font-weight: 600; font-size: 16px; }
.drop-s { color: var(--ink-3); font-size: 14px; }
.paper-open { width: 100%; margin-top: 10px; }

.queue { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.card.enter { animation: rise .55s var(--ease); }
.card { position: relative; background: var(--paper); border: 1px solid var(--rule); border-radius: 16px; padding: 20px 20px 16px; box-shadow: 0 1px 2px rgb(var(--shadow) / .04), 0 10px 30px -12px rgb(var(--shadow) / .14); overflow: hidden; }
.card-top { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); }
.card-top .src { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; }
.card-top .src svg { width: 16px; height: 16px; }
.card-when { display: flex; align-items: baseline; gap: 12px; margin: 12px 0 4px; }
.card-when b { font-family: var(--num); font-weight: 400; font-size: 40px; line-height: 1; letter-spacing: -.02em; }
.card-when span { color: var(--ink-2); font-size: 15px; }
.card-veta { margin: 4px 0 0; font-size: 18px; line-height: 1.4; text-wrap: pretty; }
.card-doc { margin: 6px 0 0; color: var(--ink-3); font-size: 14px; }
.card-doc button { border: 0; background: none; padding: 0; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.card-doc button:hover { color: var(--ink); text-decoration-color: currentColor; }
.cite { margin: 14px 0 0; padding: 12px 14px; background: var(--ground); border-radius: 10px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.cite q { quotes: "„" "“"; }
.cite small { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--accent); font-weight: 500; }
.cite small.bad { color: var(--amber); }
.cite small svg { width: 14px; height: 14px; }
.rule-note { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
.question { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--amber-wash); color: var(--amber); font-size: 15px; display: flex; gap: 10px; }
.question svg { margin-top: 1px; }
.actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 10px 16px; font-size: 15px; font-weight: 600; border: 1px solid transparent; transition: background .2s, border-color .2s, color .2s, transform .15s var(--ease); min-height: 42px; }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--accent-fill); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-fill-hover); }
.btn.ghost { background: transparent; border-color: var(--rule); color: var(--ink-2); }
.btn.ghost:hover { border-color: var(--border-hover); color: var(--ink); }
.btn.quiet { background: transparent; color: var(--ink-3); padding-inline: 10px; }
.btn.quiet:hover { color: var(--red); }
.btn[disabled] { opacity: .55; cursor: progress; }

.edit { display: grid; gap: 10px; margin-top: 14px; }
.edit label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.field { width: 100%; border: 1px solid var(--rule); background: var(--paper); border-radius: 10px; padding: 10px 12px; font-size: 16px; font-weight: 400; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.field:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--paper)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent); }
textarea.field { resize: vertical; min-height: 64px; line-height: 1.4; }

.seal { position: absolute; right: 18px; top: 16px; width: 92px; height: 92px; border-radius: 50%; border: 2px solid var(--accent); color: var(--accent); display: grid; place-items: center; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.25; background: color-mix(in srgb, var(--accent-wash) 90%, transparent); animation: press .42s var(--ease) both; pointer-events: none; }
.seal::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.card.sealed { animation: leave .5s .62s var(--ease) forwards; }

.working { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; animation: rise .5s var(--ease); }
.working p { margin: 0; min-width: 0; }
.working p b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.working p span { font-size: 14px; color: var(--ink-3); }
.pulse { width: 26px; height: 26px; border-radius: 50%; flex: none; background: conic-gradient(var(--accent) 0 25%, var(--rule-2) 25% 100%); mask: radial-gradient(circle, transparent 8px, #000 9px); -webkit-mask: radial-gradient(circle, transparent 8px, #000 9px); animation: spin 4s linear infinite; } /* #000 is a mask stop (opacity), not a rendered colour */
.working.err { background: var(--red-wash); border-color: var(--red-border); }
.working.err span { color: var(--red); }

.inbox-empty { margin: 14px 0 0; color: var(--ink-3); font-size: 15px; }

.trash-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding-inline: 0; }
.trash-list { display: grid; gap: 2px; margin-top: 20px; }
.trash-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--rule-2); }
.trash-name { margin: 0; font-size: 15px; font-weight: 500; }
.trash-meta { font-size: 13px; color: var(--ink-3); }

.paper-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-2); }
.paper-list li button { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; border: 0; border-bottom: 1px solid var(--rule-2); background: none; padding: 12px 2px; }
.paper-list li button:hover .p-name { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.paper-list svg { color: var(--ink-3); width: 18px; height: 18px; }
.p-name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-area { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }

/* ---------- drop veil ---------- */
.dropveil { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: color-mix(in srgb, var(--ground) 78%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
.dropveil.on { opacity: 1; }
.dropveil div { display: grid; justify-items: center; gap: 10px; padding: 48px 64px; border: 2px dashed var(--accent); border-radius: 24px; color: var(--accent); background: color-mix(in srgb, var(--paper) 70%, transparent); }
.dropveil svg { width: 40px; height: 40px; }
.dropveil p { margin: 0; font-size: 22px; font-weight: 600; }

/* ---------- sheet ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 40; background: rgb(var(--shadow) / .22); animation: fade .3s var(--ease); }
/* user 29. 9.: in the iPhone app the sticky head let content scroll up under the clock. The head is now a
   fixed row and only the body scrolls, so nothing can ever pass behind the status bar. */
.sheet { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--paper); box-shadow: -2px 0 0 var(--rule), -24px 0 60px -20px rgb(var(--shadow) / .25); display: flex; flex-direction: column; overflow: hidden; animation: slide .45s var(--ease); }
.sheet:not([hidden]) > .sheet-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* Sticky, opaque head bar (point 17): the close button used to be position:absolute INSIDE this
   same scrolling box, so it scrolled away with the content and the safe-area gap at the top was
   just blank space that scrolled out of view too - nothing stayed pinned below the notch/status
   bar while scrolling. A sticky head fixes both: the button stays reachable, and its own
   safe-area padding + opaque background keep covering that area at any scroll position. */
.sheet-head { flex: none; position: relative; z-index: 2; display: flex; justify-content: flex-end; padding: calc(10px + env(safe-area-inset-top)) 18px 0; background: var(--paper); }
.sheet-close { padding: 8px; }
.paper-dialog .sheet-close { position: absolute; top: 18px; right: 18px; }
.sheet-body { padding: 6px 40px 64px; }
.sheet h3 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -.015em; font-weight: 600; text-wrap: balance; }
.sheet .lede { margin: 10px 0 0; font-size: 17px; color: var(--ink-2); max-width: 60ch; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 20px; margin: 24px 0 0; padding: 18px 0; border-top: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); font-size: 15px; }
/* user 28. 9.: one row height for text and controls alike, label and value on one centre line */
.facts dt { color: var(--ink-3); display: flex; align-items: center; min-height: 44px; }
.facts dd { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; }
.facts select { max-width: 220px; }
.sheet h4 { margin: 32px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.doc-text { white-space: pre-wrap; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); background: var(--ground); border-radius: 12px; padding: 18px 20px; max-height: 44vh; overflow: auto; margin: 0; font-family: var(--sans); }
.doc-text mark { background: var(--accent-wash); color: var(--ink); border-radius: 3px; padding: 1px 2px; box-shadow: 0 0 0 2px var(--accent-wash); }
.report { white-space: pre-wrap; font-size: 15px; line-height: 1.55; color: var(--ink-2); background: var(--ground); border-radius: 12px; padding: 16px 18px; margin: 0; }
.facts dd.note { color: var(--amber); font-size: 13.5px; }
.terms { display: grid; border-top: 1px solid var(--rule-2); }
.term { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 16px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--rule-2); }
.term .date b { font-size: 34px; }
.term p { margin: 0; font-size: 16px; }
.term .actions { margin-top: 10px; }
.brief { margin-top: 12px; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.brief-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: var(--ground); font-size: 14px; color: var(--ink-2); }
.brief-b { padding: 16px 18px; font-size: 15px; line-height: 1.55; }
.brief-b p { margin: 0 0 10px; }
.brief-b ul { margin: 0 0 10px; padding-left: 18px; }
.brief-b .zad { font-weight: 600; margin: 0; }
.brief-foot { padding: 0 18px 14px; font-size: 13px; color: var(--ink-3); }
.pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.prof h3 + .lede { margin-bottom: 8px; }
.prof .note, .login .note { color: var(--ink-3); font-size: 14px; margin: 8px 0 0; }
.prof .lead-row { flex-wrap: wrap; margin-bottom: 8px; }

/* Login (brief 26. 9.): while it is up, nothing of the app shows behind it. */
body.locked > :not(.login, svg, .toast) { display: none !important; }
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 16px 24px; }
.login[hidden] { display: none; }
.login-card { width: 100%; max-width: 380px; background: var(--paper); border: 1px solid var(--rule); border-radius: 16px; padding: 28px 24px; display: grid; gap: 14px; }
.login-card h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.login-card .lede { margin: 0; color: var(--ink-2); font-size: 15px; }
.login-card label { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.login-card label[hidden] { display: none; }
.login-card .switch { flex-wrap: wrap; justify-self: start; }
.login-err { margin: 0; min-height: 1.2em; color: var(--red); font-size: 14px; }
.login-card .actions { margin-top: 0; }
.area-edit { display: grid; gap: 8px; }
.area-edit .line { display: grid; grid-template-columns: auto 1fr 40px; gap: 10px; align-items: center; }
.lead-row { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.lead-row .field { width: 90px; text-align: center; font-variant-numeric: tabular-nums; }
.lead-row .field.field-wide { width: 100%; max-width: 480px; text-align: left; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.checks input { accent-color: var(--accent); width: 17px; height: 17px; }
.style-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.style-swatch { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--rule); background: var(--paper); border-radius: 999px; padding: 7px 14px 7px 9px; font-size: 14px; color: var(--ink-2); }
.style-swatch[aria-pressed="true"] { border-color: var(--accent); color: var(--ink); }
.style-swatch i { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); flex: none; }
.danger-zone .btn { white-space: nowrap; }
.danger-zone { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--rule-2); display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--ink-3); font-size: 14px; }

/* ---------- new-paper dialog ---------- */
.paper-dialog { position: fixed; z-index: 50; margin: auto; top: 0; right: 0; bottom: 0; left: 0; width: min(520px, calc(100vw - 32px)); max-height: min(88vh, 720px); border: 0; border-radius: 18px; padding: 28px 26px 24px; background: var(--paper); box-shadow: 0 24px 70px -20px rgb(var(--shadow) / .35); color: var(--ink); }
.paper-dialog::backdrop { background: rgb(var(--shadow) / .35); }
.paper-dialog h3 { margin: 0 32px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.paper-dialog .lede { margin: 8px 32px 0 0; color: var(--ink-2); font-size: 15px; }
.shots { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.shots-empty { margin: 18px 0 0; color: var(--ink-3); font-size: 14px; }
.shots-count { width: 100%; margin: 8px 0 0; color: var(--ink-3); font-size: 14px; }
.shot { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--rule); background: var(--ground); }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; height: 100%; font-size: 10.5px; text-align: center; padding: 4px; overflow: hidden; color: var(--ink-3); }
.shot-x { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgb(var(--shadow) / .55); color: #fff; display: grid; place-items: center; padding: 0; } /* fixed dark chip in both modes, so a literal white icon always reads */
.shot-x svg { width: 12px; height: 12px; }
.paper-actions { display: flex; gap: 10px; margin: 16px 0 0; flex-wrap: wrap; }
.msg-field { display: grid; gap: 6px; margin: 18px 0 0; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.voice-row { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; }
.voice-state { font-size: 14px; color: var(--ink-2); }
.co-s-tim { border: 0; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 6px; }
.co-s-tim legend { font-size: 13px; font-weight: 600; color: var(--ink-3); padding: 0; margin: 0 0 6px; }
.co-s-tim label { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.co-s-tim input, .priority-toggle input { accent-color: var(--accent); width: 17px; height: 17px; }
.priority-toggle { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 15px; }
.ideas-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-2); }
.idea-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--rule-2); }
.idea-row button[data-doc] { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; text-align: left; color: inherit; }
.idea-row button[data-doc]:hover .p-name { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.idea-row .p-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idea-row svg { color: var(--ink-3); width: 18px; height: 18px; flex: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@media (max-width: 640px) { .paper-dialog { padding: 22px 18px 18px; } }

/* ---------- footer (point 13) ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 18px 32px calc(18px + env(safe-area-inset-bottom)); }
.site-footer-in { max-width: 1320px; margin: 0 auto; display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) { .site-footer { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); } }

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--toast-bg); color: var(--toast-fg); padding: 12px 18px; border-radius: 12px; font-size: 15px; max-width: min(520px, calc(100vw - 32px)); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease), transform .4s var(--ease); box-shadow: 0 8px 30px -8px rgb(var(--shadow) / .4); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: .001; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } }
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes press { 0% { transform: scale(1.6) rotate(-14deg); opacity: 0; filter: blur(4px); } 60% { transform: scale(.94) rotate(-9deg); opacity: 1; filter: blur(0); } 100% { transform: scale(1) rotate(-9deg); opacity: 1; } }
@keyframes leave { to { opacity: 0; transform: translateX(-24px) scale(.98); height: 0; padding-block: 0; margin-block: -7px; border-width: 0; } }
@keyframes settle { 0% { background: var(--accent-wash); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; } }

/* ---------- small screens ---------- */
@media (max-width: 1080px) {
  .grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "rail" "papers"; grid-template-rows: auto; gap: 40px; }
  .side-col { position: static; }
  .papers .paper-list { columns: 1; }
}
@media (max-width: 640px) {
  .grid { grid-template-areas: "rail" "side" "papers"; }
  .areas { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); padding-right: 40px; } /* mask stop, not a rendered colour */
  .areas { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .areas::-webkit-scrollbar { display: none; }
  .areas button { white-space: nowrap; }
  .areas button[aria-pressed="true"]::after { bottom: -14px; }
  .btn { padding: 10px 12px; }
  .actions { gap: 6px; }
}
@media (max-width: 640px) {
  .top-in { padding: 10px 16px; }
  .brand h1 { font-size: 20px; }
  .today { display: none; }
  .icon-btn span { display: none; }
  .icon-btn { padding: 8px; }
  .switch button { padding: 6px 12px; }
  .viewer-note { padding: 10px 16px; }
  .wrap { padding: 16px 16px 80px; }
  .owner-name-header { display: none; }
  .owner-name-mobile { display: block; text-align: center; margin: 0 0 16px; }
  .ask { border-radius: 14px; padding-left: 14px; }
  .ask input { font-size: 16px; padding: 12px 10px; }
  .grid { margin-top: 24px; }
  .summary { font-size: 24px; }
  .row { grid-template-columns: 58px minmax(0, 1fr); gap: 14px; }
  .row .state { grid-column: 2; justify-self: start; margin-top: -6px; }
  .date b { font-size: 36px; }
  .card { padding: 18px 16px 14px; }
  .card-when b { font-size: 36px; }
  .seal { width: 78px; height: 78px; font-size: 10px; }
  .sheet-head { padding: calc(10px + env(safe-area-inset-top)) 12px 0; }
  .sheet-body { padding: 6px 18px 56px; }
  .sheet h3 { font-size: 22px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dt { min-height: 0; margin-top: 10px; }
  .facts dd { min-height: 0; }
  .facts dd { margin-bottom: 10px; }
  .term { grid-template-columns: 56px minmax(0, 1fr); }
  .dropveil { display: none; }
}

/* Film or series saved for later (decision 27. 9.) */
.media { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; margin-top: 20px; align-items: start; }
.media-one { grid-template-columns: 1fr; }
.media-poster { width: 112px; border-radius: 8px; display: block; }
.media-facts p { margin: 0 0 8px; }
.media-score b { font-size: 22px; }
.media-plot { color: var(--ink-3); font-size: 14px; }
.media-links a { color: var(--accent); }
@media (max-width: 420px) { .media { grid-template-columns: 84px minmax(0, 1fr); } .media-poster { width: 84px; } }

.hero { display: block; width: 100%; margin: 18px 0 4px; padding: 0; border: 0; background: none; cursor: zoom-in; }
.hero img { display: block; width: 100%; max-height: 340px; object-fit: cover; border-radius: 14px; }
.media-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px !important; }
.btn.pill { padding: 8px 14px; font-size: 14px; text-decoration: none; }
.viewer { position: fixed; inset: 0; z-index: 60; background: rgb(0 0 0 / .92); display: flex; align-items: center; justify-content: center; padding: calc(56px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); }
.viewer-body { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-body iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 8px; }
.viewer-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 14px; color: #fff; }

.working-thumb { width: 44px; height: 44px; flex: none; object-fit: cover; border-radius: 8px; }

.recent { margin-top: 28px; }
.recent-h { margin: 0 0 6px; font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list button { display: flex; gap: 12px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--rule-2); background: none; padding: 10px 2px; color: inherit; font-size: 14px; }
.recent-t { color: var(--ink-3); font-variant-numeric: tabular-nums; flex: none; }

/* "Dnes" (spec 008 US1): the state is in the colour AND in a word, never in the colour alone */
.dnes-head { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 12px 16px; border: 0; background: none; color: inherit; font-size: 16px; font-weight: 500; text-align: left; }
.dnes-head:disabled { cursor: default; color: var(--ink-3); font-weight: 400; }
.dnes.is-akce { border-color: var(--accent); }
.dnes.is-akce .dnes-head { color: var(--accent); }
.dnes.is-po { border-color: #c0392b; }
.dnes.is-po .dnes-head { color: #c0392b; }
.dnes-list { list-style: none; margin: 0; padding: 0 16px 8px; }
.dnes-list li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--rule-2); font-size: 15px; }
.dnes-tag { flex: none; min-width: 84px; font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.dnes-akce .dnes-tag { color: var(--accent); }
.dnes-po .dnes-tag { color: #c0392b; }
.dnes-note { margin: 0; padding: 0 16px 12px; color: var(--ink-3); font-size: 14px; }

.prof-more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.prof-more > summary::-webkit-details-marker { display: none; }
.prof-more > summary::after { content: "▾"; color: var(--ink-3); }
.prof-more[open] > summary::after { content: "▴"; }
.prof-more > summary h4 { margin-bottom: 8px; }

/* Tags (spec 004, user 28. 9.) */
.tag-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.tag-filter:empty { display: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid var(--rule); border-radius: 999px; background: none; color: var(--ink-2, inherit); font-size: 13px; line-height: 1.4; }
.tag.on { border-color: var(--accent); color: var(--accent); }
.tag-x { border: 0; background: none; color: inherit; padding: 0 0 0 2px; font-size: 15px; line-height: 1; cursor: pointer; }
.tags-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-input { width: 140px; padding: 4px 10px; font-size: 13px; }

.viewer-pages { width: 100%; height: 100%; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.viewer-pages figure { margin: 0; text-align: center; }
.viewer-pages img { max-width: 100%; max-height: none; }
.viewer-pages figcaption { color: #ccc; font-size: 13px; margin-top: 6px; }

.orig > summary { cursor: pointer; color: var(--accent); }
.orig-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.orig-thumb { padding: 0; border: 1px solid var(--rule); border-radius: 8px; background: none; overflow: hidden; cursor: zoom-in; }
.orig-thumb img { display: block; width: 72px; height: 96px; object-fit: cover; }
.tag-suggest { border-style: dashed; cursor: pointer; }
.viewer-text { width: 100%; height: 100%; overflow: auto; margin: 0; padding: 16px; background: #fff; color: #000; border-radius: 8px; white-space: pre-wrap; font-size: 14px; }

/* ---------- layouts (FR-036): Přehled is the default and has no rules of its own here ---------- */
.lay-switch svg { width: 17px; height: 17px; }
.lay-switch button { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 1520px) { .lay-switch span { display: none; } .lay-switch button { padding: 6px 10px; } }
.drawer-btn, .drawer-close, .board { display: none; }

/* Deník: one column by time; the inbox between today and the stream, papers in the drawer */
body[data-layout="denik"] .wrap { max-width: 780px; }
body[data-layout="denik"] .grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "dnes" "summary" "side" "areas" "rail"; grid-template-rows: auto; row-gap: 0; }
body[data-layout="denik"] .rail-col { display: contents; }
body[data-layout="denik"] .dnes { grid-area: dnes; }
body[data-layout="denik"] .summary { grid-area: summary; }
body[data-layout="denik"] .areas { grid-area: areas; margin-top: 40px; }
body[data-layout="denik"] .rail { grid-area: rail; }
body[data-layout="denik"] .side-col { grid-area: side; position: static; margin-top: 32px; }
body[data-layout="denik"] .group-past { margin-top: 44px; }
.row.arrived .date b { color: var(--ink-3); }
.row.arrived .row-t p { color: var(--ink-2); }
.state.in { color: var(--ink-2); background: var(--ground); box-shadow: inset 0 0 0 1px var(--rule); }

/* Both alternatives: Papíry, Na později and tags live in a drawer from the right */
body[data-layout="denik"] .drawer-btn, body[data-layout="nastenka"] .drawer-btn { display: inline-flex; }
body[data-layout="denik"] .papers-col, body[data-layout="nastenka"] .papers-col {
  position: fixed; z-index: 36; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); align-content: start;
  background: var(--paper); overflow-y: auto; overscroll-behavior: contain; row-gap: 40px;
  padding: calc(12px + env(safe-area-inset-top)) 32px calc(48px + env(safe-area-inset-bottom));
  box-shadow: -2px 0 0 var(--rule), -24px 0 60px -20px rgb(var(--shadow) / .25);
  transform: translateX(104%); visibility: hidden; transition: transform .45s var(--ease), visibility 0s .45s;
}
body.drawer-open .papers-col { transform: none; visibility: visible; transition: transform .45s var(--ease); }
body[data-layout="denik"] .drawer-close, body[data-layout="nastenka"] .drawer-close { display: inline-flex; justify-self: end; position: sticky; top: 0; z-index: 1; padding: 8px; margin-bottom: -28px; }
body[data-layout="denik"] .papers .paper-list, body[data-layout="nastenka"] .papers .paper-list { columns: 1; }
.drawer-back { position: fixed; inset: 0; z-index: 35; background: rgb(var(--shadow) / .22); animation: fade .3s var(--ease); }

/* Nástěnka: a column per area, hairlines between them, the inbox first */
body[data-layout="nastenka"] .wrap { max-width: 1600px; }
body[data-layout="nastenka"] .grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "rail" "board"; grid-template-rows: auto; row-gap: 36px; }
body[data-layout="nastenka"] .areas, body[data-layout="nastenka"] .rail { display: none; }
body[data-layout="nastenka"] .board { grid-area: board; display: flex; align-items: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding-bottom: 16px; }
.board-cols { display: contents; }
.board > *, .bcol { scroll-snap-align: start; min-width: 0; }
.board > .side-col { flex: 0 0 360px; position: static; padding-right: 28px; }
.bcol { flex: 1 0 196px; min-width: 0; padding: 0 14px; border-left: 1px solid var(--rule-2); }
.bcol:last-child { padding-right: 0; }
.bcol-h { display: flex; align-items: center; gap: 9px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--rule); }
.bcol-h h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.005em; }
.bcol-h .count { margin-left: auto; }
.brow { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--rule-2); background: none; padding: 12px 0; border-radius: 0; transition: background .25s var(--ease); }
.brow .date b { font-size: 30px; }
.brow .date i { margin-top: 4px; font-size: 11px; }
.brow-t p { margin: 0; font-size: 15px; line-height: 1.35; font-variant-numeric: tabular-nums; text-wrap: pretty; }
.brow-t small { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.brow.due { background: var(--amber-wash); border-radius: 10px; border-bottom-color: transparent; padding: 12px 10px; margin: 6px 0; }
.brow.due small { color: var(--amber); font-weight: 600; }
.brow:not(.due):hover { background: color-mix(in srgb, var(--paper) 90%, transparent); }
.brow.settle { animation: settle .9s var(--ease); }
.bcol-empty { margin: 14px 0 0; color: var(--ink-3); font-size: 14px; }
.bcol-sub { display: flex; justify-content: space-between; margin: 26px 0 4px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.bcol-sub span { font-weight: 400; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.bcol-papers { list-style: none; margin: 0; padding: 0; }
.bcol-papers button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 40px; text-align: left; border: 0; border-bottom: 1px solid var(--rule-2); background: none; padding: 8px 0; color: inherit; }
.bcol-papers svg { width: 16px; height: 16px; color: var(--ink-3); }
.bcol-papers .p-name { min-width: 0; font-size: 14px; }
.bcol-papers button:hover .p-name { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }

@media (max-width: 640px) {
  body[data-layout="denik"] .side-col { margin-top: 24px; }
  body[data-layout="denik"] .papers-col, body[data-layout="nastenka"] .papers-col { padding-inline: 18px; }
  body[data-layout="nastenka"] .board { margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
  .board > .side-col { flex: 0 0 88%; padding-right: 16px; }
  .bcol { flex: 0 0 82%; padding: 0 16px; }
  .bcol:last-child { padding-right: 16px; }
}
/* Phone header: the layout switch needs the brand's room; the greeting under the header stays */
@media (max-width: 640px) {
  .top-in:has(.lay-switch) .brand { display: none; }
  .top-actions { gap: 8px; margin-left: auto; }
  .lay-switch button { padding: 6px 8px; }
}
/* Deník: one "Nový papír" button is enough in a single column; dragging a file still works on the whole page */
body[data-layout="denik"] .drop { display: none; }
body[data-layout="denik"] .paper-open { margin-top: 0; }
@media (max-width: 640px) { .row .state.in.plain { display: none; } }
/* user 29. 9.: in Deník the stream already carries every waiting term (and its detail can confirm it),
   so the approval cards would only push the stream a screen and a half down. Intent questions and
   running uploads stay, they are not in the stream. */
body[data-layout="denik"] #queue article[data-card] { display: none; }
.dismiss { margin: 4px 0 8px; }

/* user 30. 9.: "counting" and "ready to move" must look different at a glance */
.uklid-stav { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; font-size: 14px;
  border: 1px dashed var(--rule); opacity: .8; }
.uklid-stav.hotovo { border: 1px solid var(--accent); background: var(--accent-wash); color: var(--accent-deep);
  font-weight: 600; opacity: 1; }

/* user 30. 9.: three ways of saying "time saved", to compare */
.usetreno-varianty { margin: 4px 0 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.usetreno-hlavni { font-size: 22px; font-weight: 600; margin: 4px 0 8px; }
.usetreno-seznam { margin: 0 0 10px; padding-left: 20px; line-height: 1.6; }
.usetreno-blok { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 10px; }
.usetreno-dopis { line-height: 1.6; }
.usetreno-dopis p { margin: 0 0 10px; }

/* ---- Přehled smlouvy (spec 003 FR-042, draft) ---- */
#smPanel { margin-top: 24px; }
.sm { border: 1px solid var(--rule); border-radius: 12px; padding: 4px 18px 18px; }
.sm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sm-head h4 { flex: 1; margin: 20px 0 10px; }
.sm h5 { margin: 24px 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.sm-svg { display: block; width: 100%; max-width: 480px; height: auto; font-family: var(--sans); }
.sm-cap { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); }
.sm .note { margin: 6px 0 0; font-size: 14px; color: var(--ink-3); }
.sm-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; margin-bottom: 10px; font-size: 14px; color: var(--ink-2); }
.sm-bar .sm-track { grid-column: 1 / -1; grid-row: 2; height: 14px; border-radius: 7px; background: var(--rule-2); overflow: hidden; }
.sm-bar .sm-track i { display: block; height: 100%; border-radius: 7px; }
.sm-bar .sm-track i.a { background: var(--ink-3); }
.sm-bar .sm-track i.b { background: var(--accent); }
.sm-bar span { grid-column: 1; grid-row: 1; }
.sm-bar b { grid-column: 2; grid-row: 1; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.sm-legend { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.sm-legend span { display: flex; align-items: center; gap: 8px; }
.sm-legend b { color: var(--ink); }
.sm-tab { width: 100%; border-collapse: collapse; font-size: 14px; }
.sm-tab th { text-align: left; font-weight: 600; color: var(--ink-3); padding: 4px 8px 6px 0; }
.sm-tab td { padding: 6px 8px 6px 0; border-top: 1px solid var(--rule-2); color: var(--ink-2); overflow-wrap: anywhere; }
.sm-tab th:not(:first-child), .sm-tab td:not(:first-child) { text-align: right; white-space: nowrap; padding-right: 0; }
.sm-ask { display: flex; gap: 8px; margin-top: 4px; }
.sm-ask .field { flex: 1; min-width: 0; }
.sm-qa { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule-2); font-size: 15px; color: var(--ink-2); }
.sm-qa p { margin: 0 0 4px; }
.sm-qa .q { font-weight: 600; color: var(--ink); }
@media (max-width: 640px) { .sm { padding: 2px 14px 16px; } }
.sm-svg text { letter-spacing: 0; word-spacing: 0; paint-order: normal; stroke: none; }

/* user 30. 9.: contract overview in its own window */
.sm-dialog { border: 0; padding: 0; width: min(760px, 100vw); max-width: 100vw; max-height: 92vh;
  border-radius: 16px; background: var(--paper); color: var(--ink); overflow: auto; }
.sm-dialog::backdrop { background: rgb(0 0 0 / .45); }
.sm-dialog #smPanel, .sm-dialog #majPanel, .sm-dialog #lidePanel, .sm-dialog #skolaPanel, .sm-dialog #postaPanel, .sm-dialog #dokladyPanel, .sm-dialog #platbyPanel { position: relative; padding: 16px; }
.sm-dialog .sm { border: 0; padding: 4px 0 8px; }
.sm-dialog .sm-x { position: sticky; top: 0; float: right; z-index: 2; }
@media (max-width: 600px) { .sm-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; } }

/* ---- Majetek (spec 010) ---- */
.maj-tri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0 0; }
.maj-tri > div { border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.maj-tri span { display: block; font-size: 13px; color: var(--ink-3); }
.maj-tri b { display: block; margin-top: 2px; font-family: var(--num); font-size: 22px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.maj-tri .maj-cisty { background: var(--accent-wash); border-color: transparent; }
.maj-tri .maj-cisty b { color: var(--accent-deep); }
@media (max-width: 520px) { .maj-tri { grid-template-columns: 1fr 1fr; } .maj-tri .maj-cisty { grid-column: 1 / -1; } .maj-tri .maj-cisty b { font-size: 28px; } }
.maj-stack { display: flex; gap: 2px; height: 16px; border-radius: 8px; overflow: hidden; background: var(--rule-2); }
.maj-stack i { display: block; height: 100%; }
.maj-sw { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 3px; }
.maj-svg { max-width: 560px; }
.maj-item { border-top: 1px solid var(--rule-2); }
.maj-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; width: 100%; text-align: left; background: none; border: 0; padding: 10px 0; color: var(--ink); font: inherit; cursor: pointer; }
.maj-name { font-size: 16px; overflow-wrap: anywhere; }
.maj-val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.maj-meta { grid-column: 1 / -1; font-size: 14px; color: var(--ink-3); }
.maj-meta.old { color: var(--amber); }
.maj-splaceno { grid-column: 1 / -1; margin: 4px 0 0; }
.maj-actions, .maj-add { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 12px; }
.maj-form { display: grid; gap: 10px; padding: 4px 0 14px; }
.maj-form h6 { margin: 0; font-size: 15px; }
.maj-form p { margin: 0; font-size: 15px; }
.maj-f { display: grid; gap: 4px; font-size: 14px; color: var(--ink-3); }
.maj-form .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.maj-navrh { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; margin-top: 8px; border-radius: 12px; background: var(--accent-wash); color: var(--ink); font-size: 15px; }
.maj-navrh span { flex: 1 1 200px; min-width: 0; }
.maj-po { margin: 18px 0 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--rule); font-size: 15px; color: var(--ink); }
/* spec 010 verze 2: views, kind cards, item cards, detail with tabs, map without tiles */
.maj-seg { display: flex; flex-wrap: wrap; margin: 4px 0 12px; }
.maj-seg button, .maj-tabs button { border: 0; border-radius: 0; }
.maj-seg button + button, .maj-tabs button + button { border-left: 1px solid var(--rule); }
.maj-seg button { flex: 1 1 auto; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.maj-navrh .actions { display: flex; gap: 8px; }
.maj-navrh.off { background: transparent; border: 1px dashed var(--rule); }
.maj-stack { margin: 14px 0 6px; }
.maj-druh { border: 1px solid var(--rule); border-radius: 12px; margin-top: 10px; overflow: hidden; }
.maj-druh-h { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px; background: none; border: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; min-height: 52px; }
.maj-druh-h .maj-name { flex: 1; font-weight: 600; }
.maj-druh-h::after { content: "›"; color: var(--ink-3); font-size: 20px; transition: transform .2s var(--ease); }
.maj-druh.open .maj-druh-h::after { transform: rotate(90deg); }
.maj-count { min-width: 24px; padding: 1px 8px; border-radius: 10px; background: var(--rule-2); color: var(--ink-2); font-size: 13px; text-align: center; }
.maj-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; padding: 0 12px 12px; }
.maj-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-content: start; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.maj-card:hover { border-color: var(--border-hover); }
.maj-card .maj-meta, .maj-card .maj-tags { grid-column: 1 / -1; }
.maj-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.maj-tag { display: inline-block; padding: 1px 8px; border-radius: 8px; background: var(--rule-2); color: var(--ink-2); font-size: 12.5px; }
.maj-tag.old { background: var(--amber-wash); color: var(--amber); }
.maj-zmena.up { color: var(--accent-deep); }
.maj-zmena.down { color: var(--red); }
.maj-map { position: relative; aspect-ratio: 460 / 280; max-width: 560px; }
.maj-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.maj-dot { position: absolute; transform: translate(-13px, -50%); display: flex; align-items: center; gap: 6px; background: none; border: 0; padding: 6px; font: inherit; cursor: pointer; color: var(--ink); }
.maj-dot i { width: 14px; height: 14px; border-radius: 50%; background: var(--accent-fill); box-shadow: 0 0 0 3px var(--paper); flex: none; }
.maj-dot span { font-size: 13px; font-weight: 600; background: var(--paper); padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.maj-arch-r { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-top: 1px solid var(--rule-2); }
.maj-arch-r .maj-meta { flex: 1; }
.maj-det-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 2px 44px 6px 0; }
.maj-kicker { margin: 10px 0 0; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.maj-det-h { margin: 2px 0 4px; font-size: 22px; }
.maj-det-v { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 12px; }
.maj-det-v b { font-family: var(--num); font-size: 30px; font-weight: 500; }
.maj-det-v span:not(.maj-tag) { color: var(--ink-3); font-size: 14px; }
.maj-menu { position: relative; }
.maj-menu-l { position: absolute; right: 0; top: calc(100% + 4px); z-index: 3; display: grid; min-width: 210px; padding: 6px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); box-shadow: 0 8px 24px rgb(var(--shadow) / .18); }
.maj-menu-l .btn { justify-content: flex-start; text-align: left; color: var(--ink); }
.maj-menu-l .btn.danger { color: var(--red); }
.maj-tabs { display: flex; flex-wrap: wrap; margin: 6px 0 14px; }
.maj-tabs button { flex: 1 1 auto; padding-inline: 10px; }
.maj-tab { min-height: 120px; }
.maj-hist { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 15px; }
.maj-hist th, .maj-hist td { padding: 8px 6px; border-bottom: 1px solid var(--rule-2); text-align: left; }
.maj-hist th { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.maj-hist .c { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.maj-hist-a, .maj-hist td:first-child { white-space: nowrap; }
.maj-hist-a { text-align: right; }
.maj-hist-a .btn { padding: 4px 8px; min-height: 0; font-size: 14px; }
.maj-warn { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--amber-wash); color: var(--amber); font-size: 15px; }
.maj-warn .linkish { color: inherit; }
.maj-box { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--rule); font-size: 15px; color: var(--ink); }
.maj-box p { margin: 4px 0 0; }
.maj-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.maj-doc { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--rule-2); }
.maj-own { list-style: none; margin: 0 0 12px; padding: 0; }
.maj-own li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--rule-2); }
.maj-pozn { white-space: pre-wrap; }
.maj-inline { margin-top: 12px; }
.maj-form textarea.field { font: inherit; resize: vertical; }
@media (max-width: 520px) { .maj-cards { grid-template-columns: 1fr; padding: 0 10px 10px; } .maj-det-v b { font-size: 26px; } .maj-hist { font-size: 14px; } }

/* FR-043: the in-app calendar */
.sm-dialog #kalPanel { position: relative; padding: 16px; }
.kal-dialog { width: min(1040px, 100vw); }
.kal-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-top: 8px; }
.kal-seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.kal-seg button { padding: 9px 16px; font-size: 15px; font-weight: 600; background: transparent; color: var(--ink-2); min-height: 42px; }
.kal-seg button[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); }
.kal-nav { display: inline-flex; gap: 6px; }
.kal-nav .btn { min-width: 46px; padding-inline: 12px; }
.kal-title { margin: 14px 0 4px; font-size: 20px; font-weight: 600; }
.kal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }
.kal-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 2px; vertical-align: -1px; }
.kal-sw.ukazka { background: var(--accent-fill); }
.kal-sw.seznam { background: var(--ink-3); }
.kal-sw.google { background: transparent; border: 1px dashed var(--ink-3); }
.kal-ev { display: block; width: 100%; text-align: left; font: inherit; font-size: 13px; line-height: 1.3; padding: 3px 6px; border-radius: 6px; border: 1px solid transparent; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kal-ev b { font-weight: 700; font-variant-numeric: tabular-nums; }
.kal-ev.ukazka { background: var(--accent-wash); color: var(--accent-deep); border-left: 3px solid var(--accent); cursor: pointer; }
.kal-ev.seznam { background: var(--rule-2); color: var(--ink-2); border-left: 3px solid var(--ink-3); }
.kal-ev.pend { background: transparent; border: 1px dashed var(--accent); border-left: 3px dashed var(--accent); }
.kal-ev.clash { background: var(--red-wash); color: var(--red); border-color: var(--red); border-left: 3px solid var(--red); }
.kal-ev.big { font-size: 15px; padding: 8px 10px; margin-top: 6px; white-space: normal; }
.kal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.kal-h { padding: 6px; font-size: 13px; font-weight: 600; color: var(--ink-3); text-align: center; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.kal-cell { min-height: 112px; padding: 4px; display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-width: 0; cursor: pointer; }
.kal-cell.other { background: var(--rule-2); opacity: .7; }
.kal-cell.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.kal-cell.hl, .kal-wd.hl { background: var(--accent-wash); }
.kal-n { font-size: 13px; font-weight: 600; color: var(--ink-2); align-self: flex-start; min-width: 24px; text-align: center; border-radius: 12px; padding: 1px 4px; }
.kal-cell.today .kal-n { background: var(--accent-fill); color: var(--on-accent); }
.kal-more { font-size: 12px; color: var(--ink-3); padding-left: 4px; }
.kal-day { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; }
.kal-day h6, .kal-wd h6 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.kal-week { display: grid; gap: 8px; }
.kal-wd { border: 1px solid var(--rule); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; }
.kal-wd.today { border-color: var(--accent); border-width: 2px; }
.kal-wd.hl { border-color: var(--accent); }
.kal-wd h6 span { display: inline-block; min-width: 5.6em; }
.kal-wd.today h6::after { content: " · dnes"; color: var(--accent); }
.kal-wd .kal-ev { font-size: 15px; padding: 6px 8px; white-space: normal; }
.kal-none { margin: 0; font-size: 14px; color: var(--ink-3); }
@media (max-width: 600px) {
  .kal-cell { min-height: 58px; padding: 3px; gap: 2px; }
  .kal-cell .kal-ev { height: 6px; padding: 0; font-size: 0; border-width: 0; border-radius: 3px; }
  .kal-cell .kal-ev * { display: none; }
  .kal-more { display: none; }
}

/* user 30. 9.: design lab, whole-app variants in static/lab/<x>/ */
.lab-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 14px; }
.lab-links span { color: var(--ink-3); }
.lab-links a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Lidé a příležitosti (spec 011): the lit button and the dialog ---------- */
.lide-svit { --svit: #2f9e44; display: inline-flex; align-items: center; gap: 8px; max-width: 320px; min-width: 0; padding: 7px 14px 7px 10px;
  border-radius: 999px; border: 1.5px solid var(--svit); background: color-mix(in srgb, var(--svit) 14%, var(--ground)); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.lide-svit span { overflow: hidden; text-overflow: ellipsis; }
.lide-svit:hover { background: color-mix(in srgb, var(--svit) 24%, var(--ground)); }
.lide-svit:focus-visible { outline: 2px solid var(--svit); outline-offset: 2px; }
.lide-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--svit); box-shadow: 0 0 0 3px color-mix(in srgb, var(--svit) 30%, transparent); }
.lide-svit[data-svit="dnes"] .lide-dot, .lide-svit[data-svit="brzy"] .lide-dot { animation: lide-puls 2s ease-in-out infinite; }
@keyframes lide-puls { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--svit) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .lide-svit .lide-dot { animation: none !important; } }
@media (max-width: 600px) {
  .lide-svit { flex: none; padding: 7px 10px; font-size: 14px; font-weight: 600; }
  .lide-svit span { display: none; }
  .lide-svit::after { content: attr(data-n); }
}
@media (max-width: 420px) { .lide-svit { gap: 0; padding: 9px; } .lide-svit::after { content: none; } }  /* the header is full: only the dot */
.lide-svit-demo { --svit: #888; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--svit);
  background: color-mix(in srgb, var(--svit) 14%, var(--ground)); font-size: 14px; }
.lide-color { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.lide-color input[type=color] { width: 44px; height: 32px; padding: 0; border: 1px solid var(--rule); border-radius: 6px; background: none; cursor: pointer; }
.lide-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule-2); }
.lide-row .date { flex: none; display: flex; flex-direction: column; align-items: center; width: 44px; line-height: 1.1; }
.lide-row .date b { font-size: 20px; }
.lide-row .date i { font-style: normal; font-size: 12px; color: var(--ink-3); }
.lide-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; text-decoration: none; }
.lide-row-t span { color: var(--ink-2); font-size: 14px; }
.lide-row .actions { flex: none; margin: 0; }
.lide-row.done { opacity: .6; }
.kal-sw.lide { background: var(--a-rodina); }
.kal-ev.lide { background: color-mix(in srgb, var(--a-rodina) 18%, transparent); }
.kal-ev.lide { color: var(--ink); border-left: 3px solid var(--a-rodina); cursor: pointer; }
.lide-check { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; font-size: 15px; }
.lide-3 { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.lide-3 .maj-f { flex: 1 1 90px; }
.lide-3 .lide-lab { flex-basis: 100%; font-size: 14px; color: var(--ink-2); }
.lide-3 .actions { flex: none; }
.lide-info { width: 100%; border-collapse: collapse; margin: 4px 0 12px; font-size: 15px; }
.lide-info th { width: 34%; text-align: left; font-weight: 500; color: var(--ink-3); padding: 6px 8px 6px 0; vertical-align: top; }
.lide-info td { padding: 6px 0; border-bottom: 1px solid var(--rule-2); }
.lide-list li, .lide-vy li { align-items: center; gap: 8px; }
.lide-list li > span:first-child, .lide-vy li > span:first-child { flex: 1; }
.lide-tip { padding: 8px 0; border-bottom: 1px solid var(--rule-2); }
.lide-tip p { margin: 2px 0; }
.lide-koncept { margin: 12px 0; padding: 12px; border: 1px solid var(--rule); border-radius: 10px; }
.lide-koncept textarea { width: 100%; font: inherit; line-height: 1.5; }
.lide-koncept.done { background: var(--rule-2); }
.lide-text { white-space: normal; }
.lide-busy { color: var(--accent-deep); }
.lide-next { color: var(--accent-deep); }
.lide h6 { font-size: 15px; font-weight: 600; margin: 18px 0 6px; }

/* Zamitnute (user 2. 10.): one list per source, each row undoable */
.zamitnute h5 { margin: 14px 0 6px; font-size: .95rem; }
.zamitnute ul { list-style: none; margin: 0; padding: 0; }
.zamitnute li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.zamitnute li .btn { flex-shrink: 0; }
.tag.kdo { font-size: .75rem; vertical-align: middle; opacity: .85; }
.skola-list { margin: 0 0 8px; padding-left: 18px; }
.skola-list li { margin: 4px 0; }
/* Posta (spec 013) */
.posta .sm-head { display: flex; justify-content: space-between; align-items: center; }
.posta-ucet { padding: 10px 12px; margin: 0 0 10px; border: 1px solid var(--rule); border-left: 4px solid var(--rule); border-radius: 8px; overflow-wrap: anywhere; }
.posta-ucet.is-ok { border-left-color: #2f9e44; } .posta-ucet.is-chyba { border-left-color: #e03131; } .posta-ucet.is-off { opacity: .75; }
.posta-ucet .card-doc { margin: 4px 0; }
.zamitnute .row-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.zamitnute .rozsah { max-width: 170px; }
.fraze-add { flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; } .fraze-add .field { flex: 1 1 180px; }
.btn-ic { width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.8; }
#postaFiltr, .posta-add select { min-width: 200px; }
.zamitnute .rozsah { min-width: 150px; }
.kdo-pick { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; color: var(--ink-2); } .kdo-pick .field { max-width: 200px; }
/* Souhrn ze skoly (user 2. 10.): highlighted numbers like a search hit, the date as its own column */
.skola mark { background: var(--accent-wash); color: var(--ink); border-radius: 3px; padding: 0 3px; font-weight: 600; white-space: nowrap; }
.skola-list.rodic { border-left: 3px solid var(--accent); padding-left: 22px; }
.skola-list.info { color: var(--ink-2); }
.skola-rows { list-style: none; margin: 0; padding: 0; }
.skola-row { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--rule-2); }
.skola-row .date { flex: none; display: flex; flex-direction: column; align-items: center; width: 48px; line-height: 1.1; }
.skola-row .date b { font-size: 22px; }
.skola-row .date i { font-style: normal; font-size: 12px; color: var(--ink-3); }
.skola-row.brzy .date b { color: var(--accent-deep); }
.skola-t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.skola-t .linkish { align-self: flex-start; font-size: 14px; color: var(--ink-2); text-align: left; }
.heslo-box { margin: 6px 0; } .heslo-box summary { cursor: pointer; font-weight: 600; } .heslo-box .field { flex: 1 1 200px; }

/* user 2. 10.: the ask bar stays put under the header (like the Rozhovor lab), the approvals column
   scrolls on its own so the page itself scrolls fast */
.ask { position: sticky; top: calc(var(--top-h, 66px) + 10px); z-index: 15; background: var(--paper); box-shadow: 0 0 0 10px var(--ground), 0 12px 28px -14px rgb(0 0 0 / .45); }
@media (min-width: 1081px) {
  body:not([data-layout="denik"]):not([data-layout="nastenka"]) .side-col { top: calc(var(--top-h, 66px) + 100px); max-height: calc(100vh - var(--top-h, 66px) - 116px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 6px; scroll-padding-top: 56px; }
}
.queue-chips { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; background: var(--ground); }
.queue-chips button { border: 1px solid var(--rule); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.queue-chips button b { color: var(--ink); margin-left: 2px; }
.queue-chips button[aria-pressed="true"] { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.queue-chips button[aria-pressed="true"] b { color: inherit; }

/* ---------- Agenda (user 2. 10.): week strip + days in their own scroller + day detail ---------- */
.agenda { --ag-ja: var(--accent); --ag-po: #e03131; --ag-dite: #7950f2; --ag-info: var(--ink-3); --ag-ok: #2f9e44; margin-top: 18px; }
.ag-bar { display: flex; align-items: center; gap: 6px; background: var(--ground); padding: 6px 0; }
.ag-nav, .ag-today { flex: none; min-height: 40px; padding-inline: 12px; }
.ag-strip { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: none; scroll-padding-inline: 4px; padding: 4px 2px; }
.ag-strip::-webkit-scrollbar { display: none; }
.ag-day { position: relative; flex: 0 0 calc((100% - 24px) / 7); min-width: 52px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 6px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--ink-2); transition: background .15s, border-color .15s; }
.ag-day:hover { background: var(--rule-2); }
.ag-day.mon { margin-left: 6px; }
.ag-day.past { opacity: .45; }
.ag-day .ag-dn { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.ag-day .ag-n { font-size: 20px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ag-day.today .ag-n { color: var(--on-accent); background: var(--accent-fill); border-radius: 999px; min-width: 32px; padding: 0 6px; }
.ag-day[aria-selected="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ag-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ag-dots { display: flex; gap: 3px; min-height: 14px; align-items: center; }
.ag-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ag-ja); }
.ag-dots b { font-size: 12px; font-weight: 700; color: var(--ink); background: var(--rule-2); border-radius: 999px; padding: 0 6px; }
.ag-day.has-ja .ag-dots b { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.ag-top { display: flex; align-items: center; justify-content: space-between; }
.ag-mes { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: none; color: var(--ink); font-size: 16px; font-weight: 700; padding: 6px 10px; margin-left: -10px; border-radius: 10px; }
.ag-mes:hover { background: var(--rule-2); }
.ag-mes svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s; }
.ag-mes[aria-expanded="true"] svg { transform: rotate(180deg); }
.ag-month { max-width: 420px; margin: 6px 0 10px; padding: 14px; border: 1px solid var(--rule); border-radius: 14px; background: var(--paper); box-shadow: 0 18px 40px -22px rgb(0 0 0 / .5); }
@media (prefers-reduced-motion: no-preference) { .ag-month:not([hidden]) { animation: ag-fold .18s ease-out; } @keyframes ag-fold { from { opacity: 0; transform: translateY(-6px); } } }
.ag-mhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 16px; }
.ag-mhead .btn { min-height: 36px; padding: 0 10px; } .ag-mhead svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.ag-mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ag-mh { text-align: center; font-size: 13px; color: var(--ink-3); padding: 4px 0 6px; }
.ag-mc { display: flex; flex-direction: column; align-items: center; gap: 2px; aspect-ratio: 1; justify-content: center; border: 2px solid transparent; border-radius: 8px; background: none; color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.ag-mc:hover { background: var(--rule-2); }
.ag-mc.other { color: var(--ink-3); opacity: .6; }
.ag-mc.past span { color: var(--ink-3); }
.ag-mc.today { background: var(--accent-fill); color: var(--on-accent); font-weight: 700; }
.ag-mc.today span { color: inherit; }
.ag-mc.sel { border-color: var(--accent); }
.ag-mdots { display: flex; gap: 2px; height: 5px; } .ag-mdots b { width: 5px; height: 5px; border-radius: 50%; background: var(--k); }
.ag-mc.today .ag-mdots b { background: var(--on-accent); }
.ag-dbody .card { margin-top: 14px; }
.k-po { --k: var(--ag-po); } .k-ja { --k: var(--ag-ja); } .k-dite { --k: var(--ag-dite); } .k-info { --k: var(--ag-info); } .k-ok { --k: var(--ag-ok); }
.ag-dots i[class] { background: var(--k); }
.ag-list { scroll-snap-type: y proximity; position: relative; max-height: max(380px, calc(100vh - var(--top-h, 66px) - 250px)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  border-top: 1px solid var(--rule-2); -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); padding-bottom: 28px; }
.ag-list:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ag-sec { content-visibility: auto; contain-intrinsic-size: auto 160px; scroll-snap-align: start; }
.ag-h { position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline; justify-content: space-between; margin: 0; padding: 14px 0 6px; background: var(--ground);
  font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.ag-h button { border: 0; background: none; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.ag-h button:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.ag-h span { font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ag-sec.is-po .ag-h { color: var(--ag-po); }
.ag-row { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--rule-2); border-radius: 8px; }
.ag-row:hover, .ag-row:focus-within { background: var(--rule-2); }
.ag-main { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 12px; text-align: left; border: 0; background: none; padding: 11px 6px 11px 2px; color: inherit; }
.ag-acts { flex: none; display: flex; gap: 4px; padding-right: 6px; opacity: 0; transition: opacity .15s; }
.ag-row:hover .ag-acts, .ag-row:focus-within .ag-acts { opacity: 1; }
@media (hover: none) { .ag-acts { opacity: 1; } }
.ag-act { min-width: 36px; height: 34px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 9px; background: var(--paper); color: var(--ink-2); font-size: 13px; font-weight: 600; display: inline-grid; place-items: center; }
.ag-act:hover { color: var(--ink); border-color: var(--ink-3); }
.ag-act.ok { color: var(--on-accent); background: var(--accent-fill); border-color: var(--accent-fill); }
.ag-act svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.ag-vse { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 14px 0 -4px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, transparent); font-size: 14px; }
.toast-act { margin-left: 10px; border: 1px solid currentColor; background: none; color: inherit; border-radius: 8px; padding: 3px 10px; font-weight: 700; cursor: pointer; }
.ag-dot { flex: none; width: 4px; align-self: stretch; border-radius: 4px; background: var(--k); }
.ag-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 16px; }
.ag-t small { color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-row.k-dite .ag-t > span, .ag-row.k-info .ag-t > span { color: var(--ink-2); }
.ag-ok { flex: none; color: var(--ag-ok); } .ag-ok svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.ag-more { margin: 4px 0 6px 16px; border: 0; background: none; color: var(--accent-deep); font-weight: 600; padding: 6px 0; }
.ag-prosle { margin-top: 16px; color: var(--ink-3); } .ag-prosle summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.ag-empty { color: var(--ink-3); padding: 24px 0; }
/* day detail: side sheet on desktop, bottom sheet on a phone */
.den-dialog { border: 0; padding: 0; margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw); background: var(--paper); color: var(--ink); box-shadow: -20px 0 50px -20px rgb(0 0 0 / .5); }
.den-dialog::backdrop { background: rgb(0 0 0 / .4); }
.den-dialog[open] { display: flex; flex-direction: column; }
#denPanel { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ag-detail { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ag-dhead { display: flex; align-items: center; gap: 8px; padding: 16px; border-bottom: 1px solid var(--rule); }
.ag-dhead h3 { flex: 1; margin: 0; font-size: 20px; text-align: center; display: flex; flex-direction: column; } .ag-dhead h3 small { font-size: 13px; font-weight: 400; color: var(--ink-3); }
.ag-dhead .sheet-close { position: static; }
.ag-dbody { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 24px; }
.ag-dbody > .btn { margin-top: 16px; }
@media (prefers-reduced-motion: no-preference) {
  .den-dialog[open] { animation: ag-in .22s var(--ease, ease-out); }
  @keyframes ag-in { from { transform: translateX(40px); opacity: 0; } }
}
@media (max-width: 640px) {
  .ag-bar { position: sticky; z-index: 5; top: calc(var(--top-h, 56px) + 70px); }
  .ag-day { flex-basis: calc((100% - 16px) / 5); }
  .ag-nav { display: none; }
  .ag-list { max-height: none; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .ag-h { top: calc(var(--top-h, 56px) + 160px); }
  .den-dialog { margin: auto 0 0; width: 100vw; max-width: 100vw; height: 86dvh; border-radius: 18px 18px 0 0; }
  @media (prefers-reduced-motion: no-preference) { .den-dialog[open] { animation-name: ag-up; } @keyframes ag-up { from { transform: translateY(60px); opacity: 0; } } }
}
.toast.on:has(.toast-act) { pointer-events: auto; }
.archiv-list { list-style: none; margin: 0; padding: 0; } .archiv-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule-2); } .archiv-list .linkish { flex: 1; min-width: 0; text-align: left; } .archiv-list .note { font-size: 13px; overflow-wrap: anywhere; }
/* Doklady (spec 014 D) */
.dk-list { list-style: none; margin: 8px 0 16px; padding: 0; }
.dk-row { border-left: 4px solid var(--rule); border-radius: 8px; margin-bottom: 8px; background: var(--rule-2); }
.dk-row.is-po { border-left-color: #e03131; } .dk-row.is-brzy { border-left-color: #f08c00; } .dk-row.is-rok { border-left-color: #fab005; } .dk-row.is-klid { border-left-color: #2f9e44; }
.dk-main { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 12px 14px; text-align: left; color: inherit; }
.dk-do { display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; } .dk-do small { color: var(--ink-3); }
.dk-row.is-po .dk-do small, .dk-row.is-brzy .dk-do small { color: inherit; font-weight: 600; }
.pl-sum { font-size: 18px; } .pl-row.up { border-left-color: #f08c00; } .pl-list li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 600px) { .dk-main { grid-template-columns: minmax(0, 1fr) auto; } .dk-main > :nth-child(2) { grid-column: 1; grid-row: 2; } .dk-main .dk-do { grid-row: 1 / span 2; grid-column: 2; } }
/* Predat (spec 014 F) */
.predat { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.predat .lead-row { display: flex; gap: 6px; flex: 1 1 240px; margin: 0; } .predat .lead-row .field { flex: 1; min-width: 0; }
.predat-text { width: 100%; font: inherit; font-size: 14px; line-height: 1.45; }
.predat-btn { margin-top: 8px; }
.tag.kdo.ok { color: #2f9e44; border-color: currentColor; }
.lide-vcf { cursor: pointer; } .imp-list { max-height: 50vh; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--rule); border-radius: 10px; margin: 10px 0; } .imp-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-bottom: 1px solid var(--rule-2); cursor: pointer; } .imp-row span { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .imp-row small { color: var(--ink-3); overflow-wrap: anywhere; } .imp .lead-row { flex-wrap: wrap; gap: 8px; }
.verze-list { margin: 0; padding-left: 18px; } .verze-list li { margin: 2px 0; } .tag.kdo.zmena { color: #f08c00; border-color: currentColor; }

/* Firmy (spec 016) */
.sm-dialog #firmyPanel { position: relative; padding: 16px; }
.fi-head { flex-wrap: nowrap; gap: 8px; margin-bottom: 6px; } .fi-head h4 { min-width: 0; overflow-wrap: anywhere; margin: 0; }
.fi-back { white-space: nowrap; padding-left: 8px; padding-right: 10px; }
.fi-bar { margin: 4px 0 12px; }
.fi-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fi-card { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; border: 1px solid var(--rule); border-left: 4px solid var(--a-firma); border-radius: 10px; background: var(--paper); color: inherit; padding: 12px 14px; }
.fi-card:hover { border-color: var(--border-hover); border-left-color: var(--a-firma); }
.fi-card.is-arch { opacity: .7; border-left-color: var(--rule); }
.fi-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; } .fi-card-top b { font-size: 17px; }
.fi-card-meta, .fi-near { font-size: 14px; color: var(--ink-3); overflow-wrap: anywhere; } .fi-near small { color: var(--ink-3); }
.fi-chip { display: inline-block; border: 1px solid var(--rule); border-radius: 999px; padding: 1px 9px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.5; white-space: nowrap; }
.fi-chip.warn { background: var(--amber-wash); color: var(--amber); border-color: transparent; }
.fi-chip.ok { color: #2f6b3a; border-color: currentColor; } .fi-chip.mute { color: var(--ink-3); }
.fi-empty { padding: 8px 0 4px; } .fi-empty .btn { margin-top: 6px; } .fi-empty-t { margin: 10px 0; }
.fi-err, .fi-warn, .fi-ok { margin: 10px 0; padding: 10px 12px; border-radius: 10px; font-size: 15px; display: flex; gap: 8px; align-items: flex-start; }
.fi-err { background: var(--red-wash); color: var(--red); border: 1px solid var(--red-border); } .fi-warn { background: var(--amber-wash); color: var(--amber); } .fi-ok { background: var(--rule-2); color: var(--ink); }
.fi-ok svg { width: 18px; height: 18px; flex: none; }
.fi-sub { margin: 0 0 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.fi-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin: 6px 0 12px; overflow-x: auto; }
.fi-tabs button { border: 0; border-bottom: 3px solid transparent; background: none; padding: 10px 12px; font-size: 15px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.fi-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--a-firma); }
.fi h5 { margin: 18px 0 6px; font-size: 15px; }
.fi-dl { margin: 0 0 14px; display: grid; gap: 8px; } .fi-dl div { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px; } .fi-dl dt { color: var(--ink-3); font-size: 14px; } .fi-dl dd { margin: 0; overflow-wrap: anywhere; } .fi-none { color: var(--ink-3); }
.fi-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.btn.danger { background: var(--red); color: #fff; } .fi-del { color: var(--red); }
.fi-confirm { margin-top: 12px; padding: 12px; border: 1px solid var(--red-border); background: var(--red-wash); border-radius: 10px; } .fi-confirm p { margin: 0 0 10px; } .fi-confirm .btn { margin-right: 8px; }
.fi-form, .fi-add, .fi-box { display: grid; gap: 10px; margin: 8px 0; }
.fi-fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 14px; color: var(--ink-2); } .fi-fld small { color: var(--ink-3); } .fi-fld .field { width: 100%; text-align: left; }
.fi-check { display: flex; align-items: center; gap: 8px; font-size: 16px; min-height: 36px; } .fi-check input { width: 20px; height: 20px; }
.fi-half { max-width: 320px; }
.fi-ico { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 6px 0 10px; } .fi-ico-f { flex: 1 1 200px; max-width: 280px; }
.fi-row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.fi-who { border: 1px solid var(--rule); border-radius: 10px; padding: 6px 12px 8px; margin: 0; } .fi-who legend { font-size: 14px; color: var(--ink-2); padding: 0 6px; }
.fi-pots, .fi-ppl { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fi-pot { border: 1px solid var(--rule); border-left: 4px solid var(--rule); border-radius: 10px; padding: 10px 12px; }
.fi-pot.is-navrh { border-left-color: #f08c00; } .fi-pot.is-potvrzeno { border-left-color: var(--a-firma); } .fi-pot.is-hotovo { border-left-color: #2f9e44; } .fi-pot.is-zamitnuto { opacity: .6; }
.fi-pot-top { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; } .fi-pot-meta { font-size: 14px; color: var(--ink-2); margin-top: 2px; } .fi-pot-meta small { color: var(--ink-3); }
.fi-date { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); } .fi-date .field { width: auto; padding: 7px 8px; font-size: 15px; }
.fi-ppl li { display: flex; gap: 10px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--rule-2); padding: 8px 0; } .fi-ppl small { display: block; color: var(--ink-3); }
.fi-assets li .btn { flex: none; }
@media (max-width: 600px) { .fi-dl div { grid-template-columns: 1fr; gap: 0; } .fi-actions .btn { flex: 1 1 auto; } .fi-date { flex: 1 1 100%; } }
/* Ke schvaleni folds (user 3. 10.); folded, the count glows: orange waiting, red overdue */
.inbox-toggle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.inbox-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s; }
.inbox-toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }
.inbox.sbaleno #queue, .inbox.sbaleno #recentBox { display: none; }
.inbox-head { margin-top: 18px; }
.inbox.sbaleno #inboxCount[data-stav] { padding: 2px 10px; border-radius: 999px; font-weight: 700; }
.inbox.sbaleno #inboxCount[data-stav="ceka"] { color: #fff; background: #f08c00; box-shadow: 0 0 0 4px color-mix(in srgb, #f08c00 25%, transparent); }
.inbox.sbaleno #inboxCount[data-stav="po"] { color: #fff; background: #e03131; box-shadow: 0 0 0 4px color-mix(in srgb, #e03131 25%, transparent); }
@media (prefers-reduced-motion: no-preference) { .inbox.sbaleno #inboxCount[data-stav] { animation: lide-puls 2s ease-in-out infinite; } }
.fakt-neovereno { color: var(--ink-2); }
