/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --hairline: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.05), 0 8px 24px -12px rgba(11, 11, 11, 0.18);
  --shadow-lift: 0 2px 4px rgba(11, 11, 11, 0.06), 0 14px 32px -12px rgba(11, 11, 11, 0.22);
  --accent: #2a78d6;       /* blue 450 */
  --accent-deep: #1c5cab;  /* blue 550 */
  --accent-soft: #cde2fb;  /* blue 100 */
  /* Center accents (validated categorical steps; deep = dark-surface step,
     used where white text sits on the color) */
  --c-head: #2a78d6;  --c-head-deep: #2a78d6;
  --c-body: #eb6834;  --c-body-deep: #d95926;
  --c-heart: #1baf7a; --c-heart-deep: #199e70;
  --warning: #fab219;
  --serious: #ec835a;
  --good-text: #006300;
  --radius: 12px;
  --maxw: 62rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --hairline: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.5), 0 14px 32px -12px rgba(0, 0, 0, 0.7);
    --accent: #3987e5;
    --accent-deep: #256abf;
    --accent-soft: #184f95;
    --c-head: #3987e5;  --c-head-deep: #2a78d6;
    --c-body: #d95926;  --c-body-deep: #d95926;
    --c-heart: #199e70; --c-heart-deep: #199e70;
    --good-text: #0ca30c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --hairline: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.5), 0 14px 32px -12px rgba(0, 0, 0, 0.7);
  --accent: #3987e5;
  --accent-deep: #256abf;
  --accent-soft: #184f95;
  --c-head: #3987e5;  --c-head-deep: #2a78d6;
  --c-body: #d95926;  --c-body-deep: #d95926;
  --c-heart: #199e70; --c-heart-deep: #199e70;
  --good-text: #0ca30c;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  /* Soft color washes at the top of every page keep the site feeling lively;
     they fade into the plain page color as you scroll. */
  background:
    radial-gradient(70rem 26rem at 12% -4%, color-mix(in srgb, var(--c-head) 13%, transparent), transparent 62%),
    radial-gradient(60rem 24rem at 88% -6%, color-mix(in srgb, var(--c-heart) 11%, transparent), transparent 62%),
    radial-gradient(50rem 20rem at 50% -10%, color-mix(in srgb, var(--c-body) 7%, transparent), transparent 60%),
    var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.65;
  font-size: 1rem;
  -webkit-text-size-adjust: 100%;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  body { background: var(--page); }
}
main { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
h1 { font-size: clamp(1.85rem, 5.5vw, 2.6rem); line-height: 1.15; margin: 1.5rem 0 0.75rem; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.35rem, 3.5vw, 1.6rem); line-height: 1.25; margin: 2.75rem 0 0.85rem; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
p, li { color: var(--ink-2); }
p strong, li strong { color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: none; border-top: 1px solid var(--hairline); margin: 2rem 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* Anchor targets clear the sticky header */
section[id], [id^="type-"], h1[id], h2[id], h3[id] { scroll-margin-top: 4.5rem; }

/* Section headers get a short tri-color rule */
main > h2::before, main h2.ruled::before {
  content: "";
  display: block;
  width: 2.75rem; height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--c-head), var(--c-heart), var(--c-body));
  margin-bottom: 0.6rem;
}

