/* AskWhere "Clean" theme: the one source of truth for colours, type, shape and shared components.
   One neutral font (Inter), hairline borders, soft shadows, quiet tinted rating badges: the map and the food carry the colour.
   build.py inlines this into the map page and copies it to site/ for creator.html and terms.html.
   Font: Inter (variable, 400-700), self-hosted in site/fonts/ (Google Fonts' own subset files, OFL licence); each page preloads the
   latin file, and browsers fetch latin-ext / vietnamese only for a page that uses those letters. */
@font-face { font-family: Inter; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/inter-vietnamese.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }

:root {
  /* colour */
  --bg: #f6f5f2;          /* soft off-white page */
  --panel: #ffffff;
  --ink: #14171d;         /* text */
  --muted: #5f6673;
  --line: #ebe8e3;        /* dividers */
  --edge: #dedad3;        /* control borders: a hairline, not an outline */
  --accent: #7e4fc9;      /* brand amethyst (deep): the one primary action and "Where" in the logo (white text on it passes AA) */
  --brand: #9c6ade;       /* the raccoon's amethyst */
  --where: #7e4fc9;       /* "Where" in the logo */
  --mustard: #f2b600;     /* small highlights only */
  --transit: #00923f;
  --focus: #1f5fd1;
  --map: #eceae5;
  --road: #d8d3ca;
  --must: #1f5fd1;        /* rating scale: deep blue > sky > orange; slate = no opinion (blue/orange stays distinct with red-green colour blindness) */
  --good: #8cc4f7;
  --meh: #f28c28;
  --featured: #5b6478;
  --on-accent: #ffffff; --on-art: #ffffff; --on-must: #ffffff; --on-good: #14213d; --on-meh: #14213d; --on-featured: #ffffff;  /* sticker text, contrast-checked */
  /* creator line colours: stable per handle (see lineOf in the map), used as dots/bars only, never for text */
  --l0: #2563eb; --l1: #7c3aed; --l2: #c026d3; --l3: #0d9488; --l4: #b45309; --l5: #0284c7; --l6: #e11d48; --l7: #4338ca;
  /* type */
  --body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: var(--body);   /* headings: same family, set apart by weight and tracking */
  --label: var(--body);     /* small labels + numbers (tabular) */
  /* the type scale (docs/design-standard.md): these 7 sizes only. 2xs is for uppercase labels; body text is never below sm */
  --t-2xs: 11.5px; --t-xs: 12px; --t-sm: 14px; --t-md: 16px; --t-lg: 20px; --t-xl: 26px; --t-xxl: 34px;
  --fw-body: 400; --fw-strong: 600; --fw-head: 650;
  /* spacing: gaps and padding use these only */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;
  /* icon sizes: inline with text, buttons and rows, floating buttons and empty states */
  --i-sm: 16px; --i-md: 20px; --i-lg: 24px;
  /* content widths: forms, dashboards on desktop, reading pages; phones use a 16px gutter */
  --w-form: 640px; --w-dash: 960px; --w-page: 720px;
  /* shape */
  --r-sm: 6px; --r-md: 12px; --r-lg: 18px; --r-pill: 999px;
  --bw: 1px;
  --float: 0 1px 2px rgb(0 0 0 / .08), 0 4px 14px rgb(0 0 0 / .10);   /* things floating over the map */
  --lift: 0 8px 28px rgb(0 0 0 / .16);                                /* sheets, dialogs */
  --card: 0 1px 2px rgb(0 0 0 / .05);                                 /* a card resting on the page. The 3 shadows: card, float, lift */
  /* status and roles (text-safe on --panel, AA): ok / warn / err, destructive actions, the verified badge */
  --ok: #1f7a45; --warn: #9a5b00; --err: #b42318; --danger: var(--err); --on-danger: #ffffff; --verified: var(--focus);
  --raised: var(--panel);   /* the current tab in a segmented control */
  --selected: var(--ink); --on-selected: var(--panel);   /* a chosen option (chips): never used for "where I am" */
  --switch-on: var(--focus);   /* a toggle switch that is on */
  --you: #1a73e8;         /* "you are here" dot and the locate button when on */
  --gold: #ffc107; --on-gold: #14171d; --on-mustard: #3a2b00;   /* NEW badge, top-3 rank discs */
  --splash-bg: #e5341f; --splash-shade: #b9270f; --splash-ink: #141414; --splash-cream: #fff0d2;   /* first-visit intro loop: poster art, the same in light and dark */
  --fab: 48px;            /* every floating map button */
  /* motion */
  --fast: 150ms; --med: 220ms; --ease: cubic-bezier(.2, .8, .2, 1);
  /* page layers, lowest first (the phone sheet sits over the header so pulling it up covers search, like Google Maps): the only z-index values for page-level UI. Leaflet's own: map panes 400-700, map controls 1000.
     dialogs use the browser top layer and sit above all of these. */
  --z-fab: 500; --z-tip: 1050; --z-header: 1100; --z-sheet: 1150; --z-rail: 1160; --z-menu: 1200; --z-splash: 5000;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f1216; --panel: #191d24; --ink: #eef1f6; --muted: #9aa2b1; --line: #262b34; --edge: #323844;
  --accent: #a072e0; --where: #b794f0; --mustard: #ffc93c; --transit: #2fbf71; --focus: #7fb0ff; --map: #1c2027; --road: #2a2f38;
  --must: #4d8dff; --good: #a9d4ff; --meh: #ffb347; --featured: #7a8396;
  --on-accent: #0f1216; --on-must: #0f1216; --on-good: #0f1216; --on-meh: #0f1216; --on-featured: #eef1f6;
  --float: 0 1px 2px rgb(0 0 0 / .4), 0 4px 14px rgb(0 0 0 / .35); --lift: 0 8px 28px rgb(0 0 0 / .5); --ok: #4cc38a; --warn: #ffb347; --err: #ff7a6e; --on-danger: #0f1216; --raised: var(--edge); --card: 0 1px 2px rgb(0 0 0 / .3); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0f1216; --panel: #191d24; --ink: #eef1f6; --muted: #9aa2b1; --line: #262b34; --edge: #323844;
  --accent: #a072e0; --where: #b794f0; --mustard: #ffc93c; --transit: #2fbf71; --focus: #7fb0ff; --map: #1c2027; --road: #2a2f38;
  --must: #4d8dff; --good: #a9d4ff; --meh: #ffb347; --featured: #7a8396;
  --on-accent: #0f1216; --on-must: #0f1216; --on-good: #0f1216; --on-meh: #0f1216; --on-featured: #eef1f6;
  --float: 0 1px 2px rgb(0 0 0 / .4), 0 4px 14px rgb(0 0 0 / .35); --lift: 0 8px 28px rgb(0 0 0 / .5); --ok: #4cc38a; --warn: #ffb347; --err: #ff7a6e; --on-danger: #0f1216; --raised: var(--edge); --card: 0 1px 2px rgb(0 0 0 / .3); color-scheme: dark }

[hidden] { display: none !important; }  /* the hidden attribute always wins over component display rules */
body { background: var(--bg); color: var(--ink); font: var(--fw-body) var(--t-md)/1.45 var(--body); -webkit-font-smoothing: antialiased; }

/* ---------- shared components ---------- */
.logo { display: inline-flex; align-items: center; gap: 7px; font: 650 var(--t-lg)/1 var(--display); letter-spacing: -.025em; color: var(--ink); white-space: nowrap; text-decoration: none; }
.logo .mark { width: 28px; height: 28px; flex: none; background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"%3E%3Cpath d="M18 28L14 6l20 12zM82 28l4-22-20 12z" fill="%239c6ade"/%3E%3Cpath d="M30 68L32 92L48 72z" fill="%239c6ade"/%3E%3Cpath d="M24 14h52q16 0 16 16v28q0 16-16 16H24Q8 74 8 58V30q0-16 16-16z" fill="%239c6ade"/%3E%3Cpath d="M8 36Q50 19 92 36V51Q50 68 8 51z" fill="%2314171d"/%3E%3Ccircle cx="34" cy="44" r="10.5" fill="%23ffffff"/%3E%3Ccircle cx="35.5" cy="45.5" r="5" fill="%2314171d"/%3E%3Ccircle cx="66" cy="44" r="10.5" fill="%23ffffff"/%3E%3Ccircle cx="67.5" cy="45.5" r="5" fill="%2314171d"/%3E%3Cellipse cx="50" cy="63" rx="8" ry="6" fill="%23ffc107"/%3E%3C/svg%3E') center / contain no-repeat; }  /* AskWhere mark (the Trash Panda): brand/make_logo.py */
.logo .where { color: var(--where); }
.logo .city { font: 600 var(--t-2xs) var(--label); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.label { font: 600 11.5px var(--label); letter-spacing: .06em; text-transform: uppercase; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* buttons: primary (solid red), secondary (hairline pill), chip (filter toggle) */
.btn, .btn-2, .chip { box-sizing: border-box; }  /* links styled as buttons size like buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 9px 16px; border-radius: var(--r-pill);
  font: 600 var(--t-md)/1 var(--body); color: var(--on-accent); background: var(--accent); border: var(--bw) solid transparent;
  cursor: pointer; text-decoration: none; transition: filter var(--fast) var(--ease), transform var(--fast) var(--ease); }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn-2 { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: var(--r-pill);
  font: 600 var(--t-sm)/1 var(--body); color: var(--ink); background: var(--panel); border: var(--bw) solid var(--edge); cursor: pointer; text-decoration: none; }
.btn-2:hover { background: var(--bg); }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 12px; border-radius: var(--r-pill);
  font: 500 14px/1 var(--body); color: var(--ink); background: var(--panel); border: var(--bw) solid var(--edge); cursor: pointer; text-decoration: none; }
.chip[aria-pressed="true"], .chip[data-on="1"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* rating badge: a dot in the verdict colour on a light tint of it; the text stays ink for contrast */
.sticker { --c: var(--featured); display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: var(--r-sm); color: var(--ink);
  background: color-mix(in srgb, var(--c) 17%, var(--panel)); font: 600 var(--t-xs)/1.15 var(--label); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sticker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.sticker.must { --c: var(--must); }
.sticker.good { --c: var(--good); }
.sticker.meh { --c: var(--meh); }
.sticker.featured { --c: var(--featured); }
.sticker.agree { --c: var(--mustard); }

.line-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--lc); flex: none; vertical-align: 0; margin-right: 5px; }

/* small labels */
.badge2 { display: inline-flex; align-items: center; gap: 4px; font: 600 12px var(--label); border-radius: var(--r-pill);
  padding: 3px 9px; border: var(--bw) solid var(--edge); background: var(--panel); color: var(--ink); }
.badge2.ok { background: var(--must); color: var(--on-must); }

/* form groups (docs/design-standard.md): a titled block, never the browser's grey fieldset box */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
/* choice chips: a .chip label wrapping a checkbox or radio, for picking among options (multi-choice lists) */
label.chip { position: relative; cursor: pointer; -webkit-user-select: none; user-select: none; }
label.chip > input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
label.chip:has(> input:checked) { background: var(--selected); color: var(--on-selected); border-color: var(--selected); }
label.chip:has(> input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
/* toggle switch: one on/off setting. <label class="toggle"><input type="checkbox"> <span>Label</span></label> */
label.toggle { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; cursor: pointer; font-weight: 500; }
label.toggle > input[type="checkbox"] { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 42px; height: 26px; margin: 0; border-radius: var(--r-pill);
  background: var(--muted); cursor: pointer; transition: background var(--fast) var(--ease); }
label.toggle > input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--on-accent);
  box-shadow: var(--float); transition: transform var(--fast) var(--ease); }
label.toggle > input[type="checkbox"]:checked { background: var(--switch-on); }
label.toggle > input[type="checkbox"]:checked::after { transform: translateX(16px); }
label.toggle > input[type="checkbox"]:disabled { opacity: .5; cursor: default; }

/* forms + dialogs */
input, textarea, select { font-family: var(--body); }
.field, dialog input, dialog textarea { width: 100%; box-sizing: border-box; font: 400 var(--t-md) var(--body); color: var(--ink); background: var(--panel);
  border: var(--bw) solid var(--edge); border-radius: var(--r-md); padding: 9px 12px; }
dialog { border: var(--bw) solid var(--edge); border-radius: var(--r-lg); background: var(--panel); color: var(--ink); padding: 20px;
  width: min(420px, calc(100vw - 48px)); box-sizing: border-box; max-height: calc(100dvh - 48px); overflow-y: auto; box-shadow: var(--lift); }  /* map stays visible around it */
dialog::backdrop { background: rgb(15 23 41 / .5); }
dialog h2 { font: 650 var(--t-lg)/1.2 var(--display); letter-spacing: -.02em; margin: 0 0 6px; }
dialog p { margin: 0 0 10px; color: var(--muted); font-size: var(--t-sm); }
dialog label { display: block; font: 600 var(--t-sm) var(--body); margin: 10px 0 4px; }
dialog .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
dialog .msg { min-height: 1em; margin: 8px 0 0; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* loading: the raccoon looks around for a spot (its pupils glance left and right, and it bobs). Markup: <div class="awload" role="status">AWMARK<span>Loading…</span></div>, AWMARK = the svg in brand/loader-mark.html */
.awload { display: grid; justify-items: center; gap: 14px; padding: 56px 16px; color: var(--muted); font: 500 var(--t-md) var(--body); text-align: center; }
.awmark { width: 64px; height: 64px; overflow: visible; }
.awmark .b { fill: var(--brand); } .awmark .m { fill: #14171d; } .awmark .w { fill: #fff; } .awmark .n { fill: #ffc107; } .awmark .p { fill: #14171d; }
/* the old logo's three typing dots, played by the eyes and nose: left eye, nose, right eye hop in turn */
.awmark .w, .awmark .p, .awmark .n { animation: awdot 1.2s ease-in-out infinite; }
.awmark .n { animation-delay: .15s; } .awmark [cx="66"], .awmark [cx="67.5"] { animation-delay: .3s; }
@keyframes awdot { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }
/* =====================================================================================================================
   Shared components (docs/design-standard.md, section 3). New pages and the phase 2-5 migrations use these; each one is
   shown in every state on site/styleguide.html. Older shared pieces above (.btn, .btn-2, .chip, .field, .sticker,
   label.chip, label.toggle) are part of the set too.
   ===================================================================================================================== */

/* page shell: a header lined up with the content, a centred content column, a plain footer.
   Width per page type: <body class="w-dash"> (dashboards), "w-form" (forms), "w-page" (reading pages) */
body { --shell-w: var(--w-dash); } body.w-form { --shell-w: var(--w-form); } body.w-page { --shell-w: var(--w-page); }
.shell-top { display: flex; align-items: center; gap: var(--s-2); min-height: 56px; background: var(--panel); border-bottom: var(--bw) solid var(--line);
  padding: 0 max(var(--s-4), calc((100% - var(--shell-w)) / 2 + var(--s-4))); }
.shell-top .shell-title { margin-left: auto; font: var(--fw-strong) var(--t-2xs) var(--label); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.shell { max-width: var(--shell-w); margin: 0 auto; padding: var(--s-4) var(--s-4) var(--s-7); display: grid; gap: var(--s-4); }
body.w-page .shell { display: block; padding-top: var(--s-5); }  /* reading pages flow as text */
.shell-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2) var(--s-5); padding: var(--s-5) var(--s-4) var(--s-6); font-size: var(--t-sm); }
.shell-foot a { color: var(--muted); }

/* buttons: states shared by .btn (primary), .btn-2 (secondary) and .btn-danger (destructive, confirm first) */
.btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 44px; padding: 9px var(--s-4); border-radius: var(--r-pill);
  font: var(--fw-strong) var(--t-sm)/1 var(--body); color: var(--on-danger); background: var(--danger); border: var(--bw) solid transparent; cursor: pointer; text-decoration: none; box-sizing: border-box; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; }
.btn-icon:hover { background: var(--line); }
.btn-icon .icon { width: var(--i-md); height: var(--i-md); }
:is(.btn, .btn-2, .btn-danger, .btn-icon):disabled, :is(.btn, .btn-2, .btn-danger, .btn-icon)[aria-disabled="true"] { opacity: .5; cursor: default; filter: none; transform: none; }
:is(.btn-2, .btn-danger):active { transform: scale(.98); }
/* busy: the button keeps its width, shows a spinner and takes no second tap */
:is(.btn, .btn-2, .btn-danger)[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
:is(.btn, .btn-2, .btn-danger)[aria-busy="true"]::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--on-accent); border-bottom-color: transparent; animation: spin .7s linear infinite; }
.btn-2[aria-busy="true"]::after { border-color: var(--ink); border-bottom-color: transparent; }
.spinner { display: inline-block; width: var(--i-sm); height: var(--i-sm); border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(1turn); } }

