/* REC Onboarding — Modern SaaS, neutral cool grays, indigo accent */

:root {
  --bg: oklch(0.99 0.003 250);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.975 0.004 260);
  --surface-3: oklch(0.955 0.005 260);
  --ink: oklch(0.22 0.015 260);
  --ink-2: oklch(0.35 0.012 260);
  --muted: oklch(0.55 0.01 260);
  --faint: oklch(0.72 0.008 260);
  --border: oklch(0.92 0.005 260);
  --border-strong: oklch(0.86 0.006 260);
  --accent: oklch(0.52 0.15 275);
  --accent-2: oklch(0.58 0.15 275);
  --accent-soft: oklch(0.96 0.025 275);
  --accent-ink: oklch(0.35 0.15 275);
  --danger: oklch(0.55 0.18 27);
  --danger-soft: oklch(0.97 0.02 27);
  --ok: oklch(0.62 0.13 155);
  --warn-soft: oklch(0.97 0.03 85);

  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 6px;

  --shadow-sm: 0 1px 0 oklch(0.9 0.005 260 / 0.6);
  --shadow: 0 1px 2px oklch(0.2 0.02 260 / 0.04), 0 4px 12px oklch(0.2 0.02 260 / 0.04);
  --shadow-pop: 0 10px 30px oklch(0.2 0.02 260 / 0.12), 0 2px 6px oklch(0.2 0.02 260 / 0.06);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: oklch(0.18 0.012 260);
  --surface: oklch(0.22 0.013 260);
  --surface-2: oklch(0.25 0.013 260);
  --surface-3: oklch(0.28 0.014 260);
  --ink: oklch(0.96 0.005 260);
  --ink-2: oklch(0.85 0.008 260);
  --muted: oklch(0.68 0.01 260);
  --faint: oklch(0.5 0.01 260);
  --border: oklch(0.32 0.012 260);
  --border-strong: oklch(0.4 0.014 260);
  --accent: oklch(0.72 0.14 275);
  --accent-2: oklch(0.78 0.14 275);
  --accent-soft: oklch(0.3 0.05 275);
  --accent-ink: oklch(0.85 0.1 275);
  --danger: oklch(0.72 0.16 27);
  --danger-soft: oklch(0.3 0.05 27);
  --ok: oklch(0.72 0.13 155);
  --warn-soft: oklch(0.3 0.04 85);
  --shadow-sm: 0 1px 0 oklch(0.1 0.005 260 / 0.6);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.2), 0 4px 12px oklch(0 0 0 / 0.24);
  --shadow-pop: 0 10px 30px oklch(0 0 0 / 0.4), 0 2px 6px oklch(0 0 0 / 0.2);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
}

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: 288px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 28px 22px 120px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  position: relative;
}
.brand-mark::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1.5px solid var(--bg);
  border-radius: 50%;
  opacity: 0.35;
}
.brand-mark::after {
  content: '';
  position: absolute;
  width: 5px; height: 5px;
  background: var(--bg);
  border-radius: 50%;
}
.brand-title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.brand-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.side-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--faint);
  text-transform: uppercase;
  padding: 0 10px 10px;
}

.stepnav { display: flex; flex-direction: column; gap: 2px; }
.stepnav-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-2);
  background: transparent;
  border: none;
  text-align: left;
  font: inherit;
  width: 100%;
  transition: background 0.12s ease;
}
.stepnav-item:hover { background: var(--surface-2); }
.stepnav-item.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.stepnav-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.stepnav-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.stepnav-item.active .stepnav-num {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.stepnav-item.done .stepnav-num {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.stepnav-title {
  font-size: 13.5px;
  font-weight: 500;
}
.stepnav-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 1px;
}
.stepnav-check {
  color: var(--ok);
  font-size: 14px;
}

/* ---------- Main content ---------- */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.topbar-left {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}
.topbar-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-right {
  display: flex;
  gap: 14px;
  align-items: center;
}

.autosave {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.autosave-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
}
.autosave.saving .autosave-dot { background: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

.progress-wrap {
  padding: 0 40px;
  background: var(--bg);
}
.progress-bar {
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--accent);
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.content {
  flex: 1;
  padding: 40px 40px 140px;
  max-width: 920px;
  width: 100%;
}

.page-header {
  margin-bottom: 36px;
}
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-ink);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.page-title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 10px;
  text-wrap: balance;
}
.page-desc {
  font-size: 15px;
  color: var(--muted);
  max-width: 58ch;
  text-wrap: pretty;
}

/* ---------- Fieldsets / groups ---------- */
.group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.group-internal {
  background: var(--surface-3);
  border-color: var(--border);
}
.group h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.group h2 .group-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  font-weight: 400;
}

