/* ChefBrain app styles. Every value comes from tokens.css (loaded first).
   The short names below are the names the screens already use; they now point at the tokens,
   so the whole app takes the new look without touching any screen's structure. */
:root {
  --bg: var(--c-bg); --surface: var(--c-surface); --surface-2: var(--c-surface-2); --surface-3: var(--c-surface-3);
  --ink: var(--c-ink); --muted: var(--c-muted); --line: var(--c-line); --line-strong: var(--c-line-strong);
  --accent: var(--c-brand); --accent-hover: var(--c-brand-hover); --accent-ink: var(--c-brand-ink); --accent-soft: var(--c-brand-soft); --accent-line: var(--c-brand-line);
  /* one main action colour: the brand green (the copper call-to-action is gone) */
  --cta: var(--c-brand); --cta-hover: var(--c-brand-hover); --cta-ink: var(--c-brand-ink); --copper: var(--c-brand);
  --ok: var(--c-ok); --ok-soft: var(--c-ok-soft); --warn: var(--c-warn); --warn-soft: var(--c-warn-soft); --bad: var(--c-bad); --bad-soft: var(--c-bad-soft);
  --k-dairy: #2f5f9e; --k-fish: #1f6f71;
  --ticket: var(--c-surface); --wa-bg: #e9e3d8; --wa-in: #fff; --wa-out: #d9fdd3; --wa-ink: #111b21;
  --shadow-sm: var(--shadow-1); --shadow: var(--shadow-2); --shadow-lg: var(--shadow-3);
  --f-ui: var(--font-sans); --f-display: var(--font-sans); --f-num: var(--font-sans); --f-mono: var(--font-mono);
  --r: var(--radius-lg); --r-sm: var(--radius-md);
}
:root[data-theme="dark"] { --k-dairy: #8fb4ea; --k-fish: #6cc5c7; --wa-bg: #0b141a; --wa-in: #202c33; --wa-out: #005c4b; --wa-ink: #e9edef; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-ui); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; } /* 12:1 light, 9:1 dark; the pale ring was 1.4:1 */
/* !important: on desktop ".main > *" gives children full width, which made the hidden title push the page sideways */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; inset-inline-start: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: var(--tracking-tight); font-weight: var(--fw-semibold); }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
[dir=rtl] td.num.n { text-align: left; }
[dir=rtl] .kpi .v { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* layout */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1200px; margin: 0 auto; padding: 14px max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); display: grid; gap: 10px; }
.top-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 22px; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; border-radius: 10px 10px 0 0; transition: color var(--dur), background-color var(--dur), border-color var(--dur); }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.main:focus { outline: none; }
.main { max-width: 1200px; margin: 0 auto; padding: 32px max(20px, env(safe-area-inset-right)) 64px max(20px, env(safe-area-inset-left)); display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
@media (min-width: 861px) { .grid2.dish-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: var(--border); border-radius: var(--r); padding: var(--s-5); display: grid; gap: 16px; min-width: 0; align-content: start; box-shadow: var(--shadow-sm); grid-template-columns: minmax(0, 1fr); }
.panel h2 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.page-h { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-h h1 { font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); }

/* controls */
.btn { border: var(--border-strong); background: var(--surface); border-radius: var(--r-sm); padding: 10px 18px; min-height: var(--tap-min); font-weight: var(--fw-semibold); font-size: 15px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast), opacity var(--dur-fast); }
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn.primary { background: var(--cta); border-color: var(--cta); color: var(--cta-ink); box-shadow: none; }
.btn.primary:hover { background: var(--cta-hover); border-color: var(--cta-hover); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad-soft); }
.btn.ghost { background: none; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.sm { padding: 8px 14px; min-height: 44px; font-size: 14px; border-radius: var(--r-sm); }
.btn .ico { width: 18px; height: 18px; }
label.f { display: grid; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 500; }
input, select, textarea { border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-sm); padding: 10px 14px; min-height: 44px; min-width: 0; transition: border-color var(--dur), box-shadow var(--dur); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line-strong)); }
input:focus, input:focus-within, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=checkbox], input[type=radio] { min-height: 0; accent-color: var(--accent); }
input[type=number] { font-variant-numeric: tabular-nums; }
textarea { min-height: 120px; font-size: 15px; width: 100%; resize: vertical; line-height: 1.6; }
::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.form { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.form .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; align-items: start; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--surface); padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 8px 14px; min-height: 36px; font-size: 14px; font-weight: 600; color: var(--muted); border-radius: 7px; transition: background-color var(--dur), color var(--dur); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.chip { font-size: 13px; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; text-decoration: none; transition: background-color var(--dur), color var(--dur); }
a.chip:hover { background: var(--accent-soft); color: var(--accent); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: var(--border); border-radius: var(--r); padding: 20px 22px; display: grid; gap: var(--s-1); box-shadow: var(--shadow-sm); }
.kpi .l { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); font-family: var(--f-num); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: var(--lh-tight); }
.kpi.bad .v { color: var(--bad); } .kpi.ok .v { color: var(--ok); }
.kpi .s { font-size: 13px; color: var(--muted); }

