/* UniCirc Workspace 2 — the original dark UniCirc look (black, warm-white ink, white pill main buttons, purple glow).
   Rules: one white main button per area; quiet neutrals elsewhere; 16 px text; 8 px spacing grid;
   big targets (44 px min, 52 px main buttons); related things sit close together inside one card.
   CLASS REFERENCE for screen files (prefer these; prefix any new class with your file prefix):
   Layout  .pb (page body, vertical rhythm) · .grp (group card with .grp-h title + .hint) · .card (.card.soft .card.warn .card.ok .card.accent)
           .cols (2 columns that stack on phones) · .cols3 · .stack (vertical gap) · .inline (row with wrap)
   Lists   ul.rows > li > a.row (made by WS.row) · .empty (WS.empty) · .kv (dl label/value) · .facts (3 big numbers, b + span + small)
   Status  .chip.ok|wait|info|bad|mute|accent · ol.steps (WS.steps) · ol.stages · .next (WS.nextBox) · .badge
   Forms   .fm (WS.form) · .fld (WS.field) · .chips · .pick (garment picker) · .sizes/.stepper · .fm-bar (sticky action bar) · .draft-note
   Other   .tw > table (table that scrolls inside itself) · table.sz (sizes table) · details.more · .done-panel (a finished moment: big check + summary)
           .term (word with "?") · .quote · .hint · .muted · .sr */
/* Colours = the original UniCirc site and Workspace (assets/style.css). Do not change them without the user's approval. */
:root {
  color-scheme: dark;
  --bg: #0a0a0b; --bg-2: #111113; --surface: #161618; --surface-2: #1d1d20; --sunk: #0e0e10;
  --ink: #f3f1ec; --ink-2: #bcb7af; --ink-3: #8a857e;
  --line: rgba(255, 255, 255, .16); --line-2: rgba(255, 255, 255, .09);
  --glow: #a99cff;
  --accent: #f3f1ec; --accent-2: #ffffff; --accent-ink: #0a0a0b; --accent-tint: rgba(255, 255, 255, .08);
  --ok: #8fd8ab; --ok-tint: rgba(143, 216, 171, .13); --wait: #f2cd7c; --wait-tint: rgba(242, 205, 124, .13); --info: #9cc4f0; --info-tint: rgba(156, 196, 240, .13); --bad: #f19a9a; --bad-tint: rgba(241, 154, 154, .12);
  --focus: #f3f1ec;
  --shadow: none;
  --sans: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "PingFang SC", monospace;
  --r: 20px; --top: 64px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html[data-lang="en"] [lang="zh"] { display: none !important; }
html[data-lang="zh"] [lang="en"] { display: none !important; }
html { background: var(--bg); }
body.ws2 { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: 12px; z-index: 90; }
.skip:not(:focus) { width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); padding: 0; border: 0; }
.ic { flex: none; }
.muted { color: var(--ink-2); }
.hint, .fh { color: var(--ink-2); font-size: 14.5px; }
.hint .ic { vertical-align: -4px; }
.mono, .id { font-family: var(--mono); font-size: .92em; letter-spacing: .01em; }

