/* ============================================================================
   Radar Internacional · JAGA TECH — "Overflow UI" glass + neón
   Negro real, azul royal JAGA como acento primario, un neón por sección, vidrio esmerilado
   (fondo translúcido + desenfoque + borde de 1 px), esquinas rectas, sin sombras.
   Móvil primero: táctiles ≥ 44 px, entradas a 16 px, barras fijas con zonas seguras.
   ========================================================================= */
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/space-grotesk-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/space-grotesk-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/space-grotesk-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/space-grotesk-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-500.woff2') format('woff2'); font-weight: 500 700; font-display: swap; }
@font-face { font-family: 'Aldrich'; src: url('/fonts/aldrich.woff2') format('woff2'); font-weight: 400; font-display: swap; }
/* Space Mono se usa si está instalada en el equipo; si no, JetBrains Mono (incluida en la app). */
@font-face { font-family: 'Space Mono'; src: local('Space Mono'), local('SpaceMono-Regular'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Space Mono'; src: local('Space Mono Bold'), local('SpaceMono-Bold'); font-weight: 700; font-display: swap; }

/* ---------------------------------------------------------------- tokens */
:root {
  --bg: #000000; --abismo: #000f1d;
  --glass: rgba(255, 255, 255, .045); --glass-2: rgba(255, 255, 255, .07); --glass-bar: rgba(4, 8, 16, .72);
  --solid: #0b0d12; --solid-2: #12151d;
  --line: rgba(255, 255, 255, .12); --line-2: rgba(255, 255, 255, .2);
  --ink: #f7f7f7; --mute: #a3aab4;
  --royal: #0629c7; --royal-claro: #4d6bff; --azul: #4da2ff;
  --acc: var(--azul); --acc-bg: var(--royal); --acc-ink: #ffffff; --acc-soft: rgba(77, 107, 255, .16); --sel: rgba(77, 107, 255, .1);
  /* Un color por sección: orienta antes que el texto. */
  --c-subv: #6de6f8; --c-lic: #ffd84d; --c-lic-2: #ff7a00; --c-inter: #ff6ada; --c-ideas: #beff4d; --c-docs: #8f80ff; --c-docs-borde: #5c4ade; --c-tab: #4da2ff;
  --ok: #4df766; --warn: #fffc4d; --bad: #ff5a5a; --nada: #8a929c;
  --ok-soft: rgba(77, 247, 102, .1); --warn-soft: rgba(255, 252, 77, .09); --bad-soft: rgba(255, 90, 90, .1);
  --halo-1: rgba(6, 41, 199, .34); --halo-2: rgba(109, 230, 248, .12); --halo-3: rgba(92, 74, 222, .2);
  --font: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif; --mono: 'Space Mono', 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
  --marca: 'Aldrich', 'Segoe UI', system-ui, sans-serif;
  --blur: blur(16px) saturate(140%);
  --r: 0px; --r-ctl: 2px; --side-w: 220px; --nav-h: 64px; --top-h: 56px; --bar-h: 64px;
  --sec: var(--royal-claro);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5f7; --abismo: #e9edf3;
  --glass: rgba(255, 255, 255, .62); --glass-2: rgba(255, 255, 255, .82); --glass-bar: rgba(250, 251, 253, .8);
  --solid: #ffffff; --solid-2: #f0f2f5;
  --line: rgba(11, 13, 18, .12); --line-2: rgba(11, 13, 18, .24);
  --ink: #0b0d12; --mute: #545c66;
  --acc: #0629c7; --acc-soft: rgba(6, 41, 199, .1); --sel: rgba(6, 41, 199, .07); --azul: #0b5fc0; --royal-claro: #2a46d6;
  /* Los neón no sirven como texto sobre claro: se oscurecen. */
  --c-subv: #0b7a8c; --c-lic: #8a6400; --c-lic-2: #b35400; --c-inter: #b0207f; --c-ideas: #4b6b00; --c-docs: #4638b8; --c-docs-borde: #4638b8; --c-tab: #0b5fc0;
  --ok: #12803a; --warn: #8a6400; --bad: #c62828; --nada: #6a7280;
  --ok-soft: rgba(18, 128, 58, .1); --warn-soft: rgba(138, 100, 0, .1); --bad-soft: rgba(198, 40, 40, .08);
  --halo-1: rgba(6, 41, 199, .12); --halo-2: rgba(13, 142, 163, .08); --halo-3: rgba(70, 56, 184, .08);
  color-scheme: light;
}
/* Acento por sección (contenedores y vistas). */
.t-subvencion, .t-beca, .t-premio, .t-aceleradora { --sec: var(--c-subv); }
.t-licitacion { --sec: var(--c-lic); }
.t-intercambio { --sec: var(--c-inter); }
.t-todas, .t-otro { --sec: var(--royal-claro); }
.t-docs, body[data-vista="documentos"], body[data-vista="documento"] { --sec: var(--c-docs); }
body[data-vista="ideas"], body[data-vista="idea"] { --sec: var(--c-ideas); }
body[data-vista="tablero"] { --sec: var(--c-tab); }

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
svg[aria-hidden="true"] { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.18em; }
html { font-size: 16px; }
html, body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
body { font: 15px/1.55 var(--font); }
body { min-height: 100dvh; overflow-x: hidden; }
html.sin-scroll, html.sin-scroll body { overflow: hidden; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--acc); }
h1, h2, h3 { font-family: var(--font); font-weight: 600; margin: 0 0 .5rem; line-height: 1.12; }
h1 { font-size: clamp(1.6rem, 4.6vw, 2.4rem); letter-spacing: -.04em; }
h2 { font-size: clamp(1.12rem, 2.6vw, 1.4rem); letter-spacing: -.03em; }
h3 { font-size: 1rem; letter-spacing: -.01em; }
p { margin: 0 0 .6rem; }
small, .muted { color: var(--mute); }
small { font-size: .82rem; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.label, .eyebrow { font: 700 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .18em; color: var(--mute); }
.acc { color: var(--acc); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--royal-claro); outline-offset: 2px; }
::selection { background: var(--royal); color: #fff; }
code { font-family: var(--mono); font-size: max(12px, .9em); }
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes latido { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sk { to { background-position: -200% 0; } }

/* Vidrio: fondo translúcido + desenfoque + borde fino. Sin soporte → superficie sólida. */
.glass, .card, .panel, .rows, .kpi, .col, .modal, .topbar, .nav, .actionbar, .barra-guardar, .sidebar, .editorial, .cmd, .auth .card {
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--line);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .card, .panel, .rows, .kpi, .col, .modal, .editorial, .cmd, .auth .card { background: var(--solid); }
  .topbar, .nav, .actionbar, .barra-guardar, .sidebar { background: var(--solid); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .card, .panel, .rows, .kpi, .col, .modal, .topbar, .nav, .actionbar, .barra-guardar, .sidebar, .editorial, .cmd, .auth .card { background: var(--solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .halos { display: none; }
}

/* Halos de fondo: 3 manchas suaves, fijas, detrás de todo (un solo elemento del tamaño de la ventana). */
.halos { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70vmax 70vmax at -6% -14%, var(--halo-1), transparent 62%), radial-gradient(60vmax 60vmax at 112% 38%, var(--halo-2), transparent 60%),
    radial-gradient(70vmax 70vmax at 30% 118%, var(--halo-3), transparent 62%); }
.halos i { display: none; }

.boot { display: grid; place-items: center; gap: 12px; min-height: 100dvh; color: var(--mute); font: 13px var(--mono); }

/* ---------------------------------------------------------------- armazón */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100dvh; }
.shell > * { min-width: 0; }
.sidebar { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; padding-top: env(safe-area-inset-top);
  height: calc(var(--top-h) + env(safe-area-inset-top)); background: var(--glass-bar); border-width: 0 0 1px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; min-height: 44px; }
.brand:hover { color: inherit; }
.brand .sq { width: 26px; height: 26px; background: var(--royal); flex: none; display: grid; place-items: center; }
.brand .sq img { width: 18px; height: 18px; filter: brightness(0) invert(1); }
.brand b { font: 400 14px var(--marca); text-transform: uppercase; letter-spacing: .12em; white-space: nowrap; }
.brand small { display: block; font: 400 12px var(--mono); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { padding: 16px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); width: 100%; max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.main > * { min-width: 0; animation: entrar .35s ease both; }
.main:has(.actionbar) { padding-bottom: calc(var(--nav-h) + var(--bar-h) + 36px + env(safe-area-inset-bottom)); }
.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); background: var(--glass-bar); border-width: 1px 0 0; }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--mute); text-decoration: none; font: 700 12px var(--mono); letter-spacing: .04em; position: relative; min-height: 44px; }
.nav a svg { width: 22px; height: 22px; }
.nav a.active { color: var(--ink); }
.nav a.active svg { color: var(--sec); }
.nav a.active::before { content: ''; position: absolute; top: -1px; left: 26%; right: 26%; height: 3px; background: var(--sec); }
.nav .dot, .sidebar .dot, .sheet .dot { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--royal); color: #fff; font: 700 12px/18px var(--mono); text-align: center; font-style: normal; }
.nav .dot { position: absolute; top: 6px; left: 54%; }
.only-desk, .solo-desk { display: none !important; }
@media (min-width: 900px) {
  .only-desk { display: inline-flex !important; }
  .solo-desk { display: flex !important; }
  .solo-movil { display: none !important; }
  .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .topbar, .nav { display: none; }
  .sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100dvh; padding: 22px 14px; border-width: 0 1px 0 0; background: var(--glass-bar); }
  .sidebar .brand b { font-size: 12.5px; letter-spacing: .08em; }
  .sidebar nav { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
  .sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 10px 10px; color: var(--mute); text-decoration: none; border-left: 2px solid transparent; }
  .sidebar nav a svg { width: 17px; height: 17px; }
  .sidebar nav a:hover { color: var(--ink); background: var(--glass-2); }
  .sidebar nav a.active { background: var(--sel); color: var(--ink); border-left-color: var(--royal-claro); }
  .sidebar nav [data-nav="subv"].active { border-left-color: var(--c-subv); } .sidebar nav [data-nav="lic"].active { border-left-color: var(--c-lic); }
  .sidebar nav [data-nav="inter"].active { border-left-color: var(--c-inter); } .sidebar nav [data-nav="ideas"].active { border-left-color: var(--c-ideas); }
  .sidebar nav [data-nav="documentos"].active { border-left-color: var(--c-docs); }
  .sidebar nav .dot { margin-left: auto; }
  .side-status { margin-top: auto; font: 400 12px/1.75 var(--mono); color: var(--mute); }
  .side-status .live { display: flex; align-items: center; gap: 8px; }
  .side-status .live i { width: 7px; height: 7px; background: var(--ok); animation: latido 2s infinite; }
  .side-acts { gap: 4px; }
  .main { padding: 24px 28px 48px; gap: 18px; }
  .main:has(.actionbar) { padding-bottom: 48px; }
}