/* Page titles carry a subtle ink→accent gradient */
@supports (-webkit-background-clip: text) or (background-clip: text) {
  h1 {
    background: linear-gradient(105deg, var(--ink) 45%, var(--accent) 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: var(--accent);
  }
}

/* Rotating center-color stripes for generic card grids */
.grid.rainbow > .card:nth-child(3n + 1) { border-top: 4px solid var(--c-head); }
.grid.rainbow > .card:nth-child(3n + 2) { border-top: 4px solid var(--c-heart); }
.grid.rainbow > .card:nth-child(3n) { border-top: 4px solid var(--c-body); }
.grid.rainbow > .card:nth-child(3n + 1) .kicker { color: var(--c-head-deep); }
.grid.rainbow > .card:nth-child(3n + 2) .kicker { color: var(--c-heart-deep); }
.grid.rainbow > .card:nth-child(3n) .kicker { color: var(--c-body-deep); }

/* ---------- Header / nav ---------- */
header.site {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; z-index: 20;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  header.site { background: var(--surface); }
}
header.site .bar {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 1.25rem;
}
.brand { font-weight: 800; color: var(--ink); font-size: 1.05rem; letter-spacing: -0.01em; flex: none; }
.brand:hover { text-decoration: none; }
nav.main {
  display: flex; gap: 0.25rem; margin-left: auto;
  overflow-x: auto; white-space: nowrap;
  scrollbar-width: none; -ms-overflow-style: none;
}
nav.main::-webkit-scrollbar { display: none; }
nav.main a {
  color: var(--ink-2); padding: 0.33rem 0.6rem; border-radius: 999px;
  font-size: 0.9rem; font-weight: 500; flex: none;
}
nav.main a:hover { background: var(--accent-soft); text-decoration: none; color: var(--ink); }
nav.main a[aria-current="page"] { background: var(--accent); color: #fff; }

/* Hamburger — shown only when the inline nav can't fit */
.nav-toggle {
  display: none; flex: none; cursor: pointer;
  width: 2.5rem; height: 2.5rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--page);
  color: var(--ink); padding: 0;
  align-items: center; justify-content: center;
  margin-left: auto;
}
@media (max-width: 920px) {
  header.site .bar { position: relative; }
  .nav-toggle { display: inline-flex; }
  nav.main {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    margin: 0; padding: 0.4rem 0.75rem 0.75rem;
    background: var(--surface);
    border-bottom: 1px solid var(--hairline);
    box-shadow: var(--shadow-lift);
    white-space: normal;
  }
  header.site.nav-open nav.main { display: block; }
  nav.main a {
    display: block; width: 100%;
    padding: 0.8rem 0.9rem; margin-top: 0.25rem;
    font-size: 1.05rem; border-radius: 10px;
  }
}

/* Theme toggle */
.theme-toggle {
  flex: none; cursor: pointer;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  border: 1px solid var(--border); background: var(--page);
  font-size: 1.05rem; line-height: 1; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { border-color: var(--accent); }

/* Colored brand mark next to the wordmark */
.brand { display: inline-flex; align-items: center; }
.brand svg { display: block; margin-right: 0.5rem; }
.brand-text b { font-weight: inherit; color: var(--accent); }

/* ---------- Differentiator strip under the header ---------- */
.usp-bar {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--c-head) 10%, var(--surface)),
    color-mix(in srgb, var(--c-heart) 10%, var(--surface)));
  border-bottom: 1px solid var(--hairline);
  text-align: center;
  font-size: 0.84rem;
  padding: 0.45rem 1rem;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .usp-bar { background: var(--surface); }
}
.usp-bar a { color: var(--ink-2); }
.usp-bar strong { color: var(--ink); }
.usp-bar a:hover { text-decoration: none; }
.usp-bar a:hover strong { color: var(--accent); }
@media (max-width: 700px) {
  .usp-long { display: none; }
  .usp-bar { font-size: 0.8rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 2.5rem max(1.25rem, calc(50vw - var(--maxw) / 2 + 1.25rem)) 1rem;
  background:
    radial-gradient(60rem 22rem at 15% -5%, color-mix(in srgb, var(--c-head) 14%, transparent), transparent 60%),
    radial-gradient(50rem 20rem at 85% -10%, color-mix(in srgb, var(--c-heart) 10%, transparent), transparent 60%);
}
.hero h1 { margin-top: 0; }
.hero .lede { font-size: 1.1rem; max-width: 44rem; }
.cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.5rem 0 0.5rem; }

/* ---------- Cards & layout ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin: 1rem 0;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
@media (hover: hover) {
  a .card:hover, .card.hoverable:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
}
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); }

/* Center-of-intelligence accents */
.card.center-body { border-top: 4px solid var(--c-body); }
.card.center-heart { border-top: 4px solid var(--c-heart); }
.card.center-head { border-top: 4px solid var(--c-head); }

.pill {
  display: inline-block; font-size: 0.8rem; font-weight: 600;
  padding: 0.15rem 0.65rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--ink);
  margin: 0 0.35rem 0.25rem 0;
}
.kicker {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem;
  font-weight: 700; color: var(--muted); margin: 0 0 0.25rem;
}
.kicker.center-body { color: var(--c-body-deep); }
.kicker.center-heart { color: var(--c-heart-deep); }
.kicker.center-head { color: var(--c-head-deep); }

