/* Consola Antifraude · identidad visual finsus (misma paleta y componentes que CMS-Mexico) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --bg: #F1F2FA; --surface: #FFFFFF; --surface-2: #F6F7FB;
    --ink: #24205A; --ink-soft: #565378; --muted: #8B89A6; --line: #E4E6F2;
    --accent: #E15750; --accent-deep: #991B1B; --indigo: #4C48A8;
    --grad-i: linear-gradient(180deg, #E15750 0%, #C24A45 55%, #6E2F3F 100%);
    --ok: #2E9E6B; --ok-bg: #E6F5EE; --warn: #B07A10; --warn-bg: #FBF1DF; --bad: #C6423C; --bad-bg: #FBE9E8; --info-bg: #EBEDFB;
    /* escala ordinal de riesgo (un tono, claro→oscuro; validada) */
    --r-low: #EE9089; --r-medium: #E15750; --r-high: #B23434; --r-critical: #6E1F2A;
    --r: 18px; --r-sm: 12px; --shadow: 0 10px 30px rgba(36, 32, 90, .07);
    --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
    --top-h: 56px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; max-width: 100%; overflow: hidden; }
body { font-family: 'Poppins', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono, code { font-family: var(--mono); }
code { background: var(--surface-2); border-radius: 6px; padding: 1px 6px; font-size: 12px; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; cursor: pointer; }
a:hover { text-decoration-color: var(--accent); }
h1, h2, h3, h4 { margin: 0; color: var(--ink); letter-spacing: -.2px; }

/* ── cabecera ─────────────────────────────────────────────────── */
header.top { background: var(--surface); border-bottom: 1px solid var(--line); min-height: var(--top-h); height: var(--top-h); padding: 0 32px; position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 18px; flex-wrap: nowrap; flex-shrink: 0; }
.wordmark { flex-shrink: 0; font-weight: 600; font-size: 26px; letter-spacing: -.5px; color: var(--ink); display: flex; align-items: baseline; gap: 2px; line-height: 1; text-decoration: none; }
.wordmark .i { background: var(--grad-i); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wordmark-tag { font-size: 10px; font-weight: 600; color: var(--accent); letter-spacing: 2px; border: 1px solid #F2C9C7; background: var(--bad-bg);
    border-radius: 999px; padding: 2px 9px; margin-left: 8px; align-self: center; white-space: nowrap; }
.top .title { min-width: 0; flex: 1 1 auto; }
.top .title h1 { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .title p { color: var(--muted); font-size: 12px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .status { margin-left: auto; display: flex; gap: 12px; align-items: center; flex-wrap: nowrap; flex-shrink: 0; }
.pill { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 6px 14px; font-size: 11px; font-weight: 600; letter-spacing: .4px;
    background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.pill.bad { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(46, 158, 107, .15); }
.pill.bad .dot { box-shadow: 0 0 0 4px rgba(198, 66, 60, .15); }
.dot.live { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.clock { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── estructura ───────────────────────────────────────────────── */
.layout { display: grid; grid-template-columns: 262px minmax(0, 1fr); height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); overflow: hidden; flex: 1; }
nav.side { background: var(--surface); border-right: 1px solid var(--line); padding: 14px 14px 18px; height: 100%; max-height: 100%; display: flex; flex-direction: column; overflow-y: auto; box-sizing: border-box; }
nav.side::-webkit-scrollbar { width: 5px; }
nav.side::-webkit-scrollbar-track { background: transparent; }
nav.side::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
nav.side::-webkit-scrollbar-thumb:hover { background: #CFD1E3; }
.side-nav-body { display: flex; flex-direction: column; gap: 2px; }
.side .cat { display: none !important; }
.nav-btn { display: flex; align-items: center; gap: 11px; padding: 8.5px 10px; border-radius: var(--r-sm); color: var(--ink-soft); font-weight: 500; font-size: 13px;
    background: transparent; border: none; width: 100%; text-align: left; cursor: pointer; transition: .15s; text-decoration: none; flex-shrink: 0; }
.nav-btn:hover { background: var(--surface-2); color: var(--ink); }
.nav-btn.active { background: var(--info-bg); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav-btn svg { width: 17px; height: 17px; flex: 0 0 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav-btn .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 600; border-radius: 999px; padding: 1px 8px; }

/* footer enriquecido al fondo del menú lateral */
.side .foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.side .foot-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side .foot-brand b { font-size: 11.5px; color: var(--ink); font-weight: 600; }
.side .foot-badge { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; font-size: 10px; font-weight: 600; color: var(--accent); }
.side .foot-meta { display: flex; flex-direction: column; gap: 5px; }
.side .foot-meta-item { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--ink-soft); line-height: 1.3; }
.side .foot-meta-item svg { width: 13px; height: 13px; stroke: var(--muted); fill: none; stroke-width: 1.8; flex-shrink: 0; }
.side .foot-copy { font-size: 9.5px; color: var(--muted); line-height: 1.3; padding-top: 2px; }
main { height: 100%; overflow-y: auto; padding: 24px 32px 56px; min-width: 0; box-sizing: border-box; }
main::-webkit-scrollbar { width: 7px; }
main::-webkit-scrollbar-track { background: transparent; }
main::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
main::-webkit-scrollbar-thumb:hover { background: #CFD1E3; }

/* ── encabezado de página y barra de filtros ─────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { font-size: 22px; font-weight: 600; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: none; background: transparent; border-radius: 999px; padding: 6px 13px; font-size: 12px; font-weight: 500; color: var(--ink-soft); cursor: pointer; }
.seg button.on { background: var(--ink); color: #fff; font-weight: 600; }
.field-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

/* ── controles ───────────────────────────────────────────────── */
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=time], input[type=number], input[type=date], input[type=search], select, textarea {
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px; font-size: 13px; color: var(--ink); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: #fff; border-color: var(--accent); }
.toolbar input, .toolbar select { padding: 7px 12px; border-radius: 999px; background: var(--surface); }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-soft); font-weight: 500; }
textarea { font-family: var(--mono); font-size: 12px; resize: vertical; width: 100%; }
.btn { border-radius: 999px; padding: 9px 18px; font-weight: 600; font-size: 13px; border: 1px solid transparent; cursor: pointer; transition: .15s; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--ink); color: #fff; } .btn-primary:hover { background: #1A1745; }
.btn-accent { background: var(--accent); color: #fff; } .btn-accent:hover { background: var(--accent-deep); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); } .btn-ghost:hover { border-color: var(--ink); }
.btn-danger { background: #fff; color: var(--accent-deep); border-color: #F2C9C7; } .btn-danger:hover { background: var(--bad-bg); }
.btn-ok { background: #fff; color: var(--ok); border-color: #BFE3D1; } .btn-ok:hover { background: var(--ok-bg); }
.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }

/* ── tarjetas y rejillas ─────────────────────────────────────── */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 16px; }
.card-h h3 { font-size: 15px; font-weight: 600; }
.card-h .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mt { margin-top: 18px; }
@media (max-width: 1280px) { .g-2, .g-3, .g-21, .g-12 { grid-template-columns: minmax(0, 1fr); } }

/* ── indicadores ─────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .l { font-size: 11px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); }
.kpi .v { font-size: 26px; font-weight: 600; letter-spacing: -.6px; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.15; word-break: break-word; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi.hero { background: var(--ink); color: #fff; }
.kpi.hero .l, .kpi.hero .s { color: #BDBBE0; }
.kpi.hero::after { content: ""; position: absolute; right: -56px; bottom: -64px; width: 150px; height: 150px; border-radius: 50%; background: var(--grad-i); opacity: .28; }
.kpi.hero > * { position: relative; z-index: 1; }
.delta { font-weight: 600; font-size: 11.5px; border-radius: 999px; padding: 1px 8px; }
.delta.up-bad, .delta.down-bad { background: var(--bad-bg); color: var(--bad); }
.delta.up-good, .delta.down-good { background: var(--ok-bg); color: var(--ok); }
.delta.flat { background: var(--surface-2); color: var(--muted); }
.kpi.hero .delta.flat { background: rgba(255,255,255,.12); color: #DCDAF5; }

/* ── tablas ──────────────────────────────────────────────────── */
.table-wrap { border: 1px solid var(--line); border-radius: var(--r-sm); overflow-x: auto; background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th { color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase; text-align: left; padding: 10px 12px;
    background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr.click { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
.factors { color: var(--ink-soft); font-size: 12px; max-width: 420px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { text-align: center; padding: 34px 12px; color: var(--muted); font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 4px 0; font-size: 12px; color: var(--muted); }
.pager strong { color: var(--ink); }
.pager .nav { display: flex; gap: 4px; }
.pager button { min-width: 30px; height: 30px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer; font-size: 12px; }
.pager button.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }
.pager button:disabled { opacity: .4; cursor: default; }

/* ── etiquetas ───────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-LOW { background: var(--ok-bg); color: var(--ok); }
.b-MEDIUM { background: var(--warn-bg); color: var(--warn); }
.b-HIGH { background: var(--bad-bg); color: var(--bad); }
.b-CRITICAL { background: #6E1F2A; color: #fff; }
.b-APPROVED { background: var(--ok-bg); color: var(--ok); }
.b-REVIEW { background: var(--warn-bg); color: var(--warn); }
.b-DECLINED { background: var(--bad-bg); color: var(--accent-deep); }
.b-NUEVA { background: var(--bad-bg); color: var(--bad); }
.b-EN_REVISION { background: var(--warn-bg); color: var(--warn); }
.b-CONFIRMADA { background: #6E1F2A; color: #fff; }
.b-FALSO_POSITIVO { background: var(--info-bg); color: var(--indigo); }
.b-info { background: var(--info-bg); color: var(--ink); }
.score { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; }
.score i { display: inline-block; width: 46px; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; position: relative; }
.score i b { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }

/* ── gráficas ────────────────────────────────────────────────── */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text, .chart text.lbl { fill: var(--muted); font-size: 11px; font-family: 'Poppins', system-ui, sans-serif; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .cross { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; opacity: .35; pointer-events: none; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 11px; font-size: 12px;
    box-shadow: 0 12px 30px rgba(36,32,90,.25); white-space: nowrap; z-index: 5; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .1s; }
.tip.on { opacity: 1; }
.tip .t { color: #BDBBE0; font-size: 11px; margin-bottom: 3px; }
.tip .row { display: flex; align-items: center; gap: 8px; }
.tip .sw { width: 9px; height: 9px; border-radius: 3px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(70px, 40%) minmax(48px, 1fr) auto; gap: 12px; align-items: center; font-size: 12.5px; }
.hbar .name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { display: block; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hbar .fill { display: block; height: 100%; border-radius: 999px; background: var(--indigo); }
.hbar .val { font-variant-numeric: tabular-nums; color: var(--ink-soft); text-align: right; white-space: nowrap; }
.donut-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.donut-wrap svg { width: 168px; height: 168px; flex: 0 0 168px; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 170px; }
.donut-legend .it { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center; font-size: 12.5px; }
.donut-legend i { width: 12px; height: 12px; border-radius: 4px; }
.donut-legend .pct { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.donut-legend .n { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }

/* ── evaluación ──────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-sec { font-size: 10.5px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); grid-column: 1 / -1; margin-top: 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.result-score { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.gauge { width: 150px; height: 150px; flex: 0 0 150px; }
.verdict { font-size: 22px; font-weight: 600; }
.verdict small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.factor-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.factor-list li { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; }
.factor-list li::before { content: "!"; flex: 0 0 20px; height: 20px; border-radius: 50%; background: var(--bad-bg); color: var(--bad); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.split-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.scenario-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* ── monitor en vivo ─────────────────────────────────────────── */
.feed { display: flex; flex-direction: column; gap: 10px; }
.feed > .pager, .norm-feed > .pager { margin-top: 4px; }
.feed-item { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px 12px 0; align-items: center; }
.feed-item .bar { align-self: stretch; border-radius: 0 6px 6px 0; }
.feed-item.new { animation: flash 1.4s ease-out; }
@keyframes flash { from { background: var(--bad-bg); } to { background: var(--surface-2); } }
.feed-item .meta { font-size: 12px; color: var(--muted); }

/* ── panel lateral de detalle ───────────────────────────────── */
.drawer-bg { position: fixed; inset: 0; background: rgba(36, 32, 90, .35); backdrop-filter: blur(3px); z-index: 40; opacity: 0; pointer-events: none; transition: .2s; }
.drawer-bg.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(620px, 100vw); background: var(--surface); z-index: 41; box-shadow: -20px 0 60px rgba(36,32,90,.18);
    transform: translateX(100%); transition: transform .22s ease; display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.drawer-h { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer-b { padding: 20px 24px; overflow-y: auto; flex: 1; }
.drawer-f { padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.x { border: 1px solid var(--line); background: var(--surface); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 16px; color: var(--ink-soft); flex: 0 0 32px; }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { word-break: break-word; }
.section-t { font-size: 10.5px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }

/* ── avisos ──────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff; border-radius: var(--r-sm); padding: 12px 16px; font-size: 13px;
    box-shadow: 0 16px 40px rgba(36,32,90,.25); z-index: 60; transform: translateY(20px); opacity: 0; transition: .2s; max-width: 380px; }
.toast.on { transform: none; opacity: 1; }
.toast.err { background: var(--accent-deep); } .toast.ok { background: var(--ok); }
.note { background: var(--info-bg); border-radius: var(--r-sm); padding: 12px 14px; font-size: 12.5px; color: var(--ink-soft); }
.note.warn { background: var(--warn-bg); color: #6B4A06; }
.muted { color: var(--muted); }
.loading { color: var(--muted); padding: 40px; text-align: center; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), #ECEEF7, var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r); min-height: 120px; }
@keyframes sk { to { background-position: -200% 0; } }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; } ::-webkit-scrollbar-track { background: transparent; }

/* ── reporte (pantalla e impresión) ─────────────────────────── */
.report { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 48px 56px; max-width: 1040px; margin: 0 auto; color: var(--ink); }
.report .rh { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 3px solid var(--ink); padding-bottom: 18px; }
.report .rh .wordmark { font-size: 34px; }
.report .rh .meta { text-align: right; font-size: 12px; color: var(--ink-soft); }
.report .rh .meta strong { display: block; font-size: 15px; color: var(--ink); }
.report h1.rt { font-size: 26px; font-weight: 600; margin: 26px 0 4px; }
.report .rsub { color: var(--muted); font-size: 13px; }
.report h2 { font-size: 15px; font-weight: 600; margin: 30px 0 12px; display: flex; align-items: center; gap: 10px; }
.report h2 .n { width: 26px; height: 26px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; }
.report p { font-size: 13px; color: var(--ink-soft); margin: 0 0 10px; }
.report .rk { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.report .rk > div { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.report .rk .l { font-size: 10px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.report .rk .v { font-size: 20px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.report .rk .s { font-size: 11px; color: var(--muted); }
.report table th { font-size: 9.5px; padding: 8px 10px; }
.report table td { font-size: 12px; padding: 8px 10px; }
.report .findings { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-soft); }
.report .findings li { margin-bottom: 6px; }
.report .findings.mt { margin-top: 16px; }
.report .rf { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 14px; font-size: 10.5px; color: var(--muted); }
.report .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 46px; }
.report .sign div { border-top: 1px solid var(--ink); padding-top: 8px; font-size: 11.5px; color: var(--ink-soft); text-align: center; }
.report .conf { display: inline-block; font-size: 10px; letter-spacing: 1.5px; font-weight: 600; color: var(--accent-deep); border: 1px solid #F2C9C7; border-radius: 999px; padding: 2px 10px; margin-bottom: 8px; }
.report .avoid { break-inside: avoid; }

@media print {
    @page { size: A4; margin: 14mm 12mm; }
    body { background: #fff; font-size: 12px; }
    header.top, nav.side, .no-print, .toast, .drawer, .drawer-bg { display: none !important; }
    .layout { display: block; }
    main { padding: 0; }
    .report { box-shadow: none; padding: 0; max-width: none; border-radius: 0; }
    .report h2 { break-after: avoid; }
    .report .avoid, .report table tr { break-inside: avoid; }
    .table-wrap { border-color: #ccc; overflow: visible; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── terminal POS ────────────────────────────────────────────── */
pre.code { background: #1E1A4D; color: #E6E5F7; border-radius: var(--r-sm); padding: 16px; font-family: var(--mono); font-size: 12px; line-height: 1.55;
    max-height: 520px; overflow: auto; margin: 0; white-space: pre-wrap; word-break: break-word; }
.pos-term textarea { background: #1E1A4D; color: #E6E5F7; border-color: #1E1A4D; line-height: 1.55; min-height: 420px; }
.pos-term textarea:focus { background: #1E1A4D; }
.pos-verdict { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.pos-verdict > div { border-radius: var(--r-sm); padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); }
.pos-verdict .l { font-size: 10.5px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pos-verdict .v { font-size: 19px; font-weight: 600; margin-top: 2px; }
.pos-verdict.v-CRITICAL > div:first-child { background: #6E1F2A; border-color: #6E1F2A; color: #fff; }
.pos-verdict.v-CRITICAL > div:first-child .l { color: #F2C9C7; }
.pos-verdict.v-HIGH > div:first-child { background: var(--bad-bg); border-color: #F2C9C7; color: var(--accent-deep); }
.pos-verdict.v-LOW > div:first-child, .pos-verdict.v-MEDIUM > div:first-child { background: var(--ok-bg); border-color: #BFE3D1; color: var(--ok); }

/* ── notificaciones ──────────────────────────────────────────── */
label.chk { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink); cursor: pointer; padding: 8px 12px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
label.chk input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.day input { display: none; }
.day span { display: inline-block; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; cursor: pointer; }
.day input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }
.recips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 220px; overflow: auto; }
.chans { display: flex; gap: 10px; flex-wrap: wrap; }
.chan { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; font-size: 12px; background: var(--surface-2); }
.chan small { color: var(--muted); }
.chan .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.chan.ok .dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.chan.off .dot { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-bg); }
.mini { display: inline-block; font-size: 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; margin: 1px 0; color: var(--ink-soft); }
.badge.b-off { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
tr.off-row td { opacity: .55; }
td.actions { width: 1%; }
td.actions .btn { display: flex; width: 100%; justify-content: center; margin: 3px 0; }
label.f input, label.f select { width: 100%; }

/* ── centro de monitoreo ─────────────────────────────────────── */
.live-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); animation: pulse 1.6s infinite; }
.live-kpis .v { transition: color .3s; }
.map-wrap { position: relative; }
.worldmap { display: block; width: 100%; height: auto; border-radius: var(--r-sm); overflow: hidden; }
.worldmap .sea { fill: #F6F7FB; }
.worldmap .land { fill: #E2E4F1; }
.worldmap .borders { fill: none; stroke: #FFFFFF; stroke-width: .6; }
.worldmap .dot { stroke: #fff; stroke-width: 1.4; fill-opacity: .88; cursor: pointer; transition: r .3s; }
.worldmap .dot:hover { fill-opacity: 1; stroke: var(--ink); }
.worldmap .ping { fill: none; stroke-width: 2; animation: ping 1.8s ease-out forwards; pointer-events: none; }
@keyframes ping { from { r: 4; opacity: 1; } to { r: 26; opacity: 0; } }
.map-wrap .tip { transform: translate(-50%, calc(-100% - 12px)); }
tr.flash td { animation: flashrow 2.2s ease-out; }
@keyframes flashrow { from { background: var(--bad-bg); } to { background: transparent; } }
.ask { display: flex; gap: 8px; margin-bottom: 12px; }
.ask input { flex: 1; }
.ai-item { background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; font-size: 13px; }
.ai-item.critico { border-left-color: #6E1F2A; }
.ai-item.atencion { border-left-color: var(--warn); }
.ai-item.info { border-left-color: var(--ok); }
.ai-item.accion { border-left-color: var(--indigo); }
.ai-item.new { animation: flash 1.6s ease-out; }
.ai-h { display: flex; gap: 8px; align-items: center; margin-bottom: 5px; font-size: 11.5px; flex-wrap: wrap; }
.ai-h .src { color: var(--ink-soft); font-weight: 600; }
.ai-h .muted { margin-left: auto; }
.ai-txt { color: var(--ink-soft); margin-top: 3px; white-space: pre-wrap; }
.ai-rec { color: var(--ink); margin-top: 6px; font-weight: 500; }
.ai-answer { white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; }
.auto-card .card-h { align-items: center; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 44px; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; background: #D5D7E6; border-radius: 999px; cursor: pointer; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ── normatividad México ─────────────────────────────────────── */
.st { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.st-ok { background: var(--ok-bg); color: var(--ok); } .st-part { background: var(--warn-bg); color: var(--warn); }
.st-pend { background: var(--bad-bg); color: var(--bad); } .st-org { background: #ECEDF5; color: #5E5C7E; }
.cov-grid { gap: 26px; }
.cov-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-bottom: 8px; }
.cov-bar { display: flex; gap: 2px; height: 22px; border-radius: 8px; overflow: hidden; }
.cov-bar span { display: grid; place-items: center; font-size: 11px; font-weight: 600; min-width: 4px; }
.cov-bar .st-ok { background: #2E9E6B; color: #fff; } .cov-bar .st-part { background: #D08A1A; color: #fff; }
.cov-bar .st-pend { background: #C6423C; color: #fff; } .cov-bar .st-org { background: #A9A8C2; color: #fff; }
.cov-l { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--ink-soft); }
.cov-l span { display: inline-flex; align-items: center; gap: 6px; }
.cov-l i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cov-l i.st-ok { background: #2E9E6B; } .cov-l i.st-part { background: #D08A1A; } .cov-l i.st-pend { background: #C6423C; } .cov-l i.st-org { background: #A9A8C2; }
.tab-n { margin-left: 6px; font-weight: 700; color: var(--accent); }
.seg button.on .tab-n { color: #FFB4AE; }
.normas { display: grid; gap: 12px; }
details.norma { padding: 0; }
details.norma > summary { list-style: none; cursor: pointer; padding: 18px 22px; }
details.norma > summary::-webkit-details-marker { display: none; }
details.norma[open] > summary { border-bottom: 1px solid var(--line); }
.norma-h { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.norma-t { min-width: 0; flex: 1 1 380px; }
.norma-t h3 { font-size: 15px; margin: 6px 0 2px; } .norma-t h3 span { font-weight: 500; color: var(--ink-soft); }
.norma-t .mini { margin-right: 6px; }
.warn-mini { background: var(--warn-bg) !important; color: var(--warn) !important; border-color: transparent !important; font-weight: 600; }
.norma-c { display: flex; gap: 6px; flex-wrap: wrap; }
.norma-b { padding: 16px 22px 22px; }
.norma-b > p { margin: 0 0 12px; font-size: 13px; color: var(--ink-soft); line-height: 1.55; }
.norma-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 14px; }
.rule-chips, .mod-links { margin-top: 6px; } .rule-chips .mini { font-size: 10.5px; }
.mod-links a { font-size: 12px; }
.reco { margin-top: 6px; font-size: 12px; color: var(--accent-deep); }
.mon-state { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.srcs { display: grid; gap: 8px; }
.src { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px; background: var(--surface-2); font-size: 12.5px; }
.src > i { width: 9px; height: 9px; border-radius: 50%; background: #C9C8DA; flex: 0 0 9px; margin-top: 5px; }
.src.ok > i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); } .src.bad > i { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.src.off { opacity: .55; }
.src b { display: block; } .src small { display: block; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.src-url { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.src-edit { display: grid; gap: 6px; margin-bottom: 10px; } .src-edit input:not([type]) { width: 100%; }
.kw { display: grid; grid-template-columns: minmax(0, 2fr) 64px minmax(0, 1fr) auto; gap: 6px; margin-bottom: 6px; }
.norm-feed { display: grid; gap: 10px; }
.norm-item { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; background: var(--surface); }
.norm-item.is-new { border-left-color: var(--accent); }
.ni-h { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 11.5px; }
.ni-t { display: block; margin-top: 6px; font-weight: 600; font-size: 13.5px; line-height: 1.4; text-decoration: none; }
.ni-t:hover { text-decoration: underline; }
.ni-ia { margin-top: 8px; background: var(--surface-2); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; }
.ni-ia p { margin: 6px 0 0; color: var(--ink-soft); } .ni-ia ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink); }
.ni-f { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 10px; }
.ni-act { display: flex; gap: 6px; flex-wrap: wrap; }
@media print { details.norma > summary { padding: 10px 0; } .norma-b { padding: 8px 0; } details.norma:not([open]) { break-inside: avoid; } }
@media screen and (max-width: 640px) {
    details.norma > summary { padding: 14px; } .norma-b { padding: 12px 14px 16px; }
    .kw { grid-template-columns: minmax(0, 1fr) 56px; } .kw input[name=t] { grid-column: 1; }
}

/* ── asistentes ──────────────────────────────────────────────── */
.as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.as-card { display: flex; flex-direction: column; gap: 12px; }
.as-card.off { opacity: .75; }
.as-h { display: flex; gap: 12px; align-items: flex-start; }
.as-h h3 { font-size: 15.5px; }
.as-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--info-bg); color: var(--indigo); flex: 0 0 40px; }
.as-ic svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.as-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; align-items: center; }
.as-p { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.as-when { font-size: 12.5px; color: var(--ink-soft); }
.as-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.as-stats > div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: 11px; color: var(--muted); }
.as-stats span { display: block; font-size: 18px; font-weight: 600; color: var(--ink); }
.as-last { display: flex; gap: 8px; align-items: flex-start; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
    font-size: 12.5px; cursor: pointer; color: var(--ink); }
.as-last:hover { border-color: #CFD1E3; background: var(--surface-2); }
.as-last span:last-child { flex: 1; min-width: 0; }
.as-last-empty { font-size: 12.5px; }
.as-f { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.as-list { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-soft); } .as-list li { margin-bottom: 4px; }
.as-dict { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.as-dict p { margin: 8px 0; color: var(--ink-soft); line-height: 1.55; }
.as-rec { display: flex; gap: 8px; flex-wrap: wrap; }
.as-recrow { border-top: 1px solid var(--line); padding: 8px 0; font-size: 13px; }
.as-txt { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-soft); white-space: pre-wrap; }
.as-case { display: grid; gap: 8px; }
.as-pre { white-space: pre-wrap; font-size: 12px; }
@media screen and (max-width: 640px) { .as-stats span { font-size: 15px; } }

/* ── prueba masiva e integración ─────────────────────────────── */
pre.curl { max-height: none; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.dl-grid { display: grid; gap: 10px; }
.dl-card { position: relative; display: block; text-decoration: none; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 64px 14px 16px; background: var(--surface-2); transition: .15s; }
.dl-card:hover { border-color: var(--indigo); background: var(--info-bg); }
.dl-card b { display: block; font-size: 14px; } .dl-card span { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; }
.dl-card i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: #1F7A4D; border-radius: 6px; padding: 3px 7px; }
.drop { display: grid; place-items: center; gap: 4px; text-align: center; border: 2px dashed #CFD1E3; border-radius: 14px; padding: 26px 16px; cursor: pointer; background: var(--surface-2); transition: .15s; }
.drop:hover, .drop.over { border-color: var(--indigo); background: var(--info-bg); }
.drop b { font-size: 14px; } .drop span { font-size: 12px; color: var(--muted); }
.pbar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pbar b { display: block; height: 100%; background: linear-gradient(90deg, #4C48A8, #E15750); border-radius: 99px; transition: width .4s; }
table.cm td { font-size: 22px; font-weight: 600; } table.cm td small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
table.cm th[scope], table.cm tbody th { text-align: left; font-size: 11px; }
td.ok-c { background: var(--ok-bg); color: var(--ok); } td.bad-c { background: var(--bad-bg); color: var(--bad); }
.proj { display: grid; gap: 8px; }
.proj > div { background: var(--surface-2); border-radius: 10px; padding: 9px 12px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; }
.proj span { font-size: 15px; font-weight: 600; color: var(--ink); }

/* ── responsivo: tabletas y celulares ─────────────────────────── */
.menu-btn { display: none; width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
    cursor: pointer; place-items: center; color: var(--ink); padding: 0; }
.menu-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.nav-bg { display: none; }

@media screen and (max-width: 1024px) {
    header.top { padding: 10px 16px; gap: 12px; flex-wrap: nowrap; }
    .top .title { display: none; }
    .menu-btn { display: grid; }
    .top .status { gap: 8px; flex-wrap: nowrap; }
    /* menú lateral como panel deslizable */
    .layout { display: block; min-height: 0; }
    nav.side { position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; height: 100dvh; width: min(300px, 84vw); z-index: 45;
        transform: translateX(-105%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); box-shadow: 20px 0 50px rgba(36, 32, 90, .18);
        padding: 20px 14px calc(20px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
    body.nav-open nav.side { transform: none; }
    .nav-bg { display: block; position: fixed; inset: 0; background: rgba(36, 32, 90, .35); backdrop-filter: blur(2px); z-index: 44;
        opacity: 0; pointer-events: none; transition: opacity .2s; }
    body.nav-open .nav-bg { opacity: 1; pointer-events: auto; }
    body.nav-open { overflow: hidden; }
    .nav-btn { padding: 11px 10px; }
    main { padding: 18px 16px 40px; }
    .factors { max-width: none; }
}

@media screen and (max-width: 640px) {
    body { font-size: 13.5px; }
    header.top { padding: 8px 12px; gap: 10px; }
    .wordmark { font-size: 22px; }
    .wordmark-tag { font-size: 8px; letter-spacing: 1.4px; padding: 2px 6px; margin-left: 5px; }
    .top .clock { display: none; }
    /* indicadores de API y bot: solo el punto de color (el texto queda en el título) */
    .top .status .pill { font-size: 0; gap: 0; padding: 8px; }
    .top .status .pill .dot { box-shadow: 0 0 0 3px rgba(46, 158, 107, .15); }
    main { padding: 14px 12px 36px; }
    .page-head { gap: 10px; margin-bottom: 14px; }
    .page-head > div:first-child { min-width: 0; }
    .page-head h2 { font-size: 19px; }
    .page-head p { font-size: 12px; }
    .page-head > .toolbar, .card-h .toolbar { width: 100%; }
    .toolbar { gap: 6px; }
    .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .seg::-webkit-scrollbar { display: none; }
    .seg button { flex: 0 0 auto; }
    .toolbar input, .toolbar select, .field-inline input, .field-inline { width: auto !important; min-width: 0; flex: 1 1 140px; }
    .field-inline { flex-wrap: wrap; }
    /* iOS no hace zoom en campos de 16px */
    input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px; }
    .grid { gap: 12px; }
    .card { padding: 16px 14px; border-radius: 16px; }
    .card-h { gap: 8px; padding-bottom: 12px; margin-bottom: 12px; }
    .kpis, .kpis[style] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; margin-bottom: 12px; }
    .kpi { padding: 14px 14px; border-radius: 16px; }
    .kpi .l { font-size: 10px; letter-spacing: .8px; }
    .kpi .v { font-size: 21px; }
    .kpi .s { font-size: 11px; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .kv .k { font-size: 11.5px; }
    .kv .v { margin-bottom: 9px; }
    .table-wrap table { font-size: 12.5px; }
    /* tablas anchas: se deslizan de lado; sombras indican que hay más columnas y la primera queda fija */
    .table-wrap { -webkit-overflow-scrolling: touch;
        background: linear-gradient(90deg, var(--surface) 30%, rgba(255, 255, 255, 0)) left / 28px 100% no-repeat local,
                    linear-gradient(270deg, var(--surface) 30%, rgba(255, 255, 255, 0)) right / 28px 100% no-repeat local,
                    radial-gradient(farthest-side at 0 50%, rgba(36, 32, 90, .16), transparent) left / 12px 100% no-repeat scroll,
                    radial-gradient(farthest-side at 100% 50%, rgba(36, 32, 90, .16), transparent) right / 12px 100% no-repeat scroll, var(--surface); }
    .table-wrap table { background: transparent; }
    .table-wrap tbody td { background: transparent; }
    .table-wrap th:first-child, .table-wrap td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
    .table-wrap thead th:first-child { z-index: 2; background: var(--surface-2); }
    .drawer { width: 100vw; }
    .drawer-f { flex-wrap: wrap; }
    .toast { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: none; }
    .donut-wrap { flex-direction: column; align-items: stretch; }
    .donut-wrap svg { align-self: center; }
    .donut-legend { min-width: 0; width: 100%; }
    .hbar { grid-template-columns: minmax(70px, 42%) minmax(30px, 1fr) auto; gap: 8px; }
    .feed-item { gap: 10px; }
    .pos-verdict { grid-template-columns: minmax(0, 1fr); }
    .pos-term textarea { min-height: 300px; }
    .recips { grid-template-columns: minmax(0, 1fr); }
    .ask { flex-wrap: wrap; }
    .ask input { flex: 1 1 100%; }
    .ask .btn { flex: 1; }
    .report { padding: 22px 16px; border-radius: 16px; }
    .report .rh { flex-direction: column; }
    .report .rh .meta { text-align: left; }
    .report .rk { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report .sign { grid-template-columns: minmax(0, 1fr); gap: 26px; }
    .report .rf { flex-direction: column; }
}
