/* =====================================================================
   styles.css — tema oscuro
   ===================================================================== */
:root{
  --surface-0:#0d0d0d;
  --surface-1:#1a1a19;
  --surface-2:#212120;
  --surface-3:#2a2a28;
  --surface-4:#333331;
  --text-primary:#ffffff;
  --text-secondary:#c3c2b7;
  --text-muted:#898781;
  --grid:#2c2c2a;
  --baseline:#383835;
  --border:rgba(255,255,255,0.10);
  --up:#0ca30c;
  --down:#d03b3b;
  --warning:#fab219;
  --accent:#3987e5;
  --toolbar-h:44px;
  --sidebar-w:44px;
}

/* Tema claro: mismos roles, pasos propios para la superficie clara.
   No es una inversión automática del oscuro. */
:root[data-theme="light"]{
  --surface-0:#f9f9f7;
  --surface-1:#fcfcfb;
  --surface-2:#ffffff;
  --surface-3:#f0efec;
  --surface-4:#e1e0d9;
  --text-primary:#0b0b0b;
  --text-secondary:#52514e;
  --text-muted:#898781;
  --grid:#e1e0d9;
  --baseline:#c3c2b7;
  --border:rgba(11,11,11,0.12);
  --up:#0ca30c;
  --down:#d03b3b;
  --warning:#c98500;
  --accent:#2a78d6;
}

*{ box-sizing:border-box; }

html,body{
  margin:0; padding:0; height:100%;
  background:var(--surface-0);
  color:var(--text-primary);
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  overflow:hidden;
  -webkit-font-smoothing:antialiased;
}
button{ font-family:inherit; }
input,select{ font-family:inherit; }

#app{ display:flex; flex-direction:column; height:100vh; }

