:root{
  --ink:#17190F; --ink-h:#2A2D1E; --lime:#C9E750; --lime-h:#D9F16C; --paper:#FDFDFB;
  --line:#EEEFE9; --line-s:#E4E6DE; --line-d:#C9CDBF; --muted:#9AA096; --muted-d:#5F654F;
  --faint:#B4B9AC; --fill:#F2F3EF; --fill-a:#F4F5F0; --fill-c:#F7F8F4; --hover:#F5F6F1;
  --lime-soft:#E9F7B9; --lime-text:#4C6114; --lime-mid:#9DBE33; --lime-deep:#7A9B1E;
  --warn-bg:#FDF3DE; --warn-bd:#EBCE96; --warn-t:#9A6E14; --warn-x:#7A5A16;
  --err-bg:#FBE3DA; --err-t:#A63A18; --err-bd:#EEC0AE;
  --sans:'Archivo',sans-serif; --mono:'IBM Plex Mono',monospace;
  --white:#FFFFFF; --page:linear-gradient(135deg,#E6E8E1,#F2F3EE 55%,#E9EBE4);
  /* ⚠️ Shadows follow `ink` too — the green theme uses rgba(21,43,24,…), i.e. #152B18.
     My first pass diffed hex values only and missed these two rgba ones. */
  --sh:23,25,15;
  /* Dropdown chevron. ⚠️ The colour is baked into the data URI and cannot inherit, so each theme
     gets its own. The shape follows the `▾` v3 already uses — a thin round-capped stroke, not the
     solid system triangle. */
  --chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239AA096' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* ══════════════════════════════════════════════════════════════════════════
   v3 Green — copied value by value from `Dashboard v3 Green.dc.html`.
   ⚠️ **Switching themes is purely a colour switch: not one character of HTML or JS changes;
      only these dozen-odd variables are overridden.**
      Measured: both mockups use 24 colours across 261 sites, and with colour lines removed they
      differ by a single `data-screen-label` — so a theme must be a pure variable layer and must
      never touch structure.
   ⚠️ **Not one brand green changed** (#C9E750 / #E9F7B9 / #4C6114 …); only neutrals were swapped.
   ⚠️ In the green theme `--white` is **not pure white** but #FBFDF7. That is where it beats the
      original: an inner card of #FFFFFF on a #FDFDFB shell has a ΔE of only 1.3, wasting a layer;
      the green theme reaches ΔE 4.0 and the layer is genuinely visible.
      **Do not revert to pure white in the name of "cleanliness".**
   ══════════════════════════════════════════════════════════════════════════ */
:root[data-theme="green"]{
  --ink:#152B18; --ink-h:#20401F; --paper:#F2F8EC;
  --line:#CFE2C4; --line-s:#BFD8B2; --line-d:#A6C29A;
  --muted:#7C9474; --muted-d:#476544; --faint:#9BB591;
  --fill:#E2F0DA; --fill-a:#E3EEDA; --fill-c:#F2F8EC; --hover:#E3EEDA;
  --white:#FBFDF7; --page:linear-gradient(135deg,#E3EEDA,#F2F8EC 55%,#E2F0DA);
  --sh:21,43,24;
  --chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237C9474' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--page);}
body{font-family:var(--sans);-webkit-font-smoothing:antialiased;color:var(--ink);}
a{color:var(--ink);text-decoration:none}a:hover{color:var(--lime-deep)}
::selection{background:var(--lime);color:var(--ink)}
@keyframes v3-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)}}
/* ⚠️ The rgba(201,231,80) here is lime and **deliberately not a variable** —
   the brand greens are identical across both themes (measured: #C9E750 appears ×34 in each).
   Turning something invariant into a variable only suggests it can vary. */
@keyframes v3-pulse{0%,100%{box-shadow:0 0 0 0 rgba(201,231,80,.55)}70%{box-shadow:0 0 0 14px rgba(201,231,80,0)}}
@keyframes v3-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}
/* ⚠️ Customers stare at this UI for tens of minutes, not five seconds */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
}
.wrap{min-height:100vh;padding:28px;display:flex;justify-content:center}
.shell{width:100%;max-width:1180px;background:var(--paper);border-radius:26px;
  box-shadow:0 30px 80px rgba(var(--sh),.12);overflow:hidden;display:flex;flex-direction:column}