/* navigation tabs: a segmented control (decision 2026-11-08). Every tab fits at 375px; the current one is raised on --raised.
   Never pills, so "where I am" never looks like "what I picked" */
.tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 3px; border-radius: var(--r-md); background: var(--line); }
.tabbar > :is(a, button) { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-1); min-height: 44px; padding: 2px var(--s-1); border: 0; border-radius: var(--r-md);
  background: none; color: var(--muted); font: var(--fw-strong) var(--t-sm)/1.1 var(--body); text-align: center; text-decoration: none; cursor: pointer; min-width: 0; }
.tabbar > :is(a, button):hover { color: var(--ink); }
.tabbar > [aria-current="page"] { background: var(--raised); color: var(--ink); box-shadow: var(--float); }
@media (max-width: 420px) { .tabbar > :is(a, button) { font-size: var(--t-xs); } }
/* phones: tabs keep their words on one line and the bar scrolls sideways when they don't all fit (six business tabs, big system text) */
@media (max-width: 600px) { .tabbar { display: flex; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; } .tabbar::-webkit-scrollbar { display: none; }
  .tabbar > :is(a, button) { flex: 1 0 auto; white-space: nowrap; padding: 2px var(--s-2); } }
.tabbar .tcount { min-width: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font: var(--fw-strong) var(--t-2xs)/18px var(--label); text-align: center; }

