/* apps/ui/src/styles/legal.css (tests look for this path in the built CSS) */
/* Privacy and terms pages. Its own Vite entry, shared sheets bundled in. */
/* apps/ui/src/styles/chrome.css (tests look for this path in the built CSS) */
/* Global tokens, header and tab bar for every SPA page (print sheet too).
   Loaded on first paint and never unloaded, so nothing here may target a
   single page. */
  /* Self-hosted IBM Plex Sans Arabic, Arabic and Latin subsets per weight.
     The unicode-range values are verbatim from Google; don't trim them. */
  @font-face{font-family:'IBM Plex Sans Arabic';src:url('/fonts/plexarabic-arabic-400.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap;unicode-range:U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1}
  @font-face{font-family:'IBM Plex Sans Arabic';src:url('/fonts/plexarabic-latin-400.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap;unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
  @font-face{font-family:'IBM Plex Sans Arabic';src:url('/fonts/plexarabic-arabic-500.woff2') format('woff2');font-weight:500;font-style:normal;font-display:swap;unicode-range:U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1}
  @font-face{font-family:'IBM Plex Sans Arabic';src:url('/fonts/plexarabic-latin-500.woff2') format('woff2');font-weight:500;font-style:normal;font-display:swap;unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
  @font-face{font-family:'IBM Plex Sans Arabic';src:url('/fonts/plexarabic-arabic-600.woff2') format('woff2');font-weight:600;font-style:normal;font-display:swap;unicode-range:U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1}
  @font-face{font-family:'IBM Plex Sans Arabic';src:url('/fonts/plexarabic-latin-600.woff2') format('woff2');font-weight:600;font-style:normal;font-display:swap;unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
  @font-face{font-family:'IBM Plex Sans Arabic';src:url('/fonts/plexarabic-arabic-700.woff2') format('woff2');font-weight:700;font-style:normal;font-display:swap;unicode-range:U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1}
  @font-face{font-family:'IBM Plex Sans Arabic';src:url('/fonts/plexarabic-latin-700.woff2') format('woff2');font-weight:700;font-style:normal;font-display:swap;unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
  /* -------------------------------------------------------------------
     Light is the default. Rules only use tokens, so switching theme is one
     attribute on <html>. Brand orange as text is only 2.45:1 on white, hence
     the separate --accent-light.
     ------------------------------------------------------------------- */
  :root {
    --canvas: #F7F8FA;
    --paper: #FFFFFF;
    --sunk: #F1F3F6;
    --raise: #E8ECF2;
    --accent: #F28C38;
    --accent-hover: #E67E22;
    /* Orange for text, 5.02:1 on white. */
    --accent-light: #B45309;
    /* Button labels on the orange fill. 7.58:1. */
    --on-accent: #1A1206;
    --ink: #131C2B;
    --ink-2: #41506A;
    --ink-3: #5E6C82;
    --line: rgba(19,28,43,.13);
    --hover-wash: rgba(19,28,43,.04);
    --green: #15803D;
    --red: #B91C1C;
    --amber: #B45309;
    --shadow-1: 0 1px 2px rgba(19,28,43,.06);
    --shadow-2: 0 8px 20px rgba(19,28,43,.10);
    --shadow-3: 0 18px 40px rgba(19,28,43,.14);
    --radius: 14px;
    --radius-lg: 18px;

    /* Short durations, ease-out only. Past ~250ms motion feels like waiting. */
    --dur-1: 120ms;   /* a state change on something already under the cursor */
    --dur-2: 180ms;   /* the default */
    --dur-3: 280ms;   /* something entering or leaving the page */
    --ease: cubic-bezier(.22, .61, .36, 1);
  }
  /* Reduced motion means none. Kept first so nothing below can win on
     specificity. */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: .001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: .001ms !important;
      scroll-behavior: auto !important;
    }
  }

  @keyframes lnx-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
  }
  @keyframes lnx-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  /* Staggered page entrance in reading order, capped at six. */
  main > * { animation: lnx-rise var(--dur-3) var(--ease) backwards; }
  main > *:nth-child(1) { animation-delay: 0ms; }
  main > *:nth-child(2) { animation-delay: 40ms; }
  main > *:nth-child(3) { animation-delay: 80ms; }
  main > *:nth-child(4) { animation-delay: 120ms; }
  main > *:nth-child(5) { animation-delay: 160ms; }
  main > *:nth-child(n+6) { animation-delay: 200ms; }

  /* Grid tiles enter in sequence, capped at eight. */
  .cards-grid > *, .kpis > * { animation: lnx-rise var(--dur-3) var(--ease) backwards; }
  .cards-grid > *:nth-child(1), .kpis > *:nth-child(1) { animation-delay: 30ms; }
  .cards-grid > *:nth-child(2), .kpis > *:nth-child(2) { animation-delay: 60ms; }
  .cards-grid > *:nth-child(3), .kpis > *:nth-child(3) { animation-delay: 90ms; }
  .cards-grid > *:nth-child(4), .kpis > *:nth-child(4) { animation-delay: 120ms; }
  .cards-grid > *:nth-child(5) { animation-delay: 150ms; }
  .cards-grid > *:nth-child(6) { animation-delay: 180ms; }
  .cards-grid > *:nth-child(7) { animation-delay: 210ms; }
  .cards-grid > *:nth-child(n+8) { animation-delay: 240ms; }

  /* The preview slides in from its own side. There's no logical translate,
     so RTL is written out. */
  @keyframes lnx-slide-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
  @keyframes lnx-slide-in-rtl { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
  .sim-rail { animation: lnx-slide-in var(--dur-3) var(--ease) backwards; animation-delay: 120ms; }
  html[dir="rtl"] .sim-rail { animation-name: lnx-slide-in-rtl; }

  /* Keep it quick: the merchant is dragging a colour picker. */
  .sim-card { transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
  .sim-card:hover { box-shadow: var(--shadow-3); }
  .sim-strip { transition: opacity var(--dur-1) var(--ease); }

  .tabbar .tab { transition: color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease); }
  .tabbar .tabicon { transition: transform var(--dur-2) var(--ease); }
  .tabbar .tab.active .tabicon { transform: translateY(-1px) scale(1.06); }
  .tab-more[open] .more-sheet { animation: lnx-rise var(--dur-2) var(--ease) backwards; }

  header.top nav.nav a { transition: color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease); }

  /* One pulse on a success banner. */
  @keyframes lnx-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(242,140,56,.45); }
    100% { box-shadow: 0 0 0 12px rgba(242,140,56,0); }
  }
  .ok-banner { animation: lnx-rise var(--dur-3) var(--ease) backwards, lnx-pulse 900ms var(--ease) 1; }

  /* Table rows and list items settle in on load, in reading order. */
  table.data tbody tr { animation: lnx-fade var(--dur-2) var(--ease) backwards; }
  table.data tbody tr:nth-child(1) { animation-delay: 20ms; }
  table.data tbody tr:nth-child(2) { animation-delay: 40ms; }
  table.data tbody tr:nth-child(3) { animation-delay: 60ms; }
  table.data tbody tr:nth-child(4) { animation-delay: 80ms; }
  table.data tbody tr:nth-child(n+5) { animation-delay: 100ms; }
  /* Only the first rows: past a screenful nobody sees it, and every animating
     row is a GPU layer. 275 at once, as tall phone cards, crashed iPhone
     Safari on /admin/merchants. */
  table.data tbody tr:nth-child(n+13) { animation: none; }

  a:not(.btn):not(.card-tile):not(.tpl-tile) { transition: color var(--dur-1) var(--ease); }

  /* :focus-visible so mouse clicks don't draw a ring. */
  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
  }

  /* Dark: same token names, different values. */
  html[data-theme="dark"] {
    --canvas: #0F172A;
    --paper: #1C2A42;
    --sunk: #162338;
    --raise: #22314C;
    --accent-light: #F7B267;
    --on-accent: #0F172A;
    --ink: #FFFFFF;
    --ink-2: #CBD5E1;
    --ink-3: #94A3B8;
    --line: rgba(255,255,255,.10);
    --hover-wash: rgba(255,255,255,.045);
    --green: #22C55E;
    /* #EF4444 was 3.82:1 on --paper and failed AA; this is 5.20:1. */
    --red: #F87171;
    --amber: #F7B267;
    --shadow-1: 0 1px 2px rgba(0,0,0,.28);
    --shadow-2: 0 10px 24px rgba(0,0,0,.34);
    --shadow-3: 0 20px 48px rgba(0,0,0,.44);
  }

  /* Tracking breaks Arabic letter joins. Keyed on any element's lang since
     Arabic/Sorani cards show up inside English dashboards. */
  :is([lang="ar"], [lang="ckb"]), :is([lang="ar"], [lang="ckb"]) * { letter-spacing: 0 !important; }
  /* Arabic needs more line-height than Latin. */
  html:is([lang="ar"], [lang="ckb"]) body { line-height: 1.75; }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* Don't let the browser fake weights or italics the font doesn't ship
       (see views/fonts.ts). A faked 600 resolves to bold and clashes with 700. */
    font-synthesis-weight: none;
    font-synthesis-style: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  /* Form controls do not inherit the family by default. */
  button, input, select, textarea { font-family: inherit; }
  /* Tabular figures so numeric columns line up. */
  table.data td, table.data th, .kpi .n, .num, code.pill { font-variant-numeric: tabular-nums; }
  header.top {
    background: var(--sunk);
    border-bottom: 1px solid var(--line);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 28px;
  }
  /* Not scoped to header.top: the lockup also appears in other headers
     (e.g. .auth-top) that share no ancestor. */
  a.brand { display: inline-flex; align-items: center; gap: 9px; }
  header.top a.brand { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: 0.2px; }
  /* Brand minimum is 24px; below that the mark stops resolving. */
  .brand-mark { width: 24.9px; height: 26px; flex: none; display: block; }
  /* Clear space is one stamp dot; the viewBox already carries most of it. */
  .brand-word { white-space: nowrap; }
  /* --accent-light, not --accent: raw orange text fails AA here. */
  .brand-word > span { color: var(--accent-light); }
  header.top nav.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-inline-start: auto; }
  header.top nav.nav a {
    color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px;
    padding: 8px 14px; border-radius: 100px;
  }
  header.top nav.nav a:hover { color: var(--ink); background: var(--raise); }
  header.top nav.nav a.active { color: var(--on-accent); background: var(--accent); }

  header.top nav.nav a.lang-toggle {
    border: 1px solid var(--line);
    margin-inline-start: 8px;
    color: var(--ink-3);
  }
  header.top nav.nav a.lang-toggle:hover { color: var(--ink); border-color: var(--accent); }

  /* Screen-reader only, e.g. a header for an action-only column. */
  .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  /* Quiet until hovered; it sits among data, not as a call to action. */
  .row-action {
    color: var(--ink-3); text-decoration: none; font-size: 13px; font-weight: 600;
    white-space: nowrap;
  }
  .row-action:hover, .row-action:focus-visible { color: var(--red); text-decoration: underline; }
  /* Skip link, off-screen until focused. */
  .skip {
    position: absolute; inset-inline-start: -9999px; top: 12px; z-index: 999;
    padding: 10px 18px; border-radius: var(--radius);
    background: var(--accent); color: var(--on-accent); font-weight: 700;
    text-decoration: none;
  }
  .skip:focus { inset-inline-start: 12px; }

  /* -------------------------------------------------------------------
     Mobile bottom tab bar, under 720px only. The top nav links hide at the
     same breakpoint, so only one nav is ever visible.
     ------------------------------------------------------------------- */
  .tabbar { display: none; }

  @media (max-width: 720px) {
    /* Top bar becomes a slim title bar. Sign out moves into More so a
       destructive action isn't under the thumb. */
    header.top { padding: 12px 16px; gap: 12px; }
    header.top nav.nav,
    header.top form { display: none; }

    .tabbar {
      display: flex;
      position: fixed;
      inset-inline: 0;
      bottom: 0;
      z-index: 50;
      background: color-mix(in srgb, var(--sunk) 92%, transparent);
      backdrop-filter: saturate(160%) blur(12px);
      -webkit-backdrop-filter: saturate(160%) blur(12px);
      border-top: 1px solid var(--line);
      /* iPhone home-indicator inset. */
      padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .tabbar .tab {
      flex: 1 1 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 5px;
      padding: 12px 2px 10px;
      color: var(--ink-3);
      text-decoration: none;
      font-size: 12px;
      font-weight: 600;
      line-height: 1.15;
      text-align: center;
      /* Well above the 48px minimum: this is the whole nav on a phone, used
         one-handed. */
      min-height: 60px;
      background: none;
      border: 0;
      cursor: pointer;
      /* Kills the grey flash iOS paints over a tapped link. */
      -webkit-tap-highlight-color: transparent;
    }
    .tabbar .tab span {
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .tabbar .tabicon { width: 27px; height: 27px; flex: none; }
    /* --accent-light, not --accent: raw orange is 2.4:1 on --sunk. */
    .tabbar .tab.active { color: var(--accent-light); }
    /* Pressed state only; :hover sticks after a tap on touch screens. */
    .tabbar .tab:active { background: var(--raise); }

    /* <details>, so More works without JS. It doesn't close on Escape or an
       outside tap by itself; TAB_SHEET_SCRIPT adds that. */
    .tab-more { flex: 1 1 0; display: flex; position: relative; }
    .tab-more > summary { list-style: none; width: 100%; }
    .tab-more > summary::-webkit-details-marker { display: none; }
    .more-sheet {
      position: absolute;
      bottom: calc(100% + 8px);
      inset-inline-end: 6px;
      min-width: 190px;
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 6px;
      box-shadow: var(--shadow-3);
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .more-sheet a,
    .more-sheet button {
      display: block;
      width: 100%;
      text-align: start;
      padding: 12px 14px;
      border-radius: 10px;
      color: var(--ink-2);
      text-decoration: none;
      font: inherit;
      font-size: 14px;
      font-weight: 600;
      background: none;
      border: 0;
      cursor: pointer;
    }
    .more-sheet a:active,
    .more-sheet button:active { background: var(--raise); color: var(--ink); }
    .more-sheet form { margin: 0; }

    /* Clears the fixed tab bar. Keep in step with .tabbar .tab's min-height
       (60px) or the last row hides under it. */
    main { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  }
  .btn {
    display: inline-block;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 100px;
    padding: 12px 22px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
  }
  .btn { transition: background-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease); box-shadow: var(--shadow-1); }
  .btn:hover { background: var(--accent-hover); box-shadow: var(--shadow-2); }
  /* 1px is enough; more reads as a bounce. */
  .btn:active { transform: translateY(1px); box-shadow: var(--shadow-1); }
  .btn.secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
  }
  .btn.secondary:hover { background: var(--raise); }
  .btn[disabled] { opacity: .5; cursor: default; }
  /* Trial-to-paid button. The periodic sheen is there so it gets noticed. */
  .plan-cta-row { margin: 18px 0 0; }
  .btn.plan-cta {
    position: relative; overflow: hidden;
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 26px; font-size: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    box-shadow: 0 6px 18px rgba(242,140,56,.32), var(--shadow-1);
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s var(--ease);
  }
  .btn.plan-cta::after {
    content: ''; position: absolute; top: 0; bottom: 0; width: 45%;
    inset-inline-start: -60%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
    animation: plan-cta-sheen 3.6s ease-in-out 1.2s infinite;
    pointer-events: none;
  }
  .btn.plan-cta:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
    box-shadow: 0 10px 26px rgba(242,140,56,.42), var(--shadow-2);
  }
  .btn.plan-cta:active { transform: translateY(0); box-shadow: 0 4px 12px rgba(242,140,56,.3); }
  .btn.plan-cta:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px rgba(242,140,56,.55); }
  .plan-cta-arrow { transition: transform .18s var(--ease); }
  .btn.plan-cta:hover .plan-cta-arrow { transform: translateX(4px); }
  /* The arrow points the way the language reads. */
  html[dir=rtl] .plan-cta-arrow { transform: scaleX(-1); }
  html[dir=rtl] .btn.plan-cta:hover .plan-cta-arrow { transform: scaleX(-1) translateX(4px); }
  @keyframes plan-cta-sheen {
    0% { inset-inline-start: -60%; }
    40%, 100% { inset-inline-start: 130%; }
  }
  @media (prefers-reduced-motion: reduce) {
    .btn.plan-cta::after { animation: none; display: none; }
    .btn.plan-cta, .plan-cta-arrow { transition: none; }
    .btn.plan-cta:hover { transform: none; }
    .btn.plan-cta:hover .plan-cta-arrow { transform: none; }
    html[dir=rtl] .btn.plan-cta:hover .plan-cta-arrow { transform: scaleX(-1); }
  }
  /* Free plan upgrade bar, aligned with main's 1000px column. Quiet below the
     nudge threshold, loud (orange wash, plan-cta) from it. */
  .upgrade-bar { background: var(--sunk); border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 13px; }
  .upgrade-bar-in {
    max-width: 1000px; margin: 0 auto; padding: 8px 20px;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px;
  }
  .upgrade-bar-text { margin: 0; line-height: 1.45; }
  .upgrade-bar-text b { color: var(--ink); }
  .upgrade-bar .btn.small { flex: none; }
  .upgrade-bar-nudge { background: rgba(242,140,56,.10); border-bottom-color: rgba(242,140,56,.30); color: var(--ink); font-size: 14px; }
  .upgrade-bar-nudge .upgrade-bar-in { padding-block: 12px; }
  .upgrade-bar-nudge .btn.plan-cta { padding: 10px 20px; font-size: 14px; flex: none; }
  .upgrade-bar-full { border-bottom: 2px solid var(--accent); }
  .upgrade-bar-full .upgrade-bar-text b { color: var(--accent-light); }
  /* An admin working on a merchant's cards (ActingBar.tsx). The upgrade bar's
     column, but an accent edge on both sides so it can't pass for part of the
     merchant's own frame. Never printed: the print sheet goes on a counter. */
  .acting-bar { background: rgba(242,140,56,.12); border-block: 2px solid var(--accent); color: var(--ink); font-size: 14px; }
  .acting-bar-in {
    max-width: 1000px; margin: 0 auto; padding: 10px 20px;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px;
  }
  .acting-bar-text { margin: 0; line-height: 1.45; }
  .acting-bar-actions { display: flex; align-items: center; gap: 14px; flex: none; }
  .acting-bar-actions a { color: var(--accent-light); font-size: 13px; }
  @media print { .acting-bar { display: none; } }
  /* apps/ui/src/styles/page.css (tests look for this path in the built CSS) */