/* =============================== Barra superior =============================== */
#topbar{
  display:flex; align-items:center; gap:2px;
  height:var(--toolbar-h); flex:0 0 var(--toolbar-h);
  padding:0 8px;
  background:var(--surface-1);
  border-bottom:1px solid var(--border);
  position:relative; z-index:60;
}
.brand{
  display:flex; align-items:center; gap:7px;
  font-weight:700; font-size:14px; letter-spacing:.2px;
  padding:0 10px 0 4px; white-space:nowrap;
}
.brand-mark{
  width:20px; height:20px; border-radius:5px;
  background:linear-gradient(135deg,var(--accent),#199e70);
  display:flex; align-items:center; justify-content:center;
  font-size:11px; color:#fff;
}
.tb-sep{ width:1px; align-self:stretch; margin:9px 5px; background:var(--border); flex:0 0 1px; }
.spacer{ flex:1; }

.tb-btn{
  display:flex; align-items:center; gap:6px;
  background:transparent; color:var(--text-secondary);
  border:none; border-radius:6px;
  font-size:13px; padding:7px 9px; cursor:pointer;
  white-space:nowrap; transition:background .12s,color .12s;
}
.tb-btn:hover{ background:var(--surface-2); color:var(--text-primary); }
.tb-btn.strong{ color:var(--text-primary); font-weight:600; }
.tb-icon{
  display:flex; align-items:center; justify-content:center;
  width:30px; height:30px; border-radius:6px;
  background:transparent; color:var(--text-secondary); border:none;
  cursor:pointer; font-size:14px; transition:background .12s,color .12s;
}
.tb-icon:hover{ background:var(--surface-2); color:var(--text-primary); }
.tb-icon.on{ color:var(--accent); }
.chev{ font-size:9px; opacity:.65; }

.top-price{ font-size:14px; font-weight:700; font-variant-numeric:tabular-nums; padding:0 2px 0 8px; }
.top-change{ font-size:12px; font-variant-numeric:tabular-nums; padding-right:6px; }
.up{ color:var(--up); }
.down{ color:var(--down); }

#status{ display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text-muted); white-space:nowrap; padding:0 8px; }
.status-dot{ width:7px; height:7px; border-radius:50%; background:var(--text-muted); flex:0 0 7px; }
.status-dot.live{ background:var(--up); animation:pulse 1.9s infinite; }
.status-dot.error{ background:var(--down); }
.status-dot.loading{ background:var(--warning); }
.last-tick{ font-variant-numeric:tabular-nums; color:var(--text-muted); opacity:.75; }
@keyframes pulse{
  0%{ box-shadow:0 0 0 0 rgba(12,163,12,.5); }
  70%{ box-shadow:0 0 0 6px rgba(12,163,12,0); }
  100%{ box-shadow:0 0 0 0 rgba(12,163,12,0); }
}

/* =============================== Desplegables =============================== */
.dropdown{ position:relative; }
.dd-panel{
  display:none; position:absolute; top:calc(100% + 5px); left:0;
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:8px; padding:6px; min-width:230px; max-height:380px; overflow-y:auto;
  box-shadow:0 10px 30px rgba(0,0,0,.55); z-index:80;
}
.dropdown.open .dd-panel{ display:block; }
.dd-search{ padding:2px 2px 6px; }
.dd-search input{
  width:100%; background:var(--surface-1); border:1px solid var(--border);
  border-radius:6px; color:var(--text-primary); font-size:13px; padding:7px 9px;
}
.dd-search input:focus{ outline:none; border-color:var(--accent); }
.dd-group-label{ font-size:10px; color:var(--text-muted); letter-spacing:.6px; padding:8px 8px 4px; font-weight:700; }
.dd-row{
  display:flex; align-items:center; gap:9px; width:100%;
  background:transparent; border:none; color:var(--text-secondary);
  font-size:13px; padding:7px 9px; border-radius:6px; cursor:pointer; text-align:left;
}
.dd-row:hover{ background:var(--surface-3); color:var(--text-primary); }
.dd-row.active{ color:var(--accent); font-weight:600; background:rgba(57,135,229,.10); }
.dd-icon{ width:16px; text-align:center; flex:0 0 16px; }
.dd-label{ flex:1; }
.dd-hint{ font-size:11px; color:var(--text-muted); }

/* =============================== Cuerpo =============================== */
#body{ display:flex; flex:1; min-height:0; }

/* -------- Barra lateral de dibujo -------- */
#sidebar{
  position:relative;
  flex:0 0 var(--sidebar-w); width:var(--sidebar-w);
  background:var(--surface-1); border-right:1px solid var(--border);
  display:flex; flex-direction:column; align-items:center;
  padding:5px 0; gap:1px; overflow-y:auto; overflow-x:visible;
  z-index:50;
}
#sidebar::-webkit-scrollbar{ width:0; }
.tool-btn{
  position:relative;
  width:32px; height:32px; flex:0 0 32px;
  display:flex; align-items:center; justify-content:center;
  background:transparent; border:none; border-radius:6px;
  color:var(--text-secondary); cursor:pointer;
  transition:background .12s,color .12s;
}
.tool-btn svg{ width:17px; height:17px; }
.tool-btn:hover{ background:var(--surface-2); color:var(--text-primary); }
.tool-btn.active{ background:rgba(57,135,229,.16); color:var(--accent); }
.tool-btn.on{ color:var(--warning); }
.tool-caret{
  position:absolute; right:2px; bottom:2px;
  width:0; height:0;
  border-left:3.5px solid transparent;
  border-bottom:3.5px solid var(--text-muted);
}

/* Colgado del <body> para que el scroll de la barra lateral no lo recorte */
.flyout{
  display:none; position:fixed; left:var(--sidebar-w); top:0;
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:8px; padding:6px; min-width:300px; max-height:78vh; overflow-y:auto;
  box-shadow:0 12px 34px rgba(0,0,0,.6); z-index:150;
}
.flyout.open{ display:block; }
.fly-group{
  font-size:10px; color:var(--text-muted); letter-spacing:.6px;
  padding:9px 9px 5px; font-weight:700;
}
.fly-row{
  display:flex; align-items:center; gap:10px; width:100%;
  background:transparent; border:none; color:var(--text-secondary);
  font-size:13px; padding:7px 9px; border-radius:6px; cursor:pointer; text-align:left;
}
.fly-row:hover{ background:var(--surface-3); color:var(--text-primary); }
.fly-row.unavailable{ opacity:.45; }
.fly-glyph{ width:18px; text-align:center; color:var(--text-muted); flex:0 0 18px; }
.fly-label{ flex:1; }
.fly-key{ font-size:11px; color:var(--text-muted); }