/* field: label, optional hint, the input, and a counter or error in the box's bottom-right corner */
.form-field { display: grid; gap: var(--s-1); min-width: 0; }
.form-field > label, .ff-label { font: var(--fw-strong) var(--t-sm) var(--body); color: var(--ink); }
.form-field .ff-hint { font-size: var(--t-xs); color: var(--muted); }
.form-field .ff-box { position: relative; }
.form-field .ff-box > .field { width: 100%; }
.form-field .ff-count { position: absolute; right: var(--s-3); bottom: var(--s-2); font: var(--t-xs) var(--label); color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.form-field .ff-error { font-size: var(--t-xs); font-weight: var(--fw-strong); color: var(--err); }
.field[aria-invalid="true"] { border-color: var(--err); }
.field:disabled { opacity: .55; cursor: default; }

/* form group: a titled block with a one-line explanation (never the browser's fieldset box) */
.form-group { display: grid; gap: var(--s-3); min-width: 0; }
.form-group > legend, .form-group .fg-title { font: var(--fw-head) var(--t-md) var(--body); margin-bottom: var(--s-1); }
.form-group .fg-hint { font-size: var(--t-sm); color: var(--muted); margin: 0; }

/* card: one surface for every dashboard section */
.panel-card { background: var(--panel); border: var(--bw) solid var(--line); border-radius: var(--r-lg); box-shadow: var(--card); padding: var(--s-4); display: grid; gap: var(--s-3); min-width: 0; }
@media (min-width: 761px) { .panel-card { padding: var(--s-5); } }
.panel-card .pc-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.panel-card .pc-title { font: var(--fw-head) var(--t-lg)/1.2 var(--display); letter-spacing: -.02em; margin: 0; }
.panel-card .pc-desc { font-size: var(--t-sm); color: var(--muted); margin: 0; }
/* settings-style card: title and explanation on the left, the fields on the right (desktop); stacked on phones */
.panel-card .pc-side { display: grid; gap: var(--s-1); align-content: start; min-width: 0; }
.panel-card .pc-main { display: grid; gap: var(--s-4); align-content: start; min-width: 0; }
@media (min-width: 900px) { .panel-card.split { grid-template-columns: 220px minmax(0, 1fr); gap: var(--s-6); } }

/* save state for autosaving forms: "Saving…", then "Saved ✓" that fades after 2s; problems stay until fixed */
.savestate { position: sticky; bottom: max(12px, env(safe-area-inset-bottom, 0px)); justify-self: center; z-index: 1; padding: 6px 14px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--panel); font: var(--fw-strong) var(--t-sm) var(--body); box-shadow: var(--lift); }
.savestate.err { background: var(--panel); color: var(--ink); border: var(--bw) solid var(--edge); }
.savestate:empty { display: none; }