.callout {
  border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.9rem 1.2rem; margin: 1.25rem 0;
  box-shadow: var(--shadow);
}
.callout.flag {
  border-left-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
}
.callout.caution {
  border-left-color: var(--serious);
  background: color-mix(in srgb, var(--serious) 7%, var(--surface));
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .callout, .callout.flag, .callout.caution { background: var(--surface); }
}
.callout .kicker { color: var(--ink-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; border: none;
  font: inherit; font-weight: 600;
  padding: 0.65rem 1.4rem; border-radius: 999px;
  box-shadow: var(--shadow);
  transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.2s ease;
}
.btn:hover { filter: brightness(1.12); text-decoration: none; box-shadow: var(--shadow-lift); }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent); box-shadow: none;
}
.btn.ghost:hover { background: var(--accent-soft); color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.btn-small { padding: 0.3rem 0.85rem; font-size: 0.85rem; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
caption { text-align: left; color: var(--muted); font-size: 0.85rem; padding-bottom: 0.4rem; }
th, td { text-align: left; padding: 0.55rem 0.75rem; vertical-align: top; }
thead th { border-bottom: 2px solid var(--baseline); color: var(--ink); font-size: 0.88rem; }
tbody td { border-bottom: 1px solid var(--hairline); color: var(--ink-2); }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
tbody td:first-child, tbody th[scope="row"] { color: var(--ink); font-weight: 600; }
.table-scroll { overflow-x: auto; border-radius: var(--radius); }

/* ---------- Enneagram symbol ---------- */
.symbol-wrap { display: flex; justify-content: center; padding: 1rem 0; }
.symbol-wrap svg { max-width: min(100%, 22rem); height: auto; color: var(--baseline); }
.symbol-wrap .num { font-weight: 700; font-size: 20px; }
.symbol-wrap .num text { fill: var(--ink); }
.symbol-wrap .num .n-body { fill: var(--c-body-deep); }
.symbol-wrap .num .n-heart { fill: var(--c-heart-deep); }
.symbol-wrap .num .n-head { fill: var(--c-head-deep); }
.symbol-wrap .tri { stroke: var(--accent); }
.symbol-wrap .hex { stroke: var(--baseline); }
.symbol-legend { display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-2); margin-bottom: 1rem; }
.symbol-legend span::before {
  content: ""; display: inline-block; width: 0.65em; height: 0.65em;
  border-radius: 50%; margin-right: 0.4em;
}
.symbol-legend .l-body::before { background: var(--c-body-deep); }
.symbol-legend .l-heart::before { background: var(--c-heart-deep); }
.symbol-legend .l-head::before { background: var(--c-head-deep); }

/* ---------- Type profile ---------- */
.type-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.type-num {
  background: var(--accent); color: #fff; font-weight: 700;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex: none;
  box-shadow: var(--shadow);
}
.center-body .type-num, .type-num.center-body { background: var(--c-body-deep); }
.center-heart .type-num, .type-num.center-heart { background: var(--c-heart-deep); }
.center-head .type-num, .type-num.center-head { background: var(--c-head-deep); }
.type-jump { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 1.5rem; padding: 0; }
.type-jump a {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.35rem 0.85rem 0.35rem 0.4rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  color: var(--ink); font-size: 0.9rem; font-weight: 600;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.type-jump a:hover { text-decoration: none; }
@media (hover: hover) {
  .type-jump a:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
}
.type-jump .type-num { width: 1.6rem; height: 1.6rem; font-size: 0.85rem; box-shadow: none; }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 0.75rem 1.5rem; margin: 0.75rem 0; }
.fact-grid div { font-size: 0.95rem; color: var(--ink-2); }
.fact-grid b { display: block; color: var(--ink); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
details.wings, details.more {
  border-top: 1px solid var(--hairline); margin-top: 0.9rem; padding-top: 0.6rem;
}
details summary { cursor: pointer; font-weight: 600; color: var(--ink); }
details summary:hover { color: var(--accent); }

/* ---------- Quiz ---------- */
.quiz-progress { height: 8px; background: var(--hairline); border-radius: 999px; overflow: hidden; margin: 1rem 0; }
.quiz-progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  border-radius: 999px; transition: width 0.25s ease;
}
.q-hint { color: var(--muted); font-size: 0.88rem; margin: 1rem 0 -0.5rem; }
.q-text { font-size: clamp(1.1rem, 3vw, 1.3rem); color: var(--ink); font-weight: 600; margin: 1rem 0 1.25rem; min-height: 3.5rem; }
.likert { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; }
.likert button {
  font: inherit; cursor: pointer; padding: 0.75rem 0.4rem;
  min-height: 44px;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.85rem; line-height: 1.25;
  box-shadow: var(--shadow);
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}
/* Hover feedback only on devices that truly hover — on touch screens the
   browser leaves a "sticky hover" on whatever lands under the last tap, which
   made the next question appear to have an answer pre-selected. */
@media (hover: hover) {
  .likert button:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
}
.likert button.sel { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (max-width: 620px) {
  .likert { grid-template-columns: 1fr; gap: 0.55rem; }
  .likert button { font-size: 0.95rem; padding: 0.8rem 1rem; text-align: left; }
}
/* Multiple-choice items: options are sentences — always one per row. */
.likert.mc { grid-template-columns: 1fr; gap: 0.55rem; }
.likert.mc button { font-size: 0.95rem; padding: 0.8rem 1rem; text-align: left; }
.format-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.5rem; }
.quiz-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 1.5rem; gap: 1rem; }
.quiz-nav .btn { flex: none; }
.quiz-meta { color: var(--muted); font-size: 0.85rem; }

