/* Tableru — estilos de la aplicación */
:root {
  --bg: #f5f5fa;
  --bg2: #fbfbfe;
  --card: #ffffff;
  --line: #eceef6;
  --line2: #e2e5f0;
  --ink: #1b1e3a;
  --ink2: #3a3f63;
  --muted: #7b80a0;
  --muted2: #a3a7c2;
  --brand: #6366f1;
  --brand2: #8b5cf6;
  --brand-soft: #eef0ff;
  --ok: #16a34a;
  --ok-soft: #e8f8ee;
  --bad: #e11d48;
  --bad-soft: #fdecef;
  --warn: #f59e0b;
  --warn-soft: #fff6e5;
  --side: #0d1024;
  --side2: #151935;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(20, 22, 60, .04), 0 4px 18px rgba(20, 22, 60, .05);
  --shadow-l: 0 20px 60px rgba(20, 22, 60, .16);
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.grad-text { background: linear-gradient(90deg, var(--brand), var(--brand2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------------- Botones y formularios ---------------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 11px; border: 1px solid var(--line2); background: #fff; color: var(--ink); font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; text-decoration: none; }
.btn:hover { border-color: #cfd3e6; background: #fafbff; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: #12152b; border-color: #12152b; color: #fff; }
.btn.primary:hover { background: #20244a; }
.btn.brand { background: linear-gradient(135deg, var(--brand), var(--brand2)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(99, 102, 241, .32); }
.btn.brand:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(99, 102, 241, .07); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #f6c7d1; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.xs { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn.xs svg, .btn.sm svg { width: 15px; height: 15px; }
.btn.icon { width: 38px; padding: 0; justify-content: center; }
.btn.icon.sm { width: 32px; }
.btn.icon.xs { width: 28px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px; border: 2px solid currentColor; border-color: #9aa0c3 transparent #9aa0c3 transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.brand.loading::after, .btn.primary.loading::after { border-color: #fff transparent #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 10px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; padding-right: 32px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237b80a0' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.input:focus { border-color: #a5a8f6; box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); }
.input.mono { font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.switch { position: relative; width: 38px; height: 22px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: #d6d9e8; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; 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: #22c55e; }
.switch input:checked + span::before { transform: translateX(16px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line2); background: #fff; color: var(--ink2); font-size: 13px; cursor: pointer; transition: .15s; }
.chip:hover { border-color: #c5c8f3; background: #f7f7ff; color: var(--brand); }
.chip.on { background: var(--brand-soft); border-color: #c9ccfb; color: var(--brand); font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #f1f2f8; color: var(--ink2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: #b45309; }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------------- Layout principal ---------------- */
.app { display: flex; min-height: 100vh; }
.side { width: 248px; flex: none; background: linear-gradient(180deg, var(--side) 0%, #0b0e20 100%); color: #e7e9f6; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 18px; color: #fff; }
.side-brand img { width: 38px; height: 38px; }
.side-brand b { font-size: 23px; font-weight: 750; letter-spacing: -.03em; display: block; line-height: 1; }
.side-brand small { display: block; font-size: 10.5px; color: #9ca1c4; margin-top: 4px; }
.side-nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-space { display: flex; align-items: center; gap: 12px; padding: 0 12px; height: 40px; border-radius: 10px; color: #cfd3ea; font-weight: 500; font-size: 14px; transition: background .15s, color .15s; cursor: pointer; }
.side-nav a svg { width: 19px; height: 19px; opacity: .9; flex: none; }
.side-nav a:hover, .side-space:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.side-nav a.on { background: rgba(255, 255, 255, .09); color: #fff; }
.side-nav a.on .nav-new { background: #fff; color: var(--side); }
.nav-new { width: 22px; height: 22px; border-radius: 7px; background: rgba(255, 255, 255, .12); display: grid; place-items: center; margin-left: -1px; }
.nav-new svg { width: 14px !important; height: 14px !important; }
.side-sec { margin: 18px 20px 8px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #7f84a8; font-weight: 650; display: flex; align-items: center; justify-content: space-between; }
.side-sec button { background: none; border: 0; color: #7f84a8; cursor: pointer; padding: 2px; border-radius: 6px; display: grid; }
.side-sec button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.side-spaces { padding: 0 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; min-height: 60px; }
.side-space .sp-ic { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: #fff; flex: none; }
.side-space .sp-ic svg { width: 14px; height: 14px; }
.side-space.on { background: rgba(255, 255, 255, .09); color: #fff; }
.side-space span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .06); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; cursor: pointer; }
.side-user:hover { background: rgba(255, 255, 255, .05); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13.5px; flex: none; background: var(--brand); }
.avatar.sm { width: 28px; height: 28px; font-size: 11.5px; }
.side-user b { display: block; font-size: 13.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user small { color: #9ca1c4; font-size: 11.5px; }
.side-user svg { width: 17px; height: 17px; color: #9ca1c4; margin-left: auto; flex: none; }
.credits { margin-top: 8px; padding: 14px; border-radius: 14px; background: var(--side2); border: 1px solid rgba(255, 255, 255, .05); }
.credits .row { font-size: 12.5px; color: #cfd3ea; justify-content: space-between; }
.credits .bar { height: 5px; background: rgba(255, 255, 255, .1); border-radius: 9px; margin: 9px 0 12px; overflow: hidden; }
.credits .bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, #60a5fa, #a78bfa); }
.credits .btn { width: 100%; justify-content: center; height: 34px; background: transparent; color: #fff; border-color: rgba(255, 255, 255, .22); font-size: 13px; }
.credits .btn:hover { background: rgba(255, 255, 255, .06); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: radial-gradient(1200px 500px at 10% -10%, #fdeee6 0%, rgba(253, 238, 230, 0) 60%), radial-gradient(900px 500px at 90% 0%, #eceefe 0%, rgba(236, 238, 254, 0) 60%), var(--bg); }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 24px 8px; position: sticky; top: 0; z-index: 30; }
.topbar.scrolled { background: rgba(245, 245, 250, .97); box-shadow: 0 1px 0 var(--line); padding-bottom: 12px; }
.hamb { display: none; }
.ask { flex: 1; max-width: 760px; display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 8px 0 18px; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.ask svg.spark { width: 22px; height: 22px; flex: none; }
.ask input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; min-width: 0; }
.ask input::placeholder { color: #9095b4; }
.top-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.content { padding: 14px 24px 40px; flex: 1; min-width: 0; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 18px; flex-wrap: wrap; }
.page-h h1 { font-size: 24px; font-weight: 720; }
.page-h p { margin: 4px 0 0; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 6px; }
.card-h h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-h h3 svg { width: 18px; height: 18px; }
.card-b { padding: 8px 18px 18px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.rail { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .em-ic { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty .em-ic svg { width: 30px; height: 30px; }
.empty h3 { color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.empty p { max-width: 420px; margin: 0 auto 16px; }

/* Listas del panel lateral */
.rlist { display: flex; flex-direction: column; gap: 8px; }
.ritem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s, background .15s; cursor: pointer; color: inherit; }
.ritem:hover { border-color: #d7daf0; background: #fcfcff; }
.ritem .ri-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.ritem .ri-ic svg { width: 18px; height: 18px; }
.ritem b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ritem small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins { display: flex; gap: 12px; padding: 10px 2px; border-bottom: 1px solid #f2f3f9; }
.ins:last-child { border-bottom: 0; }
.ins .ins-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.ins .ins-ic svg { width: 17px; height: 17px; }
.ins p { margin: 0; font-size: 12.5px; color: var(--ink2); line-height: 1.5; }
.tone-up { background: #e8f8ee; color: #16a34a; }
.tone-down { background: #fdecef; color: #e11d48; }
.tone-star { background: #eef0ff; color: #6366f1; }
.tone-info { background: #e8f3ff; color: #2563eb; }
.tone-warn { background: #fff2e5; color: #f97316; }
.auto-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid #f2f3f9; }
.auto-row:last-child { border-bottom: 0; }
.auto-row .ai { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.auto-row .ai svg { width: 17px; height: 17px; }
.auto-row b { display: block; font-size: 13px; font-weight: 600; }
.auto-row small { color: var(--muted); font-size: 11.5px; }

/* ---------------- Chat ---------------- */
.chat { max-width: 1000px; }
.thread { display: flex; flex-direction: column; gap: 18px; padding-bottom: 210px; }
.msg-u { align-self: flex-start; display: flex; gap: 14px; max-width: 760px; width: fit-content; margin-left: 46px; }
.msg-u .bubble { background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 18px; padding: 14px 18px; font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; box-shadow: var(--shadow); }
.msg-a { display: flex; gap: 14px; }
.ai-av { width: 42px; height: 42px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; flex: none; border: 1px solid var(--line); }
.ai-av svg { width: 22px; height: 22px; }
.msg-a .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.msg-a .reply { background: rgba(255, 255, 255, .85); border: 1px solid var(--line); border-radius: 18px; padding: 15px 18px; box-shadow: var(--shadow); font-size: 14.5px; line-height: 1.6; }
.reply p { margin: 0 0 8px; } .reply p:last-child { margin: 0; }
.reply ul, .reply ol { margin: 4px 0 8px; padding-left: 20px; }
.reply li { margin: 3px 0; }
.reply strong { font-weight: 650; }
.reply code { background: #f3f4fa; padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
.reply .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.thinking { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.thinking .pulse { display: flex; gap: 4px; }
.thinking .pulse i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: pulse 1.2s infinite ease-in-out; }
.thinking .pulse i:nth-child(2) { animation-delay: .15s; background: #a78bfa; }
.thinking .pulse i:nth-child(3) { animation-delay: .3s; background: #f472b6; }
@keyframes pulse { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
.steps-live { font-size: 13px; color: var(--muted); margin-top: 4px; }

.composer-wrap { position: fixed; left: 248px; right: 0; bottom: 0; padding: 0 24px 20px; z-index: 25; pointer-events: none; }
.composer-wrap.with-rail { right: 320px; }
.composer { max-width: 1000px; pointer-events: auto; }
.composer .sugs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.composer .sugs .chip { background: #fff; }
.composer-box { display: flex; align-items: flex-end; gap: 10px; background: #fff; border: 1px solid var(--line2); border-radius: 18px; padding: 8px 8px 8px 16px; box-shadow: 0 10px 40px rgba(20, 22, 60, .10); }
.composer-box textarea { flex: 1; border: 0; outline: 0; resize: none; max-height: 180px; min-height: 24px; padding: 9px 0; line-height: 1.5; font-size: 14.5px; background: transparent; }
.composer-box .send { width: 44px; height: 44px; border-radius: 13px; border: 0; background: linear-gradient(135deg, #7c7ff7, #6366f1); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 18px rgba(99, 102, 241, .35); flex: none; }
.composer-box .send svg { width: 20px; height: 20px; }
.composer-box .send[disabled] { opacity: .5; }
.composer-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted2); margin-top: 7px; padding: 0 6px; }

.welcome { max-width: 880px; margin: 5vh auto 0; text-align: center; }
.welcome .wl-logo { width: 64px; height: 64px; margin: 0 auto 18px; }
.welcome h1 { font-size: 32px; font-weight: 750; letter-spacing: -.03em; }
.welcome p { color: var(--muted); font-size: 16px; margin: 10px 0 28px; }
.welcome .big-ask { text-align: left; }
.starter { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 22px; text-align: left; }
.starter button { text-align: left; background: rgba(255, 255, 255, .85); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; transition: .15s; display: flex; gap: 12px; align-items: flex-start; }
.starter button:hover { border-color: #c9ccfb; box-shadow: var(--shadow); transform: translateY(-1px); }
.starter button svg { width: 20px; height: 20px; color: var(--brand); flex: none; margin-top: 1px; }
.starter b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.starter span { font-size: 12.5px; color: var(--muted); }

/* Tarjetas de visual dentro del chat y en reportes */
.vgrid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.vcard { grid-column: span 6; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; position: relative; }
.vcard.w12 { grid-column: span 12; } .vcard.w8 { grid-column: span 8; } .vcard.w4 { grid-column: span 4; } .vcard.w3 { grid-column: span 3; } .vcard.w9 { grid-column: span 9; }
.vcard-h { display: flex; align-items: flex-start; gap: 8px; padding: 14px 14px 4px 18px; }
.vcard-h h4 { font-size: 14.5px; font-weight: 650; flex: 1; min-width: 0; padding-top: 5px; }
.vcard-h .vact { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; position: absolute; top: 10px; right: 10px; background: rgba(255, 255, 255, .94); border-radius: 10px; padding: 2px; box-shadow: 0 2px 10px rgba(20, 22, 60, .08); z-index: 2; }
.vcard:hover .vact, .vcard:focus-within .vact { opacity: 1; }
@media (hover: none) { .vcard-h .vact { position: static; opacity: .8; box-shadow: none; background: none; } }
.vcard .chart { padding: 6px 14px 12px; height: 260px; position: relative; }
.vcard .chart.kpi, .vcard .chart.table { height: auto; }
.vcard.h1 .chart { height: 170px; } .vcard.h2 .chart { height: 270px; } .vcard.h3 .chart { height: 360px; } .vcard.h4 .chart { height: 460px; }
.vcard .vnote { font-size: 12.5px; color: var(--muted); padding: 0 18px 14px; line-height: 1.5; }
.vcard .verr { margin: 8px 18px 16px; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 12.5px; }
.vcard.kpi-card { box-shadow: none; border: 0; background: transparent; }
.vcard.kpi-card .vcard-h { display: none; }
.vcard.kpi-card .chart { padding: 0; }
.vmeta { font-size: 11.5px; color: var(--muted2); padding: 0 18px 12px; display: flex; gap: 10px; }

/* Resumen ejecutivo (bloque del mensaje del asistente) */
.exec { background: rgba(255, 255, 255, .9); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 18px; }
.exec-h { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
.exec-h .orb { width: 40px; height: 40px; border-radius: 50%; background: conic-gradient(from 200deg, #6366f1, #a78bfa, #f472b6, #38bdf8, #6366f1); flex: none; box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .55); }
.exec-h h3 { font-size: 19px; font-weight: 700; }
.exec-h p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* ---------------- Motor de gráficos ---------------- */
.trc { position: relative; width: 100%; height: 100%; }
.trc-svg { display: block; width: 100%; height: auto; overflow: hidden; }
.trc-scroll { overflow: auto; }
.trc-noanim *, .trc-noanim { animation: none !important; stroke-dashoffset: 0 !important; }
.ic14 { width: 14px; height: 14px; }
.trc-auto { height: auto !important; }
.trc-center-box { display: flex; align-items: center; justify-content: center; }
.trc-tick { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.trc-axis-title { font-size: 11px; fill: var(--muted2); }
.trc-grid { stroke: #eff0f7; stroke-width: 1; }
.trc-zero { stroke: #dcdfec; stroke-width: 1; }
.trc-val { font-size: 11px; font-weight: 600; fill: var(--ink2); }
.trc-cross { stroke: #c7cae6; stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.trc-line { stroke-dasharray: 3000; stroke-dashoffset: 3000; animation: trcDraw 1.1s ease-out forwards; }
.trc-area { opacity: 0; animation: trcFade .8s .25s ease-out forwards; }
.trc-dot { transition: r .12s; }
.trc-bar { transform-box: fill-box; transform-origin: bottom; animation: trcGrow .6s cubic-bezier(.2, .8, .2, 1) both; cursor: pointer; transition: opacity .15s; }
.trc-bar:hover, .trc-slice:hover, .trc-pt:hover, .trc-cell:hover { opacity: .82; }
.trc-slice { cursor: pointer; animation: trcFade .6s ease-out both; transition: opacity .15s; }
.trc-pt { animation: trcFade .6s ease-out both; cursor: pointer; }
.trc-gauge { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: trcDraw 1.2s ease-out forwards; }
@keyframes trcDraw { to { stroke-dashoffset: 0; } }
@keyframes trcFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes trcGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.trc-center { font-size: 19px; font-weight: 750; fill: var(--ink); }
.trc-center.big { font-size: 30px; }
.trc-center-sub { font-size: 11px; fill: var(--muted); }
.trc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; padding-top: 8px; }
.trc-legend.vertical { flex-direction: column; }
.trc-leg { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink2); }
.trc-leg i { width: 10px; height: 10px; border-radius: 3px; }
.trc-leg em { font-style: normal; color: var(--muted); margin-left: 4px; }
.trc-tip { position: fixed; z-index: 9999; pointer-events: none; background: #12152b; color: #fff; border-radius: 10px; padding: 9px 11px; font-size: 12px; box-shadow: 0 10px 30px rgba(10, 12, 40, .3); min-width: 140px; max-width: 280px; display: none; }
.trc-tip-h { font-weight: 650; margin-bottom: 5px; color: #fff; }
.trc-tip-row { display: flex; align-items: center; gap: 7px; margin-top: 3px; color: #c9cce4; }
.trc-tip-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.trc-tip-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trc-tip-row b { color: #fff; font-weight: 650; white-space: pre; }
.trc-empty { display: grid; place-items: center; height: 100%; min-height: 120px; color: var(--muted2); font-size: 13px; }
.trc-hbars { display: flex; flex-direction: column; gap: 9px; padding: 6px 2px; }
.trc-hrow { display: grid; grid-template-columns: minmax(70px, 28%) 1fr auto; align-items: center; gap: 12px; font-size: 13px; cursor: default; }
.trc-hlab { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink2); }
.trc-htrack { height: 20px; background: transparent; border-radius: 5px; overflow: hidden; }
.trc-hfill { display: block; height: 100%; border-radius: 5px; animation: trcBar .8s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
@keyframes trcBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.trc-hval { font-size: 13px; font-weight: 650; min-width: 54px; text-align: right; }
.trc-pie-wrap { display: flex; align-items: center; gap: 24px; height: 100%; justify-content: center; }
.trc-pie-wrap.stack { flex-direction: column; gap: 12px; }
.trc-pie-wrap svg { width: auto; flex: none; }
.trc-pie-legend { display: flex; flex-direction: column; gap: 9px; min-width: 120px; flex: 1; max-width: 240px; }
.trc-pl { display: grid; grid-template-columns: 10px 1fr auto; gap: 9px; align-items: center; font-size: 12.5px; color: var(--ink2); }
.trc-pl i { width: 10px; height: 10px; border-radius: 3px; }
.trc-pl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trc-pl b { color: var(--muted); font-weight: 600; }
.trc-funnel { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.trc-frow { display: grid; grid-template-columns: minmax(70px, 24%) 1fr 44px; align-items: center; gap: 12px; font-size: 13px; }
.trc-fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); }
.trc-fbar-wrap { display: flex; justify-content: center; }
.trc-fbar { height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; min-width: 50px; animation: trcBar .8s both; }
.trc-frow em { font-style: normal; color: var(--muted); font-size: 12px; text-align: right; }
.trc-kpis { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
.trc-kpis.n1 { grid-template-columns: 1fr; } .trc-kpis.n2 { grid-template-columns: repeat(2, 1fr); } .trc-kpis.n3 { grid-template-columns: repeat(3, 1fr); }
.trc-kpi { display: flex; gap: 14px; align-items: flex-start; padding: 16px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; position: relative; overflow: hidden; min-width: 0; }
.trc-kpi-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.trc-kpi-ic svg { width: 21px; height: 21px; }
.trc-kpi-b { min-width: 0; flex: 1; position: relative; z-index: 1; }
.trc-kpi-l { font-size: 12.5px; color: var(--ink2); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trc-kpi-v { font-size: 25px; font-weight: 750; letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trc-kpi-d { font-size: 12px; font-weight: 650; margin-top: 4px; }
.trc-kpi-d span { color: var(--muted); font-weight: 450; margin-left: 4px; }
.trc-kpi-d.up { color: var(--ok); } .trc-kpi-d.down { color: var(--bad); }
.trc-spark { position: absolute; right: 0; bottom: 6px; width: 46%; height: 34px; opacity: .55; }
.trc-table-wrap { overflow: auto; max-height: 420px; border: 1px solid var(--line); border-radius: 12px; }
.trc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.trc-table th { position: sticky; top: 0; background: #f7f8fc; text-align: left; font-weight: 600; color: var(--ink2); padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; }
.trc-table td { padding: 8px 12px; border-bottom: 1px solid #f2f3f8; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.trc-table tr:hover td { background: #fbfbff; }
.trc-table .num { text-align: right; position: relative; font-variant-numeric: tabular-nums; }
.trc-table td.num span { position: relative; z-index: 1; }
.trc-tbar { position: absolute; right: 0; top: 6px; bottom: 6px; background: rgba(99, 102, 241, .08); border-radius: 4px 0 0 4px; z-index: 0 !important; }
.trc-more { font-size: 12px; color: var(--muted); padding: 8px 2px 0; }

/* ---------------- Tableros ---------------- */
.dgrid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.dgrid .vcard { grid-column: span var(--w, 6); }
.dgrid.editing .vcard { cursor: grab; outline: 2px dashed transparent; outline-offset: 2px; }
.dgrid.editing .vcard:hover { outline-color: #c9ccfb; }
.dgrid .vcard.dragging { opacity: .4; }
.dgrid .vcard.drop-before { box-shadow: -4px 0 0 var(--brand); }
.dgrid .vcard .resz { display: none; position: absolute; right: 8px; bottom: 8px; gap: 4px; z-index: 3; }
.dgrid.editing .vcard .resz { display: flex; }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.dtile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; color: inherit; }
.dtile:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(20, 22, 60, .09); }
.dtile .thumb { height: 128px; background: linear-gradient(135deg, #f6f6ff, #fdf4f0); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px; }
.dtile .thumb div { background: #fff; border-radius: 9px; border: 1px solid #eef0f8; display: grid; place-items: center; color: #b9bcef; }
.dtile .thumb svg { width: 32px; height: 32px; }
.dtile .info { padding: 14px 16px 16px; }
.dtile b { display: block; font-size: 15px; font-weight: 650; margin-bottom: 4px; }
.dtile small { color: var(--muted); font-size: 12px; }
.dash-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.dash-title { font-size: 24px; font-weight: 720; outline: none; border-radius: 8px; padding: 2px 6px; margin-left: -6px; }
.dash-title[contenteditable="true"]:hover, .dash-title:focus { background: rgba(99, 102, 241, .06); }

/* ---------------- Tablas de administración ---------------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid #f2f3f8; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fbfbff; }
.tbl .acts { display: flex; gap: 4px; justify-content: flex-end; }

.src-type { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 13px; color: #fff; }
.src-type svg { width: 21px; height: 21px; }
.src-csv { background: #e9f9ef; color: #16a34a; } .src-xlsx { background: #e7f6ec; color: #107c41; } .src-gsheet { background: #e8f5e9; color: #188038; }
.src-rest { background: #fdecef; color: #e11d48; } .src-mysql { background: #e8f3ff; color: #00758f; } .src-pgsql { background: #eef0ff; color: #336791; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.src-pick { border: 1px solid var(--line2); border-radius: 14px; padding: 16px; background: #fff; cursor: pointer; text-align: left; transition: .15s; display: flex; flex-direction: column; gap: 10px; }
.src-pick:hover { border-color: #c9ccfb; box-shadow: var(--shadow); }
.src-pick b { font-size: 14px; }
.src-pick span { font-size: 12.5px; color: var(--muted); }
.src-pick.locked { opacity: .55; }
.drop { border: 2px dashed #d3d6ec; border-radius: 16px; padding: 30px 20px; text-align: center; background: #fbfbff; cursor: pointer; transition: .15s; }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop svg { width: 34px; height: 34px; color: var(--brand); }
.drop b { display: block; margin: 8px 0 4px; }
.ds-cols { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ds-cols span { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: #f3f4fa; color: var(--ink2); }
.ds-cols span em { font-style: normal; color: var(--muted2); margin-left: 4px; }

/* Explorador SQL */
.sql-ed { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; min-height: 150px; background: #0f1226; color: #e6e8f7; border: 0; border-radius: 12px; padding: 14px; width: 100%; resize: vertical; outline: none; line-height: 1.6; }
.cat-tree { max-height: 560px; overflow: auto; font-size: 13px; }
.cat-tree details { border-bottom: 1px solid #f2f3f8; padding: 6px 0; }
.cat-tree summary { cursor: pointer; font-weight: 600; padding: 4px 2px; list-style: none; display: flex; gap: 8px; align-items: center; }
.cat-tree summary::-webkit-details-marker { display: none; }
.cat-tree .col { display: flex; justify-content: space-between; padding: 3px 4px 3px 20px; color: var(--ink2); cursor: pointer; border-radius: 6px; }
.cat-tree .col:hover { background: #f5f6fc; }
.cat-tree .col em { color: var(--muted2); font-style: normal; font-size: 11.5px; }

/* ---------------- Modales, menús, avisos ---------------- */
.modal-bg { position: fixed; inset: 0; background: rgba(16, 18, 40, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: trcFade .15s; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 520px; box-shadow: var(--shadow-l); animation: pop .18s ease-out; }
.modal.wide { max-width: 760px; } .modal.xl { max-width: 1080px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 6px; }
.modal-h h3 { font-size: 18px; font-weight: 700; }
.modal-b { padding: 12px 22px 8px; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }
.menu { position: fixed; z-index: 120; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-l); padding: 6px; min-width: 210px; animation: pop .12s ease-out; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 11px; border: 0; background: none; border-radius: 9px; cursor: pointer; text-align: left; color: var(--ink); font-size: 13.5px; }
.menu button:hover, .menu a:hover { background: #f4f5fb; }
.menu button svg, .menu a svg { width: 17px; height: 17px; color: var(--muted); }
.menu .sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu .mh { font-size: 11px; color: var(--muted2); text-transform: uppercase; letter-spacing: .08em; padding: 8px 11px 4px; font-weight: 650; }
.menu .danger { color: var(--bad); } .menu .danger svg { color: var(--bad); }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #12152b; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--shadow-l); display: flex; gap: 10px; align-items: center; animation: pop .2s; max-width: 92vw; }
.toast.err { background: #9f1239; }
.toast.ok svg { color: #4ade80; }
.toast svg { width: 18px; height: 18px; flex: none; }
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--warn-soft); color: #92400e; border: 1px solid #fde4b8; margin-bottom: 16px; font-size: 13.5px; }
.banner.info { background: var(--brand-soft); color: #3730a3; border-color: #d9dbfd; }
.banner svg { width: 20px; height: 20px; flex: none; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--brand); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat small { color: var(--muted); font-size: 12.5px; }
.stat b { display: block; font-size: 24px; font-weight: 750; margin-top: 4px; letter-spacing: -.02em; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan-card { border: 1px solid var(--line2); border-radius: 18px; padding: 22px; background: #fff; display: flex; flex-direction: column; gap: 10px; position: relative; }
.plan-card.cur { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(99, 102, 241, .1); }
.plan-card h3 { font-size: 18px; }
.plan-card .price { font-size: 30px; font-weight: 780; letter-spacing: -.03em; }
.plan-card .price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.plan-card ul { list-style: none; padding: 0; margin: 4px 0 10px; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; color: var(--ink2); }
.plan-card li { display: flex; gap: 8px; }
.plan-card li svg { width: 16px; height: 16px; color: var(--ok); flex: none; margin-top: 2px; }
.plan-card .btn { margin-top: auto; justify-content: center; }
.usage-bar { height: 7px; border-radius: 9px; background: #eef0f7; overflow: hidden; margin-top: 7px; }
.usage-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand2)); border-radius: 9px; }
.code-box { background: #0f1226; color: #e6e8f7; border-radius: 10px; padding: 10px 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; position: relative; }
.log-box { background: #0f1226; color: #cfd3ea; border-radius: 12px; padding: 14px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; max-height: 360px; overflow: auto; white-space: pre-wrap; }
.skeleton { background: linear-gradient(90deg, #f0f1f7 25%, #f7f8fc 50%, #f0f1f7 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

/* Reporte ejecutivo */
.report { max-width: 980px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 40px 44px; }
.report .rp-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 26px; }
.report .rp-brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; }
.report .rp-brand img { width: 30px; height: 30px; }
.report h1 { font-size: 30px; font-weight: 780; letter-spacing: -.03em; }
.report .rp-sub { color: var(--muted); margin: 6px 0 22px; }
.report .rp-sum { font-size: 15.5px; line-height: 1.7; color: var(--ink2); background: linear-gradient(135deg, #f7f7ff, #fff8f4); border-radius: 16px; padding: 18px 20px; border: 1px solid #efeffb; }
.report .rp-hl { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 22px 0; }
.report .rp-hl div { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.report .rp-hl small { color: var(--muted); font-size: 12px; display: block; }
.report .rp-hl b { font-size: 22px; font-weight: 760; display: block; margin: 4px 0 2px; }
.report .rp-hl em { font-style: normal; font-size: 12px; font-weight: 650; }
.report .rp-sec { margin: 30px 0; break-inside: avoid; }
.report .rp-sec h2 { font-size: 19px; margin-bottom: 8px; }
.report .rp-sec .txt { color: var(--ink2); line-height: 1.7; margin-bottom: 14px; }
.report .rp-sec .chart { height: 300px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.report .rp-sec .chart.auto { height: auto; }
.report .rp-list { padding-left: 20px; line-height: 1.8; color: var(--ink2); }
.report .rp-foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted2); font-size: 12px; display: flex; justify-content: space-between; }

/* ---------------- Responsivo ---------------- */
@media (max-width: 1280px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .composer-wrap.with-rail { right: 0; }
}
@media (max-width: 1100px) {
  .vgrid .vcard, .dgrid:not(.pos) .vcard { grid-column: span 12 !important; }
  .vgrid .vcard.w4, .vgrid .vcard.w3, .dgrid:not(.pos) .vcard.small { grid-column: span 6 !important; }
  .trc-kpis { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .22s; box-shadow: var(--shadow-l); }
  .side.open { transform: none; }
  .side-scrim { position: fixed; inset: 0; background: rgba(10, 12, 30, .4); z-index: 39; }
  .hamb { display: inline-flex; }
  .composer-wrap { left: 0; padding: 0 12px 12px; }
  .topbar { padding: 12px 14px 8px; gap: 8px; }
  .content { padding: 10px 14px 40px; }
  .top-actions .btn .lbl-t { display: none; }
  .top-actions .btn:not(.icon) { padding: 0 11px; }
  .ask { height: 44px; }
  .msg-u { margin-left: 0; }
  .ai-av { width: 34px; height: 34px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .welcome h1 { font-size: 25px; }
  .vgrid .vcard.w4, .vgrid .vcard.w3, .dgrid:not(.pos) .vcard.w4 { grid-column: span 12 !important; }
  .report { padding: 24px 18px; border-radius: 0; }
}
@media (max-width: 560px) {
  .trc-kpis { grid-template-columns: 1fr !important; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .top-actions .hide-sm { display: none; }
  .page-h h1 { font-size: 21px; }
}
@media print {
  body { background: #fff; }
  .side, .topbar, .composer-wrap, .no-print, .vact, .toasts { display: none !important; }
  .main { background: #fff; }
  .content { padding: 0; }
  .report { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .vcard { break-inside: avoid; box-shadow: none; }
  .trc-line, .trc-area, .trc-bar, .trc-hfill, .trc-gauge, .trc-slice { animation: none !important; stroke-dashoffset: 0 !important; opacity: 1 !important; transform: none !important; }
}
.vcard .chart.kpi.trc, .vcard .chart.table.trc { height: auto; }
@media (max-width: 1280px) {
  .chat-page .rail { display: none; }
}
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; }
  .topbar .ask { order: 3; flex-basis: 100%; max-width: none; }
  .top-actions { gap: 6px; }
  .composer .sugs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 8px; }
  .composer .sugs::-webkit-scrollbar { display: none; }
  .composer .sugs > span { display: none; }
  .composer .sugs .chip { flex: none; }
  .composer-meta { display: none; }
  .thread { padding-bottom: 190px; }
}
@media (max-width: 560px) { .msg-a .ai-av { display: none; } .msg-a { gap: 0; } }
.trc-pie-wrap.stack .trc-pie-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; max-width: none; width: 100%; }

/* ================= Motor gráfico 2 ================= */
.trc { position: relative; }
.trc-leg, .trc-pl { background: none; border: 0; padding: 3px 6px; border-radius: 7px; cursor: pointer; font: inherit; transition: opacity .15s, background .15s; }
.trc-leg:hover, .trc-pl:hover { background: #f4f5fb; }
.trc-leg.off, .trc-pl.off { opacity: .38; }
.trc-leg.off i, .trc-pl.off i { background: #cbd0e4 !important; }
.trc-pl { width: 100%; text-align: left; }
.trc-tip-hint { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.12); color: #a5b4fc; font-size: 11px; }
.trc-brush { fill: rgba(99, 102, 241, .12); stroke: rgba(99, 102, 241, .5); stroke-dasharray: 3 3; pointer-events: none; }
.trc-reset { position: absolute; top: 2px; right: 2px; z-index: 2; border: 1px solid var(--line2); background: #fff; border-radius: 8px; font-size: 11.5px; padding: 3px 9px; cursor: pointer; color: var(--brand); font-weight: 600; box-shadow: var(--shadow); }
.trc-ref-l { font-size: 11px; font-weight: 650; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.trc-val.in { fill: #fff; paint-order: normal; }
.trc-val { paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.trc-val.in { stroke: none; }
.trc-tick.small { font-size: 10px; }
.trc-axis-title { font-size: 11px; font-weight: 600; fill: var(--muted2); }
.trc-tm-l { font-size: 12px; font-weight: 650; fill: #fff; pointer-events: none; }
.trc-tm-v { font-size: 11px; fill: rgba(255, 255, 255, .88); pointer-events: none; }
.trc-cell { transition: opacity .15s; }
.trc-sk-l { font-size: 12px; fill: var(--ink2); pointer-events: none; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.trc-link { transition: fill-opacity .15s; cursor: default; }
.trc-node { cursor: pointer; }
.trc-radar { animation: trcFade .7s ease-out both; }
.trc-region { transition: opacity .15s, stroke-width .15s; }
.trc-region.has:hover { opacity: .8; stroke: #1b1e3a; stroke-width: 1.2; }
.trc-map { display: flex; gap: 16px; align-items: center; }
.trc-map .trc-mapsvg { flex: 1; min-width: 0; width: 100%; display: block; overflow: hidden; }
.trc-map.withlist .trc-mapsvg { flex: none; width: 70%; }
.trc-map-list { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.trc-ml-h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted2); font-weight: 650; margin-bottom: 2px; }
.trc-ml { position: relative; display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; padding: 5px 8px; border-radius: 8px; overflow: hidden; }
.trc-ml > * { position: relative; z-index: 1; }
.trc-ml span { color: var(--muted2); font-weight: 650; }
.trc-ml b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trc-ml em { font-style: normal; color: var(--ink2); font-weight: 650; }
.trc-ml i { position: absolute !important; left: 0; top: 0; bottom: 0; opacity: .28; z-index: 0 !important; border-radius: 8px; }
.trc-scale { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 11px; color: var(--muted); padding-top: 6px; }
.trc-scale i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.trc-scale.map { justify-content: flex-start; gap: 8px; }
.trc-scale.map b { width: 120px; height: 8px; border-radius: 9px; display: inline-block; }
.trc-scale em { font-style: normal; margin-left: auto; color: var(--muted2); cursor: help; }
.trc-htrack { position: relative; }
.trc-goalmark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #16a34a; border-radius: 2px; }
.trc-progress { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px; }
.trc-prow { border-radius: 10px; }
.trc-ptop { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.trc-ptop span { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trc-ptop b { font-weight: 700; white-space: nowrap; }
.trc-ptop em { font-style: normal; color: var(--muted); font-weight: 500; }
.trc-ptrack { height: 10px; background: #eef0f7; border-radius: 9px; overflow: hidden; }
.trc-ptrack i { display: block; height: 100%; border-radius: 9px; animation: trcBar .9s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
.trc-ppct { font-size: 11.5px; font-weight: 650; margin-top: 4px; }
.trc-kpi-goal { height: 5px; background: #eef0f7; border-radius: 9px; overflow: hidden; margin-top: 8px; }
.trc-kpi-goal i { display: block; height: 100%; border-radius: 9px; }
.trc-kpi-gl { font-size: 11px; color: var(--muted); margin-top: 4px; }
.trc-tsearch { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.trc-tsearch input { flex: 1; height: 32px; border: 1px solid var(--line2); border-radius: 9px; padding: 0 10px; font: inherit; font-size: 13px; outline: none; }
.trc-tsearch input:focus { border-color: #a5a8f6; }
.trc-tsearch span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.trc-table tbody tr[style*="pointer"]:hover td { background: #f5f5ff; }

/* Gráficos más grandes */
.vcard .chart { height: 330px; }
.vcard.h1 .chart { height: 220px; } .vcard.h2 .chart { height: 340px; } .vcard.h3 .chart { height: 460px; } .vcard.h4 .chart { height: 600px; }
.vcard .chart.kpi.trc, .vcard .chart.table.trc { height: auto; }
.chat { max-width: 1240px; }
.composer { max-width: 1240px; }
.modal.full { max-width: min(1500px, 96vw); }
.expand-chart { height: min(72vh, 760px); }

/* Filtros de tablero */
.fbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -4px 0 16px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line2); font-size: 13px; cursor: pointer; }
.fchip b { font-weight: 650; }
.fchip span { color: var(--muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchip button { border: 0; background: #f1f2f8; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.fchip button:hover { background: var(--bad-soft); color: var(--bad); }
.fchip button svg { width: 12px; height: 12px; }
.fchip.on { background: var(--brand-soft); border-color: #c9ccfb; }
.fvals { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.fvals label { display: flex; gap: 9px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.fvals label:hover { background: #f6f7fc; }

/* Editor de gráficos */
.ced { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; }
.ced-side { max-height: 70vh; overflow-y: auto; padding-right: 6px; }
.ced-sec { border-bottom: 1px solid var(--line); padding: 12px 0; }
.ced-sec:first-child { padding-top: 0; }
.ced-sec > b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 10px; }
.ced-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ced-types button { border: 1px solid var(--line2); background: #fff; border-radius: 10px; padding: 8px 4px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; color: var(--ink2); line-height: 1.15; text-align: center; }
.ced-types button svg { width: 18px; height: 18px; color: var(--muted); }
.ced-types button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.ced-types button.on svg { color: var(--brand); }
.ced-gl { font-size: 10.5px; color: var(--muted2); text-transform: uppercase; letter-spacing: .06em; margin: 8px 0 5px; grid-column: 1 / -1; }
.ced .field { margin-bottom: 10px; }
.ced .input { height: 34px; font-size: 13px; }
.ced-pal { display: flex; flex-wrap: wrap; gap: 6px; }
.ced-pal button { border: 2px solid transparent; border-radius: 9px; padding: 3px; background: #fff; cursor: pointer; display: flex; gap: 2px; }
.ced-pal button.on { border-color: var(--brand); }
.ced-pal i { width: 12px; height: 18px; border-radius: 3px; display: block; }
.ced-prev { background: #fbfbfe; border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-width: 0; }
.ced-prev .chart { height: 440px; }
.ced-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.ced-row .input { flex: 1; }
.seg { display: inline-flex; background: #f1f2f8; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 8px; font-size: 12.5px; cursor: pointer; color: var(--ink2); }
.seg button.on { background: #fff; box-shadow: 0 1px 3px rgba(20, 22, 60, .12); color: var(--ink); font-weight: 600; }

/* Modo presentación */
.presenting .side, .presenting .topbar, .presenting .rail, .presenting .no-present { display: none !important; }
.presenting .split { grid-template-columns: 1fr !important; }
.presenting .content { padding: 28px 36px; }
.presenting .main { background: #f6f6fb; }
.present-exit { position: fixed; top: 14px; right: 16px; z-index: 60; }

@media (max-width: 1000px) {
  .ced { grid-template-columns: 1fr; }
  .ced-side { max-height: none; }
  .ced-prev .chart { height: 320px; }
  .trc-map.withlist { flex-direction: column; }
  .trc-map.withlist .trc-mapsvg { width: 100%; }
}
.menu { max-height: calc(100vh - 24px); overflow-y: auto; }
.menu.menu-cols { columns: 2; column-gap: 4px; min-width: 400px; }
.menu.menu-cols > * { break-inside: avoid; }
@media (max-width: 560px) { .menu.menu-cols { columns: 1; min-width: 240px; } }
.trc-center, .trc-center-sub, .trc-val, .trc-tick, .trc-ref-l { pointer-events: none; }


/* ================= 1.1.2 · pulido visual y rendimiento ================= */
/* Íconos: nunca crecen más allá de su caja */
svg.ic { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.ritem > svg.ic, .tbl .acts > svg.ic { width: 16px; height: 16px; color: var(--muted2); }
.chart, .trc { overflow: hidden; contain: layout paint; }
.trc.trc-scroll { overflow: auto; }
.trc-note { font-size: 11.5px; color: var(--muted); text-align: center; padding-top: 4px; }

/* Barras de desplazamiento finas y discretas en toda la app */
* { scrollbar-width: thin; scrollbar-color: #d3d6e6 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d3d6e6; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #b8bcd4; background-clip: padding-box; border: 3px solid transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }
.side ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); background-clip: padding-box; }
.side * { scrollbar-color: rgba(255,255,255,.18) transparent; }
.log-box::-webkit-scrollbar-thumb, .code-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); background-clip: padding-box; }

/* Menús compactos: el de tipos de gráfico cabe sin scroll */
.menu { max-height: min(640px, calc(100vh - 24px)); }
.menu.menu-cols { columns: 3; min-width: 540px; padding: 8px; }
.menu.menu-cols button { padding: 6px 9px; font-size: 13px; }
.menu.menu-cols .mh { padding: 6px 9px 2px; }
@media (max-width: 640px) { .menu.menu-cols { columns: 2; min-width: 0; width: calc(100vw - 24px); } }

/* Editor de gráficos por pestañas, sin scroll largo */
.ced { grid-template-columns: 330px minmax(0, 1fr); align-items: stretch; }
.ced-side { max-height: none; overflow: visible; padding-right: 0; display: flex; flex-direction: column; min-height: 0; }
.ced-tabs { display: flex; gap: 2px; background: #f1f2f8; border-radius: 11px; padding: 3px; margin-bottom: 12px; }
.ced-tabs button { flex: 1; border: 0; background: none; padding: 7px 4px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.ced-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,22,60,.1); }
.ced-pane { display: none; overflow-y: auto; max-height: min(58vh, 520px); padding-right: 4px; }
.ced-pane.on { display: block; }
.ced-sec { border: 0; padding: 0 0 12px; }
.ced-types { grid-template-columns: repeat(5, 1fr); gap: 5px; }
.ced-types button { padding: 7px 2px 5px; font-size: 10px; }
.ced-types button svg { width: 16px; height: 16px; }
.ced-prev { display: flex; flex-direction: column; }
.ced-prev .chart { height: auto; flex: 1; min-height: 360px; max-height: 520px; }
@media (max-width: 1000px) { .ced-pane { max-height: none; } .ced-prev .chart { min-height: 300px; } }

/* Modales: el contenido no rebasa la ventana */
.modal { max-height: calc(100vh - 8vh - 16px); display: flex; flex-direction: column; }
.modal-b { overflow-y: auto; min-height: 0; }
.modal-bg { align-items: flex-start; }

/* Rendimiento: menos trabajo de pintado */
.vcard, .card, .stat, .dtile { will-change: auto; }
@media (prefers-reduced-motion: reduce) { .trc *, .trc { animation: none !important; } }

/* Espacios de trabajo administrables */
.side-sec .sec-acts { display: flex; gap: 2px; }
.side-sec button { width: 24px; height: 24px; display: grid; place-items: center; }
.side-sec button svg { width: 15px; height: 15px; }
.side-space { position: relative; }
.side-space .sp-more { margin-left: auto; opacity: 0; border: 0; background: none; color: #9ca1c4; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; cursor: pointer; flex: none; }
.side-space .sp-more svg { width: 16px; height: 16px; }
.side-space:hover .sp-more, .side-space.on .sp-more { opacity: 1; }
.side-space .sp-more:hover { background: rgba(255,255,255,.1); color: #fff; }
@media (hover: none) { .side-space .sp-more { opacity: .7; } }
.sp-list .ritem { cursor: grab; }
.sp-list .ritem.dragging { opacity: .4; }
.sp-list .ritem .grip { color: var(--muted2); display: grid; }

.drop { display: block; }
.save-bar { position: sticky; bottom: 0; z-index: 5; max-width: 820px; display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px; margin-top: 4px; background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -6px 24px rgba(20,22,60,.06); }
.trc-hbars { min-height: 100%; justify-content: space-evenly; }

.ced-types button { padding: 5px 2px 4px; gap: 2px; min-height: 46px; justify-content: center; }
.ced-gl { margin: 6px 0 3px; }
.ced-pane { max-height: min(64vh, 580px); }
@media (max-width: 560px) {
  .sp-list .ritem { gap: 8px; padding: 10px; }
  .sp-list .ritem .grip, .sp-list .ritem a.btn { display: none; }
  .sp-list .ritem [data-e] { font-size: 0; gap: 0; width: 28px; padding: 0; justify-content: center; }
  .composer-box textarea { font-size: 14px; }
}
@media (max-width: 860px) {
  .page-h > .row { flex-wrap: wrap; width: 100%; }
  .page-h > .row .input { flex: 1; width: auto !important; min-width: 0; }
  .split { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Modo presentación en pestaña propia */
.presenting .content { padding: 0 !important; }
.presenting .main { background: #f4f5fa; }
.pres-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 28px; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); transition: transform .3s, opacity .3s; }
.pres-bar.idle { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.pres-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pres-l img { width: 32px; height: 32px; flex: none; }
.pres-l b { display: block; font-size: 19px; font-weight: 720; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pres-l small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pres-r { display: flex; align-items: center; gap: 8px; flex: none; }
.pres-auto { font-size: 12.5px; color: var(--ink2); margin-right: 6px; }
.pres-body { padding: 24px 28px 40px; }
.presenting .vcard .chart { height: 380px; }
.presenting .vcard.h1 .chart { height: 240px; } .presenting .vcard.h3 .chart { height: 520px; } .presenting .vcard.h4 .chart { height: 680px; }
.presenting .vcard .chart.kpi.trc, .presenting .vcard .chart.table.trc { height: auto; }
.presenting .vcard-h h4 { font-size: 16px; }
.presenting .trc-kpi-v { font-size: 30px; }
.presenting .vact { display: none; }
.pres-hint { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px 10px 10px; box-shadow: var(--shadow-l); font-size: 13px; color: var(--muted); }
.pres-hint kbd { background: #f1f2f8; border: 1px solid var(--line2); border-radius: 6px; padding: 1px 7px; font: 600 12px var(--font); color: var(--ink); }
:fullscreen .pres-body { padding-top: 20px; }
@media (max-width: 860px) { .pres-bar { flex-wrap: wrap; padding: 12px 14px; } .pres-auto { display: none; } .pres-body { padding: 14px; } .pres-hint { display: none; } }

/* ===== 1.2 Conectores ===== */
.src-type.mono b { font-size: 12.5px; font-weight: 800; letter-spacing: -.02em; }
.src-top { position: sticky; top: -20px; z-index: 2; background: #fff; padding: 0 0 12px; margin-top: -4px; }
.search-in { position: relative; }
.search-in > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search-in .input { padding-left: 38px; }
.src-cats { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.src-cats::-webkit-scrollbar { display: none; }
.src-cats .chip { height: 30px; padding: 0 12px; flex: none; }
.src-gal section { margin-top: 14px; }
.src-gal h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 0 0 8px; }
.src-gal .src-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.src-gal .src-pick { padding: 13px 14px; gap: 8px; }
.src-gal .src-pick .src-type { width: 34px; height: 34px; border-radius: 10px; }
.src-gal .src-pick .src-type svg { width: 18px; height: 18px; }
.src-gal .src-pick > span:not(.row) { line-height: 1.4; }
.src-gal .src-pick .badge { font-size: 10.5px; }
.src-note { font-size: 11.5px; color: #b45309; font-style: normal; }
.ftypes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.ftypes div { background: #f8f9fd; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; line-height: 1.4; }
.ftypes b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.ftypes span { color: var(--muted); }
.cf-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.cf-head b { display: block; font-size: 15px; }
.cf-head span:not(.src-type) { font-size: 12.5px; color: var(--muted); }
.cf-help { align-items: flex-start; line-height: 1.5; }
.cf-help svg { margin-top: 1px; }
.cf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.cf-grid .field.w2 { grid-column: span 2; } .cf-grid .field.w3 { grid-column: 1 / -1; }
.cf-grid .req { color: #e11d48; }
.cf-grid textarea.input { resize: vertical; min-height: 64px; }
.chk-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chk { display: inline-flex; cursor: pointer; }
.chk input { position: absolute; opacity: 0; pointer-events: none; }
.chk span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line2); font-size: 13px; color: var(--ink2); background: #fff; transition: .15s; }
.chk span::before { content: ''; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid #c3c6dc; transition: .15s; }
.chk input:checked + span { background: var(--brand-soft); border-color: #c9ccfb; color: var(--brand); font-weight: 600; }
.chk input:checked + span::before { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5'%3E%3Cpath d='M5 12l5 5L19 8'/%3E%3C/svg%3E") center/10px no-repeat; border-color: var(--brand); }
.chk input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row .code-box { flex: 1; min-width: 0; }
.code-box.muted { color: #9aa0c3; }
.code-pre { background: #0f1226; color: #e6e8f7; border-radius: 0 0 12px 12px; padding: 14px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.55; overflow-x: auto; white-space: pre; margin: 0; }
.banner.ok-b { background: #ecfdf3; color: #166534; border-color: #c8f0d6; }
@media (max-width: 700px) {
  .cf-grid { grid-template-columns: 1fr; }
  .cf-grid .field.w2 { grid-column: auto; }
  .ftypes { grid-template-columns: 1fr; }
  .src-gal .src-grid { grid-template-columns: 1fr; }
  .copy-row { flex-wrap: wrap; }
}
.conn-card { margin-bottom: 14px; padding: 6px 0; }
.conn-gh { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px 8px; }
.conn-gh h3 { font-size: 14px; }
.conn-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); transition: opacity .15s; }
.conn-info b { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.conn-info span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conn-row.off .src-type, .conn-row.off .conn-info, .conn-row.off .conn-plans { opacity: .45; }
.conn-plans .chk span { height: 28px; padding: 0 10px; font-size: 12px; }
.chk.dim span { border-style: dashed; }
@media (max-width: 760px) {
  .conn-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .conn-plans { grid-column: 2 / -1; grid-row: 2; }
  .conn-info span { white-space: normal; }
}

/* ===== 1.3 Gobierno de datos ===== */
.tabs a svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 2px; }
.layer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.lcard { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: .15s; position: relative; overflow: hidden; }
.lcard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.lcard.on { border-color: color-mix(in srgb, var(--tone) 35%, #fff); box-shadow: var(--shadow); }
.lcard.on::before { background: var(--tone); }
.lc-top { display: flex; align-items: center; gap: 12px; }
.lc-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--tone) 12%, #fff); color: var(--tone); }
.lc-ic svg { width: 20px; height: 20px; }
.lc-top small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--tone); font-weight: 700; }
.lc-top h3 { font-size: 15.5px; margin-top: 1px; }
.lcard p { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; flex: 1; }
.lc-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--ink2); border-top: 1px solid var(--line); padding-top: 10px; min-height: 38px; }
.lc-foot .btn svg { width: 14px; height: 14px; margin: 0 -2px 0 4px; }
.lopt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink2); background: #f8f9fd; border-radius: 10px; padding: 8px 10px; }
.lopt > label:not(.check) { font-weight: 600; }
.input.sm { height: 32px; padding: 0 10px; font-size: 13px; width: auto; }
.sem-sec { margin-bottom: 14px; padding: 4px 0; }
.sem-h { display: flex; gap: 12px; align-items: center; padding: 14px 18px 10px; }
.sem-h h3 { font-size: 14.5px; } .sem-h h3 .muted { font-weight: 500; }
.sem-h small { font-size: 12px; color: var(--muted); }
.sem-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.sem-ic svg { width: 17px; height: 17px; }
.sem-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-top: 1px solid var(--line); }
.sem-row b { font-size: 14px; }
.sem-body { margin-top: 5px; line-height: 1.7; }
.sem-code, .sem-row code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: #f3f4fb; border-radius: 6px; padding: 2px 6px; color: #3730a3; word-break: break-word; }
.sem-empty { padding: 12px 18px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.6; }
.sem-empty code { font-size: 12px; background: #f3f4fb; border-radius: 6px; padding: 1px 5px; }
.chips-s { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chips-s span { font-size: 11.5px; background: #f1f2f8; color: var(--ink2); border-radius: 999px; padding: 2px 9px; }
.qx { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.qx .chip, .sugg .chip { height: 26px; padding: 0 10px; font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.sugg .chip { font-family: inherit; }
.sugg .chip small { color: var(--muted); font-size: 10.5px; }
.colchips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; align-items: center; }
.colchip { border: 1px solid var(--line2); background: #fff; border-radius: 6px; font-size: 11.5px; padding: 2px 7px; cursor: pointer; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink2); }
.colchip:hover { border-color: var(--brand); color: var(--brand); }
.colchip.t-integer, .colchip.t-real { border-left: 3px solid #16a34a; } .colchip.t-date, .colchip.t-datetime { border-left: 3px solid #0ea5e9; }
.sem-test { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #f8f9fd; border-radius: 12px; padding: 10px 12px; }
.ok-t { color: #166534; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; } .ok-t svg { width: 15px; height: 15px; }
.rel-grid { display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; gap: 0 10px; align-items: end; }
.rel-eq { font-size: 18px; font-weight: 700; color: var(--muted); padding-bottom: 22px; }
.tagbox { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line2); border-radius: 10px; padding: 6px 8px; min-height: 42px; background: #fff; cursor: text; }
.tagbox:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.tagbox input { border: 0; outline: 0; flex: 1; min-width: 140px; font: inherit; font-size: 13.5px; background: transparent; }
.tag { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-soft); color: var(--brand); border-radius: 7px; padding: 3px 4px 3px 9px; font-size: 12.5px; font-weight: 600; }
.tag button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; border-radius: 5px; }
.tag button:hover { background: rgba(79,70,229,.12); }
.sugg { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; max-height: 120px; overflow: auto; }
.gv-av { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.cert-g { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 12px 18px 4px; border-top: 1px solid var(--line); }
.cert-row { display: flex; align-items: center; gap: 12px; padding: 9px 18px; border-top: 1px solid var(--line); }
.cert-g + .cert-row { border-top: 0; }
.cert-row b { display: flex; align-items: center; gap: 6px; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cert-row small { display: block; font-size: 12px; color: var(--muted); }
.cert-ic { color: #16a34a; display: inline-flex; vertical-align: -3px; } .cert-ic svg { width: 16px; height: 16px; }
.audit-f { display: grid; grid-template-columns: minmax(200px, 1fr) repeat(3, minmax(130px, 180px)) auto; gap: 8px; margin-bottom: 12px; }
.audit-sql { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--ink2); display: block; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl.audit td { vertical-align: top; }
.vmetric { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: #166534; background: #ecfdf3; border-radius: 999px; padding: 3px 10px; margin: 6px 0 0; align-self: flex-start; }
.vmetric svg { width: 13px; height: 13px; }
@media (max-width: 860px) {
  .cert-grid { grid-template-columns: 1fr; }
  .audit-f { grid-template-columns: 1fr 1fr; }
  .audit-f .search-in { grid-column: 1 / -1; }
  .rel-grid { grid-template-columns: 1fr 1fr; }
  .rel-eq { display: none; }
  .layer-grid { grid-template-columns: 1fr; }
}

/* ===== 1.4 Motor: tiempo, analítica y matriz ===== */
.trc-grain { position: absolute; top: 0; right: 0; z-index: 3; display: flex; gap: 1px; background: rgba(241, 242, 248, .92); border-radius: 8px; padding: 2px; opacity: .75; transition: opacity .15s; }
.trc:hover .trc-grain { opacity: 1; }
.trc-grain button { border: 0; background: none; font: 600 10.5px Inter, system-ui, sans-serif; color: #7a7f9e; padding: 3px 7px; border-radius: 6px; cursor: pointer; }
.trc-grain button:hover { color: var(--ink); }
.trc-grain button.on { background: #fff; color: var(--brand); box-shadow: 0 1px 2px rgba(20, 22, 60, .12); }
.trc-an { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 2px 0; font-size: 11.5px; color: var(--ink2); line-height: 1.35; }
.trc-an-i { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trc-an-i i { width: 10px; height: 3px; border-radius: 2px; flex: none; }
.trc-an-i.k-trend i { height: 0; border-top: 2px dotted currentColor; background: none !important; color: #4338ca; }
.trc-an-i.k-fc i { height: 0; border-top: 2px dashed #6366f1; background: none !important; }
.trc-an-i.k-anom i { width: 8px; height: 8px; border-radius: 50%; }
.trc-an-i em { font-style: normal; color: var(--muted); }
.trc-fc-l { font: 600 10px Inter, system-ui, sans-serif; fill: #a3a7c2; }
.trc-tip-anom { margin-top: 4px; color: #fda4af; font-weight: 600; font-size: 11.5px; }
.trc-mx-wrap { max-height: 520px; }
.trc-mx { font-size: 12.5px; }
.trc-mx th { cursor: pointer; }
.trc-mx th.trc-mx-cg { text-align: center; border-left: 1px solid var(--line); }
.trc-mx thead { position: sticky; top: 0; z-index: 5; }
.trc-mx thead th { position: relative; }
.trc-mx thead th.trc-mx-dim { position: sticky; left: 0; }
.trc-mx .trc-mx-dim, .trc-mx td.trc-mx-l { position: sticky; left: 0; z-index: 2; background: #fff; min-width: 160px; max-width: 280px; }
.trc-mx thead .trc-mx-dim { background: #f7f8fc; z-index: 4; cursor: default; }
.trc-mx td.trc-mx-l { display: table-cell; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trc-mx td.trc-mx-l span { cursor: inherit; }
.trc-mx td.trc-mx-l em { font-style: normal; font-size: 10.5px; color: var(--muted); margin-left: 6px; }
.trc-mx-tg { border: 0; background: #eef0f8; color: var(--ink2); width: 18px; height: 18px; border-radius: 5px; font-size: 10px; line-height: 18px; padding: 0; margin-right: 6px; cursor: pointer; vertical-align: 1px; }
.trc-mx-tg:hover { background: var(--brand-soft); color: var(--brand); }
.trc-mx-sp0 { display: inline-block; width: 24px; }
.trc-mx tr.grp td { font-weight: 650; background: #fafbfe; }
.trc-mx tr.grp.l0 td { background: #f4f5fb; }
.trc-mx tr.grp.l0 td.trc-mx-l { background: #f4f5fb; } .trc-mx tr.grp td.trc-mx-l { background: #fafbfe; }
.trc-mx .trc-mx-tot { font-weight: 650; background: #f9f9fd; border-left: 1px solid var(--line); }
.trc-mx tfoot { position: sticky; bottom: 0; z-index: 4; }
.trc-mx tfoot td { background: #eef0fa !important; font-weight: 700; border-top: 1px solid #dfe2f2; }
.trc-mx tfoot td.trc-mx-l { position: sticky; left: 0; z-index: 3; }
.trc-mx .trc-mx-sp { width: 90px; text-align: center; cursor: default; }
.trc-mx td.trc-mx-sp svg { display: block; margin: 0 auto; }
.trc-ic { font-style: normal; font-size: 9px; margin-right: 6px; position: relative; z-index: 1; vertical-align: 1px; }
.trc-ic.up { color: #16a34a; } .trc-ic.down { color: #e11d48; } .trc-ic.mid { color: #f59e0b; }
.trc-mx-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.trc-mx-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trc-mx-bar button { border: 1px solid var(--line2); background: #fff; border-radius: 8px; font-size: 11.5px; padding: 3px 9px; cursor: pointer; color: var(--ink2); }
.trc-mx-bar button:hover { border-color: var(--brand); color: var(--brand); }
.an-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; transition: .15s; }
.an-opt:hover { border-color: #c9ccfb; }
.an-opt:has(input:checked) { border-color: #c9ccfb; background: var(--brand-soft); }
.an-opt input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.an-opt span { flex: 1; min-width: 0; }
.an-opt b { display: block; font-size: 13px; }
.an-opt small { display: block; font-size: 11.5px; color: var(--muted); }
.an-opt select { width: 64px !important; flex: none; }

/* ===== 1.5 Marca, páginas y usuarios ===== */
.brand-logo { display: block; height: auto; width: auto; object-fit: contain; }
.side-brand.has-logo { justify-content: flex-start; }
.side-brand .brand-logo { height: 36px; max-width: 190px; }
.side-brand .brand-logo.on-plate, .brand-logo.on-plate { background: #fff; padding: 5px 10px; border-radius: 10px; box-sizing: content-box; height: 28px; }
.auth-logo .brand-logo { height: 44px; max-width: 220px; }
.auth-logo .brand-ic { width: 34px; height: 34px; }
.pub-brand .brand-logo { height: 32px; max-width: 180px; }
.pub-brand .brand-ic { width: 30px; height: 30px; }
.pub-brand .brand-name { font-size: 19px; letter-spacing: -.02em; }
.rp-logo { height: 34px; max-width: 200px; object-fit: contain; }
.logo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.logo-slot { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.logo-prev { height: 84px; border-radius: 10px; display: grid; place-items: center; background: repeating-conic-gradient(#f3f4f9 0 25%, #fff 0 50%) 0 0 / 16px 16px; border: 1px dashed var(--line2); overflow: hidden; }
.logo-slot.dark .logo-prev { background: #0f1226; border-color: #0f1226; }
.logo-prev img { max-height: 60px; max-width: 86%; object-fit: contain; }
.logo-slot b { font-size: 13.5px; }
.logo-slot .small { line-height: 1.4; min-height: 34px; }
.logo-slot label.btn { cursor: pointer; }
.pg-ed { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; height: min(70vh, 720px); }
.pg-ed-l { display: flex; flex-direction: column; min-height: 0; }
.pg-txt { flex: 1; min-height: 260px; resize: none; font-size: 12.5px; line-height: 1.6; }
.pg-ed-r { border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; overflow: auto; background: #fff; }
.pg-tools { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; align-items: center; }
.pg-tools button { border: 1px solid var(--line2); background: #fff; border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.pg-tools button svg { width: 13px; height: 13px; }
.pg-tools .grow { flex: 1; }
.legal-doc { font-size: 15px; line-height: 1.7; color: #2b2f52; }
.legal-doc h1 { font-size: 30px; letter-spacing: -.02em; margin: 0 0 6px; color: var(--ink); }
.legal-doc h2 { font-size: 19px; margin: 28px 0 8px; color: var(--ink); }
.legal-doc h3 { font-size: 16px; margin: 20px 0 6px; }
.legal-doc p { margin: 0 0 12px; }
.legal-doc ul, .legal-doc ol { margin: 0 0 14px; padding-left: 22px; }
.legal-doc li { margin-bottom: 4px; }
.legal-doc a { color: var(--brand); }
.legal-doc blockquote { margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 10px 10px 0; }
.legal-doc hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.legal-ok { font-size: 12.5px; color: var(--muted); margin: 4px 0 12px; line-height: 1.5; }
.legal-ok a, .auth-foot a { color: inherit; text-decoration: underline; }
@media (max-width: 860px) { .logo-grid { grid-template-columns: 1fr; } .pg-ed { grid-template-columns: 1fr; height: auto; } .pg-ed-r { max-height: 320px; } }
.side-brand img.brand-logo, .auth-logo img.brand-logo, .s-logo img.brand-logo, .report .rp-brand img.rp-logo, .pub-brand img.brand-logo { width: auto; }

/* ---------- 1.6 Ejes, jerarquías y anotaciones ---------- */
.trc-scale-l { font-size: 10px; fill: var(--muted2); font-style: italic; }
.trc-tick2 { fill: #8a8fb0; }
.trc-axis2 { stroke: #e3e5f0; }
.trc-break-band { fill: #fff; }
.trc-break-z { stroke: #b6b9d3; stroke-width: 1.4; }
.trc-note-ln { stroke: #9aa0c3; stroke-width: 1; stroke-dasharray: 2 2; }
.trc-note-pt { fill: #fff; stroke-width: 2.2; }
.trc-note-bx { fill: #1b1e3a; opacity: .92; }
.trc-note-t { font-size: 11px; font-weight: 600; fill: #fff; }
.trc-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--muted); padding: 0 0 6px; min-height: 22px; line-height: 1.2; }
.trc-crumbs button { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; padding: 2px 4px; border-radius: 6px; cursor: pointer; }
.trc-crumbs button:hover { background: #eef0ff; }
.trc-crumbs b { color: var(--ink); font-weight: 650; padding: 2px 2px; }
.trc-crumbs .trc-up { width: 22px; height: 22px; display: inline-grid; place-items: center; border: 1px solid var(--line2); background: #fff; padding: 0; font-size: 13px; }
.trc-crumbs em { font-style: normal; color: var(--muted2); margin-left: 6px; }
.trc-crumbs .trc-lv { font-weight: 600; color: var(--muted); }
.trc-crumbs .trc-lv + em::before { content: '· '; }
.trc-crumbs.tm { padding-right: 230px; }

/* ---------- 1.6 Tablero libre ---------- */
.dgrid.pos { grid-auto-rows: 40px; gap: 16px; position: relative; }
.dgrid.pos > .vcard { min-height: 0; overflow: hidden; }
.dgrid.pos > .vcard.gp .chart, .presenting .dgrid.pos > .vcard.gp .chart { height: auto !important; flex: 1 1 auto; min-height: 0; }
.dgrid.pos > .vcard.gp .chart.kpi, .dgrid.pos > .vcard.gp .chart.table { overflow: auto; }
.dgrid.pos > .vcard .vnote { max-height: 3.2em; overflow: hidden; }
.dgrid.busy { opacity: .55; pointer-events: none; transition: opacity .2s; }
.dgrid.editing > .vcard { cursor: grab; outline: 2px dashed #d5d8fb; outline-offset: -1px; user-select: none; touch-action: none; }
.dgrid.editing > .vcard:hover { outline-color: #a5abf8; }
.dgrid.editing > .vcard .chart, .dgrid.editing > .vcard .wtext, .dgrid.editing > .vcard .wimg { pointer-events: none; }
.dgrid.editing > .vcard.moving { z-index: 20; cursor: grabbing; box-shadow: 0 18px 40px rgba(20, 22, 60, .22); opacity: .92; }
.dgrid.editing > .vcard.sizing { z-index: 20; }
.dgrid.pos > .ph { border: 2px dashed var(--brand); background: rgba(99, 102, 241, .07); border-radius: var(--radius); pointer-events: none; }
.vcard .rz { display: none; position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; cursor: nwse-resize; z-index: 4; border-right: 3px solid var(--brand); border-bottom: 3px solid var(--brand); border-radius: 0 0 8px 0; }
.dgrid.editing .vcard .rz { display: block; }
.vcard .ed-size { display: none; position: absolute; left: 10px; bottom: 8px; font-size: 11px; font-weight: 600; color: var(--brand); background: #eef0ff; padding: 1px 7px; border-radius: 6px; z-index: 4; }
.dgrid.editing .vcard:hover .ed-size, .dgrid.editing .vcard.sizing .ed-size, .dgrid.editing .vcard.moving .ed-size { display: block; }
@media (max-width: 860px) {
  .dgrid.pos { grid-auto-rows: auto; }
  .dgrid.pos > .vcard { grid-column: 1 / -1 !important; grid-row: auto !important; height: min(560px, calc(var(--gh) * 40px + (var(--gh) - 1) * 16px)); }
  .dgrid.pos > .vcard.wk-div { height: auto; }
}
/* Widgets de contenido */
.vact.float { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; background: rgba(255, 255, 255, .94); border-radius: 10px; padding: 2px; box-shadow: 0 2px 10px rgba(20, 22, 60, .08); z-index: 3; }
.vcard:hover .vact.float { opacity: 1; }
.vact.float:empty { display: none; }
.wk-text .wtext { padding: 14px 20px 16px; overflow: auto; flex: 1; min-height: 0; }
.wk-text .vcard-h + .wtext { padding-top: 4px; }
.md-doc { font-size: 14px; line-height: 1.6; color: var(--ink2); }
.md-doc > :first-child { margin-top: 0; }
.md-doc p { margin: 0 0 10px; }
.md-doc h2 { font-size: 19px; margin: 6px 0 8px; color: var(--ink); }
.md-doc h3 { font-size: 16px; margin: 6px 0 6px; color: var(--ink); }
.md-doc h4 { font-size: 14px; margin: 4px 0 4px; color: var(--ink); }
.md-doc ul, .md-doc ol { margin: 0 0 10px; padding-left: 20px; }
.md-doc a { color: var(--brand); font-weight: 600; }
.md-doc hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.md-doc blockquote { margin: 0 0 10px; padding: 6px 12px; border-left: 3px solid var(--brand); background: #f6f7ff; border-radius: 0 8px 8px 0; }
.md-doc code { background: #f1f2f8; padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.wk-img { overflow: hidden; }
.wk-img .wimg { flex: 1; min-height: 0; padding: 10px; display: flex; }
.wk-img .vcard-h + .wimg { padding-top: 2px; }
.wk-img .wimg a { display: flex; width: 100%; height: 100%; }
.wk-img .wimg img { width: 100%; height: 100%; border-radius: 10px; display: block; }
.wimg-empty { margin: auto; color: var(--muted2); font-size: 13px; }
.vcard.wk-div { background: transparent; border: 0; box-shadow: none; justify-content: flex-end; overflow: visible; }
.wdiv-in { display: flex; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--line2); padding: 0 2px 6px; }
.wdiv-in h3 { font-size: 17px; font-weight: 720; color: var(--ink); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wdiv-in span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dgrid.editing .vcard.wk-div { background: rgba(255, 255, 255, .6); }
/* Pestañas */
.dtabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 14px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.dtabs button { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); padding: 10px 14px 9px; border-bottom: 2.5px solid transparent; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; margin-bottom: -1px; }
.dtabs button:hover { color: var(--ink); }
.dtabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.dtabs button i { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; }
.dtabs button i:hover { background: #eef0ff; }
.dtabs button i svg { width: 14px; height: 14px; }
.dtabs .dt-add { color: var(--brand); padding: 8px 10px; }
/* Parámetros de escenario */
.pbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: -6px 0 16px; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.pbar .pb-l { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 13px; color: var(--ink); }
.pbar .pb-l svg { width: 16px; height: 16px; color: var(--brand); }
.pctl { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink2); }
.pctl input[type=range] { width: 150px; accent-color: var(--brand); }
.pctl b { min-width: 54px; font-variant-numeric: tabular-nums; color: var(--ink); }
.pctl.chg b { color: #c2410c; }
.ptable { display: grid; gap: 6px; margin-bottom: 12px; }
.pt-h, .pt-r { display: grid; grid-template-columns: 1.4fr 1.3fr .7fr .7fr .6fr .7fr .9fr 32px; gap: 6px; align-items: center; }
.pt-h { font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 0 2px; }
.pt-id { font-size: 12px; background: #f1f2f8; padding: 6px 8px; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .pt-h { display: none; } .pt-r { grid-template-columns: 1fr 1fr; padding-bottom: 8px; border-bottom: 1px solid var(--line); } }
/* Filtro deslizador */
.dslider { position: relative; height: 34px; margin: 4px 6px 12px; }
.dslider .ds-track { position: absolute; left: 0; right: 0; top: 15px; height: 5px; border-radius: 5px; background: #e6e8f3; }
.dslider .ds-fill { position: absolute; top: 0; bottom: 0; background: var(--brand); border-radius: 5px; }
.dslider input[type=range] { position: absolute; left: 0; right: 0; top: 6px; width: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; height: 24px; }
.dslider input[type=range]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 2px 6px rgba(20, 22, 60, .2); cursor: pointer; }
.dslider input[type=range]::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); cursor: pointer; }
.dslider input[type=range]::-webkit-slider-runnable-track { background: none; }
/* Vista temporal, editores */
.banner.view-banner { background: #fff7ed; border-color: #fed7aa; color: #7c2d12; }
.banner.view-banner svg { color: #ea580c; }
.txt-ed { align-items: start; }
.txt-ed textarea { font-family: ui-monospace, Menlo, monospace; font-size: 13px; min-height: 260px; }
.txt-prev { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; min-height: 290px; max-height: 420px; overflow: auto; background: #fcfcff; }
.md-tools { display: flex; gap: 4px; margin-bottom: 6px; }
.md-tools button { width: 30px; height: 28px; border: 1px solid var(--line2); background: #fff; border-radius: 7px; cursor: pointer; display: inline-grid; place-items: center; font-size: 13px; }
.md-tools button svg { width: 14px; height: 14px; }
.img-ed { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.img-prev { border: 1px dashed var(--line2); border-radius: 12px; min-height: 260px; display: flex; align-items: center; justify-content: center; background: #fafbff; overflow: hidden; }
.img-prev img { width: 100%; height: 300px; }
@media (max-width: 760px) { .img-ed { grid-template-columns: 1fr; } }
.fvals label .ord { font-style: normal; color: var(--brand); font-weight: 650; margin-left: 2px; }
.pres-l img.pres-logo { width: auto; max-width: 180px; height: 32px; object-fit: contain; }
.chip.xs { height: 24px; padding: 0 9px; font-size: 12px; font-family: ui-monospace, Menlo, monospace; }
@media (max-width: 860px) {
  .dgrid.pos > .vcard:has(.chart.kpi), .dgrid.pos > .vcard:has(.chart.table), .dgrid.pos > .vcard.wk-text { height: auto; }
  .dgrid.pos > .vcard.wk-text .wtext { overflow: visible; }
}
@media (max-width: 560px) { .pub-top .hide-sm { display: none; } }

/* ---------- 1.7 Mapas ---------- */
.trc-map-st path { fill: none; stroke: #9aa0c8; stroke-width: .6; pointer-events: none; vector-effect: non-scaling-stroke; }
.trc-base { fill: #eef0f7; stroke: #fff; stroke-width: .7; vector-effect: non-scaling-stroke; }
.trc-base.thin { stroke-width: .35; }
.trc-pt { transition: fill-opacity .15s; }
.trc-pt:hover { fill-opacity: 1; stroke: #1b1e3a; }
.trc-hex:hover { stroke: #1b1e3a; }
.trc-map.pts { display: block; }
.trc-map .trc-canvas { position: absolute; left: 0; top: 0; }
.trc-scale .trc-src { margin-left: auto; color: var(--muted2); font-size: 10.5px; }
/* ---------- 1.7 Nuevos tipos ---------- */
.trc-tick.strong { fill: var(--ink2); font-weight: 600; }
.trc-tick.small { font-size: 10px; }
.trc-sb-l { font-size: 10.5px; font-weight: 600; fill: #fff; pointer-events: none; }
.trc-sb-up { font-size: 11px; fill: var(--brand); font-weight: 600; pointer-events: none; }
.trc-word { font-family: Inter, Arial, sans-serif; font-weight: 700; cursor: default; transition: opacity .15s; }
.trc-word:hover { opacity: .75; }
.trc-slope:hover line { stroke-width: 3.6; }
.trc-facets { display: grid; gap: 10px 14px; }
.trc-facet { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 2px; }
.trc-facet-h { font-size: 12px; font-weight: 650; color: var(--ink2); padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trc.trc-auto .trc-facets { margin-bottom: 4px; }

/* ---------- 1.8 Alertas y notificaciones ---------- */
.bell { position: relative; flex: none; }
.bell .bell-n { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px var(--bg); }
.notif-panel { position: fixed; z-index: 80; width: min(380px, calc(100vw - 16px)); max-height: min(520px, calc(100vh - 90px)); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-l); overflow: hidden; }
.np-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.np-h a { font-size: 12.5px; color: var(--brand); font-weight: 600; }
.np-b { overflow: auto; }
.np-i { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.np-i:hover { background: var(--bg2); }
.np-i.new { background: #fff7f8; }
.np-i .ai { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.np-i .ai svg { width: 16px; height: 16px; }
.np-i b { display: block; font-size: 13.5px; }
.np-i small { display: block; color: var(--ink2); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.np-i em { display: block; font-style: normal; color: var(--muted2); font-size: 11.5px; margin-top: 4px; }
.np-empty { padding: 28px 22px; text-align: center; color: var(--muted); font-size: 13px; }
.np-empty svg { width: 26px; height: 26px; color: var(--muted2); }
.alert-rule { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; font-size: 14px; }
.alert-rule > span:first-child { font-weight: 650; color: var(--ink); }
.alert-rule .input { width: auto; min-width: 120px; flex: 1 1 140px; }
.alert-rule .ar-v { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 120px; }
.alert-rule .ar-v em { font-style: normal; color: var(--muted); font-weight: 600; }
details.adv summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 13px; }
/* ---------- 1.8 Inserción ---------- */
.embed-body { background: var(--bg); }
.embed-wrap { padding: 14px 14px 18px; max-width: 1400px; margin: 0 auto; }
.embed-title { font-size: 20px; margin: 2px 2px 14px; }
.embed-foot { text-align: right; font-size: 11px; color: var(--muted2); margin-top: 10px; }
.code-wrap { position: relative; }
.code-wrap pre { white-space: pre-wrap; word-break: break-all; font-size: 12px; max-height: 220px; overflow: auto; margin: 0; padding-right: 86px; }
.code-wrap [data-copy] { position: absolute; top: 8px; right: 8px; }
.tabs.sm a { font-size: 12.5px; padding: 6px 10px; }

/* ---------- 1.8 Accesibilidad ---------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; transition: top .15s; }
.skip:focus { top: 12px; }
.content:focus { outline: none; }
.trc:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 8px; }
.trc .trc-kfocus { stroke: var(--ink) !important; stroke-width: 2.5px !important; paint-order: stroke; }
.trc .trc-hrow.trc-kfocus, .trc .trc-mx-l span.trc-kfocus { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.btn:focus-visible, .chip:focus-visible, .menu button:focus-visible, a:focus-visible, .dtabs button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.menu button:focus { background: var(--bg2); }
.vcard .chart > * { animation: trcFade .28s ease-out; }
@keyframes trcFade { from { opacity: .35; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .vcard .chart > * { animation: none; } .skip { transition: none; } }


/* ---------- Fuentes de un análisis ---------- */
.composer { position: relative; }
.scope-row { display: flex; align-items: center; gap: 10px; margin: 0 0 8px 4px; }
.scope-btn { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px 0 9px; border-radius: 999px; border: 1px solid var(--line2); background: #fff; color: var(--ink2); font-size: 12.5px; cursor: pointer; max-width: 70%; box-shadow: 0 2px 8px rgba(20, 22, 60, .05); }
.scope-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-btn svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.scope-btn:hover { border-color: #c5c8f3; color: var(--brand); }
.scope-btn.on { background: var(--brand-soft); border-color: #c9ccfb; color: var(--brand); }
.scope-btn.on svg { color: var(--brand); }
.scope-hint { color: var(--muted2); }
kbd { display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; background: #fff; font: 600 11px/16px var(--font); color: var(--ink2); text-align: center; }
.mention { position: absolute; left: 0; bottom: calc(100% - 34px); width: min(420px, 100%); max-height: 330px; overflow: auto; background: #fff; border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow-l); padding: 6px; z-index: 5; }
.mention-h { padding: 6px 10px 4px; }
.mention button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 10px; cursor: pointer; color: var(--ink); }
.mention button.on, .mention button:hover { background: var(--brand-soft); }
.mention button b { display: block; font-size: 13.5px; font-weight: 600; }
.mention button small, .sp-item small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-mode { width: 100%; }
.sp-mode button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; font-size: 13px; }
.sp-mode button svg { width: 15px; height: 15px; }
.sp-help { margin: 10px 2px 12px; }
.sp-tools { display: flex; gap: 8px; }
.sp-tools .input { flex: 1; }
.sp-bar { display: flex; gap: 6px; align-items: center; margin: 10px 2px 6px; color: var(--muted); }
.sp-list { max-height: min(46vh, 380px); overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.sp-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.sp-item:hover { background: #f7f7fc; }
.sp-item.on { background: var(--brand-soft); }
.sp-item b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-item input { flex: none; accent-color: var(--brand); width: 16px; height: 16px; }
.scope-auto { display: flex; gap: 10px; align-items: flex-start; background: #f7f7ff; border: 1px solid #e6e8fb; border-radius: 12px; padding: 10px 12px; }
.scope-auto svg { flex: none; width: 18px; height: 18px; color: var(--brand); margin-top: 1px; }
.scope-auto p { margin: 0; color: var(--ink2); }
.used-src { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); }
.used-src svg { width: 14px; height: 14px; }
.used-src b { color: var(--ink2); font-weight: 600; }
@media (max-width: 700px) { .scope-hint { display: none; } .scope-btn { max-width: 100%; } }


/* ---------- Administración: plan por usuario ---------- */
.u-org { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px 0; font-size: 13px; }
.u-org + .u-org { border-top: 1px dashed var(--line); }
.u-plan { border: 0; cursor: pointer; font: inherit; font-size: 12px; }
.u-plan:hover { filter: brightness(.96); text-decoration: underline; }
.wrap-seg { flex-wrap: wrap; }

.lang-sw { white-space: nowrap; }
.lang-sw a { color: inherit; }
.lang-sw b { font-weight: 600; }


/* ---------- Actividad, tickets y modo soporte ---------- */
.act-list { display: flex; flex-direction: column; }
.act-row { display: flex; gap: 12px; padding: 10px 2px; border-bottom: 1px solid #f2f3f9; align-items: flex-start; }
.act-row:last-child { border-bottom: 0; }
.act-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #f1f2fb; color: var(--brand); flex: none; }
.act-ic svg { width: 16px; height: 16px; }
.act-t { font-size: 13.5px; color: var(--ink2); line-height: 1.45; overflow-wrap: anywhere; }
.act-t b { color: var(--ink); font-weight: 600; }
.act-list.compact .act-row { padding: 7px 0; }
.act-more { margin-top: 10px; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #f43f5e; color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.dot-new { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: 7px; vertical-align: middle; }
.drop.sm { display: flex; align-items: center; padding: 14px; flex-direction: row; gap: 10px; justify-content: center; min-height: 0; }
.drop.sm svg { width: 18px; height: 18px; }
.tk-thread { display: flex; flex-direction: column; gap: 12px; }
.tk-msg { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; max-width: 92%; }
.tk-msg.sup { background: #f5f6ff; border-color: #e1e4fb; margin-left: auto; }
.tk-msg.internal { background: #fff8e8; border-color: #f7e2b0; }
.tk-h { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 13px; }
.tk-h .muted { margin-left: auto; }
.tk-b { font-size: 14px; line-height: 1.6; color: var(--ink2); overflow-wrap: anywhere; }
.tk-img { display: block; max-width: 100%; max-height: 340px; border-radius: 10px; margin-top: 8px; border: 1px solid var(--line); }
.tk-admin { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 16px; align-items: start; }
.tk-list { max-height: 72vh; overflow: auto; padding: 6px; }
.tk-li { display: block; padding: 10px 12px; border-radius: 12px; color: inherit; text-decoration: none; border: 1px solid transparent; }
.tk-li:hover { background: #f7f7fc; }
.tk-li.on { background: var(--brand-soft); border-color: #d9dcfb; }
.tk-ctx { display: flex; flex-direction: column; gap: 3px; background: #f7f8fc; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 12px 0; color: var(--ink2); }
.tk-ctx code { font-size: 12px; }
#support-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: #f59e0b; color: #1b1300; font-size: 13.5px; box-shadow: 0 -4px 18px rgba(0, 0, 0, .15); }
#support-bar svg { width: 18px; height: 18px; flex: none; }
#support-bar .btn { background: #1b1300; color: #fff; border-color: #1b1300; }
body.in-support .composer-wrap { bottom: 42px; }
body.in-support .content { padding-bottom: 60px; }
body.in-support .side { height: calc(100vh - 42px); }
@media (max-width: 900px) { .tk-admin { grid-template-columns: 1fr; } .tk-list { max-height: 40vh; } .tk-msg { max-width: 100%; } }

/* ==== TEMA OSCURO (generado) ==== */
html[data-theme="dark"] body { color: var(--ink); background: var(--bg); }
html[data-theme="dark"] a { color: var(--brand); }
html[data-theme="dark"] button, html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { color: inherit; }
html[data-theme="dark"] .muted { color: var(--muted); }
html[data-theme="dark"] .grad-text { background: linear-gradient(90deg, var(--brand), var(--brand2)); color: transparent; }
html[data-theme="dark"] .btn { border: 1px solid var(--line2); background: #16192a; color: var(--ink); }
html[data-theme="dark"] .btn:hover { border-color: #272e54; background: #171b2d; }
html[data-theme="dark"] .btn.primary { background: #12152b; border-color: #12152b; color: #fff; }
html[data-theme="dark"] .btn.primary:hover { background: #20244a; }
html[data-theme="dark"] .btn.brand { background: linear-gradient(135deg, var(--brand), var(--brand2)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(99, 102, 241, .32); }
html[data-theme="dark"] .btn.ghost { background: transparent; border-color: transparent; }
html[data-theme="dark"] .btn.ghost:hover { background: rgba(99, 102, 241, .07); }
html[data-theme="dark"] .btn.danger { color: var(--bad); }
html[data-theme="dark"] .btn.danger:hover { background: var(--bad-soft); border-color: #54202b; }
html[data-theme="dark"] .btn.loading { color: transparent !important; }
html[data-theme="dark"] .btn.loading::after { border-color: #9aa0c3 transparent #9aa0c3 transparent; }
html[data-theme="dark"] .btn.brand.loading::after, html[data-theme="dark"] .btn.primary.loading::after { border-color: #16192a transparent #16192a transparent; }
html[data-theme="dark"] .field > label, html[data-theme="dark"] .lbl { color: var(--ink2); }
html[data-theme="dark"] .field .hint { color: var(--muted); }
html[data-theme="dark"] .input, html[data-theme="dark"] select.input, html[data-theme="dark"] textarea.input { border: 1px solid var(--line2); background: #16192a; outline: none; }
html[data-theme="dark"] select.input { background: #16192a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237b80a0' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
html[data-theme="dark"] .input:focus { border-color: #a5a8f6; box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); }
html[data-theme="dark"] .switch span { background: #252c4e; }
html[data-theme="dark"] .switch span::before { background: #16192a; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
html[data-theme="dark"] .switch input:checked + span { background: #22c55e; }
html[data-theme="dark"] .chip { border: 1px solid var(--line2); background: #16192a; color: var(--ink2); }
html[data-theme="dark"] .chip:hover { border-color: #212457; background: #181c2e; color: var(--brand); }
html[data-theme="dark"] .chip.on { background: var(--brand-soft); border-color: #1e2150; color: var(--brand); }
html[data-theme="dark"] .badge { background: #1b2035; color: var(--ink2); }
html[data-theme="dark"] .badge.ok { background: var(--ok-soft); color: var(--ok); }
html[data-theme="dark"] .badge.bad { background: var(--bad-soft); color: var(--bad); }
html[data-theme="dark"] .badge.warn { background: var(--warn-soft); color: #d2b6a1; }
html[data-theme="dark"] .badge.brand { background: var(--brand-soft); color: var(--brand); }
html[data-theme="dark"] .side { background: linear-gradient(180deg, var(--side) 0%, #0b0e20 100%); color: #e7e9f6; }
html[data-theme="dark"] .side-brand { color: #fff; }
html[data-theme="dark"] .side-brand small { color: #9ca1c4; }
html[data-theme="dark"] .side-nav a, html[data-theme="dark"] .side-space { color: #cfd3ea; }
html[data-theme="dark"] .side-nav a:hover, html[data-theme="dark"] .side-space:hover { background: rgba(255, 255, 255, .05); color: #fff; }
html[data-theme="dark"] .side-nav a.on { background: rgba(255, 255, 255, .09); color: #fff; }
html[data-theme="dark"] .side-nav a.on .nav-new { background: #16192a; color: var(--side); }
html[data-theme="dark"] .nav-new { background: rgba(255, 255, 255, .12); }
html[data-theme="dark"] .side-sec { color: #7f84a8; }
html[data-theme="dark"] .side-sec button { background: none; color: #7f84a8; }
html[data-theme="dark"] .side-sec button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .side-space .sp-ic { color: #fff; }
html[data-theme="dark"] .side-space.on { background: rgba(255, 255, 255, .09); color: #fff; }
html[data-theme="dark"] .side-foot { border-top: 1px solid rgba(255, 255, 255, .06); }
html[data-theme="dark"] .side-user:hover { background: rgba(255, 255, 255, .05); }
html[data-theme="dark"] .avatar { color: #fff; background: var(--brand); }
html[data-theme="dark"] .side-user b { color: #fff; }
html[data-theme="dark"] .side-user small { color: #9ca1c4; }
html[data-theme="dark"] .side-user svg { color: #9ca1c4; }
html[data-theme="dark"] .credits { background: var(--side2); border: 1px solid rgba(255, 255, 255, .05); }
html[data-theme="dark"] .credits .row { color: #cfd3ea; }
html[data-theme="dark"] .credits .bar { background: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .credits .bar i { background: linear-gradient(90deg, #60a5fa, #a78bfa); }
html[data-theme="dark"] .credits .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .22); }
html[data-theme="dark"] .credits .btn:hover { background: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .main { background: radial-gradient(1200px 500px at 10% -10%, #1d2238 0%, rgba(253, 238, 230, 0) 60%), radial-gradient(900px 500px at 90% 0%, #1b1f35 0%, rgba(236, 238, 254, 0) 60%), var(--bg); }
html[data-theme="dark"] .topbar.scrolled { background: rgba(26, 30, 50, .97); box-shadow: 0 1px 0 var(--line); }
html[data-theme="dark"] .ask { background: rgba(22, 25, 42, .92); border: 1px solid var(--line); box-shadow: var(--shadow); }
html[data-theme="dark"] .ask input { background: transparent; }
html[data-theme="dark"] .ask input::placeholder { color: #9095b4; }
html[data-theme="dark"] .page-h p { color: var(--muted); }
html[data-theme="dark"] .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
html[data-theme="dark"] .empty { color: var(--muted); }
html[data-theme="dark"] .empty .em-ic { background: var(--brand-soft); color: var(--brand); }
html[data-theme="dark"] .empty h3 { color: var(--ink); }
html[data-theme="dark"] .ritem { border: 1px solid var(--line); background: #16192a; color: inherit; }
html[data-theme="dark"] .ritem:hover { border-color: #1e234e; background: #161a2c; }
html[data-theme="dark"] .ritem small { color: var(--muted); }
html[data-theme="dark"] .ins { border-bottom: 1px solid #1b1f34; }
html[data-theme="dark"] .ins p { color: var(--ink2); }
html[data-theme="dark"] .tone-up { background: #1e233a; color: #16a34a; }
html[data-theme="dark"] .tone-down { background: #1b2035; color: #c68996; }
html[data-theme="dark"] .tone-star { background: #1a1e33; color: #6366f1; }
html[data-theme="dark"] .tone-info { background: #1c2036; color: #8296c3; }
html[data-theme="dark"] .tone-warn { background: #1d2138; color: #f97316; }
html[data-theme="dark"] .auto-row { border-bottom: 1px solid #1b1f34; }
html[data-theme="dark"] .auto-row small { color: var(--muted); }
html[data-theme="dark"] .msg-u .bubble { background: rgba(22, 25, 42, .7); border: 1px solid var(--line); box-shadow: var(--shadow); }
html[data-theme="dark"] .ai-av { background: #16192a; box-shadow: var(--shadow); border: 1px solid var(--line); }
html[data-theme="dark"] .msg-a .reply { background: rgba(22, 25, 42, .85); border: 1px solid var(--line); box-shadow: var(--shadow); }
html[data-theme="dark"] .reply code { background: #1a1e33; }
html[data-theme="dark"] .thinking { color: var(--muted); }
html[data-theme="dark"] .thinking .pulse i { background: var(--brand); }
html[data-theme="dark"] .thinking .pulse i:nth-child(2) { background: #a78bfa; }
html[data-theme="dark"] .thinking .pulse i:nth-child(3) { background: #f472b6; }
html[data-theme="dark"] .steps-live { color: var(--muted); }
html[data-theme="dark"] .composer .sugs .chip { background: #16192a; }
html[data-theme="dark"] .composer-box { background: #16192a; border: 1px solid var(--line2); box-shadow: 0 10px 40px rgba(0, 0, 0, .10); }
html[data-theme="dark"] .composer-box textarea { background: transparent; }
html[data-theme="dark"] .composer-box .send { background: linear-gradient(135deg, #7c7ff7, #6366f1); color: #fff; box-shadow: 0 6px 18px rgba(99, 102, 241, .35); }
html[data-theme="dark"] .composer-meta { color: var(--muted2); }
html[data-theme="dark"] .welcome p { color: var(--muted); }
html[data-theme="dark"] .starter button { background: rgba(22, 25, 42, .85); border: 1px solid var(--line); }
html[data-theme="dark"] .starter button:hover { border-color: #1e2150; box-shadow: var(--shadow); }
html[data-theme="dark"] .starter button svg { color: var(--brand); }
html[data-theme="dark"] .starter span { color: var(--muted); }
html[data-theme="dark"] .vcard { background: #16192a; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
html[data-theme="dark"] .vcard-h .vact { background: rgba(22, 25, 42, .94); box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
@media (hover: none) {
  html[data-theme="dark"] .vcard-h .vact { box-shadow: none; background: none; }
}
html[data-theme="dark"] .vcard .vnote { color: var(--muted); }
html[data-theme="dark"] .vcard .verr { background: var(--bad-soft); color: var(--bad); }
html[data-theme="dark"] .vcard.kpi-card { box-shadow: none; background: transparent; }
html[data-theme="dark"] .vmeta { color: var(--muted2); }
html[data-theme="dark"] .exec { background: rgba(22, 25, 42, .9); border: 1px solid var(--line); box-shadow: var(--shadow); }
html[data-theme="dark"] .exec-h .orb { background: conic-gradient(from 200deg, #6366f1, #a78bfa, #f472b6, #38bdf8, #6366f1); box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .55); }
html[data-theme="dark"] .exec-h p { color: var(--muted); }
html[data-theme="dark"] .trc-tick { fill: var(--muted); }
html[data-theme="dark"] .trc-axis-title { fill: var(--muted2); }
html[data-theme="dark"] .trc-grid { stroke: #1c2137; }
html[data-theme="dark"] .trc-zero { stroke: #222a49; }
html[data-theme="dark"] .trc-val { fill: var(--ink2); }
html[data-theme="dark"] .trc-cross { stroke: #262b5b; }
html[data-theme="dark"] .trc-center { fill: var(--ink); }
html[data-theme="dark"] .trc-center-sub { fill: var(--muted); }
html[data-theme="dark"] .trc-leg { color: var(--ink2); }
html[data-theme="dark"] .trc-leg em { color: var(--muted); }
html[data-theme="dark"] .trc-tip { background: #12152b; color: #fff; box-shadow: 0 10px 30px rgba(10, 12, 40, .3); }
html[data-theme="dark"] .trc-tip-h { color: #fff; }
html[data-theme="dark"] .trc-tip-row { color: #c9cce4; }
html[data-theme="dark"] .trc-tip-row b { color: #fff; }
html[data-theme="dark"] .trc-empty { color: var(--muted2); }
html[data-theme="dark"] .trc-hlab { color: var(--ink2); }
html[data-theme="dark"] .trc-htrack { background: transparent; }
html[data-theme="dark"] .trc-pl { color: var(--ink2); }
html[data-theme="dark"] .trc-pl b { color: var(--muted); }
html[data-theme="dark"] .trc-fname { color: var(--ink2); }
html[data-theme="dark"] .trc-fbar { color: #fff; }
html[data-theme="dark"] .trc-frow em { color: var(--muted); }
html[data-theme="dark"] .trc-kpi { background: #16192a; border: 1px solid var(--line); }
html[data-theme="dark"] .trc-kpi-l { color: var(--ink2); }
html[data-theme="dark"] .trc-kpi-d span { color: var(--muted); }
html[data-theme="dark"] .trc-kpi-d.up { color: var(--ok); }
html[data-theme="dark"] .trc-kpi-d.down { color: var(--bad); }
html[data-theme="dark"] .trc-table-wrap { border: 1px solid var(--line); }
html[data-theme="dark"] .trc-table th { background: #191d30; color: var(--ink2); border-bottom: 1px solid var(--line); }
html[data-theme="dark"] .trc-table td { border-bottom: 1px solid #1b1f35; }
html[data-theme="dark"] .trc-table tr:hover td { background: #171a2c; }
html[data-theme="dark"] .trc-tbar { background: rgba(99, 102, 241, .08); }
html[data-theme="dark"] .trc-more { color: var(--muted); }
html[data-theme="dark"] .dgrid.editing .vcard:hover { outline-color: #1e2150; }
html[data-theme="dark"] .dgrid .vcard.drop-before { box-shadow: -4px 0 0 var(--brand); }
html[data-theme="dark"] .dtile { background: #16192a; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; }
html[data-theme="dark"] .dtile:hover { box-shadow: 0 10px 30px rgba(0, 0, 0, .09); }
html[data-theme="dark"] .dtile .thumb { background: linear-gradient(135deg, #181c2f, #1a1e33); }
html[data-theme="dark"] .dtile .thumb div { background: #16192a; border: 1px solid #1c2137; color: #b9bcef; }
html[data-theme="dark"] .dtile small { color: var(--muted); }
html[data-theme="dark"] .dash-meta { color: var(--muted); }
html[data-theme="dark"] .dash-title { outline: none; }
html[data-theme="dark"] .dash-title[contenteditable="true"]:hover, html[data-theme="dark"] .dash-title:focus { background: rgba(99, 102, 241, .06); }
html[data-theme="dark"] .tbl th { color: var(--muted); border-bottom: 1px solid var(--line); }
html[data-theme="dark"] .tbl td { border-bottom: 1px solid #1b1f35; }
html[data-theme="dark"] .tbl tr.click:hover td { background: #171a2c; }
html[data-theme="dark"] .src-type { color: #fff; }
html[data-theme="dark"] .src-csv { background: #1d2239; color: #16a34a; }
html[data-theme="dark"] .src-xlsx { background: #1f233b; color: #b3dac5; }
html[data-theme="dark"] .src-gsheet { background: #1f233b; color: #aed8bb; }
html[data-theme="dark"] .src-rest { background: #1b2035; color: #c68996; }
html[data-theme="dark"] .src-mysql { background: #1c2036; color: #b2d3da; }
html[data-theme="dark"] .src-pgsql { background: #1a1e33; color: #9ebad0; }
html[data-theme="dark"] .src-pick { border: 1px solid var(--line2); background: #16192a; }
html[data-theme="dark"] .src-pick:hover { border-color: #1e2150; box-shadow: var(--shadow); }
html[data-theme="dark"] .src-pick span { color: var(--muted); }
html[data-theme="dark"] .drop { border: 2px dashed #212751; background: #171a2c; }
html[data-theme="dark"] .drop.over { border-color: var(--brand); background: var(--brand-soft); }
html[data-theme="dark"] .drop svg { color: var(--brand); }
html[data-theme="dark"] .ds-cols span { background: #1a1e33; color: var(--ink2); }
html[data-theme="dark"] .ds-cols span em { color: var(--muted2); }
html[data-theme="dark"] .sql-ed { background: #0f1226; color: #e6e8f7; outline: none; }
html[data-theme="dark"] .cat-tree details { border-bottom: 1px solid #1b1f35; }
html[data-theme="dark"] .cat-tree .col { color: var(--ink2); }
html[data-theme="dark"] .cat-tree .col:hover { background: #191d31; }
html[data-theme="dark"] .cat-tree .col em { color: var(--muted2); }
html[data-theme="dark"] .modal-bg { background: rgba(16, 18, 40, .45); }
html[data-theme="dark"] .modal { background: #16192a; box-shadow: var(--shadow-l); }
html[data-theme="dark"] .menu { background: #16192a; border: 1px solid var(--line); box-shadow: var(--shadow-l); }
html[data-theme="dark"] .menu button, html[data-theme="dark"] .menu a { background: none; color: var(--ink); }
html[data-theme="dark"] .menu button:hover, html[data-theme="dark"] .menu a:hover { background: #1a1e32; }
html[data-theme="dark"] .menu button svg, html[data-theme="dark"] .menu a svg { color: var(--muted); }
html[data-theme="dark"] .menu .sep { background: var(--line); }
html[data-theme="dark"] .menu .mh { color: var(--muted2); }
html[data-theme="dark"] .menu .danger { color: var(--bad); }
html[data-theme="dark"] .menu .danger svg { color: var(--bad); }
html[data-theme="dark"] .toast { background: #12152b; color: #fff; box-shadow: var(--shadow-l); }
html[data-theme="dark"] .toast.err { background: #9f1239; }
html[data-theme="dark"] .toast.ok svg { color: #4ade80; }
html[data-theme="dark"] .banner { background: var(--warn-soft); color: #d7bcac; border: 1px solid #594522; }
html[data-theme="dark"] .banner.info { background: var(--brand-soft); color: #9c99ce; border-color: #1a1d45; }
html[data-theme="dark"] .tabs { border-bottom: 1px solid var(--line); }
html[data-theme="dark"] .tabs a { color: var(--muted); }
html[data-theme="dark"] .tabs a.on { color: var(--ink); border-color: var(--brand); }
html[data-theme="dark"] .stat { background: #16192a; border: 1px solid var(--line); }
html[data-theme="dark"] .stat small { color: var(--muted); }
html[data-theme="dark"] .plan-card { border: 1px solid var(--line2); background: #16192a; }
html[data-theme="dark"] .plan-card.cur { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(99, 102, 241, .1); }
html[data-theme="dark"] .plan-card .price small { color: var(--muted); }
html[data-theme="dark"] .plan-card ul { color: var(--ink2); }
html[data-theme="dark"] .plan-card li svg { color: var(--ok); }
html[data-theme="dark"] .usage-bar { background: #1c2137; }
html[data-theme="dark"] .usage-bar i { background: linear-gradient(90deg, var(--brand), var(--brand2)); }
html[data-theme="dark"] .code-box { background: #0f1226; color: #e6e8f7; }
html[data-theme="dark"] .log-box { background: #0f1226; color: #cfd3ea; }
html[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #1c2036 25%, #191d30 50%, #1c2036 75%); }
html[data-theme="dark"] .report { background: #16192a; border: 1px solid var(--line); box-shadow: var(--shadow); }
html[data-theme="dark"] .report .rp-sub { color: var(--muted); }
html[data-theme="dark"] .report .rp-sum { color: var(--ink2); background: linear-gradient(135deg, #181c2e, #191d30); border: 1px solid #1b1f35; }
html[data-theme="dark"] .report .rp-hl div { border: 1px solid var(--line); }
html[data-theme="dark"] .report .rp-hl small { color: var(--muted); }
html[data-theme="dark"] .report .rp-sec .txt { color: var(--ink2); }
html[data-theme="dark"] .report .rp-sec .chart { border: 1px solid var(--line); }
html[data-theme="dark"] .report .rp-list { color: var(--ink2); }
html[data-theme="dark"] .report .rp-foot { border-top: 1px solid var(--line); color: var(--muted2); }
@media (max-width: 860px) {
  html[data-theme="dark"] .side { box-shadow: var(--shadow-l); }
  html[data-theme="dark"] .side-scrim { background: rgba(10, 12, 30, .4); }
}
html[data-theme="dark"] .trc-leg, html[data-theme="dark"] .trc-pl { background: none; }
html[data-theme="dark"] .trc-leg:hover, html[data-theme="dark"] .trc-pl:hover { background: #1a1e32; }
html[data-theme="dark"] .trc-leg.off i, html[data-theme="dark"] .trc-pl.off i { background: #283157 !important; }
html[data-theme="dark"] .trc-tip-hint { border-top: 1px solid rgba(255,255,255,.12); color: #a5b4fc; }
html[data-theme="dark"] .trc-brush { fill: rgba(99, 102, 241, .12); stroke: rgba(99, 102, 241, .5); }
html[data-theme="dark"] .trc-reset { border: 1px solid var(--line2); background: #16192a; color: var(--brand); box-shadow: var(--shadow); }
html[data-theme="dark"] .trc-ref-l { stroke: #16192a; }
html[data-theme="dark"] .trc-val.in { fill: #fff; }
html[data-theme="dark"] .trc-val { stroke: #16192a; }
html[data-theme="dark"] .trc-val.in { stroke: none; }
html[data-theme="dark"] .trc-axis-title { fill: var(--muted2); }
html[data-theme="dark"] .trc-tm-l { fill: #fff; }
html[data-theme="dark"] .trc-tm-v { fill: rgba(255, 255, 255, .88); }
html[data-theme="dark"] .trc-sk-l { fill: var(--ink2); stroke: #16192a; }
html[data-theme="dark"] .trc-region.has:hover { stroke: #1b1e3a; }
html[data-theme="dark"] .trc-ml-h { color: var(--muted2); }
html[data-theme="dark"] .trc-ml span { color: var(--muted2); }
html[data-theme="dark"] .trc-ml em { color: var(--ink2); }
html[data-theme="dark"] .trc-scale { color: var(--muted); }
html[data-theme="dark"] .trc-scale em { color: var(--muted2); }
html[data-theme="dark"] .trc-goalmark { background: #16a34a; }
html[data-theme="dark"] .trc-ptop span { color: var(--ink2); }
html[data-theme="dark"] .trc-ptop em { color: var(--muted); }
html[data-theme="dark"] .trc-ptrack { background: #1c2137; }
html[data-theme="dark"] .trc-kpi-goal { background: #1c2137; }
html[data-theme="dark"] .trc-kpi-gl { color: var(--muted); }
html[data-theme="dark"] .trc-tsearch input { border: 1px solid var(--line2); outline: none; }
html[data-theme="dark"] .trc-tsearch input:focus { border-color: #a5a8f6; }
html[data-theme="dark"] .trc-tsearch span { color: var(--muted); }
html[data-theme="dark"] .trc-table tbody tr[style*="pointer"]:hover td { background: #181c2f; }
html[data-theme="dark"] .fchip { background: #16192a; border: 1px solid var(--line2); }
html[data-theme="dark"] .fchip span { color: var(--muted); }
html[data-theme="dark"] .fchip button { background: #1b2035; color: var(--muted); }
html[data-theme="dark"] .fchip button:hover { background: var(--bad-soft); color: var(--bad); }
html[data-theme="dark"] .fchip.on { background: var(--brand-soft); border-color: #1e2150; }
html[data-theme="dark"] .fvals { border: 1px solid var(--line); }
html[data-theme="dark"] .fvals label:hover { background: #191d30; }
html[data-theme="dark"] .ced-sec { border-bottom: 1px solid var(--line); }
html[data-theme="dark"] .ced-sec > b { color: var(--muted); }
html[data-theme="dark"] .ced-types button { border: 1px solid var(--line2); background: #16192a; color: var(--ink2); }
html[data-theme="dark"] .ced-types button svg { color: var(--muted); }
html[data-theme="dark"] .ced-types button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
html[data-theme="dark"] .ced-types button.on svg { color: var(--brand); }
html[data-theme="dark"] .ced-gl { color: var(--muted2); }
html[data-theme="dark"] .ced-pal button { background: #16192a; }
html[data-theme="dark"] .ced-pal button.on { border-color: var(--brand); }
html[data-theme="dark"] .ced-prev { background: #171b2d; border: 1px solid var(--line); }
html[data-theme="dark"] .seg { background: #1b2035; }
html[data-theme="dark"] .seg button { background: none; color: var(--ink2); }
html[data-theme="dark"] .seg button.on { background: #16192a; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); color: var(--ink); }
html[data-theme="dark"] .presenting .main { background: #191d31; }
html[data-theme="dark"] .ritem > svg.ic, html[data-theme="dark"] .tbl .acts > svg.ic { color: var(--muted2); }
html[data-theme="dark"] .trc-note { color: var(--muted); }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: transparent; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #272d50; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #b8bcd4; }
html[data-theme="dark"] ::-webkit-scrollbar-corner { background: transparent; }
html[data-theme="dark"] .side ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); }
html[data-theme="dark"] .log-box::-webkit-scrollbar-thumb, html[data-theme="dark"] .code-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); }
html[data-theme="dark"] .ced-tabs { background: #1b2035; }
html[data-theme="dark"] .ced-tabs button { background: none; color: var(--muted); }
html[data-theme="dark"] .ced-tabs button.on { background: #16192a; color: var(--ink); box-shadow: 0 1px 3px rgba(20,22,60,.1); }
html[data-theme="dark"] .side-space .sp-more { background: none; color: #9ca1c4; }
html[data-theme="dark"] .side-space .sp-more:hover { background: rgba(255,255,255,.1); color: #fff; }
html[data-theme="dark"] .sp-list .ritem .grip { color: var(--muted2); }
html[data-theme="dark"] .save-bar { background: rgba(22, 25, 42, .97); border: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(20,22,60,.06); }
html[data-theme="dark"] .presenting .main { background: #1a1e33; }
html[data-theme="dark"] .pres-bar { background: rgba(22, 25, 42, .97); border-bottom: 1px solid var(--line); }
html[data-theme="dark"] .pres-l small { color: var(--muted); }
html[data-theme="dark"] .pres-auto { color: var(--ink2); }
html[data-theme="dark"] .pres-hint { background: #16192a; border: 1px solid var(--line); box-shadow: var(--shadow-l); color: var(--muted); }
html[data-theme="dark"] .pres-hint kbd { background: #1b2035; border: 1px solid var(--line2); color: var(--ink); }
html[data-theme="dark"] .src-top { background: #16192a; }
html[data-theme="dark"] .search-in > svg { color: var(--muted); }
html[data-theme="dark"] .src-gal h4 { color: var(--muted); }
html[data-theme="dark"] .src-note { color: #d2b6a1; }
html[data-theme="dark"] .ftypes div { background: #181c2f; border: 1px solid var(--line); }
html[data-theme="dark"] .ftypes span { color: var(--muted); }
html[data-theme="dark"] .cf-head span:not(.src-type) { color: var(--muted); }
html[data-theme="dark"] .cf-grid .req { color: #c68996; }
html[data-theme="dark"] .chk span { border: 1px solid var(--line2); color: var(--ink2); background: #16192a; }
html[data-theme="dark"] .chk span::before { border: 1.5px solid #2e345d; }
html[data-theme="dark"] .chk input:checked + span { background: var(--brand-soft); border-color: #1e2150; color: var(--brand); }
html[data-theme="dark"] .chk input:checked + span::before { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5'%3E%3Cpath d='M5 12l5 5L19 8'/%3E%3C/svg%3E") center/10px no-repeat; border-color: var(--brand); }
html[data-theme="dark"] .chk input:focus-visible + span { outline: 2px solid var(--brand); }
html[data-theme="dark"] .code-box.muted { color: #9aa0c3; }
html[data-theme="dark"] .code-pre { background: #0f1226; color: #e6e8f7; }
html[data-theme="dark"] .banner.ok-b { background: #1b2035; color: #b9ddc7; border-color: #215734; }
html[data-theme="dark"] .conn-row { border-top: 1px solid var(--line); }
html[data-theme="dark"] .conn-info span { color: var(--muted); }
html[data-theme="dark"] .lcard { background: #16192a; border: 1px solid var(--line); }
html[data-theme="dark"] .lcard::before { background: transparent; }
html[data-theme="dark"] .lcard.on { border-color: color-mix(in srgb, var(--tone) 35%, #16192a); box-shadow: var(--shadow); }
html[data-theme="dark"] .lcard.on::before { background: var(--tone); }
html[data-theme="dark"] .lc-ic { background: color-mix(in srgb, var(--tone) 12%, #16192a); color: var(--tone); }
html[data-theme="dark"] .lc-top small { color: var(--tone); }
html[data-theme="dark"] .lcard p { color: var(--muted); }
html[data-theme="dark"] .lc-foot { color: var(--ink2); border-top: 1px solid var(--line); }
html[data-theme="dark"] .lopt { color: var(--ink2); background: #181c2f; }
html[data-theme="dark"] .sem-h small { color: var(--muted); }
html[data-theme="dark"] .sem-ic { background: var(--brand-soft); color: var(--brand); }
html[data-theme="dark"] .sem-row { border-top: 1px solid var(--line); }
html[data-theme="dark"] .sem-code, html[data-theme="dark"] .sem-row code { background: #1a1e33; color: #9c99ce; }
html[data-theme="dark"] .sem-empty { border-top: 1px solid var(--line); color: var(--muted); }
html[data-theme="dark"] .sem-empty code { background: #1a1e33; }
html[data-theme="dark"] .chips-s span { background: #1b2035; color: var(--ink2); }
html[data-theme="dark"] .sugg .chip small { color: var(--muted); }
html[data-theme="dark"] .colchip { border: 1px solid var(--line2); background: #16192a; color: var(--ink2); }
html[data-theme="dark"] .colchip:hover { border-color: var(--brand); color: var(--brand); }
html[data-theme="dark"] .colchip.t-integer, html[data-theme="dark"] .colchip.t-real { border-left: 3px solid #16a34a; }
html[data-theme="dark"] .colchip.t-date, html[data-theme="dark"] .colchip.t-datetime { border-left: 3px solid #0ea5e9; }
html[data-theme="dark"] .sem-test { background: #181c2f; }
html[data-theme="dark"] .ok-t { color: #b9ddc7; }
html[data-theme="dark"] .rel-eq { color: var(--muted); }
html[data-theme="dark"] .tagbox { border: 1px solid var(--line2); background: #16192a; }
html[data-theme="dark"] .tagbox:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
html[data-theme="dark"] .tagbox input { background: transparent; }
html[data-theme="dark"] .tag { background: var(--brand-soft); color: var(--brand); }
html[data-theme="dark"] .tag button { background: none; color: inherit; }
html[data-theme="dark"] .tag button:hover { background: rgba(79,70,229,.12); }
html[data-theme="dark"] .gv-av { background: var(--brand-soft); color: var(--brand); }
html[data-theme="dark"] .cert-g { color: var(--muted); border-top: 1px solid var(--line); }
html[data-theme="dark"] .cert-row { border-top: 1px solid var(--line); }
html[data-theme="dark"] .cert-row small { color: var(--muted); }
html[data-theme="dark"] .cert-ic { color: #16a34a; }
html[data-theme="dark"] .audit-sql { color: var(--ink2); }
html[data-theme="dark"] .vmetric { color: #b9ddc7; background: #1b2035; }
html[data-theme="dark"] .trc-grain { background: rgba(27, 32, 53, .92); }
html[data-theme="dark"] .trc-grain button { background: none; color: #7a7f9e; }
html[data-theme="dark"] .trc-grain button:hover { color: var(--ink); }
html[data-theme="dark"] .trc-grain button.on { background: #16192a; color: var(--brand); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
html[data-theme="dark"] .trc-an { color: var(--ink2); }
html[data-theme="dark"] .trc-an-i.k-trend i { background: none !important; color: #8c87c5; }
html[data-theme="dark"] .trc-an-i.k-fc i { border-top: 2px dashed #6366f1; background: none !important; }
html[data-theme="dark"] .trc-an-i em { color: var(--muted); }
html[data-theme="dark"] .trc-fc-l { fill: #a3a7c2; }
html[data-theme="dark"] .trc-tip-anom { color: #fda4af; }
html[data-theme="dark"] .trc-mx th.trc-mx-cg { border-left: 1px solid var(--line); }
html[data-theme="dark"] .trc-mx .trc-mx-dim, html[data-theme="dark"] .trc-mx td.trc-mx-l { background: #16192a; }
html[data-theme="dark"] .trc-mx thead .trc-mx-dim { background: #191d30; }
html[data-theme="dark"] .trc-mx td.trc-mx-l em { color: var(--muted); }
html[data-theme="dark"] .trc-mx-tg { background: #1c2137; color: var(--ink2); }
html[data-theme="dark"] .trc-mx-tg:hover { background: var(--brand-soft); color: var(--brand); }
html[data-theme="dark"] .trc-mx tr.grp td { background: #171b2d; }
html[data-theme="dark"] .trc-mx tr.grp.l0 td { background: #1a1e32; }
html[data-theme="dark"] .trc-mx tr.grp.l0 td.trc-mx-l { background: #1a1e32; }
html[data-theme="dark"] .trc-mx tr.grp td.trc-mx-l { background: #171b2d; }
html[data-theme="dark"] .trc-mx .trc-mx-tot { background: #181c2e; border-left: 1px solid var(--line); }
html[data-theme="dark"] .trc-mx tfoot td { background: #1c2036 !important; border-top: 1px solid #1c2347; }
html[data-theme="dark"] .trc-ic.up { color: #16a34a; }
html[data-theme="dark"] .trc-ic.down { color: #c68996; }
html[data-theme="dark"] .trc-ic.mid { color: #f59e0b; }
html[data-theme="dark"] .trc-mx-bar { color: var(--muted); }
html[data-theme="dark"] .trc-mx-bar button { border: 1px solid var(--line2); background: #16192a; color: var(--ink2); }
html[data-theme="dark"] .trc-mx-bar button:hover { border-color: var(--brand); color: var(--brand); }
html[data-theme="dark"] .an-opt { border: 1px solid var(--line); }
html[data-theme="dark"] .an-opt:hover { border-color: #1e2150; }
html[data-theme="dark"] .an-opt:has(input:checked) { border-color: #1e2150; background: var(--brand-soft); }
html[data-theme="dark"] .an-opt small { color: var(--muted); }
html[data-theme="dark"] .side-brand .brand-logo.on-plate, html[data-theme="dark"] .brand-logo.on-plate { background: #16192a; }
html[data-theme="dark"] .logo-slot { border: 1px solid var(--line); }
html[data-theme="dark"] .logo-prev { background: repeating-conic-gradient(#1b1f34 0 25%, #16192a 0 50%) 0 0 / 16px 16px; border: 1px dashed var(--line2); }
html[data-theme="dark"] .logo-slot.dark .logo-prev { background: #0f1226; border-color: #0f1226; }
html[data-theme="dark"] .pg-ed-r { border: 1px solid var(--line); background: #16192a; }
html[data-theme="dark"] .pg-tools button { border: 1px solid var(--line2); background: #16192a; }
html[data-theme="dark"] .legal-doc { color: #babedb; }
html[data-theme="dark"] .legal-doc h1 { color: var(--ink); }
html[data-theme="dark"] .legal-doc h2 { color: var(--ink); }
html[data-theme="dark"] .legal-doc a { color: var(--brand); }
html[data-theme="dark"] .legal-doc blockquote { border-left: 3px solid var(--brand); background: var(--brand-soft); }
html[data-theme="dark"] .legal-doc hr { border-top: 1px solid var(--line); }
html[data-theme="dark"] .legal-ok { color: var(--muted); }
html[data-theme="dark"] .legal-ok a, html[data-theme="dark"] .auth-foot a { color: inherit; }
html[data-theme="dark"] .trc-scale-l { fill: var(--muted2); }
html[data-theme="dark"] .trc-tick2 { fill: #8a8fb0; }
html[data-theme="dark"] .trc-axis2 { stroke: #1f2543; }
html[data-theme="dark"] .trc-break-band { fill: #fff; }
html[data-theme="dark"] .trc-break-z { stroke: #353d69; }
html[data-theme="dark"] .trc-note-ln { stroke: #9aa0c3; }
html[data-theme="dark"] .trc-note-pt { fill: #fff; }
html[data-theme="dark"] .trc-note-bx { fill: #c7cae4; }
html[data-theme="dark"] .trc-note-t { fill: #fff; }
html[data-theme="dark"] .trc-crumbs { color: var(--muted); }
html[data-theme="dark"] .trc-crumbs button { background: none; color: var(--brand); }
html[data-theme="dark"] .trc-crumbs button:hover { background: #1a1e33; }
html[data-theme="dark"] .trc-crumbs b { color: var(--ink); }
html[data-theme="dark"] .trc-crumbs .trc-up { border: 1px solid var(--line2); background: #16192a; }
html[data-theme="dark"] .trc-crumbs em { color: var(--muted2); }
html[data-theme="dark"] .trc-crumbs .trc-lv { color: var(--muted); }
html[data-theme="dark"] .dgrid.editing > .vcard { outline: 2px dashed #1c1f49; }
html[data-theme="dark"] .dgrid.editing > .vcard:hover { outline-color: #a5abf8; }
html[data-theme="dark"] .dgrid.editing > .vcard.moving { box-shadow: 0 18px 40px rgba(0, 0, 0, .22); }
html[data-theme="dark"] .dgrid.pos > .ph { border: 2px dashed var(--brand); background: rgba(99, 102, 241, .07); border-radius: var(--radius); }
html[data-theme="dark"] .vcard .rz { border-right: 3px solid var(--brand); border-bottom: 3px solid var(--brand); }
html[data-theme="dark"] .vcard .ed-size { color: var(--brand); background: #1a1e33; }
html[data-theme="dark"] .vact.float { background: rgba(22, 25, 42, .94); box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
html[data-theme="dark"] .md-doc { color: var(--ink2); }
html[data-theme="dark"] .md-doc h2 { color: var(--ink); }
html[data-theme="dark"] .md-doc h3 { color: var(--ink); }
html[data-theme="dark"] .md-doc h4 { color: var(--ink); }
html[data-theme="dark"] .md-doc a { color: var(--brand); }
html[data-theme="dark"] .md-doc hr { border-top: 1px solid var(--line); }
html[data-theme="dark"] .md-doc blockquote { border-left: 3px solid var(--brand); background: #181c2f; }
html[data-theme="dark"] .md-doc code { background: #1b2035; }
html[data-theme="dark"] .wimg-empty { color: var(--muted2); }
html[data-theme="dark"] .vcard.wk-div { background: transparent; box-shadow: none; }
html[data-theme="dark"] .wdiv-in { border-bottom: 2px solid var(--line2); }
html[data-theme="dark"] .wdiv-in h3 { color: var(--ink); }
html[data-theme="dark"] .wdiv-in span { color: var(--muted); }
html[data-theme="dark"] .dgrid.editing .vcard.wk-div { background: rgba(22, 25, 42, .6); }
html[data-theme="dark"] .dtabs { border-bottom: 1px solid var(--line); }
html[data-theme="dark"] .dtabs button { background: none; color: var(--muted); }
html[data-theme="dark"] .dtabs button:hover { color: var(--ink); }
html[data-theme="dark"] .dtabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
html[data-theme="dark"] .dtabs button i:hover { background: #1a1e33; }
html[data-theme="dark"] .dtabs .dt-add { color: var(--brand); }
html[data-theme="dark"] .pbar { background: #16192a; border: 1px solid var(--line); }
html[data-theme="dark"] .pbar .pb-l { color: var(--ink); }
html[data-theme="dark"] .pbar .pb-l svg { color: var(--brand); }
html[data-theme="dark"] .pctl { color: var(--ink2); }
html[data-theme="dark"] .pctl b { color: var(--ink); }
html[data-theme="dark"] .pctl.chg b { color: #cfaa9a; }
html[data-theme="dark"] .pt-h { color: var(--muted); }
html[data-theme="dark"] .pt-id { background: #1b2035; }
@media (max-width: 760px) {
  html[data-theme="dark"] .pt-r { border-bottom: 1px solid var(--line); }
}
html[data-theme="dark"] .dslider .ds-track { background: #1c2241; }
html[data-theme="dark"] .dslider .ds-fill { background: var(--brand); }
html[data-theme="dark"] .dslider input[type=range] { background: none; }
html[data-theme="dark"] .dslider input[type=range]::-webkit-slider-thumb { background: #16192a; border: 3px solid var(--brand); box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
html[data-theme="dark"] .dslider input[type=range]::-moz-range-thumb { background: #16192a; border: 3px solid var(--brand); }
html[data-theme="dark"] .dslider input[type=range]::-webkit-slider-runnable-track { background: none; }
html[data-theme="dark"] .banner.view-banner { background: #1b1f34; border-color: #604424; color: #dabcb2; }
html[data-theme="dark"] .banner.view-banner svg { color: #ea580c; }
html[data-theme="dark"] .txt-prev { border: 1px solid var(--line); background: #161a2c; }
html[data-theme="dark"] .md-tools button { border: 1px solid var(--line2); background: #16192a; }
html[data-theme="dark"] .img-prev { border: 1px dashed var(--line2); background: #171b2d; }
html[data-theme="dark"] .fvals label .ord { color: var(--brand); }
html[data-theme="dark"] .trc-map-st path { fill: none; stroke: #9aa0c8; }
html[data-theme="dark"] .trc-base { fill: #1c2137; stroke: #16192a; }
html[data-theme="dark"] .trc-pt:hover { stroke: #1b1e3a; }
html[data-theme="dark"] .trc-hex:hover { stroke: #1b1e3a; }
html[data-theme="dark"] .trc-scale .trc-src { color: var(--muted2); }
html[data-theme="dark"] .trc-tick.strong { fill: var(--ink2); }
html[data-theme="dark"] .trc-sb-l { fill: #fff; }
html[data-theme="dark"] .trc-sb-up { fill: var(--brand); }
html[data-theme="dark"] .trc-facet { border: 1px solid var(--line); }
html[data-theme="dark"] .trc-facet-h { color: var(--ink2); }
html[data-theme="dark"] .bell .bell-n { background: var(--bad); color: #fff; box-shadow: 0 0 0 2px var(--bg); }
html[data-theme="dark"] .notif-panel { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-l); }
html[data-theme="dark"] .np-h { border-bottom: 1px solid var(--line); }
html[data-theme="dark"] .np-h a { color: var(--brand); }
html[data-theme="dark"] .np-i { border-bottom: 1px solid var(--line); color: inherit; }
html[data-theme="dark"] .np-i:hover { background: var(--bg2); }
html[data-theme="dark"] .np-i.new { background: #181c2e; }
html[data-theme="dark"] .np-i small { color: var(--ink2); }
html[data-theme="dark"] .np-i em { color: var(--muted2); }
html[data-theme="dark"] .np-empty { color: var(--muted); }
html[data-theme="dark"] .np-empty svg { color: var(--muted2); }
html[data-theme="dark"] .alert-rule { background: var(--bg2); border: 1px solid var(--line); }
html[data-theme="dark"] .alert-rule > span:first-child { color: var(--ink); }
html[data-theme="dark"] .alert-rule .ar-v em { color: var(--muted); }
html[data-theme="dark"] details.adv summary { color: var(--brand); }
html[data-theme="dark"] .embed-body { background: var(--bg); }
html[data-theme="dark"] .embed-foot { color: var(--muted2); }
html[data-theme="dark"] .skip { background: var(--ink); color: #fff; }
html[data-theme="dark"] .content:focus { outline: none; }
html[data-theme="dark"] .trc:focus-visible { outline: 2px solid var(--brand); }
html[data-theme="dark"] .trc .trc-kfocus { stroke: var(--ink) !important; }
html[data-theme="dark"] .trc .trc-hrow.trc-kfocus, html[data-theme="dark"] .trc .trc-mx-l span.trc-kfocus { outline: 2px solid var(--brand); }
html[data-theme="dark"] .btn:focus-visible, html[data-theme="dark"] .chip:focus-visible, html[data-theme="dark"] .menu button:focus-visible, html[data-theme="dark"] a:focus-visible, html[data-theme="dark"] .dtabs button:focus-visible { outline: 2px solid var(--brand); }
html[data-theme="dark"] .menu button:focus { background: var(--bg2); }
html[data-theme="dark"] .scope-btn { border: 1px solid var(--line2); background: #16192a; color: var(--ink2); box-shadow: 0 2px 8px rgba(0, 0, 0, .05); }
html[data-theme="dark"] .scope-btn svg { color: var(--muted); }
html[data-theme="dark"] .scope-btn:hover { border-color: #212457; color: var(--brand); }
html[data-theme="dark"] .scope-btn.on { background: var(--brand-soft); border-color: #1e2150; color: var(--brand); }
html[data-theme="dark"] .scope-btn.on svg { color: var(--brand); }
html[data-theme="dark"] .scope-hint { color: var(--muted2); }
html[data-theme="dark"] kbd { border: 1px solid var(--line2); background: #16192a; color: var(--ink2); }
html[data-theme="dark"] .mention { background: #16192a; border: 1px solid var(--line2); box-shadow: var(--shadow-l); }
html[data-theme="dark"] .mention button { background: none; color: var(--ink); }
html[data-theme="dark"] .mention button.on, html[data-theme="dark"] .mention button:hover { background: var(--brand-soft); }
html[data-theme="dark"] .mention button small, html[data-theme="dark"] .sp-item small { color: var(--muted); }
html[data-theme="dark"] .sp-bar { color: var(--muted); }
html[data-theme="dark"] .sp-list { border: 1px solid var(--line); }
html[data-theme="dark"] .sp-item:hover { background: #191d30; }
html[data-theme="dark"] .sp-item.on { background: var(--brand-soft); }
html[data-theme="dark"] .scope-auto { background: #181c2e; border: 1px solid #1e2239; }
html[data-theme="dark"] .scope-auto svg { color: var(--brand); }
html[data-theme="dark"] .scope-auto p { color: var(--ink2); }
html[data-theme="dark"] .used-src { color: var(--muted); }
html[data-theme="dark"] .used-src b { color: var(--ink2); }
html[data-theme="dark"] .u-org + .u-org { border-top: 1px dashed var(--line); }
html[data-theme="dark"] .lang-sw a { color: inherit; }
html[data-theme="dark"] .act-row { border-bottom: 1px solid #1b1f34; }
html[data-theme="dark"] .act-ic { background: #1b1f34; color: var(--brand); }
html[data-theme="dark"] .act-t { color: var(--ink2); }
html[data-theme="dark"] .act-t b { color: var(--ink); }
html[data-theme="dark"] .nav-badge { background: #f43f5e; color: #fff; }
html[data-theme="dark"] .dot-new { background: var(--brand); }
html[data-theme="dark"] .tk-msg { border: 1px solid var(--line); background: #16192a; }
html[data-theme="dark"] .tk-msg.sup { background: #181c2f; border-color: #1f243c; }
html[data-theme="dark"] .tk-msg.internal { background: #1c2036; border-color: #614f25; }
html[data-theme="dark"] .tk-b { color: var(--ink2); }
html[data-theme="dark"] .tk-img { border: 1px solid var(--line); }
html[data-theme="dark"] .tk-li { color: inherit; }
html[data-theme="dark"] .tk-li:hover { background: #191d30; }
html[data-theme="dark"] .tk-li.on { background: var(--brand-soft); border-color: #1b1f47; }
html[data-theme="dark"] .tk-ctx { background: #191d30; border: 1px solid var(--line); color: var(--ink2); }
html[data-theme="dark"] #support-bar { background: #f59e0b; color: #efe9dd; box-shadow: 0 -4px 18px rgba(0, 0, 0, .15); }
html[data-theme="dark"] #support-bar .btn { background: #1b1300; color: #fff; border-color: #1b1300; }
/* Variables y ajustes manuales; el resto se genera desde las reglas claras. */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0c18; --bg2: #10142a; --card: #151a30; --line: #232945; --line2: #2d3456;
  --ink: #e8eaf6; --ink2: #c3c7e0; --muted: #959bbd; --muted2: #6f7599;
  --brand: #818cf8; --brand2: #a78bfa; --brand-soft: #232a55;
  --ok: #34d399; --ok-soft: #12352a; --bad: #fb7185; --bad-soft: #3a1622; --warn: #fbbf24; --warn-soft: #3a2c0f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 18px rgba(0, 0, 0, .25);
  --shadow-l: 0 20px 60px rgba(0, 0, 0, .5);
}
html[data-theme="dark"] body { background: var(--bg); color: var(--ink2); }
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3, html[data-theme="dark"] h4, html[data-theme="dark"] b, html[data-theme="dark"] strong { color: var(--ink); }
html[data-theme="dark"] a { color: var(--brand); }
html[data-theme="dark"] .btn.primary { background: #e8eaf6; color: #0d1024; border-color: #e8eaf6; }
html[data-theme="dark"] .btn.primary:hover { background: #fff; }
html[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #171c34 25%, #1f2542 37%, #171c34 63%); background-size: 400% 100%; }
html[data-theme="dark"] img.brand-ic, html[data-theme="dark"] .rp-brand img { filter: none; }
/* Gráficos SVG: colores fijos en atributos */
html[data-theme="dark"] .trc [fill="#fff"], html[data-theme="dark"] .trc [fill="#ffffff"] { fill: var(--card); }
html[data-theme="dark"] .trc [stroke="#fff"], html[data-theme="dark"] .trc [stroke="#ffffff"] { stroke: var(--card); }
html[data-theme="dark"] .trc [fill="#f1f2f8"], html[data-theme="dark"] .trc [fill="#eef0fb"], html[data-theme="dark"] .trc [fill="#e9ebf5"], html[data-theme="dark"] .trc [fill="#f8f9fd"] { fill: #1d2340; }
html[data-theme="dark"] .trc [fill="#dfe2f0"] { fill: #262d4f; } html[data-theme="dark"] .trc [fill="#d2d6ea"] { fill: #2f3760; }
html[data-theme="dark"] .trc [fill="#1b1e3a"] { fill: #e8eaf6; }
html[data-theme="dark"] .trc [stroke="#c7cae6"], html[data-theme="dark"] .trc [stroke="#c9ccfb"] { stroke: #3a4170; }
html[data-theme="dark"] .trc-val.in { fill: #fff; }
html[data-theme="dark"] .trc-note-bx { fill: #e8eaf6; } html[data-theme="dark"] .trc-note-t { fill: #0d1024; }
html[data-theme="dark"] .trc-tip { background: #e8eaf6; color: #0d1024; }
html[data-theme="dark"] .trc-tip-h { color: #0d1024; } html[data-theme="dark"] .trc-tip-row { color: #3a3f63; }
html[data-theme="dark"] .trc-break-band { fill: var(--card); }
html[data-theme="dark"] .trc-base { fill: #1d2340; stroke: var(--card); }
html[data-theme="dark"] .trc-map-st path { stroke: #4a5182; }
html[data-theme="dark"] .trc-kpi { background: var(--card); }
html[data-theme="dark"] .trc-kpi-ic { filter: saturate(.9) brightness(.85); }
html[data-theme="dark"] .trc-table th { background: #1a1f39; }
html[data-theme="dark"] .trc-mx .grp td, html[data-theme="dark"] .trc-mx-gt td { background: #1a1f39; }
/* Estilos en línea de componentes */
html[data-theme="dark"] [style*="background:#fff"], html[data-theme="dark"] [style*="background: #fff"] { background: var(--card) !important; }
html[data-theme="dark"] [style*="border-top:1px solid #eceef6"] { border-top-color: var(--line) !important; }
html[data-theme="dark"] .md-doc blockquote { background: #1a2042; }
html[data-theme="dark"] .np-i.new { background: #2a1825; }
html[data-theme="dark"] .banner.view-banner { background: #33230f; border-color: #5b3b12; color: #fcd9a7; }
html[data-theme="dark"] ::selection { background: #3b4290; }
