/* ============================================================
   PrometheX Partner Onboarding Portal — design system
   Light-primary OpenShip-style shell. Fully self-contained:
   system font stack only, no @import / CDN / analytics / webfonts.
   Light is the default (:root); dark is an opt-in override on
   html[data-theme="dark"]. Bilingual via html[data-lang].
   Shared by index.html (intake) and status.html.
   ============================================================ */

:root {
  --bg:          #f6f6f7;
  --surface:     #ffffff;
  --surface-2:   #fbfbfc;
  --chip:        #f1f1f3;   /* small neutral fills: idx, seg, tags */
  --ink:         #17171a;
  --ink-2:       #52525b;
  --ink-3:       #6b6b74;   /* WCAG AA: 5.28:1 on --surface #ffffff */
  --line:        #ececee;
  --line-2:      #e2e2e6;
  --line-strong: #c9c9d0;

  --accent:      #d98207;   /* funding gate amber */
  --accent-tint: #fffaf0;
  --accent-fill: #fbe6bf;   /* amber chip fill */
  --accent-ink:  #9a5804;
  --accent-line: #f0cd8f;

  --live:        #16a34a;    /* SSL / live green */
  --live-dot:    #22c55e;
  --live-tint:   #eefcf3;
  --live-line:   #c6f0d5;

  --cta:         #17171a;    /* dark CTA button */
  --cta-hover:   #000000;
  --cta-ink:     #ffffff;

  --r-card: 15px;
  --r-tile: 12px;
  --r-ctl:  10px;
  --r-pill: 999px;

  --space-md:  16px;
  --space-lg:  20px;
  --space-xl:  24px;
  --space-2xl: 32px;

  --sh-1: 0 1px 2px rgba(24,24,27,.04), 0 1px 3px rgba(24,24,27,.05);
  --sh-2: 0 4px 16px rgba(24,24,27,.06), 0 1px 3px rgba(24,24,27,.05);
  --sh-modal: 0 24px 64px rgba(24,24,27,.24);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --bg:          #0b0b0e;
  --surface:     #141419;
  --surface-2:   #1a1a20;
  --chip:        rgba(255,255,255,.07);
  --ink:         #ededf2;
  --ink-2:       #a6a6b2;
  --ink-3:       #8b8b98;   /* WCAG AA: 5.46:1 on --surface #141419 */
  --line:        rgba(255,255,255,.08);
  --line-2:      rgba(255,255,255,.13);
  --line-strong: rgba(255,255,255,.22);

  --accent:      #f5b544;
  --accent-tint: rgba(245,181,68,.10);
  --accent-fill: rgba(245,181,68,.22);
  --accent-ink:  #f5c877;
  --accent-line: rgba(245,181,68,.42);

  --live:        #4ade80;
  --live-dot:    #22c55e;
  --live-tint:   rgba(74,222,128,.12);
  --live-line:   rgba(74,222,128,.34);

  --cta:         #ededf2;    /* inverts to a light button on dark bg */
  --cta-hover:   #ffffff;
  --cta-ink:     #141419;

  --sh-1: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.4);
  --sh-2: 0 4px 18px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.4);
  --sh-modal: 0 24px 64px rgba(0,0,0,.6);
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
html, body { padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent-tint); }

/* bilingual span visibility */
html[data-lang="en"] .lang-zh { display: none !important; }
html[data-lang="zh"] .lang-en { display: none !important; }

/* screen-reader-only / visually hidden native inputs */
.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============================================================
   App shell : 3 columns
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr) 352px;
  min-height: 100vh;
  max-width: 1480px;
  margin: 0 auto;
}

