:root {
  --bg: #faf6ef;
  --bg-deep: #f4ecdd;
  --ink: #221c14;
  --ink-2: #2c241c;
  --muted: #5b5043;
  --line: #e6dcc8;
  --line-soft: #efe7d6;
  --accent: #b27a2a;
  --accent-deep: #8f5f1d;
  --accent-soft: #f3e6cf;
  --panel: #ffffff;
  --danger: #b04a3a;
  --good:   #3f6b35;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(60,40,10,.05);
  --shadow: 0 1px 2px rgba(60,40,10,.04), 0 10px 30px -12px rgba(60,40,10,.12);
  --shadow-lift: 0 2px 4px rgba(60,40,10,.06), 0 18px 44px -16px rgba(60,40,10,.20);
  --focus-ring: 0 0 0 3px rgba(178,122,42,.25);
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  /* Soft savanna wash: a warm glow at the top fading into the base. */
  background:
    radial-gradient(1100px 460px at 50% -180px, rgba(178,122,42,.10), rgba(178,122,42,0) 70%),
    linear-gradient(var(--bg), var(--bg));
  background-attachment: scroll;
}

/* Media never overflows its container. */
img, svg, video { max-width: 100%; height: auto; }

::selection { background: var(--accent-soft); color: var(--ink); }

/* The topbar is sticky, so in-page anchors must clear it rather than
 * landing underneath. Applies to headings and any explicit anchor target. */
:where(h1, h2, h3, [id]) { scroll-margin-top: 84px; }

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 6px;
}

/* Keyboard-accessible skip link: hidden until focused. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: white;
  padding: 8px 14px;
  border-radius: 0 0 8px 0;
  font-size: 13px;
  font-weight: 500;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
  text-decoration: none;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  backdrop-filter: blur(10px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand {
  font-family: var(--font-display);
  font-weight: 600; font-size: 20px; color: var(--ink);
  letter-spacing: 0;
  display: inline-flex; align-items: center; gap: 9px;
}
.topbar .brand .brand-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: block;
  box-shadow: 0 1px 3px rgba(60,40,10,.22);
}
.topbar nav { display: flex; gap: 18px; align-items: center; font-size: 14px; }
.topbar nav a { color: var(--muted); }
.topbar nav a:hover { color: var(--ink); text-decoration: none; }
.topbar nav .who { color: var(--muted); padding-left: 6px; border-left: 1px solid var(--line); margin-left: 4px; }
.topbar nav .cta {
  background: var(--ink); color: white !important; padding: 7px 15px; border-radius: 999px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(60,40,10,.2);
  transition: background .12s ease, transform .08s ease;
}
.topbar nav .cta:hover { background: var(--accent-deep); }
.topbar form.inline { display: inline; margin: 0; }
.topbar .link {
  background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0;
}
.topbar .link:hover { color: var(--ink); }

/* On narrower viewports the nav has too many links to sit on one line
 * beside the brand. Stack it under the brand and let it scroll sideways
 * rather than wrapping into a ragged block or overflowing the page. */
@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 16px;
  }
  .topbar nav {
    gap: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a, .topbar nav .link { white-space: nowrap; }
  .topbar nav .who { border-left: 0; padding-left: 0; margin-left: auto; }
}

