/* Protokol 3.1 — komponenty. Hodnoty len cez tokeny z tokens.css. Iba systémové písma. */

*, *::before, *::after { box-sizing: border-box; }
html, body { background: var(--canvas); color: var(--ink); }
body { margin: 0; font-family: var(--font-sans); font-size: 14px; line-height: 20px; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; }
code, pre, .code { font-family: var(--font-code); }
::selection { background: var(--signal-wash); color: var(--ink); }
:focus-visible { outline: var(--stroke-focus) solid var(--signal-fill); outline-offset: 2px; }
.pk-data { letter-spacing: 0; font-variant-numeric: tabular-nums; }
.pk-muted { color: var(--ink-muted); }
.pk-kbd { display: inline-block; min-width: 18px; padding: 0 4px; border: 1px solid var(--rule); border-radius: 4px; font-size: 11px; line-height: 16px; letter-spacing: 0; text-align: center; color: var(--ink-muted); }
.pk-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pk-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: var(--stroke-icon); stroke-linecap: round; stroke-linejoin: round; }
.pk-stack { display: grid; gap: var(--space-3); }
.pk-stack:empty { display: none; }

/* ---------- Kostra ---------- */
.pk-app { display: grid; grid-template-columns: var(--index-width) minmax(0, 1fr); gap: var(--space-5); align-items: start; padding-right: max(var(--space-5), env(safe-area-inset-right, 0px)); transition: padding-right var(--motion-panel) ease-out; }
.pk-main { min-width: 0; width: 100%; max-width: var(--content-max); justify-self: center; padding-block: var(--space-4) var(--space-7); }
.pk-main:focus { outline: none; }
.pk-content { container: pk-content / inline-size; }
.pk-topbar, .pk-scrim { display: none; }
@media (min-width: 1220px) {
  body:has(.pk-panel:not([hidden])) .pk-app { padding-right: calc(var(--panel-width) + var(--space-5)); }
}

/* ---------- Blok: obsah na podklade, oddelený linkou hore a dole ---------- */
.pk-block { min-width: 0; border-block: 1px solid var(--rule); }
.pk-block--pad { padding-block: var(--space-5); }
.pk-block + .pk-block, .pk-figures + .pk-block, .pk-block + .pk-figures { margin-top: var(--space-5); }
.pk-block__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-2) var(--space-4); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--rule); }
.pk-block__head h2 { margin: 0; }
.pk-scroll { overflow-x: auto; container-type: inline-size; }

/* ---------- Masthead ---------- */
.pk-masthead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-6); margin-bottom: var(--space-3); padding-block: var(--space-4); }
.pk-masthead__title { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.02em; }
.pk-masthead__count { margin-left: var(--space-2); font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.pk-masthead__meta { font-size: 13px; color: var(--ink-muted); }
.pk-masthead__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }

