/* Tubias – styly. Mobile-first; od 900 px rozložení pro počítač. Světlý i tmavý režim podle systému. */
:root {
  --bg: #f4f6f5; --surface: #ffffff; --surface-2: #f0f3f2; --line: #dde3e1; --text: #17211f; --muted: #5d6b68;
  --accent: #0f766e; --accent-ink: #ffffff; --accent-soft: #d9f0ec;
  --ok: #15803d; --ok-bg: #dcfce7; --warn: #b45309; --warn-bg: #fef3c7; --bad: #b91c1c; --bad-bg: #fee2e2;
  --radius: 14px; --shadow: 0 1px 2px rgba(16, 24, 23, .06), 0 4px 14px rgba(16, 24, 23, .05);
  --nav-h: 62px; --top-h: 54px; --chart: #0d9488;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1514; --surface: #182120; --surface-2: #1f2b29; --line: #2c3a38; --text: #e7efed; --muted: #9aaba7;
    --accent: #2dd4bf; --accent-ink: #06201d; --accent-soft: #12332f;
    --ok: #4ade80; --ok-bg: #12301d; --warn: #fbbf24; --warn-bg: #3a2c0b; --bad: #f87171; --bad-bg: #3b1616;
    --shadow: none; --chart: #11a598;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); min-height: 100dvh; display: flex; flex-direction: column; }
h1 { font-size: 1.45rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .2rem; }
p { margin: 0 0 .7rem; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.sub { color: var(--muted); margin: .15rem 0 0; font-size: .9rem; }
.hint { color: var(--muted); font-size: .85rem; } small.hint { display: block; margin-top: .25rem; }
.error { color: var(--bad); font-size: .9rem; min-height: 0; margin: .3rem 0; } .error:empty { display: none; }
.spacer { flex: 1; }

/* ---- horní lišta a navigace ---- */
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line); }  /* pozor: backdrop-filter by rozbil position:fixed u spodní navigace */
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); text-decoration: none; }
.sync { appearance: none; font: inherit; background: var(--surface); cursor: pointer; margin-left: auto; font-size: .82rem; color: var(--muted); padding: 6px 10px; min-height: 36px; border: 1px solid var(--line); border-radius: 99px;
  max-width: 54vw; overflow: hidden; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.sync:hover, .sync[aria-expanded=true] { border-color: var(--accent); background: var(--surface-2); } .sync:empty { display: none; } .chip-caret { font-size: .7rem; opacity: .7; }
.pop-menu { position: fixed; z-index: 40; top: calc(var(--top-h) + 4px); right: 8px; width: min(300px, calc(100vw - 16px)); max-height: calc(100dvh - var(--top-h) - 16px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .22); padding: 6px; }
.pm-head { display: flex; flex-direction: column; padding: 8px 10px 10px; min-width: 0; } .pm-head > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-group { border-top: 1px solid var(--line); padding: 6px 0; } .pm-group:last-child { padding-bottom: 0; } .pm-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 4px 10px; }
.pm-item { appearance: none; border: 0; background: none; color: var(--text); font: inherit; width: 100%; min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; text-align: left; }
.pm-item:hover, .pm-item:focus-visible { background: var(--surface-2); } .pm-item.danger { color: var(--bad); font-weight: 600; } .pm-ico { width: 1.4em; text-align: center; flex: none; } .pm-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-item[aria-checked=true] { font-weight: 600; } .pm-item[aria-checked=true] .pm-ico { color: var(--accent); }
.sync.ok { color: var(--ok); } .sync.warn { color: var(--warn); }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .7rem; min-width: 0; }
.nav a .nav-ico { font-size: 1.25rem; line-height: 1; filter: grayscale(1); opacity: .75; }
.nav a.on { color: var(--accent); font-weight: 600; } .nav a.on .nav-ico { filter: none; opacity: 1; }

.view { width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px; flex: 1; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; } .toolbar .btn { padding: 7px 10px; font-size: .86rem; min-height: 36px; }
.footer { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px 16px; font-size: .78rem; color: var(--muted); }
.made-by { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; opacity: .8; }
.made-by:hover { opacity: 1; } .made-by img { display: block; height: 18px; width: auto; } .made-by strong { letter-spacing: .08em; font-size: .75rem; }