/* ============ left sidebar ============ */
.side {
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 18px;
}
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: var(--ink); color: var(--surface);
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px; letter-spacing: -.03em;
}
.brand .wm { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand .wm b { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.brand .wm .sub { font-size: 11px; color: var(--ink-3); }

.nav-group { margin-top: 4px; }
.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 12px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: var(--r-ctl);
  color: var(--ink-2); font-size: 13px; font-weight: 500;
  text-decoration: none; position: relative; user-select: none;
  border: 0; background: none; width: 100%; text-align: left;
  cursor: pointer;
}
.nav-item svg { flex: none; opacity: .8; }
.nav-item .nl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { background: var(--surface-2); text-decoration: none; }
.nav-item.active {
  background: var(--chip); color: var(--ink); font-weight: 600;
}
.nav-item.active svg { opacity: 1; }

/* funding gate dot + done tick */
.nav-item .dot {
  margin-left: auto; width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint);
}
.nav-item .tick { margin-left: auto; color: var(--live); display: none; flex: none; }
.nav-item.done .dot { display: none; }
.nav-item.done .tick { display: inline-flex; }

.side .foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex; gap: 8px;
}
.foot-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 10px; border-radius: var(--r-ctl);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  font-size: 12px; font-weight: 600;
  transition: border-color .12s, color .12s, background .12s;
}
.foot-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.foot-btn .ico-sun, .foot-btn .ico-moon { display: none; }
html[data-theme="dark"] .foot-btn .ico-sun { display: block; }
html[data-theme="light"] .foot-btn .ico-moon { display: block; }

/* account chip */
.ws {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--r-ctl);
  background: var(--surface-2); border: 1px solid var(--line);
  margin-bottom: 4px;
}
.ws .av {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
}
.ws .meta { line-height: 1.25; min-width: 0; display: flex; flex-direction: column; }
.ws .meta b {
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
.ws .meta .role { font-size: 11px; color: var(--ink-3); }

/* ============ center main ============ */
.main { padding: 26px 34px 72px; min-width: 0; }
.main-head { margin-bottom: var(--space-xl); }
.crumbs {
  font-size: 12px; color: var(--ink-3);
  display: flex; align-items: center; gap: 7px; margin-bottom: 10px;
}
.crumbs b { color: var(--ink-2); font-weight: 500; }
.main-head h1 {
  font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 5px;
  text-wrap: balance;
}
.main-head p { margin: 0; color: var(--ink-2); font-size: 13.5px; max-width: 60ch; text-wrap: pretty; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--sh-1);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-lg);
  scroll-margin-top: 20px;
}
.card-head { margin-bottom: var(--space-lg); }
.card-head .row { display: flex; align-items: flex-start; gap: 11px; }
.card-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -.015em; margin: 0; }
.card-head .sub { display: none; } /* per-card explanatory subtitles removed (reduce-text) */
.card-head .htext { min-width: 0; }
.idx {
  width: 22px; height: 22px; border-radius: 7px; flex: none; margin-top: 1px;
  background: var(--chip); color: var(--ink-2);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
}
.idx.gate { background: var(--accent-fill); color: var(--accent-ink); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  padding: 3px 9px; border-radius: var(--r-pill);
  margin-left: auto; white-space: nowrap; flex: none; margin-top: 1px;
}
.badge.soft { background: var(--chip); color: var(--ink-3); }
.badge.note { background: var(--live-tint); color: var(--live); border: 1px solid var(--live-line); }
.badge.gate { background: var(--accent-tint); color: var(--accent-ink); border: 1px solid var(--accent-line); }
.badge .b-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* ============ form fields ============ */
.field { margin-top: 14px; }
.field > label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px;
}
.field .opt { color: var(--ink-3); font-weight: 500; margin-left: 6px; }
/* field hints are explanatory, not load-bearing — keep them out of the way
   until the field is actually being used, then reveal on focus. */
.field .hint { display: none; font-size: 11.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.5; }
.field:not(.two):focus-within .hint { display: block; }
.field.two > div:focus-within .hint { display: block; } /* reveal only the focused sub-field's hint */

