﻿/* Investment Intelligence Hub — Main Stylesheet
   Theme: Dotty brand palette (navy base + magenta/pink accent), dark default
   with a light variant via [data-theme="light"]. */

/* ── Design tokens (single source of truth) ──────────────────────────────────
   Merged from the two former :root blocks (Phase-1 palette + the migrated Atlas
   design system). Values are the ones that ALREADY render: where a token was
   defined twice, the later definition won the cascade, so those effective values
   are preserved here byte-for-byte. Legacy aliases (--surface2, --text-muted,
   --accent-hover) are kept because live selectors still reference them. */
:root {
    color-scheme: dark;
    /* Base surfaces */
    --bg: #080b14;
    --surface: #101624;
    --surface-raised: #151d2e;
    --surface-soft: #1a2438;
    --surface-hover: #202c43;
    --surface2: #182035;              /* legacy alias, still referenced */
    --border: #293653;
    --border-strong: #3a4b70;
    /* Text */
    --text: #eef2f8;
    --text-soft: #cbd5e5;
    --muted: #94a3b8;
    --text-muted: #9aa9c4;            /* legacy alias, still referenced */
    /* Accent (Dotty magenta/pink) */
    --accent: #f0abfc;
    --accent-strong: #d946ef;
    --accent-hover: #d946ef;          /* legacy alias of --accent-strong */
    --accent-soft: rgba(240, 171, 252, .11);
    /* Semantic state colors (kept functional: green/amber/red for QA & signals) */
    --pass: #22c55e;
    --pass-soft: rgba(34, 197, 94, .12);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, .12);
    --blocked: #ef4444;
    --blocked-soft: rgba(239, 68, 68, .12);
    --failed: #b91c1c;
    --info: #60a5fa;
    --info-soft: rgba(96, 165, 250, .12);
    /* Tier medals */
    --gold: #FBBF24;
    --silver: #94a3b8;
    --bronze: #cd7f32;
    /* Geometry & chrome */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow: 0 20px 55px rgba(0, 0, 0, .22);
    --sidebar: 226px;
    --topbar: 72px;
    /* Device safe-area insets (iOS notch / home indicator). Zero on devices
       without them; requires viewport-fit=cover on the meta viewport. Adapted
       from the Dotty PWA — used by the mobile bottom-nav and full-bleed shells. */
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
    --sar: env(safe-area-inset-right, 0px);
}

[data-theme="light"] {
    color-scheme: light;
    --bg: #f5f6fb;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-soft: #eef1f7;
    --surface-hover: #e8ecf4;
    --surface2: #ececf4;              /* legacy alias, still referenced */
    --border: #d8deea;
    --border-strong: #b8c2d4;
    --text: #172033;
    --text-soft: #35425b;
    --muted: #65718a;
    --text-muted: #555570;            /* legacy alias, still referenced */
    --accent: #c026d3;
    --accent-strong: #9333ea;
    --accent-hover: #9333ea;          /* legacy alias of --accent-strong */
    --accent-soft: rgba(192, 38, 211, .09);
    /* Semantic TEXT colours must be re-darkened for the light theme: the dark
       values (green #22c55e, amber #fbbf24, red #ef4444) fail 4.5:1 on white
       (audit A-1). These pass AA on --surface/--bg; the bright tones stay only
       for fills/marks. */
    --pass: #15803d;      /* ~4.9:1 on white */
    --warning: #a16207;   /* ~4.6:1 on white */
    --blocked: #b91c1c;   /* ~5.9:1 on white */
    --info: #2563eb;      /* ~5.2:1 on white */
    --pass-soft: rgba(34, 197, 94, .10);
    --warning-soft: rgba(245, 158, 11, .11);
    --blocked-soft: rgba(239, 68, 68, .09);
    --info-soft: rgba(59, 130, 246, .09);
    --shadow: 0 16px 40px rgba(34, 47, 74, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.nav-brand a { font-weight: 700; font-size: 1rem; color: var(--text); }
.nav-links { display: flex; gap: 0.35rem; flex: 1; align-items: center; }
.nav-links a {
    color: var(--text-muted); font-size: 0.88rem;
    padding: 0.35rem 0.55rem; border-radius: 6px;
}
.nav-links a:hover, .nav-links a.is-active { color: var(--text); background: var(--surface2); text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.user-badge {
    font-size: 0.8rem; color: var(--text-muted);
    background: var(--surface2); padding: 0.2rem 0.6rem; border-radius: 4px;
}

/* ── Container ──────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, #F0ABFC, #D946EF); color: #0d1321; border: none;
    padding: 0.5rem 1.25rem; border-radius: 6px; cursor: pointer;
    font-size: 0.9rem; font-weight: 700;
    transition: filter 0.15s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-full { width: 100%; padding: 0.65rem; }
.btn-sm {
    background: var(--surface2); color: var(--text); border: 1px solid var(--border);
    padding: 0.3rem 0.75rem; border-radius: 4px; cursor: pointer; font-size: 0.8rem;
    display: inline-block;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-logout {
    background: none; border: 1px solid var(--border); color: var(--text-muted);
    padding: 0.25rem 0.6rem; border-radius: 4px; cursor: pointer; font-size: 0.8rem;
}
.btn-logout:hover { border-color: var(--blocked); color: var(--blocked); }

/* ── Alerts ──────────────────────────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem;
    border-left: 4px solid;
}
.alert-error { background: rgba(239,68,68,0.1); border-color: var(--failed); color: #fca5a5; }
.alert-info  { background: rgba(79,142,247,0.08); border-color: var(--accent); color: var(--text-muted); }
.alert-critical { background: rgba(239,68,68,0.15); border-color: var(--failed); color: #fca5a5; margin-bottom: 1.5rem; }
.alert-warning { background: rgba(251,191,36,0.12); border-color: var(--warning); color: #fde68a; margin-bottom: 1.5rem; }

/* ── Availability states (core.presentation.DataBlock) ───────────────────
   Honest per-block data state instead of a blank "No disponible". Colour maps
   to a status class (never inline style); text is always present. */
.availability {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem;
    padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem;
    border-left: 4px solid var(--border); background: var(--surface2);
    color: var(--text-muted);
}
.availability-label { color: var(--text); }
.availability-action { margin-left: auto; color: var(--accent); }
.availability--error   { border-color: var(--failed);  background: rgba(239,68,68,0.10); color: #fca5a5; }
.availability--blocked { border-color: var(--blocked); background: rgba(239,68,68,0.10); color: #fca5a5; }
.availability--pending { border-color: var(--accent);  background: rgba(79,142,247,0.08); }
.availability--partial { border-color: var(--warning); background: rgba(251,191,36,0.10); color: #fde68a; }
.availability--not_applicable { border-color: var(--border); }

/* ── Login ───────────────────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box {
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    padding: 2.5rem 2rem; width: 100%; max-width: 380px;
}
/* Wider variant for the registration form (extra profile fields). */
.login-box-wide { max-width: 460px; }
.login-page { padding: 2rem 1rem; }

/* Google sign-in button (M1). Google brand guidelines: white surface + dark text
   + the multi-color mark, so it stays recognizable in both light and dark themes.
   This is a deliberate exception to the Dotty palette. */
.btn-google {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    width: 100%; padding: 0.7rem 1rem; margin-bottom: 0.75rem;
    background: #fff; color: #1f1f1f; font-weight: 600; font-size: 0.92rem;
    border: 1px solid #dadce0; border-radius: 8px; text-decoration: none;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.btn-google:hover { background: #f7f8f8; box-shadow: 0 1px 3px rgba(0,0,0,0.2); text-decoration: none; }
.btn-google:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-google-icon { flex: 0 0 auto; }
.auth-consent-hint {
    font-size: 0.76rem; color: var(--text-muted); text-align: center;
    margin: 0 0 0.75rem; line-height: 1.4;
}
.auth-consent-hint a { color: var(--accent); }
.auth-divider {
    display: flex; align-items: center; gap: 0.75rem; margin: 1rem 0;
    color: var(--text-muted); font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
    content: ""; flex: 1; height: 1px; background: var(--border);
}
.register-section { font-size: 1rem; margin: 1.75rem 0 0.25rem; color: var(--text); }
.register-section .muted { color: var(--text-muted); font-weight: normal; font-size: 0.85rem; }
.login-box fieldset { border: 1px solid var(--border); border-radius: 6px; padding: 0.6rem 0.75rem; }
.login-box legend { font-size: 0.8rem; color: var(--text-muted); padding: 0 0.4rem; }
.login-box h1 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.login-subtitle { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.35rem; font-size: 0.85rem; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.55rem 0.75rem;
    background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
    color: var(--text); font-size: 0.9rem; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }

/* ── Communication preferences (profile) ─────────────────────────────── */
.comms-prefs { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.comms-prefs legend { padding: 0 0.5rem; font-size: 0.85rem; color: var(--text-muted); }
.comms-prefs-hint { font-size: 0.8rem; margin: 0 0 0.75rem; }
.comms-check { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; cursor: pointer; }
.comms-check input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--accent); transform: scale(1.2); }
.comms-check span { font-size: 0.9rem; color: var(--text); }

/* ── In-app broadcast banner (session-start novedades) ───────────────── */
.comms-banner {
    border: 1px solid var(--accent); border-left: 4px solid var(--accent);
    background: var(--surface); border-radius: var(--radius);
    padding: 1rem 1.1rem; margin: 0 0 1.25rem; position: relative;
}
.comms-banner-eyebrow {
    font-size: 0.7rem; letter-spacing: 0; text-transform: uppercase;
    color: var(--accent); font-weight: 700;
}
.comms-banner h3 { margin: 0.25rem 0 0.5rem; font-size: 1.05rem; color: var(--text); }
.comms-banner .comms-intro { font-size: 0.9rem; color: var(--text-muted); margin: 0 0 0.75rem; }
.comms-banner-dismiss {
    position: absolute; top: 0.6rem; right: 0.6rem; background: transparent;
    border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; line-height: 1;
    min-width: 44px; min-height: 44px;
}
.comms-banner-dismiss:hover { color: var(--text); }
.comms-banner-optout {
    display: flex; align-items: center; gap: 0.45rem; margin: 0.85rem 0 0;
    font-size: 0.82rem; color: var(--text-muted); cursor: pointer;
    -webkit-user-select: none; user-select: none;
}
.comms-banner-optout input { cursor: pointer; }
.comms-banner-optout-all {
    display: inline-block; margin: 0.35rem 0 0; padding: 0;
    background: none; border: none; cursor: pointer;
    font-size: 0.78rem; color: var(--text-muted);
    text-decoration: underline; text-underline-offset: 2px;
}
.comms-banner-optout-all:hover { color: var(--text); }

/* Email-confirmation reminder (M2 magic link) — non-blocking amber nudge. */
.verify-reminder {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    border: 1px solid var(--warning); border-left: 4px solid var(--warning);
    background: var(--warning-soft); border-radius: var(--radius);
    padding: 0.85rem 1.1rem; margin: 0 0 1.25rem;
}
.verify-reminder-text { display: flex; flex-direction: column; gap: 0.15rem; flex: 1 1 16rem; }
.verify-reminder-text strong { font-size: 0.92rem; color: var(--text); }
.verify-reminder-text span { font-size: 0.82rem; color: var(--text-soft); }
.verify-reminder-action { margin: 0; flex: 0 0 auto; }
.verify-flash { margin-bottom: 1.25rem; }

/* ── Home ────────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; }
.page-header p { color: var(--text-muted); font-size: 0.9rem; }

.eyebrow {
    display: inline-block; color: var(--accent); font-size: 0.72rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0;
    margin-bottom: 0.25rem;
}

.section-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem;
}
.section-card h2 { font-size: 1rem; margin-bottom: 0.75rem; }

.snapshot-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    padding: 1.25rem; margin-bottom: 1.5rem;
}
.snapshot-meta { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 1rem; }
.meta-item { display: flex; flex-direction: column; }
.meta-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0; }
.meta-value { font-size: 0.95rem; font-weight: 500; }

.qa-summary h3 { font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--text-muted); }
.qa-counts { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.search-promo { background: var(--surface2); border-radius: 8px; padding: 1.25rem; }
.search-promo h2 { font-size: 1rem; margin-bottom: 0.75rem; }
.search-form { display: flex; gap: 0.5rem; }
.search-input {
    flex: 1; padding: 0.5rem 0.75rem;
    background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
    color: var(--text); font-size: 0.9rem;
}
.search-input:focus { outline: none; border-color: var(--accent); }

.home-hero {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
    gap: 1rem; align-items: center;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.4rem; margin-bottom: 1rem;
}
.home-hero h2 { font-size: 1.35rem; margin-bottom: 0.25rem; }
.search-form-hero { align-items: center; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.snapshot-meta.compact { gap: 1rem; margin-bottom: 0.75rem; }
.qa-counts-block { margin-top: 0.75rem; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; }
.quick-action {
    display: flex; flex-direction: column; gap: 0.15rem;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 8px; padding: 0.8rem; color: var(--text);
}
.quick-action:hover { border-color: var(--accent); text-decoration: none; }
.quick-action span { color: var(--text-muted); font-size: 0.82rem; }

/* ── Search page ─────────────────────────────────────────────────────── */
.search-form-top { margin-bottom: 1rem; }
.snapshot-ref { font-size: 0.8rem; color: var(--text-muted); }
.results-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }

/* Business-level quick filters (one-click presets) */
.preset-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.9rem; }
.preset-chip {
    display: inline-flex; align-items: center;
    border: 1px solid var(--accent); background: var(--surface2);
    border-radius: 999px; color: var(--accent);
    padding: 0.3rem 0.8rem; font-size: 0.82rem; font-weight: 600;
}
.preset-chip:hover {
    background: var(--accent); color: var(--bg); text-decoration: none;
}

/* Categorical checkbox groups (replace confusing <select multiple>) */
.filter-group-label { display: block; margin-bottom: 0.3rem; }
.check-scroll {
    display: flex; flex-direction: column; gap: 0.2rem;
    max-height: 120px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg); padding: 0.4rem 0.5rem;
}
.check-scroll .checkbox-label { font-size: 0.82rem; }

.filter-chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: -0.5rem 0 0.9rem; }
.filter-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    border: 1px solid var(--border); background: var(--surface2);
    border-radius: 999px; color: var(--text-muted);
    padding: 0.16rem 0.55rem; font-size: 0.78rem;
}
.filter-chip .chip-x {
    color: var(--text-muted); text-decoration: none; font-weight: 700;
    line-height: 1; padding-left: 0.1rem;
}
.filter-chip .chip-x:hover { color: var(--accent); }
.filter-chip-count {
    display: inline-flex; align-items: center; color: var(--text);
    font-size: 0.82rem; margin-right: 0.2rem;
}
.filter-chip-clear {
    display: inline-flex; align-items: center; color: var(--text-muted);
    font-size: 0.78rem; text-decoration: underline; text-underline-offset: 2px;
}
.filter-chip-clear:hover { color: var(--accent); }

/* Grouped filters: conceptual sections + advanced accordion */
.filter-section { margin: 0.4rem 0 0.2rem; }
.filter-section-title {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0; color: var(--accent); margin: 0.6rem 0 0.1rem;
    border-bottom: 1px solid var(--border); padding-bottom: 0.25rem;
}
.filter-advanced {
    margin-top: 0.6rem; border-top: 1px solid var(--border); padding-top: 0.4rem;
}
.filter-advanced > summary {
    cursor: pointer; font-weight: 600; color: var(--text-muted);
    font-size: 0.85rem; padding: 0.3rem 0;
}
.filter-advanced[open] > summary { color: var(--accent); }
.filter-sort-row { margin-top: 0.6rem; }
.metric-tip {
    cursor: help; color: var(--text-muted); font-size: 0.72rem;
    text-decoration: none; border: none; margin-left: 0.15rem;
}
.metric-tip:hover { color: var(--accent); }

/* Vertical scroll (header sticky on top) + horizontal scroll for wide tables.
   max-height keeps a fixed viewport so you scroll within the table, up & down. */
.table-wrapper { overflow: auto; max-height: 70vh; }
.data-table { width: auto; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.875rem; }
.data-table th {
    text-align: left; padding: 0.6rem 0.75rem;
    background: var(--surface2); color: var(--text-muted);
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 2;   /* sticky header while scrolling */
}
.data-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); }

/* Pinned columns: CTA (Ver 360), Ticker and Empresa stay visible while the
   dynamic columns scroll horizontally. Widths are fixed so the left offsets
   line up. The header cells sit above both axes. */
.data-table .col-sticky { position: sticky; z-index: 1; background: var(--surface); }
.data-table thead .col-sticky { z-index: 3; background: var(--surface2); }
.data-table tbody tr:hover .col-sticky { background: var(--surface2); }
.col-sticky-1 { left: 0; width: 5.4rem; min-width: 5.4rem; }
.col-sticky-2 { left: 5.4rem; width: 7rem; min-width: 7rem; }
.col-sticky-3 { left: 12.4rem; width: 14rem; min-width: 14rem; }
/* Shadow hint on the right edge of the last pinned column. */
.data-table .col-sticky-3 { box-shadow: 6px 0 8px -6px rgba(0,0,0,.45); }
.col-cta { padding-left: .5rem; padding-right: .5rem; }

@media (max-width: 600px) {
  /* On phones, drop the Empresa pin (too wide) — keep CTA + Ticker pinned. */
  .col-sticky-3 { position: static; box-shadow: none; width: auto; min-width: 11rem; }
}
.data-table tbody tr:hover { background: var(--surface2); }
.data-table .num-col { text-align: right; font-variant-numeric: tabular-nums; }
.row-blocked { opacity: 0.75; }
.row-blocked td:first-child { border-left: 3px solid var(--blocked); }
.row-warning td:first-child { border-left: 2px solid var(--warning); }

/* Card reflow for dense tables on phones (M3). Enhanced by responsive-tables.js,
   which adds .data-table--cards + data-label on each cell under 640px. Each row
   becomes a stacked card; every value is prefixed by its column header. Falls
   back to the normal scrollable table if the JS doesn't run. */
@media (max-width: 640px) {
  .data-table--cards { min-width: 0; width: 100%; border-collapse: collapse; }
  .data-table--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .data-table--cards tbody tr {
    display: block; margin-bottom: 0.75rem; padding: 0.35rem 0.15rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface);
  }
  .data-table--cards tbody tr:hover { background: var(--surface); }
  /* Sticky columns can't stay pinned inside a stacked card — reset them. */
  .data-table--cards .col-sticky,
  .data-table--cards td.col-sticky { position: static; box-shadow: none; width: auto; min-width: 0; background: transparent; }
  .data-table--cards td {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    padding: 0.4rem 0.7rem; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
    text-align: right;
  }
  .data-table--cards tbody tr td:last-child { border-bottom: none; }
  .data-table--cards td::before {
    content: attr(data-label); text-align: left; color: var(--text-muted);
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em;
    font-weight: 700; flex: 0 0 auto;
  }
  /* First cell (usually the name/ticker) reads as the card title. */
  .data-table--cards tbody tr td:first-child {
    font-weight: 700; font-size: 0.95rem; border-bottom: 1px solid var(--border);
  }
  .data-table--cards tbody tr td:first-child::before { display: none; }
  .data-table--cards .row-blocked td:first-child,
  .data-table--cards .row-warning td:first-child { border-left: none; }
}

.pagination { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; font-size: 0.85rem; color: var(--text-muted); }

/* ── Company 360 ─────────────────────────────────────────────────────── */
.company-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 0.5rem; gap: 1rem;
}
.company-header h1 { font-size: 2rem; }
.company-header h2 { font-size: 1rem; color: var(--text-muted); font-weight: normal; margin-top: 0.25rem; }
.company-meta-right { display: flex; gap: 0.5rem; align-items: flex-start; justify-content: flex-end; flex-wrap: wrap; padding-top: 0.25rem; }
.breadcrumb-link { display: inline-block; margin-bottom: 0.35rem; color: var(--text-muted); font-size: 0.82rem; }

.snapshot-ref-bar {
    font-size: 0.8rem; color: var(--text-muted);
    margin-bottom: 1.5rem; padding: 0.4rem 0; border-bottom: 1px solid var(--border);
}

.decision-panel {
    display: grid; grid-template-columns: minmax(180px, 260px) 1fr;
    gap: 1rem; align-items: stretch;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem;
}
.decision-main {
    display: flex; flex-direction: column; justify-content: center; gap: 0.4rem;
    border-right: 1px solid var(--border); padding-right: 1rem;
}
.decision-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}
.decision-grid dt, .kpi-card span {
    color: var(--text-muted); font-size: 0.74rem;
    text-transform: uppercase; letter-spacing: 0;
}
.decision-grid dd {
    margin-top: 0.12rem; font-size: 0.95rem; font-weight: 600;
    overflow-wrap: anywhere;
}
.kpi-grid {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem; margin-bottom: 1rem;
}
.kpi-card {
    min-height: 86px; display: flex; flex-direction: column;
    justify-content: space-between; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0.85rem;
}
.kpi-card strong { font-size: 1.12rem; overflow-wrap: anywhere; }

.c360-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}
.c360-section {
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    padding: 1rem;
}
.c360-section h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0; color: var(--text-muted); margin-bottom: 0.75rem; }

.field-list { display: grid; grid-template-columns: 1fr 1.5fr; gap: 0.4rem 0.75rem; align-items: baseline; }
.field-list dt { font-size: 0.8rem; color: var(--text-muted); }
.field-list dd { font-size: 0.9rem; font-weight: 500; }
.na-note { color: var(--text-muted); font-weight: normal; }
.na-note small { font-size: 0.75rem; }

.flag-list { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; }
.flag-item { font-size: 0.85rem; }
.flag-active { color: var(--blocked); }
.flag-inactive { color: var(--text-muted); }

.warning-list { list-style: disc; padding-left: 1.25rem; font-size: 0.85rem; color: var(--text-muted); }
.ok-note { color: var(--pass); font-size: 0.85rem; }
.artifact-list { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; }

.back-link { margin-top: 1.5rem; font-size: 0.85rem; }

/* ── Badges ──────────────────────────────────────────────────────────── */
.qa-badge {
    display: inline-block; font-size: 0.7rem; font-weight: 600;
    padding: 0.2rem 0.55rem; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0;
}
.qa-pass { background: rgba(34,197,94,0.15); color: var(--pass); }
.qa-pass-with-warnings, .qa-pass-with-warnings { background: rgba(245,158,11,0.15); color: var(--warning); }
.qa-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.qa-blocked { background: rgba(239,68,68,0.15); color: var(--blocked); }
.qa-failed { background: rgba(220,38,38,0.2); color: var(--failed); }
.qa-unknown { background: var(--surface2); color: var(--text-muted); }

.tier-badge {
    display: inline-block; font-size: 0.7rem; font-weight: 700;
    padding: 0.2rem 0.55rem; border-radius: 4px; text-transform: uppercase;
}
.tier-gold { background: rgba(251,191,36,0.15); color: var(--gold); }
.tier-silver { background: rgba(148,163,184,0.15); color: var(--silver); }
.tier-bronze { background: rgba(205,127,50,0.15); color: #cd7f32; }

.rec-badge {
    display: inline-block; font-size: 0.85rem; font-weight: 600;
    padding: 0.3rem 0.75rem; border-radius: 4px;
}
.rec-watchlist { background: rgba(79,142,247,0.15); color: var(--accent); }
.rec-buy { background: rgba(34,197,94,0.15); color: var(--pass); }
.rec-hold { background: rgba(148,163,184,0.15); color: var(--silver); }
.rec-sell, .rec-blocked { background: rgba(239,68,68,0.15); color: var(--blocked); }
/* css_token hyphenates underscores, so rec- classes MUST use hyphens (the old
   underscore variants never matched — upstream F-209). */
.rec-mantener-bajo-revision { background: rgba(245,158,11,0.2); color: var(--warning); }
.rec-no-iniciar { background: rgba(245,158,11,0.2); color: var(--warning); }
/* Native VI verdict taxonomy (6 levels, run_20260716). Tactical-weak sell is
   amber (12-month entry signal), NOT red: red is reserved for VENTA/URGENTE. */
.rec-compra-fuerte { background: rgba(34,197,94,0.25); color: var(--pass); }
.rec-compra { background: rgba(34,197,94,0.15); color: var(--pass); }
.rec-compra-debil { background: rgba(34,197,94,0.10); color: var(--pass); }
.rec-venta-tactica-debil { background: rgba(245,158,11,0.2); color: var(--warning); }
.rec-venta { background: rgba(239,68,68,0.15); color: var(--blocked); }
.rec-venta-urgente { background: rgba(239,68,68,0.25); color: var(--blocked); }
.rec-unknown { background: var(--surface2); color: var(--text-muted); }
.tier-unknown { background: var(--surface2); color: var(--text-muted); }

.empty-state {
    background: var(--surface); border: 1px dashed var(--border);
    border-radius: var(--radius); padding: 1.5rem; color: var(--text-muted);
}
.empty-state h2 { color: var(--text); font-size: 1.05rem; margin-bottom: 0.35rem; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.footer {
    text-align: center; padding: 1rem; color: var(--text-muted);
    border-top: 1px solid var(--border); margin-top: 2rem; font-size: 0.75rem;
}

/* ── Phase 2: admin panel, invites, feedback ────────────────────────────── */
.navbar-admin { border-bottom: 2px solid var(--accent); }

.card-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem; margin: 1.5rem 0;
}
.stat-card {
    display: flex; flex-direction: column; gap: 0.25rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: 1.25rem; text-decoration: none; color: var(--text);
    transition: border-color 0.15s;
}
.stat-card:hover { border-color: var(--accent); }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

.alert-success {
    background: rgba(34,197,94,0.1); border: 1px solid var(--pass);
    color: #86efac; padding: 0.75rem 1rem; border-radius: 6px; margin: 0.75rem 0;
}

.token-box {
    margin-top: 0.5rem; padding: 0.6rem 0.8rem; background: var(--bg);
    border: 1px dashed var(--accent); border-radius: 6px; overflow-wrap: anywhere;
}
.token-box code { color: var(--accent-hover); font-size: 0.9rem; }

.inline-form {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem;
    margin: 1rem 0;
}
.inline-form label { display: flex; flex-direction: column; font-size: 0.8rem; color: var(--text-muted); gap: 0.25rem; }
.inline-form input, .inline-form select {
    background: var(--surface2); color: var(--text);
    border: 1px solid var(--border); border-radius: 4px; padding: 0.4rem 0.5rem;
}

.feedback-form { max-width: 640px; }

.context-strip {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
    margin-bottom: 1rem; color: var(--text-muted); font-size: 0.82rem;
}
.context-strip span {
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 6px; padding: 0.3rem 0.55rem;
}

.btn-small {
    background: var(--surface2); color: var(--text); border: 1px solid var(--border);
    border-radius: 4px; padding: 0.3rem 0.7rem; font-size: 0.8rem; cursor: pointer;
}
.btn-small:hover { border-color: var(--accent); }
.btn-danger { border-color: var(--failed); color: #fca5a5; }
.btn-danger:hover { border-color: var(--blocked); }

.badge {
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 4px; padding: 0.15rem 0.5rem; font-size: 0.8rem;
}
.desc-cell { max-width: 360px; overflow-wrap: anywhere; }
.muted { color: var(--text-muted); }

/* ── Filters panel (structured search) ──────────────────────────────────── */
.search-form-full { margin: 1rem 0 1.5rem; }
.search-row { display: flex; gap: 0.5rem; align-items: center; }
.search-row .search-input { flex: 1; }

.filter-panel {
    margin-top: 0.75rem; background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 1rem;
}
.filter-panel summary {
    cursor: pointer; font-weight: 600; color: var(--text-muted);
    padding: 0.35rem 0;
}
.filter-panel[open] summary { color: var(--accent); }

.filter-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.85rem; margin: 0.75rem 0;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0.75rem 0; }
.filter-group { display: flex; flex-direction: column; gap: 0.3rem; }
.filter-group > label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0; }
.filter-group select, .filter-group input[type="number"] {
    background: var(--surface2); color: var(--text);
    border: 1px solid var(--border); border-radius: 4px; padding: 0.35rem 0.45rem;
}
.filter-group select[multiple] { min-height: 4.5rem; }

