/* FilPolMap — sistema de diseño "graphite".
   Tokens en :root (tema oscuro grafito por defecto) y [data-theme="light"] (paper-graphite).
   Superficies en capas con degradados mínimos y bordes de 1px; un único acento (iris). */

/* ============ Tokens ============ */
:root,
:root[data-theme="dark"] {
  --bg: #0e0f11;
  --bg-2: #121316;
  --surface: #17181b;
  --surface-2: #1d1e22;
  --surface-3: #25262b;
  --sheen: rgba(255, 255, 255, .035);
  --highlight: rgba(255, 255, 255, .055);
  --border: rgba(255, 255, 255, .075);
  --border-strong: rgba(255, 255, 255, .13);
  --text: #ecebe7;
  --text-2: #c5c3be;
  --muted: #8f8d88;
  --accent: #a9b4ff;
  --accent-strong: #c4cbff;
  --accent-soft: rgba(169, 180, 255, .12);
  --accent-line: rgba(169, 180, 255, .38);
  --accent-contrast: #0e0f11;
  --neg: #e3a27f;
  --pos: #a9b4ff;
  --focus: #c4cbff;

  --map-bg: #111215;
  --map-bg-2: #15161a;
  --map-grid: rgba(255, 255, 255, .03);
  --map-grid-strong: rgba(255, 255, 255, .055);
  --map-axis: rgba(255, 255, 255, .26);
  --map-frame: rgba(255, 255, 255, .09);
  --map-quad-a: rgba(255, 255, 255, .014);
  --map-quad-b: rgba(255, 255, 255, 0);
  --map-quad-text: rgba(236, 235, 231, .34);
  --map-pill: rgba(21, 22, 25, .9);
  --map-pill-border: rgba(255, 255, 255, .09);
  --map-halo: rgba(17, 18, 21, .92);
  --map-vignette: rgba(0, 0, 0, .38);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 10px 28px -10px rgba(0, 0, 0, .65), 0 2px 6px rgba(0, 0, 0, .3);
  --shadow-3: 0 30px 70px -18px rgba(0, 0, 0, .75), 0 8px 20px -6px rgba(0, 0, 0, .45);
  --glass: rgba(23, 24, 27, .72);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f2ee;
  --bg-2: #eeede8;
  --surface: #fbfaf7;
  --surface-2: #f1f0eb;
  --surface-3: #e7e5df;
  --sheen: rgba(255, 255, 255, .7);
  --highlight: rgba(255, 255, 255, .9);
  --border: rgba(24, 24, 27, .09);
  --border-strong: rgba(24, 24, 27, .16);
  --text: #1a1a1c;
  --text-2: #3b3b3f;
  --muted: #65645f;
  --accent: #3e4bc0;
  --accent-strong: #2f3aa3;
  --accent-soft: rgba(62, 75, 192, .085);
  --accent-line: rgba(62, 75, 192, .35);
  --accent-contrast: #ffffff;
  --neg: #b4552d;
  --pos: #3e4bc0;
  --focus: #3e4bc0;

  --map-bg: #f2f1ed;
  --map-bg-2: #ecebe6;
  --map-grid: rgba(30, 30, 34, .04);
  --map-grid-strong: rgba(30, 30, 34, .075);
  --map-axis: rgba(30, 30, 34, .32);
  --map-frame: rgba(30, 30, 34, .12);
  --map-quad-a: rgba(30, 30, 34, .022);
  --map-quad-b: rgba(30, 30, 34, 0);
  --map-quad-text: rgba(40, 40, 44, .4);
  --map-pill: rgba(251, 250, 247, .93);
  --map-pill-border: rgba(24, 24, 27, .1);
  --map-halo: rgba(246, 245, 242, .94);
  --map-vignette: rgba(90, 80, 60, .07);

  --shadow-1: 0 1px 2px rgba(30, 28, 24, .07);
  --shadow-2: 0 10px 28px -12px rgba(30, 28, 24, .22), 0 2px 6px rgba(30, 28, 24, .06);
  --shadow-3: 0 30px 70px -20px rgba(30, 28, 24, .3), 0 8px 20px -8px rgba(30, 28, 24, .12);
  --glass: rgba(251, 250, 247, .76);
  color-scheme: light;
}
:root {
  --font: "Inter", "Inter var", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --ease: cubic-bezier(.22, .72, .18, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --t1: .14s;
  --t2: .24s;
  --t3: .42s;
  --header-h: 58px;
  --maxw: 1120px;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 75% -10%, var(--sheen), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 400 15.5px/1.6 var(--font);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.num, .count, .near-pct, .lg-count { font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-contrast);
  padding: 8px 14px; border-radius: var(--r-sm); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 8px; }

/* ============ Cabecera ============ */
.site-header {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 max(20px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -.015em; font-size: 15.5px; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-mark .bm-bg { fill: var(--surface-2); stroke: var(--border-strong); }
.brand-mark .bm-axis { stroke: var(--muted); stroke-width: 1.3; stroke-linecap: round; opacity: .7; }
.brand-mark .bm-sub { fill: var(--muted); }
.brand-mark .bm-dot { fill: var(--accent); }
.site-nav {
  display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none;
  padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--highlight);
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  color: var(--muted); text-decoration: none; padding: 5px 13px; border-radius: 9px; font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: color var(--t1), background var(--t1);
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-3); box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-1); }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 1px solid var(--border); background: var(--surface); border-radius: 10px; cursor: pointer; color: var(--text-2);
  box-shadow: inset 0 1px 0 var(--highlight);
  transition: background var(--t1), color var(--t1), border-color var(--t1), transform var(--t1);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(.96); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }

