/* User center design document (docs/design/user-center-vision.md). Tokens and components follow landing.html and
   design-system.md. Motion: transform and opacity only, interruptible, reduced under prefers-reduced-motion. */
:root {
  --navy-950: #04152f; --navy-900: #0a1e3d; --navy-800: #0c1d52; --navy-700: #102463;
  --slate-600: #55659a; --slate-500: #6673aa; --blue-700: #3150a7; --blue-50: #eaf0ff;
  --paper: #fefefd; --paper-warm: #fef6ee; --card: #fdfefd; --mist: #f3f6fc; --track: #e9ecf2;
  --green-500: #2dc165; --green-600: #2cb868; --green-900: #10742d; --green-50: #e0f8e7;
  --amber-400: #ffba26; --orange-500: #fe752f; --red-500: #fc3a41;
  --tint-both: #eefcee; --tint-orange-side: #fef6ec; --tint-apple-side: #fef6ed; --tint-low: #feedeb;
  --label-both: #0c8351; --label-orange-side: #b55710; --label-apple-side: #b05a17; --label-low: #dc0425;
  --ink-hand: #121f41; --stroke-hand: #fe8c65;
  /* ai-accent is "to measure" from reference 07's lavender card (design-system.md); this is a placeholder. */
  --ai-surface: #f4f1fe; --ai-ink: #4b3aa8;
  --text-strong: var(--navy-950); --text: var(--navy-800); --text-muted: var(--slate-600); --text-subtle: var(--slate-500);
  --text-axis: #68739b; --surface-page: var(--paper); --surface-card: var(--card); --surface-control: var(--mist);
  --action-primary: var(--navy-900); --bar-fill: var(--green-600); --bar-track: var(--track);
  --selection: var(--navy-900); --selection-text: var(--paper);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --duration-press: 120ms; --duration-small: 150ms; --duration-entry: 200ms; --duration-medium: 250ms; --duration-panel: 300ms;
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif; --font-ui: "Inter", system-ui, sans-serif; --font-hand: "Caveat", cursive;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); font-family: var(--font-ui); line-height: 1.5; -webkit-font-smoothing: antialiased;
  background: radial-gradient(900px 600px at 100% 0%, var(--paper-warm) 0%, rgb(254 246 238 / 0) 70%), var(--surface-page); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue-700); outline-offset: 2px; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 10; padding: 10px 16px; border-radius: 10px; background: var(--action-primary); color: #fff; }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.art { mix-blend-mode: multiply; pointer-events: none; user-select: none; object-fit: contain; }

.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: 18px 16px 20px;
  background: var(--surface-card); border-right: 1px solid var(--track); }
.brand { display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text-strong); }
.brand-mark { width: 60px; height: 60px; }
.brand-text { display: grid; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.375rem; line-height: 1.15; letter-spacing: -0.02em; }
.brand-tag { font-size: 0.6875rem; font-weight: 500; line-height: 1.3; color: var(--text-muted); }
.side-nav { display: grid; gap: 2px; }
.nav-caption { margin: 0 0 4px; padding: 0 12px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-subtle); }
.nav-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; text-decoration: none;
  font-size: 0.9375rem; font-weight: 500; color: var(--navy-700);
  transition: transform var(--duration-press) var(--ease-out), background-color var(--duration-small) var(--ease-out); }
.nav-link svg { flex: none; }
.nav-link:active { transform: scale(0.98); }
.nav-link[aria-current="page"] { background: var(--mist); color: var(--text-strong); font-weight: 600; }
.nav-short { display: none; }
/* Requests waiting for this fruit's answer: the one number in the sidebar that asks for action, so it is filled. */
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--action-primary); font-size: 0.6875rem; font-weight: 700;
  line-height: 1.5; text-align: center; color: #fff; font-variant-numeric: tabular-nums; }