/* term tooltip — zero-dependency, keyboard-reachable via title + aria-label */
.info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  background: var(--chip); color: var(--ink-3);
  font-size: 10px; font-style: normal; font-weight: 700; line-height: 1;
  cursor: help; vertical-align: middle; margin-left: 2px;
}
.info:hover, .info:focus-visible { background: var(--line-strong); color: var(--ink); }
.info:focus-visible { outline: 2px solid var(--ink-3); outline-offset: 2px; }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input[type="text"], input[type="date"], input[type="url"], input[type="email"], textarea {
  width: 100%; font-family: var(--font); font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  padding: 9px 12px; transition: border-color .12s, box-shadow .12s;
}
input[type="date"] { color-scheme: light; }
html[data-theme="dark"] input[type="date"] { color-scheme: dark; }
input:focus, textarea:focus { outline: none; border-color: var(--line-strong); }
input:focus-visible, textarea:focus-visible {
  border-color: var(--ink-3); box-shadow: 0 0 0 3px var(--chip);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
textarea { resize: vertical; min-height: 70px; line-height: 1.55; }

/* ============ currency option grid ============ */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.opt {
  text-align: left; border: 1.5px solid var(--line-2);
  background: var(--surface); border-radius: var(--r-tile);
  padding: 13px 14px; position: relative; transition: border-color .12s, background .12s;
  cursor: pointer; color: inherit;
}
.opt:hover { border-color: var(--line-strong); box-shadow: var(--sh-1); }
.opt.on { border-color: var(--ink); background: var(--surface-2); box-shadow: var(--sh-1); }
.opt .oi {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--chip); display: grid; place-items: center;
  margin-bottom: 10px; color: var(--ink);
}
.opt.on .oi { background: var(--ink); color: var(--surface); }
.opt .ot { font-size: 13px; font-weight: 620; letter-spacing: -.01em; }
.opt .od { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.opt .chk {
  position: absolute; top: 11px; right: 11px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--ink); color: var(--surface);
  display: grid; place-items: center; opacity: 0; transform: scale(.6);
  transition: opacity .12s, transform .12s;
}
.opt.on .chk { opacity: 1; transform: scale(1); }

/* ============ funding gate card ============ */
.card.gate {
  border: 1.5px solid var(--accent-line);
  background: linear-gradient(180deg, var(--accent-tint), var(--surface) 78px);
}
.ro-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ro-grid.mt { margin-top: 10px; }
.tile {
  border: 1px solid var(--line-2); border-radius: var(--r-tile);
  background: var(--surface); padding: 12px 14px; min-width: 0;
}
.tile .k {
  font-size: 11px; color: var(--ink-3); font-weight: 550;
  display: flex; align-items: center; gap: 6px; margin-bottom: 5px;
}
.tile .k .pill {
  font-size: 9.5px; font-weight: 700; letter-spacing: .03em;
  padding: 1px 6px; border-radius: var(--r-pill);
  background: var(--chip); color: var(--ink-3);
}
.tile .v { font-size: 13px; font-weight: 600; font-family: var(--mono); word-break: break-all; }
.tile .v.await { font-family: var(--font); font-weight: 500; color: var(--ink-3); font-style: italic; }

.fund-note { font-size: 11.5px; color: var(--ink-3); margin: 12px 0 0; }

/* check-tiles (funding confirm + acknowledgements) */
.check-tile {
  display: flex; gap: 11px; align-items: flex-start;
  margin-top: 12px; padding: 13px 15px;
  border: 1px solid var(--line-2); border-radius: var(--r-tile);
  background: var(--surface-2); cursor: pointer; user-select: none;
  transition: border-color .12s;
}
.check-tile:hover { border-color: var(--line-strong); box-shadow: var(--sh-1); }
.check-tile.gate { border-color: var(--accent-line); background: var(--accent-tint); }
.cbx {
  width: 19px; height: 19px; flex: none; margin-top: 1px;
  border: 1.5px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); display: grid; place-items: center;
  color: #fff; transition: background .12s, border-color .12s;
}
.cbx svg { opacity: 0; transition: opacity .1s; }
.check-tile.on .cbx { background: var(--live); border-color: var(--live); }
.check-tile.on .cbx svg { opacity: 1; }
.check-tile .ct b { font-size: 13px; font-weight: 600; display: block; }
.check-tile .ct small { font-size: 12px; color: var(--ink-2); line-height: 1.5; display: block; margin-top: 2px; }

