/* Zodiac Pairs (Tool 8, prefix zp-) — the funnel: score gauge and rank, identity lockup, thematic breakdown, micro-insights, proof and ranking.
   Loaded through the `styles:` list in zodiac-pairs.njk, so it sits in <head>, BEFORE the tool kit's inline <style> blocks.
   Rules are scoped `.zp .x`; where one restyles a kit class it adds a class (`.zp .rk-bento.zp-bento`) so it outranks the kit's
   `.tk .x`. Token overrides use `.tk.zp`. Depends on tokens.css, partials/tool-kit-css.njk and partials/result-kit-css.njk.

   Sign A is Cinnabar (the page accent), Sign B is ink. Four tones carry every metric: flow (cyan, a triangle), friction (amber,
   a square), fusion (violet, a circle) and quiet (slate, a ring). Colour and shape always travel together. */
.tk.zp {
  --tk-accent: var(--accent-love, #E11D48);
  --tone-flow: #0284C7;
  --tone-friction: #D97706;
  --tone-fusion: #7C3AED;
  --tone-quiet: #94A3B8;
  --pa: var(--c-accent);
  --pb: var(--c-ink);
}

/* ---- Input: two rows of twelve signs, one button ---- */
.zp .zp-pair { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .zp .zp-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; } }
.zp .zp-badge { font-size: 1.0625rem; font-weight: 800; letter-spacing: 0; }
.zp .zp-b .zp-badge { background: #EEF2F6; color: var(--c-ink); }
.zp .zp-signs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
@media (min-width: 400px) { .zp .zp-signs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.zp .zp-sign { position: relative; display: block; }
.zp .zp-sign input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.zp .zp-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 68px; padding: 10px 4px 8px; border: 1px solid var(--c-line); border-radius: 12px; background: #fff; color: var(--c-muted); transition: border-color 0.15s, background 0.15s, color 0.15s; }
.zp .zp-chip svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.zp .zp-chip b { font-size: 0.8125rem; font-weight: 700; letter-spacing: -0.005em; color: var(--c-ink); }
.zp .zp-sign:hover .zp-chip { border-color: var(--c-ink); }
.zp .zp-sign input:focus-visible + .zp-chip { outline: 3px solid color-mix(in srgb, var(--c-accent) 55%, transparent); outline-offset: 2px; }
.zp .zp-a .zp-sign input:checked + .zp-chip { border-color: var(--pa); background: var(--c-accent-tint); color: var(--pa); box-shadow: 0 0 0 1px var(--pa) inset; }
.zp .zp-b .zp-sign input:checked + .zp-chip { border-color: var(--pb); background: #EEF2F6; color: var(--pb); box-shadow: 0 0 0 1px var(--pb) inset; }
.zp .zp-go { width: min(100%, 380px); margin: 20px auto 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.zp .zp-hint { margin-top: 10px; text-align: center; }
.tk #zp-forms { margin-bottom: 20px; }
.zp .zp-forms .form-error { max-width: 560px; margin-left: auto; margin-right: auto; text-align: center; }

/* After a reading the two rows fold into one bar. The signs stay one tap away. */
.zp .zp-strip { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 12px 12px 12px 20px; border: 1px solid var(--c-line); border-radius: var(--r-card); background: var(--c-card); }
.zp .zp-strip-names { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.01em; }
.zp .zp-strip-names span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.zp .zp-strip-names i { font-style: normal; font-weight: 500; color: var(--c-muted); }
.zp .zp-strip + .tk-layout { margin-top: 16px; }
.zp .tk-layout.zp-layout { grid-template-columns: minmax(0, 1fr); }
.zp .zp-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; }
.zp .zp-dot.a { background: var(--pa); }
.zp .zp-dot.b { background: var(--pb); }

/* ---- Shapes: colour never works alone ---- */
.zp .zp-sh { display: inline-block; flex: none; width: 12px; height: 12px; fill: var(--tone); stroke: none; }
.zp .zp-sh.fusion { --tone: var(--tone-fusion); }
.zp .zp-sh.flow { --tone: var(--tone-flow); }
.zp .zp-sh.friction { --tone: var(--tone-friction); }
.zp .zp-sh.quiet { --tone: var(--tone-quiet); fill: none; stroke: var(--tone); stroke-width: 2.4; }

.zp .zp-kick { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-accent-ink); margin-bottom: 4px; }
.zp .zp-funnel { container: zpfunnel / inline-size; }

/* ---- The empty state's ring ---- */
.zp .zp-today { margin: 0 auto; width: 100%; max-width: 240px; }
.zp .zp-today .zp-ringsvg { display: block; width: 100%; height: auto; }
.zp .zp-today .zp-track { fill: none; stroke: #E8EDF3; stroke-width: 12; }
.zp .zp-today .zp-arc { fill: none; stroke: var(--c-accent); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: var(--off); }
.zp .zp-today-n { fill: var(--c-ink); font-size: 62px; font-weight: 800; letter-spacing: -0.04em; }

/* ================= Level 1: the core result ================= */
.zp .zp-hero { --hl: var(--tone-fusion); }
.zp .zp-hero[data-tone="flow"] { --hl: var(--tone-flow); }
.zp .zp-hero[data-tone="friction"] { --hl: var(--tone-friction); }
.zp .zp-hero[data-tone="quiet"] { --hl: var(--tone-quiet); }
.zp .zp-hero .rk-top { position: relative; }
.zp .zp-mark { position: absolute; right: -14%; top: -12%; width: min(70%, 520px); height: auto; fill: none; stroke: var(--c-accent); stroke-width: 1.5; opacity: 0.1; pointer-events: none; }
.zp .zp-stage { position: relative; display: grid; justify-items: center; margin-top: 8px; text-align: center; }

/* the gauge: a ring of 100 units, the percentage inside it */
.zp .zp-gauge { container: gauge / inline-size; position: relative; width: min(100%, 380px); aspect-ratio: 1; }
.zp .zp-gauge .zp-ringsvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.zp .zp-gauge .zp-track { fill: none; stroke: #E8EDF3; stroke-width: 12; }
.zp .zp-gauge .zp-arc { fill: none; stroke: var(--c-accent); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: var(--off); }
.zp .zp-gauge .zp-knob { fill: #fff; stroke: var(--c-accent); stroke-width: 4; }
.zp .zp-gauge .zp-ticks { fill: none; stroke: #CBD5E1; stroke-width: 1.5; stroke-linecap: round; }
.zp .zp-gauge-c { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 2cqw; }
.zp .zp-pct { display: flex; align-items: flex-start; font-size: 34cqw; font-weight: 800; letter-spacing: -0.05em; line-height: 0.86; color: var(--c-ink); }
.zp .zp-pct-u { margin-top: 0.06em; margin-left: 0.04em; font-size: 0.4em; letter-spacing: 0; color: var(--c-accent); }
.zp .zp-pct-k { margin-top: 3cqw; font-size: max(0.6875rem, 3.4cqw); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c-muted); }

/* the rank chip: ink, square-cut, tabular */
.zp .zp-rankrow { margin-top: 18px; }
.zp .zp-rank { display: inline-flex; align-items: center; height: 38px; padding: 0 18px; border-radius: 10px; background: var(--c-ink); color: #fff; font-size: 1.0625rem; font-weight: 800; letter-spacing: 0.01em; }
.zp .zp-gauge-sub { margin-top: 10px; font-size: 0.875rem; font-weight: 600; color: var(--c-muted); }

/* the verdict: one bold phrase, the last word on a marker in the verdict's tone */
.zp .zp-verdict { margin-top: 20px; font-size: clamp(2.375rem, 14cqw, 5rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1; text-wrap: balance; color: var(--c-ink); }
.zp .zp-vw { display: inline-block; }
.zp .zp-vw.hl > span {
  display: inline-block; margin-left: -0.05em; padding: 0 0.07em; border-radius: 0.08em;
  background: linear-gradient(transparent 52%, color-mix(in srgb, var(--hl) 55%, #fff) 52%, color-mix(in srgb, var(--hl) 55%, #fff) 93%, transparent 93%) no-repeat 0 0 / 100% 100%;
}
.zp .zp-hook { margin-top: 16px; max-width: 26ch; font-size: clamp(1.25rem, 1rem + 1.4vw, 1.875rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; text-wrap: balance; }
.zp .zp-sub { margin-top: 10px; max-width: 54ch; font-size: 1rem; line-height: 1.5; color: var(--c-muted); }
.zp .zp-hero .rk-actions { justify-content: center; }

/* ================= Level 2: the identity lockup ================= */
.zp .zp-lock { container: lock / inline-size; }
.zp .zp-duo { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px 12px; align-items: stretch; }
.zp .zp-side { --p: var(--pa); display: grid; align-content: start; justify-items: center; gap: 12px; min-width: 0; text-align: center; }
.zp .zp-side.b { --p: var(--pb); }
.zp .zp-sname { font-size: clamp(1.125rem, 6.4cqw, 2.375rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; overflow-wrap: anywhere; color: var(--p); }
.zp .zp-side.a .zp-sname { color: var(--c-accent-ink); }
.zp .zp-plate { display: grid; place-items: center; width: clamp(84px, 36cqw, 220px); aspect-ratio: 1; border-radius: 22%; color: var(--p); background: color-mix(in srgb, var(--p) 7%, #fff); border: 1px solid color-mix(in srgb, var(--p) 22%, #fff); }
.zp .zp-glyph { width: 62%; height: 62%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.zp .zp-meta { font-size: 0.8125rem; font-weight: 600; color: var(--c-muted); }
.zp .zp-el { --ec: var(--c-muted); display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--ec) 30%, #fff); background: color-mix(in srgb, var(--ec) 9%, #fff); color: color-mix(in srgb, var(--ec) 76%, #000); font-size: 0.875rem; font-weight: 700; }
.zp .zp-el.fire { --ec: var(--el-fire); }
.zp .zp-el.earth { --ec: var(--el-earth); }
.zp .zp-el.air { --ec: var(--el-air); }
.zp .zp-el.water { --ec: var(--el-water); }
.zp .zp-el svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.zp .zp-join { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-width: 40px; }
.zp .zp-ln { flex: 1; width: 2px; min-height: 8px; border-radius: 1px; background: var(--c-line); }
.zp .zp-cross { flex: none; width: 44px; height: 44px; fill: none; }
.zp .zp-cross circle { stroke: #CBD5E1; stroke-width: 1.5; }
.zp .zp-cross path { stroke: var(--c-ink); stroke-width: 2.5; stroke-linejoin: miter; }
.zp .zp-relrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--c-line); font-size: 0.9375rem; }
.zp .zp-relrow b { font-weight: 800; margin-left: -4px; margin-right: -2px; }
.zp .zp-relrow span { font-weight: 600; color: var(--c-muted); }
.zp .zp-relrow .zp-sh { margin-right: -4px; }

/* ================= Level 3: the thematic breakdown ================= */
.zp .zp-mbars { display: grid; gap: 18px; margin-top: 4px; }
.zp .zp-mbar { --tone: var(--tone-flow); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 12px; }
.zp .zp-mbar.friction { --tone: var(--tone-friction); }
.zp .zp-mbar.quiet { --tone: var(--tone-quiet); }
.zp .zp-mbar-l { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.zp .zp-mbar-l b { font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.01em; }
.zp .zp-mbar-l small { font-size: 0.8125rem; font-weight: 600; color: var(--c-muted); }
.zp .zp-mbar-n { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.zp .zp-mbar-t { grid-column: 1 / -1; display: block; height: 12px; border-radius: 999px; background: #EEF2F6; overflow: hidden; }
.zp .zp-mbar-t i { display: block; width: var(--w); height: 100%; border-radius: 999px; background: var(--tone); }
.zp .zp-mbar.quiet .zp-mbar-t i { background: color-mix(in srgb, var(--tone-quiet) 80%, #475569); }
.zp .zp-cts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--c-line); }
.zp .zp-ct { --tone: var(--c-muted); display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--tone) 30%, #fff); background: color-mix(in srgb, var(--tone) 7%, #fff); font-size: 0.875rem; font-weight: 700; }
.zp .zp-ct.flow { --tone: var(--tone-flow); }
.zp .zp-ct.friction { --tone: var(--tone-friction); }
.zp .zp-ct.quiet { --tone: var(--tone-quiet); }
.zp .zp-legend { margin-top: 12px; font-size: 0.8125rem; font-weight: 600; color: var(--c-muted); }

/* ================= Level 4: micro-insights ================= */
.zp .rk-bento.zp-bento { grid-template-columns: minmax(0, 1fr); margin-top: 14px; }
@container zpfunnel (min-width: 640px) { .zp .rk-bento.zp-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } .zp .zp-tile.dyn { grid-column: 1 / -1; } }
@container zpfunnel (min-width: 980px) { .zp .rk-bento.zp-bento { grid-template-columns: repeat(3, minmax(0, 1fr)); } .zp .zp-tile.dyn { grid-column: auto; } }
.zp .zp-tile { display: flex; flex-direction: column; }
.zp .zp-tile.flow { border-top: 3px solid var(--tone-flow); }
.zp .zp-tile.friction { border-top: 3px solid var(--tone-friction); }
.zp .zp-tile.dyn { border-top: 3px solid var(--tone-fusion); }
.zp .zp-tile h3 { display: flex; align-items: center; gap: 8px; }
.zp .zp-bul { display: grid; gap: 14px; margin-top: 14px; }
.zp .zp-bul li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; font-size: 0.9375rem; line-height: 1.45; color: #334155; }
.zp .zp-bul .zp-sh { margin-top: 5px; }
.zp .zp-dyn { display: grid; gap: 18px; margin-top: 14px; }
.zp .zp-dyn li { display: grid; gap: 4px; }
.zp .zp-dyn-k { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--tone-fusion); }
.zp .zp-dyn-t { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; color: var(--c-ink); }

/* ================= Level 5: the proof of math and the ranking ================= */
.zp .zp-facts { display: grid; gap: 0; margin-top: 4px; }
.zp .zp-facts li { display: grid; grid-template-columns: minmax(84px, 120px) minmax(0, 1fr); gap: 2px 12px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--c-line); }
.zp .zp-facts li:first-child { border-top: 0; }
.zp .zp-fk { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--c-muted); }
.zp .zp-fv { display: inline-flex; align-items: center; gap: 8px; font-size: 1.125rem; font-weight: 800; letter-spacing: -0.015em; }
.zp .zp-fl { grid-column: 2; font-size: 0.875rem; font-weight: 600; color: var(--c-muted); }
.zp .zp-fl:empty { display: none; }
.zp .zp-note { margin-top: 14px; font-size: 0.875rem; line-height: 1.5; color: #475569; max-width: 70ch; }
.zp .zp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 12px; }
.zp .zp-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.zp .zp-table caption { text-align: left; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-muted); padding-bottom: 6px; }
.zp .zp-table th, .zp .zp-table td { padding: 10px 8px; text-align: left; border-top: 1px solid var(--c-line); font-weight: 500; vertical-align: top; }
.zp .zp-table thead th { border-top: 0; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--c-muted); }
.zp .zp-table th[scope="row"] { font-weight: 700; }
.zp .zp-table th[scope="row"] small { display: block; margin-top: 1px; font-size: 0.75rem; font-weight: 500; color: var(--c-muted); }
.zp .zp-table td { min-width: 96px; }
.zp .zp-tv { font-size: 1.0625rem; font-weight: 800; }
.zp .zp-tb { display: block; height: 6px; margin-top: 6px; border-radius: 3px; background: #E2E8F0; overflow: hidden; }
.zp .zp-tb i { display: block; width: var(--w); height: 100%; border-radius: 3px; background: var(--pa); }
.zp .zp-tb.b i { background: var(--pb); }

.zp .zp-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 14px; }
.zp .zp-filter label { font-size: 0.875rem; font-weight: 700; }
.zp .zp-filter .input { width: auto; min-width: 200px; height: 44px; }
.zp .zp-count { font-size: 0.875rem; font-weight: 600; color: var(--c-muted); }
.zp .zp-rank-scroll { max-height: 560px; overflow: auto; border: 1px solid var(--c-line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.zp .zp-rt { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.zp .zp-rt thead th { position: sticky; top: 0; z-index: 1; padding: 10px 12px; background: #F8FAFC; border-bottom: 1px solid var(--c-line); text-align: left; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-muted); }
.zp .zp-rt td { padding: 0 12px; border-top: 1px solid var(--c-line); height: 48px; }
.zp .zp-rt tbody tr:first-child td { border-top: 0; }
.zp .zp-rt tbody tr:hover td { background: #F8FAFC; }
.zp .zp-rt tr[aria-current="true"] td { background: var(--c-accent-tint); }
.zp .zp-rt-r { width: 56px; font-weight: 800; color: var(--c-muted); }
.zp .zp-rt-s { width: 72px; font-weight: 800; }
.zp .zp-rt-v span { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.zp .zp-pairbtn { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; font-weight: 700; letter-spacing: -0.005em; }
.zp .zp-pairbtn:focus-visible { outline: 3px solid color-mix(in srgb, var(--c-accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.zp .zp-pairbtn span { margin-left: 4px; }
.zp .zp-mini { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.zp .zp-pairbtn .zp-mini:first-child { color: var(--pa); }
.zp .zp-pairbtn .zp-mini:nth-child(2) { color: var(--pb); }
@media (max-width: 560px) { .zp .zp-rt .zp-rt-v { display: none; } .zp .zp-rt-r { width: 44px; } }

.zp .zp-nexts { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .zp .zp-nexts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* a narrow phone: the lockup keeps three columns and the glyph plates shrink with the card */
@container lock (max-width: 360px) { .zp .zp-cross { width: 32px; height: 32px; } .zp .zp-meta { font-size: 0.75rem; } .zp .zp-el { padding: 0 8px 0 6px; font-size: 0.8125rem; } }

/* ---- Motion: the ring draws, the knob lands, the verdict rises and its marker sweeps, the bars fill ---- */
@keyframes zp-ring { from { stroke-dashoffset: 100; } }
@keyframes zp-word { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes zp-sweep { from { background-size: 0 100%; } to { background-size: 100% 100%; } }
@keyframes zp-grow { from { width: 0; } }
@keyframes zp-fade { from { opacity: 0; } }
@keyframes zp-draw { from { opacity: 0; transform: scale(0.94); } to { opacity: 0.1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .zp .results.is-in .zp-mark { animation: zp-draw 1.1s var(--ease) 0.1s backwards; transform-origin: 70% 40%; }
  .zp .results.is-in .zp-gauge .zp-arc { animation: zp-ring 1.1s var(--ease) 0.25s backwards; }
  .zp .results.is-in .zp-gauge .zp-knob { animation: zp-fade 0.4s var(--ease) 1.2s backwards; }
  .zp .results.is-in .zp-rank { animation: zp-word 0.5s var(--ease) 0.9s backwards; }
  .zp .results.is-in .zp-verdict .zp-vw > span, .zp .results.is-in .zp-verdict > .zp-vw:not(.hl) { animation: zp-word 0.6s var(--ease) 0.5s backwards; }
  .zp .results.is-in .zp-vw.hl > span { animation: zp-word 0.6s var(--ease) 0.6s backwards, zp-sweep 0.7s var(--ease) 1s backwards; }
  .zp .results.is-in .zp-mbar-t i { animation: zp-grow 0.9s var(--ease) 0.4s backwards; }
}
