/* Tiffin Desk — tiffin-steel greys, bottle green for action, haldi saffron for money still owed. */
:root {
  color-scheme: light;
  --bg: #E9EDEB;          /* steel */
  --surface: #FFFFFF;
  --surface-2: #F4F6F5;
  --ink: #13221C;
  --ink-2: #4E5E57;
  --ink-3: #7A8882;
  --line: #D6DDDA;
  --green: #0F6B4F;       /* action */
  --green-ink: #0B5640;
  --green-soft: #DCEEE6;
  --haldi: #B9780A;       /* owed (text-safe) */
  --haldi-mark: #D8930F;  /* owed (marks) */
  --haldi-soft: #FBEFD5;
  --chili: #B3322A;
  --chili-soft: #F8E1DE;
  --series-1: #16805F;
  --series-2: #D8930F;
  --series-3: #5B6CD6;
  --heat-empty: #EEF1F0;
  --paper: #FFFFFF;
  --r-lg: 18px; --r-md: 12px; --r-sm: 8px;
  --shadow: 0 1px 0 rgba(19,34,28,.06), 0 6px 20px -12px rgba(19,34,28,.25);
  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0F1513; --surface: #18201D; --surface-2: #1F2925; --ink: #E8EFEC; --ink-2: #A9B7B1; --ink-3: #7F8D87;
    --line: #2C3833; --green: #2FA37C; --green-ink: #6CD3AD; --green-soft: #173A2E; --haldi: #EDB44A; --haldi-mark: #D2951C;
    --haldi-soft: #3A2C10; --chili: #F08A80; --chili-soft: #3D1D1A; --series-1: #2FA37C; --series-2: #D2951C; --series-3: #8C99F0;
    --heat-empty: #222C28; --shadow: 0 1px 0 rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in oklab, var(--green) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; display: flex; align-items: center; gap: 10px; }
.brand { font-weight: 800; font-size: 19px; letter-spacing: -0.02em; margin-right: auto; display: flex; align-items: center; gap: 8px; }
.brand svg { width: 26px; height: 26px; }
.sync { font-size: 13px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--series-1); display: inline-block; }
.sync.saving i { background: var(--haldi-mark); }
.sync.offline i, .sync.error i { background: var(--chili); }
main { min-width: 0; padding: 4px 16px calc(96px + var(--safe-b)); max-width: 1080px; width: 100%; margin: 0 auto; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); }
.tabs button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 12px; font-weight: 600; color: var(--ink-3); border-radius: 12px; }
.tabs button svg { width: 24px; height: 24px; }
.tabs button[aria-current="page"] { color: var(--green); }
.tabs button[aria-current="page"] svg { stroke-width: 2.4; }
@media (min-width: 900px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .top { grid-column: 1 / -1; padding: 14px 28px; }
  .tabs { position: sticky; top: 64px; align-self: start; grid-template-columns: 1fr; border: 0; background: none; padding: 8px 12px; gap: 2px; }
  .tabs button { grid-auto-flow: column; justify-content: start; gap: 12px; font-size: 15px; padding: 10px 14px; }
  .tabs button[aria-current="page"] { background: var(--surface); box-shadow: var(--shadow); }
  main { padding: 8px 28px 48px; }
}

