/* ═══════════════════════════════════════════════════════════════
   SCOUT.CSS — Sir Balone · Rediseño 2026
   Museo del Fútbol · editorial, sereno, galería
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  /* paper / ink */
  --paper:        oklch(0.985 0.0022 100);
  --paper-warm:   oklch(0.968 0.0030 100);
  --paper-deep:   oklch(0.948 0.0040 100);
  --ink:          oklch(0.205 0.016 290);
  --ink-soft:     oklch(29.699% 0.01264 292.122);
  --ink-faint:    oklch(36.878% 0.00512 286.032);
  --rule:         oklch(0.885 0.010 85);
  --rule-soft:    oklch(0.925 0.008 85);

  /* brand */
  --purple:       oklch(0.40 0.130 295);
  --purple-deep:  oklch(0.30 0.110 295);
  --purple-soft:  oklch(0.92 0.040 295);
  --gold:         oklch(0.68 0.130 78);
  --gold-soft:    oklch(0.93 0.050 80);
  --burgundy:     oklch(0.46 0.110 25);
  --slate:        oklch(0.55 0.015 280);

  --shadow-card:
    0 1px 0 oklch(1 0 0 / 0.5) inset,
    0 1px 2px oklch(0 0 0 / 0.04),
    0 12px 32px -12px oklch(0.30 0.04 290 / 0.18),
    0 40px 60px -40px oklch(0.30 0.04 290 / 0.20);

  /* typography */
  --S: 'Instrument Serif', Georgia, serif;
  --G: 'Archivo', system-ui, sans-serif;
  --M: 'Space Mono', ui-monospace, monospace;

  /* layout */
  --sw: 300px;

  /* ── backward-compat aliases for JS-generated inline styles ── */
  --bg:      var(--paper);
  --bg2:     var(--paper-warm);
  --bg3:     var(--paper-deep);
  --ink2:    var(--ink-soft);
  --ink3:    var(--ink-faint);
  --muted:   var(--ink-faint);
  --border:  var(--rule);
  --border2: var(--rule);
  --acc:     var(--gold);
  --acc2:    var(--gold);
  --acc-dim: oklch(0.93 0.050 80 / 0.35);
  --white:   var(--paper);
  --D: var(--S);
  --B: var(--G);
  /* tier color aliases (used in inline JS) */
  --s-color: var(--purple);
  --a-color: var(--gold);
  --b-color: var(--ink);
  --c-color: var(--burgundy);
  --x-color: var(--ink-faint);
}

/* ── 2. RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

/* ── 3. BASE ──────────────────────────────────────────────────── */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--G);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 18% 8%, oklch(0.95 0.02 75 / 0.45), transparent 48%),
    radial-gradient(circle at 88% 82%, oklch(0.95 0.02 295 / 0.20), transparent 52%);
}

/* language visibility */
body[data-lang="es"] .en { display: none !important; }
body[data-lang="en"] .es { display: none !important; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 2px; }

/* ── 4. SHELL ─────────────────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: var(--sw) 1fr;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}

/* ── 5. SIDEBAR ───────────────────────────────────────────────── */
.sidebar {
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 0;
  background: linear-gradient(180deg, oklch(0.978 0.006 85) 0%, oklch(0.968 0.008 80) 100%);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative; /* for faq-overlay */
  flex-shrink: 0;
}

/* brand */
.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 32px 28px 24px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.brand-logo {
  display: block;
  width: auto;
}
.brand-logo--sm {
  height: 28px;
}
.brand-tag, .brand-tag a {
  font-family: var(--G);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 10px;
  font-weight: 500;
}
.brand-sub {
  font-family: var(--S);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 2px;
}

/* sidebar-top (mobile hamburger row) */
.sidebar-top {
  display: none; /* hidden on desktop */
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
}
.sidebar-menu-btn {
  background: none; border: none;
  color: var(--ink); font-size: 20px;
  cursor: pointer; padding: 4px;
}

/* ── 6. SEARCH ────────────────────────────────────────────────── */
.sidebar-search {
  padding: 20px 28px 0;
  flex-shrink: 0;
}
.search-wrap { position: relative; }

