/* Bílé pozadí a černé písmo, velké a kontrastní, aby to bylo čitelné na kameře. */
:root {
  --fg: #000;
  --muted: #555;
  --line: #e5e5e5;
  --green: #12a150;
  --orange: #f57c00;
  --red: #e11d2e;
  --brand: #0E4F53; /* Nomce Teal z logo manuálu */
  --bar-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: #fff;
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

.hidden { display: none !important; }

/* Značka */
.brand { display: flex; align-items: baseline; gap: 6px; color: var(--brand); }
.brand img { height: 26px; align-self: center; }
.brand-ai { font-weight: 800; font-size: 22px; margin-left: -4px; }
.brand-gastro { font-weight: 300; font-size: 24px; margin-left: 6px; }

.brand-big { flex-direction: column; align-items: center; gap: 10px; }
.brand-big img { height: 56px; }
.brand-big .brand-row { display: flex; align-items: baseline; }
.brand-big .brand-ai { font-size: 44px; margin-left: -2px; }
.brand-big .brand-gastro { font-size: 40px; margin: 0; letter-spacing: .02em; }

/* Úvodní obrazovka */
.splash {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  transition: opacity .6s ease;
}
.splash .brand { animation: rise .9s ease both; }
.splash.fade { opacity: 0; pointer-events: none; }

/* Pruh nahoře */
.topbar {
  position: sticky; top: 0; z-index: 5;
  height: calc(var(--bar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 20px 0;
  display: flex; align-items: center;
  background: #fff;
  border-bottom: 2px solid var(--fg);
}

main { padding: 0 20px calc(24px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }

.screen { animation: fadein .35s ease both; }
h1 { font-size: 30px; line-height: 1.2; margin: 28px 0 8px; }
h2 { font-size: 22px; margin: 0; }
.sub { font-size: 18px; color: var(--muted); margin: 0 0 14px; }

/* Mikrofon */
#screen-listen { display: flex; flex-direction: column; align-items: center; text-align: center; }
.mic {
  width: 132px; height: 132px; margin: 26px 0 12px;
  border-radius: 50%;
  border: 4px solid var(--fg);
  background: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .1s;
}
.mic:active { transform: scale(.96); }
.mic svg { width: 60px; height: 60px; fill: var(--fg); transition: fill .2s; }
.mic.listening { background: var(--red); border-color: var(--red); animation: pulse 1.4s ease-out infinite; }
.mic.listening svg { fill: #fff; }
.mic.busy { opacity: .35; pointer-events: none; }

.status { font-size: 22px; font-weight: 600; margin: 4px 0 8px; min-height: 1.3em; }
.transcript { font-size: 22px; line-height: 1.4; margin: 0 0 16px; min-height: 1.4em; max-width: 34em; }
.transcript .interim { color: #888; }

/* Objednávka / seznamy */
.card {
  width: 100%; text-align: left;
  border: 2px solid var(--fg); border-radius: 16px;
  padding: 16px 18px; margin-top: 4px;
}
.card h2 { margin-bottom: 6px; }

.list { list-style: none; padding: 0; margin: 0; }
.list li {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 22px; padding: 10px 0;
  border-bottom: 1px solid var(--line);
  animation: slidein .35s ease both;
}
.list li:last-child { border-bottom: 0; }
.list .qty { font-weight: 700; white-space: nowrap; }
.list-compact li { font-size: 17px; padding: 6px 0; }
.list-compact .note { display: block; font-size: 14px; color: var(--orange); font-weight: 600; }

.status-left, .transcript-left { text-align: left; }

/* Kdo vaří */
.chefs { display: grid; gap: 12px; margin-top: 12px; }
.chef {
  border: 3px solid var(--fg); border-radius: 16px; background: #fff;
  font-size: 34px; font-weight: 800; padding: 22px; cursor: pointer;
  transition: background .2s, color .2s, transform .1s;
}
.chef:active { transform: scale(.98); }
.chef.picked { background: var(--fg); color: #fff; animation: pop .4s ease both; }

/* Recepty */
.dish { border: 2px solid var(--fg); border-radius: 16px; padding: 12px 16px; margin-bottom: 12px; animation: fadein .4s ease both; }
.dish-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.dish-head h2 { font-size: 21px; }
.dish-head span { font-weight: 700; white-space: nowrap; }
.notes { list-style: none; padding: 0; margin: 4px 0 0; }
.notes li { font-size: 18px; font-weight: 700; color: var(--orange); padding: 4px 0; animation: slidein .35s ease both; }

/* Kontroly */
.checks { list-style: none; padding: 0; margin: 18px 0 0; }
.checks li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); animation: slidein .35s ease both; }
.checks .icon {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--fg);
  animation: spin .8s linear infinite;
}
.checks li.ok .icon {
  border: 0; background: var(--green); animation: pop .35s ease both;
  display: grid; place-items: center;
}
.checks li.ok .icon::after { content: "✓"; color: #fff; font-weight: 900; font-size: 20px; }
.checks .text { font-size: 22px; font-weight: 700; line-height: 1.25; }
.checks .detail { display: block; font-size: 16px; font-weight: 400; color: var(--muted); margin-top: 4px; }

/* Návrh: dva sloupce */
#screen-proposal { padding-bottom: 110px; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.supplier { border: 2px solid var(--fg); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; animation: rise .5s ease both; }
.supplier:nth-child(2) { animation-delay: .25s; }
.supplier-head {
  background: var(--bg); color: var(--fg-shop);
  font-weight: 900; font-size: 22px; text-align: center; padding: 12px 6px;
}
.supplier-head img { max-height: 34px; max-width: 90%; }
.supplier ul { list-style: none; padding: 4px 10px; margin: 0; flex: 1; }
.supplier li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.25; }
.supplier li:last-child { border-bottom: 0; }
.supplier li .meta { display: flex; justify-content: space-between; gap: 6px; font-weight: 700; margin-top: 2px; }
.supplier li .note { display: block; font-size: 12px; color: var(--orange); font-weight: 700; }
.supplier-foot { border-top: 2px solid var(--fg); padding: 8px 10px; }
.supplier-foot .sum { font-size: 20px; font-weight: 900; }
.supplier-foot .vat { font-size: 13px; font-weight: 700; color: var(--muted); }
.vat-note { font-size: 15px; font-weight: 700; color: var(--muted); margin: -8px 0 12px; }
.supplier-foot .when { font-size: 14px; color: var(--muted); }
.editing .supplier li { cursor: pointer; background: #fff7ed; }
.edit-hint { font-size: 16px; font-weight: 700; color: var(--orange); margin: 0 0 10px; }
.sub strong { color: var(--fg); }

.actions {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; gap: 12px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--line);
  max-width: 560px; margin: 0 auto;
}
.btn {
  border: 0; border-radius: 14px; cursor: pointer;
  font-size: 24px; font-weight: 800; color: #fff;
  padding: 20px 10px;
  transition: transform .1s, filter .1s;
}
.btn:active { transform: scale(.97); filter: brightness(.92); }
.btn-green { background: var(--green); flex: 2; }
.btn-orange { background: var(--orange); flex: 1; }
.btn-ghost { background: none; color: var(--muted); font-size: 18px; font-weight: 600; display: block; margin: 30px auto 0; }

/* Objednáno */
.done { text-align: center; padding-top: 50px; }
.done-check {
  width: 130px; height: 130px; margin: 0 auto;
  border-radius: 50%; background: var(--green); color: #fff;
  font-size: 80px; line-height: 130px; font-weight: 900;
  animation: pop .5s ease both;
}
.done h1 { font-size: 40px; }
.done-line { font-size: 22px; margin: 0 0 10px; line-height: 1.35; }
.done-line span { color: var(--muted); }

/* ---------- Záložky (Jídelníček, Sklad, Postřehy, Objednávka) ---------- */
.tabs {
  position: sticky; top: calc(var(--bar-h) + env(safe-area-inset-top)); z-index: 4;
  display: flex; background: #fff; border-bottom: 1px solid var(--line);
  max-width: 560px; margin: 0 auto;
}
.tabs button {
  flex: 1; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 16px; font-weight: 700; color: var(--muted);
  padding: 13px 4px 11px; border-bottom: 3px solid transparent; position: relative;
}
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs button.ping::after {
  content: ""; position: absolute; top: 8px; right: 12%; width: 9px; height: 9px;
  border-radius: 50%; background: var(--orange); animation: pulse-o 1.4s ease-out infinite;
}
.view { animation: fadein .3s ease both; }
.h2-gap { margin: 24px 0 10px; }

.margin-box {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--brand); color: #fff; border-radius: 16px; padding: 14px 18px; margin-bottom: 14px;
}
.mlabel { font-size: 14px; opacity: .85; }
.mval { font-size: 34px; font-weight: 900; line-height: 1.1; white-space: nowrap; }
.m-arrow { font-size: 22px; font-weight: 800; color: #FEE1B5; margin-left: 8px; }
.mnote { font-size: 15px; font-weight: 700; line-height: 1.3; text-align: right; color: #FEE1B5; }

.change, .insight {
  border: 2px solid var(--fg); border-radius: 16px; padding: 12px 14px; margin-bottom: 12px;
}
.insight, .change.fresh { animation: rise .35s ease both; }
.change h3, .insight h3 { font-size: 19px; margin: 2px 0 4px; line-height: 1.25; }
.change p, .insight p { font-size: 16px; margin: 0 0 8px; line-height: 1.35; }
.ctag { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--brand); }
.ctag .new { background: var(--orange); color: #fff; border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
.change.offer { border-color: var(--orange); background: #fff7ed; }
.change.offer.fresh { animation: rise .4s ease both, glow 1.6s ease-out 2; }
.bench { color: var(--brand); font-weight: 600; }
.cfoot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.cmargin { font-weight: 800; color: var(--green); margin-right: auto; }
.cwrite { font-weight: 800; color: var(--red); margin-right: auto; line-height: 1.2; }
.cwrite.saved { color: var(--green); }
.cfoot button { border: 0; border-radius: 10px; font: inherit; font-size: 16px; font-weight: 800; padding: 10px 16px; cursor: pointer; }
.cfoot .yes { background: var(--green); color: #fff; }
.cfoot .no { background: #eee; color: var(--muted); }
.cfoot .undo { background: none; color: var(--muted); text-decoration: underline; padding: 6px; font-size: 14px; }
.cstate { font-weight: 800; }
.change.decided.yes { border-color: var(--green); }
.change.decided.no { opacity: .5; }
.recipe { margin: 0 0 8px; font-size: 15px; }
.recipe summary { cursor: pointer; font-weight: 700; color: var(--brand); }
.recipe ul { list-style: none; padding: 0; margin: 6px 0; }
.recipe li { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--line); }
.rfoot { font-weight: 700; }

.week { width: 100%; border-collapse: collapse; font-size: 15px; }
.week th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.week td { padding: 9px 6px; border-top: 1px solid var(--line); vertical-align: top; line-height: 1.3; }
.week td.day { font-weight: 900; width: 34px; }
.week td.chg { background: #e8f6ee; font-weight: 700; animation: fadein .5s ease both; }

.warnbox { background: #fff7ed; border: 2px solid var(--orange); border-radius: 14px; padding: 10px 14px; font-weight: 600; margin-bottom: 12px; }
.stock { list-style: none; padding: 0; margin: 0; }
.stock li { border-bottom: 1px solid var(--line); padding: 11px 0 11px 12px; border-left: 5px solid var(--line); margin-bottom: 4px; }
.stock li.hot { border-left-color: var(--red); }
.stock li.warm { border-left-color: var(--orange); }
.srow { display: flex; justify-content: space-between; gap: 10px; font-size: 18px; }
.sname { font-weight: 700; }
.sqty { font-weight: 800; white-space: nowrap; }
.srow2 { font-size: 14px; color: var(--muted); margin-top: 2px; }
.stock li.hot .sdays { color: var(--red); font-weight: 800; }
.suse { display: block; color: var(--fg); font-weight: 600; margin-top: 2px; }

.ask { margin-top: 18px; border-top: 2px solid var(--fg); padding-top: 12px; }
.ask-log { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.amsg { padding: 9px 12px; border-radius: 14px; font-size: 16px; line-height: 1.35; max-width: 90%; white-space: pre-line; }
.amsg.u { align-self: flex-end; background: var(--brand); color: #fff; }
.amsg.a { align-self: flex-start; background: #f0f2ef; }
.amsg.wait { color: var(--muted); font-style: italic; }
.ask-form { display: flex; gap: 8px; }
.ask-form input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 12px; border: 2px solid var(--fg); border-radius: 12px; -webkit-user-select: text; user-select: text; }
.ask-form button { border: 0; border-radius: 12px; background: var(--brand); color: #fff; font-size: 18px; padding: 0 16px; cursor: pointer; }

@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(245,124,0,.5); } 100% { box-shadow: 0 0 0 16px rgba(245,124,0,0); } }
@keyframes pulse-o { 0% { box-shadow: 0 0 0 0 rgba(245,124,0,.6); } 100% { box-shadow: 0 0 0 10px rgba(245,124,0,0); } }

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(225,29,46,.45); } 100% { box-shadow: 0 0 0 28px rgba(225,29,46,0); } }
@keyframes spin { to { transform: rotate(360deg); } }
