/* Nákupný zoznam v mobile (Leták do nákupu). Bez externých zdrojov, svetlý aj tmavý režim. */
:root {
  --bg: #f5f5f4; --card: #fff; --text: #1c1917; --muted: #6b645f; --line: #e2dfdc;
  --accent: #15803d; --accent-text: #fff; --soft: #ecfdf3; --warn: #b42318;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1c1917; --card: #292524; --text: #f5f5f4; --muted: #a8a29e; --line: #44403c;
    --accent: #22c55e; --accent-text: #052e16; --soft: #14321f; --warn: #fca5a5; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }

main { max-width: 640px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 12px 0; }
header { padding: 4px 4px 10px; }
h1 { margin: 0; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
#sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
h2 { margin: 18px 4px 6px; font-size: 15px; color: var(--muted); font-weight: 600; }

/* Položky: celý riadok je zaškrtávatko. */
.items { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); }
.items:empty { display: none; }
.item { display: flex; align-items: stretch; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px;
  cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.row:active { background: var(--soft); }
.row input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.box { flex: none; width: 30px; height: 30px; border: 2px solid var(--muted); border-radius: 9px; position: relative; }
.row input:checked + .box { background: var(--accent); border-color: var(--accent); }
.row input:checked + .box::after { content: ''; position: absolute; left: 9px; top: 3px; width: 7px; height: 15px;
  border: solid var(--accent-text); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.row input:focus-visible + .box { outline: 3px solid var(--accent); outline-offset: 2px; }
.txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.label { overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 14px; margin-top: 1px; }
.qty { flex: none; font-weight: 700; font-size: 16px; padding: 2px 9px; border-radius: 999px; background: var(--soft); }
.done .label { text-decoration: line-through; color: var(--muted); }
.done .qty { background: none; color: var(--muted); }
.del { flex: none; width: 52px; border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted);
  font-size: 26px; line-height: 1; }
.del:active { color: var(--warn); }

.note { color: var(--muted); text-align: center; margin: 14px 0; }

#add { display: flex; gap: 8px; margin: 14px 0 0; }
#add input { flex: 1; min-width: 0; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); }
#add input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

.btn { min-height: 48px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  font-weight: 600; }
.btn:active { background: var(--soft); }
.btn.armed { background: var(--warn); border-color: var(--warn); color: #fff; }
.actions { display: flex; gap: 8px; margin: 18px 0 0; }
.wide { flex: 1; }
.hint { color: var(--muted); font-size: 13px; text-align: center; margin: 12px 8px 0; }

/* Súčet drží spodok obrazovky. */
#sum { position: sticky; bottom: 0; margin: 16px -12px 0; padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
#sum div { display: flex; flex-direction: column; }
#sum div:last-of-type { text-align: right; }
#sum span { color: var(--muted); font-size: 13px; }
#sum strong { font-size: 20px; }
#sum-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; }

#toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); max-width: calc(100% - 32px); margin: 0;
  padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 15px; }

.screen { max-width: 420px; margin: 0 auto; padding: 18vh 24px 24px; text-align: center; }
.screen p { color: var(--muted); }
.screen .note { color: var(--warn); font-size: 15px; }
.mark { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; border: 3px solid var(--muted); position: relative; }
.mark::after { content: ''; position: absolute; left: 14px; right: 14px; top: 18px; height: 3px; background: var(--muted);
  box-shadow: 0 9px 0 var(--muted), 0 18px 0 var(--muted); }
.mark.ok { border-color: var(--accent); background: var(--accent); }
.mark.ok::after { left: 21px; right: auto; top: 9px; width: 14px; height: 28px; background: none; box-shadow: none;
  border: solid var(--accent-text); border-width: 0 4px 4px 0; transform: rotate(45deg); }