main { flex: 1; outline: none; }
.loading { padding: 120px 16px; text-align: center; color: var(--muted); display: flex; gap: 12px; justify-content: center; align-items: center; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.site-footer { padding: 28px 16px 36px; color: var(--muted); font-size: 12.5px; text-align: center; border-top: 1px solid var(--border); }
.site-footer p { margin: 0 auto; max-width: 720px; }

/* ============ Botones ============ */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, var(--sheen), transparent), var(--surface-2);
  color: var(--text); box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-1);
  text-decoration: none; font-weight: 550; font-size: 14.5px; letter-spacing: -.005em; cursor: pointer;
  transition: background var(--t1), border-color var(--t1), transform var(--t1), box-shadow var(--t1), color var(--t1);
}
.btn:hover { background: linear-gradient(180deg, var(--sheen), transparent), var(--surface-3); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 60%), var(--accent);
  border-color: transparent; color: var(--accent-contrast);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 18px -6px var(--accent-line), var(--shadow-1);
}
.btn-primary:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 60%), var(--accent-strong); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 15px; border-radius: 13px; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13.5px; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.btn .arrow { transition: transform var(--t2) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.link-btn {
  background: none; border: 0; padding: 4px 2px; color: var(--accent); cursor: pointer; font-size: 13.5px;
  text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px;
}
.link-btn:hover { text-decoration-color: currentColor; }

.chip {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-size: 12px; font-weight: 550; border: 1px solid var(--accent-line);
}
.chip.muted { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; vertical-align: middle; margin-right: 7px; background: var(--c, var(--muted)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--muted)) 18%, transparent); }
.sw.lg { width: 12px; height: 12px; }

/* ============ Páginas ============ */
.view-page { max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 64px; width: 100%; animation: view-in var(--t3) var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: .14em; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--accent); }
.lead { font-size: 17.5px; line-height: 1.6; color: var(--text-2); max-width: 60ch; }
.lead.small { font-size: 15px; }