.nav-more { display: grid; gap: 2px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--track); }
.store-note { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--tint-orange-side); color: var(--label-orange-side); font-size: 0.875rem; font-weight: 600; }
.side-art { margin: auto 0 0; }
.side-art img { display: block; width: 100%; height: auto; }
.hand { margin: 4px 0 0; font-family: var(--font-hand); font-weight: 600; font-size: 1.25rem; line-height: 1; color: var(--ink-hand); transform: rotate(-4deg); }

.main { min-width: 0; padding: 22px 28px 28px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-head h1 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1.1; letter-spacing: -0.02em; color: var(--text-strong); }
.lead { margin: 4px 0 0; font-size: 0.9375rem; color: var(--text-muted); }
.identity { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border-radius: 18px; background: var(--surface-card);
  box-shadow: 0 1px 2px rgb(12 29 82 / 0.05), 0 12px 32px -20px rgb(12 29 82 / 0.3); }
.identity-name { margin: 0; font-weight: 700; color: var(--text-strong); }
.identity-sub { margin: 0; font-size: 0.75rem; color: var(--text-muted); }
.demo-switch { display: grid; gap: 2px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-subtle); }

.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--mist); }
.avatar-sm { width: 30px; height: 30px; }
.avatar-lg { flex: none; width: 88px; height: 88px; }
.card { background: var(--surface-card); border-radius: 22px; padding: 18px 20px;
  box-shadow: 0 1px 2px rgb(12 29 82 / 0.05), 0 24px 48px -28px rgb(12 29 82 / 0.24); }
