@font-face{
  font-family:'Hanken Grotesk';
  src:url('/assets/font/hanken.woff2') format('woff2');
  font-weight:400 800;
  font-style:normal;
  font-display:swap;
}
:root{
  /* ── Primary: fresh cool blue. Confident, clear, never warm. ──────────── */
  --brand:#2C63F0;                   /* fills — white text ≥5:1 */
  --brand-fg:#ffffff;
  --brand-text:#2657E6;              /* link/icon ink — ≥4.5:1 on white + tints */
  --brand-tint:rgba(44,99,240,.08);
  --brand-strong:#1E4FD6;            /* hover/press fill, deeper */
  --brand-wash:rgba(44,99,240,.05);  /* faint page-tint surface */
  --brand-chip:rgba(44,99,240,.12);  /* icon-chip fill behind the brand glyph */
  --focus-ring:rgba(44,99,240,.85);  /* ≥3:1 non-text on white + --bg-alt */
  /* ── Money / positive accent: emerald. Money in always reads as good news,
     distinct from the blue chrome. ───────────────────────────────────────── */
  --money:#047857;                  /* text on white ≥4.5:1 */
  --money-strong:#065f46;
  --money-chip:rgba(4,120,87,.12);
  /* ── Neutrals: cool slate ink on near-white surfaces. ─────────────────── */
  --ink:#0f172a;        /* cool near-black headings */
  --body:#334155;       /* cool slate body */
  --muted:#475569;      /* cool muted — ≥4.5:1 on white + --bg-alt */
  --line:#D8E0EA;       /* cool hairlines */
  --line-strong:#cbd5e1;
  --bg:#ffffff;       /* cards */
  --bg-alt:#E6EBF2;   /* page + sunken rows — deeper cool-gray so white cards/sidebar lift */
  --bg-sunken:#EEF3F9;/* faint inner fills */
  --btn-bg:#eef2f7;   /* default (non-primary) button fill */
  --btn-bg-hover:#e2e8f0;
  --switch-off:#cbd5e1;
  --switch-knob:#ffffff;
  --ok-text:#047857;   --ok-tint:rgba(4,120,87,.10);     --ok:#059669;
  --warn-text:#8A5A00; --warn-tint:rgba(180,120,10,.12); --warn:#B4780A;
  --bad-text:#B3322A;  --bad-tint:rgba(211,58,44,.09);   --bad:#D33A2C;
  --btn-danger-bg:#D33A2C;          /* danger fill: white text ≥4.5:1 */
  --btn-danger-strong:#B3322A;
  --mute-text:#475569; --mute-tint:rgba(71,85,105,.12);  /* cool slate (fulfilled/handled pills) */
  --topbar-bg:rgba(255,255,255,.85);
  --radius:18px;
  --radius-sm:12px;
  --radius-xs:9px;
  /* Layered elevation — soft, low-spread shadows tinted toward the cool ink so
     cards feel placed in daylight, not floating in flat space. */
  --sh-sm:0 1px 2px rgba(15,23,42,.05),0 1px 3px rgba(15,23,42,.07);
  --sh-md:0 4px 10px rgba(15,23,42,.07),0 12px 28px rgba(15,23,42,.10);
  --sh-lg:0 10px 24px rgba(15,23,42,.09),0 30px 60px rgba(15,23,42,.15);
  --shadow:var(--sh-sm);            /* legacy alias — default card resting */
  --maxw:980px;
  font-synthesis:none;
}

/* ── DARK palette (cool slate) ───────────────────────────────────────────────
   A faithful inversion, contrast-checked to WCAG AA (text ≥4.5:1, UI
   glyphs/borders ≥3:1). Surfaces follow a cool-slate family (page #0b1120 /
   cards #161e2e) so the app stays clear blue-black at night. The blue lifts to
   a friendly sky; money stays emerald. Keep the two blocks below byte-identical. */
html[data-theme='dark']{
  color-scheme:dark;
  --brand:#6AA1FF;                   /* sky-blue link/brand on dark */
  --brand-fg:#0b1120;                /* ink on a brand-filled pill/button */
  --brand-text:#9DBEFF;              /* ≥4.5:1 on the .2 chip over cards */
  --brand-tint:rgba(106,161,255,.16);
  --brand-strong:#3B82F6;            /* hover/press fill on dark */
  --brand-wash:rgba(106,161,255,.09);
  --brand-chip:rgba(106,161,255,.2);
  --focus-ring:rgba(106,161,255,.9);
  --money:#34d399;                  /* emerald-400 — ≥4.5:1 on dark cards */
  --money-strong:#10b981;
  --money-chip:rgba(52,211,153,.18);
  --ink:#f1f5f9;
  --body:#cbd5e1;                    /* ≥10:1 on cards */
  --muted:#94a3b8;                   /* ≥4.5:1 on cards/page */
  --line:#283447;
  --line-strong:#3a485f;
  --bg:#161e2e;                      /* cards */
  --bg-alt:#0b1120;                  /* page + sunken rows */
  --bg-sunken:#111a2b;
  --btn-bg:#222d42;                  /* default button fill */
  --btn-bg-hover:#2c3850;
  --switch-off:#3a485f;
  --switch-knob:#cbd5e1;
  --ok-text:#34d399;   --ok-tint:rgba(16,185,129,.16);  --ok:#10b981;
  --warn-text:#E8B44A; --warn-tint:rgba(217,165,20,.16);--warn:#D9A514;
  --bad-text:#F08C7E;  --bad-tint:rgba(239,68,68,.15);  --bad:#ef4444;
  --btn-danger-bg:#D33A2C;          /* danger fill: white text ≥4.5:1 */
  --btn-danger-strong:#ef4444;
  --mute-text:#a4b2c4; --mute-tint:rgba(148,163,184,.18);
  --topbar-bg:rgba(11,17,32,.85);
  --sh-sm:0 1px 2px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.34);
  --sh-md:0 6px 14px rgba(0,0,0,.46),0 18px 38px rgba(0,0,0,.5);
  --sh-lg:0 12px 24px rgba(0,0,0,.5),0 36px 70px rgba(0,0,0,.6);
  --shadow:var(--sh-sm);
}
@media (prefers-color-scheme:dark){
  html:not([data-theme]){
    color-scheme:dark;
    --brand:#6AA1FF;
    --brand-fg:#0b1120;
    --brand-text:#9DBEFF;
    --brand-tint:rgba(106,161,255,.16);
    --brand-strong:#3B82F6;
    --brand-wash:rgba(106,161,255,.09);
    --brand-chip:rgba(106,161,255,.2);
    --focus-ring:rgba(106,161,255,.9);
    --money:#34d399;
    --money-strong:#10b981;
    --money-chip:rgba(52,211,153,.18);
    --ink:#f1f5f9;
    --body:#cbd5e1;
    --muted:#94a3b8;
    --line:#283447;
    --line-strong:#3a485f;
    --bg:#161e2e;
    --bg-alt:#0b1120;
    --bg-sunken:#111a2b;
    --btn-bg:#222d42;
    --btn-bg-hover:#2c3850;
    --switch-off:#3a485f;
    --switch-knob:#cbd5e1;
    --ok-text:#34d399;   --ok-tint:rgba(16,185,129,.16);  --ok:#10b981;
    --warn-text:#E8B44A; --warn-tint:rgba(217,165,20,.16);--warn:#D9A514;
    --bad-text:#F08C7E;  --bad-tint:rgba(239,68,68,.15);  --bad:#ef4444;
    --btn-danger-bg:#D33A2C;
    --btn-danger-strong:#ef4444;
    --mute-text:#a4b2c4; --mute-tint:rgba(148,163,184,.18);
    --topbar-bg:rgba(11,17,32,.85);
    --sh-sm:0 1px 2px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.34);
    --sh-md:0 6px 14px rgba(0,0,0,.46),0 18px 38px rgba(0,0,0,.5);
    --sh-lg:0 12px 24px rgba(0,0,0,.5),0 36px 70px rgba(0,0,0,.6);
    --shadow:var(--sh-sm);
  }
}
*{box-sizing:border-box}
body{
  margin:0;color:var(--body);background:var(--bg-alt);
  font-family:'Hanken Grotesk',-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  font-size:16px;line-height:1.6;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
}
.wrap{max-width:var(--maxw);margin:0 auto;padding:0 20px}
/* Type scale — fixed rem (no fluid clamp for UI text), ~1.2 ratio; confident,
   tightly-tracked humanist headings; balanced wrapping on the big ones. */
