/* ==========================================================================
   Private Client Portal — stylesheet
   Light is the base; dark is a selected theme, not an automatic inversion.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Surfaces */
  --plane:        #f4f5f7;
  --surface-1:    #ffffff;
  --surface-2:    #fafbfc;
  --surface-3:    #f0f2f5;
  --rail:         #101724;
  --rail-2:       #182131;

  /* Ink */
  --text-primary:   #0b0e14;
  --text-secondary: #4d5665;
  --text-muted:     #808995;
  --rail-text:      #e8ecf2;
  --rail-muted:     #8794a8;

  /* Lines */
  --border:      #e3e6ea;
  --border-soft: #eef0f3;
  --grid:        #e8eaee;

  /* Accent */
  --accent:      #2a78d6;
  --accent-ink:  #1c5cab;
  --accent-wash: #eaf2fd;

  /* Categorical series — validated light steps */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-track: #e8eaee;

  /* Status (fixed, never themed) */
  --good:     #0ca30c;
  --warning:  #fab219;
  --serious:  #ec835a;
  --critical: #d03b3b;
  --good-wash:     #eaf7ea;
  --warning-wash:  #fdf5e3;
  --critical-wash: #fbecec;
  --neutral-wash:  #eef0f3;

  --shadow-sm: 0 1px 2px rgba(11, 14, 20, .06);
  --shadow-md: 0 4px 16px rgba(11, 14, 20, .08);
  --shadow-lg: 0 16px 48px rgba(11, 14, 20, .14);

  --radius:    12px;
  --radius-sm: 8px;
  --rail-w:    264px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;

  --plane:        #0b0e14;
  --surface-1:    #131820;
  --surface-2:    #171d27;
  --surface-3:    #1d242f;
  --rail:         #0e131b;
  --rail-2:       #171d27;

  --text-primary:   #f2f5f9;
  --text-secondary: #a9b4c4;
  --text-muted:     #79879b;
  --rail-text:      #e8ecf2;
  --rail-muted:     #7d8b9f;

  --border:      #242c39;
  --border-soft: #1c232e;
  --grid:        #232b37;

  --accent:      #3987e5;
  --accent-ink:  #6da7ec;
  --accent-wash: #16233a;

  /* Dark steps of the same eight hues, validated against #131820 */
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-track: #242c39;

  --good-wash:     #10261a;
  --warning-wash:  #2b2210;
  --critical-wash: #2c1618;
  --neutral-wash:  #1d242f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .45);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .6);
}

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--plane);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent); }

/* ==========================================================================
   LOGIN
   ========================================================================== */

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(1000px 600px at 15% -10%, rgba(42, 120, 214, .16), transparent 60%),
    radial-gradient(900px 500px at 95% 110%, rgba(27, 175, 122, .12), transparent 60%),
    var(--plane);
}

.login-card {
  width: 100%;
  max-width: 412px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 40px 36px 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 30px;
}

.brand-mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--accent), var(--accent-ink));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px;
  letter-spacing: -.02em;
  flex: none;
}