/* not-applicable toggle (token / identity) */
.na-row { display: flex; align-items: center; gap: 9px; }
.na-row input { width: 16px; height: 16px; accent-color: var(--ink); cursor: pointer; flex: none; }
.na-row label { font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.na-collapse { transition: opacity .15s; }
.card.is-na .na-collapse { opacity: .4; pointer-events: none; }

/* ============ domain live preview ============ */
.dom-live {
  display: flex; align-items: center; gap: 9px;
  margin-top: 14px; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-tile);
  background: var(--surface-2);
}
.dom-live svg { flex: none; color: var(--ink-3); }
.dom-live .url { font-family: var(--mono); font-size: 13px; font-weight: 600; word-break: break-all; }
.dom-live .url.await { color: var(--ink-3); font-style: italic; font-weight: 500; }
.dom-live .ssl {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--live); white-space: nowrap; flex: none;
}
.dom-live .ssl.muted { color: var(--ink-3); }
.dom-live .ssl .g {
  width: 7px; height: 7px; border-radius: 50%; background: var(--live-dot);
  box-shadow: 0 0 0 3px rgba(34,197,94,.16);
}
.field-note { font-size: 11.5px; color: var(--ink-3); margin: 10px 0 0; line-height: 1.5; }

/* ============ markets mini table ============ */
.mkt-tbl { border: 1px solid var(--line-2); border-radius: var(--r-tile); overflow: hidden; }
.mkt-head, .mkt-row { display: grid; grid-template-columns: 1fr 180px 40px; }
.mkt-head > span {
  padding: 9px 12px; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
}
.mkt-row { border-bottom: 1px solid var(--line-2); }
.mkt-row:last-child { border-bottom: 0; }
.mkt-row input { border: 0; border-radius: 0; background: none; }
.mkt-row input:focus { background: var(--surface-2); box-shadow: none; }
.mkt-row .cell-b { border-left: 1px solid var(--line-2); }
.mkt-del {
  min-width: 40px; min-height: 40px;
  border: 0; background: none; color: var(--ink-3); font-size: 17px; line-height: 1;
  border-left: 1px solid var(--line-2); transition: color .12s;
  display: grid; place-items: center;
}
.mkt-del:hover { color: var(--accent); }
.mkt-add {
  margin-top: 12px; display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 1px dashed var(--line-strong); border-radius: var(--r-ctl);
  color: var(--ink-2); font-size: 12.5px; font-weight: 600; padding: 8px 14px;
  transition: border-color .12s, color .12s;
}
.mkt-add:hover { border-color: var(--ink-3); color: var(--ink); }
.mkt-add:disabled { opacity: .45; cursor: not-allowed; }