/* ---------------------------------------------------------------- buscador y segmentos */
.cmdbar { display: flex; align-items: center; gap: 8px; }
.cmd { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px; font: 14px var(--mono); color: var(--mute); }
.cmd b { color: var(--sec); font-weight: 700; }
.cmd input, .cmd input[type=search] { flex: 1; min-width: 0; height: 44px; min-height: 0; border: 0; background: transparent !important; outline: none; color: var(--ink); font: 16px var(--font); padding: 0; }
.cmd input::placeholder { color: var(--mute); }
.cmd:focus-within { border-color: var(--royal-claro); }
.seg { display: flex; gap: 4px; overflow-x: auto; max-width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.seg::-webkit-scrollbar { display: none; }
.seg button, .seg a { flex: none; scroll-snap-align: start; white-space: nowrap; border: 1px solid var(--line); cursor: pointer; font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .12em;
  min-height: 44px; padding: 0 14px; border-radius: var(--r-ctl); background: var(--glass); color: var(--mute); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--ink); border-color: var(--line-2); }
.seg .on { color: var(--ink); border-color: var(--sec); background: color-mix(in srgb, var(--sec) 12%, transparent); box-shadow: inset 0 -2px 0 var(--sec); }
.seg .n { opacity: .75; letter-spacing: 0; font-weight: 400; }
.tipo-tabs button.t-subvencion { --sec: var(--c-subv); } .tipo-tabs button.t-licitacion { --sec: var(--c-lic); }
.tipo-tabs button.t-intercambio { --sec: var(--c-inter); } .tipo-tabs button.t-todas { --sec: var(--royal-claro); }
.tipo-tabs button::before { content: ''; width: 8px; height: 8px; background: var(--sec); flex: none; }
.resumen { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--mute); }

