/* ===========================================================================
   Foxhole Onboarding — design system
   Dark only. The palette, the type stack and the motion curve are lifted from
   reference/Field_OS_ORIGINAL.html so this app reads as Field OS's sibling.
   Token names are pinned by CONTRACTS.md §4.5 — views use these and no raw hex.
   =========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root{
  /* --- surfaces ------------------------------------------------------- */
  --fx-bg:#0A0A0B;            --fx-surface:#131316;      --fx-surface-2:#1C1C20;   --fx-surface-3:#26262B;
  --fx-border:rgba(255,255,255,.07);                      --fx-border-strong:rgba(255,255,255,.12);
  /* --- type ----------------------------------------------------------- */
  --fx-text:#F5F5F7;          --fx-text-dim:#A1A1A6;     --fx-text-faint:#6B6B70;
  /* --- brand ---------------------------------------------------------- */
  --fx-accent:#C84B31;        --fx-accent-hi:#E05C3E;    --fx-accent-soft:rgba(200,75,49,.14);
  /* --- status --------------------------------------------------------- */
  --fx-green:#10B981;         --fx-amber:#F59E0B;        --fx-red:#EF4444;
  /* --- shape ---------------------------------------------------------- */
  --fx-radius:14px;           --fx-radius-sm:9px;
  --fx-font:'Geist',system-ui,-apple-system,'Segoe UI',sans-serif;
  --fx-mono:'Geist Mono','SF Mono',ui-monospace,monospace;
  --fx-ease:cubic-bezier(.32,.72,0,1);
  --fx-shadow:0 10px 30px rgba(0,0,0,.45);
  --fx-header-h:56px;         --fx-gutter:16px;

  /* Derived helpers — safe to use, but views should prefer the pinned names. */
  --fx-accent-deep:#A3341F;
  --fx-green-soft:rgba(16,185,129,.15);
  --fx-amber-soft:rgba(245,158,11,.15);
  --fx-red-soft:rgba(239,68,68,.12);
  --fx-tap:52px;                                   /* glove-friendly minimum */
  --fx-safe-top:env(safe-area-inset-top,0px);
  --fx-safe-bottom:env(safe-area-inset-bottom,0px);
  --fx-safe-left:env(safe-area-inset-left,0px);
  --fx-safe-right:env(safe-area-inset-right,0px);

  /* v2 — layout only: a readable measure for the 45 KB agreement. */
  --fx-doc-measure:68ch;
  --fx-doc-lead:1.65;

  color-scheme:dark;
}

/* ===========================================================================
   Base
   =========================================================================== */
html{ -webkit-text-size-adjust:100%; }

body{
  min-height:100dvh;
  background:var(--fx-bg);
  color:var(--fx-text);
  font-family:var(--fx-font);
  font-size:15px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
  overscroll-behavior-y:none;
}

button{ background:none; border:none; font:inherit; color:inherit; cursor:pointer; }
input,textarea,select{ font:inherit; color:inherit; }
a{ color:var(--fx-accent-hi); text-decoration:none; }
a:hover{ color:var(--fx-accent); }
svg{ display:block; }

:focus-visible{ outline:2px solid var(--fx-accent-hi); outline-offset:2px; border-radius:4px; }

.fx-sr{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }

/* ===========================================================================
   App frame — header / banner / main / toast
   =========================================================================== */
.fx-app{
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  padding-left:var(--fx-safe-left);
  padding-right:var(--fx-safe-right);
}

.fx-header{
  position:sticky; top:0; z-index:40;
  flex-shrink:0;
  height:calc(var(--fx-header-h) + var(--fx-safe-top));
  padding:var(--fx-safe-top) var(--fx-gutter) 0;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:rgba(10,10,11,.86);
  backdrop-filter:saturate(180%) blur(14px);
  -webkit-backdrop-filter:saturate(180%) blur(14px);
  border-bottom:1px solid var(--fx-border);
}