/* ---------- Index: bočný panel na celú výšku, od obsahu ho delí zvislá linka ---------- */
.pk-index { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; width: var(--index-width); overflow-y: auto; padding: var(--space-5) var(--space-3) var(--space-4) max(var(--space-3), env(safe-area-inset-left, 0px)); background: var(--surface); border-right: 1px solid var(--rule); }
.pk-index__brand { padding: 0 var(--space-2); font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; }
.pk-index__env { display: inline-block; margin: var(--space-1) 0 0 var(--space-2); padding: 1px 8px; border-radius: 6px; background: var(--signal); color: var(--on-signal); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0; }
.pk-index__env--quiet { background: transparent; color: var(--ink-muted); box-shadow: inset 0 0 0 1px var(--rule); font-weight: 400; }
.pk-index__group { margin-top: var(--space-5); }
.pk-index__label { padding: 0 var(--space-2); font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-muted); }
.pk-index__list { display: grid; gap: 2px; list-style: none; margin: var(--space-2) 0 0; padding: 0; }
.pk-index__item { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); padding: 7px var(--space-2); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; transition: background var(--motion-fast); }
.pk-index__item:hover { background: var(--surface-sunken); }
.pk-index__item[aria-current="page"] { background: var(--surface-selected); color: var(--ink); font-weight: 500; }
.pk-index__count { font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.pk-index__count--attn { color: var(--ink); font-weight: 600; }
.pk-index__item[aria-current="page"] .pk-index__count { color: var(--ink); }
.pk-index__foot { display: grid; gap: var(--space-2); margin-top: auto; padding: var(--space-5) var(--space-2) 0; }
.pk-index__foot p { margin: 0; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.pk-index__foot .pk-segment { display: flex; }
.pk-index__foot .pk-segment__btn { flex: 1; padding: 0 var(--space-1); }

/* ---------- Button a akcie ---------- */
.pk-btn { display: inline-flex; align-items: center; gap: var(--space-2); height: var(--control-height); padding: 0 14px; border: 0; border-radius: var(--radius-md); background: var(--inverse); color: var(--on-inverse); font-family: var(--font-sans); font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: -0.01em; cursor: pointer; white-space: nowrap; text-decoration: none; transition: opacity var(--motion-fast), background var(--motion-fast); }
.pk-btn:hover { opacity: 0.85; }
.pk-btn--secondary { border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 500; }
.pk-btn--secondary:hover { opacity: 1; background: var(--surface-sunken); }
.pk-btn--small { height: var(--control-height-small); padding: 0 10px; font-size: 13px; }
.pk-btn[disabled] { background: var(--surface-sunken); color: var(--ink-faint); cursor: not-allowed; opacity: 1; }
.pk-link { display: inline-block; padding: 2px 0; border: 0; background: none; font: inherit; letter-spacing: inherit; color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--rule-control); cursor: pointer; white-space: nowrap; }
.pk-link:hover { color: var(--signal); text-decoration-color: currentColor; }
.pk-link--danger { color: var(--status-error); }
.pk-link--danger:hover { color: var(--status-error); }
.pk-link--muted { color: var(--ink-muted); }
.pk-link[disabled] { color: var(--ink-faint); text-decoration: none; cursor: not-allowed; }
.pk-action { padding: var(--space-1) 2px; border: 0; background: none; font-family: inherit; font-size: 13px; line-height: 18px; letter-spacing: inherit; color: var(--ink-muted); text-decoration: none; cursor: pointer; white-space: nowrap; transition: color var(--motion-fast); }
.pk-action:hover { color: var(--ink); }
.pk-action--view:hover { color: var(--signal); }
.pk-action--danger:hover { color: var(--status-error); }

/* ---------- Segment ---------- */
.pk-segment { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; }
.pk-segment__btn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; padding: 0 10px; border: 0; background: transparent; font-family: inherit; font-size: 13px; letter-spacing: inherit; color: var(--ink-muted); cursor: pointer; transition: background var(--motion-fast), color var(--motion-fast); }
.pk-segment__btn:not(:last-child) { border-right: 1px solid var(--rule); }
.pk-segment__btn:hover { color: var(--ink); }
.pk-segment__btn[aria-pressed="true"] { background: var(--surface-sunken); color: var(--ink); }
.pk-segment__btn:focus-visible { outline-offset: -2px; }

/* ---------- Tag ---------- */
.pk-tag { display: inline-block; padding: 2px var(--space-2); border-radius: 6px; background: var(--surface-sunken); font-size: 11px; line-height: 14px; letter-spacing: 0; color: var(--ink-muted); }
.pk-tag--mine { background: var(--signal-wash); color: var(--signal); }

/* ---------- Field ---------- */
.pk-field { display: grid; gap: 6px; max-width: 360px; }
.pk-field__label { display: flex; justify-content: space-between; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.pk-field__input { height: var(--control-height); padding: 0 var(--space-3); border: 1px solid var(--rule-control); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--ink); font-family: var(--font-sans); font-size: 14px; letter-spacing: -0.01em; }
.pk-field__input--data { letter-spacing: 0; font-variant-numeric: tabular-nums; }
.pk-field__input:focus { outline: var(--stroke-focus) solid var(--signal-fill); outline-offset: 2px; }
.pk-field__help { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.pk-field--error .pk-field__input { border-color: var(--status-error); box-shadow: inset 0 0 0 1px var(--status-error); }
.pk-field--error .pk-field__help { color: var(--status-error); }

/* ---------- Status ---------- */
.pk-status { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; line-height: 18px; color: var(--ink-muted); white-space: nowrap; }
.pk-status::before { content: "○"; font-size: 10px; }
.pk-status--ok { color: var(--ink); }
.pk-status--ok::before { content: "●"; }
.pk-status--warn { color: var(--status-warn); }
.pk-status--warn::before { content: "▲"; }
.pk-status--error { color: var(--status-error); }
.pk-status--error::before { content: "✕"; }
.pk-status--live { color: var(--signal); }
.pk-status--live::before { content: "◆"; }

/* ---------- Riadok s filtrami a hľadaním ---------- */
.pk-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3) var(--space-5); margin-bottom: var(--space-3); }
.pk-toolbar .pk-tabs { flex: 1 1 320px; min-width: 0; }
.pk-search { flex: 0 1 280px; width: 280px; max-width: 280px; }
.pk-search__box { position: relative; display: grid; }
.pk-search__box .pk-field__input { width: 100%; padding-right: var(--space-6); }
.pk-search__box .pk-kbd { position: absolute; top: var(--space-2); right: var(--space-2); pointer-events: none; }
.pk-search__box .pk-field__input:not(:placeholder-shown) + .pk-kbd { display: none; }

