/* The MC Energy Index — design tokens + respondent flow + builder + admin */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0a0a0a;
  color: #e9e3d2;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, button { font-family: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
a { color: inherit; text-decoration: none; }

/* ============================================================================
   SHELL — view switcher
============================================================================ */
.app-shell { min-height: 100vh; background: var(--bg, #0a0a0a); }
.view-switch {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 50;
  display: flex; gap: 0;
  background: rgba(20,20,20,0.9);
  border: 1px solid rgba(196,154,60,0.35);
  border-radius: 999px;
  padding: 4px;
  backdrop-filter: blur(12px);
  font-family: "Inter", sans-serif;
}
.view-switch button {
  padding: 7px 16px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(233,227,210,0.55);
  border-radius: 999px;
  transition: all 0.18s ease;
}
.view-switch button:hover { color: #C49A3C; }
.view-switch button.is-active {
  background: #C49A3C;
  color: #0a0a0a;
}

/* ============================================================================
   RESPONDENT FLOW
============================================================================ */
.rf-root {
  --gold: #C49A3C;
  --gold-soft: rgba(196,154,60,0.18);
  --bg: #0a0a0a;
  --bg-2: #131210;
  --ink: #ffffff;
  --mute: rgba(255,255,255,0.7);
  --rule: rgba(196,154,60,0.18);

  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.rf-root[data-variant="bold"] {
  background:
    radial-gradient(ellipse at top, rgba(196,154,60,0.08), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(196,154,60,0.05), transparent 50%),
    #0a0a0a;
}
.rf-root[data-variant="bold"]::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(196,154,60,0.04) 1px, transparent 1px);
  background-size: 100% 88px;
  pointer-events: none; mask-image: linear-gradient(to bottom, black, transparent 80%);
}

/* Progress */
.rf-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: rgba(196,154,60,0.12);
  z-index: 30;
}
.rf-progress-fill {
  height: 100%; background: var(--gold);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header — minimal bar, just holds the question counter on the right */
.rf-header {
  position: relative; z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 56px 0;
  min-height: 22px;
}
.rf-header-spacer { grid-column: 2; }
.rf-logo {
  grid-column: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
}
.rf-logo-credit {
  color: #ffffff;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-align: center;
  max-width: min(720px, 80vw);
  line-height: 1.5;
  margin-top: -4px;
}
.rf-logo img {
  display: block;
  height: 158px;
  width: auto;
  max-width: min(968px, 88vw);
  object-fit: contain;
}
.rf-archetype-icons {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px 18px;
  width: 100%;
  max-width: 560px;
  color: var(--gold);
  margin: 14px 0 22px;
}
.rf-welcome .rf-archetype-icons {
  margin: 18px auto 28px;
  max-width: 100%;
  width: 100%;
}
.rf-arch-icon {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
}
@media (max-width: 640px) {
  .rf-archetype-icons {
    gap: 22px 0;
    max-width: 100%;
  }
  /* Row 1: Conductor + Warm Host (2 cols, 50% each) */
  .rf-arch-icon:nth-child(1),
  .rf-arch-icon:nth-child(2) {
    flex: 0 0 50%;
    max-width: 50%;
  }
  /* Row 2: Entertainer + Hype Man + Showman (3 cols, ~33% each) */
  .rf-arch-icon:nth-child(3),
  .rf-arch-icon:nth-child(4),
  .rf-arch-icon:nth-child(5) {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
  }
  .rf-arch-icon-label {
    font-size: 9px;
    letter-spacing: 0.1em;
  }
}
.rf-arch-icon svg {
  width: 36px; height: 36px;
  display: block;
}
.rf-arch-icon-label {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: #ffffff; font-weight: 600;
  white-space: nowrap;
}
.rf-counter {
  grid-column: 3;
  justify-self: end;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--mute);
  letter-spacing: 0.1em;
}
.rf-counter-num { color: var(--gold); }
.rf-counter-sep { margin: 0 4px; }

/* Main */
.rf-main {
  flex: 1;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 56px 40px;
  position: relative; z-index: 2;
}

/* Footer */
.rf-footer {
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 56px 24px;
  font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  font-weight: 500;
}
.rf-footer-row {
  display: flex; justify-content: space-between; gap: 16px;
}
.rf-footer-credit {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
  text-align: center;
  font-weight: 400;
}

/* ---- Welcome ---- */
.rf-welcome {
  max-width: 1180px; width: 100%;
  animation: rfFadeUp 0.6s ease both;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 64px;
  align-items: start;
  text-align: left;
  margin: 0 auto;
}
.rf-welcome-text { min-width: 0; }
.rf-welcome-form-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.rf-welcome .rf-lede { margin-left: 0; margin-right: 0; }
.rf-welcome .rf-form {
  margin: 0;
  max-width: 100%;
  width: 100%;
}
.rf-welcome .rf-field-label { text-align: left; }
.rf-welcome .rf-input { text-align: left; }
.rf-welcome .rf-cta { align-self: flex-start; justify-self: flex-start; }
.rf-welcome .rf-hint { text-align: left; }
.rf-welcome .rf-title { text-align: left; }
.rf-welcome .rf-eyebrow { text-align: left; }

@media (max-width: 900px) {
  .rf-welcome {
    grid-template-columns: 1fr;
    gap: 0;
    text-align: center;
  }
  /* When stacked, the second column's first paragraph should sit a normal
     paragraph-distance below the first column's last paragraph — the .rf-lede
     bottom-margin already supplies that, so no extra row-gap is needed. */
  .rf-welcome-form-col > .rf-lede:first-child { margin-top: 0; }
  .rf-welcome-form-col { }
  .rf-welcome .rf-lede { margin-left: auto; margin-right: auto; }
  .rf-welcome .rf-form { margin-left: auto; margin-right: auto; max-width: 520px; }
  .rf-welcome .rf-field-label,
  .rf-welcome .rf-input,
  .rf-welcome .rf-hint,
  .rf-welcome .rf-title,
  .rf-welcome .rf-eyebrow { text-align: center; }
  .rf-welcome .rf-cta { align-self: center; justify-self: center; }
}
.rf-eyebrow {
  font-size: 14px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
  margin-bottom: 24px;
}
.rf-title {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(40px, 5.4vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 24px;
  color: var(--ink);
  text-wrap: balance;
  white-space: normal;
}
.rf-title br { display: block; }
.rf-root[data-variant="bold"] .rf-title { color: var(--gold); }
.rf-lede {
  font-size: 18px; line-height: 1.55; max-width: 620px;
  color: #ffffff;
  margin: 0 0 18px;
}
.rf-lede:last-of-type { margin-bottom: 40px; }
.rf-lede-em { color: #ffffff; font-style: italic; font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

.rf-form { display: grid; gap: 20px; max-width: 520px; }
.rf-field { display: flex; flex-direction: column; gap: 8px; }
.rf-field-label {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
}
.rf-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(196,154,60,0.35);
  padding: 12px 0;
  font-size: 22px;
  color: var(--ink);
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease;
}
.rf-input::placeholder { color: rgba(255,255,255,0.25); }
.rf-input:focus { border-bottom-color: var(--gold); }
.rf-error { font-size: 12px; color: #e07f7f; }
.rf-hint {
  font-size: 12px; letter-spacing: 0.06em;
  color: var(--mute);
}
.rf-hint-inline {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

/* CTA button */
.rf-cta {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 18px 28px;
  background: var(--gold);
  color: #0a0a0a;
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  border-radius: 2px;
  transition: all 0.18s ease;
  align-self: flex-start;
  margin-top: 6px;
}
.rf-cta:hover:not(:disabled) {
  background: #d8ad4a;
  transform: translateY(-1px);
}
.rf-cta:disabled { opacity: 1; cursor: not-allowed; }
.rf-cta-sm { padding: 14px 22px; font-size: 12px; }
.rf-cta-ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}
.rf-cta-ghost:hover:not(:disabled) {
  background: rgba(196,154,60,0.08);
}

/* ---- Question screen ---- */
.rf-question {
  max-width: 800px; width: 100%;
  animation: rfFadeUp 0.45s ease both;
}
.rf-q-label {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
  margin-bottom: 18px;
}
.rf-q-text {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 38px;
  font-style: normal;
  text-wrap: pretty;
  color: var(--ink);
}
.rf-root[data-variant="bold"] .rf-q-text {
  font-style: normal;
  color: var(--gold);
}

.rf-options { display: flex; flex-direction: column; gap: 10px; }
.rf-option {
  width: 100%;
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  text-align: left;
  font-size: 17px;
  color: var(--ink);
  transition: all 0.16s cubic-bezier(0.4, 0, 0.2, 1);
}
.rf-option:hover {
  background: rgba(196,154,60,0.06);
  border-color: rgba(196,154,60,0.5);
  transform: translateX(2px);
}
.rf-option.is-selected {
  background: rgba(196,154,60,0.12);
  border-color: var(--gold);
}
.rf-key {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gold);
  font-family: "JetBrains Mono", "SF Mono", monospace;
  transition: all 0.16s ease;
}
.rf-option:hover .rf-key,
.rf-option.is-selected .rf-key {
  background: var(--gold);
  color: #0a0a0a;
  border-color: var(--gold);
}
.rf-option-text { flex: 1; }
.rf-option-check {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--gold);
}

/* footer for question */
.rf-q-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 36px;
}
.rf-textbtn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
  transition: color 0.18s ease;
}
.rf-textbtn:hover { color: var(--gold); }