/* ============ right summary panel ============ */
.aside {
  border-left: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.sum-head { padding: var(--space-xl) var(--space-xl) var(--space-md); }
.sum-head h3 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.sum-head p { margin: 3px 0 0; font-size: 12px; color: var(--ink-3); }

/* prefill-load failure notice (?c=<slug> fetch 404/parse error) */
.sum-alert {
  margin: 0 var(--space-xl) var(--space-md);
  padding: 8px 10px; font-size: 12px; line-height: 1.5;
  color: var(--accent-ink); background: var(--accent-tint);
  border: 1px solid var(--accent-line); border-radius: var(--r-ctl);
}

.sum-body { padding: 0 var(--space-xl); overflow-y: auto; flex: 1; }
.srow {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 0; border-top: 1px solid var(--line);
}
.srow:first-child { border-top: 0; }
.srow .sk {
  font-size: 12px; color: var(--ink-3); font-weight: 550;
  width: 78px; flex: none; padding-top: 1px;
}
.srow .sk .lang-zh, .srow .sk .lang-en { display: inline; }
.srow .sv { font-size: 12.5px; color: var(--ink); font-weight: 600; min-width: 0; }
.srow .sv .muted { color: var(--ink-3); font-weight: 500; font-style: italic; }
.srow .sv .mono { font-family: var(--mono); font-size: 11px; overflow-wrap: anywhere; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: var(--r-pill);
  background: var(--chip); color: var(--ink-2); margin: 3px 4px 0 0;
}
.tag.g { background: var(--live-tint); color: var(--live); }
.tag .g { width: 6px; height: 6px; border-radius: 50%; background: var(--live-dot); }
.conf { display: flex; flex-direction: column; gap: 6px; }
.conf .ci { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.conf .ci .m {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: #fff;
}
.conf .ci .m svg { opacity: 0; }
.conf .ci.ok .m { background: var(--live); border-color: var(--live); }
.conf .ci.ok .m svg { opacity: 1; }
.conf .ci .lbl { color: var(--ink-2); }

.sum-cta { padding: var(--space-lg) var(--space-xl) var(--space-xl); border-top: 1px solid var(--line); }
.cta-gate {
  display: flex; align-items: center; gap: 7px; justify-content: center;
  font-size: 11.5px; color: var(--accent-ink); margin: 0 0 11px;
  background: var(--accent-tint); border: 1px solid var(--accent-line);
  border-radius: var(--r-pill); padding: 6px 10px; font-weight: 550; text-align: center;
}
.cta-gate.clear { color: var(--live); background: var(--live-tint); border-color: var(--live-line); }
.btn-cta {
  width: 100%; border: 0; border-radius: 12px;
  background: var(--cta); color: var(--cta-ink);
  padding: 13px 16px; font-size: 14px; font-weight: 620;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: var(--sh-2); transition: background .12s, transform .06s;
}
.btn-cta:hover { background: var(--cta-hover); }
.btn-cta:active { transform: translateY(1px); }
.cta-alt { text-align: center; font-size: 11.5px; color: var(--ink-3); margin: 11px 0 0; }
.cta-alt button {
  color: var(--ink-2); background: none; border: 0; padding: 0;
  text-decoration: underline; text-underline-offset: 2px; font-size: inherit;
}
.cta-alt button:hover { color: var(--ink); }

/* mobile-only sticky bottom CTA bar — hidden on desktop, shown by the
   960px breakpoint below. Its button just triggers #btn-send. */
.mobile-cta {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(24,24,27,.10);
}
.mobile-cta .btn-cta { margin: 0; }

/* ============ summary sheet (modal) ============ */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(24,24,27,.42);
  display: none; place-items: center; padding: 24px;
}
.sheet-backdrop.open { display: grid; }
.sheet {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; width: min(580px, 100%); max-height: 86vh;
  display: flex; flex-direction: column; box-shadow: var(--sh-modal);
}
.sheet-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.sheet-head h3 { font-size: 14px; font-weight: 650; margin: 0; }
.sheet-head p { font-size: 11.5px; color: var(--ink-3); margin: 2px 0 0; }
.sheet-x {
  margin-left: auto; flex: none; width: 30px; height: 30px; border-radius: 8px;
  border: 0; background: none; color: var(--ink-3); display: grid; place-items: center;
}
.sheet-x:hover { background: var(--chip); color: var(--ink); }
.sheet-body { padding: 16px 18px; overflow-y: auto; }
.sheet-note { font-size: 12px; color: var(--ink-2); margin: 0 0 10px; line-height: 1.5; }
.sheet pre {
  margin: 0; padding: 16px; border-radius: var(--r-tile);
  background: var(--surface-2); border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 12px; line-height: 1.7; color: var(--ink);
  white-space: pre-wrap; word-break: break-word; overflow-x: auto;
}
.sheet-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-top: 1px solid var(--line);
}
.sheet-foot .hint { font-size: 11px; color: var(--ink-3); margin-right: auto; max-width: 24ch; line-height: 1.4; }
.sb-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--ink-2);
  font-size: 12.5px; font-weight: 600; padding: 9px 14px;
  transition: border-color .12s, color .12s, background .12s;
}
.sb-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.sb-btn.ok { color: var(--live); border-color: var(--live-line); background: var(--live-tint); }
.sb-btn.primary { background: var(--cta); color: var(--cta-ink); border-color: transparent; }
.sb-btn.primary:hover { background: var(--cta-hover); }