.card-title, .card h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.1875rem; letter-spacing: -0.01em; color: var(--text-strong); }
.card-head { display: flex; align-items: center; gap: 12px; }
.sub, .fine { margin: 4px 0 0; font-size: 0.75rem; line-height: 1.45; color: var(--text-muted); }
.empty { margin: 8px 0 0; font-size: 0.8125rem; color: var(--text-muted); }
.muted { color: var(--text-subtle); }
.check-alert, .load-state.error { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--tint-low); color: var(--label-low); font-size: 0.875rem; font-weight: 600; }
.load-state { margin: 24px 0 0; font-size: 0.9375rem; color: var(--text-muted); }
.load-state p { margin: 0 0 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; font: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform var(--duration-press) var(--ease-out), background-color var(--duration-small) var(--ease-out); }
.btn:active, .prompt:active, .chip-btn:active { transform: scale(0.97); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 0.875rem; }
.btn-xs { height: 30px; padding: 0 12px; border-radius: 9px; font-size: 0.75rem; }
.btn-primary { background: var(--action-primary); color: #fff; }
.btn-secondary { background: var(--surface-control); color: var(--text); }
.link-btn { padding: 4px 6px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 0.875rem; font-weight: 600; color: var(--blue-700);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.chip { display: inline-flex; align-items: center; gap: 6px; margin: 6px 6px 0 0; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.chip-ok { background: var(--green-50); color: var(--green-900); }
.chip-muted { margin: 0; background: var(--mist); color: var(--text-muted); }
.chip-version { margin: 0; background: var(--blue-50); color: var(--blue-700); }
.chip-new { background: var(--tint-orange-side); color: var(--label-orange-side); }
.chip-ai { margin: 0; background: var(--ai-surface); color: var(--ai-ink); }
select, input[type="number"], .ask input { height: 38px; padding: 0 10px; border: 1px solid var(--track); border-radius: 10px; font: inherit; font-size: 0.875rem;
  color: var(--text-strong); background: var(--surface-card); }

/* The insights column never drops below 540px: the plane's 654-unit viewBox then renders at 0.77 or more, so its text stays near 11px. */
.columns { display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(290px, 0.75fr) minmax(540px, 1.5fr); gap: 20px; margin-top: 18px; align-items: start; }
.chat { position: sticky; top: 18px; display: flex; flex-direction: column; height: calc(100vh - 36px); min-height: 600px; max-height: 1040px; }
.mode { margin: 2px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-muted); }
.thread { position: relative; flex: 1; min-height: 0; margin: 14px -10px 0; padding: 0 10px 4px; list-style: none; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; align-items: flex-start; gap: 10px; }
.msg.from-you { flex-direction: row-reverse; }
.msg:not(.settled) { transition: opacity var(--duration-entry) var(--ease-out), transform var(--duration-entry) var(--ease-out); }
.bubble { min-width: 0; max-width: 90%; padding: 10px 14px; border-radius: 16px; font-size: 0.875rem; background: var(--surface-control); }
.from-fruitful .bubble { border-top-left-radius: 6px; }
.from-you .bubble { border-top-right-radius: 6px; background: var(--blue-50); }
.msg.change .bubble { background: var(--green-50); }
.bubble p { margin: 0 0 6px; }
.bubble > p:last-child { margin-bottom: 0; }
.speaker { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--text-muted); }
.speaker strong { color: var(--text-strong); }
.items { margin: 4px 0 8px; padding-left: 18px; }
.items li + li { margin-top: 2px; }
.cands, .chat-suggestions { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
/* Candidate cards speak the landing page's selected-pair language at chat width (B-194). The whole summary is the
   disclosure's click target through the button's ::after, so the focus ring is drawn around the card instead. */
.cand-card { border: 1px solid var(--track); border-radius: 14px; background: var(--surface-card); transition: border-color var(--duration-small) var(--ease-out); }
.cand-card:has(.pair-toggle:focus-visible) { outline: 2px solid var(--blue-700); outline-offset: 2px; }
.pair-summary { position: relative; display: grid; gap: 10px; padding: 12px 12px 8px; border-radius: 13px; transition: transform var(--duration-press) var(--ease-out); }
.cand-card:has(.pair-toggle:active) .pair-summary { transform: scale(0.985); }
.pair-summary p { margin: 0; }
.pair-head { display: flex; align-items: center; gap: 10px; }
.pair-art { position: relative; flex: none; display: flex; }
.pair-mascot { width: 38px; height: 38px; }
.pair-art .pair-mascot:last-child { margin-left: -10px; }
.pair-heart { position: absolute; top: -7px; left: 50%; transform: translateX(-50%); color: var(--red-500); }
.pair-titles { min-width: 0; display: grid; justify-items: start; gap: 4px; }
.pair-summary .pair-name { font-family: var(--font-display); font-weight: 800; font-size: 1.0625rem; line-height: 1.2; letter-spacing: -0.01em; color: var(--text-strong); }
.pair-name .x { font-weight: 700; color: var(--text-subtle); }
.verdict { padding: 3px 10px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; line-height: 1.35; background: var(--green-50); color: var(--green-900); }
.verdict[data-tone="apple"], .verdict[data-tone="orange"] { background: var(--tint-apple-side); color: var(--label-apple-side); }
.verdict[data-tone="low"] { background: var(--tint-low); color: var(--label-low); }
.verdict[data-tone="none"] { background: var(--mist); color: var(--text-muted); }
.pair-dirs { display: grid; gap: 10px; }
/* A range like "67% to 100%" wraps below its label on a narrow card instead of squeezing the label into three lines. */
.pair-dir { display: flex; flex-wrap: wrap; align-items: flex-end; column-gap: 10px; }
.pair-dir-text { flex: 1 1 10.5rem; min-width: 0; }
.pair-summary .pair-dir-label { font-size: 0.75rem; font-weight: 600; color: var(--text-strong); }
.pair-summary .pair-dir-sub { font-size: 0.6875rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pair-summary .pair-dir-value { margin-left: auto; font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; line-height: 1.1; white-space: nowrap;
  color: var(--text-strong); font-variant-numeric: tabular-nums; }
.pair-bar { flex: 1 0 100%; position: relative; height: 6px; margin-top: 6px; border-radius: 999px; background: var(--bar-track); overflow: hidden; }
.pair-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--bar-fill); transform: translateX(calc((var(--v) - 1) * 100%)); }
.pair-hatch { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--green-600) 0 2px, rgb(44 184 104 / 0) 2px 5px); }
.pair-summary .pair-why { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-control); font-size: 0.75rem; line-height: 1.45; }
.pair-why strong { color: var(--text-strong); }
.why-leaf { flex: none; width: 24px; height: 24px; }
.pair-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 0 0; border: 0; border-top: 1px dashed var(--track);
  background: none; font: inherit; font-size: 0.75rem; font-weight: 600; color: var(--blue-700); text-align: left; cursor: pointer; }