h1,h2,h3{color:var(--ink);line-height:1.18;margin:0 0 .4em;letter-spacing:-.02em;text-wrap:balance}
h1{font-size:1.75rem;font-weight:800}
h2{font-size:1.22rem;font-weight:750;letter-spacing:-.018em}
h3{font-size:1.02rem;font-weight:700;letter-spacing:-.012em}
a{color:var(--brand-text);text-decoration:none}
a:hover{text-decoration:underline}
.muted{color:var(--muted)}
/* Screen-reader-only: in the DOM + accessibility tree, visually removed. Used to
   name a page in the heading outline when the visible focal point is a figure. */
.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
/* Focus ring: 3px solid at ≥3:1 (WCAG 1.4.11) on every surface, both themes. */
:focus-visible{outline:3px solid var(--focus-ring);outline-offset:2px;border-radius:8px}

/* Skip link (WCAG 2.4.1 Bypass Blocks) — the FIRST focusable thing on every
   page. Off-screen until focused, then it slides into the top-left over the
   chrome so a keyboard / switch user can jump straight past the sidebar nav (a
   13-link rail repeated on every route) to the page's <main>. Mirrors the
   storefront's proven pattern; CSS-only, strict-CSP safe. The target <main> has
   tabindex="-1" so the jump moves real focus there (not just the viewport). */
.skip-link{position:fixed;top:0;left:0;z-index:100;background:var(--ink);color:var(--bg);padding:10px 16px;border-bottom-right-radius:var(--radius-sm);font-weight:700;transform:translateY(-120%);transition:transform .15s ease}
.skip-link:focus{transform:translateY(0)}
.skip-link:focus-visible{outline:3px solid var(--focus-ring);outline-offset:2px}
/* The programmatic skip target must never paint its own focus ring (it isn't a
   control — the visible focus belongs to the heading/content the user reads). */
main:focus{outline:none}
@media (prefers-reduced-motion:reduce){.skip-link{transition:none}}

/* Impersonation banner (Point 4) — persistent + visually distinct, shown on
   every page while a Mission Control operator is logged in as the merchant.
   Spans the very top, above the sidebar shell, so it is always the first thing
   seen. */