/* ---------- Tabs (filtre) ---------- */
.pk-tabs { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.pk-tab { padding: 6px var(--space-3); border: 1px solid transparent; border-radius: var(--radius-md); background: none; font: inherit; font-size: 14px; letter-spacing: inherit; color: var(--ink-muted); cursor: pointer; white-space: nowrap; transition: color var(--motion-fast); }
.pk-tab:hover { color: var(--ink); }
.pk-tab[aria-pressed="true"] { background: var(--surface-selected); color: var(--ink); font-weight: 600; }
.pk-tab__n { margin-left: 6px; font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.pk-tab[aria-pressed="true"] .pk-tab__n { color: var(--ink); }
.pk-tabs--compact { display: none; }
.pk-tab-select { field-sizing: content; max-width: 100%; padding: 6px var(--space-2) 6px var(--space-3); border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; font: inherit; font-size: 14px; letter-spacing: inherit; color: var(--ink-muted); cursor: pointer; }
.pk-tab-select:hover { color: var(--ink); }
.pk-tab-select.is-active { background: var(--surface-selected); color: var(--ink); font-weight: 600; }
@container pk-content (max-width: 1110px) {
  .pk-toolbar .pk-tabs--full { display: none; }
  .pk-toolbar .pk-tabs--compact { display: flex; flex: 0 1 auto; }
  .pk-toolbar .pk-search { flex: 1 1 180px; width: auto; }
}

/* ---------- DataTable ---------- */
.pk-table { width: 100%; border-collapse: collapse; }
.pk-table th { padding: var(--space-3); text-align: left; vertical-align: bottom; font-size: 13px; line-height: 18px; font-weight: 500; letter-spacing: 0; color: var(--ink-muted); background: var(--surface-sunken); border-bottom: 1px solid var(--rule); white-space: nowrap; }
.pk-table th:first-child, .pk-table td:first-child { padding-left: var(--space-5); }
.pk-table th:last-child, .pk-table td:last-child { padding-right: var(--space-5); }
.pk-table th[aria-sort] { color: var(--ink); }
.pk-table td { height: var(--row-height); padding: 0 var(--space-3); border-bottom: 1px solid var(--rule); white-space: nowrap; }
.pk-table tbody tr:last-child td { border-bottom: 0; }
.pk-table tbody tr { transition: background var(--motion-fast); }
.pk-table tbody tr[data-id] { cursor: pointer; }
.pk-table tbody tr:hover { background: var(--surface-sunken); }
.pk-table tr.is-selected, .pk-table tr[aria-current="true"], .pk-table tr.is-new { background: var(--signal-wash); }
.pk-table td a { display: inline-block; padding-block: 4px; color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: transparent; }
.pk-table td a:hover, .pk-table td a:focus-visible { color: var(--signal); text-decoration-color: currentColor; }
.pk-table .pk-num { text-align: right; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.pk-table .pk-id { letter-spacing: 0; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.pk-table .pk-primary { font-weight: 600; }
.pk-table .pk-check { width: 1%; }
.pk-check__box { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; cursor: pointer; }
.pk-check__box input { width: 16px; height: 16px; margin: 0; accent-color: var(--signal-fill); cursor: pointer; }
.pk-sort { min-height: 24px; padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.pk-sort:hover { color: var(--ink); }
.pk-table__act { text-align: right; }
.pk-table__sub { display: none; }
@container (max-width: 1060px) {
  .pk-table .pk-col-wide { display: none; }
}
@container (max-width: 920px) {
  .pk-table .pk-col-opt { display: none; }
}
@container (max-width: 680px) {
  .pk-table .pk-col-sub { display: none; }
  .pk-table td { padding-block: var(--space-2); white-space: normal; }
  .pk-table th:first-child, .pk-table td:first-child { padding-left: var(--space-4); }
  .pk-table th:last-child, .pk-table td:last-child { padding-right: var(--space-4); }
  .pk-table__act .pk-link { white-space: nowrap; }
  .pk-table__sub { display: grid; gap: 2px; justify-items: start; margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
}
.pk-table--compact td { height: var(--row-height-compact); }
.pk-table--bare th { padding-top: 0; background: transparent; }
.pk-table--bare th:first-child, .pk-table--bare td:first-child { padding-left: 0; }
.pk-table--bare th:last-child, .pk-table--bare td:last-child { padding-right: 0; }
.pk-table__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-5); border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-muted); }
.pk-pager { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }

/* ---------- Prázdne stavy a načítavanie ---------- */
.pk-empty { display: grid; gap: var(--space-2); justify-items: start; padding: var(--space-7) var(--space-5); }
.pk-empty p { margin: 0; max-width: var(--measure); }
.pk-loading { padding: var(--space-7) var(--space-5); color: var(--ink-muted); }

/* ---------- RowList (kapitola Súbory a médiá, v 3.1 nerevidovaná) ---------- */
.pk-rows { display: grid; gap: var(--space-3); }
.pk-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-5); align-items: center; padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); transition: transform var(--motion-fast), border-color var(--motion-fast); }
.pk-row:hover { transform: translateY(-2px); border-color: var(--rule-strong); }
.pk-row__main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pk-row__icon { display: flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-sunken); color: var(--ink-muted); }
.pk-row__icon img, .pk-row__icon svg.pk-thumb { width: 100%; height: 100%; object-fit: cover; }
.pk-row__icon .pk-icon { width: 18px; height: 18px; }
.pk-row__info { min-width: 0; }
.pk-row__name { display: block; font-size: 15px; line-height: 22px; font-weight: 600; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.pk-row__meta { margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.pk-row__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-1) 14px; }
.pk-row--collection { border-left: 3px solid var(--signal-fill); background: linear-gradient(90deg, var(--signal-wash), var(--surface) 45%); }
.pk-row--collection .pk-row__icon { width: 44px; height: 44px; background: var(--signal-wash); color: var(--signal-fill); }
.pk-row--collection .pk-row__icon svg { width: 30px; height: 30px; }
.pk-row--collection .pk-row__name { font-weight: 700; }