/* ---------------------------------------------------------------- componentes */
.card { border-radius: var(--r); padding: 16px; }
.card + .card, .stack > * + * { margin-top: 12px; }
.main > .card + .card { margin-top: 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 0; flex-wrap: wrap; }
.section-title h2, .section-title h1 { margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-ctl);
  border: 1px solid var(--line-2); background: transparent; color: var(--ink); font: 500 14px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--ink); background: var(--glass-2); color: var(--ink); }
.btn.primary { background: var(--royal); border-color: var(--royal); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--royal-claro); border-color: var(--royal-claro); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--mute); }
.btn.ghost:hover { color: var(--ink); background: var(--glass-2); }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 44px; padding: 0; }
.btn.sm.icon { width: 36px; }
.btn.wide { width: 100%; min-height: 52px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }

label.field, div.field { display: grid; gap: 6px; font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--mute); min-width: 0; }
label.field > span { display: block; }
label.field small, div.field small { text-transform: none; letter-spacing: 0; font: 400 13px var(--font); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: rgba(0, 0, 0, .35); color: var(--ink);
  font: 400 15px var(--font); text-transform: none; letter-spacing: 0; max-width: 100%; }
:root[data-theme="light"] :is(input, select, textarea) { background: #fff; }
select { appearance: auto; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--royal-claro); outline: 2px solid var(--acc-soft); outline-offset: 0; }
input[type=file] { font: 13px var(--mono); color: var(--mute); max-width: 100%; }
input[type=file]::file-selector-button { min-height: 44px; margin-right: 10px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--glass-2); color: var(--ink); font: 500 13px var(--font); cursor: pointer; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--royal); flex: none; }
select[multiple] { min-height: 132px; padding: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--r-ctl); font: 700 12px var(--mono); letter-spacing: .02em; background: transparent; border: 1px solid var(--line-2); color: var(--mute); white-space: nowrap; }
.chip.blue { border-color: color-mix(in srgb, var(--azul) 55%, transparent); color: var(--azul); background: var(--sel); }
.chip.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-soft); color: var(--ok); }
.chip.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); color: var(--warn); }
.chip.bad { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-soft); color: var(--bad); }
.chip button { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; font-size: 1rem; line-height: 1; }
button.chip { cursor: pointer; min-height: 36px; }
button.chip.on { background: var(--royal); border-color: var(--royal); color: #fff; }
label.chip { cursor: pointer; min-height: 40px; padding: 6px 12px; font: 500 13px var(--font); letter-spacing: 0; color: var(--ink); white-space: normal; }
label.chip.on { background: var(--acc-soft); border-color: var(--royal-claro); color: var(--ink); }
label.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
label.chip:focus-within { outline: 2px solid var(--royal-claro); outline-offset: 2px; }

/* KPIs y cifras */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { border-radius: var(--r); padding: 14px 14px 16px; text-align: left; cursor: pointer; color: inherit; text-decoration: none; min-width: 0; border-left: 3px solid var(--sec); display: block; }
.kpi:hover { background: var(--glass-2); color: inherit; }
.kpi .label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi b { display: block; font: 600 clamp(26px, 6vw, 36px)/1 var(--font); letter-spacing: -.05em; font-variant-numeric: tabular-nums; margin-top: 10px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi span.delta { display: block; font: 12px var(--mono); margin-top: 6px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Encaje: alto verde, medio ámbar, bajo gris (rango mínimo–máximo) */
.match { display: flex; align-items: center; gap: 8px; min-width: 0; }
.match .track { flex: 1; height: 4px; background: var(--line); min-width: 28px; position: relative; overflow: hidden; }
.match .track i { display: block; height: 4px; background: var(--ok); }
.match .track.rango i { position: absolute; left: 0; top: 0; }
.match b { font: 700 13px var(--mono); min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.match.alta b { color: var(--ok); }
.match.media .track i { background: var(--warn); } .match.media b { color: var(--warn); }
.match.baja .track i { background: var(--nada); } .match.baja b { color: var(--mute); }
.score { width: 48px; height: 48px; display: grid; place-items: center; font: 700 16px var(--mono); border: 1px solid var(--line-2); color: var(--mute); flex: none; }
.score.alta { color: #000; background: var(--ok); border-color: var(--ok); }
.score.media { color: var(--warn); border-color: var(--warn); }
.score.big { width: 64px; height: 64px; font-size: 22px; }

/* Tablero de inicio: filas, paneles y feed */
.dash-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 1000px) { .dash-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } .dash-row.main-row { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1240px) { .dash-row.main-row { grid-template-columns: minmax(0, 1fr) 300px; } }
.panel { border-radius: var(--r); padding: 16px; min-width: 0; display: flex; flex-direction: column; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--mute); }
.panel-head .mono { font-size: 12px; white-space: nowrap; letter-spacing: 0; text-transform: none; }
.panel-head a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 4px; color: var(--azul); }
.editorial .ed-indice { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.editorial .ed-indice a { padding: 4px 0; }
.bars { flex: 1 0 150px; min-height: 150px; display: flex; align-items: flex-end; gap: 6px; margin-top: 14px; }
.bars div { flex: 1; min-height: 2px; background: var(--line-2); cursor: pointer; transition: height .5s, background .2s; }
.bars div.on, .bars div:hover { background: var(--sec); }
.feed { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; font: 13px/1.45 var(--mono); max-height: 240px; overflow: hidden; }
.feed a, .feed div { display: flex; gap: 10px; align-items: center; text-decoration: none; min-width: 0; min-height: 44px; border-bottom: 1px solid var(--line); }
.feed .t { color: var(--mute); flex: none; white-space: nowrap; }
.feed .s { flex: none; white-space: nowrap; color: var(--sec); }
.feed .x { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-dot { color: var(--ok); font: 12px var(--mono); white-space: nowrap; }

/* Listas de oportunidades */
.rows { border-radius: var(--r); overflow: hidden; min-width: 0; }
.rows-head, .row-item { display: grid; grid-template-columns: 92px minmax(0, 1fr) 96px 64px 96px; gap: 12px; align-items: center; padding: 12px 16px; }
.rows-head { font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--mute); border-bottom: 1px solid var(--line); }
.row-item { border-bottom: 1px solid var(--line); border-left: 3px solid var(--sec); cursor: pointer; font-size: 14px; text-decoration: none; color: inherit; transition: background .15s; }
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: var(--glass-2); }
.row-item.unseen .obj::before { content: ''; display: inline-block; width: 7px; height: 7px; background: var(--sec); margin-right: 8px; vertical-align: 2px; }
.row-item .src { font: 12px/1.35 var(--mono); color: var(--mute); }
.row-item .o { min-width: 0; color: inherit; text-decoration: none; display: block; min-height: 46px; }
.row-item .obj { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .ent { font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .val, .row-item .cie { font: 13px var(--mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-item .cie.bad, .row-item .meta-m .bad { color: var(--bad); } .row-item .cie.warn, .row-item .meta-m .warn { color: var(--warn); }
.row-item .acts { grid-column: 2 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: -2px; }
.row-item .motivo { color: var(--mute); font-size: 13px; flex: 1; min-width: 160px; }
.row-item .acts-b { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.row-item .meta-m { display: none; }
.row-item .tipo-m { color: var(--sec); }
@media (max-width: 760px) {
  .rows-head { display: none; }
  .row-item { grid-template-columns: minmax(0, 1fr) 92px; grid-template-areas: "obj match" "meta meta" "acts acts"; gap: 8px 10px; padding: 14px 14px 12px; }
  .row-item > .src, .row-item > .val, .row-item > .cie { display: none; }
  .row-item > .o { grid-area: obj; }
  .row-item > .match { grid-area: match; align-self: start; padding-top: 4px; }
  .row-item .meta-m { grid-area: meta; display: flex; gap: 6px 12px; flex-wrap: wrap; font: 12px var(--mono); color: var(--mute); }
  .row-item .obj { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; line-height: 1.3; font-size: 15px; }
  .row-item .ent { white-space: normal; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; margin-top: 4px; }
  .row-item .acts { grid-area: acts; grid-column: auto; }
  .row-item .motivo { flex-basis: 100%; order: -1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .row-item .acts-b { flex-basis: 100%; margin-left: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: center; }
  .row-item .acts-b > .chip { justify-self: start; }
}
.aside-ai { gap: 10px; }
.aside-ai .tag { font: 12px var(--mono); color: var(--sec); text-transform: uppercase; letter-spacing: .14em; }
.aside-ai .ttl { font-size: 15px; font-weight: 500; line-height: 1.35; }
.aside-ai .txt { font-size: 13.5px; line-height: 1.55; color: var(--mute); }
.aside-ai .btns { margin-top: auto; display: flex; gap: 8px; padding-top: 6px; }
.aside-ai .btns .btn { flex: 1; }

/* Factores del puntaje */
.factor { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.factor:last-child { border-bottom: 0; }
.factor .num { font-size: 12px; }
.bar { grid-column: 1 / -1; height: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--sec); }

/* Pestañas */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); background: var(--glass-bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); z-index: 10; margin: 0 -16px; padding: 0 16px; }
@media (min-width: 900px) { .tabs { top: 0; margin: 0; padding: 0; } }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; min-height: 46px; padding: 0 14px; font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--mute); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--sec); }

/* Tablas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 700 12px var(--mono); color: var(--mute); text-transform: uppercase; letter-spacing: .12em; border-bottom-color: var(--line-2); }
td.num { font-size: 13px; text-align: right; white-space: nowrap; }
.scroll-hint { font: 12px var(--mono); color: var(--mute); letter-spacing: .06em; margin: 4px 0; }
/* Tablas que en el celular se apilan como tarjetas (ajustes, presupuesto, cronograma). */
@media (max-width: 760px) {
  .tabla-cards { overflow: visible; }
  .tabla-cards table, .tabla-cards tbody, .tabla-cards tr, .tabla-cards td { display: block; width: 100%; }
  .tabla-cards thead { display: none; }
  .tabla-cards tr { border: 1px solid var(--line); background: var(--glass); padding: 10px 12px; margin-bottom: 10px; }
  .tabla-cards td { border: 0; padding: 4px 0; }
  .tabla-cards td[data-l]::before { content: attr(data-l); display: block; font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--mute); margin-bottom: 2px; }
  .tabla-cards td.tc-titulo { font-weight: 600; font-size: 15px; }
  .tabla-cards td.tc-titulo::before { display: none; }
  .tabla-cards input { width: 100%; }
  .tabla-cards .tc-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
  .tabla-cards .tc-acts .btn { width: 100%; min-height: 44px; }
  .wide-m { width: 100%; }
}
.tc-acts { display: inline-flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

/* Kanban (escritorio) / lista por estado con pestañas (celular) */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 84%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
@media (min-width: 900px) { .kanban { grid-auto-columns: minmax(230px, 1fr); } }
.col { scroll-snap-align: start; border-radius: var(--r); padding: 10px; min-height: 160px; border-top: 3px solid var(--sec); }
.col h3 { display: flex; justify-content: space-between; align-items: center; font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--mute); margin: 2px 4px 10px; }
.kcard { background: var(--glass); border: 1px solid var(--line); padding: 12px; font-size: 14px; }
.kcard + .kcard { margin-top: 8px; }
.kcard > a { text-decoration: none; font-weight: 500; display: block; margin-bottom: 4px; line-height: 1.35; min-height: 44px; }
.kcard small { display: block; }
.kcard .row { margin-top: 8px; flex-wrap: nowrap; }
.kcard select { flex: 1; min-width: 0; }
@media (max-width: 899px) {
  .kanban { display: block; overflow: visible; }
  .kanban .col { display: none; min-height: 0; border-top-width: 0; border: 0; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0; }
  .kanban .col.on { display: block; }
  .kanban .col h3 { display: none; }
  .estado-tabs { margin-bottom: 4px; }
}

/* Listas, estados, avisos */
.list-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.status { display: inline-block; width: 8px; height: 8px; margin-top: 7px; flex: none; background: var(--nada); }
.status.vigente, .status.sin_vencimiento { background: var(--ok); }
.status.por_vencer { background: var(--warn); }
.status.vencido { background: var(--bad); }
.empty { text-align: center; padding: 30px 16px; color: var(--mute); }
.empty svg { width: 38px; height: 38px; opacity: .5; }
.notice { padding: 12px 14px; background: var(--sel); border: 1px solid color-mix(in srgb, var(--royal-claro) 40%, transparent); border-left: 3px solid var(--royal-claro); font-size: 14px; }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); border-left-color: var(--warn); color: var(--ink); }
.notice.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); border-left-color: var(--bad); color: var(--ink); }
.notice.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); border-left-color: var(--ok); color: var(--ink); }
ul.clean { list-style: none; padding: 0; margin: 0; }
ul.clean li { padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
ul.clean li:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); gap: 8px 12px; font-size: 14px; margin: 0; }
.kv dt { font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--mute); padding-top: 3px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .kv dd { margin-bottom: 10px; } }
details > summary { cursor: pointer; }
details.card summary { font-weight: 600; font-size: 15px; letter-spacing: -.01em; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 44px; gap: 10px; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after { content: '+'; font: 700 18px var(--mono); color: var(--sec); }
details.card[open] summary::after { content: '–'; }
details.card[open] summary { margin-bottom: 12px; }
details:not(.card) > summary { min-height: 44px; display: flex; align-items: center; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
.skeleton { height: 76px; background: linear-gradient(90deg, var(--glass) 0%, var(--glass-2) 50%, var(--glass) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border: 1px solid var(--line); }
.skeleton + .skeleton { margin-top: 10px; }
.row-item .skeleton { border: 0; }
.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.tools label.field { flex: 1 1 170px; }
.tools .check { align-self: center; }

/* Login */
.auth { min-height: 100dvh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: radial-gradient(60vmax 60vmax at 0% 0%, var(--halo-1), transparent 60%), radial-gradient(50vmax 50vmax at 100% 100%, var(--halo-3), transparent 60%), var(--bg); }
.auth .card { width: 100%; max-width: 400px; padding: 28px 22px; margin: auto 0; border-top: 3px solid var(--royal); }
.auth .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth .logo b { font: 400 17px var(--marca); text-transform: uppercase; letter-spacing: .14em; display: block; }
.auth .logo small { font: 12px var(--mono); }
.auth form { display: grid; gap: 12px; }

/* Avisos flotantes, diálogos y hojas inferiores */
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 460px); padding: 12px 16px; background: var(--ink); color: var(--bg); font: 13px var(--mono); transition: .2s; z-index: 100; }
body:has(.actionbar) #toast { bottom: calc(var(--nav-h) + var(--bar-h) + 22px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { #toast, body:has(.actionbar) #toast { bottom: 24px; } }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--bad); color: #fff; }
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 90; display: grid; place-items: end center; }
@media (min-width: 700px) { .modal-bg { place-items: center; } }
.modal { width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto; background: var(--glass-bar); border-radius: 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-top: 3px solid var(--sec); }
.modal h2 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal.hoja { display: flex; flex-direction: column; padding: 0; max-height: 86dvh; overflow: hidden; }
.modal.hoja > h2, .hoja-pie { flex: none; }
.modal.hoja > h2 { padding: 14px 8px 8px 16px; margin: 0; }
.hoja-cuerpo { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 16px 16px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.hoja-pie { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.hoja-pie .btn { min-height: 48px; }
.hoja label.field { margin-bottom: 4px; }
@media (min-width: 700px) { .hoja-pie { padding-bottom: 12px; } }
.sheet a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 16px; }
.sheet a svg { width: 20px; height: 20px; color: var(--sec); }
.sheet a:last-child { border-bottom: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Barra de acciones fija (oportunidad y documento) y barra de guardar (formularios) */
.actionbar { position: fixed; z-index: 29; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px;
  padding: 8px max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left)); background: var(--glass-bar); border-width: 1px 0; }