.impersonation-banner{position:sticky;top:0;z-index:60;background:var(--warn);color:#1f1400;font-weight:700;border-bottom:1px solid var(--warn-text)}
.impersonation-banner__inner{display:flex;align-items:center;justify-content:space-between;gap:8px 16px;flex-wrap:wrap;padding:8px 20px}
.impersonation-banner strong{font-weight:800}
.impersonation-banner__exit .btn{background:#1f1400;color:#fff;border-color:#1f1400}
/* Demo back office (src/demo.tsx): the same sticky strip in the brand fill, so
   a prospect never mistakes the sample for a real account. brand-fg on brand
   is the pair the tokens above prove at AA; the button inverts it. */
.demo-banner{position:sticky;top:0;z-index:60;background:var(--brand);color:var(--brand-fg);font-weight:700;border-bottom:1px solid var(--brand-strong)}
.demo-banner__inner{display:flex;align-items:center;justify-content:space-between;gap:8px 16px;flex-wrap:wrap;padding:8px 20px}
.demo-banner__exit .btn{background:var(--brand-fg);color:var(--brand-text);border-color:var(--brand-fg)}
/* Live site editor (src/routes/editor.tsx). The draft bar says changes are saved
   but NOT on the website; the editor page is a chat log, a change list and the
   publish box. Only tokens the sheet already proves at AA. */
.draft-bar{display:flex;align-items:center;justify-content:space-between;gap:8px 16px;flex-wrap:wrap;background:var(--warn-tint);color:var(--ink);border:1px solid var(--warn);border-radius:var(--radius-sm);padding:10px 14px;margin-bottom:14px}
.editor-as{display:inline-block;background:var(--warn-tint);border:1px solid var(--warn);color:var(--ink);border-radius:999px;padding:4px 12px;font-weight:700;font-size:.9rem;margin:0 0 10px}
.editor-grid{display:grid;gap:16px;grid-template-columns:minmax(0,1fr)}
@media (min-width:1000px){.editor-grid{grid-template-columns:minmax(0,3fr) minmax(0,2fr);align-items:start}}
.chat-log{display:flex;flex-direction:column;gap:10px;max-height:60vh;overflow:auto;padding:2px}
.chat-msg{border-radius:var(--radius-sm);padding:10px 14px;max-width:92%;white-space:pre-wrap;overflow-wrap:anywhere}
.chat-msg--you{align-self:flex-end;background:var(--brand);color:var(--brand-fg)}
.chat-msg--assistant{align-self:flex-start;background:var(--bg-alt);color:var(--ink);border:1px solid var(--line)}
.chat-msg__refused{display:block;margin-top:6px;color:var(--warn-text);font-size:.92rem}
.chat-form textarea{width:100%;min-height:84px}
.change-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.change-list li{border:1px solid var(--line);border-radius:var(--radius-xs);padding:8px 12px;background:var(--bg)}
.change-before{color:var(--muted);text-decoration:line-through}
.change-after{color:var(--ink);font-weight:650}
.confirm-box{border:1px solid var(--warn);background:var(--warn-tint);border-radius:var(--radius-sm);padding:12px 14px;margin:12px 0}
.confirm-box label{display:flex;gap:10px;align-items:flex-start;font-weight:650;margin:6px 0}
.history-table td,.history-table th{vertical-align:top}

/* ── App shell: a left vertical sidebar + the main column (mirrors Mission
   Control so the two surfaces match). The sidebar carries the brand, a grouped
   vertical nav, the theme toggle + sign out; the main column scrolls.

   Desktop (>=768px): a permanent 230px labelled rail + the main column.
   Mobile (<768px): the rail goes OFF-CANVAS (translateX(-100%)); a slim sticky
   top bar (brand + theme toggle + hamburger) shows instead, and the hamburger
   slides the FULL LABELLED rail in over a dimmed scrim — CSS-only via the
   #nav-toggle checkbox. ─────────────────────────────────────────────────── */
.shell{display:grid;grid-template-columns:230px 1fr;min-height:100vh}
.sidebar{background:var(--bg);border-right:1px solid var(--line);padding:20px 12px;display:flex;flex-direction:column;gap:22px;position:sticky;top:0;height:100vh;overflow-y:auto}
.sidebar__head{display:flex;align-items:center;justify-content:space-between;gap:8px}
/* The in-drawer close + the top bar are desktop-hidden; they only come alive in
   the <768px block below. The drawer checkbox is visually hidden but stays
   FOCUSABLE (clip pattern, no opacity:0 / pointer-events:none / tabindex) so
   keyboard users can Tab to it and toggle the drawer with Space. */
.nav-toggle{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.topbar,.nav-scrim,.nav-close,.nav-burger{display:none}
/* Brand: badge + the merchant's own business name. */
.brand{display:flex;align-items:center;gap:11px;font-weight:800;color:var(--ink);padding:0 6px}
.brand__badge{flex:none;display:grid;place-items:center;width:40px;height:40px;border-radius:13px;background:var(--brand);color:var(--brand-fg);font-size:.92rem;font-weight:800;box-shadow:var(--sh-sm);letter-spacing:.02em}
/* Merchant logo in the shell brand lockup — fills the badge slot when uploaded. */
.brand__logo{flex:none;height:40px;max-height:40px;width:auto;max-width:150px;object-fit:contain;display:block;border-radius:10px}
/* Official Wholesale Payments lockup (auth page + footer credit). Show the
   variant that reads on the current background: portal is LIGHT-first, so
   full-color by default, white wordmark on dark. */
.wpi-logo{height:40px;width:auto;display:block}
.wpi-logo--white{display:none}
.wpi-logo--color{display:block}
html[data-theme='dark'] .wpi-logo--white{display:block}
html[data-theme='dark'] .wpi-logo--color{display:none}
@media (prefers-color-scheme:dark){
  html:not([data-theme]) .wpi-logo--white{display:block}
  html:not([data-theme]) .wpi-logo--color{display:none}
}
.brand--auth{flex-direction:column;gap:10px}
.footer__row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 18px}
.footer__credit{display:inline-flex;align-items:center;gap:7px;color:var(--muted)}
.footer__credit-label{font-size:.86rem}
.footer__logo{height:20px}
.brand__name{font-size:1.08rem;letter-spacing:-.015em;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Vertical grouped nav (SELL / MANAGE / SETTINGS). A small caption labels each
   group. The rail stays fully labelled at every width: a permanent rail at
   >=768px, and an off-canvas labelled drawer under 768px (it never becomes an
   icon-only rail). */
.nav{display:flex;flex-direction:column;gap:18px}
.nav-section{display:flex;flex-direction:column;gap:2px}
.nav-label{padding:0 10px 4px;font-size:.66rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.nav a{position:relative;display:flex;align-items:center;gap:10px;padding:.5em .65em;border-radius:var(--radius-xs);color:var(--body);font-weight:600;transition:background .15s ease,color .15s ease}
.nav a:hover{background:var(--bg-alt);color:var(--ink);text-decoration:none}
.nav a[aria-current="page"]{background:var(--brand-tint);color:var(--brand-text)}
.nav a[aria-current="page"]::before{content:"";position:absolute;left:0;top:7px;bottom:7px;width:3px;border-radius:0 2px 2px 0;background:var(--brand)}
.nav a svg{flex:none;width:19px;height:19px;opacity:.85}
.nav a[aria-current="page"] svg{color:var(--brand-text);opacity:1}
.nav-item__label{min-width:0}
/* Foot of the sidebar: theme toggle + sign out, pushed to the bottom. */
.sidebar-foot{margin-top:auto;display:flex;align-items:center;gap:8px;padding:0 6px;flex-wrap:wrap}
.sidebar-foot .theme-form,.sidebar-foot .topbar__signout{display:flex}
.sidebar-foot .topbar__signout{flex:1 1 auto}
.sidebar-foot .topbar__signout .btn{width:100%}
/* Main column. */
.main-col{display:flex;flex-direction:column;min-width:0}

/* Theme toggle (Point 1) — a ghost icon button cycling System/Light/Dark. The
   right glyph is chosen from data-theme-state on the button, so it's correct
   on first paint in every state (no prefers-color-scheme guess for the icon). */
.theme-form{display:flex}
.theme-toggle{padding:.5em;line-height:0}
.theme-toggle svg{display:none}
.theme-toggle[data-theme-state="system"] .ti-system{display:block}
.theme-toggle[data-theme-state="light"] .ti-sun{display:block}
.theme-toggle[data-theme-state="dark"] .ti-moon{display:block}
/* On the centered auth pages the toggle pins to the top-right corner. */
.auth-theme{display:flex;justify-content:flex-end;padding:14px 18px 0}
.auth-theme .theme-toggle{background:var(--bg);border-color:var(--line)}

/* ── Mobile drawer (<768px): the full labelled rail goes off-canvas and a slim
   sticky top bar takes its place. The hamburger (a <label> for #nav-toggle)
   slides the rail in over a dimmed scrim — NO JavaScript required; the labels
   stay visible in the drawer (NEVER an icon-only rail). ───────────────────── */
@media (max-width:767.98px){
  .shell{display:block;min-height:100vh}
  /* Slim sticky top bar — brand + tools + hamburger. */
  .topbar{display:flex;align-items:center;justify-content:space-between;gap:10px;position:sticky;top:0;z-index:40;padding:10px 16px;min-height:56px;background:var(--topbar-bg);backdrop-filter:saturate(1.2) blur(8px);border-bottom:1px solid var(--line)}
  .topbar .brand--top{padding:0;min-width:0}
  .topbar .brand__badge{width:34px;height:34px;border-radius:11px}
  .topbar .brand__logo{height:34px;max-height:34px;max-width:128px}
  .topbar .brand__name{font-size:1rem}
  .topbar__tools{display:flex;align-items:center;gap:6px;flex:none}
  /* Hamburger / close toggle — a 44px+ tap target, keyboard-operable as a label
     wrapping the hidden checkbox. */
  .nav-burger{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:var(--radius-xs);border:1.5px solid var(--line-strong);background:var(--btn-bg);color:var(--ink);cursor:pointer}
  .nav-burger:hover{background:var(--btn-bg-hover)}
  .menu-glyph{display:block}
  .menu-glyph--close{display:none}
  .nav-toggle:checked ~ .topbar .menu-glyph--open{display:none}
  .nav-toggle:checked ~ .topbar .menu-glyph--close{display:block}
  /* Keyboard focus ring on the label (the checkbox is off-screen). */
  .nav-toggle:focus-visible ~ .topbar .nav-burger{outline:3px solid var(--focus-ring);outline-offset:2px}
  /* Off-canvas drawer: the full labelled rail slides in from the left. When
     CLOSED it is visibility:hidden so its ~13 nav links + the in-drawer close
     control leave the tab order AND the accessibility tree (WCAG 2.4.3 Focus
     Order / 1.3.2 — a keyboard or screen-reader user must never land on the
     off-screen rail while the drawer is shut). visibility is transitioned with
     a delay equal to the slide so the rail stays visible THROUGH the close
     animation, then hides; opening flips it visible instantly. */
  .sidebar{position:fixed;top:0;left:0;bottom:0;height:100dvh;width:min(84vw,300px);z-index:50;transform:translateX(-100%);visibility:hidden;transition:transform .24s ease,visibility 0s linear .24s;border-right:1px solid var(--line);box-shadow:var(--sh-lg);will-change:transform}
  .nav-toggle:checked ~ .sidebar{transform:translateX(0);visibility:visible;transition:transform .24s ease,visibility 0s linear 0s}
  /* Dimmed scrim — covers the page behind the open drawer; tap to close. */
  .nav-scrim{display:block;position:fixed;inset:0;z-index:45;background:rgba(15,23,42,.5);opacity:0;visibility:hidden;transition:opacity .24s ease,visibility .24s ease;cursor:pointer}
  .nav-toggle:checked ~ .nav-scrim{opacity:1;visibility:visible}
  /* In-drawer close control (top-right of the drawer head). */
  .nav-close{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;flex:none;border-radius:var(--radius-xs);border:1px solid var(--line);background:var(--btn-bg);color:var(--ink);cursor:pointer}
  .nav-close:hover{background:var(--btn-bg-hover)}
  .nav-toggle:focus-visible ~ .sidebar .nav-close{outline:3px solid var(--focus-ring);outline-offset:2px}
  /* The drawer's own brand sits in the head; the rail stays fully labelled. */
  .sidebar__head{padding:0 2px 2px}
}
/* No-transform slide for reduced-motion (the drawer still opens, just instant). */
@media (max-width:767.98px) and (prefers-reduced-motion:reduce){
  .sidebar,.nav-scrim{transition:none}
}
/* Desktop keeps the permanent labelled rail — the close control never shows. */
@media (min-width:768px){
  .sidebar__head .nav-close{display:none}
}

/* Buttons — calm pills with a confident lift on the one primary blue
   action per screen. Hover AND press states on every variant. */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.5em;
  border:1.5px solid var(--line);border-radius:999px;padding:.68em 1.3em;
  font-weight:650;font-size:.95rem;letter-spacing:.005em;cursor:pointer;font-family:inherit;
  transition:transform .15s ease,box-shadow .15s ease,background .15s ease,border-color .15s ease,color .15s ease;
  background:var(--btn-bg);color:var(--ink);
}
.btn:hover{background:var(--btn-bg-hover)}
.btn:active{transform:translateY(1px)}
.btn--primary{background:var(--brand);border-color:var(--brand);color:var(--brand-fg);box-shadow:0 8px 20px var(--brand-tint)}
.btn--primary:hover{background:var(--brand-strong);border-color:var(--brand-strong);transform:translateY(-1px);box-shadow:0 12px 26px var(--brand-tint)}
.btn--primary:active{transform:translateY(0);box-shadow:0 4px 12px var(--brand-tint)}
.btn--ghost{background:transparent;border-color:var(--line-strong);color:var(--ink)}
.btn--ghost:hover{background:var(--bg-alt);border-color:var(--line-strong)}
.btn--danger{background:var(--btn-danger-bg);border-color:var(--btn-danger-bg);color:#fff;box-shadow:0 8px 20px var(--bad-tint)}
.btn--danger:hover{background:var(--btn-danger-strong);border-color:var(--btn-danger-strong);transform:translateY(-1px)}
.btn--danger:active{transform:translateY(0)}
.btn--block{width:100%}
.btn--sm{padding:.46em .98em;font-size:.88rem}

/* Pager (audit-style prev/next + "Page X of Y") — shared by the orders and
   transactions lists. */
.pager{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:20px;flex-wrap:wrap}
.pager span{color:var(--muted);font-size:.92rem;font-weight:600}

/* Cards & sections */
main{padding:32px 0 72px}
.section{margin:0 0 34px}
.section__title{display:flex;align-items:baseline;gap:10px;margin-bottom:16px;flex-wrap:wrap}
.section__title .muted{font-size:.92rem}
.section__more{margin-left:auto;font-weight:650;font-size:.92rem;white-space:nowrap}
.card{background:var(--bg);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--sh-sm);padding:24px;transition:box-shadow .18s ease,border-color .18s ease}
.card + .card{margin-top:14px}
/* Warning card (Get paid: the share link can't work yet). Top accent + a warm
   tint header strip — body text keeps the normal ink color, so contrast stays
   AA, and it's not a banned side-stripe. */
.card--warn{border-color:var(--warn);box-shadow:0 -3px 0 var(--warn) inset,var(--sh-sm);margin-bottom:14px}
.stack > * + *{margin-top:14px}
/* List rows inside a .stack lift gently on hover — calm, not flashy. */
.stack > .card:hover{box-shadow:var(--sh-md);border-color:var(--line-strong)}

/* ── Home command center ──────────────────────────────────────────────────── */
/* The money headline — the dominant figure (Hanken, tabular), reading as good
   news in money-green, with a quiet sub-line. Not a lone giant gradient number:
   it sits in a real card alongside a small trend + supporting context. */
.headline{display:flex;flex-wrap:wrap;align-items:flex-end;gap:6px 24px;padding:26px 24px}
.headline__main{display:flex;flex-direction:column;gap:2px;min-width:0}
.headline__eyebrow{color:var(--muted);font-size:.92rem;font-weight:650}
.headline__value{font-size:2.6rem;font-weight:800;line-height:1.04;letter-spacing:-.03em;color:var(--money-strong);font-variant-numeric:tabular-nums}
.headline__sub{color:var(--body);font-size:.96rem}
.headline__trend{display:inline-flex;align-items:center;gap:.4em;font-weight:700;font-size:.92rem;padding:.28em .7em;border-radius:999px;background:var(--money-chip);color:var(--money)}
.headline__aside{margin-left:auto;display:flex;flex-direction:column;gap:2px;text-align:right}
.headline__aside-value{font-size:1.5rem;font-weight:800;color:var(--ink);line-height:1.1;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.headline__aside-label{color:var(--muted);font-size:.86rem;font-weight:600}

/* "Needs your attention" — a short, scannable list of actionable items, each a
   tappable row that links to the task. Empty = a warm all-caught-up state. */
.attention{display:flex;flex-direction:column;gap:0}
.attention__item{display:flex;align-items:center;gap:14px;padding:15px 4px;border-bottom:1px solid var(--line);color:inherit;transition:background .14s ease}
.attention__item:last-child{border-bottom:0}
.attention__item:hover{text-decoration:none;background:var(--bg-sunken)}
.attention__icon{flex:none;display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:var(--brand-chip);color:var(--brand-text)}
.attention__icon svg{width:20px;height:20px;display:block}
.attention__icon--warn{background:var(--warn-tint);color:var(--warn-text)}
.attention__icon--money{background:var(--money-chip);color:var(--money)}
/* Brand tone = the base chip; defined for parity with --warn/--money so the
   modifier the markup emits (tone="brand") always resolves to a rule. */
.attention__icon--brand{background:var(--brand-chip);color:var(--brand-text)}
.attention__body{display:flex;flex-direction:column;gap:1px;min-width:0;flex:1 1 auto}
.attention__title{font-weight:700;color:var(--ink);font-size:1rem}
.attention__note{color:var(--muted);font-size:.9rem}
.attention__count{font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums;font-size:1.1rem}
.attention__chev{flex:none;color:var(--muted);width:18px;height:18px}
.attention--clear{display:flex;align-items:center;gap:14px;padding:6px 4px;color:var(--body)}
.attention--clear .attention__icon{background:var(--money-chip);color:var(--money)}

/* Quick actions — large, friendly targets. Big tap area, clear icon + label. */
.quick-actions{display:grid;grid-template-columns:1fr;gap:12px}
.quick-action{display:flex;align-items:center;gap:14px;padding:18px 20px;border:1.5px solid var(--line);border-radius:var(--radius);background:var(--bg);color:var(--ink);box-shadow:var(--sh-sm);transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.quick-action:hover{text-decoration:none;transform:translateY(-2px);box-shadow:var(--sh-md);border-color:var(--brand)}
.quick-action__icon{flex:none;display:grid;place-items:center;width:46px;height:46px;border-radius:13px;background:var(--brand-chip);color:var(--brand-text)}
.quick-action__icon svg{width:23px;height:23px;display:block}
.quick-action__label{font-weight:750;font-size:1.04rem;letter-spacing:-.01em}
.quick-action__note{display:block;color:var(--muted);font-size:.88rem;font-weight:500;letter-spacing:0}
.quick-action--primary{background:var(--brand);border-color:var(--brand);color:var(--brand-fg);box-shadow:0 8px 20px var(--brand-tint)}
.quick-action--primary:hover{background:var(--brand-strong);border-color:var(--brand-strong)}
.quick-action--primary .quick-action__icon{background:rgba(255,255,255,.18);color:var(--brand-fg)}
.quick-action--primary .quick-action__note{color:rgba(255,255,255,.85)}

/* Home dashboard stat tiles (still used on Home + Insights) — an icon chip, a
   dominant number, a quiet label. The whole tile is the tap target on linked
   ones; hovering lifts it on the layered shadow scale. */
.stats{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.stats--2{grid-template-columns:repeat(2,1fr)}
.stats .card{padding:20px}
.stat{display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:2px}
a.stat{color:inherit;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
a.stat:hover{text-decoration:none;transform:translateY(-3px);box-shadow:var(--sh-md);border-color:var(--brand)}
.stat__icon{display:grid;place-items:center;width:44px;height:44px;border-radius:13px;background:var(--brand-chip);color:var(--brand-text);margin-bottom:12px}
.stat__icon svg{width:22px;height:22px;display:block}
.stat__value{font-size:1.95rem;font-weight:800;color:var(--ink);line-height:1.1;letter-spacing:-.025em;font-variant-numeric:tabular-nums}
.stat__label{color:var(--muted);font-size:.88rem;font-weight:600;line-height:1.4}

/* Get paid — the prominent "waiting to be paid" totals banner. A warm --warn
   tint when money is outstanding (it's owed, and we want it noticed). The paid
   side keeps a calm green --ok tint (money in = good). Numbers stay AA. */
.banners{display:grid;grid-template-columns:1fr;gap:16px;margin-bottom:6px}
.banner{display:flex;align-items:center;gap:16px;border-radius:var(--radius);padding:20px 22px;border:1px solid;box-shadow:var(--sh-sm)}
.banner__icon{flex:none;display:grid;place-items:center;width:48px;height:48px;border-radius:14px}
.banner__icon svg{width:24px;height:24px;display:block}
.banner__body{display:flex;flex-direction:column;gap:1px;min-width:0}
.banner__value{font-size:1.95rem;font-weight:800;line-height:1.05;letter-spacing:-.025em;color:var(--ink);font-variant-numeric:tabular-nums}
.banner__label{font-size:.9rem;font-weight:650}
.banner--warn{background:var(--warn-tint);border-color:var(--warn)}
/* Glyph uses --brand-fg (white in light, warm-near-black ink in dark) so it
   clears the 3:1 non-text floor on the status fill in BOTH themes — white on
   the lifted dark --warn/--ok was only ~2.3:1. */
.banner--warn .banner__icon{background:var(--warn);color:var(--brand-fg)}
.banner--warn .banner__label{color:var(--warn-text)}
.banner--ok{background:var(--ok-tint);border-color:var(--ok)}
.banner--ok .banner__icon{background:var(--ok);color:var(--brand-fg)}
.banner--ok .banner__label{color:var(--ok-text)}

/* Get paid — the share-link box ("Send this link to your customer") */
.sharelink{display:flex;flex-direction:column;gap:8px;margin-top:6px}
.sharelink__label{font-size:.86rem;font-weight:650;color:var(--ink)}
.sharelink__box{width:100%;padding:.74em .9em;border:1px solid var(--line);border-radius:var(--radius-sm);font-size:.95rem;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--ink);background:var(--bg-sunken)}
.sharelink__actions{display:flex;gap:10px;flex-wrap:wrap}
.sharelink .hint{margin:0;color:var(--muted);font-size:.88rem}

/* No-JS confirm for small destructive actions (cancel a payment request) */
details.confirm{margin-top:12px}
details.confirm summary{cursor:pointer;font-weight:650;color:var(--bad-text);list-style-position:inside}
details.confirm .confirm__body{margin-top:8px;padding:14px;border:1px solid var(--bad);border-radius:var(--radius-sm);background:var(--bad-tint)}
details.confirm .confirm__body p{margin:0 0 10px;color:var(--bad-text)}

/* Orders */
.order{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center}
.order__num{font-weight:800;color:var(--ink);letter-spacing:.01em;font-size:1.02rem}
a.order__num:hover{text-decoration:underline}
.order__total{font-weight:800;color:var(--ink);margin-left:auto;font-size:1.08rem;letter-spacing:-.015em;font-variant-numeric:tabular-nums}
.order__total--money{color:var(--money-strong)}
.order__meta{flex-basis:100%;color:var(--muted);font-size:.92rem}
.order__items{flex-basis:100%;color:var(--body)}
.order__actions{flex-basis:100%;display:flex;justify-content:flex-end}
/* Whole-card click target (orders + transactions lists). The order-number link
   stretches a transparent ::after over the entire card so a click anywhere opens
   it; interactive children (the "Mark as done" button) are lifted above it. Pure
   CSS — no JS, strict-CSP safe. */
.order--link{position:relative;cursor:pointer}
.order--link .order__num::after{content:"";position:absolute;inset:0;border-radius:var(--radius)}
.order--link:hover{border-color:var(--brand);box-shadow:var(--sh-md)}
.order--link .order__num:focus-visible{outline:none}
.order--link .order__num:focus-visible::after{outline:3px solid var(--focus-ring);outline-offset:2px}
.order--link .order__actions{position:relative;z-index:1}

/* Status pills (AA on tint). Money-positive states use green, refunds/voids
   crimson — meaning never carried by color alone (label + dot reinforce). */
.pill{display:inline-flex;align-items:center;gap:.42em;border-radius:999px;padding:.22em .74em;font-size:.78rem;font-weight:700;letter-spacing:.01em}
.pill::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.pill--paid{color:var(--ok-text);background:var(--ok-tint);border:1px solid var(--ok)}
.pill--pending{color:var(--warn-text);background:var(--warn-tint);border:1px solid var(--warn)}
.pill--fulfilled{color:var(--mute-text);background:var(--mute-tint);border:1px solid var(--mute-text)}
.pill--canceled{color:var(--bad-text);background:var(--bad-tint);border:1px solid var(--bad)}
/* Reversal states — refunds/voids read in crimson so a money-out event is
   unmistakable (the order/transactions lists + detail use order.status). */
.pill--refunded{color:var(--bad-text);background:var(--bad-tint);border:1px solid var(--bad)}
.pill--voided{color:var(--bad-text);background:var(--bad-tint);border:1px solid var(--bad)}
/* New = brand-blue family. handled/live/draft reuse proven families. */
.pill--new{color:var(--brand-text);background:var(--brand-tint);border:1px solid var(--brand)}
.pill--handled{color:var(--mute-text);background:var(--mute-tint);border:1px solid var(--mute-text)}
.pill--live{color:var(--ok-text);background:var(--ok-tint);border:1px solid var(--ok)}
.pill--draft{color:var(--warn-text);background:var(--warn-tint);border:1px solid var(--warn)}

/* Quote requests */
.lead{display:flex;flex-wrap:wrap;gap:4px 14px;align-items:center}
.lead__name{font-weight:750;color:var(--ink);font-size:1.02rem;letter-spacing:-.01em}
.lead__when{margin-left:auto;color:var(--muted);font-size:.9rem}
.lead__what{flex-basis:100%;color:var(--body)}
.lead__actions{flex-basis:100%;display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}

/* First-party reviews (moderation) */
.review-mod{display:flex;flex-direction:column;gap:8px}
.review-mod__head{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.review-mod__stars{color:var(--ink);font-size:1.05rem;letter-spacing:.06em}
.review-mod__head .muted{margin-left:auto;font-size:.9rem}
.review-mod__author{margin:0;font-weight:750;color:var(--ink)}
.review-mod__body{margin:0;color:var(--body);white-space:pre-wrap}
.review-mod__actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}

/* WPI Rewards (loyalty) — read-only member list */
.reward-member{display:flex;flex-wrap:wrap;gap:4px 14px;align-items:center}
.reward-member__who{font-weight:750;color:var(--ink);font-size:1.02rem;letter-spacing:-.01em}
.reward-member__pts{font-weight:700;color:var(--brand-text);font-variant-numeric:tabular-nums}
.reward-member__when{margin-left:auto;font-size:.9rem}

/* Filter tabs (quote requests) */
.filters{display:flex;gap:6px;margin:0 0 14px;flex-wrap:wrap}
.filters a{color:var(--body);font-weight:600;padding:.38em .9em;border-radius:999px;border:1px solid var(--line);background:var(--bg);transition:background .15s ease,border-color .15s ease,color .15s ease}
.filters a:hover{text-decoration:none;background:var(--bg-alt);border-color:var(--line-strong)}
.filters a[aria-current="page"]{background:var(--brand);border-color:var(--brand);color:var(--brand-fg)}

/* Key–value lines + order-detail items table */
.kv{margin:.32em 0}
.kv__key{display:inline-block;min-width:6.5em;color:var(--muted);font-size:.9rem;font-weight:650}
/* Dense tables scroll horizontally WITHIN their card on narrow screens, so a
   wide table never breaks the page. The table keeps a sensible min-width so its
   columns stay readable; the wrapper takes the overflow with momentum scroll. */
.table-scroll{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.table-scroll table.items{min-width:22rem}
table.items{width:100%;border-collapse:collapse}
table.items th,table.items td{text-align:left;padding:.62em 8px;border-bottom:1px solid var(--line)}
table.items thead th{color:var(--muted);font-size:.78rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase}
table.items tbody tr{transition:background .12s ease}
table.items tbody tr:hover{background:var(--bg-sunken)}
table.items tfoot th,table.items tfoot td{border-bottom:0;font-weight:800;color:var(--ink)}
table.items .items__num{text-align:right;font-variant-numeric:tabular-nums}

/* Products */
.product{display:block}
.product__head{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center}
.product__thumb{width:56px;height:56px;object-fit:cover;border-radius:var(--radius-sm);border:1px solid var(--line)}
/* Large-inventory (P5.4; Pro): bulk-select checkbox on each card + the
   search/filter and bulk-ops cards. The checkbox associates with the bulk form
   by id (HTML form= attribute) — no JS. */
.product__bulk-check{width:20px;height:20px;flex:none;cursor:pointer}
.inventory-filters{margin-bottom:16px}
.bulk-ops{margin-bottom:16px}
.bulk-ops > summary{cursor:pointer;font-weight:650}
.btn.is-disabled{opacity:.5;pointer-events:none}
/* Logo card (Point 6): preview the current logo on a neutral tile so a
   transparent PNG still reads clearly. */
.logo-current{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:10px 0}
.logo-current__img{max-height:56px;max-width:200px;width:auto;object-fit:contain;border:1px solid var(--line);border-radius:var(--radius-xs);background:var(--bg-sunken);padding:8px}
/* Hero-image preview: wide landscape crop (reuses .logo-current's flex row). */
.hero-current__img{width:100%;max-width:320px;aspect-ratio:16/9;object-fit:cover;border:1px solid var(--line);border-radius:var(--radius-xs);background:var(--bg-sunken)}
/* Hero darkness slider. */
.hero-darkness{margin-top:14px;max-width:360px}
.hero-darkness label{display:block;font-weight:600;color:var(--ink);margin-bottom:8px}
.hero-darkness input[type=range]{width:100%;accent-color:var(--brand);cursor:pointer}
.hero-darkness__ends{display:flex;justify-content:space-between;font-size:.82rem;color:var(--muted);margin:4px 0 10px}
.product__name{font-weight:700;color:var(--ink);font-size:1.05rem}
.product__price{font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums}
.product__desc{flex-basis:100%;color:var(--body);margin:.2em 0 0}
.stockform{margin-left:auto;display:flex;align-items:center;gap:8px}
.stocklabel{font-size:.9rem;font-weight:600}
.stocklabel--in{color:var(--ok-text)}
.stocklabel--out{color:var(--mute-text)}

/* Stock switch — a real form submit styled as a switch (no JS) */
.switch{position:relative;width:46px;height:26px;border-radius:999px;border:1px solid var(--line);background:var(--switch-off);cursor:pointer;padding:0;transition:background .18s ease}
.switch::after{content:"";position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;background:var(--switch-knob);box-shadow:0 1px 3px rgba(0,0,0,.3);transition:transform .18s ease}
.switch[aria-checked="true"]{background:var(--ok);border-color:var(--ok)}
.switch[aria-checked="true"]::after{transform:translateX(20px)}

/* Edit form inside a product card */
details.editor{margin-top:10px;border-top:1px solid var(--line);padding-top:12px}
details.editor summary{cursor:pointer;font-weight:650;color:var(--brand-text);list-style-position:inside}
details.editor[open] summary{margin-bottom:12px}

/* Product photo picker — tappable thumbnail radios (no JS; the radio itself is
   visually hidden, the framed thumbnail IS the tap target; :checked + sibling
   shows the pick, :focus-visible + sibling keeps the keyboard ring) */
fieldset.photo-picker{border:0;padding:0;margin:0 0 8px;min-width:0}
.photo-picker legend{font-size:.86rem;font-weight:650;color:var(--ink);padding:0;margin-bottom:6px}
.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:10px}
.photo-choice{position:relative;display:block;cursor:pointer}
.photo-choice input{position:absolute;opacity:0;width:1px;height:1px;margin:0}
.photo-choice__frame{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:4/3;border:2px solid var(--line);border-radius:var(--radius-xs);background:var(--bg-sunken);color:var(--mute-text);font-size:.85rem;font-weight:650;text-align:center;transition:border-color .15s ease,box-shadow .15s ease}
img.photo-choice__frame{object-fit:cover}
.photo-choice input:checked + .photo-choice__frame{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-tint)}
.photo-choice input:focus-visible + .photo-choice__frame{outline:3px solid var(--focus-ring);outline-offset:2px}

/* Multiple-photos editor (migration 0038; Pro). The current extra photos as a
   thumbnail list with per-item reorder/remove actions; reuses .photo-choice
   tokens for visual parity with the picker above. */
.photo-gallery-list{list-style:none;margin:0 0 12px;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:12px}
.photo-gallery-item{display:flex;flex-direction:column;gap:8px}
.photo-gallery-thumb{width:100%;aspect-ratio:4/3;object-fit:cover;border:2px solid var(--line);border-radius:var(--radius-xs);background:var(--bg-sunken)}
.photo-gallery-actions{display:flex;flex-wrap:wrap;gap:6px}

/* Media library (migration 0031) — the merchant's picture grid + quota meter +
   drag/drop upload card. The grid mirrors .photo-grid's auto-fill rhythm but
   each tile is a labelled <figure> (thumbnail + kind/date caption + delete). */
.quota{margin:0 0 18px}
.quota__row{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 12px;margin-bottom:6px}
.quota__row label{font-size:.86rem;font-weight:650;color:var(--ink)}
.quota__figure{font-size:.84rem;color:var(--muted);font-variant-numeric:tabular-nums}
.quota__bar{appearance:none;-webkit-appearance:none;width:100%;height:8px;border:0;border-radius:999px;background:var(--bg-sunken);overflow:hidden}
.quota__bar::-webkit-progress-bar{background:var(--bg-sunken);border-radius:999px}
.quota__bar::-webkit-progress-value{background:var(--brand);border-radius:999px}
.quota__bar::-moz-progress-bar{background:var(--brand);border-radius:999px}
.media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:14px}
.media-tile{margin:0;display:flex;flex-direction:column;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--bg-sunken);overflow:hidden}
.media-tile__img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;background:var(--bg-alt)}
.media-tile__img--missing{display:flex;align-items:center;justify-content:center;color:var(--mute-text);font-size:1.6rem;font-weight:700}
.media-tile__cap{display:flex;flex-direction:column;gap:2px;padding:8px 10px}
.media-tile__kind{font-size:.86rem;font-weight:650;color:var(--ink)}
.media-tile__meta{font-size:.78rem;color:var(--muted)}
.media-tile__del{padding:0 10px 10px;margin-top:auto}
.media-tile__del .btn{width:100%}
/* Drag/drop upload card — the dropzone state + the (JS-revealed) drop hint. */
.media-upload.is-dragover{outline:3px dashed var(--brand);outline-offset:4px;border-radius:var(--radius-sm)}
.media-drop-hint{font-size:.84rem;color:var(--muted);font-style:italic}

/* Forms */
.form-grid{display:grid;grid-template-columns:1fr;gap:14px}
.field{display:flex;flex-direction:column;gap:5px}
/* Customize "Look" radio groups: a bare <fieldset class="field"> — strip the
   default UA border/padding so it matches the rest of the form, and give the
   legend the same weight as a field label. */
fieldset.field{border:0;padding:0;margin:0;min-width:0}
fieldset.field legend{font-size:.86rem;font-weight:650;color:var(--ink);padding:0;margin-bottom:6px}
.field label{font-size:.86rem;font-weight:650;color:var(--ink)}
/* Radio + checkbox inputs inside a .field must NOT take the text-input rule
   below (width:100% + padding): that is exactly what stretched the Customize
   page's radios across the whole row, shoved each option's text to the far
   right and made the options step diagonally. Native size, brand accent. */
.field input[type=radio],.field input[type=checkbox]{width:auto;padding:0;margin:0;flex:none;accent-color:var(--brand)}
/* A no-JS choice list (Customize "Look"): one <label for> per <input id> so the
   whole row is the hit target and assistive tech reads the option text. */
.choices{display:flex;flex-direction:column;gap:8px;margin:2px 0 6px}
.field .choice{display:flex;align-items:center;gap:10px;font-size:.95rem;font-weight:500;color:var(--body);cursor:pointer}
.field input,.field textarea,.field select{
  width:100%;padding:.72em .9em;border:1px solid var(--line-strong);border-radius:var(--radius-sm);
  font-size:1rem;font-family:inherit;color:var(--ink);background:var(--bg);
  transition:border-color .15s ease,box-shadow .15s ease;
}
.field input::placeholder,.field textarea::placeholder{color:var(--muted)}
.field input:hover,.field textarea:hover,.field select:hover{border-color:var(--muted)}
.field input:focus,.field textarea:focus,.field select:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-tint)}
.field textarea{min-height:76px;resize:vertical}
.field .error{color:var(--bad-text);font-size:.86rem;font-weight:600}
.field .hint{color:var(--muted);font-size:.84rem}
.error{color:var(--bad-text);font-size:.9rem;font-weight:600}
.form-actions{display:flex;gap:10px;justify-content:flex-end}
/* The one long form (Business info) keeps its Save in reach on phones. */
.form-actions--sticky{position:sticky;bottom:0;background:var(--bg-alt);padding:12px 0;margin-top:4px}
/* Destructive product delete: set apart from the Save row, left-justified. */
.form-actions--delete{justify-content:flex-start;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}