/* ---------- Type ---------- */
h1 { font-size: 28px; line-height: 1.1; letter-spacing: -0.025em; margin: 6px 0 4px; font-weight: 800; }
h2 { font-size: 18px; letter-spacing: -0.01em; margin: 0; font-weight: 700; }
h3 { font-size: 15px; margin: 0; font-weight: 700; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: 14px; }
p { margin: 0 0 10px; max-width: 64ch; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; white-space: nowrap; }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:active { background: var(--green-ink); }
.btn.ghost { background: none; border-color: transparent; }
.btn.danger { color: var(--chili); }
.btn.block { width: 100%; }
.btn.big { min-height: 54px; font-size: 17px; border-radius: 14px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.icon-btn svg { width: 22px; height: 22px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip .n { font-weight: 500; opacity: .7; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; margin: 0 -16px; padding-inline: 16px; }
.chips::-webkit-scrollbar { display: none; }
.week-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; font: inherit; font-weight: 800; font-size: 28px; letter-spacing: -0.025em; padding: 0; text-align: left; color: var(--ink); }
.week-btn svg { width: 22px; height: 22px; color: var(--ink-3); flex: none; }
input[type=text], input[type=tel], input[type=search], input[type=number], input[type=password], input[type=date], input[type=datetime-local], select, textarea {
  min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 8px 12px; width: 100%; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: -1px; }
label.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 12px; width: 20px; height: 20px; color: var(--ink-3); }
.search input { padding-left: 40px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 12px; }
.spacer { height: 12px; }
.check { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--line); display: inline-grid; place-items: center; background: var(--surface); flex: none; }
.check svg { width: 18px; height: 18px; opacity: 0; color: #fff; }
.check.on { background: var(--green); border-color: var(--green); }
.check.on svg { opacity: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); min-height: 34px; }
.seg button[aria-pressed="true"] { background: var(--green-soft); color: var(--green-ink); }

