/* ============================================================
   SACRED MANAGE — design system v2 (2026-08-29)

   Family: facility-os-demo. What we take from it, and why:
     • the MATERIAL model — every raised surface gets a hairline
       gradient edge (light catches the TOP, not a uniform border),
       a specular inset, and a TWO-part shadow (1px contact +
       wide ambient with negative spread). One flat 0 8px 32px
       shadow is the copy-paste tell.
     • the TYPE discipline — tight display tracking (-.03em),
       one step-scale, tabular-nums on every numeric.
     • generous radii, generous whitespace, real focus rings.
   What we deliberately DON'T take: heavy backdrop blur on
   content surfaces. Facility is a showcase; Manage is a tool an
   owner reads leads on at arm's length in a truck. Glass is used
   for CHROME only (top bar, nav) — content cards are SOLID, which
   is facility's own rule ("text lives on the SOLID part of a
   card, never floating over a busy blur").

   Brand accent is Sacred crimson (not facility orange): Manage is
   Sacred's own product surface, not a re-skinned client app.

   Mobile-first at 375. At >=1000 a sticky left rail appears and
   the content column stays readable rather than stretching.

   LEGACY ALIAS LAYER at the bottom: js/editors/* and css/editors.css
   were built against the v1 variable names (--bg-raised, --text-dim,
   --chip-bg …) and the .sm-* class block. Both are preserved and
   re-pointed at the v2 tokens, so every settings editor inherits the
   new look without being rewritten.
   ============================================================ */

/* ---------------- tokens ---------------- */
:root {
  color-scheme: dark light;

  /* base */
  --ink: #0A0B0E;
  --ink-2: #0F1116;
  --surface: #14161C;
  --surface-2: #191C23;
  --field: #101318;

  /* text */
  --bone: #F7F7F8;
  --soft: #D9DBE1;
  --muted: #9AA0AB;
  --muted-2: #6E7480;

  /* brand — Sacred crimson.
     --accent is a FILL (white text sits on it); --accent-2 is the
     text/icon tint for dark backgrounds where --accent is too dark. */
  --accent: #C2263A;
  --accent-2: #FF6076;
  --accent-deep: #8A1728;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(194, 38, 58, 0.14);

  /* semantic */
  --good: #43D17C;
  --good-2: #7BE3A6;
  --good-soft: rgba(67, 209, 124, 0.13);
  --warn: #FFC53D;
  --warn-2: #FFD979;
  --warn-soft: rgba(255, 197, 61, 0.13);
  --bad: #FF6B6B;
  --bad-soft: rgba(255, 107, 107, 0.13);
  --info: #6FA8FF;
  --info-soft: rgba(111, 168, 255, 0.13);

  /* lines + materials */
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.14);
  --hair: linear-gradient(160deg,
      rgba(255, 255, 255, 0.34) 0%,
      rgba(255, 255, 255, 0.10) 26%,
      rgba(255, 255, 255, 0.03) 55%,
      rgba(255, 255, 255, 0.08) 100%);
  --spec: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  --float: 0 1px 1px rgba(0, 0, 0, 0.45), 0 14px 32px -16px rgba(0, 0, 0, 0.70);
  --float-lg: 0 1px 1px rgba(0, 0, 0, 0.5), 0 28px 60px -22px rgba(0, 0, 0, 0.82);
  --chrome: rgba(14, 16, 21, 0.78);
  --blur: blur(24px) saturate(170%);

  /* geometry */
  --r: 18px;
  --r-sm: 13px;
  --r-lg: 26px;
  --r-pill: 999px;
  --pad: 18px;
  --colw: 620px;
  --rail: 232px;

  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text',
    'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --ink: #F4F5F7;
    --ink-2: #EDEFF3;
    --surface: #FFFFFF;
    --surface-2: #F7F8FA;
    --field: #F3F4F7;

    --bone: #14161B;
    --soft: #333843;
    --muted: #5C636F;
    --muted-2: #7C838F;

    --accent: #B01F32;
    --accent-2: #A31226;
    --accent-deep: #7C1522;
    --accent-soft: rgba(176, 31, 50, 0.09);

    --good: #12864A;
    --good-2: #0E6E3C;
    --good-soft: rgba(18, 134, 74, 0.10);
    --warn: #8A6100;
    --warn-2: #6F4E00;
    --warn-soft: rgba(138, 97, 0, 0.10);
    --bad: #B3132B;
    --bad-soft: rgba(179, 19, 43, 0.09);
    --info: #1F5FBF;
    --info-soft: rgba(31, 95, 191, 0.09);

    --line: rgba(16, 20, 28, 0.11);
    --line-2: rgba(16, 20, 28, 0.18);
    --hair: linear-gradient(160deg,
        rgba(16, 20, 28, 0.14) 0%,
        rgba(16, 20, 28, 0.06) 40%,
        rgba(16, 20, 28, 0.03) 100%);
    --spec: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --float: 0 1px 1px rgba(16, 20, 28, 0.05), 0 12px 28px -16px rgba(16, 20, 28, 0.22);
    --float-lg: 0 1px 1px rgba(16, 20, 28, 0.06), 0 26px 54px -24px rgba(16, 20, 28, 0.28);
    --chrome: rgba(248, 249, 251, 0.82);
  }
}

