/* ==========================================================================
   Doklady (views/doklady.js, docs/design-v2/Doklady.dc.html) — prefix .dk-
   Colours only through tokens: the Nova 2 look (v2.css) gives paper #F6F4EE, white cards with a hairline, green =
   income and the main action, brown = expenses, amber = a row without a document; the classic look and dark mode
   follow app.css. Phone first: one column, nothing wider than the phone, ≥ 44 px targets on touch, inputs 16 px
   (app.css), the sheets are bottom sheets on a phone (app.css .modal).
   ========================================================================== */

:root {
  --dk-miss-border: #f3ddb5;
  --dk-add-border: #b5af9f;
  --dk-thumb-bg: #efece4;
  --dk-pdf-text: #5b5852;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --dk-miss-border: #5a4520;
    --dk-add-border: #5d584e;
    --dk-thumb-bg: #2a2823;
    --dk-pdf-text: #c9c3b6;
  }
}
:root[data-theme="dark"] {
  --dk-miss-border: #5a4520;
  --dk-add-border: #5d584e;
  --dk-thumb-bg: #2a2823;
  --dk-pdf-text: #c9c3b6;
}

.dk { gap: 12px; }
.dk-ico { flex: none; }

/* A file input opened from a button: visually hidden, never display:none (Safari opens it from a click). */
.dk-file {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  opacity: 0;
  pointer-events: none;
}

/* ---- Head: title + the month pill ---- */
.dk-head .v2-head-row { align-items: center; }
.dk-monthnav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 36px;
  padding: 0 2px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
}
.dk-mlabel { min-width: 0; padding: 0 2px; white-space: nowrap; }
.dk-mbtn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.dk-mbtn:hover { background: var(--surface-2); }
.dk-mbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- „Odfotiť doklad“ · „Nahrať PDF“ ---- */
.dk-actions { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dk-actions[hidden] { display: none; }
.dk-snap, .dk-pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  height: 56px;
  padding: 0 10px;
  border-radius: 13px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.dk-snap { border: 0; background: var(--primary); color: #ffffff; } /* --primary keeps white text ≥ 4.5 : 1 in dark mode too */
.dk-snap:hover { background: var(--primary-hover); }
.dk-pdf { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.dk-pdf:hover { background: var(--surface-2); }
.dk-snap:focus-visible, .dk-pdf:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dk-snap span, .dk-pdf span { min-width: 0; overflow-wrap: anywhere; text-align: left; line-height: 1.2; }
.dk-ro { margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--grey-soft); color: var(--text-2); font-size: 13.5px; }
.dk-ro[hidden] { display: none; }
/* who else sees the documents / where the server keeps them (doc_list sharing, storageExposed) */
.dk-share-note { margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--grey-soft); color: var(--text-2); font-size: 13.5px; overflow-wrap: anywhere; }
.dk-share-note.is-warn { background: var(--critical-soft); color: var(--critical-text); }
.dk-share-note[hidden] { display: none; }

/* ---- Loading / error line ---- */
.dk-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-2); font-size: 13.5px; }
.dk-status[hidden] { display: none; }
.dk-status.is-error { padding: 10px 12px; border-radius: var(--radius); background: var(--warning-soft); color: var(--warning-text); }