.top{display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:18px 28px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:10px;font-size:15px;font-weight:800}
/* ⚠️⚠️ 主标记**不转**。原来那个 `✳` 是 16 秒一圈的旋转字符，换成真 logo 之后
   再转就成了「加载中」的信号 —— 顶栏一个永远在转的东西，会让人以为页面卡住了。
   ⚠️ `.star` 那条留着：后台顶栏还在用字符版（内部页，没必要跟品牌走）。 */
.brand .mark{width:22px;height:22px;flex:none;display:block}
.brand .star{font-size:24px;animation:v3-spin 16s linear infinite;display:inline-block}
/* Breadcrumbs say "which screen you are on" — navigation to be read, not decoration */
.crumb{font-family:var(--mono);font-size:10px;color:var(--muted-d);margin-left:4px}
/* ⚠️ The one nav link in the top bar. Deliberately quieter than the pill controls
   next to it — it is a way back, not an action, and the eye should land on the
   page's own content first. */
/* ⚠️⚠️ **`--ink-3` 是我凭空造的变量名，从来没定义过。** CSS 里引用一个不存在的
   自定义属性会让**整条声明作废**（不是回落到某个默认值），于是这里的颜色
   静默变成继承来的正文墨色 —— 和上面注释写的「刻意做轻」正好相反，
   而且**不报错、不警告、控制台一片干净**。
   ⇒ 用真实存在的 `--muted-d`。加新颜色前先确认变量在 `:root` 里有定义。 */
.toplink{font-size:12.5px;font-weight:600;color:var(--muted-d);padding:9px 4px;white-space:nowrap}
.toplink:hover{color:var(--ink);text-decoration:underline;text-underline-offset:4px}
.body{padding:30px 32px 46px}
h1{font-size:32px;font-weight:800;margin:0;letter-spacing:-.02em}
.hl{background:var(--lime);border-radius:12px;padding:0 10px;display:inline-block;transform:rotate(-1.5deg)}
.tag{font-family:var(--mono);font-size:10.5px;font-weight:600;color:var(--muted-d);
  background:var(--white);border:1px solid var(--line-s);border-radius:999px;padding:7px 13px}
.grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:18px;margin-top:24px;align-items:start}
.card{background:var(--white);border:1px solid var(--line);border-radius:18px;padding:20px}
.card.dash{border:1.5px dashed var(--line-d);text-align:center}
.dark{background:var(--ink);border-radius:18px;padding:20px;color:var(--paper)}
.dark h3{margin:0;font-size:15px;font-weight:800;color:var(--lime)}
.row{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid var(--ink-h);padding:11px 0}
/* Key names on dark cards — these are read ("API calls", "elapsed"), so use the muted-d step.
   ⚠️ On dark it is the other way round: `--muted` on `--ink` is fine (contrast is high enough),
      so this rule stays as-is; only secondary text **on light backgrounds** needs swapping. */
.row .k{font-size:12px;color:var(--muted);font-weight:500}
.row .v{font-family:var(--mono);font-size:12px;font-weight:600}
label{display:block;font-size:12.5px;font-weight:700;margin:0 0 7px}
/* ⚠️ The site originally had zero inputs — three wizard steps collected nothing from the customer */
input[type=text],input[type=number],select{width:100%;font-family:var(--sans);font-size:13.5px;
  font-weight:600;color:var(--ink);background:var(--white);border:1px solid var(--line-s);
  border-radius:999px;padding:11px 16px;outline:none;transition:border-color .15s ease}
input::placeholder{color:var(--faint);font-weight:500}
input[type=number]{-moz-appearance:textfield}
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}

/* ── Dropdowns ─────────────────────────────────────────────────────────
   ⚠️ A native select clashes badly with this "paper + pill" look: square corners, system blue,
      a grey triangle. `appearance:none` kills the native look and the chevron is redrawn in the
      `▾` shape v3 already uses.
   ⚠️ The chevron is a background-image, so **its colour is baked into the data URI and cannot be
      currentColor** — hence one per theme (see `--chev` on :root).
   ⚠️⚠️ **This block only ever fixes the CLOSED state — the OS draws the open list.**
      That used to be the whole decision ("a consistent closed state is enough"). It is not:
      the pill matches the paper-and-pill look, then clicking it drops a square white box with a
      system-blue highlight — the one moment the interface stops looking like itself.
      ⇒ The top-bar switchers now use `.dd` below (`web-react/src/Dropdown.jsx`), which draws
        its own list. These `select` rules stay for the plain `<select>`s still in the forms. */