/* ---------------- reset ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }

html, body { max-width: 100%; overflow-x: clip; min-height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
}

/* A single soft bloom behind everything so the dark base isn't flat.
   Fixed, never scrolls, sits under all content. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(90% 55% at 50% -10%, var(--accent-soft), transparent 62%),
    radial-gradient(70% 50% at 100% 0%, rgba(111, 168, 255, 0.06), transparent 60%);
}

/* ---------------- type ---------------- */
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.dsp { font-weight: 700; letter-spacing: -0.032em; line-height: 1.1; }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.034em; line-height: 1.12; }
h2 { font-size: 1.08rem; font-weight: 650; letter-spacing: -0.02em; }
h3 { font-size: 0.95rem; font-weight: 650; letter-spacing: -0.016em; }
.lede { color: var(--muted); font-size: 0.94rem; margin-top: 6px; }
.small { font-size: 0.84rem; line-height: 1.45; color: var(--muted); }
.tiny { font-size: 0.75rem; line-height: 1.4; color: var(--muted-2); }
.dim { color: var(--muted); }
.eyebrow {
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---------------- focus + motion ---------------- */
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 8px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------- material primitives ---------------- */
/* Every raised surface: solid fill + gradient hairline + specular + 2-part shadow. */
.card, .tile, .lead, .stepcard, .bigbox {
  position: relative;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--spec), var(--float);
}
.card::before, .tile::before, .lead::before, .stepcard::before, .bigbox::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  padding: 1px;
  background: var(--hair);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.card > *, .tile > *, .lead > *, .stepcard > *, .bigbox > * { position: relative; }
.card { padding: 18px; }