/* ---- Cards ---- */
.dk-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.dk-month-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.dk-month-title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.35; }
.dk-badge {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning-text);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
}
.dk-badge.is-ok { background: var(--green-soft); color: var(--green-text); }
.dk-badge[hidden] { display: none; }
.dk-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dk-stat { display: flex; flex-direction: column; min-width: 0; }
.dk-stat-label, .dk-stat-sub { color: var(--text-2); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.dk-stat-value { font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dk-stat[data-key="expense"] .dk-stat-value { color: var(--brown-text); }
.dk-stat[data-key="income"] .dk-stat-value { color: var(--green-text); }
.dk-export {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 12px;
  border: 1px solid var(--green);
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green-text);
  font-size: 14.5px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.dk-export:hover { background: var(--green-tint); color: var(--green-text); text-decoration: none; }
.dk-export:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dk-export.is-disabled { border-color: var(--border-strong); background: var(--surface-2); color: var(--muted); cursor: default; }
.dk-note { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
.dk-note.is-warn { color: var(--warning-text); }
.dk-note[hidden] { display: none; }

/* ---- Položky mesiaca ---- */
.dk-items { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dk-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dk-list:empty { display: none; }
.dk-doc {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  scroll-margin-top: calc(var(--header-h, 56px) + 12px);
}
.dk-doc.is-target { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.dk-doc-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: -4px -6px;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dk-doc-main:hover { background: var(--surface-2); }
.dk-doc-main:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dk-doc-text { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.dk-doc-title { font-weight: 600; overflow-wrap: anywhere; }
.dk-doc-meta { color: var(--text-2); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.dk-doc-amount { flex: none; max-width: 40%; color: var(--brown-text); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dk-doc-amount.is-income { color: var(--green-text); }
.dk-doc-amount.is-missing { color: var(--warning-text); font-size: 13px; font-weight: 600; }
.dk-thumbrow { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.dk-thumbs { display: contents; }
.dk-thumb {
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--dk-thumb-bg);
  color: var(--dk-pdf-text);
  text-decoration: none;
}
.dk-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dk-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dk-thumb.is-small { width: 44px; height: 44px; }
.dk-thumb-pdf { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--dk-pdf-text); }
.dk-add {
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px dashed var(--dk-add-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--green-text);
  cursor: pointer;
}
.dk-add:hover { background: var(--green-tint); }
.dk-add:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dk-add[hidden] { display: none; }
.dk-files-count { margin-left: auto; color: var(--green-text); font-size: 12px; font-weight: 600; text-align: right; }

/* a row of the month without a document (amber) */
.dk-miss {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  background: var(--warning-soft);
  border: 1px solid var(--dk-miss-border);
  border-radius: 12px;
}
.dk-miss-text { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.dk-miss-title { font-weight: 600; overflow-wrap: anywhere; }
.dk-miss-line { color: var(--text-2); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.dk-miss-flag { color: var(--warning-text); }
.dk-miss-snap {
  flex: none;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.dk-miss-snap:hover { background: var(--primary-hover); }
.dk-miss-snap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dk-miss-snap[hidden] { display: none; }
.dk-more { align-self: flex-start; }
/* „Podľa plánu (bez záznamu) – 16 riadkov · zobraziť“ wraps on a narrow phone instead of running past the card */
.dk-more { max-width: 100%; height: auto; min-height: 36px; padding-top: 7px; padding-bottom: 7px; white-space: normal; line-height: 1.3; text-align: left; overflow-wrap: anywhere; }
.dk-empty { margin: 0; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: 12px; color: var(--text-2); font-size: 13.5px; }
.dk-empty[hidden], .dk-more[hidden] { display: none; }
/* „Podľa plánu (bez záznamu)“ – zbalené riadky plánu, nerátajú sa do „bez dokladu“ */
.dk-planned-list[hidden] { display: none; }
.dk-planned-list .dk-miss.is-planned, .dk-miss.is-planned { opacity: 0.85; }
.dk-planned-toggle { color: var(--text-2); }

/* ---- Upload progress (card, sheet) ---- */
.dk-progress { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dk-progress[hidden] { display: none; }
.dk-progress-bar { width: 100%; height: 6px; accent-color: var(--green); }
.dk-progress-text { color: var(--text-2); font-size: 12.5px; }
.dk-progress.is-error .dk-progress-bar { display: none; }
.dk-progress.is-error .dk-progress-text { color: var(--warning-text); }

/* ---- Sheets „Nový doklad“ / a document ---- */
.dk-sheet { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dk-sheet-lead { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.dk-sheet-lead:focus { outline: none; }
.dk-sheet-error { padding: 8px 10px; border-radius: var(--radius); background: var(--warning-soft); color: var(--warning-text); font-size: 13.5px; }
.dk-sheet-error[hidden] { display: none; }
.dk-pend-box { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dk-pend, .dk-efiles { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dk-pend-item, .dk-efile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 6px 6px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.dk-pend-img {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--dk-thumb-bg);
  object-fit: cover;
}
.dk-pend-text { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.dk-pend-name { font-size: 14px; overflow-wrap: anywhere; }
.dk-pend-size { color: var(--text-2); font-size: 12px; }
.dk-pend-remove {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.dk-pend-remove:hover { background: var(--surface-2); color: var(--critical-text, var(--text)); }
.dk-pend-add { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.dk-pend-btn { display: inline-flex; align-items: center; gap: 6px; }
.dk-pend-btn[hidden] { display: none; }

.dk-form { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dk-form .field { min-width: 0; margin: 0; }
.dk-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dk-form-grid .dk-f-supplier, .dk-form-grid .dk-f-vat { grid-column: 1 / -1; }
.dk-dir.segmented { display: flex; width: 100%; }
.dk-dir .segmented-item { flex: 1 1 0; justify-content: center; min-width: 0; }

/* „Patrí k“: the chosen row + the search list */
.dk-link { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dk-link-chosen {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
}
.dk-link-text { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.dk-link-title { font-weight: 600; overflow-wrap: anywhere; }
.dk-link-sub { color: var(--text-2); font-size: 12.5px; overflow-wrap: anywhere; }
.dk-link-change { flex: none; }
.dk-link-panel { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dk-link-panel[hidden] { display: none; }
.dk-opts { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.dk-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dk-opt:hover { background: var(--surface-2); }
.dk-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dk-opt.is-selected { border-color: var(--green); background: var(--green-tint); }
.dk-opt-text { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.dk-opt-title { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.dk-opt-sub { color: var(--text-2); font-size: 12.5px; overflow-wrap: anywhere; }
.dk-opt-badge { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--warning-soft); color: var(--warning-text); font-size: 11.5px; font-weight: 600; }
.dk-opts-more { margin: 0; color: var(--text-2); font-size: 12.5px; }
.dk-opts-more[hidden] { display: none; }

/* ---- mountDocChips: the documents of one row (Náklady / Príjmy / Nákup details, Prevádzka) ---- */
.dk-chips { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dk-chips-label { color: var(--text-2); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.dk-chips-row { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.dk-chip-list { display: contents; }
.dk-chip-list > li { display: contents; }
.dk-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}
.dk-chip:hover { background: var(--surface-2); text-decoration: none; }
.dk-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dk-chip .v2-icon { flex: none; color: var(--green-text); }
.dk-chip-text { min-width: 0; overflow-wrap: anywhere; }
.dk-chip-count { flex: none; padding: 0 6px; border-radius: 999px; background: var(--green-soft); color: var(--green-text); font-size: 11.5px; font-weight: 700; }
.dk-chips-empty { color: var(--text-2); font-size: 13px; }
.dk-chips-empty[hidden] { display: none; }
.dk-chip-add { display: inline-flex; align-items: center; gap: 6px; }
.dk-chip-add[hidden] { display: none; }
/* „Iný doklad“ – nový doklad k tomu istému riadku (ďalšia fotka ide k prvému dokladu) */
.dk-chip-other {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 6px; border: 0; background: none; color: var(--accent-text, var(--green-text));
  font: inherit; font-size: 13.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.dk-chip-other:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.dk-chip-other[hidden] { display: none; }
.dk-chips-status { color: var(--text-2); font-size: 12.5px; overflow-wrap: anywhere; }
.dk-chips-status[data-tone="error"], .dk-chips-status[data-tone="error-load"] { color: var(--warning-text); }
.dk-chips-status[data-tone="ok"] { color: var(--green-text); }
.dk-chips-status[hidden] { display: none; }

/* a file picked before the row exists (a new animal event, R14): waits in the chips until „Uložiť“ */
.dk-chip-pend { border-style: dashed; background: var(--surface-2); }
.dk-chip-x {
  display: grid; place-items: center; flex: none; width: 28px; height: 28px; margin: -2px -6px -2px 0; padding: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--text-2); cursor: pointer;
}
.dk-chip-x:hover { background: var(--surface-2); color: var(--text); }
.dk-chip-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dk-chips-status[data-tone="pending"] { color: var(--text-2); font-style: italic; }
/* a failed upload keeps its files: „Skúsiť znova“ · „Zahodiť súbory“ */
.dk-chips-retry { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dk-chips-retry[hidden] { display: none; }
.dk-chip-retry[hidden], .dk-chip-drop[hidden] { display: none; }
.dk-chip-drop, .dk-hint-no {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 32px; padding: 0 8px; border: 0;
  background: none; color: var(--text-2);
  font: inherit; font-size: 13.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.dk-chip-drop:focus-visible, .dk-hint-no:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---- mountPhotoStrip: the photos of an animal / event (R15) – not accounting documents ---- */
.dk-photos { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dk-photos-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; min-width: 0; }
.dk-photos-count { color: var(--text-2); font-size: 12.5px; }
.dk-photos-row { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.dk-photo-strip { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.dk-photo-strip[hidden] { display: none; }
.dk-photo-thumb {
  position: relative; display: grid; place-items: center; flex: none; width: 54px; height: 54px; padding: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 8px; background: var(--dk-thumb-bg); color: var(--text); font: inherit;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.dk-photo-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dk-photo-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dk-photo-pend { border-style: dashed; }
.dk-photo-x {
  position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 999px;
  background: var(--surface); color: var(--text); pointer-events: none;
}
.dk-photo-add { display: inline-flex; align-items: center; gap: 6px; }
.dk-photo-add[hidden] { display: none; }
.dk-photos-hint { margin: 0; color: var(--text-2); font-size: 12.5px; overflow-wrap: anywhere; }
.dk-photos-hint[hidden] { display: none; }

/* the photo viewer sheet */
.dk-viewer { display: flex; flex-direction: column; gap: 8px; min-width: 0; outline: none; }
.dk-viewer-fig { display: grid; place-items: center; margin: 0; min-width: 0; border-radius: 10px; background: var(--dk-thumb-bg); overflow: hidden; }
.dk-viewer-img { display: block; max-width: 100%; max-height: 60vh; object-fit: contain; }
.dk-viewer-bar { display: flex; align-items: center; justify-content: center; gap: 12px; }
.dk-viewer-nav {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border-strong);
  border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer;
}
.dk-viewer-nav[hidden] { visibility: hidden; display: inline-grid; }
.dk-viewer-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dk-viewer-pos { min-width: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.dk-viewer-caption { margin: 0; overflow-wrap: anywhere; }
.dk-viewer-caption[hidden] { display: none; }
.dk-viewer-open { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-text, var(--green-text)); font-weight: 600; }

/* ---- hints of the animals' documents (R14 amount from the event, R15 move to photos) ---- */
.dk-hints { gap: 8px; border-color: var(--dk-miss-border); }
.dk-hints[hidden] { display: none; }
.dk-hint-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.dk-hint { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dk-hint + .dk-hint { padding-top: 10px; border-top: 1px solid var(--border); }
.dk-hint-title { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.dk-hint-text { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.dk-hint-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---- Touch: ≥ 44 px targets ---- */
@media (pointer: coarse) {
  .dk-monthnav { height: 44px; }
  .dk-mbtn { width: 44px; height: 44px; }
  .dk-miss-snap { height: 44px; }
  .dk-link-change { min-height: 44px; }
  .dk-pend-remove { width: 44px; height: 44px; }
  .dk-pend-btn, .dk-more { min-height: 44px; }
  .dk-chip { min-height: 44px; }
  .dk-chip-other { min-height: 44px; padding: 0 10px; }
  .dk-chip-add { min-height: 44px; }
  .dk-dir .segmented-item { min-height: 44px; }
  .dk-chip-x { width: 44px; height: 44px; margin: -8px -10px -8px 0; }
  .dk-chip-retry, .dk-chip-drop, .dk-photo-add, .dk-hint-no { min-height: 44px; }
  .dk-hint-yes { min-height: 44px; }
}

/* ---- Narrow phones ---- */
@media (max-width: 420px) {
  .dk-head .v2-head-row { flex-wrap: wrap; }
  .dk-snap, .dk-pdf { font-size: 14.5px; }
  .dk-stats { gap: 6px; }
}
@media (max-width: 360px) {
  .dk-form-grid { grid-template-columns: minmax(0, 1fr); }
  .dk-actions { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .dk-actions, .dk-add, .dk-miss-snap, .dk-monthnav .dk-mbtn, .dk-export { display: none !important; }
}

/* ---- R10 folds (docs/SPEC_V4.md §3 R10, round 9 QA): the hints, the month card and the items fold in place (ui.js
   collapsible through views/screen-folds.js); the chevron stays left of the month's title, the summary takes its own line ---- */
.dk-month-head[data-fold-head] { justify-content: flex-start; align-items: flex-start; row-gap: 0; }
.dk-month-head[data-fold-head] > .fold-toggle { margin: -10px -6px -10px -12px; }
/* the month's name never breaks („September 2026“): on a 320 px phone the badge takes the next line instead */
.dk-month-head[data-fold-head] > .dk-month-title { flex: 1 1 auto; white-space: nowrap; }
.dk-month-head[data-fold-head] > .fold-summary { flex-basis: 100%; order: 5; padding-left: 32px; }
.dk-card.is-folded { gap: 0; }
.dk-items.is-folded { gap: 0; }

/* v5 R24 (round 14): a member's upload – the chip „od člena Jana“ on the card, the filter „Od členov (n)“, the line in the sheet */
.dk-doc-by {
  align-self: flex-start;
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--brown-soft, var(--surface-2));
  color: var(--brown-text, var(--text-2));
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.dk-doc-by[hidden] { display: none; }
.dk-filter {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 36px;
  margin: 0 0 8px;
  padding: 4px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.dk-filter[hidden] { display: none; }
.dk-filter.is-on { border-color: var(--primary); background: var(--green-soft, var(--surface-2)); color: var(--green-text, var(--text)); }
.dk-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dk-by-note { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
@media (pointer: coarse) {
  .dk-filter { min-height: 44px; }
}