.fx-brand{ display:flex; align-items:center; gap:10px; min-width:0; color:var(--fx-text); }
.fx-brand:hover{ color:var(--fx-text); }
.fx-brand__mark{ width:28px; height:35px; flex-shrink:0; display:block; object-fit:contain; }
/* The Foxhole wordmark on the sign-in card (brand kit FINAL 2026, reversed for dark surfaces). */
.fx-wordmark{ display:block; width:100%; max-width:280px; height:auto; margin:0 auto 18px; }
.fx-brands{ display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:12px 16px; margin:0 0 20px; }
.fx-brands__logo{ display:block; flex:1 1 150px; min-width:0; max-width:190px; height:auto; }
.fx-brands__logo--tile{ border-radius:8px; }
.fx-brand__text{ display:flex; flex-direction:column; min-width:0; }
.fx-brand__name{ font-weight:700; font-size:15px; letter-spacing:-.015em; line-height:1.15; }
.fx-brand__sub{
  font-family:var(--fx-mono); font-size:9px; letter-spacing:.16em; text-transform:uppercase;
  color:var(--fx-text-faint); margin-top:3px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:46vw;
}

.fx-header__actions{ display:flex; align-items:center; gap:8px; flex-shrink:0; }

/* Round icon/label buttons that live in the header. */
.fx-iconbtn{
  height:34px; min-width:34px; padding:0 11px;
  border-radius:17px;
  background:var(--fx-surface-2); border:1px solid var(--fx-border);
  color:var(--fx-text-dim);
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  font-size:12px; font-weight:600;
  transition:background 160ms var(--fx-ease), color 160ms var(--fx-ease);
}
.fx-iconbtn:active{ background:var(--fx-surface-3); }
.fx-iconbtn.is-active{ color:var(--fx-text); border-color:var(--fx-border-strong); }
.fx-iconbtn--accent{ background:var(--fx-accent-soft); border-color:rgba(200,75,49,.34); color:var(--fx-accent-hi); }
.fx-avatar{
  width:32px; height:32px; border-radius:50%;
  background:var(--fx-surface-2); border:1px solid var(--fx-border);
  display:inline-flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:600; color:var(--fx-text-dim);
}

.fx-main{
  flex:1 1 auto;
  width:100%;
  max-width:560px;                       /* phone-first; centred and calm on a laptop */
  margin:0 auto;
  padding:18px var(--fx-gutter) calc(28px + var(--fx-safe-bottom));
}

.fx-view{ display:block; animation:fxViewIn 220ms var(--fx-ease); }
@keyframes fxViewIn{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }

/* ===========================================================================
   Typography helpers
   =========================================================================== */
h1,h2,h3{ letter-spacing:-.02em; line-height:1.2; }
h1{ font-size:24px; font-weight:700; }
h2{ font-size:18px; font-weight:650; }
h3{ font-size:15px; font-weight:600; }

.fx-title{ font-size:24px; font-weight:700; letter-spacing:-.02em; line-height:1.2; }
.fx-lede{ font-size:14px; color:var(--fx-text-dim); line-height:1.5; }
.fx-muted{ color:var(--fx-text-dim); font-size:13px; line-height:1.5; }
.fx-faint{ color:var(--fx-text-faint); font-size:12px; }
.fx-mono{ font-family:var(--fx-mono); font-variant-numeric:tabular-nums; }
.fx-eyebrow{
  font-family:var(--fx-mono); font-size:10px; font-weight:700;
  letter-spacing:.16em; text-transform:uppercase; color:var(--fx-text-faint);
}
.fx-eyebrow--accent{ color:var(--fx-accent-hi); }

/* ===========================================================================
   Layout primitives
   =========================================================================== */
.fx-stack{ display:flex; flex-direction:column; gap:12px; }
.fx-stack--tight{ gap:8px; }
.fx-stack--loose{ gap:20px; }
.fx-row-flex{ display:flex; align-items:center; gap:10px; }
.fx-spread{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.fx-divider{ height:1px; background:var(--fx-border); margin:18px 0; border:0; }

/* ===========================================================================
   Card
   =========================================================================== */
.fx-card{
  background:var(--fx-surface);
  border:1px solid var(--fx-border);
  border-radius:var(--fx-radius);
  padding:16px 18px;
}
.fx-card--pad-lg{ padding:22px 20px; }
.fx-card--accent{ border-color:rgba(200,75,49,.34); background:linear-gradient(180deg,var(--fx-accent-soft),transparent 60%),var(--fx-surface); }
.fx-card__label{
  font-family:var(--fx-mono); font-size:9px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--fx-text-faint); margin-bottom:6px;
}
.fx-card__title{ font-size:15px; font-weight:600; margin-bottom:2px; }
.fx-card__desc{ font-size:13px; color:var(--fx-text-dim); line-height:1.45; }

