/* Dojedeno – vizuální systém. Bez externích fontů a knihoven (on-prem, demo bez internetu). */
:root {
  --bg: #f3f5f7;
  --card: #ffffff;
  --ink: #16202a;
  --muted: #4c5a68;
  --line: #d6dde4;
  --line-strong: #b9c3cc;
  --brand: #0b6e6e;        /* Před jídlem, primární akce */
  --brand-ink: #085757;
  --brand-soft: #e0f0ef;
  --po: #3b47b8;           /* Po jídle */
  --po-ink: #2f3994;
  --po-soft: #e7e9fa;
  --ok: #1b7340;
  --ok-soft: #e2f3e8;
  --low: #8f4c00;          /* nízký příjem, vrací se */
  --low-soft: #fcefdb;
  --risk: #b02a1d;         /* v riziku */
  --risk-soft: #fdebe8;
  --check: #6f5600;        /* potvrďte */
  --check-soft: #fff4c4;
  --track: #e4e9ee;
  --radius: 16px;
  --tap: 52px;
  --tap-primary: 68px;
  --shadow: 0 1px 2px rgba(16, 32, 42, .06), 0 2px 8px rgba(16, 32, 42, .05);
  --accent: var(--brand);
  --accent-ink: var(--brand-ink);
  --accent-soft: var(--brand-soft);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 18px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; }
body { min-height: 100vh; overflow-x: hidden; }
img { max-width: 100%; }
a { color: var(--brand-ink); }
:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
.tnum, .big, .huge, td.num { font-variant-numeric: tabular-nums; }

/* ---------- hlavička ---------- */
header.app { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }
.app-bar { display: flex; align-items: center; gap: 12px; max-width: 1180px; margin: 0 auto; padding: 8px 16px; }
.app-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 750; font-size: 19px; white-space: nowrap; }
.app-brand svg { width: 30px; height: 30px; flex: none; }
.roles { display: flex; gap: 4px; margin-left: auto; }
.roles a, .meas a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 16px;
  border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 650; font-size: 17px; }
.roles a.active { background: var(--ink); color: #fff; }
.roles a:not(.active):hover { background: var(--bg); }
.meas { border-left: 1px solid var(--line); padding-left: 8px; }
.meas a { font-size: 15px; font-weight: 600; padding: 0 12px; }
.meas a.active { background: var(--ink); color: #fff; }   /* jako aktivní role */
.subnav { display: flex; gap: 6px; max-width: 1180px; margin: 0 auto; padding: 0 16px 8px; }
.subnav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line-strong);
  color: var(--ink); background: var(--card); text-decoration: none; font-weight: 700; font-size: 16px; }