select{
  appearance:none;-webkit-appearance:none;-moz-appearance:none;
  cursor:pointer;padding-right:34px;
  background-image:var(--chev);
  background-repeat:no-repeat;
  background-position:right 13px center;
  background-size:10px 6px;
}
select::-ms-expand{display:none}
select:hover{border-color:var(--line-d)}
/* The small dropdown in the top bar. ⚠️ **Never use an inline `padding:9px 14px`** — it overrides
   the 34px reserved above for the chevron and the text runs straight over it. */
select.sm{width:auto;font-size:12.5px;padding:9px 30px 9px 14px;background-position:right 11px center}

/* ── Custom dropdown (`web-react/src/Dropdown.jsx`) ─────────────────────
   ⚠️ The closed button is deliberately **pixel-for-pixel the old `select.sm`** — the closed
      state was never the problem, so changing it would be a gratuitous visual diff. */
.dd{position:relative;display:inline-block}
.ddbtn{
  display:flex;align-items:center;gap:9px;width:auto;cursor:pointer;
  font-family:var(--sans);font-size:12.5px;color:var(--ink);
  padding:9px 13px 9px 14px;
  background:var(--paper);border:1px solid var(--line);border-radius:999px;
}
.ddbtn:hover{border-color:var(--line-d)}
.ddbtn[aria-expanded="true"]{border-color:var(--ink)}
/* ⚠️ Chevron as a rotated border-corner rather than the `--chev` data URI: the URI has its colour
   baked in (one per theme), and this one needs to flip when the list opens. */
.ddchev{
  width:6px;height:6px;flex:none;margin-left:2px;
  border-right:1.6px solid var(--ink);border-bottom:1.6px solid var(--ink);
  transform:translateY(-2px) rotate(45deg);transition:transform .16s ease;
}
.ddbtn[aria-expanded="true"] .ddchev{transform:translateY(1px) rotate(-135deg)}
.ddlist{
  position:absolute;top:calc(100% + 6px);right:0;z-index:60;min-width:100%;
  padding:5px;background:var(--paper);border:1px solid var(--line-d);
  border-radius:14px;box-shadow:0 14px 34px rgba(0,0,0,.13);
  /* ⚠️ `outline:none` is safe **only** because the highlighted row is drawn by `.ddopt.on` —
     the list itself takes DOM focus so that screen readers follow `aria-activedescendant`. */
  outline:none;
}
.ddopt{
  padding:8px 13px;border-radius:10px;white-space:nowrap;cursor:pointer;
  font-size:12.5px;color:var(--ink);
}
/* ⚠️ Two different states, two different marks — they can be true at once:
   `.on` = where the keyboard is right now, `.sel` = what is actually chosen. */
.ddopt.on{background:var(--fill-a)}
.ddopt.sel{font-weight:700}
.ddopt.sel::after{content:"✓";margin-left:10px;color:var(--muted-d)}   /* 同上：--ink-3 不存在 */
/* ⚠️ Keyboard users must see where focus is. After `outline:none` a replacement is mandatory —
   a lime ring rather than the browser's default blue box, consistent with the palette. */
input:focus-visible,select:focus-visible,button:focus-visible,a:focus-visible{
  border-color:var(--ink);
  box-shadow:0 0 0 3px rgba(201,231,80,.55);
}
input:focus,select:focus{border-color:var(--ink)}

/* ── Scrollbars ────────────────────────────────────────────────────────
   ⚠️ The output gallery can hold tens of thousands of images and the log box scrolls too — the
      thick grey system scrollbar is jarring inside paper-white/paper-green cards. Make it thin,
      rounded, with generous breathing room.
   ⚠️ `background-clip:content-box` plus a transparent border leaves space either side of the thumb;
      without it a thin thumb hugging the edge just looks like a smudge. */