/* ---------- Results chart (single-series bars, direct-labeled) ---------- */
.score-chart { margin: 1rem 0; }
.score-row {
  display: grid; grid-template-columns: 11rem minmax(0, 1fr) 2.6rem;
  align-items: center; gap: 0.75rem; margin-bottom: 2px; /* 2px surface gap between bars */
}
.score-row .name { font-size: 0.92rem; color: var(--ink); text-align: right; line-height: 1.3; }
.score-row .track { display: block; background: transparent; border-left: 2px solid var(--baseline); padding: 3px 0; }
.score-row .bar {
  display: block; height: 14px; background: var(--accent);
  border-radius: 0 4px 4px 0; /* rounded data-end only, anchored at baseline */
  min-width: 2px;
  transition: width 0.4s ease;
}
/* Single series = one hue; the top row is marked by weight + position, never color alone. */
.score-row.top .name, .score-row.top .val { font-weight: 700; }
.score-row .val { font-size: 0.88rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .score-row { grid-template-columns: 7.6rem minmax(0, 1fr) 2.2rem; }
  .score-row .name { font-size: 0.78rem; }
}

.result-flag { margin-top: 1rem; }
.result-flag h4 { margin: 0 0 0.35rem; }
.result-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ---------- Pairing & comparison pickers ---------- */
.pair-picker {
  display: flex; gap: 1rem; align-items: stretch; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.pair-picker fieldset {
  flex: 1 1 14rem; border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 0.75rem 1rem 1rem; margin: 0; min-width: 0;
}
.pair-picker legend { font-weight: 700; padding: 0 0.4rem; font-size: 0.95rem; }
.pair-picker label { display: block; font-size: 0.85rem; color: var(--ink-2); margin-top: 0.5rem; }
.pair-picker select {
  display: block; width: 100%; margin-top: 0.25rem;
  font: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--page); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.5rem 0.6rem;
}
.pair-heart {
  align-self: center; font-size: 1.6rem; color: var(--accent);
  flex: none; padding: 0 0.25rem;
}
@media (max-width: 620px) { .pair-heart { display: none; } }

