/* Dílna — H7: fokus, odkaz „Přeskočit na obsah“, drobnosti na úzkých displejích, formulář uživatele, tisk. Načítá se jako poslední. */

/* ---------- viditelný fokus všude (klávesnice) ---------- */
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.kcard:focus-visible, .seg button:focus-visible, .tabs a:focus-visible, .ptabs a:focus-visible, .tab:focus-visible, .chip:focus-visible, .t-main:focus-visible,
.sg-item:focus-visible, .nav-item:focus-visible, .bn-item:focus-visible, .menu-item:focus-visible, .heat-c:focus-visible, .pcal-chip:focus-visible, .drop:focus-visible {
  outline: 2px solid var(--ring); outline-offset: -2px; box-shadow: inset 0 0 0 4px var(--surface);
}
.kanban:focus-visible { outline-offset: -2px; }
.tl-bar:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; box-shadow: 0 0 0 5px var(--surface); }
.chk input:focus-visible { outline: 3px solid var(--ring); outline-offset: -3px; }
.ch-svg rect:focus-visible, .hb-seg:focus-visible, .ch-svg [tabindex]:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.switch input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }
.inp:focus-visible, .sel:focus-visible, textarea:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.btn.pri:focus-visible, .btn.danger.solid:focus-visible { outline-color: var(--ring); box-shadow: 0 0 0 5px var(--surface); }
.modal:focus { outline: none; }

/* ---------- Přeskočit na obsah: první položka tabulátoru, vidět jen při fokusu ---------- */
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 2000; padding: 10px 16px; border-radius: var(--r); background: var(--primary); color: var(--primary-text); font-weight: 650; text-decoration: none; box-shadow: var(--shadow-lg); transition: top var(--t-fast); }
.skip-link:focus, .skip-link:focus-visible { top: 12px; outline: 2px solid var(--text); outline-offset: 2px; text-decoration: none; }
#page:focus { outline: none; }

/* ---------- nadpisy a hlavičky karet se nelámou do věže ---------- */
.card-h { flex-wrap: wrap; row-gap: 2px; }
.card-h > b, .card-h > h2, .card-h > h3, .card-h > h4 { flex: 0 0 auto; max-width: 100%; }
.card-h > .muted, .card-h > .small { flex: 1 1 240px; min-width: 0; }
h1, h2, h3 { text-wrap: balance; }
.page-h > div:first-child { min-width: 0; flex: 1 1 220px; }
@media (max-width: 768px) {
  .page-h h1, .project h1 { overflow-wrap: break-word; word-break: normal; hyphens: auto; }
  .page-h .sub { font-size: 13px; }
}

/* ---------- Timeline: popisek pruhu se přilepí k viditelné hraně (nezajíždí pod sloupec s názvy) ---------- */
.tl-bar:not(.narrow) .bn { position: sticky; left: calc(var(--lw, 0px) + 8px); flex: 0 1 auto; max-width: 100%; }
.tl-bar:not(.narrow) .bav { margin-left: auto; }
.tl-bar.narrow .bn { transform: translateX(var(--sh, 0px)); }

/* ---------- Kanban: skeleton jako sloupce ---------- */
.sk-kanban { display: flex; gap: 14px; overflow: hidden; padding-bottom: 6px; }
.sk-kcol { flex: 0 0 300px; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--border); }
.sk-kcol .sk-line { margin: 0; }
.sk-kcard { height: 84px; border-radius: var(--r); }
@media (max-width: 768px) { .sk-kcol { flex-basis: 82vw; } }

/* ---------- Formulář uživatele: prostornější a širší ---------- */
.modal.dialog.wide { width: min(720px, calc(100vw - 32px)); }
.uform { display: flex; flex-direction: column; gap: 20px; }
.uform .form-grid { gap: 18px 20px; }
.uform .field { gap: 8px; }
.uform .hint { margin-top: 2px; line-height: 1.45; }
.uform .toggle-row { margin-top: 4px; }
@media (max-width: 640px) { .modal.dialog.wide { width: 100vw; height: 100%; max-height: none; border-radius: 0; } }

.pstat > small { font-size: 11px; line-height: 1.3; }