/* CSS-only search icon */
.search-icon-wrap {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  width: 14px; height: 14px;
}
.search-icon-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.2px solid var(--ink-faint);
  border-radius: 50%;
  width: 10px; height: 10px;
}
.search-icon-wrap::after {
  content: "";
  position: absolute;
  right: 0; bottom: 0;
  width: 5px; height: 1.2px;
  background: var(--ink-faint);
  transform: rotate(45deg);
  transform-origin: left;
}
/* fallback for old .search-icon span */
.search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint); font-size: 14px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 11px 14px 11px 36px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-family: var(--G);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--purple); }
.search-input::placeholder { color: var(--ink-faint); font-style: italic; }

.search-results {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  z-index: 600;
  max-height: 260px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  box-shadow: 0 8px 24px oklch(0.30 0.04 290 / 0.12);
}
.search-results.open { display: flex; }
.sr-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--rule-soft);
  transition: background 0.1s;
}
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--paper-warm); }
.sr-name { font-size: 13px; font-weight: 500; flex: 1; color: var(--ink); }
.sr-meta { font-size: 10px; color: var(--ink-faint); }
.sr-pos {
  font-family: var(--M); font-size: 9px;
  color: var(--purple); background: var(--purple-soft);
  padding: 2px 6px; border-radius: 1px;
}

/* ── 7. FILTERS ───────────────────────────────────────────────── */
.sidebar-filters {
  padding: 20px 28px 0;
  flex-shrink: 0;
}
.filter-label {
  font-family: var(--G);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
  display: block;
  margin-bottom: 6px;
}
.ms-wrap { position: relative; }
.ms-trigger {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  min-height: 36px;
  transition: border-color 0.15s;
}
.ms-trigger:hover { border-color: var(--purple); }
.ms-chip {
  font-family: var(--M); font-size: 9px;
  background: var(--purple-soft);
  border: 1px solid oklch(0.40 0.13 295 / 0.2);
  color: var(--purple-deep);
  padding: 2px 7px; border-radius: 1px;
  display: flex; align-items: center; gap: 3px;
}
.ms-chip button {
  background: none; border: none;
  color: var(--purple-deep); cursor: pointer;
  font-size: 11px; padding: 0; line-height: 1;
}
.ms-placeholder { font-size: 12px; color: var(--ink-faint); font-style: italic; }
.ms-dropdown {
  position: absolute; top: calc(100% + 2px); left: 0; right: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  z-index: 700; max-height: 200px; overflow-y: auto;
  box-shadow: 0 8px 20px oklch(0.30 0.04 290 / 0.10);
  display: none;
}
.ms-dropdown.open { display: block; }
.ms-opt {
  padding: 8px 14px; cursor: pointer;
  font-size: 12px; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
  transition: background 0.1s;
}
.ms-opt:hover { background: var(--paper-warm); }
.ms-opt.sel { font-weight: 500; }
.ms-opt.sel::before { content: '✓'; color: var(--purple); font-weight: 700; width: 12px; flex-shrink: 0; }
.ms-opt:not(.sel)::before { content: ''; width: 12px; flex-shrink: 0; }

/* ── 8. LANG TOGGLE ───────────────────────────────────────────── */
.sidebar-lang {
  padding: 20px 28px 0;
  flex-shrink: 0;
}
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: 100px;
  padding: 3px 3px 3px 10px;
  background: var(--paper);
}
.lang-globe {
  color: var(--ink-faint);
  flex-shrink: 0;
  margin-right: 5px;
}
.lang-btn, .lang {
  height: 26px;
  min-width: 36px;
  border: none;
  border-radius: 100px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-family: var(--M);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 10px;
  transition: all 0.18s;
  font-weight: 500;
}
.lang-btn:hover, .lang:hover { color: var(--ink); }
.lang-btn.active, .lang.active {
  background: var(--purple);
  color: var(--paper);
}

/* ── 9. AI SECTION ────────────────────────────────────────────── */
.section-divider {
  padding: 20px 28px 0;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--S);
  font-style: italic; font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.section-divider .glyph {
  font-style: normal;
  color: var(--purple);
  font-family: var(--M);
  font-size: 11px;
}