/* badges: small, square-ish, tinted from a status or role colour; never a bright off-palette pill */
.status-badge, .verified-badge { --c: var(--muted); display: inline-flex; align-items: center; gap: var(--s-1); padding: 2px var(--s-2); border-radius: var(--r-sm);
  font: var(--fw-strong) var(--t-xs)/1.5 var(--label); color: var(--ink); background: color-mix(in srgb, var(--c) 14%, var(--panel)); white-space: nowrap; }
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.status-badge.ok { --c: var(--ok); } .status-badge.warn { --c: var(--warn); } .status-badge.err { --c: var(--err); }
.verified-badge { --c: var(--verified); }
.verified-badge .icon { width: 14px; height: 14px; color: var(--c); stroke-width: 2.6; }

/* avatar: photo, else the creator's raccoon, else initials. Always round */
.ava { display: inline-grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden; background: var(--line); color: var(--ink); font: var(--fw-strong) var(--t-xs) var(--label);
  width: 36px; height: 36px; object-fit: cover; }
.ava.s24 { width: 24px; height: 24px; font-size: var(--t-2xs); } .ava.s48 { width: 48px; height: 48px; font-size: var(--t-sm); } .ava.s104 { width: 104px; height: 104px; font-size: var(--t-xl); }

/* drawer: pickers and filters slide in from the right on every screen size */
dialog.side-drawer { position: fixed; margin: 0; inset: 0 0 0 auto; width: min(420px, 90vw); height: 100dvh; max-width: none; max-height: 100dvh; padding: 0;
  border-right: 0; border-radius: var(--r-lg) 0 0 var(--r-lg); display: none; flex-direction: column; box-shadow: var(--lift); padding-top: env(safe-area-inset-top, 0px); }