/* alert tickets: a kitchen order slip */
.rail { display: flex; gap: 16px; overflow-x: auto; padding: 4px 4px 12px; margin: -4px; }
.ticket { flex: 0 0 min(290px, 100%); background: var(--ticket); border: 1px solid var(--line); border-top: 3px solid var(--bad); padding: 16px 18px 18px; display: grid; gap: 8px; position: relative; font-size: 14px; text-decoration: none; color: var(--ink); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.ticket.warn { border-top-color: var(--warn); }
.ticket.special { border-top-color: var(--ok); }
.ticket .h { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 16px; }
.ticket .m { font-size: 13px; color: var(--muted); }
.ticket .fx { border-top: 1px dashed var(--line-strong); padding-top: 8px; display: grid; gap: 4px; font-weight: 500; color: var(--accent); }
.allgood { background: var(--ok-soft); color: var(--ok); border-radius: var(--r-sm); padding: 14px 18px; font-weight: 500; }

/* tables */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { font-size: 13px; color: var(--muted); font-weight: 600; text-align: start; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: end; }
tr.click { cursor: pointer; transition: background-color var(--dur); } tr.click:hover { background: var(--surface-2); }
.sub { font-size: 13px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.neutral { background: var(--surface-2); color: var(--muted); }
.bar { position: relative; height: 8px; background: var(--surface-3); border-radius: 999px; min-width: 80px; overflow: hidden; flex: 1; }
.bar i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; }
.bar b { position: absolute; inset-block: -2px; width: 2px; background: var(--ink); opacity: .45; }
.up { color: var(--bad); } .down { color: var(--ok); }
.nw { white-space: nowrap; }
.stk-rows { display: grid; gap: 8px; }
.stk-row { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kchip { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); white-space: nowrap; }
.kchip.k-meat { color: var(--bad); border-color: currentColor; } .kchip.k-dairy { color: var(--k-dairy); border-color: currentColor; }
.kchip.k-fish { color: var(--k-fish); border-color: currentColor; } .kchip.k-parve { color: var(--muted); }

/* menu engineering quadrants */
.quad { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.quad > div { min-width: 0; overflow-wrap: anywhere; }
.quad > div { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; display: grid; gap: 6px; align-content: start; min-height: 96px; background: var(--surface); }
.quad .qt { font-weight: 700; font-size: 15px; }
.quad .qd { font-size: 13px; color: var(--muted); }
.quad .star { background: var(--ok-soft); border-color: transparent; } .quad .dog { background: var(--bad-soft); border-color: transparent; }

/* recipe editor */
.recipe { display: grid; gap: 10px; }
.rline { display: grid; grid-template-columns: minmax(0, 2fr) 96px 86px 96px 40px; gap: 10px; align-items: center; }
/* phones: the ingredient takes its own row; amount, unit, line cost and remove stay reachable on the second row */
@media (max-width: 600px) {
  .rline { grid-template-columns: 84px 84px minmax(0, 1fr) 44px; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--c-line); }
  .rline > select[data-f="ingredient_id"] { grid-column: 1 / -1; }
  .rline .lsrc { white-space: nowrap; }
}
.whatif input[type=range] { width: 100%; accent-color: var(--accent); min-height: 0; }
.big { font-size: 34px; font-weight: 700; font-family: var(--f-num); letter-spacing: -0.02em; }

/* chat & whatsapp */
.chat { display: grid; gap: 12px; max-height: 520px; overflow-y: auto; padding: 4px; }
.msg { max-width: min(640px, 92%); padding: 12px 16px; border-radius: 12px; white-space: pre-wrap; }
.msg.me { justify-self: end; background: var(--accent); color: var(--accent-ink); }
.msg.bot { justify-self: start; background: var(--surface-2); border: 1px solid var(--line); }
/* the chat simulator: a modern phone, drawn in CSS (no trademarked marks): titanium frame, dynamic island, status bar, home bar */
.phone { position: relative; width: 100%; max-width: 360px; aspect-ratio: 9 / 18.6; justify-self: center; padding: 11px; border-radius: 54px;
  background: linear-gradient(145deg, #cfd1cc 0%, #8c8f89 18%, #5a5d58 50%, #a7aaa4 82%, #d9dbd6 100%);
  box-shadow: 0 0 0 1.5px #3a3c39, 0 30px 60px -20px rgba(0, 0, 0, .55), inset 0 0 0 1.5px rgba(255, 255, 255, .5); }
.phone .ph-btn { position: absolute; width: 3px; border-radius: 2px; background: #6d706a; }
.phone .ph-btn.b1 { inset-inline-start: -3px; top: 17%; height: 28px; } .phone .ph-btn.b2 { inset-inline-start: -3px; top: 25%; height: 52px; }
.phone .ph-btn.b3 { inset-inline-end: -3px; top: 27%; height: 76px; }
.phone .screen { position: relative; height: 100%; border-radius: 44px; overflow: hidden; background: var(--wa-bg); box-shadow: 0 0 0 5px #0a0b0a; display: grid; grid-template-rows: auto auto 1fr auto auto; grid-template-columns: minmax(0, 1fr); }
.phone .island { position: absolute; z-index: 3; top: 10px; left: 50%; transform: translateX(-50%); width: 31%; height: 26px; border-radius: 20px; background: #000; }
.phone .sbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 26px 6px; font-size: 14px; color: var(--wa-ink); direction: ltr; }
.phone .sb-r { display: inline-flex; gap: 6px; align-items: center; } .phone .sb-r svg { fill: currentColor; }
.phone .ph { display: flex; gap: 10px; align-items: center; padding: 8px 16px 10px; background: color-mix(in srgb, var(--wa-bg) 80%, #fff); border-bottom: 1px solid rgba(0, 0, 0, .08); }
.phone .ph i { width: 36px; height: 36px; border-radius: 50%; background: var(--c-brand); display: grid; place-items: center; font-style: normal; font-weight: var(--fw-bold); color: var(--c-brand-ink); }
.phone .ph-t { display: grid; line-height: 1.25; color: var(--wa-ink); } .phone .ph-t b { font-size: 15px; } .phone .ph-t span { font-size: 12px; opacity: .65; }
.phone .pb { min-height: 0; overflow-y: auto; padding: 12px 12px 6px; display: flex; flex-direction: column; gap: 6px; background: var(--wa-bg); }
.wa { max-width: 82%; padding: 8px 12px; border-radius: 18px; white-space: pre-wrap; font-size: 14px; line-height: 1.45; color: var(--wa-ink); }
.wa.out { align-self: flex-end; background: var(--wa-out); border-end-end-radius: 5px; } .wa.in { align-self: flex-start; background: var(--wa-in); border-end-start-radius: 5px; }
.phone form { display: flex; gap: 6px; padding: 8px 10px; background: color-mix(in srgb, var(--wa-bg) 80%, #fff); align-items: center; }
.phone form input[type=text] { flex: 1; min-width: 0; border-radius: 999px; }
.phone .home-bar { width: 34%; height: 5px; border-radius: 3px; background: var(--wa-ink); opacity: .85; margin: 4px auto 8px; }
@media (max-width: 420px) { .phone { max-width: 300px; border-radius: 46px; padding: 9px; } .phone .screen { border-radius: 37px; } }

/* misc */
.drop { border: 2px dashed var(--line-strong); border-radius: var(--r); padding: 22px; display: grid; gap: 12px; background: var(--surface-2); transition: border-color var(--dur), background-color var(--dur); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.notice { border-radius: var(--r-sm); padding: 14px 16px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.err { color: var(--bad); font-size: 14px; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.auth .card { width: min(460px, 100%); background: var(--surface); border: var(--border); border-radius: var(--r); padding: 32px; display: grid; gap: 18px; box-shadow: var(--shadow-lg); }
#toast { position: fixed; inset-inline: 0; bottom: max(24px, env(safe-area-inset-bottom)); margin: 0 auto; width: fit-content; max-width: 90vw; background: var(--ink); color: var(--surface); padding: 12px 20px; border-radius: 10px; z-index: 50; font-weight: 500; box-shadow: var(--shadow-lg); }
.spark { width: 120px; height: 32px; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 2; }
.events { display: grid; gap: 8px; font-size: 14px; }
.events div { display: flex; gap: 8px; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
dialog { border: var(--border); border-radius: var(--r); background: var(--surface); color: var(--ink); padding: 28px; box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(28, 25, 23, .38); backdrop-filter: blur(3px); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.step { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); text-decoration: none; color: var(--ink); background: var(--surface); font-weight: 500; transition: border-color var(--dur), box-shadow var(--dur); }
.step:hover { border-color: var(--accent-line); box-shadow: var(--shadow); }
.step .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 700; flex: none; }
.step.done { opacity: .65; } .step.done .num { background: var(--ok-soft); color: var(--ok); }
.recipes { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); } /* a wide recipe table scrolls inside its box, not the whole page */
.rcp { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; background: var(--surface-2); transition: background-color var(--dur), box-shadow var(--dur); }
.rcp summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rcp[open] { background: var(--surface); box-shadow: var(--shadow); }
.main { padding-bottom: 96px; }
input:not([type=number]):not([type=email]):not([type=password]), textarea { unicode-bidi: plaintext; }

/* empty states */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty .em-ico { width: 56px; height: 56px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.empty .em-ico .ico { width: 26px; height: 26px; }
.empty .em-t { color: var(--ink); font-weight: 700; font-size: 17px; }
.empty .em-s { max-width: 46ch; font-size: 15px; }

/* skeleton loading (shown only when a page takes more than a moment) */
.sk { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; }
.sk-page { display: grid; gap: 24px; }
.sk-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.sk-row .sk { height: 104px; border-radius: var(--r); }
.sk-panel { height: 260px; border-radius: var(--r); }
.sk-line { height: 14px; }
@media (max-width: 760px) { .sk-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* motion: subtle, and only for people who have not asked for less of it */
@media (prefers-reduced-motion: no-preference) {
  a.ticket { transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
  a.ticket:hover { box-shadow: var(--shadow); }
  .sk { animation: sk 1.4s ease infinite; }
  .main > * { animation: rise var(--dur) var(--ease) both; }
}
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* nav icons + phone bottom bar (app feel, like a POS handheld) */
.nav a { display: inline-flex; align-items: center; gap: 8px; }
.ico { width: 18px; height: 18px; flex: none; }
@media (max-width: 700px) {
  /* a blurred header would trap the fixed bottom bar inside it */
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
  .nav { position: fixed; inset: auto 0 0 0; z-index: 30; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding: 6px max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); justify-content: space-between; }
  .nav a { flex-direction: column; gap: 3px; font-size: 11.5px; padding: 6px 8px; border-bottom: 0; border-top: 2px solid transparent; min-width: 64px; border-radius: 10px; }
  .nav a.on { border-top-color: transparent; color: var(--accent); background: var(--accent-soft); }
  .ico { width: 22px; height: 22px; }
  .main { padding: 20px max(16px, env(safe-area-inset-right)) 130px max(16px, env(safe-area-inset-left)); gap: 18px; }
  .panel { padding: 18px; }
  .page-h h1 { font-size: 26px; }
  .top-in { padding-top: 10px; }
}
.snap { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: var(--r); background: var(--accent); color: var(--accent-ink); cursor: pointer; box-shadow: var(--shadow); transition: background-color var(--dur), box-shadow var(--dur); }
.snap-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--accent-ink) 14%, transparent); }
.snap:hover { background: var(--accent-hover); box-shadow: var(--shadow-lg); }
.auth-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 460px); gap: 56px; align-items: center; width: min(1060px, 100%); }
.pitch h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.15; font-weight: var(--fw-bold); }
.pitch p { font-size: 18px; max-width: 46ch; color: var(--muted); }
.pitch ul { padding: 0; margin: 0; list-style: none; display: grid; gap: 12px; }
.pitch li { display: flex; gap: 12px; align-items: baseline; }
.pitch li::before { content: "✓"; color: var(--accent); font-weight: var(--fw-bold); }
@media (max-width: 820px) { .auth-grid { grid-template-columns: 1fr; gap: 24px; } .pitch ul { display: none; } }
.only-phone { display: none; }
/* golden path: only the main tabs show; the rest open under "More" (the current page's tab always shows) */
.nav a.sec { display: none; }
.nav.open a.sec, .nav a.sec.on { display: inline-flex; }
.more-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; border-radius: 10px 10px 0 0; transition: color var(--dur), background-color var(--dur); }
.more-btn:hover { color: var(--ink); background: var(--surface-2); }
.nav.open .more-btn { color: var(--ink); }
@media (max-width: 700px) {
  .nav { flex-wrap: wrap; overflow: visible; }
  .nav.open a.sec, .nav a.sec.on { display: flex; }
  .nav a, .more-btn { flex: 1 0 18%; }
  .more-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; padding: 6px 8px; border: 0; background: none; color: var(--muted); border-radius: 10px; }
  .only-phone { display: grid; }
  #toast { bottom: calc(96px + env(safe-area-inset-bottom)); } /* above the bottom bar */
}

/* Wordmark: plain text in the one family until the brand name and logo are chosen */
.brand { font-family: var(--f-display); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-tight); }
.page-h h1, .pitch h1, .welcome h1, dialog h2 { font-family: var(--f-ui); }

/* Invoice review: one card per line, so was → now stays visible on a phone */
.ilines { display: grid; gap: 12px; }
.iline { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 12px; box-shadow: var(--shadow-sm); }
.iline.open { border-color: color-mix(in srgb, var(--warn) 45%, transparent); border-inline-start: 4px solid var(--warn); }
.iline .pr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.iline .pr input { width: 120px; }
.iline .inc { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; white-space: nowrap; min-height: 44px; }
.iline .inc input { width: 20px; height: 20px; }
.iline .decide { background: var(--warn-soft); border-radius: var(--r-sm); padding: 14px 16px; display: grid; gap: 10px; }
.iline .decide p { margin: 0; font-size: 15px; font-weight: 500; }
.iline .decide .btn { min-height: 44px; }
.warnc { color: var(--warn); }
.cause { font-size: 13.5px; line-height: 1.5; border-top: 1px dashed var(--line-strong); padding-top: 8px; margin-top: 2px; }
.cause b { font-weight: 600; }
.lsrc { font-size: 12px; color: var(--muted); }

/* Dishes whose numbers are not complete yet: neutral, never green */
.pill.incomplete { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--line-strong); }
.events > a { display: flex; gap: 8px; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding: 8px 0; min-height: 44px; text-decoration: none; color: inherit; transition: color var(--dur); }
.events > a:hover { color: var(--accent); }
.events > a .small { text-align: end; }

/* Wide screens: a calm sidebar (Linear/Notion-like). Main tasks on top, the rest in a quieter group below. */
@media (min-width: 1100px) {
  .top { position: fixed; inset-block: 0; inset-inline-start: 0; width: 248px; border-bottom: 0; border-inline-end: 1px solid var(--line); background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; z-index: 10; }
  .top-in { height: 100%; max-width: none; margin: 0; padding: 22px 16px; display: flex; flex-direction: column; gap: 8px; }
  .top-row { display: contents; }
  .brand { order: 0; padding: 4px 8px 18px; font-size: 21px; }
  .brand .muted { display: none; }
  .nav { order: 1; flex-direction: column; gap: 2px; overflow: visible; }
  .nav a, .nav a.sec { display: flex; border-bottom: 0; border-radius: 8px; padding: 10px 12px; }
  .nav a.on { background: var(--accent-soft); color: var(--accent); border-bottom: 0; }
  .nav a:not(.sec) + a.sec { margin-top: 18px; position: relative; }
  .nav a:not(.sec) + a.sec::before { content: ""; position: absolute; inset-inline: 12px; top: -10px; border-top: 1px solid var(--line); }
  .nav a.sec { color: var(--muted); font-size: 15px; }
  .more-btn { display: none; }
  .top-act { order: 2; margin-top: auto; flex-direction: column; align-items: stretch; gap: var(--s-2); padding-top: var(--s-4); border-top: var(--border); }
  .help-btn { justify-content: flex-start; }
  .um-btn { display: none; }
  .umenu { position: static; }
  .um-pop, .umenu.open .um-pop { display: grid; position: static; box-shadow: none; border: 0; padding: 0; width: auto; }
  .main { margin-inline-start: 248px; margin-inline-end: 0; max-width: none; padding-inline: 48px; }
  .main > * { max-width: 1120px; width: 100%; }
}

/* Restaurant UX pass 2 (21.10.2026): big targets for wet or gloved hands, status you can read in a dim kitchen,
   clear feedback after every action. */
.ticket .m { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
a.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 12px; margin: 2px; font-size: 14px; }
.to-rep { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 18px; border: 1px dashed var(--line-strong); border-radius: var(--r); color: var(--muted); text-decoration: none; font-weight: 500; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.to-rep:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
a.snap { text-decoration: none; }
summary { cursor: pointer; padding-block: 10px; min-height: 44px; box-sizing: border-box; }
input[type=checkbox] { width: 20px; height: 20px; }
label.inc { cursor: pointer; }
/* feedback: green when it worked, red when it did not, never just a grey line */
#toast { display: flex; gap: 10px; align-items: center; font-size: 16px; font-weight: 600; border: 1.5px solid transparent; }
#toast[hidden] { display: none; }
#toast.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
#toast.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
#toast.ok::before, #toast.bad::before { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: var(--fw-bold); font-size: 14px; flex: none; color: var(--surface); }
#toast.ok::before { content: "✓"; background: var(--ok); }
#toast.bad::before { content: "!"; background: var(--bad); }
@media (prefers-reduced-motion: no-preference) {
  .btn:not(:disabled):active { transform: scale(.98); }
  #toast:not([hidden]) { animation: rise var(--dur) var(--ease) both; }
}
/* phone: everything you tap is at least 48px tall, with room between targets */
@media (max-width: 700px) {
  .btn, input, select { min-height: 48px; font-size: 16px; }
  .btn.sm { min-height: 44px; font-size: 15px; }
  .iline .decide .btn { min-height: 52px; }
  .seg button { min-height: 42px; }
  input[type=checkbox], .iline .inc input { width: 24px; height: 24px; }
  a.chip { min-height: 44px; }
  .row { gap: 14px; }
}
.quad .chip { white-space: normal; max-width: 100%; text-align: start; }
@media (max-width: 360px) { .kpi .v { font-size: 24px; } .kpi { padding: 14px; } } /* small phones (320px): numbers stay inside their card */

/* profit radar: share of food cost resting on recent invoice prices */
.radar { display: grid; gap: 10px; }
.meter { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--ok); border-radius: inherit; transition: width .3s ease; }

/* Phase 2 dashboard (02.11.2026): a visible title with today's date and one main action beside it */
.dash-h { align-items: center; }
.dash-t { display: grid; gap: var(--s-1); }
.dash-t p { margin: 0; }
.dash-fix { display: grid; gap: var(--s-3); }
.dash-fix h2 { font-size: var(--fs-lg); }
@media (max-width: 700px) { .dash-h .btn.primary { width: 100%; } }

/* Phase 2 navigation (02.11.2026): one header on every size. Brand, then Help and the restaurant menu.
   Help never floats over content. The restaurant menu holds restaurant, language and log out:
   a dropdown on phone and tablet, always open at the bottom of the desktop sidebar. */
.brand .tag { font-weight: var(--fw-regular); }
@media (max-width: 1099px) { .brand .tag { display: none; } }
.top-act { display: flex; align-items: center; gap: var(--s-2); }
.help-btn .ico, .um-btn .ico { width: 18px; height: 18px; }
.umenu { position: relative; }
.um-btn { gap: var(--s-2); padding-inline: 10px; max-width: 46vw; }
.um-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.um-av { flex: none; width: 26px; height: 26px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.um-pop { display: none; position: absolute; inset-inline-end: 0; top: calc(100% + var(--s-2)); z-index: 40; width: min(300px, calc(100vw - 32px)); gap: var(--s-3);
  background: var(--surface); border: var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: var(--s-4); }
.umenu.open .um-pop { display: grid; }
.um-pop select, .um-pop .seg { width: 100%; }
.um-pop .seg button { flex: 1; }
.um-pop #logout { justify-content: flex-start; }
.um-who { display: grid; gap: 2px; overflow-wrap: anywhere; }
.um-who .small:first-child { color: var(--ink); font-weight: var(--fw-medium); }
.um-who:has(.small:first-child:empty) .small:first-child { display: none; }
@media (max-width: 1099px) { .top-row { flex-wrap: nowrap; } .brand { min-width: 0; } }
@media (max-width: 700px) {
  .brand { font-size: var(--fs-lg); gap: 10px; }
  .brand img { width: 30px; height: 30px; }
  .help-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* icon only on phones, name kept for screen readers */
  .help-btn { min-width: 48px; padding-inline: 12px; }
  .um-btn { max-width: 52vw; }
}
@media (max-width: 1099px) {
  .top-row { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .top-act { min-width: 0; justify-content: flex-end; }
  .umenu { min-width: 0; }
  .um-btn { max-width: 100%; min-width: 0; }
}
@media (min-width: 1100px) {
  .um-btn { display: none; }
  .um-pop, .umenu.open .um-pop { display: grid; position: static; box-shadow: none; border: 0; padding: 0; width: auto; background: none; }
  .top-act { flex-direction: column; align-items: stretch; }
}
.rail > .ticket:only-child { flex-basis: 100%; max-width: 560px; }

/* Phase 3: on phones a table with a header row becomes a list of cards. The first cell is the title of the card,
   the others show their column name above the value (ui.js copies it into data-l). Nothing is hidden. */
@media (max-width: 699px) {
  .tw.cards { overflow: visible; }
  .tw.cards table, .tw.cards tbody { display: block; }
  .tw.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tw.cards tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .tw.cards tbody tr:last-child { border-bottom: 0; }
  .tw.cards td { display: block; padding: 0; border: 0; text-align: start; min-width: 0; overflow-wrap: anywhere; }
  .tw.cards td:first-child { grid-column: 1 / -1; }
  .tw.cards td[data-l]:not(:first-child)::before { content: attr(data-l); display: block; font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--c-muted); margin-bottom: 2px; }
  .tw.cards td:has(.bar) { grid-column: 1 / -1; order: 1; }
  .tw.cards td:empty { display: none; }
  .tw.cards td .row { flex-wrap: wrap; }
  /* a status pill in the last column sits beside the title, where the eye starts */
  .tw.cards tr:has(> td:last-child > .pill:first-child) > td:first-child { grid-column: 1 / -2; }
  .tw.cards td:last-child:has(> .pill:first-child) { grid-row: 1; grid-column: -2 / -1; justify-self: end; }
  .tw.cards td:last-child:has(> .pill:first-child)::before { display: none; }
}

/* Phase 3: estimate and suggestion tags (ui.js tag()). Quiet, small, always a word. */
.tag { display: inline-flex; align-items: center; vertical-align: middle; font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.4; padding: 1px 8px; border-radius: var(--radius-pill); white-space: nowrap; letter-spacing: 0; }
.tag.est { color: var(--c-warn); background: var(--c-warn-soft); border: 1px dashed color-mix(in srgb, var(--c-warn) 55%, transparent); }
.tag.rec { color: var(--c-brand); background: var(--c-brand-soft); border: 1px solid var(--c-brand-line); }
.kpi .l .tag { margin-inline-start: 4px; }
.lsrc .tag { font-weight: var(--fw-medium); }

/* Phase 3: the demo restaurant says so on every page, above the content */
.tag.demo { color: var(--c-ink); background: var(--c-surface-3); border: 1px solid var(--c-line-strong); margin-inline-end: var(--s-2); }
.demo-bar { max-width: 1200px; margin: 0 auto; padding: var(--s-4) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
.demo-in { display: block; line-height: 1.6; font-size: var(--fs-sm); color: var(--c-muted); background: var(--c-surface-2); border: var(--border); border-radius: var(--radius-md); padding: var(--s-2) var(--s-3); }
.demo-bar + .main { padding-top: var(--s-4); }
@media (min-width: 1100px) { .demo-bar { margin-inline-start: 248px; margin-inline-end: 0; max-width: none; padding-inline: 48px; } .demo-in { max-width: 1120px; } }

/* Phase 3: a price change names its supplier and date, so two changes to one ingredient read as two events */
.events.pcs > div { align-items: baseline; }
.events.pcs > div > span:first-child { display: grid; gap: 2px; min-width: 0; }
.events.pcs .pc-n { font-weight: var(--fw-medium); }
.events.pcs > div > span:last-child { text-align: end; white-space: nowrap; }

/* Phase 3: invoice review on tablet and desktop: the match and the price sit side by side, so a line is one
   short card instead of three stacked rows. Questions and notes still take the full width. */
@media (min-width: 861px) {
  .iline { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: var(--s-5); align-items: end; }
  .iline > :first-child, .iline > .sub, .iline > .decide { grid-column: 1 / -1; }
  .iline .pr { justify-content: flex-end; min-height: 48px; }
}
.iline .pr .num.up, .iline .pr .num.down, .iline .pr .num.muted { min-width: 56px; text-align: end; }
@media (max-width: 420px) { .iline .pr { gap: 6px 10px; } .iline .pr input { width: 92px; } }

/* ===== Mida polish (07.11.2026): the app after login feels like the same company as the site =====
   Lockup in the header, a calm "today" row on the dashboard, quieter estimate tags (amber means attention only),
   a forest welcome panel on the login screen, and tighter rhythm on panels. Tokens only. */
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand { text-decoration: none; color: inherit; }
.brand img.lockup { width: auto; height: 34px; border-radius: 0; }
@media (max-width: 700px) { .brand img.lockup { height: 30px; } }
@media (min-width: 1100px) { .brand img.lockup { height: 38px; } .brand { padding-bottom: 22px; } }
body { font-feature-settings: "kern"; }
.page-h h1 { letter-spacing: -0.02em; }
.panel h2 { letter-spacing: -0.01em; }
.panel { border-radius: var(--radius-lg); }
/* an estimate is not an alarm: the tag stays visible, in the neutral ink, dashed */
.tag.est { color: var(--c-muted); background: var(--c-surface); border: 1px dashed var(--c-line-strong); }
/* the restaurant picker in the sidebar never clips a Latin name in a Hebrew page */
.um-pop select { text-overflow: ellipsis; padding-inline-end: 34px; }

/* today: four answers, each a link to where it is handled */
.today { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); }
@media (max-width: 860px) { .today { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.td-t { display: grid; gap: 2px; align-content: start; padding: var(--s-4) var(--s-4) var(--s-3); border-radius: var(--radius-lg); background: var(--c-surface); border: var(--border); text-decoration: none; color: var(--c-ink); position: relative; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.td-t:hover { border-color: var(--c-line-strong); box-shadow: var(--shadow-2); }
.td-t::before { content: ""; position: absolute; inset-block: 14px; inset-inline-start: 0; width: 3px; border-radius: 0 3px 3px 0; background: var(--c-line-strong); }
[dir=rtl] .td-t::before { border-radius: 3px 0 0 3px; }
.td-t.att::before { background: var(--c-warn); }
.td-t.good::before { background: var(--c-sage); }
.td-l { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--c-muted); }
.td-v { font-size: 28px; font-weight: var(--fw-semibold); line-height: 1.15; letter-spacing: -0.02em; text-align: start; }
.td-t.att .td-v { color: var(--c-warn); }
.td-s { font-size: var(--fs-xs); color: var(--c-muted); }

/* login: a forest panel with the light lockup, like the site's colour bands */
.auth { background: var(--c-bg); }
.pitch { background: var(--c-brand); color: #f3f1ea; border-radius: 20px; padding: clamp(28px, 4vw, 48px); display: grid; gap: var(--s-4); align-content: start; position: relative; overflow: hidden; }
.pitch .pitch-logo { height: 40px; width: auto; }
.pitch h1 { color: #fff; margin: var(--s-3) 0 0; }
.pitch p, .pitch .muted { color: #d7e4da; margin: 0; }
.pitch li { color: #eef2ec; }
.pitch li::before { color: var(--c-sage); }
.auth .card .brand img.lockup { height: 40px; }
:root[data-theme="dark"] .pitch { background: #12261d; border: 1px solid var(--c-line); }
@media (max-width: 820px) { .pitch { padding: 22px 24px 28px; gap: var(--s-2); } .pitch .pitch-logo { height: 30px; } .pitch h1 { font-size: 24px; line-height: 1.4; padding-bottom: 2px; } .pitch p { display: none; } }

/* welcome / first run */
.w-h { font-size: var(--fs-xl); font-weight: var(--fw-bold); }
.w-demo { display: grid; gap: var(--s-2); padding: var(--s-4); border-radius: var(--radius-md); background: var(--c-brand-soft); border: 1px solid var(--c-brand-line); }
.w-or { display: flex; align-items: center; gap: var(--s-3); color: var(--c-muted); font-size: var(--fs-sm); }
.w-or::before, .w-or::after { content: ""; flex: 1; border-top: var(--border); }

/* invoice check: proven finding, finding to check */
.wd-block { display: grid; gap: var(--s-2); padding: var(--s-4); border-radius: var(--radius-md); border: var(--border); background: var(--c-surface-2); }
.wd-h3 { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semibold); }
[dir=rtl] .td-v { text-align: right; }
@media (min-width: 1100px) { .brand img.lockup { height: 44px; } }
/* Sign in with Google */
.btn.google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: var(--c-surface); color: var(--c-ink); border: 1px solid var(--c-line-strong); font-weight: 600; text-decoration: none; }
.btn.google:hover { background: var(--c-surface-2); }
.btn.google .ico { width: 18px; height: 18px; }
.or { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--c-line); }

/* ================= guided tour (tour.js) ================= */
.tour { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: 1fr auto; align-items: center; justify-items: center; gap: 20px;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--c-bg) 72%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1);
  animation: tour-in .28s var(--ease) both; }
.tour.out { animation: tour-out .24s var(--ease) both; }
@keyframes tour-in { from { opacity: 0; } }
@keyframes tour-out { to { opacity: 0; } }
.tour-lift { align-self: end; display: grid; justify-items: center; max-width: 100%; pointer-events: none; }
.tour-lift > * { box-shadow: 0 30px 70px -30px rgba(18, 50, 36, .45); border-radius: var(--radius-lg); background: var(--c-surface); }
.tour-lift.in > * { animation: tour-pop .55s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes tour-pop { from { opacity: 0; transform: translateY(18px) scale(.9); } to { opacity: 1; transform: scale(1.04); } }
.tour-lift.in > * { transform: scale(1.04); }
.tour-art { display: grid; place-items: center; width: 132px; height: 132px; border-radius: 36px !important; }
.tour-art img { width: 88px; height: 88px; }
.tour-find { width: min(340px, 86vw); padding: 18px 20px; display: grid; gap: 6px; border: 1px solid var(--c-line); }
.tour-find-v { font-size: 40px; font-weight: 600; color: var(--c-warn); letter-spacing: -.02em; }
.tour-card { align-self: start; width: min(440px, 100%); text-align: center; display: grid; gap: 10px; }
.tour-h { margin: 0; font-size: clamp(26px, 6vw, 34px); line-height: 1.15; letter-spacing: -.02em; color: var(--c-ink); }
.tour-p { margin: 0; font-size: 17px; line-height: 1.55; color: var(--c-muted); }
.tour-acts { display: grid; gap: 8px; margin-top: 10px; }
.tour-acts .btn { width: 100%; min-height: 50px; font-size: 16px; }
.tour-dots { display: flex; gap: 6px; justify-content: center; }
.tour-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--c-line-strong); transition: width .3s var(--ease), background-color .3s; }
.tour-dots i.on { width: 20px; background: var(--c-brand); }
body.touring { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .tour, .tour.out, .tour-lift.in > * { animation: none; } }

/* ================= the Mida loader ================= */
.mloader { position: fixed; z-index: 90; inset-inline: 0; bottom: max(24px, env(safe-area-inset-bottom)); margin-inline: auto; width: max-content; display: flex; align-items: center; gap: 12px;
  padding: 10px 18px 10px 10px; border-radius: 999px; background: var(--c-surface); border: 1px solid var(--c-line); box-shadow: 0 20px 44px -18px rgba(18, 50, 36, .4);
  font-weight: 600; color: var(--c-ink); animation: ml-in .25s var(--ease) both; }
[dir="rtl"] .mloader { padding: 10px 10px 10px 18px; }
.mloader[hidden] { display: none; }
@keyframes ml-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.ml-orb { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--c-brand);
  background: radial-gradient(circle at 35% 30%, #ffffff, var(--c-brand-soft)); box-shadow: inset 0 0 0 1px var(--c-brand-line), 0 0 0 4px color-mix(in srgb, var(--c-sage) 18%, transparent);
  animation: ml-glow 1.6s ease-in-out infinite; }
.ml-orb svg { width: 32px; height: 32px; overflow: visible; }
.ml-ring { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-dasharray: 46 140; stroke-linecap: round; transform-origin: 32px 32px; animation: ml-spin 1.1s linear infinite; }
.ml-plate { transform-origin: 32px 32px; animation: ml-turn 2.4s cubic-bezier(.6, 0, .4, 1) infinite; }
@keyframes ml-spin { to { transform: rotate(360deg); } }
@keyframes ml-turn { 0%, 15% { transform: rotate(0); } 50%, 65% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }
@keyframes ml-glow { 50% { box-shadow: inset 0 0 0 1px var(--c-brand-line), 0 0 0 9px color-mix(in srgb, var(--c-sage) 8%, transparent); } }
@media (prefers-reduced-motion: reduce) { .ml-ring, .ml-plate, .ml-orb, .mloader { animation: none; } }
@media (max-width: 900px) { .mloader { bottom: calc(92px + env(safe-area-inset-bottom)); } } /* above the bottom tab bar */

/* the hands-on try after the tour */
.notice.coach { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; border-color: var(--accent); background: var(--accent-soft); font-size: 15px; }
.notice.coach .btn { margin-inline-start: auto; }
tr.try-hl td { background: var(--warn-soft); }
tr.try-hl td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
[dir="rtl"] tr.try-hl td:first-child { box-shadow: inset -4px 0 0 var(--warn); }
.tour-lift > .tour-vid { height: min(44vh, 380px); width: auto; aspect-ratio: 9 / 16; border-radius: 22px; display: block; background: #faf8f3; }

/* ---------- document upload zone (product recovery 14.11.2026) ---------- */
.dz { border: 2px dashed var(--line-strong); border-radius: var(--r); padding: 18px; display: grid; gap: 12px; background: var(--surface-2); transition: border-color var(--dur), background-color var(--dur); }
.dz.over { border-color: var(--accent); background: var(--accent-soft); }
.dz-target { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 14px 8px; cursor: pointer; border-radius: var(--r-sm); }
.dz-target:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dz-ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--surface); color: var(--accent); }
.dz-ico svg { width: 24px; height: 24px; }
.dz-t { font-weight: 700; font-size: 17px; }
.dz-s { color: var(--muted); font-size: 14px; max-width: 42ch; }
.dz-btn { margin-top: 6px; pointer-events: none; }
.dz-consent { align-items: flex-start; font-size: 14px; }
.dz-file { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; }
.dz-file img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.dz-pdf { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-weight: 800; font-size: 13px; flex: none; }
.dz-meta { display: grid; min-width: 0; flex: 1; } .dz-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-prog { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: start; }
.dz-prog[hidden] { display: none; }
.dz-prog-t { display: grid; gap: 8px; flex: 1; min-width: 0; }
.dz-msg { font-size: 15px; font-weight: 600; line-height: 1.35; }
/* the Mida mark rolls while a document is on its way and being read */
.mida-load { flex: none; width: 56px; height: 56px; display: grid; place-items: center; }
.mida-load svg { width: 100%; height: 100%; overflow: visible; }
.mida-load .body { fill: var(--accent); } .mida-load .slice { fill: #8DBE9D; transform-origin: 32px 32px; animation: midaSlice 2.4s cubic-bezier(.65, 0, .35, 1) infinite; }
.mida-load .roll { transform-origin: 32px 32px; animation: midaRoll 2.4s cubic-bezier(.65, 0, .35, 1) infinite; }
.mida-load .orbit { fill: none; stroke: #8DBE9D; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 40 150; transform-origin: 32px 32px; animation: midaOrbit 1.6s linear infinite; opacity: .9; }
@keyframes midaRoll { 0% { transform: rotate(0) scale(.82); } 55% { transform: rotate(360deg) scale(.82); } 100% { transform: rotate(360deg) scale(.82); } }
@keyframes midaSlice { 0%, 55% { translate: 0 0; } 75% { translate: 3px -3px; } 100% { translate: 0 0; } }
@keyframes midaOrbit { to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) { .mida-load .roll, .mida-load .slice, .mida-load .orbit { animation: none; } .mida-load .orbit { stroke-dasharray: none; opacity: .35; } }
.dz-prog .bar { height: 8px; border-radius: 99px; background: var(--surface-3, var(--line)); overflow: hidden; }
.dz-prog .bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .2s; }
.dz-prog .bar.wait i { width: 100% !important; background: linear-gradient(90deg, var(--accent) 0 40%, var(--accent-soft) 50%, var(--accent) 60% 100%); background-size: 200% 100%; animation: dzwait 1.2s linear infinite; }
@keyframes dzwait { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .dz-prog .bar.wait i { animation: none; } }
details.paste > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 15px; padding: 4px 0; }
details.paste[open] { display: grid; gap: 10px; }

/* ---------- invoice review: header as printed, the document, how sure the reading is ---------- */
.ih-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .ih-grid { grid-template-columns: 1fr; } }
.hdr-f { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 600px) { .hdr-f { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hdr-f .f > span { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hdr-f .pill { font-size: 12px; padding: 2px 8px; }
.rd-h { margin: 14px 0 4px; font-size: 15px; }
.rd { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: 14px; }
.ih-doc > summary { cursor: pointer; font-weight: 700; margin-bottom: 8px; }
.docv { display: grid; gap: 6px; }
.docv iframe, .docv img { width: 100%; height: 460px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; object-fit: contain; }
@media (max-width: 600px) { .docv iframe, .docv img { height: 320px; } }
.mk-ing { margin-top: 8px; display: grid; gap: 8px; }
.mk-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
@media (max-width: 600px) { .mk-form { grid-template-columns: 1fr; } }
/* menu preview on a phone: every field stays inside its card (the description field was pushing the page sideways) */
@media (max-width: 699px) {
  #m-out .tw.cards tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #m-out .tw.cards td input:not([type=checkbox]) { width: 100% !important; min-width: 0; box-sizing: border-box; }
  #m-out .tw.cards td:nth-child(2), #m-out .tw.cards td:nth-child(4) { grid-column: 1 / -1; }
}

/* ---------- insights: one card per finding (what changed → dishes → check → do → basis) ---------- */
.ins-sec { display: grid; gap: 16px; } .ins-sec > h2 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ins { background: var(--surface); border: var(--border); border-inline-start: 4px solid var(--bad); border-radius: var(--radius-lg); padding: var(--s-5); display: grid; gap: 14px; min-width: 0; box-shadow: var(--shadow-1); }
.ins.drop { border-inline-start-color: var(--ok); }
.ins-h { display: flex; gap: 14px; align-items: flex-start; }
.ins-h h3 { margin: 0; font-size: 18px; font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
.ins-ar { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; background: var(--bad-soft); color: var(--bad); }
.ins-ar.down { background: var(--ok-soft); color: var(--ok); }
.ins-px { font-size: 20px; margin-top: 4px; } .ins-px .muted { font-size: 14px; }
.ins-lead { margin: 0; font-size: 15px; }
.ins-b h4 { margin: 0 0 6px; font-size: 14px; font-weight: var(--fw-semibold); color: var(--muted); }
.ins-b ul, .ins-basis ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: 14px; }
.ins-acts { flex-wrap: wrap; gap: 8px; } .ins-acts .btn { white-space: normal; text-align: start; height: auto; min-height: var(--tap-min); }
.ins-basis { border-top: 1px dashed var(--line-strong); padding-top: 10px; font-size: 14px; }
.ins-basis > summary { cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); min-height: 32px; }
.ins-basis[open] > summary { margin-bottom: 8px; }
.ins-bar { height: 10px; border-radius: 99px; background: var(--c-surface-3); overflow: hidden; } .ins-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.ins-next { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius-md); padding: 12px 14px; font-size: 15px; }
.ins-dash .ins { box-shadow: none; padding: 16px; } .ins-dash .ins .btn { justify-self: start; }
.ins-foot { margin: 0; }
td input.need, input.need { border-color: var(--warn); background: var(--warn-soft); }
@media (max-width: 699px) { .ins { padding: 16px; } .ins-h h3 { font-size: 17px; } .ins-px { font-size: 18px; } .ins-acts .btn { width: 100%; } }
@media (max-width: 899px) { .ins td a, .ins-dash a.small, .ins-h .sub a { display: inline-flex; align-items: center; min-height: 48px; min-width: 48px; } }

/* ===== Finish layer (owner, 15.11.2026): the app stays light, calm and readable for a full day of work.
   The premium feel comes from small things: a faint geometric grid behind titles and empty screens,
   soft depth on cards, a clear headline number, and quiet motion. No dark look here. ===== */
:root:not([data-theme="dark"]) {
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 1px 2px rgba(29, 74, 55, .05), 0 8px 24px -18px rgba(29, 74, 55, .22);
  --shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 2px 4px rgba(29, 74, 55, .05), 0 18px 40px -24px rgba(29, 74, 55, .28);
  --grid-ink: rgba(29, 74, 55, .075);
}
:root[data-theme="dark"] { --grid-ink: rgba(143, 196, 165, .07); }
/* a faint grid that fades out, behind the page title */
.page-h { position: relative; isolation: isolate; padding-block: 10px 14px; }
.page-h::before { content: ""; position: absolute; z-index: -1; inset: -18px 0 -6px; pointer-events: none; border-radius: 18px;
  background-image: linear-gradient(var(--grid-ink) 1px, transparent 1px), linear-gradient(90deg, var(--grid-ink) 1px, transparent 1px); background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 92%); mask-image: linear-gradient(to bottom, #000, transparent 92%); }
.page-h h1 { letter-spacing: -.025em; }
.page-h h1::after { content: ""; display: block; width: 44px; height: 3px; margin-top: 10px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #8dbe9d); }
[dir=rtl] .page-h h1::after { background: linear-gradient(270deg, var(--accent), #8dbe9d); }
/* empty screens: the same grid, and a mark with a soft ring */
.empty { position: relative; isolation: isolate; border-radius: 16px; overflow: hidden; }
.empty::before { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid-ink) 1px, transparent 1px), linear-gradient(90deg, var(--grid-ink) 1px, transparent 1px); background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(70% 80% at 50% 40%, #000, transparent); mask-image: radial-gradient(70% 80% at 50% 40%, #000, transparent); }
.empty .em-ico { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent-soft) 55%, transparent), 0 10px 24px -12px rgba(29, 74, 55, .35); border-radius: 16px; }
/* cards: soft depth, and the headline numbers stand out */
.panel, .kpi { transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease; }
.kpi { position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset-block: 14px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--line-strong); }
.kpi.ok::before { background: var(--ok); } .kpi.bad::before { background: var(--bad); }
.kpi .v { font-size: clamp(28px, 3.2vw, 38px); font-weight: 700; }
@media (hover: hover) { .kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); } }
/* the main button: a little depth, and it answers a press */
.btn { transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .12s ease; }
.btn.primary { background-image: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0)); box-shadow: 0 1px 0 rgba(255, 255, 255, .16) inset, 0 8px 18px -10px color-mix(in srgb, var(--cta) 70%, transparent); }
.btn:not(:disabled):active { transform: scale(.98); }
/* the upload zone: the grid inside, fading down */
.dz { position: relative; isolation: isolate; }
.dz::before { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; border-radius: inherit;
  background-image: linear-gradient(var(--grid-ink) 1px, transparent 1px), linear-gradient(90deg, var(--grid-ink) 1px, transparent 1px); background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(80% 90% at 50% 0, #000, transparent); mask-image: radial-gradient(80% 90% at 50% 0, #000, transparent); }
/* a screen eases in after it is drawn */
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
.main.in > * { animation: pageIn .32s cubic-bezier(.2, .7, .2, 1) both; }
.main.in > *:nth-child(2) { animation-delay: .04s; } .main.in > *:nth-child(3) { animation-delay: .08s; } .main.in > *:nth-child(n+4) { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) { .main.in > * { animation: none; } .kpi, .panel, .btn { transition: none; } }

/* dishes arriving one by one while a menu is being read */
.live { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.live li { display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); animation: liveIn .35s cubic-bezier(.2, .7, .2, 1) both; }
.live li b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
@keyframes liveIn { from { opacity: 0; transform: translateY(6px); background: var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) { .live li { animation: none; } }

/* Quick recipe build: the restaurant's own ingredients as large tap targets */
.qb { display: grid; gap: 8px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2); }
.qb-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 190px; overflow-y: auto; padding: 2px; }
.qb-chips .chip { min-height: 40px; padding: 8px 14px; font-size: 14px; cursor: pointer; color: var(--ink); background: var(--surface); font-family: inherit; }
.qb-chips .chip:hover { border-color: var(--accent); }
.qb-chips .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.qb-chips .chip.on::before { content: "✓ "; }
@media (max-width: 640px) { .qb-chips .chip { min-height: 44px; } }

/* ---------- polish 17.11: one intake, quieter lines, clearer hierarchy ---------- */
.dz { position: relative; overflow: hidden; border: 1.5px dashed var(--c-brand-line); border-radius: var(--radius-lg); padding: var(--s-5);
  background: linear-gradient(var(--c-surface-2), var(--c-surface)) padding-box; }
.dz::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image: linear-gradient(var(--c-line) 1px, transparent 1px), linear-gradient(90deg, var(--c-line) 1px, transparent 1px);
  background-size: 28px 28px; -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 72%); mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 72%); }
