/* SetDip design system (always the bright light look; the tablet board has its own light/dark setting)
   Paper:  #f4f6f9   Surface: #ffffff   Ink: #14202e
   Brand:  #0b6e5f (prep green)   Tape: #ffd43b (masking tape label)
   Type:   Bricolage Grotesque for headings, Figtree for everything else */

:root {
  --bg: #f6fbff;
  --surface: #ffffff;
  --surface-2: #eef5fb;
  --ink: #14202e;
  --muted: #4b5768;
  --line: #d7e2ec;
  --accent: #18c48f;          /* bright prep green: buttons, bars, fills */
  --accent-ink: #06291f;      /* text on bright green */
  --accent-text: #0a7457;     /* green used as text and links */
  --accent-soft: #dcf8ec;
  --tape: #ffd43b;
  --tape-ink: #2b2100;
  /* Day dot colors for icons and stickers, each with readable text */
  --sun: #ffd43b;   --sun-soft: #fff3c4;   --sun-ink: #6b4e00;
  --coral: #ff7a59; --coral-soft: #ffe4d9; --coral-ink: #7a2e12;
  --sky: #4cc3ff;   --sky-soft: #e3f4ff;   --sky-ink: #0b4f7a;
  --grape: #9b7bff; --grape-soft: #efeaff; --grape-ink: #5b3fb8;
  --danger: #b42318;
  --ok: #1e6b2f;
  --focus: #1a56db;
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(20 32 46 / .05), 0 10px 30px rgb(40 90 140 / .08);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font, "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5rem; font-family: var(--font, var(--display)); font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent-text); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, [tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 99; background: var(--surface); padding: .6rem 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 28px; } }

/* ---------- Top bar ---------- */
.topbar { background: color-mix(in srgb, var(--surface) 88%, transparent); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.4) blur(10px); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 800; font-size: 1.35rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; }
.brand .mark::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--tape); box-shadow: 0 0 0 3px var(--accent), 0 0 0 5px var(--tape); transform: scale(.7); }
.brand .dip { color: var(--accent-text); }
.who { display: inline-flex; align-items: center; gap: .6rem; color: var(--muted); font-weight: 600; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-family: var(--display); }
main { padding: 32px 0 72px; }