*{scrollbar-width:thin;scrollbar-color:var(--line-s) transparent}
::-webkit-scrollbar{width:11px;height:11px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{
  background:var(--line-s);border-radius:999px;
  border:3px solid transparent;background-clip:content-box;
}
::-webkit-scrollbar-thumb:hover{background:var(--muted);background-clip:content-box}
::-webkit-scrollbar-corner{background:transparent}
.field+.field{margin-top:14px}
/* ══════════════════════════════════════════════════════════════════════════
   ⚠️⚠️ **`--muted` does not have enough contrast; never use it for text meant to be read.**

   Measured (WCAG AA body text needs ≥4.5):
       v3 original   muted #9AA096 → 2.63    faint #B4B9AC → 1.97
       v3 Green      muted #7C9474 → 3.06    faint #9BB591 → 2.06
       mutedDark in both themes is 6.0+  ✓

   This flaw is in the v3 mockups themselves, not introduced by the theme (muted is used 28 times
   across the dashboard).

   **The fix is to change usage, not the palette** — not a single new colour was added, so the
   "the styling must stay identical" requirement is not violated:
       --muted    **decorative/redundant** text only: breadcrumbs, chart axis labels, labels that
                  repeat adjacent content
       --muted-d  everything **the customer needs to read**: form hints, secondary explanations,
                  status descriptions
       --faint    **never for body text**; placeholders and disabled states only
                  (both of which WCAG exempts)
   ══════════════════════════════════════════════════════════════════════════ */
.hint{font-size:11px;color:var(--muted-d);margin-top:6px;line-height:1.5}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;border:none;
  background:var(--lime);color:var(--ink);border-radius:999px;padding:14px 22px;
  font-size:14px;font-weight:800;font-family:var(--sans);cursor:pointer;transition:background .15s ease}
.btn:hover:not(:disabled){background:var(--lime-h)}
.btn:disabled{background:var(--fill);color:var(--faint);cursor:not-allowed}
.btn.dark{background:var(--ink);color:var(--paper);padding:11px 8px 11px 20px;font-size:13px;font-weight:700}
.btn.dark:hover{background:var(--ink-h)}
.btn.ghost{background:var(--white);border:1px solid var(--line-s);color:var(--ink);font-weight:700;font-size:13px;padding:11px 20px}
.btn.ghost:hover{border-color:var(--ink);background:var(--white)}
.pip{width:30px;height:30px;border-radius:50%;background:var(--lime);color:var(--ink);
  display:inline-flex;align-items:center;justify-content:center;font-size:13px}

/* ── The key back in ──────────────────────────────────────────────────────
   ⚠️⚠️ `Shell` renders this on **every** page (task #17). It used to be pasted into
      three pages by hand, so `start.html` — the page a returning customer actually
      lands on — had no way back in at all, and their batch was simply unreachable.
   ⚠️ Collapsed by default because an expanded password-looking field on the front
      door is noise on a first visit. Pages where money has already been spent
      (job / create / tiers) pass `keyOpen` and get the full card instead.
   ⚠️ Margin-top is generous on purpose: this sits **below** the page content and
      must not read as part of it. It is a utility, not a step in the flow. */
.keyslot{margin-top:34px}
/* ── Wallet sign-in (`web-react/src/WalletSession.jsx`) ────────────────
   ⚠️ Deliberately quiet: on a page where a batch is running, "who am I signed in as"
      is reference information, not the thing to look at. It only becomes loud when
      there is something to do (the button). */
