/* OASIS Studio — capa visual "Studio" (ventana flotante, tipografía 15px, un acento, iconos monolínea) */

:root{
  --font:"Inter",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;
  --r:12px;--r-lg:16px;--r-pill:999px;
  --bg:#eef1f5;--panel:#ffffff;--panel2:#f4f4f5;--line:#e4e4e7;--txt:#18181b;--muted:#71717a;
  --acc:#2563eb;--acc2:#1d4ed8;--acc-soft:#eff4ff;
  --ok:#16a34a;--ok-soft:#e7f7ec;--warn:#b45309;--warn-soft:#fff4e0;--bad:#dc2626;--bad-soft:#fdecec;
  --pos:#16a34a;--neg:#dc2626;--neu:#71717a;
  --shadow:0 24px 60px rgba(15,23,42,.18),0 2px 6px rgba(15,23,42,.06);
  --sky1:#cfe0f7;--sky2:#9fbfe9;--sky3:#e9eef7;
}
html[data-theme="dark"]{
  --bg:#0b0d12;--panel:#15181f;--panel2:#1d2129;--line:#2a2f3a;--txt:#ececf1;--muted:#8b8f9c;
  --acc:#3b82f6;--acc2:#60a5fa;--acc-soft:#182238;
  --ok:#22c55e;--ok-soft:#14301f;--warn:#f59e0b;--warn-soft:#352810;--bad:#ef4444;--bad-soft:#3a1717;
  --shadow:0 24px 60px rgba(0,0,0,.55);
  --sky1:#1a2740;--sky2:#0f1a2e;--sky3:#101522;
}