/* Inicio */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 28px 0 40px; }
.hero h1 {
  font-size: clamp(34px, 5.2vw, 60px); line-height: 1.03; letter-spacing: -.035em; font-weight: 650; margin-bottom: 22px;
  background: linear-gradient(180deg, var(--text) 30%, color-mix(in srgb, var(--text) 62%, var(--muted)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 30px 0 18px; }
.data-status { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.hero-visual {
  position: relative; display: block; aspect-ratio: 1 / 1; border-radius: var(--r-xl); overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, var(--surface-2), var(--map-bg) 70%);
  border: 1px solid var(--border-strong); box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-3);
  transition: transform var(--t3) var(--ease), box-shadow var(--t3) var(--ease), border-color var(--t3);
}
.hero-visual:hover { transform: translateY(-3px); border-color: var(--accent-line); }
.hero-visual svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-visual .hv-cta {
  position: absolute; right: 14px; bottom: 14px; font-size: 12.5px; font-weight: 550; color: var(--text-2);
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong); padding: 6px 12px; border-radius: 999px;
}
.hv-grid { stroke: var(--map-grid-strong); stroke-width: 1; }
.hv-axis { stroke: var(--map-axis); stroke-width: 1; }
.hv-frame { fill: none; stroke: var(--map-frame); }
.hv-label { font: 600 11px var(--font); paint-order: stroke; stroke: var(--map-bg); stroke-width: 3.5px; stroke-linejoin: round; }
.hv-pole { font: 600 9.5px var(--font); letter-spacing: .12em; fill: var(--muted); text-transform: uppercase; }
.hv-dot { animation: hv-pop .7s var(--ease) both; transform-box: fill-box; transform-origin: center; }
@keyframes hv-pop { from { opacity: 0; transform: scale(.3); } }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; margin: 0; }
.section-head p { margin: 0; font-size: 14px; }
.axes-intro { margin: 24px 0 8px; }
.axes-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; counter-reset: ax; }
.axes-list li {
  position: relative; counter-increment: ax;
  background: linear-gradient(180deg, var(--sheen), transparent 70%), var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 16px 14px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: inset 0 1px 0 var(--highlight);
  transition: border-color var(--t2), transform var(--t2) var(--ease);
}
.axes-list li:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.axes-list li::before { content: counter(ax, decimal-leading-zero); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.axes-list strong { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.ax-poles { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.ax-poles span:last-child { text-align: right; }
.ax-track { width: 46px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--neg), var(--border-strong) 50%, var(--pos)); }

.notice {
  margin-top: 32px; padding: 16px 18px; border-radius: var(--r-lg); border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 13.5px; line-height: 1.6;
}
.notice strong { color: var(--text-2); font-weight: 600; }
.empty, .empty-state { color: var(--muted); }
.empty-state { text-align: center; padding: 80px 0; }
.empty-state h1 { color: var(--text); font-size: 30px; }
.empty-state .btn { margin: 4px; }

/* ============ Test ============ */
.view#view-test { max-width: 780px; }
.test-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; }
.progress-wrap { flex: 1 1 260px; }
.progress { height: 3px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress span {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 50%, transparent), var(--accent));
  box-shadow: 0 0 12px var(--accent-line);
  transition: width var(--t3) var(--ease);
}
.progress-text { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 11px; padding: 3px; background: var(--surface); box-shadow: inset 0 1px 0 var(--highlight); }
.segmented button { border: 0; background: none; padding: 5px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 500; transition: color var(--t1), background var(--t1); }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-1); }
.block-meta { color: var(--muted); font-size: 13px; letter-spacing: .02em; }
.q-card {
  position: relative;
  background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl); padding: 32px 32px 28px;
  box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-2); margin-bottom: 16px;
}
.test-body.single .q-card { animation: q-in var(--t3) var(--ease) both; }
.test-body.single.back .q-card { animation-name: q-in-back; }
@keyframes q-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes q-in-back { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.q-card.skipped { opacity: .8; }
.q-meta { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 16px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.q-text { font-size: clamp(21px, 3vw, 28px); font-weight: 550; line-height: 1.3; letter-spacing: -.022em; margin-bottom: 30px; outline: none; text-wrap: balance; }
h3.q-text { font-size: clamp(18px, 2.4vw, 21px); margin-bottom: 22px; }

/* Escala Likert: cinco puntos sobre una línea, tamaño creciente hacia los extremos */
.likert { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.likert::before {
  content: ""; position: absolute; left: 10%; right: 10%; top: 31px; height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--neg) 55%, transparent), var(--border-strong) 50%, color-mix(in srgb, var(--pos) 55%, transparent));
}
.lk {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 4px 12px;
  border: 1px solid transparent; background: none; border-radius: var(--r-md); cursor: pointer; text-align: center; color: var(--text-2);
  transition: background var(--t1), border-color var(--t1), color var(--t1);
}
.lk:hover { background: var(--surface-2); color: var(--text); }
.lk-dot {
  --d: 22px; width: var(--d); height: var(--d); margin: calc((34px - var(--d)) / 2) 0; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--muted);
  transition: transform var(--t2) var(--ease), background var(--t1), border-color var(--t1), box-shadow var(--t2);
}
.lk-0 .lk-dot, .lk-4 .lk-dot { --d: 34px; }
.lk-1 .lk-dot, .lk-3 .lk-dot { --d: 27px; }
.lk-0 .lk-dot, .lk-1 .lk-dot { border-color: color-mix(in srgb, var(--neg) 80%, transparent); }
.lk-3 .lk-dot, .lk-4 .lk-dot { border-color: color-mix(in srgb, var(--pos) 80%, transparent); }
.lk:hover .lk-dot { transform: scale(1.08); }
.lk-label { font-size: 12.5px; line-height: 1.25; font-weight: 500; }
.lk[aria-checked="true"] { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.lk[aria-checked="true"] .lk-label { font-weight: 600; }
.lk[aria-checked="true"] .lk-dot { background: var(--text-2); border-color: var(--text-2); box-shadow: inset 0 0 0 4px var(--surface), 0 0 0 4px color-mix(in srgb, var(--text-2) 15%, transparent); }
.lk-0[aria-checked="true"] .lk-dot, .lk-1[aria-checked="true"] .lk-dot { background: var(--neg); border-color: var(--neg); box-shadow: inset 0 0 0 4px var(--surface), 0 0 0 5px color-mix(in srgb, var(--neg) 20%, transparent); }
.lk-3[aria-checked="true"] .lk-dot, .lk-4[aria-checked="true"] .lk-dot { background: var(--pos); border-color: var(--pos); box-shadow: inset 0 0 0 4px var(--surface), 0 0 0 5px color-mix(in srgb, var(--pos) 20%, transparent); }
.choice { display: flex; flex-direction: column; gap: 8px; }
.choice-opt {
  display: flex; gap: 12px; align-items: center; text-align: left; padding: 13px 15px; border: 1px solid var(--border);
  background: var(--bg-2); border-radius: var(--r-md); cursor: pointer; transition: border-color var(--t1), background var(--t1);
}
.choice-opt:hover { border-color: var(--border-strong); background: var(--surface-2); }
.radio-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--muted); flex: none; transition: all var(--t1); }
.choice-opt[aria-checked="true"] { border-color: var(--accent-line); background: var(--accent-soft); font-weight: 550; }
.choice-opt[aria-checked="true"] .radio-dot { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface); background: var(--accent); }
.test-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.test-nav .spacer { flex: 1; }
.test-extra { width: 100%; display: flex; gap: 18px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.kbd-hint { font-size: 12px; color: var(--muted); }
kbd, .kbd {
  font: 500 11px var(--font); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 -1px 0 var(--border);
}

/* ============ Resultado ============ */
.result-head { margin-bottom: 28px; max-width: 860px; }
.result-head h1 { font-size: clamp(28px, 4.2vw, 44px); letter-spacing: -.03em; line-height: 1.08; }
.hl { color: var(--hl); }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card {
  background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl); padding: 22px; min-width: 0;
  box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-2);
  animation: view-in var(--t3) var(--ease) both;
}
.result-grid .card:nth-child(2) { animation-delay: .05s; }
.result-grid .card:nth-child(3) { animation-delay: .1s; }
.result-grid .card:nth-child(4) { animation-delay: .15s; }
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-bottom: 16px; }
.radar { width: 100%; height: auto; max-height: 440px; display: block; overflow: visible; }
.rd-ring { fill: none; stroke: var(--border-strong); stroke-width: 1; }
.rd-ring.zero { stroke: var(--muted); stroke-dasharray: 2 4; opacity: .7; }
.rd-spoke { stroke: var(--border); }
.rd-label { fill: var(--text); font-size: 12.5px; }
.rd-name { font-weight: 600; }
.rd-pole { fill: var(--muted); font-size: 11px; }
.rd-scale { fill: var(--muted); font-size: 10px; }
.radar polygon:not(.rd-ring) { transform-origin: 0 0; animation: rd-grow .9s var(--ease) both; }
.radar polygon:not(.rd-ring):last-of-type { animation-delay: .12s; }
.radar circle { animation: rd-fade .5s .6s var(--ease) both; }
@keyframes rd-grow { from { transform: scale(.15); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rd-fade { from { opacity: 0; } }
.radar.no-anim polygon, .radar.no-anim circle { animation: none; }
.legend-line { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 10px 0 4px; flex-wrap: wrap; color: var(--text-2); }
.legend-line .sw { border-radius: 2px; width: 16px; height: 3px; box-shadow: none; }
.legend-line .sw.dashed { background: none; border-top: 2px dashed var(--muted); height: 0; margin-left: 14px; }
.near-list, .thinker-list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 6px; }
.near-list li { display: flex; align-items: center; gap: 6px; }
.near-item, .thinker-item {
  flex: 1; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--bg-2); cursor: pointer; text-align: left; color: var(--text); text-decoration: none; min-width: 0;
  transition: border-color var(--t1), background var(--t1), transform var(--t1);
}
.near-item:hover, .thinker-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.near-item[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); }
.near-rank { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--surface-3); font-size: 12px; font-weight: 600; flex: none; font-variant-numeric: tabular-nums; color: var(--text-2); }
.near-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.near-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.near-fam { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; }
.near-pct { font-weight: 600; display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.meter { width: 60px; height: 4px; background: var(--surface-3); border-radius: 9px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: inherit; animation: meter-in .9s var(--ease) both; transform-origin: left; }
@keyframes meter-in { from { transform: scaleX(0); } }
.near-map { font-size: 12.5px; padding: 6px; white-space: nowrap; text-decoration: none; color: var(--muted); }
.near-map:hover { color: var(--accent); }

.axis-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.axis-bars.compact { gap: 10px; }
.ab-labels { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); gap: 6px; }
.ab-labels strong { color: var(--text); font-size: 12.5px; font-weight: 600; }
.ab-labels span:last-child { text-align: right; }
.ab-track { position: relative; height: 6px; background: var(--surface-3); border-radius: 9px; margin-top: 6px; }
.ab-track::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--muted); opacity: .5; }
.ab-fill { position: absolute; top: 0; bottom: 0; background: var(--pos); opacity: .55; border-radius: 9px; }
.ab-fill.neg { background: var(--neg); }
.ab-dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--text); border: 2px solid var(--surface); box-shadow: var(--shadow-1); }
.ab-cmp { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--accent); border-radius: 2px; box-shadow: 0 0 6px var(--accent-line); }
.compact .ab-track { height: 5px; }
.sw-line { display: inline-block; width: 2px; height: 12px; background: var(--accent); vertical-align: middle; margin-right: 4px; border-radius: 2px; }

