/* InerCAD · hoja de estilos */
:root {
  --tb-h: 50px;
  --sb-h: 28px;
  --lw: 272px;
  --rw: 348px;
  --radius: 8px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", ui-monospace, Consolas, monospace;
  --math: "IBM Plex Serif", Cambria, "Times New Roman", serif;
  color-scheme: dark;
}
:root, :root[data-resolved="dark"] {
  /* Blackstone #212529 y grises afines */
  --bg: #17191c;
  --panel: #212529;
  --panel-2: #2a2f34;
  --raise: #343a40;
  --line: #3a4046;
  --line-2: #495057;
  --text: #e9ecef;
  --muted: #adb5bd;
  --faint: #868e96;
  --accent: #e9ecef;
  --accent-ink: #212529;
  --accent-soft: rgba(233, 236, 239, 0.12);
  --accent-line: rgba(233, 236, 239, 0.45);
  --danger: #ff7b72;
  --warn: #f2b84b;
  --ok: #4cd18f;
  --cv-bg: #1b1e21;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --hole: #ff8a80;
}
:root[data-resolved="light"] {
  /* Whiteout #e9ecef y grises afines */
  color-scheme: light;
  --bg: #ced4da;
  --panel: #dee2e6;
  --panel-2: #d3d8dd;
  --raise: #e9ecef;
  --line: #c3c9cf;
  --line-2: #adb5bd;
  --text: #212529;
  --muted: #495057;
  --faint: #6c757d;
  --accent: #212529;
  --accent-ink: #e9ecef;
  --accent-soft: rgba(33, 37, 41, 0.09);
  --accent-line: rgba(33, 37, 41, 0.45);
  --danger: #c92a2a;
  --warn: #a8690a;
  --ok: #2b8a3e;
  --cv-bg: #e9ecef;
  --shadow: 0 10px 30px rgba(33, 37, 41, 0.22), 0 1px 0 rgba(255, 255, 255, 0.35) inset;
  --hole: #c92a2a;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 400 13px/1.5 var(--font); letter-spacing: .006em;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.ic { display: block; flex: none; }
[hidden] { display: none !important; }
sub, sup { line-height: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Estructura ---------- */
#app { display: grid; grid-template-rows: var(--tb-h) minmax(0, 1fr) var(--sb-h); height: 100vh; height: 100dvh; }
#main { display: grid; grid-template-columns: var(--lw) 5px minmax(0, 1fr) 5px var(--rw); min-height: 0; }
#left, #right { background: var(--panel); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
#left { border-right: 1px solid var(--line); }
#right { border-left: 1px solid var(--line); }
.resizer { background: transparent; cursor: col-resize; position: relative; z-index: 3; }
.resizer::after { content: ""; position: absolute; inset: 0 1px; background: transparent; transition: background .15s; }
.resizer:hover::after, .resizer.active::after { background: var(--accent-line); }
#stage { position: relative; min-width: 0; min-height: 0; background: var(--cv-bg); overflow: hidden; }
#cv { position: absolute; inset: 0; display: block; outline: none; }

/* ---------- Barra superior ---------- */
#topbar {
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0;
}
.brand { display: flex; align-items: center; gap: 9px; margin-right: 4px; flex: none; }
.brand-word { display: block; height: 19px; aspect-ratio: 1100 / 246; background: var(--text); flex: none;
  -webkit-mask: url(../assets/logo/wordmark.png) center / contain no-repeat; mask: url(../assets/logo/wordmark.png) center / contain no-repeat; }
.lockup { display: block; height: 88px; aspect-ratio: 1696 / 587; margin: 0 auto 10px; background: var(--text);
  -webkit-mask: url(../assets/logo/lockup.png) center / contain no-repeat; mask: url(../assets/logo/lockup.png) center / contain no-repeat; }
.proj-name {
  background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 5px 8px;
  width: clamp(120px, 20vw, 260px); font-weight: 400; letter-spacing: .01em; text-overflow: ellipsis;
}
.proj-name:hover { border-color: var(--line); }
.proj-name:focus { border-color: var(--accent); background: var(--panel-2); outline: none; }
.tb-group { display: flex; align-items: center; gap: 2px; padding-left: 10px; border-left: 1px solid var(--line); }
.tb-spacer { flex: 1; }
.tb-select { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.tb-select select { min-width: 74px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 11px;
  background: transparent; border: 1px solid transparent; border-radius: 7px; color: var(--text); white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--raise); border-color: var(--line); }
.btn:active { transform: translateY(1px); }
.btn.icon { width: 32px; padding: 0; }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn.sm.icon { width: 26px; padding: 0; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.btn.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); font-weight: 500; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.outline { border-color: var(--line-2); }
.btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-size: 12px; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-2); }
.link-btn:hover { text-decoration: underline; }