/* -------- Área de gráficos -------- */
#panes{ flex:1; min-width:0; display:flex; flex-direction:column; background:var(--surface-1); }
.pane{ position:relative; min-height:0; }
.pane-main{ flex:1; }
.pane-sub{ flex:0 0 auto; border-top:1px solid var(--border); }
.pane-chart{ position:absolute; inset:0; }
.pane-resizer{
  position:absolute; top:-3px; left:0; right:0; height:7px;
  cursor:row-resize; z-index:12;
}
.pane-resizer:hover{ background:rgba(57,135,229,.25); }

.draw-layer{
  position:absolute; inset:0; z-index:8;
  pointer-events:none;
}

/* -------- Leyendas -------- */
.pane-legend{
  position:absolute; top:6px; left:10px; z-index:10;
  display:flex; flex-direction:column; gap:1px;
  pointer-events:none; max-width:calc(100% - 90px);
}
.legend-row{
  display:flex; align-items:center; gap:6px;
  font-size:12px; color:var(--text-secondary);
  text-shadow:0 1px 3px rgba(0,0,0,.75);
  pointer-events:auto;
  border-radius:4px; padding:1px 3px;
}
.legend-row:hover{ background:rgba(42,42,40,.72); }
.legend-head{ font-size:13px; }
.lg-symbol{ color:var(--text-primary); font-weight:700; }
.lg-sep{ color:var(--text-muted); }
.lg-tf,.lg-exch{ color:var(--text-muted); }
.lg-ohlc{ display:flex; gap:8px; margin-left:6px; font-variant-numeric:tabular-nums; }
.ohlc-item{ color:var(--text-muted); }
.ohlc-item b{ margin-left:3px; font-weight:600; }
.ohlc-chg{ font-variant-numeric:tabular-nums; }

.indicator-row.is-hidden{ opacity:.42; }
.lg-name{ color:var(--text-secondary); }
.lg-params{ color:var(--text-muted); font-variant-numeric:tabular-nums; }
.lg-values{ display:flex; gap:6px; font-variant-numeric:tabular-nums; }
.lg-actions{ display:none; gap:1px; margin-left:4px; }
.legend-row:hover .lg-actions{ display:flex; }
.lg-btn{
  background:transparent; border:none; color:var(--text-muted);
  cursor:pointer; font-size:11px; padding:1px 4px; border-radius:3px; line-height:1.4;
}
.lg-btn:hover{ background:var(--surface-4); color:var(--text-primary); }
.swatch{ width:9px; height:3px; border-radius:2px; display:inline-block; flex:0 0 9px; }

/* -------- Marca de agua -------- */
#watermark{
  position:absolute; inset:0; z-index:2; pointer-events:none;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; user-select:none;
}
#wm-symbol{ font-size:clamp(30px,6.5vw,72px); font-weight:800; color:rgba(255,255,255,.045); line-height:1; }
#wm-sub{ font-size:clamp(11px,1.5vw,17px); font-weight:600; color:rgba(255,255,255,.045); margin-top:8px; }

/* =============================== Modales =============================== */
.modal{
  display:none; position:fixed; inset:0; z-index:200;
  background:rgba(0,0,0,.55);
  align-items:flex-start; justify-content:center;
  padding-top:8vh;
}
.modal.open{ display:flex; }
.modal-box{
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:10px; width:min(560px,92vw); max-height:76vh;
  display:flex; flex-direction:column;
  box-shadow:0 24px 60px rgba(0,0,0,.7);
  overflow:hidden;
}
.modal-title{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 18px 12px; font-size:16px; font-weight:600;
  border-bottom:1px solid var(--border);
}
.modal-close{
  background:transparent; border:none; color:var(--text-muted);
  font-size:16px; cursor:pointer; padding:2px 6px; border-radius:4px;
}
.modal-close:hover{ background:var(--surface-3); color:var(--text-primary); }
.modal-search{ padding:12px 18px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:9px; }
.modal-search input{
  flex:1; background:transparent; border:none; color:var(--text-primary); font-size:14px;
}
.modal-search input:focus{ outline:none; }
.modal-search .mag{ color:var(--text-muted); }