/* ---------------- app shell ---------------- */
#app { min-height: 100vh; min-height: 100svh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
  background: var(--chrome);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.brand .seal {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(160deg, var(--accent-2), var(--accent-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.topbar .end { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.page {
  width: 100%;
  max-width: var(--colw);
  margin: 0 auto;
  padding: 18px max(16px, env(safe-area-inset-left))
           calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
}
.page.narrow { max-width: 460px; }

.vhd { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.vhd .end { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 18px; }

/* ---------------- nav ---------------- */
/* Mobile: floating pill, bottom. Desktop (>=1000): sticky left rail. */
.nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 60;
  width: min(calc(100% - 24px), 440px);
  display: flex;
  gap: 3px;
  padding: 5px;
  border-radius: var(--r-pill);
  background: var(--chrome);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--spec), var(--float-lg);
  border: 1px solid var(--line);
}
.nav a {
  flex: 1;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: var(--r-pill);
  color: var(--muted-2);
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: color 0.18s, background 0.18s;
  position: relative;
}
.nav a svg { width: 19px; height: 19px; }
.nav a[aria-current="page"] {
  color: var(--bone);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
@media (prefers-color-scheme: light) {
  .nav a[aria-current="page"] { background: rgba(16, 20, 28, 0.07); box-shadow: none; }
}
.nav a[aria-current="page"] svg { color: var(--accent-2); }
.nav .dot {
  position: absolute;
  top: 8px;
  right: calc(50% - 17px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 2px var(--chrome);
}

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.012em;
  line-height: 1.15;
  text-align: center;
  border: 1px solid transparent;
  transition: transform 0.14s, filter 0.16s, background 0.16s;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-p {
  background: linear-gradient(170deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26),
              0 8px 22px -10px rgba(194, 38, 58, 0.6);
}
.btn-p:hover:not(:disabled) { filter: brightness(1.06); }
.btn-g {
  background: var(--surface-2);
  color: var(--bone);
  border-color: var(--line-2);
  box-shadow: var(--spec);
}
.btn-g:hover:not(:disabled) { background: var(--surface); }
.btn-q { color: var(--muted); font-weight: 600; min-height: 40px; padding: 8px 12px; }
.btn-q:hover { color: var(--bone); }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 0.85rem; border-radius: 10px; }
.btn-wide { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }

/* ---------------- pills / chips ---------------- */
.ph {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-size: 0.68rem;
  font-weight: 650;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid var(--line);
}
@media (prefers-color-scheme: light) { .ph { background: rgba(16, 20, 28, 0.045); } }
.ph.ok { background: var(--good-soft); color: var(--good-2); border-color: color-mix(in oklab, var(--good) 30%, transparent); }
.ph.warn { background: var(--warn-soft); color: var(--warn-2); border-color: color-mix(in oklab, var(--warn) 30%, transparent); }
.ph.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in oklab, var(--bad) 30%, transparent); }
.ph.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in oklab, var(--info) 30%, transparent); }
.ph.brand { background: var(--accent-soft); color: var(--accent-2); border-color: color-mix(in oklab, var(--accent) 34%, transparent); }

/* ---------------- notices ---------------- */
.notice {
  border-radius: var(--r-sm);
  padding: 13px 15px;
  font-size: 0.88rem;
  line-height: 1.5;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted-2);
  color: var(--soft);
}
.notice strong { display: block; color: var(--bone); font-weight: 650; margin-bottom: 2px; }
.notice.err { border-left-color: var(--bad); background: var(--bad-soft); }
.notice.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.notice.ok { border-left-color: var(--good); background: var(--good-soft); }
.notice.info { border-left-color: var(--info); background: var(--info-soft); }
.notice[hidden] { display: none; }

/* ---------------- tenant header ---------------- */
.thead { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.thead .seal {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 750;
  color: #fff;
  background: linear-gradient(160deg, var(--accent-2), var(--accent-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 18px -8px rgba(194, 38, 58, 0.55);
}
.thead .who { min-width: 0; flex: 1; }
.thead .nm {
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.026em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thead .sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }

/* ---------------- leads inbox ---------------- */
.inbox-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  min-height: 28px;
}
.inbox-bar .live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted-2);
}
.inbox-bar .live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px var(--good-soft);
}
.inbox-bar .live.paused::before { background: var(--muted-2); box-shadow: none; }
.inbox-bar .end { margin-left: auto; }