/* reuse as header for ai section */
.sidebar-ai-header {
  padding: 20px 28px 0;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.sidebar-ai-title {
  font-family: var(--M);
  font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold);
  flex: 1;
}
.ai-user-chip {
  font-family: var(--M); font-size: 9px;
  color: var(--ink-faint);
  display: flex; align-items: center; gap: 5px;
}
.ai-logout-btn {
  background: none; border: 1px solid var(--ink-faint);
  color: var(--ink-soft);
  font-family: var(--M); font-size: 10px;
  padding: 3px 9px; border-radius: 2px;
  cursor: pointer; transition: all 0.12s;
}
.ai-logout-btn:hover { border-color: var(--purple); color: var(--purple); background: rgba(74,29,114,.06); }

.lens-card {
  margin: 12px 28px 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  flex-shrink: 0;
}
.lens-eyebrow {
  font-family: var(--M);
  font-size: 10px; letter-spacing: 0.15em;
  color: var(--gold); text-transform: uppercase;
}
.lens-title {
  font-family: var(--S);
  font-style: italic; font-size: 15px;
  color: var(--ink); line-height: 1.2;
}
.lens-card input[type="email"],
.ai-field {
  width: 100%;
  padding: 9px 12px;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-family: var(--G); font-size: 12px;
  color: var(--ink); outline: none;
  transition: border-color 0.15s;
}
.ai-field { background: var(--paper-warm); }
.lens-card input::placeholder,
.ai-field::placeholder { color: var(--ink-faint); font-style: italic; }
.lens-card input:focus,
.ai-field:focus { border-color: var(--purple); }

.lens-card .btn,
.ai-send-btn {
  width: 100%;
  padding: 11px 14px;
  background: var(--ink); color: var(--paper);
  border: none; border-radius: 2px;
  font-family: var(--G);
  font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer; font-weight: 500;
  transition: background 0.15s;
}
.lens-card .btn:hover { background: var(--ink-soft); }
.ai-send-btn:hover { background: var(--ink-soft); }
.ai-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.ai-login-form { display: flex; flex-direction: column; gap: 6px; }
.ai-query-form { display: flex; flex-direction: column; gap: 6px; }
.ai-context-note {
  font-family: var(--M); font-size: 9px;
  color: var(--ink-faint); text-align: center;
}
.ai-context-note span { color: var(--gold); }

.ai-response-area {
  flex: 1; overflow-y: auto;
  padding: 0 28px 8px; min-height: 0;
}
.ai-response-bubble {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 12px 14px;
  font-size: 12px; line-height: 1.7;
  color: var(--ink); display: none;
}
.ai-response-bubble.show { display: block; }
.ai-response-bubble p { margin: 0 0 8px; }
.ai-response-bubble p:last-child { margin-bottom: 0; }
.ai-response-bubble strong { font-weight: 600; color: var(--ink); }
.ai-heading {
  font-family: var(--M); font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin: 10px 0 4px;
}
.ai-thinking {
  font-family: var(--M); font-size: 10px;
  color: var(--ink-faint); display: none;
  padding: 8px 0; animation: pulse 1s infinite;
}
.ai-thinking.on { display: block; }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* upgrade row */
#ai-upgrade-row {
  margin: 0 0 8px;
  font-family: var(--M);
  font-size: 10px;
  text-align: center;
}

/* ── 10. GHOST BUTTON + FAQ ───────────────────────────────────── */
.sidebar-faq {
  padding: 16px 28px;
  flex-shrink: 0;
}
.faq-btn, .ghost-btn {
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink-soft);
  font-family: var(--G);
  font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 10px;
  font-weight: 500;
  transition: all 0.15s;
}
.faq-btn:hover, .ghost-btn:hover {
  border-color: var(--purple);
  color: var(--purple);
}
.faq-btn .num, .ghost-btn .num {
  font-family: var(--M);
  color: var(--ink-faint);
  font-size: 10px; letter-spacing: 0;
}
.faq-btn.on { background: var(--purple-soft); border-color: var(--purple); color: var(--purple); }

/* FAQ overlay */
.faq-overlay {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--paper);
  z-index: 100;
  overflow-y: auto; padding: 24px 28px;
  display: none; flex-direction: column; gap: 0;
}
.faq-overlay.open { display: flex; }
.faq-overlay-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.faq-overlay-title {
  font-family: var(--S);
  font-weight: 400; font-size: 22px;
  color: var(--ink);
}
.faq-close {
  background: none; border: none;
  color: var(--ink-faint); font-size: 20px;
  cursor: pointer; transition: color 0.12s;
}
.faq-close:hover { color: var(--ink); }