dialog.side-drawer[open] { display: flex; animation: side-in var(--med) var(--ease); }
@keyframes side-in { from { transform: translateX(100%); } }

/* loading: placeholder rows while a list fills in (the raccoon loader .awload covers a whole page) */
.skel { display: block; height: 14px; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 40%, var(--panel)) 50%, var(--line) 75%);
  background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; }
.skel + .skel { margin-top: var(--s-2); } .skel.w60 { width: 60%; } .skel.w40 { width: 40%; }
@keyframes skel { to { background-position: -200% 0; } }

/* empty and error states: an icon or the raccoon, one line, one action */
.empty-state { display: grid; justify-items: center; gap: var(--s-3); padding: var(--s-6) var(--s-4); text-align: center; color: var(--muted); font-size: var(--t-sm); }
.empty-state > svg { width: 48px; height: 48px; color: var(--muted); }
.empty-state p { margin: 0; max-width: 34ch; }

/* toast: confirmations not tied to a field, with an undo where it can be undone */
.toast-bar { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: var(--z-menu); display: flex; gap: var(--s-3); align-items: center;
  max-width: calc(100% - 32px); padding: 10px var(--s-4); border-radius: var(--r-md); background: var(--ink); color: var(--panel); box-shadow: var(--lift); font-size: var(--t-sm); }
.toast-bar button { border: 0; background: none; color: var(--panel); font: 700 var(--t-sm) var(--body); text-decoration: underline; cursor: pointer; padding: 4px 0; }

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

/* deal steps (site/ui.js dealSteps): agreed deals on both dashboards */
.dealsteps { list-style: none; margin: var(--s-2) 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1); font: 600 var(--t-xs) var(--label); }
.dealsteps li { padding: 3px var(--s-2); border-radius: var(--r-pill); border: var(--bw) solid var(--line); color: var(--muted); }
.dealsteps li.ok { border-color: transparent; background: var(--bg); }
.dealsteps li.now { border-color: var(--ink); color: var(--ink); }

/* messages (site/ui.js chatCard): an inbox and one open chat. Side by side from 761px; on phones the chat opens full-screen.
   Mine are on the right in the accent colour, theirs on the left on the card colour; deal events are small centred lines */
.chat { display: grid; min-width: 0; }
.chat-list { display: grid; align-content: start; min-width: 0; }
.chat-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-3); align-items: center; min-height: 64px; padding: var(--s-2); margin: 0 calc(-1 * var(--s-2));
  border: 0; border-radius: var(--r-md); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.chat-row:hover { background: var(--bg); }