.pair-score { margin-top: 0.5rem; }
.pair-num { font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; }
.pair-outof { color: var(--muted); font-weight: 600; margin-left: 0.25rem; }
.pair-band {
  display: inline-block; vertical-align: 0.9rem; margin-left: 0.6rem;
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.01em;
  padding: 0.25rem 0.8rem; border-radius: 999px;
}
.pair-desc { margin: 0.35rem 0 0.15rem; color: var(--ink-2); }
.pair-desc strong { color: var(--ink); }
.heat-legend {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem;
  font-size: 0.85rem; color: var(--ink-2); margin: 0.75rem 0 0;
}
.heat-legend i {
  display: inline-block; width: 0.85em; height: 0.85em;
  border-radius: 3px; margin-right: 0.4em; vertical-align: -0.07em;
  border: 1px solid var(--border);
}
.pair-meter {
  height: 10px; background: var(--hairline); border-radius: 999px;
  overflow: hidden; margin: 0.4rem 0 0.25rem; max-width: 26rem;
}
.pair-meter span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  border-radius: 999px; transition: width 0.3s ease;
}

/* ---------- Pairing heatmap ---------- */
table.heatmap { border-collapse: separate; border-spacing: 2px; min-width: 30rem; }
table.heatmap th { border: none; font-size: 0.85rem; text-align: center; padding: 0.3rem; }
table.heatmap td { border: none; padding: 0; }
table.heatmap td button {
  display: block; width: 100%; min-width: 2.6rem; padding: 0.55rem 0.2rem;
  border: none; border-radius: 6px; cursor: pointer;
  font: inherit; font-size: 0.85rem; font-weight: 600;
  font-variant-numeric: tabular-nums; text-align: center;
}
@media (hover: hover) {
  table.heatmap td button:hover { outline: 2px solid var(--ink); outline-offset: -2px; }
}

/* ---------- Side-by-side comparison ---------- */
.compare-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  gap: 1rem; margin-top: 0.5rem;
}
.compare-col {
  border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}
.compare-col p { margin: 0.4rem 0; font-size: 0.95rem; }
.compare-col b { color: var(--ink); }
.compare-col .type-num { width: 1.8rem; height: 1.8rem; font-size: 0.95rem; }

details.lookalikes { padding: 0.9rem 1.4rem; }
details.lookalikes summary { display: flex; align-items: center; gap: 0.6rem; }
details.lookalikes .type-num { width: 1.8rem; height: 1.8rem; font-size: 0.95rem; }
details.lookalikes table { margin: 0.75rem 0 0.25rem; }
details.lookalikes th { white-space: nowrap; }
details.lookalikes em { color: var(--ink); font-style: normal; font-weight: 600; }

/* ---------- Growth levels ---------- */
.level { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 0.8rem 1rem; }
.level p { margin: 0.25rem 0 0; font-size: 0.93rem; }
.level-healthy { border-top: 4px solid var(--good-text); }
.level-average { border-top: 4px solid var(--warning); }
.level-unhealthy { border-top: 4px solid var(--serious); }

/* ---------- Instinct mini-test ---------- */
.mini-row { border-top: 1px solid var(--hairline); padding: 0.75rem 0 0.9rem; }
.mini-row p { margin: 0 0 0.5rem; color: var(--ink); font-weight: 500; }
.mini-scale { display: flex; gap: 0.5rem; }
.mini-scale button {
  width: 44px; height: 44px; border-radius: 50%;
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--page); color: var(--ink-2);
  border: 1px solid var(--border);
}
@media (hover: hover) {
  .mini-scale button:hover { border-color: var(--accent); color: var(--ink); }
}
.mini-scale button.sel { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- PDF report (print) ---------- */
#print-area { display: none; }
@media print {
  body.print-result header.site,
  body.print-result main,
  body.print-result footer.site { display: none !important; }
  body.print-result #print-area { display: block; }
  #print-area {
    color: #000; background: #fff;
    font-size: 11pt; line-height: 1.5;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  }
  #print-area h1 { font-size: 20pt; margin: 0.25rem 0; }
  #print-area h2 { font-size: 13pt; margin: 1.2rem 0 0.4rem; }
  #print-area .p-brand {
    font-size: 9pt; letter-spacing: 0.08em; text-transform: uppercase;
    color: #444; border-bottom: 1px solid #999; padding-bottom: 0.3rem;
  }
  #print-area table { width: 100%; border-collapse: collapse; font-size: 10pt; }
  #print-area th, #print-area td { text-align: left; padding: 0.25rem 0.5rem; border-bottom: 1px solid #ccc; }
  #print-area .p-track { width: 45%; }
  #print-area .p-bar {
    display: block; height: 9px; background: #2a78d6;
    border-radius: 0 3px 3px 0; min-width: 2px;
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  #print-area .p-foot { font-size: 9pt; color: #444; margin-top: 1.2rem; border-top: 1px solid #999; padding-top: 0.4rem; }
}