/* ---------- Tisk: čitelný černobílý výstup bez ovládacích prvků ---------- */
@media print {
  @page { margin: 14mm 12mm; }
  :root, :root[data-theme="dark"] { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #f3f3f3; --surface-3: #e8e8e8; --border: #999; --border-strong: #666; --text: #000; --text-2: #111; --muted: #333; --primary: #000; --shadow-sm: none; --shadow: none; --shadow-lg: none; }
  html, body { height: auto !important; background: #fff !important; color: #000 !important; font-size: 11pt; overflow: visible !important; }
  .sidebar, .topbar, .bottomnav, .skip-link, .toasts, .toast, #verxee-chyby, .ptabs, .tabs, .toolbar, .vtools, .page-h .acts, .qadd, .kadd-btn, .cc-add, .drag-handle, .t-more, .icon-btn, .btn, .chip-add, .banner .btn, [data-pmenu], [data-fav], .ph-members, .search-trigger, .filters, .fbar, .seg, #ptrunc, .progress, .skeleton, .sk { display: none !important; }
  body:has(.overlay) #app { display: none !important; }
  #app, .app, .main { display: block !important; width: auto !important; height: auto !important; overflow: visible !important; }
  .main, #page, .page { margin: 0 !important; padding: 0 !important; max-width: none !important; width: 100% !important; overflow: visible !important; }
  .page { padding: 0 !important; }
  body.no-scroll { overflow: visible !important; }
  /* otevřený detail úkolu / modál se vytiskne jako stránka */
  .overlay { position: static !important; background: none !important; padding: 0 !important; display: block !important; }
  .modal { position: static !important; width: auto !important; height: auto !important; max-height: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
  .modal-b { overflow: visible !important; }
  .modal-f, .modal-h .icon-btn { display: none !important; }
  * { box-shadow: none !important; text-shadow: none !important; animation: none !important; transition: none !important; }
  a, a:hover { color: #000 !important; text-decoration: none; }
  main a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #333; }
  h1 { font-size: 18pt; } h2 { font-size: 14pt; } h3 { font-size: 12pt; }
  h1, h2, h3, h4, .card-h { break-after: avoid; page-break-after: avoid; }
  .card, .pstat, .pt-card, .kcard, .note, .comment, section.card { border: 1px solid #777 !important; background: #fff !important; border-radius: 4px !important; break-inside: avoid; page-break-inside: avoid; }
  /* seznamy úkolů: řádek = jeden řádek s rámečkem, nerozlomit */
  .trow, .tgroup-h, .te-row, .cal-ev, .wiki-item, .notif, .sk-row { break-inside: avoid; page-break-inside: avoid; border-bottom: 1px solid #aaa !important; background: #fff !important; }
  .trow:hover, .tl-row:hover .tl-label { background: #fff !important; }
  .t-main { min-height: 0 !important; }
  .pill, .label, .tag, .chip:not(.on), .prio { border: 1px solid #555 !important; background: #fff !important; color: #000 !important; }
  .av { border: 1px solid #555 !important; background: #fff !important; color: #000 !important; }
  .danger-text, .ok-text, .warn-text { color: #000 !important; font-weight: 700; }
  /* tabulky (Tabulka, výkazy času, reporty, heatmapa, uživatelé) */
  table, .tbl, .ptable, .heat { width: 100% !important; border-collapse: collapse !important; font-size: 10pt; }
  th, td { border: 1px solid #777 !important; padding: 3px 5px !important; background: #fff !important; color: #000 !important; white-space: normal !important; }
  thead { display: table-header-group; } tfoot { display: table-footer-group; }
  tr { break-inside: avoid; page-break-inside: avoid; }
  .tbl-wrap, .heat-scroll, .ptable-wrap, .tbl-scroll { overflow: visible !important; }
  .heat-c { border: 1px solid #555 !important; background: #fff !important; color: #000 !important; }
  /* kanban: sloupce pod sebou */
  .kanban { display: block !important; overflow: visible !important; }
  .kcol { display: block !important; width: auto !important; min-width: 0 !important; margin: 0 0 10px !important; border: 1px solid #777 !important; background: #fff !important; break-inside: auto; }
  .kcol-b { overflow: visible !important; max-height: none !important; }
  /* wiki a popisy */
  .md, .wiki-body, .desc { color: #000 !important; }
  .md pre, .md code, code { background: #f1f1f1 !important; border: 1px solid #bbb; color: #000 !important; white-space: pre-wrap; }
  /* grafy v Reportech: segmenty dostanou pevný rámeček a čísla, ať jsou čitelné v odstínech šedi */
  .hb-seg { border: 1px solid #000; background: #bbb !important; }
  .ch-svg { max-height: none; } .ch-svg rect { stroke: #000; stroke-width: .6; } .ch-ax { fill: #000 !important; }
  .tl-bar { background: #ccc !important; color: #000 !important; border: 1px solid #000; }
  /* timeline a kalendář se nelámou doprostřed buňky */
  .tl-wrap, .tl-scroll, .pcal { overflow: visible !important; }
}
