/* ==========================================================================
   myspHUBS · FIWARE y los iHubs de España — mismo sistema visual que smartservice.es / mySDM / myTTN / myNGSI-LD
   Base (tokens, cabecera, portada, tarjetas, panel lateral) copiada de myNGSI-LD/assets/ngsi.css; al final, lo propio.
   ========================================================================== */
:root {
  --primary: #1b8d84;
  --accent: #87b32b;
  --ink: #092441;
  --bg: #051526;
  --bg2: #071d33;
  --panel: rgba(13, 38, 64, .55);
  --panel-solid: #0b2742;
  --line: rgba(219, 231, 239, .10);
  --line2: rgba(219, 231, 239, .18);
  --text: #e6eef5;
  --muted: #8ea6bb;
  --dim: #5d7891;
  --raw: #f2b84b;
  --ok: #3ccf91;
  --bad: #ff6b6b;
  --demo: #b48cf0;
  --grad: linear-gradient(100deg, #fff 10%, color-mix(in srgb, var(--primary) 70%, #fff) 55%, var(--accent));
  --btn-grad: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, var(--accent)));
  --code-bg: rgba(3, 13, 25, .65);
  --code-text: #c9d8e6;
  --nav-bg: rgba(5, 21, 38, .72);
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  --font: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 14px;
  --max: 1240px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f3f6f9;
  --bg2: #e9eff5;
  --panel: rgba(255, 255, 255, .78);
  --panel-solid: #ffffff;
  --line: rgba(9, 36, 65, .09);
  --line2: rgba(9, 36, 65, .16);
  --text: #092441;
  --muted: #4c6680;
  --dim: #7890a6;
  --raw: #b7791f;
  --ok: #138a5e;
  --bad: #c53030;
  --demo: #7a4fd0;
  --primary: #167a72;
  --accent: #5f8a12;
  --grad: linear-gradient(100deg, var(--ink) 10%, var(--primary) 55%, var(--accent));
  --code-bg: #071d33;
  --nav-bg: rgba(243, 246, 249, .8);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
::selection { background: color-mix(in srgb, var(--primary) 55%, transparent); }
a { color: inherit; }
h1, h2, h3, h4 { letter-spacing: -.025em; line-height: 1.08; margin: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--text); }
select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
code { font-family: var(--mono); font-size: .86em; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); padding: .1em .4em; border-radius: 6px; word-break: break-word; }
strong { font-weight: 650; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.ico { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.blueprint {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 78% -10%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 70%),
    radial-gradient(700px 500px at -10% 40%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--bg);
  mask-image: linear-gradient(#000, rgba(0, 0, 0, .55) 60%, rgba(0, 0, 0, .35));
}

/* ---------- Navegación ---------- */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); background: var(--nav-bg); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; gap: 22px; height: 64px; max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; flex: none; }
.brand img { height: 32px; width: auto; display: block; flex: none; }
.brand small { display: block; font: 500 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nav-links { flex: 1; display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; font-size: 14px; justify-content: center; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: var(--muted); text-decoration: none; white-space: nowrap; padding: 6px 0; position: relative; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px; background: var(--accent); }
.nav-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line2); background: rgba(255, 255, 255, .03); color: var(--text); transition: border-color .2s, transform .15s;
}
.icon-btn:hover { border-color: color-mix(in srgb, var(--primary) 70%, transparent); transform: translateY(-1px); }
.icon-btn .ico { color: var(--accent); }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.live { display: inline-flex; align-items: center; gap: 7px; color: var(--dim); font: 12px var(--mono); white-space: nowrap; }
.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.live.connected { color: var(--ok); }
.live.connected::before, .live.demo::before { box-shadow: 0 0 10px currentColor; animation: blink 1.4s infinite; }
.live.connecting { color: var(--raw); }
.live.connecting::before { animation: blink .9s infinite; }
.live.demo { color: var(--demo); }
.live.error { color: var(--bad); }
@keyframes blink { 50% { opacity: .25; } }
.menu-btn { display: none; }
.mnav { border-top: 1px solid var(--line); background: var(--panel-solid); padding: 8px 16px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: calc(100vh - 64px); overflow: auto; }
.mnav a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px; }
.mnav a:hover, .mnav a.active { color: var(--text); border-color: color-mix(in srgb, var(--primary) 60%, transparent); }
.mnav a span { font: 600 11px var(--mono); color: var(--accent); }