.lead { padding: 15px 16px; }
.lead + .lead { margin-top: 10px; }
.lead.is-new { border-left: 0; }
.lead.is-new::after {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-2);
}
.lead-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.lead-name {
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.018em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lead-when {
  margin-left: auto;
  flex: none;
  font-size: 0.74rem;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.lead-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.lead-msg {
  margin-top: 8px;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.lead-call {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  min-height: 44px;
  padding: 9px 15px 9px 12px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  border: 1px solid color-mix(in oklab, var(--accent) 34%, transparent);
  color: var(--accent-2);
  font-weight: 650;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  transition: background 0.16s;
}
.lead-call:hover { background: color-mix(in oklab, var(--accent) 20%, transparent); }
.lead-call svg { width: 16px; height: 16px; flex: none; }
.lead-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

/* 3-way status control */
.statusctl {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--field);
  border: 1px solid var(--line);
}
.statusctl button {
  min-height: 34px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  font-size: 0.76rem;
  font-weight: 650;
  color: var(--muted-2);
  transition: color 0.16s, background 0.16s;
}
.statusctl button[aria-pressed="true"] { color: var(--bone); background: rgba(255, 255, 255, 0.1); }
@media (prefers-color-scheme: light) {
  .statusctl button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 3px rgba(16,20,28,.12); }
}
.statusctl button[aria-pressed="true"][data-s="contacted"] { color: var(--warn-2); }
.statusctl button[aria-pressed="true"][data-s="won"] { color: var(--good-2); }
.statusctl.is-busy { opacity: 0.55; pointer-events: none; }

/* empty state — coaches, never apologises */
.empty {
  text-align: center;
  padding: 34px 22px 30px;
}
.empty .ring {
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
}
.empty .ring svg { width: 26px; height: 26px; }
.empty h2 { font-size: 1.12rem; letter-spacing: -0.024em; }
.empty p { margin-top: 8px; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.empty .num { color: var(--bone); font-weight: 650; }

/* skeleton */
.sk { border-radius: var(--r); background: var(--surface); height: 96px; opacity: 0.55; }
.sk + .sk { margin-top: 10px; }
@media (prefers-reduced-motion: no-preference) {
  .sk { animation: skp 1.5s ease-in-out infinite; }
  @keyframes skp { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.68; } }
}

/* ---------------- activation ---------------- */
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps .s {
  flex: 1;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--line);
}
.steps .s.done { background: var(--good); }
.steps .s.now { background: var(--accent-2); }

.stepcard { padding: 20px 18px; }
.stepcard .eyebrow { display: block; margin-bottom: 6px; }

/* the big number moment */
.bigbox {
  padding: 26px 20px;
  text-align: center;
  background: linear-gradient(180deg, var(--accent-soft), var(--surface) 62%);
}
.bignum {
  display: block;
  font-size: clamp(1.9rem, 8.5vw, 2.6rem);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  color: var(--bone);
  margin: 4px 0 2px;
  overflow-wrap: anywhere;
}
.bigbox .coach {
  margin-top: 14px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--soft);
}
.bigbox .coach b { color: var(--bone); font-weight: 650; }