/* ---- Computing ---- */
.rf-computing { display: grid; place-items: center; gap: 24px; }
.rf-spinner {
  width: 38px; height: 38px;
  border: 2px solid rgba(196,154,60,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: rfSpin 0.9s linear infinite;
}
.rf-computing-text {
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
}
@keyframes rfSpin { to { transform: rotate(360deg); } }

/* ---- Result ---- */
.rf-result {
  max-width: 920px; width: 100%;
  animation: rfFadeUp 0.7s ease both;
}
.rf-result-eyebrow {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
  margin-bottom: 18px;
}

/* Score card */
.rf-score-card {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 36px 40px;
  background: linear-gradient(180deg, rgba(196,154,60,0.08), transparent 50%);
  margin-bottom: 36px;
}
.rf-archetype-letter {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 88px;
  line-height: 1;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: -0.02em;
}
.rf-archetype-icon {
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  margin-bottom: 8px;
}
.rf-archetype-icon svg {
  width: 88px; height: 88px;
  display: block;
}
.rf-archetype-icon svg path,
.rf-archetype-icon svg circle {
  stroke-width: 1.4;
}
.rf-archetype-name {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(38px, 4.5vw, 58px);
  line-height: 1.05; font-weight: 600;
  color: var(--ink);
  margin: 4px 0 8px;
  letter-spacing: -0.01em;
}
.rf-archetype-tag {
  font-style: italic;
  color: var(--mute);
  font-size: 18px;
  margin-bottom: 28px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rf-bars { display: grid; gap: 10px; }
.rf-bar-row {
  display: grid;
  grid-template-columns: 180px 1fr 30px;
  gap: 16px; align-items: center;
  font-size: 13px;
  color: var(--mute);
}
.rf-bar-row.is-top { color: var(--ink); font-weight: 500; }
.rf-bar-track {
  height: 6px;
  background: rgba(196,154,60,0.1);
  border-radius: 999px;
  overflow: hidden;
}
.rf-bar-fill {
  display: block; height: 100%;
  background: rgba(196,154,60,0.4);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.rf-bar-row.is-top .rf-bar-fill { background: var(--gold); }
.rf-bar-val {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-align: right;
  color: var(--gold);
}

/* Persona card */
.rf-persona-card { margin-bottom: 36px; }
.rf-persona-frame {
  border: 2px solid var(--gold);
  padding: 56px 40px;
  background:
    radial-gradient(ellipse at center, rgba(196,154,60,0.1), transparent 70%),
    #0a0a0a;
  text-align: center;
  position: relative;
}
.rf-persona-frame::before, .rf-persona-frame::after {
  content: ""; position: absolute;
  width: 24px; height: 24px;
  border: 2px solid var(--gold);
}
.rf-persona-frame::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.rf-persona-frame::after { bottom: -2px; right: -2px; border-left: none; border-top: none; }
.rf-persona-letter {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 140px; line-height: 0.9;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: -0.04em;
}
.rf-persona-icon {
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  margin-bottom: 4px;
}
.rf-persona-icon svg {
  width: 132px; height: 132px;
  display: block;
}
.rf-persona-icon svg path,
.rf-persona-icon svg circle {
  stroke-width: 1.3;
}
.rf-persona-name {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 600;
  color: var(--ink);
  margin: 8px 0 10px;
  letter-spacing: -0.01em;
}
.rf-persona-tag {
  font-style: italic;
  color: var(--gold);
  font-size: 20px;
  margin-bottom: 18px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.rf-persona-meta {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--mute);
}
.rf-persona-meta-dot { margin: 0 10px; color: var(--gold); }

/* Result body */
.rf-result-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 40px;
  margin-bottom: 40px;
}
.rf-result-block {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}
.rf-result-body > .rf-result-description { grid-column: 1 / -1; }
.rf-result-body > .rf-result-block:nth-of-type(3) { grid-column: 1 / -1; }
.rf-result-framework {
  grid-column: 1 / -1;
  margin-top: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}
.rf-result-framework .rf-result-block-title {
  align-self: flex-start;
}
.rf-result-framework img {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  border-radius: 4px;
}
.rf-result-description {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 auto 6px;
  max-width: 760px;
  text-align: center;
}
.rf-result-block-title {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
  margin-bottom: 14px;
}
.rf-result-list { display: grid; gap: 10px; }
.rf-result-list li {
  font-size: 16px; line-height: 1.5;
  color: var(--ink);
  padding-left: 18px;
  position: relative;
}
.rf-result-list li::before {
  content: ""; position: absolute; left: 0; top: 11px;
  width: 8px; height: 1px; background: var(--gold);
}
.rf-result-closing {
  grid-column: 1 / -1;
  margin-top: 6px;
}
.rf-result-closing .rf-result-block-prose {
  font-style: italic;
  color: var(--ink);
}
.rf-result-block-prose {
  font-size: 17px; line-height: 1.55;
  color: var(--ink);
  margin: 0;
  text-wrap: pretty;
}

.rf-result-cta {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.rf-result-emailed {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px;
  color: var(--mute);
}
.rf-result-emailed b { color: var(--ink); font-weight: 500; }
.rf-retake { margin-top: 4px; }
.rf-result-cta-lede {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(32px, 3.6vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
  margin-top: 4px;
}
.rf-root[data-variant="bold"] .rf-result-cta-lede { color: var(--gold); }
.rf-result-cta-body {
  font-size: 16px;
  line-height: 1.55;
  color: #ffffff;
  max-width: 560px;
  margin: 0 0 6px;
}
.rf-result-cta .rf-cta { margin-top: 2px; }
.rf-result-cta-secondary { margin-top: 2px; }

/* animations */
@keyframes rfFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   BUILDER VIEW
============================================================================ */
.bv-root {
  --gold: #C49A3C;
  --bg: #0a0a0a;
  --panel: #131210;
  --rule: rgba(196,154,60,0.18);
  --ink: #ffffff;
  --mute: #ffffff;
  min-height: 100vh;
  padding-top: 64px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", sans-serif;
}
.bv-shell { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 64px); }

.bv-sidebar {
  background: var(--panel);
  border-right: 1px solid var(--rule);
  padding: 28px 22px;
  display: flex; flex-direction: column; gap: 28px;
}
.bv-side-section {}
.bv-side-title {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 8px;
}
.bv-side-name {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px; font-weight: 500;
  margin-bottom: 8px; line-height: 1.2;
}
.bv-side-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--mute);
}
.bv-dot { width: 6px; height: 6px; border-radius: 50%; background: #6fc18b; box-shadow: 0 0 6px rgba(111,193,139,0.6); }

.bv-nav { display: flex; flex-direction: column; gap: 2px; }
.bv-nav-group {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--mute); margin-top: 12px; margin-bottom: 6px;
  font-weight: 600;
}
.bv-nav-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; border-radius: 3px;
  font-size: 13px; color: var(--ink);
  cursor: pointer; transition: background 0.16s ease;
}
.bv-nav-item:hover { background: rgba(196,154,60,0.08); }
.bv-nav-item.is-active { background: rgba(196,154,60,0.14); color: var(--gold); }
.bv-nav-pill {
  font-size: 10px; padding: 2px 7px; border-radius: 999px;
  background: rgba(196,154,60,0.15); color: var(--gold);
  font-family: "JetBrains Mono", monospace;
}