/* ---- Ventana flotante ---- */
html,body{font-size:15px;line-height:1.5}
body{
  /* Escena de fondo: atardecer sobre colinas (SVG propio, sin derechos de terceros).
     Para usar una fotografía, sustituye la URL por la imagen deseada. */
  background:var(--scene,url("scene.svg")) center/cover no-repeat fixed,var(--bg);
}
html[data-theme="dark"] body{--scene:url("scene-dark.svg")}
#app{
  margin:16px;height:calc(100vh - 32px);border-radius:var(--r-lg);overflow:hidden;
  background:var(--panel);box-shadow:0 30px 80px rgba(20,10,30,.35),0 2px 8px rgba(0,0,0,.08);border:1px solid rgba(255,255,255,.6);
  grid-template-columns:264px 1fr;
}
html[data-theme="dark"] #app{border-color:rgba(255,255,255,.06)}
@media (max-width:900px){#app{margin:0;height:100vh;border-radius:0;grid-template-columns:1fr}#sidebar{display:none}}

/* ---- Barra lateral ---- */
#sidebar{background:var(--panel);border-right:1px solid var(--line)}
.brand{padding:18px 18px 14px;border-bottom:0}
.brand .logo{width:32px;height:32px;border-radius:8px;background:var(--txt);color:var(--panel);font-size:12px}
.brand b{font-size:15px;font-weight:600}.brand small{font-size:12px}
nav{padding:6px 12px}
.nav{padding:9px 12px;border-radius:10px;font-size:14.5px;gap:10px;color:var(--txt)}
.nav:hover{background:var(--panel2)}
.nav.active{background:var(--panel2);box-shadow:none;font-weight:500}
.nav>span:first-child{display:inline-flex;width:18px;height:18px;color:var(--muted)}
.nav.active>span:first-child{color:var(--txt)}
.nav>span:first-child svg{width:18px;height:18px}
.nav-group{font-size:11.5px;letter-spacing:.06em;padding:18px 12px 6px;font-weight:500}
.nav-more{border-top:1px solid var(--line);margin-top:12px;padding-top:6px}
.nav-more>summary{padding:10px 12px 6px}
#nav-recents .nav{font-size:13.5px;padding:7px 12px}
#nav-recents .nav small{font-size:11px}
.sidebar-foot{border-top:1px solid var(--line);padding:10px 12px}
.sidebar-user{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:10px;cursor:pointer;position:relative}
.sidebar-user:hover{background:var(--panel2)}
.sidebar-user .av{width:30px;height:30px;border-radius:50%;background:var(--panel2);border:1px solid var(--line);display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;color:var(--txt)}
.sidebar-user .nm{flex:1;min-width:0;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-user .nm small{display:block;color:var(--muted);font-size:11.5px}
.user-menu{position:absolute;left:8px;right:8px;bottom:calc(100% + 6px);background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);padding:6px;display:none;z-index:40}
.user-menu.open{display:block}
.user-menu a{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:8px;font-size:14px;cursor:pointer;color:var(--txt)}
.user-menu a:hover{background:var(--panel2)}
.user-menu .theme-row{display:flex;gap:4px;padding:6px 10px}
.user-menu .theme-row .btn{flex:1;padding:4px;font-size:12px}
.theme-toggle{display:none}

/* ---- Barra superior ---- */
#topbar{padding:14px 28px;border-bottom:1px solid var(--line)}
#crumb{font-weight:500;font-size:14.5px;color:var(--muted)}
#crumb b{color:var(--txt);font-weight:500}
#crumb .sep{margin:0 8px;color:var(--line)}
#view{padding:28px 32px 96px}

/* ---- Tipografía base ---- */
h1.st-title{font-size:28px;font-weight:500;letter-spacing:-.01em;margin:0 0 18px;line-height:1.2}
h2.title{font-size:22px;font-weight:500}
.st-label{font-size:12.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:500}
.btn{border-radius:10px;font-size:14px;padding:8px 14px;background:var(--panel);display:inline-flex;align-items:center;gap:8px}
.btn:hover{border-color:#c9ccd3}
.btn.primary{background:var(--txt);border-color:var(--txt);color:var(--panel);font-weight:500}
.btn.primary:hover{opacity:.9}
.btn.accent{background:var(--acc);border-color:var(--acc);color:#fff;font-weight:500}
.btn.pill{border-radius:var(--r-pill)}
.btn.icon{padding:8px;width:36px;height:36px;justify-content:center}
.btn svg{width:16px;height:16px}
.card{border-radius:var(--r);padding:22px}
input[type=text],input[type=email],input[type=number],input:not([type]),select,textarea{border-radius:10px;font-size:14px;padding:9px 12px}
textarea{line-height:1.5}
.tag{border-radius:var(--r-pill);font-size:12px;padding:3px 10px}

/* ---- Chips de estado ---- */
.chip-state{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:var(--r-pill);font-size:12.5px;font-weight:500;background:var(--panel2);color:var(--muted)}
.chip-state.ok{background:var(--ok-soft);color:var(--ok)}
.chip-state.live{background:var(--acc-soft);color:var(--acc)}
.chip-state.live::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--acc);animation:pulse 1.2s infinite}
.chip-state.bad{background:var(--bad-soft);color:var(--bad)}
.chip-state.warn{background:var(--warn-soft);color:var(--warn)}

/* ---- Inicio ---- */
.st-home{max-width:1100px;margin:0 auto}
.st-hero{padding:48px 0 24px}
.st-hero h1{font-size:30px;font-weight:500;letter-spacing:-.01em;margin:0 0 20px}
.st-ask{display:flex;gap:10px;align-items:stretch;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:8px 8px 8px 16px;box-shadow:0 1px 2px rgba(0,0,0,.03)}
.st-ask:focus-within{border-color:var(--acc);box-shadow:0 0 0 4px var(--acc-soft)}
.st-ask textarea{flex:1;border:0;background:transparent;resize:none;padding:8px 0;font-size:15.5px;min-height:44px;max-height:160px}
.st-ask textarea:focus{outline:none}
.st-ask .btn{align-self:flex-end}
.st-sub{color:var(--muted);font-size:14px;margin:12px 0 0}
.st-section{margin-top:44px}
.st-section-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:14px}
.st-section-head h2{font-size:17px;font-weight:500;margin:0}
.st-section-head a{color:var(--muted);font-size:14px;cursor:pointer}
.st-section-head a:hover{color:var(--txt)}
.st-tpl-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
@media (max-width:1200px){.st-tpl-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.st-tpl{background:var(--panel);border:1px solid var(--line);border-radius:var(--r);padding:20px;cursor:pointer;transition:border-color .15s,transform .15s;display:flex;flex-direction:column;gap:10px;min-height:168px}
.st-tpl:hover{border-color:#c9ccd3;transform:translateY(-1px)}
.st-tpl .ic{width:34px;height:34px;border-radius:9px;background:var(--panel2);display:inline-flex;align-items:center;justify-content:center;color:var(--txt)}
.st-tpl .ic svg{width:18px;height:18px}
.st-tpl h3{margin:0;font-size:15.5px;font-weight:500;line-height:1.35}
.st-tpl p{margin:0;font-size:13.5px;color:var(--muted);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.st-tpl .meta{margin-top:auto;font-size:12.5px;color:var(--muted)}
.st-steps{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin-top:14px}
.st-step{display:flex;gap:12px;align-items:flex-start;padding:16px;border:1px solid var(--line);border-radius:var(--r);background:var(--panel)}
.st-step .n{width:26px;height:26px;border-radius:50%;background:var(--panel2);display:inline-flex;align-items:center;justify-content:center;font-size:12.5px;font-weight:600;flex:none}
.st-step b{display:block;font-size:14px;font-weight:500}
.st-step small{color:var(--muted);font-size:12.5px;line-height:1.4}
@media (max-width:1100px){.st-steps{grid-template-columns:1fr 1fr}}
.st-table{width:100%;border-collapse:separate;border-spacing:0;background:var(--panel);border:1px solid var(--line);border-radius:var(--r);overflow:hidden;font-size:14px}
.st-table th{font-size:12.5px;color:var(--muted);font-weight:500;padding:12px 16px;border-bottom:1px solid var(--line);background:var(--panel2)}
.st-table td{padding:14px 16px;border-bottom:1px solid var(--line);vertical-align:middle}
.st-table tr:last-child td{border-bottom:0}
.st-table tr.row-click{cursor:pointer}
.st-table tr.row-click:hover td{background:var(--panel2)}
.st-table td.t{font-weight:500}
.st-table td.m{color:var(--muted)}
.st-filters{display:flex;gap:6px;margin-bottom:12px}
.st-filters .btn{padding:5px 12px;font-size:13px}
.st-filters .btn.on{background:var(--panel2);font-weight:500}

/* ---- Espacio de trabajo ---- */
.st-ws{max-width:1280px;margin:0 auto}
.st-ws-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:6px}
.st-ws-head h1{margin:0 0 14px}
.st-ws-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.st-tabs{display:flex;gap:4px;align-items:center;margin:0 0 24px;border-bottom:1px solid var(--line)}
.st-tab{padding:10px 14px;border:0;background:transparent;color:var(--muted);font:inherit;font-size:14.5px;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;display:inline-flex;gap:8px;align-items:center;border-radius:8px 8px 0 0}
.st-tab:hover{color:var(--txt);background:var(--panel2)}
.st-tab.active{color:var(--txt);border-bottom-color:var(--txt);font-weight:500}
.st-tab .cnt{font-size:11.5px;color:var(--muted);background:var(--panel2);padding:1px 7px;border-radius:var(--r-pill)}
.st-tab.active .cnt{background:var(--acc-soft);color:var(--acc)}
.st-tabs .sp{flex:1}
.st-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:28px;align-items:start}
@media (max-width:1100px){.st-layout{grid-template-columns:1fr}}

.st-grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
@media (max-width:760px){.st-grid2{grid-template-columns:1fr}}
.st-card{background:var(--panel);border:1px solid var(--line);border-radius:var(--r);padding:22px;display:flex;flex-direction:column;gap:12px;min-height:200px;transition:border-color .15s}
.st-card:hover{border-color:#c9ccd3}
.st-card.sel{border-color:var(--acc);box-shadow:0 0 0 1px var(--acc)}
.st-card-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.st-card-head h3,.st-card-head h2{margin:0;font-size:15.5px;font-weight:500}
.st-card .more{margin-top:auto;align-self:flex-start}
.st-list{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}
.st-list li{display:flex;gap:10px;align-items:flex-start;font-size:14px;line-height:1.45}
.st-list li .k{width:22px;height:22px;border-radius:50%;border:1px solid var(--line);display:inline-flex;align-items:center;justify-content:center;font-size:11px;color:var(--muted);flex:none;margin-top:1px}
.st-list li .del{margin-left:auto;opacity:0;color:var(--muted);cursor:pointer;display:inline-flex}
.st-list li:hover .del{opacity:1}
.st-list li .del svg{width:14px;height:14px}
.st-empty{color:var(--muted);font-size:14px;padding:12px 0}
.st-textarea{width:100%;min-height:96px;border:1px solid transparent;background:var(--panel2);border-radius:10px;padding:12px;font:inherit;font-size:14.5px;resize:vertical}
.st-textarea:focus{outline:none;border-color:var(--acc);background:var(--panel)}
.st-input{width:100%;border:1px solid var(--line);background:var(--panel);border-radius:10px;padding:9px 12px;font:inherit;font-size:14.5px}
.st-input:focus{outline:none;border-color:var(--acc);box-shadow:0 0 0 3px var(--acc-soft)}
.st-files{display:flex;flex-direction:column;gap:6px}
.st-file{display:flex;align-items:center;gap:10px;font-size:14px;padding:8px 10px;border-radius:8px;background:var(--panel2)}
.st-file svg{width:16px;height:16px;color:var(--muted)}
.st-file .del{margin-left:auto;cursor:pointer;color:var(--muted);display:inline-flex}

/* tarjetas de pregunta / audiencia */
.st-qgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
@media (max-width:760px){.st-qgrid{grid-template-columns:1fr}}
.st-q{background:var(--panel);border:1px solid var(--line);border-radius:var(--r);padding:22px;display:flex;flex-direction:column;gap:14px}
.st-q:hover{border-color:#c9ccd3}
.st-q-top{display:flex;align-items:center;gap:8px}
.st-badge{display:inline-flex;align-items:center;gap:6px;padding:3px 9px;border-radius:8px;background:var(--panel2);font-size:12.5px;color:var(--txt);font-weight:500}
.st-badge svg{width:13px;height:13px;color:var(--muted)}
.st-q-top .cm{margin-left:auto;color:var(--muted);font-size:12.5px;display:inline-flex;gap:4px;align-items:center}
.st-q-top .cm svg{width:14px;height:14px}
.st-q h3,.st-q h2{margin:0;font-size:19px;font-weight:500;line-height:1.3;letter-spacing:-.005em}
.st-opts{display:flex;flex-direction:column;gap:8px}
.st-opt{display:flex;align-items:center;gap:12px;font-size:14.5px}
.st-opt .k{width:24px;height:24px;border-radius:50%;border:1px solid var(--line);display:inline-flex;align-items:center;justify-content:center;font-size:11.5px;color:var(--muted);flex:none}
.st-free{border:1px solid var(--line);border-radius:10px;padding:12px;color:var(--muted);font-size:14px}
.st-q .foot{margin-top:auto;display:flex;gap:8px;align-items:center}
.st-q .foot .del{margin-left:auto;color:var(--muted);cursor:pointer;opacity:0;display:inline-flex}
.st-q:hover .foot .del{opacity:1}
.st-aud h3,.st-aud h2{font-size:20px}
.st-aud .lbl{font-size:12.5px;color:var(--muted);margin-top:4px}
.st-aud p{margin:2px 0 0;font-size:14.5px;line-height:1.5;color:var(--txt)}
.st-aud .cnt{font-size:16px;font-weight:500}
.st-aud .traits{display:flex;gap:6px;flex-wrap:wrap}
.st-add{border:1px dashed var(--line);border-radius:var(--r);display:flex;align-items:center;justify-content:center;gap:8px;color:var(--muted);cursor:pointer;min-height:140px;font-size:14px;background:transparent}
.st-add:hover{border-color:var(--acc);color:var(--acc);background:var(--acc-soft)}

/* panel derecho */
.st-props{display:flex;flex-direction:column;gap:14px;position:sticky;top:0}
.st-sec{background:var(--panel);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.st-sec>summary{list-style:none;display:flex;justify-content:space-between;align-items:center;padding:14px 18px;font-size:15px;font-weight:500;cursor:pointer}
.st-sec>summary::-webkit-details-marker{display:none}
.st-sec>summary svg{width:16px;height:16px;color:var(--muted);transition:transform .15s}
.st-sec[open]>summary svg{transform:rotate(180deg)}
.st-sec .body{padding:0 18px 12px}
.st-prow{display:flex;justify-content:space-between;align-items:center;min-height:44px;font-size:14.5px;gap:12px}
.st-prow .l{color:var(--muted)}
.st-prow .v{display:inline-flex;align-items:center;gap:8px;text-align:right}
.st-prow .v .av{width:22px;height:22px;border-radius:50%;background:var(--panel2);border:1px solid var(--line);font-size:10px;display:inline-flex;align-items:center;justify-content:center;font-weight:600}
.st-prow select,.st-prow input{width:150px;padding:5px 8px;font-size:13.5px}
.st-progress{height:6px;background:var(--panel2);border-radius:99px;overflow:hidden;margin:6px 0 10px}
.st-progress i{display:block;height:100%;background:var(--acc);border-radius:99px;transition:width .4s}
.st-runbar{display:flex;gap:6px;margin:8px 0 6px}
.st-runbar .btn{flex:1;justify-content:center;padding:7px}
.st-steps-mini{display:flex;flex-direction:column;gap:6px;padding:4px 0 6px}
.st-steps-mini div{display:flex;gap:10px;align-items:center;font-size:13.5px;color:var(--muted)}
.st-steps-mini div.done{color:var(--txt)}
.st-steps-mini div .d{width:18px;height:18px;border-radius:50%;border:1px solid var(--line);display:inline-flex;align-items:center;justify-content:center;flex:none}
.st-steps-mini div.done .d{background:var(--ok);border-color:var(--ok);color:#fff}
.st-steps-mini div.cur .d{border-color:var(--acc);box-shadow:0 0 0 3px var(--acc-soft)}
.st-steps-mini svg{width:11px;height:11px}
.st-adv a{display:flex;align-items:center;gap:10px;padding:9px 0;font-size:14.5px;cursor:pointer;color:var(--txt);border-top:1px solid var(--line)}
.st-adv a:first-child{border-top:0}
.st-adv a:hover{color:var(--acc)}
.st-adv a svg{width:16px;height:16px;color:var(--muted)}
.st-adv a .ar{margin-left:auto}
.st-adv .grp{font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);padding:10px 0 2px;font-weight:500}

/* resultados */
.st-res{display:grid;grid-template-columns:220px minmax(0,1fr);gap:28px;align-items:start}
@media (max-width:900px){.st-res{grid-template-columns:1fr}}
.st-toc{position:sticky;top:0;display:flex;flex-direction:column;gap:2px}
.st-toc .st-label{padding:0 10px 8px}
.st-toc a{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8px;font-size:14px;color:var(--txt);cursor:pointer}
.st-toc a:hover,.st-toc a.on{background:var(--panel2)}
.st-toc a .k{font-size:11px;color:var(--muted);background:var(--panel2);border:1px solid var(--line);padding:1px 6px;border-radius:6px;min-width:26px;text-align:center}
.st-toc .meta{padding:16px 10px 0;color:var(--muted);font-size:13px;line-height:1.8;border-top:1px solid var(--line);margin-top:10px}
.st-res-main{display:flex;flex-direction:column;gap:18px}
.st-res-main .gen{color:var(--muted);font-size:13.5px;letter-spacing:.02em}
.st-lead{font-size:22px;line-height:1.4;font-weight:400;letter-spacing:-.005em;margin:0}
.st-find{background:var(--panel);border:1px solid var(--line);border-radius:var(--r);padding:20px 22px;display:flex;flex-direction:column;gap:14px;scroll-margin-top:16px}
.st-find .h{display:flex;gap:12px;align-items:flex-start}
.st-find .h .k{font-size:11px;color:var(--muted);background:var(--panel2);border:1px solid var(--line);padding:2px 7px;border-radius:6px;flex:none;margin-top:3px}
.st-find .h h3,.st-find .h h2{margin:0;font-size:17px;font-weight:500;line-height:1.35}
.st-bars{display:flex;flex-direction:column;gap:8px}
.st-bar{display:grid;grid-template-columns:48px 160px 1fr;gap:12px;align-items:center;font-size:14px}
.st-bar .p{font-weight:500;text-align:right}
.st-bar .t{height:8px;background:var(--panel2);border-radius:99px;overflow:hidden}
.st-bar .t i{display:block;height:100%;background:var(--line);border-radius:99px}
.st-bar.top .t i{background:var(--acc)}
.st-bar .l{color:var(--txt)}
.st-quotes{display:flex;flex-direction:column;gap:8px}
.st-quote{font-size:14px;color:var(--txt);padding:10px 14px;background:var(--panel2);border-radius:10px;line-height:1.5}
.st-quote b{color:var(--muted);font-weight:500;font-size:12.5px;display:block;margin-bottom:2px}
.st-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.st-kpi{background:var(--panel);border:1px solid var(--line);border-radius:var(--r);padding:16px 18px}
.st-kpi small{color:var(--muted);font-size:12.5px;display:block}
.st-kpi b{font-size:24px;font-weight:500;display:block;margin:2px 0}
.st-kpi .chip-state{margin-top:4px}
.st-md{font-size:15px;line-height:1.65}
.st-md h1,.st-md h2,.st-md h3{font-weight:500;letter-spacing:-.005em}
.st-md h2{font-size:19px;margin:22px 0 8px}
.st-md h3{font-size:16px;margin:16px 0 6px}
.st-md table{font-size:13.5px}
.st-adv-res{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
@media (max-width:900px){.st-adv-res{grid-template-columns:repeat(2,1fr)}}
.st-adv-res a{display:flex;flex-direction:column;gap:6px;padding:14px;border:1px solid var(--line);border-radius:10px;cursor:pointer;color:var(--txt);font-size:14px;background:var(--panel)}
.st-adv-res a:hover{border-color:var(--acc)}
.st-adv-res a svg{width:18px;height:18px;color:var(--muted)}
.st-adv-res a small{color:var(--muted);font-size:12.5px}

/* estado vacío */
.st-blank{text-align:center;padding:64px 24px;border:1px dashed var(--line);border-radius:var(--r);color:var(--muted)}
.st-blank .ic{width:44px;height:44px;border-radius:12px;background:var(--panel2);display:inline-flex;align-items:center;justify-content:center;margin-bottom:12px;color:var(--txt)}
.st-blank .ic svg{width:22px;height:22px}
.st-blank h3{margin:0 0 6px;font-size:17px;font-weight:500;color:var(--txt)}
.st-blank p{margin:0 0 16px;font-size:14px}

/* ---- Drawer para vistas avanzadas ---- */
#drawer{position:fixed;inset:0;z-index:45;display:flex;justify-content:flex-end;background:rgba(15,23,42,.35);backdrop-filter:blur(2px)}
#drawer .panel{width:min(1180px,94vw);height:100%;background:var(--panel);display:flex;flex-direction:column;box-shadow:-20px 0 60px rgba(0,0,0,.2);animation:drawer-in .22s ease}
@keyframes drawer-in{from{transform:translateX(24px);opacity:0}to{transform:none;opacity:1}}
#drawer header{display:flex;align-items:center;gap:12px;padding:14px 22px;border-bottom:1px solid var(--line)}
#drawer header b{font-weight:500;font-size:15.5px}
#drawer header small{color:var(--muted)}
#drawer header .x{margin-left:auto}
#drawer .dbody{flex:1;overflow:auto;padding:24px 28px}

/* ---- Botón flotante Preguntar ---- */
#st-ask-fab{position:fixed;right:28px;bottom:28px;z-index:30;display:inline-flex;align-items:center;gap:8px;padding:10px 16px;border-radius:var(--r-pill);background:var(--panel);border:1px solid var(--line);box-shadow:0 10px 30px rgba(15,23,42,.15);font:inherit;font-size:14px;font-weight:500;color:var(--txt);cursor:pointer}
#st-ask-fab:hover{border-color:#c9ccd3;transform:translateY(-1px)}
#st-ask-fab svg{width:16px;height:16px;color:var(--acc)}
body.auth-mode #st-ask-fab,body.public-mode #st-ask-fab{display:none}

/* iconos */
.ic-i{display:inline-flex;width:16px;height:16px;vertical-align:-3px}
.ic-i svg{width:100%;height:100%}

/* oculta elementos del esquema anterior que compiten con el nuevo */
#wizard,.design-bar{display:none !important}

/* duplicados del esquema anterior: la cuenta vive en el avatar inferior */
#sidebar nav > .nav[data-go="account"]{display:none}
.top-actions #account{display:none}
/* pasos de "Cómo funciona": sin recorte */
.st-step{min-height:112px;align-items:flex-start}
.st-step small{display:block}
/* el botón flotante no tapa el panel derecho */
#view{padding-bottom:120px}
#st-ask-fab{right:24px;bottom:20px}
@media (max-width:1100px){#st-ask-fab{bottom:16px}}

/* formularios en sitio */
.hidden{display:none !important}
.st-inline{display:flex;flex-direction:column;gap:8px;padding-top:4px}
.st-form{border-style:dashed;border-color:var(--acc);background:var(--acc-soft)}
html[data-theme="dark"] .st-form{background:var(--panel2)}
.st-seg{display:flex;gap:4px;flex-wrap:wrap}
.st-seg button{border:1px solid var(--line);background:var(--panel);border-radius:var(--r-pill);padding:5px 11px;font:inherit;font-size:13px;cursor:pointer;display:inline-flex;gap:6px;align-items:center;color:var(--muted)}
.st-seg button.on{background:var(--txt);color:var(--panel);border-color:var(--txt)}
.st-seg button svg{color:currentColor}
.st-form .st-opt input{padding:7px 10px}
.st-tools{display:flex;gap:8px;align-items:center;margin-bottom:16px;flex-wrap:wrap}
.st-note{display:flex;gap:8px;align-items:center;font-size:13.5px;color:var(--muted);padding:10px 14px;border:1px solid var(--line);border-radius:10px;margin-bottom:16px;background:var(--panel)}
.st-note svg{width:15px;height:15px;flex:none}
.st-aud.implicit{border-style:dashed}
.st-avs{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}
.st-av{width:28px;height:28px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:11.5px;font-weight:600;cursor:pointer;border:1.5px solid var(--panel);box-shadow:0 0 0 1px var(--line);background:var(--panel2);color:var(--txt)}
.st-av.pos{background:var(--ok-soft);color:var(--ok)}.st-av.neg{background:var(--bad-soft);color:var(--bad)}.st-av.neu{background:var(--panel2);color:var(--muted)}
.st-av.more{font-size:10.5px;color:var(--muted)}
.st-av:hover{transform:translateY(-1px)}
.st-prow a.link{color:var(--txt);cursor:pointer;text-decoration:none}
.st-prow a.link:hover{color:var(--acc)}
.st-timeline{display:flex;gap:6px;overflow-x:auto;padding-bottom:4px}
.st-tl-r{min-width:92px;flex:1;border:1px solid var(--line);border-radius:10px;padding:8px;display:flex;flex-direction:column;gap:4px;background:var(--panel2)}
.st-tl-r.has{background:var(--panel)}
.st-tl-r .rn{font-size:11.5px;color:var(--muted);font-weight:500;letter-spacing:.04em}
.st-tl-r .ev{font-size:12px;background:var(--acc-soft);color:var(--acc);border-radius:6px;padding:2px 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.st-tl-r .ev.more{background:transparent;color:var(--muted)}

/* pasada UX */
body[data-view="studio"] #btn-save-scenario{display:none}
h1.st-title.editable{outline:none;border-radius:8px;padding:2px 6px;margin-left:-6px;cursor:text}
h1.st-title.editable:hover{background:var(--panel2)}
h1.st-title.editable:focus{background:var(--panel2);box-shadow:0 0 0 2px var(--acc-soft)}
.st-props{padding-bottom:72px}
.st-tl-r{min-width:120px}
.st-tl-r .ev{white-space:normal;line-height:1.3;max-height:2.6em;overflow:hidden}
.st-card .st-empty{line-height:1.5}

/* ---- homologación de vistas antiguas (dentro del drawer y fuera) ---- */
#drawer header b{font-weight:500;color:var(--muted)}
#drawer header small{color:var(--txt);font-weight:500}
h2.title{font-size:24px;font-weight:500;letter-spacing:-.01em;margin:0 0 6px}
p.lead,.lead{font-size:15px;color:var(--muted);line-height:1.55;max-width:860px}
.card h3{font-size:15.5px;font-weight:500;margin:0 0 10px}
.card .sub,.sub{font-size:13.5px;color:var(--muted);line-height:1.5}
label{font-size:13.5px;color:var(--muted)}
.btn.sm{padding:5px 11px;font-size:13px;border-radius:8px}
.btn.danger{background:transparent}
.tip{width:16px;height:16px;font-size:10.5px;background:transparent;border-color:var(--line);color:var(--muted);vertical-align:middle}
.tip:hover{background:var(--txt);border-color:var(--txt);color:var(--panel)}
.tip[data-t]:hover::after{background:var(--txt);color:var(--panel);border:0;border-radius:10px;font-size:12.5px;line-height:1.45;padding:10px 12px;max-width:320px;box-shadow:var(--shadow)}
.tip[data-t]:hover::before{border-top-color:var(--txt)}
table{font-size:14px}
th{font-size:12.5px;font-weight:500;letter-spacing:.02em}
th,td{padding:10px 12px}
.persona-grid{grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.pcard{background:var(--panel);border-radius:12px;padding:14px}
.pcard .av{width:34px;height:34px;font-size:12.5px;font-weight:600;color:var(--txt)}
.pcard .av[style*="rgb(239"],.pcard .av[style*="#ef4444"],.pcard .av[style*="#f25f5c"]{background:var(--bad-soft) !important;color:var(--bad) !important}
.pcard .av[style*="rgb(34"],.pcard .av[style*="#22c55e"],.pcard .av[style*="#4cd68a"]{background:var(--ok-soft) !important;color:var(--ok) !important}
.pcard b{font-size:14px;font-weight:500}
.kpi b{font-size:26px;font-weight:500}
.grid.g3,.grid.g4{gap:16px}
.wizard,.design-bar{display:none !important}
#drawer .dbody>h2.title:first-child,#drawer .dbody>.row:first-child h2.title{margin-top:0}
.modal-card{border-radius:16px;padding:26px;width:min(640px,94vw);box-shadow:var(--shadow)}
.dlg h3{font-size:18px;font-weight:500;margin:0 0 10px}
input[type=range]{accent-color:var(--txt)}
/* ficha de agente */
.st-agent{display:flex;flex-direction:column;gap:16px}
.st-agent .h{display:flex;gap:14px;align-items:center}
.st-agent .h h3{margin:0;font-size:20px;font-weight:500}
.st-agent .av{width:48px;height:48px;border-radius:50%;background:var(--panel2);display:inline-flex;align-items:center;justify-content:center;font-weight:600;font-size:16px;flex:none}
.st-agent .av.ok{background:var(--ok-soft);color:var(--ok)}.st-agent .av.bad{background:var(--bad-soft);color:var(--bad)}
.st-agent .lbl{font-size:12px;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);margin-bottom:3px;font-weight:500}
.st-agent-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px 16px;font-size:14.5px}
.st-agent p{margin:0;font-size:14.5px;line-height:1.55}
.st-tr-row{display:flex;align-items:center;gap:10px;font-size:13.5px;color:var(--muted);margin:5px 0}
.st-tr-row b{color:var(--txt);font-weight:500;min-width:32px;text-align:right}
.st-tr{flex:1;height:6px;background:var(--panel2);border-radius:99px;position:relative;overflow:hidden}
.st-tr i{display:block;height:100%;background:var(--txt);border-radius:99px}
.st-tr.stance{overflow:visible}
.st-tr.stance::before{content:"";position:absolute;left:50%;top:-3px;bottom:-3px;width:1px;background:var(--line)}
.st-tr.stance i{position:absolute;top:-4px;width:14px;height:14px;border-radius:50%;background:var(--acc);transform:translateX(-50%)}

/* ---- accesibilidad WCAG 2.2: foco visible, objetivos ≥24px ---- */
:focus-visible{outline:2px solid var(--acc) !important;outline-offset:2px;border-radius:8px}
.st-tab:focus-visible{outline-offset:-2px}
h1.st-title.editable:focus{outline:2px solid var(--acc);outline-offset:2px}
button.del,.st-list li button.del,.st-file button.del,.st-q .foot button.del{appearance:none;border:0;background:transparent;padding:0;margin:0;font:inherit;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;min-width:28px;min-height:28px;flex:0 0 28px;border-radius:8px;color:var(--muted)}
.st-list li .del{margin-left:auto;opacity:0}.st-list li:hover .del,.st-list li .del:focus-visible{opacity:1}
.st-q .foot .del{margin-left:auto;opacity:0}.st-q:hover .foot .del,.st-q .foot .del:focus-visible{opacity:1}
.st-file .del{margin-left:auto}
.del:hover{background:var(--panel2);color:var(--bad)}
.del svg{width:15px;height:15px}
.st-av{all:unset;box-sizing:border-box;width:28px;height:28px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:11.5px;font-weight:600;cursor:pointer;border:1.5px solid var(--panel);box-shadow:0 0 0 1px var(--line);background:var(--panel2);color:var(--txt)}
.st-av.pos{background:var(--ok-soft);color:var(--ok)}.st-av.neg{background:var(--bad-soft);color:var(--bad)}.st-av.neu{background:var(--panel2);color:var(--muted)}
.st-av.more{font-size:10.5px;color:var(--muted)}
.st-prow a.link{min-height:28px;display:inline-flex;align-items:center;padding:0 4px;border-radius:6px}
.tip{width:20px;height:20px;min-width:20px}
.st-toc a{min-height:32px}
.nav-more>summary,.st-sec>summary{min-height:44px}
.tip{width:24px;height:24px;min-width:24px;font-size:11px}
/* avatares de la vista Personas: tono suave en vez de relleno saturado */
.pcard .av[style*="--neg"]{background:var(--bad-soft) !important;color:var(--bad) !important}
.pcard .av[style*="--pos"]{background:var(--ok-soft) !important;color:var(--ok) !important}
.pcard .av[style*="--neu"]{background:var(--panel2) !important;color:var(--muted) !important}
.persona-grid{width:100%;min-width:0;grid-template-columns:repeat(auto-fill,minmax(220px,1fr)) !important}
#p-grid{width:100%}

/* esqueletos de carga */
.sk{background:linear-gradient(90deg,var(--panel2) 25%,var(--line) 50%,var(--panel2) 75%);background-size:200% 100%;animation:sk 1.2s infinite;border-radius:10px}
@keyframes sk{from{background-position:200% 0}to{background-position:-200% 0}}
.sk-h1{height:34px;width:52%;margin:0 0 20px}.sk-h2{height:20px;width:220px;margin-bottom:14px}.sk-ask{height:62px;border-radius:14px}
.sk-card{height:168px;border-radius:12px}.sk-tabs{height:40px;width:420px;margin:0 0 24px}.sk-line{height:14px;margin:0 0 12px;width:80%}.sk-lead{height:56px;margin-bottom:4px}
/* desglose por audiencia */
.st-byaud{border-top:1px solid var(--line);padding-top:10px}
.st-byaud>summary{list-style:none;cursor:pointer;font-size:13.5px;color:var(--muted);display:inline-flex;gap:6px;align-items:center;min-height:28px}
.st-byaud>summary::-webkit-details-marker{display:none}
.st-byaud-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin-top:10px}
.st-byaud-grid .st-label{margin-bottom:6px;font-size:11.5px}
.st-bar.sm{grid-template-columns:40px 110px 1fr;font-size:13px;gap:8px}

/* exportaciones y subtítulo */
.st-exports a{display:flex;align-items:center;gap:12px;padding:10px 0;border-top:1px solid var(--line);color:var(--txt);text-decoration:none;cursor:pointer;min-height:44px}
.st-exports a:first-child{border-top:0}
.st-exports a>svg:first-child{width:18px;height:18px;color:var(--muted);flex:none}
.st-exports a span{flex:1;min-width:0}
.st-exports a b{display:block;font-weight:500;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.st-exports a small{display:block;color:var(--muted);font-size:12.5px}
.st-exports a:hover b{color:var(--acc)}
.st-subtitle{color:var(--muted);font-size:14.5px;margin:-10px 0 14px}
a.btn{text-decoration:none}

/* bloque de polarización */
.st-pol{display:flex;flex-direction:column;gap:14px}
.st-pol-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
@media (max-width:1100px){.st-pol-grid{grid-template-columns:repeat(2,1fr)}}
.st-pol-grid .st-kpi b{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.st-pol-grid .st-kpi b .d{font-size:13px;color:var(--muted);font-weight:500}
.st-pol-grid .st-kpi.secondary{border-style:dashed}
.st-pol-read{background:var(--panel);border:1px solid var(--line);border-radius:var(--r);padding:18px 20px}
.st-pol-read p{margin:0 0 8px;font-size:14.5px;line-height:1.55}
.st-pol-read p:last-child{margin:0}
.st-refs>summary{list-style:none;cursor:pointer;color:var(--muted);font-size:13.5px;display:inline-flex;gap:6px;align-items:center;min-height:28px}
.st-refs>summary::-webkit-details-marker{display:none}
.st-refs ul{margin:8px 0 0;padding-left:18px;font-size:13.5px;line-height:1.5}
.st-refs li{margin-bottom:6px}
.st-refs a{color:var(--acc)}

/* semáforo */
.st-sem-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
@media (max-width:1100px){.st-sem-grid{grid-template-columns:repeat(2,1fr)}}
.st-sem{border:1px solid var(--line);border-radius:var(--r);padding:16px 18px;background:var(--panel);display:flex;flex-direction:column;gap:6px;border-left-width:4px}
.st-sem.alert{border-left-color:var(--bad)}.st-sem.watch{border-left-color:var(--warn)}.st-sem.ok{border-left-color:var(--ok)}.st-sem.info{border-left-color:var(--line)}
.st-sem .v{font-size:24px;font-weight:500;display:flex;align-items:center;gap:10px}
.st-sem.alert .v{color:var(--bad)}.st-sem.watch .v{color:var(--warn)}.st-sem.ok .v{color:var(--ok)}.st-sem.info .v{color:var(--muted)}
.st-sem .lv{font-size:11.5px;font-weight:500;letter-spacing:.04em;text-transform:uppercase;padding:2px 8px;border-radius:var(--r-pill);background:var(--panel2);color:var(--muted)}
.st-sem.alert .lv{background:var(--bad-soft);color:var(--bad)}.st-sem.watch .lv{background:var(--warn-soft);color:var(--warn)}.st-sem.ok .lv{background:var(--ok-soft);color:var(--ok)}
.st-sem .l{font-size:14.5px;font-weight:500;color:var(--txt)}
.st-sem .w{font-size:13.5px;color:var(--txt);line-height:1.45}
.st-sem details summary{list-style:none;cursor:pointer;color:var(--muted);font-size:12.5px;min-height:24px;display:inline-flex;align-items:center}
.st-sem details summary::-webkit-details-marker{display:none}
.st-sem details p{margin:4px 0 0;font-size:12.5px;color:var(--muted);line-height:1.45}
.st-sem-rest>summary{list-style:none;cursor:pointer;color:var(--muted);font-size:13.5px;display:inline-flex;gap:6px;align-items:center;min-height:32px}
.st-sem-rest>summary::-webkit-details-marker{display:none}
.st-sem-rest[open]>summary{margin-bottom:10px}
.st-sec-detail>summary{list-style:none;cursor:pointer;display:inline-flex;gap:6px;align-items:center;min-height:32px}
.st-sec-detail>summary::-webkit-details-marker{display:none}
.st-sec-detail[open]>summary{margin-bottom:12px}

/* === UI/UX PRO MAX: STUDIO LAYOUT & SPACING ENHANCEMENTS === */
/* Sticky sidebar properties with polished border and scroll behavior */
.st-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 32px;
  align-items: start;
}
.st-props {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 4px;
}
.st-props::-webkit-scrollbar {
  width: 5px;
}
.st-props::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: var(--r-pill);
}

/* Clear visual rhythm in main workspace */
.st-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.st-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.st-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.st-sec {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  margin-bottom: 12px;
  transition: border-color 0.15s ease;
}
.st-sec summary {
  padding: 12px 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.st-sec[open] summary {
  border-bottom: 1px solid var(--line);
}
.st-sec .body {
  padding: 14px;
}