/* Hours & services row editors — one stacked card-row per entry on phones */
.rows{display:flex;flex-direction:column;gap:10px}
.row{display:grid;grid-template-columns:1fr;gap:8px;padding:14px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--bg-sunken)}
.row .error{grid-column:1 / -1}

/* Toasts (PRG) */
.toast{border-radius:var(--radius-sm);padding:.88em 1.1em;margin:0 0 20px;font-weight:600;border:1px solid;box-shadow:var(--sh-sm)}
.toast--ok{color:var(--ok-text);background:var(--ok-tint);border-color:var(--ok)}
.toast--err{color:var(--bad-text);background:var(--bad-tint);border-color:var(--bad)}
.toast--demo{color:var(--brand-text);background:var(--brand-tint);border-color:var(--brand)}

/* Auth pages */
.auth{max-width:440px;margin:60px auto;padding:0 16px}
.auth .card{padding:32px;box-shadow:var(--sh-lg)}
.auth h1{font-size:1.45rem}
.auth p{margin:.4em 0 1em}
.auth .brand{justify-content:center;margin-bottom:22px}
/* "Trust this device" check row on the OTP page (and any inline checkbox). */
.check{display:flex;align-items:flex-start;gap:.55em;font-size:.92rem;color:var(--body);line-height:1.4;cursor:pointer}
.check input{margin:.18em 0 0;width:1.05em;height:1.05em;flex:none;accent-color:var(--brand)}