.container { max-width: 980px; margin: 0 auto; padding: 36px 24px 96px; }
.footer {
  max-width: 980px; margin: 40px auto 32px; padding: 20px 24px 0;
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 12px; color: var(--muted);
  flex-wrap: wrap;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.4vw, 42px); line-height: 1.08; margin: 0 0 14px;
  letter-spacing: -0.01em; font-weight: 600;
}
h2 {
  font-family: var(--font-display);
  font-size: 25px; margin: 32px 0 14px; letter-spacing: -0.005em; font-weight: 600;
  line-height: 1.2;
}
h3 { font-size: 17px; margin: 0 0 8px; }
h4 { font-size: 13px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .09em; color: var(--accent-deep); font-weight: 700; }
.lede { font-size: 18px; color: var(--muted); margin: 0 0 28px; line-height: 1.55; max-width: 70ch; }
.muted { color: var(--muted); }
.error { background: #fbe9e6; color: var(--danger); padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid #e7b9b2; }
.flash { background: #ecf3e6; color: var(--good); padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid #b7d3a9; }
.checkbox { flex-direction: row; align-items: center; gap: 8px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; background: var(--bg); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); }
.kicker { text-transform: uppercase; letter-spacing: .18em; font-size: 11px; color: var(--accent-deep); margin: 0; font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 22px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 500;
  text-decoration: none;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease, opacity .12s ease, border-color .15s ease;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  color: white;
  box-shadow: 0 1px 2px rgba(60,40,10,.25), inset 0 1px 0 rgba(255,255,255,.08);
}
.btn.primary:hover { background: linear-gradient(180deg, #3a3026, var(--ink-2)); box-shadow: 0 6px 16px -4px rgba(60,40,10,.35); }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-deep); box-shadow: 0 4px 12px -4px rgba(60,40,10,.18); }
.btn.danger { background: var(--danger); color: white; }
.btn.small { padding: 7px 14px; font-size: 13px; }
button.link {
  background: none; border: 0; color: var(--accent-deep); cursor: pointer; font: inherit; padding: 0;
}
button.link:hover { text-decoration: underline; }
button.link.danger { color: var(--danger); }

.hero { padding: 36px 0 8px; }
.copy { margin-top: 32px; }
.copy ul { padding-left: 18px; }
.caveat {
  margin-top: 12px; font-size: 13px; color: var(--muted);
  background: var(--bg); border-left: 3px solid var(--accent);
  padding: 10px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Landing-page hero: bigger, more deliberate spacing, calmer composition. */
.hero-landing {
  padding: 72px 0 32px;
  max-width: 760px;
}
.hero-landing .kicker { margin-bottom: 14px; }
.hero-landing h1 {
  font-size: clamp(42px, 6.5vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin-bottom: 20px;
}
.hero-landing .lede {
  font-size: 19px;
  color: var(--muted);
  margin-bottom: 30px;
  max-width: 620px;
}
.hero-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }

/* Eight-archetype teaser tiles: names + tagline, no detail. Each tile
 * carries its archetype colour via an inline --accent custom property. */
.teaser-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 36px 0 8px;
}
@media (max-width: 880px) { .teaser-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .teaser-grid { grid-template-columns: 1fr; } }
.teaser {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
  overflow: hidden;
}
.teaser::after {
  /* Soft tint of the archetype colour bleeding from the top edge. */
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 56px;
  background: linear-gradient(180deg, var(--accent), transparent);
  opacity: .07;
  pointer-events: none;
}
.teaser:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.teaser h3 { color: var(--accent); margin: 0 0 4px; font-size: 18px; font-family: var(--font-display); font-weight: 600; }
.teaser p { color: var(--muted); font-size: 13px; margin: 0; }

/* Two-column audience block: who this is for. */
.audiences {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 40px 0 8px;
}
@media (max-width: 720px) { .audiences { grid-template-columns: 1fr; } }
.audience-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow);
}
.audience-card h2 { font-size: 19px; margin: 0 0 6px; }
.audience-card p { margin: 0; color: var(--muted); }

/* Three-layer "what you'll get" preview on the landing. */
.report-preview { margin: 56px 0 0; }
.report-preview h2 { font-size: 24px; margin-bottom: 4px; }
.report-preview > p.muted { margin: 0 0 18px; max-width: 600px; }
.layer-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow);
}
.layer-card .layer-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: .15em;
  color: var(--accent);
  margin: 0 0 10px;
}
.layer-card h3 { margin: 0 0 8px; font-size: 17px; }
.layer-card p { margin: 0; color: var(--muted); font-size: 14px; }