.chat-ava { display: grid; flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; }
.chat-ava > * { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; font-size: var(--t-md); }
.chat-head .chat-ava { width: 36px; height: 36px; }
.cr-main { display: grid; gap: 2px; min-width: 0; }
.cr-line { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.cr-line b, .cr-prev { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-line b { font-weight: var(--fw-strong); }
.cr-line time { flex: none; font: var(--t-xs) var(--label); color: var(--muted); font-variant-numeric: tabular-nums; }
.cr-prev { font-size: var(--t-sm); color: var(--muted); }
.chat-row.new .cr-prev { color: var(--ink); font-weight: 500; }
.chat-row.new time { color: var(--accent); font-weight: var(--fw-strong); }
.cr-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.chat-pane { display: none; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.chat-head { display: flex; align-items: center; gap: var(--s-2); min-height: 60px; box-sizing: border-box; padding: var(--s-2) var(--s-3); background: var(--panel); border-bottom: var(--bw) solid var(--line); }
.chat-back { margin-left: calc(-1 * var(--s-2)); }
.ch-who { display: grid; min-width: 0; flex: 1; }
.ch-who b { font-weight: var(--fw-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-deal { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: var(--t-xs); }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column-reverse; padding: var(--s-3) var(--s-3) var(--s-4); }  /* reversed: opens at the newest */
.chat-flow { flex: none; display: flex; flex-direction: column; gap: 2px; min-height: 100%; }
.chat-day { align-self: center; margin: var(--s-4) 0 var(--s-2); font: var(--fw-strong) var(--t-2xs) var(--label); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chat-sys { align-self: center; max-width: 85%; margin: var(--s-2) 0; padding: 2px var(--s-3); border-radius: var(--r-pill); background: var(--line); color: var(--muted); font-size: var(--t-xs); text-align: center; }
.bub { align-self: flex-start; display: grid; max-width: min(80%, 520px); padding: 7px 12px 5px; border-radius: var(--r-lg); background: var(--panel); border: var(--bw) solid var(--line); color: var(--ink); }
.bub.first { margin-top: var(--s-2); }
.bub.tail { border-bottom-left-radius: var(--r-sm); }
.bub-t { white-space: pre-wrap; overflow-wrap: anywhere; }
.bub time { justify-self: end; margin-top: 1px; font: var(--t-2xs) var(--label); color: var(--muted); font-variant-numeric: tabular-nums; }
.bub.me { align-self: flex-end; background: var(--accent); border-color: transparent; color: var(--on-accent); }
.bub.me.tail { border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-sm); }
.bub.me time { color: var(--on-accent); opacity: .8; }
.chat-state { align-self: flex-end; margin: 2px var(--s-1) 0; font-size: var(--t-2xs); color: var(--muted); }
.chat-empty { margin: auto; padding: var(--s-5) 0; max-width: 30ch; text-align: center; color: var(--muted); font-size: var(--t-sm); }
.chat-compose { display: flex; align-items: flex-end; gap: var(--s-2); padding: var(--s-2) var(--s-3); background: var(--panel); border-top: var(--bw) solid var(--line); }
.chat-compose textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 140px; box-sizing: border-box; resize: none; padding: 8px var(--s-4); border: var(--bw) solid var(--edge); border-radius: var(--r-lg);
  background: var(--bg); color: var(--ink); font: var(--t-md)/1.4 var(--body); }
.chat-compose textarea:focus-visible { outline: 0; border-color: var(--focus); }  /* the border is the focus ring inside the composer */
.chat-send { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); cursor: pointer;
  transition: background var(--fast) var(--ease); }
.chat-send .icon { width: var(--i-md); height: var(--i-md); stroke-width: 2.4; }
.chat-compose:has(textarea:placeholder-shown) .chat-send { background: var(--line); color: var(--muted); }  /* grey until there's something to send */
.chat-send:disabled { opacity: .5; cursor: default; }
.chat-hint { margin: 0; padding: 0 var(--s-3) var(--s-2); background: var(--panel); color: var(--muted); font-size: var(--t-xs); }
@media (max-width: 760px) {
  .chat.open .chat-pane { display: flex; position: fixed; inset: 0; z-index: var(--z-sheet); padding-top: env(safe-area-inset-top, 0px); }
  .chat.open .chat-pane > :last-child { padding-bottom: max(var(--s-2), env(safe-area-inset-bottom, 0px)); }
  html:has(.chat.open) { overflow: hidden; }
}
@media (min-width: 761px) {
  .chat { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: min(680px, 80dvh); border: var(--bw) solid var(--line); border-radius: var(--r-md); overflow: hidden; }
  .chat-list { overflow-y: auto; padding: var(--s-2); border-right: var(--bw) solid var(--line); }
  .chat-row { margin: 0; }
  .chat-row[aria-current="true"] { background: var(--bg); }
  .chat-pane { display: flex; }
  .chat-back { display: none; }
}
.chat-ava > .ava { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); color: var(--accent); }  /* a business's initial */

/* the offer section (business.html offerFields): three offer cards, format chips with a count, the line the creator will see */
.opicks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-2); margin: 0 0 var(--s-3); }
.opick { position: relative; display: grid; gap: 2px; align-content: start; padding: var(--s-3); border: var(--bw) solid var(--edge); border-radius: var(--r-md); cursor: pointer; }
.opick input { position: absolute; opacity: 0; pointer-events: none; }
.opick span { font: 400 var(--t-xs) var(--body); color: var(--muted); }
.opick:has(:checked) { outline: 2px solid var(--ink); outline-offset: -1px; }
.opick:has(:focus-visible) { outline: 2px solid var(--focus); }
.fmts { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-1) 0 var(--s-3); }
.fmt { display: inline-flex; align-items: center; gap: var(--s-1); }
.fmt { gap: 0; } .fmt:has(:checked) .chip { border-radius: var(--r-pill) 0 0 var(--r-pill); }
.fmt .qty { display: inline-flex; align-items: center; min-height: 34px; padding: 0 4px 0 8px; border: var(--bw) solid var(--selected); border-left: 0; border-radius: 0 var(--r-pill) var(--r-pill) 0;
  background: var(--panel); color: var(--muted); font: 600 var(--t-sm) var(--body); }