.dz > * { position: relative; }
.dz.over { border-style: solid; border-color: var(--c-brand); background: var(--c-brand-soft); }
.dz-target { padding: var(--s-5) var(--s-3); gap: var(--s-2); }
.dz-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--c-brand); color: var(--c-brand-ink); box-shadow: var(--shadow-2); }
.dz-ico svg { width: 26px; height: 26px; }
.dz-t { font-size: var(--fs-lg); letter-spacing: var(--tracking-tight); }
.dz-btn { min-height: 52px; padding-inline: 28px; font-size: 16px; margin-top: var(--s-2); }
.dz-target:hover .dz-btn { background: var(--c-brand-hover); }
.dz-consent { background: var(--c-surface); border: var(--border); border-radius: var(--radius-md); padding: 10px 12px; }
details.paste > summary { cursor: pointer; color: var(--c-muted); font-size: var(--fs-sm); min-height: 44px; display: flex; align-items: center; }
details.paste[open] > summary { margin-bottom: var(--s-2); }

/* invoice lines: one tidy row each instead of a tall card */
.ilines { gap: var(--s-2); }
.iline { border-radius: var(--radius-md); padding: 14px 16px; gap: 10px; box-shadow: none; }
.iline.open { background: color-mix(in srgb, var(--c-warn-soft) 55%, var(--c-surface)); }
.iline .sub.num { font-variant-numeric: tabular-nums; }
.iline .f.small { gap: 4px; }
.iline .mk-ing { margin-top: 0; }
.ilines .mk-form { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
@media (min-width: 861px) { .ilines .iline { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); align-items: center; } .ilines .iline > .sub, .ilines .iline > .decide, .ilines .iline > .mk-ing { grid-column: 1 / -1; } }
.mk-all { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; background: var(--c-brand-soft); border-color: var(--c-brand-line); }
.mk-all .btn { white-space: normal; }
@media (max-width: 699px) { .mk-all .btn { width: 100%; } }