.pair-toggle::after { content: ""; position: absolute; inset: 0; border-radius: 13px; }
.pair-toggle:focus-visible { outline: none; }
.chev { flex: none; transition: transform var(--duration-entry) var(--ease-out); }
.pair-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
/* Opening fades the list in under its header; closing fades it out faster, then the space closes. No height animates. */
.cand-detail { display: grid; gap: 10px; margin: 0 12px; padding: 8px 0 10px; border-top: 1px solid var(--track);
  transition-property: opacity, transform, display; transition-duration: var(--duration-entry); transition-timing-function: var(--ease-out); transition-behavior: allow-discrete; }
.cand-detail[hidden] { display: none; opacity: 0; transform: translateY(-4px); transition-duration: var(--duration-small); }
.cand-detail .crit-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; margin: 0 0 4px; font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.crit-head strong { color: var(--text-strong); }
.crit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.crit { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; grid-template-areas: "sw label state" ". text text"; align-items: center; gap: 1px 8px;
  margin: 0 -6px; padding: 3px 6px; border-radius: 8px; font-size: 0.8125rem; }
.crit.unmet { background: var(--tint-low); }
.crit .swatch { grid-area: sw; }
.crit-label { grid-area: label; font-weight: 600; color: var(--text-strong); }
.crit-state { grid-area: state; font-size: 0.6875rem; font-weight: 700; }
.crit.met .crit-state { color: var(--green-900); } .crit.unmet .crit-state { color: var(--label-low); } .crit.unknown .crit-state { color: var(--text-muted); }
.crit-text { grid-area: text; font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cand-detail .crit-none { margin: 6px 0 0; font-size: 0.6875rem; color: var(--text-subtle); }
.pair-action { padding: 0 12px 12px; }
.pair-action .btn { width: 100%; }
.cta-heart { flex: none; }
.chat-suggestions li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--ai-surface); font-size: 0.8125rem; }
.trace { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--track); font-size: 0.6875rem; color: var(--text-muted); }
.trace p { margin: 0; }
.trace summary { cursor: pointer; font-weight: 600; color: var(--blue-700); }
.docs { margin: 6px 0 0; padding-left: 16px; }
.docs li + li { margin-top: 4px; }
.prompts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.prompt { padding: 6px 12px; border: 1px solid var(--track); border-radius: 999px; background: var(--surface-card); font: inherit; font-size: 0.8125rem; color: var(--navy-700);
  cursor: pointer; transition: transform var(--duration-press) var(--ease-out), background-color var(--duration-small) var(--ease-out); }
.ask { display: flex; gap: 8px; margin-top: 10px; }
.ask input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 12px; }
.send { width: 44px; height: 44px; padding: 0; }