/* ============================================================
   Status page (status.html)
   ============================================================ */
.status-shell { max-width: 620px; margin: 0 auto; padding: 30px 24px 80px; }
.status-topbar {
  max-width: 620px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; gap: 12px;
}
.status-topbar .spacer { flex: 1; }
.status-topbar .brand { padding: 0; }
.status-topbar .foot-btn { flex: none; min-width: 74px; }
.status-head { margin-bottom: 22px; }
.status-head .crumbs { margin-bottom: 8px; }
.status-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0; }

.status-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 24px 24px 22px; box-shadow: var(--sh-1);
}
.status-client { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 3px; }
.status-updated { font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); margin-bottom: 22px; }
.tracker { list-style: none; padding: 0; margin: 0; }
.tk { display: flex; align-items: flex-start; gap: 14px; position: relative; padding-bottom: 20px; }
.tk:last-child { padding-bottom: 0; }
.tk:not(:last-child)::after {
  content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line-2);
}
.tk.done:not(:last-child)::after { background: var(--live); }
.tk .node {
  width: 27px; height: 27px; border-radius: 50%; flex: none; z-index: 1;
  display: grid; place-items: center; font-family: var(--mono); font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink-3);
}
.tk.done .node { background: var(--live); border-color: var(--live); color: #fff; }
.tk.on .node { background: var(--ink); border-color: var(--ink); color: var(--surface); box-shadow: 0 0 0 4px var(--chip); }
.tk .tk-label { padding-top: 3px; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.tk.done .tk-label { color: var(--ink-2); }
.tk.on .tk-label { color: var(--ink); font-weight: 700; }
.tk .tk-tag {
  margin-left: 8px; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill);
  vertical-align: middle; border: 1px solid var(--line-2); color: var(--ink-3); background: var(--surface-2);
}
.tk.on .tk-tag { color: var(--ink); background: var(--chip); border-color: var(--line-2); }

.next-line {
  display: flex; gap: 11px; align-items: flex-start; margin-top: 22px;
  background: var(--accent-tint); border: 1px solid var(--accent-line); border-radius: var(--r-tile);
  padding: 14px 16px;
}
.next-line .nx-ico { font-size: 16px; flex: none; }
.next-line .nx-body b { display: block; color: var(--accent-ink); font-size: 12px; margin-bottom: 3px; }
.next-line .nx-body p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.status-empty { color: var(--ink-2); font-size: 13.5px; text-align: center; padding: 40px 20px; }

.status-foot { margin-top: 24px; text-align: center; font-size: 12px; color: var(--ink-3); }
.status-foot a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }

/* keyboard focus ring */
.nav-item:focus-visible, .foot-btn:focus-visible, .opt:focus-visible,
.check-tile:focus-visible, .mkt-add:focus-visible, .mkt-del:focus-visible,
.btn-cta:focus-visible, .sb-btn:focus-visible, .cta-alt button:focus-visible,
.sheet-x:focus-visible {
  outline: 2px solid var(--ink-3); outline-offset: 2px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1140px) {
  .app { grid-template-columns: 224px minmax(0, 1fr); }
  .aside {
    grid-column: 1 / -1; position: static; height: auto;
    border-left: 0; border-top: 1px solid var(--line);
  }
  .sum-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
  .srow.wide { grid-column: 1 / -1; }
}

