/* --- písma (self-hosted, latin + latin-ext ako na Google Fonts) ------------- */
@font-face { font-family: Archivo; font-weight: 100 900; font-display: swap; src: url(fonts/archivo-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Archivo; font-weight: 100 900; font-display: swap; src: url(fonts/archivo-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Figtree; font-weight: 300 900; font-display: swap; src: url(fonts/figtree-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Figtree; font-weight: 300 900; font-display: swap; src: url(fonts/figtree-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Material Symbols Rounded"; font-weight: 400; font-display: block;
  src: url(fonts/material-symbols-rounded.woff2?v=3) format("woff2"); }

/* --- témy: Etiketa (predvolená) / Bridlica × svetlá / tmavá ------------------ */
:root, :root[data-theme="etiketa"] {
  --font: Archivo, system-ui, sans-serif; --r-card: 4px; --r-btn: 4px; --total-w: 800;
  --page: #fff; --card: #fff; --ink: #000; --ink-2: #1a1a1a; --muted: #4d4d4d; --muted-2: #666;
  --line: #d4d4d4; --field: #f0f0f0; --disabled: #cfcfcf; --primary-bg: #000; --primary-fg: #fff;
  --attn-bg: #ffd400; --attn-fg: #000; --attn-ring: inset 0 0 0 1.5px #000;
  --card-border: 1.5px solid var(--ink); --q-border: 3px solid #000; --chip-bg: var(--attn-bg); --chip-fg: var(--attn-fg);
}
:root[data-theme="bridlica"] {
  --font: Figtree, system-ui, sans-serif; --r-card: 14px; --r-btn: 10px; --total-w: 600;
  --page: #edf0f2; --card: #fff; --ink: #0f1a21; --ink-2: #2c3a43; --muted: #5a6872; --muted-2: #5f6b74;
  --line: #dce2e7; --field: #e5eaee; --disabled: #c9d1d7; --primary-bg: oklch(0.48 0.09 200); --primary-fg: #fff;
  --attn-bg: oklch(0.48 0.09 200); --attn-fg: #fff; --attn-ring: none;
  --card-border: 0 solid transparent; --q-border: 2px solid var(--attn-bg); --chip-bg: var(--primary-bg); --chip-fg: var(--primary-fg);
}
/* tmavá: data-dark nastavuje JS (režim Auto = prefers-color-scheme, alebo Svetlý / Tmavý z Nastavení) */
:root { color-scheme: light; }
:root[data-dark] { color-scheme: dark; }
:root[data-dark]:not([data-theme="bridlica"]) {
  --page: #000; --card: #0f0f0f; --ink: #fff; --ink-2: #e6e6e6; --muted: #b3b3b3; --muted-2: #999;
  --line: #333; --field: #1c1c1c; --disabled: #3a3a3a; --primary-bg: #fff; --primary-fg: #000;
  --attn-ring: none; --q-border: 3px solid #ffd400;
}
:root[data-dark][data-theme="bridlica"] {
  --page: #0e0f10; --card: #18191b; --ink: #eef0f1; --ink-2: #d4d7d9; --muted: #a2a7ab; --muted-2: #878c90;
  --line: #2d2f32; --field: #222427; --disabled: #3a3d40;
}

/* --- základ ------------------------------------------------------------------ */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; height: 100dvh; overflow: hidden;
       font: 16px/1.35 var(--font); background: var(--page); color: var(--ink); -webkit-tap-highlight-color: transparent;
       padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
.ico { font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal; font-size: 24px; line-height: 1;
       letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; direction: ltr;
       -webkit-font-feature-settings: "liga"; font-feature-settings: "liga"; -webkit-font-smoothing: antialiased;
       flex: none; user-select: none; }
.num, #total, .kcal, #rec-time, .job .t { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.ib { min-width: 48px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center;
      border-radius: 50%; color: var(--ink); flex: none; }
.ib.dark { background: rgba(0, 0, 0, .55); color: #fff; }
.spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%;
        animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

#stage { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.view { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; overscroll-behavior: contain; }
.head { display: flex; align-items: center; min-height: 56px; padding: 4px 4px; gap: 4px; }
.head h1 { flex: 1; margin: 0 0 0 4px; font-size: 22px; font-weight: 800; }
.pad { padding: 8px 16px 24px; }
.hint { color: var(--muted); padding: 0 16px; margin: auto 0 12px; font-size: 15px; }

/* --- tlačidlá ------------------------------------------------------------------ */
.btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
       padding: 10px 16px; border-radius: var(--r-btn); font-weight: 600; font-size: 15px; }
.btn.primary { background: var(--primary-bg); color: var(--primary-fg); }
.btn.outline { border: 1.5px solid var(--ink); }
.btn.attn { background: var(--attn-bg); color: var(--attn-fg); box-shadow: var(--attn-ring); }
.btn.ghost { color: var(--ink); }
.btn.big { min-height: 56px; font-size: 16px; }
.btn.choice { width: 100%; justify-content: flex-start; text-align: left; font-weight: 400; padding: 12px 14px;
              border: 1.5px solid var(--ink); background: var(--card); overflow-wrap: anywhere; }
.btn.choice.action { background: var(--field); }
.btn.choice.other { border-style: dashed; border-color: var(--muted-2); color: var(--muted); }
.btn:disabled { opacity: .5; }

/* --- Deň ---------------------------------------------------------------------- */
#day-head { justify-content: space-between; }
#day-pick { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.day-nav { display: flex; align-items: center; }
.day-label { min-height: 48px; padding: 0 4px; font-weight: 600; font-size: 16px; white-space: nowrap; }
.day-label .muted { font-weight: 400; }
.past #day-head, .past #total-wrap { background: var(--ink); color: var(--card); }
.past #day-head .ib, .past .day-label .muted { color: var(--card); }
#total-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 16px 16px; }
#total { font-size: 52px; font-weight: var(--total-w); letter-spacing: -0.02em; line-height: 1.1; }
#total .unit { font-size: 17px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.past #total .unit { color: inherit; opacity: .75; }
#total.zero #total-n { color: var(--disabled); }
#go-today { min-height: 44px; }
#feed { display: flex; flex-direction: column; gap: 12px; padding: 0 12px 12px; }
#empty { margin: auto 0 0; padding: 16px 24px; text-align: center; font-size: 17px; font-weight: 600;
         display: flex; flex-direction: column; align-items: center; gap: 4px; }

.box { background: var(--card); border: var(--card-border); border-radius: var(--r-card); overflow: hidden; }
.box.has-q { border: var(--q-border); }
.box-head { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 4px 0 16px; text-align: left; }
.box-head .time { font-weight: 600; }
.box-head .sum { flex: 1; font-size: 14px; color: var(--muted); }
.pill { background: var(--attn-bg); color: var(--attn-fg); box-shadow: var(--attn-ring); font-size: 13px; font-weight: 600;
        padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.box-head .ico { width: 48px; text-align: center; }
.box-msg { display: flex; gap: 8px; padding: 0 16px 10px; font-size: 14px; color: var(--muted); white-space: pre-wrap; }
.box-msg .ico { font-size: 18px; }
.box-hint { display: flex; gap: 6px; align-items: flex-start; padding: 10px 16px 14px; font-size: 13px; color: var(--muted);
            border-top: 1px solid var(--line); }
.box-hint .ico { font-size: 18px; }
.box-move { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 8px 6px; padding: 0 8px;
  font-size: 14px; color: var(--muted); }
.box-move .ico { font-size: 18px; }
.move-opts { display: grid; gap: 8px; position: relative; }
.move-opt { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; width: 100%; text-align: left;
  border: 1.5px solid var(--ink); border-radius: var(--r-btn); font-size: 16px; }
.move-opt .ico { font-size: 20px; }
.move-date { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.item { border-top: 1px solid var(--line); }
.item-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; width: 100%; text-align: left; min-height: 48px; }
.item.sel > .item-row, .item.open > .item-row { background: var(--field); }
.item.target { box-shadow: inset 0 0 0 2px var(--ink); }
.item .body { flex: 1; min-width: 0; }
.item .name { overflow-wrap: anywhere; }
.item .name .sup, .q-head .sup { color: var(--muted); }
.item .amt { font-size: 14px; color: var(--muted); }
.item .kcal { font-weight: 700; white-space: nowrap; }
.item .kcal small { font-size: 14px; font-weight: 400; color: var(--muted); }
.st { width: 22px; height: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.st .ico { font-size: 22px; }
.st.est { border: 1.5px dashed var(--ink); border-radius: 50%; font-size: 14px; font-weight: 700; }
.st.q { background: var(--attn-bg); color: var(--attn-fg); box-shadow: var(--attn-ring); border-radius: 50%; font-size: 14px; font-weight: 800; }
.item-row .ib { margin: -12px -12px -12px 0; }

.item.q { padding: 14px 16px 16px; }
.q-head { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: -8px 0 0; }
.q-head .name { flex: 1; min-width: 0; }
.q-head .name b { font-weight: 600; }
.q-head .ib { margin-right: -12px; color: var(--muted-2); }
.q-text { color: var(--ink-2); font-size: 15px; margin: 4px 0 12px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opts.side { flex-direction: row; }
.opts.side .btn { flex: 1; justify-content: center; text-align: center; }
.opts.side .ok { flex: 2; }
.opts.side .cancel { flex: 1; }
.unnamed { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.unnamed img, .thumb64 img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--r-btn); display: block; }
.zoom { position: relative; flex: none; }
.zoom .ico { position: absolute; right: 2px; bottom: 2px; font-size: 18px; color: #fff; background: rgba(0,0,0,.55); border-radius: 50%; padding: 2px; }
.input { width: 100%; min-height: 52px; padding: 0 14px; border: 1.5px solid var(--ink); border-radius: var(--r-btn);
         background: var(--card); }
label.lbl { display: flex; flex-direction: column; gap: 6px; flex: 1; font-size: 14px; color: var(--muted); }

.detail { padding: 0 16px 16px 50px; display: flex; flex-direction: column; gap: 6px; background: var(--field); }
.detail .how { font-size: 15px; }
.detail .vals, .detail .src { font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; overflow-wrap: anywhere; }
.detail .src .ico { font-size: 18px; }
.detail .thumb64 img { width: 64px; height: 64px; }
.detail .opts { margin-top: 8px; }

/* --- lišty nad dockom ------------------------------------------------------------ */
#bars { flex: none; }
.bar { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 20px; min-height: 48px; border-top: 1px solid var(--line);
       font-size: 15px; }
.bar.ink { background: var(--ink); color: var(--card); border: 0; }
.bar.ink .ib { color: var(--card); }
.bar .btn { margin-right: 12px; }
.undo-btn { min-height: 48px; padding: 0 20px; text-decoration: underline; font-weight: 600; color: inherit; }
.job { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-top: 1px solid var(--line); font-size: 15px; }
.job img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; }
.job .t { margin-left: auto; color: var(--muted); }
.job .ico { font-size: 18px; color: var(--muted); }
.notice { display: flex; gap: 10px; align-items: center; margin: 8px 12px 0; padding: 10px 14px; border: 1.5px solid var(--ink);
          border-radius: var(--r-btn); font-size: 14px; }
.topbar { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; background: var(--ink);
          color: var(--card); font-size: 14px; font-weight: 600; }
.topbar .ico { font-size: 18px; }

/* --- dock ----------------------------------------------------------------------- */
#dock, #foods-bar { flex: none; background: var(--page); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
#chips { display: flex; flex-direction: column; gap: 6px; }
#chips:not(:empty) { margin-bottom: 8px; }
.chip { display: flex; align-items: center; gap: 8px; min-height: 48px; padding-left: 16px; border-radius: 999px;
        background: var(--primary-bg); color: var(--primary-fg); font-size: 15px; font-weight: 600; }
.chip.attn { background: var(--chip-bg); color: var(--chip-fg); box-shadow: var(--attn-ring); }
.chip.plain { background: var(--field); color: var(--ink); }
.chip span.grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .ib { color: inherit; }
.chip:not(:has(.ib)) { padding-right: 16px; }
.field { display: flex; align-items: center; gap: 4px; min-height: 48px; border-radius: 999px; background: var(--field);
         padding: 0 6px 0 18px; }
.field input { flex: 1; min-width: 0; border: 0; background: none; outline: none; min-height: 48px; font-size: 16px; }
.field input::placeholder { color: var(--muted-2); }
.field > .ico { color: var(--muted-2); margin-left: -4px; }
.field .find { margin-left: -16px; margin-right: -8px; color: var(--muted); }
.send { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-bg); color: var(--primary-fg);
        display: inline-flex; align-items: center; justify-content: center; position: relative; }
.send::after { content: ""; position: absolute; inset: -6px; }          /* dotyková plocha 48 px */
.send:disabled { background: var(--disabled); color: var(--card); }
.send .ico { font-size: 22px; }
.ctrl { display: flex; align-items: center; justify-content: space-between; padding: 14px 32px 6px; }
.round { width: 56px; height: 56px; border-radius: 50%; border: 1.5px solid var(--ink); display: inline-flex;
         align-items: center; justify-content: center; cursor: pointer; color: var(--ink); flex: none; }
.round.main { width: 76px; height: 76px; border: 0; background: var(--primary-bg); color: var(--primary-fg); }
.round.main .ico { font-size: 32px; }
.round.off { border-style: dashed; border-color: var(--muted-2); color: var(--muted-2); background: none; }
.labeled { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.labeled small { font-size: 13px; color: var(--muted); }
.shutter { background: none !important; border: 4px solid var(--ink) !important; }
.shutter span { width: 58px; height: 58px; border-radius: 50%; background: var(--ink); }
#ctrl-cam, #rec .ctrl { padding-top: 8px; }
#tray { display: flex; gap: 10px; overflow-x: auto; padding: 8px 4px 10px; }
.thumb { position: relative; flex: none; }
.thumb img { width: 60px; height: 60px; object-fit: cover; border-radius: var(--r-btn); display: block; }
.thumb button { position: absolute; top: -12px; right: -12px; width: 48px; height: 48px; display: flex;
                align-items: flex-start; justify-content: flex-end; }
.thumb button .ico { width: 24px; height: 24px; font-size: 18px; border-radius: 50%; background: var(--ink); color: var(--card);
                     display: flex; align-items: center; justify-content: center; margin: 6px; }
#rec .rec-state { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; font-size: 17px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 2px solid var(--ink); }
.dot.paused { background: none; }
#rec-time { font-weight: 600; }

/* --- kamera ---------------------------------------------------------------------- */
#cam { position: absolute; inset: 0; z-index: 3; background: #000; }
#cam-video { width: 100%; height: 100%; object-fit: cover; display: block; }
#cam-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
            gap: 12px; color: #fff; font-size: 15px; }
#cam-wait .spin { width: 32px; height: 32px; border-color: #555; border-top-color: #fff; }
#cam-close { position: absolute; top: 12px; left: 12px; }
#cam-switch { position: absolute; top: 12px; right: 12px; }

/* --- Moje jedlá ------------------------------------------------------------------ */
.list { list-style: none; margin: 0; padding: 0 0 12px; }
.list li { border-top: 1px solid var(--line); }
.list li:last-child { border-bottom: 1px solid var(--line); }
.list button { width: 100%; min-height: 64px; display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 16px; text-align: left; }
.list .body { flex: 1; min-width: 0; }
.list .meta { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.tag { font-size: 13px; font-weight: 600; padding: 1px 8px; border: 1.5px solid var(--ink); border-radius: var(--r-btn); color: var(--ink); }
.tag.attn { background: var(--attn-bg); color: var(--attn-fg); border-color: transparent; box-shadow: var(--attn-ring); }
.tag.dim { border-color: var(--muted-2); color: var(--muted); }
#food-none { padding: 24px 16px; }
#food-none p { margin: 0 0 12px; font-size: 17px; font-weight: 600; }
#foods-bar .two { margin-top: 10px; }
.two { display: flex; gap: 10px; }
.two > * { flex: 1; }

.food-name { font-size: 28px; font-weight: 800; margin: 4px 0 0; line-height: 1.15; overflow-wrap: anywhere; }
.food-sup { font-size: 17px; color: var(--muted); margin: 2px 0 0; }
.nf { border-top: 3px solid var(--ink); border-bottom: 1.5px solid var(--ink); margin: 16px 0; }
.nf div { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; }
.nf div + div { border-top: 1px solid var(--line); }
.nf b { font-size: 22px; font-weight: 800; }
.src-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin: 8px 0; overflow-wrap: anywhere; }
.ings { list-style: none; margin: 8px 0; padding: 0; }
.ings li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ings li span:last-child { color: var(--muted); text-align: right; }
.warn { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 12px 0; border-radius: var(--r-btn);
        background: var(--attn-bg); color: var(--attn-fg); box-shadow: var(--attn-ring); font-size: 15px; }

/* --- formuláre, nastavenia ------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.form input, .form textarea { min-height: 52px; padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: var(--r-btn);
                              background: var(--card); font-weight: 400; font-size: 16px; width: 100%; }
.form textarea { min-height: 120px; resize: vertical; }
.suffix { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.settings { display: flex; flex-direction: column; flex: 1; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); min-height: 72px; }
.set-row > div:first-child { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.set-row b { font-weight: 600; }
.set-row small { font-size: 13px; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper output { min-width: 52px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.step { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.step .ico { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--ink); border-radius: var(--r-btn); }
.switch { appearance: none; width: 52px; height: 32px; border-radius: 999px; background: var(--disabled); position: relative;
          cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%;
                 background: var(--card); transition: transform .15s; }
.switch:checked { background: var(--primary-bg); }
.switch:checked::after { transform: translateX(20px); background: var(--primary-fg); }
.seg { display: flex; border: 1.5px solid var(--ink); border-radius: var(--r-btn); overflow: hidden; }
.seg button { min-height: 44px; padding: 0 12px; font-size: 14px; font-weight: 600; }
.seg button.on { background: var(--primary-bg); color: var(--primary-fg); }
.credits { font-size: 13px; color: var(--muted); padding: 16px; margin: auto 0 0; }
.settings > .btn { margin: 0 12px 12px; }
.set-row.account { margin-top: 32px; border-top: 1px solid var(--line); min-height: 64px; }
.set-row.account small { font-size: 14px; }
.set-row.account .btn { padding: 0 14px; font-weight: 600; }
.set-row.account .btn .ico { font-size: 20px; }

/* --- prihlásenie (8a–8c) ------------------------------------------------------------ */
body.login > :not(#login, #offline, #lightbox, script) { display: none !important; }
#login { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column;
         padding-bottom: env(safe-area-inset-bottom); }
.login-title { flex: 1; display: flex; align-items: center; padding: 0 24px; }
.login-title h1 { margin: 0; font-size: 52px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; text-wrap: balance; }
.login-form { padding: 0 16px 16px; }
.login-form input { padding: 0 14px; }
.login-form input::placeholder { color: var(--muted-2); }
.login-form input:focus { outline: none; border: 2px solid var(--ink); padding: 0 13.5px; }
.login-form.bad input[name="password"]:focus { box-shadow: inset 0 0 0 3px var(--attn-bg); }
.login-form.busy input { border-color: var(--line); color: var(--muted); }
.login-form .bar { border-radius: var(--r-btn); }
.pw { position: relative; display: flex; }
.pw input { padding-right: 52px; }
.pw .ib { position: absolute; right: 2px; top: 2px; color: var(--muted-2); }
#login-btn { font-weight: 600; }
#login-btn .ico { font-size: 20px; }
#login-btn:disabled { background: var(--disabled); color: var(--muted-2); opacity: 1; }
#login-off p { margin: 0 0 12px; font-size: 15px; }
#login-off .btn { width: 100%; }
#login .credits { margin: 0; }

#lightbox { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, .9); display: flex; align-items: center; justify-content: center; }
#lightbox img { max-width: 100%; max-height: 100%; }
input[type="search"]::-webkit-search-cancel-button { display: none; }
#login-btn .spin { border-color: color-mix(in srgb, var(--primary-fg) 35%, transparent); border-top-color: var(--primary-fg); }

/* --- kolo 9: ručné úpravy (manual.js) ------------------------------------------------- */
:root { --sheet-bg: var(--card); --sheet-top: none; }
:root[data-dark]:not([data-theme="bridlica"]) { --sheet-bg: #171717; --sheet-top: 1.5px solid #fff; }
#sheet { position: fixed; inset: 0; z-index: 8; display: flex; flex-direction: column; justify-content: flex-end; }
#sheet .scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.sheet { position: relative; background: var(--sheet-bg); border-top: var(--sheet-top); color: var(--ink);
         border-radius: 8px 8px 0 0; max-height: calc(100dvh - 72px); display: flex; flex-direction: column;
         padding-bottom: env(safe-area-inset-bottom); transition: transform .15s; }
:root[data-theme="bridlica"] .sheet { border-radius: 14px 14px 0 0; }
.sheet.tall { height: calc(100dvh - 72px); }
.sheet.busy .sh-body, .sheet.busy .sh-foot > :not(.btn), .edit-form.busy { pointer-events: none; opacity: .6; }
.grab { width: 36px; height: 4px; border-radius: 2px; background: var(--muted-2); margin: 8px auto 0; flex: none; }
.sh-head { display: flex; align-items: flex-start; gap: 8px; padding: 8px 4px 8px 20px; flex: none; }
.sh-head h2 { margin: 6px 0 0; font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
:root[data-theme="bridlica"] .sh-head h2 { font-weight: 700; }
.sh-head .sub { margin: 2px 0 0; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
.sh-bar { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 4px 4px 16px; flex: none;
          background: var(--ink); color: var(--card); font-size: 15px; }
.sh-bar .ib { color: var(--card); }
.sh-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px 14px; display: flex; flex-direction: column; gap: 14px; }
.sh-foot { flex: none; padding: 0 16px 12px; }
.btn.wide { width: 100%; }
.spin.inv { border-color: color-mix(in srgb, var(--primary-fg) 35%, transparent); border-top-color: var(--primary-fg); }

/* množstvo: stepper, rýchle voľby, jednotky, výsledok */
.amount { display: flex; flex-direction: column; gap: 12px; }
.amt-step { display: flex; align-items: center; gap: 12px; }
.amt-step .step-b { width: 56px; height: 56px; flex: none; display: flex; align-items: center; justify-content: center;
                    border: 1.5px solid var(--ink); border-radius: var(--r-btn); }
.amt-val { flex: 1; min-width: 0; height: 60px; border: 0; border-bottom: 2px solid var(--ink); background: none; outline: none;
           text-align: center; font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; border-radius: 0; }
.amt-val::placeholder { color: var(--disabled); }
.picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pick, .unit { min-height: 48px; border: 1.5px solid var(--ink); border-radius: var(--r-btn); font-size: 16px; padding: 0 14px; }
.pick.on, .unit.on { background: var(--primary-bg); color: var(--primary-fg); border-color: var(--primary-bg); font-weight: 600; }
.units { display: flex; flex-wrap: wrap; gap: 8px; }
.units.bad .unit.on { box-shadow: inset 0 0 0 3px var(--attn-bg); border-color: var(--ink); }
.res { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 40px; }
.res-k { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res-k small { font-size: 15px; font-weight: 400; color: var(--muted); }
.q-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-btn); font-size: 15px;
         background: color-mix(in srgb, var(--attn-bg) 22%, var(--sheet-bg)); box-shadow: inset 0 0 0 1.5px var(--ink); }
:root[data-theme="bridlica"] .q-box { box-shadow: inset 0 0 0 1.5px var(--attn-bg); }
.info, .f-err { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 14px; }
.info { color: var(--muted); }
.info .ico, .f-err .ico { font-size: 20px; }
.f-err { font-weight: 600; color: var(--ink); }

/* iné jedlo: výsledky dole, hľadanie nad klávesnicou */
.results { display: flex; flex-direction: column; margin: -8px -16px -14px; flex: 1; }
.results > :first-child { margin-top: auto; }
.sec { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 20px 8px; font-size: 13px; font-weight: 700;
       text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.sec .ico { font-size: 18px; }
.res-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 20px; text-align: left; width: 100%;
           border-bottom: 1px solid var(--line); }
.res-row b { font-weight: 600; text-wrap: pretty; overflow-wrap: anywhere; }
.res-row .en { font-size: 14px; font-style: italic; color: var(--muted); }
.res-row .vals { font-size: 14px; color: var(--muted); }
.res-row .kcal { font-weight: 700; white-space: nowrap; }
.res-row .kcal small { font-size: 13px; font-weight: 400; color: var(--muted); }
.res-row.now { opacity: 1; }
.results .empty { margin-top: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.results .empty h3 { margin: 0; font-size: 18px; font-weight: 700; }
.results .empty p { margin: 0; font-size: 15px; display: flex; gap: 6px; align-items: center; }
.search { display: flex; align-items: center; gap: 4px; min-height: 52px; padding-left: 12px; border: 2px solid var(--ink);
          border-radius: var(--r-btn); background: var(--card); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; min-height: 48px; }
.search input::placeholder { color: var(--muted-2); }

/* zápis z databázy: Názov + pôvodný názov */
.f-group { display: flex; flex-direction: column; gap: 6px; }
.from-db { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 14px; }
.from-db .ico { font-size: 18px; }

/* zápis: minulý deň */
.day-band { display: flex; align-items: center; gap: 10px; margin: -8px -16px 0; padding: 12px 20px; background: var(--ink);
            color: var(--card); font-size: 15px; }

/* položka: tlačidlá ručných úprav, zvýraznenie po zmene, zmenené hodnoty jedla */
.detail .opts + .btn { margin-top: 2px; }
.btn.manual { align-self: flex-start; background: var(--field); font-weight: 400; padding: 10px 16px; }
.btn.manual .ico { font-size: 20px; }
.item.flash { box-shadow: inset 4px 0 0 var(--attn-bg); }
.changed { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1.5px dashed var(--ink);
           border-radius: var(--r-btn); font-size: 14px; }
.changed .ico { font-size: 18px; }

/* dock: nedávne jedlá (len keď je pole aktívne) */
#recent { margin: 0 -12px 8px; }
.rec-label { display: flex; align-items: center; gap: 6px; padding: 0 16px 6px; font-size: 13px; font-weight: 700;
             text-transform: uppercase; letter-spacing: .04em; }
.rec-label .ico { font-size: 18px; }
.rec-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 12px; scrollbar-width: none; }
.rec-chip { flex: none; max-width: 260px; min-height: 48px; display: flex; align-items: center; gap: 6px; padding: 0 14px;
            border: 1.5px solid var(--ink); border-radius: var(--r-btn); background: var(--card); white-space: nowrap; }
.rec-chip b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.rec-chip .ico { font-size: 18px; }
.rec-empty { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 0 16px; font-size: 14px; color: var(--muted); }
.rec-empty .ico { font-size: 18px; }

/* detail jedla: Zapísať + Upraviť; formulár úpravy */
.food-actions { display: flex; gap: 8px; padding: 12px 12px 4px; margin-top: auto; }
.food-actions .primary { flex: 2; }
.food-actions .outline { flex: 1; }
.edit-form { display: flex; flex-direction: column; gap: 14px; padding: 4px 16px 16px; }
.edit-form .sh-bar { margin: 0 -16px; }
.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f-label { font-size: 14px; font-weight: 600; }
.f-label .muted { font-weight: 400; }
.f-input { display: flex; align-items: center; min-height: 52px; border: 1.5px solid var(--ink); border-radius: var(--r-btn);
           background: var(--card); padding-left: 14px; }
.f-input:focus-within { border-width: 2px; padding-left: 13.5px; }
.f-input.bad { box-shadow: inset 0 0 0 3px var(--attn-bg); }
.f-input input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; min-height: 48px; }
.f-input input::placeholder { color: var(--muted-2); }
.f-input .suffix { color: var(--muted); padding: 0 14px 0 6px; }
.row2 { display: flex; gap: 12px; }
.row2 > .f { flex: 1; }
.f-hint { margin: 0; font-size: 13px; color: var(--muted); }
.edit-form .nf { margin: 0; }
.edit-foot { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); margin-top: auto;
             border-top: 1px solid var(--line); background: var(--page); position: sticky; bottom: 0; }
.edit-foot .outline { flex: 1; }
.edit-foot .primary, .edit-foot .attn { flex: 2; }
.detail .opts.side .btn { flex: 1; }               /* Množstvo / Iné jedlo rovnako široké (nezalomí sa) */