/* Accordion */
.accordion-section { border-bottom: 1px solid var(--rule); }
.accordion-trigger {
  width: 100%; background: none; border: none;
  padding: 12px 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  cursor: pointer; text-align: left;
}
.accordion-title {
  font-family: var(--S); font-size: 15px;
  font-weight: 400; color: var(--ink); margin-bottom: 2px;
}
.accordion-summary { font-size: 11px; color: var(--ink-faint); line-height: 1.4; }
.accordion-icon { color: var(--purple); font-size: 14px; flex-shrink: 0; margin-top: 2px; transition: transform 0.2s; }
.accordion-trigger.open .accordion-icon { transform: rotate(180deg); }
.accordion-body { display: none; padding-bottom: 12px; }
.accordion-body.open { display: block; }
.accordion-content { font-size: 12px; color: var(--ink-soft); line-height: 1.7; }
.accordion-content p { margin-bottom: 10px; }
.faq-overlay .skill-row { margin-bottom: 10px; }
.faq-overlay .skill-name {
  font-family: var(--M); font-size: 9px; font-weight: 500;
  color: var(--ink); letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 3px;
}

/* tier legend in faq */
.tier-legend { display: flex; gap: 10px; flex-wrap: wrap; padding: 10px 0; }
.tl-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-soft); }
.tl-badge {
  width: 20px; height: 20px; border-radius: 1px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--S); font-weight: 500; font-size: 12px;
  border: 1px solid;
}
/* old tier- classes (uppercase) → same as grade- classes */
.tl-badge.tier-S, .tl-badge.grade-s { color: var(--paper); background: var(--purple); border-color: var(--purple); }
.tl-badge.tier-A, .tl-badge.grade-a { color: var(--ink); background: var(--gold-soft); border-color: var(--gold); }
.tl-badge.tier-B, .tl-badge.grade-b { color: var(--ink); background: transparent; border-color: var(--ink); }
.tl-badge.tier-C, .tl-badge.grade-c { color: var(--burgundy); background: transparent; border-color: var(--burgundy); }
.tl-badge.tier-X, .tl-badge.grade-x { color: var(--ink-faint); background: transparent; border-color: var(--ink-faint); }

/* ── 11. SIDEBAR FOOTER ───────────────────────────────────────── */
.sidebar-foot {
  margin-top: auto;
  padding: 20px 28px 24px;
  border-top: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 10px;
  flex-shrink: 0;
}
.foot-links { display: flex; gap: 8px 16px; font-size: 11px; color: var(--ink-faint); flex-wrap: balance;}
.foot-links a { color: inherit; text-decoration: none; }
.foot-links a:hover { color: var(--ink); }
.foot-meta {
  font-family: var(--M); font-size: 9.5px;
  letter-spacing: 0.08em; color: var(--ink-faint);
  text-transform: uppercase;
}

/* ── 12. MAIN ─────────────────────────────────────────────────── */
.main {
  padding: 36px 56px 32px;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* ── 13. MAIN-HEAD ────────────────────────────────────────────── */
.main-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.breadcrumb { display: flex; flex-direction: column; gap: 6px; }
.breadcrumb .eyebrow {
  font-family: var(--M);
  font-size: 10px; letter-spacing: 0.18em;
  color: var(--ink-faint); text-transform: uppercase;
}
.breadcrumb .crumb {
  font-family: var(--S);
  font-style: italic; font-size: 28px;
  color: var(--ink); line-height: 1; font-weight: 400;
  display: flex; align-items: baseline; gap: 0; flex-wrap: wrap;
}
.crumb-label { margin-right: 6px; }

/* active-strip = chip container inside crumb */
#active-strip {
  display: inline-flex; align-items: baseline;
  gap: 6px; flex-wrap: wrap;
}
.strip-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 12px;
  background: var(--purple-soft);
  border: 1px solid oklch(0.40 0.13 295 / 0.18);
  color: var(--purple-deep);
  font-family: var(--G); font-style: normal;
  font-size: 12px; font-weight: 500;
  border-radius: 2px; letter-spacing: 0;
  transform: translateY(-4px);
  cursor: pointer;
  transition: background 0.15s;
}
.strip-chip:hover { background: oklch(0.88 0.05 295); }
.strip-chip.chip-focused { background: var(--purple); color: var(--paper); }
.strip-chip .x {
  width: 10px; height: 10px;
  position: relative; cursor: pointer; opacity: 0.55;
  flex-shrink: 0;
}
.strip-chip .x::before,
.strip-chip .x::after {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 10px; height: 1px; background: currentColor;
}
.strip-chip .x::before { transform: rotate(45deg); }
.strip-chip .x::after  { transform: rotate(-45deg); }
/* old strip-chip button format */
.strip-chip button {
  background: none; border: none;
  color: currentColor; cursor: pointer;
  font-size: 12px; line-height: 1; padding: 0;
  opacity: 0.6;
}

