/* SurgeIQ visual system: dark signal command shell, light operational product UI. */

:root {
  --navy: #07111f;
  --navy-2: #0b1220;
  --navy-hover: #132238;
  --cyan: #17e6c3;
  --cyan-ink: #0f766e;
  --cyan-soft: #ccfbf1;
  --green: #10b981;
  --green-ink: #047857;
  --green-soft: #ecfdf5;
  --amber: #f59e0b;
  --amber-ink: #92400e;
  --amber-soft: #fffbeb;
  --blue: #2563eb;
  --blue-ink: #1d4ed8;
  --blue-soft: #eff6ff;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;

  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --text: #101827;
  --muted: #64748b;
  --faint: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-border:
    0 0 0 1px rgba(7, 17, 31, .06),
    0 1px 2px -1px rgba(7, 17, 31, .08),
    0 3px 8px -4px rgba(7, 17, 31, .09);
  --shadow-border-hover:
    0 0 0 1px rgba(7, 17, 31, .1),
    0 2px 4px -2px rgba(7, 17, 31, .12),
    0 10px 24px -12px rgba(7, 17, 31, .2);
  --shadow-lift:
    0 0 0 1px rgba(7, 17, 31, .08),
    0 12px 32px -12px rgba(7, 17, 31, .28);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.2;
  text-wrap: balance;
}

h1 { font-size: clamp(1.65rem, 2.5vw, 2rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0; text-wrap: pretty; }
ul, ol { text-wrap: pretty; }
a { color: var(--cyan-ink); text-decoration: none; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }

.num, .surge-score, .badge, table, time {
  font-variant-numeric: tabular-nums;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 8px;
  z-index: 100;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--cyan);
  color: var(--navy);
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform .15s ease-out;
}

.skip-link:focus { transform: translateY(0); text-decoration: none; }

/* App shell */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 62px;
  padding: 0 clamp(16px, 3vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--navy);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 8px 22px -20px rgba(7, 17, 31, .9);
}

.topbar .brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #fff;
  font-size: 1.16rem;
  font-weight: 800;
  letter-spacing: -.04em;
}

.topbar .brand:hover { color: #fff; text-decoration: none; }

.primary-nav,
.topbar > nav {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.primary-nav a,
.topbar > nav a,
.topbar .linkbtn {
  min-height: 40px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  transition-property: color, background-color, box-shadow;
  transition-duration: .15s;
  transition-timing-function: ease-out;
}

.primary-nav a:hover,
.topbar > nav a:hover,
.topbar .linkbtn:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
  text-decoration: none;
}

.primary-nav a.active,
.topbar > nav a.active {
  background: rgba(23, 230, 195, .1);
  color: #fff;
  box-shadow: inset 0 -2px var(--cyan);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .07);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  cursor: pointer;
  transition-property: background-color, scale;
  transition-duration: .15s;
}

.nav-toggle:hover { background: rgba(255, 255, 255, .12); }
.nav-toggle:active { scale: .96; }
.nav-toggle span { width: 19px; height: 2px; border-radius: 2px; background: currentColor; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 30px auto 64px;
  padding: 0 24px;
  flex: 1 0 auto;
}

.container.narrow { max-width: 520px; margin-top: 48px; }
.page-head { margin-bottom: 22px; }
.page-head .sub { margin-top: 5px; color: var(--muted); font-size: .92rem; }
.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.row > *, .lead-line > * { min-width: 0; }
.pool-call-status { min-height: 1em; margin-bottom: 12px; font-size: .82rem; }

/* Controls */
.btn, .act,
button:not(.act):not(.btn):not(.linkbtn):not(.nav-toggle):not(.icon-act) {
  min-height: 42px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #fff;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 650;
  line-height: 1.1;
  cursor: pointer;
  transition-property: background-color, border-color, box-shadow, color, scale;
  transition-duration: .15s;
  transition-timing-function: ease-out;
}

.btn:hover, .act:hover,
button:not(.act):not(.btn):not(.linkbtn):not(.nav-toggle):not(.icon-act):hover {
  background: var(--navy-hover);
  color: #fff;
  text-decoration: none;
}

.btn:active, .act:active,
button:not(.act):not(.btn):not(.linkbtn):not(.nav-toggle):not(.icon-act):active { scale: .96; }

.btn.secondary, .act.secondary {
  border-color: transparent;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-border);
}

.btn.secondary:hover, .act.secondary:hover {
  background: var(--surface-muted);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--border-strong);
}

.btn.danger, .act.danger {
  background: var(--surface);
  color: var(--danger);
  box-shadow: 0 0 0 1px #fecaca;
}

.btn.danger:hover, .act.danger:hover { background: var(--danger-soft); color: var(--danger); }

.btn[disabled], .act[disabled],
button[disabled], .icon-act[disabled] {
  opacity: .52;
  cursor: not-allowed;
  scale: 1;
  filter: saturate(.45);
}

.linkbtn {
  border: 0;
  background: none;
  cursor: pointer;
}

.inline { display: inline; }

:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 3px solid var(--cyan-ink);
  outline-offset: 3px;
}

.topbar :where(a, button):focus-visible {
  outline-color: var(--cyan);
}

/* Surfaces and lead signals */
.card, .lead {
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-border);
}

.card { padding: 20px; }
.card + .card { margin-top: 14px; }

.lead {
  position: relative;
  margin-bottom: 12px;
  padding: 18px 20px 17px;
  overflow: hidden;
  transition-property: box-shadow, transform;
  transition-duration: .18s;
  transition-timing-function: ease-out;
}

.lead::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--cyan);
}

@media (hover: hover) {
  .lead:hover { transform: translateY(-2px); box-shadow: var(--shadow-border-hover); }
}

.workflow-card { display: grid; gap: 12px; }
.lead-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lead h3 { font-size: 1.02rem; line-height: 1.35; }
.lead h3 a { color: var(--text); }
.lead h3 a:hover { color: var(--cyan-ink); }
.lead .meta, .meta { color: var(--muted); font-size: .82rem; }

.surge-score {
  min-width: 132px;
  padding: 8px 10px 8px 13px;
  display: inline-grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 5px 10px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  box-shadow: inset 3px 0 var(--cyan), 0 5px 16px -12px rgba(7, 17, 31, .8);
}