/* Empty states — a one-liner stays supported (.empty alone), but the richer
   shape is an icon chip + headline + supporting line + optional primary CTA. */
.empty{color:var(--muted);text-align:center;padding:40px 18px}
.empty__icon{display:grid;place-items:center;width:58px;height:58px;margin:0 auto 16px;border-radius:18px;background:var(--brand-chip);color:var(--brand-text)}
.empty__icon svg{width:28px;height:28px;display:block}
.empty__title{font-size:1.15rem;font-weight:750;color:var(--ink);letter-spacing:-.015em;margin:0 0 4px}
.empty__body{margin:0 auto;max-width:46ch;color:var(--muted)}
.empty__cta{margin-top:18px}

footer{border-top:1px solid var(--line);padding:24px 0;color:var(--muted);font-size:.9rem;background:var(--bg)}

@media (min-width:700px){
  h1{font-size:2.05rem}
  .form-grid{grid-template-columns:1fr 1fr}
  .field--wide{grid-column:1 / -1}
  .order__actions,.order__items{flex-basis:auto}
  .order__items{flex-basis:100%}
  .row{grid-template-columns:1fr 1fr}
  /* Both stat rows share the same three-column track so the two "To collect"
     tiles line up under the first two "This week" tiles; the get-paid banner
     pair sets the outstanding total wider. */
  .stats{grid-template-columns:repeat(3,1fr)}
  .stats--2{grid-template-columns:repeat(3,1fr)}
  /* "This week" carries a fourth tile (website visits): two by two until
     there is room for all four in one row (the 1100px query below). */
  .stats--4{grid-template-columns:repeat(2,1fr)}
  .banners{grid-template-columns:1.4fr 1fr}
  .stat__value{font-size:2.1rem}
  .banner__value{font-size:2.15rem}
  .headline__value{font-size:3rem}
  .quick-actions{grid-template-columns:repeat(3,1fr)}
}
@media (min-width:1100px){
  .stats--4{grid-template-columns:repeat(4,1fr)}
}
@media (prefers-reduced-motion:reduce){
  *{transition:none !important}
  a.stat:hover,.btn--primary:hover,.btn--danger:hover,.quick-action:hover{transform:none}
}