.head-meta {
  text-align: right;
  display: flex; flex-direction: column; gap: 4px;
  padding-top: 6px;
}
.head-meta .label {
  font-family: var(--M); font-size: 10px;
  letter-spacing: 0.18em; color: var(--ink-faint);
  text-transform: uppercase;
}
.head-meta .value {
  font-family: var(--S); font-style: italic;
  font-size: 16px; color: var(--ink-soft);
}

/* ── 14. TABS ─────────────────────────────────────────────────── */
.tabs, .view-tabs {
  display: flex; gap: 0;
  padding: 18px 0 0;
  margin-bottom: 0;
  flex-shrink: 0;
}
.tab, .view-tab {
  padding: 12px 22px 14px;
  font-family: var(--G);
  font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  cursor: pointer; font-weight: 500;
  border: none; background: none;
  border-bottom: 1.5px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
}
.tab:hover, .view-tab:hover { color: var(--ink); }
.tab.active, .view-tab.active {
  color: var(--ink);
  border-bottom-color: var(--purple);
}
.tab .count {
  font-family: var(--M); font-size: 10px;
  letter-spacing: 0; color: var(--ink-faint);
  margin-left: 8px; font-weight: 400;
}

/* ── 15. GALLERY ──────────────────────────────────────────────── */
.gallery {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 56px;
  padding: 48px 0 0;
  align-items: start;
}

/* ── 16. CURATOR NOTE (left column) ───────────────────────────── */
.curator {
  display: flex; flex-direction: column; gap: 24px;
  padding-top: 24px; max-width: 460px;
}
.curator .plate-num {
  font-family: var(--M); font-size: 11px;
  letter-spacing: 0.2em; color: var(--ink-faint);
  text-transform: uppercase;
}
.curator h2 {
  font-family: var(--S); font-weight: 400;
  font-size: 40px; line-height: 1.05;
  color: var(--ink); letter-spacing: -0.015em;
}
.curator h2 em { font-style: italic; color: var(--purple); font-weight: 500; }
.curator .lede {
  font-family: var(--S); font-size: 16px;
  line-height: 1.55; color: var(--ink-soft);
  max-width: 420px;
}
.curator .meta-rows {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--rule); margin-top: 4px;
}
.curator .meta-row {
  display: grid; grid-template-columns: 140px 1fr;
  padding: 12px 0; border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.curator .meta-row dt {
  font-family: var(--M); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint);
}
.curator .meta-row dd {
  font-family: var(--S); font-style: italic;
  font-size: 15px; color: var(--ink);
}

/* ── 17. EXHIBIT (right column) ───────────────────────────────── */
.exhibit { display: flex; flex-direction: column; align-items: stretch; }

/* ── 18. PLAYER CARD ──────────────────────────────────────────── */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-card);
  padding: 36px 32px 30px;
  display: flex; flex-direction: column; gap: 22px;
  position: relative;
}
.card:hover {
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.5) inset,
    0 1px 2px oklch(0 0 0 / 0.04),
    0 16px 40px -10px oklch(0.30 0.04 290 / 0.22),
    0 48px 70px -36px oklch(0.30 0.04 290 / 0.24);
}
/* fine inner frame */
.card::before {
  content: "";
  position: absolute; inset: 8px;
  border: 1px solid var(--rule-soft);
  pointer-events: none;
}
.card-mark {
  position: absolute; top: 14px; left: 16px;
  font-family: var(--M); font-size: 9px;
  letter-spacing: 0.18em; color: var(--ink-faint);
  text-transform: uppercase;
}
.card-mark-right {
  position: absolute; top: 14px; right: 16px;
  font-family: var(--M); font-size: 9px;
  letter-spacing: 0.18em; color: var(--ink-faint);
  text-transform: uppercase;
}