/* ===========================================================================
   List rows — the roster pattern
   =========================================================================== */
.fx-list{
  display:flex; flex-direction:column;
  background:var(--fx-surface);
  border:1px solid var(--fx-border);
  border-radius:var(--fx-radius);
  overflow:hidden;
}
.fx-row{
  display:flex; align-items:center; gap:12px;
  width:100%; text-align:left;
  min-height:64px; padding:12px 16px;
  border-bottom:1px solid var(--fx-border);
  color:var(--fx-text);
}
.fx-row:last-child{ border-bottom:none; }
.fx-row--tap{ transition:background 160ms var(--fx-ease); }
.fx-row--tap:active{ background:var(--fx-surface-2); transform:scale(.995); }
.fx-row__body{ flex:1 1 auto; min-width:0; }
.fx-row__title{ font-size:14px; font-weight:600; line-height:1.3; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fx-row__sub{ font-size:12px; color:var(--fx-text-faint); line-height:1.35; margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fx-row__end{ flex-shrink:0; display:flex; align-items:center; gap:8px; }
.fx-row__mark{
  width:36px; height:36px; flex-shrink:0; border-radius:var(--fx-radius-sm);
  background:var(--fx-surface-2); border:1px solid var(--fx-border);
  display:flex; align-items:center; justify-content:center;
  font-family:var(--fx-mono); font-size:12px; font-weight:700; color:var(--fx-text-dim);
}

/* ===========================================================================
   Buttons
   =========================================================================== */
.fx-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:var(--fx-tap); padding:0 20px;
  border-radius:12px;
  background:var(--fx-surface-2); border:1px solid var(--fx-border);
  color:var(--fx-text);
  font-size:15px; font-weight:600; letter-spacing:-.01em;
  transition:background 160ms var(--fx-ease), border-color 160ms var(--fx-ease), transform 120ms var(--fx-ease);
  user-select:none;
}
.fx-btn:active{ transform:scale(.98); }
.fx-btn[disabled],.fx-btn.is-busy{ opacity:.55; pointer-events:none; }
.fx-btn--block{ width:100%; }
.fx-btn--sm{ min-height:38px; padding:0 14px; font-size:13px; border-radius:10px; }

/* Same gradient Field OS uses on its primary action: accent into a deeper burn. */
.fx-btn--primary{
  background:linear-gradient(135deg,var(--fx-accent),var(--fx-accent-deep));
  border-color:transparent; color:#fff;
  box-shadow:0 6px 18px rgba(200,75,49,.26);
}
.fx-btn--primary:hover{ background:linear-gradient(135deg,var(--fx-accent-hi),var(--fx-accent)); }
.fx-btn--primary:active{ background:var(--fx-accent-deep); box-shadow:none; }

.fx-btn--ghost{ background:transparent; border-color:var(--fx-border-strong); color:var(--fx-text-dim); }
.fx-btn--ghost:active{ background:var(--fx-surface-2); color:var(--fx-text); }

.fx-btn--danger{ background:var(--fx-red-soft); border-color:rgba(239,68,68,.35); color:#FCA5A5; }

.fx-btn__spin{
  width:15px; height:15px; border-radius:50%;
  border:2px solid rgba(255,255,255,.35); border-top-color:#fff;
  animation:fxSpin 700ms linear infinite;
}

/* ===========================================================================
   Forms
   =========================================================================== */
.fx-field{ display:flex; flex-direction:column; gap:7px; }
.fx-label{
  font-family:var(--fx-mono); font-size:10px; font-weight:700;
  letter-spacing:.14em; text-transform:uppercase; color:var(--fx-text-faint);
}
.fx-input,select.fx-input,textarea.fx-input{
  width:100%; min-height:var(--fx-tap);
  padding:14px 16px;
  background:var(--fx-surface); border:1px solid var(--fx-border-strong);
  border-radius:12px;
  color:var(--fx-text);
  font-size:16px;                               /* 16px stops iOS zooming on focus */
  transition:border-color 160ms var(--fx-ease), background 160ms var(--fx-ease);
  appearance:none;
}
.fx-input::placeholder{ color:var(--fx-text-faint); }
.fx-input:focus{ outline:none; border-color:var(--fx-accent); background:var(--fx-surface-2); }
.fx-input:disabled{ opacity:.55; }
.fx-input.is-invalid{ border-color:var(--fx-red); }
select.fx-input{
  background-image:linear-gradient(45deg,transparent 50%,var(--fx-text-faint) 50%),linear-gradient(135deg,var(--fx-text-faint) 50%,transparent 50%);
  background-position:calc(100% - 20px) calc(50% + 2px),calc(100% - 15px) calc(50% + 2px);
  background-size:5px 5px,5px 5px; background-repeat:no-repeat;
  padding-right:42px;
}
.fx-hint{ font-size:12px; color:var(--fx-text-faint); line-height:1.4; }
.fx-fieldnote{ font-size:12px; color:var(--fx-red); line-height:1.4; }

/* ===========================================================================
   Pills / badges
   =========================================================================== */
.fx-pill{
  display:inline-flex; align-items:center; gap:5px;
  padding:4px 10px; border-radius:999px;
  background:var(--fx-surface-2); border:1px solid var(--fx-border);
  font-family:var(--fx-mono); font-size:10px; font-weight:700;
  letter-spacing:.08em; text-transform:uppercase; color:var(--fx-text-dim);
  white-space:nowrap;
}
.fx-pill::before{ content:''; width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.9; }
.fx-pill.is-invited{ background:var(--fx-amber-soft); border-color:rgba(245,158,11,.3); color:var(--fx-amber); }
.fx-pill.is-active{ background:var(--fx-green-soft); border-color:rgba(16,185,129,.3); color:var(--fx-green); }
.fx-pill.is-disabled{ background:var(--fx-red-soft); border-color:rgba(239,68,68,.3); color:var(--fx-red); }
.fx-pill.is-admin{ background:var(--fx-accent-soft); border-color:rgba(200,75,49,.34); color:var(--fx-accent-hi); }

.fx-badge{
  display:inline-block; padding:3px 8px; border-radius:6px;
  background:var(--fx-surface-3); color:var(--fx-text-dim);
  font-family:var(--fx-mono); font-size:10px; letter-spacing:.1em; text-transform:uppercase;
}

/* ===========================================================================
   Spinner / skeleton / boot
   =========================================================================== */
@keyframes fxSpin{ to{ transform:rotate(360deg); } }
.fx-spinner{
  display:inline-block; width:18px; height:18px;
  border-radius:50%;
  border:2px solid var(--fx-border-strong); border-top-color:var(--fx-accent);
  animation:fxSpin 700ms linear infinite;
}
.fx-spinner--lg{ width:30px; height:30px; border-width:3px; }
.fx-loading{ display:flex; flex-direction:column; align-items:center; gap:12px; padding:44px 20px; text-align:center; }
.fx-loading__text{ font-size:13px; color:var(--fx-text-faint); }

.fx-boot{ display:flex; flex-direction:column; align-items:center; gap:14px; padding:70px 20px; text-align:center; }
.fx-boot__text{ font-size:13px; color:var(--fx-text-faint); }

@keyframes fxShimmer{ from{ background-position:-360px 0; } to{ background-position:360px 0; } }
.fx-skeleton{
  height:14px; border-radius:7px;
  background:linear-gradient(90deg,var(--fx-surface-2) 25%,var(--fx-surface-3) 50%,var(--fx-surface-2) 75%);
  background-size:720px 100%;
  animation:fxShimmer 1.25s linear infinite;
}
.fx-skeleton--row{ height:64px; border-radius:var(--fx-radius); }
.fx-skeleton--title{ height:20px; width:58%; }

/* ===========================================================================
   Empty / error states
   =========================================================================== */
.fx-empty{
  padding:34px 22px; text-align:center;
  background:var(--fx-surface); border:1px dashed var(--fx-border-strong);
  border-radius:var(--fx-radius);
}
.fx-empty__icon{ font-size:28px; opacity:.45; margin-bottom:10px; }
.fx-empty__title{ font-size:16px; font-weight:600; margin-bottom:6px; }
.fx-empty__desc{ font-size:13px; color:var(--fx-text-faint); line-height:1.45; }
.fx-empty__action{ margin-top:16px; }

.fx-error{
  padding:14px 16px;
  background:var(--fx-red-soft); border:1px solid rgba(239,68,68,.32);
  border-left-width:3px;
  border-radius:var(--fx-radius-sm);
  font-size:13px; line-height:1.45; color:#FCA5A5;
}
.fx-error strong{ display:block; color:var(--fx-text); font-size:14px; margin-bottom:3px; }
.fx-error__action{ margin-top:12px; }
.fx-error--page{ text-align:center; padding:26px 22px; border-left-width:1px; }

.fx-ok{
  padding:14px 16px;
  background:var(--fx-green-soft); border:1px solid rgba(16,185,129,.3);
  border-radius:var(--fx-radius-sm);
  font-size:13px; line-height:1.45; color:#6EE7B7;
}

/* ===========================================================================
   Banners (offline, install hint)
   =========================================================================== */
.fx-banner-slot{ position:sticky; top:calc(var(--fx-header-h) + var(--fx-safe-top)); z-index:30; }
.fx-banner{
  display:flex; align-items:center; gap:10px;
  padding:10px calc(var(--fx-gutter) + 2px);
  font-size:12.5px; line-height:1.35; font-weight:500;
  background:var(--fx-surface-2);
  border-bottom:1px solid var(--fx-border);
  color:var(--fx-text-dim);
  animation:fxBannerIn 200ms var(--fx-ease);
}
@keyframes fxBannerIn{ from{ opacity:0; transform:translateY(-6px); } to{ opacity:1; transform:none; } }
.fx-banner__dot{ width:7px; height:7px; border-radius:50%; background:currentColor; flex-shrink:0; }
.fx-banner__text{ flex:1 1 auto; min-width:0; }
.fx-banner__close{ flex-shrink:0; width:26px; height:26px; border-radius:50%; color:var(--fx-text-faint); font-size:15px; line-height:1; }
/* Banners sit sticky over scrolling content, so their backgrounds are OPAQUE.
   A translucent tint here lets the roster read straight through the message. */
.fx-banner--offline{ background:#2A2312; color:var(--fx-amber); border-bottom-color:rgba(245,158,11,.28); }
.fx-banner--error{ background:#2A1416; color:#FCA5A5; border-bottom-color:rgba(239,68,68,.3); }
.fx-banner--info{ background:#2A1712; color:var(--fx-accent-hi); border-bottom-color:rgba(200,75,49,.3); }

/* ===========================================================================
   Toast
   =========================================================================== */
.fx-toast-host{
  position:fixed; z-index:70;
  left:0; right:0; bottom:0;
  padding:0 var(--fx-gutter) calc(18px + var(--fx-safe-bottom));
  display:flex; flex-direction:column; align-items:center; gap:8px;
  pointer-events:none;
}
.fx-toast{
  width:100%; max-width:440px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:13px 16px;
  border-radius:12px;
  background:var(--fx-surface-3); border:1px solid var(--fx-border-strong);
  box-shadow:var(--fx-shadow);
  color:var(--fx-text); font-size:14px; font-weight:500; line-height:1.35;
  pointer-events:auto;
  animation:fxToastIn 200ms var(--fx-ease);
}
.fx-toast.is-leaving{ animation:fxToastOut 180ms var(--fx-ease) forwards; }
@keyframes fxToastIn{ from{ opacity:0; transform:translateY(14px); } to{ opacity:1; transform:none; } }
@keyframes fxToastOut{ to{ opacity:0; transform:translateY(10px); } }
.fx-toast__text{ flex:1 1 auto; min-width:0; }
.fx-toast--error{ background:#2A1416; border-color:rgba(239,68,68,.4); color:#FCA5A5; }
.fx-toast--success{ background:#0F2620; border-color:rgba(16,185,129,.35); color:#6EE7B7; }
.fx-toast__action{
  flex-shrink:0; padding:6px 12px; border-radius:8px;
  background:var(--fx-accent); color:#fff;
  font-size:12px; font-weight:700;
}

/* ===========================================================================
   Install affordance (beforeinstallprompt on Android, hint sheet on iOS)
   =========================================================================== */
.fx-install-sheet{
  position:fixed; inset:0; z-index:80;
  display:flex; align-items:flex-end; justify-content:center;
  background:rgba(0,0,0,.72);
  animation:fxFade 160ms var(--fx-ease);
}
@keyframes fxFade{ from{ opacity:0; } to{ opacity:1; } }
.fx-install-sheet__card{
  width:100%; max-width:480px;
  background:var(--fx-surface); border:1px solid var(--fx-border-strong);
  border-radius:var(--fx-radius) var(--fx-radius) 0 0;
  padding:22px var(--fx-gutter) calc(24px + var(--fx-safe-bottom));
  box-shadow:var(--fx-shadow);
  animation:fxSheetIn 240ms var(--fx-ease);
}
@keyframes fxSheetIn{ from{ transform:translateY(30px); } to{ transform:none; } }
.fx-install-steps{ display:flex; flex-direction:column; gap:10px; margin:16px 0 18px; }
.fx-install-step{ display:flex; gap:12px; align-items:flex-start; font-size:14px; line-height:1.45; color:var(--fx-text-dim); }
.fx-install-step__n{
  flex-shrink:0; width:24px; height:24px; border-radius:50%;
  background:var(--fx-accent); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700;
}
.fx-install-step strong{ color:var(--fx-text); font-weight:600; }

/* ===========================================================================
   Misc
   =========================================================================== */
.fx-noscript{
  margin:var(--fx-gutter);
  padding:16px 18px;
  background:var(--fx-surface); border:1px solid var(--fx-border-strong);
  border-left:3px solid var(--fx-accent);
  border-radius:var(--fx-radius);
  font-size:14px; line-height:1.5; color:var(--fx-text-dim);
  display:flex; flex-direction:column; gap:4px;
}
.fx-noscript strong{ color:var(--fx-text); }

@media (min-width:600px){
  .fx-main{ padding-top:26px; }
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{ animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}

/* ===========================================================================
   v2 — agreement document, signature pad, checklist, uploads, forms
   (V2_CONTRACTS.md §8.6. Pinned tokens only; no new colours.)
   =========================================================================== */
.fx-doc{ display:flex; flex-direction:column; gap:10px; }
.fx-doc__scroll{
  max-height:min(62dvh,560px); overflow-y:auto; -webkit-overflow-scrolling:touch;
  background:var(--fx-surface); border:1px solid var(--fx-border); border-radius:var(--fx-radius);
  padding:18px 18px 28px;
}
.fx-doc__scroll:focus-visible{ outline:2px solid var(--fx-accent-hi); outline-offset:2px; }
.fx-doc__body{ max-width:var(--fx-doc-measure); margin:0 auto; font-size:14px; line-height:var(--fx-doc-lead); color:var(--fx-text-dim); }
.fx-doc__body h2{ font-size:15px; font-weight:700; color:var(--fx-text); margin:22px 0 8px; letter-spacing:-.01em; }
.fx-doc__body h2:first-child{ margin-top:0; }
.fx-doc__body h3{ font-size:14px; font-weight:650; color:var(--fx-text); margin:16px 0 6px; }
.fx-doc__body p{ margin:0 0 10px; }

.fx-legal-meta{ font-family:var(--fx-mono); font-size:11px; color:var(--fx-text-faint); line-height:1.5; word-break:break-all; }

.fx-check{ display:flex; align-items:flex-start; gap:12px; min-height:var(--fx-tap); padding:10px 0; cursor:pointer; }
.fx-check__box{
  flex-shrink:0; width:24px; height:24px; margin-top:1px; border-radius:6px;
  appearance:none; -webkit-appearance:none;
  background:var(--fx-surface); border:1.5px solid var(--fx-border-strong);
  display:grid; place-content:center; cursor:pointer;
  transition:background 160ms var(--fx-ease), border-color 160ms var(--fx-ease);
}
.fx-check__box::after{
  content:''; width:11px; height:6px; margin-top:-3px;
  border-left:2.5px solid var(--fx-text); border-bottom:2.5px solid var(--fx-text);
  transform:rotate(-45deg) scale(0); transition:transform 140ms var(--fx-ease);
}
.fx-check__box:checked{ background:var(--fx-accent); border-color:var(--fx-accent); }
.fx-check__box:checked::after{ transform:rotate(-45deg) scale(1); }
.fx-check__text{ font-size:14px; line-height:1.45; color:var(--fx-text); }

.fx-sigpad{ display:flex; flex-direction:column; gap:8px; }
.fx-sigpad__canvas{
  display:block; width:100%; max-width:600px; aspect-ratio:3/1; height:auto;
  border-radius:12px; border:1px solid var(--fx-border-strong);
  touch-action:none; cursor:crosshair;
  background:var(--fx-text); /* the drawn surface is white-ish; the export fills pure white */
}
.fx-sigpad__actions{ display:flex; justify-content:space-between; align-items:center; gap:10px; max-width:600px; }
.fx-sigpad__hint{ font-size:12px; color:var(--fx-text-faint); }

.fx-steps{ display:flex; flex-direction:column; gap:0; list-style:none; }
.fx-step{ display:flex; align-items:flex-start; gap:12px; padding:12px 0; border-bottom:1px solid var(--fx-border); }
.fx-step:last-child{ border-bottom:none; }
.fx-step__n{
  flex-shrink:0; width:28px; height:28px; border-radius:50%;
  display:grid; place-content:center;
  background:var(--fx-surface-2); border:1px solid var(--fx-border-strong);
  font-family:var(--fx-mono); font-size:12px; font-weight:700; color:var(--fx-text-dim);
}
.fx-step__body{ flex:1 1 auto; min-width:0; font-size:14px; line-height:1.4; padding-top:4px; }
.fx-step--done .fx-step__n{ background:var(--fx-green-soft); border-color:rgba(16,185,129,.35); color:var(--fx-green); }
.fx-step--done .fx-step__body{ color:var(--fx-text-dim); }
.fx-step--current .fx-step__n{ background:var(--fx-accent-soft); border-color:rgba(200,75,49,.4); color:var(--fx-accent-hi); }
.fx-step--current .fx-step__body{ color:var(--fx-text); font-weight:600; }

.fx-filedrop{
  display:flex; align-items:center; gap:14px;
  padding:14px; border-radius:12px;
  background:var(--fx-surface); border:1px dashed var(--fx-border-strong);
}
.fx-filedrop__preview{
  flex-shrink:0; width:88px; height:56px; border-radius:8px; object-fit:cover;
  background:var(--fx-surface-2); border:1px solid var(--fx-border);
}
.fx-filedrop__meta{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:6px; font-size:13px; color:var(--fx-text-dim); }

.fx-masked{ font-family:var(--fx-mono); font-size:16px; letter-spacing:.08em; color:var(--fx-text); }

.fx-grid2{ display:grid; grid-template-columns:1fr; gap:12px; }
@media (min-width:560px){ .fx-grid2{ grid-template-columns:1fr 1fr; } }

.fx-formsection{ display:flex; flex-direction:column; gap:12px; padding-bottom:4px; }
.fx-formsection__title{ font-size:15px; font-weight:650; color:var(--fx-text); margin-bottom:2px; }

/* ===== v3 training ======================================================= */
.fx-xp{ display:flex; align-items:baseline; gap:6px; }
.fx-xp__num{ font-size:34px; font-weight:700; letter-spacing:-.02em; line-height:1; }
.fx-xp__label{ font-size:13px; font-weight:600; color:var(--fx-accent-hi); letter-spacing:.08em; }
.fx-bar{ height:8px; border-radius:99px; background:var(--fx-surface-3); overflow:hidden; }
.fx-bar__fill{ display:block; height:100%; border-radius:inherit; background:var(--fx-accent); transition:width .4s var(--fx-ease); }
.fx-sync{ display:flex; align-items:center; gap:8px; font-size:13px; }
.fx-sync__dot{ width:8px; height:8px; border-radius:50%; background:var(--fx-green); flex-shrink:0; }
.fx-sync__dot--pending{ background:var(--fx-amber); }
.fx-module__head{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.fx-module__title{ margin:0; font-size:16px; line-height:1.3; }
.fx-lessons{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; }
.fx-lesson{
  display:flex; align-items:center; gap:12px; width:100%; min-height:var(--fx-tap); padding:10px 4px;
  background:none; border:0; border-top:1px solid var(--fx-border); color:var(--fx-text);
  font:inherit; font-size:14px; text-align:left; cursor:pointer;
}
.fx-lessons li:first-child .fx-lesson{ border-top:0; }
.fx-lesson:hover .fx-lesson__title{ color:var(--fx-accent-hi); }
.fx-lesson:focus-visible{ outline:2px solid var(--fx-accent-hi); outline-offset:2px; border-radius:6px; }
.fx-lesson__mark{
  width:24px; height:24px; border-radius:50%; flex-shrink:0; display:grid; place-items:center;
  border:1px solid var(--fx-border-strong); font-size:12px; font-weight:700; color:var(--fx-text-dim);
}
.fx-lesson.is-done .fx-lesson__mark{ background:var(--fx-green-soft); border-color:transparent; color:var(--fx-green); }
.fx-lesson.is-soon{ color:var(--fx-text-faint); }
.fx-lesson.is-soon .fx-lesson__mark{ width:auto; padding:0 6px; border-radius:99px; font-size:10px; font-weight:600; }
.fx-lesson__title{ flex:1; min-width:0; }
.fx-lesson__meta{ font-size:12px; color:var(--fx-text-faint); white-space:nowrap; }
.fx-back{ align-self:flex-start; min-height:40px; }
.fx-lesson-body{ font-size:15px; line-height:var(--fx-doc-lead); color:var(--fx-text-dim); }
.fx-lesson-body > :first-child{ margin-top:0; }
.fx-lesson-body > :last-child{ margin-bottom:0; }
.fx-lesson-body h3{ font-size:15px; font-weight:650; color:var(--fx-text); margin:18px 0 6px; }
.fx-lesson-body p{ margin:0 0 12px; }
.fx-lesson-body ul{ margin:0 0 12px; padding-left:20px; }
.fx-lesson-body li{ margin:0 0 6px; }
.fx-lesson-body strong{ color:var(--fx-text); }

/* ===== v4 tool checklist + roster ======================================== */
.fx-tool{
  display:flex; align-items:flex-start; gap:12px; width:100%; min-height:var(--fx-tap); padding:12px 4px;
  border-top:1px solid var(--fx-border); cursor:pointer; color:var(--fx-text); font-size:14px;
}
.fx-lessons li:first-child .fx-tool{ border-top:0; }
.fx-tool__check{ width:22px; height:22px; margin:1px 0 0; flex-shrink:0; accent-color:var(--fx-accent); cursor:pointer; }
.fx-tool__body{ flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.fx-tool__name{ font-weight:600; line-height:1.3; }
.fx-tool.is-done .fx-tool__name{ color:var(--fx-text-dim); }
.fx-tool__warn{ color:var(--fx-red); margin-right:6px; letter-spacing:-.1em; }
.fx-tool__why{ font-size:13px; color:var(--fx-text-dim); line-height:1.45; }
.fx-tool__where{ font-size:12px; color:var(--fx-text-faint); }
.fx-tool__tier{ flex-shrink:0; }
.fx-roster{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:12px; }
.fx-roster__name{ font-weight:650; font-size:16px; }
.fx-stats{ display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:12px 16px; }
.fx-stat{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.fx-stat__num{ font-size:20px; font-weight:700; letter-spacing:-.02em; line-height:1.1; }
.fx-stat__label{ font-size:12px; color:var(--fx-text-faint); }
