/* Love Calculator (Tool 9, prefix lc-) — the funnel: score gauge, name lockup, thematic breakdown, micro-insights, proof.
   Loaded through the `styles:` list in love-calculator.njk, so it sits in <head>, BEFORE the tool kit's inline <style> blocks.
   Rules are scoped `.lc .x`; where one restyles a kit class it adds a class (`.lc .rk-bento.lc-bento`) so it outranks the kit's
   `.tk .x`. Token overrides use `.tk.lc`. 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.lc {
  --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 names side by side, one button ---- */
.lc .lc-pair { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .lc .lc-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; } }
.lc .lc-badge { font-size: 1.0625rem; font-weight: 800; letter-spacing: 0; }
.lc .lc-b .lc-badge { background: #EEF2F6; color: var(--c-ink); }
.lc .lc-go { width: min(100%, 380px); margin: 20px auto 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.lc .lc-go svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.lc .lc-hint { margin-top: 10px; text-align: center; }
.lc .lc-forms .form-error { max-width: 560px; margin: 12px auto 0; text-align: center; }
.tk #lc-forms { margin-bottom: 20px; }

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

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

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

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

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

/* ================= Level 2: the identity lockup ================= */
.lc .lc-lock { container: lock / inline-size; }
.lc .lc-duo { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px 12px; align-items: stretch; }
.lc .lc-side { display: grid; align-content: center; justify-items: start; gap: 8px; min-width: 0; }
.lc .lc-side.b { justify-items: end; text-align: right; }
/* the name is the loudest thing in the card: its size follows the longest word, so a long name still fits its column */
.lc .lc-pname { --chars: 5; display: block; max-width: 100%; font-size: clamp(1.125rem, calc(56cqw / var(--chars)), 4.75rem); font-weight: 800; letter-spacing: -0.04em; line-height: 0.98; overflow-wrap: anywhere; hyphens: none; text-wrap: balance; }
.lc .lc-side.a .lc-pname { color: var(--c-accent); }
.lc .lc-side.b .lc-pname { color: var(--c-ink); }
.lc .lc-meta { display: grid; gap: 1px; font-size: 0.8125rem; font-weight: 600; color: var(--c-muted); }
.lc .lc-meta b { white-space: nowrap; font-size: clamp(0.9375rem, 3.4cqw, 1.125rem); font-weight: 800; letter-spacing: -0.01em; color: var(--c-ink); }
.lc .lc-join { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-width: 44px; }
.lc .lc-ln { flex: 1; width: 2px; min-height: 8px; border-radius: 1px; background: var(--c-line); }
.lc .lc-link { flex: none; width: 52px; height: 36px; fill: none; }
.lc .lc-link circle { stroke-width: 2.5; }
.lc .lc-link circle:first-child { stroke: var(--pa); }
.lc .lc-link circle:last-child { stroke: var(--pb); }
.lc .lc-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; }
.lc .lc-relrow b { font-weight: 800; }
.lc .lc-relrow span { font-weight: 600; color: var(--c-muted); }

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

/* ================= Level 4: micro-insights ================= */
.lc .rk-bento.lc-bento { grid-template-columns: minmax(0, 1fr); margin-top: 14px; }
@container lcfunnel (min-width: 640px) { .lc .rk-bento.lc-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container lcfunnel (min-width: 1040px) { .lc .rk-bento.lc-bento { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lc .lc-tile { --tone: var(--tone-quiet); display: flex; flex-direction: column; border-top: 3px solid var(--tone); }
.lc .lc-tile.flow { --tone: var(--tone-flow); }
.lc .lc-tile.friction { --tone: var(--tone-friction); }
.lc .lc-tile h3 { display: flex; align-items: center; gap: 8px; }
.lc .lc-tile-n { margin-left: auto; font-size: 0.9375rem; font-weight: 700; color: var(--c-muted); }
.lc .lc-tile-line { margin-top: 12px; font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.lc .lc-tile-fact { margin-top: auto; padding-top: 14px; font-size: 0.8125rem; font-weight: 600; line-height: 1.4; color: var(--c-muted); }

/* ================= Level 5: the proof of math ================= */
.lc .lc-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 16px; }
.lc .lc-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.lc .lc-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; }
.lc .lc-table th, .lc .lc-table td { padding: 10px 8px; text-align: left; border-top: 1px solid var(--c-line); font-weight: 500; vertical-align: top; }
.lc .lc-table thead th { border-top: 0; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--c-muted); }
.lc .lc-table thead th span { overflow-wrap: anywhere; }
.lc .lc-table th[scope="row"] { width: 26%; font-weight: 700; }
.lc .lc-table td { min-width: 0; }
.lc .lc-ltrs { display: flex; flex-wrap: wrap; gap: 4px; }
.lc .lc-ltr { display: inline-grid; justify-items: center; min-width: 26px; padding: 3px 4px; border-radius: 6px; background: #EEF2F6; line-height: 1.1; }
.lc .lc-ltr b { font-size: 1rem; font-weight: 800; text-transform: uppercase; }
.lc .lc-ltr i { font-style: normal; font-size: 0.6875rem; font-weight: 700; color: var(--c-muted); }
.lc .lc-ltr.v { background: color-mix(in srgb, var(--c-accent) 14%, #fff); }
.lc .lc-ltr.v b { color: var(--c-accent-ink); }
.lc .lc-tv { font-size: 1.0625rem; font-weight: 800; }
.lc .lc-tv small { font-size: 0.8125rem; font-weight: 600; color: var(--c-muted); }
.lc .lc-beat { display: inline-block; margin-right: 6px; font-weight: 700; }
.lc .lc-beat.h { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.lc .lc-rel { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--c-line); }
.lc .lc-rel-k { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--c-muted); }
.lc .lc-rels { display: grid; gap: 8px; margin-top: 8px; }
.lc .lc-rels li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: 0.9375rem; }
.lc .lc-rels li b { font-weight: 800; }
.lc .lc-rels li span { color: var(--c-muted); font-weight: 600; }
.lc .lc-note { margin-top: 12px; font-size: 0.875rem; line-height: 1.45; color: #475569; max-width: 70ch; }

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

/* a narrow phone: the lockup keeps three columns and the names shrink with the card */
@container lock (max-width: 360px) { .lc .lc-link { width: 40px; height: 28px; } .lc .lc-join { min-width: 36px; } .lc .lc-meta { font-size: 0.75rem; } }

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