.fmt .qty input { width: 28px; border: 0; background: none; color: var(--ink); font: inherit; text-align: center; -moz-appearance: textfield; }
.fmt .qty input::-webkit-inner-spin-button { display: none; }
.fmt:not(:has(:checked)) .qty { display: none; }
.offer-sum { padding: var(--s-2) var(--s-3); background: var(--bg); border-radius: var(--r-md); }
label.toggle.meal { align-items: center; margin: 0 0 var(--s-2); }
.fhead { margin: var(--s-3) 0 0; font: 700 var(--t-sm) var(--body); }

/* creators' food photos (creator.html foodBox, business.html crCard): square tiles */
.foods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); margin: var(--s-2) 0; max-width: 420px; }
.foods.sm { grid-template-columns: repeat(3, 72px); }
.foods img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-md); background: var(--bg); }
.food { display: grid; gap: var(--s-1); justify-items: start; }
.food.add { position: relative; aspect-ratio: 1; place-items: center; justify-items: center; text-align: center; padding: var(--s-2); border: var(--bw) dashed var(--edge); border-radius: var(--r-md);
  color: var(--muted); font: 600 var(--t-xs) var(--label); cursor: pointer; }
.food.add input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.food.add:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
/* reply and edit (site/ui.js chatCtx): tap a bubble for Reply / Edit; a reply quotes the message it answers */
.bub.sel { box-shadow: 0 0 0 2px var(--focus); }
.bub.flash { animation: bub-flash 1.4s var(--ease); }
@keyframes bub-flash { 0%, 50% { box-shadow: 0 0 0 3px var(--mustard); } }
.bub-q { display: grid; justify-items: start; min-width: 0; margin: 2px 0 var(--s-1); padding: var(--s-1) var(--s-2); border: 0; border-left: 3px solid currentColor; border-radius: var(--r-sm);
  background: color-mix(in srgb, currentColor 10%, transparent); color: inherit; font: var(--t-xs)/1.35 var(--body); text-align: left; cursor: pointer; }
.bub-q span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
/* the message menu: long-press on phones, the ⋯ button on hover with a mouse (or right-click). Reply, Copy, Edit and Delete (yours, 15 minutes) */
.bub { position: relative; }
.bub-more { position: absolute; top: 50%; left: calc(100% + var(--s-1)); transform: translateY(-50%); display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 50%; background: var(--panel); color: var(--muted); box-shadow: var(--card); cursor: pointer; opacity: 0; transition: opacity var(--fast) var(--ease); }
.bub.me .bub-more { left: auto; right: calc(100% + var(--s-1)); }
.bub:hover .bub-more, .bub-more:focus-visible, .bub.sel .bub-more { opacity: 1; }
.bub-more .icon { width: var(--i-md); height: var(--i-md); stroke-width: 3; }
.bub-menu { display: none; position: absolute; z-index: var(--z-tip); top: 0; left: calc(100% + var(--s-1)); width: 180px; padding: var(--s-1); border: var(--bw) solid var(--line); border-radius: var(--r-md);
  background: var(--panel); box-shadow: var(--float); }  /* floats over the thread: opening it never moves a message */
.bub.me > .bub-menu { left: auto; right: calc(100% + var(--s-1)); }
.bub > .bub-menu.up { top: auto; bottom: 0; }
.bub > .bub-menu.over { left: auto; right: 0; }  /* no room beside a wide bubble: sit on it, at its outer edge */
.bub.sel > .bub-menu { display: grid; }
.bub-menu button { display: flex; align-items: center; gap: var(--s-3); min-height: 44px; padding: 0 var(--s-3); border: 0; border-radius: var(--r-sm); background: none; color: var(--ink);
  font: var(--t-sm) var(--body); text-align: left; cursor: pointer; }
.bub-menu button:hover { background: var(--bg); }
.bub-menu .icon { width: var(--i-sm); height: var(--i-sm); color: var(--muted); }
.bub-menu .bm-del, .bub-menu .bm-del .icon { color: var(--danger); }
.bub-menu .bm-cancel { border-top: var(--bw) solid var(--line); border-radius: 0 0 var(--r-sm) var(--r-sm); color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .bub-menu .bm-cancel { display: none; } }
@media (hover: none) { .bub-more { display: none; } .bub[data-mid] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } }
.bub.del { background: none; border: var(--bw) dashed var(--edge); color: var(--muted); font-style: italic; }
.bub.del time { color: var(--muted); }
.chat-compose { flex-wrap: wrap; }
.chat-ctx { flex-basis: 100%; display: flex; align-items: center; gap: var(--s-2); min-width: 0; padding-left: var(--s-3); border-left: 3px solid var(--accent); border-radius: var(--r-sm);
  background: var(--bg); color: var(--muted); font-size: var(--t-xs); }