/* ---- prvky ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 14px; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 500;
  cursor: pointer; min-height: 40px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: var(--surface-2); } .btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; } .btn.disabled { pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-ghost { color: var(--bad); } .btn.small { padding: 6px 11px; min-height: 36px; font-size: .88rem; } .btn.block { width: 100%; }
.add-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; } .add-row .add-food { flex: 1 1 150px; min-height: 46px; font-weight: 600; font-size: 1rem; box-shadow: var(--shadow); }
.add-row .btn:not(.add-food) { flex: 0 1 auto; min-height: 46px; } .plus { font-size: 1.3rem; line-height: 1; font-weight: 700; }
.icon-btn { appearance: none; border: 0; background: transparent; color: var(--muted); width: 38px; height: 38px; border-radius: 10px; font-size: 1rem; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); } .icon-btn.del:hover { color: var(--bad); } .icon-btn:disabled { opacity: .3; cursor: default; }
.link { appearance: none; border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=date], select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-height: 42px; }
input.num { text-align: right; font-variant-numeric: tabular-nums; }
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field { display: block; margin-bottom: 12px; } .field > span:first-child { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.field.end { display: flex; align-items: flex-end; }
.with-unit { display: flex; align-items: center; gap: 8px; } .unit { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: .92rem; cursor: pointer; } .check input { width: 18px; height: 18px; accent-color: var(--accent); }
.grid2, .grid3 { display: grid; gap: 0 12px; grid-template-columns: 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); }
.row { display: flex; align-items: center; gap: 10px; } .row.between { justify-content: space-between; margin: 4px 0 10px; }
.notice { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; font-size: .95rem; }
.notice.warn { background: var(--warn-bg); color: var(--text); }
.badge { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge.mine { background: var(--accent-soft); color: var(--accent); margin-left: 6px; }
.computed { font-size: .92rem; color: var(--muted); } .computed strong { color: var(--text); }
[data-level=ok] { color: var(--ok); } [data-level=warn] { color: var(--warn); } [data-level=bad] { color: var(--bad); }

/* ---- jídelníček ---- */
.menu-layout { display: flex; flex-direction: column; gap: 0; }
.summary { position: sticky; top: calc(var(--top-h) + 6px); z-index: 10; padding: 9px 12px; }
.summary h2, .summary .m-rest { display: none; }
.meters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.m-top { display: flex; flex-direction: column; font-size: .7rem; line-height: 1.25; } .m-label { color: var(--muted); } .m-label .long { display: none; }
.m-val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .74rem; }
.m-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.m-fill { height: 100%; width: 0; border-radius: 99px; transition: width .25s ease; }
.m-bar[data-level=ok] .m-fill { background: var(--ok); } .m-bar[data-level=warn] .m-fill { background: var(--warn); } .m-bar[data-level=bad] .m-fill { background: var(--bad); }
.m-fill { background: var(--accent); }
.ratio-box { display: flex; align-items: baseline; gap: 8px; margin-top: 7px; } .ratio-box .small { font-size: .74rem; }
.ratio-big { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: auto; order: 3; }

.meal { padding: 0; overflow: hidden; border-left: 4px solid var(--line); }
.meal[data-level=ok] { border-left-color: var(--ok); } .meal[data-level=warn] { border-left-color: var(--warn); } .meal[data-level=bad] { border-left-color: var(--bad); }
.meal[data-level] { color: inherit; }
.meal-head { appearance: none; border: 0; background: transparent; color: inherit; font: inherit; width: 100%; display: flex; align-items: center; gap: 8px; padding: 13px 14px; cursor: pointer; text-align: left; }
.meal-name { font-weight: 700; font-size: 1.05rem; } .meal-pct { font-size: .82rem; white-space: nowrap; }
.head-kcal { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; } .head-ratio { font-weight: 600; font-variant-numeric: tabular-nums; font-size: .9rem; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; }
.dot[data-level=ok] { background: var(--ok); } .dot[data-level=warn] { background: var(--warn); } .dot[data-level=bad] { background: var(--bad); }
.chev { color: var(--muted); transition: transform .2s; } .meal.collapsed .chev { transform: rotate(-90deg); }
.meal-body { padding: 0 14px 14px; } .meal.collapsed .meal-body { display: none; }
input.meal-title { border-color: transparent; background: var(--surface-2); font-weight: 600; margin-bottom: 10px; }

