/* Aktualizováno: 25. 11. 2026 */
:root {
  --bg: #f6f7f7; --fg: #1b1f1f; --muted: #5d6666; --card: #ffffff; --line: #d9dede;
  --primary: #0f5c5c; --primary-fg: #ffffff; --warn-bg: #fff4d6; --warn-fg: #6b4e00;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121515; --fg: #e8eded; --muted: #9aa5a5; --card: #1c2121; --line: #2e3636;
    --primary: #3aa6a6; --primary-fg: #071414; --warn-bg: #3a3014; --warn-fg: #ffe08a; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* CH-002: atribut hidden nesmí přebít žádné display pravidlo */
html, body { margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.bar { display: flex; align-items: baseline; gap: 12px; padding: 12px 16px; background: var(--primary); color: var(--primary-fg); }
.bar h1 { margin: 0; font-size: 20px; }
.bar .muted { color: inherit; opacity: .8; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
main { max-width: 720px; margin: 0 auto; padding: 16px; padding-bottom: 96px; }
h2 { font-size: 18px; margin: 24px 0 8px; }
h3 { font-size: 16px; margin: 16px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.note { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.warn { background: var(--warn-bg); color: var(--warn-fg); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
button, .btn { font: inherit; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--fg); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
button:disabled { opacity: .5; }
button.primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
button.big { width: 100%; padding: 18px; font-size: 18px; }
button.link { background: none; border: none; color: var(--primary); padding: 8px 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; align-items: flex-end; }
.grow { flex: 1; }
.sticky { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; border-top: 1px solid var(--line); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 8px; cursor: pointer; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 12px 0; }
.thumb { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.thumb-img { width: 100%; height: auto; border-radius: 6px; display: block; }
.thumb .pdf { padding: 24px 8px; text-align: center; word-break: break-all; }
.tools { display: flex; gap: 4px; justify-content: space-between; }
.tools button { padding: 6px 8px; flex: 1; justify-content: center; }
form label { display: block; margin: 10px 0; font-size: 14px; color: var(--muted); }
form label.inline { display: inline-flex; gap: 6px; margin-right: 16px; color: var(--fg); }
input, select, textarea { display: block; width: 100%; font: inherit; color: var(--fg); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-top: 4px; }
input[type=radio] { width: auto; display: inline; margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; padding: 8px 12px; }
.item { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.item input[name=it_popis] { grid-column: 1 / -1; }
.item input { margin: 0; }
.crop-wrap { position: relative; display: flex; justify-content: center; touch-action: none; user-select: none; }
#crop-canvas { max-width: 100%; display: block; }
.crop-box { position: absolute; border: 2px solid #ffd400; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); pointer-events: none; }
.crop-box .h { position: absolute; width: 36px; height: 36px; background: #ffd400; border-radius: 50%; pointer-events: auto; touch-action: none; }
.crop-box .tl { left: -18px; top: -18px; } .crop-box .tr { right: -18px; top: -18px; }
.crop-box .bl { left: -18px; bottom: -18px; } .crop-box .br { right: -18px; bottom: -18px; }
.viewer { position: fixed; inset: 0; background: #000; z-index: 20; overflow: auto; }
.viewer img { width: 100%; height: auto; display: block; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 24px; z-index: 30; background: #222; color: #fff;
  padding: 12px 16px; border-radius: 10px; text-align: center; }