select, input[type="text"], input[type="number"] {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; height: 30px; padding: 0 9px;
  min-width: 0; transition: border-color .12s, background .12s;
}
select { padding-right: 6px; cursor: pointer; }
select:hover, input[type="text"]:hover { border-color: var(--line-2); }
input[type="text"]:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input.bad { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(255, 123, 114, .18) !important; }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
input[type="range"] { accent-color: var(--accent); width: 100%; }

/* ---------- Paneles laterales ---------- */
.panel-sec { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); }
.panel-sec.grow { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; border-bottom: 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 8px; color: var(--muted);
  font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.sec-head .sec-hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); font-size: 11px; }
.sec-head .count { background: var(--raise); border-radius: 10px; padding: 0 7px; font-size: 11px; letter-spacing: 0; }
.pal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 12px; }
.pal-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 8px 2px 6px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; color: var(--muted); min-width: 0;
  transition: background .12s, border-color .12s, color .12s, transform .1s;
}
.pal-item span { font-size: 10.5px; line-height: 1.15; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item:hover { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }
.pal-item:active { transform: scale(.96); }
.pal-item.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.layer-list { flex: 1; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.layer {
  display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border-radius: 7px; border: 1px solid transparent;
  cursor: default; user-select: none;
}
.layer:hover { background: var(--panel-2); }
.layer.sel { background: var(--accent-soft); border-color: var(--accent-line); }
.layer .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; border: 1px solid rgba(255, 255, 255, .25); }
.layer .sw.hole { background: transparent !important; border: 1.5px dashed var(--hole); }
.layer .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer .meta { color: var(--faint); font-size: 11px; }
.layer.off .nm, .layer.off .sw { opacity: .45; }
.layer .acts { display: flex; gap: 0; opacity: .0; }
.layer:hover .acts, .layer.sel .acts, .layer .acts .keep { opacity: 1; }
.layer .acts .btn { color: var(--muted); }
.layer .acts .btn.act { color: var(--accent); }
.layer-empty { color: var(--faint); font-size: 12px; text-align: center; padding: 22px 10px; line-height: 1.6; }
.layer input.rename { height: 24px; width: 100%; }
.mode-pill { font-size: 10px; font-weight: 600; border-radius: 4px; padding: 1px 5px; flex: none; }
.mode-pill.add { color: var(--ok); background: rgba(76, 209, 143, .14); }
.mode-pill.sub { color: var(--danger); background: rgba(255, 123, 114, .14); }

/* ---------- Pestañas ---------- */
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 6px; gap: 2px; flex: none; }
.tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 6px; background: none; border: 0;
  border-bottom: 2px solid transparent; color: var(--muted); font-weight: 400; white-space: nowrap; min-width: 0; letter-spacing: .01em;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab .badge { background: var(--warn); color: #1c1300; font-size: 10px; font-weight: 600; border-radius: 8px; padding: 0 5px; }
.tabpanes { flex: 1; min-height: 0; position: relative; }
.tabpane { position: absolute; inset: 0; overflow: auto; padding: 12px 14px 24px; display: none; }
.tabpane.active { display: block; }

/* ---------- Propiedades ---------- */
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; }
.card h4 { margin: 0 0 8px; font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
.empty-state { color: var(--muted); text-align: center; padding: 36px 14px; line-height: 1.65; }
.empty-state .big { color: var(--faint); margin-bottom: 10px; }
.prop-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.prop-head .type-ic { width: 38px; height: 38px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.prop-head input { flex: 1; font-weight: 500; height: 32px; }
.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { flex: 1; height: 28px; background: none; border: 0; border-radius: 6px; color: var(--muted); font-weight: 400; display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--raise); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 0 0 1px var(--line-2); }
.seg button[aria-pressed="true"].add { color: var(--ok); }
.seg button[aria-pressed="true"].sub { color: var(--danger); }
.field { display: grid; grid-template-columns: 1fr 112px; align-items: center; gap: 8px; margin: 6px 0; }
.field > label { color: var(--muted); display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.field > label .sym { font-family: var(--math); font-style: italic; color: var(--text); font-size: 14px; min-width: 22px; }
.field > label .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inp { position: relative; }
.inp input { width: 100%; text-align: right; padding-right: 36px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.inp .u { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 11px; pointer-events: none; }
.field.two { grid-template-columns: 1fr 1fr; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.vtable { width: 100%; border-collapse: collapse; font-size: 12px; }
.vtable th { text-align: left; color: var(--faint); font-weight: 500; padding: 2px 4px; font-size: 11px; letter-spacing: .03em; }
.vtable td { padding: 2px 3px; }
.vtable input { width: 100%; height: 26px; text-align: right; font-family: var(--mono); padding: 0 6px; }
.vtable tr.selv input { border-color: var(--accent); background: var(--accent-soft); }
.vtable .n { color: var(--faint); width: 22px; text-align: center; }
.note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.note.warn { color: var(--warn); }
.align-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }

/* ---------- Resultados ---------- */
.res-group { margin-bottom: 14px; }
.res-group h4 { margin: 0 0 4px; font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.res-row {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: baseline; gap: 8px; padding: 5px 6px; margin: 0 -6px;
  border-radius: 6px; position: relative;
}
.res-row:hover { background: var(--panel-2); }
.res-row .sym { font-family: var(--math); font-style: italic; font-size: 14.5px; white-space: nowrap; }
.res-row .nm { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-row .val { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12.5px; letter-spacing: 0; text-align: right; white-space: nowrap; }
.res-row .val small { color: var(--faint); font-size: 11px; margin-left: 4px; }
.res-row .cp { position: absolute; right: 2px; top: 2px; opacity: 0; background: var(--raise); }
.res-row:hover .cp { opacity: 1; }
.res-row:hover .val.has-cp { padding-right: 0; }
.res-row.key .val { color: var(--accent); font-weight: 500; }
.res-bar { display: flex; gap: 6px; margin-bottom: 12px; align-items: center; }
.res-bar select { flex: 1; }
.alert { display: flex; gap: 9px; padding: 9px 11px; border-radius: 8px; font-size: 12.5px; line-height: 1.45; margin-bottom: 8px; border: 1px solid; }
.alert.warn { background: rgba(242, 184, 75, .1); border-color: rgba(242, 184, 75, .4); color: var(--warn); }
.alert.error { background: rgba(255, 123, 114, .1); border-color: rgba(255, 123, 114, .4); color: var(--danger); }
.alert .ic { margin-top: 1px; }
.alert > div { color: var(--text); }
.mini-diagram { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }

/* ---------- Tabla (Steiner) ---------- */
.tbl-wrap { overflow: auto; margin: 0 -14px; padding: 0 14px; }
table.data { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 5px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { color: var(--muted); font-weight: 500; font-size: 10.5px; letter-spacing: .03em; position: sticky; top: 0; background: var(--panel); text-align: right; }
table.data th:first-child, table.data td:first-child { text-align: left; position: sticky; left: 0; background: var(--panel); z-index: 1; }
table.data tr.total td { font-weight: 500; border-top: 2px solid var(--line-2); color: var(--accent); }
table.data td.neg { color: var(--danger); }
table.data .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* ---------- Mohr ---------- */
.mohr { width: 100%; touch-action: none; user-select: none; }
.mohr text { font: 11px var(--font); fill: var(--muted); }
.mohr .grid { stroke: var(--line); stroke-width: 1; }
.mohr .circ { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.8; }
.mohr .pt { cursor: grab; }

/* ---------- Superposiciones del lienzo ---------- */
.floatbar {
  position: absolute; z-index: 4; display: flex; align-items: center; gap: 2px; padding: 4px;
  background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); border-radius: 11px;
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
#floatbar { top: 26px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 110px); flex-wrap: wrap; justify-content: center; }
#floatbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
#zoombar { right: 12px; bottom: 14px; flex-direction: column; }
#zoombar .zlabel { font-size: 10.5px; color: var(--muted); padding: 2px 0; font-family: var(--mono); }
.hud {
  position: absolute; left: 30px; bottom: 14px; z-index: 3; min-width: 232px; padding: 10px 12px 8px;
  background: color-mix(in srgb, var(--panel) 90%, transparent); border: 1px solid var(--line); border-radius: 11px;
  box-shadow: var(--shadow); backdrop-filter: blur(8px); font-size: 12px; max-width: 320px;
}
.hud .hh { cursor: grab; touch-action: none; user-select: none; display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.hud .row { display: flex; justify-content: space-between; gap: 14px; padding: 1.5px 0; }
.hud .row .k { color: var(--muted); font-family: var(--math); font-style: italic; font-size: 13px; }
.hud .row .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; letter-spacing: 0; }
.hud .row .v small { color: var(--faint); margin-left: 4px; }
.hud.min { min-width: 0; }
.hint {
  position: absolute; top: 74px; left: 50%; transform: translateX(-50%); z-index: 4; padding: 6px 12px; border-radius: 20px;
  background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 400; letter-spacing: .01em; box-shadow: var(--shadow); pointer-events: none;
  width: max-content; max-width: 90%; text-align: center;
}
.hint:empty { display: none; }
.welcome {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; pointer-events: none; padding: 60px 20px 20px;
}
.welcome .box {
  pointer-events: auto; max-width: 560px; text-align: center; background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px 22px; box-shadow: var(--shadow); backdrop-filter: blur(6px);
}
.welcome h2 { margin: 0 0 6px; font-size: 22px; font-weight: 300; letter-spacing: -.012em; line-height: 1.2; }
.welcome p { margin: 0 0 16px; color: var(--muted); line-height: 1.55; }
.welcome .quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; text-align: left; }
.quick button { display: flex; align-items: center; gap: 9px; padding: 9px 11px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; text-align: left; color: var(--text); }
.quick button:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.quick button small { display: block; color: var(--faint); font-size: 11px; }
.quick button .qi { color: var(--accent); }
#paneToggles { display: none; }

/* ---------- Barra de estado ---------- */
#status { display: flex; align-items: center; gap: 0; background: var(--panel); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); min-width: 0; }
.st-cell { padding: 0 12px; height: 100%; display: flex; align-items: center; gap: 6px; border-right: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-cell:last-child { border-right: 0; }
.st-warn { color: var(--warn); cursor: pointer; }
.st-ok { color: var(--ok); }

/* ---------- Menús, modales, avisos ---------- */
#menuRoot .menu {
  position: fixed; z-index: 60; min-width: 220px; max-width: 320px; background: var(--raise); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: var(--shadow); padding: 5px; max-height: 70vh; overflow: auto;
}
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 7px 10px; background: none; border: 0; border-radius: 6px; text-align: left; }
.menu button:hover { background: var(--accent-soft); }
.menu button small { display: block; color: var(--faint); font-size: 11px; }
.menu button .kbd { margin-left: auto; color: var(--faint); font-size: 11px; font-family: var(--mono); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.menu .mh { padding: 6px 10px 3px; color: var(--faint); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 500; }
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(14, 16, 18, .62); display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(3px); animation: fade .15s; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); width: min(720px, 100%); max-height: min(86vh, 860px); display: flex; flex-direction: column; animation: pop .18s; }
.modal.wide { width: min(1000px, 100%); }
.modal.narrow { width: min(460px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.modal-h h3 { margin: 0; font-size: 17px; font-weight: 400; letter-spacing: -.006em; flex: 1; }
.modal-b { padding: 16px 20px; overflow: auto; flex: 1; }
.modal-f { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
#toasts { position: fixed; bottom: 42px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--raise); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 14px; box-shadow: var(--shadow); display: flex; gap: 9px; align-items: center; animation: pop .2s; pointer-events: auto; }
.toast.ok .ic { color: var(--ok); }
.toast.warn .ic { color: var(--warn); }
.cat-layout { display: grid; grid-template-columns: 210px 1fr; gap: 14px; min-height: 360px; }
.cat-series { display: flex; flex-direction: column; gap: 2px; }
.cat-series button { text-align: left; padding: 8px 10px; background: none; border: 1px solid transparent; border-radius: 8px; color: var(--muted); }
.cat-series button:hover { background: var(--panel-2); color: var(--text); }
.cat-series button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.cat-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; align-content: start; max-height: 52vh; overflow: auto; padding-right: 4px; }
.cat-items button { padding: 8px 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.cat-items button:hover { border-color: var(--accent); background: var(--accent-soft); }
.cat-search { margin-bottom: 10px; width: 100%; }
.kbd-table { width: 100%; border-collapse: collapse; }
.kbd-table td { padding: 5px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.kbd-table td:first-child { white-space: nowrap; width: 38%; }
kbd { font-family: var(--mono); font-size: 11.5px; background: var(--raise); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }
.help h4 { margin: 16px 0 6px; font-size: 13px; }
.help p, .help li { color: var(--muted); line-height: 1.6; }
.help li { margin: 2px 0; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.set-row small { display: block; color: var(--faint); }

/* ---------- Scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Informe ---------- */
.report-doc { background: #e9ecef; color: #212529; font-family: var(--font); }
.report-doc * { color-scheme: light; }
.report-doc .rp { max-width: 820px; margin: 0 auto; padding: 28px 34px 40px; font-size: 12.5px; }
.report-doc h1 { font-size: 26px; font-weight: 300; letter-spacing: -.015em; line-height: 1.15; margin: 0; }
.report-doc .rp-logo { height: 34px; display: block; margin-left: auto; margin-bottom: 6px; }
.report-doc h2 { font-weight: 500; font-size: 13px; margin: 22px 0 8px; padding-bottom: 4px; border-bottom: 2px solid #212529; text-transform: uppercase; letter-spacing: .06em; }
.report-doc .rp-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid #212529; padding-bottom: 10px; margin-bottom: 14px; }
.report-doc .rp-head small { color: #6c757d; }
.report-doc img.draw { width: 100%; max-height: 380px; object-fit: contain; border: 1px solid #ced4da; border-radius: 6px; background: #e9ecef; }
.report-doc table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.report-doc td { font-feature-settings: "tnum"; }
.report-doc th, .report-doc td { border-bottom: 1px solid #ced4da; padding: 4px 6px; text-align: right; }
.report-doc th:first-child, .report-doc td:first-child { text-align: left; }
.report-doc th { font-size: 10.5px; color: #6c757d; font-weight: 500; letter-spacing: .03em; }
.report-doc tr.total td { font-weight: 500; border-top: 2px solid #212529; }
.report-doc .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.report-doc .sym { font-family: var(--math); font-style: italic; }
.report-doc .foot { margin-top: 22px; color: #6c757d; font-size: 11px; border-top: 1px solid #ced4da; padding-top: 8px; }
.report-doc .formulas { columns: 2; column-gap: 28px; color: #495057; font-size: 11.5px; }
.modal.report-modal .modal-b { background: #adb5bd; padding: 18px; }
.modal.report-modal .report-doc { box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }

@media print {
  @page { size: A4; margin: 12mm; }
  html { color-scheme: light !important; }
  html, body { background: none !important; color: #212529 !important; overflow: visible !important; height: auto !important; }
  body > *:not(#reportDoc):not(#modalRoot) { display: none !important; }
  #modalRoot .modal-back { position: static !important; background: none !important; padding: 0 !important; display: block !important; backdrop-filter: none !important; }
  #modalRoot .modal { box-shadow: none !important; border: 0 !important; max-height: none !important; width: 100% !important; background: none !important; }
  #modalRoot .modal-h, #modalRoot .modal-f { display: none !important; }
  #modalRoot .modal-b { overflow: visible !important; padding: 0 !important; background: none !important; }
  .report-doc { box-shadow: none !important; background: none !important; }
  .report-doc .rp { padding: 0; max-width: none; }
  .report-doc h2 { break-after: avoid; }
  .report-doc table, .report-doc .two > div { break-inside: avoid; }
}

/* ---------- Adaptación a pantallas pequeñas ---------- */
@media (max-width: 1180px) { :root { --rw: 316px; --lw: 236px; } .tb-select > span { display: none; } }
@media (max-width: 1100px) {
  #topbar { gap: 6px; padding: 0 8px; }
  #topbar .btn .lbl { display: none; }
  #topbar .btn { padding: 0 8px; }
  #topbar .btn.icon { width: 32px; padding: 0; }
  .tb-group { padding-left: 6px; }
  .proj-name { width: clamp(90px, 14vw, 160px); }
}
@media (max-width: 980px) {
  #main { grid-template-columns: minmax(0, 1fr); }
  #left, #right { position: absolute; top: var(--tb-h); bottom: var(--sb-h); z-index: 20; width: min(340px, 92vw); transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  #right { right: 0; left: auto; transform: translateX(102%); }
  #app.show-left #left, #app.show-right #right { transform: none; }
  .resizer { display: none; }
  #paneToggles { display: flex; position: absolute; top: 26px; left: 30px; z-index: 5; gap: 6px; }
  #floatbar { top: 66px; }
  .proj-name { width: 120px; }
  .hud { max-width: 260px; }
}
@media (max-width: 640px) { .brand-name, .tb-select { display: none; } #tbRight .btn .lbl { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Ajustes finos de pestañas */
.tab .ic { display: none; }
.tab { font-size: 12.5px; }

.report-doc table.steiner { font-size: 10.5px; }
.report-doc table.steiner th, .report-doc table.steiner td { padding: 3px 4px; }

.hud.dragging { cursor: grabbing; opacity: .92; }
.hud.min .row, .hud.min .more { display: none; }