.frow { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.frow-head { display: none; }
.frow-name { appearance: none; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; text-align: left; padding: 6px 0; cursor: pointer; flex: 1 1 0; min-width: 0; order: 1; }
.frow-name:hover { color: var(--accent); }
.frow-grams { order: 2; display: flex; align-items: center; gap: 5px; flex: none; } .frow-grams input { width: 82px; }
.frow .del { order: 3; margin-right: -8px; }
.frow-grams { flex-wrap: wrap; justify-content: flex-end; max-width: 150px; }
.port { flex: 0 0 100%; text-align: right; font-size: .78rem; color: var(--accent); font-weight: 600; } .port:empty { display: none; }
.frow-vals { order: 5; flex: 0 0 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; }
.frow .lbl { font-size: .7rem; color: var(--muted); } .frow .v { font-size: .8rem; margin-right: 7px; }
.frow-vals:has(.v:empty) { display: none; }
.target-line { display: none; font-size: .85rem; margin: 2px 0 0; }
.meal-body.is-empty .target-line { display: block; } .meal-body.is-empty .table-wrap, .meal-body.is-empty .meal-actions, .meal-body.is-empty .meal-meta { display: none; }
.meal-body.is-empty .add-row { margin-bottom: 4px; }
.frow.missing .frow-name { color: var(--warn); }
.table-wrap { overflow-x: auto; margin: 0 -2px; }
table.totals { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
table.totals { font-size: .82rem; } table.totals th, table.totals td { padding: 6px 4px; text-align: right; white-space: nowrap; } table.totals th:first-child { text-align: left; color: var(--muted); font-weight: 500; }
table.totals thead th { font-size: .74rem; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); }
table.totals tr.sum td, table.totals tr.sum th { font-weight: 700; color: var(--text); } table.totals tr.target td { color: var(--muted); }
table.totals tr.diff td { font-weight: 600; } table.totals td[data-level=ok] { background: var(--ok-bg); } table.totals td[data-level=warn] { background: var(--warn-bg); } table.totals td[data-level=bad] { background: var(--bad-bg); }
table.totals tr.diff td:first-of-type { border-radius: 8px 0 0 8px; } table.totals tr.diff td:last-child { border-radius: 0 8px 8px 0; }
.meal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.meal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.stepper { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 0 4px 0 10px; font-size: .88rem; }
.stepper .icon-btn { width: 32px; height: 34px; } .step-val { min-width: 1.4em; text-align: center; font-weight: 700; }

/* ---- seznamy ---- */
input.search { margin-bottom: 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; scrollbar-width: thin; }
.chip { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: .85rem; white-space: nowrap; cursor: pointer; flex: none; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.food-list { display: flex; flex-direction: column; }
.food-item { appearance: none; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; display: flex; align-items: center; gap: 10px; padding: 10px 4px; cursor: pointer; width: 100%; }
.food-item:hover { background: var(--surface-2); } .fi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fi-name { font-weight: 600; } .fi-meta { font-size: .78rem; color: var(--muted); }
.page-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 12px; }
.list-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 4px 4px; }
.choose-list { display: flex; flex-direction: column; gap: 6px; }
.choose-item { appearance: none; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; text-align: left; border-radius: 12px; padding: 11px 13px; cursor: pointer; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.choose-item:hover { border-color: var(--accent); } .ci-label { font-weight: 600; } .ci-hint { font-size: .8rem; color: var(--muted); }
.lib-item { display: flex; align-items: center; gap: 2px; }
.cards { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 8px; } .cards .card { margin: 0; }
.group-title { margin: 18px 0 8px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.as-button { appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer; } .as-button:hover { border-color: var(--accent); }
.ingredients { list-style: none; margin: 8px 0 0; padding: 0; font-size: .9rem; } .ingredients li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.empty { text-align: center; padding: 28px 14px; color: var(--muted); }
h2.step { margin-top: 16px; font-size: .95rem; color: var(--accent); }
.meal-def { display: grid; grid-template-columns: minmax(0, 1fr) 84px 32px 32px 32px; gap: 3px; align-items: center; margin-bottom: 6px; } .meal-def .with-unit { gap: 4px; } .meal-def .icon-btn { width: 32px; } .meal-def input { padding-left: 8px; padding-right: 8px; }
table.log { border-collapse: collapse; font-size: .85rem; width: 100%; } table.log th, table.log td { padding: 5px 6px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.log th { color: var(--muted); font-weight: 500; font-size: .74rem; } table.log input { min-height: 34px; padding: 4px 8px; min-width: 70px; } table.log input[type=text]:not(.num) { min-width: 160px; text-align: left; } table.log input[type=date] { min-width: 140px; }
.or { text-align: center; color: var(--muted); font-size: .82rem; margin: 12px 0 8px; }
.solve-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); cursor: pointer; } .solve-row input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.sr-name { flex: 1; min-width: 0; } .sr-g { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; font-size: .9rem; } .sr-g.changed strong { color: var(--accent); }
.solve-list { margin-bottom: 12px; }

/* ---- dialogy ---- */
dialog.dlg { border: 0; padding: 0; background: var(--surface); color: var(--text); border-radius: 18px 18px 0 0; width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; box-shadow: 0 -8px 40px rgba(0, 0, 0, .25); }
dialog.dlg[open] { display: flex; flex-direction: column; } dialog.dlg.sheet { height: 92dvh; }
dialog.dlg::backdrop { background: rgba(10, 16, 15, .5); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 10px 8px 18px; } .dlg-head h2 { margin: 0; font-size: 1.1rem; }
.dlg-body { padding: 4px 18px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; flex: 1; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; } .dlg-actions.wrap { flex-wrap: wrap; }
.dlg-actions.sticky { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); background: var(--surface); padding: 10px 0 calc(14px + env(safe-area-inset-bottom)); margin-top: 0; border-top: 1px solid var(--line); }
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { pointer-events: auto; background: #1d2927; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: .92rem; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); display: flex; align-items: center; gap: 14px; animation: toast-in .2s ease; max-width: 100%; }
.toast.error { background: #7f1d1d; } .toast.out { opacity: 0; transition: opacity .3s; }
.toast-action { appearance: none; border: 0; background: none; color: #5eead4; font: inherit; font-weight: 700; cursor: pointer; padding: 2px 4px; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }


/* ---- úvodní stránka, přihlášení ---- */
body.gated .nav, body.gated .sync { display: none; } body.gated { padding-bottom: 0; }
.landing { max-width: 920px; margin: 0 auto; } .landing.narrow { max-width: 520px; }
.hero { text-align: center; padding: 22px 0 18px; } .hero .logo { border-radius: 22%; box-shadow: var(--shadow); } .hero h1 { font-size: 2rem; margin-top: 10px; }
.lead { color: var(--muted); font-size: 1.05rem; margin: 6px auto 0; max-width: 34em; }
.landing-grid { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: start; } .landing-grid .card { margin: 0; }
.features { list-style: none; margin: 0; padding: 0; } .features li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .95rem; } .features li:last-child { border: 0; }
.login-box { display: flex; flex-direction: column; gap: 10px; } .btn.big { min-height: 48px; font-size: 1.02rem; } form.login[hidden] { display: none; }
.spinner { width: 28px; height: 28px; margin: 18px auto 0; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chip-name { max-width: 10em; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; } .sync .badge { margin-left: 6px; }
.prose h2 { margin-top: 1.1rem; } .prose p { font-size: .95rem; }

/* ---- navigace po dnech, kalendář ---- */
.date-nav { padding: 8px 10px; } .date-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.date-title { display: flex; align-items: center; gap: 6px; min-width: 0; } .date-title strong::first-letter, .cap::first-letter { text-transform: uppercase; }
input.date-input { width: auto; min-height: 36px; padding: 5px 8px; font-size: .88rem; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 8px; }
.wd { appearance: none; border: 1px solid transparent; background: var(--surface-2); color: var(--text); border-radius: 10px; padding: 5px 0 6px; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.wd:hover { border-color: var(--accent); } .wd.on { background: var(--accent); color: var(--accent-ink); } .wd.today:not(.on) { border-color: var(--accent); }
.wd-name { font-size: .68rem; opacity: .8; text-transform: uppercase; } .wd-num { font-weight: 700; font-size: .95rem; }
.wd .dot { width: 7px; height: 7px; margin-top: 2px; } .wd .dot[data-filled=false] { background: transparent; } .wd .dot[data-filled=true][data-level=none] { background: var(--muted); } .wd.on .dot[data-filled=true] { box-shadow: 0 0 0 2px var(--accent-ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.cal-wd { text-align: center; font-size: .7rem; color: var(--muted); text-transform: uppercase; padding: 2px 0; }
.cal-day { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; border-radius: 10px; min-height: 62px; padding: 5px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: stretch; gap: 1px; text-align: left; overflow: hidden; }
.cal-day.has { border-left-width: 3px; }
.cal-day:hover { border-color: var(--accent); } .cal-day.other { opacity: .4; } .cal-day.today .cal-num { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 6px; align-self: flex-start; }
.cal-day[data-level=ok] { border-left-color: var(--ok); } .cal-day[data-level=warn] { border-left-color: var(--warn); } .cal-day[data-level=bad] { border-left-color: var(--bad); } .cal-day[data-level] { color: var(--text); }
.cal-num { font-weight: 700; font-size: .85rem; } .cal-info { display: flex; flex-wrap: wrap; gap: 0 5px; font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; } .cal-kcal { color: var(--text); font-weight: 600; }
.cal-eaten { color: var(--ok); } .cal-name { font-size: .66rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: none; }
.legend { font-size: .78rem; color: var(--muted); margin: 10px 0 0; } .legend .dot { display: inline-block; vertical-align: middle; margin-left: 6px; }
.actual { margin: 8px 0 0; font-size: .82rem; color: var(--muted); } .actual:empty { display: none; }
.eaten { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; font-size: .88rem; } .eaten input { width: 52px; min-height: 34px; border: 0; padding: 4px 2px; background: transparent; box-shadow: none !important; }

/* ---- vaření, nákupní seznam, členové, rozcestník ---- */
dialog.dlg.cook .dlg-head h2 { font-size: 1.25rem; }
.cook-list { display: flex; flex-direction: column; gap: 8px; } .cook-left { text-align: center; font-weight: 600; margin: 14px 0 0; }
.cook-row { appearance: none; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; border-radius: 14px; padding: 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left; font-size: 1.2rem; }
.cook-check { width: 28px; height: 28px; border: 2px solid var(--muted); border-radius: 8px; flex: none; display: grid; place-items: center; }
.cook-name { flex: 1; min-width: 0; font-weight: 600; } .cook-g { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cook-row.done { opacity: .45; border-color: var(--ok); } .cook-row.done .cook-check { background: var(--ok); border-color: var(--ok); } .cook-row.done .cook-check::after { content: "✓"; color: #fff; font-weight: 800; } .cook-row.done .cook-name { text-decoration: line-through; }
.shop-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); cursor: pointer; } .shop-row input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.shop-row .sr-g { color: var(--text); font-variant-numeric: tabular-nums; } .shop-row.done { opacity: .45; } .shop-row.done .sr-name { text-decoration: line-through; }
.member { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); } .member select { width: auto; min-height: 36px; padding: 5px 8px; font-size: .88rem; }
.choose-item.on { border-color: var(--accent); background: var(--accent-soft); }
.account-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; } .account-row > div { min-width: 0; overflow-wrap: anywhere; }
.more-item { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); } .more-item:hover { border-color: var(--accent); } .more-ico { font-size: 1.7rem; flex: none; } .more-item span span { display: block; }
.off-btn { margin: -4px 0 12px; } form.row input.search { margin: 0; }
details.help { border-bottom: 1px solid var(--line); } details.help summary { cursor: pointer; padding: 12px 2px; font-weight: 600; } .help-body { padding: 0 2px 8px; }

/* ---- grafy (jedna řada, jeden odstín; text nikdy v barvě dat) ---- */
.c-wrap { position: relative; } .c-wrap svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.c-grid { stroke: var(--line); stroke-width: 1; } .c-axis { fill: var(--muted); font-size: 11px; } .c-label { fill: var(--text); font-size: 12px; font-weight: 700; }
.c-line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; } .c-target { stroke: var(--muted); stroke-width: 1; }
.c-dot { fill: var(--chart); stroke: var(--surface); stroke-width: 2; } .c-dot.on { r: 6; } .c-cross { stroke: var(--muted); stroke-width: 1; }
.c-tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); background: var(--text); color: var(--surface); border-radius: 8px; padding: 5px 9px; font-size: .78rem; pointer-events: none; white-space: nowrap; display: flex; flex-direction: column; align-items: center; z-index: 2; }
.c-tip[hidden] { display: none; } .c-tip strong { font-size: .92rem; } details.c-table { margin-top: 8px; font-size: .85rem; } details.c-table summary { cursor: pointer; color: var(--muted); }