.bv-side-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 20px; border-top: 1px solid var(--rule); }
.bv-stat { display: flex; justify-content: space-between; font-size: 12px; color: var(--mute); }
.bv-stat b { color: var(--gold); font-weight: 600; font-family: "JetBrains Mono", monospace; }

.bv-main { display: flex; flex-direction: column; }
.bv-topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 32px; border-bottom: 1px solid var(--rule);
}
.bv-tabs { display: flex; gap: 2px; }
.bv-tab {
  padding: 8px 16px;
  font-size: 12px; letter-spacing: 0.06em;
  color: var(--mute); border-radius: 3px;
  transition: all 0.16s ease;
}
.bv-tab:hover { color: var(--ink); }
.bv-tab.is-active { background: rgba(196,154,60,0.14); color: var(--gold); }

.bv-actions { display: flex; gap: 8px; }
.bv-ghost, .bv-primary {
  padding: 9px 16px; font-size: 12px; font-weight: 500;
  letter-spacing: 0.06em; border-radius: 3px;
  transition: all 0.16s ease;
}
.bv-ghost { border: 1px solid var(--rule); color: var(--ink); }
.bv-ghost:hover { border-color: var(--gold); }
.bv-primary { background: var(--gold); color: #0a0a0a; }
.bv-primary:hover { background: #d8ad4a; }

.bv-canvas {
  flex: 1; display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  padding: 28px 32px;
  background:
    radial-gradient(ellipse at top right, rgba(196,154,60,0.04), transparent 60%),
    var(--bg);
}

.bv-stage-list { display: flex; flex-direction: column; gap: 8px; }
.bv-stage {
  background: var(--panel); border: 1px solid var(--rule); border-radius: 4px;
  cursor: pointer; transition: all 0.16s ease;
}
.bv-stage:hover { border-color: rgba(196,154,60,0.4); }
.bv-stage.is-expanded { border-color: var(--gold); }
.bv-stage-row {
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 14px 18px;
}
.bv-stage-icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: rgba(196,154,60,0.1);
  color: var(--gold);
  border-radius: 3px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px; font-weight: 500;
}
.bv-stage-type {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 3px;
}
.bv-stage-label {
  font-size: 14px; line-height: 1.3;
  color: var(--ink);
}
.bv-stage-meta {
  font-size: 11px; color: var(--mute); margin-top: 4px;
}
.bv-stage-badge {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(111,193,139,0.15); color: #6fc18b;
  padding: 4px 8px; border-radius: 999px;
  font-weight: 600;
}
.bv-stage-chevron {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  color: var(--gold); font-size: 18px;
  border: 1px solid var(--rule); border-radius: 3px;
}
.bv-stage-expand {
  border-top: 1px solid var(--rule);
  padding: 8px 18px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.bv-opt {
  display: grid; grid-template-columns: 28px 1fr auto;
  gap: 14px; align-items: center;
  padding: 8px 8px;
  font-size: 13px;
  border-radius: 3px;
}
.bv-opt:hover { background: rgba(196,154,60,0.05); }
.bv-opt-key {
  text-align: center;
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  color: var(--mute);
}
.bv-opt-text { color: var(--ink); }
.bv-opt-map {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--gold);
}

.bv-inspector {
  background: var(--panel); border: 1px solid var(--rule); border-radius: 4px;
  padding: 22px; height: fit-content;
  position: sticky; top: 88px;
}
.bv-insp-title {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 6px;
}
.bv-insp-sub {
  font-size: 13px; color: var(--mute);
  margin-bottom: 16px; line-height: 1.4;
}
.bv-insp-divider { height: 1px; background: var(--rule); margin: 22px 0; }

.bv-bucket-list { display: flex; flex-direction: column; gap: 6px; }
.bv-bucket {
  display: grid; grid-template-columns: 28px 1fr;
  gap: 12px; align-items: center;
  padding: 10px 12px;
  background: rgba(196,154,60,0.05);
  border-radius: 3px;
  position: relative;
}
.bv-bucket-letter {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--gold); color: #0a0a0a;
  border-radius: 3px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px; font-weight: 600;
}
.bv-bucket-name { font-size: 13px; color: var(--ink); font-weight: 500; }
.bv-bucket-count {
  grid-column: 2; font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.06em;
}

