/* KORVIA AI + Gemelo Digital 3D V1. Scope estricto: .kai-root / .k3d- */
.kai-root{--kai-navy:#07152d;--kai-blue:#0b2347;--kai-wine:#8e1c2a;--kai-border:#dce5ef;--kai-muted:#62738a;--kai-white:#fff;color:#13263d;display:flex;flex-direction:column;gap:18px;min-width:0}
.kai-root *{box-sizing:border-box}
.kai-hero{position:relative;display:flex;justify-content:space-between;align-items:center;gap:25px;border-radius:18px;background:linear-gradient(118deg,#07152d 0%,#0b2347 73%,#561a30 120%);padding:27px 29px;color:#fff;overflow:hidden}
.kai-hero:after{content:"";position:absolute;width:240px;height:240px;border-radius:50%;right:120px;top:-160px;background:rgba(113,173,255,.12);filter:blur(14px);pointer-events:none}
.kai-hero h2{color:#fff;margin:6px 0 8px;font-size:clamp(22px,2.5vw,32px);line-height:1.16}
.kai-hero p{color:#c7d5eb;margin:0;max-width:660px;font-size:12px;line-height:1.65}
.kai-overline{display:block;font-size:10px;font-weight:800;letter-spacing:.2em;color:#b2c3d9}
.kai-live{white-space:nowrap;display:flex;align-items:center;gap:8px;border:1px solid #ffffff36;background:#ffffff12;border-radius:50px;padding:10px 14px;color:#e5ecf8;font-size:11px;font-weight:700;z-index:1}
.kai-live-dot{width:8px;height:8px;border-radius:50%;background:#67d2b2;box-shadow:0 0 0 3px #67d2b222}
.kai-grid{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(230px,.8fr);gap:15px;align-items:stretch}
.kai-panel{background:#fff;border:1px solid var(--kai-border);box-shadow:0 10px 30px rgba(7,21,45,.045);border-radius:15px;min-width:0;padding:21px}
.kai-panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}
.kai-panel-head h3{font-size:17px;font-weight:800;color:#102443;margin:0}
.kai-panel-head>span{font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:800;color:#8e1c2a}
.kai-controls{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.kai-root label{display:flex;flex-direction:column;gap:6px;font-size:11px;font-weight:800;color:#334b64;min-width:0}
.kai-root select,.kai-root textarea{font:inherit;display:block;width:100%;border:1px solid #ccd8e6;border-radius:9px;background:#fff;color:#182a44;padding:11px;font-size:13px;outline:none;min-height:42px}
.kai-root textarea{resize:vertical;min-height:95px;line-height:1.55}
.kai-root select:focus,.kai-root textarea:focus{border-color:#446d9f;box-shadow:0 0 0 3px #4e7daa22}
.kai-root select:disabled{opacity:.55}
.kai-question{margin-top:15px}
.kai-quick{display:flex;gap:7px;flex-wrap:wrap;margin:12px 0}
.kai-quick button{border:1px solid #d7e2ef;background:#f3f7fb;color:#375678;border-radius:6px;padding:7px 10px;cursor:pointer;font-size:11px;font-weight:700}
.kai-quick button:hover{border-color:#597ca5}
.kai-query-bottom{display:flex;justify-content:space-between;align-items:center;gap:12px}
.kai-query-bottom small{color:#8290a3;font-size:10px;line-height:1.6}
.kai-primary{border:0;background:#8e1c2a;border-radius:9px;color:#fff;font-weight:800;font-size:12px;padding:12px 20px;cursor:pointer;white-space:nowrap}
.kai-primary:hover{background:#6f1521}.kai-primary:disabled{opacity:.6;cursor:wait}
.kai-intro{background:#f6f8fb;display:flex;flex-direction:column;align-items:flex-start;gap:11px}
.kai-intro .kai-overline{color:#8e1c2a}.kai-intro h3{font-size:20px;line-height:1.25;color:#102443;margin:0}.kai-intro p{font-size:12px;color:#516780;line-height:1.8;margin:0}
.kai-footnote{margin-top:auto;font-weight:700;font-size:11px;color:#466589;padding:14px;background:#e9f0f8;border-radius:8px;line-height:1.6}
.kai-error:not(:empty){border:1px solid #f0bbc6;background:#fff1f2;color:#9a2535;padding:12px;border-radius:9px;font-size:12px}
.kai-answers{min-height:150px}.kai-empty{color:#8290a4;font-size:13px;padding:22px 8px;text-align:center}
.kai-answer-text{white-space:pre-wrap;color:#18334f;line-height:1.75;font-size:13px;overflow-wrap:anywhere;border-left:3px solid #8e1c2a;padding:9px 16px;background:#f6f8fb;border-radius:0 8px 8px 0}
.kai-answers h4{font-size:13px;color:#1d3651;margin:19px 0 9px}
.kai-warning{color:#9d6d24;background:#fff6e8;font-size:12px;padding:12px;border-radius:8px}
.kai-table-wrap{max-width:100%;overflow-x:auto;border-radius:9px;border:1px solid #e1e8f2}
.kai-table{border-collapse:collapse;min-width:500px;width:100%;font-size:11px}.kai-table th{background:#f0f5fa;text-align:left;color:#426080;padding:10px 12px;white-space:nowrap}.kai-table td{padding:10px 12px;border-top:1px solid #e7edf4;color:#263d58;white-space:normal;min-width:75px;max-width:270px}
.kai-notice{background:#f0f4f9;border:1px solid #d7e3f2;padding:13px 18px;color:#425872;font-size:12px;line-height:1.6;border-radius:10px}
.kai-unit-toolbar{display:flex;align-items:flex-end;gap:13px;flex-wrap:wrap}.kai-unit-toolbar label{min-width:260px;flex:1;max-width:480px}
.kai-unit-toolbar button{border-radius:9px;background:#fff;border:1px solid #d4e0ec;color:#345171;padding:11px 15px;cursor:pointer;font-weight:800;font-size:12px;white-space:nowrap}.kai-unit-toolbar>span{margin-left:auto;color:#687d93;font-size:11px}
.k3d-grid{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(290px,.85fr);align-items:stretch;gap:14px}
.k3d-main{display:flex;flex-direction:column;gap:12px;min-width:0}.k3d-canvas-wrap{position:relative;min-height:400px;height:min(56vh,560px);border-radius:14px;overflow:hidden;background:#091a33;touch-action:none}
.k3d-canvas-wrap canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}.k3d-canvas-wrap canvas:active{cursor:grabbing}
.k3d-hint{position:absolute;bottom:12px;right:12px;border:1px solid #ffffff24;background:#07152dbb;color:#d3e0f0;font-size:10px;padding:8px 12px;border-radius:7px;pointer-events:none}
.k3d-systems{display:flex;flex-wrap:wrap;gap:7px}.k3d-systems button{background:#fff;border:1px solid #dae3ec;border-radius:8px;padding:9px 12px;font-size:11px;color:#2d4561;font-weight:700;cursor:pointer}.k3d-systems button.is-active{background:#0b2347;border-color:#0b2347;color:#fff}.k3d-systems small{display:inline-flex;justify-content:center;min-width:19px;margin-left:5px;background:#eff3f7;color:#284b6a;border-radius:50px;font-size:10px;padding:2px 4px}.k3d-systems button.is-active small{color:#0b2347;background:#dbe9f5}
.k3d-side{display:flex;flex-direction:column;gap:12px;max-height:650px;overflow:auto}.k3d-side .kai-panel-head{margin:0}
.k3d-kpis{display:grid;grid-template-columns:1fr 1fr;gap:9px}.k3d-kpis div{background:#f0f5fa;border:1px solid #e2e9f2;border-radius:10px;padding:12px;min-width:0}.k3d-kpis span{display:block;color:#657a94;font-size:10px;margin-bottom:7px}.k3d-kpis strong{color:#142d4a;font-size:13px;overflow-wrap:anywhere}
.k3d-side h4{font-size:15px;color:#0c2442;margin:14px 0 0}.k3d-disclaimer{font-size:11px;color:#6e8299;line-height:1.6;margin:0}
.k3d-count{font-size:11px;font-weight:700;color:#60748c;margin:0 0 10px}.k3d-empty{font-size:12px;color:#8394a7}.k3d-record{padding:12px 0;border-bottom:1px solid #e2e9f1}.k3d-record strong{display:block;font-size:11px;color:#0d2b4f}.k3d-record span{font-size:10px;color:#8e1c2a}.k3d-record p{color:#50687f;font-size:12px;margin:5px 0 0;line-height:1.5;overflow-wrap:anywhere}
html[data-theme="dark"] .kai-root{--kai-border:#2b3e57;color:#e7edf8}html[data-theme="dark"] .kai-panel{background:#12233a;border-color:#304661}html[data-theme="dark"] .kai-panel-head h3,html[data-theme="dark"] .kai-intro h3,html[data-theme="dark"] .k3d-side h4{color:#e7edf8}html[data-theme="dark"] .kai-root label{color:#bfd0e5}html[data-theme="dark"] .kai-root select,html[data-theme="dark"] .kai-root textarea{background:#091a2e;color:#e5effb;border-color:#3c5572}html[data-theme="dark"] .kai-intro,html[data-theme="dark"] .kai-footnote,html[data-theme="dark"] .k3d-kpis div{background:#152b45}html[data-theme="dark"] .kai-intro p,html[data-theme="dark"] .k3d-disclaimer{color:#b2c1d3}html[data-theme="dark"] .kai-answer-text{background:#0e1e33;color:#d7e6f6}html[data-theme="dark"] .kai-table th{background:#1f344e;color:#e1e8f5}html[data-theme="dark"] .kai-table td{color:#e2eaf7;border-color:#364a66}html[data-theme="dark"] .k3d-systems button,html[data-theme="dark"] .kai-unit-toolbar button{background:#152b45;color:#e4ecf6;border-color:#395374}html[data-theme="dark"] .k3d-systems button.is-active{background:#8e1c2a}html[data-theme="dark"] .k3d-kpis span,html[data-theme="dark"] .k3d-kpis strong,html[data-theme="dark"] .k3d-record strong{color:#e4eef9}html[data-theme="dark"] .k3d-record p{color:#b4c5db}html[data-theme="dark"] .kai-notice{background:#142841;border-color:#36506a;color:#d1def0}
@media(max-width:1100px){.k3d-grid{grid-template-columns:minmax(0,1fr)}.k3d-side{max-height:none}.kai-grid{grid-template-columns:1fr}}
@media(max-width:620px){.kai-hero{padding:23px;align-items:flex-start;flex-direction:column}.kai-live{white-space:normal}.kai-controls{grid-template-columns:1fr}.kai-panel{padding:17px}.kai-query-bottom{flex-wrap:wrap}.kai-unit-toolbar label{min-width:100%;max-width:100%}.kai-unit-toolbar>span{margin-left:0}.k3d-canvas-wrap{height:360px;min-height:360px}.k3d-hint{font-size:9px;right:6px}.k3d-kpis{grid-template-columns:1fr 1fr}}