.range-row { display: flex; align-items: center; gap: 0.4rem; }
.range-row input[type="number"] { width: 5.5rem; }
.range-row span { color: var(--text-muted); }

.flag-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--text); text-transform: none; letter-spacing: 0; }

.filter-actions { margin: 0.5rem 0 0.25rem; }

/* ── Consent block + legal docs + profile (Dotty-inspired) ──────────────── */
.consent-block {
    margin: 0.5rem 0 1rem; padding: 0.75rem; background: var(--surface2);
    border: 1px solid var(--border); border-radius: 8px;
}
.consent-block .checkbox-label {
    align-items: flex-start; gap: 0.5rem; margin-bottom: 0.6rem; font-size: 0.82rem;
    line-height: 1.4; text-transform: none; letter-spacing: 0;
}
.consent-block input[type="checkbox"] { margin-top: 0.2rem; flex-shrink: 0; }

.legal-doc { max-width: 720px; line-height: 1.6; }
.legal-doc h2 { margin-bottom: 0.25rem; }
.legal-doc h3 { margin: 1.2rem 0 0.4rem; color: var(--accent); font-size: 1rem; }

.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.2rem; height: 2.2rem; border-radius: 50%;
    background: linear-gradient(135deg, #F0ABFC, #D946EF); color: #0d1321;
    font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.avatar-lg { width: 4rem; height: 4rem; font-size: 1.8rem; }
.profile-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.emoji-picker label { cursor: pointer; font-size: 1.3rem; padding: 0.2rem 0.35rem;
    border: 1px solid var(--border); border-radius: 6px; }
.emoji-picker input { display: none; }
.emoji-picker input:checked + span { outline: 2px solid var(--accent); border-radius: 4px; }

.nav-profile { display: flex; align-items: center; gap: 0.5rem; }
.nav-profile:hover { text-decoration: none; }
.nav-profile .avatar { width: 1.8rem; height: 1.8rem; font-size: 0.85rem; }

/* ── Nav dropdowns (CSS-only, CSP-safe via <details>) ───────────────────── */
.nav-menu { position: relative; }
.nav-menu summary { list-style: none; cursor: pointer; -webkit-user-select: none; user-select: none; }
.nav-menu summary::-webkit-details-marker { display: none; }

.nav-menu-btn, .nav-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border-radius: 6px;
    background: var(--surface2); border: 1px solid var(--border);
    color: var(--text); font-size: 1rem;
}
.nav-menu-btn:hover, .nav-icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-profile-btn { display: inline-flex; align-items: center; }

.nav-dropdown {
    position: absolute; top: calc(100% + 0.4rem); left: 0; z-index: 200;
    min-width: 200px; padding: 0.4rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: var(--shadow);
    display: flex; flex-direction: column;
}
.nav-dropdown-right { left: auto; right: 0; }
.nav-dropdown a, .nav-dropdown-logout {
    display: block; width: 100%; text-align: left;
    padding: 0.5rem 0.7rem; border-radius: 6px;
    color: var(--text); font-size: 0.88rem; background: none; border: none; cursor: pointer;
}
.nav-dropdown a:hover, .nav-dropdown-logout:hover { background: var(--surface2); text-decoration: none; color: var(--accent); }
.nav-dropdown-sep { height: 1px; background: var(--border); margin: 0.35rem 0; }
.nav-dropdown-head { padding: 0.5rem 0.7rem; display: flex; flex-direction: column; gap: 0.1rem; border-bottom: 1px solid var(--border); margin-bottom: 0.3rem; }
.nav-dropdown-head .muted { font-size: 0.75rem; }
.nav-dropdown-logout { color: #fca5a5; }

/* ── Help center (FAQs + glossary) ──────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 0.6rem; max-width: 760px; }
.faq-item {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: 0.5rem 1rem;
}
.faq-item summary { cursor: pointer; font-weight: 600; padding: 0.4rem 0; }
.faq-item[open] summary { color: var(--accent); }
.faq-answer { padding: 0.3rem 0 0.6rem; color: var(--text-muted); line-height: 1.6; }

.glossary { max-width: 760px; }
.glossary dt { font-weight: 700; color: var(--accent); margin-top: 1rem; }
.glossary dd { margin: 0.2rem 0 0; color: var(--text-muted); line-height: 1.55; }

.contact-mail { font-size: 1.05rem; }

/* ── Data-update status in top bar ──────────────────────────────────────── */
.nav-data-status {
    display: flex; align-items: center; gap: 0.4rem; margin-left: 1rem;
    font-size: 0.78rem; color: var(--text-muted);
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 6px; padding: 0.25rem 0.6rem; white-space: nowrap;
}
.data-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pass); flex-shrink: 0; }

.save-filter-form { display: flex; gap: 0.5rem; align-items: center; margin: 0.75rem 0; flex-wrap: wrap; }
.save-filter-form input { background: var(--surface2); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 0.35rem 0.5rem; }

/* ── Methodology section ────────────────────────────────────────────────── */
.method-section { margin: 1.5rem 0 2rem; }
.method-section h2 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.method-grid { display: grid; grid-template-columns: minmax(280px, 1fr) 1.2fr; gap: 1.5rem; align-items: start; }
@media (max-width: 720px) { .method-grid { grid-template-columns: 1fr; } }
.method-chart { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; }
.method-notes { margin: 0.5rem 0 0 1.1rem; color: var(--text-muted); line-height: 1.6; }

.plotly-chart { width: 100%; min-height: 220px; }
/* Price-history charts render at a fixed 340px height; keep the container from
   reserving Plotly's larger default so there's no empty band under the line. */
.price-history-panel .plotly-chart { min-height: 0; max-height: 360px; }
.price-history-panel .plotly-chart > .svg-chart { max-height: 340px; }
/* Server-side SVG charts stretch to their container by default (price history,
   choropleth, etc. must be wide). Only the COMPACT bar charts are capped, so a
   wide container doesn't scale their tiny viewBox text into giant numbers — done
   per-figure via .dataviz-narrow, never globally (a global cap squashed the
   full-width ficha price chart). */
.svg-chart { width: 100%; height: auto; }
.svg-chart .svg-label { fill: var(--text); font-size: 12px; }
.svg-chart .svg-val { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.svg-chart .svg-track { fill: var(--surface2); }
/* Zone dividers at the 40/60 thresholds: the NON-colour cue that makes the
   reading zones distinguishable even when the low-alpha fills are imperceptible
   (audit C-1, WCAG 1.4.11). Stroke contrast against the track ≥3:1. */
.svg-chart .svg-zone-divider { stroke: var(--text-muted); stroke-width: 1; opacity: 0.55; }
.svg-chart .svg-zone-tick { fill: var(--text-faint, var(--text-muted)); font-size: 9px; font-variant-numeric: tabular-nums; }
/* Compact bar charts (inflation term structure, small horizontal bars). */
.dataviz-narrow .svg-chart { max-width: 380px; }
.diverge-chart, .wf-chart { max-width: 520px; }
.donut-chart { max-width: 240px; }

/* Metric grid — legible KPI cards with a value, a foot row of explained chips.
   Replaces the cramped region-card for numeric readouts (30d / percentile). */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .7rem; }