.chat-ctx span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-ctx b { color: var(--ink); font-weight: var(--fw-strong); }
/* the job inside the chat (site/ui.js chatPane): a bar with the deal's next step; tap it for the terms, steps and actions */
/* the deal as a sheet hanging from the chat header: its own surface, edge, shadow and rounded bottom, so it never reads as part of the chat.
   The message list sits below it and shrinks to fit; the sheet stops at 60% of the chat and scrolls inside */
.chat-sheet { position: relative; z-index: 1; flex: none; display: flex; flex-direction: column; max-height: 60%; background: var(--panel);
  border-bottom: var(--bw) solid var(--edge); border-radius: 0 0 var(--r-lg) var(--r-lg); box-shadow: var(--float); }
.chat-jobbar { display: flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-1) 0 var(--s-3); color: var(--ink); font: var(--fw-strong) var(--t-sm) var(--body); cursor: pointer; }
.chat-jobbar > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cj-toggle .icon { transition: transform var(--fast) var(--ease); }
.chat-sheet.open .cj-toggle .icon { transform: rotate(180deg); }
.chat-job { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--s-3) var(--s-3) var(--s-1); border-top: var(--bw) solid var(--line); }
.chat-job > .panel-card { padding: 0; border: 0; box-shadow: none; background: none; }
.cj-handle { flex: none; align-self: center; width: 36px; height: 4px; margin: var(--s-1) 0 var(--s-2); border-radius: var(--r-pill); background: var(--edge); }
/* a proposed change to an agreed deal (site/ui.js chatPane): new terms against the old, Accept / Decline for the other side */
.chat-change { align-self: center; display: grid; gap: var(--s-2); width: min(100%, 440px); box-sizing: border-box; margin: var(--s-3) 0; padding: var(--s-3) var(--s-4);
  border: var(--bw) solid var(--line); border-radius: var(--r-md); background: var(--panel); box-shadow: var(--card); }
.chat-change.open { border-color: var(--accent); }
.chat-change p { margin: 0; }
.chat-change .cc-title { font: var(--fw-strong) var(--t-sm) var(--body); }
.chat-change .cc-now, .chat-change .cc-was { display: grid; grid-template-columns: 3em minmax(0, 1fr); gap: var(--s-2); font-size: var(--t-sm); }
.chat-change .cc-now span, .chat-change .cc-was span { font: var(--fw-strong) var(--t-2xs) var(--label); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.chat-change .cc-now { font-weight: var(--fw-strong); }
.chat-change .cc-was { color: var(--muted); text-decoration: line-through; }
.chat-change .cc-note { padding-left: var(--s-2); border-left: 3px solid var(--line); font-size: var(--t-sm); white-space: pre-wrap; }
.chat-change .cc-wait { color: var(--muted); font-size: var(--t-xs); }
.chat-change .row { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* pointing tip (site/ui.js coach): a dark bubble with an arrow at the thing it's about, which gets an outline */
.coach { position: absolute; z-index: var(--z-menu); width: max-content; max-width: min(320px, calc(100vw - 24px)); padding: var(--s-3); border-radius: var(--r-md);
  background: var(--ink); color: var(--panel); box-shadow: var(--float); font: 400 var(--t-sm)/1.45 var(--body); }
.coach::before { content: ""; position: absolute; top: -6px; left: var(--ax, 50%); width: 12px; height: 12px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.coach.up::before { top: auto; bottom: -6px; }
.coach b { display: block; font-weight: var(--fw-strong); }
.coach p, .coach ol { margin: var(--s-1) 0 0; } .coach ol { padding-left: 1.2em; }
.coach-pick { display: block; margin: var(--s-1) 0 0; font-weight: var(--fw-strong); -webkit-user-select: all; user-select: all; word-break: break-all; }
.coach button { margin: var(--s-2) 0 0; padding: 0; border: 0; background: none; color: inherit; font: 700 var(--t-sm) var(--body); text-decoration: underline; cursor: pointer; min-height: 32px; }
.coach-on { outline: 3px solid var(--accent); outline-offset: 3px; }
.subhead { margin: var(--s-4) 0 var(--s-2); padding-top: var(--s-4); border-top: 1px solid var(--line); font: 700 var(--t-md) var(--body); }
/* closed deals (site/ui.js chatList): a collapsed group at the end of the list; their chats are read-only */
.chat-closed { margin-top: var(--s-2); border-top: var(--bw) solid var(--line); padding-top: var(--s-1); }
.chat-closed > summary { display: flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-2); list-style: none; cursor: pointer; border-radius: var(--r-md);
  color: var(--muted); font: var(--fw-strong) var(--t-sm) var(--body); }
.chat-closed > summary::-webkit-details-marker { display: none; }
.chat-closed > summary:hover { background: var(--bg); }
.chat-closed > summary span { font-weight: var(--fw-body); }
.chat-closed > summary .icon { margin-left: auto; width: var(--i-sm); height: var(--i-sm); transition: transform var(--fast) var(--ease); }
.chat-closed[open] > summary .icon { transform: rotate(180deg); }
.chat-closed .chat-row { opacity: .75; }
.chat-ended { margin: 0; padding: var(--s-3) var(--s-4); background: var(--panel); border-top: var(--bw) solid var(--line); color: var(--muted); font-size: var(--t-sm); text-align: center; }