.actionbar .btn { flex-direction: column; gap: 3px; min-height: 48px; padding: 4px 2px; font: 700 12px var(--mono); letter-spacing: .02em; white-space: nowrap; overflow: hidden; }
.actionbar .btn span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.barra-guardar { position: sticky; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom)); z-index: 15; padding: 10px; margin-top: 12px; background: var(--glass-bar); }
.barra-guardar .btn { flex: 1 1 auto; min-height: 48px; }
@media (min-width: 900px) { .barra-guardar { bottom: 12px; } .barra-guardar .btn { flex: 0 0 auto; } }

/* ---------------------------------------------------------------- Editorial (lecturas de oportunidades y documentos) */
.editorial {
  --e-ink: var(--ink); --e-mute: var(--mute); --e-line: var(--line); --e-soft: var(--glass-2); --e-side: var(--glass); --e-acc: var(--sec); --e-bg: var(--solid);
  border-radius: var(--r); font: 15px/1.6 var(--font); padding: 20px 16px; display: flex; flex-direction: column; gap: 22px; min-width: 0; border-top: 3px solid var(--sec);
}
@media (min-width: 760px) { .editorial { padding: 32px 36px; } }
.editorial .ed-kicker { font: 700 12px/1.6 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--e-mute); display: flex; align-items: flex-start; gap: 10px; }
.editorial .ed-kicker i { margin-top: 6px; }
.editorial .ed-kicker i { width: 8px; height: 8px; background: var(--e-acc); flex: none; }
.editorial .ed-h1 { font: 600 clamp(26px, 6.4vw, 46px)/1.06 var(--font); letter-spacing: -.045em; margin: 8px 0 0; text-wrap: pretty; max-width: 820px; overflow-wrap: anywhere; }
.editorial .ed-h1 em { font-style: normal; color: var(--e-acc); }
.editorial .ed-lead { font-size: 16px; color: var(--e-mute); max-width: 780px; margin: 0; }
.editorial .ed-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--e-line); }
@media (min-width: 760px) { .editorial .ed-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.editorial .ed-kpi { padding: 14px 12px 16px 0; min-width: 0; }
.editorial .ed-kpi span { display: block; font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--e-mute); }
.editorial .ed-kpi b { display: block; font: 600 clamp(20px, 5vw, 28px)/1.1 var(--font); letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin-top: 6px; overflow-wrap: anywhere; }
.editorial .ed-kpi small { display: block; font-size: 13px; color: var(--e-mute); }
.editorial .ed-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 1000px) { .editorial .ed-grid { grid-template-columns: minmax(0, 1fr) 320px; } }
.editorial .ed-sec { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.editorial .ed-sec h2 { font: 600 24px/1.15 var(--font); margin: 0; letter-spacing: -.04em; }
.editorial .ed-sec h3, .editorial h3 { font: 700 12px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--e-mute); margin: 0; }
.editorial .ed-sec h4 { margin: 6px 0 0; font-size: 15px; }
.editorial .ed-list { list-style: none; margin: 0; padding: 0; }
.editorial .ed-list li { padding: 12px 0; border-bottom: 1px solid var(--e-line); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: baseline; }
.editorial .ed-list li > :only-child { grid-column: 1 / -1; }
.editorial .ed-list.req li { grid-template-columns: minmax(0, 1fr) auto; }
.editorial .ed-list small, .editorial .ed-mute { color: var(--e-mute); font-size: 13.5px; }
.editorial .ed-mark { font: 700 12px var(--mono); padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--e-soft); border: 1px solid var(--line); }
.editorial .ed-mark.si { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.editorial .ed-mark.no { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.editorial .ed-mark.verificar { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.editorial .ed-aside { background: var(--e-side); border: 1px solid var(--e-line); padding: 20px; display: flex; flex-direction: column; gap: 16px; align-self: start; min-width: 0; }
@media (min-width: 1000px) { .editorial .ed-aside { position: sticky; top: 20px; } }
.editorial .ed-serif { font: 700 12px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--e-mute); }
.editorial .ed-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.editorial .ed-pills span { font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); background: var(--e-soft); }
.editorial .ed-ring { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.editorial .ed-ring > div { width: 46px; height: 46px; border-radius: 50%; background: var(--e-bg); display: grid; place-items: center; font: 700 14px var(--mono); }
.editorial .ed-btn { min-height: 44px; border: 1px solid var(--royal); border-radius: var(--r-ctl); background: var(--royal); color: #fff; font: 500 14px var(--font); cursor: pointer; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.editorial .ed-btn:hover { background: var(--royal-claro); border-color: var(--royal-claro); color: #fff; }
.editorial .ed-btn.line { background: transparent; color: var(--e-ink); border: 1px solid var(--line-2); }
.editorial .ed-btn.line:hover { border-color: var(--e-ink); background: var(--e-soft); }
.editorial .ed-btn[disabled] { opacity: .45; cursor: not-allowed; }
.editorial table th { color: var(--e-mute); }
.editorial table td, .editorial table th { border-color: var(--e-line); }
.editorial a:not(.ed-btn):not(.btn) { color: var(--azul); }
.editorial .spinner { color: var(--e-acc); }
.editorial details > summary { color: var(--e-mute); font-size: 14px; }
.editorial .ed-det { border-top: 1px solid var(--e-line); padding-top: 4px; }
.editorial .ed-det > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 48px; font: 700 12px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--e-ink); }
.editorial .ed-det > summary::-webkit-details-marker { display: none; }
.editorial .ed-det > summary::after { content: '+'; font: 700 18px var(--mono); color: var(--e-acc); letter-spacing: 0; }
.editorial .ed-det[open] > summary::after { content: '–'; }
.editorial .ed-det[open] > summary { margin-bottom: 8px; }
.editorial .factor { border-bottom-color: var(--e-line); }
.editorial .bar { background: var(--e-line); }
.editorial .bar i { background: var(--e-acc); }
.editorial select, .editorial textarea { border-color: var(--line-2); }
.editorial .conteo.pasa { color: var(--bad); }
.editorial .sec-acts { justify-content: flex-end; }
.editorial .sec-acts .ed-btn { min-height: 36px; padding: 0 10px; font-size: 13px; }
.doc-indice { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top) + 6px); z-index: 12; padding: 6px 8px 6px 12px; background: var(--solid); border: 1px solid var(--line-2);
  display: flex !important; align-items: center; gap: 10px; }
