:root{--navy:#102b39;--teal:#087c70;--teal-light:#eaf5f1;--bg:#f5f7f8;--line:#e1e7e9;--muted:#71818b;--text:#213844;--white:#fff;--red:#a52b38;--amber:#956514}*{box-sizing:border-box}body{margin:0;background:var(--bg);font-family:Inter,Arial,sans-serif;color:var(--text);font-size:14px;line-height:1.5}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:4px}button{cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}a{color:var(--teal);text-decoration:none}.sidebar{position:fixed;inset:0 auto 0 0;width:245px;background:var(--navy);color:#cbd9df;padding:34px 19px 20px;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:12px;font-size:25px;letter-spacing:2px;color:white;font-weight:700;padding:0 14px 44px}.brand-icon{display:grid;place-items:center;width:41px;height:45px;border:1px solid #638c91;border-radius:12px;font-family:Georgia,serif;background:#1f424e}.brand-sub{display:block;font-size:9px;letter-spacing:1.9px;color:#96afb7;margin-top:0}.workspace-label{padding:0 14px;font-size:9px;letter-spacing:1.8px;color:#91a9b2;margin-bottom:15px}nav{display:grid;gap:8px}.nav{display:flex;align-items:center;gap:12px;background:transparent;border:0;border-radius:7px;color:#c5d3d9;text-align:left;padding:12px 14px;font-size:12px}.nav span{font-size:20px;width:20px}.nav.active{background:#254951;color:#fff;box-shadow:inset 3px 0 #52c6a4}.nav:hover{background:#23434f}.sidebar-note{margin-top:auto;padding:24px 12px 16px;font-size:11px;border-bottom:1px solid #34505b}.sidebar-note p{color:#8fa8b3;font-size:10px;line-height:1.8;margin-top:9px}.dot,.live-chip i{display:inline-block;width:6px;height:6px;border-radius:50%;background:#68c6a5;margin-right:6px}.profile-mini{display:flex;gap:10px;align-items:center;font-size:12px;padding:20px 10px 0}.avatar{display:grid;place-items:center;background:#3b5862;width:32px;height:32px;border-radius:8px}.profile-mini small{display:block;color:#91abb5;font-size:10px}.main-shell{margin-left:245px}.topbar{height:71px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding:0 40px;background:white;font-size:11px}.crumb{color:var(--muted)}.crumb-sep{margin:0 15px;color:#b0bcc2}.live-chip{font-size:10px;border:1px solid var(--line);border-radius:25px;padding:7px 12px}main{max-width:1460px;margin:auto;padding:37px 40px 20px}.view{display:none}.view.active{display:block}.heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:25px}.eyebrow{font-size:9px;letter-spacing:1.8px;color:var(--teal);font-weight:700;margin-bottom:11px}h1{font-size:clamp(24px,2.25vw,36px);font-weight:600;letter-spacing:-1.2px;line-height:1.25;margin:0 0 9px}h2{font-size:17px;font-weight:600;letter-spacing:-.25px;margin:0 0 8px}h3{font-size:15px;margin:8px 0}p{color:var(--muted);margin:6px 0;font-size:12px}.button{display:inline-flex;align-items:center;justify-content:center;gap:12px;padding:11px 16px;border-radius:6px;font-weight:600;font-size:11px;white-space:nowrap;border:1px solid transparent}.primary{background:var(--teal);color:white}.primary:hover{background:#07685f}.secondary{background:white;color:var(--text);border-color:var(--line)}.secondary:hover{border-color:#85afa9}.text-button{border:0;background:none;color:var(--teal);font-size:11px;font-weight:600;padding:5px}.source-banner{display:flex;align-items:center;gap:14px;border:1px solid #d1e7df;border-radius:8px;padding:17px 20px;background:var(--teal-light);margin-bottom:23px}.source-banner strong{font-size:12px;font-weight:600}.source-banner p{font-size:11px;color:#598077;margin:4px 0 0}.source-banner .text-button{margin-left:auto;flex-shrink:0}.source-icon{display:grid;place-items:center;background:#d7ece5;width:33px;height:33px;border-radius:7px;font-size:20px;color:var(--teal)}.panel{background:white;border:1px solid var(--line);border-radius:9px;padding:23px;margin-bottom:22px;box-shadow:0 2px 4px #243a4510}.search-panel{padding:22px}.search-row{display:grid;grid-template-columns:1.6fr 1fr auto;gap:16px;align-items:end}label{display:flex;flex-direction:column;gap:7px;font-size:11px;font-weight:600;margin-bottom:10px}input,select,textarea{border:1px solid #dce4e7;border-radius:5px;padding:10px 12px;background:#fff;color:var(--text);min-width:0;font-size:12px;width:100%;font-weight:400}input:focus,textarea:focus,select:focus{border-color:var(--teal);outline:2px solid #087c7015}.search-row .button{margin-bottom:10px;height:41px;min-width:160px}.help{color:var(--muted);font-size:11px;line-height:1.7;font-weight:400}.filters{margin-top:15px;padding-top:14px;border-top:1px solid var(--line)}summary{cursor:pointer;font-size:11px;font-weight:600;color:#375260}summary span{font-weight:400;color:var(--muted);margin-left:10px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 22px;margin:14px 0}.filters .form-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.search-actions{display:flex;align-items:center;justify-content:space-between;margin-top:15px}.inline-label{display:flex;flex-direction:row;align-items:center;gap:7px;font-size:10px;font-weight:400;margin:0}.inline-label input{width:14px;height:14px;accent-color:var(--teal)}.results-toolbar{display:flex;align-items:center;justify-content:space-between;margin:27px 0 17px}.results-toolbar h2{margin:0}.results-toolbar p{font-size:10px;margin-top:5px}.results{display:grid;gap:14px}.process-card{background:white;border:1px solid var(--line);border-radius:9px;padding:21px;transition:box-shadow .2s,border-color .2s}.process-card:hover{border-color:#a3c8c1;box-shadow:0 5px 18px #0d403d0b}.card-top{display:flex;justify-content:space-between;gap:15px;align-items:center}.entity{font-size:9px;color:var(--muted);font-weight:700;letter-spacing:.5px;text-transform:uppercase}.badge{display:inline-block;font-size:9px;font-weight:600;border-radius:4px;background:#f0f4f5;color:#62727c;padding:4px 8px}.green{background:#e7f4ef;color:#23735c}.amber{background:#fff4df;color:var(--amber)}.red{background:#fbedee;color:var(--red)}.process-card h3{font-size:14px;line-height:1.6;font-weight:600;margin:10px 0 12px;max-width:90%;overflow-wrap:anywhere}.card-ref{font-size:10px;color:#809098;margin-bottom:14px}.card-bottom{display:flex;align-items:end;justify-content:space-between;gap:12px;border-top:1px solid #edf1f2;padding-top:15px}.card-data{display:flex;gap:26px;flex-wrap:wrap}.datum span{display:block;color:#8c9aa1;font-size:8px;text-transform:uppercase;letter-spacing:.7px}.datum strong{font-size:11px;display:block;margin-top:5px;font-weight:500}.datum.price strong{font-size:15px;font-weight:600;letter-spacing:-.4px}.card-actions{display:flex;gap:12px;align-items:center}.card-warning{margin:10px 0 0;color:var(--amber);font-size:10px}.pagination{display:flex;justify-content:center;align-items:center;gap:20px;margin:24px 0;font-size:11px}.technical{margin:20px 0;color:var(--muted)}pre{white-space:pre-wrap;overflow-wrap:anywhere;font-family:monospace;font-size:11px;background:#f4f7f8;padding:15px;border-radius:6px}.flow-lamps{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 16px}.lamp{display:flex;gap:8px;align-items:flex-start;border:1px solid var(--line);border-radius:8px;padding:8px 12px;background:white;font-size:11px;max-width:280px}.lamp i{width:10px;height:10px;border-radius:50%;background:#c5d0d4;flex:none;margin-top:4px}.lamp.green i{background:#23735c}.lamp.amber i{background:#956514}.lamp.red i{background:#a52b38}.lamp strong{display:block;color:var(--text)}.lamp span{color:var(--muted)}
.notice{padding:13px 16px;border-radius:6px;font-size:11px;line-height:1.7;margin-bottom:18px}.info{background:#edf3f8;color:#4b6980;border:1px solid #dbe6ee}.danger{background:#fff0ee;color:#9b3b35;border:1px solid #f1cbc8}.empty-state{text-align:center;padding:43px 25px;color:var(--muted);border:1px dashed #d5e0e4;border-radius:9px;background:#ffffff88}.empty-state p{max-width:430px;margin:10px auto}.empty-icon{font-size:37px;color:#98b4af}.empty-state h3{color:#47636b}.section-title{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}.section-title h2{margin:0}.form-footer{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}.upload-form{display:flex;gap:12px;align-items:center;margin:20px 0}.upload-form input{background:#f7faf9}.document-row{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:15px 0;border-top:1px solid var(--line)}.document-row strong{font-size:12px;overflow-wrap:anywhere}.document-row p{font-size:10px}.document-actions{display:flex;gap:10px;flex-shrink:0}.tabs{display:flex;border-bottom:1px solid var(--line);margin:20px 0}.tab{border:0;background:none;padding:14px 22px;font-size:12px;color:var(--muted)}.tab.active{border-bottom:2px solid var(--teal);color:var(--teal);font-weight:600}.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:15px}.stat{border:1px solid var(--line);border-radius:8px;background:white;padding:20px;margin-bottom:20px}.stat strong{display:block;font-size:27px;font-weight:600}.stat span{font-size:10px;color:var(--muted)}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;font-size:11px}th{text-align:left;padding:12px;background:#f5f8f9;color:#6b8089;font-size:9px;letter-spacing:.4px}td{padding:14px 12px;border-bottom:1px solid var(--line);vertical-align:top}td small{display:block;margin-top:5px;color:var(--muted);max-width:300px}.chat-layout{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:25px}.chat-panel{padding:0;overflow:hidden}.chat-guide h3{margin-top:0}.chat-guide p{line-height:1.8}.chat-guide .notice{margin-top:22px}.prompt{display:block;width:100%;text-align:left;padding:13px 0;border:0;border-bottom:1px solid var(--line);background:none;font-size:11px;color:var(--teal)}#chat-messages{height:470px;overflow:auto;padding:25px;display:flex;flex-direction:column;gap:22px}.message{max-width:93%;font-size:12px;line-height:1.8;white-space:pre-wrap}.message.user{margin-left:auto;background:#edf5f3;padding:12px 17px;border-radius:10px 10px 0 10px}.message.assistant{padding:0 5px}.message-label{font-size:9px;letter-spacing:.8px;font-weight:700;color:var(--teal);margin-bottom:6px}.message .button{margin-top:12px}#chat-form{display:flex;gap:12px;padding:18px;border-top:1px solid var(--line);background:#fbfcfc}#chat-form textarea{resize:vertical}#chat-form button{align-self:end}.diagnostic-intro{display:grid;grid-template-columns:1fr 1fr;gap:20px}.diagnostic-intro p{line-height:1.8;margin:12px 0 18px}.large-icon{font-size:25px;color:var(--teal)}.limitations{font-size:12px;color:#68808c;line-height:1.8;padding-left:18px}.limitations li{margin:10px 0}.toast{position:fixed;bottom:28px;right:28px;max-width:470px;background:var(--navy);color:white;padding:16px 23px;border-radius:8px;box-shadow:0 6px 24px #162b4333;z-index:100;font-size:12px}.toast.error{background:#8e3435}dialog{border:1px solid var(--line);border-radius:12px;width:min(950px,90vw);max-height:85vh;padding:28px}dialog::backdrop{background:#102b3966}.doc-page{border-top:1px solid var(--line);padding-top:15px;margin-top:20px}.doc-page pre{font-size:12px}footer{font-size:9px;color:#93a0a8;padding-top:35px;display:flex;justify-content:space-between;gap:20px;margin:20px 0}.hidden{display:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0)}.loading{opacity:.6;pointer-events:none}.spin{animation:pulse 1s infinite alternate}@keyframes pulse{to{opacity:.3}}@media(max-width:1100px){.sidebar{width:205px;padding-left:10px;padding-right:10px}.main-shell{margin-left:205px}main{padding:28px 25px}.topbar{padding:0 25px}.search-row{grid-template-columns:1fr 1fr}.search-row .button{grid-column:1/-1}.card-bottom{align-items:start;flex-direction:column}.card-actions{align-self:flex-end}.chat-layout{grid-template-columns:1fr}.chat-guide{display:none}.heading{align-items:start}.heading>.button{max-width:180px;white-space:normal}}@media(max-width:720px){.sidebar{position:static;width:auto;padding:14px;display:block}.brand{padding:0 8px 14px;font-size:20px}.brand-icon{width:30px;height:33px}.sidebar-note,.profile-mini,.workspace-label{display:none}nav{display:flex;overflow:auto;gap:4px}.nav{white-space:nowrap;font-size:10px;padding:7px 10px}.nav span{display:none}.main-shell{margin:0}.topbar{height:48px;padding:0 16px}.topbar .crumb,.crumb-sep{display:none}main{padding:25px 16px}.heading{flex-direction:column;gap:12px}h1{font-size:27px}.source-banner{padding:14px;align-items:start}.source-icon{display:none}.source-banner .text-button{display:none}.search-row,.form-grid,.filters .form-grid{grid-template-columns:1fr}.search-actions,.form-footer,.upload-form{align-items:stretch;flex-direction:column;gap:15px}.card-data{gap:18px}.card-bottom{gap:20px}.process-card h3{max-width:100%}.card-actions{align-self:stretch;justify-content:space-between}.diagnostic-intro{grid-template-columns:1fr;gap:0}.stats-grid{grid-template-columns:1fr 1fr;gap:10px}.stat{margin-bottom:0}.stats-grid{margin-bottom:20px}.document-row{align-items:start;flex-direction:column;gap:10px}.section-title{align-items:start;flex-direction:column}.panel{padding:18px}.chat-panel{padding:0}#chat-messages{height:400px;padding:18px}#chat-form{padding:12px;gap:8px}footer{flex-direction:column;gap:8px}.toast{bottom:15px;left:15px;right:15px}.results-toolbar{gap:10px}.results-toolbar h2{font-size:15px}}

.viewer-toolbar,.chat-evidence{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.viewer-toolbar label{min-width:130px;margin:0}.original-preview{width:100%;height:65vh;object-fit:contain;border:1px solid var(--line);margin-top:15px}.chat-evidence{margin-top:14px}.chat-evidence>p,.chat-evidence>details{width:100%}.citation-button{white-space:normal;text-align:left;max-width:100%;overflow-wrap:anywhere}.graph-edge{display:flex;align-items:center;gap:15px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding:12px 0}.graph-edge span{font-size:11px;color:var(--muted)}#document-modal{width:min(1150px,96vw);max-width:96vw}#document-content{min-width:0}#open-data-result dd{overflow-wrap:anywhere}#open-data-result details{display:block}.chat-panel,.chat-layout>*{min-width:0}@media(max-width:720px){#document-modal{padding:14px;max-height:94dvh}.original-preview{height:62dvh}.viewer-toolbar{align-items:stretch}.viewer-toolbar>*{flex:1 1 130px}.document-actions{flex-wrap:wrap;max-width:100%}.document-actions .button{white-space:normal}.graph-edge{display:grid;gap:5px}.chat-evidence details pre{max-height:250px;overflow:auto}}
#document-content,.message,.document-row p{overflow-wrap:anywhere}#document-modal{overflow-x:hidden}#document-title{overflow-wrap:anywhere;min-width:0}
/* Los nombres originales largos conservan legibilidad en el visor de referencias móvil. */
#view-references .panel, #view-references .section-title>div { min-width:0; }
#view-references .button { white-space:normal; overflow-wrap:anywhere; max-width:100%; text-align:left; }
#view-references h2, #view-references p, #view-references summary { overflow-wrap:anywhere; }
#view-references .reference-documents { display:flex; flex-wrap:wrap; gap:8px; margin:20px 0; }
#view-references .reference-documents h3, #view-references .reference-documents p { flex-basis:100%; }

/* Avance real de consultas y fuentes legibles en escritorio y móvil. */
#chat-progress{padding:16px;border-bottom:1px solid var(--line,#dce5e8);max-height:42vh;overflow:auto;background:#f5faf9}
.process-lights{display:flex;flex-wrap:wrap;gap:12px;margin:12px 0;white-space:normal}
.process-step{display:flex;align-items:flex-start;gap:7px;font-size:11px;color:#637785;flex:1 1 100px;min-width:0}
.process-step small{display:block;font-size:10px;margin-top:3px}
.process-bulb{display:inline-block;flex:0 0 10px;height:10px;border:1px solid #a2b2ba;border-radius:50%;margin-top:2px;background:#e3e9ec}
.process-step.running .process-bulb{background:#ecb442;border-color:#cb982d;box-shadow:0 0 8px #e9bd60;animation:process-pulse 1.5s ease-in-out infinite}
.process-step.done .process-bulb{background:#348a72;border-color:#348a72;box-shadow:0 0 5px #9fcec0}
.process-step.error .process-bulb{background:#be603c;border-color:#be603c}
.process-step.skipped{opacity:.65}.process-step.skipped .process-bulb{background:transparent}
.process-log{white-space:normal;font-size:12px}.process-log ol{padding-left:20px}.process-log li{margin:12px 0;overflow-wrap:anywhere}.process-log p{margin:4px 0}.process-log details{margin:8px 0}
.source-table-wrap{max-width:100%;overflow-x:auto;margin:12px 0;white-space:normal;border:1px solid #dce5e8;border-radius:6px}
.source-table{width:100%;border-collapse:collapse;font-size:12px;text-align:left}.source-table td,.source-table th{padding:10px;vertical-align:top;border-bottom:1px solid #e3eaed;overflow-wrap:anywhere;min-width:100px;max-width:400px}.source-table th{background:#f3f7f8;font-weight:600}.source-table tbody th{width:32%}
.source-card{white-space:normal;padding:14px;border:1px solid #dce5e8;border-radius:8px;margin:12px 0;background:#fbfdfd;overflow-wrap:anywhere}.source-card strong{display:block}.source-card blockquote{margin:12px 0;border-left:3px solid #91b6ad;padding-left:12px}.source-card .text-button{margin-left:12px}
.chat-evidence{min-width:0;white-space:normal}.chat-evidence pre{max-height:300px;overflow:auto}.message{min-width:0;overflow-wrap:anywhere}#chat-handoff[hidden],#chat-progress[hidden]{display:none}
.company-choices{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}.company-choices button{flex:1 1 200px;white-space:normal;text-align:left}.company-choices small{display:block;margin-top:5px}
@keyframes process-pulse{50%{box-shadow:0 0 2px #e9bd60;opacity:.65}}
@media(prefers-reduced-motion:reduce){.process-step.running .process-bulb{animation:none}}
@media(max-width:600px){.process-step{flex-basis:85px}.source-card .text-button{display:block;margin:12px 0 0}.source-table td,.source-table th{padding:8px}.chat-panel{min-width:0}.source-card .button{max-width:100%;white-space:normal}}
.chat-evidence{display:block}.chat-evidence>*{min-width:0;max-width:100%}.chat-evidence>.source-card,.chat-evidence>div{width:100%}
#chat-form textarea{flex:1 1 0;min-width:0;width:auto}#chat-form button{flex:0 0 auto}
#chat-messages{overflow-x:hidden}.message.assistant{flex:0 0 auto;width:93%}