/* ---------- Grid (kapitola Súbory a médiá, v 3.1 nerevidovaná) ---------- */
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: var(--space-4); }
.pk-tile { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); transition: transform var(--motion-fast), border-color var(--motion-fast); }
.pk-tile:hover { transform: translateY(-2px); border-color: var(--rule-strong); }
.pk-tile__thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; max-width: 100%; overflow: hidden; background: var(--surface-sunken); color: var(--ink-muted); }
.pk-tile__thumb img, .pk-tile__thumb svg.pk-thumb { width: 100%; height: 100%; object-fit: cover; }
.pk-tile__thumb .pk-icon { width: 38%; height: 38%; }
.pk-tile__info { padding: 10px var(--space-3) 6px; }
.pk-tile__name { font-size: 13px; line-height: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-tile__meta { margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-tile__actions { display: flex; flex-wrap: wrap; gap: 0 10px; margin-top: auto; padding: 6px var(--space-3); border-top: 1px solid var(--rule); }
.pk-tile__actions .pk-action { font-size: 12px; }
.pk-tile--collection { border-color: var(--signal-edge); background: linear-gradient(180deg, var(--signal-wash), var(--surface) 70%); }
.pk-tile--collection .pk-tile__thumb { background: transparent; color: var(--signal-fill); }
.pk-tile--collection .pk-tile__thumb svg { width: 52%; height: 52%; }

/* ---------- Dropzone a Progress (kapitola Súbory a médiá, v 3.1 nerevidované) ---------- */
.pk-dropzone { display: block; padding: var(--space-8) var(--space-5); border: 2px dashed var(--rule); border-radius: var(--radius-xl); background: var(--surface); text-align: center; cursor: pointer; transition: transform var(--motion-fast), border-color var(--motion-fast), background var(--motion-fast); }
.pk-dropzone:hover { transform: translateY(-2px); border-color: var(--signal-fill); }
.pk-dropzone:focus-within { outline: var(--stroke-focus) solid var(--signal-fill); outline-offset: 2px; }
.pk-dropzone.is-drag { border-color: var(--signal-fill); background: var(--signal-wash); }
.pk-dropzone__label { font-size: 22px; line-height: 30px; font-weight: 600; letter-spacing: -0.01em; }
.pk-dropzone__label u { text-underline-offset: 4px; text-decoration-thickness: 1px; }
.pk-dropzone__hint { margin-top: var(--space-2); color: var(--ink-muted); }
.pk-progress__head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.pk-progress__name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-progress__bar { height: 10px; overflow: hidden; border-radius: var(--radius-round); background: var(--rule); }
.pk-progress__fill { height: 100%; width: 0; background: var(--progress-fill); transition: width var(--motion-panel) ease; }
.pk-progress__meta { display: flex; justify-content: space-between; margin-top: var(--space-2); font-size: 12px; line-height: 16px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* ---------- Bulk bar ---------- */
.pk-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); padding: var(--space-2) var(--space-4); border-radius: var(--radius-md); background: var(--inverse); color: var(--on-inverse); }
.pk-bulk .pk-link, .pk-bulk .pk-link:hover { color: var(--on-inverse); text-decoration-color: currentColor; }
.pk-bulk .pk-link:hover { text-decoration-thickness: 2px; }
.pk-bulk :focus-visible { outline-color: var(--on-inverse); }
.pk-bulk__n { margin-right: auto; font-weight: 600; }
.pk-bulk__inline { display: contents; }
.pk-bulk__toggle, .pk-bulk__menu { display: none; }

/* ---------- Figure: kľúčové čísla v jednom pruhu ---------- */
.pk-figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--rule); border-block: 1px solid var(--rule); }
.pk-figure { min-width: 0; padding: var(--space-3) var(--space-4); background: var(--canvas); }
.pk-figure__label { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.pk-figure__value { margin-top: var(--space-1); font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pk-figure__unit { margin-left: var(--space-1); font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--ink-muted); }
.pk-figure__delta { margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.pk-figure__delta--bad { color: var(--status-error); }
@container pk-content (max-width: 560px) {
  .pk-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Graf ---------- */
.pk-chart { display: block; width: 100%; height: 180px; }
.pk-chart text { font-size: 10px; letter-spacing: 0; fill: var(--ink-muted); }
.pk-chart__line { stroke: var(--rule); stroke-width: var(--stroke-hairline); }
.pk-chart__bar { fill: var(--ink); }
.pk-chart__bar--now { fill: var(--signal-fill); }
.pk-chart__note { margin: var(--space-3) 0 0; max-width: var(--measure); font-size: 13px; line-height: 18px; color: var(--ink-muted); }

/* ---------- Log ---------- */
.pk-log { margin: 0; padding: 0; list-style: none; }
.pk-log__row { display: grid; grid-template-columns: 170px 96px minmax(0, 1fr); gap: var(--space-4); padding: 11px var(--space-5); border-bottom: 1px solid var(--rule); align-items: baseline; }
.pk-log__row:last-child { border-bottom: 0; }
.pk-log__time, .pk-log__actor { font-size: 13px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.pk-log__time { color: var(--ink-muted); }
.pk-log__actor { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-log__msg code { font-size: 12px; letter-spacing: 0; }
.pk-log__msg .pk-status { margin-right: var(--space-2); }
.pk-log--compact .pk-log__row { grid-template-columns: 112px minmax(0, 1fr); gap: var(--space-3); padding-inline: 0; }
.pk-log__by { font-size: 12px; letter-spacing: 0; color: var(--ink-muted); }
.pk-log__undone { color: var(--ink-muted); text-decoration: line-through; }
.pk-log__undone .pk-link { color: inherit; text-decoration: inherit; }

/* ---------- Notice ---------- */
.pk-notice { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.pk-notice__text { flex: 1 1 320px; min-width: 0; }
.pk-notice__acts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.pk-notices { position: sticky; top: var(--space-3); z-index: 10; margin-bottom: var(--space-3); }

/* ---------- Dok: dočasné hlásenia a hromadné akcie pri spodku okna ---------- */
.pk-dock { position: sticky; bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); z-index: 10; display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.pk-dock > :empty { display: none; }
.pk-dock .pk-notice, .pk-dock .pk-bulk { box-shadow: var(--shadow-overlay); }

/* ---------- Panel ---------- */
.pk-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(var(--panel-width), 100vw); overflow-y: auto; overscroll-behavior: contain; padding-right: env(safe-area-inset-right, 0px); background: var(--surface-raised); border-left: 1px solid var(--rule); box-shadow: var(--shadow-overlay); animation: pk-panel-in var(--motion-panel) ease-out; }
.pk-panel:focus { outline: none; }
@keyframes pk-panel-in { from { transform: translateX(16px); opacity: 0.5; } to { transform: none; opacity: 1; } }
@media (min-width: 1220px) {
  .pk-panel { box-shadow: none; }
}
.pk-panel__head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); background: var(--surface-raised); border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--ink-muted); }
.pk-panel__nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.pk-panel__body { display: grid; gap: var(--space-6); padding: var(--space-5) var(--space-5) var(--space-7); }
.pk-panel__lead { display: grid; gap: var(--space-2); justify-items: start; }
.pk-panel__lead p { margin: 0; max-width: var(--measure); color: var(--ink-muted); }
.pk-panel__acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin-top: var(--space-3); }
.pk-panel__sections { display: grid; gap: var(--space-6); }
.pk-panel__title { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.02em; }
.pk-panel__title:focus { outline: none; }
.pk-section__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin: 0 0 var(--space-2); }
.pk-section__title { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }
.pk-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px var(--space-5); margin: 0; }
.pk-facts dt { color: var(--ink-muted); }
.pk-facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Pätička so skratkami ---------- */
.pk-keys { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-5); font-size: 12px; line-height: 16px; color: var(--ink-muted); }