/* ---- od tabletu ---- */
@media (min-width: 600px) {
  .grid2 { grid-template-columns: 1fr 1fr; } .cards { grid-template-columns: repeat(2, 1fr); }
  .chips { flex-wrap: wrap; overflow: visible; padding-bottom: 4px; }   /* na širší obrazovce žádné posouvání do strany */
  .landing-grid { grid-template-columns: 1.15fr 1fr; } .cal-day { min-height: 78px; padding: 7px; } .cal-name { display: block; } .cal-info { font-size: .74rem; }
  dialog.dlg { width: 560px; border-radius: 18px; margin: auto; max-height: 86dvh; } dialog.dlg.wide { width: 720px; } dialog.dlg.sheet { height: 80dvh; }
}
/* ---- počítač ---- */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .nav { position: static; height: auto; background: none; border: 0; padding: 0; gap: 2px; margin-left: 18px; }
  .nav a { flex: none; flex-direction: row; gap: 6px; font-size: .92rem; padding: 8px 12px; border-radius: 10px; } .nav a .nav-ico { font-size: 1rem; }
  .nav a.on { background: var(--accent-soft); }
  .toasts { bottom: 24px; }
  .page-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; } .page-list > p { grid-column: 1 / -1; }
  .view { padding: 24px; } .cards { grid-template-columns: repeat(3, 1fr); } .toolbar .btn { padding: 9px 14px; font-size: 1rem; min-height: 40px; }
  .menu-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
  .summary { order: 2; top: calc(var(--top-h) + 18px); display: block; padding: 16px; }
  .summary h2, .summary .m-rest { display: block; } .m-label .long { display: inline; } .m-label .short { display: none; } .meters { grid-template-columns: 1fr; gap: 14px; }
  .m-top { flex-direction: row; justify-content: space-between; font-size: .85rem; } .m-val { font-size: .88rem; } .m-bar { height: 8px; } .m-rest { font-size: .76rem; color: var(--muted); }
  .ratio-box { display: block; text-align: left; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); } .ratio-box .small { font-size: .8rem; } .ratio-big { font-size: 1.7rem; }
  .frow, .frow-head { display: grid; grid-template-columns: minmax(160px, 1fr) 170px repeat(5, 62px) 38px; gap: 0 8px; padding: 4px 0; }
  .frows.semi .frow { grid-template-columns: minmax(160px, 1fr) 130px 80px repeat(3, 62px) 38px; }
  .frow-head { font-size: .74rem; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
  .frow > * { order: 0 !important; } .frow-vals { display: contents !important; } .frow .lbl { display: none; } .frow .v { text-align: right; font-size: .9rem; margin: 0; }
  table.totals { font-size: .88rem; } table.totals th, table.totals td { padding: 6px 8px; }
  .ratio-big { margin: 0; order: 0; } .add-row .add-food { flex: 0 1 340px; }
  .frow-grams { margin: 0; flex: none; } .frow-grams input { width: 84px; min-height: 36px; padding: 6px 9px; } .frow-name { padding: 8px 0; }
  .frow-grams { flex-wrap: nowrap; justify-content: flex-start; max-width: none; } .port { flex: none; font-size: .74rem; white-space: nowrap; }
}