#ind-list{ overflow-y:auto; padding:6px 8px 12px; }
.ind-group{ font-size:10px; color:var(--text-muted); letter-spacing:.6px; font-weight:700; padding:12px 10px 5px; }
.ind-row{
  display:flex; align-items:center; gap:10px; width:100%;
  background:transparent; border:none; color:var(--text-secondary);
  font-size:13.5px; padding:8px 10px; border-radius:6px; cursor:pointer; text-align:left;
}
.ind-row:hover{ background:var(--surface-3); color:var(--text-primary); }
.ind-star{ color:var(--warning); flex:0 0 12px; font-size:12px; }
.ind-name{ flex:1; }
.ind-note{ color:var(--accent); cursor:help; font-size:12px; }
.ind-pane{ font-size:10.5px; color:var(--text-muted); border:1px solid var(--border); padding:1px 6px; border-radius:10px; }
.ind-add{ font-size:11.5px; color:var(--accent); opacity:0; min-width:74px; text-align:right; }
.ind-row:hover .ind-add{ opacity:1; }
.ind-count{ font-size:11.5px; color:var(--up); font-weight:700; min-width:22px; text-align:right; }
.ind-row.active .ind-name{ color:var(--text-primary); }
.ind-empty{ padding:26px; text-align:center; color:var(--text-muted); font-size:13px; }

.settings-body{ padding:14px 18px; overflow-y:auto; }
.settings-row{ display:flex; align-items:center; justify-content:space-between; gap:14px; padding:7px 0; }
.settings-label{ font-size:13px; color:var(--text-secondary); }
.settings-input{
  background:var(--surface-1); border:1px solid var(--border); border-radius:6px;
  color:var(--text-primary); font-size:13px; padding:6px 9px; width:150px;
}
.settings-input:focus{ outline:none; border-color:var(--accent); }
input[type="checkbox"].settings-input{ width:auto; accent-color:var(--accent); }
.settings-note{
  padding:12px 18px; font-size:12px; color:var(--text-muted); line-height:1.5;
  background:rgba(57,135,229,.06); border-left:2px solid var(--accent); margin:0;
}
.settings-foot{
  display:flex; justify-content:flex-end; gap:8px;
  padding:12px 18px; border-top:1px solid var(--border);
}
.btn-primary{
  background:var(--accent); color:#fff; border:none; border-radius:6px;
  padding:8px 18px; font-size:13px; font-weight:600; cursor:pointer;
}
.btn-primary:hover{ filter:brightness(1.1); }
.btn-ghost{
  background:transparent; color:var(--text-secondary); border:1px solid var(--border);
  border-radius:6px; padding:8px 14px; font-size:13px; cursor:pointer;
}
.btn-ghost:hover{ background:var(--surface-3); color:var(--text-primary); }

/* =============================== Alertas =============================== */
.tb-badge{
  display:none; margin-left:6px; min-width:16px; padding:0 5px;
  background:var(--warning); color:#0d0d0d; border-radius:9px;
  font-size:10.5px; font-weight:700; line-height:16px; text-align:center;
}
.tb-badge.on{ display:inline-block; }

#alerts-box{ width:min(680px,94vw); }
.al-tabs{ display:flex; gap:4px; padding:8px 14px 0; border-bottom:1px solid var(--border); }
.al-tab{
  background:transparent; border:none; border-bottom:2px solid transparent;
  color:var(--text-muted); font-size:13px; padding:7px 12px 8px; cursor:pointer;
}
.al-tab:hover{ color:var(--text-primary); }
.al-tab.active{ color:var(--accent); border-bottom-color:var(--accent); font-weight:600; }

#alerts-form{ padding:14px 18px 12px; border-bottom:1px solid var(--border); }
.al-form-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.al-field{ display:flex; flex-direction:column; gap:5px; }
.al-field.wide{ grid-column:1 / -1; }
.al-field > span{ font-size:11px; color:var(--text-muted); letter-spacing:.3px; }
.al-field .settings-input{ width:100%; }
.al-form-foot{ display:flex; align-items:center; gap:14px; margin-top:12px; }
.al-check{ display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--text-secondary); cursor:pointer; }
.al-check input{ accent-color:var(--accent); }