/* ---------- Úzke obrazovky ---------- */
@media (max-width: 960px) {
  .pk-app { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); padding-left: max(var(--space-4), env(safe-area-inset-left, 0px)); padding-right: max(var(--space-4), env(safe-area-inset-right, 0px)); }
  .pk-main { padding-top: var(--space-2); }
  .pk-notices { top: calc(var(--space-7) + var(--space-3) + env(safe-area-inset-top, 0px)); }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 25; background: var(--canvas); }
  .pk-topbar { position: sticky; top: calc(var(--space-2) + env(safe-area-inset-top, 0px)); z-index: 20; display: flex; align-items: center; gap: var(--space-3); margin: var(--space-2) max(var(--space-4), env(safe-area-inset-right, 0px)) 0 max(var(--space-4), env(safe-area-inset-left, 0px)); padding: var(--space-2) var(--space-4); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
  .pk-topbar__brand { margin-right: auto; font-size: 16px; line-height: 24px; font-weight: 600; }
  .pk-topbar .pk-index__env { margin: 0; }
  .pk-index { position: fixed; top: 0; bottom: 0; left: 0; z-index: 45; width: min(260px, 84vw); height: auto; padding-top: calc(var(--space-5) + env(safe-area-inset-top, 0px)); padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px)); transform: translateX(-102%); visibility: hidden; transition: transform var(--motion-panel) ease-out, visibility 0s linear var(--motion-panel); }
  .drawer-open .pk-index { transform: none; visibility: visible; box-shadow: var(--shadow-overlay); transition: transform var(--motion-panel) ease-out; }
  .drawer-open .pk-scrim { display: block; position: fixed; inset: 0; z-index: 42; background: var(--scrim); }
}
@media (max-width: 640px) {
  .pk-masthead { padding-block: var(--space-3); }
  .pk-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .pk-row__actions { justify-content: flex-start; }
  .pk-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .pk-dropzone { padding: var(--space-7) var(--space-4); }
  .pk-dropzone__label { font-size: 18px; line-height: 26px; }
  .pk-log__row { grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--space-3); padding-inline: var(--space-4); }
  .pk-log__msg { grid-column: 1 / -1; }
  .pk-log--compact .pk-log__row { grid-template-columns: minmax(0, 1fr); padding-inline: 0; }
  .pk-panel { width: 100vw; border: 0; }
  .pk-panel__head { flex-wrap: wrap; gap: var(--space-1) var(--space-3); padding-top: calc(var(--space-3) + env(safe-area-inset-top, 0px)); }
  .pk-panel__head > :first-child { white-space: nowrap; }
  .pk-panel__head, .pk-panel__body { padding-left: max(var(--space-4), env(safe-area-inset-left, 0px)); padding-right: max(var(--space-4), env(safe-area-inset-right, 0px)); }
  .pk-bulk__inline { display: none; }
  .pk-bulk__toggle { display: inline-block; }
  .pk-bulk__menu:not([hidden]) { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); flex-basis: 100%; order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; }
  .pk-row:hover, .pk-tile:hover, .pk-dropzone:hover { transform: none; }
}