/* Page-level rules (panels, forms, tables), loaded by the three frames.

   Everything is scoped to .page-frame because loaded sheets never unload:
   unscoped, these h1/p/.panel rules would restyle the print poster. Wrapped
   in :where() so the scope adds no specificity. */
  /* No box of its own unless a frame class (e.g. .auth-page) adds one. */
  :where(.page-frame) { display: contents; }
  :where(.page-frame) main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 20px 64px;
  }
  :where(.page-frame) .banner {
    background: rgba(242,140,56,.10);
    border: 1px solid rgba(242,140,56,.30);
    color: var(--accent-light);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
  }
  :where(.page-frame) .banner b { color: var(--ink); }
  :where(.page-frame) .panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-1);
  }
  :where(.page-frame) h1 { font-size: 24px; margin: 0 0 6px; color: var(--ink); }
  :where(.page-frame) h2 { font-size: 16px; margin: 0 0 14px; color: var(--ink); }
  :where(.page-frame) p { line-height: 1.5; }
  :where(.page-frame) .muted { color: var(--ink-3); }
  :where(.page-frame) .row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
  :where(.page-frame) .cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
  /* "Save 44%" inside the Annual chip. */
  :where(.page-frame) .chip-badge { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--sunk); margin-inline-start: 4px; }
  /* A destructive secondary action, e.g. Cancel subscription. */
  :where(.page-frame) .btn.secondary.danger { color: var(--red); }
  /* Billing's four plans, 2×2: four across is too narrow for a crossed-out
     price, and auto-fill would leave Enterprise alone on a row. */
  :where(.page-frame) .cards-grid.plan-grid { grid-template-columns: repeat(2, 1fr); }
  @media (max-width: 560px) { :where(.page-frame) .cards-grid.plan-grid { grid-template-columns: 1fr; } }
  :where(.page-frame) .card-tile {
    display: block;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
  }
  /* Lift only on things that actually go somewhere. */
  :where(.page-frame) .card-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: rgba(242,140,56,.45); }
  :where(.page-frame) .card-tile:active { transform: translateY(0); }
  :where(.page-frame) .card-tile img { display: block; width: 100%; height: auto; background: var(--sunk); }
  :where(.page-frame) .card-tile .meta { padding: 14px 16px; border-top: 1px solid var(--line); }
  :where(.page-frame) .card-tile .meta h3 { margin: 0 0 4px; font-size: 15px; color: var(--ink); }
  :where(.page-frame) .card-tile .meta p { margin: 0; font-size: 13px; color: var(--ink-3); }
  :where(.page-frame) .empty {
    text-align: center;
    padding: 48px 24px;
  }
  :where(.page-frame) form .field { margin-bottom: 18px; }
  :where(.page-frame) label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink-2); }
  /* Every text-entry type. A missing one (email, password once) renders as a
     browser-default white box. */
  :where(.page-frame) input[type="text"],
  :where(.page-frame) input[type="number"],
  :where(.page-frame) input[type="tel"],
  :where(.page-frame) input[type="email"],
  :where(.page-frame) input[type="password"],
  :where(.page-frame) input[type="search"],
  :where(.page-frame) input[type="date"],
  :where(.page-frame) input[type="url"],
  :where(.page-frame) select,
  :where(.page-frame) textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    background: var(--sunk);
    color: var(--ink);
    font-family: inherit;
  }
  :where(.page-frame) select { appearance: auto; }

  /* Phone entry: country code, then number. The row is dir="ltr" since phone
     numbers read left-to-right in both languages. The select sizes to content
     because country names vary a lot in width. */
  :where(.page-frame) .tel-row { display: flex; gap: 8px; align-items: stretch; }
  :where(.page-frame) .tel-row > input { flex: 1 1 auto; min-width: 0; }
  :where(.page-frame) .tel-cc {
    width: auto;
    flex: 0 0 auto;
    /* Fits flag, dial code and a bit of the name. Truncating long names is
       fine; flag and code come first and always survive. */
    max-width: 9.5rem;
    /* Keep the text anchored to the same edge in either page language. */
    direction: ltr;
    text-align: left;
    padding-inline: 10px;
    font-variant-numeric: tabular-nums;
  }
  /* Too narrow for side by side; stack, select first. */
  @media (max-width: 380px) {
    :where(.page-frame) .tel-row { flex-wrap: wrap; }
    :where(.page-frame) .tel-cc { max-width: none; width: 100%; }
    :where(.page-frame) .tel-row > input { flex: 1 1 100%; }
  }
  :where(.page-frame) input[type="text"],
  :where(.page-frame) input[type="number"],
  :where(.page-frame) input[type="tel"],
  :where(.page-frame) input[type="email"],
  :where(.page-frame) input[type="password"],
  :where(.page-frame) input[type="search"],
  :where(.page-frame) input[type="date"],
  :where(.page-frame) select,
  :where(.page-frame) textarea {
    transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
  }
  :where(.page-frame) input[type="text"]:focus,
  :where(.page-frame) input[type="number"]:focus,
  :where(.page-frame) input[type="tel"]:focus,
  :where(.page-frame) input[type="email"]:focus,
  :where(.page-frame) input[type="password"]:focus,
  :where(.page-frame) input[type="search"]:focus,
  :where(.page-frame) input[type="date"]:focus,
  :where(.page-frame) select:focus,
  :where(.page-frame) textarea:focus {
    outline: none;
    border-color: var(--accent);
    /* A ring rather than a thicker border, so nothing reflows on focus. */
    box-shadow: 0 0 0 3px rgba(242,140,56,.18);
    background: var(--raise);
  }
  :where(.page-frame) input[disabled], :where(.page-frame) select[disabled], :where(.page-frame) textarea[disabled] { opacity: .55; cursor: not-allowed; }
  :where(.page-frame) input[type="range"] { width: 100%; }
  :where(.page-frame) input[type="color"] {
    width: 56px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 2px;
    background: var(--paper);
  }
  :where(.page-frame) .colors { display: flex; gap: 24px; flex-wrap: wrap; }
  :where(.page-frame) .colors .field { margin-bottom: 0; }
  :where(.page-frame) .preview-panel { text-align: center; background: var(--sunk); border: 1px dashed var(--line); border-radius: var(--radius-lg); padding: 20px; }
  /* height:auto matters: the <img> has width/height attributes for layout
     reservation, and without this a shrunk width leaves it stretched. */
  :where(.page-frame) .preview-panel img { max-width: 100%; height: auto; }
  :where(.page-frame) .error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); color: var(--red); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; }
  /* A caution, not an error, so amber rather than red. */
  :where(.page-frame) .warn { background: rgba(247,178,103,.10); border: 1px solid rgba(247,178,103,.32); color: var(--amber); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; line-height: 1.5; }
  :where(.page-frame) .error, :where(.page-frame) .warn, :where(.page-frame) .ok-banner { animation: lnx-rise var(--dur-3) var(--ease) backwards; }
  /* --accent-light passes AA in both themes. */
  :where(.page-frame) .ok-banner { background: rgba(242,140,56,.10); border: 1px solid rgba(242,140,56,.32); color: var(--accent-light); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; }

  /* -------------------------------------------------------------------
     Live card preview. It's the grid's second column, so dir flips it to
     the left in Arabic with no extra rules.
     ------------------------------------------------------------------- */
  :where(.page-frame) .with-sim { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 26px; align-items: start; }
  :where(.page-frame) .sim-rail { position: sticky; top: 20px; }
  :where(.page-frame) .sim-head { font-size: 13px; font-weight: 600; color: var(--ink-3); margin: 0 0 10px; }
  :where(.page-frame) .sim-card {
    border-radius: 18px;
    padding: 18px 18px 16px;
    border: 1px solid var(--line);
    /* A real shadow so it reads as a card, not a colour swatch. */
    box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255,255,255,.10);
    transition: background-color .25s ease, color .25s ease;
  }
  :where(.page-frame) .sim-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
  :where(.page-frame) .sim-brand { font-size: 13px; font-weight: 600; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  :where(.page-frame) .sim-chip { font-size: 10px; font-weight: 600; letter-spacing: .06em; opacity: .65; text-transform: uppercase; }
  html:is([lang="ar"], [lang="ckb"]) :where(.page-frame) .sim-chip { text-transform: none; letter-spacing: 0; }
  :where(.page-frame) .sim-reward { font-size: 21px; font-weight: 700; line-height: 1.25; margin: 0 0 14px; word-break: break-word; }
  :where(.page-frame) .sim-strip { display: block; width: 100%; height: auto; border-radius: 10px; }
  :where(.page-frame) .sim-foot { margin-top: 12px; font-size: 12px; opacity: .78; display: flex; justify-content: space-between; gap: 10px; }
  :where(.page-frame) .sim-hint { margin: 12px 2px 0; font-size: 12px; color: var(--ink-3); line-height: 1.5; }
  @media (max-width: 900px) {
    /* Too narrow for two columns. The form stays first so its fields and
       Create buttons are on the first screen; the preview follows. */
    :where(.page-frame) .with-sim { grid-template-columns: 1fr; }
    :where(.page-frame) .sim-rail { position: static; }
  }

  /* Show only the theme you're not in. Both toggles are server-rendered and
     CSS hides one, so no JS is needed. */
  :where(.page-frame) .theme-toggle { display: none; padding: 7px 11px; }
  :where(.page-frame) .theme-toggle svg { width: 15px; height: 15px; display: block; }
  html[data-theme="light"] :where(.page-frame) .theme-toggle[data-theme-link="dark"] { display: inline-flex; }
  html[data-theme="dark"] :where(.page-frame) .theme-toggle[data-theme-link="light"] { display: inline-flex; }
  :where(.page-frame) .more-sheet [data-theme-link] { display: none; }
  html[data-theme="light"] :where(.page-frame) .more-sheet [data-theme-link="dark"] { display: block; }
  html[data-theme="dark"] :where(.page-frame) .more-sheet [data-theme-link="light"] { display: block; }

  /* -------------------------------------------------------------------
     Autofill. Browsers paint their own background over filled fields and
     there's no property to turn it off. A huge inset box-shadow covers it,
     and the long transition delay outruns Chrome re-applying it on focus.
     ------------------------------------------------------------------- */
  :where(.page-frame) input:-webkit-autofill,
  :where(.page-frame) input:-webkit-autofill:hover,
  :where(.page-frame) input:-webkit-autofill:focus,
  :where(.page-frame) input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--sunk) inset !important;
    box-shadow: 0 0 0 1000px var(--sunk) inset !important;
    -webkit-text-fill-color: var(--ink) !important;
    caret-color: var(--ink);
    transition: background-color 100000s ease-in-out 0s;
  }
  :where(.page-frame) input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--raise) inset, 0 0 0 3px rgba(242,140,56,.18) !important;
    box-shadow: 0 0 0 1000px var(--raise) inset, 0 0 0 3px rgba(242,140,56,.18) !important;
  }

  /* -------------------------------------------------------------------
     Password field with the reveal button inside it.
     ------------------------------------------------------------------- */
  :where(.page-frame) .pw-field { position: relative; display: block; }
  :where(.page-frame) .pw-field input { width: 100%; padding-inline-end: 46px; }
  :where(.page-frame) .pw-reveal {
    position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    background: none; border: 0; border-radius: 8px; padding: 0;
    color: var(--ink-3); cursor: pointer;
    transition: color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
  }
  :where(.page-frame) .pw-reveal:hover { color: var(--ink); background: var(--hover-wash); }
  :where(.page-frame) .pw-reveal svg { width: 18px; height: 18px; display: block; }
  :where(.page-frame) .pw-reveal .pw-off { display: none; }
  :where(.page-frame) .pw-field.revealed .pw-reveal .pw-on { display: none; }
  :where(.page-frame) .pw-field.revealed .pw-reveal .pw-off { display: block; }

  /* Roomier fields on auth forms; they're often used on a phone. */
  :where(.page-frame) .auth-card input { padding: 13px 15px; font-size: 16px; }

  /* -------------------------------------------------------------------
     Wallet preview. Apple and Google lay a card out differently, so there
     are two layouts:

       Apple   logo, strip, fields, barcode at the bottom
       Google  logo, title, fields, barcode, hero image last

     Both use the real /preview.png and /qr.png.
     ------------------------------------------------------------------- */
  :where(.page-frame) .wp { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); padding: 16px; }
  :where(.page-frame) .wp-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
  :where(.page-frame) .wp-title { font-size: 13px; font-weight: 600; color: var(--ink-2); }
  :where(.page-frame) .wp-tabs { display: inline-flex; gap: 4px; }
  :where(.page-frame) .wp-tab {
    width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent; border-radius: 9px; background: none; cursor: pointer; padding: 0;
    color: var(--ink-3); transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
  }
  :where(.page-frame) .wp-tab svg { width: 18px; height: 18px; display: block; }
  :where(.page-frame) .wp-tab:hover { background: var(--hover-wash); }
  :where(.page-frame) .wp-tab.on { background: var(--sunk); border-color: var(--line); color: var(--ink); }

  /* Clipped so strip and hero images meet the edges like on a phone. */
  :where(.page-frame) .wp-card {
    border-radius: 14px; overflow: hidden; color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(32,33,36,.14);
    transition: background-color var(--dur-2) var(--ease);
  }
  :where(.page-frame) .wp-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
  :where(.page-frame) .wp-logo { max-height: 26px; max-width: 120px; width: auto; display: block; }
  :where(.page-frame) .wp-wordmark { font-size: 14px; font-weight: 700; letter-spacing: .01em; }
  /* Google puts the issuer on the opposite side to Apple. */
  :where(.page-frame) .wp-card.is-google .wp-head { justify-content: flex-end; border-bottom: 1px solid rgba(255,255,255,.14); }
  :where(.page-frame) .wp-card.is-google .wp-logo { max-height: 42px; }

  :where(.page-frame) .wp-strip { display: block; width: 100%; height: auto; }
  :where(.page-frame) .wp-title-lg { font-size: 22px; font-weight: 700; text-align: center; margin: 14px 12px 4px; line-height: 1.3; }

  :where(.page-frame) .wp-fields { display: flex; gap: 12px; padding: 12px 14px 6px; }
  :where(.page-frame) .wp-field { flex: 1 1 0; min-width: 0; }
  :where(.page-frame) .wp-field .k { font-size: 10px; font-weight: 600; opacity: .72; letter-spacing: .04em; text-transform: uppercase; }
  html[lang="ar"] :where(.page-frame) .wp-field .k, :where(.page-frame) .wp-card:is([lang="ar"], [lang="ckb"]) .wp-field .k { text-transform: none; letter-spacing: 0; }
  :where(.page-frame) .wp-field .v { font-size: 17px; font-weight: 600; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  :where(.page-frame) .wp-code { text-align: center; padding: 14px; }
  :where(.page-frame) .wp-code img { width: 132px; height: 132px; display: block; margin: 0 auto; background: #fff; padding: 8px; border-radius: 8px; image-rendering: pixelated; }
  :where(.page-frame) .wp-code .serial { margin-top: 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; }

  :where(.page-frame) .wp-status { display: flex; justify-content: center; margin-top: 12px; }
  :where(.page-frame) .wp-status span {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(21,128,61,.10); color: var(--green);
    border-radius: 100px; padding: 5px 12px; font-size: 12px; font-weight: 600;
  }
  :where(.page-frame) .wp-status span.draft { background: rgba(247,178,103,.14); color: var(--amber); }
  :where(.page-frame) .wp-status span::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

  /* Only one layout is in the document flow at a time. */
  :where(.page-frame) .wp-layout { display: none; }
  :where(.page-frame) .wp-layout.on { display: block; animation: lnx-fade var(--dur-2) var(--ease) backwards; }

  /* Value and copy button read as one object. */
  :where(.page-frame) .copyable { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  :where(.page-frame) .copy-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; flex: none;
    background: var(--sunk); border: 1px solid var(--line); border-radius: 8px;
    color: var(--ink-3); cursor: pointer; padding: 0;
    transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
  }
  :where(.page-frame) .copy-btn svg { width: 15px; height: 15px; }
  :where(.page-frame) .copy-btn:hover { color: var(--ink); border-color: var(--accent); }
  :where(.page-frame) .copy-btn:active { transform: translateY(1px); }
  :where(.page-frame) .copy-btn.copied { color: var(--green); border-color: var(--green); }
  :where(.page-frame) .copy-btn.copy-error { color: var(--amber); border-color: var(--amber); }
  :where(.page-frame) .copy-note { font-size: 12px; color: var(--ink-3); animation: lnx-fade var(--dur-1) var(--ease) backwards; }

  /* The paste-a-map-link fallback on the locations editor. */
  :where(.page-frame) .paste-coords { margin-top: 12px; margin-bottom: 0; }
  :where(.page-frame) .paste-coords label { font-size: 12px; color: var(--ink-3); }
  /* .hex-row's layout, not its capitals: HTTPS://MAPS.APP.GOO.GL/… reads as
     a different link. */
  :where(.page-frame) .paste-coords .hex-row input[type="text"] { text-transform: none; }

  /* Plan usage bars, so a limit is visible before you hit it. */
  :where(.page-frame) .plan-row { margin-bottom: 14px; }
  :where(.page-frame) .plan-row-top { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
  :where(.page-frame) .plan-usage { font-variant-numeric: tabular-nums; color: var(--ink-3); }
  :where(.page-frame) .plan-bar { height: 6px; border-radius: 100px; background: var(--sunk); overflow: hidden; }
  :where(.page-frame) .plan-bar > span {
    display: block; height: 100%; background: var(--accent); border-radius: 100px;
    transition: width var(--dur-3) var(--ease);
  }

  /* Setup checklist. A band above the page content, not another panel.
     <details> keeps the open state with no JS or cookie. */
  :where(.page-frame) .setup {
    background: linear-gradient(180deg, rgba(242,140,56,.09), rgba(242,140,56,.03));
    border: 1px solid rgba(242,140,56,.26);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin-bottom: 20px;
    animation: lnx-rise var(--dur-3) var(--ease) backwards;
  }
  :where(.page-frame) .setup > summary {
    display: flex; align-items: center; gap: 12px; cursor: pointer;
    list-style: none; font-size: 14px;
  }
  :where(.page-frame) .setup > summary::-webkit-details-marker { display: none; }
  :where(.page-frame) .setup .setup-title { font-weight: 700; color: var(--ink); }
  :where(.page-frame) .setup .setup-count { color: var(--accent-light); font-weight: 600; margin-inline-start: auto; font-variant-numeric: tabular-nums; }
  :where(.page-frame) .setup-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
  :where(.page-frame) .setup-pill {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--line); border-radius: 100px;
    padding: 8px 15px; font-size: 13px; font-weight: 600;
    color: var(--ink-2); text-decoration: none; background: var(--sunk);
    transition: border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
  }
  :where(.page-frame) .setup-pill:hover { color: var(--ink); border-color: var(--accent); transform: translateY(-1px); }
  :where(.page-frame) .setup-pill .setup-tick {
    width: 16px; height: 16px; border-radius: 50%; flex: none;
    border: 1px solid var(--line); display: inline-flex;
    align-items: center; justify-content: center; font-size: 10px;
  }
  /* Finished steps stay visible; seeing progress is the point. */
  :where(.page-frame) .setup-pill.done { color: var(--ink-3); }
  :where(.page-frame) .setup-pill.done .setup-tick { background: var(--green); border-color: var(--green); color: #0F172A; font-weight: 700; }

  /* Template gallery. Reuses .cards-grid so tiles line up with real cards. */
  :where(.page-frame) .tpl-search { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
  :where(.page-frame) .tpl-tile {
    display: block; background: var(--paper); border: 1px solid var(--line);
    border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; color: inherit;
  }
  :where(.page-frame) .tpl-tile { transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease); }
  :where(.page-frame) .tpl-tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-2); }
  :where(.page-frame) .tpl-tile:active { transform: translateY(0); }
  :where(.page-frame) .tpl-tile img { display: block; width: 100%; height: auto; background: var(--sunk); }
  :where(.page-frame) .tpl-tile .meta { padding: 14px 16px; border-top: 1px solid var(--line); }
  :where(.page-frame) .tpl-tile .meta h3 { margin: 0 0 4px; font-size: 15px; color: var(--ink); }
  :where(.page-frame) .tpl-tile .meta p { margin: 0 0 4px; font-size: 13px; color: var(--ink-2); }
  :where(.page-frame) .tpl-tile .tpl-sub { color: var(--ink-3); font-size: 12px; }
  :where(.page-frame) .tpl-tile .tpl-sub code { font-family: inherit; letter-spacing: .04em; }
  :where(.page-frame) .tpl-tile .btn.small { margin-top: 10px; }
  :where(.page-frame) .tpl-code { margin-block-start: 14px; }
  :where(.page-frame) .tpl-code summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); }
  /* Jump to a trade instead of scrolling the whole catalogue. */
  :where(.page-frame) .tpl-cats {
    position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
    margin-block-start: 18px; margin-inline: -20px; padding: 10px 20px; background: var(--canvas);
  }
  :where(.page-frame) .tpl-cats a {
    flex: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 100px; background: var(--paper);
    color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
  }
  :where(.page-frame) .tpl-cat { scroll-margin-top: 64px; }
  @media (max-width: 560px) {
    /* Two small tiles a row: the catalogue in a few screens, not nine thousand pixels. */
    :where(.page-frame) .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    :where(.page-frame) .tpl-tile .meta { padding: 10px 12px; }
    :where(.page-frame) .tpl-tile .tpl-sub, :where(.page-frame) .tpl-tile .btn.small { display: none; }
  }
  :where(.page-frame) code.pill { background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 13px; color: var(--ink-2); font-family: inherit; }
  :where(.page-frame) .kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 15px; }
  :where(.page-frame) .kv dt { color: var(--ink-3); }
  :where(.page-frame) .kv dd { margin: 0; color: var(--ink); }
  :where(.page-frame) .qr-wrap { text-align: center; padding: 20px; background: var(--sunk); border-radius: var(--radius-lg); border: 1px solid var(--line); }
  :where(.page-frame) .qr-wrap img { image-rendering: pixelated; border-radius: 8px; background: #fff; padding: 12px; }
  :where(.page-frame) .lock { opacity: .55; }
  :where(.page-frame) .lock label::after { content: ' 🔒'; }
  :where(.page-frame) table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
  :where(.page-frame) table.data th, :where(.page-frame) table.data td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  :where(.page-frame) table.data tbody tr { transition: background-color var(--dur-1) var(--ease); }
  :where(.page-frame) table.data tbody tr:hover { background: var(--hover-wash); }
  :where(.page-frame) table.data th { color: var(--ink-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
  :where(.page-frame) table.data td { color: var(--ink); }
  :where(.page-frame) table.data code.mono { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
  :where(.page-frame) .progress-bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
  :where(.page-frame) .progress-bar .track { flex: 1; height: 6px; border-radius: 100px; background: var(--sunk); overflow: hidden; }
  :where(.page-frame) .progress-bar .fill { height: 100%; background: var(--accent); }
  :where(.page-frame) .progress-bar span.frac { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
  :where(.page-frame) .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 20px; }
  :where(.page-frame) .kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; }
  :where(.page-frame) .kpi .n { font-size: 28px; font-weight: 700; color: var(--ink); }
  :where(.page-frame) .kpi .label { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
  :where(.page-frame) .chips { display: flex; gap: 8px; flex-wrap: wrap; }
  :where(.page-frame) .chip {
    display: inline-block; padding: 8px 16px; border-radius: 100px; font-size: 13px; font-weight: 600;
    border: 1px solid var(--line); color: var(--ink-2); text-decoration: none;
  }
  :where(.page-frame) .chip.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  :where(.page-frame) .chip.locked { background: rgba(242,140,56,.12); color: var(--accent-light); border-color: rgba(242,140,56,.3); }
  :where(.page-frame) .funnel { display: flex; flex-direction: column; gap: 12px; }
  :where(.page-frame) .funnel .step { display: grid; grid-template-columns: 180px 1fr 60px; align-items: center; gap: 12px; font-size: 14px; }
  :where(.page-frame) .funnel .track { height: 22px; border-radius: 8px; background: var(--sunk); overflow: hidden; }
  :where(.page-frame) .funnel .fill { height: 100%; background: var(--accent); border-radius: 8px; }
  :where(.page-frame) .weekday-chart { display: flex; align-items: flex-end; gap: 10px; height: 140px; }
  :where(.page-frame) .weekday-chart .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
  :where(.page-frame) .weekday-chart .bar { width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; min-height: 2px; }
  :where(.page-frame) .weekday-chart .day-label { font-size: 11px; color: var(--ink-3); }
  :where(.page-frame) .weekday-chart .day-count { font-size: 11px; color: var(--ink-2); }
  :where(.page-frame) .no-data { text-align: center; color: var(--ink-3); padding: 28px 12px; font-size: 14px; }

  /* Card designer: controls plus sticky preview; single column on narrow
     screens with the preview on top. */
  :where(.page-frame) .designer { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
  :where(.page-frame) .designer-controls { min-width: 0; }
  :where(.page-frame) .designer-preview { position: sticky; top: 20px; }
  :where(.page-frame) .designer-preview .preview-panel img { width: 100%; height: auto; border-radius: 10px; }
  :where(.page-frame) .designer-preview .hint { font-size: 12px; color: var(--ink-3); margin-top: 10px; line-height: 1.5; }
  @media (max-width: 860px) {
    :where(.page-frame) .designer { grid-template-columns: 1fr; }
    :where(.page-frame) .designer-preview { position: static; order: -1; margin-bottom: 4px; }
  }
  :where(.page-frame) .designer h2 { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
  :where(.page-frame) .designer h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
  :where(.page-frame) .upload-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
  :where(.page-frame) .upload-thumb {
    width: 64px; height: 64px; border-radius: 10px; background: var(--sunk);
    border: 1px solid var(--line); object-fit: cover; display: none;
  }
  :where(.page-frame) .upload-thumb.cover-thumb { width: 96px; height: 37px; }
  :where(.page-frame) .upload-thumb.shown { display: block; }
  :where(.page-frame) .upload-actions { display: flex; gap: 8px; flex-wrap: wrap; }
  :where(.page-frame) input[type="file"] { display: none; }
  :where(.page-frame) .btn.small { padding: 8px 16px; font-size: 13px; }
  :where(.page-frame) .btn.remove { background: transparent; color: var(--red); border: 1px solid rgba(239,68,68,.35); }
  :where(.page-frame) .btn.remove:hover { background: rgba(239,68,68,.12); }
  :where(.page-frame) .btn.remove[disabled] { opacity: .4; cursor: default; }
  :where(.page-frame) .upload-error { color: var(--red); font-size: 13px; margin-top: 6px; }
  :where(.page-frame) .hex-row { display: flex; align-items: center; gap: 8px; }
  :where(.page-frame) .hex-row input[type="color"] { flex: none; }
  :where(.page-frame) .hex-row input[type="text"] { width: 96px; flex: none; text-transform: uppercase; }
  :where(.page-frame) .range-row { display: flex; align-items: center; gap: 12px; }
  :where(.page-frame) .range-row input[type="range"] { flex: 1; }
  :where(.page-frame) .range-row .range-val { font-size: 13px; color: var(--ink-2); min-width: 34px; text-align: end; }
  :where(.page-frame) .shape-toggle { display: flex; gap: 8px; }
  :where(.page-frame) .shape-toggle label {
    display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 14px; cursor: pointer; font-weight: 500; font-size: 14px; color: var(--ink-2); margin: 0;
    flex: 1; justify-content: center;
  }
  :where(.page-frame) .shape-toggle input { accent-color: var(--accent); }
  /* Card-language picker, a <details> that opens in the form's flow so no
     ancestor overflow clips it. Not .lang-toggle: that class belongs to the
     nav and its display rules would clash. */
  :where(.page-frame) .lang-picker { position: relative; }
  :where(.page-frame) .lang-summary {
    list-style: none; display: flex; align-items: center; gap: 14px; cursor: pointer;
    border: 2px solid var(--line); border-radius: var(--radius-lg); background: var(--sunk);
    padding: 12px 16px; transition: border-color .15s, box-shadow .15s;
  }
  :where(.page-frame) .lang-summary::-webkit-details-marker { display: none; }
  :where(.page-frame) .lang-summary:hover { border-color: var(--accent); }
  :where(.page-frame) .lang-picker[open] > .lang-summary { border-color: var(--accent); box-shadow: 0 0 0 3px var(--hover-wash); }
  :where(.page-frame) .lang-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  :where(.page-frame) .lang-glyph {
    flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    font-size: 19px; font-weight: 700; color: var(--on-accent); letter-spacing: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    box-shadow: var(--shadow-1);
  }
  :where(.page-frame) .lang-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
  :where(.page-frame) .lang-card-name { font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: 0; line-height: 1.25; }
  :where(.page-frame) .lang-meta { font-size: 12.5px; color: var(--ink-3); }
  :where(.page-frame) .lang-count {
    flex: none; font-size: 11px; font-weight: 700; color: var(--ink-3); border: 1px solid var(--line);
    border-radius: 100px; padding: 2px 8px;
  }
  :where(.page-frame) .lang-chevron {
    flex: none; width: 10px; height: 10px; border-inline-end: 2px solid var(--ink-3); border-block-end: 2px solid var(--ink-3);
    transform: rotate(45deg); transition: transform .2s; margin-inline-end: 4px;
  }
  :where(.page-frame) .lang-picker[open] .lang-chevron { transform: rotate(225deg); }
  :where(.page-frame) .lang-panel {
    margin-block-start: 10px; border: 1px solid var(--line); border-radius: var(--radius-lg);
    background: var(--paper); box-shadow: var(--shadow-2); padding: 12px;
    animation: lang-drop .18s ease-out;
  }
  @keyframes lang-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
  @media (prefers-reduced-motion: reduce) { :where(.page-frame) .lang-panel { animation: none; } :where(.page-frame) .lang-chevron { transition: none; } }
  :where(.page-frame) .lang-search {
    width: 100%; margin-block-end: 10px; padding: 10px 14px; border-radius: 100px;
    border: 1px solid var(--line); background: var(--sunk); color: var(--ink); font: inherit; font-size: 14px;
  }
  :where(.page-frame) .lang-options {
    border: 0; margin: 0; padding: 0; min-width: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px;
    max-height: min(440px, 60vh); overflow-y: auto; overscroll-behavior: contain;
  }
  :where(.page-frame) .lang-card {
    position: relative; display: flex; align-items: center; gap: 12px; margin: 0; cursor: pointer;
    border: 2px solid transparent; border-radius: var(--radius-lg); padding: 10px 12px; background: var(--sunk);
    transition: border-color .12s, background .12s;
  }
  :where(.page-frame) .lang-card[hidden] { display: none; }
  :where(.page-frame) .lang-card:hover { border-color: var(--line); background: var(--hover-wash); }
  :where(.page-frame) .lang-card:focus-within { border-color: var(--accent); }
  :where(.page-frame) .lang-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--paper); }
  :where(.page-frame) .lang-card input { position: absolute; opacity: 0; width: 0; height: 0; }
  :where(.page-frame) .lang-card .lang-glyph { width: 38px; height: 38px; font-size: 16px; background: var(--raise); color: var(--ink); box-shadow: none; border: 1px solid var(--line); }
  :where(.page-frame) .lang-card.selected .lang-glyph { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); color: var(--on-accent); border-color: transparent; }
  :where(.page-frame) .lang-card .lang-card-name { font-size: 15.5px; }
  :where(.page-frame) .lang-sample { font-size: 12.5px; color: var(--ink-2); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  :where(.page-frame) .lang-rtl {
    font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--accent-light);
    border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-inline-start: 2px;
  }
  :where(.page-frame) .lang-check {
    flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
    font-size: 13px; font-weight: 700; color: var(--on-accent); background: var(--accent);
    opacity: 0; transform: scale(.6); transition: opacity .12s, transform .12s;
  }
  :where(.page-frame) .lang-card.selected .lang-check { opacity: 1; transform: none; }
  :where(.page-frame) .lang-empty { margin: 8px 4px 0; color: var(--ink-3); }
  /* Polish and Korean fall outside the vendored Plex subsets, so use the
     system font throughout to avoid switching typeface mid-word. */
  :where(.page-frame) :is([lang="pl"], [lang="ko"]), :where(.page-frame) :is([lang="pl"], [lang="ko"]) * { font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; }
  :where(.page-frame) .switch-row { display: flex; align-items: center; gap: 10px; }
  :where(.page-frame) .switch-row label { margin: 0; font-weight: 500; }
  :where(.page-frame) .switch-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
  :where(.page-frame) .icon-grid { display: flex; flex-wrap: wrap; gap: 8px; }
  :where(.page-frame) .icon-swatch {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--sunk); cursor: pointer; margin: 0;
  }
  :where(.page-frame) .icon-swatch.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
  :where(.page-frame) .icon-swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
  :where(.page-frame) .icon-swatch img { width: 28px; height: 28px; }
  :where(.page-frame) .field-hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
  :where(.page-frame) .field-hint.amber { color: var(--amber); }

  /* Location reminders: fieldsets added/removed client-side until Save. */
  :where(.page-frame) .locations-heading-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  :where(.page-frame) .locations-counter { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
  :where(.page-frame) .locations-intro { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 4px 0 16px; }
  :where(.page-frame) .locations-empty { text-align: center; color: var(--ink-3); padding: 20px 12px; font-size: 13px; border: 1px dashed var(--line); border-radius: 12px; margin-bottom: 14px; }
  :where(.page-frame) .location-row { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; background: var(--sunk); }
  :where(.page-frame) .location-row .row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
  :where(.page-frame) .location-row .row-title { font-size: 13px; font-weight: 700; color: var(--ink-2); }
  :where(.page-frame) .location-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  :where(.page-frame) .location-grid .field { margin-bottom: 12px; }
  :where(.page-frame) .location-row .geo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
  :where(.page-frame) .location-row .geo-status { font-size: 12px; color: var(--ink-3); }
  :where(.page-frame) .location-row .geo-status.error { color: var(--red); }

  /* Business search. Picking a result fills the coordinates behind the
     scenes; merchants never see a latitude. */
  :where(.page-frame) .place-search { position: relative; }
  :where(.page-frame) .place-results {
    position: absolute; z-index: 30; top: calc(100% + 4px); inset-inline: 0;
    margin: 0; padding: 4px; list-style: none;
    background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-2);
    /* At most five results, but long addresses wrap, so cap the height. */
    max-height: 280px; overflow-y: auto;
  }
  /* The li is the option; a <button> inside role="option" is invalid ARIA. */
  :where(.page-frame) .place-results li {
    display: block; width: 100%; text-align: start; cursor: pointer;
    padding: 9px 10px; border-radius: 8px;
    color: var(--ink); line-height: 1.35;
  }
  /* Hover and keyboard (.is-active) share one look. */
  :where(.page-frame) .place-results li:hover,
  :where(.page-frame) .place-results li.is-active { background: var(--hover-wash); outline: none; }
  :where(.page-frame) .place-results .place-primary { display: block; font-weight: 600; font-size: 14px; }
  :where(.page-frame) .place-results .place-secondary { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; }
  :where(.page-frame) .place-search-status { font-size: 12px; color: var(--ink-3); margin: 6px 0 0; }
  :where(.page-frame) .place-search-status.error { color: var(--red); }

  /* Selected place, replacing the search box. Shows name and address so
     the merchant can confirm the geofence. */
  :where(.page-frame) .place-chosen {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; margin-bottom: 12px;
    border: 1px solid rgba(34,197,94,.35); background: rgba(34,197,94,.10);
    border-radius: 12px;
  }
  /* The display above outranks the browser's [hidden] rule, which put an
     empty green tick on every new row. */
  :where(.page-frame) .place-chosen[hidden] { display: none; }
  :where(.page-frame) .place-chosen .tick { color: var(--green); font-weight: 700; line-height: 1.35; }
  :where(.page-frame) .place-chosen .place-chosen-text { flex: 1; min-width: 0; }
  :where(.page-frame) .place-chosen .place-chosen-name { display: block; font-weight: 600; color: var(--ink); line-height: 1.35; }
  :where(.page-frame) .place-chosen .place-chosen-address {
    display: block; font-size: 12px; color: var(--ink-2); margin-top: 2px; line-height: 1.4;
    /* Google addresses run long; wrap rather than stretch. */
    overflow-wrap: anywhere;
  }
  :where(.page-frame) .location-row .or-divider { font-size: 12px; color: var(--ink-3); }

  /* Settings: staff PIN reveal. */
  :where(.page-frame) .staff-pin-reveal { background: rgba(34,197,94,.10); border: 1px solid rgba(34,197,94,.35); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
  :where(.page-frame) .staff-pin-reveal .pin { font-size: 24px; font-weight: 700; letter-spacing: 0.12em; color: var(--ink); font-variant-numeric: tabular-nums; }
  :where(.page-frame) .staff-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  :where(.page-frame) .staff-row:last-child { border-bottom: none; }
  :where(.page-frame) .staff-row .name { font-weight: 600; color: var(--ink); }
  :where(.page-frame) .staff-row .badge { font-size: 11px; padding: 3px 10px; border-radius: 100px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
  :where(.page-frame) .staff-row .badge.active { background: rgba(34,197,94,.14); color: var(--green); }
  :where(.page-frame) .staff-row .badge.inactive { background: rgba(148,163,184,.14); color: var(--ink-3); }
  :where(.page-frame) .staff-row .actions { display: flex; gap: 8px; }
  :where(.page-frame) .settings-note { font-size: 13px; color: var(--ink-3); line-height: 1.5; margin: 6px 0 18px; }
  /* /team: one row per staff member; the actions wrap under the name on a phone. */
  :where(.page-frame) .team-list { list-style: none; margin: 0; padding: 0; }
  :where(.page-frame) .team-member { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-block-start: 1px solid var(--line); }
  :where(.page-frame) .team-member:first-child { border-block-start: 0; padding-block-start: 0; }
  :where(.page-frame) .team-who { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  :where(.page-frame) .team-who .mono { font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
  :where(.page-frame) .team-note { font-size: 13px; color: var(--ink-3); }
  :where(.page-frame) .team-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  :where(.page-frame) .team-actions form { margin: 0; }

  /* Notifications (BUILD.md §8.12). */
  :where(.page-frame) .notif-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
  :where(.page-frame) .notif-tabs a { padding: 8px 16px; border-radius: 100px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink-2); border: 1px solid var(--line); }
  :where(.page-frame) .notif-tabs a.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  :where(.page-frame) .notif-advisory { background: rgba(34,197,94,.10); border: 1px solid rgba(34,197,94,.35); color: var(--ink-2); border-radius: var(--radius-lg); padding: 14px 18px; margin-bottom: 20px; font-size: 13px; line-height: 1.5; }
  :where(.page-frame) .notif-advisory b { color: var(--green); }
  :where(.page-frame) .notif-recipient-count { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
  :where(.page-frame) .notif-counter { font-size: 12px; color: var(--ink-3); text-align: end; margin-top: 4px; }
  :where(.page-frame) .notif-counter.over { color: var(--red); }
  :where(.page-frame) .notif-history { margin-top: 28px; }
  :where(.page-frame) .notif-job { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
  :where(.page-frame) .notif-job:last-child { border-bottom: none; }
  :where(.page-frame) .notif-job .msg { color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  :where(.page-frame) .notif-job .meta { color: var(--ink-3); white-space: nowrap; }
  :where(.page-frame) .notif-job .status-pill { font-size: 11px; padding: 3px 10px; border-radius: 100px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
  :where(.page-frame) .notif-job .status-pill.queued { background: rgba(148,163,184,.14); color: var(--ink-3); }
  :where(.page-frame) .notif-job .status-pill.sending { background: rgba(242,140,56,.14); color: var(--accent-light); }
  :where(.page-frame) .notif-job .status-pill.sent { background: rgba(34,197,94,.14); color: var(--green); }
  /* Expiry pill: is the broadcast message still showing on passes. */
  :where(.page-frame) .notif-job .status-pill.active { background: rgba(34,197,94,.14); color: var(--green); }
  :where(.page-frame) .notif-job .status-pill.expired { background: rgba(148,163,184,.14); color: var(--ink-3); }
  /* Assistant chat thread. Logical properties only, so the merchant's
     messages sit on the inline-end side and RTL mirrors the thread for free. */
  /* --paper: there's no --surface token (an unknown one renders transparent). */
  :where(.page-frame) .chat { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; max-width: 780px; }
  :where(.page-frame) .chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--sunk); }
  :where(.page-frame) .chat-online { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
  :where(.page-frame) .chat-name { font-weight: 600; font-size: 14px; color: var(--ink); }
  :where(.page-frame) .chat-card { margin-inline-start: auto; max-width: 40%; font-size: 12px; padding: 4px 8px; }
  :where(.page-frame) .chat-plan { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 100px; background: rgba(242,140,56,.14); color: var(--accent-light); white-space: nowrap; }
  :where(.page-frame) .chat-body { padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; min-height: 320px; max-height: 62vh; overflow-y: auto; }
  :where(.page-frame) .msg { display: flex; }
  :where(.page-frame) .msg.in { justify-content: flex-start; }
  :where(.page-frame) .msg.out { justify-content: flex-end; }
  :where(.page-frame) .bubble { max-width: 82%; padding: 12px 15px; border-radius: var(--radius-lg); font-size: 14px; line-height: 1.65; }
  :where(.page-frame) .msg.in .bubble { background: var(--sunk); color: var(--ink-2); border-start-start-radius: 4px; }
  :where(.page-frame) .msg.out .bubble { background: rgba(242,140,56,.16); color: var(--ink); border-start-end-radius: 4px; }
  :where(.page-frame) .bubble p { margin: 0 0 8px; }
  :where(.page-frame) .bubble p:last-child { margin-bottom: 0; }
  :where(.page-frame) .bubble.greeting { color: var(--ink-3); }
  :where(.page-frame) .chat-headline { font-size: 15px; font-weight: 600; color: var(--ink); }
  /* --sunk so it recedes inside a --paper bubble. */
  :where(.page-frame) .chat-suggestion { margin-top: 10px; padding: 10px 12px; background: var(--sunk); border-radius: var(--radius); font-size: 13px; }
  :where(.page-frame) .chat-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
  :where(.page-frame) .chat-stat { display: flex; flex-direction: column; gap: 2px; min-width: 92px; }
  :where(.page-frame) .chat-stat .n { font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.1; }
  :where(.page-frame) .chat-stat .label { font-size: 12px; color: var(--ink-2); }
  :where(.page-frame) .chat-stat .delta { font-size: 11px; color: var(--ink-3); }
  /* Customer list as a collapsed attachment under the answer. */
  :where(.page-frame) .attach { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
  :where(.page-frame) .attach summary { cursor: pointer; padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--ink); }
  :where(.page-frame) .attach-body { padding: 0 12px 12px; }
  :where(.page-frame) .attach-note { font-size: 12px; color: var(--ink-3); margin: 8px 0 0; display: block; }
  :where(.page-frame) .assistant-table-wrap { overflow-x: auto; }
  :where(.page-frame) .chat-campaign { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
  :where(.page-frame) .chat-campaign textarea { width: 100%; font-size: 13px; }
  :where(.page-frame) .chat-campaign .btn { align-self: flex-start; }
  :where(.page-frame) .chat-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 0; }
  :where(.page-frame) .quick { font-size: 12px; padding: 7px 13px; border-radius: 100px; border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
  :where(.page-frame) .quick:hover { border-color: var(--accent); color: var(--ink); }
  :where(.page-frame) .chat-composer { display: flex; gap: 8px; padding: 14px 16px; align-items: center; }
  :where(.page-frame) .chat-composer input[type=text] { flex: 1; border-radius: 100px; padding: 11px 16px; }
  :where(.page-frame) .chat-send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--accent); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
  :where(.page-frame) .chat-send:hover { background: var(--accent-light); }
  /* Arrow follows the reading direction. */
  html[dir=rtl] :where(.page-frame) .chat-send svg { transform: scaleX(-1); }
  :where(.page-frame) .dots { display: inline-flex; gap: 4px; align-items: center; }
  :where(.page-frame) .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: chatdot 1.2s infinite ease-in-out; }
  :where(.page-frame) .dots i:nth-child(2) { animation-delay: .18s; }
  :where(.page-frame) .dots i:nth-child(3) { animation-delay: .36s; }
  @keyframes chatdot { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
  :where(.page-frame) .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  @media (prefers-reduced-motion: reduce) { :where(.page-frame) .dots i { animation: none; opacity: .6; } }
  :where(.page-frame) .assistant-question-list { margin: 14px 0 18px; padding-inline-start: 20px; color: var(--ink-2); line-height: 1.9; }
  :where(.page-frame) .automated-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
  :where(.page-frame) .automated-card { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
  :where(.page-frame) .automated-card h3 { margin: 0 0 6px; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
  :where(.page-frame) .automated-card p { margin: 0; font-size: 13px; color: var(--ink-3); line-height: 1.5; }
  :where(.page-frame) .automated-card .status-pill { font-size: 10px; padding: 3px 9px; border-radius: 100px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
  /* Tinted: the one nav link that isn't part of the product. */
  :where(.page-frame) .nav-admin {
    background: rgba(242,140,56,.12); color: var(--accent-light) !important;
    border: 1px solid rgba(242,140,56,.3); border-radius: 100px;
    padding: 6px 14px !important; font-weight: 700;
  }
  /* Admin joined-date filter. Wraps rather than squeezing date inputs
     narrower than their calendar icon. */
  :where(.page-frame) .range-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 14px; margin-bottom: 16px;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  }
  :where(.page-frame) .range-label { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
  :where(.page-frame) .range-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-inline-start: auto; }
  :where(.page-frame) .range-form input[type="date"] { width: auto; padding: 8px 10px; font-size: 14px; }
  :where(.page-frame) .range-bar .chip { padding: 6px 12px; font-size: 12px; }
  /* Unscoped fallback for status pills outside notifications (admin tables),
     which otherwise render as bare text. */
  :where(.page-frame) .status-pill {
    display: inline-block; font-size: 11px; padding: 3px 10px; border-radius: 100px;
    font-weight: 700; letter-spacing: .02em; white-space: nowrap;
    background: rgba(148,163,184,.14); color: var(--ink-3);
  }
  :where(.page-frame) .status-pill.live { background: rgba(34,197,94,.14); color: var(--green); }
  :where(.page-frame) .status-pill.pending { background: rgba(242,140,56,.14); color: var(--accent-light); }
  :where(.page-frame) .status-pill.danger { background: rgba(239,68,68,.14); color: var(--red); }
  :where(.page-frame) .automated-card .status-pill.live { background: rgba(34,197,94,.14); color: var(--green); }
  :where(.page-frame) .automated-card .status-pill.pending { background: rgba(148,163,184,.14); color: var(--ink-3); }
  /* Automation on/off switch, drawn over a real checkbox so keyboard, label
     and form post all still work without JS. The input is moved off-screen
     (not display:none) to stay in the tab order. */
  :where(.page-frame) .switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; margin: 16px 0 20px; }
  :where(.page-frame) .switch input {
    position: absolute; opacity: 0; width: 46px; height: 28px; margin: 0; cursor: pointer;
  }
  :where(.page-frame) .switch .track {
    flex: none; position: relative; width: 46px; height: 28px; border-radius: 100px;
    background: rgba(148,163,184,.42); transition: background .18s ease;
  }
  :where(.page-frame) .switch .track::after {
    content: ''; position: absolute; top: 3px; inset-inline-start: 3px;
    width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(19,28,43,.32); transition: transform .18s ease;
  }
  :where(.page-frame) .switch input:checked + .track { background: var(--green); }
  /* The knob moves toward the line end (left in Arabic); a single translateX
     would slide it off the track. */
  :where(.page-frame) .switch input:checked + .track::after { transform: translateX(18px); }
  html[dir=rtl] :where(.page-frame) .switch input:checked + .track::after { transform: translateX(-18px); }
  :where(.page-frame) .switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(242,140,56,.35); }
  :where(.page-frame) .switch-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
  :where(.page-frame) .switch-title { font-size: 13px; font-weight: 600; color: var(--ink-2); }
  /* Show the word too; a slider alone doesn't say which side is on. */
  :where(.page-frame) .switch-state { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--ink-3); }
  :where(.page-frame) .switch input:checked ~ .switch-text .switch-state { color: var(--green); }
  :where(.page-frame) .switch .switch-on { display: none; }
  :where(.page-frame) .switch input:checked ~ .switch-text .switch-on { display: inline; }
  :where(.page-frame) .switch input:checked ~ .switch-text .switch-off { display: none; }
  @media (prefers-reduced-motion: reduce) {
    :where(.page-frame) .switch .track, :where(.page-frame) .switch .track::after { transition: none; }
  }
  /* Feedback goes under the switch, where the merchant is looking. */
  :where(.page-frame) .switch-note { margin: -8px 0 18px; font-size: 12px; color: var(--ink-3); }
  :where(.page-frame) .switch-note.ok { color: var(--green); }
  :where(.page-frame) .switch-note.error { color: var(--red); }
  /* Unprompted proposal from the assistant. */
  :where(.page-frame) .bubble.proposal { border-inline-start: 3px solid var(--accent); }
  :where(.page-frame) .proposal-ask { font-weight: 600; color: var(--ink); margin-top: 12px; }

  :where(.page-frame) .crop-dialog {
    border: 0;
    padding: 0;
    background: transparent;
    max-width: 100vw;
    max-height: 100vh;
  }
  :where(.page-frame) .crop-dialog::backdrop { background: rgba(19, 28, 43, .58); }
  :where(.page-frame) .crop-shell {
    width: min(620px, 94vw);
    max-height: 92vh;
    overflow-y: auto;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-3);
  }
  :where(.page-frame) .crop-head { display: flex; align-items: flex-start; gap: 12px; }
  :where(.page-frame) .crop-head h2 { margin: 0 0 2px; font-size: 18px; }
  :where(.page-frame) .crop-head .crop-sub { margin: 0; font-size: 13px; color: var(--ink-3); }
  :where(.page-frame) .crop-close {
    margin-inline-start: auto;
    background: transparent;
    border: 0;
    color: var(--ink-3);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 8px;
  }
  :where(.page-frame) .crop-close:hover { color: var(--ink); background: var(--hover-wash); }
  :where(.page-frame) .crop-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin: 14px 0 10px;
    padding: 6px;
    background: var(--sunk);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  :where(.page-frame) .crop-toolbar .sep {
    width: 1px;
    align-self: stretch;
    background: var(--line);
    margin: 2px 4px;
  }
  :where(.page-frame) .crop-toolbar button {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--ink-2);
    cursor: pointer;
    transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
  }
  :where(.page-frame) .crop-toolbar button:hover { background: var(--raise); color: var(--ink); }
  :where(.page-frame) .crop-toolbar button:focus-visible { border-color: var(--accent); outline: none; }
  :where(.page-frame) .crop-toolbar svg {
    width: 20px; height: 20px; fill: none; stroke: currentColor;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  }
  :where(.page-frame) .crop-stage {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background-color: var(--sunk);
    /* Checkerboard so logo transparency is visible, in both themes. */
    background-image:
      linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%),
      linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
  }
  :where(.page-frame) .crop-stage canvas {
    display: block;
    width: 100%;
    /* Cursor is set per region by the script. touch-action stops a drag from
       scrolling the page. */
    touch-action: none;
  }
  :where(.page-frame) .crop-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
  }
  :where(.page-frame) .crop-actions .crop-spacer { margin-inline-start: auto; }
  :where(.page-frame) .crop-error { margin: 10px 0 0; font-size: 13px; color: var(--red); }
  @media (max-width: 520px) {
    :where(.page-frame) .crop-shell { padding: 14px; }
    :where(.page-frame) .crop-toolbar button { width: 34px; height: 34px; }
    :where(.page-frame) .crop-actions { flex-wrap: wrap; }
  }


  :where(.page-frame) .store-links { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 14px; }
  :where(.page-frame) .store-link {
    display: inline-flex; align-items: center; gap: 10px; flex: 1 1 auto;
    min-height: 56px; padding: 0 18px; border-radius: 14px;
    border: 1px solid var(--line); background: var(--raise); color: var(--ink);
    text-decoration: none; font-family: inherit;
  }
  :where(.page-frame) .store-link:hover { border-color: var(--accent); }
  :where(.page-frame) .store-link svg { flex: none; color: var(--ink-2); }
  :where(.page-frame) .store-link:hover svg { color: var(--accent-light); }
  /* Overline is translated; the wordmark below stays Latin. */
  :where(.page-frame) .store-link i { font-style: normal; display: block; font-size: 11px; color: var(--ink-3); line-height: 1.2; }
  :where(.page-frame) .store-link b { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; }
  /* No tracking: it breaks Arabic letter joining. The overline can be Arabic. */
  html[lang="ar"] :where(.page-frame) .store-link i { letter-spacing: 0; }
  /* Long-form reading: narrower measure, taller line-height. */
.legal { max-width: 46rem; margin: 0 auto; padding: 40px 22px 80px; }
.legal h1 { font-size: 30px; margin: 0 0 6px; }
.legal .eff { color: var(--ink-3); font-size: 14px; margin: 0 0 34px; }
.legal-s { margin-bottom: 30px; }
.legal-s h2 { font-size: 17px; margin: 0 0 10px; color: var(--ink); }
.legal p { color: var(--ink-2); line-height: 1.75; margin: 0 0 12px; font-size: 15px; }
/* --accent is 2.45:1 on --paper and fails AA for body text. */
.legal a { color: var(--accent-light); }
.legal ul { color: var(--ink-2); line-height: 1.75; font-size: 15px; padding-inline-start: 22px; }
.legal li { margin-bottom: 7px; }
.legal .back { display: inline-block; margin-bottom: 26px; color: var(--ink-3); text-decoration: none; font-size: 14px; }
.legal .back:hover { color: var(--ink); }