/* ---------- Selector de idioma (igual que mySDM) ---------- */
html.i18n-wait body { visibility: hidden; }
.langsel { position: relative; }
.langbtn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 11px; border-radius: 10px; border: 1px solid var(--line2);
  background: rgba(255, 255, 255, .03); color: var(--text); font: 600 13px var(--mono); cursor: pointer; }
.langbtn:hover { border-color: color-mix(in srgb, var(--primary) 70%, transparent); }
.langbtn svg { width: 15px; height: 15px; color: var(--accent); }
.langmenu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px; padding: 6px; border-radius: 12px; border: 1px solid var(--line2);
  background: var(--panel-solid); box-shadow: 0 20px 50px rgba(0, 0, 0, .45); display: none; z-index: 60; }
.langmenu.on { display: block; }
.langmenu button { display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none;
  color: var(--muted); font: 500 14px var(--font); cursor: pointer; text-align: left; }
.langmenu button b { font: 600 12px var(--mono); color: var(--dim); width: 22px; }
.langmenu button:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
[data-theme="light"] .langmenu button:hover { background: rgba(9, 36, 65, .05); }
.langmenu button.on { color: var(--text); background: color-mix(in srgb, var(--primary) 22%, transparent); }
.langmenu button.on b { color: var(--accent); }
@media (max-width: 680px) { .langbtn { padding: 0 8px; } }
@media (max-width: 420px) { .langbtn { height: 34px; } }

/* ---------- Botones, etiquetas ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 11px 18px; border-radius: 10px; font: 650 14.5px var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid var(--line2); background: rgba(255, 255, 255, .03); color: var(--text); transition: transform .15s, background .2s, border-color .2s, opacity .2s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: color-mix(in srgb, var(--primary) 70%, transparent); }
.btn.primary { background: var(--btn-grad); border-color: transparent; color: #fff; box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn.demo { color: var(--demo); border-color: color-mix(in srgb, var(--demo) 45%, transparent); background: color-mix(in srgb, var(--demo) 8%, transparent); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn .ico { width: 16px; height: 16px; }
.btn:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.kicker { font: 600 12px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); display: inline-flex; align-items: center; gap: 10px; }
.kicker::before { content: ''; width: 26px; height: 1px; background: currentColor; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em;
  padding: 3px 8px; border-radius: 6px; white-space: nowrap; color: var(--muted); border: 1px solid var(--line2); background: var(--bg);
}
.pill-accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.pill-warn { color: var(--raw); border-color: color-mix(in srgb, var(--raw) 40%, transparent); }
.lead { color: var(--muted); font-size: 18px; max-width: 760px; }
.lead strong, .desc strong { color: var(--text); font-weight: 600; }
.desc { color: var(--muted); font-size: 15px; }
.link { color: var(--accent); text-decoration: none; font: 500 12.5px var(--mono); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Tarjetas ---------- */
.card { position: relative; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); padding: 22px 24px; transition: border-color .25s, background .25s; min-width: 0; }
.card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--primary) 13%, transparent), transparent 45%);
}
.card:hover::before { opacity: 1; }
.card:hover { border-color: color-mix(in srgb, var(--primary) 55%, transparent); }
.card > * { position: relative; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h3 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-head h3 .ico { color: var(--accent); width: 20px; height: 20px; }
.card-text { color: var(--muted); font-size: 14.5px; }
.cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.svc { position: relative; display: flex; flex-direction: column; background: var(--bg); padding: 30px 28px 28px; transition: background .25s; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); min-width: 0; }
.svc:hover { background: var(--bg2); }
.svc::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--primary) 12%, transparent), transparent 50%); }
.svc:hover::before { opacity: 1; }
.svc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 11.5px var(--mono); color: var(--dim); margin-bottom: 22px; }
.svc > .ico { width: 30px; height: 30px; color: var(--accent); margin-bottom: 16px; stroke-width: 1.5; }
.svc h3 { font-size: 19px; font-weight: 700; }
.svc p { margin-top: 10px; color: var(--muted); font-size: 15px; }