.cta-foot {
  text-align: center;
  margin: 64px 0 16px;
  padding: 40px 16px;
  background:
    radial-gradient(600px 200px at 50% -60px, rgba(178,122,42,.12), transparent 70%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cta-foot p { margin: 0 0 12px; }
.cta-foot p.muted { margin: 12px 0 0; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) {
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
}

.types { grid-template-columns: repeat(4, 1fr); margin-top: 24px; }
@media (max-width: 900px) { .types { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .types { grid-template-columns: 1fr; } }

.type-card {
  background: var(--panel); border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.type-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.type-card h3 { color: var(--accent); font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.type-card .tag { color: var(--muted); font-size: 13px; margin: 0 0 8px; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 26px;
  box-shadow: var(--shadow);
}
.panel.inset { margin-top: 12px; border-left: 4px solid var(--accent); }
.panel ul, .panel ol { padding-left: 20px; margin: 8px 0 0; }
.panel li { margin-bottom: 7px; }
.panel li:last-child { margin-bottom: 0; }
.panel li::marker { color: var(--accent); }
.stats .big { font-size: 34px; font-weight: 700; margin: 8px 0 0; font-family: var(--font-display); }

.auth { max-width: 460px; margin: 24px auto; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.stack input, .stack textarea, .stack select {
  padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: white; font: inherit;
  font-weight: 400; color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.stack input::placeholder, .stack textarea::placeholder { color: #a89a85; }
.stack input:hover, .stack textarea:hover, .stack select:hover { border-color: #c8b993; }
.stack input:focus, .stack textarea:focus, .stack select:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--focus-ring);
}
.stack fieldset {
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.stack fieldset legend { padding: 0 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.stack small { color: var(--muted); font-weight: 400; }

/* ------------------------------------------------------------------ */
/* Report hero. The archetype colour arrives via an inline --accent;   */
/* everything tints from it so each report feels like its animal.      */
/* ------------------------------------------------------------------ */
.result {
  padding: 36px 32px 32px; border-radius: var(--radius); background: var(--panel);
  border: 1px solid var(--line); border-top: 6px solid var(--accent); margin-bottom: 24px;
  box-shadow: var(--shadow-lift);
  position: relative;
  overflow: hidden;
}
.result::before {
  /* Archetype-tinted wash bleeding down from the top of the card. */
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 170px;
  background: linear-gradient(180deg, var(--accent), transparent);
  opacity: .09;
  pointer-events: none;
}
.result::after {
  /* Oversized watermark monogram of the archetype's first letter,
   * supplied by the template as --monogram. Decorative only. */
  content: var(--monogram, '');
  position: absolute;
  right: -10px; top: -44px;
  font-family: var(--font-display);
  font-size: 240px; font-weight: 700; line-height: 1;
  color: var(--accent);
  opacity: .08;
  pointer-events: none;
  user-select: none;
}
.result > * { position: relative; }
.result .primary-name {
  color: var(--accent); font-size: clamp(38px, 7vw, 56px); margin: 6px 0 2px; line-height: 1.02;
}
.result .tagline { color: var(--muted); font-size: 17px; margin: 0 0 16px; font-style: italic; }
.result .lede { margin-bottom: 14px; }
.result-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 14px;
  font-size: 13px; color: var(--muted);
}
.secondary-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 13px; font-weight: 600;
}
.secondary-chip .chip-label { font-weight: 400; color: var(--muted); }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 12px; align-items: center; font-size: 14px; }
.bar-row .label { color: var(--ink); }
.bar-track {
  height: 12px;
  background: var(--bg-deep);
  border-radius: 999px; overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(60,40,10,.08);
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent));
  border-radius: 999px;
  animation: bar-grow .9s cubic-bezier(.25,.7,.3,1) backwards;
  box-shadow: inset 0 -2px 3px rgba(0,0,0,.12);
}
@keyframes bar-grow { from { width: 0; } }
.bar-row .value { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* The viewer's own archetypes called out in the trait breakdown. */
.bar-row.is-primary .label, .bar-row.is-secondary .label { font-weight: 700; }
.bar-row.is-primary .value, .bar-row.is-secondary .value { color: var(--ink); font-weight: 600; }
.bar-row .you-tag {
  display: inline-block; margin-left: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 1px 6px; border-radius: 999px;
  vertical-align: 1px;
}

.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  padding: 5px 12px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--accent); color: var(--accent-deep); font-size: 13px;
  font-weight: 500;
}

.quiz-head { margin-bottom: 20px; }
.progress { height: 8px; background: var(--bg-deep); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; box-shadow: inset 0 1px 2px rgba(60,40,10,.08); }
.progress .bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-deep)); width: 0; transition: width .25s ease; border-radius: 999px; }
.progress-label { font-size: 12px; color: var(--muted); margin: 0; }
.save-status { font-size: 12px; color: var(--muted); }
.save-status.save-ok { color: var(--good); }
.save-status.save-error { color: var(--danger); }