/* ── Narrow-phone overflow audit (down to 360px): nothing runs off the page.
   Multi-column content stacks, big numbers stay legible, action rows wrap, and
   no fixed width exceeds the viewport. ─────────────────────────────────────── */
@media (max-width:480px){
  .wrap{padding:0 16px}
  main{padding:22px 0 56px}
  /* The money headline + its aside stack instead of fighting for one row. */
  .headline{padding:22px 18px}
  .headline__aside{margin-left:0;text-align:left;width:100%}
  .headline__value{font-size:2.2rem}
  /* The status-breakdown row: the label column was a fixed 9em — let it shrink
     so the bar + count never push past the edge. */
  .status-breakdown__row{grid-template-columns:minmax(0,7em) 1fr auto;gap:8px}
  /* Action / button rows wrap and right-aligned ones become full-width-friendly. */
  .form-actions,.lead__actions,.sharelink__actions,.order__actions{flex-wrap:wrap}
  .form-actions{justify-content:stretch}
  .form-actions .btn{flex:1 1 auto}
  /* Money summary keeps its two columns but never overflows. */
  .money-summary th{padding-right:10px}
  /* Primary tap targets clear 44px on phones. */
  .btn{min-height:44px}
  .btn--sm{min-height:38px}
}

/* Charts / SVG always fill their container, never a fixed pixel width. */
.chart,svg.chart{max-width:100%;height:auto}