/* card hero */
.card-hero { text-align: center; padding-top: 14px; }
.nvp-label {
  font-family: var(--M); font-size: 10px;
  letter-spacing: 0.32em; color: var(--ink-faint);
  text-transform: uppercase; margin-bottom: 6px;
}
.nvp-num {
  font-family: var(--S); font-weight: 400;
  font-size: 92px; line-height: 1.3;
  color: var(--gold); letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.nvp-rule {
  width: 36px; height: 1px;
  background: var(--rule); margin: 14px auto;
}
.player-name {
  font-family: var(--S); font-weight: 400;
  font-size: 30px; line-height: 1;
  color: var(--ink); letter-spacing: -0.01em;
}
.player-meta {
  font-family: var(--M); font-size: 10px;
  letter-spacing: 0.22em; color: var(--ink-soft);
  text-transform: uppercase; margin-top: 10px;
}
.player-meta .sep { color: var(--ink-faint); margin: 0 8px; }

/* ── 19. SKILLS ───────────────────────────────────────────────── */
.skills {
  display: flex; flex-direction: column; gap: 14px;
  padding: 6px 4px 0;
}
.skill {
  display: grid;
  grid-template-columns: 110px 1fr 22px 28px;
  align-items: center; gap: 12px;
}
.skill .name {
  font-family: var(--S); font-size: 14px;
  color: var(--ink); line-height: 1.1;
  display: flex; align-items: center; gap: 6px;
}
.skill .info {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid var(--rule);
  color: var(--ink-faint); font-size: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--G); cursor: help; flex-shrink: 0;
  transition: all 0.15s;
}
.skill .info:hover, .skill .info.active {
  border-color: var(--purple); color: var(--purple);
  background: var(--purple-soft);
}
.skill .bar {
  height: 2px; background: var(--rule-soft);
  position: relative; overflow: visible;
}
.skill .bar .fill {
  position: absolute; inset: 0 auto 0 0;
}
.skill .bar .tick {
  position: absolute; top: -3px; bottom: -3px;
  width: 1px; background: var(--paper);
  box-shadow: 0 0 0 0.5px var(--rule);
}
.skill .grade {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--S); font-weight: 500; font-size: 13px;
  border: 1px solid var(--ink); border-radius: 1px; line-height: 1;
  color: var(--ink);
}
.skill .score {
  font-family: var(--S); font-size: 16px;
  color: var(--ink); text-align: right;
  font-variant-numeric: tabular-nums;
}

/* skill desc panel */
.skill-desc-panel {
  font-family: var(--G); font-size: 11px;
  color: var(--ink-soft); line-height: 1.55;
  padding: 6px 4px 12px 126px; /* indent to align with bar */
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 2px;
}

/* grade / fill color classes */
.grade-s, .fill-s + .grade, .skill .grade.grade-s { color: var(--paper); background: var(--purple); border-color: var(--purple); }
.grade-a, .skill .grade.grade-a { color: var(--ink); background: var(--gold-soft); border-color: var(--gold); }
.grade-b, .skill .grade.grade-b { color: var(--ink); background: transparent; border-color: var(--ink); }
.grade-c, .skill .grade.grade-c { color: var(--burgundy); background: transparent; border-color: var(--burgundy); }
.grade-x, .skill .grade.grade-x { color: var(--ink-faint); background: transparent; border-color: var(--ink-faint); }

/* bar fill colors (used by .fill class + old .skill-bar) */
.fill-s, .fill-S { background: var(--purple) !important; }
.fill-a, .fill-A { background: var(--gold) !important; }
.fill-b, .fill-B { background: var(--ink) !important; }
.fill-c, .fill-C { background: var(--burgundy) !important; }
.fill-x, .fill-X { background: var(--ink-faint) !important; }