/* mobile: single column; the left sidebar folds into a slim horizontally-
   scrollable top bar instead of a 100vh column that would otherwise sit on
   top of the form; the summary panel flows under all cards; a fixed bottom
   bar keeps "Send to PrometheX" reachable without hunting for the aside. */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; padding-bottom: 74px; }
  .side {
    position: static; height: auto; flex-direction: row; align-items: center;
    flex-wrap: nowrap; gap: 8px; padding: 10px 12px;
    border-right: 0; border-bottom: 1px solid var(--line);
    overflow-x: auto; -webkit-overflow-scrolling: touch; /* whole bar scrolls; nothing hidden */
  }
  .side .brand { padding: 2px 4px; flex: none; }
  .side .brand .wm .sub { display: none; }
  .side .ws { display: none; }                              /* account chip is cosmetic on mobile */
  .side .nav-group { margin: 0; flex: none; display: flex; gap: 4px; }
  .side .nav-label { display: none; }
  .side .nav-item {
    width: auto; flex: none; white-space: nowrap; padding: 7px 10px;
  }
  .side .nav-item .nl { overflow: visible; }
  .side .nav-item .dot, .side .nav-item .tick { display: none; }
  .side .foot { margin: 0; border-top: 0; padding-top: 0; flex: none; } /* contacts + status stay reachable in the scroll strip */

  .aside { grid-column: auto; position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); }
  .sum-body { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 24px; }

  .mobile-cta { display: flex; }
}
@media (max-width: 560px) {
  .grid3 { grid-template-columns: 1fr; }
  .ro-grid { grid-template-columns: 1fr; }
  .field.two { grid-template-columns: 1fr; }
  .mkt-head, .mkt-row { grid-template-columns: 1fr 120px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Brand color picker + live demo preview (index.html #sec-brand)
   ============================================================ */
.colorrow { display: flex; gap: 8px; align-items: center; }
.colorrow input[type="color"] {
  width: 38px; height: 38px; padding: 0; flex: 0 0 auto; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--surface);
}
.colorrow input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.colorrow input[type="color"]::-webkit-color-swatch { border: none; border-radius: 6px; }
.colorrow input[type="text"] { flex: 1 1 auto; font-family: var(--mono); }

.logorow { display: flex; gap: 8px; align-items: center; }
.logorow input[type="text"] { flex: 1 1 auto; }
.pick-color-btn {
  flex: none; border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--ink-2);
  font-size: 12px; font-weight: 600; padding: 0 12px; height: 38px;
  white-space: nowrap; transition: border-color .12s, color .12s;
}
.pick-color-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.pick-color-btn:disabled { opacity: .5; cursor: not-allowed; }
.pick-color-msg {
  display: none; font-size: 11.5px; margin-top: 6px; line-height: 1.5;
}
.pick-color-msg.show { display: block; }
.pick-color-msg.err { color: var(--accent-ink); }
.pick-color-msg.ok { color: var(--live); }

.preview-wrap {
  margin-top: var(--space-lg); overflow: hidden;
  border: 1px solid var(--line-2); border-radius: var(--r-card); background: var(--surface-2);
  box-shadow: var(--sh-1);
}
.preview-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-size: 12px; background: var(--surface);
}
.preview-bar b { font-weight: 600; }
.preview-u { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.preview-frame { position: relative; width: 100%; height: 420px; background: var(--chip); }
.preview-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: #0b0b0e; }
.preview-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 20px; text-align: center; color: var(--ink-3); font-size: 13px; line-height: 1.5;
}
/* iframe failed to load / timed out — reassuring, not alarming */
.preview-error {
  position: absolute; inset: 0; align-items: center; justify-content: center;
  padding: 20px; text-align: center; color: var(--accent-ink); font-size: 13px; line-height: 1.5;
  background: var(--accent-tint);
}
.preview-error:not([hidden]) { display: flex; }
.preview-wrap > .hint { display: block; padding: 10px 16px 12px; }
@media (max-width: 720px) { .preview-frame { height: 320px; } }

/* themed demo embed on the status page (status.js) */
.status-preview {
  margin-top: var(--space-lg); overflow: hidden;
  border: 1px solid var(--line-2); border-radius: var(--r-card); background: var(--surface-2);
  box-shadow: var(--sh-1);
}
.status-preview .sp-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 12px; background: var(--surface);
}
.status-preview .sp-bar b { font-weight: 600; }
.status-preview .sp-u { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.status-preview .sp-frame { display: block; width: 100%; height: 440px; border: 0; background: #0b0b0e; }
@media (max-width: 720px) { .status-preview .sp-frame { height: 340px; } }