.profile-head { display: flex; align-items: center; gap: 14px; }
.summary { margin: 2px 0 0; font-size: 0.875rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.block { margin-top: 18px; }
.block-head { display: flex; align-items: center; gap: 8px; }
.block-head h3 { flex: 1; margin: 0; font-size: 0.9375rem; font-weight: 700; color: var(--text-strong); }
.note { font-size: 0.6875rem; color: var(--text-subtle); }
.kv { margin: 6px 0 0; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--track); font-size: 0.875rem; }
.kv-row dt { color: var(--text-muted); }
.kv-row dd { margin: 0; text-align: right; font-weight: 600; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.kv-row dd.muted { font-weight: 500; color: var(--text-subtle); }
.editor { display: grid; gap: 10px; margin-top: 10px; }
.edit-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; font-size: 0.875rem; }
fieldset.edit-row { grid-template-columns: 1fr; }
.edit-row legend, .edit-row > label { padding: 0; font-weight: 600; color: var(--text-strong); }
.range-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 4px; }
.mini { display: grid; gap: 2px; min-width: 0; font-size: 0.6875rem; color: var(--text-muted); }
.editor input[type="number"], .editor select { width: 100%; min-width: 0; }
.unit-field { position: relative; display: block; min-width: 0; }
.unit-field input { padding-right: 32px; }
.unit { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); pointer-events: none; }
.shine-options { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 6px; }
input[type="number"][aria-invalid="true"] { border-color: var(--red-500); box-shadow: 0 0 0 1px var(--red-500); }
input[type="checkbox"][aria-invalid="true"] { outline: 2px solid var(--red-500); outline-offset: 1px; }
.field-error { margin: 2px 0 0; grid-column: 1 / -1; font-size: 0.75rem; font-weight: 600; color: var(--label-low); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.preview { padding: 14px; border: 2px solid var(--selection); border-radius: 16px;
  transition: opacity var(--duration-entry) var(--ease-out), transform var(--duration-entry) var(--ease-out); }
.diff { margin: 8px 0 0; padding: 0; list-style: none; font-size: 0.8125rem; }
.diff li { display: flex; justify-content: space-between; gap: 10px; }
.impact { display: grid; gap: 6px; margin: 12px 0 8px; }
.impact-row { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "label label" "num delta"; align-items: baseline; gap: 1px 8px; font-size: 0.8125rem; }
.impact-label { grid-area: label; font-size: 0.75rem; color: var(--text-muted); }
.impact-num { grid-area: num; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.impact-row .delta { grid-area: delta; justify-self: start; }
.preview .block-head { flex-wrap: wrap; }
.delta { padding: 1px 8px; border-radius: 999px; font-size: 0.6875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.delta.up { background: var(--green-50); color: var(--green-900); }
.delta.down { background: var(--tint-low); color: var(--label-low); }
.delta.flat { background: var(--mist); color: var(--text-muted); }
.warn { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--tint-orange-side); color: var(--label-orange-side); font-size: 0.75rem; font-weight: 600; }

.insights { display: grid; gap: 20px; min-width: 0; }
.insights > * { min-width: 0; }
.chart-head { display: grid; gap: 8px; }
.legend { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.6875rem; color: var(--text-muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.dot.both { background: var(--green-500); } .dot.orange { background: var(--amber-400); } .dot.apple { background: var(--orange-500); } .dot.low { background: var(--red-500); }
.dot.ctx { background: #c9cfdc; } .dot.hollow { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--text-muted); } .dot.selected { background: var(--navy-900); }
.plane-scroll { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; border-radius: 12px; }
/* The drawing, the callout's button and the card in the plane share the stage's box, so one scale maps between them (B-203). */
.plane-stage { position: relative; width: 100%; max-width: 760px; margin: 6px auto 0; }
.plane { display: block; width: 100%; height: auto; overflow: visible; }
.scroll-hint { display: none; }
.plane text { font-family: var(--font-ui); }
.q-both { fill: var(--tint-both); } .q-orange { fill: var(--tint-orange-side); } .q-apple { fill: var(--tint-apple-side); } .q-low { fill: var(--tint-low); }
.guide { stroke: #fff; stroke-width: 1; stroke-dasharray: 2 3; }
.midline { stroke: var(--card); stroke-width: 3; }
.qlabel { font-size: 14px; font-weight: 600; }
.qlabel.both { fill: var(--label-both); } .qlabel.orange { fill: var(--label-orange-side); } .qlabel.apple { fill: var(--label-apple-side); } .qlabel.low { fill: var(--label-low); }
.tick { font-size: 14px; fill: var(--text-axis); font-variant-numeric: tabular-nums; }
.axis-title { font-size: 14px; font-weight: 700; fill: var(--navy-900); }
.d { transform: translate(var(--x), var(--y)) scale(var(--s, 1)); transition: transform var(--duration-panel) var(--ease-out); stroke-width: 1.5; }
.d[data-other] { cursor: pointer; }
.d.ctx { fill: #c9cfdc; opacity: 0.6; pointer-events: none; }
.d.ctx.hollow { fill: var(--card); stroke: #b8bfce; stroke-width: 1; }
.d.both { fill: var(--green-500); stroke: var(--label-both); } .d.orange { fill: var(--amber-400); stroke: var(--label-orange-side); }
.d.apple { fill: var(--orange-500); stroke: var(--label-apple-side); } .d.low { fill: var(--red-500); stroke: var(--label-low); }
.d.hollow:not(.ctx) { fill: var(--card); }
.d.selected { --s: 1.3; fill: var(--selection); stroke: var(--surface-card); }
.callout { pointer-events: none; transform-box: fill-box; transform-origin: center; transition: transform var(--duration-press) var(--ease-out); }
.callout rect { fill: var(--selection); stroke: var(--surface-card); stroke-width: 1.5; transition: fill var(--duration-small) var(--ease-out); }
.selection-leader { stroke: var(--selection); stroke-width: 1.5; pointer-events: none; }
.c1 { font-size: 15px; font-weight: 700; fill: var(--selection-text); }
.c2 { font-size: 14px; fill: var(--selection-text); font-variant-numeric: tabular-nums; }
.c-chev { fill: none; stroke: var(--selection-text); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
/* The callout is drawn in the plane's image; this transparent native button over it is what takes the click and the focus. */
.callout-hit { position: absolute; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.callout-hit:focus-visible { outline: 2px solid var(--blue-700); outline-offset: 2px; }
.plane-stage:has(.callout-hit:active) .callout { transform: scale(0.97); }
/* The card grows out of the point that faces its dot (`transform-origin` from `place`) and leaves faster than it came. */
.plane-pop { position: absolute; z-index: 2; display: flex; flex-direction: column; border: 1px solid var(--track); border-radius: 14px; background: var(--surface-card);
  box-shadow: 0 1px 2px rgb(12 29 82 / 0.06), 0 18px 36px -18px rgb(12 29 82 / 0.32); overflow: hidden;
  transition-property: opacity, transform, display; transition-duration: var(--duration-entry); transition-timing-function: var(--ease-out); transition-behavior: allow-discrete; }
.plane-pop[hidden] { display: none; opacity: 0; transform: scale(0.96); transition-duration: var(--duration-small); }
.plane-pop:focus-visible { outline: 2px solid var(--blue-700); outline-offset: -2px; }
.plane-pop-body { min-height: 0; margin: 0; padding: 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; }
.plane-pop .cand-card { border: 0; border-radius: 0; }
.plane-pop .cand-card:has(.pair-toggle:focus-visible) { outline-offset: -3px; }
.plane-pop .pair-head { padding-right: 30px; }
.pop-close { position: absolute; top: 8px; right: 8px; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: var(--surface-card); color: var(--text-muted); cursor: pointer;
  transition: transform var(--duration-press) var(--ease-out), background-color var(--duration-small) var(--ease-out); }
.pop-close:active { transform: scale(0.97); }
.selection-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: var(--mist); font-size: 0.8125rem; }
.selection-controls label { font-weight: 700; color: var(--selection); }
/* The actions stay together at the right end, so the introduction is always last, wherever the bar wraps. */
.selection-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }
/* On the mist bar, the control fill would vanish; white with a hairline keeps "Explain in chat" a button. */
.selection-actions .btn-secondary { background: var(--surface-card); box-shadow: inset 0 0 0 1px var(--track); }
/* Pointer note (design-system.md): the arrow's tip lands under the bar's last button. It arrives 400ms after the columns,
   as its own event, and rises towards the button; leaving, it fades faster and the space closes. */
.intro-nudge { display: flex; justify-content: flex-end; align-items: flex-end; gap: 2px; margin: 2px 0 -6px; padding-right: 88px; pointer-events: none; user-select: none;
  transition-property: opacity, transform, display; transition-duration: var(--duration-medium); transition-timing-function: var(--ease-out);
  transition-delay: 400ms; transition-behavior: allow-discrete; }
.intro-nudge[hidden] { display: none; opacity: 0; transform: translateY(6px); transition-duration: var(--duration-small); transition-delay: 0ms; }
.nudge-note { padding-bottom: 4px; font-family: var(--font-hand); font-weight: 600; font-size: 1.25rem; line-height: 1; color: var(--ink-hand); transform: rotate(-4deg); }
.nudge-arrow { flex: none; color: var(--stroke-hand); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; }
.pref-row { padding: 8px 0; border-bottom: 1px solid var(--track); }
.pref-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label count" "want want"; align-items: baseline; gap: 0 10px; font-size: 0.8125rem; }
.pref-label { grid-area: label; color: var(--text-strong); }
.pref-want { grid-area: want; font-size: 0.75rem; color: var(--text-muted); }
.pref-count { grid-area: count; font-weight: 600; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.stack { position: relative; height: 8px; margin-top: 6px; border-radius: 999px; background: var(--tint-low); overflow: hidden; }
.stack i { position: absolute; inset: 0; border-radius: inherit; transition: transform var(--duration-medium) var(--ease-out); }
.stack-met { background: var(--green-500); transform: translateX(calc((var(--met) - 1) * 100%)); }
.stack-unknown { background: repeating-linear-gradient(135deg, var(--slate-500) 0 2px, rgb(102 115 170 / 0.25) 2px 5px); transform: translateX(calc((var(--seen) - 1) * 100%)); }
.stack-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 0.6875rem; color: var(--text-muted); }
.stack-key li { display: flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 8px; border-radius: 999px; }
.swatch.met { background: var(--green-500); } .swatch.unknown { background: repeating-linear-gradient(135deg, var(--slate-500) 0 2px, rgb(102 115 170 / 0.25) 2px 5px); } .swatch.unmet { background: var(--tint-low); box-shadow: inset 0 0 0 1px var(--label-low); }
.advice-lead { margin: 8px 0 0; font-size: 0.875rem; }
.advice-block h3 { margin: 14px 0 6px; font-size: 0.8125rem; font-weight: 700; color: var(--text-strong); }
.close-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.close-list li { display: flex; align-items: center; gap: 10px; font-size: 0.8125rem; color: var(--text-muted); }
.chip-btn { padding: 2px 10px; border: 1px solid var(--selection); border-radius: 999px; background: var(--surface-card); font: inherit; font-size: 0.75rem; font-weight: 700;
  color: var(--selection); cursor: pointer; transition: transform var(--duration-press) var(--ease-out), background-color var(--duration-small) var(--ease-out); }
.suggestions { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.suggestion { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--ai-surface); }
.num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ai-ink); color: #fff; font-size: 0.75rem; font-weight: 700; }
.suggestion p { margin: 0; }
.suggestion-name { font-size: 0.875rem; font-weight: 700; color: var(--text-strong); }
.suggestion .suggestion-effect { margin-top: 2px; font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.suggestion .suggestion-effect.has-loss { color: var(--label-low); }
.foot { margin-top: 24px; font-size: 0.75rem; color: var(--text-subtle); }

@starting-style {
  .msg:not(.settled) { opacity: 0; transform: translateY(6px); }
  .preview { opacity: 0; transform: translateY(8px); }
  .cand-detail { opacity: 0; transform: translateY(-4px); }
  .stack-met, .stack-unknown { transform: translateX(-100%); }
  .intro-nudge { opacity: 0; transform: translateY(6px); }
  .plane-pop { opacity: 0; transform: scale(0.96); }
}
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--navy-800); }
  .btn-secondary:hover, .prompt:hover { background: var(--track); }
  .cand-card:has(.pair-summary:hover) { border-color: var(--slate-500); }
  .d[data-other]:not(.selected):hover { --s: 1.6; }
  .nav-link:hover { background: var(--mist); color: var(--text-strong); }
  .plane-stage:has(.callout-hit:hover) .callout rect { fill: var(--navy-800); }
  .pop-close:hover { background: var(--mist); color: var(--text-strong); }
}
@media (prefers-reduced-motion: reduce) {
  .msg:not(.settled), .preview { transition: opacity var(--duration-small) linear; }
  @starting-style { .msg:not(.settled), .preview, .cand-detail, .intro-nudge, .plane-pop { transform: none; } }
  .cand-detail, .plane-pop { transition-property: opacity, display; transition-duration: var(--duration-small); transition-timing-function: linear; }
  .cand-detail[hidden], .intro-nudge[hidden], .plane-pop[hidden] { transform: none; }
  .intro-nudge { transition-property: opacity, display; }
  .d, .stack i, .chev, .pair-summary, .callout { transition: none; }
  .btn, .prompt, .chip-btn, .nav-link, .pop-close { transition: background-color var(--duration-small) linear; }
  .btn:active, .prompt:active, .chip-btn:active, .cand-card:has(.pair-toggle:active) .pair-summary, .nav-link:active,
  .plane-stage:has(.callout-hit:active) .callout, .pop-close:active { transform: none; }
}
@media (max-width: 1479px) {
  .columns { grid-template-columns: minmax(340px, 1fr) minmax(520px, 1.25fr); grid-template-areas: "chat insights" "profile insights"; }
  .chat { grid-area: chat; position: static; height: 640px; min-height: 0; }
  .profile { grid-area: profile; }
  .insights { grid-area: insights; }
}
/* The rail is 80px so the two columns keep their 880px down to 1000px: 1000 - 80 - 2 × 20 of padding. */
@media (max-width: 1159px) {
  .shell { grid-template-columns: 80px minmax(0, 1fr); }
  .sidebar { gap: 16px; padding: 14px 8px; }
  .brand { justify-content: center; }
  .brand-mark { width: 48px; height: 48px; }
  .brand-text, .nav-caption, .side-art { display: none; }
  .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav-short { display: block; }
  .nav-link { flex-direction: column; gap: 4px; padding: 9px 2px; font-size: 0.6875rem; font-weight: 600; text-align: center; }
  /* On the rail the count sits on the icon's top right, as a badge, so the short label keeps its line. */
  .nav-count { position: absolute; top: 4px; left: calc(50% + 4px); min-width: 18px; padding: 0 5px; font-size: 0.625rem; }
  .nav-more { margin-top: 6px; padding-top: 6px; }
  .main { padding: 20px; }
}
@media (max-width: 999px) {
  .columns { grid-template-columns: minmax(0, 1fr); grid-template-areas: "chat" "profile" "insights"; }
}
@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; overflow: visible; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 16px;
    border-right: 0; border-bottom: 1px solid var(--track); }
  .side-nav, .nav-list, .nav-more { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav-more { margin: 0; padding: 0; border-top: 0; }
  .nav-link { flex-direction: row; gap: 6px; padding: 8px 10px; font-size: 0.8125rem; }
  .nav-count { position: static; margin-left: 2px; }
  .main { padding: 16px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .identity { flex-wrap: wrap; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .chat { height: 600px; }
}
/* The full sidebar needs about 721px with its art (measured at 1440 × 801); below that, the art gives way to the entries. */
@media (max-height: 729px) {
  .side-art { display: none; }
}
/* The plane keeps 560px so its text stays near 12px; the region scrolls sideways instead, as WCAG 1.4.10 allows for charts. */
@media (max-width: 599px) {
  .plane-stage { min-width: 560px; }
  .scroll-hint { display: block; }
  /* Stacked, the two actions fill the bar instead of hanging right-aligned in two widths. */
  .selection-actions { flex: 1 1 100%; }
  .selection-actions .btn { flex: 1 1 auto; }
}