/* ---------- Portada ---------- */
.hero { padding: 70px 0 40px; }
.hero-head { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; }
.hero-head > * { min-width: 0; }
.hero h1 { margin-top: 18px; font-size: clamp(42px, 6vw, 80px); font-weight: 850; letter-spacing: -.045em; }
.hero h1 .line { display: block; }
.hero .lead { margin-top: 20px; }
.ctas { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.typed { margin-top: 18px; font: 14px var(--mono); color: var(--accent); min-height: 1.7em; overflow-wrap: anywhere; }
.typed .prompt { color: var(--dim); }
.caret { display: inline-block; width: .55em; height: 1.1em; margin-left: 2px; vertical-align: -.2em; background: var(--accent); animation: blink 1s steps(1) infinite; }
.console {
  border: 1px solid var(--line2); border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, rgba(10, 32, 56, .75), rgba(5, 21, 38, .85));
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .05);
}
[data-theme="light"] .console { background: linear-gradient(180deg, #0a2038, #051526); --text: #e6eef5; --muted: #8ea6bb; --dim: #5d7891; --line: rgba(219, 231, 239, .10); --line2: rgba(219, 231, 239, .18); --accent: #87b32b; color: var(--text); }
.console .bar { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); }
.console .dots { display: flex; gap: 6px; flex: none; }
.console .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line2); }
.console .bar .ttl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.console .bar .ttl b { color: var(--text); font-weight: 600; }
.console-tabs { display: flex; border-bottom: 1px solid var(--line); }
.console-tabs button { flex: 1; padding: 8px 6px; border: 0; background: none; cursor: pointer; font: 11px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; border-bottom: 2px solid transparent; }
.console-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.code-pre { margin: 0; padding: 14px 16px; font: 12px/1.65 var(--mono); color: var(--code-text); overflow: auto; background: var(--code-bg); white-space: pre; tab-size: 2; }
.hero .code-pre { height: 330px; }
.console .legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font: 11px var(--mono); color: var(--dim); }
.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 44px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--panel); }
.stats-row > div { padding: 18px 20px; border-right: 1px solid var(--line); min-width: 0; }
.stats-row > div:last-child { border-right: 0; }
.stats-row b { display: block; font-size: clamp(24px, 2.8vw, 36px); font-weight: 850; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats-row span { display: block; font: 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stats-row small { display: block; font: 11.5px var(--mono); color: var(--dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value.bump { animation: bump .4s ease; }
@keyframes bump { 40% { transform: scale(1.08); color: var(--raw); } }

/* ---------- Secciones ---------- */
.section { padding: 96px 0 10px; position: relative; }
.section-head { margin-bottom: 34px; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 20px; }
.section-head h2 { font-size: clamp(30px, 4vw, 50px); font-weight: 800; margin: 14px 0 12px; }
.section-num { font: 600 64px var(--mono); color: transparent; -webkit-text-stroke: 1px var(--line2); line-height: 1; }
.sub-h { font-size: 22px; font-weight: 750; margin: 56px 0 8px; display: flex; gap: 12px; align-items: center; }
.sub-h .ico { color: var(--accent); }
.sub-title { font: 600 11.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: 18px 0 10px; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
.empty-state { padding: 18px; text-align: center; border-radius: 12px; border: 1px dashed var(--line2); color: var(--dim); font-size: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: 600 11.5px var(--mono); color: #fff; background: var(--primary); white-space: nowrap; }
.chip.ghost { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.chip.warm { color: var(--raw); background: color-mix(in srgb, var(--raw) 10%, transparent); border: 1px solid color-mix(in srgb, var(--raw) 40%, transparent); }
.chip.dev { color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }


/* ---------- Pie ---------- */
footer { margin-top: 110px; border-top: 1px solid var(--line); padding: 36px 0 50px; color: var(--muted); font-size: 13.5px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
footer a { color: var(--text); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer img { height: 34px; width: auto; display: block; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; font: 12.5px var(--mono); }



/* ---------- Comunes (de myNGSI-LD) ---------- */
.lead em, .sub-p em { color: var(--text); font-style: normal; }
.sub-p { color: var(--muted); max-width: 860px; margin-bottom: 18px; }
.field label { display: block; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--dim); margin-bottom: 6px; }
.field input, .field select, textarea, .req-line input, .req-line select, .metric-select { width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line2); background: var(--bg); outline: none; font-size: 14px; color: var(--text); }
.field input:focus, .field select:focus, textarea:focus, .req-line input:focus { border-color: color-mix(in srgb, var(--primary) 70%, transparent); }
.field-hint { font-size: 12.5px; margin-top: 6px; color: var(--dim); }
textarea { font: 12.5px/1.6 var(--mono); resize: vertical; }
.metric-select { width: auto; padding: 7px 30px 7px 10px; font-size: 13px; }
.feed-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.table-wrap { overflow-x: auto; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 14px; }
.tabs button { padding: 8px 14px; border: 0; border-radius: 9px; background: none; cursor: pointer; font: 600 13px var(--font); color: var(--muted); white-space: nowrap; }
.tabs button.on { background: var(--btn-grad); color: #fff; }

/* Tabla comparativa */
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th { text-align: left; font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); padding: 10px 12px; border-bottom: 1px solid var(--line2); }
.cmp td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.cmp td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }
.cmp td:last-child { color: var(--text); }
.cmp tr:last-child td { border-bottom: 0; }

/* JSON coloreado */
.j-k { color: #7fd6cd; } .j-s { color: #c9e486; } .j-n { color: #f2b84b; } .j-b { color: #8fb8ff; } .j-z { color: #5d7891; }
.j-t { color: #3ccf91; font-weight: 700; } .j-tr { color: #8fb8ff; font-weight: 700; } .j-tg { color: #f2b84b; font-weight: 700; } .j-tl { color: #e07be0; font-weight: 700; }
.code-pre .c { color: #5d7891; }

/* Referencias */
.refs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ref { padding: 16px; text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.ref b { font-size: 15px; }
.ref span { font-size: 13px; color: var(--muted); }

/* Panel lateral: laboratorio */
body.lock { overflow: hidden; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 120; padding: 10px 16px; border-radius: 999px; font: 13px var(--mono); background: var(--panel-solid); border: 1px solid var(--accent); box-shadow: 0 20px 50px rgba(0, 0, 0, .45); animation: toastIn .3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ==========================================================================
   Propio de myspHUBS
   ========================================================================== */
.lead em, .sub-p em { color: var(--text); font-style: normal; }
.sub-p { color: var(--muted); max-width: 860px; margin-bottom: 18px; }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); }

/* Aviso «página no oficial» */
.notice { display: flex; gap: 12px; align-items: flex-start; margin-top: 26px; padding: 12px 16px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--raw) 50%, transparent); background: color-mix(in srgb, var(--raw) 6%, transparent); color: var(--muted); font-size: 13.5px; }
.notice .ico { flex: none; color: var(--raw); width: 18px; height: 18px; margin-top: 2px; }
.notice b { color: var(--text); }

/* Cronología */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--panel); }
.timeline li { padding: 20px 18px; border-right: 1px solid var(--line); min-width: 0; position: relative; }
.timeline li:last-child { border-right: 0; }
.timeline li::before { content: ''; position: absolute; left: 18px; top: 0; width: 34px; height: 3px; background: var(--btn-grad); border-radius: 0 0 3px 3px; }
.timeline b { display: block; font: 800 26px var(--font); letter-spacing: -.03em; }
.timeline span { display: block; margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.timeline li.here b { color: var(--accent); }

/* Fundación */
.found { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 6px; border-top: 1px solid var(--line); }
.facts > div { padding: 14px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.facts > div:nth-child(odd) { padding-right: 16px; }
.facts dt { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.facts dd { margin: 4px 0 0; font-size: 15.5px; font-weight: 650; }
.quote { margin: 18px 0 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--accent); color: var(--muted); font-size: 15px; font-style: italic; }
.orgs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; }
.org { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); font-weight: 650; font-size: 14px; }
.org i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.org.f i { background: var(--raw); }

/* Ecosistema por capas */
.eco { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; }
.layers { display: flex; flex-direction: column; gap: 8px; }
.layer { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); color: var(--text); cursor: pointer; transition: border-color .2s, background .2s, transform .15s; }
.layer:hover { border-color: color-mix(in srgb, var(--primary) 60%, transparent); transform: translateX(3px); }
.layer.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.layer .ico { width: 22px; height: 22px; color: var(--accent); }
.layer b { display: block; font-size: 15px; }
.layer small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.layer .seen { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line2); display: grid; place-items: center; color: transparent; }
.layer .seen .ico { width: 12px; height: 12px; color: transparent; }
.layer.visited .seen { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.layer.visited .seen .ico { color: var(--bg); }
.layer.core { border-style: solid; box-shadow: inset 3px 0 0 var(--accent); }
.layer-detail { position: sticky; top: 90px; }
.layer-detail h3 { font-size: 20px; font-weight: 750; display: flex; gap: 10px; align-items: center; }
.layer-detail h3 .ico { color: var(--accent); }
.layer-detail p { color: var(--muted); margin-top: 10px; font-size: 15px; }
.comp { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.comp a, .comp span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); font: 600 12px var(--mono); text-decoration: none; }
.comp a:hover { border-color: var(--accent); color: var(--accent); }
.layer-detail .also { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }

/* Cifras */
.figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.fig b { display: block; font-size: clamp(34px, 4vw, 52px); font-weight: 850; letter-spacing: -.04em; line-height: 1.05; }
.fig span { display: block; margin-top: 6px; font-weight: 650; }
.fig small { display: block; margin-top: 8px; font: 11.5px var(--mono); color: var(--dim); }
.src-note { margin-top: 12px; font: 12px var(--mono); color: var(--dim); }
.src-note a { color: var(--accent); }

/* Perfiles de iHub */
.prof-grid { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.prof-grid .svc { padding: 24px 20px; }
.prof-grid .svc h3 { font-size: 17px; }
.prof-grid .svc p { font-size: 14px; }
.motto { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 0 0 22px; }
.motto b { font-size: clamp(24px, 3vw, 34px); font-weight: 850; letter-spacing: -.03em; }

/* Mapa */
.map-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 18px; align-items: start; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { padding: 9px 12px; border-radius: 9px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); font-size: 13.5px; outline: none; }
.filters input { min-width: 200px; flex: 1; }
.filters select:focus, .filters input:focus { border-color: color-mix(in srgb, var(--primary) 70%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chips .lbl { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-right: 4px; align-self: center; }
.fchip { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line2); background: none; color: var(--muted); font: 600 12px var(--font); cursor: pointer; transition: all .15s; }
.fchip:hover { color: var(--text); border-color: color-mix(in srgb, var(--primary) 60%, transparent); }
.fchip.on { color: #fff; background: var(--btn-grad); border-color: transparent; }
.map-card { padding: 10px; }
.map-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 6px 8px; font: 12px var(--mono); color: var(--dim); }
.map-tools .btn.on { border-color: var(--accent); color: var(--accent); }
#mapSvg { display: block; width: 100%; height: auto; max-height: 76vh; touch-action: manipulation; }
#mapSvg .rg { fill: color-mix(in srgb, var(--primary) 10%, var(--bg)); stroke: color-mix(in srgb, var(--primary) 55%, transparent); stroke-width: .8; stroke-linejoin: round; cursor: pointer; transition: fill .2s; }
#mapSvg .rg:hover { fill: color-mix(in srgb, var(--primary) 22%, var(--bg)); }
#mapSvg .rg.has { fill: color-mix(in srgb, var(--primary) 18%, var(--bg)); }
#mapSvg .rg.sel { fill: color-mix(in srgb, var(--accent) 26%, var(--bg)); stroke: var(--accent); stroke-width: 1.2; }
#mapSvg .rg.mute { opacity: .45; }
#mapSvg .inset { fill: none; stroke: var(--line2); stroke-dasharray: 4 4; }
#mapSvg .inset-t { font: 11px var(--mono); fill: var(--dim); }
#mapSvg .pin { cursor: pointer; }
#mapSvg .pin circle.halo { fill: var(--accent); opacity: .18; transform-box: fill-box; transform-origin: center; animation: halo 2.6s ease-out infinite; }
#mapSvg .pin circle.dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; transition: r .15s; }
#mapSvg .pin.home circle.dot { fill: var(--raw); }
#mapSvg .pin.home circle.halo { fill: var(--raw); }
#mapSvg .pin.off { opacity: .18; pointer-events: none; }
#mapSvg .pin.off circle.halo { animation: none; opacity: 0; }
#mapSvg .pin:hover circle.dot, #mapSvg .pin.hl circle.dot { r: 8; }
#mapSvg .pin text { font: 700 11px var(--font); fill: var(--text); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; pointer-events: none; }
#mapSvg .near-l { stroke: var(--raw); stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; }
#mapSvg .near-p { fill: var(--raw); }
@keyframes halo { 0% { transform: scale(.6); opacity: .35; } 100% { transform: scale(2.2); opacity: 0; } }
.map-side { display: flex; flex-direction: column; gap: 8px; }
.map-side .count { font: 12px var(--mono); color: var(--dim); padding: 2px 2px 4px; }
.hub-row { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); cursor: pointer; text-align: left; color: var(--text); width: 100%; }
.hub-row:hover, .hub-row.hl { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.hub-row b { display: block; font-size: 14px; }
.hub-row small { display: block; font-size: 12.5px; color: var(--muted); }

/* Logotipo (o monograma si no hay) */
.logo { width: 64px; height: 40px; border-radius: 9px; display: grid; place-items: center; overflow: hidden; flex: none; background: #fff; border: 1px solid var(--line2); }
.logo { position: relative; }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4px 5px; }
.logo.mono-l { background: var(--btn-grad); color: #fff; font: 800 13px var(--font); letter-spacing: -.02em; border-color: transparent; }
.logo.lg { width: 120px; height: 72px; border-radius: 14px; }
.logo.lg img { padding: 7px 9px; }
.logo.lg.mono-l { font-size: 22px; }

/* Directorio */
.dir-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dir-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hub-card { display: flex; flex-direction: column; gap: 12px; cursor: pointer; }
.hub-card .top { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.hub-card h3 { font-size: 16.5px; font-weight: 750; line-height: 1.25; }
.hub-card .where { font: 12px var(--mono); color: var(--muted); margin-top: 3px; }
.hub-card p { color: var(--muted); font-size: 14px; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-flex; padding: 2px 8px; border-radius: 6px; font: 600 11px var(--mono); color: var(--muted); border: 1px solid var(--line2); background: var(--bg); }
.tag.p { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.tag.w { color: var(--raw); border-color: color-mix(in srgb, var(--raw) 45%, transparent); }
.hub-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font: 12px var(--mono); color: var(--dim); border-top: 1px solid var(--line); padding-top: 10px; }

/* Ficha (diálogo) */
dialog.sheet { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border-radius: 18px; border: 1px solid var(--line2); background: var(--panel-solid); color: var(--text); box-shadow: 0 40px 120px rgba(0, 0, 0, .55); }
dialog.sheet::backdrop { background: rgba(2, 10, 20, .6); backdrop-filter: blur(3px); }
.sheet-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.sheet-head .where { font: 12.5px var(--mono); color: var(--muted); margin-top: 4px; }
.sheet-body { padding: 18px 22px 22px; overflow-y: auto; }
.sheet-body > p { color: var(--muted); font-size: 15px; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; margin: 16px 0; border-top: 1px solid var(--line); }
.sheet-grid > div { padding: 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.sheet-grid dt { font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: 4px; }
.sheet-grid dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.sheet-grid dd a { color: var(--accent); }
.sheet-list { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.sheet-list a { color: var(--accent); }
.sheet-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.sheet-body .code-pre { max-height: 360px; border-radius: 10px; margin-top: 12px; }

/* Proyección internacional */
.intl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.intl .card h3 { font-size: 17px; font-weight: 750; display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.intl .card h3 .ico { color: var(--accent); }
.intl .card p { color: var(--muted); font-size: 14.5px; }
.hl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hl-list li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 12px; background: var(--panel); font-size: 14px; color: var(--muted); }
.hl-list li b { color: var(--text); }
.hl-list li .tag { margin-top: 1px; }

/* Córdoba */
.home { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
.home .card p { color: var(--muted); margin-top: 10px; }
.svc-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.svc-link { display: flex; flex-direction: column; gap: 4px; padding: 16px; text-decoration: none; }
.svc-link b { font: 700 15px var(--mono); }
.svc-link span { color: var(--muted); font-size: 13px; }
.svc-link.here { border-color: var(--accent); }

/* Panel lateral: explora */

/* Agenda: eventos, actividades y noticias */
:root { --ev: #5b9cf0; --act: #b48cf0; --news: #f2b84b; }
[data-theme="light"] { --ev: #2f5fd0; --act: #7a4fd0; --news: #b7791f; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.ag-date { flex: none; width: 58px; padding: 7px 0 6px; border-radius: 12px; text-align: center; background: var(--bg); border: 1px solid var(--line2); line-height: 1.05; }
.ag-date b { display: block; font-size: 24px; font-weight: 850; letter-spacing: -.03em; }
.ag-date span { display: block; font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-top: 2px; }
.ag-date small { display: block; font: 10.5px var(--mono); color: var(--dim); margin-top: 2px; }
.ag-date.news span { color: var(--news); }
.ag-date.big { width: 86px; padding: 12px 0 10px; border-radius: 16px; }
.ag-date.big b { font-size: 36px; }
.ag-date.big span { font-size: 12.5px; }
.ag-badges { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.ag-type { display: inline-flex; padding: 3px 9px; border-radius: 6px; font: 700 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.ag-type.t-event { --c: var(--ev); } .ag-type.t-activity { --c: var(--act); } .ag-type.t-news { --c: var(--news); }
.ag-b { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font: 600 11px var(--mono); color: var(--muted); border: 1px solid var(--line2); background: var(--bg); }
.ag-b .ico { width: 12px; height: 12px; color: var(--accent); }
.ag-b.priv .ico { color: var(--raw); }
.ag-b.warn { color: var(--raw); border-color: color-mix(in srgb, var(--raw) 45%, transparent); }
.ag-org { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ag-org > .ico { width: 14px; height: 14px; color: var(--dim); flex: none; }
.ag-org .logo { width: 48px; height: 30px; border-radius: 7px; }
.ag-org .link { background: none; border: 0; padding: 0; cursor: pointer; }
.sheet-grid dd .ag-org .logo { width: 48px; height: 30px; }
@media (max-width: 680px) { .hag-star span, .hag-smp { display: none; } }

/* Consola de la portada con la agenda */
[data-theme="light"] .console { --ev: #5b9cf0; --act: #b48cf0; --news: #f2b84b; --raw: #f2b84b; --primary: #1b8d84; }
.hero-body { height: 330px; background: var(--code-bg); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.hero-body::-webkit-scrollbar { width: 8px; }
.hero-body::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; }
.hero-body.no-anim .hag-row { animation: none; }
.hag-row.past { opacity: .78; }
.hero .hero-body .code-pre { height: auto; min-height: 100%; overflow: visible; }
.console .bar .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 2s infinite; box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
.console.is-json .bar .live-dot { display: none; }
.console .legend { justify-content: space-between; }
.console .legend a { color: var(--accent); text-decoration: none; font-weight: 600; }
.console .legend a:hover { text-decoration: underline; }
.hag { display: flex; flex-direction: column; }
.hag-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; align-items: center; width: 100%; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); text-align: left; cursor: pointer; font: inherit; position: relative; transition: background .15s; animation: hagIn .45s ease both; }
.hag-row:nth-child(2) { animation-delay: .06s; } .hag-row:nth-child(3) { animation-delay: .12s; } .hag-row:nth-child(4) { animation-delay: .18s; }
@keyframes hagIn { from { opacity: 0; transform: translateX(10px); } }
.hag-row:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.hag-row::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c, var(--accent)); opacity: .85; }
.hag-row.t-event { --c: var(--ev); } .hag-row.t-activity { --c: var(--act); } .hag-row.t-news { --c: var(--news); }
.hag-row.feat { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
.hag-d { display: grid; place-items: center; height: 52px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(255, 255, 255, .03); line-height: 1; }
.hag-d b { font: 800 21px var(--font); letter-spacing: -.03em; }
.hag-d i { font: 700 10px var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: .1em; color: var(--c); margin-top: -8px; }
.hag-m { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hag-l1 { display: flex; align-items: center; gap: 8px; font: 600 10.5px var(--mono); min-width: 0; }
.hag-l1 em { font-style: normal; text-transform: uppercase; letter-spacing: .1em; color: var(--c); }
.hag-star { color: var(--accent); white-space: nowrap; }
.hag-smp { color: var(--raw); border: 1px solid color-mix(in srgb, var(--raw) 45%, transparent); border-radius: 4px; padding: 0 5px; }
.hag-rel { margin-left: auto; color: var(--muted); white-space: nowrap; font-weight: 500; }
.hag-row.feat .hag-rel { color: var(--accent); }
.hag-t { font-size: 14.5px; font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hag-row.cancelled .hag-t { text-decoration: line-through; color: var(--muted); }
.hag-l3 { font: 11.5px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hag-empty { padding: 30px 18px; color: var(--muted); font: 13px var(--mono); text-align: center; }

.ag-prog { list-style: none; margin: 4px 0 0; padding: 0; border-left: 2px solid var(--line2); }
.ag-prog li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 9px 0 9px 14px; position: relative; }
.ag-prog li::before { content: ''; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line2); }
.ag-prog-t { font: 600 12.5px var(--mono); color: var(--accent); padding-top: 1px; }
.ag-prog b { font-size: 14px; font-weight: 600; }
.ag-prog small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.ag-prog li.us { background: color-mix(in srgb, var(--accent) 9%, transparent); border-radius: 0 10px 10px 0; }
.ag-prog li.us::before { background: var(--accent); border-color: var(--accent); }
.ag-us { display: inline-flex; margin-left: 8px; padding: 1px 7px; border-radius: 5px; font: 700 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--bg); background: var(--accent); vertical-align: 2px; }
@media (max-width: 680px) { .ag-prog li { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Responsive ---------- */
.nav-inner { max-width: 1440px; }
.nav-links { gap: 16px; font-size: 13.5px; }
@media (max-width: 1339px) {
  .nav-links { display: none; }
  .menu-btn { display: grid; }
  .nav-inner { justify-content: space-between; }
}
@media (max-width: 1100px) {
  .hero-head, .found, .eco, .map-wrap, .home { grid-template-columns: 1fr; }
  .layer-detail { position: static; }
  .timeline { grid-template-columns: repeat(3, 1fr); }
  .timeline li:nth-child(3) { border-right: 0; }
  .timeline li:nth-child(n+4) { border-top: 1px solid var(--line); }
  .prof-grid { grid-template-columns: repeat(3, 1fr); }
  .dir-grid, .intl { grid-template-columns: 1fr 1fr; }
  .refs { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1020px) {
  .svc-grid { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .stats-row > div:nth-child(3) { border-right: 0; }
  .stats-row > div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .figs { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .wrap, .nav-inner { padding: 0 16px; }
  .brand small { display: none; }
  .hero { padding-top: 40px; }
  .section { padding-top: 70px; }
  .section-num { display: none; }
  .section-head { grid-template-columns: 1fr; }
  .svc-grid, .refs, .dir-grid, .intl, .prof-grid, .svc-links, .figs { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr 1fr; }
  .timeline li { border-right: 1px solid var(--line) !important; border-top: 1px solid var(--line); }
  .timeline li:nth-child(-n+2) { border-top: 0; }
  .timeline li:nth-child(2n) { border-right: 0 !important; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stats-row > div { border-right: 1px solid var(--line) !important; border-top: 1px solid var(--line); }
  .stats-row > div:nth-child(-n+2) { border-top: 0; }
  .stats-row > div:nth-child(2n) { border-right: 0 !important; }
  .stats-row > div:last-child { grid-column: 1 / -1; }
  .facts, .sheet-grid { grid-template-columns: 1fr; }
  .facts > div:nth-child(odd) { padding-right: 0; }
  .sheet-head { grid-template-columns: auto 1fr; }
  .sheet-head .icon-btn { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; }
  .filters select, .filters input { flex: 1 1 100%; min-width: 0; width: 100%; }
  #mapSvg .pin circle.dot, #mapSvg .pin circle.halo { transform: scale(1.8); transform-box: fill-box; transform-origin: center; }
  #mapSvg .pin text { font-size: 18px; }
  .mnav { grid-template-columns: 1fr; }
  footer { margin-top: 70px; }
  input, select, textarea { font-size: 16px !important; }
}
@media (hover: none) and (pointer: coarse) {
  .card:hover { border-color: var(--line2); }
  .btn:hover, .icon-btn:hover, .layer:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
.hero-head > *, .map-wrap > *, .eco > *, .found > * { min-width: 0; }

/* Vista previa desde genera.html (?preview=1) */
.preview-badge { position: fixed; left: 12px; bottom: 12px; z-index: 200; padding: 5px 10px; border-radius: 8px; font: 700 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #051526; background: var(--raw); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); pointer-events: none; }
.preview-hl { outline: 2px solid var(--raw); outline-offset: -2px; }
body.embed > header, body.embed > main, body.embed > footer, body.embed > .blueprint { display: none; }
.embed-wrap { max-width: 560px; margin: 28px auto; padding: 0 16px; }
.embed-wrap.wide { max-width: 820px; }
.embed-wrap .hub-card { cursor: default; }