/* ---- tisk / PDF (A4) ---- */
#print-root { display: none; }
@page { size: A4; margin: 14mm 13mm; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  body { background: #fff; color: #000; padding: 0; display: block; font-size: 10.5pt; min-height: 0; }
  #print-root { display: block; }
  .p-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1.2pt solid #000; padding-bottom: 5pt; margin-bottom: 8pt; }
  #print-root h1 { font-size: 15pt; margin: 0; } #print-root h1::first-letter { text-transform: uppercase; } .p-sub { color: #333; margin: 2pt 0 0; font-size: 10pt; } .p-brand { font-weight: 700; letter-spacing: .06em; color: #555; font-size: 10pt; }
  .p-meal { break-inside: avoid; margin-bottom: 9pt; } #print-root h2 { font-size: 11.5pt; margin: 0 0 3pt; }
  #print-root table { width: 100%; border-collapse: collapse; } #print-root th, #print-root td { border-bottom: .5pt solid #999; padding: 2.5pt 4pt; text-align: left; }
  #print-root .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; } #print-root th { font-size: 8.5pt; color: #444; font-weight: 600; } #print-root .p-sum td { font-weight: 700; border-bottom-color: #000; }
  #print-root .box { width: 22pt; font-size: 13pt; } .print-cook td { padding-top: 5pt !important; padding-bottom: 5pt !important; font-size: 12pt; } .p-group td { font-weight: 700; background: #eee; font-size: 9.5pt; }
  .p-foot { margin-top: 12pt; font-size: 8pt; color: #666; }
}