.metric-card { display: flex; flex-direction: column; gap: .35rem; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: .8rem .9rem; }
.metric-card .metric-label { color: var(--muted); font-size: .72rem; font-weight: 680; line-height: 1.25; text-transform: uppercase; letter-spacing: .02em; }
.metric-card .metric-value { color: var(--text); font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.metric-card .metric-foot { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; }
.metric-chip { font-size: .72rem; font-weight: 640; color: var(--text-soft); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 999px; padding: .12rem .5rem; white-space: nowrap; }
.metric-chip.chip-up { color: #86efac; border-color: color-mix(in srgb, #22c55e 30%, var(--border)); }
.metric-chip.chip-down { color: #fca5a5; border-color: color-mix(in srgb, #ef4444 30%, var(--border)); }
/* ── Cartera "liga" summary boxes (4×3 matrix) ─────────────────────────── */
.cartera-box-unit { font-size: .8rem; font-weight: 640; color: var(--muted); }
.cartera-grid { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.cartera-box { gap: .5rem; }
.cartera-box-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.cartera-box-top .metric-value { font-size: 1.35rem; }
/* Asset-class composition bar: SVG (width attrs, CSP-safe — no inline styles). */
.asset-bar { display: block; width: 100%; height: 8px; border-radius: 4px; overflow: hidden;
    background: var(--surface-soft); border: 1px solid var(--border); }
.asset-bar rect.ab-eq { fill: #3987e5; }   /* equity  — cat-1 */
.asset-bar rect.ab-rf { fill: #c98500; }   /* r. fija — cat-4 */
.asset-bar rect.ab-mm { fill: #199e70; }   /* monetario — cat-5 */
.asset-bar rect.ab-ot { fill: var(--muted); }
.asset-legend { display: flex; flex-wrap: wrap; gap: .3rem .7rem; font-size: .7rem;
    color: var(--text-soft); font-variant-numeric: tabular-nums; }
.asset-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.asset-legend i { width: .6rem; height: .6rem; border-radius: 2px; display: inline-block; }
.asset-legend i.ab-eq { background: #3987e5; }
.asset-legend i.ab-rf { background: #c98500; }
.asset-legend i.ab-mm { background: #199e70; }
/* Realized 1Y risk/return strip: a hairline separates it from the asset-mix
   legend above, so "already happened" never reads as part of the estimate. */
.cartera-box-realized { border-top: 1px solid var(--border-soft, rgba(255,255,255,.08));
    padding-top: .3rem; margin-top: .1rem; column-gap: .9rem; }
.cartera-box-meta { display: flex; flex-direction: column; gap: .25rem; margin: .15rem 0 0; }
.cartera-box-meta > div { display: grid; grid-template-columns: 4.6rem 1fr; gap: .5rem; }
.cartera-box-meta dt { color: var(--muted); font-size: .7rem; font-weight: 680;
    text-transform: uppercase; letter-spacing: .02em; margin: 0; }
.cartera-box-meta dd { color: var(--text-soft); font-size: .76rem; margin: 0;
    font-variant-numeric: tabular-nums; }
.chart-note { font-size: .76rem; }

/* Single missing-value semantics (R-010): a real absence reads "No disponible",
   muted so it stays quiet inside dense tables (never an ambiguous "—"/"—%"). */
.cell-na { color: var(--muted); font-size: .82em; font-style: italic; }

/* Progressive disclosure for derivatives-idea context (R-007): compact by
   default, expands to rationale/conviction/expiry/worst-scenario on demand. */
.idea-context > summary { cursor: pointer; color: var(--accent); font-size: .8rem; font-weight: 640; }
.idea-context[open] > summary { margin-bottom: .35rem; }
.idea-context-dl { display: flex; flex-direction: column; gap: .25rem; margin: 0; max-width: 34rem; }
.idea-context-dl > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: .5rem; }
.idea-context-dl dt { color: var(--muted); font-size: .72rem; font-weight: 680; text-transform: uppercase; letter-spacing: .02em; }
.idea-context-dl dd { margin: 0; font-size: .82rem; color: var(--text-soft); }

/* Ticker shown as a secondary, muted chip — the company NAME is the primary
   label everywhere (people recognise companies, not tickers). */
.ticker-chip {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  color: var(--muted); background: var(--surface-soft); border: 1px solid var(--border);
  border-radius: 5px; padding: .04rem .34rem; font-variant-numeric: tabular-nums;
}

/* Factor radar (single series, brand accent). Recessive rings/spokes, a
   translucent accent fill, direct value labels — no legend (one series). */
.radar-chart { max-width: 320px; }
.radar-chart .radar-ring { fill: none; stroke: var(--border); stroke-width: 1; opacity: .6; }
.radar-chart .radar-spoke { stroke: var(--border); stroke-width: 1; opacity: .5; }
.radar-chart .radar-area { fill-opacity: .18; stroke-width: 2; stroke-linejoin: round; }
.radar-chart .radar-label { fill: var(--text-soft); font-size: 10.5px; font-weight: 640; }
.radar-chart .radar-val { fill: var(--accent); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.c360-radar-figure { margin: 1rem 0 0; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.c360-radar-figure figcaption { color: var(--text-soft); font-size: .78rem; font-weight: 700; }
.c360-radar-figure figcaption span { color: var(--muted); font-weight: 500; }

/* Donut (parts-of-a-whole, categorical). Slice % labels sit on the ring; the
   legend (built in the template from donut_legend) carries identity so colour is
   never alone. A thin surface ring separates arcs. */
.donut-chart { max-width: 240px; }
.donut-chart path { stroke: var(--bg); stroke-width: 2; }
.donut-slice-label { fill: #fff; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.donut-center-value { fill: var(--text); font-size: 20px; font-weight: 820; font-variant-numeric: tabular-nums; }
.donut-center-label { fill: var(--muted); font-size: 9.5px; font-weight: 680; text-transform: uppercase; letter-spacing: .04em; }
.donut-figure { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; }
.donut-legend { display: flex; flex-direction: column; gap: .35rem; margin: 0; list-style: none; padding: 0; }
.donut-legend li { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--text-soft); }
.donut-legend .swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.donut-legend .leg-pct { margin-left: auto; color: var(--text); font-weight: 760; font-variant-numeric: tabular-nums; }

/* Swatch colours as classes (strict CSP forbids inline style=). One class per
   validated palette hue used by the donut / divergent bars / waterfall legends. */
.swatch-cat-1 { background: #3987e5; }
.swatch-cat-2 { background: #008300; }
.swatch-cat-3 { background: #d55181; }
.swatch-cat-4 { background: #c98500; }
.swatch-cat-5 { background: #199e70; }
.swatch-good  { background: #0ca30c; }
.swatch-bad   { background: #d03b3b; }
.swatch-total { background: #d946ef; }

/* Divergent bars (identity + polarity): favoured grow right (green), avoided
   grow left (red), off a shared centre axis. Icons + legend in the template keep
   it readable without colour (CVD/print). */
.diverge-chart { max-width: 520px; }
.diverge-chart .diverge-axis { stroke: var(--border-strong); stroke-width: 1; }
.diverge-chart .diverge-label { fill: #fff; font-size: 11.5px; font-weight: 720; }
.diverge-legend { display: flex; gap: 1.2rem; margin: .5rem 0 0; font-size: .8rem; color: var(--text-soft); }
.diverge-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.diverge-legend .swatch { width: 11px; height: 11px; border-radius: 3px; }

/* Value-creation waterfall: rises green, falls red, resulting total in the brand
   accent; recessive baseline + connectors, every step directly labelled. */
.wf-chart { max-width: 520px; }
.wf-chart .wf-baseline { stroke: var(--border-strong); stroke-width: 1; }
.wf-chart .wf-connector { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; }
.wf-chart .wf-value { fill: var(--text); font-size: 10.5px; font-weight: 760; font-variant-numeric: tabular-nums; }
.wf-chart .wf-label { fill: var(--text-soft); font-size: 10px; font-weight: 640; }
.dataviz-figure { margin: 1rem 0 0; display: flex; flex-direction: column; gap: .4rem; }
.dataviz-figure figcaption { color: var(--muted); font-size: .78rem; }

/* Section sub-tabs (section-tabs.js) — a sticky strip that filters a long page
   into short views. Built by JS; hidden entirely without JS (all sections show).
   Brand accent on the active tab. */
.section-tabs {
  /* Sticks BELOW the app topbar (which is sticky at top:0, z-index:20), not over
     it — otherwise the strip and the search bar overlap at the top of the page. */
  position: sticky; top: var(--topbar); z-index: 15; display: flex; flex-wrap: wrap; gap: .3rem;
  margin: 0 0 1.4rem; padding: .5rem .25rem;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.section-tab {
  appearance: none; cursor: pointer; border: 1px solid var(--border);
  background: var(--surface-soft); color: var(--muted);
  font: inherit; font-size: .82rem; font-weight: 640;
  padding: .38rem .8rem; border-radius: 999px; white-space: nowrap;
}
.section-tab:hover { color: var(--text); border-color: var(--border-strong); }
.section-tab[aria-selected="true"] {
  color: var(--bg); border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}
.section-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Two-level (grouped) nav: a primary row of ~5 groups + a secondary row of the
   sections inside the active group. Primary is the wayfinding anchor (bigger,
   fewer); secondary is lighter and only appears once a group is chosen. */
.section-tabs-primary { top: var(--topbar); z-index: 16; }
.section-tabs-primary .section-tab { font-size: .9rem; font-weight: 700; padding: .46rem 1rem; }
.section-tabs-secondary {
  top: calc(var(--topbar) + 3rem); z-index: 15; margin-top: -1rem; padding-top: .35rem;
  border-bottom: 1px dashed var(--border);
}
.section-tabs-secondary { align-items: center; }
.section-tabs-secondary .section-tab { font-size: .78rem; padding: .3rem .7rem; }
.section-tabs-secondary .section-tab[aria-selected="true"] {
  background: var(--surface-soft); color: var(--text);
  border-color: var(--accent);
}
/* Concept label before each sub-group of tabs (mail-style separation). */
.section-tab-concept {
  font-size: .62rem; font-weight: 780; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 0 .1rem 0 .15rem; white-space: nowrap;
}
.section-tab-sep {
  display: inline-block; width: 1px; height: 1.1rem; margin: 0 .35rem;
  background: var(--border-strong); flex: none;
}

/* Scrolled-to sections clear the topbar + the sticky strip(s) (scroll-spy). */
[data-section-tabs] > [data-tab-panel] { scroll-margin-top: calc(var(--topbar) + 6rem); }

.dim-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.3rem; }

.quadrant-matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 720px; }
@media (max-width: 560px) { .quadrant-matrix { grid-template-columns: 1fr; } }
.quadrant-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; border-top: 3px solid var(--accent); }
.quadrant-card h3 { font-size: 1rem; margin: 0.4rem 0 0.2rem; }
.quadrant-cp_bajo { border-top-color: #27AE60; }
.quadrant-cp_alto { border-top-color: #F39C12; }
.quadrant-mp_bajo { border-top-color: #2980B9; }
.quadrant-mp_alto { border-top-color: #E74C3C; }

.stat-card.is-disabled { opacity: 0.55; }
.nav-dropdown-section { padding: 0.3rem 0.7rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0; color: var(--text-muted); }

/* ── P&L (saved portfolios) ─────────────────────────────────────────────── */
.pnl-summary { margin: 0.6rem 0; padding: 0.5rem 0.75rem; border-radius: 6px; background: var(--surface2); font-size: 0.9rem; }
.pnl-summary.pnl-pos { border-left: 3px solid var(--pass); }
.pnl-summary.pnl-neg { border-left: 3px solid var(--blocked); }
.row-pnl-pos td:nth-child(5), .row-pnl-pos td:nth-child(6) { color: #86efac; }
.row-pnl-neg td:nth-child(5), .row-pnl-neg td:nth-child(6) { color: #fca5a5; }

@media (max-width: 900px) {
    .nav-links a:nth-child(n+4) { display: none; }
    .home-hero, .home-grid, .decision-panel { grid-template-columns: 1fr; }
    .decision-main { border-right: 0; border-bottom: 1px solid var(--border); padding-right: 0; padding-bottom: 0.8rem; }
    .decision-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .navbar { gap: 0.6rem; padding: 0.65rem 0.8rem; }
    .nav-brand a { font-size: 0.92rem; }
    .nav-links a:nth-child(n+3), .nav-data-status { display: none; }
    .container { padding: 1rem; }
    .search-form, .search-row, .search-form-hero { flex-direction: column; align-items: stretch; }
    .quick-actions, .decision-grid, .kpi-grid { grid-template-columns: 1fr; }
    .company-header { flex-direction: column; }
    .company-meta-right { justify-content: flex-start; }
}

/* ── Atlas — control tower ──────────────────────────────────────────────── */
.global-pulse { border-top: 3px solid var(--accent); }
.pulse-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.7rem; margin-top: 0.6rem; }
.pulse-card { display: flex; flex-direction: column; gap: 0.2rem; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem 0.8rem; }
.pulse-card.pulse-alert { border-color: var(--blocked); }
.pulse-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0; color: var(--text-muted); }
.pulse-value { font-size: 1.15rem; }
.pulse-sub { font-size: 0.76rem; color: var(--text-muted); }
.pulse-sub.pulse-warn { color: var(--warning); font-weight: 600; }
@media (max-width: 900px) { .pulse-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .pulse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.impact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; margin-top: 0.6rem; }
.impact-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 0.9rem; }
.impact-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.impact-head strong { font-size: 1.05rem; }
.impact-signal { background: var(--accent); color: var(--bg); border-radius: 4px; padding: 0.1rem 0.45rem; font-size: 0.72rem; font-weight: 600; }
.impact-sectors { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.6rem; }
.funds-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 0.5rem; }
.fund-list { list-style: none; margin: 0; padding: 0; }
.fund-list li { display: flex; justify-content: space-between; padding: 0.25rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.fund-list li span { color: var(--text-muted); }
@media (max-width: 700px) { .funds-cols { grid-template-columns: 1fr; } }

/* Macro news list (Atlas) — same surface/border idiom as .region-card. */
.news-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.news-item { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem 0.85rem; }
.news-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.news-head a, .news-head strong { font-size: 0.9rem; }
.news-summary { margin: 0.35rem 0 0.25rem; font-size: 0.82rem; }
.news-meta { font-size: 0.78rem; }

.atlas-health { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.atlas-sub { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0; color: var(--text-muted); margin-bottom: 0.5rem; }
.atlas-movers { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 0.8rem; }
.mover-list, .ranking-list { list-style: none; margin: 0; padding: 0; }
.mover-list li { display: flex; justify-content: space-between; padding: 0.25rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.mover-up { color: var(--pass); font-variant-numeric: tabular-nums; font-weight: 600; }
.mover-down { color: var(--blocked); font-variant-numeric: tabular-nums; font-weight: 600; }
.atlas-rankings { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-top: 0.8rem; }
.ranking-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 0.9rem; }
.ranking-list { counter-reset: rk; }
.ranking-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.ranking-list .rk-name { flex: 1; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-list .rk-master { font-variant-numeric: tabular-nums; font-weight: 600; }
.atlas-footnote { margin-top: 1.2rem; font-size: 0.8rem; }
.region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.7rem; margin-top: 0.6rem; }
.region-card { display: flex; flex-direction: column; gap: 0.15rem; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem 0.85rem; }
.region-card .region-count { color: var(--text); font-size: 0.85rem; }
.region-card .region-metrics { color: var(--text-muted); font-size: 0.78rem; }

/* Sector-stress heatmap cells: 1 (worst) -> 5 (best). Subtle tints over the
   dark base; text stays readable. Risk cells pass invert=True at render. */
.heat-1 { background: rgba(239, 68, 68, 0.28); }
.heat-2 { background: rgba(251, 146, 60, 0.24); }
.heat-3 { background: rgba(251, 191, 36, 0.20); }
.heat-4 { background: rgba(132, 204, 22, 0.20); }
.heat-5 { background: rgba(34, 197, 94, 0.26); }
.heat-legend { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.6rem; font-size: 0.76rem; color: var(--text-muted); flex-wrap: wrap; }
/* Only the colour swatches get the fixed box size. `heat-note` also starts with
   "heat-" but is descriptive text, so it must be excluded from this rule. */
.heat-legend span.heat-1, .heat-legend span.heat-2, .heat-legend span.heat-3,
.heat-legend span.heat-4, .heat-legend span.heat-5 {
    display: inline-block; width: 22px; height: 12px; border-radius: 2px;
}
.heat-legend .heat-note { margin-left: 0.6rem; flex: 1 1 auto; min-width: 0; }
.atlas-note { margin-top: 0.7rem; font-size: 0.8rem; line-height: 1.5; }

@media (max-width: 900px) {
    .atlas-health { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .atlas-health, .atlas-movers { grid-template-columns: 1fr; }
}

/* ── Executive summary band (Atlas, decision-first) ───────────────────── */
.exec-band {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 1rem 0;
}
.exec-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.7rem 0.85rem;
}
.exec-card.exec-alert { border-top-color: var(--blocked); }
.exec-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0; color: var(--text-muted); }
.exec-value { font-size: 1.18rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.exec-sub { font-size: 0.74rem; color: var(--text-muted); }
@media (max-width: 900px) { .exec-band { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .exec-band { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Semantic value tints (coverage levels + good/bad values). Functional color. */
.cov-good, .val-good { color: var(--pass); }
.cov-warn, .val-warn { color: var(--warning); }
.cov-bad,  .val-bad  { color: var(--blocked); }
.cov-none { color: var(--text-muted); }

/* ── Data-status legend (what each visual state means) ────────────────── */
.status-legend { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.status-chip {
    font-size: 0.72rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.status-chip.chip-good { border-color: var(--pass); color: var(--pass); }
.status-chip.chip-warn { border-color: var(--warning); color: var(--warning); }
.status-chip.chip-bad  { border-color: var(--blocked); color: var(--blocked); }
.status-chip.chip-none { border-color: var(--border); color: var(--text-muted); }

/* ── Data-health coverage bars ────────────────────────────────────────── */
.coverage-list { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.6rem; }
.coverage-row {
    display: grid;
    grid-template-columns: 150px 1fr 64px 110px;
    align-items: center;
    gap: 0.7rem;
}
.coverage-label { font-size: 0.85rem; }
.coverage-track { background: var(--surface2); border-radius: 999px; height: 12px; overflow: hidden; }
.coverage-fill { height: 100%; border-radius: 999px; background: var(--text-muted); }
.coverage-fill.cov-good { background: var(--pass); }
.coverage-fill.cov-warn { background: var(--warning); }
.coverage-fill.cov-bad  { background: var(--blocked); }
.coverage-val { font-size: 0.85rem; text-align: right; font-variant-numeric: tabular-nums; }
.coverage-count { font-size: 0.76rem; text-align: right; }
@media (max-width: 600px) {
    .coverage-row { grid-template-columns: 1fr 56px; grid-auto-flow: row; }
    .coverage-track { grid-column: 1 / -1; order: 3; }
    .coverage-count { display: none; }
}

/* ── Schematic region exposure map (server-side SVG) ──────────────────── */
.region-map-wrap { max-width: 560px; margin: 0.4rem auto 1rem; }
.region-map { width: 100%; height: auto; display: block; }
.region-map .map-region-label { fill: var(--text); font-size: 3px; font-weight: 600; }
.region-map .map-region-count { fill: var(--bg); font-size: 3.4px; font-weight: 700; }

/* ── Company 360 refactor ─────────────────────────────────────────────── */
.c360-header {
    position: sticky;
    /* Stick BELOW the global topbar (which is also sticky at top:0 with a higher
       z-index), so the ficha badges never overlap the user menu/search bar. */
    top: var(--topbar, 56px);
    z-index: 15;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 0 0.6rem;
    margin: -1rem 0 1rem;   /* hug the container top */
}
.c360-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}
.c360-header h1 { font-size: 1.8rem; }
.c360-header h2 { font-size: 0.95rem; color: var(--text-muted); font-weight: normal; margin-top: 0.15rem; }
.c360-identity-line { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.3rem; }
.c360-datanote {
    margin-top: 0.5rem;
    font-size: 0.74rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border);
    padding-top: 0.4rem;
}
.decision-disclaimer { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.4rem; }
.c360-subhead {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0;
    color: var(--text-muted);
    margin: 0.9rem 0 0.4rem;
}
.c360-hint { font-size: 0.8rem; margin-bottom: 0.6rem; }
.c360-desc { font-size: 0.88rem; line-height: 1.55; color: var(--text); }
.c360-footnote { margin-top: 1.2rem; font-size: 0.78rem; }

/* Risk block: make it visually prominent (left accent + headline score). */
.c360-risk { border-left: 3px solid var(--warning); }
.risk-headline { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.7rem; }
.risk-score { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.c360-qual { grid-column: 1 / -1; }   /* qualitative spans the grid width */
.c360-audit { border-left: 3px solid var(--accent); }

@media (max-width: 600px) {
    .c360-header { position: static; margin-top: 0; }
}

/* ── Market monitor (home dashboard) ─────────────────────────────────── */
.monitor-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; }
.monitor-head h1 { margin: 0 0 0.25rem; }
.monitor-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.1rem; grid-column: span 4; }
.panel-wide { grid-column: span 8; }
.panel-macro, .panel-risk { grid-column: span 6; }
.panel-connect { grid-column: span 4; background: linear-gradient(135deg, rgba(240,171,252,0.10), rgba(217,70,239,0.06)); border-color: rgba(240,171,252,0.35); }
.panel-countries { grid-column: span 4; }
.panel-changed { grid-column: span 8; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.6rem; }
.panel-head h2 { font-size: 1rem; margin: 0; }
.panel-date { font-size: 0.75rem; color: var(--text-muted); }
.panel-sub { font-size: 0.8rem; color: var(--text-muted); margin: 0.8rem 0 0.4rem; text-transform: uppercase; letter-spacing: 0; }
.macro-regime { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.8rem; }
.regime-tag { background: rgba(240,171,252,0.18); color: var(--accent); padding: 0.25rem 0.7rem; border-radius: 999px; font-weight: 700; letter-spacing: 0; }
.metric-row { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.metric { display: flex; flex-direction: column; }
.metric-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; }
.metric-value { font-size: 1.3rem; font-weight: 700; }
.metric-sub { font-size: 0.72rem; color: var(--text-muted); }
.alert-thermo { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.thermo-badge { padding: 0.3rem 0.6rem; border-radius: 6px; font-size: 0.8rem; font-weight: 600; }
.chip-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.chip { padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.78rem; border: 1px solid var(--border); }
.chip-good { background: rgba(34,197,94,0.12); color: var(--pass); }
.chip-bad { background: rgba(239,68,68,0.12); color: var(--blocked); }
.idea-list { list-style: none; padding: 0; margin: 0.3rem 0 0; }
.idea-list li { padding: 0.3rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.idea-dir { display: inline-block; min-width: 44px; text-align: center; padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.72rem; text-transform: uppercase; }
.idea-long { background: rgba(34,197,94,0.15); color: var(--pass); }
.idea-short { background: rgba(239,68,68,0.15); color: var(--blocked); }
.ai-logos { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.6rem 0 1rem; }
.ai-chip { padding: 0.3rem 0.7rem; border-radius: 999px; border: 1px solid rgba(240,171,252,0.3); font-size: 0.82rem; }
.compact-table th, .compact-table td { padding: 0.35rem 0.5rem; font-size: 0.84rem; }
.heat-cell { display: inline-block; min-width: 38px; text-align: center; padding: 0.1rem 0.35rem; border-radius: 4px; font-weight: 600; }
.movers { display: flex; gap: 2rem; flex-wrap: wrap; }
.mover { font-size: 0.85rem; padding: 0.15rem 0; }
.mover.up { color: var(--pass); }
.mover.down { color: var(--blocked); }
@media (max-width: 900px) {
    .panel, .panel-wide, .panel-macro, .panel-risk, .panel-connect, .panel-countries, .panel-changed { grid-column: span 12; }
}

/* ── Active nav tab highlight ────────────────────────────────────────── */
.nav-links a.is-active { color: var(--accent); position: relative; }
.nav-links a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -0.5rem; height: 2px; background: linear-gradient(90deg, #F0ABFC, #D946EF); border-radius: 2px; }

/* ── Human error pages (401/403/404/500) ──────────────────────────────────── */
.error-box { text-align: center; max-width: 460px; }
.error-box .error-code {
    font-size: 3.5rem; font-weight: 700; line-height: 1;
    background: linear-gradient(135deg, #10b981, #0ea5e9);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; margin-bottom: .25rem;
}
.error-box h1 { font-size: 1.25rem; margin: .25rem 0 .5rem; }
.error-box .error-actions {
    display: flex; gap: .75rem; justify-content: center; margin-top: 1.25rem;
    flex-wrap: wrap;
}

/* ── Glossary tooltips on technical terms ─────────────────────────────────── */
.term-tip {
    border-bottom: 1px dotted currentColor; cursor: help;
}

/* ── Company 360: reading-mode toggle ─────────────────────────────────────── */
.view-toggle { display: inline-flex; border: 1px solid var(--border, #2a3445);
    border-radius: 8px; overflow: hidden; margin-left: .5rem; }
.view-toggle .view-btn {
    padding: .25rem .7rem; font-size: .85rem; text-decoration: none;
    color: var(--muted, #94a3b8); background: transparent;
}
.view-toggle .view-btn.is-active {
    background: linear-gradient(135deg, #10b981, #0ea5e9); color: #04121a; font-weight: 600;
}

/* ── Company 360: large verdict + conviction ──────────────────────────────── */
.rec-badge.rec-large { font-size: 1.5rem; padding: .4rem 1rem; }
.decision-conviction { margin: .5rem 0 0; }
.c360-thesis .lead { font-size: 1.05rem; line-height: 1.6; }
.thesis-verdict { border-left: 3px solid #10b981; padding-left: .9rem; margin: 1rem 0; }
.thesis-verdict .eyebrow { color: #10b981; }
.inline-meta { margin-top: 1rem; }

/* ── Company 360: price-vs-value visual bar ───────────────────────────────── */
/* Textual state above the bar so barato/caro is never colour-only (audit
   F-101/C-2). Icon + words carry the reading; the tone is reinforcement. */
.pv-state { display: flex; align-items: center; gap: .4rem; margin: .25rem 0 0; font-size: .9rem; font-weight: 600; }
.pv-state-icon { font-size: .8em; }
.pv-state-good { color: var(--pass, #22c55e); }
.pv-state-bad { color: var(--blocked, #ef4444); }
.pv-state-neutral { color: var(--text-muted); }
.kpi-note { display: block; font-size: .72rem; color: var(--text-muted); font-weight: 400; margin-top: 1px; }
.pv-bar {
    position: relative; height: 14px; border-radius: 7px; margin: .5rem 0 .25rem;
    background: #1a2233; overflow: hidden;
}
.pv-fill { height: 100%; border-radius: 7px 0 0 7px; }
.pv-cheap { background: linear-gradient(90deg, #059669, #10b981); }
.pv-fair  { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.pv-rich  { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.pv-marker {
    position: absolute; top: -3px; width: 2px; height: 20px; background: #e2e8f0;
}
.pv-caption { font-size: .85rem; color: var(--muted, #94a3b8); margin: 0 0 .5rem; }

.c360-mode-hint { margin-top: 1.25rem; padding: .6rem .9rem; background: #131a27;
    border-radius: 8px; }
.c360-mode-hint a { color: #38bdf8; }

/* ── Home onboarding: "¿Qué quieres hacer hoy?" ───────────────────────────── */
.onboarding { margin: 1.25rem 0 1.75rem; }
.onboarding-title { font-size: 1.05rem; margin: 0 0 .75rem; color: var(--muted, #94a3b8); }
.onboarding-grid {
    display: grid; gap: .9rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.onboarding-card {
    display: flex; flex-direction: column; gap: .25rem;
    padding: 1rem 1.1rem; border-radius: 12px; text-decoration: none;
    background: #131a27; border: 1px solid var(--border, #2a3445);
    color: var(--text, #e2e8f0); transition: transform .12s ease, border-color .12s ease;
}
.onboarding-card:hover { transform: translateY(-2px); border-color: #10b981; }
.onboarding-card .ob-icon { font-size: 1.6rem; }
.onboarding-card strong { font-size: 1rem; }

/* ── Narrative dashboard band (Qué pasa → Por qué → Impacto → Acción) ──────── */
.narrative-band {
    display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    background: #0f1623; border: 1px solid var(--border, #2a3445);
    border-radius: 12px; overflow: hidden; margin: 0 0 1.5rem;
}
.narrative-step { padding: 1rem 1.1rem; border-right: 1px solid var(--border, #2a3445); }
.narrative-step:last-child { border-right: none; }
.narrative-step .eyebrow {
    font-size: .72rem; text-transform: uppercase; letter-spacing: 0;
    color: #10b981; display: block; margin-bottom: .35rem;
}
.narrative-step .nstep-value { font-size: 1.05rem; font-weight: 600; display: block; }
.narrative-step .nstep-detail { font-size: .85rem; color: var(--muted, #94a3b8); }
.narrative-step.nstep-action { background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(14,165,233,.12)); }
.narrative-step.nstep-action a { color: #38bdf8; font-weight: 600; text-decoration: none; }

/* -- Nav "Mas" dropdown (replaces the redundant left hamburger menu) -- */
.nav-more { position: relative; display: inline-block; }
.nav-more > summary.nav-more-btn {
    list-style: none; cursor: pointer; padding: .35rem .6rem;
    color: var(--muted, #94a3b8); border-radius: 6px; -webkit-user-select: none; user-select: none;
}
.nav-more > summary.nav-more-btn::-webkit-details-marker { display: none; }
.nav-more > summary.nav-more-btn:hover { color: var(--text, #e2e8f0); }
.nav-more > summary.nav-more-btn.is-active { color: #10b981; }
.nav-more[open] > .nav-dropdown { display: block; }
.nav-more > .nav-dropdown {
    position: absolute; top: 100%; left: 0; min-width: 220px; z-index: 50;
}

/* ── World tile-grid map (macro tier × companies covered) ─────────────────── */
.tilegrid { display: flex; flex-direction: column; gap: 1rem; margin-top: .75rem; }
.tilegrid-region-title {
    font-size: .8rem; text-transform: uppercase; letter-spacing: 0;
    color: var(--muted, #94a3b8); margin: 0 0 .4rem;
}
.tilegrid-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.country-tile {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    min-width: 48px; height: 40px; padding: 0 .35rem; border-radius: 7px;
    text-decoration: none; color: #04121a; font-weight: 700; font-size: .8rem;
    background: var(--tier, #475569);
    border: 1px solid rgba(0,0,0,.25);
    transition: transform .1s ease, box-shadow .1s ease;
}
.country-tile:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 4px 14px rgba(0,0,0,.4); z-index: 2;
}
.country-tile .tile-iso { line-height: 1; }
.country-tile .tile-badge {
    position: absolute; top: -6px; right: -6px;
    background: #0b1220; color: #e2e8f0; font-size: .62rem; font-weight: 600;
    border-radius: 999px; padding: .05rem .3rem; border: 1px solid rgba(255,255,255,.25);
    min-width: 16px; text-align: center;
}
.tilegrid-legend { display: flex; flex-wrap: wrap; gap: .9rem; margin: .5rem 0; }
.tilegrid-legend .legend-item {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .8rem; color: var(--muted, #94a3b8);
}
.tilegrid-legend .legend-swatch {
    width: 14px; height: 14px; border-radius: 4px; display: inline-block;
}
.tilegrid-summary { margin: .25rem 0 .5rem; }

/* ── Systemic cascade banner (home) ───────────────────────────────────────── */
.cascade-banner { margin: 0 0 1.25rem; }
.cascade-banner-main { font-size: 1rem; }
.cascade-regions { display: flex; flex-wrap: wrap; gap: .6rem; margin: .5rem 0 .25rem; }
.cascade-region {
    font-size: .8rem; padding: .15rem .5rem; border-radius: 6px;
    background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.15);
}
.cascade-note { font-size: .8rem; opacity: .85; margin: .35rem 0 0; }

/* ── Country recommendations (atlas) ──────────────────────────────────────── */
.reco-cols { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: .5rem; }
.reco-list { list-style: none; padding: 0; margin: .3rem 0 0; }
.reco-list li { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.reco-list a { color: #38bdf8; text-decoration: none; }
.reco-val { font-weight: 700; margin-left: auto; }
.reco-good { color: #10b981; }
.reco-bad { color: #ef4444; }

/* ============================================================================
   ATLAS DESIGN SYSTEM (migrated from ux_prototype/assets/prototype.css)
   Sidebar shell, layered pages, cards, world map, navigator, drawers.
   Design tokens are unified in the single :root at the top of this file.
   ============================================================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 70% -10%, var(--accent-soft), transparent 28rem),
    var(--bg);
  color: var(--text);
  font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img, svg { max-width: 100%; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 52%, transparent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed; z-index: 1000; top: .75rem; left: .75rem;
  transform: translateY(-180%);
  border-radius: var(--radius-sm); padding: .65rem .9rem;
  background: var(--accent); color: #18101b; font-weight: 800; text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }
.prototype-ribbon {
  position: fixed; z-index: 80; right: 18px; bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 999px; padding: .35rem .65rem;
  background: color-mix(in srgb, var(--surface-raised) 92%, transparent);
  color: var(--muted); box-shadow: var(--shadow); font-size: .68rem;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

/* Shell */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar);
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  overflow-y: auto; overscroll-behavior: contain;
}
.brand {
  min-height: var(--topbar); display: flex; align-items: center; gap: .72rem;
  border-bottom: 1px solid var(--border); padding: 0 1.05rem;
  font-size: 1.02rem; font-weight: 850; letter-spacing: 0; text-decoration: none;
}
.brand-mark {
  width: 33px; height: 33px; flex: 0 0 auto;
  object-fit: contain; display: block;
}
.auth-title { display: inline-flex; align-items: center; gap: .5rem; }
.auth-logo { object-fit: contain; vertical-align: middle; flex: 0 0 auto; }
.auth-full-logo { display: block; height: auto; width: clamp(150px, 45%, 200px); margin: 0 auto .4rem; }
.landing-hero-logo {
  display: block; width: clamp(82px, 8vw, 118px); height: auto; margin: 0;
  aspect-ratio: 817 / 840; object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .28));
}
.brand small {
  display: block; color: var(--muted); font-size: .64rem; font-weight: 700;
  letter-spacing: 0; text-transform: uppercase;
}
.nav-label {
  margin: 1.15rem 1.05rem .42rem; color: var(--muted);
  font-size: .67rem; font-weight: 850; letter-spacing: 0; text-transform: uppercase;
}
.side-nav { display: grid; gap: .2rem; padding: 0 .65rem; }
.nav-item {
  min-height: 44px; display: flex; align-items: center; gap: .7rem;
  border: 1px solid transparent; border-radius: 10px; padding: .52rem .66rem;
  color: var(--muted); font-weight: 680; text-decoration: none;
}
.nav-item:hover { border-color: var(--border); background: var(--surface-soft); color: var(--text); }
.nav-item.is-active {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
  background: var(--accent-soft); color: var(--text);
}
.nav-icon { width: 22px; color: var(--text-soft); text-align: center; font-size: 1rem; }
.nav-item.is-active .nav-icon { color: var(--accent); }
.nav-count {
  min-width: 21px; margin-left: auto; border-radius: 999px;
  background: var(--surface-soft); padding: .04rem .36rem; color: var(--muted);
  font-size: .68rem; text-align: center;
}
.sidebar-status {
  margin: auto .72rem .72rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-soft); padding: .78rem;
}
.sidebar-status strong { display: block; font-size: .78rem; }
.sidebar-status span { color: var(--muted); font-size: .7rem; }
.progress { height: 5px; margin: .6rem 0 .35rem; overflow: hidden; border-radius: 999px; background: var(--border); }
.progress > span { display: block; width: var(--progress, 85%); height: 100%; border-radius: inherit; background: var(--pass); }

.main-shell { min-height: 100vh; margin-left: var(--sidebar); }
.topbar {
  position: sticky; top: 0; z-index: 20; min-height: var(--topbar);
  display: grid; grid-template-columns: minmax(260px, 620px) auto; align-items: center; gap: 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  padding: .72rem clamp(1rem, 2.4vw, 2rem); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.global-search { position: relative; display: block; min-width: 0; }
.global-search input {
  width: 100%; min-width: 0; height: 44px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); padding: 0 6rem 0 2.65rem;
}
.global-search input::placeholder { color: var(--muted); }
.search-symbol { position: absolute; top: 50%; left: .9rem; transform: translateY(-50%); color: var(--muted); }
.search-hint {
  position: absolute; top: 50%; right: .65rem; transform: translateY(-50%);
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface-soft);
  padding: .1rem .38rem; color: var(--muted); font-size: .68rem;
}
.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: .48rem; }
.icon-button, .profile-button {
  min-height: 42px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); color: var(--text-soft); cursor: pointer;
}
.icon-button { width: 42px; display: grid; place-items: center; }
.icon-button:hover { border-color: var(--border-strong); color: var(--accent); }
.profile-button { display: flex; align-items: center; gap: .55rem; padding: .25rem .55rem .25rem .34rem; color: var(--text); }
.avatar {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 9px; background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #19101c; font-size: .72rem; font-weight: 850;
}
.profile-copy { text-align: left; line-height: 1.15; }
.profile-copy strong { display: block; font-size: .75rem; }
.profile-copy span { color: var(--muted); font-size: .64rem; }
.mobile-nav { display: none; }

main { width: min(1540px, 100%); margin: 0 auto; padding: clamp(1rem, 2.4vw, 2rem); }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.8rem;
}
.page-head h1 { margin: 0 0 .28rem; font-size: 2rem; line-height: 1.12; letter-spacing: 0; }
.page-head p { max-width: 760px; margin: 0; color: var(--muted); }
.eyebrow {
  display: block; margin-bottom: .2rem; color: var(--accent);
  font-size: .68rem; font-weight: 850; letter-spacing: 0; text-transform: uppercase;
}
.snapshot-pill {
  display: flex; align-items: center; gap: .62rem; flex: 0 0 auto;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: .62rem .75rem;
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pass); box-shadow: 0 0 0 4px var(--pass-soft); }
.snapshot-pill strong { display: block; font-size: .75rem; }
.snapshot-pill span { display: block; color: var(--muted); font-size: .66rem; }

/* Layered page rhythm */
.layer { margin-top: 3.5rem; }
.layer:first-of-type { margin-top: 0; }
.layer-heading {
  /* A 3rd auto track holds the optional trailing <span class="layer-divider">
     (Hall of Fame sections add it). With only 2 tracks the grid dropped that 3rd
     child to a new row and staggered the whole section. The 3rd track collapses
     to 0 when there is no divider, so 2-child headings elsewhere are unaffected.
     No :has() needed → works on any grid-capable browser. */
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem;
  margin-bottom: 1rem;
}
.layer-index {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft);
  color: var(--accent); font-size: .69rem; font-weight: 850;
}
.layer-heading h2 { margin: 0; font-size: 1rem; letter-spacing: 0; }
.layer-heading p { margin: .08rem 0 0; color: var(--muted); font-size: .74rem; }
.layer-divider { height: 1px; margin: 0 0 0 1rem; background: linear-gradient(90deg, var(--border), transparent); }
.strategic-layer .layer-index { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.tactical-layer .layer-index { color: var(--info); background: var(--info-soft); }
.operational-layer .layer-index { color: var(--muted); }

/* Components */
.card {
  min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-raised) 98%, var(--accent) 2%), var(--surface));
  box-shadow: var(--shadow);
}
.card-pad { padding: 1rem; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.card-title { margin: 0; font-size: .96rem; letter-spacing: 0; }
.card-subtitle { margin: .1rem 0 0; color: var(--muted); font-size: .73rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.grid-main-aside { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .72fr); gap: 1rem; }
.stack { display: grid; align-content: start; gap: 1rem; }

.hero-card { position: relative; overflow: hidden; padding: 1.25rem; }
.hero-card::after {
  content: ""; position: absolute; width: 300px; height: 300px; top: -205px; right: -90px;
  border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%);
  pointer-events: none;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem; }
.hero-card h2 { margin: 0 0 .48rem; max-width: 850px; font-size: 1.5rem; line-height: 1.28; letter-spacing: 0; }
.hero-card p { max-width: 850px; margin: 0; color: var(--text-soft); line-height: 1.7; }
.confidence {
  min-width: 106px; align-self: start; border: 1px solid color-mix(in srgb, var(--pass) 35%, var(--border));
  border-radius: 12px; background: var(--pass-soft); padding: .7rem; text-align: center;
}
.confidence strong { display: block; color: var(--pass); font-size: 1.22rem; }
.confidence span { color: var(--muted); font-size: .64rem; font-weight: 750; letter-spacing: 0; text-transform: uppercase; }
.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; margin-top: 1.15rem; }
.metric { border-top: 1px solid var(--border); padding-top: .68rem; }
.metric span { display: block; color: var(--muted); font-size: .68rem; }
.metric strong { display: block; margin-top: .08rem; font-size: .9rem; }
.metric-zone { display: inline-block; margin-left: .35rem; padding: .04rem .42rem; border-radius: 999px; background: var(--surface-soft); border: 1px solid var(--border); color: var(--muted); font-size: .62rem; font-weight: 600; vertical-align: middle; }
.metric-card { border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); padding: .8rem; }
.metric-card span { display: block; color: var(--muted); font-size: .68rem; }
.metric-card strong { display: block; margin-top: .2rem; font-size: 1.12rem; }
.metric-card small { color: var(--muted); font-size: .65rem; }
.tone-good { color: var(--pass) !important; }
.tone-warn { color: var(--warning) !important; }
.tone-bad { color: var(--blocked) !important; }
.tone-neutral { color: var(--muted); }
.tone-info { color: var(--info) !important; }

.badge {
  display: inline-flex; align-items: center; min-height: 24px;
  border: 1px solid transparent; border-radius: 999px; padding: .12rem .48rem;
  font-size: .65rem; font-weight: 820; letter-spacing: 0; white-space: nowrap;
}
.badge-buy, .badge-pass { border-color: color-mix(in srgb, var(--pass) 28%, transparent); background: var(--pass-soft); color: var(--pass); }
.badge-hold { border-color: color-mix(in srgb, var(--info) 28%, transparent); background: var(--info-soft); color: var(--info); }
.badge-watch { border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: var(--accent-soft); color: var(--accent); }
.badge-warning, .badge-noiniciar { border-color: color-mix(in srgb, var(--warning) 28%, transparent); background: var(--warning-soft); color: var(--warning); }
.badge-blocked, .badge-sell { border-color: color-mix(in srgb, var(--blocked) 28%, transparent); background: var(--blocked-soft); color: var(--blocked); }
.badge-neutral { border-color: var(--border); background: var(--surface-soft); color: var(--muted); }

.button, .button-primary, .button-danger {
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  border: 1px solid var(--border); border-radius: 9px; padding: .44rem .72rem;
  cursor: pointer; font-size: .73rem; font-weight: 780; text-decoration: none;
}
.button { background: var(--surface-soft); color: var(--text-soft); }
.button:hover { border-color: var(--border-strong); color: var(--text); }
.button-primary { border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: #1a101d; }
.button-danger { background: var(--blocked-soft); color: var(--blocked); border-color: color-mix(in srgb, var(--blocked) 30%, var(--border)); }
.button[disabled], .button-primary[disabled] { opacity: .5; cursor: not-allowed; }
.button-row { display: flex; flex-wrap: wrap; gap: .5rem; }

.attention-list, .activity-list, .simple-list { display: grid; gap: .58rem; }
.attention-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .7rem;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); padding: .72rem;
}
.attention-icon {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font-weight: 850;
}
.attention-icon.warn { background: var(--warning-soft); color: var(--warning); }
.attention-icon.info { background: var(--info-soft); color: var(--info); }
.attention-icon.bad { background: var(--blocked-soft); color: var(--blocked); }
.attention-item strong { display: block; font-size: .79rem; }
.attention-item p { margin: .08rem 0 0; color: var(--muted); font-size: .7rem; }
.attention-meta { color: var(--muted); font-size: .65rem; white-space: nowrap; }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.quick-action {
  min-height: 74px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-soft); color: var(--text); padding: .7rem; text-align: left; cursor: pointer; text-decoration: none;
}
.quick-action:hover { border-color: var(--accent); transform: translateY(-1px); }
.quick-action strong { display: block; font-size: .76rem; }
.quick-action span { display: block; margin-top: .1rem; color: var(--muted); font-size: .66rem; }

.table-tools { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  min-height: 30px; display: inline-flex; align-items: center; gap: .3rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-soft);
  color: var(--text-soft); padding: .22rem .55rem; font-size: .68rem;
}
button.chip { cursor: pointer; }
.chip.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip .remove { color: var(--muted); }
.table-wrap { overflow: auto; border-top: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { border-bottom: 1px solid var(--border); padding: .7rem .82rem; text-align: left; white-space: nowrap; }
th {
  position: sticky; top: 0; z-index: 2; background: var(--surface);
  color: var(--muted); font-size: .65rem; letter-spacing: 0; text-transform: uppercase;
}
tbody tr:hover { background: var(--surface-soft); }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; }
.company-cell { min-width: 205px; white-space: normal; }
.company-cell strong { display: block; color: var(--text); font-size: .78rem; }
.company-cell span { color: var(--muted); font-size: .67rem; }
.ticker { color: var(--accent); font-weight: 830; }
.row-link { color: var(--accent); font-weight: 720; text-decoration: none; }
.table-compact th, .table-compact td { padding-top: .45rem; padding-bottom: .45rem; }
.empty-state { padding: 2rem 1rem; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: .2rem; color: var(--text); }

.segmented {
  display: inline-flex; overflow: hidden; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface-soft);
}
.segmented button {
  min-height: 34px; border: 0; border-left: 1px solid var(--border);
  background: transparent; color: var(--muted); padding: .3rem .56rem; cursor: pointer; font-size: .68rem;
}
.segmented button:first-child { border-left: 0; }
.segmented button.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 800; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.form-field { display: grid; gap: .32rem; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: var(--muted); font-size: .7rem; font-weight: 720; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; min-height: 42px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-soft); color: var(--text); padding: .55rem .65rem;
}
.form-field textarea { min-height: 128px; resize: vertical; }
.form-hint { color: var(--muted); font-size: .65rem; }
.context-strip {
  display: flex; flex-wrap: wrap; gap: .55rem 1rem; margin-bottom: 1rem;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); padding: .65rem;
  color: var(--muted); font-size: .7rem;
}

.alert {
  border: 1px solid var(--border); border-left-width: 4px;
  border-radius: 11px; padding: .75rem .85rem; background: var(--surface-soft);
}
.alert-warning { border-left-color: var(--warning); background: var(--warning-soft); }
.alert-critical { border-left-color: var(--blocked); background: var(--blocked-soft); }
.alert-info { border-left-color: var(--info); background: var(--info-soft); }
.alert strong { display: block; margin-bottom: .12rem; font-size: .78rem; }
.alert p { margin: 0; color: var(--text-soft); font-size: .7rem; }

.bar-list { display: grid; gap: .65rem; }
.bar-row { display: grid; grid-template-columns: minmax(105px, 1fr) 1.4fr auto; align-items: center; gap: .6rem; font-size: .7rem; }
.bar-track { height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.bar-fill { height: 100%; width: var(--value, 50%); border-radius: inherit; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.bar-fill.warn { background: var(--warning); }
.bar-fill.bad { background: var(--blocked); }
.bar-fill.good { background: var(--pass); }

/* World map */
.world-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(270px, .55fr); gap: 1rem; }
.world-card { overflow: hidden; }
.map-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid var(--border); padding: .85rem 1rem;
}
.map-stage {
  position: relative; min-height: 440px; display: grid; place-items: center;
  overflow: hidden; background:
    linear-gradient(color-mix(in srgb, var(--border) 35%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--border) 35%, transparent) 1px, transparent 1px),
    radial-gradient(circle at 50% 45%, var(--surface-soft), var(--surface));
  background-size: 62px 62px, 62px 62px, auto;
}
/* Fluid: the SVG viewBox scales to the container width. No min-width, so the
   map fits any screen instead of forcing horizontal scroll on mobile (M3). */
.world-map { width: 100%; height: auto; padding: 1rem; }
.world-map .continent {
  fill: color-mix(in srgb, var(--info) 25%, var(--surface-soft));
  stroke: color-mix(in srgb, var(--info) 42%, var(--border));
  stroke-width: 2; transition: fill .16s ease, transform .16s ease, opacity .16s ease; cursor: pointer;
}
.world-map .continent:hover, .world-map .continent.is-active {
  fill: color-mix(in srgb, var(--accent) 45%, var(--surface-soft));
  stroke: var(--accent);
}
.world-map .continent.risk-high { fill: color-mix(in srgb, var(--blocked) 30%, var(--surface-soft)); }
.world-map .continent.risk-medium { fill: color-mix(in srgb, var(--warning) 28%, var(--surface-soft)); }
.world-map .continent.risk-low { fill: color-mix(in srgb, var(--pass) 24%, var(--surface-soft)); }
.world-map .map-dot { stroke: var(--surface); stroke-width: 3; cursor: pointer; }
.world-map .map-dot.good { fill: var(--pass); }
.world-map .map-dot.warn { fill: var(--warning); }
.world-map .map-dot.bad { fill: var(--blocked); }
.world-map text { fill: var(--text-soft); font-size: 16px; font-weight: 720; pointer-events: none; }
.map-legend { display: flex; gap: .7rem; flex-wrap: wrap; color: var(--muted); font-size: .66rem; }
.legend-dot { width: 8px; height: 8px; display: inline-block; margin-right: .25rem; border-radius: 50%; }
/* Company price chart — reference-index legend (chips below the chart). */
.c360-overlay-legend { display: flex; flex-wrap: wrap; gap: .45rem; margin: .6rem 0 .2rem; }
.legend-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .28rem .6rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-soft);
  color: var(--text); font-size: .72rem; font-weight: 600;
}
.legend-dot.legend-index { background: #38BDF8; }
.legend-dot.legend-price { background: #D946EF; }
.legend-dot.legend-commodity { background: #FBBF24; }
/* Per-period change strip reuses the score-strip grid but stays compact. */
.c360-period-strip { margin-top: .55rem; }
.region-detail { min-height: 100%; }
.region-detail h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.region-detail > p { color: var(--muted); }
.region-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: 1rem 0; }

/* Company 360 */
.company-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.company-identity h1 { margin: 0; font-size: 2rem; letter-spacing: 0; }
.company-identity h2 { margin: .15rem 0 .3rem; font-size: 1rem; color: var(--text-soft); }
.company-identity p { margin: 0; color: var(--muted); font-size: .72rem; }
.decision-grid { display: grid; grid-template-columns: minmax(220px, .65fr) minmax(0, 1.35fr); gap: 1rem; }
.verdict-card { display: grid; align-content: space-between; min-height: 230px; }
.verdict-card .big-verdict { font-size: 1.45rem; }
.decision-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.fact { border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); padding: .72rem; }
.fact span { display: block; color: var(--muted); font-size: .66rem; }
.fact strong { display: block; margin-top: .14rem; font-size: .8rem; }
.score-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .65rem; }
.score-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); padding: .72rem; }
.score-card span { display: block; color: var(--muted); font-size: .65rem; }
.score-card strong { display: block; margin-top: .15rem; font-size: 1.1rem; }
.score-track { height: 5px; margin-top: .45rem; overflow: hidden; border-radius: 999px; background: var(--border); }
.score-track span { width: var(--score, 50%); height: 100%; border-radius: inherit; background: var(--accent); }
.timeline { position: relative; display: grid; gap: .8rem; padding-left: 1.1rem; }
.timeline::before { content: ""; position: absolute; top: .3rem; bottom: .3rem; left: .27rem; width: 1px; background: var(--border); }
.timeline-item { position: relative; }
.timeline-item::before {
  content: ""; position: absolute; top: .35rem; left: -1.05rem; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-item strong { display: block; font-size: .76rem; }
.timeline-item p { margin: .1rem 0 0; color: var(--muted); font-size: .68rem; }

/* Auth */
.auth-page {
  min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .8fr) minmax(0, 1.2fr);
  background: var(--bg);
}
.auth-panel { display: grid; align-content: center; padding: clamp(1.5rem, 5vw, 5rem); }
.auth-box { width: min(410px, 100%); margin: 0 auto; }
.auth-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 2.2rem; font-size: 1.1rem; font-weight: 850; }
.auth-box h1 { margin: 0 0 .4rem; font-size: 1.75rem; letter-spacing: 0; }
.auth-box > p { color: var(--muted); }
.auth-box .form-field { margin-top: .85rem; }
.auth-box .button-primary { width: 100%; margin-top: 1rem; }
.auth-links { display: flex; justify-content: space-between; gap: 1rem; margin-top: .8rem; color: var(--muted); font-size: .68rem; }
.auth-visual {
  position: relative; display: grid; align-content: center; overflow: hidden;
  border-left: 1px solid var(--border); padding: clamp(2rem, 5vw, 5rem);
  background: radial-gradient(circle at 20% 30%, var(--accent-soft), transparent 30rem), var(--surface);
}
.auth-visual h2 { max-width: 720px; margin: 0 0 .8rem; font-size: 2.65rem; line-height: 1.08; letter-spacing: 0; }
.auth-visual p { max-width: 650px; color: var(--text-soft); font-size: .95rem; line-height: 1.7; }
.auth-preview { margin-top: 2rem; border: 1px solid var(--border); border-radius: 18px; background: color-mix(in srgb, var(--surface-raised) 84%, transparent); padding: 1rem; box-shadow: var(--shadow); }

/* Admin */
.admin-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.admin-nav { display: flex; gap: .4rem; flex-wrap: wrap; }
.admin-nav a { text-decoration: none; }

.toast {
  position: fixed; z-index: 70; top: calc(var(--topbar) + 1rem); right: 1rem;
  max-width: 360px; transform: translateY(-16px); opacity: 0; pointer-events: none;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-raised);
  box-shadow: var(--shadow); padding: .75rem .9rem; transition: opacity .16s ease, transform .16s ease;
}
.toast.is-visible { transform: translateY(0); opacity: 1; }
.compare-tray {
  position: fixed; z-index: 60; right: 1rem; bottom: 1rem; width: min(430px, calc(100vw - 2rem));
  display: none; align-items: center; gap: .7rem; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 14px; background: var(--surface-raised); box-shadow: 0 22px 60px rgba(0,0,0,.38); padding: .7rem;
}
.compare-tray.is-visible { display: flex; }
.compare-tray div { min-width: 0; flex: 1; }
.compare-tray strong, .compare-tray span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-tray strong { font-size: .75rem; }
.compare-tray span { color: var(--muted); font-size: .65rem; }

/* Public landing */
.public-page { min-height: 100vh; background: radial-gradient(circle at 75% 0, var(--accent-soft), transparent 30rem), var(--bg); }
.public-nav {
  position: sticky; top: 0; z-index: 20; min-height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid var(--border); padding: .75rem clamp(1rem, 5vw, 4.5rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.public-links { display: flex; align-items: center; gap: .5rem; }
.public-main { width: min(1180px, 100%); margin: 0 auto; padding: clamp(2rem, 7vw, 6.5rem) 1rem 4rem; }
.public-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); align-items: center; gap: clamp(2rem, 6vw, 5rem); }
.public-hero h1 { margin: .4rem 0 1rem; font-size: 4.35rem; line-height: .98; letter-spacing: 0; }
.public-hero p { max-width: 680px; color: var(--text-soft); font-size: 1rem; line-height: 1.75; }
.public-proof {
  border: 1px solid var(--border); border-radius: 22px; padding: 1rem;
  background: linear-gradient(160deg, var(--surface-raised), var(--surface)); box-shadow: var(--shadow);
}
.public-section { margin-top: 6rem; }
.public-section-head { max-width: 720px; margin-bottom: 1.4rem; }
.public-section-head h2 { margin: .2rem 0 .45rem; font-size: 2.05rem; letter-spacing: 0; }
.public-section-head p { color: var(--muted); }
.public-footer { border-top: 1px solid var(--border); margin-top: 5rem; padding: 1.5rem 0; color: var(--muted); font-size: .72rem; }

/* Atlas Navigator */
.navigator-summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem;
}
.asset-tabs {
  display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: thin;
  border-bottom: 1px solid var(--border); padding: 0 1rem;
}
.asset-tab {
  min-height: 52px; flex: 0 0 auto; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--muted); padding: .6rem .8rem; cursor: pointer; font-weight: 740;
}
.asset-tab:hover { color: var(--text); }
.asset-tab.is-active { border-bottom-color: var(--accent); color: var(--accent); }
.navigator-workspace { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 620px; }
.filter-rail { border-right: 1px solid var(--border); padding: 1rem; background: color-mix(in srgb, var(--surface-soft) 45%, transparent); }
.filter-rail-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1rem; }
.filter-rail-head h3 { margin: 0; font-size: .85rem; }
.filter-stack { display: grid; gap: .8rem; }
.filter-stack .form-field select, .filter-stack .form-field input { min-height: 38px; font-size: .72rem; }
.range-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.macro-filter-group {
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 12px; background: var(--accent-soft); padding: .7rem;
}
.macro-filter-group > strong { display: block; margin-bottom: .55rem; color: var(--accent); font-size: .7rem; letter-spacing: 0; text-transform: uppercase; }
.navigator-results { min-width: 0; }
.navigator-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .7rem; flex-wrap: wrap; padding: .85rem 1rem; }
.saved-view-row { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .2rem; }
.saved-view {
  min-height: 34px; display: inline-flex; align-items: center; gap: .35rem; flex: 0 0 auto;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft);
  color: var(--text-soft); padding: .35rem .58rem; cursor: pointer; font-size: .67rem;
}
.saved-view:hover, .saved-view.is-active { border-color: var(--accent); color: var(--accent); }
.saved-view small { color: var(--muted); }
.navigator-table td { vertical-align: middle; }
.detail-trigger {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft);
  color: var(--accent); cursor: pointer; font-weight: 850;
}
.detail-trigger:hover { border-color: var(--accent); }
.result-kind { color: var(--muted); font-size: .65rem; }
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 90; display: none; background: rgba(0, 0, 0, .56); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.drawer-backdrop.is-open { display: block; }
.detail-drawer {
  position: fixed; inset: 0 0 0 auto; z-index: 100; width: min(600px, 94vw);
  transform: translateX(102%); overflow-y: auto;
  border-left: 1px solid var(--border); background: var(--bg); box-shadow: -25px 0 70px rgba(0,0,0,.4);
  transition: transform .2s ease;
}
.detail-drawer.is-open { transform: translateX(0); }
.drawer-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 92%, transparent);
  padding: 1rem; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.drawer-head h2 { margin: .15rem 0 0; font-size: 1.25rem; }
.drawer-content { display: grid; gap: 1rem; padding: 1rem; }
.drawer-section { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: .9rem; }
.drawer-section h3 { margin: 0 0 .65rem; font-size: .84rem; }
.dimension-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.dimension {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); padding: .58rem;
}
.dimension span { display: block; color: var(--muted); font-size: .61rem; }
.dimension strong { display: block; margin-top: .12rem; font-size: .82rem; }
.mini-chart { width: 100%; min-height: 180px; }
.mini-chart .chart-grid { stroke: var(--border); stroke-width: 1; }
.mini-chart .chart-area { fill: var(--accent-soft); }
.mini-chart .chart-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mini-chart text { fill: var(--muted); font-size: 10px; }
.aggregate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.impact-list { display: grid; gap: .45rem; }
.impact-row { display: grid; grid-template-columns: minmax(100px, .7fr) minmax(0, 1fr) auto; align-items: center; gap: .55rem; font-size: .68rem; }
.impact-row .bar-track { height: 6px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.glossary-panel {
  position: fixed; inset: var(--topbar) 0 0 auto; z-index: 85; width: min(460px, 94vw);
  transform: translateX(102%); overflow-y: auto;
  border-left: 1px solid var(--border); background: var(--surface); padding: 1rem; transition: transform .2s ease;
}
.glossary-panel.is-open { transform: translateX(0); }
.glossary-search { position: sticky; top: -1rem; z-index: 2; background: var(--surface); padding: 1rem 0 .65rem; }
.glossary-list { display: grid; gap: .55rem; }
.glossary-entry { border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); padding: .7rem; }
.glossary-entry dt { font-weight: 820; }
.glossary-entry dd { margin: .18rem 0 0; color: var(--muted); font-size: .68rem; }
.save-view-dialog {
  position: fixed; inset: 50% auto auto 50%; z-index: 110; width: min(440px, calc(100vw - 2rem));
  display: none; transform: translate(-50%, -50%);
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface-raised); box-shadow: var(--shadow); padding: 1rem;
}
.save-view-dialog.is-open { display: block; }

/* Hierarchical map */
.map-stage.is-zoomed .continent:not(.is-active) { opacity: .12; }
.map-stage.is-zoomed .continent.is-active { stroke-width: 3; }
.country-layer { opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.map-stage.is-zoomed .country-layer.is-active { opacity: 1; pointer-events: auto; }
.country-point { cursor: pointer; }
.country-point circle { r: 5px; fill: var(--surface-raised); stroke: var(--accent); stroke-width: 1.5; }
.country-point:hover circle, .country-point.is-active circle { fill: var(--accent); }
.country-point text { fill: var(--text); font-size: 7px; font-weight: 800; text-anchor: middle; }
.map-back { display: none; }
.map-stage.is-zoomed + .map-back, .map-back.is-visible { display: inline-flex; }
.country-selector { display: flex; flex-wrap: wrap; gap: .38rem; margin: .7rem 0; }
.country-button {
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-soft);
  color: var(--text-soft); padding: .26rem .5rem; cursor: pointer; font-size: .65rem;
}
.country-button:hover, .country-button.is-active { border-color: var(--accent); color: var(--accent); }
.country-brief { display: grid; gap: .7rem; }
.country-brief h3 { margin: 0; }
.country-tags { display: flex; flex-wrap: wrap; gap: .35rem; }

/* Glossary page */
.glossary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.glossary-card { border: 1px solid var(--border); border-radius: 13px; background: var(--surface); padding: .85rem; }
.glossary-card h3 { margin: 0 0 .25rem; font-size: .84rem; }
.glossary-card p { margin: 0; color: var(--muted); font-size: .7rem; }
.dimension-family { margin-top: 1.5rem; }
.dimension-family-head { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .65rem; }
.dimension-family-head h2 { margin: 0; font-size: .95rem; }

@media (max-width: 1180px) {
  :root { --sidebar: 78px; }
  .brand-copy, .nav-item > span:not(.nav-icon):not(.nav-count), .nav-label, .sidebar-status { display: none; }
  .brand, .nav-item { justify-content: center; }
  .nav-item { position: relative; padding: .52rem; }
  .nav-count { position: absolute; top: 3px; right: 4px; }
  .grid-main-aside, .world-layout { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .navigator-workspace { grid-template-columns: 235px minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .grid-4, .admin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decision-grid { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .public-hero { grid-template-columns: 1fr; }
  .navigator-workspace { grid-template-columns: 1fr; }
  .filter-rail { border-right: 0; border-bottom: 1px solid var(--border); }
  .filter-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .macro-filter-group { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  :root { --topbar: 64px; }
  .sidebar { display: none; }
  /* Leave room for the fixed bottom-nav + the iOS home-indicator (safe area). */
  .main-shell { margin-left: 0; padding-bottom: calc(70px + var(--sab)); }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; padding: .62rem .8rem; }
  .profile-button { display: none; }
  main { padding: 1rem .8rem 1.5rem; }
  .mobile-nav {
    position: fixed; inset: auto 0 0; z-index: 40;
    /* Grow the bar by the home-indicator inset and pad its contents up off it. */
    height: calc(64px + var(--sab)); padding-bottom: var(--sab);
    display: grid; grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 96%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  }
  .mobile-nav a { display: grid; place-items: center; gap: .05rem; color: var(--muted); font-size: .6rem; text-decoration: none; }
  .mobile-nav a.is-active { color: var(--accent); }
  .mobile-nav b { font-size: 1rem; }
  /* "Más" cell: a <details> whose <summary> matches the sibling links and whose
     panel opens upward as a real menu (was a broken direct link to /methodology). */
  .mobile-more { position: relative; display: grid; place-items: center; }
  .mobile-more > summary {
    display: grid; place-items: center; gap: .05rem; list-style: none;
    color: var(--muted); font-size: .6rem; cursor: pointer; width: 100%; height: 100%;
  }
  .mobile-more > summary::-webkit-details-marker { display: none; }
  .mobile-more > summary.is-active { color: var(--accent); }
  .mobile-more > summary b { font-size: 1rem; }
  .mobile-more[open] > summary { color: var(--accent); }
  .mobile-more-sheet {
    position: absolute; bottom: calc(100% + .4rem); right: .4rem; min-width: 190px;
    display: grid; gap: .1rem; padding: .4rem; z-index: 50;
    background: var(--surface-raised); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .mobile-more-sheet a {
    display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem;
    border-radius: var(--radius-sm); color: var(--text-soft); font-size: .8rem;
    text-decoration: none;
  }
  .mobile-more-sheet a.is-active { color: var(--accent); background: var(--accent-soft); }
  .mobile-more-sheet .nav-icon { width: 1.1rem; text-align: center; }
  .page-head, .company-head { align-items: stretch; flex-direction: column; }
  .snapshot-pill { width: 100%; }
  .layer { margin-top: 2.6rem; }
  .grid-2, .grid-3, .grid-4, .form-grid, .admin-kpis { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .confidence { display: flex; align-items: center; justify-content: space-between; text-align: left; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attention-item { grid-template-columns: auto minmax(0, 1fr); }
  .attention-meta { display: none; }
  /* Map fits the viewport (viewBox scales); no forced horizontal scroll (M3). */
  .map-stage { min-height: 300px; justify-content: center; }
  .world-map { width: 100%; padding: 0.5rem; }
  .world-map text { font-size: 22px; }
  .prototype-ribbon { display: none; }
  .public-nav { padding: .65rem .8rem; }
  .public-links a:not(.button-primary) { display: none; }
  .public-main { padding-top: 3rem; }
  .public-section { margin-top: 4rem; }
  .filter-stack { grid-template-columns: 1fr; }
  .dimension-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glossary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .search-hint, .icon-button[data-notifications] { display: none; }
  .global-search input { padding-right: .75rem; }
  .quick-grid, .metric-strip, .decision-facts, .region-stats, .score-grid { grid-template-columns: 1fr; }
  .company-identity h1 { font-size: 1.65rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* ── Migration helpers (CSP-safe; no inline styles) ───────────────────────── */
.progress-full { width: 96% !important; }

/* ── CSP-safe bar widths (10% steps; bar-fill/score-track read --value via class) ── */
.w-0{width:0}.w-10{width:10%}.w-20{width:20%}.w-30{width:30%}.w-40{width:40%}
.w-50{width:50%}.w-60{width:60%}.w-70{width:70%}.w-80{width:80%}.w-90{width:90%}.w-100{width:100%}
.h-0{height:0}.h-10{height:10%}.h-20{height:20%}.h-30{height:30%}.h-40{height:40%}
.h-50{height:50%}.h-60{height:60%}.h-70{height:70%}.h-80{height:80%}.h-90{height:90%}.h-100{height:100%}
.layer-cards { margin-top: 1rem; }
.data-note { margin-top: 1rem; }

/* ── Decision dashboard redesign ─────────────────────────────────────────── */
.home-page-head { align-items: center; }
.home-head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.home-snapshot-line {
  display: flex; align-items: center; gap: .55rem; margin: -1rem 0 1.6rem;
  color: var(--muted); font-size: .7rem;
}
.home-snapshot-line strong { color: var(--text-soft); }
.strategic-brief .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(220px, .36fr); }
.strategic-risk-box {
  align-self: stretch; display: flex; flex-direction: column; justify-content: center;
  border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--border));
  border-radius: 13px; background: var(--warning-soft); padding: .9rem;
}
.strategic-risk-box span, .strategic-risk-box small { color: var(--muted); font-size: .66rem; }
.strategic-risk-box strong { margin: .18rem 0; color: var(--warning); font-size: 1rem; }
.management-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.management-card { display: flex; min-height: 285px; flex-direction: column; padding: .95rem; }
.management-card-head { display: flex; align-items: center; gap: .7rem; }
.management-card-head .eyebrow { margin: 0; }
.management-card-head h3 { margin: .08rem 0 0; font-size: .94rem; }
.management-icon {
  width: 34px; height: 34px; display: grid; flex: 0 0 auto; place-items: center;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft);
  color: var(--accent); font-size: .72rem; font-weight: 850;
}
.management-primary { margin: 1rem 0 .75rem; }
.management-primary strong { display: block; font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums; }
.management-primary span { display: block; margin-top: .2rem; color: var(--muted); font-size: .67rem; }
.management-facts { display: grid; gap: .52rem; margin: 0; }
.management-facts div { border-top: 1px solid var(--border); padding-top: .48rem; }
.management-facts dt { color: var(--muted); font-size: .64rem; }
.management-facts dd { margin: .08rem 0 0; font-size: .73rem; font-weight: 650; overflow-wrap: anywhere; }
.management-link { margin-top: auto; padding-top: .85rem; color: var(--accent); font-size: .7rem; font-weight: 760; text-decoration: none; }
.commodity-pulse { display: grid; gap: .42rem; }
.commodity-pulse div { display: flex; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--border); padding-top: .42rem; }
.commodity-pulse strong { font-size: .7rem; }
.commodity-pulse span { color: var(--muted); font-size: .64rem; text-align: right; }
.agenda-card { overflow: hidden; }
.agenda-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; }
.agenda-head h3 { margin: .08rem 0 0; font-size: 1rem; }
.agenda-list { border-top: 1px solid var(--border); }
.agenda-item {
  display: grid; grid-template-columns: 62px 140px minmax(170px, .8fr) minmax(240px, 1.3fr) auto;
  align-items: center; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none;
}
.agenda-item:last-child { border-bottom: 0; }
.agenda-item:hover { background: var(--surface-soft); }
.agenda-priority { border-radius: 999px; padding: .15rem .42rem; font-size: .62rem; font-weight: 820; text-align: center; }
.priority-alta { background: var(--blocked-soft); color: var(--blocked); }
.priority-media { background: var(--warning-soft); color: var(--warning); }
.agenda-event { color: var(--text-soft); font-size: .7rem; font-weight: 720; }
.agenda-asset strong { display: block; font-size: .75rem; }
.agenda-asset small { display: block; margin-top: .06rem; color: var(--muted); font-size: .63rem; }
.agenda-reason { color: var(--muted); font-size: .69rem; line-height: 1.45; }
.agenda-action { color: var(--accent); font-size: .68rem; font-weight: 760; white-space: nowrap; }

/* ── Company 360 strategic-to-operational redesign ──────────────────────── */
.company-title-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: .65rem; }
.company-title-line h1, .company-title-line h2 { margin: 0; }
/* Ticker is a secondary identifier under the company name: muted, smaller,
   tabular so it reads as a code, not a second title. */
.company-title-line h2.company-ticker {
  font-size: .95rem; font-weight: 640; color: var(--muted);
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
}
.c360-layer { scroll-margin-top: 110px; }
.c360-decision-hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 1rem; padding: 1rem;
}
.c360-verdict-block { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.c360-verdict-block p { max-width: 780px; margin: .65rem 0 0; color: var(--text-soft); font-size: .82rem; line-height: 1.65; }

/* ── Shared asset components (templates/components/asset) ───────────────────── */
.c360-decision-hero-single { margin: .8rem 0 1.2rem; }
.decision-summary { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }
.decision-summary--blocked .decision-summary-label { color: var(--blocked); }
.decision-summary-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.decision-summary-label { font-size: 1.1rem; }
.decision-summary-meaning { max-width: 780px; margin: .2rem 0 0; color: var(--text-soft); font-size: .82rem; line-height: 1.6; }
.decision-summary-meta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .2rem; color: var(--muted); font-size: .72rem; }
.c360-verdict-prose { max-width: 780px; margin: .55rem 0 0; color: var(--text-soft); font-size: .8rem; line-height: 1.6; }
.action-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.action-btn {
    display: inline-flex; align-items: center; padding: .4rem .8rem; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface-soft); color: var(--text);
    font-size: .78rem; text-decoration: none; cursor: pointer;
}
.action-btn--primary { background: var(--accent); border-color: var(--accent); color: #10121a; }
.action-btn--danger { border-color: var(--blocked); color: var(--blocked); }
.action-btn:disabled { opacity: .55; cursor: not-allowed; }
.c360-actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.c360-actions-grid div { border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); padding: .7rem; }
.c360-actions-grid span { display: block; color: var(--muted); font-size: .64rem; }
.c360-actions-grid strong { display: block; margin-top: .16rem; font-size: .78rem; overflow-wrap: anywhere; }
.c360-block-cause { grid-column: 1 / -1; border-left: 3px solid var(--blocked, #ef4444) !important; }
.c360-block-cause small { display: block; margin-top: .45rem; color: var(--muted); font-size: .64rem; }
.block-reason-list { margin: .3rem 0 0; padding-left: 1.05rem; font-size: .74rem; }
.block-reason-list li { margin-top: .2rem; }
.c360-score-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .65rem; margin-top: .7rem; }
.c360-score-strip div { border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); padding: .7rem; }
.c360-score-strip span, .c360-score-strip small { display: block; color: var(--muted); font-size: .64rem; }
.c360-score-strip strong { display: block; margin-top: .12rem; font-size: 1.05rem; }
/* Conceptually-grouped KPIs (same blocks as the screener filters). Each group
   is a titled fieldset; its inner strip auto-fits the metrics it contains. */
.c360-kpi-groups { display: grid; gap: .7rem; margin-top: .7rem; }
.c360-kpi-group { border: 1px solid var(--border); border-radius: 13px; padding: .55rem .7rem .7rem; margin: 0; }
.c360-kpi-group > legend { color: var(--accent); font-size: .66rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; padding: 0 .35rem; }
/* KPI groups keep ALL their metrics on ONE row (owner: "todo en una misma fila,
   acorta las cajas"). Flow in a single column track so 9-11 cards never wrap to a
   ragged 2nd row; boxes shrink to fit, and a long group scrolls horizontally
   inside its own box instead of breaking the layout. */
.c360-kpi-group .c360-score-strip { display: grid; grid-auto-flow: column;
    grid-auto-columns: minmax(84px, 1fr); margin-top: .15rem;
    overflow-x: auto; scrollbar-width: thin; }
.c360-kpi-group .c360-score-strip > div { min-width: 0; }
.c360-kpi-group .c360-score-strip strong { font-size: .92rem; overflow-wrap: anywhere; }
/* Native qualitative reading card: verdict + per-dimension labels. Tone is a
   reinforcement of the label text, never the only cue (the label carries it). */
.c360-qual-card { border-left: 3px solid var(--accent); margin-top: .8rem; }
.c360-qual-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin: .2rem 0 .8rem; }
.c360-qual-verdict { font-size: 1.25rem; font-weight: 700; }
.c360-qual-reason { color: var(--text-muted); font-size: .88rem; }
.c360-qual-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .55rem .9rem; margin: 0; }
.c360-qual-grid div { display: flex; flex-direction: column; gap: 1px; }
.c360-qual-grid dt { font-size: .74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.c360-qual-grid dd { margin: 0; font-weight: 600; font-size: .95rem; }
.c360-thesis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: .8rem; }
.c360-thesis-grid h3, .c360-tactical-grid h3, .c360-sector-compare h3 { margin: .1rem 0 .75rem; font-size: .92rem; }
.c360-case-card { border-left: 3px solid var(--pass); }
.c360-risk-card { border-left: 3px solid var(--warning); }
.c360-point-list { display: grid; gap: .48rem; margin: 0; }
.c360-point-list div { display: grid; grid-template-columns: minmax(105px, .7fr) minmax(0, 1.3fr); gap: .7rem; border-top: 1px solid var(--border); padding-top: .42rem; }
.c360-point-list dt { color: var(--muted); font-size: .66rem; }
.c360-point-list dd { margin: 0; text-align: right; font-size: .72rem; font-weight: 680; overflow-wrap: anywhere; }
/* Absolute-fundamentals sub-block inside the Valoración card. */
.c360-subblock { margin-top: .85rem; padding-top: .7rem; border-top: 1px dashed var(--border); }
.c360-subblock .eyebrow { display: block; margin-bottom: .5rem; }
.compact-flags { margin-bottom: .65rem; }
.c360-tactical-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.c360-sector-compare { margin-top: .8rem; }
.sector-delta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.sector-delta-grid div { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); padding: .65rem; }
.sector-delta-grid span, .sector-delta-grid small { display: block; color: var(--muted); font-size: .63rem; }
.sector-delta-grid strong { display: block; margin: .12rem 0; font-size: 1rem; }
.evidence-stack { display: grid; gap: .6rem; }
.evidence-group { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.evidence-group summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .82rem 1rem; cursor: pointer; list-style: none; }
.evidence-group summary::-webkit-details-marker { display: none; }
.evidence-group summary strong, .evidence-group summary small { display: block; }
.evidence-group summary strong { font-size: .78rem; }
.evidence-group summary small { margin-top: .08rem; color: var(--muted); font-size: .65rem; }
.evidence-group summary b { color: var(--accent); font-size: 1rem; }
.evidence-group[open] summary { border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.evidence-group[open] summary b { transform: rotate(45deg); }
.evidence-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; padding: .8rem; }
.evidence-grid div { border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); padding: .62rem; }
.evidence-grid span { display: block; color: var(--muted); font-size: .63rem; }
.evidence-grid strong { display: block; margin-top: .12rem; font-size: .86rem; }
.audit-grid { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr); gap: 1rem; padding: .9rem; }
.audit-grid h4 { margin: 0 0 .4rem; font-size: .72rem; }
.c360-history-card { display: grid; gap: .8rem; }
.c360-history-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.c360-history-meta div { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); padding: .65rem; }
.c360-history-meta span { display: block; color: var(--muted); font-size: .63rem; }
.c360-history-meta strong { display: block; margin-top: .12rem; font-size: .78rem; font-variant-numeric: tabular-nums; }
.c360-history-card .method-chart { padding: .45rem .65rem .2rem; }

/* ── Company 360 cross-asset correlations ────────────────────────────────── */
.c360-crossasset { margin-top: .8rem; }
.c360-crossasset-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1rem; margin-top: .4rem; }
.c360-crossasset-primary { border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); padding: .75rem; }
.c360-crossasset-primary > strong { display: block; margin: .15rem 0 .5rem; font-size: 1.05rem; }
.corr-bar-list { list-style: none; margin: .35rem 0 0; padding: 0; display: grid; gap: .5rem; }
.corr-row { display: grid; grid-template-columns: minmax(78px, .8fr) minmax(0, 1.4fr) auto; align-items: center; gap: .55rem; }
.corr-label { color: var(--muted); font-size: .68rem; }
.corr-track { position: relative; height: 7px; border-radius: 4px; background: rgba(255,255,255,0.06); overflow: hidden; }
.corr-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; }
.corr-fill.corr-pos { background: var(--pass, #22c55e); }
.corr-fill.corr-neg { background: var(--warning, #f59e0b); }
.corr-val { font-size: .72rem; font-weight: 680; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .c360-crossasset-grid { grid-template-columns: 1fr; } }
.c360-history-card .plotly-chart { min-height: 320px; }
.c360-history-note { margin: 0; font-size: .68rem; }
.price-axis { stroke: var(--border); stroke-width: 1; }
.price-history-line { fill: none; stroke: #d946ef; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.price-chart-label { fill: var(--muted); font-size: 11px; }

@media (max-width: 1180px) {
  .management-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agenda-item { grid-template-columns: 62px 130px minmax(160px, .8fr) minmax(200px, 1fr); }
  .agenda-action { display: none; }
  .c360-tactical-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c360-tactical-grid > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .strategic-brief .hero-grid, .c360-decision-hero, .c360-thesis-grid, .audit-grid { grid-template-columns: 1fr; }
  .c360-score-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sector-delta-grid, .evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c360-history-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agenda-item { grid-template-columns: 58px minmax(125px, .6fr) minmax(0, 1fr); }
  .agenda-reason { grid-column: 2 / -1; }
}
@media (max-width: 720px) {
  .home-page-head { align-items: stretch; }
  .home-head-actions { justify-content: flex-start; }
  .home-snapshot-line { align-items: flex-start; flex-wrap: wrap; }
  .management-grid, .c360-tactical-grid { grid-template-columns: 1fr; }
  .management-card { min-height: 0; }
  .c360-tactical-grid > :last-child { grid-column: auto; }
  .agenda-head { align-items: flex-start; flex-direction: column; }
  .agenda-item { grid-template-columns: 58px minmax(0, 1fr); }
  .agenda-event { text-align: right; }
  .agenda-asset, .agenda-reason { grid-column: 1 / -1; }
  .c360-score-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c360-actions-grid, .sector-delta-grid, .evidence-grid { grid-template-columns: 1fr; }
  .c360-history-meta { grid-template-columns: 1fr; }
}

/* ── Landing helpers (CSP-safe; no inline styles) ─────────────────────────── */
.brand-inline { min-height: auto; border: 0; padding: 0; }
.mt-row { margin-top: 1.5rem; }
.mt-hint { margin-top: 1rem; }
.hero-flat { box-shadow: none; }

/* ── Bridge old .page-header to the new .page-head look (migration) ───────── */
.page-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.8rem; flex-wrap: wrap;
}
.page-header h1 {
    margin: 0 0 .28rem; font-size: 2rem;
    line-height: 1.12; letter-spacing: 0;
}
.page-header p { max-width: 760px; margin: 0; color: var(--muted, #94a3b8); }

/* ── Atlas map: tier legend dots + continent tier colors ──────────────────── */
.legend-dot.legend-diamond { background: #10b981; }
.legend-dot.legend-gold    { background: #84cc16; }
.legend-dot.legend-silver  { background: #eab308; }
.legend-dot.legend-bronze  { background: #f59e0b; }
.legend-dot.legend-watch   { background: #ef4444; }
.region-sub { display: block; margin: .8rem 0 .35rem; font-size: .74rem; }

/* ── Asset tabs: coming-soon state ────────────────────────────────────────── */
.asset-tab.asset-soon { color: var(--muted, #94a3b8); opacity: .6; cursor: not-allowed; }
.asset-tab:not(.asset-soon):not(.is-active) { cursor: default; }

/* ── Sidebar universe + next-batch countdown (top of sidebar) ─────────────── */
.sidebar-universe {
    margin: .8rem .72rem 0; border: 1px solid var(--border, #2a3445);
    border-radius: var(--radius, 12px); background: var(--surface-soft, #1a2438);
    padding: .72rem;
}
.universe-head { display: flex; align-items: center; gap: .5rem; }
.universe-head strong { display: block; font-size: .78rem; }
.universe-head span { color: var(--muted, #94a3b8); font-size: .68rem; }
.universe-batch {
    margin: .6rem 0 0; padding-top: .55rem;
    border-top: 1px solid var(--border, #2a3445);
    color: var(--muted, #94a3b8); font-size: .68rem; line-height: 1.45;
}
.universe-batch strong { color: var(--accent, #f0abfc); }
.navegador-batch { margin: .6rem 0 1rem; font-size: .76rem; line-height: 1.5; }
.navegador-batch strong { color: var(--text, #e2e8f0); }

/* ── Navegador column picker ──────────────────────────────────────────────── */
/* Toolbar: keep the summary buttons (Columnas / Ordenar) on the right. When a
   panel opens, flex-wrap drops it to its own full-width line so it stays
   readable rather than being squeezed into the right corner. */
.column-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-start;
    gap: .5rem;
    margin: .5rem 0 1rem;
}
.column-tools > .column-picker { margin: 0; }
.column-tools > .column-picker[open] { flex: 1 1 100%; }
.column-picker { margin: .5rem 0 1rem; }
.column-picker > summary {
    cursor: pointer; display: inline-flex; align-items: center; gap: .4rem;
    padding: .35rem .7rem; border: 1px solid var(--border, #2a3445);
    border-radius: 8px; background: var(--surface-soft, #1a2438);
    color: var(--text-soft, #cbd5e5); font-size: .8rem; width: fit-content;
}
.column-picker[open] > summary { border-color: var(--accent, #f0abfc); }
.column-picker-form {
    margin-top: .6rem; padding: .9rem; border: 1px solid var(--border, #2a3445);
    border-radius: 10px; background: var(--surface-soft, #1a2438);
}
.column-options {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .35rem .8rem; margin: .6rem 0;
}

/* ── CSP fix: legend swatch colors + pv marker (no inline styles) ─────────── */
.legend-swatch.legend-diamond { background: #10b981; }
.legend-swatch.legend-gold    { background: #84cc16; }
.legend-swatch.legend-silver  { background: #eab308; }
.legend-swatch.legend-bronze  { background: #f59e0b; }
.legend-swatch.legend-watch   { background: #ef4444; }
.pv-marker-mid { left: 66.6%; }
.inline-form { display: inline; }
.map-country-back { margin-bottom: .6rem; font-size: .72rem; }

/* ── Column picker: concept groups (levels/sub-levels) ────────────────────── */
.column-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; margin: .7rem 0; }
.column-group { border: 1px solid var(--border, #2a3445); border-radius: 10px; padding: .6rem .7rem; margin: 0; background: var(--surface, #111827); }
.column-group legend {
    font-size: .68rem; font-weight: 800; letter-spacing: 0; text-transform: uppercase;
    color: var(--accent, #f0abfc); padding: 0 .35rem;
}
.column-group-options { display: grid; gap: .3rem; margin-top: .3rem; }
.column-group-options .checkbox-label { font-size: .76rem; }
.column-picker-actions { margin-top: .6rem; display: flex; align-items: center; gap: .6rem; }
.column-picker-count { color: var(--accent); font-weight: 600; }
.column-picker-status { color: #4ade80; font-size: .8rem; }
.checkbox-label.is-disabled { opacity: .45; cursor: not-allowed; }

/* ── Column order: reorderable list of active columns (drag / ↑↓) ──────────── */
.column-order-list { list-style: none; margin: .4rem 0 0; padding: 0;
    display: flex; flex-direction: column; gap: .35rem; }
.column-order-item { display: flex; align-items: center; gap: .5rem;
    padding: .4rem .6rem; border: 1px solid var(--border, #2a3f6b);
    border-radius: .5rem; background: var(--surface-soft, #1a2438); cursor: grab; }
.column-order-item.is-dragging { opacity: .5; border-color: var(--accent, #f0abfc); }
.column-order-grip { color: var(--muted, #94a3b8); cursor: grab;
    -webkit-user-select: none; user-select: none;
    font-size: .8rem; letter-spacing: -2px; }
.column-order-label { flex: 1; font-size: .9rem; }
.column-order-controls { display: flex; gap: .25rem; }
.column-order-status { color: #4ade80; font-size: .8rem; }
.btn-icon { border: 1px solid var(--border, #2a3f6b); background: transparent;
    color: var(--text, #e8ecf4); border-radius: .35rem; width: 1.7rem; height: 1.7rem;
    line-height: 1; cursor: pointer; font-size: .85rem; }
.btn-icon:hover { border-color: var(--accent, #f0abfc); color: var(--accent, #f0abfc); }

/* ── Asset tabs: soon badge + count ───────────────────────────────────────── */
.tab-soon { font-size: .6rem; padding: .05rem .35rem; border-radius: 999px;
    background: var(--surface-soft, #1a2438); color: var(--muted, #94a3b8);
    border: 1px solid var(--border, #2a3445); margin-left: .3rem; }
.tab-count { font-size: .65rem; color: var(--muted, #94a3b8); margin-left: .25rem; }

/* ── Real world map with switchable layers ────────────────────────────────── */
.mt-1 { margin-top: 1rem; }
.worldmap-wrap { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(260px,.6fr); gap: 1rem; }
.worldmap-stage { border: 1px solid var(--border,#2a3445); border-radius: 12px; background: var(--surface-soft,#0f1623); overflow: hidden; }
#world-map-host svg { width: 100%; height: auto; display: block; }
#world-map-host .map-country { stroke: var(--bg,#080b14); stroke-width: .3; transition: fill .15s ease, opacity .15s ease; }
#world-map-host .map-country-covered { cursor: pointer; }
#world-map-host .map-country-covered:hover { opacity: .8; stroke: var(--accent,#f0abfc); stroke-width: .6; }
.layer-selector { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.layer-btn { border: 1px solid var(--border,#2a3445); border-radius: 8px; background: var(--surface-soft,#1a2438); color: var(--muted,#94a3b8); padding: .3rem .65rem; cursor: pointer; font-size: .76rem; }
.layer-btn.is-active { border-color: var(--accent,#f0abfc); background: var(--accent-soft,rgba(240,171,252,.11)); color: var(--accent,#f0abfc); }
.map-legend-dynamic { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-top: .6rem; font-size: .72rem; color: var(--muted,#94a3b8); }
.map-legend-dynamic .map-legend-title { font-weight: 700; color: var(--text,#e2e8f0); margin-right: .3rem; }

/* ── Unified geographic Atlas ─────────────────────────────────────────── */
.geo-atlas { overflow: hidden; }
.geo-atlas-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  margin-bottom: 1rem;
}
.geo-atlas-head h2 { margin: .1rem 0 .25rem; }
.geo-atlas-head p { max-width: 850px; margin: 0; }
.geo-summary {
  display: grid; grid-template-columns: repeat(3, auto); gap: .15rem .7rem;
  min-width: 260px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-soft); padding: .7rem;
}
.geo-summary strong { font-size: 1rem; color: var(--text); text-align: right; }
.geo-summary span { align-self: center; color: var(--muted); font-size: .66rem; }
.geo-controls {
  display: grid; grid-template-columns: minmax(190px, .35fr) minmax(0, 1fr); gap: .8rem;
  margin-bottom: .8rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-soft); padding: .75rem;
}
.geo-control-group { min-width: 0; }
.geo-control-label {
  display: block; margin-bottom: .4rem; color: var(--muted); font-size: .65rem;
  font-weight: 800; letter-spacing: 0; text-transform: uppercase;
}
.geo-control-group .layer-selector { margin: 0; }
.worldmap-stage {
  position: relative; min-height: 520px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, var(--surface-soft), var(--surface));
}
#world-map-host { width: 100%; height: 100%; min-height: 520px; display: grid; place-items: center; }
#world-map-host svg {
  width: 100%; height: 100%; max-height: 620px; display: block;
  cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none;
}
#world-map-host svg:active { cursor: grabbing; }
#world-map-host #World { fill: var(--surface-soft) !important; }
#world-map-host #Ocean { fill: var(--surface) !important; stroke: var(--border) !important; }
#world-map-host .map-country path,
#world-map-host .map-country polygon,
#world-map-host .map-country polyline,
#world-map-host .map-country rect,
#world-map-host .map-country circle,
#world-map-host .map-country ellipse {
  stroke: var(--bg); stroke-width: .45; vector-effect: non-scaling-stroke;
  transition: fill .15s ease, opacity .15s ease, stroke .15s ease;
}
#world-map-host .map-country-covered { cursor: pointer; }
#world-map-host .map-country-covered:hover path,
#world-map-host .map-country-covered:hover polygon,
#world-map-host .map-country-covered:focus path,
#world-map-host .map-country-covered:focus polygon {
  opacity: .82; stroke: var(--accent); stroke-width: 1.1;
}
#world-map-host .map-country.is-selected path,
#world-map-host .map-country.is-selected polygon {
  stroke: var(--accent); stroke-width: 1.5;
}
.map-zoom-controls {
  position: absolute; z-index: 4; top: .7rem; right: .7rem;
  display: flex; gap: .3rem; padding: .3rem; border: 1px solid var(--border);
  border-radius: 9px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}
.map-zoom-btn {
  min-width: 34px; min-height: 34px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface-raised); color: var(--text); cursor: pointer; font-weight: 850;
}
.map-zoom-btn:hover { border-color: var(--accent); color: var(--accent); }
.map-zoom-btn:disabled { opacity: .42; cursor: default; }
.map-zoom-reset { padding: 0 .55rem; font-size: .66rem; }
.map-view-caption {
  position: absolute; z-index: 3; left: .7rem; bottom: .7rem; margin: 0;
  border: 1px solid var(--border); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text-soft); padding: .3rem .6rem; font-size: .68rem; font-weight: 750;
}
.map-legend-dynamic {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft);
  padding: .6rem .75rem;
}
.map-legend-description { flex-basis: 100%; color: var(--muted); font-size: .66rem; }
.legend-tone-tier-diamond, .legend-tone-scale-5, .legend-tone-risk-low { background: #10b981; }
.legend-tone-tier-gold, .legend-tone-scale-4 { background: #84cc16; }
.legend-tone-tier-silver, .legend-tone-scale-3, .legend-tone-risk-moderate { background: #eab308; }
.legend-tone-tier-bronze, .legend-tone-scale-2, .legend-tone-risk-elevated { background: #f59e0b; }
.legend-tone-tier-watch, .legend-tone-scale-1, .legend-tone-risk-high { background: #ef4444; }
.legend-tone-none { background: var(--border); }
.map-focus-metric {
  margin: .8rem 0; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 10px; background: var(--accent-soft); padding: .7rem;
}
.map-focus-metric span { display: block; color: var(--muted); font-size: .64rem; }
.map-focus-metric strong { display: block; margin-top: .12rem; font-size: 1.05rem; }
.map-country-list { display: grid; gap: .4rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.map-country-list li { display: flex; justify-content: space-between; gap: .6rem; font-size: .7rem; }
.geo-signals { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.geo-signals-head { display: flex; align-items: baseline; justify-content: space-between; gap: .7rem; }
.geo-signals-head h3 { margin: 0; }
.geo-signal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin-top: .65rem; }
.geo-signal-card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); padding: .7rem; }
.geo-signal-card h4 { margin: 0 0 .45rem; font-size: .75rem; }

/* ── Country detail ───────────────────────────────────────────────────── */
.country-page-head { align-items: flex-end; }
.country-head-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.country-reading-grid { display: grid; grid-template-columns: minmax(260px, .65fr) minmax(0, 1.35fr); gap: .8rem; margin-top: 1rem; }
.country-thesis-card h3 { margin: .3rem 0 .45rem; font-size: 1.15rem; }
.country-thesis-card p { color: var(--text-soft); line-height: 1.65; }
.country-core-metrics { gap: .6rem; }
.country-forecast-card, .country-sector-card, .country-company-table { margin-top: .8rem; }
.country-forecast-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-top: .7rem; }
.country-forecast-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-top: .6rem; }
.country-forecast-notes > div { border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); padding: .65rem; }
.country-forecast-notes strong { font-size: .7rem; }
.country-forecast-notes p { margin: .2rem 0 0; color: var(--muted); font-size: .68rem; }
.empty-state.compact { padding: 1rem .7rem; }
.country-context-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-top: 1rem; }
.country-dimension-list { display: grid; gap: .45rem; margin: .7rem 0 0; padding: 0; list-style: none; }
.country-dimension-list li { display: flex; align-items: center; gap: .45rem; color: var(--text-soft); font-size: .72rem; }
.country-dimension-list .status-dot { background: var(--pass); }
.country-dimension-list.risk-list .status-dot { background: var(--warning); }
.country-warning-list { margin-bottom: 0; }
.country-company-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.country-sector-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; margin-top: .7rem; }
.country-sector-item { border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); padding: .65rem; }
.country-sector-item strong, .country-sector-item span, .country-sector-item small { display: block; }
.country-sector-item span { margin-top: .15rem; color: var(--text-soft); font-size: .69rem; }
.country-sector-item small { margin-top: .25rem; color: var(--muted); font-size: .62rem; }

@media (max-width: 1180px) {
  .geo-signal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .country-company-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .country-sector-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .geo-atlas-head, .geo-signals-head { flex-direction: column; }
  .geo-summary { width: 100%; min-width: 0; }
  .geo-controls, .country-reading-grid { grid-template-columns: 1fr; }
  .worldmap-stage, #world-map-host { min-height: 380px; }
  .country-context-grid, .country-forecast-notes { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .geo-signal-grid, .country-sector-grid, .country-forecast-grid, .country-company-metrics { grid-template-columns: 1fr; }
  .map-zoom-controls { top: .45rem; right: .45rem; }
  .map-zoom-reset { display: none; }
  .worldmap-stage, #world-map-host { min-height: 310px; }
}

/* ── Modal de confirmación (Sí/No) ───────────────────────────────────────── */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 11, 20, .66);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  padding: 1rem;
}
.confirm-modal {
  width: 100%; max-width: 26rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.4rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.confirm-text { margin: 0 0 1.2rem; font-size: 1rem; line-height: 1.5; color: var(--text); }
.confirm-actions { display: flex; justify-content: flex-end; gap: .6rem; }
.confirm-actions .btn-sm { min-width: 5rem; padding: .5rem 1rem; }
.confirm-no { background: var(--surface-soft); }

/* ── Welcome tour (first-session carousel modal) ─────────────────────────── */
.tour-overlay {
  position: fixed; inset: 0; z-index: 2100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 11, 20, .72);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  padding: 1rem;
}
.tour-modal {
  width: 100%; max-width: 32rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.6rem 1.7rem 1.3rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.tour-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.tour-icon { font-size: 1.7rem; line-height: 1; }
.tour-count { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: 0; }
.tour-title { margin: .2rem 0 .5rem; font-size: 1.2rem; }
.tour-body { margin: 0; color: var(--text); line-height: 1.55; font-size: .92rem; }
.tour-usecases { display: grid; gap: .45rem; margin-top: 1rem; }
.tour-usecase {
  display: block; padding: .6rem .8rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-soft);
  color: var(--text); text-decoration: none; font-size: .86rem; font-weight: 600;
  transition: border-color .15s, background .15s;
}
.tour-usecase:hover { border-color: var(--accent); background: var(--surface); }
.tour-usecase::after { content: " →"; color: var(--accent); }
.tour-dots { display: flex; justify-content: center; gap: .4rem; margin: 1.1rem 0 .9rem; }
.tour-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.tour-dot.is-active { background: var(--accent); }
.tour-actions { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; }
.tour-actions .tour-skip { margin-right: auto; background: transparent; color: var(--muted); }
.tour-actions .btn-sm { min-width: 4.5rem; padding: .5rem .9rem; }
.tour-optout {
  display: flex; align-items: center; gap: .45rem; margin: .85rem 0 0;
  font-size: .82rem; color: var(--muted); cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.tour-optout input { cursor: pointer; }
@media (max-width: 480px) {
  .tour-modal { padding: 1.2rem 1.1rem; }
  .tour-actions { flex-wrap: wrap; }
  .tour-actions .tour-skip { margin-right: 0; width: 100%; order: 3; }
}

/* First-session investor-profiling modal (mostly Google sign-ups). Mirrors the
   tour modal chrome; adds a compact select stack. */
.profiling-overlay {
  position: fixed; inset: 0; z-index: 2100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 11, 20, .72);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  padding: 1rem;
}
.profiling-modal {
  width: 100%; max-width: 30rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.6rem 1.7rem 1.3rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  max-height: 90vh; overflow-y: auto;
}
.profiling-eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .35rem;
}
.profiling-modal h2 { margin: .1rem 0 .4rem; font-size: 1.2rem; }
.profiling-modal .muted { margin: 0 0 1rem; font-size: .88rem; line-height: 1.5; }
.profiling-form { display: grid; gap: .3rem; }
.profiling-form label {
  font-size: .82rem; font-weight: 600; color: var(--text); margin-top: .5rem;
}
.profiling-form select {
  width: 100%; padding: .5rem .6rem; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface-soft); color: var(--text);
}
.profiling-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: .55rem; margin-top: 1.2rem;
}
.profiling-actions .profiling-skip { margin-right: auto; background: transparent; color: var(--muted); }
.profiling-actions .btn-sm { min-width: 4.5rem; padding: .5rem .9rem; }
@media (max-width: 480px) {
  .profiling-modal { padding: 1.2rem 1.1rem; }
  .profiling-actions { flex-wrap: wrap; }
  .profiling-actions .profiling-skip { margin-right: 0; width: 100%; order: 3; }
}

/* ── Utilidades (sustituyen estilos inline en plantillas) ────────────────── */
.mt-lg { margin-top: 1.5rem; }
.section-rule { margin: 2rem 0; border: none; border-top: 1px solid var(--border); }
.inline-form-block { display: inline-block; }

/* ── Errores de campo inline (accesibles) ────────────────────────────────── */
.field-error { color: #fca5a5; font-size: .8rem; margin: .35rem 0 0; }
.field-hint { color: var(--text-muted); font-size: .78rem; margin: .35rem 0 0; line-height: 1.35; }
.field-hint.is-ok { color: #86efac; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: #ef4444; }

/* ── Accesibilidad: tamaño de área táctil (≥44px) en controles ──────────────
   WCAG 2.5.5: interactive controls should reach ~44×44px on touch. Applies on
   coarse pointers (touch) so the desktop layout stays compact. */
@media (pointer: coarse) {
  button, .btn-sm, .btn-primary, .button, .button-primary,
  input:not([type="checkbox"]):not([type="radio"]),
  select, .asset-tab, .preset-chip, .role-select,
  .nav-links a, .mobile-nav a, .avatar, .password-toggle {
    min-height: 44px;
  }
  .btn-sm, .preset-chip { padding-top: .55rem; padding-bottom: .55rem; }
  .password-toggle { min-width: 44px; }
}

/* iOS Safari zooms the page in when a focused input's font-size is < 16px. Force
   16px on form controls under Safari-on-touch only, so the login/search/register
   fields don't trigger that jarring auto-zoom. (Dotty PWA fix.) */
@supports (-webkit-touch-callout: none) {
  input:not([type="checkbox"]):not([type="radio"]),
  textarea, select {
    font-size: 16px;
  }
}

/* Native-app touch feedback: a subtle press on tap. Skipped when the user asks
   for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .button:active, .button-primary:active, .btn-primary:active, .btn-sm:active,
  .btn-google:active, .card:active, .stat-card:active, .preset-chip:active,
  .chip:active {
    transform: scale(0.98);
  }
}

/* ── Metodología: filosofía + principios ─────────────────────────────────── */
.method-intro { margin-bottom: 1.6rem; }
.method-lead { font-size: 1.05rem; line-height: 1.6; max-width: 70ch; color: var(--text); }
.principle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: .8rem; }
.principle-card { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 12px; background: var(--surface-soft); padding: 1rem 1.1rem; }
.principle-card h3 { margin: 0 0 .45rem; font-size: .95rem; color: var(--accent); }
.principle-card p { margin: 0; font-size: .88rem; line-height: 1.5; color: var(--muted); }
.method-steps { margin: .8rem 0 0; padding-left: 1.2rem; }
.method-steps li { margin-bottom: .6rem; line-height: 1.55; }
.method-limits { margin: .8rem 0 0; padding-left: 1.2rem; color: var(--muted); }
.method-limits li { margin-bottom: .4rem; line-height: 1.5; }

/* ── Metodología: mapa de flujo E2E ─────────────────────────────────────── */
.methodology-head { align-items: center; }
.method-flow-section { margin: 1.1rem 0 2rem; }
.method-flow-card { overflow: hidden; }
.method-flow-card .method-chart { border: 0; background: transparent; padding: .25rem 0 0; }
.method-flow-card .plotly-chart { min-height: 520px; }
.method-flow-legend { display: flex; flex-wrap: wrap; gap: .55rem 1rem; margin-bottom: .35rem; color: var(--muted); font-size: .68rem; }
.method-flow-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.flow-dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; }
.flow-input { background: #3b82f6; }
.flow-process { background: var(--muted); }
.flow-gate { background: var(--accent); }
.flow-output { background: var(--surface2); border: 1px solid var(--text-soft); }
.method-flow-note { margin: .25rem 0 0; color: var(--muted); font-size: .67rem; text-align: center; }
.method-stage-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7rem; margin-top: .8rem; }
.method-stage-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); padding: .82rem; }
.method-stage-card span { display: block; color: var(--accent); font-size: .62rem; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.method-stage-card strong { display: block; margin-top: .2rem; font-size: .79rem; }
.method-stage-card p { margin: .35rem 0 0; color: var(--muted); font-size: .67rem; line-height: 1.5; }
.method-stage-gate { border-color: color-mix(in srgb, var(--accent) 48%, var(--border)); }
.methodology-flow-svg { width: 100%; height: auto; min-width: 920px; }
.method-flow-link { fill: none; stroke-width: 14; stroke-linecap: round; opacity: .52; }
.method-flow-core { fill: none; stroke-width: 34; stroke-linecap: butt; opacity: .58; }
.method-flow-node { stroke: rgba(255,255,255,.22); stroke-width: 1; }
.method-flow-label { fill: #f8fafc; font-size: 12px; font-weight: 650; }
.method-flow-heading { fill: #94a3b8; font-size: 10px; font-weight: 800; letter-spacing: 0; }

@media (max-width: 1050px) {
  .method-stage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method-flow-card .method-chart { overflow-x: auto; }
}
@media (max-width: 620px) {
  .methodology-head { align-items: stretch; }
  .method-stage-grid { grid-template-columns: 1fr; }
  .method-flow-card .plotly-chart { min-height: 440px; min-width: 820px; }
}

/* ── Tablas: cabeceras ordenables ────────────────────────────────────────── */
.th-sortable { white-space: nowrap; }
.th-sort { color: inherit; display: inline-flex; align-items: center; gap: .25rem; }
.th-sort:hover { color: var(--accent); text-decoration: none; }
.sort-arrow { font-size: .62rem; color: var(--accent); }

/* Client-side sortable headers (sortable-table.js wraps the label in a button). */
.th-sort-btn {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; color: inherit; padding: 0; text-align: inherit;
}
.th-sort-btn:hover .th-sort-label { color: var(--accent); }
.th-sort-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* Reserve arrow space so the header width doesn't jump when the arrow appears. */
.th-sort-btn .sort-arrow { min-width: .7em; }
th[aria-sort="ascending"] .th-sort-label,
th[aria-sort="descending"] .th-sort-label { color: var(--accent); }

/* ── Navegador: filtros de fondos / países ───────────────────────────────── */
.asset-filters { margin-top: .8rem; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); padding: .6rem .9rem; }
.asset-filters summary { cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--muted); }
.asset-filters[open] summary { margin-bottom: .7rem; }
.asset-filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .65rem; }
.asset-filter { display: flex; flex-direction: column; gap: .25rem; font-size: .76rem; color: var(--muted); }
.asset-filter select, .asset-filter input { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: .32rem .5rem; font-size: .8rem; }
.asset-filter .range-inputs { display: flex; gap: .35rem; }
.asset-filter .range-inputs input { width: 100%; }
.asset-filter-actions { margin-top: .75rem; }

/* ── Admin users: inline role selector ───────────────────────────────────── */
.role-form { display: inline; }
.role-select {
  background: var(--surface-soft); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: .22rem .5rem; font-size: .78rem; cursor: pointer;
}
.role-select:hover { border-color: var(--accent); }

/* ── Glossary A-Z (help/glossary) ────────────────────────────────────────── */
.glossary-az { display: flex; flex-wrap: wrap; gap: .3rem; margin: .6rem 0 1.4rem; position: sticky; top: 0; background: var(--bg); padding: .5rem 0; z-index: 2; }
.glossary-az a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.8rem; height: 1.8rem; padding: 0 .35rem;
  border: 1px solid var(--border); border-radius: 7px;
  font-size: .78rem; font-weight: 600; color: var(--muted);
}
.glossary-az a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.glossary-group { margin-bottom: 1.6rem; scroll-margin-top: 3.2rem; }
.glossary-letter {
  font-size: 1.1rem; color: var(--accent); border-bottom: 1px solid var(--border);
  padding-bottom: .25rem; margin: 0 0 .7rem;
}
.glossary dt { font-weight: 700; margin-top: 1rem; }
.glossary dd { margin: .25rem 0 0; }
.glossary-def { margin: 0; }
.glossary-formula, .glossary-example { margin: .35rem 0 0; font-size: .86rem; }
.glossary-formula code {
  background: var(--surface-soft); border: 1px solid var(--border);
  border-radius: 6px; padding: .12rem .45rem; font-size: .85rem;
}
.glossary-example { color: var(--muted); }
.glossary-tag {
  display: inline-block; margin-right: .35rem; padding: .03rem .4rem;
  border-radius: 999px; background: var(--surface-soft); border: 1px solid var(--border);
  font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0;
  color: var(--accent); vertical-align: middle;
}

/* ── Register: back link + password visibility toggle ────────────────────── */
.back-link { display: inline-block; margin-bottom: .6rem; font-size: .82rem; color: var(--muted); }
.back-link:hover { color: var(--accent); text-decoration: none; }

.password-wrap { position: relative; display: flex; align-items: center; }
.password-wrap input { flex: 1; padding-right: 2.6rem; }
.password-toggle {
  position: absolute; right: .25rem; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem; padding: 0;
  background: none; border: none; cursor: pointer; color: var(--muted);
}
.password-toggle:hover { color: var(--accent); }
.eye-icon {
  width: 20px; height: 20px; display: block;
  background-color: currentColor;
  -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat;
  /* Eye open (default) */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
.password-toggle.is-shown .eye-icon {
  /* Eye off (slashed) when the password is visible */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
}

/* ── Users insights (admin/users-insights) ───────────────────────────────── */
.ui-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: .8rem 0 1.4rem; }
.ui-card { border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); padding: .9rem 1rem; }
.ui-card h3 { margin: 0 0 .6rem; font-size: .82rem; color: var(--muted); font-weight: 600; }
.ui-dist { display: flex; flex-direction: column; gap: .32rem; }
.ui-row { display: grid; grid-template-columns: 9.5rem 1fr 2.2rem; align-items: center; gap: .5rem; font-size: .76rem; }
.ui-row-lbl { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-row-track { background: var(--surface); border-radius: 999px; height: .55rem; overflow: hidden; }
.ui-row-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); min-width: 2px; }
.ui-row-fill-muted { background: var(--border); }
.ui-row-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.ui-row-val small { display: block; color: var(--muted); font-size: .55rem; font-weight: 500; }

.ui-bars-cols { display: flex; align-items: flex-end; gap: .35rem; height: 150px; padding: .4rem .2rem 0; margin: .6rem 0 1.4rem; border-bottom: 1px solid var(--border); }
.ui-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .15rem; }
.ui-col-bar { width: 70%; min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--accent), var(--accent-strong)); }
.ui-col-val { font-size: .62rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ui-col-lbl { font-size: .56rem; color: var(--muted); white-space: nowrap; }

.ui-heatmap { display: flex; flex-direction: column; gap: 2px; margin: .6rem 0; overflow-x: auto; }
.ui-hm-row { display: flex; gap: 2px; align-items: center; }
.ui-hm-day { width: 2.4rem; font-size: .62rem; color: var(--muted); flex: 0 0 auto; }
.ui-hm-hour { flex: 1; min-width: 14px; font-size: .52rem; color: var(--muted); text-align: center; }
.ui-hm-cell { flex: 1; min-width: 14px; height: 18px; border-radius: 3px; border: 1px solid color-mix(in srgb, var(--border) 72%, transparent); }
.ui-hm-head .ui-hm-cell { background: none; }
.ui-intensity-0 { background: var(--surface); color: var(--muted); }
.ui-intensity-1 { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.ui-intensity-2 { background: color-mix(in srgb, var(--accent) 31%, var(--surface)); }
.ui-intensity-3 { background: color-mix(in srgb, var(--accent) 48%, var(--surface)); }
.ui-intensity-4 { background: color-mix(in srgb, var(--accent-strong) 68%, var(--surface)); }
.ui-intensity-5 { background: var(--accent-strong); color: #fff; }
.ui-section-block { margin: 1.25rem 0 1.5rem; }
.ui-section-head h2 { margin-bottom: .1rem; }
.ui-section-head p, .ui-chart-summary { margin: 0 0 .65rem; color: var(--muted); font-size: .72rem; }
.ui-zone-map { display: grid; grid-template-columns: 1.05fr .9fr .9fr 1.05fr; grid-template-rows: repeat(2, minmax(70px, auto)); grid-template-areas: "eeuu europa europa global" "eeuu espana espana global"; gap: .65rem; }
.ui-zone-card { min-height: 108px; border: 1px solid var(--border); border-radius: 12px; padding: .8rem; display: flex; flex-direction: column; justify-content: flex-end; }
.ui-zone-eeuu { grid-area: eeuu; }.ui-zone-europa { grid-area: europa; }
.ui-zone-espana { grid-area: espana; }.ui-zone-global { grid-area: global; }
.ui-zone-card span, .ui-zone-card small { display: block; }
.ui-zone-card span { font-size: .68rem; font-weight: 720; }
.ui-zone-card strong { margin: .2rem 0; font-size: 1.55rem; font-variant-numeric: tabular-nums; }
.ui-zone-card small { font-size: .62rem; opacity: .86; }
.ui-heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: .4rem; color: var(--muted); font-size: .6rem; }
.ui-heat-legend i { display: inline-block; width: 18px; height: 10px; border-radius: 2px; border: 1px solid var(--border); }

@media (max-width: 720px) {
  .ui-grid-2 { grid-template-columns: 1fr; }
  .ui-row { grid-template-columns: 7rem 1fr 2rem; }
  .ui-zone-map { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; grid-template-areas: "espana europa" "eeuu global"; }
}

/* Hall of Fame: monthly podium, historical palmares, Top 10.
   Medals never rely on colour alone: every card and tally carries the medal name
   ("Oro"/"Plata"/"Bronce") and its numeric position as text. */
.hof-head p { max-width: 820px; }
.hof-lede { color: var(--muted); }
.hof-head-meta { display: grid; gap: .1rem; text-align: right; margin: 0; }
.hof-head-meta strong { color: var(--text); font-size: 1rem; }
.hof-head-meta span { color: var(--muted); font-size: .72rem; }
.hof-month-filter { margin-bottom: 1rem; align-items: flex-end; gap: .5rem; }
.hof-alert {
  margin: .2rem 0 1rem; padding: .6rem .8rem;
  border: 1px solid color-mix(in srgb, var(--warning) 42%, var(--border));
  border-radius: 8px; background: color-mix(in srgb, var(--warning) 10%, var(--surface));
  color: var(--text-soft); font-size: .78rem; line-height: 1.5;
}

.hof-podium-layer { margin-top: 1.2rem; }
.hof-two-col {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem; align-items: start;
}
/* Podium: a single grid of 2 columns × (title row + 3 medal rows). The panels
   and their lists are subgrids that inherit those rows, so the Gold/Silver/Bronze
   cards line up horizontally across the companies and funds columns no matter how
   tall a card's content is. This replaces the old guessed min-heights (two
   independent lists could never sync row heights). */
.hof-podium-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto repeat(3, auto); gap: 0 .9rem;
}
.hof-podium-panel {
  min-width: 0; display: grid; grid-row: 1 / span 4;
  grid-template-rows: subgrid; gap: .55rem;
}
.hof-podium-panel .card-subtitle { margin: 0; }
.hof-podium-list {
  display: grid; grid-row: 2 / span 3; grid-template-rows: subgrid; gap: .6rem;
}
.hof-board-panel { min-width: 0; display: grid; gap: .55rem; }

.hof-podium-list { list-style: none; margin: .2rem 0 0; padding: 0; display: grid; gap: .6rem; }
/* Cards flex-column so the report link anchors to the bottom (margin-top:auto),
   keeping cards with different content lengths visually level across columns. */
.hof-podium-card {
  min-width: 0; display: flex; flex-direction: column; gap: .5rem;
  overflow-wrap: anywhere;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-soft); padding: .8rem;
}
.hof-podium-card > .hof-report-link,
.hof-podium-card > .hof-report-missing { margin-top: auto; }
/* Reserve two lines for the name so a 1-line (company) vs 2-line (fund) title
   doesn't shift the metric/tally block below it within a card. Cross-column row
   alignment is handled by the subgrid on .hof-podium-list (see above). */
.hof-podium-identity h4 { min-height: 2.5em; }
.medal-1 .hof-podium-identity h4 { min-height: 3em; }
/* Gold gets more surface and contrast, WITHOUT reordering the list: 1,2,3 stays
   the reading and DOM order (no 2-1-3 podium). */
.hof-podium-card.medal-1 {
  border-color: color-mix(in srgb, var(--gold) 60%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 12%, var(--surface-raised)), var(--surface));
  padding: 1rem;
}
.hof-podium-card.medal-2 { border-color: color-mix(in srgb, var(--silver) 48%, var(--border)); }
.hof-podium-card.medal-3 { border-color: color-mix(in srgb, var(--bronze) 48%, var(--border)); }

.hof-medal-badge { display: flex; align-items: center; gap: .4rem; margin: 0; }
.hof-medal-badge strong { color: var(--text); font-size: .8rem; font-weight: 860; }
.hof-medal-badge span:last-child { color: var(--muted); font-size: .7rem; }
.hof-medal-dot {
  width: .7rem; height: .7rem; border-radius: 999px; flex: 0 0 auto;
  border: 1px solid var(--border); background: var(--surface);
}
.hof-medal-dot.medal-1 { background: var(--gold); border-color: var(--gold); }
.hof-medal-dot.medal-2 { background: var(--silver); border-color: var(--silver); }
.hof-medal-dot.medal-3 { background: var(--bronze); border-color: var(--bronze); }

.hof-podium-identity h4 { margin: 0; color: var(--text); font-size: 1rem; line-height: 1.25; }
.medal-1 .hof-podium-identity h4 { font-size: 1.2rem; }
.hof-identity-meta { display: grid; gap: .06rem; margin: .18rem 0 0; }
.hof-identity-meta span { color: var(--muted); font-size: .72rem; line-height: 1.35; }
.hof-id { font-variant-numeric: tabular-nums; }

.hof-podium-metric { display: grid; gap: .06rem; margin: 0; }
.hof-podium-metric span { color: var(--muted); font-size: .62rem; text-transform: uppercase; font-weight: 780; }
.hof-podium-metric strong { color: var(--text); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.medal-1 .hof-podium-metric strong { font-size: 1.4rem; }

.hof-move { display: inline-block; font-size: .7rem; font-weight: 760; }
.hof-move.is-up { color: var(--pass); }
.hof-move.is-down { color: var(--blocked); }
.hof-move.is-flat, .hof-move.is-new { color: var(--muted); }

.hof-tally { list-style: none; display: flex; flex-wrap: wrap; gap: .55rem; margin: 0; padding: 0; }
.hof-tally li { display: flex; align-items: center; gap: .25rem; font-size: .72rem; color: var(--muted); }
.hof-tally strong { color: var(--text); font-variant-numeric: tabular-nums; }

.hof-podium-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin: 0; }
.hof-podium-stats div { min-width: 0; border-left: 1px solid var(--border); padding-left: .45rem; }
.hof-podium-stats dt { color: var(--muted); font-size: .58rem; line-height: 1.3; }
.hof-podium-stats dd { margin: .1rem 0 0; color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }

/* Report links: always visible, never colour-only, 44px touch target. */
.hof-report-link { justify-self: start; align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; }
.hof-report-link.is-compact { min-height: 32px; padding: .25rem .5rem; font-size: .7rem; text-align: center; max-width: 100%; }
.hof-report-missing { color: var(--muted); font-size: .7rem; font-style: italic; }
.hof-report-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.hof-table { width: 100%; }
.hof-table caption { text-align: left; color: var(--muted); font-size: .7rem; padding-bottom: .4rem; }
.hof-table th, .hof-table td { vertical-align: middle; }
.hof-table td, .hof-table th[scope="row"] { font-variant-numeric: tabular-nums; }
.hof-entity-cell { text-align: left; font-weight: 400; overflow-wrap: anywhere; }
.hof-entity-cell strong { display: block; color: var(--text); font-size: .82rem; line-height: 1.25; }
.hof-entity-cell span { display: block; color: var(--muted); font-size: .68rem; line-height: 1.3; }
.hof-rank-cell { color: var(--text); font-weight: 860; font-variant-numeric: tabular-nums; }

.hof-status-pill {
  display: inline-flex; align-items: center; min-height: 24px; padding: .18rem .48rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-soft);
  color: var(--muted); font-size: .64rem; font-weight: 760; white-space: nowrap;
}
.hof-status-pill.is-in {
  border-color: color-mix(in srgb, var(--pass) 52%, var(--border));
  background: var(--pass-soft); color: var(--pass);
}

/* auto-rows: 1fr makes every card in a row the SAME height; the card is a
   flex-column with the report button anchored to the bottom, so cards with a
   long (2-line) name stay level with short-name cards in the same row. */
.hof-category-grid {
  list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-auto-rows: 1fr; gap: .65rem;
}
.hof-category-card {
  min-width: 0; display: flex; flex-direction: column; gap: .45rem;
  overflow-wrap: anywhere;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: .75rem;
}
.hof-category-card > .hof-report-link,
.hof-category-card > .hof-report-missing { margin-top: auto; }
.hof-category-name { margin: 0; color: var(--muted); font-size: .62rem; font-weight: 780; text-transform: uppercase; }
.hof-category-entity { margin: 0; }
/* Reserve two lines for the name so 1-line vs 2-line names don't shift the
   metrics/button row below. */
.hof-category-entity strong { display: block; color: var(--text); font-size: .88rem; line-height: 1.25; min-height: 2.5em; }
.hof-category-entity span { display: block; color: var(--muted); font-size: .68rem; }
.hof-category-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; margin: 0; }
.hof-category-card dt { color: var(--muted); font-size: .58rem; line-height: 1.3; }
.hof-category-card dd { margin: .08rem 0 0; color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }

.hof-manager-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.hof-manager-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: .7rem; align-items: center;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); padding: .55rem .7rem;
}
.hof-manager-name { color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
.hof-manager-metric { display: grid; gap: .04rem; text-align: right; }
.hof-manager-metric span { color: var(--muted); font-size: .6rem; }
.hof-manager-metric strong { color: var(--text); font-variant-numeric: tabular-nums; }

.hof-method-details { margin-top: 1.15rem; }
.hof-method-details summary { cursor: pointer; color: var(--muted); font-size: .75rem; font-weight: 760; margin-bottom: .55rem; }
.hof-method-details summary:hover { color: var(--text); }
.hof-method-details summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.hof-method dl { display: grid; gap: .5rem; margin: 0; }
.hof-method dt { color: var(--text); font-size: .72rem; font-weight: 800; }
.hof-method dd { margin: .1rem 0 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }

/* Tablet: stack the two boards so nothing gets squeezed. */
@media (max-width: 1024px) {
  .hof-podium-grid, .hof-two-col { grid-template-columns: 1fr; }
}
/* Mobile: single column, no forced horizontal scroll, keep the report link. */
@media (max-width: 640px) {
  .hof-head-meta { text-align: left; }
  .hof-podium-stats { grid-template-columns: 1fr; }
  .hof-podium-stats div { border-left: 0; border-top: 1px solid var(--border); padding: .3rem 0 0; }
  .hof-manager-row { grid-template-columns: auto minmax(0, 1fr); row-gap: .4rem; }
  .hof-manager-metric { text-align: left; grid-column: 2; }
  .hof-manager-row .hof-report-link { grid-column: 2; justify-self: start; }
  .hof-report-link.is-compact { min-height: 44px; }
}

/* Public Atlas landing refactor */
.landing-page {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 24%, transparent), transparent 28rem),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 42%),
    var(--bg);
}
.landing-nav {
  position: sticky; top: 0; z-index: 50; min-height: 72px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: clamp(.55rem, 1.5vw, 1rem);
  align-items: center; border-bottom: 1px solid var(--border);
  padding: .75rem clamp(1rem, 5vw, 4.5rem);
  background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.landing-brand { border: 0; min-height: auto; padding: 0; }
.landing-brand .brand-mark { width: 36px; height: 36px; }
.landing-nav-links, .landing-nav-actions { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.landing-nav-links { justify-content: center; overflow: hidden; gap: .3rem; }
.landing-nav-links a {
  color: var(--text-soft); font-size: .95rem; font-weight: 640; padding: .4rem .7rem;
  border-radius: 8px; text-decoration: none; white-space: nowrap;
}
.landing-nav-links a:hover, .landing-nav-links a:focus-visible {
  color: var(--text); background: var(--surface-soft); outline: none;
}
.landing-mobile-menu { display: none; position: relative; }
.landing-mobile-menu summary { list-style: none; }
.landing-mobile-menu summary::-webkit-details-marker { display: none; }
.landing-mobile-panel {
  position: absolute; right: 0; top: calc(100% + .55rem); min-width: 220px;
  display: grid; gap: .25rem; padding: .65rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); box-shadow: var(--shadow);
}
.landing-mobile-panel a {
  color: var(--text-soft); padding: .55rem .65rem; border-radius: 8px; text-decoration: none;
}
.landing-mobile-panel a:hover, .landing-mobile-panel a:focus-visible {
  color: var(--text); background: var(--surface-soft); outline: none;
}
.landing-main { width: min(1180px, 100%); margin: 0 auto; padding: 1rem 1rem 4rem; }
.landing-beta-bar {
  display: flex; align-items: center; gap: .8rem; width: min(920px, 100%); margin: 1rem auto 0;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 999px; background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
  padding: .55rem .85rem;
}
.landing-beta-bar span {
  flex: 0 0 auto; color: var(--bg); background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-radius: 999px; padding: .18rem .55rem; font-size: .66rem; font-weight: 820;
}
.landing-beta-bar p { margin: 0; color: var(--text-soft); font-size: .75rem; line-height: 1.45; }
.landing-hero {
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
  gap: clamp(2rem, 6vw, 4.8rem); align-items: center; padding: clamp(3rem, 7vw, 5.2rem) 0 2.5rem;
}
.landing-hero-copy { max-width: 740px; }
.landing-hero-brand { display: flex; align-items: center; gap: .95rem; margin-bottom: 1.15rem; }
.landing-hero-brand .eyebrow { margin: 0 0 .22rem; }
.landing-hero-brandline {
  display: block; color: var(--muted); font-size: .72rem; font-weight: 760;
  letter-spacing: 0; text-transform: uppercase;
}
.landing-hero h1 {
  max-width: 880px; margin: .42rem 0 1rem;
  font-size: 4.35rem; line-height: 1.02; letter-spacing: 0;
}
.landing-lead {
  max-width: 720px; color: var(--text-soft); font-size: 1.08rem;
  line-height: 1.72;
}
.landing-chip-row { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1.25rem 0 1.35rem; }
.landing-chip-row span {
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-soft);
  color: var(--text-soft); padding: .32rem .65rem; font-size: .72rem; font-weight: 680;
}
.landing-hero-actions .button, .landing-hero-actions .button-primary { min-height: 44px; }
/* Secondary CTA "Ver un informe real" — the strongest hook (show the product
   before asking to register). Accent-outline so it stands out above a plain
   button without competing with the primary gradient. Brand colours only. */
.landing-cta-outline {
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border));
  color: var(--accent); background: var(--accent-soft); font-weight: 700;
}
.landing-cta-outline:hover {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.landing-microcopy { margin: .85rem 0 0; color: var(--muted); font-size: .72rem; max-width: 680px; }
.landing-product-shot {
  margin: 0; border: 1px solid var(--border); border-radius: 8px; padding: .85rem;
  background: linear-gradient(160deg, var(--surface-raised), var(--surface));
  box-shadow: var(--shadow); overflow: hidden;
}
.landing-shot-top, .landing-product-shot figcaption, .landing-map-legend {
  display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap;
  color: var(--muted); font-size: .68rem;
}
.landing-shot-top { margin-bottom: .65rem; }
.landing-shot-top strong { color: var(--text); }
.landing-map-frame {
  position: relative; min-height: 320px; display: grid; place-items: center; overflow: hidden;
  border: 1px solid var(--border); border-radius: 8px;
  background: linear-gradient(160deg, var(--surface-soft), var(--surface));
}
.landing-map-frame img {
  width: min(900px, 125%); max-width: none; opacity: .62; filter: invert(1) hue-rotate(176deg) saturate(.65) brightness(.78);
}
.landing-map-focus {
  position: absolute; left: 1rem; bottom: 1rem; width: min(78%, 300px);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  border-radius: 8px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  padding: .8rem; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.landing-map-focus span, .landing-map-focus small { display: block; color: var(--muted); font-size: .66rem; }
.landing-map-focus strong { display: block; margin: .12rem 0; font-size: 1.15rem; }
.landing-product-shot figcaption { margin: .7rem 0 .55rem; }
.landing-map-legend { justify-content: flex-start; border-top: 1px solid var(--border); padding-top: .65rem; }
.landing-map-legend span { display: inline-flex; align-items: center; gap: .32rem; }
.landing-map-legend i { width: 10px; height: 10px; border-radius: 999px; border: 1px solid var(--border); }
.legend-low { background: var(--pass); }
.legend-mid { background: var(--warning); }
.legend-high { background: var(--blocked); }
.legend-none { background: var(--surface-soft); }
.landing-section { margin-top: clamp(3.5rem, 7vw, 6.3rem); scroll-margin-top: 92px; }
.landing-section-head { max-width: 780px; margin-bottom: 1.25rem; }
.landing-section-head h2 { margin: .25rem 0 .5rem; font-size: 2.15rem; line-height: 1.08; letter-spacing: 0; }
.landing-section-head p { color: var(--muted); margin: 0; }
.landing-compare, .landing-quality-grid, .landing-beta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.landing-compare article, .landing-quality-grid article, .landing-beta-grid article,
.landing-steps article, .landing-gallery-card, .landing-details,
.landing-faq-list details, .landing-pricing-accordion details {
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: .9rem;
}
.landing-compare article.is-positive { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.landing-compare h3, .landing-quality-grid h3, .landing-beta-grid h3, .landing-gallery-copy h3 { margin: 0 0 .45rem; font-size: .98rem; }
.landing-compare ul, .landing-beta-grid ul, .landing-pricing-accordion ul { margin: 0; padding-left: 1.1rem; color: var(--text-soft); }
.landing-compare li, .landing-beta-grid li, .landing-pricing-accordion li { margin: .35rem 0; }
.landing-gallery { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: .85rem; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: .35rem; }
.landing-gallery-card { display: grid; grid-template-rows: 180px 1fr; gap: .85rem; scroll-snap-align: start; }
/* Copy is a flex-column so cards with an extra CTA (informes) keep the report
   block anchored to the bottom instead of stretching the card unevenly. */
.landing-gallery-copy { display: flex; flex-direction: column; min-height: 0; }
.landing-gallery-copy .landing-reports { margin-top: auto; }
.landing-preview { min-height: 0; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); }
.landing-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.landing-preview-pending { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); }
.landing-preview-pending span { border: 1px solid var(--border); border-radius: 999px; padding: .35rem .65rem; background: var(--surface); }

/* Branded abstract previews — a stylised mini-mockup per screen type instead of
   an empty "Vista en preparación" placeholder. No real data, no external image;
   pure CSS in the Dotty accent so cards read as a real product, not a blank. */
.landing-preview-mock {
  width: 100%; height: 100%; padding: .9rem; display: flex; flex-direction: column;
  gap: .4rem; overflow: hidden;
  background:
    radial-gradient(120% 90% at 80% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--surface-soft);
}
.landing-preview-mock .mk-bar { border-radius: 4px; background: color-mix(in srgb, var(--text) 14%, transparent); height: .5rem; }
.landing-preview-mock .mk-title { width: 62%; height: .8rem; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.landing-preview-mock .mk-sub { width: 40%; }
.landing-preview-mock .mk-line { width: 100%; }
.landing-preview-mock .mk-line.short { width: 55%; }
/* ficha: title + sub + 3 KPI chips + lines */
.mock-ficha .mk-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin: .2rem 0; }
.mock-ficha .mk-kpis span { height: 1.8rem; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
/* tabla: 3×2 grid of cells */
.mock-tabla .mk-table { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; height: 100%; }
.mock-tabla .mk-table span { border-radius: 5px; background: color-mix(in srgb, var(--text) 8%, var(--surface)); border: 1px solid var(--border); }
.mock-tabla .mk-table span:nth-child(3n+1) { border-left: 3px solid var(--accent); }
/* informe: text lines + a little bar chart */
.mock-informe .mk-chart { margin-top: auto; display: flex; align-items: flex-end; gap: .35rem; height: 2.4rem; }
.mock-informe .mk-chart span { flex: 1; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--accent), var(--accent-strong)); }
.mock-informe .mk-chart span:nth-child(1) { height: 55%; } .mock-informe .mk-chart span:nth-child(2) { height: 85%; }
.mock-informe .mk-chart span:nth-child(3) { height: 40%; } .mock-informe .mk-chart span:nth-child(4) { height: 70%; }
/* ia: chat bubbles */
.mock-ia .mk-chat { display: flex; flex-direction: column; gap: .5rem; justify-content: center; height: 100%; }
.mock-ia .mk-msg { height: 1.4rem; width: 72%; border-radius: 10px; background: color-mix(in srgb, var(--text) 10%, var(--surface)); border: 1px solid var(--border); }
.mock-ia .mk-msg.you { align-self: flex-end; width: 58%; background: color-mix(in srgb, var(--accent) 18%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.landing-gallery-copy strong { display: block; margin-bottom: .35rem; color: var(--text-soft); }
.landing-gallery-copy p, .landing-quality-grid p, .landing-steps p, .landing-faq-list p { margin: 0; color: var(--muted); line-height: 1.6; }
.landing-reports { margin-top: .9rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.landing-reports-note { margin: 0 0 .5rem; font-size: .72rem; color: var(--muted); }
.landing-report-cta { display: inline-block; margin-top: .2rem; }
.landing-reports-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.landing-report-link { display: block; border: 1px solid var(--border); border-radius: 8px; padding: .55rem .65rem; text-decoration: none; background: var(--surface-soft); }
.landing-report-link:hover { border-color: var(--accent); }
.landing-report-name { font-size: .82rem; color: var(--text); font-weight: 600; }
.landing-report-name small { color: var(--muted); font-weight: 400; }
.landing-report-meta { font-size: .7rem; color: var(--muted); }
.landing-status { display: inline-flex; width: fit-content; margin-bottom: .5rem; border: 1px solid var(--border); border-radius: 999px; padding: .16rem .48rem; color: var(--accent); font-size: .66rem; font-weight: 760; }
.landing-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.landing-steps article span { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: .65rem; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: var(--bg); font-weight: 850; }
.landing-steps article h3 { margin: 0 0 .35rem; font-size: .9rem; }
.landing-details { margin-top: .9rem; }
.landing-details summary { cursor: pointer; color: var(--text); font-weight: 760; }
.landing-details summary:focus-visible { color: var(--accent); outline: none; }
.landing-flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; margin-top: .8rem; }
.landing-flow span { display: grid; place-items: center; min-height: 54px; border: 1px solid var(--border); border-radius: 8px; padding: .45rem; color: var(--text-soft); text-align: center; font-size: .72rem; }
.landing-term-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.landing-term-row abbr { border: 1px solid var(--border); border-radius: 999px; padding: .25rem .5rem; color: var(--text-soft); text-decoration: none; }
.landing-pricing-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.landing-pricing-table { width: 100%; min-width: 920px; border-collapse: collapse; background: var(--surface); }
.landing-pricing-table th, .landing-pricing-table td { border-bottom: 1px solid var(--border); padding: .75rem; text-align: left; vertical-align: top; }
.landing-pricing-table th { background: var(--surface-soft); color: var(--text); }
.landing-pricing-table th span { display: block; margin-top: .22rem; color: var(--accent); font-size: .82rem; }
.landing-pricing-table td:first-child { color: var(--muted); font-weight: 760; }
.landing-pricing-accordion { display: none; gap: .65rem; }
.landing-pricing-accordion summary { display: flex; justify-content: space-between; gap: .75rem; cursor: pointer; color: var(--text); font-weight: 760; }
.landing-pricing-accordion summary strong { color: var(--accent); white-space: nowrap; }
.landing-note { margin: .85rem 0 0; color: var(--muted); font-size: .78rem; }

/* Compact plan cards (replace the dense feature matrix). Equal-height columns
   via grid-auto-rows:1fr + flex-column cards with the CTA anchored to the bottom,
   so the three cards line up. Middle card highlighted in brand accent. */
.landing-plan-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-auto-rows: 1fr; gap: 1rem;
}
.landing-plan-card {
  display: flex; flex-direction: column; gap: .55rem; min-width: 0; position: relative;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  padding: 1.4rem 1.2rem;
}
.landing-plan-card.is-featured {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 8%, var(--surface-raised)), var(--surface));
}
.landing-plan-tag {
  position: absolute; top: -.7rem; left: 1.2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--bg); font-size: .62rem; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; padding: .2rem .5rem; border-radius: 999px;
}
.landing-plan-card h3 { margin: 0; color: var(--text); font-size: 1.05rem; }
.landing-plan-price { margin: 0; color: var(--accent); font-size: .82rem; font-weight: 700; }
.landing-plan-card ul { margin: .3rem 0 0; padding-left: 1.05rem; color: var(--text-soft); font-size: .82rem; }
.landing-plan-card li { margin: .4rem 0; line-height: 1.45; }
.landing-plan-cta { margin-top: auto; align-self: flex-start; min-height: 40px; display: inline-flex; align-items: center; }
.landing-wtp-intro { color: var(--muted); margin: .4rem 0 0; max-width: 720px; }
.landing-wtp-thanks { border: 1px solid color-mix(in srgb, var(--pass) 42%, var(--border)); border-radius: 8px; background: var(--pass-soft); color: var(--text); padding: .8rem; }
.landing-wtp-form { margin-top: 1.1rem; }
.landing-wtp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.landing-wtp-item { display: grid; gap: .3rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: .8rem; }
.landing-wtp-label { font-weight: 760; color: var(--text); }
.landing-wtp-desc { color: var(--muted); font-size: .76rem; min-height: 2.1em; }
.landing-wtp-input { display: flex; align-items: center; gap: .45rem; margin-top: .3rem; }
.landing-wtp-input input { width: 100%; min-height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); color: var(--text); padding: .45rem .55rem; }
.landing-wtp-unit { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.landing-wtp-comment { display: flex; flex-direction: column; gap: .3rem; margin: 1rem 0; }
.landing-wtp-comment span { color: var(--muted); font-size: .8rem; }
.landing-wtp-comment textarea { min-height: 96px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); padding: .65rem; resize: vertical; }
.landing-cta-primary { min-height: 44px; border: 0; border-radius: 8px; padding: .65rem .9rem; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: var(--bg); font-weight: 800; cursor: pointer; }
.landing-beta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.landing-faq-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.landing-faq-list summary { cursor: pointer; color: var(--text); font-weight: 760; }
.landing-faq-list summary:focus-visible { color: var(--accent); outline: none; }
.landing-faq-list p { margin-top: .55rem; }
.landing-final-cta { margin-top: clamp(3.5rem, 7vw, 6.3rem); border: 1px solid var(--border); border-radius: 8px; background: linear-gradient(135deg, var(--surface-raised), var(--surface)); padding: clamp(1.15rem, 4vw, 2rem); }
.landing-final-cta h2 { margin: 0 0 .6rem; font-size: 2.65rem; line-height: 1.06; letter-spacing: 0; }
.landing-final-cta p { max-width: 720px; margin: 0 0 1.2rem; color: var(--text-soft); }
.landing-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem clamp(1rem, 5vw, 4.5rem); border-top: 1px solid var(--border); }
.landing-footer div, .landing-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.landing-footer strong { color: var(--text); }
.landing-footer a { color: var(--muted); }
.landing-footer a:hover, .landing-footer a:focus-visible { color: var(--accent); outline: none; }
@media (max-width: 1120px) {
  .landing-nav { grid-template-columns: auto 1fr auto; }
  .landing-nav-links, .landing-nav-actions { display: none; }
  .landing-mobile-menu { display: block; justify-self: end; }
  .landing-hero { grid-template-columns: 1fr; }
  .landing-hero h1 { font-size: 3.45rem; }
  .landing-section-head h2 { font-size: 2rem; }
  .landing-final-cta h2 { font-size: 2.25rem; }
  .landing-product-shot { max-width: 720px; }
  .landing-steps, .landing-beta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .landing-main { padding-top: .75rem; }
  .landing-beta-bar { align-items: flex-start; border-radius: 8px; flex-direction: column; gap: .45rem; }
  .landing-hero { padding-top: 2.4rem; }
  .landing-hero h1 { font-size: 2.65rem; }
  .landing-section-head h2 { font-size: 1.75rem; }
  .landing-final-cta h2 { font-size: 1.9rem; }
  .landing-hero-brand { align-items: flex-start; gap: .7rem; }
  .landing-hero-logo { width: 76px; }
  .landing-compare, .landing-quality-grid, .landing-steps,
  .landing-beta-grid, .landing-faq-list { grid-template-columns: 1fr; }
  .landing-map-frame { min-height: 255px; display: flex; flex-direction: column; justify-content: center; }
  .landing-map-focus { position: static; width: auto; margin: .75rem; }
  .landing-map-frame img { width: 145%; }
  .landing-pricing-table-wrap { display: none; }
  .landing-pricing-accordion { display: grid; }
  .landing-wtp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-footer { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) {
  .landing-nav { padding: .65rem .8rem; }
  .landing-wtp-grid { grid-template-columns: 1fr; }
  .landing-mobile-panel { right: -.2rem; }
  .landing-gallery { grid-auto-columns: minmax(270px, 86vw); }
  .landing-hero h1 { font-size: 2.15rem; }
}
/* ── Country detail visual refactor ─────────────────────────────────────── */
.country-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .42fr);
  align-items: stretch; gap: 1rem; margin-bottom: 1.4rem;
}
.country-hero-copy { min-width: 0; }
.country-hero-copy h1 { margin-bottom: .45rem; }
.country-hero-copy p { max-width: 860px; color: var(--text-soft); line-height: 1.7; }
.country-hero-panel {
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  padding: 1rem; display: grid; align-content: space-between; gap: .85rem;
}
.country-hero-panel > span, .country-hero-scoreline span {
  color: var(--muted); font-size: .66rem; font-weight: 780; letter-spacing: 0; text-transform: uppercase;
}
.country-hero-panel > strong { color: var(--text); font-size: 1.05rem; line-height: 1.25; }
.country-hero-panel p { margin: 0; color: var(--text-soft); font-size: .76rem; line-height: 1.55; }
.country-hero-scoreline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.country-hero-scoreline div { border-top: 1px solid var(--border); padding-top: .48rem; }
.country-hero-scoreline strong { display: block; margin-top: .12rem; font-size: 1rem; font-variant-numeric: tabular-nums; }
.country-section { margin-top: 2rem; }
.country-visual-summary {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; margin-top: 1rem;
}
.country-gauge-card {
  min-height: 132px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-soft); padding: .8rem; display: grid; grid-template-columns: 86px minmax(0, 1fr);
  align-items: center; gap: .7rem;
}
.country-gauge { position: relative; width: 82px; aspect-ratio: 1; display: grid; place-items: center; }
.country-gauge svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.country-gauge circle { fill: none; stroke-width: 10; }
.country-gauge .gauge-track { stroke: color-mix(in srgb, var(--border) 78%, transparent); }
.country-gauge .gauge-fill { stroke: var(--accent); stroke-linecap: round; }
.country-gauge strong { position: relative; font-size: .98rem; font-variant-numeric: tabular-nums; }
.country-gauge-card > div:last-child span { display: block; color: var(--text); font-size: .78rem; font-weight: 820; }
.country-gauge-card > div:last-child small { display: block; margin-top: .18rem; color: var(--muted); font-size: .66rem; line-height: 1.35; }
.country-gauge-card.tone-good .gauge-fill { stroke: var(--pass); }
.country-gauge-card.tone-info .gauge-fill { stroke: var(--info); }
.country-gauge-card.tone-risk .gauge-fill { stroke: var(--warning); }
.country-gauge-card.tone-neutral .gauge-fill { stroke: var(--muted); }
.country-reading-grid-v2 { grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); align-items: stretch; }
.country-score-bars { min-width: 0; }
.country-bar-list { display: grid; gap: .68rem; }
.country-bar-row, .country-sector-bar-row {
  display: grid; grid-template-columns: minmax(150px, .85fr) minmax(140px, 1fr) 52px;
  align-items: center; gap: .65rem;
}
.country-bar-label strong, .country-sector-bar-row strong { display: block; color: var(--text); font-size: .73rem; }
.country-bar-label span, .country-sector-bar-row span { display: block; margin-top: .12rem; color: var(--muted); font-size: .64rem; line-height: 1.35; }
.country-bar-track { height: 9px; overflow: hidden; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.country-bar-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.country-bar-row.tone-good .country-bar-fill { background: var(--pass); }
.country-bar-row.tone-info .country-bar-fill { background: var(--info); }
.country-bar-row.tone-risk .country-bar-fill { background: var(--warning); }
.country-bar-row.tone-neutral .country-bar-fill { background: var(--muted); }
.country-bar-row em, .country-sector-bar-row em { color: var(--text-soft); font-size: .68rem; font-style: normal; font-weight: 780; text-align: right; font-variant-numeric: tabular-nums; }
.country-forecast-layout { display: grid; gap: .8rem; }
.country-forecast-main { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.country-delta-card {
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft);
  padding: .85rem; display: grid; align-content: center; min-height: 132px;
}
.country-delta-card span { color: var(--muted); font-size: .66rem; font-weight: 780; text-transform: uppercase; letter-spacing: 0; }
.country-delta-card strong { margin-top: .2rem; font-size: 1.55rem; font-variant-numeric: tabular-nums; }
.country-delta-card small { margin-top: .25rem; color: var(--muted); font-size: .68rem; }
.country-context-grid-v2 { align-items: stretch; }
.country-risk-blocks-card, .country-stability-card, .country-fundamentals-card { margin-top: .85rem; }
.country-risk-extremes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin-top: .75rem; }
.country-risk-extreme {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); padding: .65rem;
}
.country-risk-extreme span { display: block; color: var(--muted); font-size: .64rem; }
.country-risk-extreme strong { display: block; margin-top: .16rem; color: var(--text); font-size: .82rem; }
.country-risk-extreme.is-risk { border-color: color-mix(in srgb, var(--blocked) 32%, var(--border)); background: var(--blocked-soft); }
.country-risk-extreme.is-strength { border-color: color-mix(in srgb, var(--pass) 32%, var(--border)); background: var(--pass-soft); }
/* Sovereign 10Y block (Derivados): what the market charges this country today. */
.country-sovereign-card { margin-top: .85rem; }
.country-sovereign-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-top: .75rem; }
.country-sovereign-metric { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); padding: .7rem; }
.country-sovereign-metric.is-primary { border-color: color-mix(in srgb, var(--accent) 34%, var(--border)); background: var(--accent-soft); }
.country-sovereign-metric span, .country-sovereign-metric small { display: block; color: var(--muted); font-size: .64rem; line-height: 1.3; }
.country-sovereign-metric strong { display: block; margin: .16rem 0; color: var(--text); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.country-sovereign-reading { margin: .7rem 0 0; color: var(--text-soft); font-size: .76rem; line-height: 1.55; }

/* Country-specific risk flags (the non-discriminating ones are filtered out). */
.country-flags-card { margin-top: .85rem; }
.country-flag-list { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .5rem; }
.country-flag {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .6rem; align-items: start;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); padding: .65rem;
}
.country-flag strong { display: block; color: var(--text); font-size: .8rem; }
.country-flag span { display: block; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.country-flag-severity {
  align-self: start; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--muted);
  padding: .16rem .45rem; font-size: .6rem; font-weight: 800; white-space: nowrap;
}
.country-flag.severity-high { border-color: color-mix(in srgb, var(--blocked) 34%, var(--border)); background: var(--blocked-soft); }
.country-flag.severity-high .country-flag-severity { border-color: color-mix(in srgb, var(--blocked) 52%, var(--border)); color: var(--blocked); }
.country-flag.severity-medium { border-color: color-mix(in srgb, var(--warning) 34%, var(--border)); background: var(--warning-soft); }
.country-flag.severity-medium .country-flag-severity { border-color: color-mix(in srgb, var(--warning) 52%, var(--border)); color: var(--warning); }

/* Caveat / driver note used by the geopolitical and taxonomy cards. */
.country-note { margin: .6rem 0 0; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.country-note strong { color: var(--text-soft); }
/* Membership caveats: corrections to a fact stated just above (e.g. a bloc
   membership that is formally suspended). Amber, because ignoring one makes the
   list above read as false — but not an error state, so no red. */
.country-note-list { margin: .5rem 0 0; padding-left: 1rem; color: var(--muted);
    font-size: .72rem; line-height: 1.5; }
.country-note-list li { margin: .15rem 0; }
.country-note-list li::marker { color: var(--warning); }

/* Risk-by-block map on ONE row (owner: "hazlo en una fila"): flow in a single
   column track so 6-7 blocks never wrap to a ragged 2nd row; a long list scrolls
   horizontally inside its own box. */
.country-risk-blocks { display: grid; grid-auto-flow: column;
    grid-auto-columns: minmax(120px, 1fr); gap: .55rem; margin-top: .75rem;
    overflow-x: auto; scrollbar-width: thin; }
.country-risk-pill {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); padding: .65rem; min-height: 72px;
}
.country-risk-pill strong, .country-risk-pill span { display: block; }
.country-risk-pill strong { color: var(--text); font-size: .72rem; }
.country-risk-pill span { margin-top: .16rem; color: var(--muted); font-size: .64rem; }
.country-risk-pill.risk-low, .country-risk-pill.risk-minimal { border-color: color-mix(in srgb, var(--pass) 32%, var(--border)); background: var(--pass-soft); }
.country-risk-pill.risk-moderate { border-color: color-mix(in srgb, var(--warning) 32%, var(--border)); background: var(--warning-soft); }
.country-risk-pill.risk-elevated, .country-risk-pill.risk-high, .country-risk-pill.risk-critical { border-color: color-mix(in srgb, var(--blocked) 32%, var(--border)); background: var(--blocked-soft); }
.country-stability-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin: .8rem 0; }
.country-stability-tile { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); padding: .7rem; }
.country-stability-tile span, .country-stability-tile small { display: block; color: var(--muted); font-size: .66rem; }
.country-stability-tile strong { display: block; margin: .16rem 0; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.country-fundamental-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; }
.country-fundamental-card {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); padding: .75rem;
}
.country-fundamental-card span, .country-fundamental-card small { display: block; color: var(--muted); font-size: .66rem; }
.country-fundamental-card strong { display: block; margin: .2rem 0 .14rem; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.country-sector-bars { display: grid; gap: .58rem; margin-top: .8rem; }
.country-sector-bar-row { grid-template-columns: minmax(180px, 1fr) minmax(160px, 1.1fr) 48px; }
.country-sector-bar-row .country-bar-fill { background: linear-gradient(90deg, var(--info), var(--accent)); }

/* ── Data-coverage caveat banner (low-reliability countries) ── */
.country-coverage-caveat {
  display: flex; gap: .7rem; align-items: flex-start;
  border: 1px solid var(--warn, #b9892f); border-left-width: 3px;
  background: color-mix(in srgb, var(--warn, #b9892f) 12%, var(--surface));
  border-radius: 10px; padding: .7rem .9rem; margin: 0 0 1rem;
  font-size: .82rem; line-height: 1.4;
}
.country-coverage-caveat-icon { font-size: 1.1rem; line-height: 1; color: var(--warn, #b9892f); }

/* ── IRE deal governance caveat (no BUY operative at bulk stage) ── */
.ire-governance-caveat {
  /* block, not flex: it's a running-text notice; flex split <strong>/<em>/text
     into separate items and broke the sentence flow ("fase de  cribado"). */
  display: block;
  border: 1px solid var(--warn, #b9892f); border-left-width: 3px;
  background: color-mix(in srgb, var(--warn, #b9892f) 12%, var(--surface));
  border-radius: 10px; padding: .8rem 1rem; margin: 1rem 0 0;
  font-size: .85rem; line-height: 1.45;
}
.ire-caveat-icon { font-size: 1.15rem; line-height: 1; color: var(--warn, #b9892f); }
.c360-cta-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }

/* ── Reconfig Navegador tabs: per-tab "signal not advice" caveat banner ── */
.asset-caveat {
  border: 1px solid var(--warn, #b9892f); border-left-width: 3px;
  background: color-mix(in srgb, var(--warn, #b9892f) 12%, var(--surface));
  border-radius: 10px; padding: .7rem .9rem; margin: 0 0 1rem;
  font-size: .82rem; line-height: 1.45; color: var(--text);
}
.asset-caveat strong { color: var(--warn, #b9892f); }

/* Deal ficha: strategic context line under the headline score strip. */
.c360-strategic-context { margin-top: .9rem; }
.c360-strategic-context dt { color: var(--muted); }

/* Informes section (/informes) — simple download list */
.informes-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .6rem; max-width: 640px; }
.informes-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.informes-meta { display: flex; flex-direction: column; }
.informes-name { font-size: .95rem; font-weight: 600; color: var(--text); }
.informes-sub { font-size: .75rem; color: var(--text-muted); }
.informes-dl { white-space: nowrap; }

/* IRE section (/ire) — own page: top-deal cards */
.ire-deal-grid {
  display: grid; gap: 1rem; margin-top: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.ire-deal-card { text-decoration: none; color: inherit; display: block; transition: border-color .15s, transform .1s; }
.ire-deal-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.ire-deal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.ire-deal-head h3 { margin: 0; font-size: 1rem; color: var(--text); }
.ire-deal-sector { margin: .2rem 0 .7rem; font-size: .75rem; color: var(--text-muted); }
.ire-deal-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .9rem; margin: 0; }
.ire-deal-metrics div { display: flex; flex-direction: column; }
.ire-deal-metrics dt { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0; }
.ire-deal-metrics dd { margin: 0; font-size: .92rem; font-weight: 600; color: var(--text); }
.ire-more { margin-top: 1rem; }
.ire-more a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* ── Macro→equity bridge (cost of capital) ── */
.country-bridge-card { margin-top: 1rem; }
.country-bridge-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin-top: .4rem; }
.country-bridge-metric { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); padding: .75rem; }
.country-bridge-metric.is-primary { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface-soft)); }
.country-bridge-metric span, .country-bridge-metric small { display: block; color: var(--muted); font-size: .66rem; }
.country-bridge-metric strong { display: block; margin: .2rem 0 .14rem; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.country-scenario-bars { display: grid; gap: .4rem; margin-top: .9rem; }
.country-scenario-row { display: grid; grid-template-columns: 64px 1fr 44px; align-items: center; gap: .55rem; font-size: .76rem; }
.country-scenario-label { color: var(--muted); }
.country-scenario-row em { font-variant-numeric: tabular-nums; font-style: normal; text-align: right; }
.country-scenario-row.tone-good .country-bar-fill { background: var(--good, #3fa66a); }
.country-scenario-row.tone-accent .country-bar-fill { background: var(--accent); }
.country-scenario-row.tone-risk .country-bar-fill { background: var(--bad, #c0524e); }

/* ── Structural profile (segmentation) ── */
.country-structure-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
/* Geopolitics: its 3 cards on ONE row (owner: "en una sola fila de cajas"). */
.country-structure-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.country-fact-list { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .35rem; }
.country-fact-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; border-bottom: 1px dashed var(--border); padding-bottom: .3rem; }
.country-fact-list li:last-child { border-bottom: none; }
.country-fact-list span { color: var(--muted); font-size: .78rem; }
.country-fact-list strong { font-size: .84rem; text-align: right; font-variant-numeric: tabular-nums; }
.country-structure-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }

@media (max-width: 1220px) {
  .country-visual-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .country-risk-blocks, .country-fundamental-grid, .country-bridge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .country-hero, .country-reading-grid-v2, .country-structure-grid,
  .country-structure-grid-3 { grid-template-columns: 1fr; }
  .country-forecast-main { grid-template-columns: 1fr; }
  .country-stability-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .country-visual-summary, .country-risk-blocks, .country-fundamental-grid, .country-stability-tiles, .country-bridge-grid { grid-template-columns: 1fr; }
  .country-gauge-card { grid-template-columns: 72px minmax(0, 1fr); min-height: 112px; }
  .country-gauge { width: 70px; }
  .country-bar-row, .country-sector-bar-row { grid-template-columns: 1fr; gap: .35rem; }
  .country-bar-row em, .country-sector-bar-row em { text-align: left; }
  .country-hero-scoreline { grid-template-columns: 1fr; }
}


/* Admin shell visual refresh */
.admin-shell .admin-container {
  width: min(1480px, 100%);
  max-width: 1480px;
}
.admin-topbar {
  grid-template-columns: minmax(0, 1fr) auto;
}
.admin-top-title {
  min-width: 0;
}
.admin-top-title strong {
  display: block;
  margin-top: .05rem;
  font-size: 1.05rem;
  line-height: 1.2;
}
.admin-sidebar-status span {
  display: block;
  line-height: 1.45;
}
.admin-shell .page-header,
.admin-shell .page-head {
  margin-bottom: 1.2rem;
}
.admin-shell h2 {
  margin: 1.55rem 0 .7rem;
  font-size: 1rem;
  letter-spacing: 0;
}
.admin-shell h3 {
  margin: 1rem 0 .5rem;
  font-size: .9rem;
}
.admin-shell .card-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .85rem;
}
.admin-shell .stat-card {
  min-height: 96px;
  justify-content: space-between;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  box-shadow: none;
}
.admin-shell .stat-value {
  font-size: 1.7rem;
  line-height: 1;
}
.admin-shell .data-table {
  width: 100%;
}
.admin-shell .data-table th,
.admin-shell .data-table td {
  vertical-align: top;
}
.admin-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.2rem;
}
.admin-panel {
  min-width: 0;
}
.inline-action-form {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
}
.admin-input-compact {
  width: 5rem;
}
.release-overview {
  border-left: 6px solid var(--warning);
  padding: 1rem;
  margin-bottom: 1.25rem;
}
.release-overview.status-ok { border-left-color: var(--pass); }
.release-overview.status-block { border-left-color: var(--blocked); }
.release-overview.status-review { border-left-color: var(--warning); }
.admin-card-title {
  margin: 0 0 .45rem !important;
}
.admin-num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 860px) {
  .admin-split-grid { grid-template-columns: 1fr; }
}

/* ── Section anchor nav (Seguimiento, etc.) ────────────────────────────────── */
.section-anchors { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.section-anchors a {
    padding: .3rem .7rem; border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface-soft); color: var(--text-soft); font-size: .78rem;
    text-decoration: none;
}
.section-anchors a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ── Methodology per-engine ingested docs ──────────────────────────────────── */
.method-deep-grid {
    display: grid; gap: .8rem; margin-top: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.method-deep-card {
    display: flex; flex-direction: column; gap: .3rem; padding: 1rem;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface-soft); color: var(--text); text-decoration: none;
}
.method-deep-card:hover { border-color: var(--accent); text-decoration: none; }
.method-deep-card span { color: var(--accent); font-size: .8rem; }
.methodology-doc { max-width: 820px; margin-top: 1rem; }
.methodology-doc-meta { font-size: .78rem; }
.methodology-doc-section { margin: 1.2rem 0; }
.methodology-doc-level-2, .methodology-doc-level-3 { margin-left: .2rem; }
.methodology-doc h2 { margin-top: 1.4rem; }
.methodology-doc h3 { margin-top: 1rem; color: var(--text-soft); }
.methodology-doc p { margin: .5rem 0; line-height: 1.7; color: var(--text-soft); }
.methodology-doc-list { margin: .5rem 0 .5rem 1.1rem; color: var(--text-soft); line-height: 1.6; }
.methodology-doc-list li { margin: .25rem 0; }
.methodology-doc-quote {
    margin: .8rem 0; padding: .6rem .9rem; border-left: 3px solid var(--accent);
    background: var(--surface-soft); color: var(--text); font-style: italic;
}

/* Commodity factual reading line (no signal — market state only) */
.commodity-reading { margin: .2rem 0 .8rem; font-size: .9rem; }

/* Admin document manager: per-resource access assignment + replace panels */
.admin-doc-access summary,
.admin-doc-replace summary { cursor: pointer; font-size: .82rem; }
.admin-doc-access-form { margin-top: .5rem; }
.admin-doc-userlist {
  display: flex; flex-direction: column; gap: .3rem;
  max-height: 220px; overflow-y: auto; padding: .4rem .2rem;
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: .5rem;
}
.admin-doc-user { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.admin-doc-user input { flex: 0 0 auto; }
.admin-doc-actions { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.admin-doc-replace-form { margin-top: .5rem; display: flex; flex-direction: column; gap: .4rem; }

/* Communications composer: rich-text editor + recipient multi-select */
.comms-editor-toolbar { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .4rem; }
.comms-editor-toolbar button {
  padding: .3rem .6rem; font-size: .82rem; cursor: pointer;
  background: var(--surface-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
}
.comms-editor-toolbar button:hover { border-color: var(--accent); }
.comms-editor {
  min-height: 220px; padding: .8rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--text);
  font-size: .95rem; line-height: 1.6; overflow-y: auto; max-height: 460px;
}
.comms-editor:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.comms-editor:empty::before { content: attr(data-placeholder); color: var(--muted); }
.comms-editor img { max-width: 100%; height: auto; border-radius: 6px; }
.comms-recipients {
  display: flex; flex-direction: column; gap: .3rem;
  max-height: 280px; overflow-y: auto; padding: .5rem;
  border: 1px solid var(--border); border-radius: 8px;
}
.comms-recipient { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.comms-recipient-all { border-bottom: 1px solid var(--border); padding-bottom: .35rem; margin-bottom: .15rem; }
.comms-recipient input { flex: 0 0 auto; }
.comms-hint { font-size: .78rem; }
.comms-legacy-form { margin-top: 1rem; }
/* ── C360 data-offer components (VI 2026-07-18) ──────────────────────────────
   Verdict companions (horizon/caution/driver), FV uncertainty band on the
   pv-bar, and the experimental tag. Chips are informative, never CTAs. */
.chip-horizon, .chip-caution, .chip-driver, .chip-neutral, .chip-experimental {
    display: inline-block; font-size: 0.72rem; font-weight: 600;
    padding: 0.2rem 0.55rem; border-radius: 999px; white-space: nowrap;
    border: 1px solid var(--border); background: var(--surface2); color: var(--text-soft);
}
.chip-horizon-na { color: var(--text-muted); border-style: dashed; }
.chip-caution { border-color: var(--warning); color: var(--warning); background: var(--warning-soft); }
.chip-driver { font-weight: 500; }
.chip-experimental { border-style: dashed; color: var(--text-muted); letter-spacing: .04em; }
.chip-horizon abbr, .chip-caution abbr { text-decoration: none; }

/* FV band overlay on the price/value bar: offset+width via width_class only
   (CSP-safe, no inline styles). Sits under the fill/marker. */
.pv-bar { position: relative; }
.pv-band { position: absolute; inset: 0; display: flex; pointer-events: none; }
.pv-band-off { height: 100%; flex: 0 0 auto; }
.pv-band-fill {
    height: 100%; flex: 0 0 auto; border-radius: 4px;
    background: var(--accent-soft); border: 1px dashed var(--accent-strong); opacity: .7;
}

/* ── Country bridge: usage-contract states + citable build-up (Infla 2026-07-18) ── */
.country-bridge-card.is-restricted .country-bridge-metric strong {
    filter: saturate(.35); opacity: .75;
}
.country-bridge-card .badge-watch { margin-left: .5rem; vertical-align: middle; }
.country-bridge-buildup { margin-top: 1.1rem; }
.country-bridge-buildup .eyebrow { display: block; margin-bottom: .5rem; }
.country-bridge-buildup .country-fact-list { list-style: none; margin: 0; padding: 0; }
.country-bridge-buildup .country-fact-list li {
    display: grid; grid-template-columns: minmax(160px, 220px) auto 1fr;
    gap: .35rem .75rem; align-items: baseline; padding: .3rem 0;
    border-bottom: 1px dashed var(--border);
}
.country-bridge-buildup .country-fact-list li:last-child { border-bottom: 0; }
.country-bridge-buildup .country-fact-list small { color: var(--text-muted); }
.country-scenario-caption { font-size: .82rem; margin: .5rem 0 0; }
.country-bridge-signals {
    display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .8rem;
}
.country-bridge-signals small { flex-basis: 100%; }
@media (max-width: 720px) {
    .country-bridge-buildup .country-fact-list li { grid-template-columns: 1fr; gap: .1rem; }
}

/* ── Country stress card (18 calibrated scenarios; bloque 4, 2026-07-18) ── */
.country-stress-card .table-scroll { overflow-x: auto; }
.country-stress-table { width: 100%; }
.country-stress-table td.num, .country-stress-table th.num { text-align: right; white-space: nowrap; }
.country-stress-equity { min-width: 150px; }
.country-stress-equity .country-bar-track {
    display: inline-block; width: 70px; height: 6px; vertical-align: middle; margin-right: .4rem;
}
.country-stress-equity em { font-style: normal; font-variant-numeric: tabular-nums; }
.country-stress-more { margin-top: .6rem; }
.country-stress-more summary { cursor: pointer; color: var(--text-soft); font-weight: 600; }
.country-sector-bar-row .learn-badge.tone-good { border-color: var(--pass); }
.country-sector-bar-row .learn-badge.tone-warn { border-color: var(--warning); }
.country-sector-bar-row .learn-badge.tone-bad { border-color: var(--blocked); }

/* ── C360 redistribución de cajas (2026-07-18): la parrilla táctica pasa de
   grid rígida (columnas con huecos bajo las cards cortas) a COLUMNAS masonry:
   cada card fluye y las columnas quedan equilibradas. Las cards no se parten. */
.c360-tactical-grid { display: block; columns: 2; column-gap: 1rem; }
.c360-tactical-grid > .card {
    break-inside: avoid; -webkit-column-break-inside: avoid;
    margin: 0 0 1rem; display: inline-block; width: 100%;
}
@media (max-width: 900px) { .c360-tactical-grid { columns: 1; } }
/* Las parrillas de tesis/diagnóstico no estiran las cards a la más alta. */
.c360-thesis-grid, .c360-diagnostic-grid { align-items: start; }

/* Charts dimensionales C360 (bullet + perfil de factores + escala 0-100) */
.c360-bullet-chart, .c360-profile-chart, .c360-scale-chart { width: 100%; height: auto; display: block; }
.svg-tick { fill: var(--text-muted); }
.svg-dot { fill: var(--accent-strong); stroke: var(--surface); stroke-width: 2; }
/* Vertical mark for the company's position on a 0-100 reading scale. */
.svg-mark { fill: var(--accent-strong); stroke: var(--surface); stroke-width: 1.5; }
.svg-divider { fill: var(--text-muted); font-size: 11px; letter-spacing: .04em; }
.c360-scale-figure { margin: .3rem 0 .5rem; }
.c360-scale-figure figcaption { margin-top: .3rem; }
.c360-bullet-legend { margin: .35rem 0 .75rem; }
.c360-bullet-legend .legend-dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent-strong); vertical-align: middle;
}
.c360-bullet-legend .legend-tick {
    display: inline-block; width: 3px; height: 12px; border-radius: 1.5px;
    background: var(--text-muted); vertical-align: middle;
}

/* ══ Aprende con Atlas (learn) ═══════════════════════════════════════════════
   Microlearning pills: route cards on /learn, one-idea block cards, CSP-safe
   visuals (SVG attributes, no inline styles) and quiz states driven by learn.js. */

.learn-routes { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.learn-route-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.1rem 1.25rem;
}
.learn-route-card.is-coming { opacity: .65; }
.learn-route-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.learn-route-head h2 { margin: 0; font-size: 1.05rem; }
.learn-pill-list { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .4rem; }
.learn-pill-link {
    display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
    padding: .55rem .7rem; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface2);
    color: var(--text); text-decoration: none;
}
.learn-pill-link:hover { border-color: var(--accent); text-decoration: none; }
.learn-pill-state { min-width: 1.1rem; text-align: center; color: var(--muted); }
.learn-pill-state.is-done { color: var(--pass); }
.learn-pill-state.is-started { color: var(--accent-strong); }
.learn-pill-title { flex: 1 1 auto; font-weight: 600; }
.learn-pill-meta { display: flex; gap: .3rem; flex-wrap: wrap; }
.learn-badge {
    display: inline-block; font-size: .7rem; padding: .12rem .5rem;
    border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-muted); white-space: nowrap;
}
.learn-badge-soon { border-color: var(--warning); color: var(--warning); background: var(--warning-soft); }
.learn-overall { margin: -.25rem 0 1rem; }

/* ── Pill page ── */
.learn-pill { max-width: 860px; margin: 0 auto; display: grid; gap: 1rem; }
.learn-breadcrumb { display: flex; gap: .5rem; align-items: baseline; font-size: .85rem; }
.learn-hero { padding: .25rem 0 0; }
.learn-hero h1 { margin: .5rem 0 .25rem; }
.learn-hero-meta { display: flex; gap: .35rem; flex-wrap: wrap; }
.learn-subtitle { color: var(--text-soft); margin: 0 0 .75rem; }
.learn-hook {
    margin: .75rem 0; padding: .9rem 1.1rem; border-left: 4px solid var(--accent-strong);
    background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 1.02rem; font-style: italic;
}
.learn-objective { margin: 0; }
.learn-prereqs { margin: .5rem 0 0; font-size: .85rem; }

.learn-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.1rem 1.25rem;
}
.learn-kicker {
    display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
    color: var(--accent-strong); margin: 0 0 .5rem; font-weight: 700;
}
.learn-outcomes { margin: 0; padding-left: 1.2rem; }
.learn-block h2 { display: flex; align-items: center; gap: .55rem; font-size: 1.02rem; margin: 0 0 .6rem; }
.learn-block-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.6rem; height: 1.6rem; border-radius: 50%; flex: 0 0 auto;
    background: var(--accent-soft); color: var(--accent-strong); font-size: .85rem; font-weight: 700;
}
.learn-idea { font-weight: 600; color: var(--text); }
.learn-block p { line-height: 1.55; }
.learn-error {
    margin-top: .75rem; padding: .7rem .9rem; border-radius: var(--radius-sm);
    background: var(--warning-soft); border: 1px solid var(--warning);
}
.learn-error p { margin: .35rem 0 0; }
.learn-layer { margin-top: .6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem .8rem; }
.learn-layer summary { cursor: pointer; color: var(--text-soft); font-weight: 600; }
.learn-layer[open] summary { margin-bottom: .4rem; }

/* Visuals */
.learn-visual {
    margin: 0; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem 1.25rem;
}
.learn-visual-title { font-weight: 700; margin-bottom: .75rem; }
.learn-visual-caption { font-size: .82rem; margin: .6rem 0 0; }
.learn-scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; position: relative; padding-top: .75rem; }
.learn-scale::before {
    content: ""; position: absolute; top: .95rem; left: 8%; right: 8%;
    height: 3px; border-radius: 2px;
    background: linear-gradient(90deg, var(--info), var(--pass), var(--warning), var(--blocked));
}
.learn-scale-stop { display: grid; justify-items: center; text-align: center; gap: .2rem; position: relative; }
.learn-scale-dot {
    width: .55rem; height: .55rem; border-radius: 50%; background: var(--text-soft);
    border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); margin-bottom: .25rem;
}
.learn-scale-stop strong { font-size: .85rem; }
.learn-scale-stop small { color: var(--text-muted); font-size: .72rem; line-height: 1.3; }
.learn-bars { display: grid; gap: .55rem; }
.learn-bar-row { display: grid; grid-template-columns: minmax(120px, 200px) 1fr 3rem; gap: .6rem; align-items: center; }
.learn-bar-label { font-size: .85rem; color: var(--text-soft); }
.learn-bar-svg { width: 100%; height: 14px; display: block; }
.learn-bar-track { fill: var(--surface2); }
.learn-bar-fill { fill: var(--accent-strong); }
.learn-bar-value { font-variant-numeric: tabular-nums; font-size: .85rem; text-align: right; }
.learn-example-note { font-size: .78rem; margin: -.4rem 0 0; }

/* Rule + summary */
.learn-rule {
    border: 1px solid var(--accent-strong); background: var(--accent-soft);
    border-radius: var(--radius); padding: 1rem 1.25rem; text-align: center;
}
.learn-rule p { margin: 0; font-size: 1.08rem; font-weight: 700; }
.learn-summary ul { margin: 0; padding-left: 1.2rem; }

/* Quiz */
.learn-quiz { padding: .75rem 0; border-top: 1px dashed var(--border); }
.learn-quiz:first-of-type { border-top: 0; padding-top: 0; }
.learn-quiz fieldset { border: 0; margin: 0; padding: 0; }
.learn-quiz legend, .learn-quiz-q { font-weight: 600; margin-bottom: .5rem; }
.learn-options { display: flex; flex-wrap: wrap; gap: .45rem; margin: .5rem 0; }
.learn-option {
    border: 1px solid var(--border); background: var(--surface2); color: var(--text);
    border-radius: var(--radius-sm); padding: .5rem .85rem; cursor: pointer;
    font-size: .88rem; text-align: left;
}
.learn-option:hover { border-color: var(--accent); }
.learn-option.is-chosen { border-color: var(--accent-strong); background: var(--accent-soft); }
.learn-option.is-correct { border-color: var(--pass); background: var(--pass-soft); }
.learn-option.is-incorrect { border-color: var(--blocked); background: var(--blocked-soft); }
.learn-option:disabled { cursor: default; opacity: .9; }
.learn-quiz-feedback { font-weight: 600; margin: .35rem 0; }
.learn-explain {
    border-left: 3px solid var(--info); background: var(--info-soft);
    padding: .55rem .8rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-top: .4rem;
}
.learn-explain p { margin: 0; }
.learn-answer { margin-top: .45rem; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .45rem .8rem; }
.learn-answer summary { cursor: pointer; color: var(--text-soft); font-weight: 600; }
.learn-confidence { margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed var(--border); }

/* Double close + pager */
.learn-close { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; align-items: start; }
.learn-close-col p { margin: 0 0 .7rem; }
.learn-close .button-primary { display: inline-block; text-decoration: none; }
.learn-disclaimer { font-size: .78rem; text-align: center; }
.learn-pager { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0 1rem; }
.learn-pager a { font-size: .88rem; }

@media (max-width: 720px) {
    .learn-close { grid-template-columns: 1fr; }
    .learn-scale { grid-template-columns: repeat(2, 1fr); row-gap: 1rem; }
    .learn-scale::before { display: none; }
    .learn-bar-row { grid-template-columns: 1fr; gap: .2rem; }
    .learn-bar-value { text-align: left; }
}

/* ── Utilities ───────────────────────────────────────────────────────────────
   Small, composable helpers so templates never need inline style= (CSP-safe).
   Spacing scale mirrors the common inline margins we replaced. */
.u-mt-sm { margin-top: 0.6rem; }
.u-mt-md { margin-top: 0.8rem; }
.u-mt-lg { margin-top: 1rem; }
.u-mt-xl { margin-top: 1.5rem; }
.u-mt-2x { margin-top: 2rem; }
.u-text-center { text-align: center; }
.u-row-between { display: flex; justify-content: space-between; align-items: center; }
/* Data-driven swatch colour is passed via a CSS custom property (--swatch),
   set on the element, so no colour literal ever lands in an inline style. */
.u-swatch { background: var(--swatch, var(--border)); }