/* ── 20. STATS GRID ───────────────────────────────────────────── */
.stats {
  margin-top: 8px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.stat {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 14px 10px 12px;
  text-align: center;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--paper);
}
.stat .stat-num {
  font-family: var(--S); font-size: 22px;
  color: var(--ink); line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.stat.purple .stat-num { color: var(--purple); }
.stat .stat-label {
  font-family: var(--M); font-size: 9px;
  letter-spacing: 0.18em; color: var(--ink-faint);
  text-transform: uppercase;
}

/* ── 22. LEGEND ───────────────────────────────────────────────── */
.legend {
  margin-top: auto;
  padding-top: 24px; border-top: 1px solid var(--rule);
  display: flex; align-items: center;
  justify-content: space-between; gap: 24px;
  flex-shrink: 0;
}
.legend-title {
  font-family: var(--M); font-size: 10px;
  letter-spacing: 0.22em; color: var(--ink-faint);
  text-transform: uppercase; white-space: nowrap;
}
.legend-items { display: flex; gap: 24px; flex-wrap: wrap; }
.legend-item {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--S); font-size: 13px;
  color: var(--ink-soft); font-style: italic;
}
.legend-item .badge {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--S); font-style: normal;
  font-weight: 500; font-size: 12px;
  border: 1px solid; border-radius: 1px; line-height: 1;
}
.legend-item .range {
  font-family: var(--M); font-style: normal;
  font-size: 10px; color: var(--ink-faint);
  letter-spacing: 0.06em; margin-left: 2px;
}

/* ── 23. EMPTY STATE ──────────────────────────────────────────── */
.empty-gallery { flex: 1; }
.empty-gallery .gallery { padding-top: 36px; }
.empty-exhibit {
  border: 1px dashed var(--rule);
  min-height: 480px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--S); font-style: italic;
  font-size: 16px; color: var(--ink-faint);
}
/* old-style empty (hidden, fallback) */
.empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 60vh; gap: 10px; color: var(--ink-faint);
}
.empty-big { font-size: 56px; opacity: 0.12; }
.empty-txt {
  font-family: var(--M); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
}

/* free banner */
.free-banner {
  background: var(--gold-soft); border: 1px solid var(--gold);
  border-radius: 2px; padding: 10px 14px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.fb-text { font-size: 12px; color: var(--ink); flex: 1; }
.upgrade-btn {
  background: var(--ink); color: var(--paper);
  border: none; border-radius: 2px;
  padding: 6px 12px; font-family: var(--M);
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.1em; cursor: pointer;
  transition: background 0.12s; white-space: nowrap;
}
.upgrade-btn:hover { background: var(--ink-soft); }

/* ── 24. COMPARE TABLE ────────────────────────────────────────── */
#view-table { overflow-x: auto; padding: 32px 0; }
.tier-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tier-table th {
  font-family: var(--M); font-size: 9px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint); padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: left; white-space: nowrap;
  background: var(--paper);
}
.tier-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: middle;
}
.tier-table tr:hover td { background: var(--paper-warm); }
.tt-player { font-size: 13px; font-weight: 500; color: var(--ink); }
.tt-team { font-size: 10px; color: var(--ink-faint); margin-top: 1px; }
.tt-pos {
  font-family: var(--M); font-size: 9px;
  color: var(--purple); background: var(--purple-soft);
  padding: 2px 6px; border-radius: 1px; display: inline-block;
}
.tt-nvp {
  font-family: var(--S); font-size: 20px;
  color: var(--gold); font-weight: 400;
}
.tt-bar-cell { display: flex; align-items: center; gap: 6px; }
.tt-bar {
  flex: 1; height: 2px; background: var(--rule-soft);
  border-radius: 0; overflow: hidden; min-width: 40px;
}
.tt-bar-fill { height: 2px; }
.tt-pct { font-family: var(--M); font-size: 10px; color: var(--ink-faint); width: 24px; }

