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

   Person A is Cinnabar (the page accent), Person 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.bd {
  --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 birthdays side by side, one button ---- */
.bd .bd-pair { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .bd .bd-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; } }
.bd .bd-badge { font-size: 1.0625rem; font-weight: 800; letter-spacing: 0; }
.bd .bd-b .bd-badge { background: #EEF2F6; color: var(--c-ink); }
.bd .bd-person .chips { margin-top: 10px; }
.bd .bd-go { width: min(100%, 380px); margin: 20px auto 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.bd .bd-go svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.tk #bd-forms { margin-bottom: 20px; }

/* After a reading the two forms fold into one bar. The birthdays stay one tap away. */
.bd .bd-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); }
.bd .bd-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; }
.bd .bd-strip-names span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.bd .bd-strip-names i { font-style: normal; font-weight: 500; color: var(--c-muted); }
.bd .bd-strip + .tk-layout { margin-top: 16px; }
.bd .tk-layout.bd-layout { grid-template-columns: minmax(0, 1fr); }
.bd .bd-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; }
.bd .bd-dot.a { background: var(--pa); }
.bd .bd-dot.b { background: var(--pb); }

/* ---- Shapes: colour never works alone ---- */
.bd .bd-sh { display: inline-block; flex: none; width: 11px; height: 11px; background: var(--tone); }
.bd .bd-sh.fusion { --tone: var(--tone-fusion); border-radius: 50%; }
.bd .bd-sh.flow { --tone: var(--tone-flow); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.bd .bd-sh.friction { --tone: var(--tone-friction); border-radius: 2px; }
.bd .bd-sh.quiet { --tone: var(--tone-quiet); background: transparent; border: 2.5px solid var(--tone); border-radius: 50%; }
.bd .bd-sh.lg { width: 16px; height: 16px; }

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

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

/* ================= Level 1: the core result ================= */
.bd .bd-hero { --hl: var(--tone-fusion); }
.bd .bd-hero[data-tone="flow"] { --hl: var(--tone-flow); }
.bd .bd-hero[data-tone="friction"] { --hl: var(--tone-friction); }
.bd .bd-hero[data-tone="quiet"] { --hl: var(--tone-quiet); }
.bd .bd-hero .rk-top { position: relative; }
.bd .bd-hero .rk-ribbon { white-space: normal; height: auto; min-height: 28px; padding: 4px 12px; }
.bd .bd-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; }
.bd .bd-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 */
.bd .bd-gauge { container: gauge / inline-size; position: relative; width: min(100%, 380px); aspect-ratio: 1; }
.bd .bd-gauge .bd-ringsvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bd .bd-gauge .bd-track { fill: none; stroke: #E8EDF3; stroke-width: 12; }
.bd .bd-gauge .bd-arc { fill: none; stroke: var(--c-accent); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: var(--off); }
.bd .bd-gauge .bd-knob { fill: #fff; stroke: var(--c-accent); stroke-width: 4; }
.bd .bd-gauge .bd-ticks { fill: none; stroke: #CBD5E1; stroke-width: 1.5; stroke-linecap: round; }
.bd .bd-gauge-c { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 2cqw; }
.bd .bd-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); }
.bd .bd-pct-u { margin-top: 0.06em; margin-left: 0.04em; font-size: 0.4em; letter-spacing: 0; color: var(--c-accent); }
.bd .bd-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); }
.bd .bd-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 */
.bd .bd-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); }
.bd .bd-vw { display: inline-block; }
.bd .bd-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%;
}
.bd .bd-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; }
.bd .bd-sub { margin-top: 10px; max-width: 54ch; font-size: 1rem; line-height: 1.5; color: var(--c-muted); }
.bd .bd-hero .rk-actions { justify-content: center; }

