@import url("/static/fonts/fonts.css");

:root {
  --bg: #F5EFE4;
  --card: #FFFCF6;
  --ink: #2B2320;
  --ink2: #4A3F38;
  --muted: #6B5E55;
  --faded: #8C7F75;
  --line: #E4D9C8;
  --line2: #EFE6D6;
  --bd: #D9CCB8;
  --dash: #C9B89F;
  --accent: #B8431F;
  --accent-d: #8F3215;
  --kid-bg: #E3EDDF; --kid-fg: #2F5238; --kid-bd: #9DB897;
  --ad-bg: #F6E0D4;  --ad-fg: #8A3217;
  --tag-bg: #EFE6D6;
  --green: #2F5238; --green2: #3E6547;
  --c-protein: #2E6E9E; --c-carbs: #D08A1E; --c-fat: #B8431F;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: Figtree, "Segoe UI", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans); background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-d); }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--ink); }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
img { display: block; max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* šrafovaný zástupce fotky z návrhu */
.ph { background-color: #E9DCC8; background-image: repeating-linear-gradient(135deg, rgba(43,35,32,.06) 0 8px, transparent 8px 16px); }
.ph2 { background-color: #DCE6D6; background-image: repeating-linear-gradient(45deg, rgba(47,82,56,.07) 0 8px, transparent 8px 16px); }
.cover { object-fit: cover; width: 100%; height: 100%; }

/* --- rozvržení ----------------------------------------------------------------------- */
#app { min-height: 100%; display: flex; }
#view { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
.side { display: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(76px + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line); background: var(--card);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.tabbar .plus {
  width: 30px; height: 30px; border-radius: 15px; background: var(--accent); color: var(--card);
  display: flex; align-items: center; justify-content: center;
}
body.no-tabs .tabbar { display: none; }
body:not(.no-tabs) #view { padding-bottom: calc(76px + var(--safe-b)); }

.page-head { padding: 28px 20px 12px; display: flex; flex-direction: column; gap: 14px; }
.page-body { flex: 1; padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.h-serif { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1; }
.sub { font-size: 14px; color: var(--muted); }
.eyebrow { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; }
.spread { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card { background: var(--card); border-radius: 16px; }

/* sticky akce dole (Uložit, Nákupní seznam…) */
.bottom-bar {
  position: sticky; bottom: 0; z-index: 5; padding: 12px 20px calc(16px + var(--safe-b));
  background: var(--bg); border-top: 1px solid var(--line);
}
body:not(.no-tabs) .bottom-bar { bottom: calc(76px + var(--safe-b)); padding-bottom: 12px; }

/* --- tlačítka a čipy ----------------------------------------------------------------- */
.btn {
  height: 52px; border: 0; border-radius: 14px; background: var(--accent); color: var(--card);
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  font-size: 16px; font-weight: 700;
}
.btn:hover { background: var(--accent-d); color: var(--card); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.dark { background: var(--ink); }
.btn.green { background: var(--green); }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--bd); }
.btn.small { height: 44px; font-size: 14px; border-radius: 12px; }
.btn.danger { background: transparent; color: #9B2C12; border: 1px solid #E2B8A8; }
.pill {
  height: 40px; padding: 0 14px; border: 0; border-radius: 20px; background: var(--ink); color: var(--card);
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 22px; background: var(--bg);
  color: var(--ink2); display: flex; align-items: center; justify-content: center;
}
.round {
  width: 44px; height: 44px; border: 0; border-radius: 22px; background: rgba(255,252,246,.94);
  display: flex; align-items: center; justify-content: center; color: var(--ink);
}
.link-btn { border: 0; background: none; padding: 6px 0; font-size: 13px; font-weight: 600; color: var(--accent); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 0 20px 2px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--bd);
  background: var(--card); color: var(--ink); font-size: 14px; font-weight: 600;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.seg { display: flex; padding: 3px; gap: 2px; border-radius: 20px; background: var(--line2); }
.seg button { height: 34px; padding: 0 12px; border: 0; border-radius: 17px; background: transparent; font-size: 13px; font-weight: 700; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.toggle {
  height: 40px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--bd); background: var(--card);
  font-size: 13px; font-weight: 700;
}
.toggle[aria-pressed="true"] { background: var(--kid-bg); color: var(--kid-fg); border-color: var(--kid-bd); }

.tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 8px; background: var(--tag-bg); color: var(--ink2); white-space: nowrap; }
.tag.kid { background: var(--kid-bg); color: var(--kid-fg); }
.tag.ad { background: var(--ad-bg); color: var(--ad-fg); }
.tag.lg { font-size: 12px; padding: 3px 9px; border-radius: 9px; }
.time { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink2); }
.input, .textarea {
  width: 100%; min-width: 0; height: 48px; padding: 0 12px; border: 1px solid var(--bd); border-radius: 12px;
  background: var(--card); font-size: 15px; font-weight: 400;
}
.textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.hint { font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.4; }
.note-box { margin: 0; padding: 12px 14px; background: var(--line2); border-radius: 12px; font-size: 14px; line-height: 1.45; color: var(--ink2); }
.note-box.warn { background: #F8E7C8; color: #6B4A12; }
.note-box.err { background: #F6DCD3; color: #7A2A14; }

/* --- přihlášení ---------------------------------------------------------------------- */
.login { min-height: 100dvh; width: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand b { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 22px; line-height: 1; }
.brand span { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--accent); }
.login .brand b, .login .brand span { font-size: 40px; }

/* --- recepty ------------------------------------------------------------------------- */
.search {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px;
  background: var(--card); border: 1px solid var(--bd); border-radius: 14px;
}
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; outline: none; }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rcard { display: flex; flex-direction: column; background: var(--card); border-radius: 16px; overflow: hidden; color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.rcard:hover { color: var(--ink); box-shadow: 0 2px 10px rgba(43,35,32,.08); }
.rcard .pic { height: 124px; position: relative; display: flex; align-items: flex-end; padding: 8px; }
.rcard .pic img { position: absolute; inset: 0; }
.rcard .src { position: relative; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px; background: rgba(255,252,246,.92); color: var(--ink); }
.rcard .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.rcard .t { font-size: 15px; font-weight: 600; line-height: 1.25; text-wrap: pretty; }
.empty { margin: 24px 0; text-align: center; color: var(--muted); line-height: 1.5; }

/* --- detail receptu ------------------------------------------------------------------ */
.hero { height: 300px; position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 16px 12px; overflow: hidden; }
.hero > img { position: absolute; inset: 0; }
.hero .top, .hero .bottom { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hero .bottom { justify-content: center; flex-direction: column; gap: 10px; }
.hero .cap { font-size: 12px; font-weight: 600; color: var(--ink2); padding: 3px 10px; border-radius: 10px; background: rgba(255,252,246,.9); }
.vswitch { display: flex; padding: 4px; gap: 4px; border-radius: 22px; background: rgba(255,252,246,.94); }
.vswitch button { height: 36px; padding: 0 14px; border: 0; border-radius: 18px; background: transparent; font-size: 13px; font-weight: 700; }
.vswitch button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.r-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.05; }
.h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 24px; }
.ings { margin: 20px 20px 0; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.stepper { display: flex; align-items: center; gap: 4px; border: 1px solid var(--bd); border-radius: 22px; }
.stepper button { width: 44px; height: 40px; border: 0; background: none; font-size: 20px; }
.stepper span { min-width: 64px; text-align: center; font-size: 14px; font-weight: 700; }
.ing { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line2); font-size: 15px; }
.ing .n small { display: block; font-size: 13px; color: var(--muted); }
.ing .a { font-weight: 600; color: var(--ink2); white-space: nowrap; }
.ing-group { margin-top: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nutri { margin: 12px 20px 0; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.nutri .seg button { padding: 0 10px; white-space: nowrap; }
.nutri .h2 { min-width: 0; }
.nutri .kcal { font-size: 15px; color: var(--ink2); }
.nutri .kcal b { font-family: var(--serif); font-weight: 400; font-size: 40px; color: var(--ink); line-height: 1; }
.macros { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.macros div { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; border-radius: 12px; background: var(--bg); min-width: 0; }
.macros b { font-size: 16px; font-weight: 700; }
.macros span { font-size: 12px; color: var(--muted); }
.macros small { font-size: 11px; color: var(--faded); }
.day-kcal { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.recipe-wrap .nutri { margin: 0; }
.steps { padding: 24px 20px 0; display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 14px; }
.step .num { flex-shrink: 0; width: 28px; height: 28px; border-radius: 14px; background: var(--ink); color: var(--card); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.step p { margin: 3px 0 0; font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.cooked { padding: 28px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photos figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.photos figure button { padding: 0; border: 0; height: 96px; border-radius: 10px; overflow: hidden; background: #DCE6D6; }
.photos figcaption { font-size: 12px; color: var(--muted); }
.add-photo {
  height: 96px; border: 1.5px dashed var(--dash); border-radius: 10px; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--ink2); position: relative;
}
.add-photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.saved { font-size: 12px; font-weight: 600; color: var(--green2); }
details.caption { margin: 20px 20px 0; font-size: 14px; color: var(--ink2); }
details.caption summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 6px 0; }
details.caption pre { white-space: pre-wrap; font-family: var(--sans); line-height: 1.5; background: var(--card); padding: 12px; border-radius: 12px; margin: 6px 0 0; }

/* --- import -------------------------------------------------------------------------- */
.back-head { padding: 20px 12px 8px; display: flex; align-items: center; gap: 4px; }
.back-head a, .back-head .back { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ink); border: 0; background: none; }
.back-head h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 30px; }
.preview { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.preview .thumb { width: 72px; height: 72px; border-radius: 10px; flex-shrink: 0; overflow: hidden; }
.preview .title-in {
  width: 100%; border: 0; border-bottom: 1px dashed var(--bd); background: transparent; padding: 2px 0;
  font-family: var(--serif); font-size: 22px;
}
.pick-photos { display: flex; gap: 8px; overflow-x: auto; padding: 2px; }
.pick-photos button { flex-shrink: 0; width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #E9DCC8; }
.pick-photos button[aria-pressed="true"] { border-color: var(--accent); }
.ok-label { font-size: 12px; font-weight: 700; color: var(--green2); }
.loading { padding: 20px; display: flex; align-items: center; gap: 14px; font-size: 15px; color: var(--ink2); }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.snap-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.snap-ico { width: 40px; height: 40px; border-radius: 20px; background: var(--ad-bg); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.snap-thumbs { display: flex; gap: 8px; overflow-x: auto; }
.snap-thumbs figure { position: relative; margin: 0; width: 72px; height: 96px; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: var(--line2); }
.snap-thumbs button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 0; border-radius: 13px; background: rgba(43,35,32,.75); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.pick-photos .none-ph { font-size: 11px; font-weight: 700; color: var(--ink2); background: var(--card); border-color: var(--bd); }
.pick-photos .none-ph[aria-pressed="true"] { border-color: var(--accent); }
.mama-check { gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink2); cursor: pointer; }
.mama-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.spin.sm { width: 18px; height: 18px; border-width: 2px; }
.jobs { display: flex; flex-direction: column; border-top: 1px solid var(--line2); }
.job { display: flex; align-items: center; gap: 10px; min-height: 52px; border-bottom: 1px solid var(--line2); }
.job .ok, .job .bad { width: 18px; text-align: center; font-weight: 700; flex-shrink: 0; }
.job .ok { color: var(--green2); }
.job .bad { color: #9B2C12; }
.job-t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.job-t a { color: var(--ink); }
.job-t span { font-size: 12px; color: var(--muted); }
.job.failed .job-t span { color: #9B2C12; }
.job .x { width: 32px; height: 32px; border: 0; background: none; color: var(--faded); display: flex; align-items: center; justify-content: center; }
.job-banner { gap: 10px; color: var(--ink2); }
.catalog-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; color: var(--ink); }
.catalog-link:hover { color: var(--ink); box-shadow: 0 2px 10px rgba(43,35,32,.08); }
.catalog-link > span { display: flex; flex-direction: column; gap: 4px; }
.cat-list { display: flex; flex-direction: column; background: var(--card); border-radius: 16px; padding: 4px 12px; }
.cat-item { display: flex; align-items: center; gap: 12px; min-height: 68px; border-top: 1px solid var(--line2); }
.cat-item:first-child { border-top: 0; }
.cat-item input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
.cat-check { width: 22px; text-align: center; color: var(--green2); font-weight: 700; flex-shrink: 0; }
.cat-pic { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.cat-t { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink); padding: 8px 0; }
.cat-t b { font-size: 15px; font-weight: 600; line-height: 1.25; }
.cat-t span { font-size: 12px; color: var(--muted); }
.cat-item.done .cat-t b { color: var(--muted); }

/* --- jídelníček ---------------------------------------------------------------------- */
.week-nav { display: flex; align-items: center; gap: 2px; margin-left: -10px; }
.week-nav button { width: 32px; height: 32px; border: 0; background: none; color: var(--muted); display: flex; align-items: center; justify-content: center; border-radius: 16px; }
.day { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.day.today { box-shadow: inset 0 0 0 2px var(--ad-bg); }
.day h2 { margin: 0 0 2px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.meal { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.meal .slot { width: 58px; flex-shrink: 0; font-size: 13px; color: var(--muted); border: 0; background: none; padding: 0; text-align: left; min-height: 44px; }
.meal .what { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink); }
.meal .what b { font-size: 15px; font-weight: 600; line-height: 1.25; }
.meal .what span { font-size: 12px; color: var(--muted); }
.meal .none { flex: 1; font-size: 14px; color: var(--faded); border: 0; background: none; text-align: left; padding: 0; min-height: 44px; }

/* desktop týden */
.week-grid { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.week-grid section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.week-grid h2 { margin: 0; display: flex; flex-direction: column; font-size: 13px; font-weight: 700; color: var(--muted); }
.week-grid h2 span { font-family: var(--serif); font-weight: 400; font-size: 24px; color: var(--ink); }
.mcard { flex: 1; display: flex; flex-direction: column; background: var(--card); border-radius: 14px; overflow: hidden; color: var(--ink); min-height: 170px; }
.mcard .pic { height: 84px; position: relative; }
.mcard .body { padding: 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.mcard .slot-l { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mcard .t { font-size: 14px; font-weight: 600; line-height: 1.25; text-wrap: pretty; }
.mcard .acts { display: flex; gap: 4px; margin-top: auto; padding-top: 6px; }
.mcard .acts button { flex: 1; height: 32px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: var(--bg); font-size: 12px; font-weight: 700; color: var(--ink2); }
.mcard.empty-slot { border: 1.5px dashed var(--dash); background: transparent; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; font-weight: 600; }

/* --- nákup --------------------------------------------------------------------------- */
.share-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) 48px; gap: 8px; }
.share-row .btn { height: 48px; border-radius: 12px; font-size: 15px; }
.share-row .copy { height: 48px; border: 1px solid var(--bd); border-radius: 12px; background: var(--card); display: flex; align-items: center; justify-content: center; }
.sgroup { padding: 10px 14px; display: flex; flex-direction: column; }
.sgroup h2 { margin: 2px 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sitem { display: flex; align-items: center; gap: 12px; min-height: 44px; border-top: 1px solid var(--line2); cursor: pointer; }
.sitem input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: var(--green2); }
.sitem .n { flex: 1; font-size: 15px; }
.sitem .a { font-size: 14px; font-weight: 600; }
.sitem.done .n, .sitem.done .a { color: var(--faded); text-decoration: line-through; }
.sitem .x { width: 36px; height: 36px; border: 0; background: none; color: var(--faded); display: flex; align-items: center; justify-content: center; }
.add-item { height: 48px; padding: 0 12px; border: 1px dashed var(--dash); border-radius: 12px; background: transparent; font-size: 15px; width: 100%; }

/* --- nutriční karta a kalorie -------------------------------------------------------- */
.macro4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.macro4 div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.macro4 b { font-size: 22px; font-weight: 700; }
.macro4 span { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.macro4 i, .legend i, .dot { width: 8px; height: 8px; border-radius: 4px; display: inline-block; flex-shrink: 0; }
.ebar { display: flex; gap: 2px; height: 8px; }
.ebar div:first-child { border-radius: 4px 0 0 4px; }
.ebar div:last-child { border-radius: 0 4px 4px 0; }
.dot { width: 10px; height: 10px; border-radius: 5px; }
.stat-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.stat-card .big { font-family: var(--serif); font-size: 52px; line-height: 1; }
.bar { height: 8px; border-radius: 4px; background: var(--line2); overflow: hidden; }
.bar div { height: 8px; border-radius: 4px; background: var(--accent); }
.log-list { display: flex; flex-direction: column; border-top: 1px solid var(--line2); }
.log-row { display: grid; grid-template-columns: 64px 1fr auto 32px; align-items: center; gap: 8px; min-height: 40px; border-bottom: 1px solid var(--line2); font-size: 14px; }
.log-row a { color: var(--ink); font-weight: 600; }
.log-row .x { width: 32px; height: 32px; border: 0; background: none; color: var(--faded); display: flex; align-items: center; justify-content: center; }
.chart { display: flex; flex-direction: column; gap: 6px; }
.chart-bars { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; border-bottom: 1px solid var(--bd); }
.chart-bars .col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; border: 0; background: none; padding: 0; }
.chart-bars .b { width: 100%; max-width: 30px; border-radius: 4px 4px 0 0; background: var(--accent); min-height: 1px; }
.plan, .chart-bars .b.plan { background-color: #F1D5C8; background-image: repeating-linear-gradient(135deg, rgba(184,67,31,.35) 0 2px, transparent 2px 6px); }
.chart-bars .target { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--muted); pointer-events: none; z-index: 1; }
.chart-bars .target-l { position: absolute; right: 0; font-size: 11px; font-weight: 600; color: var(--ink2); background: var(--card); padding: 0 2px; z-index: 1; }
.chart-bars .tip { position: absolute; z-index: 2; white-space: nowrap; padding: 4px 8px; border-radius: 8px; background: var(--ink); color: var(--card); font-size: 12px; font-weight: 600; }
.chart-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.chart-days span { text-align: center; font-size: 12px; font-weight: 500; color: var(--ink2); }
.chart-days .now { font-weight: 700; color: var(--ink); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink2); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); }
.legend i.plan { background-color: #F1D5C8; background-image: repeating-linear-gradient(135deg, rgba(184,67,31,.35) 0 2px, transparent 2px 6px); }
.kcal-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.kcal-table th { font-size: 12px; color: var(--muted); padding: 6px 0; text-align: right; }
.kcal-table th:first-child, .kcal-table td:first-child { text-align: left; }
.kcal-table td { padding: 8px 0; border-top: 1px solid var(--line2); text-align: right; }
.kcal-table td:nth-child(2) { font-weight: 600; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.two .card { padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.two span { font-size: 12px; color: var(--muted); }
.two b { font-size: 24px; font-weight: 700; }
.top-row { display: flex; justify-content: space-between; gap: 12px; min-height: 44px; align-items: center; border-top: 1px solid var(--line2); color: var(--ink); font-size: 15px; }
.top-row:hover { color: var(--ink); }
.who { display: flex; flex-direction: column; gap: 8px; }
.who-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; }
.who-row .stepper span { min-width: 84px; font-size: 13px; }
.picked { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.picked > span { display: flex; flex-direction: column; gap: 2px; }
.goal { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px 10px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 0; }
.goal legend { font-weight: 700; font-size: 14px; padding: 0 4px; }
.goal label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 600; }
.goal .input { height: 38px; padding: 0 6px; font-size: 14px; }

/* --- dialogy ------------------------------------------------------------------------- */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(43,35,32,.4); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 520px; max-height: 88dvh; overflow-y: auto; background: var(--bg);
  border-radius: 20px 20px 0 0; padding: 20px 20px calc(20px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px;
}
.sheet h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 28px; }
.pick-list { display: flex; flex-direction: column; }
.pick-list button { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-size: 15px; font-weight: 600; padding: 4px 0; }
.pick-list button span { font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.days7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.days7 button { height: 56px; border: 1px solid var(--bd); border-radius: 12px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); padding: 0; }
.days7 button b { font-size: 15px; color: var(--ink); }
.days7 button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }
.days7 button[aria-pressed="true"], .days7 button[aria-pressed="true"] b { color: var(--card); }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(20,16,14,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 20px; }
.lightbox img { max-height: 78dvh; border-radius: 12px; }
.lightbox .row button { height: 44px; padding: 0 16px; border-radius: 12px; border: 0; font-weight: 700; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--safe-b)); z-index: 70;
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--card);
  font-size: 14px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.2);
}
.toast a { color: #F3B9A2; margin-left: 8px; }

/* --- desktop ------------------------------------------------------------------------- */
@media (min-width: 1000px) {
  .tabbar { display: none; }
  body:not(.no-tabs) #view { padding-bottom: 0; }
  body:not(.no-tabs) .bottom-bar { bottom: 0; padding-bottom: 16px; }
  .side {
    display: flex; position: sticky; top: 0; height: 100dvh; width: 232px; flex-shrink: 0;
    padding: 32px 20px; flex-direction: column; gap: 28px; background: var(--card); border-right: 1px solid var(--line);
  }
  .side .brand { flex-direction: column; gap: 0; }
  .side .brand b { font-family: var(--serif); font-style: normal; font-weight: 400; font-size: 34px; }
  .side .brand span { font-size: 20px; }
  .side nav { display: flex; flex-direction: column; gap: 4px; }
  .side nav a { height: 44px; padding: 0 12px; border-radius: 10px; display: flex; align-items: center; gap: 10px; color: var(--ink2); font-size: 15px; font-weight: 600; }
  .side nav a[aria-current="page"] { background: var(--ad-bg); color: var(--ad-fg); font-weight: 700; }
  .side nav a:hover { background: var(--bg); }
  .side .btn { margin-top: auto; height: 48px; border-radius: 12px; font-size: 15px; }
  .page-head { padding: 32px 32px 12px; }
  .page-body { padding: 4px 32px 32px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
  .rcard .pic { height: 150px; }
  .narrow { width: 100%; max-width: 720px; margin: 0 auto; }
  .recipe-wrap { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 8px 32px; max-width: 1180px; padding: 32px; align-items: start; }
  .recipe-wrap .hero { border-radius: 20px; height: 340px; }
  .recipe-wrap .ings { margin: 0; }
  .recipe-wrap .steps, .recipe-wrap .cooked { padding-left: 0; padding-right: 0; }
  .recipe-wrap .r-head { padding: 0 !important; }
  .recipe-wrap .col-l { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 32px; }
  .recipe-wrap .bottom-bar { position: static; padding: 24px 0 0; border: 0; background: none; }
  .recipe-wrap details.caption { margin: 20px 0 0; }
  .plan-desk { display: flex; flex: 1; min-height: 100dvh; }
  .plan-desk main { flex: 1; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
  .plan-desk aside { width: 280px; flex-shrink: 0; padding: 32px 24px; display: flex; flex-direction: column; gap: 16px; background: var(--card); border-left: 1px solid var(--line); }
  .toast { bottom: 24px; }
  .sheet-bg { align-items: center; }
  .sheet { border-radius: 20px; }
}

/* --- tisk receptu ------------------------------------------------------------------- */
#print-sheet { display: none; }
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  body { background: #fff; }
  body > *:not(#print-sheet) { display: none !important; }
  #print-sheet { display: block; color: #000; font-family: var(--sans); font-size: 11pt; line-height: 1.45; }
  #print-sheet header { display: flex; justify-content: space-between; gap: 8mm; align-items: flex-start;
    border-bottom: 1.5pt solid #B8431F; padding-bottom: 4mm; margin-bottom: 5mm; }
  #print-sheet h1 { font-family: var(--serif); font-weight: 400; font-size: 28pt; line-height: 1.05; margin: 0 0 2mm; }
  #print-sheet .meta { margin: 0; color: #444; font-size: 10pt; }
  #print-sheet header img { width: 42mm; height: 30mm; object-fit: cover; border-radius: 3mm; flex-shrink: 0; }
  #print-sheet .cols { display: grid; grid-template-columns: 70mm 1fr; gap: 8mm; align-items: start; }
  #print-sheet h2 { font-family: var(--serif); font-weight: 400; font-size: 16pt; margin: 0 0 2mm; }
  #print-sheet table { width: 100%; border-collapse: collapse; }
  #print-sheet td { padding: 1.2mm 0; border-bottom: 0.5pt solid #ddd; vertical-align: top; }
  #print-sheet td.a { white-space: nowrap; padding-right: 3mm; font-weight: 600; width: 1%; }
  #print-sheet th { text-align: left; font-size: 9pt; text-transform: uppercase; letter-spacing: .06em; color: #555; padding: 3mm 0 1mm; }
  #print-sheet small { color: #555; }
  #print-sheet ol { margin: 0; padding-left: 5mm; }
  #print-sheet li { margin-bottom: 2mm; break-inside: avoid; }
  #print-sheet .p-nutri { font-size: 9.5pt; color: #333; margin-top: 4mm; }
  #print-sheet .p-ing, #print-sheet .p-steps { display: block; margin: 0; padding: 0; }
  #print-sheet footer { margin-top: 8mm; padding-top: 2mm; border-top: 0.5pt solid #ccc; font-size: 8.5pt; color: #666; }
}