.doc-indice > span { flex: none; }
.doc-indice select { flex: 1; min-width: 0; }
@media (min-width: 900px) { .doc-indice { display: none !important; } }

/* ---------------------------------------------------------------- celular: táctiles ≥ 44 px, entradas a 16 px (sin zoom en iOS) */
@media (max-width: 899px) {
  input, select, textarea { font-size: 16px !important; }
  .btn, .btn.sm { min-height: 44px; }
  .btn.sm.icon, .btn.icon { width: 44px; min-width: 44px; }
  .editorial .ed-btn, .editorial .sec-acts .ed-btn { min-height: 44px; }
  button.chip, label.chip { min-height: 44px; }
  .cmdbar .btn { flex: none; }
  .section-title .row { width: 100%; }
  .section-title .row > .btn { flex: 1 1 auto; }
  .main > a.btn.ghost.sm:first-child { min-height: 44px; margin-left: -8px; }
  .kcard small a, .kv dd a, .ed-mute a, small a { display: inline-flex; align-items: center; min-height: 44px; }
  .editorial .sec-acts { width: 100%; justify-content: flex-start; }
  .editorial .ed-aside { padding: 16px; }
}
@media (max-width: 420px) {
  .main { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .editorial { padding: 18px 14px; }
  .actionbar .btn { font-size: 12px; }
  .brand small { max-width: 52vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