#alerts-list{ overflow-y:auto; padding:6px 10px 10px; min-height:90px; }
.alert-row{
  display:flex; align-items:center; gap:10px;
  padding:8px 10px; border-radius:6px; font-size:13px;
}
.alert-row:hover{ background:var(--surface-3); }
.alert-row.off{ opacity:.5; }
.alert-row.editing{ background:rgba(57,135,229,.12); }
.al-icon{ flex:0 0 18px; text-align:center; font-size:14px; }
.al-main{ flex:1; display:flex; flex-direction:column; gap:2px; min-width:0; }
.al-title{ color:var(--text-primary); font-variant-numeric:tabular-nums; }
.al-title b{ color:var(--warning); font-weight:700; padding:0 2px; }
.al-sub{ font-size:11.5px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.al-dist{ font-size:12px; font-variant-numeric:tabular-nums; color:var(--text-muted); min-width:58px; text-align:right; }
.al-state{ font-size:11.5px; color:var(--text-muted); min-width:96px; text-align:right; }
.al-acts{ display:flex; gap:2px; }
.al-link{
  background:transparent; border:none; color:var(--accent);
  font-size:12px; cursor:pointer; padding:0 2px; text-decoration:underline;
}

/* ========================= Diario de operaciones ========================= */
#journal-box{ width:min(900px,96vw); max-height:88vh; }
#journal-form{ padding:14px 18px 12px; border-bottom:1px solid var(--border); }
.jr-form-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }

#journal-list,#journal-stats{ overflow-y:auto; padding:6px 10px 10px; min-height:110px; }

.jr-row{
  display:flex; align-items:center; gap:10px;
  padding:8px 10px; border-radius:6px; font-size:13px;
  border-bottom:1px solid rgba(128,128,128,.07);
}
.jr-row:hover{ background:var(--surface-3); }
.jr-row.editing{ background:rgba(57,135,229,.12); }
.jr-row.abierta .jr-net{ color:var(--warning); }
.jr-side{
  flex:0 0 52px; text-align:center; font-size:10.5px; font-weight:700;
  letter-spacing:.4px; padding:3px 0; border-radius:4px;
}
.jr-side.long{ background:rgba(12,163,12,.16); color:var(--up); }
.jr-side.short{ background:rgba(208,59,59,.16); color:var(--down); }
.jr-main{ flex:1; display:flex; flex-direction:column; gap:2px; min-width:0; }
.jr-title{ color:var(--text-primary); font-variant-numeric:tabular-nums; }
.jr-sub{ font-size:11.5px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.jr-pct,.jr-r,.jr-net{ font-variant-numeric:tabular-nums; text-align:right; }
.jr-pct{ min-width:64px; font-size:12.5px; }
.jr-r{ min-width:58px; font-size:12px; color:var(--text-muted); }
.jr-net{ min-width:96px; font-weight:600; }
.jr-acts{ display:flex; gap:2px; }

.jr-tiles{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr));
  gap:8px; padding:10px 8px 4px;
}
.jr-tile{
  display:flex; flex-direction:column; gap:4px;
  background:var(--surface-1); border:1px solid var(--border);
  border-radius:7px; padding:9px 11px;
}
.jr-tile-lab{ font-size:10.5px; color:var(--text-muted); letter-spacing:.3px; }
.jr-tile-val{
  font-size:15px; font-weight:700; color:var(--text-primary);
  font-variant-numeric:tabular-nums;
}
.jr-curve{ display:block; width:100%; margin:2px 8px 10px; }

/* =============================== Comparación =============================== */
.dd-compare{
  display:block; width:100%; margin-top:6px; padding:8px 8px;
  background:transparent; border:none; border-top:1px solid var(--border);
  color:var(--accent); font-size:12.5px; text-align:left; cursor:pointer;
  border-radius:0 0 6px 6px;
}
.dd-compare:hover{ background:var(--surface-3); }
.dd-compare.on{ color:var(--warning); }
.dd-list.comparing .dd-row.active{ color:var(--warning); background:rgba(250,178,25,.10); }
.dd-row.dd-disabled{ opacity:.45; cursor:default; }
.compare-row .lg-name{ color:var(--text-primary); font-weight:600; }
.compare-row .swatch{ width:9px; height:3px; }

/* ==================== Ajustes del dibujo seleccionado ==================== */
#draw-toolbar{
  display:none; position:absolute; z-index:130;
  align-items:center; gap:2px; padding:4px 6px;
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:8px; box-shadow:0 8px 26px rgba(0,0,0,.55);
  white-space:nowrap;
}
#draw-toolbar.open{ display:flex; }
.dt-name{
  font-size:11.5px; color:var(--text-muted); padding:0 6px 0 2px;
  max-width:180px; overflow:hidden; text-overflow:ellipsis;
}
.dt-sep{ width:1px; align-self:stretch; margin:2px 3px; background:var(--border); flex:0 0 1px; }
.dt-item{ position:relative; }
.dt-btn{
  background:transparent; border:none; color:var(--text-secondary);
  font-size:12.5px; height:26px; min-width:26px; padding:0 7px;
  border-radius:5px; cursor:pointer; display:flex; align-items:center; gap:5px;
}
.dt-btn:hover{ background:var(--surface-3); color:var(--text-primary); }
.dt-del:hover{ background:rgba(208,59,59,.18); color:var(--down); }
.dt-swatch i{
  display:block; width:15px; height:15px; border-radius:4px;
  border:1px solid rgba(128,128,128,.5);
}