.subnav a.active { border-color: var(--ink); color: #fff; background: var(--ink); }
.subnav .tag { margin-left: auto; align-self: center; font-size: 14px; color: var(--muted); }
.statusline { display: flex; align-items: center; gap: 8px; max-width: 1180px; margin: 0 auto; padding: 0 16px 8px;
  font-size: 15px; color: var(--muted); }
.statusline button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); flex: none; }
.statusline.ok .dot { background: var(--ok); }
.statusline.warn .dot { background: #d68a00; }
.statusline.err { color: var(--risk); font-weight: 650; }
.statusline.err .dot { background: var(--risk); }
.statusline { flex-wrap: wrap; row-gap: 0; }
.statusline .detail { font-size: 14px; }
@media (max-width: 720px) {
  .app-bar { flex-wrap: wrap; padding: 8px 12px 6px; gap: 6px 10px; }
  .roles { order: 3; width: 100%; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
  .roles a { padding: 0 6px; }
  .meas { margin-left: auto; border: 0; padding: 0; }
  .statusline, .subnav { padding-left: 12px; padding-right: 12px; }
}

/* ---------- rozvržení ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 16px 16px 40px; }
main.narrow { max-width: 600px; }
h1.page { font-size: 26px; line-height: 1.2; margin: 8px 0 4px; }
h2 { font-size: 21px; margin: 28px 0 10px; }
h3 { font-size: 18px; margin: 0; }
.lead { color: var(--muted); margin: 0 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.table-wrap { overflow-x: auto; }
.row { display: flex; gap: 12px; align-items: center; }
.row > * { flex: 1; }
.stack > * + * { margin-top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.big { font-size: 26px; font-weight: 750; line-height: 1.15; }
.huge { font-size: 40px; font-weight: 800; line-height: 1.05; letter-spacing: -.01em; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- formuláře a tlačítka ---------- */
label { display: block; font-size: 16px; color: var(--muted); margin: 12px 0; font-weight: 600; }
select, input[type=text], input:not([type]), input[type=date], input[type=number] { display: block; width: 100%; min-width: 0; max-width: 100%;
  margin-top: 6px; min-height: var(--tap); padding: 10px 14px; font: inherit; font-weight: 500; color: var(--ink);
  border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff; -webkit-appearance: none; appearance: none; }
input.code { font-size: 24px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
button { font: inherit; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 20px;
  border-radius: 14px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink); font-weight: 650; font-size: 17px;
  text-decoration: none; touch-action: manipulation; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: var(--tap-primary); font-size: 20px; border-radius: 18px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.btn.danger { color: var(--risk); border-color: #e7b7b1; }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.btns > .btn { flex: 1 1 200px; }
.linkbtn { all: unset; cursor: pointer; color: var(--accent-ink); font-weight: 650; text-decoration: underline; text-underline-offset: 3px;
  min-height: 44px; display: inline-flex; align-items: center; }

/* volba jedním dotykem */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.chip { min-height: var(--tap); min-width: 64px; padding: 0 18px; border-radius: 14px; border: 1.5px solid var(--line-strong);
  background: #fff; color: var(--ink); font-weight: 700; font-size: 18px; touch-action: manipulation; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.on::before { content: "✓ "; }
.chip small { display: block; font-size: 13px; font-weight: 500; }
.field-label { font-size: 16px; font-weight: 650; color: var(--muted); margin: 18px 0 0; }

/* starý segmentový přepínač (Vážení) */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.seg button { min-height: 64px; padding: 10px 8px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--card);
  font-size: 18px; font-weight: 700; color: var(--muted); }
.seg button small { display: block; font-weight: 500; font-size: 14px; }
.seg button.on { border-color: var(--brand); background: var(--brand); color: #fff; }

/* ---------- zprávy a stavy ---------- */
.msg { padding: 14px 16px; border-radius: 14px; margin: 12px 0; font-weight: 600; border: 1px solid transparent; }
.msg.ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe2cb; }
.msg.warn { background: var(--low-soft); color: var(--low); border-color: #f0cf9f; }
.msg.err { background: var(--risk-soft); color: var(--risk); border-color: #f2c2bb; }
.msg.info { background: var(--bg); color: var(--muted); border-color: var(--line); font-weight: 500; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe2cb; }
.pill.warn, .pill.low { background: var(--low-soft); color: var(--low); border-color: #f0cf9f; }
.pill.err, .pill.risk { background: var(--risk-soft); color: var(--risk); border-color: #f2c2bb; }
.pill.check { background: var(--check-soft); color: var(--check); border-color: #ecd77a; }
.pill.wait { background: #eef1f4; color: var(--muted); }
.empty { text-align: center; padding: 32px 16px; }
.empty .ico { font-size: 44px; line-height: 1; }
.empty h3 { margin: 12px 0 6px; font-size: 20px; }
.empty p { color: var(--muted); margin: 0 auto 16px; max-width: 420px; }
.alert-box { display: flex; gap: 12px; padding: 16px; border-radius: 16px; background: var(--risk-soft); color: #7d1d13;
  border: 1.5px solid #f0b9b1; margin: 12px 0; }
.alert-box .ico { font-size: 26px; line-height: 1; }
.alert-box b { display: block; font-size: 19px; color: var(--risk); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 16px; padding: 12px 12px 12px 20px; border-radius: 16px; background: var(--ink); color: #fff;
  font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25); width: max-content; max-width: calc(100vw - 32px); }
.toast button { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; font-weight: 700; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 4px solid rgba(0,0,0,.12); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ---------- pruhy a tabulky ---------- */
.bar { position: relative; height: 10px; border-radius: 99px; background: var(--track); overflow: hidden; min-width: 60px; margin-top: 8px; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 99px; }
.bar.low > i { background: var(--low); }
.bar.ret > i { background: var(--low); }
.bar.thick { height: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 650; font-size: 14px; }
td.num, th.num { text-align: right; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 8px 0 12px; }
.filters { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 12px; align-items: end; }
.filters label { margin: 0; }
.filters .btn { min-height: var(--tap); }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; min-height: 64px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); margin: 10px 0; cursor: pointer; text-decoration: none; color: inherit; }
.list-item.alert { border-color: #f0c08a; background: var(--low-soft); }
input[type=range] { width: 100%; accent-color: var(--brand); min-height: 40px; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--accent-ink); list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; display: inline-block; transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }

/* ---------- fotky a masky ---------- */
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; max-width: 620px; }
.photos figure { margin: 0; }
.photos img { width: 100%; border-radius: 12px; aspect-ratio: 4/3; object-fit: cover; background: #e6eaee; display: block; }
.photos figcaption { font-size: 14px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.photos .ph { position: relative; line-height: 0; }
.photos img.mask { position: absolute; inset: 0; height: 100%; background: transparent; pointer-events: none; display: none; }
.show-masks .photos img.mask { display: block; }
.photos .noafter { display: flex; align-items: center; justify-content: center; aspect-ratio: 4/3; border-radius: 12px;
  border: 2px dashed var(--line-strong); color: var(--muted); font-size: 15px; text-align: center; padding: 8px; }
.mask-legend { display: none; flex-wrap: wrap; gap: 4px 14px; margin: -2px 0 10px; font-size: 14px; color: var(--muted); }
.show-masks .mask-legend { display: flex; }
.mask-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.mask-toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; margin: 0; min-height: 48px; color: var(--ink); }
.mask-toggle input { width: 24px; height: 24px; accent-color: var(--brand); }

/* ---------- výběr podnosu podle fotky ---------- */
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; margin: 12px 0 4px; }
.pick-item { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 2px solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--ink); text-align: left; font-size: 16px; touch-action: manipulation; }
.pick-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; background: #eee; }
.pick-item b { font-size: 19px; }
.pick-item:active, .pick-item.on { border-color: var(--accent); background: var(--accent-soft); }

/* ======================= FOCENÍ ======================= */
body.mode-po { --accent: var(--po); --accent-ink: var(--po-ink); --accent-soft: var(--po-soft); }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 16px; }
.mode { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 10px 14px; border-radius: 18px;
  border: 2px solid var(--line-strong); background: var(--card); color: var(--muted); text-align: left; touch-action: manipulation; }
.mode .mi { font-size: 30px; line-height: 1; width: 40px; text-align: center; flex: none; filter: grayscale(1); opacity: .7; }
.mode b { display: block; font-size: 19px; color: var(--ink); white-space: nowrap; }
.mode small { display: block; font-size: 14px; }
.mode.pred.on { background: var(--brand); border-color: var(--brand); color: #e3f4f3; }
.mode.po.on { background: var(--po); border-color: var(--po); color: #e6e8fb; }
.mode.on b { color: #fff; }
.mode.on .mi { filter: none; opacity: 1; }
.mode-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--accent-soft);
  border-left: 6px solid var(--accent); margin-bottom: 8px; }
.mode-head .mi { font-size: 30px; }
.mode-head h1 { margin: 0; font-size: 24px; color: var(--accent-ink); }
.mode-head p { margin: 0; color: var(--ink); font-size: 17px; font-weight: 600; }
.menu-title { margin-top: 10px; font-size: 16px; color: var(--muted); }
.menu-title b { color: var(--ink); font-weight: 650; }
.shootbar { position: sticky; bottom: 0; z-index: 10; padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(243,245,247,0), var(--bg) 18px); margin-top: 8px; }
.shoot { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 84px; border-radius: 20px;
  background: var(--accent); color: #fff; font-size: 22px; font-weight: 800; cursor: pointer; user-select: none; -webkit-user-select: none;
  box-shadow: 0 4px 14px rgba(16,32,42,.18); touch-action: manipulation; text-align: center; padding: 0 16px; }
.shoot .si { font-size: 30px; }
.shoot .sl { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.shoot .sl small { font-size: 16px; font-weight: 600; opacity: .9; }
.shoot:active { transform: scale(.99); }
.shoot.secondary { background: #fff; color: var(--accent-ink); border: 2px solid var(--accent); box-shadow: none; min-height: 64px; font-size: 19px; }
.shoot.busy { opacity: .5; pointer-events: none; }
.gallery { display: flex; align-items: center; justify-content: center; min-height: 52px; margin-top: 8px; border-radius: 14px;
  background: #fff; color: var(--accent-ink); border: 1.5px solid var(--line, #d5dde3); font-size: 17px; font-weight: 650;
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.gallery:active { transform: scale(.99); }
.gallery.busy { opacity: .5; pointer-events: none; }
.hint { text-align: center; color: var(--muted); font-size: 16px; margin: 8px 0 0; }
.where { text-align: center; color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.where.out { color: var(--low); font-weight: 650; }
.stage { margin: 8px 0; }
.result-card { text-align: center; padding: 22px 16px; border-radius: 20px; border: 2px solid; }
.result-card.done { background: var(--ok-soft); border-color: #9fd3b2; color: var(--ok); }
.result-card.wait { background: var(--card); border-color: var(--line); color: var(--ink); }
.result-card.warn { background: var(--check-soft); border-color: #ecd77a; color: var(--check); text-align: left; }
.result-card.err { background: var(--risk-soft); border-color: #f2c2bb; color: var(--risk); text-align: left; }
.result-card .rc-ico { font-size: 52px; line-height: 1; }
.result-card h2 { margin: 10px 0 4px; font-size: 26px; color: inherit; }
.result-card p { margin: 4px 0; color: var(--ink); }
.result-card .thumb { width: 120px; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; float: right; margin: 0 0 8px 12px; }
.result-card.wait .row { justify-content: center; }
.result-card.wait .row > * { flex: none; }
.counter { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 6px; font-size: 16px; color: var(--muted); }
.recent-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.recent-row b { min-width: 64px; }
.recent-row .grow { flex: 1; color: var(--muted); }

/* ======================= SESTRA ======================= */
.summary-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.group-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 750; margin: 22px 0 8px; }
.group-title.risk { color: var(--risk); }
.group-title.low { color: var(--low); }
.group-title.ok { color: var(--ok); }
.group-title.none { color: var(--muted); }
.group-title .count { font-weight: 600; color: var(--muted); font-size: 16px; }
.pt { display: grid; grid-template-columns: minmax(130px, 1.1fr) minmax(0, 2fr) auto; align-items: center; gap: 14px; padding: 14px 16px;
  min-height: 76px; border: 1px solid var(--line); border-left: 6px solid var(--line-strong); border-radius: 14px; background: var(--card);
  margin: 10px 0; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.pt.risk { border-left-color: var(--risk); background: linear-gradient(90deg, var(--risk-soft), #fff 45%); }
.pt.low { border-left-color: var(--low); }
.pt.ok { border-left-color: var(--ok); }
.pt .code { font-size: 21px; font-weight: 800; }
.pt .sub { font-size: 15px; color: var(--muted); }
.pt .nums { display: flex; gap: 8px 20px; flex-wrap: wrap; align-items: flex-end; }
.pt .nums .spark-wrap { margin-left: auto; }
.pt .n b { font-size: 24px; font-weight: 800; }
.pt .n span { display: block; font-size: 14px; color: var(--muted); }
.pt .why { grid-column: 1 / -1; font-size: 16px; font-weight: 650; }
.pt.risk .why { color: var(--risk); }
.pt.low .why { color: var(--low); }
.pt .go { font-size: 26px; color: var(--muted); }
.spark { display: inline-flex; align-items: flex-end; gap: 3px; height: 34px; }
.spark i { display: block; width: 12px; border-radius: 3px 3px 0 0; background: var(--ok); min-height: 3px; }
.spark i.low { background: var(--low); }
.spark i.none { background: var(--track); }
.spark-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) {
  .pt { grid-template-columns: 1fr auto; }
  .pt .nums { grid-column: 1 / -1; order: 3; }
  .pt .go { display: none; }
}
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi { padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.kpi .lbl { font-size: 16px; font-weight: 650; color: var(--muted); }
.kpi .of { font-size: 16px; color: var(--muted); }
.kpi.low { border-color: #f0cf9f; background: var(--low-soft); }
.kpi.low .huge { color: var(--low); }
.meal { padding: 16px; }
@media (min-width: 900px) {
  .meal { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: 24px; align-items: start; }
  .meal > .meal-head { grid-column: 1 / -1; }
  .meal > .photos { grid-column: 1; grid-row: 2 / span 30; margin-top: 4px; }
  .meal > :not(.meal-head):not(.photos) { grid-column: 2; }
  .comp.check { margin: 0; padding: 12px; border-radius: 12px; }
}
.meal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.meal-head .t { font-size: 19px; font-weight: 750; }
.meal-head .s { font-size: 15px; color: var(--muted); }
.comp { padding: 12px 0; border-top: 1px solid var(--line); }
.comp:first-of-type { border-top: 0; }
.comp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.comp-name { font-weight: 700; font-size: 18px; }
.comp-name small { font-weight: 500; color: var(--muted); font-size: 14px; margin-left: 6px; }
.comp-val { font-weight: 800; font-size: 20px; white-space: nowrap; }
.comp-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 6px; font-size: 14px; color: var(--muted); }
.comp.check { background: linear-gradient(90deg, var(--check-soft), transparent); margin: 0 -16px; padding: 12px 16px; border-radius: 0; }
.quarters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.quarters button { min-height: var(--tap); padding: 0; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--card);
  font-size: 19px; font-weight: 750; color: var(--ink); touch-action: manipulation; }
.quarters button small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.quarters button.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.quarters button.on small { color: #d7efed; }
.quarters-label { font-size: 14px; color: var(--muted); margin-top: 8px; }
.meal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.meal-actions .btn { flex: 1 1 180px; }
.panel { border: 2px solid var(--ink); }
.assign-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.assign-list span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--bg);
  border: 1px solid var(--line); font-weight: 650; }
.assign-list button { min-height: 40px; min-width: 40px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fff; }
.field-err { color: var(--risk); font-weight: 650; font-size: 16px; margin-top: 6px; }

/* ======================= KUCHYNĚ ======================= */
.insights { display: grid; gap: 10px; margin: 8px 0 4px; }
.insight { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--card);
  border: 1px solid var(--line); font-size: 18px; box-shadow: var(--shadow); }
.insight .ico { font-size: 24px; line-height: 1.2; }
.insight b { font-weight: 750; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hbar .lbl { font-weight: 650; }
.hbar .lbl small { display: block; font-weight: 500; color: var(--muted); font-size: 14px; }
.hbar .v { text-align: right; font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.hbar .bar { grid-column: 1 / -1; margin-top: 0; }

/* ======================= VÁŽENÍ A PŘESNOST (beze změny logiky) ======================= */
.grid-g { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.grid-g label { margin: 8px 0 4px; }
.savebar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.savebar .btn { min-width: 160px; min-height: 60px; font-size: 18px; }
.pos { color: var(--low); font-weight: 650; }
.neg { color: var(--brand); font-weight: 650; }
td.best { background: var(--brand-soft); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 10px; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.tile .big { font-size: 22px; }
.best-card { border-color: var(--brand); border-width: 2px; }

@media (max-width: 560px) {
  .mode { padding: 10px; gap: 8px; min-height: 68px; }
  .mode .mi { font-size: 24px; width: 28px; }
  .mode b { font-size: 18px; }
  .mode-head { padding: 10px 14px; }
  .mode-head p { font-size: 16px; }
  .statusline .detail { flex-basis: 100%; padding-left: 19px; }
  main { padding: 12px 16px 32px; }
  .filters { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .filters button { grid-column: 1 / -1; }
  th, td { padding: 8px 5px; }
  .huge { font-size: 34px; }
  .stats { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .comp.check { margin: 0 -14px; padding: 12px 14px; }
}
select { padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }

/* ---------- vzorové podnosy (Kuchyně) ---------- */
.vzor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 12px; }
.vzor { border: 2px dashed var(--line-strong); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.vzor.ok { border-style: solid; border-color: #9fd3b2; }
.vzor img, .vzor-empty { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; background: var(--track); }
.vzor-empty { display: flex; align-items: center; justify-content: center; font-size: 34px; }
.vzor-t { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.vzor-m { min-height: 2.6em; }
.chip small, .btn small { font-weight: 400; opacity: .75; }
.vzor-form { border: 2px solid var(--accent-soft); border-radius: 14px; padding: 10px 12px; margin: 4px 0 10px; }

/* ---------- modální okno zespodu (rozhodnutí bez scrollování) ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(16, 32, 42, .45); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.sheet { background: var(--card); color: var(--ink); width: min(560px, 100%); max-height: calc(100dvh - 24px); overflow: auto; border-radius: 20px;
  padding: 18px 16px; box-shadow: 0 8px 32px rgba(16, 32, 42, .25); overscroll-behavior: contain; }
.sheet.wide { width: min(820px, 100%); }
.sheet h2 { margin: 0 0 6px; font-size: 22px; }
.sheet p { margin: 4px 0 10px; }
.sheet .thumb { width: 96px; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; float: right; margin: 0 0 8px 12px; }
.sheet .btns { clear: both; }
.sheet .pick { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
body.sheet-open { overflow: hidden; }
@media (min-width: 700px), (orientation: landscape) { .sheet-bg { align-items: center; } }
@media (orientation: landscape) and (max-height: 560px) {
  .sheet { padding: 12px 14px; }
  .sheet .thumb { width: 72px; }
  .sheet h2 { font-size: 19px; }
}
/* ---------- mobil: kompaktní hlavička a volby jedním řádkem ---------- */
.opts-sum { display: flex; align-items: flex-start; gap: 12px; }
.opts-sum .t { flex: 1; min-width: 0; }
.opts-sum .s { margin-top: 2px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }  /* co je na podnosu: až 3 řádky */
.diet-seg { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.diet-seg span { margin-right: 4px; }
.diet-seg button { min-width: 48px; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line-strong);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 700; font-size: 18px; cursor: pointer; }
.diet-seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 720px) {
  header.app { position: static; }
  .app-bar { padding-bottom: 4px; }
  .roles a { min-height: 42px; }
  .statusline { flex-wrap: nowrap; font-size: 14px; padding-bottom: 6px; }
  .statusline > span:nth-of-type(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
  .statusline .detail { display: none; }
  .statusline .authtag .long { display: none; }
  .modes { margin-bottom: 10px; }
  .mode { min-height: 60px; }
  .mode small { display: none; }
  .mode-head { padding: 8px 12px; }
  .mode-head p { font-size: 15px; }
  #optsShort { padding: 10px 12px; }
  .shoot { min-height: 72px; }
}
.statusline .authtag { margin-left: auto; flex: none; border: 1px dashed var(--line-strong); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.check-list label { display: flex; gap: 8px; align-items: center; border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; margin: 0; font-weight: 600; }
.check-list label.on { border-color: var(--brand); background: var(--brand-soft); }
.check-list input { width: 22px; height: 22px; flex: none; }
.check-list small { display: block; font-weight: 400; color: var(--muted); }

/* úzký telefon: volby (období, jídlo, dieta) o chloupek menší, ať se vejdou na jeden řádek; dotyk dál ≥ 46 px */
@media (max-width: 480px) {
  .chips { gap: 6px; }
  .chip { min-height: 46px; min-width: 48px; padding: 0 12px; font-size: 17px; border-radius: 12px; }
}

/* podtitulek stránky na telefonu na jeden řádek */
@media (max-width: 480px) {
  .lead { font-size: 15px; }
}

/* Měření na telefonu: bez popisku vpravo, ať jsou Vážení a Přesnost sladěné s ostatními volbami */
@media (max-width: 480px) {
  .subnav .tag { display: none; }
}

/* ---------- review UI na telefonu ---------- */
/* pokyn a poznámka o vzoru z kuchyně pod sebou, ne vedle sebe */
.mode-head { flex-wrap: wrap; row-gap: 0; }
.mode-head > p, .mode-head > .msg { flex: 1 1 100%; }
/* když karta výsledku čeká na rozhodnutí (tmavá fotka, chyba odeslání, výběr podnosu), lišta focení se nepřilepuje
   ke spodku obrazovky a nezakrývá tlačítka karty */
body.view-dark .shootbar, body.view-neterr .shootbar, body.view-noqr .shootbar { position: static; }
/* po uložení zůstává „Vyfotit další podnos“ po ruce, karta je proto na telefonu nižší (✓ v nadpisu, bez nápovědy pod lištou) */
body.view-done .hint { display: none; }
@media (max-width: 720px) {
  .result-card.done { padding: 12px 14px; }
  .result-card.done .rc-ico { display: none; }
  .result-card.done h2 { margin-top: 0; font-size: 22px; }
  .result-card.done h2::before { content: "✓ "; }
  .result-card.done .btns { margin-top: 8px; }
}
/* telefon na ležato: lišta by zakryla přepínač Před/Po i pokyny */
@media (orientation: landscape) and (max-height: 560px) { .shootbar { position: static; } }
/* kód pacienta nebo podnosu se nezalamuje v pomlčce */
.nowrap { white-space: nowrap; }
@media (max-width: 480px) {
  input[type=date] { font-size: 15px; padding-left: 8px; padding-right: 4px; }   /* celé datum se vejde do pole */
  .list-item { flex-wrap: wrap; row-gap: 6px; }                                   /* stav podnosu pod text, ne přes okraj karty */
  .filters.f3 { grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important; }  /* Přesnost: Od a Do vedle sebe, Sada nad nimi */
  .filters.f3 > label:first-child { grid-column: 1 / -1; }
}