.brand-name { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.brand-sub  { font-size: 12.5px; color: var(--text-muted); }

.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-lede { color: var(--text-secondary); font-size: 14px; margin-bottom: 26px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.input, .select {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23808995' stroke-width='1.75' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}

.btn {
  width: 100%;
  padding: 12px 16px;
  font: inherit; font-size: 14.5px; font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, transform .06s;
}
.btn:hover  { background: var(--accent-ink); }
.btn:active { transform: translateY(1px); }

.login-error {
  display: none;
  margin-bottom: 16px;
  padding: 10px 13px;
  font-size: 13.5px;
  color: var(--critical);
  background: var(--critical-wash);
  border: 1px solid color-mix(in srgb, var(--critical) 26%, transparent);
  border-radius: var(--radius-sm);
}
.login-error.show { display: block; }

.login-foot {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   APP SHELL
   ========================================================================== */

.app { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.rail {
  width: var(--rail-w);
  flex: none;
  background: var(--rail);
  color: var(--rail-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.rail-head { padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.rail .brand-name { color: var(--rail-text); }
.rail .brand-sub  { color: var(--rail-muted); }

.rail-user {
  display: flex; align-items: center; gap: 11px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.avatar {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-ink));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 650; font-size: 13.5px;
}
.rail-user-name { font-size: 14px; font-weight: 600; color: var(--rail-text); }
.rail-user-role { font-size: 12px; color: var(--rail-muted); }

.nav { padding: 12px 12px; flex: 1; }
.nav-label {
  padding: 12px 8px 6px;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--rail-muted);
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 10px;
  margin-bottom: 2px;
  font: inherit; font-size: 14px;
  text-align: left;
  color: var(--rail-muted);
  background: none; border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .13s, color .13s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: var(--rail-text); }
.nav-item.active { background: var(--rail-2); color: #fff; font-weight: 550; }
.nav-item.active .nav-dot { background: var(--accent); }
.nav-dot {
  width: 6px; height: 6px; flex: none;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  transition: background .13s;
}

.rail-foot { padding: 14px 20px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.rail-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 8px 10px;
  font: inherit; font-size: 13px;
  color: var(--rail-muted);
  background: none; border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  cursor: pointer; margin-bottom: 8px;
  transition: background .13s, color .13s;
}
.rail-btn:hover { background: rgba(255,255,255,.06); color: var(--rail-text); }
.rail-btn:last-child { margin-bottom: 0; }

/* --- Main --- */
.main { flex: 1; min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px 32px;
  background: color-mix(in srgb, var(--plane) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 19px; }
.topbar-sub { font-size: 13px; color: var(--text-muted); margin-top: 1px; }

.asof {
  font-size: 12px; color: var(--text-muted);
  padding: 5px 11px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 100px;
  white-space: nowrap;
}

.menu-btn {
  display: none;
  padding: 7px 10px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font: inherit; cursor: pointer;
}

.content { padding: 28px 32px 72px; max-width: 1240px; }

.view { display: none; }
.view.active { display: block; animation: fade .22s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   BUILDING BLOCKS
   ========================================================================== */

.section { margin-bottom: 30px; }
.section-head { margin-bottom: 14px; }
.section-head h2 { font-size: 16px; }
.section-head p  { font-size: 13.5px; color: var(--text-secondary); margin-top: 3px; }

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px 24px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* --- Hero figure --- */
.hero {
  padding: 30px 28px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--surface-1)), var(--surface-1) 62%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.hero-label {
  font-size: 12px; font-weight: 650;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.hero-value {
  font-size: 56px; font-weight: 680;
  letter-spacing: -.035em; line-height: 1;
  color: var(--text-primary);
}
.hero-value.sm { font-size: 34px; }
.hero-caption {
  margin-top: 12px;
  font-size: 13.5px; color: var(--text-secondary);
  max-width: 62ch;
}

/* --- Stat tiles --- */
.stat { padding: 18px 20px; }
.stat-label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.stat-value {
  margin-top: 7px;
  font-size: 27px; font-weight: 650;
  letter-spacing: -.025em; line-height: 1.12;
  color: var(--text-primary);
}
.stat-value.muted { color: var(--text-muted); font-size: 22px; }
.stat-caption { margin-top: 7px; font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.stat-flag { margin-top: 10px; }

/* --- Status pills --- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 7px;
  font-size: 11.5px; font-weight: 600;
  border-radius: 100px;
  white-space: nowrap;
}
.pill-icon { font-size: 10px; line-height: 1; }
.pill-done    { color: var(--good);     background: var(--good-wash); }
.pill-active  { color: var(--accent-ink); background: var(--accent-wash); }
.pill-pending { color: var(--text-secondary); background: var(--neutral-wash); }
.pill-risk    { color: var(--critical); background: var(--critical-wash); }
[data-theme="dark"] .pill-done   { color: #3fce3f; }
[data-theme="dark"] .pill-risk   { color: #f07a7a; }
[data-theme="dark"] .pill-active { color: #7db3f0; }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
  color: var(--text-secondary);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }
td.key { color: var(--text-primary); font-weight: 550; width: 30%; }
td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-primary); font-weight: 550; }
td.pending { color: var(--text-muted); font-style: italic; font-weight: 400; }

/* --- Note / callout --- */
.note {
  padding: 14px 18px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: var(--radius-sm);
}
.note strong { color: var(--text-primary); }
.note-accent { border-left-color: var(--accent); background: var(--accent-wash); }
.note-risk   { border-left-color: var(--critical); background: var(--critical-wash); }

/* ==========================================================================
   CHARTS
   ========================================================================== */

.chart-head { margin-bottom: 4px; }
.chart-title { font-size: 15px; font-weight: 600; }
.chart-sub { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.legend {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin: 14px 0 20px;
  font-size: 12.5px; color: var(--text-secondary);
}
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-key { width: 11px; height: 11px; border-radius: 3px; flex: none; }

/* --- Stacked exposure bar --- */
.expo { margin-bottom: 26px; }
.expo:last-child { margin-bottom: 0; }
.expo-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 9px;
}
.expo-name { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.expo-name span { font-weight: 400; color: var(--text-muted); }
.expo-tax { font-size: 13.5px; font-weight: 650; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.expo-tax small { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); text-align: right; }

.expo-track {
  display: flex;
  gap: 2px;                       /* the surface gap between segments */
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface-1);
}
.expo-seg { position: relative; transition: filter .13s; }
.expo-seg:hover { filter: brightness(1.08); }
.expo-seg:first-child { border-radius: 4px 0 0 4px; }
.expo-seg:last-child  { border-radius: 0 4px 4px 0; }
.expo-labels {
  display: flex; justify-content: space-between;
  margin-top: 7px;
  font-size: 12px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* --- Allocation bars --- */
.alloc-row { padding: 15px 0; border-bottom: 1px solid var(--border-soft); }
.alloc-row:last-child { border-bottom: none; }
.alloc-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.alloc-name { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 550; color: var(--text-primary); }
.alloc-key { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.alloc-range { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.alloc-track {
  position: relative;
  height: 10px;
  background: var(--series-track);
  border-radius: 5px;
  overflow: hidden;
}
.alloc-fill { height: 100%; border-radius: 5px 4px 4px 5px; transition: width .5s cubic-bezier(.22,1,.36,1); }
.alloc-purpose { margin-top: 8px; font-size: 12.5px; color: var(--text-muted); }

/* ==========================================================================
   TIMELINE / PLAN
   ========================================================================== */

.phase { margin-bottom: 16px; }
.phase-head {
  display: flex; align-items: center; gap: 11px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-soft);
}
.phase-window {
  font-size: 11.5px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-wash);
  padding: 4px 10px; border-radius: 5px;
  white-space: nowrap;
}
[data-theme="dark"] .phase-window { color: #7db3f0; }
.phase-title { font-size: 15px; font-weight: 600; flex: 1; }

.tasks { list-style: none; margin: 0; padding: 8px 22px 18px; }
.tasks li {
  display: flex; gap: 12px;
  padding: 10px 0;
  font-size: 13.5px; line-height: 1.55;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-soft);
}
.tasks li:last-child { border-bottom: none; }
.tasks li::before {
  content: ""; flex: none;
  width: 6px; height: 6px; margin-top: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: .45;
}

/* --- Vertical timeline --- */
.tl { position: relative; padding-left: 30px; }
.tl::before {
  content: ""; position: absolute;
  left: 7px; top: 10px; bottom: 10px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding: 0 0 24px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute;
  left: -30px; top: 5px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface-1);
  border: 2px solid var(--border);
  box-shadow: 0 0 0 4px var(--plane);
}
/* Solid marker = the phase happened. Ring = upcoming or in focus. */
.tl-item.is-done::before   { border-color: var(--accent); background: var(--accent); }
.tl-item.is-active::before { border-color: var(--accent); background: var(--surface-1); border-width: 3px; }
.tl-when { font-size: 13.5px; font-weight: 650; color: var(--text-primary); margin-bottom: 3px; }
.tl-focus { font-size: 13.5px; color: var(--text-secondary); }

/* ==========================================================================
   ACCORDION / DETAIL LISTS
   ========================================================================== */

.acc { border-bottom: 1px solid var(--border-soft); }
.acc:last-child { border-bottom: none; }
.acc-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 15px 22px;
  font: inherit; text-align: left;
  color: var(--text-primary);
  background: none; border: none; cursor: pointer;
  transition: background .13s;
}
.acc-btn:hover { background: var(--surface-2); }
.acc-name { flex: 1; font-size: 14px; font-weight: 550; }
.acc-chev {
  flex: none; color: var(--text-muted); font-size: 11px;
  transition: transform .18s;
}
.acc.open .acc-chev { transform: rotate(90deg); }
.acc-body {
  display: none;
  padding: 0 22px 18px 22px;
  font-size: 13.5px; line-height: 1.62;
  color: var(--text-secondary);
  max-width: 82ch;
}
.acc.open .acc-body { display: block; }

/* --- Checklist --- */
.check-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 22px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
  color: var(--text-secondary);
}
.check-row:last-child { border-bottom: none; }
.check-box {
  flex: none; width: 17px; height: 17px; margin-top: 1px;
  border: 1.75px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 10px; color: transparent;
}
.check-row.have .check-box { background: var(--good); border-color: var(--good); color: #fff; }
.check-row.have { color: var(--text-muted); text-decoration: line-through; }

/* --- Rule list: standing principles, not to-do items.
       Uses a filled mark so it never reads as an unchecked box. --- */
.rule-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 22px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px; line-height: 1.55;
  color: var(--text-secondary);
}
.rule-row:last-child { border-bottom: none; }
.rule-mark {
  flex: none; width: 17px; height: 17px; margin-top: 2px;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-size: 9.5px; font-weight: 700;
}
[data-theme="dark"] .rule-mark { color: #7db3f0; }
.rule-mark.ask { background: var(--neutral-wash); color: var(--text-secondary); font-size: 11px; }

/* --- Explainer cards --- */
.explain { padding: 20px 22px; }
.explain h3 { font-size: 14.5px; margin-bottom: 7px; }
.explain p  { font-size: 13.5px; line-height: 1.62; color: var(--text-secondary); }

.disclaimer {
  margin-top: 34px; padding: 18px 20px;
  font-size: 12px; line-height: 1.68;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.empty {
  padding: 40px 24px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

.scrim { display: none; }

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .rail {
    position: fixed; z-index: 60; left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .rail.open { transform: none; }
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 50;
    background: rgba(0,0,0,.45);
    opacity: 0; pointer-events: none;
    transition: opacity .22s;
  }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .menu-btn { display: block; }
  .topbar { padding: 14px 18px; }
  .content { padding: 20px 18px 60px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .hero-value { font-size: 40px; }
  .hero { padding: 24px 20px; }
  td.key { width: auto; }
}

@media print {
  .rail, .topbar, .scrim { display: none !important; }
  .view { display: block !important; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* Inline "not filled in yet" ink, for use inside a table cell. */
.pending-ink { color: var(--text-muted); font-style: italic; }

/* ==========================================================================
   SVG CHARTS
   ========================================================================== */

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }

.grid-line   { stroke: var(--grid); stroke-width: 1; }
.axis-line   { stroke: var(--border); stroke-width: 1; }
.axis-text   { fill: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.axis-text.y { text-anchor: end; }
.axis-text.x { text-anchor: middle; }
.series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.series-area { stroke: none; opacity: .10; }
/* 2px ring in the surface color keeps a dot legible where marks overlap. */
.series-dot  { stroke: var(--surface-1); stroke-width: 2; }
.end-label   { fill: var(--text-primary); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.col-cap     { fill: var(--text-primary); font-size: 12px; font-weight: 600; text-anchor: middle; font-variant-numeric: tabular-nums; }
.col-rect    { transition: filter .12s; }
.col-hit:hover + .col-rect, .col-rect:hover { filter: brightness(1.1); }

.crosshair { stroke: var(--text-muted); stroke-width: 1; opacity: 0; pointer-events: none; }
.crosshair.on { opacity: .45; }
.hover-dot { opacity: 0; pointer-events: none; }
.hover-dot.on { opacity: 1; }

.chart-tip {
  position: absolute;
  z-index: 5;
  min-width: 150px;
  padding: 9px 11px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .1s;
}
.chart-tip.on { opacity: 1; }
.tip-head {
  font-weight: 650; color: var(--text-primary);
  margin-bottom: 6px; padding-bottom: 5px;
  border-bottom: 1px solid var(--border-soft);
}
.tip-row {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 0; color: var(--text-secondary);
}
.tip-key { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.tip-val {
  margin-left: auto; font-weight: 600; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Table view — the relief channel for hues below 3:1 on the light surface,
   and the way any value stays reachable without hovering. */
.chart-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 14px; padding-top: 13px;
  border-top: 1px solid var(--border-soft);
}
.chart-note { font-size: 12.5px; color: var(--text-muted); flex: 1; }
.tbl-btn {
  flex: none;
  padding: 6px 12px;
  font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: background .13s, color .13s;
}
.tbl-btn:hover { background: var(--surface-3); color: var(--text-primary); }
.chart-table { display: none; margin-top: 16px; }
.chart-table.on { display: block; }
.chart-table table { font-size: 13px; }
.chart-table thead th { background: var(--surface-2); }

/* Assumption chips — a projection must show what it assumed. */
.assump { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.assump-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 5px 11px;
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
}
.assump-chip b {
  font-weight: 650; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Numbered step marker, for ordered playbooks inside a rule list. */
.rule-mark.step {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   SCHEDULER
   ========================================================================== */

.sched-dates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.date-card {
  padding: 16px 18px;
  text-align: left;
  font: inherit;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .13s, background .13s, box-shadow .13s;
}
.date-card:hover { border-color: var(--accent); background: var(--surface-2); }
.date-card.on {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--accent-wash);
}
.date-dow   { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.date-day   { font-size: 22px; font-weight: 650; letter-spacing: -.02em; color: var(--text-primary); margin-top: 4px; }
.date-avail { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.date-card.on .date-dow, .date-card.on .date-avail { color: var(--accent-ink); }
[data-theme="dark"] .date-card.on .date-dow,
[data-theme="dark"] .date-card.on .date-avail { color: #7db3f0; }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 10px;
}
.slot {
  padding: 12px 10px;
  font: inherit; font-size: 14px; font-weight: 550;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .13s, background .13s, color .13s;
}
.slot:hover { border-color: var(--accent); background: var(--surface-2); }
.slot.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.sched-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}
.sched-summary { font-size: 13.5px; color: var(--text-secondary); }
.sched-summary strong { color: var(--text-primary); }
.btn-inline {
  flex: none;
  padding: 11px 22px;
  font: inherit; font-size: 14px; font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none; border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .13s, opacity .13s;
}
.btn-inline:hover:not(:disabled) { background: var(--accent-ink); }
.btn-inline:disabled { opacity: .4; cursor: not-allowed; }
.btn-ghost {
  padding: 9px 18px;
  font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text-primary); }

/* --- Confirmation --- */
.conf-head {
  padding: 26px 28px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(135deg, color-mix(in srgb, var(--good) 8%, var(--surface-1)), var(--surface-1) 62%);
  border-radius: var(--radius) var(--radius) 0 0;
}
.conf-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px;
  font-size: 12px; font-weight: 650;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--good);
  background: var(--good-wash);
  border-radius: 100px;
  margin-bottom: 14px;
}
[data-theme="dark"] .conf-badge { color: #3fce3f; }
.conf-when { font-size: 26px; font-weight: 650; letter-spacing: -.02em; color: var(--text-primary); }
.conf-sub  { font-size: 13.5px; color: var(--text-secondary); margin-top: 6px; }
.conf-ref {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.conf-ref b { color: var(--text-secondary); font-weight: 650; letter-spacing: .04em; }
.conf-actions { display: flex; gap: 10px; padding: 18px 28px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .sched-dates { grid-template-columns: minmax(0, 1fr); }
  .conf-when { font-size: 21px; }
}

/* Small inline qualifier that sits beside a name, e.g. attendance status. */
.tag-inline {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 7px;
  font-size: 10.5px; font-weight: 650;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--neutral-wash);
  border: 1px solid var(--border);
  border-radius: 4px;
  vertical-align: 1px;
  white-space: nowrap;
}

/* ==========================================================================
   INTAKE FORM
   ========================================================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }

.f-label {
  display: block;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.f-label .req { color: var(--critical); margin-left: 2px; }
.f-hint { font-weight: 400; color: var(--text-muted); }

.f-input {
  width: 100%;
  padding: 10px 12px;
  font: inherit; font-size: 14px;
  color: var(--text-primary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .13s, box-shadow .13s;
}
.f-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
  background: var(--surface-1);
}
.f-input.bad { border-color: var(--critical); background: var(--critical-wash); }
textarea.f-input { min-height: 92px; resize: vertical; line-height: 1.55; }

.f-errors {
  margin-bottom: 18px;
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--critical);
  background: var(--critical-wash);
  border: 1px solid color-mix(in srgb, var(--critical) 26%, transparent);
  border-radius: var(--radius-sm);
}
.f-errors ul { margin: 6px 0 0; padding-left: 18px; }
.f-errors li { margin-top: 2px; }

/* Who you are meeting, shown on the date card */
.date-with {
  margin-top: 10px; padding-top: 9px;
  border-top: 1px solid var(--border-soft);
  font-size: 12.5px;
}
.date-with b { display: block; color: var(--text-primary); font-weight: 600; }
.date-with span { color: var(--text-muted); }
.date-card.on .date-with { border-top-color: color-mix(in srgb, var(--accent) 26%, transparent); }

.step-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.step-n {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.step-n.off { background: var(--neutral-wash); color: var(--text-muted); }
.step-head h2 { font-size: 16px; }
.step-head p  { font-size: 13.5px; color: var(--text-secondary); margin-top: 2px; }

@media (max-width: 860px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* A slot already held by another account. Not clickable. */
.slot.taken {
  color: var(--text-muted);
  background: var(--surface-3);
  border-color: var(--border);
  border-style: dashed;
  cursor: not-allowed;
}
.slot.taken:hover { border-color: var(--border); background: var(--surface-3); }
.slot.taken .slot-t { text-decoration: line-through; }
.slot-tag {
  display: block;
  margin-top: 3px;
  font-size: 10.5px; font-weight: 650;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted);
}
.date-card.full { opacity: .62; }

/* ==========================================================================
   INTAKE WORKSHEETS (will / trust)
   ========================================================================== */

.wk-tabs { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.wk-tab {
  padding: 9px 16px;
  font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: background .13s, color .13s, border-color .13s;
}
.wk-tab:hover { background: var(--surface-2); color: var(--text-primary); }
.wk-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.wk-tab .wk-count { opacity: .75; font-weight: 500; margin-left: 5px; }

.wk-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; margin-bottom: 18px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.wk-track {
  flex: 1; height: 7px;
  background: var(--series-track);
  border-radius: 4px; overflow: hidden;
}
.wk-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .35s ease; }
.wk-pct { font-size: 13px; font-weight: 650; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wk-saved { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.wk-sec { margin-bottom: 18px; }
.wk-sec-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 15px 22px;
  border-bottom: 1px solid var(--border-soft);
}
.wk-sec-n {
  font-size: 11.5px; font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
  flex: none;
}
[data-theme="dark"] .wk-sec-n { color: #7db3f0; }
.wk-sec-head h3 { font-size: 14.5px; font-weight: 650; flex: 1; }
.wk-sec-body { padding: 20px 22px; }
.wk-sec-note {
  margin: -4px 0 18px;
  font-size: 12.5px; line-height: 1.6;
  color: var(--text-muted);
  padding-left: 11px;
  border-left: 2px solid var(--border);
}

.opt-list { display: flex; flex-direction: column; gap: 9px; }
.opt-list.cols { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px 18px; }
.opt {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13.5px; line-height: 1.5;
  color: var(--text-secondary);
  cursor: pointer;
}
.opt input { margin: 2px 0 0; flex: none; accent-color: var(--accent); width: 15px; height: 15px; }
.opt span b { display: block; color: var(--text-primary); font-weight: 600; }

.wk-rows { width: 100%; border-collapse: collapse; }
.wk-rows th {
  padding: 8px 10px; text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.wk-rows td { padding: 6px 5px; vertical-align: top; }
.wk-rows td:first-child { padding-left: 0; width: 26px; color: var(--text-muted); font-size: 12px; padding-top: 16px; font-variant-numeric: tabular-nums; }
.wk-rows .f-input { padding: 8px 10px; font-size: 13.5px; }

.wk-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

@media (max-width: 860px) {
  .opt-list.cols { grid-template-columns: minmax(0,1fr); }
  .wk-rows, .wk-rows tbody, .wk-rows tr, .wk-rows td { display: block; width: 100%; }
  .wk-rows thead { display: none; }
  .wk-rows tr { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
  .wk-rows td:first-child { padding-top: 0; }
}

@media print {
  .wk-tabs, .wk-foot, .btn-inline, .btn-ghost { display: none !important; }
  .wk-sec { break-inside: avoid; }
}

/* A restricted account in the sign-in picker. */
.select option:disabled { color: var(--text-muted); }

/* Locked worksheet: answers stay readable and selectable, choices are fixed. */
.f-input[readonly] {
  background: var(--surface-3);
  color: var(--text-secondary);
  cursor: default;
}
.f-input[readonly]:focus { border-color: var(--border); box-shadow: none; }
.f-input:disabled { background: var(--surface-3); color: var(--text-secondary); cursor: not-allowed; }
.opt input:disabled { cursor: not-allowed; }
.opt input:disabled + span { color: var(--text-muted); }
.opt input:disabled:checked + span { color: var(--text-secondary); }
.wk-locked {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px;
  font-size: 11.5px; font-weight: 650;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-wash);
  border-radius: 100px;
  white-space: nowrap;
}
[data-theme="dark"] .wk-locked { color: #7db3f0; }

/* ==========================================================================
   READINESS PANEL
   ========================================================================== */

.ready {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--good);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
}
.ready-top { padding: 26px 28px 22px; }
.ready-eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.ready-eyebrow .sep { flex: 1; height: 1px; background: var(--border-soft); }
.ready-h {
  font-size: 27px; font-weight: 680;
  letter-spacing: -.025em; line-height: 1.15;
  color: var(--text-primary);
}
.ready-sub {
  margin-top: 8px;
  font-size: 14px; line-height: 1.6;
  color: var(--text-secondary);
  max-width: 74ch;
}
.ready-count {
  margin-top: 16px;
  font-size: 13px; font-weight: 650;
  color: var(--good);
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .ready-count { color: #3fce3f; }

.ready-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border-soft);
  border-top: 1px solid var(--border-soft);
}
.ready-cell {
  background: var(--surface-1);
  padding: 14px 18px;
}
.ready-cell-n {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 7px;
}
.ready-tick { color: var(--good); font-size: 11px; flex: none; }
[data-theme="dark"] .ready-tick { color: #3fce3f; }
.ready-cell-s { margin-top: 3px; font-size: 11.5px; color: var(--text-muted); }

.ready-out {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 28px;
  background: var(--accent-wash);
  border-top: 1px solid var(--border-soft);
}
.ready-out-mark {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ready-out-t {
  font-size: 15px; font-weight: 650;
  color: var(--text-primary);
}
.ready-out-b {
  margin-top: 4px;
  font-size: 13.5px; line-height: 1.6;
  color: var(--text-secondary);
  max-width: 78ch;
}

@media (max-width: 1080px) { .ready-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .ready-grid { grid-template-columns: minmax(0, 1fr); } .ready-h { font-size: 21px; } }

/* ==========================================================================
   SIGNABLE DOCUMENT (recording consent)
   ========================================================================== */

.doc-sheet {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-width: 880px;
  margin: 0 auto;
  overflow: hidden;
}
.doc-rule { height: 3px; background: var(--accent); }

.doc-head {
  padding: 34px 48px 26px;
  text-align: center;
  border-bottom: 1px solid var(--border-soft);
}
.doc-org {
  font-size: 11px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-muted);
}
.doc-title {
  margin-top: 14px;
  font-size: 22px; font-weight: 680;
  letter-spacing: -.01em;
  color: var(--text-primary);
  text-transform: uppercase;
}
.doc-sub {
  margin-top: 6px;
  font-size: 13px; color: var(--text-secondary);
}
.doc-meta {
  display: flex; justify-content: center; gap: 26px; flex-wrap: wrap;
  margin-top: 16px;
  font-size: 11.5px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.doc-meta b { color: var(--text-secondary); font-weight: 650; letter-spacing: .03em; }

.doc-body { padding: 30px 48px 34px; }
.doc-lead {
  font-size: 14px; line-height: 1.7;
  color: var(--text-secondary);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 8px;
}
.doc-parties {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 18px; margin-bottom: 24px;
}
.doc-party { font-size: 13.5px; }
.doc-party-l {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 4px;
}
.doc-party-v { color: var(--text-primary); font-weight: 600; }
.doc-party-s { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }

.doc-clause { display: flex; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--border-soft); }
.doc-clause:last-of-type { border-bottom: none; }
.doc-cn {
  flex: none; width: 26px;
  font-size: 13px; font-weight: 700;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}
[data-theme="dark"] .doc-cn { color: #7db3f0; }
.doc-ct { font-size: 13.5px; font-weight: 650; color: var(--text-primary); margin-bottom: 4px; }
.doc-cb { font-size: 13.5px; line-height: 1.68; color: var(--text-secondary); }

.doc-attest {
  margin: 26px 0 8px;
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px; line-height: 1.65;
  color: var(--text-primary);
}

.sig-block {
  margin-top: 30px; padding-top: 26px;
  border-top: 2px solid var(--border);
}
.sig-h {
  font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.sig-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 26px; }
.sig-slot { min-width: 0; }
.sig-line {
  border-bottom: 1.5px solid var(--text-primary);
  padding: 6px 2px 8px;
  min-height: 46px;
  display: flex; align-items: flex-end;
}
.sig-ink {
  font-family: "Snell Roundhand", "Apple Chancery", "Segoe Script", "Brush Script MT", cursive;
  font-size: 30px; line-height: 1.1;
  color: var(--text-primary);
  padding-bottom: 2px;
}
.sig-typed {
  font-size: 15px; color: var(--text-primary); font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.sig-cap {
  margin-top: 7px;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted);
}
.sig-print { margin-top: 3px; font-size: 12.5px; color: var(--text-secondary); }

.doc-foot {
  margin-top: 28px; padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  font-size: 11.5px; line-height: 1.6;
  color: var(--text-muted);
  display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}

.exec-stamp {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--good);
  background: var(--good-wash);
  border: 1px solid color-mix(in srgb, var(--good) 30%, transparent);
  border-radius: 4px;
}
[data-theme="dark"] .exec-stamp { color: #3fce3f; }

@media (max-width: 860px) {
  .doc-head { padding: 26px 22px 20px; }
  .doc-body { padding: 24px 22px 28px; }
  .doc-parties, .sig-grid { grid-template-columns: minmax(0,1fr); }
  .doc-title { font-size: 18px; }
  .sig-ink { font-size: 25px; }
}
@media print {
  .doc-sheet { box-shadow: none; border: none; max-width: none; }
  .btn-inline, .btn-ghost { display: none !important; }
}

/* ==========================================================================
   SIGNATURE PACKET INDEX
   ========================================================================== */

.pk-row {
  display: flex; align-items: center; gap: 16px;
  width: 100%; padding: 16px 22px;
  font: inherit; text-align: left;
  background: none; border: none;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background .13s;
}
.pk-row:last-child { border-bottom: none; }
.pk-row:hover { background: var(--surface-2); }
.pk-n {
  flex: none; width: 27px; height: 27px;
  border-radius: 50%;
  background: var(--neutral-wash); color: var(--text-secondary);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pk-row.done .pk-n { background: var(--good-wash); color: var(--good); }
[data-theme="dark"] .pk-row.done .pk-n { color: #3fce3f; }
.pk-main { flex: 1; min-width: 0; }
/* These are spans inside a button, so they need an explicit block display
   or the title and the subtitle run together on one line. */
.pk-t { display: block; font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.pk-s { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.pk-ref {
  flex: none; font-size: 11.5px; color: var(--text-muted);
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.pk-go { flex: none; color: var(--text-muted); font-size: 12px; }

.pk-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 22px; margin-bottom: 18px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pk-count { font-size: 13px; font-weight: 650; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pk-track { flex: 1; height: 7px; background: var(--series-track); border-radius: 4px; overflow: hidden; }
.pk-fill { height: 100%; background: var(--good); border-radius: 4px; transition: width .35s ease; }

.doc-back {
  display: inline-flex; align-items: center; gap: 7px;
  margin-bottom: 16px; padding: 7px 14px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
}
.doc-back:hover { background: var(--surface-2); color: var(--text-primary); }

.doc-excluded {
  margin: 22px 0 6px;
  padding: 16px 20px;
  background: var(--warning-wash);
  border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  font-size: 13.5px; line-height: 1.65;
  color: var(--text-secondary);
}
.doc-excluded b { color: var(--text-primary); }

/* ==========================================================================
   SIGNING MODAL (presented at sign-in)
   ========================================================================== */

.sign-scrim {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 11, 17, .62);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 34px 20px;
  overflow-y: auto;
}
.sign-modal {
  width: 100%; max-width: 920px;
  background: var(--plane);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  overflow: hidden;
}
.sign-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 15px 24px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 2;
}
.sign-step {
  font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.sign-dots { display: flex; gap: 6px; flex: 1; }
.sign-dot { height: 5px; flex: 1; border-radius: 3px; background: var(--series-track); }
.sign-dot.done { background: var(--good); }
.sign-dot.now  { background: var(--accent); }
.sign-skip {
  flex: none; padding: 7px 14px;
  font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text-muted);
  background: none; border: 1px solid var(--border);
  border-radius: 100px; cursor: pointer;
}
.sign-skip:hover { background: var(--surface-2); color: var(--text-primary); }
.sign-body { padding: 22px; max-height: none; }
.sign-done {
  padding: 46px 30px; text-align: center;
}
.sign-done-h { font-size: 22px; font-weight: 680; letter-spacing: -.02em; color: var(--text-primary); }
.sign-done-b { margin: 10px auto 22px; max-width: 54ch; font-size: 14px; line-height: 1.65; color: var(--text-secondary); }

@media (max-width: 860px) {
  .sign-scrim { padding: 0; }
  .sign-modal { border-radius: 0; min-height: 100vh; }
  .sign-body { padding: 12px; }
}

/* Note from the CPA, shown above the documents before they are read. */
.cpa-note {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 22px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.cpa-note-l {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.cpa-note-b {
  font-size: 15px; font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
}
.cpa-note-sig {
  display: flex; justify-content: flex-end; align-items: baseline; gap: 10px;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  font-size: 12.5px; color: var(--text-secondary);
}
.cpa-note-sig b { font-weight: 650; color: var(--text-primary); }
.cpa-note-sig span { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Schedule of accounts inside a signable document. */
.doc-sched { margin: 24px 0 6px; }
.doc-sched-h {
  font-size: 11px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.doc-sched table { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.doc-sched thead th { background: var(--surface-2); font-size: 10.5px; }
.doc-sched td { font-size: 13px; padding: 11px 14px; }
.acct-num { font-variant-numeric: tabular-nums; letter-spacing: .06em; color: var(--text-primary); font-weight: 600; }
.doc-sched-n { margin-top: 10px; font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