/* ---------- Surfaces ---------- */
.panel { background: var(--surface); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.panel + .panel, .panel + .grid2, .grid2 + .panel { margin-top: 14px; }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge svg { width: 13px; height: 13px; }
.badge.paid { background: var(--green-soft); color: var(--green-ink); }
.badge.owed { background: var(--haldi-soft); color: var(--haldi); }
.badge.warn { background: var(--chili-soft); color: var(--chili); }
.badge.plain { background: var(--surface-2); color: var(--ink-2); }
.empty { text-align: center; padding: 40px 16px; }
.empty svg { width: 56px; height: 56px; color: var(--ink-3); }
.empty h2 { margin: 10px 0 6px; }
.empty p { margin: 0 auto 16px; }

/* ---------- Money hero ---------- */
.till { background: var(--ink); color: #F4F7F5; border-radius: 22px; padding: 18px 18px 16px; position: relative; overflow: hidden; }
@media (prefers-color-scheme: dark) { .till { background: #0A3B2C; } }
.till .lbl { font-size: 14px; color: #B9C6C0; }
.till .amt { font-size: 46px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; margin: 2px 0 12px; }
.till .bar { display: flex; height: 12px; gap: 2px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.12); }
.till .bar i { display: block; height: 100%; }
.till .split { display: flex; justify-content: space-between; margin-top: 10px; font-size: 14px; gap: 10px; }
.till .split b { display: block; font-size: 18px; color: #fff; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.kpi .k { font-size: 13px; color: var(--ink-2); }
.kpi .d { font-size: 12px; font-weight: 600; margin-top: 2px; }
.up { color: var(--green-ink); } .down { color: var(--chili); }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; max-height: 300px; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .hit { cursor: crosshair; }
.chart .hit.on { fill: color-mix(in oklab, var(--ink) 6%, transparent); }
.chart.heat .hit.on { stroke: var(--ink); stroke-width: 1.5; }
.heat-wrap { overflow-x: auto; }
.heat-wrap .chart { min-width: 0; }
#charttip { position: fixed; z-index: 90; display: none; pointer-events: none; background: var(--ink); color: var(--surface); padding: 6px 10px; border-radius: 8px; font-size: 13px; line-height: 1.35; max-width: 240px; box-shadow: 0 8px 24px -8px rgba(0,0,0,.4); }
#charttip div:first-child { font-weight: 700; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; font-size: 15px; }
.hbar .track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1); }
.hbar .val { font-weight: 700; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Order cards ---------- */
.list { display: grid; gap: 8px; }
.ocard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); border: 2px solid transparent; text-align: left; width: 100%; }
.ocard.sel { border-color: var(--green); }
.ocard .no { font-weight: 800; font-size: 15px; color: var(--ink-3); min-width: 30px; }
.ocard .nm { font-weight: 700; font-size: 17px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocard .it { font-size: 14px; color: var(--ink-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ocard .meta { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.ocard .amt { font-weight: 800; font-size: 18px; text-align: right; }
.ocard .body { min-width: 0; }
.selbar { position: fixed; left: 12px; right: 12px; bottom: calc(76px + var(--safe-b)); z-index: 35; background: var(--ink); color: var(--surface); border-radius: 18px; padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 8px; box-shadow: 0 14px 30px -10px rgba(0,0,0,.45); animation: rise .18s ease-out; }
.selbar .btn { border-color: transparent; }
.selbar .btn.ghost { color: var(--surface); }
@media (min-width: 900px) { .selbar { left: 260px; right: 28px; bottom: 20px; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0 } }

/* ---------- Pay sheet (spreadsheet) ---------- */
.sheet-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: 16px; overflow: clip; box-shadow: var(--shadow); }
.sheet-table th { position: sticky; top: 60px; background: var(--surface-2); font-size: 13px; text-align: left; color: var(--ink-2); font-weight: 700; padding: 10px 10px; z-index: 2; border-bottom: 1px solid var(--line); }
.sheet-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sheet-table tr:last-child td { border-bottom: 0; }
.sheet-table tr.paid td { background: color-mix(in oklab, var(--green-soft) 45%, var(--surface)); }
.sheet-table .r { text-align: right; }
.sheet-table { table-layout: fixed; }
.sheet-table td.nm { font-weight: 600; overflow: hidden; }
.sheet-table td.nm .cellbtn { display: block; width: 100%; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-table .seg { margin-top: 4px; }
.sheet-table .seg button { min-height: 28px; padding: 2px 10px; font-size: 12px; }
.sheet-table button.cellbtn { border: 0; background: none; padding: 4px; display: inline-flex; }
.sheet-table tfoot td { font-weight: 800; background: var(--surface-2); }

/* ---------- Kitchen ---------- */
.cook { display: grid; gap: 8px; }
.cookrow { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.cookrow > button { width: 100%; border: 0; background: none; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; text-align: left; }
.cookrow .q { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; text-align: right; line-height: 1; }
.cookrow .q small { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; margin-top: 3px; }
.cookrow .n { font-weight: 700; font-size: 17px; }
.cookrow .who { padding: 0 14px 12px 90px; font-size: 14px; color: var(--ink-2); line-height: 1.6; }

/* ---------- Receipts (the signature element) ---------- */
.slips { display: grid; gap: 18px; justify-items: center; padding: 6px 0 10px; }
.slip { width: auto; max-width: 100%; background: var(--paper); color: #111; font: clamp(8.5px, 2.55vw, 12.5px)/1.45 var(--mono); padding: 16px 16px 22px; position: relative; filter: drop-shadow(0 10px 14px rgba(19,34,28,.16)); }
.slip::before, .slip::after { content: ""; position: absolute; left: 0; right: 0; height: 10px; background:
  linear-gradient(-45deg, transparent 6px, var(--paper) 0) 0 0 / 12px 10px repeat-x,
  linear-gradient(45deg, transparent 6px, var(--paper) 0) 0 0 / 12px 10px repeat-x; }
.slip::before { top: -9px; transform: scaleY(-1); }
.slip::after { bottom: -9px; }
.slip .r { white-space: pre; overflow: hidden; }
.slip .c { text-align: center; } .slip .b { font-weight: 700; }
.slip .big { font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; }
.slip .tall { transform: scaleY(1.8); transform-origin: 0 0; height: 2em; } /* printer doubles the height, not the width */
.slip .big.tall { transform: none; height: auto; }
.slip .rule { border-top: 1.5px dashed #444; margin: 6px 0; }
.slip .cutline { position: absolute; left: -8px; right: -8px; bottom: -20px; border-top: 1px dashed var(--ink-3); }
.slip-count { font-size: 13px; color: var(--ink-3); text-align: center; }
.slip.fly { animation: fly .5s cubic-bezier(.3,.7,.2,1) both; }
@keyframes fly { to { transform: translateY(-30px) rotate(-3deg); opacity: 0; } }

/* ---------- Sheets (bottom drawers) ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(10,18,15,.45); animation: fade .15s ease-out; }
.drawer { position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 92dvh; background: var(--bg); border-radius: 22px 22px 0 0; display: grid; grid-template-rows: auto 1fr auto; animation: up .22s cubic-bezier(.2,.8,.2,1); }
.drawer.full { top: 0; max-height: none; border-radius: 0; }
@media (min-width: 760px) { .drawer { left: 50%; right: auto; width: 620px; transform: translateX(-50%); bottom: 24px; border-radius: 22px; max-height: 88dvh; animation: fade .15s; } .drawer.full { top: 24px; } }
.drawer-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.drawer-h h2 { flex: 1; font-size: 19px; }
.drawer-b { overflow-y: auto; padding: 14px 16px; -webkit-overflow-scrolling: touch; }
.drawer-f { padding: 10px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 10px; background: var(--bg); }
@keyframes up { from { transform: translateY(40px); opacity: .4 } }
@keyframes fade { from { opacity: 0 } }

.lines { display: grid; gap: 8px; }
.lineitem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; background: var(--surface); border-radius: 12px; padding: 8px 10px; }
.lineitem.unsure { box-shadow: inset 3px 0 0 var(--haldi-mark); }
.lineitem .raw { font-size: 13px; color: var(--ink-3); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 38px; height: 38px; border: 0; background: var(--surface-2); font-size: 20px; font-weight: 700; display: grid; place-items: center; }
.stepper span { min-width: 34px; text-align: center; font-weight: 800; }
.unmatched { background: var(--haldi-soft); border-radius: 12px; padding: 10px; display: grid; gap: 8px; }
.unmatched .raw { font-weight: 600; }
.wa { background: #E3F4E6; color: #14281C; border-radius: 4px 14px 14px 14px; padding: 8px 12px; font-size: 14px; white-space: pre-wrap; position: relative; max-width: 92%; }
@media (prefers-color-scheme: dark) { .wa { background: #1E3A2A; color: #E3F4E6; } }
.wa time { display: block; font-size: 11px; opacity: .65; margin-top: 4px; text-align: right; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.method-list { display: grid; gap: 8px; }
.method { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; background: var(--surface); border-radius: 14px; padding: 12px; border: 2px solid transparent; text-align: left; width: 100%; }
.method[aria-pressed="true"] { border-color: var(--green); }
.method .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); margin-top: 1px; }
.method[aria-pressed="true"] .radio { border: 7px solid var(--green); }
.method .t { font-weight: 700; }
.method .h { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.method:disabled { opacity: .45; }
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--green); }
.drop { border: 2px dashed var(--line); border-radius: 18px; padding: 28px 16px; text-align: center; background: var(--surface); display: block; cursor: pointer; }
.drop svg { width: 44px; height: 44px; color: var(--green); }
.drop.over { border-color: var(--green); background: var(--green-soft); }
.weeklist { display: grid; gap: 8px; }
.weekopt { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 14px; padding: 12px; border: 2px solid transparent; width: 100%; text-align: left; }
.weekopt[aria-pressed="true"] { border-color: var(--green); }
.dishrow { display: grid; grid-template-columns: auto minmax(0, 1fr) 92px; gap: 10px; align-items: center; background: var(--surface); border-radius: 12px; padding: 8px 10px; }
.dishrow.off { opacity: .5; }
.dishrow input[type=number] { text-align: right; }
.dishrow .nm input { border-color: transparent; padding-left: 4px; font-weight: 600; background: transparent; }
.dishrow .nm input:focus { border-color: var(--line); background: var(--surface); }
.dishrow .sub { font-size: 12px; color: var(--ink-3); padding-left: 4px; }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green); transition: width .2s; }
.menu-list { display: grid; gap: 8px; }
.mitem { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto; gap: 10px; align-items: center; background: var(--surface); border-radius: 12px; padding: 8px 10px 8px 14px; }
.mitem .nm { font-weight: 600; }
.mitem .sub { font-size: 12px; color: var(--ink-3); }
.mitem input[type=number] { text-align: right; }

#toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--surface); padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 15px; z-index: 100; opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100vw - 32px); box-shadow: 0 12px 28px -10px rgba(0,0,0,.5); }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
#toast button { margin-left: 12px; background: none; border: 0; color: #8fe3c3; font-weight: 700; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login .box { width: 100%; max-width: 360px; }
.login .mark { width: 64px; height: 64px; margin-bottom: 18px; }
.login h1 { font-size: 34px; }
.err { color: var(--chili); font-size: 14px; font-weight: 600; }

.tablewrap { }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.note { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--ink-2); }
.note.warn { background: var(--haldi-soft); color: var(--ink); }
a { color: var(--green-ink); }

html, body { overflow-x: hidden; }
@media (max-width: 420px) { .top .btn span { display: none; } .top .btn { padding: 0 12px; } .sync .sync-t { display: none; } }
.sheet-table tr { scroll-margin-top: 120px; } .ocard { scroll-margin-bottom: 160px; }

/* Rules page */
.tabs .wide { display: none; }
@media (min-width: 900px) { .tabs .wide { display: grid; } }
.rulecard { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.rulecard.off { opacity: .6; }
.rules-list { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; max-width: 70ch; }
.rules-list li { line-height: 1.5; }

@media (min-width: 900px) { .narrow-only { display: none !important; } }

/* ---- phone polish ---- */
/* bigger invisible tap area around small checkboxes (looks the same, easier to hit with a thumb) */
button.check { position: relative; }
button.check::after { content: ""; position: absolute; inset: -9px; }
/* segmented filters never squash into two lines; they scroll sideways instead */
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { white-space: nowrap; flex: none; min-height: 40px; }
/* weekly menu rows: name | price | remove */
.wmrow { display: grid; grid-template-columns: minmax(0, 1fr) 84px 84px 44px; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.wmrow input { text-align: right; }
.cook .q small { font-size: 12px; }
.hide-narrow { display: none; }
@media (min-width: 600px) { .hide-narrow { display: inline; } }
.sheet-table td .cellbtn { min-height: 40px; }
.wmrow .sub { font-size: 13px; color: var(--ink-3); }
.panel, .stack, .field { min-width: 0; }
select, textarea, input { max-width: 100%; }
.stack > .btn { white-space: normal; }

.acct-lines { display: grid; gap: 6px; }
.acct-line { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.acct-line .cellbtn { border: 0; background: none; padding: 4px 0; box-shadow: none; }

.wmhead { border: 0; background: none; padding: 0 10px; font-size: 12px; color: var(--ink-3); }
.stockrow { display: grid; grid-template-columns: minmax(0, 1.6fr) 92px minmax(92px, auto); grid-template-areas: "nm cap st" "nm sp sq" ". sps sps"; gap: 6px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.stockrow .nm { grid-area: nm; min-width: 0; }
.stockrow .nm .sub { font-size: 13px; color: var(--ink-3); }
.stockrow .a-cap { grid-area: cap; } .stockrow .a-st { grid-area: st; } .stockrow .a-sp { grid-area: sp; } .stockrow .a-sq { grid-area: sq; }
.stockrow .a-sps { grid-area: sps; text-align: right; }
.stockrow .mini { display: grid; gap: 2px; font-size: 12px; color: var(--ink-3); }
.stockrow .mini input { min-height: 40px; text-align: right; }
@media (max-width: 560px) {
  .stockrow { grid-template-columns: 1fr 1fr; grid-template-areas: "nm nm" "cap st" "sp sq" "sps sps"; }
  .wmrow { grid-template-columns: minmax(0, 1fr) 72px 72px 40px; }
}