.bv-onsubmit { display: flex; flex-direction: column; gap: 10px; }
.bv-onsubmit li {
  display: flex; gap: 10px; align-items: center;
  font-size: 13px; color: var(--ink);
}
.bv-check { color: var(--gold); font-weight: 600; }

/* ============================================================================
   ADMIN VIEW
============================================================================ */
.av-root {
  --gold: #C49A3C;
  --bg: #0a0a0a;
  --panel: #131210;
  --rule: rgba(196,154,60,0.18);
  --ink: #ffffff;
  --mute: #ffffff;
  min-height: 100vh; padding: 88px 56px 40px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", sans-serif;
}
.av-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
}
.av-eyebrow {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 8px;
}
.av-title {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 34px; font-weight: 600;
  margin: 0; letter-spacing: -0.01em;
}
.av-stats { display: flex; gap: 36px; }
.av-stat-num {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 36px; line-height: 1;
  color: var(--gold);
}
.av-stat-lbl {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--mute); margin-top: 6px; font-weight: 600;
}

.av-distribution {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 12px; padding: 24px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 4px;
  margin-bottom: 28px;
}
.av-dist-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.av-dist-bar {
  width: 100%; height: 100px;
  display: flex; align-items: flex-end;
  background: rgba(196,154,60,0.06); border-radius: 2px;
}
.av-dist-bar span {
  display: block; width: 100%;
  background: linear-gradient(180deg, var(--gold), rgba(196,154,60,0.3));
  border-radius: 2px;
  transition: height 0.6s ease;
}
.av-dist-pct {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px; color: var(--gold);
}
.av-dist-name {
  font-size: 11px; color: var(--mute);
  letter-spacing: 0.04em;
}