/* ================= Level 2: the identity lockup ================= */
.bd .bd-lock { container: lock / inline-size; }
.bd .bd-duo { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px 12px; align-items: stretch; }
.bd .bd-side { display: grid; align-content: start; justify-items: start; gap: 6px; min-width: 0; }
.bd .bd-side.b { justify-items: end; text-align: right; }
.bd .bd-pname { font-size: clamp(1rem, 5cqw, 1.75rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; overflow-wrap: anywhere; }
.bd .bd-side.a .bd-pname { color: var(--c-accent-ink); }
.bd .bd-lp { margin-top: 4px; font-size: clamp(4rem, 24cqw, 9rem); font-weight: 800; letter-spacing: -0.05em; line-height: 0.86; }
.bd .bd-side.a .bd-lp { color: var(--c-accent); }
.bd .bd-side.b .bd-lp { color: var(--c-ink); }
.bd .bd-arch { margin-top: 6px; font-size: clamp(0.9375rem, 3.4cqw, 1.25rem); font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.bd .bd-meta { font-size: 0.8125rem; font-weight: 600; color: var(--c-muted); }
.bd .bd-join { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-width: 40px; }
.bd .bd-ln { flex: 1; width: 2px; min-height: 8px; border-radius: 1px; background: var(--c-line); }
.bd .bd-plus { flex: none; width: 40px; height: 40px; fill: none; }
.bd .bd-plus circle { stroke: #CBD5E1; stroke-width: 1.5; }
.bd .bd-plus path { stroke: var(--c-ink); stroke-width: 2.5; stroke-linecap: round; }
.bd .bd-relrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--c-line); font-size: 0.9375rem; }
.bd .bd-relrow b { font-weight: 800; }
.bd .bd-relrow span { font-weight: 600; color: var(--c-muted); }

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

/* ================= Level 4: micro-insights ================= */
.bd .rk-bento.bd-bento { grid-template-columns: minmax(0, 1fr); margin-top: 14px; }
@container bdfunnel (min-width: 640px) { .bd .rk-bento.bd-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container bdfunnel (min-width: 1040px) { .bd .rk-bento.bd-bento { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bd .bd-tile { display: flex; flex-direction: column; }
.bd .bd-tile.flow { border-top: 3px solid var(--tone-flow); }
.bd .bd-tile.friction { border-top: 3px solid var(--tone-friction); }
.bd .bd-tile.person.a { border-top: 3px solid var(--pa); }
.bd .bd-tile.person.b { border-top: 3px solid var(--pb); }
.bd .bd-tile h3 { display: flex; align-items: center; gap: 8px; }
.bd .bd-pts { display: grid; gap: 16px; margin-top: 14px; }
.bd .bd-pt { display: grid; gap: 4px; }
.bd .bd-pt-h { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 800; letter-spacing: -0.01em; }
.bd .bd-pt-n { margin-left: auto; font-size: 0.9375rem; font-weight: 700; color: var(--c-muted); }
.bd .bd-pt-t { font-size: 0.9375rem; line-height: 1.45; color: #334155; }
.bd .bd-tile-name { margin-top: 12px; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
.bd .bd-tile.person.a .bd-tile-name { color: var(--c-accent-ink); }
.bd .bd-tile-line { margin-top: 10px; font-size: 0.9375rem; line-height: 1.45; color: #334155; }
.bd .bd-tile-grp { margin-top: auto; padding-top: 14px; font-size: 0.8125rem; font-weight: 600; color: var(--c-muted); }

/* ================= Level 5: the proof of math ================= */
.bd .bd-pf { display: grid; gap: 0; margin-top: 4px; }
.bd .bd-pf li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--c-line); }
.bd .bd-pf li:first-child { border-top: 0; }
.bd .bd-pf .bd-dot { transform: translateY(1px); }
.bd .bd-pf-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.bd .bd-pf-who b { font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.bd .bd-pf-who small { font-size: 0.8125rem; font-weight: 600; color: var(--c-muted); }
.bd .bd-pf-math { grid-column: 2; font-size: 1rem; font-weight: 700; }
.bd .bd-rel { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--c-line); }
.bd .bd-rel-k { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--c-muted); }
.bd .bd-rel-w { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; }
.bd .bd-rel-l { margin-top: 6px; font-size: 0.9375rem; line-height: 1.5; color: #475569; max-width: 62ch; }
.bd .bd-reason { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #FFFBEB; border: 1px solid #FDE68A; font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: #78350F; }
.bd .bd-note { margin-top: 12px; font-size: 0.875rem; line-height: 1.45; color: #475569; }
.bd .bd-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 16px; }
.bd .bd-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.bd .bd-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; }
.bd .bd-table th, .bd .bd-table td { padding: 10px 8px; text-align: left; border-top: 1px solid var(--c-line); font-weight: 500; vertical-align: top; }
.bd .bd-table thead th { border-top: 0; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--c-muted); }
.bd .bd-table th[scope="row"] { font-weight: 700; }
.bd .bd-table th[scope="row"] small { display: block; margin-top: 1px; font-size: 0.75rem; font-weight: 500; color: var(--c-muted); }
.bd .bd-table td { min-width: 96px; }
.bd .bd-tv { font-size: 1.0625rem; font-weight: 800; }
.bd .bd-tb { display: block; height: 6px; margin-top: 6px; border-radius: 3px; background: #E2E8F0; overflow: hidden; }
.bd .bd-tb i { display: block; width: var(--w); height: 100%; border-radius: 3px; background: var(--pa); }
.bd .bd-tb.b i { background: var(--pb); }

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

/* a narrow phone: the lockup keeps three columns and the numerals shrink with the card */
@container lock (max-width: 360px) { .bd .bd-plus { width: 32px; height: 32px; } .bd .bd-meta { font-size: 0.75rem; } }

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