/* top bar */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; min-height: var(--top); padding: 8px 16px; background: rgba(10, 10, 11, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.brand { display: inline-flex; flex-direction: column; gap: 3px; text-decoration: none; margin-right: 6px; line-height: 1; }
.brand b { font: 300 21px/1 var(--mono); letter-spacing: .28em; }
.brand span { font: 500 9.5px/1 var(--mono); color: var(--glow); letter-spacing: .2em; text-transform: uppercase; }
html[data-lang="zh"] .brand span { letter-spacing: .1em; font-size: 12px; text-transform: none; }
.rb { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 14px 6px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; }
.rb:hover { border-color: var(--ink-3); }
.rb .ic { width: 24px; height: 24px; color: var(--glow); }
.rb-t { display: grid; line-height: 1.2; }
.rb-t small { font-size: 12px; color: var(--ink-3); }
.rb-t b { font-size: 15px; }
.rb-c { color: var(--ink-3); font-size: 12px; }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tb { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid transparent; background: transparent; cursor: pointer; text-decoration: none; color: var(--ink-2); }
.tb:hover:not(:disabled) { background: var(--surface); border-color: var(--line); color: var(--ink); }
.tb:disabled { opacity: .4; cursor: default; }
.tb .tl { font-size: 14px; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: #0a0a0b; font: 600 11px/20px var(--mono); text-align: center; font-style: normal; }
.tb .badge { position: absolute; top: 2px; right: 2px; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.lang button { border: 0; background: transparent; min-height: 44px; padding: 0 11px; border-radius: 999px; font: 500 12px/1 var(--mono); cursor: pointer; color: var(--ink-2); }
.lang button[aria-pressed="true"] { background: var(--ink); color: #0a0a0b; }
.storage-note { padding: 8px 16px; background: var(--wait-tint); color: var(--wait); font-size: 14px; }

/* layout: sidebar on desktop, tab bar on phones (the familiar app pattern) */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
body.noacc .shell { grid-template-columns: minmax(0, 1fr); }
body.noacc .nav { display: none; }
.nav { padding: 18px 12px; border-right: 1px solid var(--line-2); background: var(--sunk); }
.nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; position: sticky; top: calc(var(--top) + 16px); }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: 12px; text-decoration: none; color: var(--ink-2); font-size: 15.5px; }
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--glow); }
.nav .badge { margin-left: auto; }
.nav .nav-sep { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.main { padding: 24px 32px 120px; min-width: 0; max-width: 1080px; overflow-wrap: break-word; }
.main:focus { outline: none; }

/* page header: title left, the one main action right */
.ph { margin-bottom: 20px; display: grid; gap: 10px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink-2); text-decoration: none; font-size: 15px; justify-self: start; }
.back:hover { color: var(--ink); }
.ph-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; }
.ph-t { display: grid; gap: 6px; min-width: 0; }
.ph h1 { font: 700 clamp(24px, 2.6vw, 34px)/1.1 var(--mono); text-transform: uppercase; letter-spacing: -.01em; text-wrap: balance; }
html[data-lang="zh"] .ph h1 { font-family: var(--sans); text-transform: none; }
.ph h1:focus { outline: none; }
.ph-sub { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--ink-2); font-size: 15px; }
.ph-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ph-help { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); font-size: 15px; max-width: 70ch; }
.ph-help .ic { margin-top: 2px; color: var(--ink-3); }
.pb { display: grid; gap: 18px; }