.av-grid {
  display: grid; grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}
.av-list {
  background: var(--panel); border: 1px solid var(--rule); border-radius: 4px;
  overflow: hidden;
}
.av-list-head, .av-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 100px;
  gap: 16px; align-items: center;
  padding: 12px 18px;
  text-align: left;
}
.av-list-head {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--mute); font-weight: 600;
  border-bottom: 1px solid var(--rule);
  background: rgba(196,154,60,0.04);
}
.av-row {
  width: 100%; border: none; background: transparent;
  border-bottom: 1px solid var(--rule);
  cursor: pointer; transition: background 0.14s ease;
  font-size: 13px;
}
.av-row:last-child { border-bottom: none; }
.av-row:hover { background: rgba(196,154,60,0.04); }
.av-row.is-selected { background: rgba(196,154,60,0.1); }
.av-row-name { display: flex; gap: 10px; align-items: center; }
.av-row-name b { display: block; font-weight: 500; color: var(--ink); }
.av-row-name em { display: block; font-style: normal; font-size: 11px; color: var(--mute); margin-top: 2px; }
.av-row-avatar {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: rgba(196,154,60,0.15);
  color: var(--gold);
  border-radius: 50%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  flex-shrink: 0;
}
.av-row-arch { display: flex; gap: 10px; align-items: center; color: var(--mute); }
.av-row-letter {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  background: var(--gold); color: #0a0a0a;
  border-radius: 3px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; font-weight: 600;
}
.av-row-when { font-size: 11px; color: var(--mute); font-family: "JetBrains Mono", monospace; }