.avatar {
  position: relative; width: var(--size); height: var(--size); border-radius: 50%; flex: none; overflow: hidden;
  background: var(--avatar-bg); display: inline-grid; place-items: center; color: #fff;
  box-shadow: 0 0 0 1px var(--border-strong);
}
.avatar-ini { font-weight: 600; font-size: calc(var(--size) * .36); letter-spacing: .02em; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }

/* ============ Mapa ============ */
body.map-mode { height: 100dvh; overflow: hidden; }
body.map-mode .site-footer { display: none; }
body.map-mode main { display: flex; min-height: 0; }
.view-map { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; width: 100%; }
.map-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--map-bg); isolation: isolate; }
#map-canvas { position: absolute; inset: 0; display: block; touch-action: none; cursor: grab; outline: none; }
#map-canvas.dragging { cursor: grabbing; }
#map-canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }

.glass {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-2);
}

.map-toolbar {
  position: absolute; top: 12px; left: 12px; right: 12px; z-index: 6;
  display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 15px; flex-wrap: wrap;
}
.tb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 12px;
  border: 1px solid transparent; background: transparent; border-radius: 10px; cursor: pointer; color: var(--text-2);
  font-size: 13.5px; font-weight: 550; transition: background var(--t1), color var(--t1), border-color var(--t1), transform var(--t1);
}
.tb-btn:hover { background: var(--surface-3); color: var(--text); }
.tb-btn:active { transform: scale(.96); }
.tb-btn[aria-expanded="true"] { background: var(--surface-3); color: var(--text); border-color: var(--border); }
.tb-btn.icon { width: 36px; padding: 0; }
.tb-btn.icon.sm { width: 28px; height: 28px; }
.tb-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.map-search { position: relative; flex: 1 1 240px; max-width: 440px; }
.search-ico { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; margin-top: -8px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.map-search input {
  width: 100%; height: 36px; padding: 0 34px 0 34px; border-radius: 10px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 60%, transparent); color: var(--text); font-size: 14px;
  transition: border-color var(--t1), background var(--t1), box-shadow var(--t2);
}
.map-search input::placeholder { color: var(--muted); }
.map-search input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.map-search input::-webkit-search-cancel-button { display: none; }
.search-kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.map-search input:focus ~ .search-kbd { opacity: 0; }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 20; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-3);
  max-height: 60vh; overflow: auto; animation: pop-in var(--t2) var(--ease) both;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.985); } }
