/* One narrow column built for a phone at the prep table. */
:root {
  --bg: #f3f4f2; --surface: #ffffff; --ink: #1d2124; --muted: #646d72; --line: #d9ddd9;
  --bark: #7a2a1d; --bark-soft: #f1e1dc; --on-bark: #ffffff;
  --good: #2f6b3a; --warn: #9a6a00; --bad: #a3271b;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #15181a; --surface: #1e2225; --ink: #e8eae7; --muted: #9aa3a7; --line: #33393d;
  --bark: #e0866f; --bark-soft: #3a2420; --on-bark: #15181a; --good: #7fc38a; --warn: #e2b54f; --bad: #f08a7e; color-scheme: dark } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.wrap { max-width: 720px; margin: 0 auto; padding-inline: 16px; padding-block: 16px 48px; display: grid; gap: 22px; }
.wrap.login { max-width: 400px; padding-block: 12vh 48px; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: .01em; margin: 0; text-wrap: balance; }
h1 { font-size: 2.1rem; line-height: 1; }
h2 { font-size: 1.35rem; text-transform: uppercase; letter-spacing: .06em; }
p { margin: 0; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

header { display: grid; gap: 10px; }
.toprow { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.toprow h1 { flex: 1; }
.weekbar { display: flex; align-items: center; gap: 8px; }
.weekbar .label { flex: 1; min-width: 0; font-family: var(--display); font-size: 1.25rem; font-weight: 600; }
button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--bark); outline-offset: 2px; }
button.primary { background: var(--bark); border-color: var(--bark); color: var(--on-bark); font-weight: 600; }
button.link { border: 0; background: none; color: var(--bark); padding: 4px 6px; text-decoration: underline; }
button.danger { color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
form.inline { display: inline; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 14px; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 380px) { .fields { grid-template-columns: 1fr 1fr; } }
label { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
input, select { font: inherit; font-family: var(--mono); font-size: 1.15rem; width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
input[type=text], input[type=password], select { font-family: var(--body); font-size: 1rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.msg { min-height: 1.2em; font-size: .9rem; }
.msg.err { color: var(--bad); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 2px; }
.tile .k { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.tile .v { font-family: var(--mono); font-size: 1.45rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile .s { font-size: .8rem; color: var(--muted); }
.tile.gap .v { color: var(--bark); }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.r, th.r { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
tr.current { background: var(--bark-soft); }
.chip { display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; background: var(--bark-soft); color: var(--bark); }
.chip.wait { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.pct-good { color: var(--good); } .pct-warn { color: var(--warn); } .pct-bad { color: var(--bad); }
input.portion { width: 4.2em; padding: 4px 6px; font-size: .95rem; text-align: right; }
.empty { padding: 14px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; }
.note { font-size: .88rem; color: var(--muted); max-width: 65ch; }
.warn { font-size: .88rem; color: var(--warn); }
.bar { height: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; background: var(--bark); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
details > summary { cursor: pointer; font-family: var(--display); font-size: 1.2rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
@media (prefers-reduced-motion: no-preference) { .bar > span { transition: width .3s ease; } }