footer.site {
  border-top: 1px solid var(--hairline);
  color: var(--muted); font-size: 0.85rem;
  max-width: var(--maxw); margin: 2rem auto 0; padding: 1.5rem 1.25rem 3rem;
  position: relative;
}
footer.site::before {
  content: "";
  position: absolute; top: -1px; left: 1.25rem;
  width: 6rem; height: 3px; border-radius: 999px;
  background: linear-gradient(90deg, var(--c-head), var(--c-heart), var(--c-body));
}
/* ---------- Type pages: hero, tabs, pager ---------- */
.type-hero { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0 0.5rem; }
.type-hero h1 { margin: 0; }
.type-num.big { width: 3.6rem; height: 3.6rem; font-size: 1.8rem; }
.type-hero.center-body .type-num { background: var(--c-body-deep); }
.type-hero.center-heart .type-num { background: var(--c-heart-deep); }
.type-hero.center-head .type-num { background: var(--c-head-deep); }
.tabs {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  border-bottom: 2px solid var(--hairline);
  margin: 1.5rem 0 1.25rem; padding-bottom: 0.5rem;
}
.tabs button {
  font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0.45rem 1rem;
}
.tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (hover: hover) { .tabs button:hover:not(.on) { border-color: var(--accent); color: var(--ink); } }
.tab-panel { display: none; }
.tab-panel.on { display: block; }
.type-pager { display: flex; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; margin-top: 2.5rem; }

/* ---------- Types hub cards ---------- */
.type-card { display: block; color: var(--ink); text-decoration: none; }
.type-card:hover { text-decoration: none; }
.type-card h2 { margin: 0.6rem 0 0.25rem; font-size: 1.25rem; }
.type-card p { margin: 0 0 0.5rem; }
.type-card .type-num { width: 2.2rem; height: 2.2rem; font-size: 1.05rem; }
.type-card.center-body .type-num { background: var(--c-body-deep); }
.type-card.center-heart .type-num { background: var(--c-heart-deep); }
.type-card.center-head .type-num { background: var(--c-head-deep); }

/* ---------- Personalization ---------- */
.you-chip {
  flex: none; font-size: 0.82rem; font-weight: 700;
  background: var(--accent-soft); color: var(--ink);
  padding: 0.25rem 0.7rem; border-radius: 999px;
  margin-left: auto;
}
.you-chip:hover { text-decoration: none; background: var(--accent); color: #fff; }
.you-chip + nav.main, .you-chip ~ .nav-toggle { margin-left: 0.5rem; }
nav.main { margin-left: auto; }
.bar:has(.you-chip) nav.main { margin-left: 0; }
@media (max-width: 480px) { .you-chip { display: none; } }
.card.is-you { outline: 2px solid var(--accent); }

.to-top {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 30;
  width: 2.8rem; height: 2.8rem; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font-size: 1.2rem; cursor: pointer; box-shadow: var(--shadow-lift);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* ---------- Review screen ---------- */
.review-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.review-chip {
  width: 2.4rem; height: 2.4rem; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 0.85rem; font-weight: 600;
  background: var(--accent-soft); color: var(--ink);
  border: 1px solid var(--border);
}
@media (hover: hover) { .review-chip:hover { border-color: var(--accent); } }

/* ---------- Practice tracker ---------- */
.practice-list { list-style: none; padding: 0; margin: 0.5rem 0 1rem; }
.practice-list li { margin: 0.5rem 0; }
.practice-list label { display: flex; gap: 0.6rem; align-items: flex-start; cursor: pointer; color: var(--ink-2); }
.practice-list input { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; accent-color: var(--accent); flex: none; }
.practice-list input:checked + span { color: var(--ink); }

/* ---------- Search ---------- */
#q {
  font: inherit; font-size: 1.05rem; width: 100%; max-width: 32rem;
  padding: 0.7rem 1rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
}
#q:focus-visible { outline: 2px solid var(--accent); }
.search-hit { display: block; color: var(--ink); }
.search-hit:hover { text-decoration: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