.minibox {
  margin-top: 14px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--line-2);
  background: var(--field);
  padding: 14px;
  text-align: left;
}
.minibox .eyebrow { display: block; margin-bottom: 8px; }
.minibox .waiting {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.85rem;
  color: var(--muted);
}
.minibox .waiting .pulse {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-2);
}
@media (prefers-reduced-motion: no-preference) {
  .minibox .waiting .pulse { animation: pl 1.6s ease-in-out infinite; }
  @keyframes pl {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
    50% { box-shadow: 0 0 0 7px transparent; }
  }
}
.minilead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.minilead + .minilead { margin-top: 8px; }
.minilead .nm { font-weight: 650; font-size: 0.9rem; }
.minilead .ph2 {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.minilead .when { margin-left: auto; font-size: 0.74rem; color: var(--muted-2); }

/* copy-link row (chair / facility activation) */
.copyrow {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  background: var(--field);
  border: 1px solid var(--line);
}
.copyrow .u {
  flex: 1;
  min-width: 0;
  font-size: 0.83rem;
  overflow-wrap: anywhere;
  color: var(--soft);
}

/* ---------------- forms (shell-level) ---------------- */
.fld { margin-top: 14px; }
.fld > label {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.005em;
}
.fld input, .fld select, .fld textarea, .inp {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font-size: 16px; /* never below 16 — iOS zooms the page otherwise */
  color: var(--bone);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.fld input::placeholder { color: var(--muted-2); }
.fld input:focus, .inp:focus { border-color: var(--line-2); background: var(--surface-2); }
.fld .hint { font-size: 0.75rem; color: var(--muted-2); margin-top: 5px; }
.fld.bad input { border-color: var(--bad); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* honeypot: gone for humans, present for bots */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------------- app picker ---------------- */
.pick { display: grid; gap: 10px; margin-top: 16px; }
.pick a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--spec), var(--float);
  position: relative;
  transition: transform 0.15s;
}
.pick a:active { transform: scale(0.99); }
.pick .nm { font-weight: 650; font-size: 1rem; letter-spacing: -0.018em; }
.pick .tg { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.pick .go { margin-left: auto; color: var(--muted-2); }

/* ---------------- misc ---------------- */
.loading { padding: 44px 0; text-align: center; color: var(--muted-2); font-size: 0.85rem; }
.sep { height: 1px; background: var(--line); margin: 18px 0; border: 0; }
.vis-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

#toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 90;
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 0.87rem;
  background: var(--surface);
  color: var(--bone);
  border: 1px solid var(--line-2);
  box-shadow: var(--float-lg);
}
#toast[hidden] { display: none; }

/* ---------------- >=1000px: sticky rail, deliberate at 1280 ---------------- */
@media (min-width: 1000px) {
  /* The 1180px band is centred HERE, on the grid container. Centring the rail
     instead (margin-left: calc((100vw - 1180px)/2) on .nav) put the offset on a
     grid ITEM inside a fixed 232px track: past ~1280px the margin ate the track,
     the rail collapsed toward min-content (18px at 2427px) and slid on top of
     the content column. Invisible at exactly 1280, broken at 1440/1920. */
  .shell {
    display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: 34px;
    width: min(1180px, 100% - 40px); margin-inline: auto;
  }
  .shell.solo { display: block; }

  .nav {
    position: sticky;
    top: 78px;
    left: auto;
    bottom: auto;
    transform: none;
    width: auto;
    flex-direction: column;
    gap: 4px;
    align-self: start;
    padding: 8px;
    margin-left: 0; /* centring lives on .shell — see the note there */
    border-radius: var(--r);
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: var(--spec), var(--float);
  }
  .nav a {
    flex-direction: row;
    justify-content: flex-start;
    gap: 11px;
    min-height: 44px;
    padding: 0 13px;
    border-radius: 11px;
    font-size: 0.88rem;
    letter-spacing: -0.012em;
  }
  .nav .dot { position: static; margin-left: auto; box-shadow: none; }

  .page {
    max-width: 660px;
    margin: 0;
    padding: 26px 20px 60px 0;
  }
  .page.narrow { max-width: 460px; margin: 0 auto; }
  .topbar { padding-inline: max(20px, calc((100vw - 1180px) / 2)); }
  h1 { font-size: 2rem; }
  .card, .stepcard { padding: 22px; }
  .lead { padding: 17px 19px; }
}

/* ============================================================
   LEGACY ALIAS LAYER — v1 variable names + the .sm-* editor kit.
   js/editors/* and css/editors.css were written against these.
   Re-pointed at the v2 tokens so the settings editors inherit the
   new design system without a rewrite. DO NOT delete while any
   js/editors/* file is still shipped.
   ============================================================ */
:root {
  /* v1 shell names */
  --bg: var(--ink);
  --bg-raised: var(--surface);
  --bg-inset: var(--field);
  --text: var(--bone);
  --text-dim: var(--muted);
  --accent-press: var(--accent-deep);
  --chip-bg: var(--surface-2);
  --focus: var(--accent-2);
  --radius: var(--r);
  --shadow: var(--float);

  /* names css/editors.css probes for (--sm-* wins, then bare, then its own fallback) */
  --sm-card-bg: var(--surface);
  --sm-ink: var(--bone);
  --sm-muted: var(--muted);
  --sm-line: var(--line);
  --sm-accent: var(--accent-2);
  --sm-accent-ink: var(--accent-ink);
  --sm-field-bg: var(--field);
  --sm-ok: var(--good-2);
  --sm-warn: var(--warn-2);
  --sm-err: var(--bad);
}

.sm-ed { margin: 0 0 12px; }
.sm-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 18px;
  margin: 0 0 12px;
  box-shadow: var(--spec), var(--float);
}
.sm-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.sm-card-title { font-size: 1.05rem; font-weight: 650; letter-spacing: -0.02em; margin: 0; }