.dt-pop{
  display:none; position:absolute; top:32px; left:0; z-index:140;
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:8px; padding:6px; box-shadow:0 10px 28px rgba(0,0,0,.6);
}
.dt-pop.open{ display:block; }
/* La paleta va en cuadrícula, pero el `display` solo cuando está abierta:
   si se pone en `.dt-colors` a secas le gana al `display:none` de `.dt-pop`
   —misma especificidad y viene después— y el desplegable no cierra nunca. */
.dt-colors{ grid-template-columns:repeat(6,1fr); gap:5px; width:158px; }
.dt-pop.dt-colors.open{ display:grid; }
.dt-color{
  width:20px; height:20px; border-radius:5px; cursor:pointer;
  border:1px solid rgba(128,128,128,.45);
}
.dt-color.on{ outline:2px solid var(--accent); outline-offset:1px; }
.dt-widths{ min-width:132px; }
.dt-row{
  display:flex; align-items:center; gap:9px; width:100%;
  background:transparent; border:none; color:var(--text-secondary);
  font-size:12.5px; padding:6px 8px; border-radius:5px; cursor:pointer; text-align:left;
}
.dt-row:hover{ background:var(--surface-3); color:var(--text-primary); }
.dt-row.on{ color:var(--accent); }
.dt-line{ width:42px; background:currentColor; border-radius:2px; flex:0 0 42px; }

input[type="color"].settings-input{ padding:2px; height:30px; cursor:pointer; }

/* =============================== Avisos =============================== */
#error-banner{
  display:none;
  position:absolute; top:12px; right:14px; z-index:120;
  background:var(--surface-2); border:1px solid var(--down);
  color:var(--text-primary); border-radius:8px;
  padding:12px 14px; font-size:12.5px; max-width:330px; line-height:1.5;
  box-shadow:0 8px 26px rgba(0,0,0,.5);
}
#error-banner button{
  margin-top:10px; background:var(--down); color:#fff; border:none;
  border-radius:5px; padding:6px 12px; cursor:pointer; font-size:12px;
}
#toast{
  position:fixed; bottom:24px; left:50%; transform:translate(-50%,8px);
  background:var(--surface-3); border:1px solid var(--border); color:var(--text-primary);
  padding:9px 18px; border-radius:8px; font-size:12.5px;
  opacity:0; pointer-events:none; transition:opacity .18s,transform .18s;
  z-index:300; box-shadow:0 8px 26px rgba(0,0,0,.55); max-width:80vw; text-align:center;
}
#toast.show{ opacity:1; transform:translate(-50%,0); }

::selection{ background:rgba(57,135,229,.35); }
::-webkit-scrollbar{ width:9px; height:9px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{ background:var(--surface-4); border-radius:5px; }
::-webkit-scrollbar-thumb:hover{ background:#454542; }

/* Ajustes propios del tema claro: las sombras y los velos pensados para
   fondo oscuro no funcionan sobre fondo claro. */
:root[data-theme="light"] .legend-row{ text-shadow:none; }
:root[data-theme="light"] .legend-row:hover{ background:rgba(240,239,236,.9); }
:root[data-theme="light"] #wm-symbol,
:root[data-theme="light"] #wm-sub{ color:rgba(11,11,11,.05); }
:root[data-theme="light"] .modal{ background:rgba(11,11,11,.28); }
:root[data-theme="light"] .dd-panel,
:root[data-theme="light"] .flyout,
:root[data-theme="light"] .modal-box,
:root[data-theme="light"] #toast,
:root[data-theme="light"] #error-banner{ box-shadow:0 10px 30px rgba(11,11,11,.18); }
:root[data-theme="light"] .dd-row.active{ background:rgba(42,120,214,.10); }
:root[data-theme="light"] .tool-btn.active{ background:rgba(42,120,214,.14); }