/* invoice review, 17.11: summary row for the header, sticky approve bar */
.inv-head > .ih-sum { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; min-height: 44px; list-style: none; }
.inv-head > .ih-sum::-webkit-details-marker { display: none; }
.inv-head > .ih-sum::before { content: "▸"; color: var(--c-muted); } .inv-head[open] > .ih-sum::before { content: "▾"; }
.inv-head[open] > .ih-sum { margin-bottom: var(--s-4); }
.vbar { position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--c-surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: var(--border-strong); border-radius: var(--radius-lg); padding: 10px 14px; box-shadow: var(--shadow-3); }
.vbar-s { font-size: var(--fs-sm); }
.vbar .row { gap: var(--s-2); }
@media (max-width: 699px) { .vbar { bottom: calc(76px + env(safe-area-inset-bottom)); } .vbar .row { width: 100%; } .vbar .btn.primary { flex: 1; } }

/* night: the page itself carries the site's faint grid */
:root[data-theme="dark"] body { background-color: var(--c-bg); background-image: linear-gradient(rgba(141,190,157,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(141,190,157,.045) 1px, transparent 1px); background-size: 44px 44px; background-attachment: fixed; }
:root[data-theme="dark"] .dz-ico { color: var(--c-brand-ink); }
:root[data-theme="dark"] .docv img, :root[data-theme="dark"] .docv iframe { background: #fff; }
:root[data-theme="dark"] .brand img.lockup { content: url(/brand/lockup-en-on-dark.svg); border-radius: 8px; } /* opt-in night: the official on-dark lockup, unmodified */

/* login screen: language switcher in the top corner, invite alert box, room above the phone's browser bar */
.auth { position: relative; }
.auth-lang { position: absolute; top: max(12px, env(safe-area-inset-top)); inset-inline-start: 16px; z-index: 2; padding: 2px; }
.auth-lang button { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.auth-alert:empty { display: none; }
.auth-alert { background: var(--bad-soft); border: 1px solid var(--bad); border-radius: 10px; padding: 12px 14px; line-height: 1.6; overflow-wrap: anywhere; }
.auth-alert a { color: inherit; font-weight: var(--fw-bold); text-decoration: underline; }
.auth-switch { justify-self: center; text-align: center; }
@media (max-width: 820px) {
  .auth { min-height: 100dvh; place-items: start center; align-content: start; padding: 60px 16px calc(32px + env(safe-area-inset-bottom)); }
  .auth .card { padding: 24px 20px; gap: 14px; }
  .auth-switch { margin-bottom: 24px; }
}

/* admin: pilot requests (tabs, roomy rows for a thumb, WhatsApp next to the phone, approved/declined rows slide away) */
.ld-tabs { gap: 8px; margin-block-end: 8px; }
.events.leads > div { flex-wrap: wrap; align-items: center; padding-block: 14px; overflow: hidden; }
.events.leads .row .btn.sm { min-height: 48px; }
.events.leads > div > div:empty { display: none; }
.ld-phone { display: inline-flex; align-items: center; gap: 6px; }
.wa-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #1a8a47; color: #fff; flex: none; }
.wa-btn:hover { background: #157a3d; } .wa-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wa-cta { background: #1a8a47; color: #fff; border-color: #1a8a47; }
.ld-done { border: 1px solid var(--ok); background: var(--ok-soft); border-radius: var(--r-sm); padding: 8px 12px; margin-block-end: 10px; }
.events.leads > div.ld-out { transition: max-height .3s ease, opacity .25s ease, transform .3s ease, padding .3s ease; max-height: 0 !important; opacity: 0; transform: translateX(-24px); padding-block: 0; border-bottom-width: 0; }
@media (max-width: 640px) { .events.leads > div { padding-block: 18px; gap: 10px; } }
@media (prefers-reduced-motion: reduce) { .events.leads > div.ld-out { transition: none; } }