.sm-loading { padding: 20px 0; text-align: center; color: var(--muted-2); font-size: 0.85rem; }
.sm-hint { font-size: 0.75rem; color: var(--muted-2); margin: 6px 0 0; line-height: 1.5; }
.sm-group-label {
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted-2);
  margin: 18px 0 6px;
}

.sm-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 0.68rem;
  font-weight: 650;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
  vertical-align: middle;
  margin-left: 6px;
}
.sm-chip-live { color: var(--good-2); background: var(--good-soft); }
.sm-chip-pending { color: var(--warn-2); background: var(--warn-soft); }
.sm-chip-founding { color: var(--accent-2); background: var(--accent-soft); }
.sm-chip-you { font-weight: 600; }

.sm-progress {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--field);
  border: 1px solid var(--line);
  overflow: hidden;
  margin: 10px 0 4px;
}
.sm-progress-fill { height: 100%; background: var(--good); border-radius: var(--r-pill); }
.sm-progress-label { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.sm-check-list { list-style: none; margin: 8px 0 0; padding: 0; }
.sm-check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 10px 2px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.sm-check-list li:last-child .sm-check-row { border-bottom: none; }
.sm-check-dot {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  color: var(--good-2);
}
.sm-check-row.is-done .sm-check-dot { border-color: var(--good); background: var(--good-soft); }
.sm-check-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sm-check-label { font-size: 0.94rem; font-weight: 600; }
.sm-check-row.is-done .sm-check-label { color: var(--muted); font-weight: 500; }
.sm-check-detail { font-size: 0.75rem; color: var(--muted-2); }
.sm-check-go { flex: none; font-size: 1.1rem; color: var(--muted-2); }

.sm-form { margin-top: 4px; }
.sm-field { margin: 14px 0 0; }
.sm-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  margin: 0 0 6px;
}
.sm-input,
.sm-field input,
.sm-svc-row input,
.sm-roster-row input,
.sm-add-member input,
.sm-hours-times input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--bone);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
}
.sm-field.has-error .sm-input,
.sm-field.has-error input { border-color: var(--bad); }
.sm-field-error, .sm-form-error {
  margin-top: 8px;
  padding: 11px 13px;
  border: 1px solid color-mix(in oklab, var(--bad) 45%, transparent);
  border-radius: var(--r-sm);
  background: var(--bad-soft);
  font-size: 0.83rem;
  line-height: 1.5;
}
.sm-row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }

.sm-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }

.sm-btn, .sm-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 650;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: transform 0.14s, filter 0.16s, background 0.16s;
}
.sm-btn:active, .sm-btn-primary:active { transform: scale(0.985); }
.sm-btn-primary {
  background: linear-gradient(170deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
}
.sm-btn-ghost {
  background: var(--surface-2);
  color: var(--bone);
  border-color: var(--line-2);
}
.sm-btn-remove { color: var(--bad); border: 1px solid var(--line); background: transparent; }
.sm-btn-wide { width: 100%; }
.sm-btn.is-flash, .sm-btn-primary.is-flash { background: var(--good); color: #fff; }
.sm-btn:disabled, .sm-btn-primary:disabled { opacity: 0.55; cursor: default; }

.sm-hours-grid { margin-top: 6px; }
.sm-hours-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.sm-hours-grid .sm-hours-row:last-child { border-bottom: none; }
.sm-hours-day { display: flex; align-items: center; gap: 10px; flex: none; min-width: 116px; }
.sm-hours-label { font-size: 0.88rem; font-weight: 600; }
.sm-hours-times { display: flex; align-items: center; gap: 6px; flex: 1; }
.sm-hours-times .sm-time, .sm-hours-times input {
  min-height: 44px; padding: 6px 8px; font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.sm-hours-dash { color: var(--muted-2); }
.sm-hours-closed {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--muted); min-height: 44px;
}

.sm-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.sm-switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sm-switch-track {
  width: 46px; height: 28px; border-radius: var(--r-pill);
  background: var(--field); border: 1px solid var(--line-2);
  position: relative; transition: background 0.15s ease; flex: none;
}
.sm-switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--muted-2); transition: transform 0.15s ease, background 0.15s ease;
}
.sm-switch-input:checked + .sm-switch-track { background: var(--good); border-color: var(--good); }
.sm-switch-input:checked + .sm-switch-track::after { transform: translateX(18px); background: #fff; }
.sm-switch-input:focus-visible + .sm-switch-track { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.sm-svc-list { margin-top: 6px; }
.sm-svc-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.sm-svc-list .sm-svc-row:last-child { border-bottom: none; }
.sm-svc-row input { flex: 1; min-width: 120px; }
.sm-svc-row .sm-btn-remove { flex: none; }

.sm-member-list { margin-top: 6px; }
.sm-member-row {
  display: flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.sm-member-list .sm-member-row:last-child { border-bottom: none; }
.sm-member-main, .sm-roster-main { flex: 1; min-width: 0; }
.sm-roster-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.sm-roster-main { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sm-roster-row > input { flex: 1 1 auto; min-width: 140px; }
.sm-roster-row .sm-btn-remove { flex: none; }
.sm-member-email {
  font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sm-seat-count { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sm-add-member { margin-top: 12px; }

.sm-invite-box, .sm-invite-slot {
  margin-top: 12px; padding: 13px 14px;
  border: 1px dashed var(--line-2); border-radius: var(--r-sm); background: var(--field);
}
.sm-invite-title { font-weight: 650; font-size: 0.88rem; margin-bottom: 4px; }
.sm-invite-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sm-invite-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem; word-break: break-all; user-select: all; flex: 1; min-width: 0;
}
.sm-invite-warn { font-size: 0.74rem; color: var(--warn-2); margin-top: 6px; }

.sm-plan {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin: 10px 0; flex-wrap: wrap;
}
.sm-plan-name { font-weight: 650; font-size: 1rem; }
.sm-plan-price { display: flex; align-items: baseline; gap: 2px; }
.sm-plan-amount {
  font-size: 1.9rem; font-weight: 750; letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.sm-plan-per { font-size: 0.8rem; color: var(--muted-2); }
.sm-founding-note { color: var(--soft); }
.sm-billing-slot { margin-top: 10px; }
.sm-billing-wait {
  padding: 13px 15px; border: 1px solid var(--line);
  border-left: 3px solid var(--warn); border-radius: var(--r-sm);
  background: var(--warn-soft); font-size: 0.87rem;
}
.sm-billing-wait-title { font-weight: 650; margin-bottom: 2px; }

.sm-sms-card, .sm-cap-card {
  margin-top: 12px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--field);
}
.sm-sms-text, .sm-cap-text { font-size: 0.83rem; color: var(--muted); line-height: 1.5; }