.search-results li { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 9px; cursor: pointer; }
.search-results li.active, .search-results li:hover { background: var(--surface-3); }
.sr-sw { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); }
.sr-sw::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.sr-name { flex: 1; font-weight: 550; font-size: 14px; letter-spacing: -.005em; }
.sr-kind { font-size: 12px; color: var(--muted); }
.sr-empty { color: var(--muted); cursor: default !important; }
.map-proj { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; margin-left: auto; min-width: 0; }
.map-proj select {
  height: 36px; border-radius: 10px; border: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 60%, transparent);
  padding: 0 28px 0 11px; max-width: 220px; font-size: 13px; color: var(--text-2); cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23888' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 12px;
  transition: border-color var(--t1);
}
.map-proj select:hover { border-color: var(--border-strong); color: var(--text); }
.map-proj select option { background: var(--surface); color: var(--text); }
.proj-axes { display: inline-flex; gap: 4px; align-items: center; min-width: 0; }

.map-axis-info {
  position: absolute; left: 12px; top: 70px; z-index: 3; pointer-events: none;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--muted);
  max-width: min(640px, calc(100% - 24px));
  background: color-mix(in srgb, var(--map-bg) 70%, transparent); padding: 5px 10px; border-radius: 9px; border: 1px solid var(--border);
}
.map-axis-info .ai-k { color: var(--text-2); font-weight: 600; }
.map-axis-info b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.map-axis-info .ai-sep { width: 1px; height: 12px; background: var(--border-strong); margin: 0 4px; }