.av-detail {
  background: var(--panel); border: 1px solid var(--rule); border-radius: 4px;
  padding: 24px;
  height: fit-content;
}
.av-detail-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 18px; border-bottom: 1px solid var(--rule);
  margin-bottom: 18px;
}
.av-detail-name {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.01em;
}
.av-detail-email { font-size: 12px; color: var(--mute); margin-top: 4px; }
.av-detail-letter {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  background: var(--gold); color: #0a0a0a;
  border-radius: 4px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 32px; font-weight: 600;
}
.av-detail-arch {
  margin-bottom: 22px;
}
.av-detail-arch b {
  display: block;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 22px; font-weight: 500; color: var(--gold);
  letter-spacing: -0.01em;
}
.av-detail-arch span {
  font-style: italic;
  color: var(--mute); font-size: 14px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.av-detail-bars { display: grid; gap: 8px; padding-bottom: 20px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; }
.av-detail-bar {
  display: grid; grid-template-columns: 110px 1fr 24px;
  gap: 12px; align-items: center;
  font-size: 12px; color: var(--mute);
}
.av-detail-bar.is-top { color: var(--ink); }
.av-detail-bar-track {
  height: 4px; background: rgba(196,154,60,0.1); border-radius: 999px; overflow: hidden;
}
.av-detail-bar-track span {
  display: block; height: 100%;
  background: rgba(196,154,60,0.4);
}
.av-detail-bar.is-top .av-detail-bar-track span { background: var(--gold); }
.av-detail-bar-val {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; text-align: right; color: var(--gold);
}
.av-detail-meta { display: grid; gap: 10px; }
.av-detail-meta div {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
}
.av-detail-meta span { color: var(--mute); letter-spacing: 0.04em; text-transform: uppercase; font-size: 10px; font-weight: 600; }
.av-detail-meta b { color: var(--ink); font-weight: 500; font-family: "JetBrains Mono", monospace; }
.av-sent { color: #6fc18b !important; }

@media (max-width: 1024px) {
  .rf-header, .rf-main, .rf-footer { padding-left: 28px; padding-right: 28px; }
  .rf-result-body { grid-template-columns: 1fr; }
  .av-root { padding: 88px 24px 40px; }
  .av-grid { grid-template-columns: 1fr; }
  .bv-shell { grid-template-columns: 1fr; }
  .bv-sidebar { display: none; }
  .bv-canvas { grid-template-columns: 1fr; }
}

/* ============================================================================
   PRINT REPORT — rendered hidden in the DOM, captured by html2pdf on demand
   ============================================================================ */
.rf-print {
  display: none;
}

/* While html2pdf is capturing, position the report off-screen but laid out
   so html2canvas can paint it. Using opacity:0 + zero size cover keeps it
   reliably renderable in Chromium without negative offsets. */
.rf-print.rf-print-capturing {
  display: block;
  position: fixed;
  left: 0;
  top: 0;
  width: 190mm; /* A4 portrait minus 10mm margins each side */
  min-height: 100vh;
  background: #ffffff;
  color: #111;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
}

.rf-print-page {
  width: 100%;
  max-width: 190mm;
  margin: 0 auto;
  padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111;
  background: #ffffff;
}

.rf-print-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 0 8px;
  border-bottom: 1px solid #c49a3c;
  margin-bottom: 8px;
}
.rf-print-logo {
  height: 42px; width: auto;
  background: #0a0a0a;
  padding: 6px 10px;
  border-radius: 3px;
  flex: 0 0 auto;
}
.rf-print-credit {
  margin: 0;
  font-size: 7pt;
  color: #555;
  letter-spacing: 0.01em;
  line-height: 1.35;
  text-align: right;
  max-width: 110mm;
}

.rf-print-meta {
  display: flex; gap: 24px;
  margin-bottom: 10px;
  font-size: 9pt;
}
.rf-print-meta > div { display: flex; flex-direction: row; align-items: baseline; gap: 6px; }
.rf-print-meta span {
  font-size: 7pt; letter-spacing: 0.12em; text-transform: uppercase;
  color: #c49a3c; font-weight: 600;
}
.rf-print-meta b { font-size: 9.5pt; font-weight: 600; color: #111; }

.rf-print-archetype {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  border: 1px solid #c49a3c;
  border-radius: 3px;
  background: #fdf8ec;
  margin-bottom: 10px;
  page-break-inside: avoid;
}
.rf-print-archetype-icon {
  flex: 0 0 auto;
  color: #c49a3c;
  display: flex; align-items: center; justify-content: center;
}
.rf-print-archetype-icon svg { width: 40px; height: 40px; display: block; }
.rf-print-archetype-text { flex: 1; }
.rf-print-eyebrow {
  font-size: 7pt; letter-spacing: 0.14em; text-transform: uppercase;
  color: #c49a3c; font-weight: 600;
  margin-bottom: 2px;
}
.rf-print-archetype-name {
  font-size: 16pt;
  font-weight: 600;
  margin: 0 0 1px;
  letter-spacing: -0.01em;
  color: #111;
  line-height: 1.1;
}
.rf-print-archetype-tag {
  font-size: 9pt;
  color: #555;
}

.rf-print-description {
  font-size: 9.5pt;
  line-height: 1.4;
  color: #222;
  margin: 0 0 10px;
}

.rf-print-section {
  margin-bottom: 8px;
  page-break-inside: avoid;
}
.rf-print-section-title {
  font-size: 8pt; letter-spacing: 0.14em; text-transform: uppercase;
  color: #c49a3c; font-weight: 600;
  margin: 0 0 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid #e7d8a8;
}
.rf-print-prose {
  font-size: 9.5pt;
  line-height: 1.4;
  color: #222;
  margin: 0 0 4px;
}

.rf-print-bars {
  display: grid;
  gap: 3px;
}
.rf-print-bar {
  display: grid;
  grid-template-columns: 110px 1fr 50px;
  align-items: center;
  gap: 10px;
  font-size: 9pt;
}
.rf-print-bar-label { color: #444; }
.rf-print-bar-track {
  height: 6px;
  background: #f1e5c4;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.rf-print-bar-fill {
  display: block;
  height: 100%;
  background: #c49a3c;
}
.rf-print-bar.is-top .rf-print-bar-label { color: #111; font-weight: 600; }
.rf-print-bar.is-top .rf-print-bar-fill { background: #b48528; }
.rf-print-bar-val {
  text-align: right;
  font-family: "JetBrains Mono", monospace;
  font-size: 8pt;
  color: #555;
}

.rf-print-closing .rf-print-prose {
  font-style: italic;
  color: #333;
}
.rf-print-closing { page-break-after: avoid; }

.rf-print-framework {
  page-break-before: always;
  break-before: page;
  page-break-after: avoid;
  break-after: avoid;
  page-break-inside: avoid;
  break-inside: avoid;
  text-align: center;
  margin: 0;
  padding: 0;
}
.rf-print-framework .rf-print-section-title {
  margin-bottom: 6px;
}
.rf-print-framework img {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 190mm;
  height: auto;
  max-height: 270mm;
  object-fit: contain;
  border-radius: 3px;
}

/* Hide footer in print to prevent overflowing onto a third page */
.rf-print-foot { display: none; }