.surge-score__label {
  color: #cbd5e1;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.surge-score__value { color: var(--cyan); font-size: 1.15rem; font-weight: 800; line-height: 1; }

.package-line {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: .9rem;
}

.commission { color: var(--green-ink); font-weight: 750; }
.pipeline-stage { color: var(--text); font-weight: 700; }
.claim-line { color: var(--muted); font-size: .84rem; }

.channel-actions {
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}

.icon-act {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--navy-2);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(7, 17, 31, .08);
  cursor: pointer;
  transition-property: background-color, color, box-shadow, scale;
  transition-duration: .15s;
  transition-timing-function: ease-out;
}

.icon-act:hover {
  background: var(--cyan);
  color: var(--navy);
  box-shadow: 0 0 0 3px rgba(23, 230, 195, .18);
  text-decoration: none;
}

.icon-act:active { scale: .96; }
.icon-act svg { width: 19px; height: 19px; fill: currentColor; }

.touch-line {
  padding-top: 11px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .82rem;
}

.stat-right { display: flex; align-items: flex-end; flex-direction: column; gap: 8px; text-align: right; }
.actions { margin-top: 14px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Semantic state */
.badge {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: #475569;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .01em;
}

.badge.UNCLAIMED { border-color: #a7f3d0; background: var(--green-soft); color: var(--green-ink); }
.badge.CLAIMED { border-color: #bfdbfe; background: var(--blue-soft); color: var(--blue-ink); }
.badge.SUPPRESSED { border-color: var(--border); background: var(--surface-muted); color: #475569; }

.mini-tip {
  max-width: 100%;
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #fde68a;
  border-radius: 6px;
  background: var(--amber-soft);
  color: var(--amber-ink);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Forms */
label { display: block; margin-bottom: 6px; color: var(--text); font-size: .82rem; font-weight: 650; }
input, textarea, select {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  transition-property: border-color, box-shadow, background-color;
  transition-duration: .15s;
  transition-timing-function: ease-out;
}

textarea { min-height: 104px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, textarea:hover, select:hover { border-color: #94a3b8; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--cyan-ink);
  box-shadow: 0 0 0 3px rgba(23, 230, 195, .22);
}

input:user-invalid, textarea:user-invalid, select:user-invalid { border-color: var(--danger); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--cyan-ink); }
.field { margin-bottom: 15px; }
.form-row { display: flex; align-items: flex-end; gap: 9px; }
.form-row > * { min-width: 0; }
.form-row input, .form-row select { flex: 1 1 180px; }
form p { margin-bottom: 15px; }
.errorlist { margin: 6px 0 0; padding-left: 18px; color: var(--danger); font-size: .82rem; }
.stack-form { display: grid; gap: 14px; }
.field-grid, .filter-grid, .weight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 13px;
}
.stage-fields[hidden] { display: none; }

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 7px 14px;
}

.check-grid label, .check-line {
  min-height: 40px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.check-line { align-items: flex-start; }
.check-line input { flex: 0 0 auto; margin-top: .18em; }
.check-copy { min-width: 0; line-height: 1.5; }

/* Detail hierarchy */
.back-link { margin-bottom: 15px; display: inline-flex; min-height: 40px; align-items: center; color: var(--muted); font-size: .84rem; }
.back-link:hover { color: var(--text); }

.profitline-continuity {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-left: 4px solid var(--cyan);
  background: linear-gradient(135deg, var(--surface) 0%, var(--cyan-soft) 145%);
}
.profitline-continuity__eyebrow {
  margin-bottom: 4px;
  color: var(--cyan-ink);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.profitline-continuity h2 { font-size: 1.05rem; }
.profitline-continuity p:not(.profitline-continuity__eyebrow) { margin-top: 6px; max-width: 760px; color: var(--muted); font-size: .84rem; }
.profitline-continuity .act { flex: 0 0 auto; }

.detail-hero {
  position: relative;
  margin-bottom: 14px;
  overflow: hidden;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-lift);
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 230, 195, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 230, 195, .045) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(90deg, transparent 38%, #000 100%);
}

.detail-hero > * { position: relative; z-index: 1; }
.detail-hero h1 { color: #fff; font-size: clamp(1.65rem, 3vw, 2.2rem); }
.detail-hero .meta { margin-top: 6px; color: #cbd5e1; }
.detail-eyebrow {
  margin-bottom: 7px;
  color: var(--cyan);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.detail-hero .surge-score {
  min-width: 120px;
  padding: 11px 12px 11px 15px;
  background: var(--navy-2);
  box-shadow: inset 3px 0 var(--cyan), 0 0 0 1px rgba(255, 255, 255, .1);
}
.detail-hero .surge-score__value { font-size: 1.75rem; }
.detail-hero .lead-status { color: #cbd5e1; }
.lead-status { min-height: 1em; margin-top: 11px; font-size: .84rem; }

.detail-card { padding: 0; overflow: hidden; }
.detail-card > summary {
  min-height: 58px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 750;
  list-style: none;
  transition-property: background-color, color;
  transition-duration: .15s;
}
.detail-card > summary::-webkit-details-marker { display: none; }
.detail-card > summary::after { content: "+"; color: var(--cyan-ink); font-size: 1.35rem; font-weight: 500; line-height: 1; }
.detail-card[open] > summary { background: #f8fafc; }
.detail-card[open] > summary::after { content: "\2212"; }
.detail-card__body { padding: 3px 20px 22px; }

.decision-list { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.decision-list > div { min-width: 0; padding: 13px 14px; border-radius: var(--radius-sm); background: var(--surface-muted); }
.decision-list > .decision-pitch, .decision-list > .decision-evidence { grid-column: 1 / -1; }
.decision-list > .decision-pitch { border-left: 3px solid var(--cyan-ink); background: #f0fdfa; }
.decision-list dt, .info-grid dt { color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .025em; }
.decision-list dd, .info-grid dd { margin: 4px 0 0; overflow-wrap: anywhere; }

.section-title { margin-bottom: 10px; color: var(--muted); font-size: .75rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.card-subsection { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.offer-panel { padding: 16px; border: 0; border-radius: var(--radius); background: var(--blue-soft); }
.offer-panel .section-title { color: var(--blue-ink); }
.script-box {
  margin-top: 12px;
  padding: 15px 16px;
  border: 0;
  border-left: 3px solid var(--cyan-ink);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-border);
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.workflow-block + .workflow-block { margin-top: 18px; }
.detail-actions {
  margin: 0;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-muted);
}
.detail-actions .call-wrap > .act { background: var(--cyan); color: var(--navy); }
.detail-actions .call-wrap > .act:hover { background: #5eead4; color: var(--navy); }
.call-wrap { max-width: 100%; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.workflow-grid { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .8fr); gap: 14px; align-items: start; }
.workflow-panel { min-width: 0; padding: 16px; border-radius: var(--radius); background: #f8fafc; box-shadow: inset 0 0 0 1px var(--border); }
.workflow-panel h3 { margin-bottom: 13px; }
.claim-action .act { background: var(--green); color: var(--navy); }
.claim-action .act:hover { background: #34d399; color: var(--navy); }
.note-form {
  margin-top: 18px;
  padding: 16px;
  grid-template-columns: minmax(150px, .55fr) minmax(220px, 1.45fr) auto;
  align-items: end;
  border-radius: var(--radius);
  background: var(--surface-muted);
}
.note-form label { margin: 0; }

.nested-history { margin-top: 17px; }
.nested-history summary, .step-card summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
}
.history-box { max-height: 290px; padding-right: 6px; overflow: auto; }
.list-item { padding: 13px 0; border-top: 1px solid var(--border); }
.list-item:first-of-type { border-top: 0; }
.list-item .when { color: var(--faint); font-size: .75rem; }

.info-grid { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 11px; }
.info-grid > div { min-width: 0; padding: 12px 13px; border-radius: var(--radius-sm); background: var(--surface-muted); }
.plain-list { margin: 0; padding-left: 19px; }
.plain-list li + li { margin-top: 4px; }
.badge-row { margin-top: 10px; display: flex; justify-content: flex-start; gap: 6px; flex-wrap: wrap; }
.signal-meta { margin-top: 10px; }
.ownership-note { margin-top: 8px; font-size: .9rem; }

.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.signal-table { width: 100%; border-collapse: collapse; margin-top: 13px; }
.signal-table th, .signal-table td { padding: 10px 9px; border-top: 1px solid var(--border); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.signal-table .signal-table__status { white-space: nowrap; overflow-wrap: normal; }
.signal-table th { color: var(--muted); background: #f8fafc; font-size: .73rem; font-weight: 750; }
.signal-table tbody tr:hover { background: #f8fafc; }
.recommendation-strip {
  margin-top: 15px;
  padding: 13px 14px;
  display: flex;
  gap: 8px 12px;
  flex-wrap: wrap;
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
}

/* Filters and configuration */
.filter-panel { margin-bottom: 15px; }
.filter-panel > summary { width: fit-content; max-width: 100%; list-style: none; }
.filter-panel > summary::-webkit-details-marker { display: none; }
.filter-panel > summary::after { content: "+"; margin-left: 3px; color: var(--cyan-ink); font-size: 1rem; }
.filter-panel[open] > summary { background: var(--cyan-soft); color: var(--navy); box-shadow: 0 0 0 1px rgba(15, 118, 110, .22); }
.filter-panel[open] > summary::after { content: "\2212"; }
.filter-panel__summary { flex-wrap: wrap; }
.filter-panel__state { color: var(--muted); font-size: .78rem; font-weight: 550; }
.filter-panel[open] .filter-panel__state { color: var(--cyan-ink); }
.filter-grid {
  margin-top: 12px;
  padding: 16px;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-border);
}
.filter-quick-grid, .filter-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 13px;
}
.filter-quick-grid > label, .filter-fields-grid > label { margin: 0; }
.filter-section {
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
}
.filter-section > summary {
  min-height: 46px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  color: var(--text);
  cursor: pointer;
  font-size: .86rem;
  font-weight: 700;
}
.filter-section > summary::-webkit-details-marker { display: none; }
.filter-section > summary::after { content: "+"; margin-left: auto; color: var(--cyan-ink); font-size: 1rem; font-weight: 600; }
.filter-section[open] > summary { background: #f8fafc; }
.filter-section[open] > summary::after { content: "\2212"; }
.filter-section__body { padding: 14px; border-top: 1px solid var(--border); }
.filter-count {
  min-width: 22px;
  min-height: 22px;
  padding: 2px 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--cyan-soft);
  color: var(--cyan-ink);
  font-size: .72rem;
  font-weight: 750;
}
.filter-help { margin: 0 0 11px; color: var(--muted); font-size: .8rem; }
.filter-signal-grid { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.filter-grid > .actions { margin-top: 2px; }
.filter-actions { justify-content: flex-start; }
.sort-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.sort-pair { padding: 12px; display: grid; gap: 8px; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-border); }
.sort-pair label { margin: 0; }
.sort-pair__title { margin: 0; color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }

.assign-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(160px, 2fr) auto;
  gap: 9px;
  align-items: end;
}
.compact-card { margin: -5px 0 13px; padding: 13px 16px; }
.lead-pagination {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.pagination-status { display: grid; gap: 2px; color: var(--muted); font-size: .82rem; }
.pagination-status strong { color: var(--text); font-size: .9rem; }
.pagination-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination-disabled { opacity: .52; cursor: not-allowed; }
.member-edit { width: 100%; display: grid; grid-template-columns: minmax(180px, 1.2fr) repeat(5, minmax(120px, 1fr)) auto; gap: 10px; align-items: end; }
.pipeline-board { margin-top: 13px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 13px; }
.pipeline-column { padding: 15px; border-radius: var(--radius-lg); background: var(--surface-muted); box-shadow: var(--shadow-border); }
.pipeline-column h2 { margin-bottom: 11px; display: flex; align-items: center; justify-content: space-between; }
.mini-lead { margin-bottom: 8px; padding: 11px; display: grid; gap: 3px; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-border); font-size: .82rem; }
.mini-lead span { color: var(--muted); }
.launch-complete { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.launch-complete input { width: min(280px, 100%); }

.step-list { display: grid; gap: 13px; }
.step-card { padding: 15px; border: 0; border-radius: var(--radius-lg); background: #f8fafc; box-shadow: inset 0 0 0 1px var(--border); }
.step-card summary span { width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 7px; background: var(--navy); color: var(--cyan); font-size: .75rem; }
.step-card[open] summary { margin-bottom: 13px; }

/* Empty states and feedback */
.empty {
  padding: 58px 24px;
  border-radius: var(--radius-lg);
  background-color: var(--surface);
  background-image:
    radial-gradient(circle at 50% 45%, transparent 0 34px, rgba(37, 99, 235, .06) 35px 36px, transparent 37px 56px, rgba(23, 230, 195, .06) 57px 58px, transparent 59px);
  box-shadow: var(--shadow-border);
  color: var(--muted);
  text-align: center;
}
.empty strong { margin-bottom: 5px; display: block; color: var(--text); font-size: 1rem; font-weight: 700; }

.messages { margin: 0 0 17px; padding: 0; list-style: none; }
.messages li { padding: 11px 14px; border: 1px solid #bfdbfe; border-radius: var(--radius); background: var(--blue-soft); color: #1e3a8a; }
.messages li + li { margin-top: 8px; }
.messages li.success { border-color: #a7f3d0; background: var(--green-soft); color: #065f46; }
.messages li.warning { border-color: #fde68a; background: var(--amber-soft); color: var(--amber-ink); }
.messages li.info { border-color: #bfdbfe; background: var(--blue-soft); color: #1e3a8a; }
.messages li.error { border-color: #fecaca; background: var(--danger-soft); color: #991b1b; }

/* Active browser call controls */
.call-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  width: min(360px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: var(--radius-lg);
  background: var(--navy);
  color: #f8fafc;
  box-shadow: 0 20px 54px -24px rgba(7, 17, 31, .72);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
.call-panel__summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.call-panel__state { color: var(--cyan); font-size: .78rem; font-weight: 700; }
.call-panel__number { display: block; margin-top: 3px; font-size: 1.12rem; letter-spacing: -.01em; }
.call-panel__timer { color: #cbd5e1; font-variant-numeric: tabular-nums; font-size: 1rem; }
.call-keypad { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.call-keypad[hidden], .call-panel[hidden] { display: none; }
.call-key {
  min-height: 48px;
  padding: 8px;
  border-color: rgba(148, 163, 184, .24) !important;
  border-radius: var(--radius) !important;
  background: var(--navy-hover) !important;
  color: #f8fafc !important;
  font-size: 1.05rem !important;
}
.call-key:hover { border-color: var(--cyan) !important; background: #1b304b !important; }
.call-panel__controls { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.call-control {
  min-width: 0;
  padding-inline: 10px !important;
  border-color: rgba(148, 163, 184, .28) !important;
  background: transparent !important;
  color: #f8fafc !important;
  white-space: nowrap;
}
.call-control:hover, .call-control[aria-pressed="true"] { background: var(--navy-hover) !important; }
.call-control--hangup { border-color: transparent !important; background: var(--danger) !important; }
.call-control--hangup:hover { background: #991b1b !important; }
.call-outcome { margin-top: 18px; display: grid; gap: 10px; }
.call-outcome[hidden], .call-panel__controls[hidden] { display: none; }
.call-outcome__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.call-outcome__head strong { color: #fff; }
.call-outcome__duration { color: #cbd5e1; font-variant-numeric: tabular-nums; }
.call-outcome label { color: #e2e8f0; font-size: .82rem; font-weight: 700; }
.call-outcome select, .call-outcome input, .call-outcome textarea {
  width: 100%;
  margin-top: 5px;
  border-color: rgba(148, 163, 184, .38);
  background: #fff;
  color: var(--text);
}
.call-outcome__help { color: #cbd5e1; font-size: .8rem; line-height: 1.45; }
.call-outcome__submit { width: 100%; min-height: 44px; background: var(--cyan) !important; color: var(--navy) !important; }

.call-review { margin-bottom: 16px; }
.call-review > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 700; }
.call-review__list { margin-top: 14px; display: grid; gap: 10px; }
.call-review__item { padding: 14px; border-radius: var(--radius); background: var(--surface-muted); box-shadow: inset 0 0 0 1px var(--border); }
.call-review__summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.call-review__actions, .review-form { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.call-review__actions form { margin: 0; }
.review-form input { min-width: min(280px, 100%); flex: 1 1 220px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  max-width: min(92vw, 520px);
  padding: 11px 16px;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-lift);
  font-size: .88rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition-property: opacity, transform;
  transition-duration: .18s;
  transition-timing-function: ease-out;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--danger); }
.muted { color: var(--muted); }

@media (max-width: 640px) {
  .call-panel {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 18px 18px max(18px, env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

/* Auth, legal, SOP, footer */
.container.narrow > .card { padding: 24px; }
.container.narrow h1 { margin-bottom: 18px; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-switch { margin-top: 16px; font-size: .88rem; }
.auth-legal-note { margin: 8px 0 12px; font-size: .82rem; }
.legal-version { margin: 8px 0 16px; }
.legal-form { margin-top: 16px; }
.legal h2 { margin: 22px 0 7px; font-size: 1rem; }
.legal p { max-width: 68ch; margin-bottom: 9px; }
code { padding: 2px 6px; border-radius: 6px; background: #e2e8f0; color: #334155; font-size: .8rem; overflow-wrap: anywhere; }

.container.sop-page { max-width: 820px; }
.sop-section { padding: 19px 20px 20px; border-left: 3px solid var(--cyan-ink); }
.sop-section h2 { margin-bottom: 11px; }
.sop-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.sop-list li::marker { color: var(--cyan-ink); }
.sop-list li, .sop-loop li { overflow-wrap: anywhere; }
.sop-loop { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; counter-reset: sop-step; list-style: none; }
.sop-loop li { min-height: 64px; padding: 10px 11px; display: flex; align-items: flex-start; gap: 8px; border-radius: var(--radius-sm); background: var(--navy); color: #e2e8f0; font-size: .82rem; font-weight: 600; line-height: 1.35; }
.sop-loop li::before { content: counter(sop-step, decimal-leading-zero); counter-increment: sop-step; color: var(--cyan); font-variant-numeric: tabular-nums; }

/* ProfitLine internal manager guide */
.container.admin-guide-page { max-width: 1280px; }
.manager-guide { min-width: 0; }
.guide-hero {
  padding: clamp(24px, 4vw, 42px);
  border-radius: var(--radius-lg);
  background: var(--navy);
  color: #e2e8f0;
  box-shadow: var(--shadow-lift);
}
.guide-hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.8rem); }
.guide-kicker {
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.guide-intro { max-width: 72ch; margin-top: 12px; color: #cbd5e1; font-size: 1rem; }
.guide-quick-links { margin-top: 21px; display: flex; gap: 7px; flex-wrap: wrap; }
.guide-quick-links a {
  min-height: 40px;
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: .8rem;
  font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.guide-quick-links a:hover { background: rgba(23, 230, 195, .13); color: #fff; text-decoration: none; }

.guide-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.guide-toc {
  position: sticky;
  top: 80px;
  max-height: calc(100dvh - 98px);
  padding: 16px;
  overflow-y: auto;
}
.guide-toc h2 { margin-bottom: 10px; font-size: .85rem; letter-spacing: .01em; }
.guide-toc ol { margin: 0; padding: 0; display: grid; gap: 1px; list-style: none; counter-reset: guide-toc; }
.guide-toc li { counter-increment: guide-toc; }
.guide-toc a {
  min-height: 40px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  border-radius: 7px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.25;
}
.guide-toc a::before { content: counter(guide-toc, decimal-leading-zero); color: var(--faint); font-size: .67rem; font-weight: 750; }
.guide-toc a:hover { background: var(--surface-muted); color: var(--text); text-decoration: none; }

.guide-content { min-width: 0; display: grid; gap: 18px; }
.guide-section { min-width: 0; padding: clamp(21px, 3vw, 30px); scroll-margin-top: 82px; }
.guide-section-number { margin-bottom: 6px; color: var(--cyan-ink); font-size: .7rem; font-weight: 800; letter-spacing: .11em; }
.guide-section > h2 { margin-bottom: 16px; padding-bottom: 13px; border-bottom: 1px solid var(--border); font-size: clamp(1.25rem, 2.3vw, 1.55rem); }
.guide-section h3 { margin: 23px 0 9px; font-size: 1rem; }
.guide-section h4 { margin: 0 0 8px; font-size: .88rem; }
.guide-section > p { max-width: 76ch; }
.guide-section p + p { margin-top: 10px; }
.guide-section ul, .guide-section ol { margin: 10px 0 0; padding-left: 21px; }
.guide-section li + li { margin-top: 6px; }
.guide-section li, .guide-section td, .guide-section dd { overflow-wrap: anywhere; }

.guide-callout { margin-top: 18px; padding: 15px 16px; border-left: 3px solid var(--blue); border-radius: var(--radius-sm); background: var(--blue-soft); }
.guide-callout strong { display: block; color: var(--blue-ink); }
.guide-callout p { margin-top: 4px; }
.guide-callout--warning { border-left-color: var(--amber); background: var(--amber-soft); }
.guide-callout--warning strong { color: var(--amber-ink); }
.guide-callout--danger { border-left-color: var(--danger); background: var(--danger-soft); }
.guide-callout--danger strong { color: var(--danger); }
.guide-help { margin-top: 24px; }

.guide-checklist { padding: 0 !important; display: grid; gap: 8px; list-style: none; }
.guide-checklist li { position: relative; min-height: 24px; padding-left: 29px; }
.guide-checklist li + li { margin-top: 0; }
.guide-checklist li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: .05em;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green-ink);
  font-size: .72rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px #a7f3d0;
}
.guide-checklist--columns { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }

.guide-steps { padding: 0 !important; display: grid; gap: 9px; counter-reset: guide-step; list-style: none; }
.guide-steps li {
  position: relative;
  min-height: 46px;
  margin: 0;
  padding: 11px 12px 11px 52px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px var(--border);
  counter-increment: guide-step;
}
.guide-steps li::before {
  content: counter(guide-step, decimal-leading-zero);
  position: absolute;
  left: 12px;
  top: 11px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--navy);
  color: var(--cyan);
  font-size: .68rem;
  font-weight: 750;
}

.guide-flow { padding: 0 !important; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; list-style: none; counter-reset: guide-flow; }
.guide-flow li {
  min-width: 0;
  min-height: 84px;
  margin: 0;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 3px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  counter-increment: guide-flow;
}
.guide-flow li::before { content: counter(guide-flow, decimal-leading-zero); grid-row: 1 / span 2; color: var(--cyan-ink); font-size: .7rem; font-weight: 800; }
.guide-flow strong { line-height: 1.3; }
.guide-flow span { color: var(--muted); font-size: .84rem; line-height: 1.45; }
.guide-flow--short li { min-height: 76px; }

.guide-grid, .guide-mode-grid, .guide-do-avoid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.guide-panel, .guide-mode, .guide-do-avoid > div {
  min-width: 0;
  padding: 15px 16px;
  border-radius: var(--radius);
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px var(--border);
}
.guide-panel h3, .guide-mode h3, .guide-do-avoid h3 { margin-top: 0; }
.guide-do-avoid { margin-top: 18px; }
.guide-do-avoid > div:first-child { background: var(--green-soft); box-shadow: inset 0 0 0 1px #a7f3d0; }
.guide-do-avoid > div:last-child { background: var(--amber-soft); box-shadow: inset 0 0 0 1px #fde68a; }
.guide-mode-label { margin-bottom: 6px; color: var(--cyan-ink); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.guide-definition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.guide-definition-grid > div { min-width: 0; padding: 13px 14px; border-radius: var(--radius-sm); background: var(--surface-muted); }
.guide-definition-grid p { margin-top: 4px; color: var(--muted); font-size: .86rem; }

.guide-table-wrap { min-width: 0; margin-top: 12px; overflow: hidden; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--border); }
.guide-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.guide-table caption { padding: 11px 13px; background: var(--navy); color: #e2e8f0; font-size: .74rem; font-weight: 750; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.guide-table th, .guide-table td { padding: 10px 11px; border-top: 1px solid var(--border); text-align: left; vertical-align: top; line-height: 1.45; }
.guide-table th { background: #f8fafc; color: var(--muted); font-size: .72rem; font-weight: 750; }
.guide-table td { font-size: .84rem; }
.guide-table tbody tr:nth-child(even) { background: #fbfdff; }
.guide-table--wide th:first-child { width: 18%; }
.guide-table--troubleshooting th:first-child { width: 17%; }
.guide-table--troubleshooting th:nth-child(2) { width: 25%; }

.guide-code-list { margin-top: 10px; display: flex; gap: 7px; flex-wrap: wrap; }
.guide-code-list code { padding: 6px 8px; background: var(--surface-muted); color: var(--text); }
.guide-routine { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.guide-routine > section { min-width: 0; padding: 15px; border-radius: var(--radius); background: #f8fafc; box-shadow: inset 0 0 0 1px var(--border); }
.guide-routine h3 { margin-top: 0; }
.guide-section--danger { box-shadow: 0 0 0 1px #fecaca, 0 8px 26px -20px rgba(185, 28, 28, .35); }
.guide-section--danger > h2 { color: var(--danger); border-bottom-color: #fecaca; }
.guide-glossary { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.guide-glossary > div { min-width: 0; padding: 13px 14px; border-radius: var(--radius-sm); background: var(--surface-muted); }
.guide-glossary dt { font-weight: 750; }
.guide-glossary dd { margin: 4px 0 0; color: var(--muted); font-size: .86rem; }

.site-footer {
  width: calc(100% - 48px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 23px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: .8rem;
}
.site-footer nav { display: flex; gap: 18px; }
.site-footer a { min-height: 40px; display: inline-flex; align-items: center; color: var(--muted); }

@media (max-width: 980px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-toc { position: static; max-height: none; }
  .guide-toc ol { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 8px; }
}

@media (max-width: 1080px) {
  .topbar { min-height: 60px; padding: 0 16px; flex-wrap: wrap; gap: 0 16px; }
  .topbar .brand { min-height: 60px; }
  .nav-toggle { display: inline-flex; }
  .topbar .primary-nav,
  .topbar > nav.primary-nav {
    display: none;
    flex: 1 0 100%;
    max-height: calc(100dvh - 60px);
    padding: 8px 0 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    overflow-y: auto;
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
  .topbar .primary-nav.is-open { display: flex; }
  .topbar .primary-nav a,
  .topbar .primary-nav .linkbtn {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    justify-content: flex-start;
    text-align: left;
  }
  .topbar .primary-nav a.active { box-shadow: inset 3px 0 var(--cyan); }
  .topbar .primary-nav .inline { width: 100%; display: block; }
  .member-edit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-edit > :first-child, .member-edit > :last-child { grid-column: 1 / -1; }
  .sort-grid { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
}

@media (max-width: 720px) {
  .container { margin-top: 22px; padding: 0 16px; }
  .container.narrow { margin-top: 28px; }
  .assign-row, .member-edit { grid-template-columns: 1fr; }
  .member-edit > :first-child, .member-edit > :last-child { grid-column: auto; }
  .field-grid, .filter-grid, .filter-quick-grid, .filter-fields-grid, .weight-grid, .sort-grid { grid-template-columns: 1fr; }
  .workflow-grid { grid-template-columns: 1fr; }
  .note-form { grid-template-columns: 1fr; align-items: stretch; }
  .detail-hero .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .detail-hero .stat-right { align-items: flex-end; }
  .decision-list { grid-template-columns: 1fr; }
  .decision-list > .decision-pitch, .decision-list > .decision-evidence { grid-column: auto; }
  .sop-loop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signal-table { min-width: 590px; font-size: .82rem; }
  .guide-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-grid, .guide-mode-grid, .guide-do-avoid,
  .guide-definition-grid, .guide-flow, .guide-checklist--columns,
  .guide-routine, .guide-glossary { grid-template-columns: 1fr; }
  .guide-table-wrap { overflow: hidden; box-shadow: none; }
  .guide-table, .guide-table caption, .guide-table tbody,
  .guide-table tr, .guide-table td { display: block; width: 100%; }
  .guide-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .guide-table caption { border-radius: var(--radius-sm); }
  .guide-table tbody { margin-top: 9px; display: grid; gap: 9px; }
  .guide-table tr {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-border);
  }
  .guide-table td {
    padding: 9px 0;
    display: grid;
    grid-template-columns: minmax(105px, .4fr) minmax(0, 1fr);
    gap: 10px;
    border-top: 0;
    font-size: .84rem;
  }
  .guide-table td + td { border-top: 1px solid var(--border); }
  .guide-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .03em;
    text-transform: uppercase;
  }
  .site-footer { width: calc(100% - 32px); }
}

@media (max-width: 480px) {
  .container { margin-top: 18px; margin-bottom: 48px; padding: 0 12px; }
  .container.narrow { margin-top: 20px; }
  .container.narrow > .card, .card { padding: 17px; }
  .detail-card { padding: 0; }
  .detail-card > summary { min-height: 54px; padding: 14px 16px; }
  .detail-card__body { padding: 2px 16px 18px; }
  .lead { padding: 16px 16px 15px; }
  .lead-pagination { align-items: stretch; }
  .pagination-status, .pagination-actions { width: 100%; }
  .pagination-actions > * { flex: 1; }
  .lead-line.signal-head { align-items: stretch; flex-direction: column; }
  .lead-line.signal-head .surge-score { align-self: flex-start; }
  .package-line { align-items: flex-start; flex-direction: column; gap: 5px; }
  .detail-hero .row { grid-template-columns: 1fr; }
  .detail-hero .stat-right { align-items: flex-start; flex-direction: row; flex-wrap: wrap; text-align: left; }
  .detail-hero::after { display: none; }
  .detail-actions { padding: 12px; }
  .detail-actions .act, .detail-actions .call-wrap { width: 100%; }
  .detail-actions .call-wrap > .act { flex: 1; }
  .workflow-panel, .note-form { padding: 13px; }
  .filter-grid { padding: 13px; }
  .filter-section__body { padding: 12px; }
  .info-grid { grid-template-columns: 1fr; }
  .form-row { flex-wrap: wrap; }
  .form-row > .act, .form-row > button { flex: 1 1 auto; }
  .sop-loop { grid-template-columns: 1fr; }
  .sop-loop li { min-height: 52px; }
  .guide-hero { padding: 21px 18px; }
  .guide-quick-links a { flex: 1 1 125px; justify-content: center; }
  .guide-toc { padding: 13px; }
  .guide-toc ol { grid-template-columns: 1fr; }
  .guide-section > h2 { margin-bottom: 14px; }
  .guide-table td { grid-template-columns: 1fr; gap: 3px; }
  .guide-steps li { padding-left: 48px; }
  .site-footer { padding-bottom: 20px; flex-direction: column; align-items: flex-start; }
  .site-footer nav { width: 100%; justify-content: space-between; gap: 8px; }
}

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

/* ProfitLine conversion v2: scoped to the purchase and first-value surfaces. */
.container.v2-shell { max-width: 1080px; }
.v2-purchase, .v2-first { display: grid; gap: 24px; }
.v2-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 280px);
  gap: 28px;
  align-items: center;
  padding: clamp(28px, 5vw, 54px);
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, .24);
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 8%, rgba(56, 189, 248, .18), transparent 34%),
    linear-gradient(145deg, rgba(15, 23, 42, .98), rgba(17, 34, 53, .96));
  box-shadow: 0 24px 65px rgba(2, 8, 23, .28), inset 0 1px rgba(255,255,255,.06);
}
.v2-hero h1, .v2-first h1, .v2-message h1 {
  max-width: 24ch;
  margin: 8px 0 14px;
  text-wrap: balance;
}
.v2-hero h1 { color: #f8fafc; }
.v2-lede, .v2-first__head p, .v2-message p {
  max-width: 78ch;
  color: var(--muted);
  line-height: 1.7;
  text-wrap: pretty;
}
.v2-hero .v2-lede { color: #cbd5e1; }
.v2-hero__proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 22px;
  color: #e2e8f0;
  font-size: .78rem;
  font-weight: 760;
}
.v2-hero__proof span {
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
}
.v2-hero__proof i { color: var(--cyan); font-style: normal; }
.v2-kicker {
  color: var(--cyan-ink);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.v2-hero .v2-kicker { color: var(--cyan); }
.v2-price-card {
  display: grid;
  gap: 3px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  background: rgba(2, 8, 23, .58);
  box-shadow: 0 14px 32px rgba(2, 8, 23, .28), inset 0 1px rgba(255,255,255,.06);
}
.v2-price-card form { display: grid; gap: 8px; }
.v2-price-card strong {
  color: #f8fafc;
  font-size: clamp(2.3rem, 5vw, 3.45rem);
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.v2-price-card span, .v2-price-card small { color: #cbd5e1; }
.v2-price-card hr { width: 100%; margin: 13px 0 9px; border: 0; border-top: 1px solid rgba(255,255,255,.12); }
.v2-price-card b { color: #f8fafc; font-size: .86rem; line-height: 1.45; }
.v2-price-card .v2-primary { width: 100%; margin-top: 6px; text-align: center; text-decoration: none; }
.v2-price-card__secondary { color: #cbd5e1; font-size: .76rem; text-align: center; text-decoration: underline; }
.v2-checkout-card__due { margin: 3px 0; color: #cbd5e1; font-size: .78rem; line-height: 1.45; }
.v2-check--compact { margin-top: 4px; padding: 10px; font-size: .76rem; }
.v2-check--compact span { font-size: .76rem; line-height: 1.4; }
.v2-proof { display: grid; gap: 8px; padding: 20px 24px; border-radius: 18px; }
.v2-proof p { max-width: 78ch; margin: 0; color: var(--muted); line-height: 1.6; }
.v2-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.v2-preview { padding: clamp(22px, 4vw, 32px); border-radius: 24px; }
.v2-preview__head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.v2-preview__head h2 { margin: 5px 0 0; text-wrap: balance; }
.v2-route-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(56, 189, 248, .24);
  border-radius: 999px;
  color: var(--cyan-ink);
  background: rgba(56, 189, 248, .07);
  font-size: .76rem;
  font-weight: 800;
  white-space: nowrap;
}
.v2-live { display: inline-flex; align-items: center; gap: 7px; color: var(--green-ink); font-size: .78rem; font-weight: 750; white-space: nowrap; }
.v2-live i { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .11); }
.v2-preview__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.v2-preview__grid article { padding: 17px; border-radius: 16px; background: rgba(255,255,255,.028); box-shadow: inset 0 0 0 1px var(--border); transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease; }
.v2-preview__grid article:hover { transform: translateY(-2px); background: rgba(56, 189, 248, .04); box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .28), 0 12px 28px rgba(2, 8, 23, .12); }
.v2-preview__grid h3 { margin: 12px 0 5px; text-wrap: balance; }
.v2-preview__grid article > p { margin: 0; color: var(--muted); font-size: .85rem; }
.v2-preview__grid dl { display: grid; gap: 10px; margin: 16px 0 0; }
.v2-preview__grid dt { color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.v2-preview__grid dd { margin: 2px 0 0; font-size: .82rem; line-height: 1.4; text-wrap: pretty; }
.v2-preview__privacy { margin: 16px 0 0; color: var(--muted); font-size: .78rem; text-wrap: pretty; }
.v2-commission { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 28px; align-items: center; padding: 24px; border-radius: 20px; }
.v2-commission > .v2-kicker, .v2-commission > h2, .v2-commission > p { grid-column: 1; }
.v2-commission h2 { margin: 2px 0; text-wrap: balance; }
.v2-commission > p { margin: 0; color: var(--muted); text-wrap: pretty; }
.v2-math { grid-column: 2; grid-row: 1 / span 3; display: grid; gap: 3px; min-width: 220px; padding: 17px; border-radius: 14px; background: rgba(56, 189, 248, .055); box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .2); }
.v2-math span, .v2-math small { color: var(--muted); font-size: .72rem; }
.v2-math strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.v2-math i { padding: 0 6px; color: var(--cyan-ink); font-style: normal; }
.v2-legal-links { margin: 0; color: var(--muted); font-size: .8rem; }
.v2-feature {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(2, 8, 23, .12), inset 0 1px rgba(255,255,255,.035);
}
.v2-feature__number {
  color: var(--cyan-ink);
  font-size: .76rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.v2-feature h2 { margin: 12px 0 8px; font-size: 1.06rem; text-wrap: balance; }
.v2-feature p { margin: 0; color: var(--muted); line-height: 1.6; text-wrap: pretty; }
.v2-legal { display: grid; gap: 12px; padding: clamp(22px, 4vw, 34px); border-radius: 24px; }
.v2-legal__head, .v2-submit-row, .v2-first__head, .v2-opportunity__top, .v2-opportunity__action {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}
.v2-legal__head h2 { margin: 4px 0 0; text-wrap: balance; }
.v2-version { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.v2-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 44px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 120ms ease;
}
.v2-check:hover { border-color: rgba(56, 189, 248, .5); background: rgba(56, 189, 248, .04); }
.v2-check:active { transform: scale(.99); }
.v2-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--cyan); }
.v2-check span { color: var(--muted); line-height: 1.5; text-wrap: pretty; }
.v2-submit-row { margin-top: 6px; }
.v2-submit-row p, .v2-opportunity__action p { max-width: 58ch; margin: 0; color: var(--muted); font-size: .86rem; }
.v2-primary { min-height: 44px; transition: box-shadow 160ms ease, transform 120ms ease, background-color 160ms ease; }
.v2-primary:hover { box-shadow: 0 12px 28px rgba(56, 189, 248, .2); }
.v2-primary:active { transform: scale(.96); }
.v2-alert {
  padding: 14px 16px;
  border: 1px solid rgba(248, 113, 113, .4);
  border-radius: 14px;
  color: #fecaca;
  background: rgba(127, 29, 29, .18);
}
.v2-return { margin: -6px 0 0; color: var(--muted); text-align: center; text-wrap: pretty; }
.v2-example { padding: 17px; border: 1px dashed rgba(56, 189, 248, .38); border-radius: 14px; background: rgba(56, 189, 248, .035); }
.v2-example h3 { margin: 12px 0 5px; }
.v2-example p { margin: 0; }
.v2-message { display: grid; gap: 14px; border-radius: 22px; }
.v2-message .act { min-height: 44px; justify-self: start; }
.v2-processing__pulse { display: flex; gap: 7px; min-height: 20px; align-items: center; }
.v2-processing__pulse i { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); animation: v2-pulse 1.1s ease-in-out infinite; }
.v2-processing__pulse i:nth-child(2) { animation-delay: 140ms; }
.v2-processing__pulse i:nth-child(3) { animation-delay: 280ms; }
.v2-processing--wide { max-width: 860px; margin-inline: auto; padding: clamp(26px, 5vw, 48px); }
.v2-processing__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 2px;
  padding: 0;
  list-style: none;
}
.v2-processing__steps li {
  display: grid;
  gap: 9px;
  min-height: 102px;
  align-content: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  color: var(--muted);
  background: rgba(255,255,255,.022);
}
.v2-processing__steps span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  font-size: .75rem;
}
.v2-processing__steps b { font-size: .82rem; line-height: 1.35; }
.v2-processing__steps .is-done { color: var(--green-ink); border-color: rgba(52,211,153,.25); }
.v2-processing__steps .is-current { color: var(--cyan-ink); border-color: rgba(56,189,248,.38); background: rgba(56,189,248,.055); }
@keyframes v2-pulse {
  0%, 100% { opacity: .28; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}
.v2-first__head { align-items: end; }
.v2-first__head h1 { margin-bottom: 8px; }
.v2-first__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.v2-first__actions form, .v2-message form { margin: 0; }
.v2-first .act { min-height: 44px; }
.v2-opportunity { padding: clamp(24px, 4vw, 38px); border-radius: 24px; }
.v2-opportunity__top { align-items: start; }
.v2-opportunity__top h2 { margin: 7px 0 4px; text-wrap: balance; }
.v2-opportunity__top p { margin: 0; color: var(--muted); }
.v2-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0;
}
.v2-facts > div { padding: 16px; border-radius: 14px; background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px var(--border); }
.v2-facts dt { color: var(--muted); font-size: .74rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.v2-facts dd { margin: 7px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .v2-hero, .v2-grid, .v2-preview__grid { grid-template-columns: 1fr; }
  .v2-price-card { max-width: none; }
  .v2-legal__head, .v2-submit-row, .v2-first__head, .v2-opportunity__action {
    align-items: stretch;
    flex-direction: column;
  }
  .v2-submit-row .act, .v2-first__head .act, .v2-opportunity__action .act { width: 100%; }
  .v2-first__actions { width: 100%; flex-direction: column; }
  .v2-first__actions form, .v2-first__actions button { width: 100%; }
  .v2-commission { grid-template-columns: 1fr; }
  .v2-processing__steps { grid-template-columns: 1fr; }
  .v2-processing__steps li { min-height: 74px; grid-template-columns: auto 1fr; align-items: center; }
  .v2-commission > .v2-kicker, .v2-commission > h2, .v2-commission > p, .v2-math { grid-column: 1; grid-row: auto; }
}

@media (max-width: 520px) {
  .v2-hero { padding: 23px 19px; border-radius: 22px; }
  .v2-facts { grid-template-columns: 1fr; }
  .v2-opportunity__top { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 760px) {
  .profitline-continuity { align-items: stretch; flex-direction: column; gap: 14px; }
  .profitline-continuity .act { width: 100%; justify-content: center; }
}

/* Public account trust surface */
.container.auth-page {
  width: min(1120px, calc(100% - 32px));
  max-width: 1120px;
  margin-top: clamp(24px, 5vw, 58px);
}
.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  align-items: stretch;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: var(--shadow-lift);
}
.auth-value {
  padding: clamp(28px, 5vw, 54px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--navy);
  color: #cbd5e1;
}
.auth-value h1 {
  max-width: 15ch;
  color: #fff;
  font-size: clamp(2rem, 4.2vw, 3.3rem);
  line-height: 1.04;
  letter-spacing: -.055em;
}
.auth-value > p:not(.auth-kicker) { margin-top: 18px; max-width: 58ch; color: #b7c6d2; }
.auth-kicker {
  margin-bottom: 11px;
  color: var(--cyan);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-kicker--dark { color: var(--cyan-ink); }
.auth-benefits {
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 11px;
  list-style: none;
  color: #d8e3ea;
  font-size: .9rem;
}
.auth-benefits li { padding-left: 24px; position: relative; }
.auth-benefits li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .45em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(23, 230, 195, .12);
}
.auth-profitline-note {
  margin-top: 30px;
  padding: 15px 16px;
  display: grid;
  gap: 5px;
  border: 1px solid rgba(23, 230, 195, .28);
  border-radius: var(--radius);
  background: rgba(23, 230, 195, .08);
  color: #cbd5e1;
  font-size: .82rem;
}
.auth-profitline-note strong { color: #fff; }
.auth-profitline-note a { width: fit-content; margin-top: 4px; color: var(--cyan); font-weight: 750; }
.auth-panel {
  margin: 0;
  padding: clamp(26px, 5vw, 48px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.auth-panel h2 { font-size: clamp(1.65rem, 3vw, 2.2rem); }
.auth-intro { margin: 8px 0 22px; color: var(--muted); font-size: .9rem; }
.auth-inline-note {
  margin: -8px 0 20px;
  padding: 11px 12px;
  border: 1px solid rgba(15, 118, 110, .22);
  border-radius: var(--radius-sm);
  background: var(--cyan-soft);
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.5;
}
.auth-inline-note strong { color: var(--text); }
.auth-inline-note a { font-weight: 750; text-decoration: underline; }
.auth-inline-note--warning { border-color: rgba(180, 83, 9, .24); background: var(--warning-soft); }
.auth-panel form > p { margin: 0 0 14px; }
.auth-panel form label { display: block; margin-bottom: 6px; font-size: .82rem; font-weight: 700; }
.auth-panel form input:not([type="checkbox"]):not([type="hidden"]) { width: 100%; }
.auth-panel .helptext { display: block; margin-top: 5px; color: var(--muted); font-size: .75rem; }
.auth-panel ul.errorlist { margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: .8rem; list-style: none; }

@media (max-width: 820px) {
  .container.auth-page { width: min(680px, calc(100% - 28px)); margin-top: 22px; }
  .auth-grid { grid-template-columns: 1fr; }
  .auth-panel { order: -1; }
  .auth-value { padding: 28px 24px; }
  .auth-value h1 { max-width: 20ch; font-size: clamp(1.75rem, 8vw, 2.5rem); }
  .auth-benefits { margin-top: 20px; }
  .auth-profitline-note { margin-top: 22px; }
  .auth-panel { padding: 26px 22px 30px; }
}