/* ── Point 9: taxes, reversals, delivery, insights ──────────────────────── */
.money-summary{width:100%;border-collapse:collapse}
.money-summary th,.money-summary td{padding:.4em 0}
.money-summary th{text-align:left;font-weight:600;color:var(--body)}
.money-summary td{text-align:right;font-variant-numeric:tabular-nums;color:var(--ink)}
.money-summary__total th,.money-summary__total td{font-weight:800;color:var(--ink);border-top:1px solid var(--line);padding-top:.6em}
.money-summary__total td{color:var(--money-strong)}
.money-summary__refund td{color:var(--bad-text)}
.ship-addr{display:inline-block;line-height:1.4}
/* Reversal forms (refund / void / tip-adjust) — set in a sunken danger-tinted
   panel so a money-out action reads as deliberate, never accidental. */
.reversal-form{margin:0 0 14px}
.reversal-form--tip{border-top:1px solid var(--line);padding-top:16px}
.event-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.event-list li{color:var(--body);font-size:.95rem;padding-left:16px;position:relative}
.event-list li::before{content:"";position:absolute;left:0;top:.62em;width:6px;height:6px;border-radius:50%;background:var(--line-strong)}
.tax__head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.tax__name{font-weight:750;color:var(--ink)}
.tax__rate{font-weight:700;color:var(--money);font-variant-numeric:tabular-nums}
.tax-picker,.tax-choice{display:block;border:0;padding:0;margin:0}
.tax-choice{display:flex;align-items:center;gap:8px;padding:5px 0}
.bulk-tax .form-actions{gap:8px;flex-wrap:wrap}
/* Discount / promo-code cards (migration 0032) — mirror the tax card header. */
.discount__head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.discount__code{font-weight:750;color:var(--ink);font-variant-numeric:tabular-nums;letter-spacing:.02em}
.discount__value{font-weight:700;color:var(--money)}
.discount__used{font-size:.85rem;margin-left:auto}
.shipping-toggle__label{display:flex;align-items:center;gap:10px;margin:8px 0}