.wsbox{background:var(--fill-a);border:1px solid var(--line);border-radius:16px;padding:13px 16px}
.wsrow{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.wsrow .mono{font-family:var(--mono);font-size:12.5px;color:var(--ink)}

/* ── Job payment (`web-react/src/create/PayGate.jsx`) ──────────────────
   ⚠️ Sits directly above the start button, so it must read as part of the same
      decision — same card language, not a separate banner. */
.paybox{background:var(--paper);border:1px solid var(--line-d);border-radius:16px;
  padding:14px 16px;margin:0 0 14px}
.payrow{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.payrow .mono{font-family:var(--mono);font-size:13.5px;font-weight:600;color:var(--ink)}
.keybar{display:flex;align-items:center;gap:11px;width:100%;text-align:left;
  background:var(--fill-c);border:1px dashed var(--line-d);border-radius:16px;
  padding:12px 16px;cursor:pointer;font-family:var(--sans);
  transition:border-color .15s ease,background .15s ease}
.keybar:hover{border-color:var(--lime-deep);background:var(--white)}
/* ⚠️ Keyboard focus must be visible here specifically: on six of the nine pages this
      strip is the **only** way back in, so a focus ring that cannot be seen locks
      keyboard users out of recovering their own batch. */
.keybar:focus-visible{outline:2px solid var(--lime-deep);outline-offset:2px}
.keybar-k{font-size:15px;color:var(--lime-deep);line-height:1}
/* ⚠️ `--muted-d`, not `--muted`: this line is meant to be read (see the contrast
      block above — `--muted` scores 2.63 against the 4.5 body threshold). */
.keybar-t{flex:1;min-width:0;font-size:12.5px;font-weight:600;color:var(--muted-d)}
.keybar-x{font-size:13px;color:var(--muted-d);line-height:1}
.drop{border:1.5px dashed var(--line-d);border-radius:18px;padding:38px 22px;text-align:center;
  cursor:pointer;transition:border-color .15s ease,background .15s ease}
.drop:hover,.drop.over{border-color:var(--lime-deep);background:var(--fill-c)}
.drop .big{font-size:34px;line-height:1;animation:v3-float 4.5s ease-in-out infinite;display:inline-block}
.mono{font-family:var(--mono);font-size:10px;letter-spacing:.1em;color:var(--muted);font-weight:600}
.chip{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:5px 11px;
  font-family:var(--mono);font-size:10.5px;font-weight:700}
.chip.ok{background:var(--lime-soft);color:var(--lime-text)}
.chip.warn{background:var(--warn-bg);color:var(--warn-t)}
.chip.err{background:var(--err-bg);color:var(--err-t)}
.issue{display:flex;gap:11px;padding:11px 13px;border-radius:14px;margin-top:9px;align-items:flex-start}
.issue.warn{background:var(--warn-bg);border:1px solid var(--warn-bd)}
.issue.error{background:var(--err-bg);border:1px solid var(--err-bd)}
.issue .t{font-size:12.5px;font-weight:700;line-height:1.4}
.issue .d{font-size:11.5px;line-height:1.5;margin-top:3px;opacity:.85}
.groups{display:flex;gap:9px;flex-wrap:wrap;margin-top:14px}
.grp{background:var(--fill-a);border-radius:14px;padding:11px 15px;min-width:96px}
.grp .n{font-size:22px;font-weight:800;line-height:1}
.grp .l{font-size:11px;color:var(--muted);margin-top:3px;font-weight:600}
.bar{height:10px;border-radius:999px;background:var(--fill);overflow:hidden;margin-top:12px}
.bar>i{display:block;height:100%;width:0;background:var(--lime);border-radius:999px;transition:width .3s ease}
.log{font-family:var(--mono);font-size:10.5px;line-height:1.75;color:var(--muted-d);
  background:var(--fill-c);border:1px solid var(--line);border-radius:14px;padding:13px 15px;
  margin-top:14px;max-height:190px;overflow:auto;white-space:pre-wrap}
.gal{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:12px;margin-top:16px}
.tile{background:var(--white);border:1px solid var(--line);border-radius:16px;padding:8px;
  transition:transform .15s ease,box-shadow .15s ease}
.tile:hover{transform:translateY(-3px);box-shadow:0 14px 28px rgba(var(--sh),.08)}
.tile img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:10px;display:block;background:var(--fill)}
.tile .cap{display:flex;justify-content:space-between;align-items:center;margin-top:7px;padding:0 3px}
.tile .id{font-family:var(--mono);font-size:10px;font-weight:600}
.hide{display:none!important}
.spin{display:inline-block;animation:v3-spin 1.1s linear infinite}
@media(max-width:900px){.grid{grid-template-columns:1fr}.wrap{padding:14px}.body{padding:22px 18px 34px}}

/* ⚠️⚠️ **The control group on the right of the top bar gets clipped on narrow screens.**
   `.top` itself is `flex-wrap:wrap`, but that right-hand group (theme / language / CONNECT) is a
   **nested flex** that neither wraps nor shrinks: at 375px the group is 366px wide, running from
   x=42 to 408 in a 375px viewport. **`.shell` is `overflow:hidden`, so there is no horizontal
   scrollbar; it simply clips the overflow** — 33px off the right of the CONNECT button, gone.
   And CONNECT is the **payment entry point**, so clipping it can block a sale outright.
   ⇒ Let that group wrap and shrink, and stack the top bar into two rows on narrow screens.
   (vanilla and React share this file, so one fix covers both.) */
.top > *{min-width:0}
.top > div{flex-wrap:wrap}
@media(max-width:560px){
  .top{flex-direction:column;align-items:flex-start;gap:12px;padding:16px 18px}
  .top > div{width:100%;justify-content:flex-start}
}
