  /* Palette: Anna's UI kit "Mist navy" (Figma, Nov 2026), the same token
     names as the v3 kit with new values. Navy #1B2A4A is the accent, the
     text and the brand; slate, mist blue, fog and paper carry the rest, and
     indigo is gone. The tool pages use the wireframes' own names for the
     same colors (--line, --ink-2, --crit...), aliased once below so every
     page shares one palette instead of keeping a copy of it.
     color-scheme follows the theme so native controls (a <select>'s option
     list, date pickers, scrollbars) are drawn for the same background as the
     page. Without it a dark page got the browser's light option list under
     the page's pale text. */
  :root {
    color-scheme: light;
    --bg: #eff2f6;            /* bg/canvas · paper */
    --surface: #ffffff;       /* bg/surface */
    --surface-2: #f5f7fa;     /* bg/subtle, bg/hover */
    --surface-3: #e1e6ee;     /* fog */
    --border: #e1e6ee;        /* border/default */
    --border-strong: #cdd4df; /* border/strong */
    --ink: #1b2a4a;           /* text/primary · navy */
    --ink-muted: #4a5d80;     /* text/secondary · slate */
    --ink-faint: #5a6b8c;     /* text/muted */
    --accent: #1b2a4a;        /* accent/default */
    --accent-hover: #2b3d5f;
    --accent-ink: #ffffff;    /* text/on-accent */
    --accent-soft: #e6eef9;   /* bg/accent-subtle */
    --link: #1b2a4a;          /* text/link: ink, underlined */
    --good: #1f6b48;
    --good-soft: #e5f3ec;
    --warn: #8a5a00;
    --warn-soft: #fcf3df;
    --critical: #b3362f;
    --critical-soft: #fcedec;
    --key: #1b2a4a;           /* status/key-fg */
    --key-soft: #c9d8ee;      /* status/key-bg · mist blue */
    --neutral-soft: #eff2f6;
    /* chart/* : you vs market, volume bars, NeverOOS stock segments */
    --chart-you: #1b2a4a; --chart-market: #cdd4df; --chart-volume: #a6b3ca;
    --stock-out: #d9534f; --stock-now: #e8a93a; --stock-soon: #cdd4df; --stock-covered: #8fa9d2; --stock-healthy: #3a9e72;
    --funnel-you-1: #e6eef9; --funnel-you-2: #c9d8ee; --funnel-you-3: #7a96c4; --funnel-you-4: #1b2a4a;
    --funnel-market-1: #eff2f6; --funnel-market-2: #e1e6ee; --funnel-market-3: #cdd4df; --funnel-market-4: #b3bdcc;
    --heat-1: #1b2a4a0f; --heat-2: #1b2a4a1f; --heat-3: #1b2a4a33; --heat-4: #1b2a4a4d; --heat-5: #1b2a4a6b;
    --shadow: 0 8px 24px rgba(27, 42, 74, .10);
    --card-shadow: none;
    --image-outline: oklch(0 0 0 / .1);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --bg: #0b1220;
      --surface: #111a2e;
      --surface-2: #17233d;
      --surface-3: #22324f;
      --border: #22324f;
      --border-strong: #2b3d5f;
      --ink: #eff2f6;
      --ink-muted: #b7c3d7;
      --ink-faint: #8191b0;
      --accent: #c9d8ee;
      --accent-hover: #d7e3f4;
      --accent-ink: #1b2a4a;
      --accent-soft: #22324f;
      --link: #eff2f6;
      --good: #86cfa6;
      --good-soft: #15322b;
      --warn: #edc475;
      --warn-soft: #372c18;
      --critical: #f2a29c;
      --critical-soft: #3a1e26;
      --key: #c9d8ee;
      --key-soft: #2f4675;
      --neutral-soft: #17233d;
    --chart-you: #c9d8ee; --chart-market: #3b4b69; --chart-volume: #4a5d80;
    --stock-out: #f2a29c; --stock-now: #edc475; --stock-soon: #2b3d5f; --stock-covered: #aec3e3; --stock-healthy: #86cfa6;
    --funnel-you-1: #22324f; --funnel-you-2: #2f4675; --funnel-you-3: #45629a; --funnel-you-4: #c9d8ee;
    --funnel-market-1: #17233d; --funnel-market-2: #22324f; --funnel-market-3: #2b3d5f; --funnel-market-4: #3b4b69;
    --heat-1: #c9d8ee14; --heat-2: #c9d8ee24; --heat-3: #c9d8ee38; --heat-4: #c9d8ee52; --heat-5: #c9d8ee70;
      --chart-you: #c9d8ee; --chart-market: #3b4b69; --chart-volume: #4a5d80;
      --stock-out: #f2a29c; --stock-now: #edc475; --stock-soon: #2b3d5f; --stock-covered: #aec3e3; --stock-healthy: #86cfa6;
      --funnel-you-1: #22324f; --funnel-you-2: #2f4675; --funnel-you-3: #45629a; --funnel-you-4: #c9d8ee;
      --funnel-market-1: #17233d; --funnel-market-2: #22324f; --funnel-market-3: #2b3d5f; --funnel-market-4: #3b4b69;
      --heat-1: #c9d8ee14; --heat-2: #c9d8ee24; --heat-3: #c9d8ee38; --heat-4: #c9d8ee52; --heat-5: #c9d8ee70;
      --shadow: 0 8px 24px rgba(0, 0, 0, .45);
      --card-shadow: none;
      --image-outline: oklch(1 0 0 / .1);
    }
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b1220;
    --surface: #111a2e;
    --surface-2: #17233d;
    --surface-3: #22324f;
    --border: #22324f;
    --border-strong: #2b3d5f;
    --ink: #eff2f6;
    --ink-muted: #b7c3d7;
    --ink-faint: #8191b0;
    --accent: #c9d8ee;
    --accent-hover: #d7e3f4;
    --accent-ink: #1b2a4a;
    --accent-soft: #22324f;
    --link: #eff2f6;
    --good: #86cfa6;
    --good-soft: #15322b;
    --warn: #edc475;
    --warn-soft: #372c18;
    --critical: #f2a29c;
    --critical-soft: #3a1e26;
    --key: #c9d8ee;
    --key-soft: #2f4675;
    --neutral-soft: #17233d;
    --shadow: 0 8px 24px rgba(0, 0, 0, .45);
    --card-shadow: none;
    --image-outline: oklch(1 0 0 / .1);
  }
  :root {
    --line: var(--border); --line-strong: var(--border-strong);
    --ink-2: var(--ink-muted); --ink-3: var(--ink-faint);
    --on-accent: var(--accent-ink);
    --crit: var(--critical); --crit-soft: var(--critical-soft);
    --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  }

  * { box-sizing: border-box; }
  body {
    margin: 0;
    padding: 0 0 88px;
    background: var(--bg);
    color: var(--ink);
    font: 400 14px/20px var(--sans);
    -webkit-font-smoothing: antialiased;
  }
  /* The redesign's content column: 1200px, 16px gutters (the header is wider, 1376px). */
  .wrap { max-width: 1232px; margin: 0 auto; padding: 24px 16px 0; }
  @media (max-width: 600px) { .wrap { padding-inline: 16px; } }
  .wrap.narrow { max-width: 420px; }
  .mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
  .num { font-variant-numeric: tabular-nums; text-align: right; }
  .eyebrow, .overline {
    font: 500 11px/16px var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }
  /* v3 UI kit: links are ink with an underline; indigo marks only the primary
     button. Navigation, menus, chips, tabs and button-shaped links stay plain. */
  a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
  a:hover { text-decoration-thickness: 2px; }
  .appnav a, .nav-more-panel a, .acct-menu-panel a, .mobile-tools-panel a, a.logo, a.btn, a.chip, a.tab, .tabs a,
  .skip-link, .bell, .avatar, a.card, .card a.stretch { text-decoration: none; }
  h1 { font: 600 28px/36px var(--sans); text-wrap: balance; }
  h2 { font: 600 20px/28px var(--sans); text-wrap: balance; }
  h3 { font: 600 16px/24px var(--sans); }
  .skip-link { position: fixed; z-index: 100; top: 8px; left: 16px; padding: 10px 14px;
    border-radius: 8px; background: var(--accent); color: var(--accent-ink);
    font-weight: 600; text-decoration: none; transform: translateY(-160%); }
  .skip-link:focus { transform: none; }
  #main-content { scroll-margin-top: 140px; }

  /* ---- app bar (matches docs/wireframes) ---- */
  /* Two rows: the logo and the account area, then the tools (order 3, full
     width). Flex with wrap, not grid, so the phone rules below can give the
     logo and the account area a row each. */
  /* The redesign's one-row header: logo, tools, account. On a narrower screen
     the tools wrap to a row of their own (the 1100px rule below), and on a
     phone they fold into the "All tools" menu (mobile-nav.js). */
  .appbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
  .appbar-in { max-width: 1376px; margin: 0 auto; padding: 0 16px; display: flex; flex-wrap: wrap; align-items: center; column-gap: 20px; }
  /* The logo's basis is about the mark plus "Rivet Rocket": an account area
     that would leave it less wraps to its own row instead of covering it. */
  .logo { display: flex; flex: 0 1 auto; align-items: center; gap: 10px; min-height: 52px;
    font: 600 16px/24px var(--sans); color: var(--ink); text-decoration: none; }
  /* Brand kit (Nov 2026): the symbol and wordmark are inline SVGs on currentColor;
     navy on the light theme, white on dark. The text name stays for screen readers. */
  /* D1 logo: navy body and wordmark with a slate trail on light; white with a mist-blue trail on dark */
  .logo { color: #1b2a4a; --logo-trail: #4a5d80; }
  :root[data-theme="dark"] .logo { color: #ffffff; --logo-trail: #c9d8ee; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo { color: #ffffff; --logo-trail: #c9d8ee; } }
  .logo-mark { flex: none; width: 23px; height: 30px; display: grid; place-items: center; color: inherit; }
  .logo-mark svg { width: 23px; height: 30px; display: block; }
  .logo-word { flex: none; display: grid; align-items: center; }
  .logo-word svg { height: 13px; width: auto; display: block; }
  .logo .sr-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .logo svg { display: block; }
  /* "Rivet Rocket · Agency · Brand": the app name is the logo, the rest muted
     and truncated so long names never push the nav or account area around. */
  .logo { min-width: 0; max-width: 100%; }
  .logo .logo-name { flex: none; }
  .logo .logo-sep { flex: none; color: var(--ink-faint); font-weight: 400; }
  .logo .logo-sub { min-width: 0; max-width: 18em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-muted); font-weight: 500; font-size: 13.5px; }
  @media (max-width: 760px) { .logo .logo-sub { max-width: 11em; } }
  @media (max-width: 420px) {
    .logo { gap: 5px; }
    .logo .logo-sub { max-width: 7.5em; font-size: 13px; }
    /* The brand is the name that matters most: it gives up space last. */
    .logo .logo-sub:last-child { flex-shrink: .4; }
  }
  /* On a phone the brand switcher and role badge leave the logo no room
     (the agency and brand names shrank to nothing, and the select covered
     "Rivet Rocket"): give the logo its own row and the account row below.
     Same with the alerts bell next to an agency and a brand name. */
  @media (max-width: 560px) {
    .appbar-in:has(.brand-switcher, .role-badge) .logo { flex: 1 0 100%; }
    .appbar-in:has(.brand-switcher, .role-badge) .acct { margin-left: 0; width: 100%; flex-wrap: nowrap; justify-content: flex-end; }
    .appbar-in:has(.bell):has(.logo-sub ~ .logo-sub) .logo { flex: 1 0 100%; }
    .appbar-in:has(.bell):has(.logo-sub ~ .logo-sub) .acct { margin-left: 0; width: 100%; flex-wrap: nowrap; justify-content: flex-end; }
    .appbar-in:has(.brand-switcher) .brand-switcher { flex: 1 1 auto; min-width: 0; }
    .appbar-in:has(.brand-switcher) .brand-switcher select { width: 100%; max-width: 260px; text-overflow: ellipsis; }
  }
  .nav-badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
  .appnav { flex: 1 1 0; display: flex; gap: 2px; flex-wrap: wrap; align-items: center; min-width: 0; padding-block: 10px; }
  .appnav a, .appnav summary { padding: 8px 10px; border-radius: 8px; color: var(--ink-muted); text-decoration: none; font-weight: 500; font-size: 14px; line-height: 16px; }
  .appnav a:hover, .appnav summary:hover { color: var(--ink); }
  .appnav a[aria-current], .appnav summary[aria-current] { background: var(--accent-soft); color: var(--link); }
  @media (max-width: 1100px) {
    .logo { flex: 1 1 10em; }
    .appnav { order: 3; flex: 1 0 100%; padding-block: 6px; border-top: 1px solid var(--border); }
  }
  /* Below a wide desktop the Connect accounts button is its icon alone, so the
     theme toggle (v3) fits without the tools wrapping to a second line. */
  @media (max-width: 1520px) { .connect-accounts-btn .cab-label { display: none; } .connect-accounts-btn { padding: 0 8px; } }
  .appnav a.nav-off { opacity: .45; text-decoration: line-through; }
  /* A link to a page this viewer can't open yet (tool_access's "links"
     section; templating.tool_link, rrToolLink below): greyed, no href. */
  /* !important: a page's own link or button colors (e.g. #bm .btn) mustn't make it look live. */
  .link-soon { position: relative; color: var(--ink-faint) !important; cursor: not-allowed !important; text-decoration: none !important; opacity: .7; }
  .link-soon.btn { border-style: dashed !important; background: var(--surface-2) !important; }
  .link-soon.btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 7px; padding: 7px 12px; font: 600 12.5px "IBM Plex Sans", sans-serif;
    background: var(--surface-2); color: var(--ink-faint); border: 1px dashed var(--border-strong); }
  .link-soon:hover::after, .link-soon:focus-visible::after { content: "Coming soon"; position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
    padding: 3px 8px; border-radius: 6px; background: var(--ink); color: var(--surface); font: 500 11.5px "IBM Plex Sans", sans-serif;
    white-space: nowrap; pointer-events: none; z-index: 50; }
  .mobile-tools { display: none; }
  .acct { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 13px; flex-wrap: wrap; }
  .demo-trigger { min-height: 44px; }
  .demo-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
  .demo-dialog::backdrop { background: rgb(0 0 0 / .5); }
  .demo-dialog h2 { margin: 0; }
  .demo-dialog p { color: var(--ink-muted); }
  .demo-dialog .demo-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
  .demo-dialog .btn { min-height: 44px; }
  .appnav a, .appnav summary { white-space: nowrap; }
  @media (max-width: 760px) {
    .appbar { position: static; }
    .appbar-in { padding-inline: 16px; }
    .appnav { gap: 1px; }
    .appnav a, .appnav summary { padding: 7px 8px; font-size: 12.5px; }
    body.mobile-tools-ready .appnav { display: none; }
    body.mobile-tools-ready .mobile-tools { order: 3; flex: 1 0 100%; display: flex; align-items: center;
      justify-content: space-between; gap: 12px; min-width: 0; min-height: 49px;
      border-top: 1px solid var(--border); }
    .mobile-current { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      color: var(--accent); font-size: 13px; font-weight: 700; }
    .mobile-tools-menu { flex: none; }
    .mobile-tools-menu > summary { padding: 9px 12px; border-radius: 8px; background: var(--surface-2);
      color: var(--ink); font-size: 13px; font-weight: 600; }
    .mobile-tools-menu[open] > summary { background: var(--accent-soft); color: var(--accent); }
    .mobile-tools-menu > .mobile-tools-panel { right: 0; left: auto; width: min(288px, calc(100vw - 48px));
      max-height: 65vh; overflow-y: auto; }
    .mobile-tools-panel > a, .mobile-tools-panel > .nav-more > summary { padding: 11px 10px; }
    .mobile-tools-panel [aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
    .mobile-tools-panel .nav-more-panel { position: static; box-shadow: none; border: 0;
      border-inline-start: 1px solid var(--border); border-radius: 0; margin-inline-start: 10px; }
    .brand-switcher select { max-width: 170px; }
  }
  @media (max-width: 400px) {
    .acct .role-badge { display: none; }
    .acct { gap: 8px; }
  }
  .bell { position: relative; display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px; color: var(--ink-faint); }
  .bell:hover { background: var(--surface-2); color: var(--ink); }
  .bell-n { position: absolute; top: -3px; right: -5px; min-width: 16px; padding: 0 4px; border-radius: 999px; background: var(--critical); color: var(--accent-ink); font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; }
  /* The bell opens the alerts popover (v3 handoff 01 #6): latest alerts grouped by tool. */
  .bell-menu > summary.bell { list-style: none; cursor: pointer; }
  .bell-menu > summary::-webkit-details-marker { display: none; }
  .bell-menu[open] > summary.bell { background: var(--surface-2); color: var(--ink); }
  .acct-menu-panel.bell-panel { width: min(440px, calc(100vw - 32px)); padding: 0; gap: 0; }
  .bell-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--border); font-size: 16px; }
  .bell-head .muted { font-size: 12px; color: var(--ink-faint); }
  .bell-head .link-btn { font-size: 13px; font-weight: 500; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
  .bell-tool { padding: 12px 16px 2px; }
  .bell-item { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; padding: 8px 16px; font-size: 13px; line-height: 18px; }
  .bell-item > div { display: grid; gap: 2px; min-width: 0; }
  .bell-item b { font-weight: 500; color: var(--ink); }
  .bell-item span { font-size: 12px; line-height: 16px; color: var(--ink-faint); }
  .bell-item a { font-weight: 500; font-size: 13px; }
  .bell-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 99px; background: var(--ink-faint); }
  .bell-dot.sev-immediate { background: var(--critical); }
  .bell-dot.sev-daily, .bell-dot.sev-weekly { background: var(--warn); }
  .bell-empty { padding: 16px; font-size: 13px; color: var(--ink-faint); }
  .bell-all { display: block; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--ink-faint); }
  /* Light / Dark toggle (v3 handoff 01 #3). */
  .theme-toggle { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--surface-2); flex: none; }
  .theme-toggle button { border: 0; width: 30px; height: 26px; border-radius: 6px; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--ink-faint); }
  .theme-toggle button svg { width: 15px; height: 15px; }
  .theme-toggle button:hover { color: var(--ink); }
  .theme-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(10,13,20,.08); }
  @media (max-width: 600px) { .theme-toggle { display: none; } }
  .avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--surface-2); color: var(--ink-muted); display: grid; place-items: center; font: 500 12px/16px var(--sans); text-transform: uppercase; }
  /* The avatar opens the account menu: who's signed in, Billing, Request a demo, Log out. */
  .acct-menu { position: relative; }
  .acct-menu > summary { list-style: none; cursor: pointer; border-radius: 999px; }
  .acct-menu > summary::-webkit-details-marker { display: none; }
  .acct-menu > summary:hover .avatar, .acct-menu[open] > summary .avatar { background: var(--surface-3); color: var(--ink); }
  .acct-menu-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 220px; padding: 6px;
    display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
  .acct-menu-panel .who { padding: 8px 10px 6px; font-size: 12px; line-height: 16px; color: var(--ink-faint); overflow-wrap: anywhere; }
  .acct-menu-panel form { margin: 0; }
  .acct-menu-panel a, .acct-menu-panel .link-btn { display: block; width: 100%; padding: 8px 10px; border-radius: 6px; text-align: left;
    color: var(--ink); text-decoration: none; font-size: 14px; min-height: 0; }
  .acct-menu-panel a:hover, .acct-menu-panel .link-btn:hover { background: var(--surface-2); }
  /* "Ask AI" in the header opens the quick chat (base-tail.js); the floating launcher then stays out of the way. */
  .ask-ai-btn { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--ink); font: 500 13px/16px var(--sans); cursor: pointer; white-space: nowrap; }
  .ask-ai-btn:hover { background: var(--surface-2); }
  .ask-ai-btn[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--link); }
  @media (min-width: 601px) { body.has-ask-ai-btn .quick-chat-launcher { display: none; } }
  @media (max-width: 600px) { .ask-ai-btn { display: none; } }  /* phones keep the round launcher */
  /* The Connect accounts popup's button (app/amazon_connect_ui.py), a brand's own users only. */
  .connect-accounts-btn { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--ink); font: 500 13px/16px var(--sans); text-decoration: none; white-space: nowrap; }
  .connect-accounts-btn:hover { background: var(--surface-2); }
  .connect-accounts-btn svg { margin-right: 6px; flex: none; }
  /* Icon only where the label would push the nav onto two lines; it keeps its name (aria via the label's text). */
  @media (max-width: 1400px) {
    .connect-accounts-btn { padding: 0 7px; }
    .connect-accounts-btn svg { margin-right: 0; }
    .connect-accounts-btn .cab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  }

  .live {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 11.5px;
    color: var(--ink-muted);
    margin-bottom: 20px;
  }
  .live .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--good);
    box-shadow: 0 0 0 3px var(--good-soft);
    animation: pulse 2.2s ease-in-out infinite;
  }
  @media (prefers-reduced-motion: reduce) { .live .dot { animation: none; } }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

  [hidden] { display: none !important; }
  .auth-h { font-size: 22px; line-height: 1.2; letter-spacing: -.015em; margin: 16px 0 16px; }
  .page-tag { font-size: 12.5px; color: var(--ink-muted); margin: 0 0 20px; }
  .acct .role-badge {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
  }
  .acct .role-badge.viewing { background: var(--warn-soft); color: var(--warn); }
  .brand-switcher { display: inline-flex; }
  .brand-switcher select {
    font: inherit; font-size: 13px; line-height: 18px; font-weight: 400; color: var(--ink);
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: 8px; height: 32px; padding: 0 8px 0 10px; cursor: pointer;
  }
  .brand-switcher select:hover { border-color: var(--accent); }
  /* The geo picker (app/geo.py) sits next to the brand: a globe, then the code. */
  .geo-switcher { position: relative; align-items: center; }
  .geo-switcher .geo-icon { position: absolute; left: 9px; color: var(--ink-muted); pointer-events: none; }
  .geo-switcher select { padding-left: 27px; max-width: 170px; text-overflow: ellipsis; }
  .geo-chip { font-size: 12px; font-weight: 600; color: var(--ink-muted); border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px; }
  @media (max-width: 560px) {
    /* The brand keeps the room; the geo shows its code. */
    .appbar-in:has(.brand-switcher) .geo-switcher { flex: 0 0 auto; }
    .appbar-in:has(.brand-switcher) .geo-switcher select { width: 92px; }
  }
  .viewing-as-banner { justify-content: space-between; }
  .viewing-as-banner form { flex: none; }
  .link-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--ink-muted);
    text-decoration: underline;
    cursor: pointer;
  }
  .link-btn:hover { color: var(--ink); }
  nav.crumbs { font-size: 12.5px; color: var(--ink-muted); margin-bottom: 20px; }
  nav.crumbs a { color: var(--ink-muted); }

  .nav-more { position: relative; }
  .nav-more summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; gap: 4px;
  }
  .nav-more summary::-webkit-details-marker { display: none; }
  .nav-more summary::after { content: "\25BE"; font-size: 10px; }
  .nav-more-panel {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 40;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column;
    min-width: 180px;
  }
  .nav-more-panel a { padding: 7px 10px; border-radius: 6px; white-space: nowrap; color: var(--ink-muted); text-decoration: none; font-weight: 500; }
  .nav-more-panel a:hover { background: var(--accent-soft); color: var(--accent); }
  .nav-more-panel form { margin: 0; }
  .nav-more-panel .link-btn { display: block; width: 100%; padding: 7px 10px; border-radius: 6px; text-align: left;
    white-space: nowrap; color: var(--ink-muted); font-weight: 500; text-decoration: none; }
  .nav-more-panel .link-btn:hover { background: var(--accent-soft); color: var(--accent); }

  /* ---- stat strip ---- */
  .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 36px; }
  .stat { background: var(--surface); border: 0; border-radius: 12px; padding: 16px 20px; box-shadow: var(--card-shadow); }
  .stat .v { font: 600 24px/32px var(--sans); font-variant-numeric: tabular-nums; }
  .stat .v.critical { color: var(--critical); }
  .stat .v.good { color: var(--good); }
  .stat .l { margin-top: 4px; font: 500 13px/18px var(--sans); color: var(--ink-muted); }

  /* ---- section / panel ---- */
  section { margin-bottom: 36px; }
  .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
  .section-head h2 { margin: 0; font: 600 20px/28px var(--sans); }
  .section-head .count { font-size: 12px; color: var(--ink-faint); }

  .panel { background: var(--surface); border: 0; border-radius: 12px; box-shadow: var(--card-shadow); overflow: hidden; }
  .panel .empty { padding: 22px 18px; color: var(--ink-faint); font-size: 13px; }
  .panel .pad { padding: 20px 22px; }

  table { width: 100%; border-collapse: collapse; }
  table { font-variant-numeric: tabular-nums; }
  th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 18px; vertical-align: middle; }
  tr:last-child td { border-bottom: none; }
  th {
    font: 500 12px/16px var(--sans);
    padding-block: 8px;
    letter-spacing: 0;
    text-transform: none;   /* v3 UI kit: table heads are muted, sentence case */
    color: var(--ink-faint);
    background: transparent;
    white-space: nowrap;
  }
  tr.flagged td { background: var(--critical-soft); }
  tr.link-row { cursor: pointer; }
  tr.link-row:hover td { background: color-mix(in srgb, var(--surface) 94%, var(--ink) 6%); }

  .asin { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 13px; }

  .chip {
    display: inline-flex; align-items: center; gap: 4px; min-height: 20px; padding: 0 8px;
    border-radius: 999px; font: 500 12px/16px var(--sans); white-space: nowrap;
  }
  .chip.country { background: var(--accent-soft); color: var(--accent); font-family: "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .03em; }
  .chip.in-stock { background: var(--good-soft); color: var(--good); }
  .chip.out-stock { background: var(--critical-soft); color: var(--critical); }
  .chip.alert { background: var(--critical-soft); color: var(--critical); font-family: "IBM Plex Mono", ui-monospace, monospace; }
  .chip.role { background: var(--accent-soft); color: var(--accent); }
  .chip.status-new { background: var(--accent-soft); color: var(--accent); }
  .chip.status-reviewing { background: var(--warn-soft); color: var(--warn); }
  .chip.status-done { background: var(--good-soft); color: var(--good); }
  .chip.status-declined { background: var(--critical-soft); color: var(--critical); }

  .delta { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 500; }
  .delta.up { color: var(--good); }
  .delta.down { color: var(--critical); }
  .delta.flat { color: var(--ink-faint); }

  /* Callouts: a tinted block, no border (the redesign's .callout). */
  .banner {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 12px;
    border-radius: 12px; background: var(--critical-soft); color: var(--ink); font-size: 13px; line-height: 18px;
    border: 0;
  }
  .banner strong { color: var(--critical); }
  .banner.info { background: var(--accent-soft); color: var(--ink-muted); }
  .banner.info strong { color: var(--ink); }
  .banner strong { font-weight: 600; }

  .chip.key-asin { background: var(--key-soft); color: var(--key); font-weight: 500; }

  .map-panel { padding: 14px 14px 6px; }
  #zip-map { width: 100%; height: auto; display: block; }
  #zip-map .state { fill: color-mix(in srgb, var(--surface) 88%, var(--ink) 12%); stroke: var(--border); stroke-width: 1; }
  #zip-map .zip-dot { stroke: var(--surface); stroke-width: 1.3; cursor: pointer; }
  .legend { display: flex; flex-wrap: wrap; gap: 18px; padding: 10px 4px 16px; font-size: 12px; color: var(--ink-muted); }
  .legend-item { display: flex; align-items: center; gap: 6px; }
  .legend .swatch { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
  .legend .swatch.good { background: var(--good); }
  .legend .swatch.critical { background: var(--critical); }
  .legend .swatch.warn { background: var(--warn); }
  .map-tooltip {
    position: fixed; z-index: 60; background: var(--ink); color: var(--bg); padding: 7px 11px;
    border-radius: 7px; font-size: 12px; line-height: 1.45; pointer-events: none; box-shadow: var(--shadow); max-width: 230px;
  }
  .map-tooltip strong { font-family: "IBM Plex Mono", ui-monospace, monospace; }

  .thread { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
  .msg { max-width: 78%; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; line-height: 1.5; }
  .msg.question { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 3px; }
  .msg.answer { align-self: flex-start; background: color-mix(in srgb, var(--surface) 92%, var(--ink) 8%); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
  .msg .meta { display: block; margin-top: 6px; font-size: 10.5px; opacity: .75; font-family: "IBM Plex Mono", ui-monospace, monospace; }
  .msg.question .who { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; opacity: .8; display: block; margin-bottom: 3px; }
  .status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-family: "IBM Plex Mono", ui-monospace, monospace; padding: 3px 10px; border-radius: 999px; align-self: flex-start; }
  .status-pill.pending { background: var(--warn-soft); color: var(--warn); }
  .status-pill.answered { background: var(--good-soft); color: var(--good); }
  .status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .ask-form { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
  .ask-form textarea { flex: 1; resize: vertical; min-height: 44px; }
  textarea.input { background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px 14px; font: 400 14px/20px var(--sans); }
  .answer-form { display: flex; gap: 10px; padding: 12px 20px 20px; }
  .answer-form textarea { flex: 1; resize: vertical; min-height: 40px; }
  .thread-block + .thread-block { border-top: 1px solid var(--border); }

  .bars { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
  .bar-row { display: grid; grid-template-columns: 140px 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
  .bar-row .label { color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bar-row .track { background: color-mix(in srgb, var(--surface) 90%, var(--ink) 10%); border-radius: 5px; height: 10px; overflow: hidden; }
  .bar-row .fill { height: 100%; background: var(--accent); border-radius: 5px; }
  .bar-row .value { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; text-align: right; min-width: 64px; }

  .placeholder-page { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 64px 24px; text-align: center; color: var(--ink-muted); }
  .placeholder-page .icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; color: var(--accent); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 18px; }
  .placeholder-page h3 { margin: 4px 0 0; color: var(--ink); font-size: 15px; }
  .placeholder-page p { margin: 0; font-size: 13px; max-width: 420px; }

  select.zip-select, select.input, input.input {
    background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong);
    border-radius: 8px; min-height: 36px; padding: 7px 12px; font: 400 13px/18px var(--sans);
  }
  input.input, select.input { width: 100%; }
  label.field { display: block; font-size: 12.5px; color: var(--ink-muted); margin-bottom: 6px; }
  .field-group { margin-bottom: 16px; }

  button.btn, a.btn, summary.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 8px;
    min-height: 36px; padding: 0 16px; font: 500 14px/20px var(--sans); cursor: pointer; white-space: nowrap;
    background: var(--accent); color: var(--accent-ink); text-decoration: none;
    transition-property: background-color, border-color, scale; transition-duration: 150ms; transition-timing-function: ease-out;
  }
  button.btn.secondary, a.btn.secondary, summary.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); }
  button.btn.danger { background: var(--critical); color: var(--accent-ink); }
  :is(button.btn, a.btn, summary.btn).sm { min-height: 28px; padding: 0 12px; font-size: 13px; line-height: 16px; }
  :is(button.btn, a.btn, summary.btn).ghost { background: none; color: var(--link); padding: 0 4px; }
  /* Navy barely brightens, so the hover is the kit's accent/hover token. */
  :is(button.btn, a.btn, summary.btn):hover:not(:disabled) { background-color: var(--accent-hover); }
  :is(button.btn, a.btn, summary.btn).secondary:hover:not(:disabled) { filter: none; background-color: var(--surface-2); }
  :is(button.btn, a.btn, summary.btn).ghost:hover:not(:disabled) { filter: none; text-decoration: underline; }
  button.btn.danger:hover:not(:disabled) { background-color: color-mix(in srgb, var(--critical) 88%, var(--ink) 12%); }
  :is(button.btn, a.btn, summary.btn):active:not(:disabled) { scale: .96; }
  @media (prefers-reduced-motion: reduce) {
    :is(button.btn, a.btn, summary.btn) { transition: none; }
    :is(button.btn, a.btn, summary.btn):active { scale: 1; }
  }
  .thumb:not(img) svg { display: block; width: 18px; height: 18px; }
  .error-text { color: var(--critical); font-size: 12.5px; margin: -6px 0 14px; }

  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
  }

  /* Every <select> opens with the kit's chevron-down (Icon/chevron-down,
     icon/default slate) instead of the browser's own arrow, which differed
     by OS and from page to page (Yura, Nov 16: "the arrow buttons in the
     selectors, fix them everywhere"). !important so a page's own
     `background:` shorthand or `padding:` doesn't paint over it; a page
     keeps its height, border and font. Multi-row lists keep the browser's. */
  select:not([multiple]):not([size]) {
    appearance: none !important; -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6b8c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important; background-position: right 8px center !important; background-size: 16px 16px !important;
    padding-right: 28px !important;
  }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) select:not([multiple]):not([size]) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238191b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important; } }
  :root[data-theme="dark"] select:not([multiple]):not([size]) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238191b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important; }
  select:not([multiple]):not([size]):disabled { opacity: .6; cursor: not-allowed; }

  footer.note { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; line-height: 16px; color: var(--ink-faint); }

  /* ---- The redesign's shared parts (docs/wireframes/redesign-2026-10.html),
     for any page that wants them: a page head on the background (overline,
     h1, one-line description, freshness dot), sections on space and
     hairlines, status badges, and cards only for things to act on. ---- */
  .page-head { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; justify-content: space-between; margin: 8px 0 32px; }
  .page-head > .t { display: grid; gap: 6px; min-width: 0; flex: 1 1 420px; }
  .page-head > .r { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .page-head h1 { margin: 0; }
  .page-head .sub { margin: 0; color: var(--ink-muted); max-width: 72ch; }
  .fresh { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--ink-faint); }
  .fresh::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
  .badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font: 500 12px/16px var(--sans); white-space: nowrap; }
  .b-crit { background: var(--critical-soft); color: var(--critical); }
  .b-warn { background: var(--warn-soft); color: var(--warn); }
  .b-ok { background: var(--good-soft); color: var(--good); }
  .b-key { background: var(--key-soft); color: var(--key); }
  .b-neu { background: var(--neutral-soft); color: var(--ink-muted); }
  .b-info { background: var(--accent-soft); color: var(--link); }
  .callout { border-radius: 12px; padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
  .callout > .t { flex: 1 1 420px; min-width: 0; display: grid; gap: 4px; }
  .callout.c-crit { background: var(--critical-soft); } .callout.c-warn { background: var(--warn-soft); } .callout.c-info { background: var(--accent-soft); }
  .callout .overline.crit, .callout .crit { color: var(--critical); }
  .card-x { background: var(--surface); border-radius: 12px; padding: 20px; display: grid; gap: 14px; align-content: start; min-width: 0; }
  .progress-track { width: 200px; max-width: 100%; height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
  .progress-track > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .2s; }
  @media (prefers-reduced-motion: reduce) { .progress-track > span { transition: none; } }

  @media (max-width: 560px) {
    th, td { padding: 9px 10px; font-size: 12.5px; }
    .stat .v { font-size: 22px; }
  }