.grid { display: grid; gap: 18px 20px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

@media (max-width: 880px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
}

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-req {
  color: var(--danger);
  font-weight: 400;
}
.field-opt {
  font-size: 11px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.field-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
}
.field-help {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* Info button (ⓘ) + popover */
.info-btn {
  display: inline-grid;
  place-items: center;
  width: 16px; height: 16px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  font-weight: 600;
  transition: all 0.12s;
  flex-shrink: 0;
}
.info-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.info-wrap {
  position: relative;
  display: inline-flex;
}
.info-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  min-width: 240px;
  max-width: 340px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
  animation: fadeUp 0.15s ease;
  white-space: normal;
}
.info-pop::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 6px;
  width: 8px; height: 8px;
  background: var(--ink);
  transform: rotate(45deg);
}

/* Header status cluster */
.status-cluster {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.new-form-btn {
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s;
}
.new-form-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-soft);
}
.new-form-btn-label { display: inline; }

@media (max-width: 1080px) {
  .status-cluster { gap: 10px; }
  .autosave-time { display: none; }
}
@media (max-width: 900px) {
  .new-form-btn-label { display: none; }
  .new-form-btn { padding: 6px 8px; }
  .topbar { padding: 12px 20px; gap: 12px; }
  .topbar-left { gap: 10px; }
  .topbar-title { max-width: 180px; }
}
.field-error {
  font-size: 12px;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 6px;
}

.input, .textarea, .select {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  width: 100%;
  transition: border 0.12s, box-shadow 0.12s, background 0.12s;
  outline: none;
}
.input::placeholder, .textarea::placeholder {
  color: var(--faint);
}
.input:hover, .textarea:hover, .select:hover {
  border-color: var(--faint);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}
.input.error, .textarea.error, .select.error {
  border-color: var(--danger);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.textarea.tall { min-height: 120px; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 5l3 3 3-3' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Checkbox list */
.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 720px) { .check-grid { grid-template-columns: 1fr; } }
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
}
.check-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.check-item.checked {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.check-item input {
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  display: grid;
  place-items: center;
  transition: all 0.12s;
}
.check-item input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.check-item input:checked::after {
  content: '';
  width: 8px; height: 8px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'><path d='M1 4l2 2 4-4' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
}
.check-item span { font-size: 13.5px; color: var(--ink); }

/* Confidential inline mark */
.confidential-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 2px 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.confidential-tag::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--danger);
}

/* Rival card */
.rival-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.rival-card:hover { box-shadow: var(--shadow); }
.rival-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.rival-head-left {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.rival-head-index {
  background: var(--ink);
  color: var(--bg);
  width: 22px; height: 22px;
  border-radius: 5px;
  display: grid; place-items: center;
  font-size: 11px;
}
.rival-head-name {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0;
}
.rival-body { padding: 20px 22px; }

.threat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.threat-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.threat-alto { background: var(--danger-soft); color: var(--danger); }
.threat-alto::before { background: var(--danger); }
.threat-medio { background: var(--warn-soft); color: oklch(0.5 0.12 70); }
.threat-medio::before { background: oklch(0.7 0.14 70); }
.threat-bajo { background: var(--surface-3); color: var(--muted); }
.threat-bajo::before { background: var(--faint); }
[data-theme="dark"] .threat-medio { color: oklch(0.8 0.12 85); }

/* ---------- Buttons ---------- */
.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 9px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: color-mix(in oklab, var(--ink) 85%, var(--bg));
  border-color: color-mix(in oklab, var(--ink) 85%, var(--bg));
}
.btn-accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--danger);
}
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-small {
  font-size: 12.5px;
  padding: 7px 12px;
}
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
}

/* ---------- Footer bar ---------- */
.footerbar {
  position: fixed;
  left: 288px;
  right: 0;
  bottom: 0;
  background: color-mix(in oklab, var(--bg) 95%, transparent);
  backdrop-filter: saturate(1.2) blur(12px);
  border-top: 1px solid var(--border);
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  z-index: 4;
}
.footerbar-left {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.footerbar-actions { display: flex; gap: 10px; }

/* ---------- Review step ---------- */
.review-root { max-width: 820px; }
.review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.review-eyebrow {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--faint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.review-candidate-name {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--ink);
}
.review-candidate-meta {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 4px;
}
.review-completeness { text-align: right; flex-shrink: 0; }
.review-completeness-label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.review-completeness-value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-top: 4px;
}

.review-section {
  margin-bottom: 28px;
  page-break-inside: avoid;
  break-inside: avoid;
}
.review-section h3 {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.review-count {
  display: inline-block;
  font-size: 10.5px;
  padding: 2px 7px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--faint);
  font-weight: 400;
  letter-spacing: 0.04em;
}
.review-subcount {
  font-weight: 400;
  color: var(--faint);
  letter-spacing: 0.02em;
  text-transform: none;
}