/* ---------- Building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }

/* Masking tape label: the one playful accent */
.tape { display: inline-block; background: var(--tape); color: var(--tape-ink); font-weight: 700; font-size: .9rem; padding: 3px 12px 4px; border-radius: 3px; transform: rotate(-1.5deg); box-shadow: 0 1px 0 rgb(0 0 0 / .08); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: background-color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn.secondary { background: transparent; color: var(--accent-text); border-color: var(--accent-text); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover, .btn.secondary:hover { background: var(--surface-2); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.small { min-height: 44px; padding: 0 16px; font-size: .95rem; }
.btn.big { min-height: 56px; padding: 0 28px; font-size: 1.1rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; flex: none; }

label { display: block; font-weight: 700; margin-bottom: .35rem; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .92rem; margin-top: .15rem; }
input[type=text], input[type=email], input[type=password], input[type=search], textarea, select {
  width: 100%; min-height: 50px; padding: 11px 14px; font: inherit; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm);
}
textarea { min-height: 150px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--focus); }
input[type=file] { font: inherit; max-width: 100%; }
.field + .field { margin-top: 1rem; }
.grid > .field { margin-top: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 800; font-size: 1.1rem; margin-bottom: .75rem; padding: 0; font-family: var(--display); }

.status { padding: 12px 14px; border-radius: var(--radius-sm); border: 2px solid var(--line); background: var(--surface); }
.status[data-kind=error] { border-color: var(--danger); color: var(--danger); }
.status[data-kind=ok] { border-color: var(--ok); color: var(--ok); }

.pill { display: inline-block; font-size: .82rem; font-weight: 700; padding: 3px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
.pill.quiet { background: var(--surface-2); color: var(--muted); }

.tabs { display: flex; gap: .25rem; background: var(--surface-2); padding: 5px; border-radius: 999px; margin-bottom: 1.5rem; }
.tabs button { flex: 1; background: none; border: 0; border-radius: 999px; padding: 10px 14px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; min-height: 46px; }
.tabs button[aria-selected=true] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }

/* ---------- Dashboard ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.dash-head h1 { margin: 0; }
.dash-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .dash-grid { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); } }
.dash-grid > aside { align-self: start; }

.tablet-card { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: center; background: var(--accent); color: var(--accent-ink); border: 0; position: relative; overflow: hidden; }
.tablet-card::after { content: ""; position: absolute; right: -36px; bottom: -56px; width: 150px; height: 150px; border-radius: 50%; background: var(--sun); pointer-events: none; }
.tablet-card > * { position: relative; z-index: 1; }
.tablet-card .btn { background: var(--accent-ink); color: #fff; border-color: var(--accent-ink); }
.tablet-card .btn.secondary { background: transparent; color: var(--accent-ink); border-color: var(--accent-ink); }
.tablet-card code { display: inline-block; font: 700 1.05rem/1.4 var(--display); background: rgb(255 255 255 / .45); padding: 6px 12px; border-radius: 8px; word-break: break-all; }
@media (min-width: 640px) { .tablet-card { grid-template-columns: minmax(0, 1fr) auto; } }
.qr { background: #fff; padding: 10px; border-radius: var(--radius); width: 148px; height: 148px; display: grid; place-items: center; }
.qr img, .qr canvas, .qr svg { width: 128px; height: 128px; image-rendering: pixelated; }

.checklist { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.checklist li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist .dot { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.checklist li[data-done=true] .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.checklist li[data-done=true] strong { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

.tool { display: flex; flex-direction: column; gap: .5rem; text-align: left; font: inherit; color: inherit; height: 100%; }
a.tool { text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
a.tool:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool[aria-disabled=true] { background: transparent; box-shadow: none; border-style: dashed; }
.tool .tool-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.tool .tool-icon[data-c=sun] { background: var(--sun-soft); color: var(--sun-ink); }
.tool .tool-icon[data-c=coral] { background: var(--coral-soft); color: var(--coral-ink); }
.tool .tool-icon[data-c=sky] { background: var(--sky-soft); color: var(--sky-ink); }
.tool .tool-icon[data-c=grape] { background: var(--grape-soft); color: var(--grape-ink); }
.tool[aria-disabled=true] .tool-icon { background: var(--surface-2); color: var(--muted); }
.tool .tool-icon svg { width: 26px; height: 26px; }
.tool-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.tool .go { margin-top: auto; padding-top: .5rem; font-weight: 700; color: var(--accent-text); }

.back { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; text-decoration: none; min-height: 44px; }

/* ---------- Recipes page ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.import-card { border: 2px dashed var(--line); box-shadow: none; }
.recipe-row { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 12px; margin: 0 -12px; border-radius: var(--radius); flex-wrap: wrap; }
.recipe-row:hover { background: var(--surface-2); }
.recipe-row .ph { width: 56px; height: 56px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font: 800 1.4rem var(--display); }
.thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.thumbs img { width: 88px; height: 88px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.cat-title { display: flex; align-items: center; gap: .5rem; margin: 1.25rem 0 .25rem; }

dialog { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / .35); }
dialog::backdrop { background: rgb(10 16 24 / .6); }
.dialog-head { position: sticky; top: 0; background: var(--surface); display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 16px 20px; border-bottom: 1px solid var(--line); z-index: 1; }
.dialog-body { padding: 20px; }

footer { padding: 28px 0 44px; color: var(--muted); font-size: .95rem; }

/* ---------- New feature bits ---------- */
.pill.out { background: var(--coral-soft); color: var(--coral-ink); }
.pill.allergen { background: var(--sun-soft); color: var(--sun-ink); }
.starter { background: var(--sun-soft); border-color: transparent; }
.es-card { background: var(--sky-soft); border-color: transparent; }
.task-report { list-style: none; padding: 0; margin: 0; }
.task-report li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.task-report .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.task-report li[data-done=true] .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.who-did { font-size: .92rem; white-space: nowrap; }
.date-input { min-height: 46px; padding: 8px 12px; font: inherit; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.choice input[type=checkbox]:checked + span::before { content: "✓ "; }

/* ---------- Tablet look page ---------- */
.look { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 980px) {
  .look { grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); }
  .look .preview-col { position: sticky; top: 88px; }
}
.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choices label { margin: 0; font-weight: 600; }
.choice input, .swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; }
.choice input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.choice input:focus-visible + span, .swatch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; }
.swatch span { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 8px 4px; min-height: 44px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 600; font-size: .92rem; background: var(--surface); }
.swatch i { width: 32px; height: 32px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 2px rgb(0 0 0 / .12); }
.swatch input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.swatch input:checked + span::after { content: "Selected"; font-size: .75rem; font-weight: 700; }
input[type=color] { width: 64px; height: 48px; padding: 4px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.logo-preview { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.logo-preview img { max-height: 72px; max-width: 200px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: #fff; padding: 4px; }

.device-wrap { display: flex; justify-content: center; }
.device { background: #1b222b; border-radius: 30px; padding: 18px; box-shadow: 0 18px 50px rgb(20 32 46 / .28); width: 100%; position: relative; }
.device[data-orient=portrait] { max-width: 430px; }
.device::before { content: ""; position: absolute; top: 7px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #39424e; }
.device[data-orient=landscape]::before { top: 50%; left: 7px; margin: -4px 0 0; }
.device[data-orient=landscape] { padding: 18px 22px; }
.screen { position: relative; overflow: hidden; border-radius: 10px; background: #000; }
.screen iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: #fff; }
.preview-note { font-size: .92rem; text-align: center; margin-top: .75rem; }
.save-bar { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 4px; border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Legal pages (privacy, terms) ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 36px 0 24px; }
.legal h1 { margin-bottom: .25rem; }
.legal .meta { color: var(--muted); margin-bottom: 1.5rem; }
.legal h2 { margin-top: 2.2rem; scroll-margin-top: 90px; }
.legal h3 { margin-top: 1.4rem; }
.legal ul, .legal ol { padding-left: 1.4rem; margin: 0 0 1rem; }
.legal li + li { margin-top: .4rem; }
.legal table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: .98rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.legal th { background: var(--surface-2); }
.legal .table-scroll { overflow-x: auto; }
.legal .glance { background: var(--accent-soft); border: 2px solid var(--accent); border-radius: var(--radius-lg); padding: 20px 22px; }
.legal .glance h2 { margin-top: 0; }
.legal .glance ul { margin-bottom: 0; }
.legal nav.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 1.5rem 0; }
.legal nav.toc h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.legal nav.toc ol { columns: 2 220px; margin: 0; }
.legal .callout { border-left: 5px solid var(--tape); background: var(--sun-soft); padding: 14px 18px; border-radius: var(--radius-sm); }
.site-foot { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 40px; }
.site-foot nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; }
.site-foot a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.site-foot a.privacy-link { font-weight: 800; letter-spacing: .04em; }

/* ---------- Signup consent checklist ---------- */
.consent { border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 18px 6px; min-width: 0; margin: 0; background: var(--surface-2); }
.consent legend { float: left; width: 100%; font-weight: 800; font-family: var(--display); font-size: 1.1rem; padding: 0; margin: 0 0 .4rem; }
.consent legend + * { clear: both; }
.consent .summary { font-size: .97rem; color: var(--ink); padding-left: 1.2rem; margin: .25rem 0 1rem; }
.consent .summary li + li { margin-top: .3rem; }
.check { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.check input[type=checkbox] { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--accent-text); cursor: pointer; }
.check label { font-weight: 600; cursor: pointer; }
.check input[aria-invalid=true] { outline: 3px solid var(--danger); outline-offset: 2px; }

/* ===== Shared list rows for the newer tools ===== */
.item-list { list-style: none; padding: 0; margin: 0; }
.item-list.card { padding-top: 8px; padding-bottom: 8px; }
.item-row { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 0 14px 14px; border-top: 1px solid var(--line); border-left: 5px solid transparent; }
.item-list > .item-row:first-child { border-top: 0; }
.item-row[data-status=red], .item-row[data-status=expired] { border-left-color: var(--danger); }
.item-row[data-status=yellow], .item-row[data-status=soon] { border-left-color: #e0a800; }
.item-row[data-status=green], .item-row[data-status=good] { border-left-color: var(--accent); }
.item-row p { margin: 0; }
.pill.bad { background: #fde3e1; color: #8a1c13; }
.pill.warn { background: var(--sun-soft); color: var(--sun-ink); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
details.card > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.tool .pill.alert { background: var(--coral-soft); color: var(--coral-ink); }

/* ===== Printable inspector sheet ===== */
.print-only { display: none; }
@media print {
  body > *:not(#cert-print) { display: none !important; }
  #cert-print { display: block !important; color: #000; font: 12pt/1.4 system-ui, sans-serif; }
  #cert-print table { width: 100%; border-collapse: collapse; }
  #cert-print th, #cert-print td { border: 1px solid #000; padding: 6px 8px; text-align: left; }
}

/* ===== Main menu ===== */
.side-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--ink); font-weight: 600; text-decoration: none; }
.side-nav a:hover { background: var(--surface-2); }
.side-nav a[aria-current=page] { background: var(--accent-soft); color: var(--ink); font-weight: 800; box-shadow: inset 4px 0 0 var(--accent-text); }
.side-nav .nav-group { font-family: inherit; font-size: .78rem; font-weight: 700; line-height: 1.2; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.2rem 12px .35rem; }
.nav-count { min-width: 26px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--coral-soft, #ffe4d9); color: var(--coral-ink, #7a2e12); font-size: .8rem; font-weight: 800; display: inline-grid; place-items: center; }
.app-layout > .content { min-width: 0; }
@media (min-width: 960px) {
  .app-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); column-gap: 36px; align-items: start; }
  .side-nav { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; padding-bottom: 1rem; }
  .side-nav[hidden] + .content { grid-column: 1 / -1; }
  .menu-btn { display: none !important; }
  .app-layout .back { display: none; }
}
@media (max-width: 959px) {
  .side-nav:not(.open) { display: none; }
  .side-nav.open { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 10px; margin-bottom: 20px; }
}

/* ===== Home (dashboard) ===== */
.home-head { margin-bottom: 1.25rem; }
.home-head h1 { margin: .15rem 0 0; font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.home-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .home-grid { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
.home-main { display: grid; gap: 18px; min-width: 0; }
.home .card h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
.section-title { font-size: 1.2rem; margin: .5rem 0 .25rem; }

/* Needs you */
.needs { padding: 18px 22px; }
.needs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.need { display: flex; align-items: center; gap: .85rem; min-height: 56px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); font-weight: 600; }
.need:hover { border-color: var(--accent-text); background: var(--surface-2); }
.need .tool-icon { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; }
.need .tool-icon svg { width: 22px; height: 22px; }
.need-text { flex: 1; }
.need-act { color: var(--accent-text); font-weight: 700; white-space: nowrap; }
.needs-empty { display: flex; align-items: center; gap: .6rem; min-height: 44px; font-weight: 600; }
.ok-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; flex: none; }

/* Getting started, tighter */
.start { padding: 18px 22px; }
.start-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.start-top h2 { margin: 0 !important; }
.start .progress { margin: .6rem 0 .25rem; }
.start .checklist li { padding: 10px 0; }

/* Tool tiles: icon, name, one status line */
.tool-group + .tool-group { margin-top: 1rem; }
.group-label { font-family: inherit; font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .9rem 0 .5rem; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tile { display: flex; align-items: center; gap: .8rem; min-height: 72px; height: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: border-color .15s ease; }
.tile:hover { border-color: var(--accent-text); }
.tile .tool-icon, .soon-strip .tool-icon { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.tile .tool-icon svg, .soon-strip .tool-icon svg, .need .tool-icon svg { width: 24px; height: 24px; }
.tool-icon[data-c=sun] { background: var(--sun-soft) !important; color: var(--sun-ink) !important; }
.tool-icon[data-c=coral] { background: var(--coral-soft) !important; color: var(--coral-ink) !important; }
.tool-icon[data-c=sky] { background: var(--sky-soft) !important; color: var(--sky-ink) !important; }
.tool-icon[data-c=grape] { background: var(--grape-soft) !important; color: var(--grape-ink) !important; }
.tool-icon[data-c=green] { background: var(--accent-soft); color: var(--accent-text); }
.tile-text { display: flex; flex-direction: column; min-width: 0; }
.tile-name { font-weight: 700; font-size: 1.05rem; }
.tile-status { font-size: .92rem; color: var(--muted); }
.tile.hot .tile-status { color: var(--coral-ink); font-weight: 700; }
.soon-strip { display: flex; align-items: center; gap: .8rem; margin-top: 1rem; padding: 12px 14px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.soon-strip:hover { border-color: var(--accent-text); }
.soon-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }

/* Tablet card, small */
.tablet-mini { display: grid; gap: .75rem; padding: 18px 22px; }
.tablet-mini h2 { margin: 0 !important; }
.tablet-mini code { display: block; font-weight: 700; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; word-break: break-all; }
.tablet-mini .qr { border: 1px solid var(--line); }
.tablet-mini #station-summary a { color: var(--accent-text); font-weight: 700; }
.link-btn { justify-self: start; background: none; border: 0; padding: 0; min-height: 44px; font: inherit; font-weight: 700; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Phone tab bar */
.tabbar { display: none; }
@media (max-width: 959px) {
  .tabbar:not([hidden]) { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgb(20 32 46 / .06); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; background: none; border: 0; border-radius: 12px; font: inherit; font-size: .8rem; font-weight: 700; color: var(--muted); text-decoration: none; cursor: pointer; }
  .tabbar a[aria-current=page], .tabbar button[aria-expanded=true] { color: var(--accent-text); background: var(--accent-soft); }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tb-count { position: absolute; top: 4px; right: calc(50% - 26px); min-width: 20px; height: 20px; padding: 0 5px; font-size: .72rem; }
  body.has-tabbar { padding-bottom: 76px; }
  body.has-tabbar .menu-btn { display: none !important; }
  .side-nav.open { position: fixed; left: 12px; right: 12px; bottom: 80px; max-height: 70vh; overflow-y: auto; z-index: 31; margin: 0; }
}
@media (prefers-reduced-motion: reduce) { .tile, a.tool { transition: none; } }

/* ===== Tablets page ===== */
.station-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
@media (max-width: 400px) { .station-list { grid-template-columns: minmax(0, 1fr); } }
.station-card { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) auto; align-items: start; height: 100%; }
.station-card h2 { margin: 0; font-size: 1.25rem; }
.station-card .qr { width: 112px; height: 112px; border: 1px solid var(--line); box-sizing: border-box; }
.station-card .qr svg { width: 100%; height: 100%; }
.station-card code { display: block; font-size: .92rem; word-break: break-all; background: var(--surface-2); padding: 6px 10px; border-radius: 8px; }
.station-card .row { grid-column: 1 / -1; }
.station-card .shows { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 0; padding: 0; list-style: none; }
.opt-check { display: flex; gap: .65rem; align-items: center; min-height: 44px; margin: 0; font-weight: 600; cursor: pointer; }
.opt-check input[type=checkbox] { width: 24px; height: 24px; min-height: 0; margin: 0; accent-color: var(--accent-text); flex: none; }
@media (max-width: 599px) { #biz-label { display: none; } .topbar .wrap { flex-wrap: nowrap; } }

/* ===== COGS Genie ===== */
.cogs-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat { display: flex; flex-direction: column; gap: .2rem; padding: 16px 18px; }
.stat.hot { border-color: var(--coral); box-shadow: inset 4px 0 0 var(--coral); }
.stat-label { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat-value { font-family: var(--display); font-size: 1.6rem; font-weight: 800; line-height: 1.15; }
.stat-sub { font-size: .92rem; }
.method-picks { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.method-picks button { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; min-height: 72px; padding: 12px 14px; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.method-picks button span { color: var(--muted); font-size: .92rem; }
.method-picks button:hover { border-color: var(--accent-text); }
.method-picks button[aria-pressed=true] { border-color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-text); }
.method-picks button[aria-pressed=true] strong::after { content: " ✓"; }
.cogs-thumbs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cogs-thumbs li { display: grid; gap: .35rem; justify-items: start; }
.cogs-thumbs img { width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.pdf-chip { display: grid; place-items: center; width: 100%; height: 120px; border-radius: var(--radius-sm); border: 2px dashed var(--line); font-weight: 800; color: var(--muted); }
.thumb-name { font-size: .85rem; color: var(--muted); word-break: break-all; }
.cogs-tabs { display: flex; overflow-x: auto; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; scrollbar-width: thin; }
.cogs-tabs button { flex: 1 0 auto; white-space: nowrap; }
.draft { border-left: 5px solid var(--accent); }
.draft-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.draft-line fieldset { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: .6rem; }
.draft-line legend { font-weight: 700; padding: 0 .35rem; max-width: 100%; overflow-wrap: anywhere; }
.line-grid, .cogs-head-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 14px; }
.line-grid .field, .cogs-head-grid .field { margin: 0; }
.line-out { margin: 0; font-weight: 700; color: var(--accent-text); }
.line-out[data-kind=warn] { color: var(--coral-ink); }
.draft-line .btn.ghost { justify-self: start; }
.cogs-checks { display: grid; gap: 8px; }
.table-wrap { overflow-x: auto; }
.cogs-table { width: 100%; border-collapse: collapse; font-size: .97rem; }
.cogs-table th, .cogs-table td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.cogs-table thead th { border-top: 0; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cogs-table tbody th { font-weight: 700; }
.small { font-size: .85rem; font-weight: 400; }
.cost-result { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); padding: 14px; background: var(--surface-2); border-radius: var(--radius); }
.cost-result > div { display: flex; flex-direction: column; gap: .15rem; }
.cost-result strong { font-family: var(--display); font-size: 1.35rem; }
.cost-result strong.over { color: var(--danger); }
#view-cogs input[type=number], #view-cogs input[type=date], dialog .dialog-body input[type=number] {
  width: 100%; min-height: 50px; padding: 11px 14px; font: inherit; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm);
}
@media (max-width: 599px) {
  .cogs-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px; }
  .stat-label { font-size: .72rem; letter-spacing: .02em; }
  .stat-value { font-size: 1.15rem; }
  .stat-sub { display: none; }
}

/* ===== Pick your tools ===== */
.pick-group { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.pick-group legend { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .5rem; padding: 0; }
.pick { display: flex; gap: .85rem; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.pick:has(input:checked) { border-color: var(--accent-text); background: var(--accent-soft); }
.pick input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--accent-text); }
.pick label { display: flex; flex-direction: column; gap: .15rem; cursor: pointer; flex: 1; min-height: 44px; }
.add-tools { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1rem; min-height: 44px; font-weight: 700; color: var(--accent-text); }
.add-tools span { font-size: 1.3rem; line-height: 1; }
@media (max-width: 959px) { .tabbar:not([hidden]) { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; } .tabbar a[hidden] { display: none; } }

/* ===== Managers ===== */
body.manager .owner-only { display: none !important; }
body.read-only .content .btn:not([data-keep]):not(#copy-link):not(#open-link):not(#cert-print-btn),
body.read-only #cogs-add-btn, body.read-only #cogs-add, body.read-only .content .link-btn:not(#qr-toggle),
body.read-only dialog .btn:not([data-keep]) { display: none !important; }
.role-note { margin: .4rem 0 0; display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--sky-soft); color: var(--sky-ink); font-weight: 700; }
.invite-box { background: var(--surface-2); box-shadow: none; }
.pick input[type=radio] { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--accent-text); }
.pick:has(input:checked) { border-color: var(--accent-text); background: var(--accent-soft); }

/* ===== Order checking ===== */
.order-check { display: grid; gap: 10px; padding: 14px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.credit-box textarea { min-height: 140px; }

/* ===== Health Inspections ===== */
.insp-status { display: grid; gap: 18px; grid-template-columns: auto minmax(0, 1fr); align-items: start; border-left: 6px solid var(--accent); }
.insp-status[data-status=soon] { border-left-color: #e0a800; background: linear-gradient(90deg, var(--sun-soft), var(--surface) 55%); }
.insp-status[data-status=overdue] { border-left-color: var(--danger); background: linear-gradient(90deg, #fde3e1, var(--surface) 55%); }
.insp-status[data-status=none] { display: flex; flex-direction: column; border-left-color: var(--line); }
.insp-status h2 { font-size: 1.5rem; }
.insp-status[data-status=overdue] h2 { color: var(--danger); }
.insp-status[data-status=soon] h2 { color: var(--sun-ink); }
.insp-status[data-status=overdue] h2::before { content: "⚑ "; }
.insp-head { font-size: 1.1rem; font-weight: 600; }
.insp-grade { width: 92px; height: 92px; border-radius: 22px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 2.6rem; background: var(--surface-2); color: var(--ink); border: 3px solid var(--line); }
.insp-grade[data-grade=A], .insp-grade[data-grade=Pass] { background: #e3f2ff; color: #0b3d91; border-color: #0b3d91; }
.insp-grade[data-grade=B], .insp-grade[data-grade=Conditional] { background: #e6f6ea; color: #14532d; border-color: #14532d; }
.insp-grade[data-grade=C], .insp-grade[data-grade=Fail], .insp-grade[data-grade=Closed] { background: #fde3e1; color: #8a1c13; border-color: #8a1c13; font-size: 1.6rem; }
@media (max-width: 520px) { .insp-status { grid-template-columns: minmax(0, 1fr); } .insp-grade { width: 72px; height: 72px; font-size: 2rem; } }
.insp-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.insp-checks li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: .6rem; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.insp-checks li:first-child { border-top: 0; }
.insp-checks input { width: 24px; height: 24px; accent-color: var(--accent-text); margin: 0; }
.insp-checks label { cursor: pointer; min-height: 44px; display: flex; flex-direction: column; justify-content: center; }
.insp-checks li:has(input:checked) label { color: var(--muted); }
.insp-note { display: block; font-size: .9rem; color: var(--coral-ink); font-weight: 700; }
#view-inspect input[type=tel], #view-inspect input[type=url], #view-inspect input[type=date], #view-inspect input[type=number] {
  width: 100%; min-height: 50px; padding: 11px 14px; font: inherit; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm);
}
#view-inspect input:focus { border-color: var(--focus); }