/* Marcador "Tú estás aquí" (DOM sobre el canvas; el halo pulsa con CSS, sin repintar el canvas) */
.me-marker { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; will-change: transform; }
.me-pulse {
  position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-line) 0%, transparent 70%);
  border: 1px solid var(--accent-line);
  animation: me-pulse 2.6s var(--ease) infinite;
}
.me-pulse.d2 { animation-delay: 1.3s; }
@keyframes me-pulse { 0% { transform: scale(.35); opacity: .9; } 100% { transform: scale(1.45); opacity: 0; } }
.me-tag {
  position: absolute; left: 0; bottom: 18px; transform: translateX(-50%); white-space: nowrap;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em; color: var(--accent-contrast);
  background: linear-gradient(180deg, rgba(255, 255, 255, .2), transparent), var(--accent);
  padding: 4px 10px; border-radius: 999px; box-shadow: 0 6px 18px -4px var(--accent-line), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.me-tag::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; margin-left: -4px; background: var(--accent); transform: rotate(45deg); border-radius: 1px; z-index: -1; }

/* Tooltip */
.map-tooltip {
  position: absolute; left: 0; top: 0; z-index: 8; pointer-events: none;
  translate: var(--tx, 0) var(--ty, 0); scale: .96; opacity: 0;
  transition: opacity var(--t1) var(--ease), scale var(--t1) var(--ease);
  display: flex; gap: 10px; align-items: center; max-width: 300px;
  background: var(--glass); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--border-strong); border-radius: 12px; padding: 9px 12px 9px 10px;
  box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-3); font-size: 13px;
}
.map-tooltip.show { opacity: 1; scale: 1; }
.tt-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.tt-main strong { font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.tt-sub { color: var(--muted); font-size: 12px; }
.tt-sw { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 50%, transparent); }
.tt-sw::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.tt-rel, .rel-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 3px; }
.tt-meter { width: 46px; height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; display: inline-block; }
.tt-meter i { display: block; height: 100%; border-radius: inherit; }

/* Dock inferior: zoom, nivel de detalle y leyenda */
.map-dock { position: absolute; left: 12px; bottom: 12px; z-index: 5; display: flex; gap: 8px; align-items: stretch; }
.map-zoom { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 13px; }
.dock-sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 3px; }
.map-lod { display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 13px; font-size: 12px; color: var(--muted); min-height: 44px; }
.lod-bars { display: inline-flex; gap: 3px; align-items: flex-end; height: 14px; }
.lod-bars i { width: 3px; border-radius: 2px; background: var(--border-strong); transition: background var(--t2), transform var(--t2) var(--ease); }
.lod-bars i:nth-child(1) { height: 5px; } .lod-bars i:nth-child(2) { height: 7px; } .lod-bars i:nth-child(3) { height: 9px; }
.lod-bars i:nth-child(4) { height: 11px; } .lod-bars i:nth-child(5) { height: 14px; }
.map-lod[data-level="1"] .lod-bars i:nth-child(-n+1),
.map-lod[data-level="2"] .lod-bars i:nth-child(-n+2),
.map-lod[data-level="3"] .lod-bars i:nth-child(-n+3),
.map-lod[data-level="4"] .lod-bars i:nth-child(-n+4),
.map-lod[data-level="5"] .lod-bars i { background: var(--accent); }
.lod-text { display: flex; gap: 5px; align-items: baseline; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lod-text strong { color: var(--text); font-weight: 600; font-size: 13px; }
.map-legend-btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 0 14px; border-radius: 13px; min-height: 44px; cursor: pointer;
  color: var(--text-2); font-size: 13px; font-weight: 550; transition: color var(--t1), border-color var(--t1);
}
.map-legend-btn:hover, .map-legend-btn[aria-expanded="true"] { color: var(--text); border-color: var(--accent-line); }
.legend-dots { display: inline-flex; }
.legend-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 2px var(--surface); }
.legend-dots i + i { margin-left: -3px; }
.map-legend {
  position: absolute; left: 12px; bottom: 66px; z-index: 6; width: 270px; max-height: min(56vh, 520px);
  display: flex; flex-direction: column; border-radius: 16px; padding: 12px 8px 10px 12px;
  animation: pop-in var(--t2) var(--ease) both; transform-origin: bottom left;
}
.legend-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 8px 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.legend-head strong { font-weight: 600; }
.legend-list { list-style: none; margin: 0; padding: 0 4px 0 0; overflow: auto; display: grid; gap: 1px; scrollbar-width: thin; }
.legend-item {
  width: 100%; display: flex; align-items: center; gap: 2px; padding: 5px 6px; border: 0; background: none; border-radius: 8px;
  cursor: pointer; font-size: 13px; color: var(--text-2); text-align: left; transition: background var(--t1), opacity var(--t1);
}
.legend-item:hover { background: var(--surface-3); color: var(--text); }
.legend-item[aria-pressed="false"] { opacity: .42; }
.legend-item[aria-pressed="false"] .lg-name { text-decoration: line-through; text-decoration-color: var(--muted); }
.lg-name { flex: 1; }
.lg-count { font-size: 11.5px; color: var(--muted); }
.legend-keys { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 10px 4px 0; margin-top: 8px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); }
.legend-keys span { display: inline-flex; align-items: center; gap: 6px; }
.lk-pill { width: 18px; height: 9px; border-radius: 9px; border: 1px solid var(--muted); display: inline-block; }
.lk-face { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.legend-keys .lk-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); opacity: .6; display: inline-block; }