/* ── 25. MODALS ───────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: oklch(0.21 0.022 290 / 0.45);
  z-index: 800;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--paper);
  border: 1px solid var(--rule);
  width: 340px; overflow: hidden;
  box-shadow: var(--shadow-card);
}
.modal-top {
  background: var(--ink); padding: 24px 24px 18px;
}
.modal-top img { height: 44px; }
.modal-logo {
  font-family: var(--S); font-style: italic;
  font-size: 24px; color: var(--paper);
}
.modal-tagline {
  font-family: var(--M); font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: oklch(0.974 0.006 85 / 0.5); margin-top: 4px;
}
.modal-body {
  padding: 20px 24px 24px;
  display: flex; flex-direction: column; gap: 8px;
}
.modal-input {
  width: 100%;
  background: var(--paper-warm);
  border: 1px solid var(--rule); border-radius: 2px;
  color: var(--ink); font-family: var(--G);
  font-size: 13px; padding: 9px 12px;
  outline: none; transition: border-color 0.15s;
}
.modal-input:focus { border-color: var(--purple); }
.modal-input::placeholder { color: var(--ink-faint); font-style: italic; }
.modal-btn {
  width: 100%; padding: 11px;
  border-radius: 2px; border: 1px solid var(--ink);
  background: var(--gold); color: var(--ink);
  font-family: var(--M); font-size: 10px;
  font-weight: 600; letter-spacing: 0.1em;
  cursor: pointer; transition: all 0.15s;
}
.modal-btn:hover { background: oklch(0.72 0.13 78); }
.modal-btn.ghost {
  background: transparent; color: var(--ink-faint);
  border-color: var(--rule);
}
.modal-btn.ghost:hover { color: var(--ink); border-color: var(--ink); }
.modal-msg {
  font-family: var(--M); font-size: 10px;
  color: var(--ink-faint); text-align: center;
}
.modal-msg.err { color: var(--burgundy); }

/* ── 26. AI CHAT ROOT (fixed bottom) ────────────────────────── */
.ai-chat-root {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ai-chat-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  background: var(--ink); color: var(--paper);
  border: none; border-radius: 100px;
  font-family: var(--M); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap;
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.15) inset,
    0 4px 24px oklch(0.21 0.022 290 / 0.30);
  transition: background 0.15s, transform 0.1s;
}
.ai-chat-trigger:hover { background: var(--purple); transform: translateY(-1px); }
.ai-chat-root.open .ai-chat-trigger { background: var(--purple); }
.ai-chat-trigger-icon { color: var(--gold); }

.ai-chat-panel {
  display: none; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  width: 360px; max-height: min(520px, 70vh);
  overflow: hidden;
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.5) inset,
    0 12px 48px oklch(0.21 0.022 290 / 0.22);
  margin-bottom: 10px;
  position: absolute;
  bottom: 100%;
  left: 50%; transform: translateX(-50%);
}
.ai-chat-root.open .ai-chat-panel { display: flex; }

.ai-chat-panel-head {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 14px 16px; flex-shrink: 0;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-warm);
}
.ai-chat-panel-title {
  display: flex; align-items: center; gap: 10px;
}
.ai-chat-label {
  font-family: var(--M); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold);
}
.ai-chat-close {
  background: none; border: none;
  color: var(--ink-faint); font-size: 20px;
  cursor: pointer; line-height: 1; padding: 0 2px;
  transition: color 0.12s;
}
.ai-chat-close:hover { color: var(--ink); }

.ai-chat-body {
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto; flex: 1;
}

/* ── 27. CARD DOWNLOAD BUTTON ───────────────────────────────── */
.card-download-btn {
  align-self: flex-start;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; margin-top: 4px;
  background: transparent;
  border: 1px solid var(--rule); border-radius: 2px;
  font-family: var(--M); font-size: 9.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint);
  cursor: pointer; transition: all 0.15s;
}
.card-download-btn:hover { border-color: var(--purple); color: var(--purple); }
.card-download-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── 28. MOBILE ≤ 768px ───────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sw: 100vw; }

  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }

  .sidebar-top { display: flex; }
  .brand { display: none; }

  .sidebar-drawer {
    display: none; flex-direction: column;
    border-top: 1px solid var(--rule);
  }
  .sidebar-drawer.open { display: flex; }

  .main { padding: 20px 16px 24px; }

  .gallery {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px 0;
  }
  .curator { max-width: 100%; padding-top: 0; }
  .curator h2 { font-size: 28px; }

  .card { padding: 28px 20px 24px; }
  .nvp-num { font-size: 72px; }
  .player-name { font-size: 24px; }

  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat .stat-num { font-size: 18px; }

  .main-head { flex-direction: column; gap: 12px; }
  .breadcrumb .crumb { font-size: 22px; }

  .legend { flex-direction: column; align-items: flex-start; gap: 12px; }
  .legend-items { gap: 12px; }

  .faq-overlay { position: fixed; width: 100vw; height: 100vh; }

  .ai-chat-root { bottom: 16px; }
  .ai-chat-panel { width: calc(100vw - 32px); max-width: 360px; }
}

@media (max-width: 480px) {
  .skill { grid-template-columns: 90px 1fr 22px 24px; gap: 8px; }
  .skill .name { font-size: 12px; }
  .gallery { gap: 20px; }
}