.review-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
  page-break-inside: avoid;
  break-inside: avoid;
}
.review-row:last-child { border-bottom: none; }
.review-row dt {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}
.review-row dd {
  color: var(--ink);
  margin: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.rival-review {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 12px;
  background: var(--surface);
  page-break-inside: avoid;
  break-inside: avoid;
}
.rival-review-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.rival-review-idx {
  background: var(--ink);
  color: var(--bg);
  width: 22px; height: 22px;
  border-radius: 5px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
}
.rival-review-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  flex: 1;
}
.review-actions {
  display: flex;
  gap: 10px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.chip {
  display: inline-block;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  margin: 2px 4px 2px 0;
  color: var(--ink-2);
}

@media (max-width: 720px) {
  .review-row { grid-template-columns: 1fr; gap: 2px; padding: 10px 0; }
}

/* ---------- Tweaks panel ---------- */
.tweaks-panel {
  position: fixed;
  right: 24px;
  bottom: 92px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-pop);
  z-index: 100;
  font-size: 13px;
}
.tweaks-panel h3 {
  margin: 0 0 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.tweak-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.tweak-row:first-of-type { border-top: none; }
.tweak-label { color: var(--ink); }
.toggle {
  position: relative;
  width: 36px; height: 20px;
  background: var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  padding: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(16px); }

/* ---------- Federal toggle banner ---------- */
.federal-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in oklab, var(--accent) 20%, var(--border));
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}
.federal-toggle-info { display: flex; flex-direction: column; gap: 4px; }
.federal-toggle-title { font-weight: 600; font-size: 14px; color: var(--ink); }
.federal-toggle-sub { font-size: 12.5px; color: var(--muted); }

.federal-hidden-note {
  padding: 32px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Print ---------- */
@page {
  size: A4;
  margin: 14mm 12mm;
}
@media print {
  * {
    overflow: visible !important;
    max-height: none !important;
  }
  html, body {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: white !important;
    color: black !important;
  }
  .sidebar, .topbar, .footerbar, .tweaks-panel, .stepnav, .progress-wrap, .no-print { display: none !important; }
  .app { display: block !important; height: auto !important; }
  .main {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
  }
  .content {
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
  }
  body {
    font-size: 10.5pt;
    line-height: 1.45;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .page-header { margin-bottom: 14pt; page-break-after: avoid; }
  .page-title { font-size: 20pt; }
  .page-eyebrow { font-size: 8pt; }
  .page-desc { display: none; }

  /* Review-specific print rules */
  .review-root { max-width: none !important; height: auto !important; }
  .review-head { margin-bottom: 14pt; padding-bottom: 10pt; page-break-after: avoid; }
  .review-candidate-name { font-size: 18pt; }
  .review-completeness-value { font-size: 20pt; color: #000 !important; }

  section, .review-section {
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 14pt;
  }
  .review-section h3 {
    page-break-after: avoid;
    break-after: avoid;
    border-bottom: 1pt solid #000;
    color: #000 !important;
  }
  .review-row {
    page-break-inside: avoid;
    break-inside: avoid;
    padding: 4pt 0;
    font-size: 10pt;
    grid-template-columns: 160pt 1fr;
    gap: 10pt;
    border-bottom: 0.5pt dashed #888;
  }
  .review-row dt { color: #333 !important; }
  .review-row dd { color: #000 !important; white-space: pre-wrap !important; }

  /* Long sections: allow internal breaks if content would overflow a page */
  .review-section.long-section,
  .review-section:has(.review-row:nth-child(10)) {
    page-break-inside: auto;
    break-inside: auto;
  }

  .rival-review {
    page-break-inside: avoid;
    break-inside: avoid;
    border: 0.5pt solid #888;
    padding: 8pt 10pt;
    margin-bottom: 8pt;
    background: white !important;
  }
  .rival-review-idx { background: #000 !important; color: white !important; }

  .chip {
    background: white !important;
    border: 0.5pt solid #666 !important;
    color: #000 !important;
  }
  .threat-pill {
    background: white !important;
    border: 0.5pt solid #666 !important;
    color: #000 !important;
  }
  .threat-pill::before { background: #000 !important; }

  .group { page-break-inside: avoid; box-shadow: none; border: 1px solid #ddd; margin-bottom: 16px; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
.print-header { display: none; }
@media print {
  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1pt solid #000;
    padding-bottom: 4pt;
    margin-bottom: 10pt;
    font-family: var(--font-mono);
    font-size: 8pt;
    color: #000;
  }
}

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.step-fade { animation: fadeUp 0.25s ease; }

/* Scrollbar subtle */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }

/* ---------- Focus visible ---------- */
.btn:focus-visible, .stepnav-item:focus-visible, .check-item:focus-visible, .toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