.map-disclaimer {
  position: absolute; right: 14px; bottom: 14px; margin: 0; font-size: 11px; color: var(--muted); letter-spacing: .02em;
  pointer-events: none; white-space: nowrap; z-index: 3; opacity: .85;
}

/* Paneles flotantes */
.panel {
  position: absolute; z-index: 10; display: flex; flex-direction: column; min-height: 0;
  background: linear-gradient(180deg, var(--sheen), transparent 120px), var(--surface);
  border: 1px solid var(--border-strong); box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-3);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 14px; margin: 0; letter-spacing: -.005em; }
.panel-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; display: flex; align-items: center; }
.panel-body { overflow: auto; padding: 18px 20px 22px; overscroll-behavior: contain; scrollbar-width: thin; }
.map-filters { left: 12px; top: 70px; bottom: 70px; width: 300px; border-radius: 18px; animation: pop-in var(--t2) var(--ease) both; transform-origin: top left; }
.map-detail {
  right: 12px; top: 70px; bottom: 12px; width: 400px; max-width: calc(100% - 24px); border-radius: 20px;
  transform: translateX(calc(100% + 24px)); opacity: 0;
  transition: transform var(--t3) var(--ease), opacity var(--t2) var(--ease);
}
.map-detail.open { transform: none; opacity: 1; }
.sheet-grip { display: none; }
.detail-title { font-size: 25px; letter-spacing: -.025em; margin: 0 0 6px; line-height: 1.12; }
.detail-meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.detail-lead { color: var(--text-2); line-height: 1.65; }
.detail-person { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.detail-person .detail-meta { margin: 0 0 2px; }
.detail-person .avatar { box-shadow: 0 0 0 1px var(--border-strong), 0 10px 24px -8px rgba(0, 0, 0, .5); }
.map-detail h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 24px 0 10px; font-weight: 600; }
.bullets { padding-left: 0; margin: 0; list-style: none; }
.bullets li { margin: 6px 0; padding-left: 16px; position: relative; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.bullets li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 5px; height: 1px; background: var(--muted); }
.readings li { font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  display: inline-flex; align-items: center; padding: 4px 11px 4px 9px; border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 35%, var(--border));
  background: color-mix(in srgb, var(--c, var(--muted)) 7%, var(--surface)); color: var(--text-2);
  cursor: pointer; font-size: 13px; transition: background var(--t1), border-color var(--t1), color var(--t1);
}
.chip-btn .sw { background: var(--c); width: 7px; height: 7px; margin-right: 7px; box-shadow: none; }
.chip-btn:hover { background: color-mix(in srgb, var(--c, var(--muted)) 16%, var(--surface)); color: var(--text); }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px; }
.person-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 5px; border-radius: 10px; cursor: pointer; text-align: left; font-size: 13.5px; color: var(--text-2); min-width: 0; }
.person-btn span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-btn:hover { background: var(--surface-3); color: var(--text); }
.affinity-line {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--accent-soft); color: var(--text-2); border: 1px solid var(--accent-line);
  padding: 8px 12px; border-radius: 11px; font-size: 13px;
}
.affinity-line strong { color: var(--accent); font-size: 15px; font-variant-numeric: tabular-nums; }
.detail-links { margin-top: 20px; font-size: 14px; }
.near-mini { padding-left: 0; margin: 0; list-style: none; counter-reset: nm; }
.near-mini li { margin: 6px 0; display: flex; align-items: center; gap: 8px; counter-increment: nm; }
.near-mini li::before { content: counter(nm); font-size: 11px; color: var(--muted); width: 14px; font-variant-numeric: tabular-nums; }
.near-mini-pct { margin-left: auto; color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 13px; }
.photo-credit { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }

.map-filters fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.map-filters legend { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; margin-bottom: 8px; padding: 0; }
.check { display: flex; align-items: center; gap: 9px; padding: 5px 4px; cursor: pointer; font-size: 13.5px; border-radius: 7px; color: var(--text-2); }
.check:hover { background: var(--surface-2); color: var(--text); }
.check input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; flex: none; }
.check .sw { margin: 0; box-shadow: none; }
.check .ck-label { flex: 1; }
.check .count { color: var(--muted); font-size: 12px; }
.check-list { max-height: 220px; overflow: auto; padding-right: 4px; scrollbar-width: thin; }
.fs-actions { display: flex; gap: 12px; margin-bottom: 4px; }
.sym { display: inline-block; flex: none; }
.sym-label { width: 22px; height: 11px; border-radius: 6px; border: 1.5px solid var(--muted); }
.sym-label.dashed { border-style: dashed; }
.sym-face { width: 13px; height: 13px; border-radius: 50%; background: var(--muted); margin: 0 4px; }
.sym-line { width: 22px; height: 0; border-top: 1.5px solid var(--muted); }
.sym-line.dashed { border-top-style: dashed; }
.node-index summary { cursor: pointer; font-weight: 550; font-size: 13.5px; margin-bottom: 6px; color: var(--text-2); }
.node-index ul { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow: auto; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong);
  padding: 10px 16px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--shadow-3);
  animation: toast-in var(--t3) var(--ease) both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero-visual { max-width: 560px; aspect-ratio: 4 / 3; }
}
@media (max-width: 860px) {
  .result-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  :root { --header-h: 54px; }
  .site-header { gap: 8px; padding: 0 12px; }
  .brand span { display: none; }
  .site-nav { margin-left: auto; }
  .site-nav a { padding: 5px 9px; font-size: 13.5px; }
  .view-page { padding: 24px 16px 40px; }
  .q-card { padding: 22px 18px 18px; border-radius: 18px; }
  .q-text { margin-bottom: 20px; }
  .likert { grid-template-columns: 1fr; gap: 4px; }
  .likert::before { display: none; }
  .lk { flex-direction: row; gap: 14px; padding: 9px 12px; text-align: left; border-color: var(--border); background: var(--bg-2); }
  .lk-dot, .lk-0 .lk-dot, .lk-4 .lk-dot, .lk-1 .lk-dot, .lk-3 .lk-dot { --d: 20px; margin: 0; }
  .lk-label { font-size: 14.5px; }
  .people { grid-template-columns: 1fr; }

  .map-toolbar { top: 8px; left: 8px; right: 8px; padding: 5px; gap: 4px; border-radius: 13px; }
  .tb-btn span { display: none; }
  #map-filters-btn { width: 36px; padding: 0; }
  .map-search { flex: 1 1 140px; max-width: none; }
  .search-kbd { display: none; }
  .map-proj { width: 100%; margin-left: 0; }
  .map-proj select { flex: 1; min-width: 0; max-width: none; padding-right: 22px; background-position: right 6px center; }
  .proj-axes { flex: 2.4; }
  .proj-axes select { flex: 1; min-width: 0; }
  .map-axis-info { display: none; }
  .map-dock { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); gap: 6px; }
  .map-zoom { padding: 3px; }
  .map-lod { padding: 0 10px; flex: 1; justify-content: center; min-width: 0; }
  .map-lod #map-lod-label { display: none; }
  .map-legend-btn span:last-child { display: none; }
  .map-legend-btn { padding: 0 12px; }
  .map-legend { left: 8px; right: 8px; width: auto; bottom: calc(62px + env(safe-area-inset-bottom)); max-height: 50vh; }
  .map-disclaimer { display: none; }
  .sheet-grip { display: block; width: 38px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: 8px auto 0; flex: none; }
  .map-filters, .map-detail {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .map-filters { max-height: 82%; height: 82%; transform-origin: bottom center; }
  .map-detail { max-height: 62%; transform: translateY(calc(100% + 20px)); opacity: 1; }
  .map-detail.open { transform: none; }
  .panel-body { padding: 14px 18px 22px; }
  .detail-title { font-size: 22px; }
}
@media (max-width: 520px) {
  .rd-label { font-size: 15px; }
  .rd-pole { font-size: 12.5px; }
  .card { padding: 18px; }
  .near-item { gap: 8px; padding: 8px 10px; }
  .meter { display: none; }
  .hero h1 { font-size: 34px; }
  .lead { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .me-pulse { animation: none !important; opacity: .5; transform: scale(.9); }
}