/* Insights report total — big friendly money number with a quiet label. */
.report-total{display:flex;flex-direction:column;gap:2px;margin:6px 0 14px}
.report-total__value{font-size:2.2rem;font-weight:800;line-height:1.05;letter-spacing:-.03em;color:var(--money-strong);font-variant-numeric:tabular-nums}
.report-total__label{color:var(--muted);font-size:.92rem}

/* Charts — server-rendered inline SVG, restyled to the new palette. Revenue +
   tax bars use the GREEN money accent (money in = good); geometry stays on
   attributes (CSP-safe), only fills/labels are CSS. */
.chart{width:100%;height:auto;display:block;margin:8px 0}
.chart__bar{fill:var(--money)}
.chart__label{fill:var(--muted);font-size:11px}
.status-breakdown{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.status-breakdown__row{display:grid;grid-template-columns:9em 1fr auto;align-items:center;gap:10px}
.status-breakdown__label{color:var(--body);font-size:.92rem;font-weight:600}
.status-breakdown__track{display:block;width:100%;height:12px;background:var(--mute-tint);border-radius:6px;overflow:hidden}
.status-breakdown__fill{fill:var(--mute-text)}
.status-fill--paid{fill:var(--ok)}
.status-fill--pending{fill:var(--warn)}
.status-fill--fulfilled{fill:var(--mute-text)}
.status-fill--canceled{fill:var(--bad)}
.status-breakdown__count{color:var(--muted);font-size:.88rem;white-space:nowrap;font-variant-numeric:tabular-nums}

/* AOV line under the revenue total — a quieter second figure + trend chip. */
.report-aov{display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 12px;margin:-6px 0 14px}
.report-aov__value{font-size:1.25rem;font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums}
.report-aov__label{color:var(--muted);font-size:.9rem}
.report-aov__delta{font-size:.82rem;font-weight:700;padding:.16em .6em;border-radius:999px}
.report-aov__delta.is-up{color:var(--ok-text);background:var(--ok-tint)}
.report-aov__delta.is-down{color:var(--bad-text);background:var(--bad-tint)}

/* Info banner — a quiet, neutral notice (truncation / SMS-consent / UTC note).
   Class-driven (no inline style), reuses the brand tint so it reads as info. */
.banner--info{display:block;border-radius:var(--radius);padding:12px 16px;margin:0 0 16px;background:var(--brand-tint);border:1px solid var(--brand);color:var(--body);font-size:.92rem}

/* Customers page: KPI split line, search row, table reach-out cell, data note. */
.customer__split{margin:0 0 14px}
.customer__note{margin:14px 0 0;font-size:.85rem}
.customer-search{display:flex;gap:8px;margin:0 0 16px;flex-wrap:wrap}
.customer-search input[type=search]{flex:1 1 14rem;min-width:0;padding:.55em .8em;border:1px solid var(--line-strong);border-radius:var(--radius);background:var(--bg);color:var(--ink);font:inherit}
.customer__reach{display:flex;gap:6px;white-space:nowrap}

/* Busiest days & hours heat grid — class-driven cell fills (CSP-safe: no inline
   style). 7 rows (Mon..Sun) x 4 day-parts; intensity is one of five buckets. */
.busy-grid{display:flex;flex-direction:column;gap:4px;margin:8px 0;overflow-x:auto}
.busy-grid__head,.busy-grid__row{display:grid;grid-template-columns:3.2em repeat(4,1fr);gap:4px;align-items:center;min-width:20rem}
.busy-grid__part{color:var(--muted);font-size:.74rem;font-weight:700;letter-spacing:.02em;text-align:center}
.busy-grid__corner{display:block}
.busy-grid__day{color:var(--body);font-size:.82rem;font-weight:700}
.busy-cell{display:block;height:26px;border-radius:6px;border:1px solid var(--line)}
.heat--0{background:var(--mute-tint)}
.heat--1{background:var(--brand-tint)}
.heat--2{background:color-mix(in srgb,var(--brand) 35%,transparent)}
.heat--3{background:color-mix(in srgb,var(--brand) 60%,transparent)}
.heat--4{background:var(--brand);border-color:var(--brand)}

/* ---- Staff & hours (salon; recipe-kickoff TASK 2) ---- */
.staff--retired{opacity:.7}
.staff__edit,.staff__retire{margin-top:10px}
.staff__hours{margin-top:14px}
.staff__hours h4{margin:0 0 6px;font-size:.95rem}
.staff__hours .hours th{text-align:left;font-weight:600;padding-right:10px}
.staff__hours .hours td{padding:2px 6px 2px 0}
.staff__svc{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.staff__svc-name{font-weight:600;flex:1 1 160px}
.staff__svc-toggle{display:inline-flex;align-items:center;gap:6px;font-size:.9rem}
.staff__svc-dur{display:inline-flex;align-items:center;gap:6px;font-size:.9rem}
.staff__svc-dur input{width:5.5rem}
.tables__row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px}
.tables__row .qfield{flex:1 1 160px;margin:0}
.tables__row .tables__seats{flex:0 0 7rem}
.tables__row form{margin:0}
.tables__off{color:var(--mute-text)}
.tables__sum{font-weight:600}
/* Photos a customer attached to a quote request (Round 2, migration 0062). */
.lead__photos{flex-basis:100%;display:flex;gap:8px;flex-wrap:wrap}
.lead__photos img{width:96px;height:96px;object-fit:cover;border-radius:8px;border:1px solid var(--line,rgba(128,128,128,.3));display:block}

/* ---- Members + the member card (0056) ---- */
.mstate{display:inline-block;padding:.15em .6em;border-radius:999px;font-weight:700;font-size:.85rem;border:1px solid currentColor}
.mstate--active{color:var(--ok-text)}
.mstate--expired,.mstate--used,.mstate--canceled{color:var(--bad-text)}
.mcheck h1{margin:0 0 4px}
.mcheck__plan{margin:0 0 8px;font-weight:600}
.mcheck__state{margin:0 0 16px}
.mcheck__why{margin:0;font-weight:600}
.mcheck--active{border-left:6px solid var(--ok)}
.mcheck--expired,.mcheck--used,.mcheck--canceled{border-left:6px solid var(--bad)}
.mcard-admin{display:flex;flex-wrap:wrap;gap:20px;align-items:flex-start;margin:12px 0}
.mcard-admin .qr{width:180px;height:180px;flex:0 0 auto}
.mcard-admin .sharelink{flex:1 1 16rem;min-width:0}
.mvisits{margin:0;padding-left:1.2em}
.mcard{text-align:center}
.mcard__biz{margin:0;font-weight:700;letter-spacing:.02em}
.mcard__name{margin:8px 0 2px;overflow-wrap:anywhere}
.mcard__plan{margin:0 0 10px;font-weight:600}
.mcard__state{margin:0 0 16px}
.mcard .qr{width:min(72vw,260px);height:auto;display:block;margin:0 auto 14px}
.mcard__how{margin:0;color:var(--muted)}