/* buttons: primary = the only coloured one */
.bw { display: inline-flex; flex-direction: column; gap: 4px; }
.b { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 10px 22px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); text-decoration: none; font: 600 13.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .15s; white-space: nowrap; }
html[data-lang="zh"] .b { font-family: var(--sans); letter-spacing: .04em; font-size: 15px; text-transform: none; }
.b:hover { border-color: var(--ink); background: rgba(255, 255, 255, .06); }
.b:active { transform: translateY(0); }
.b.primary { background: var(--ink); border-color: var(--ink); color: #0a0a0b; }
.b.primary:hover { background: #fff; border-color: #fff; transform: translateY(-1px); }
.b.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.b.danger { background: var(--bad); border-color: var(--bad); color: #0a0a0b; }
.b.lg { min-height: 52px; padding: 0 26px; font-size: 14px; }
html[data-lang="zh"] .b.lg { font-size: 16px; }
.b.sm { min-height: 44px; padding: 0 16px; font-size: 12.5px; }
html[data-lang="zh"] .b.sm { font-size: 14px; }
.b:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.b .ic { width: 18px; height: 18px; }
.why { font-size: 13px; color: var(--ink-3); max-width: 28ch; white-space: normal; }
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-l { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; display: grid; gap: 4px; padding: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
.menu-l .b { justify-content: flex-start; width: 100%; }
/* a long "Switch to … and do it" in the Next step box wraps on a phone instead of spilling out of its button */
.next .b { white-space: normal; text-align: center; }
/* a menu whose button starts a wrapped row (phones) hangs from the left edge instead, and never gets wider than the screen */
.menu-l.menu-l-start { left: 0; right: auto; }
.menu-l { max-width: calc(100vw - 32px); }

/* groups and cards (things that belong together sit together) */
.grp { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 20px 22px; display: grid; gap: 14px; min-width: 0; }
.grp-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.grp-h h2 { font: 500 12px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
html[data-lang="zh"] .grp-h h2 { font-family: var(--sans); letter-spacing: .04em; font-size: 14px; text-transform: none; }
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 16px 18px; display: grid; gap: 8px; min-width: 0; }
.card.soft { background: var(--sunk); }
.card.accent { background: rgba(169, 156, 255, .08); border-color: rgba(169, 156, 255, .45); }
.card.ok { background: var(--ok-tint); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.card.warn { background: var(--wait-tint); border-color: color-mix(in srgb, var(--wait) 30%, transparent); }
.card.bad { background: var(--bad-tint); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stack { display: grid; gap: 12px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
dl.kv { margin: 0; display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 10px 18px; }
dl.kv dt { color: var(--ink-3); }
dl.kv dd { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.facts > div { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 16px; display: grid; gap: 4px; }
.facts b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.facts span { color: var(--ink-2); font-size: 14.5px; }
.facts small { color: var(--ink-3); font-size: 13px; }

/* chips: a word and a dot */
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap; background: var(--sunk); color: var(--ink-2); font-style: normal; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip.ok { background: var(--ok-tint); color: var(--ok); }
.chip.wait { background: var(--wait-tint); color: var(--wait); }
.chip.info { background: var(--info-tint); color: var(--info); }
.chip.bad { background: var(--bad-tint); color: var(--bad); }
.chip.accent { background: rgba(169, 156, 255, .12); color: var(--glow); }

/* lists */
ul.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
a.row { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; gap: 14px; align-items: center; min-height: 64px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; text-decoration: none; }
a.row:hover { border-color: var(--ink-3); }
.row-main { display: grid; gap: 2px; min-width: 0; }
.row-t { font-weight: 600; }
.row-s { color: var(--ink-2); font-size: 14.5px; }
.row-side { display: grid; justify-items: end; gap: 4px; }
/* a long status ("At the recycling department · next: remove trims (buttons, zips, labels, logos)") wraps inside at most half
   the row, so the row's own title keeps its room on every width (phones put the side part under the title, see below) */
a.row { grid-template-columns: minmax(0, 1fr) fit-content(50%) 18px; }
.row-side { min-width: 0; }
.row-side .chip { white-space: normal; }
.row-side small { color: var(--ink-3); font-size: 13px; }
.chev { color: var(--ink-3); font-size: 22px; line-height: 1; }
.empty { display: grid; justify-items: center; gap: 12px; padding: 32px 16px; text-align: center; color: var(--ink-2); border: 1px dashed var(--line); border-radius: 14px; background: var(--surface-2); }
.empty .ic { width: 32px; height: 32px; color: var(--ink-3); }

/* steps: numbered, labelled, the current one in the accent colour */
ol.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; counter-reset: s; }
ol.steps li { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 13.5px; color: var(--ink-3); padding-top: 2px; }
ol.steps li::before { content: ""; position: absolute; top: 17px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 2px; background: var(--line); }
ol.steps li:first-child::before { display: none; }
ol.steps li.done::before, ol.steps li.now::before { background: var(--ok); }
ol.steps .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); font-weight: 700; font-size: 14px; position: relative; z-index: 1; }
ol.steps li.done { color: var(--ok); }
ol.steps li.done .n { background: var(--ok); border-color: var(--ok); color: #0a0a0b; }
ol.steps li.now { color: var(--ink); font-weight: 700; }
ol.steps li.now .n { background: var(--ink); border-color: var(--ink); color: #0a0a0b; box-shadow: 0 0 0 5px rgba(169, 156, 255, .25); }
.steps-cap { font-weight: 600; color: var(--ink-2); font-size: 15px; }
ol.stages { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
ol.stages li { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; color: var(--ink-3); }
ol.stages li.done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-tint); }
ol.stages li.now { color: var(--ink); border-color: var(--glow); font-weight: 600; }
ol.stages small { color: var(--ink-3); font-weight: 400; }
.next { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 0 14px 14px 0; background: rgba(169, 156, 255, .07); border-left: 3px solid var(--glow); }
.next-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--glow); border: 1px solid var(--line); }
.next-t { display: grid; gap: 2px; }
.next-t small { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
html[data-lang="zh"] .next-t small { letter-spacing: .04em; }
.next-t span { color: var(--ink-2); font-size: 14.5px; }
.next-t .org, .m-who .org { color: var(--ink-3); }

/* words with an explanation */
.term { display: inline-flex; align-items: center; gap: 5px; padding: 10px 0; margin-block: -10px; border: 0; background: none; cursor: help; font: inherit; color: inherit; text-decoration: underline dotted var(--ink-3); text-underline-offset: 3px; }
.term .q { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--ink-3); font-size: 11px; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.pop { position: absolute; z-index: 80; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); display: grid; gap: 6px; font-size: 14.5px; }
.pop a { color: inherit; font-size: 13.5px; }

/* forms: big fields, related fields together, errors next to the field */
.fm { display: grid; gap: 18px; }
.fld { display: grid; gap: 8px; min-width: 0; }
.fld .lab { font-weight: 600; font-size: 15.5px; }
.fld .req { color: var(--bad); }
.fld input:not([type=radio]):not([type=checkbox]), .fld select, .fld textarea { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; }
.fld textarea { min-height: 96px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.fld.bad input:not([type=radio]), .fld.bad select, .fld.bad textarea, .fld.bad .chips label > span, .fld.bad .pick label > span, .fld.bad .stepper { border-color: var(--bad); }
.err { color: var(--bad); font-size: 14.5px; font-weight: 600; }
.chips, .pick { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label, .pick label { position: relative; display: inline-flex; }
.chips input, .pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chips label > span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 15px; cursor: pointer; }
.chips label > span small { display: none; }
.pick label > span { display: grid; gap: 2px; min-width: 200px; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; }
.pick label > span small { color: var(--ink-3); font-size: 13.5px; }
.chips input:checked + span { background: var(--ink); color: #0a0a0b; border-color: var(--ink); }
.pick input:checked + span { border-color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ink); }
.chips input:checked + span small { color: #0a0a0b; }
.chips input:focus-visible + span, .pick input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.sizes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.st { display: grid; gap: 6px; }
.st label { font-weight: 700; font-size: 15px; }
.st label small { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.stepper { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.stepper input { min-height: 46px !important; border: 0 !important; border-radius: 0 !important; text-align: center; font-size: 18px !important; font-weight: 700; font-variant-numeric: tabular-nums; padding: 0 !important; -moz-appearance: textfield; box-shadow: none !important; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper:focus-within { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 1px; }
.sb { min-height: 46px; border: 0; background: var(--sunk); font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink); }
.sb:hover { background: var(--line-2); }
.sizes-sum { grid-column: 1 / -1; font-weight: 600; color: var(--ink-2); }
.fm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.fm-msg { margin-right: auto; color: var(--bad); font-weight: 600; }
.draft-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border-radius: 14px; background: var(--info-tint); color: var(--info); font-size: 14.5px; }
.draft-st { color: var(--ink-3); font-size: 13.5px; text-align: right; }

/* tables */
.tw { max-width: 100%; overflow-x: auto; }
table.sz, table.t { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.sz th, table.sz td, table.t th, table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); text-align: center; }
table.sz thead th, table.t thead th { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }
table.sz tbody th, table.t tbody th { text-align: left; font-weight: 600; }
table.t td { text-align: left; }
table.sz .sum { font-weight: 700; }
table.sz .z { color: var(--ink-3); opacity: .6; }
table.sz tr.tot th, table.sz tr.tot td { border-top: 2px solid var(--line); border-bottom: 0; font-weight: 700; }

/* more (shown when needed) */
details.more { border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); }
details.more > summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; padding: 0 16px; font-weight: 600; color: var(--ink-2); }
details.more[open] > summary { border-bottom: 1px solid var(--line-2); }
details.more > :not(summary) { margin: 14px 16px; }

/* messages */
ol.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.m { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); }
.m.auto { background: transparent; border-style: dashed; color: var(--ink-2); }
.m.question { border-color: color-mix(in srgb, var(--wait) 40%, transparent); }
.m.answer { margin-left: 24px; border-left: 3px solid var(--ok); }
.m-h { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13.5px; color: var(--ink-3); }
.m-who { font-weight: 600; color: var(--ink-2); }
.m-h time { margin-left: auto; }
.m .re { font-size: 13px; color: var(--ink-3); }
.m .bw { justify-self: start; }
.typed { white-space: pre-wrap; }
.quote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--wait); background: var(--sunk); border-radius: 0 10px 10px 0; }

/* the finished moment */
.done-panel { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 28px 20px; border-radius: 20px; background: var(--ok-tint); border: 1px solid rgba(143, 216, 171, .4); }
.done-panel .big-check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #0a0a0b; }
.done-panel .big-check .ic { width: 34px; height: 34px; stroke-width: 2.4; }
.done-panel h2 { font: 700 22px/1.2 var(--mono); text-transform: uppercase; }
html[data-lang="zh"] .done-panel h2 { font-family: var(--sans); text-transform: none; }
.done-panel p { color: var(--ink-2); max-width: 46ch; }

/* dialog */
#ws-dialog[hidden] { display: none; }
.dlg-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6); }
.dlg { position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.dlg:focus { outline: none; }
.dlg-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 4px; }
.dlg-h h2 { font: 700 18px/1.2 var(--mono); text-transform: uppercase; }
.dlg-h h2 .nw { white-space: nowrap; }
html[data-lang="zh"] .dlg-h h2 { font-family: var(--sans); text-transform: none; }
.dlg .x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; font-size: 22px; cursor: pointer; }
.dlg-b { padding: 12px 20px; display: grid; gap: 16px; }
.dlg-err { color: var(--bad); font-weight: 600; }
.dlg-bar { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 12px 20px 20px; }
body.dlg-on { overflow: hidden; }
.rcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.rc { position: relative; display: flex; }
.rc input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.rc > span { display: grid; gap: 6px; align-content: start; width: 100%; padding: 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface-2); cursor: pointer; }
.rc > span .ic { width: 28px; height: 28px; color: var(--glow); }
.rc b { font-size: 16px; }
.rc small { color: var(--ink-2); font-size: 13.5px; }
.rc em { justify-self: start; }
.rc input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface-2); }
.rc input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* toast */
.toast { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translate(-50%, 16px); display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(620px, calc(100vw - 24px)); padding: 10px 10px 10px 16px; border-radius: 16px; background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast .ic { color: var(--bg); }
.toast .b.ghost { color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }
.toast .b.ghost:hover { background: color-mix(in srgb, var(--bg) 12%, transparent); color: var(--bg); }

/* tour */
.tour { position: fixed; inset: 0; z-index: 85; }
.tour-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .65); border: 2px solid var(--glow); pointer-events: none; }
.tour-card { position: fixed; display: grid; gap: 10px; padding: 18px; border-radius: 18px; background: var(--surface); box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.tour-card h2 { font-size: 18px; }
.tour-card p { color: var(--ink-2); }
.tour-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-bar span { color: var(--ink-3); font-size: 14px; }

.err-box { white-space: pre-wrap; color: var(--bad); font-size: 12px; }

/* phones: tab bar at the bottom (thumb zone), main action stays reachable */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: rgba(14, 14, 16, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .nav ul { position: static; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; }
  .nav a { flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 4px 2px; font-size: 11.5px; text-align: center; position: relative; }
  .nav a[aria-current="page"] { box-shadow: inset 0 2px 0 var(--glow); }
  .nav .nl { line-height: 1.15; }
  .nav .badge { position: absolute; top: 4px; right: calc(50% - 22px); margin: 0; }
  .nav .nav-sep { display: none; }
  .main { padding: 16px 16px 150px; }
  .top { padding: 8px 12px; gap: 6px; flex-wrap: wrap; }
  .top .tl, .brand span { display: none; }
  .rb { min-height: 44px; padding: 4px 10px 4px 8px; }
  .ph-act.has-primary .b.primary.lg:not(:disabled) { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 35; box-shadow: 0 10px 24px rgba(0, 0, 0, .18); }
  .pb > .fm > .fm-bar { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 5; padding: 10px 0; background: linear-gradient(transparent, var(--bg) 30%); }
  .pb > .fm > .fm-bar .b.primary { flex: 1 1 auto; }
  .grp .fm-bar { position: static; background: none; }
  .cols, .cols3, .facts { grid-template-columns: minmax(0, 1fr); }
  .sizes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dl.kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  dl.kv dd { margin-bottom: 10px; }
  .next { grid-template-columns: auto minmax(0, 1fr); }
  .next > .bw { grid-column: 1 / -1; }
  ol.steps { grid-auto-flow: row; grid-auto-columns: auto; gap: 0; }
  ol.steps li { grid-template-columns: 32px minmax(0, 1fr); justify-items: start; text-align: left; align-items: center; gap: 12px; padding: 4px 0; }
  ol.steps li::before { top: auto; bottom: calc(50% + 16px); left: 15px; right: auto; width: 2px; height: 16px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  body:has(.ph-act.has-primary .b.primary.lg:not(:disabled)) .toast { bottom: calc(140px + env(safe-area-inset-bottom)); }
  .grp { padding: 16px; }
  a.row { grid-template-columns: minmax(0, 1fr) 14px; }
  .row-side { grid-column: 1; grid-row: 2; justify-items: start; grid-auto-flow: column; justify-content: start; gap: 8px; align-items: center; }
  .pick label > span { min-width: 0; }
  .pick, .pick label { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print {
  .top, .nav, .toast, .fm, .ph-act, .skip { display: none !important; }
  body.ws2 { background: #fff; }
  .shell { display: block; }
}
.lang button { white-space: nowrap; }
/* phones: only the essentials in the top bar (Redo stays in each message; the public site is linked from Settings) */
@media (max-width: 860px) { #ws-redo, .top-r > a[href="index.html"] { display: none; } }