.question {
  /* fieldset's default border is overridden so we control the card style. */
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 22px;
  margin: 0 0 16px;
  box-shadow: var(--shadow);
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.question-head {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 4px;
}
.question-head .qnum {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 27px; border-radius: 999px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink)); color: white;
  font-size: 12px; font-weight: 700;
  box-shadow: 0 1px 2px rgba(60,40,10,.25);
}
.question-head .cat {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  padding: 3px 10px; border-radius: 999px;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line);
  font-weight: 600;
}
.cat-personality      { color: #6b4e2e; border-color: #d8c4a3; background: #f8f1e4; }
.cat-work_ethic       { color: #2e5e6b; border-color: #b3cdd2; background: #edf4f6; }
.cat-delivery_habits  { color: #6b3a2e; border-color: #d8b6a8; background: #f9efeb; }
.cat-neurodiversity   { color: #5e2e6b; border-color: #c8b3d8; background: #f4eef7; }
.cat-scenarios        { color: #2e6b41; border-color: #b3d2bd; background: #edf5f0; }

.question .scenario {
  background: var(--bg); border-left: 3px solid var(--accent);
  padding: 12px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-style: italic;
  margin: 12px 0 0;
}
.question .prompt {
  font-size: 17px; font-weight: 600; line-height: 1.4;
  margin: 14px 0 12px;
}

.options { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; gap: 10px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.opt:hover { background: var(--bg); border-color: #c8b993; }
.opt input { margin-top: 2px; accent-color: var(--accent); }
.opt input:checked + span { font-weight: 600; }
/* Modern browsers: light up the whole selected card, not just the text. */
.opt:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.question-missing {
  animation: shake-highlight 0.5s ease-in-out 2;
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(176, 74, 58, .18);
}
@keyframes shake-highlight {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.scale {
  display: grid;
  grid-template-columns: auto repeat(5, 1fr) auto;
  gap: 6px; align-items: center;
}
.scale .end { font-size: 11px; color: var(--muted); }
.scale-opt {
  display: flex; flex-direction: column; align-items: center;
  padding: 9px 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
  font-variant-numeric: tabular-nums;
}
.scale-opt:hover { background: var(--bg); border-color: #c8b993; }
.scale-opt input { margin-bottom: 2px; accent-color: var(--accent); }
.scale-opt:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 700;
}

.actions { margin-top: 16px; display: flex; gap: 10px; }
.hidden { display: none; }

.table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); font-size: 14px; vertical-align: middle; }
.table thead th { background: var(--bg); font-weight: 700; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:nth-child(even) { background: rgba(178,122,42,.025); }
.table tbody tr:hover { background: rgba(178,122,42,.06); }
.table tr:last-child td { border-bottom: 0; }

.admin-nav, .docs-nav {
  display: flex; gap: 4px; padding: 6px; margin: 4px 0 28px;
  font-size: 14px; flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.admin-nav a, .docs-nav a {
  color: var(--muted); padding: 8px 14px; border-radius: 8px;
  transition: background .12s ease, color .12s ease;
}
.admin-nav a:hover, .docs-nav a:hover {
  color: var(--ink); background: var(--bg); text-decoration: none;
}
.admin-nav a.active, .docs-nav a.active {
  color: var(--ink); background: var(--accent-soft); font-weight: 600;
}

.row-between { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 8px 0 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.small { font-size: 12px; }

.chip-inline {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--accent); color: var(--accent); font-size: 12px;
  font-weight: 500;
}

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.badge.good    { background: #e7efe2; color: #3f6b35; border: 1px solid #b7d3a9; }
.badge.bad     { background: #fbe9e6; color: var(--danger); border: 1px solid #e7b9b2; }
.badge.neutral { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.pair-clashes { background: #fdf2f0; }
.pair-pairs   { background: #f1f7ed; }

.copy-link {
  display: inline-block; max-width: 320px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; padding: 3px 8px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; font-size: 12px; vertical-align: middle;
}

/* Invite cards: each invite shown as a panel with metadata + QR. */
/* Organogram: a simple indented tree of nodes. Each node is a card
 * with the member's name, optional role, and archetype chip. */
.org-chart { margin: 12px 0 16px; }
.org-roots, .org-children { list-style: none; padding-left: 0; margin: 0; }
.org-children {
  padding-left: 24px; margin-top: 8px;
  border-left: 2px dashed var(--line);
}
.org-chart li { margin-bottom: 8px; }
.org-node {
  display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.org-node strong { font-weight: 600; }
.org-role { font-style: italic; }

.member-cards { gap: 14px; }
.member-card { border-left: 3px solid var(--accent); }
.member-card h3 { margin: 0 0 4px; font-size: 17px; }
.member-card .small { font-size: 13px; color: var(--muted); }
.member-detail { margin-top: 8px; }
.member-detail summary { cursor: pointer; color: var(--accent-deep); font-size: 13px; font-weight: 600; }
.member-detail ul { margin: 8px 0 0; padding-left: 18px; }

.inline-edit summary { cursor: pointer; color: var(--accent-deep); }
.inline-edit-form {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--line);
}
.inline-edit-form label { font-size: 12px; }
.btn.small { padding: 6px 12px; font-size: 13px; }

.invite-list { display: flex; flex-direction: column; gap: 14px; }
.invite-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
}
.invite-meta { min-width: 0; }
.invite-line { margin: 0 0 6px; }
.invite-url-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.invite-qr {
  width: 140px;
  text-align: center;
  display: flex; flex-direction: column; gap: 6px;
}
.invite-qr img {
  width: 140px; height: 140px;
  background: white; border: 1px solid var(--line); border-radius: 8px; padding: 6px;
}
@media (max-width: 600px) {
  .invite-card { grid-template-columns: 1fr; }
  .invite-qr { width: 100%; max-width: 220px; margin: 0 auto; }
}

.tier-pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted);
  font-size: 12px; line-height: 1.6;
}
.tier-pill:hover { color: var(--accent-deep); border-color: var(--accent); text-decoration: none; }

.locked { border-left: 4px solid var(--accent); }
.locked-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Applied-judgement gauge: a conic-gradient ring with the score in the
 * middle. The template passes the score via --gauge (0-100). */
.aptitude { border-left: 4px solid #2e6b41; }
.aptitude-row {
  display: flex; gap: 28px; align-items: center; margin: 18px 0 10px;
  flex-wrap: wrap;
}
.gauge {
  --gauge-color: #2e6b41;
  width: 132px; height: 132px;
  border-radius: 50%;
  background: conic-gradient(var(--gauge-color) calc(var(--gauge, 0) * 1%), var(--bg-deep) 0);
  display: grid; place-items: center;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 3px rgba(60,40,10,.10);
}
.gauge-inner {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--panel);
  display: grid; place-items: center;
  box-shadow: 0 1px 3px rgba(60,40,10,.10);
}
.gauge-value {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 700; color: #2e6b41; line-height: 1;
}
.gauge-value small { display: block; font-family: inherit; font-size: 11px; font-weight: 400; color: var(--muted); text-align: center; margin-top: 2px; letter-spacing: .06em; }
.aptitude-copy { flex: 1; min-width: 220px; }
.aptitude-copy p { margin: 0; }
/* Legacy linear bar fallback (still used if a template renders it). */
.aptitude-bar { height: 14px; flex: 1; min-width: 200px; }
.aptitude-bar .bar-track { height: 100%; }
.aptitude-fill { background: linear-gradient(90deg, #5b9c6e, #2e6b41); }
.aptitude-value { font-size: 28px; font-weight: 700; color: #2e6b41; text-align: right; }

.spectrum { border-left: 4px solid #6B4E2E; }
.spectrum-bars { gap: 16px; }
.spectrum-row { grid-template-columns: 220px 1fr 40px; }
.spectrum-fill { background: linear-gradient(90deg, #d9a441, #6B4E2E); }
.spectrum-desc { margin: -8px 0 8px 232px; font-style: italic; }
@media (max-width: 600px) {
  .spectrum-row { grid-template-columns: 1fr; }
  .spectrum-desc { margin-left: 0; }
}

/* Hover hints. Native title is the accessibility fallback. */
abbr.hint, .hint {
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
  cursor: help;
  position: relative;
}
abbr.hint[data-hint]:hover::after,
abbr.hint[data-hint]:focus::after,
.hint[data-hint]:hover::after,
.hint[data-hint]:focus::after {
  content: attr(data-hint);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.45;
  width: max-content;
  max-width: 280px;
  white-space: normal;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
  pointer-events: none;
}
abbr.hint[data-hint]:hover::before,
.hint[data-hint]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
  z-index: 100;
}

/* Docs pages */
.docs h1 { margin-bottom: 8px; }
.docs h2 { margin-top: 36px; }
.docs section { margin-bottom: 8px; }
.docs ul, .docs ol { padding-left: 22px; }
.docs ol.steps li { margin-bottom: 12px; }
.docs .caveat { background: var(--bg); border-left: 3px solid var(--danger); padding: 12px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* docs-nav rules merged with .admin-nav above */

.faq-list details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s ease;
}
.faq-list details[open] { box-shadow: var(--shadow-lift); }
.faq-list details summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 24px;
}
.faq-list details summary::-webkit-details-marker { display: none; }
.faq-list details summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  font-weight: 400;
  color: var(--accent);
  font-size: 18px;
  line-height: 1.2;
}
.faq-list details[open] summary::after { content: '\2212'; }
.faq-list details p { margin: 10px 0 4px; }

.research-entry header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.research-entry .citations { font-size: 13px; }
.research-entry .citations li { margin-bottom: 6px; }
.danger-panel { border-left: 4px solid var(--danger); }

.glossary-list { display: grid; grid-template-columns: 220px 1fr; gap: 6px 16px; margin: 0; }
.glossary-list dt { font-weight: 600; color: var(--ink); }
.glossary-list dd { margin: 0; color: var(--muted); }
@media (max-width: 600px) {
  .glossary-list { grid-template-columns: 1fr; }
  .glossary-list dt { margin-top: 8px; }
}

.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.inline-form label { flex: 1; min-width: 180px; }
.inline-form select, .inline-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: white; font: inherit; }

/* Tighter gutters on small screens so cards keep their breathing room. */
@media (max-width: 560px) {
  .container { padding: 24px 16px 72px; }
  h1 { margin-bottom: 12px; }
  .panel { padding: 20px 18px; }
  .result { padding: 26px 20px 24px; }
  .result::after { font-size: 160px; top: -28px; }
}

/* Respect users who ask the OS to minimise motion: drop the smooth
 * scroll, transitions, and the missing-question shake animation. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print-friendly result pages: strip chrome and let the report flow. */
@media print {
  body { background: white; color: black; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .topbar, .footer, .admin-nav, .docs-nav, .no-print { display: none !important; }
  .container { max-width: none; padding: 0; margin: 0; }
  a { color: black; text-decoration: none; }
  .panel, .result, .layer-card, .audience-card, .type-card, .teaser, .table, .faq-list details, .member-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  h1, h2, h3 { break-after: avoid; }
  .result::after { display: none; }
  .bar-fill { animation: none; }
  .bar-track { border: 1px solid #888; }
  .bar-fill { background: #555 !important; }
  .gauge { box-shadow: none; border: 1px solid #888; }
  .gauge-inner { box-shadow: none; }
  .progress { display: none; }
  abbr.hint, .hint { border-bottom: none; cursor: auto; }
  abbr.hint[data-hint]:hover::after, .hint[data-hint]:hover::after,
  abbr.hint[data-hint]:hover::before, .hint[data-hint]:hover::before { display: none; }
}
