/* ═══════════════════════════════════════════════════════════
   LUBVENCA · VISOR TÉCNICO BIODISCO RBC — v4.0
   Sistema visual: estación de trabajo de ingeniería
   ═══════════════════════════════════════════════════════════ */

:root {
  --void:        #0a0d11;
  --void-2:      #0e1218;
  --surface:     rgba(16, 21, 27, 0.88);
  --surface-sol: #141a21;
  --line:        rgba(255, 255, 255, 0.075);
  --line-2:      rgba(255, 255, 255, 0.16);

  --aqua:        #4dd9c0;
  --aqua-dim:    rgba(77, 217, 192, 0.14);
  --aqua-soft:   rgba(77, 217, 192, 0.45);
  --amber:       #f2a93b;
  --rose:        #e2736b;

  --text:        #e4eaf0;
  --dim:         #8695a4;
  --dim-2:       #5b6975;

  --paper:       #fbfcfd;
  --paper-2:     #f1f4f7;
  --ink:         #0f1821;
  --ink-dim:     #51606e;
  --ink-line:    #dde4ea;

  --f-cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --f-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --r:    8px;
  --r-sm: 5px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, input, select { font: inherit; color: inherit; }

html, body {
  width: 100%; height: 100%;
  background: var(--void);
  font-family: var(--f-sans);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ───────────────────────── ARRANQUE ───────────────────────── */
#boot {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse 80% 55% at 50% 118%, #16222b 0%, transparent 62%),
    var(--void);
  transition: opacity .85s var(--ease);
}
#boot.gone { opacity: 0; pointer-events: none; }

.boot-inner { display: flex; flex-direction: column; align-items: center; }
.boot-mark { width: 72px; height: 72px; color: var(--aqua); }
.boot-arc  { transform-origin: 50% 50%; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.boot-brand {
  font-family: var(--f-cond); font-size: 2.3rem; font-weight: 700;
  letter-spacing: .42em; text-indent: .42em; margin-top: 20px;
}
.boot-sub {
  font-family: var(--f-cond); font-size: .76rem; font-weight: 500;
  letter-spacing: .3em; color: var(--dim); margin-top: 2px;
}
.boot-track {
  width: 300px; height: 2px; background: rgba(255, 255, 255, .08);
  margin-top: 36px; overflow: hidden; border-radius: 2px;
}
#boot-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--aqua-soft), var(--aqua));
  transition: width .5s var(--ease);
}
.boot-row {
  width: 300px; margin-top: 10px;
  display: flex; justify-content: space-between;
  font-family: var(--f-cond); font-size: .68rem;
  letter-spacing: .22em; color: var(--dim); text-transform: uppercase;
}
#boot-pct { letter-spacing: .08em; }

/* ───────────────────────── LIENZO ───────────────────────── */
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; }

/* ───────────────────────── BARRA SUPERIOR ───────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 120;
  height: 58px; padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(10, 13, 17, .94), rgba(10, 13, 17, .55) 70%, transparent);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 11px; pointer-events: auto; }
.brand-mark { width: 30px; height: 30px; color: var(--aqua); flex-shrink: 0; }
.brand-mark ellipse, .brand-mark line { stroke: currentColor; fill: none; }
.brand-name {
  font-family: var(--f-cond); font-size: 1.04rem; font-weight: 700;
  letter-spacing: .3em; line-height: 1;
}
.brand-sub {
  font-size: .66rem; font-weight: 300; color: var(--dim);
  letter-spacing: .04em; margin-top: 3px;
}

.topbar-tools { display: flex; align-items: center; gap: 5px; pointer-events: auto; }
.topbar-sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 5px; }

.tool {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--dim); padding: 7px 12px; border-radius: var(--r-sm);
  cursor: pointer; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  font-family: var(--f-cond); font-size: .74rem; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase; white-space: nowrap;
  transition: color .2s, border-color .2s, background .2s;
}
.tool svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5;
            stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.tool:hover { color: var(--text); border-color: var(--line-2); }
.tool.on { background: var(--aqua-dim); border-color: var(--aqua-soft); color: var(--aqua); }
.tool-accent.on { background: rgba(242, 169, 59, .15); border-color: rgba(242, 169, 59, .5); color: var(--amber); }

/* ───────────────────────── PANELES ───────────────────────── */
.panel {
  position: fixed; z-index: 110;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .4s var(--ease), opacity .3s var(--ease);
}
.panel-left  { top: 70px; left: 18px;  width: 268px; bottom: 128px; }
.panel-right { top: 70px; right: 18px; width: 272px; max-height: calc(100vh - 198px); }

.panel-left.away  { transform: translateX(calc(-100% - 24px)); opacity: 0; pointer-events: none; }
.panel-right.away { transform: translateX(calc(100% + 24px));  opacity: 0; pointer-events: none; }

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px 11px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.panel-head h2 {
  font-family: var(--f-cond); font-size: .76rem; font-weight: 600;
  letter-spacing: .26em; text-transform: uppercase; color: var(--text);
}
.icon-btn {
  width: 24px; height: 24px; border: none; background: transparent;
  color: var(--dim-2); cursor: pointer; border-radius: 4px;
  display: grid; place-items: center; transition: color .2s, background .2s;
}
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor;
                stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .07); }

.panel-reveal {
  position: fixed; top: 70px; left: 18px; z-index: 109;
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--dim); cursor: pointer; display: none; place-items: center;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.panel-reveal svg { width: 16px; height: 16px; fill: none; stroke: currentColor;
                    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.panel-reveal.show { display: grid; }
.panel-reveal:hover { color: var(--text); border-color: var(--line-2); }

/* ───────────────────────── BUSCADOR ───────────────────────── */
.search-wrap { position: relative; padding: 11px 12px 9px; flex-shrink: 0; }
.search-ico {
  position: absolute; left: 21px; top: 50%; transform: translateY(-40%);
  width: 13px; height: 13px; fill: none; stroke: var(--dim-2);
  stroke-width: 1.8; stroke-linecap: round; pointer-events: none;
}
#tree-search {
  width: 100%; background: rgba(0, 0, 0, .3); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 7px 10px 7px 29px;
  font-size: .78rem; color: var(--text); outline: none;
  transition: border-color .2s;
}
#tree-search::placeholder { color: var(--dim-2); }
#tree-search:focus { border-color: var(--aqua-soft); }
#tree-search::-webkit-search-cancel-button { filter: invert(.6); cursor: pointer; }

/* ───────────────────────── ÁRBOL ───────────────────────── */
.tree { flex: 1; overflow-y: auto; padding: 2px 6px 10px; min-height: 0; }

.tg { margin-bottom: 2px; }
.tg-head {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: var(--r-sm);
  cursor: pointer; user-select: none; transition: background .18s;
}
.tg-head:hover { background: rgba(255, 255, 255, .045); }
.tg-caret {
  width: 11px; height: 11px; flex-shrink: 0; color: var(--dim-2);
  transition: transform .22s var(--ease);
}
.tg-caret svg { width: 100%; height: 100%; fill: none; stroke: currentColor;
                stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tg.open .tg-caret { transform: rotate(90deg); }

.tg-swatch { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }
.tg-name {
  flex: 1; font-family: var(--f-cond); font-size: .82rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tg-count {
  font-family: var(--f-mono); font-size: .64rem; color: var(--dim-2);
  font-variant-numeric: tabular-nums;
}
.tg-eye {
  width: 20px; height: 20px; border: none; background: transparent; padding: 0;
  color: var(--dim-2); cursor: pointer; border-radius: 3px;
  display: grid; place-items: center; flex-shrink: 0;
}
.tg-eye svg { width: 13px; height: 13px; fill: none; stroke: currentColor;
              stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tg-eye:hover { color: var(--text); }
.tg-eye.off { color: var(--dim-2); opacity: .4; }

.tg-items { display: none; padding: 1px 0 5px 24px; }
.tg.open .tg-items { display: block; }

.ti {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 8px; border-radius: 4px; cursor: pointer;
  font-size: .74rem; color: var(--dim);
  white-space: nowrap; overflow: hidden;
  transition: background .15s, color .15s;
}
.ti:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.ti.sel { background: var(--aqua-dim); color: var(--aqua); }
.ti.off { opacity: .35; text-decoration: line-through; }
.ti-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ti-tris { font-family: var(--f-mono); font-size: .6rem; color: var(--dim-2); }

.panel-foot {
  display: flex; gap: 6px; padding: 10px 12px;
  border-top: 1px solid var(--line); flex-shrink: 0;
}
.mini-btn {
  flex: 1; background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line); color: var(--dim);
  padding: 6px 9px; border-radius: var(--r-sm); cursor: pointer;
  font-family: var(--f-cond); font-size: .7rem; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase; white-space: nowrap;
  transition: all .2s;
}
.mini-btn:hover:not(:disabled) { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, .08); }
.mini-btn:disabled { opacity: .35; cursor: default; }

/* ───────────────────────── INSPECTOR ───────────────────────── */
.insp-body { padding: 14px; overflow-y: auto; }
.insp-eyebrow {
  font-size: .62rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--aqua); margin-bottom: 6px;
}
.insp-title {
  font-family: var(--f-cond); font-size: 1.16rem; font-weight: 600;
  line-height: 1.2; letter-spacing: .02em; margin-bottom: 14px;
}

.spec-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-sm); overflow: hidden;
}
.spec {
  background: rgba(0, 0, 0, .25); padding: 8px 10px;
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.spec-k {
  font-family: var(--f-cond); font-size: .62rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dim-2);
}
.spec-v { font-size: .78rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; }

.insp-actions { display: flex; gap: 6px; margin-top: 12px; }
.insp-note {
  margin-top: 12px; font-size: .74rem; line-height: 1.6; color: var(--dim);
  padding-top: 11px; border-top: 1px solid var(--line);
}
.insp-note:empty { display: none; }
.insp-note b { color: var(--aqua); font-weight: 500; }

/* ───────────────────────── DOCK INFERIOR ───────────────────────── */
.dock {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 110; display: flex; align-items: center; gap: 16px;
  padding: 9px 16px; max-width: calc(100vw - 36px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--shadow);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  overflow-x: auto; scrollbar-width: none;
}
.dock::-webkit-scrollbar { display: none; }
.dock-group { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.dock-group + .dock-group { padding-left: 16px; border-left: 1px solid var(--line); }
.dock-label {
  font-family: var(--f-cond); font-size: .64rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--dim-2); white-space: nowrap;
}
.dock-val { font-size: .68rem; color: var(--dim); min-width: 34px; text-align: right; }

.chip {
  background: transparent; border: 1px solid transparent; color: var(--dim);
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  font-family: var(--f-cond); font-size: .74rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  transition: all .2s;
}
.chip:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.chip.on { background: var(--aqua-dim); border-color: var(--aqua-soft); color: var(--aqua); }

.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.seg-b {
  background: transparent; border: none; color: var(--dim-2);
  padding: 5px 10px; cursor: pointer;
  font-family: var(--f-mono); font-size: .66rem; font-weight: 500;
  transition: all .18s;
}
.seg-b + .seg-b { border-left: 1px solid var(--line); }
.seg-b:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.seg-b.active { background: var(--aqua-dim); color: var(--aqua); }

.slider {
  -webkit-appearance: none; appearance: none;
  width: 118px; height: 3px; border-radius: 2px;
  background: rgba(255, 255, 255, .14); outline: none; cursor: pointer;
}
.slider-sm { width: 84px; }
.slider:disabled { opacity: .35; cursor: default; }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--aqua); cursor: pointer; border: 2px solid var(--void-2);
  box-shadow: 0 0 0 1px var(--aqua-soft);
}
.slider::-moz-range-thumb {
  width: 11px; height: 11px; border-radius: 50%; background: var(--aqua);
  cursor: pointer; border: 2px solid var(--void-2);
}

/* ───────────────────────── LECTURA TÉCNICA ───────────────────────── */
.readout {
  position: fixed; right: 18px; bottom: 18px; z-index: 105;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 11px 14px; min-width: 186px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}
.ro-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 2.5px 0; }
.ro-k {
  font-family: var(--f-cond); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--dim-2);
}
.ro-v { font-size: .68rem; color: var(--text); }
.ro-v.on  { color: var(--aqua); }
.ro-v.off { color: var(--dim-2); }
.ro-sep { height: 1px; background: var(--line); margin: 7px 0; }

/* ───────────────────────── DOCK DE EDICIÓN ───────────────────────── */
.edit-dock {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%) translateY(-14px);
  z-index: 115; display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(36, 26, 10, .9); border: 1px solid rgba(242, 169, 59, .4);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.edit-dock.on { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.edit-dock .dock-label { color: var(--amber); }
.edit-dock .mini-btn { flex: none; border-color: rgba(242, 169, 59, .3); color: #f0cf9a; }
.edit-dock .mini-btn:hover { background: rgba(242, 169, 59, .16); color: #fff; }
.edit-hint { font-size: .68rem; color: rgba(240, 207, 154, .6); white-space: nowrap; }

/* ───────────────────────── MARCADORES ───────────────────────── */
.tag {
  position: fixed; z-index: 60; pointer-events: none;
  transform: translate(-50%, calc(-100% - 18px));
  background: rgba(10, 14, 18, .9); border: 1px solid var(--line-2);
  border-left: 2px solid var(--aqua);
  border-radius: 4px; padding: 4px 9px;
  font-family: var(--f-cond); font-size: .7rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  color: var(--text); opacity: 0;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: opacity .3s ease;
}
.tag.show { opacity: 1; }

.dim-label {
  position: fixed; z-index: 55; pointer-events: none;
  transform: translate(-50%, -50%);
  font-family: var(--f-mono); font-size: .62rem; font-weight: 500;
  color: var(--aqua); background: rgba(10, 14, 18, .82);
  padding: 2px 6px; border-radius: 3px; white-space: nowrap;
  border: 1px solid rgba(77, 217, 192, .28);
  opacity: 0; transition: opacity .25s ease;
}
.dim-label.show { opacity: 1; }

/* ───────────────────────── MODAL FICHA ───────────────────────── */
.scrim {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(5, 8, 11, .62);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .35s var(--ease);
}
.scrim.on { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; top: 50%; left: 50%; z-index: 1000;
  width: min(900px, 92vw); height: min(540px, 86vh);
  display: grid; grid-template-columns: 40% 60%;
  background: var(--paper); border-radius: 12px; overflow: hidden;
  transform: translate(-50%, -47%) scale(.975);
  opacity: 0; pointer-events: none;
  box-shadow: 0 36px 100px rgba(0, 0, 0, .6);
  transition: transform .42s var(--ease), opacity .32s var(--ease);
}
.sheet.on { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

.sheet-visual {
  position: relative; background: var(--paper-2);
  display: grid; place-items: center; overflow: hidden;
  border-right: 1px solid var(--ink-line);
}
.sheet-img { width: 100%; height: 100%; object-fit: contain; padding: 18px; display: block; }
.sheet-img.none { display: none; }
.sheet-img-empty {
  display: none; flex-direction: column; align-items: center; gap: 9px;
  color: #b5c0ca; font-family: var(--f-cond); font-size: .74rem;
  letter-spacing: .2em; text-transform: uppercase;
}
.sheet-img-empty.show { display: flex; }
.sheet-img-empty svg { width: 34px; height: 34px; fill: none; stroke: currentColor;
                       stroke-width: 1.3; stroke-linejoin: round; }
.sheet-img-btn {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: none; align-items: center; gap: 6px;
  background: var(--ink); color: #fff; border: none;
  padding: 8px 15px; border-radius: 999px; cursor: pointer;
  font-family: var(--f-cond); font-size: .7rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
}
.sheet-img-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor;
                     stroke-width: 2.2; stroke-linecap: round; }
.sheet.editing .sheet-img-btn { display: inline-flex; }

.sheet-main { position: relative; display: flex; flex-direction: column; min-width: 0; }
.sheet-close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--paper-2); border: 1px solid var(--ink-line);
  color: var(--ink-dim); cursor: pointer; display: grid; place-items: center;
  transition: all .25s var(--ease);
}
.sheet-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor;
                   stroke-width: 1.9; stroke-linecap: round; }
.sheet-close:hover { background: var(--ink); border-color: var(--ink); color: #fff; transform: rotate(90deg); }

.sheet-head { padding: 26px 32px 0; }
.sheet-tag {
  font-size: .6rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-dim); margin-bottom: 11px;
}
.sheet-title-row { display: flex; align-items: center; gap: 13px; }
.sheet-icon {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: var(--r-sm);
  background: var(--paper-2); border: 1px solid var(--ink-line);
  display: grid; place-items: center; color: var(--ink);
}
.sheet-icon svg { width: 21px; height: 21px; }
.sheet-head h3 {
  font-family: var(--f-cond); font-size: 1.46rem; font-weight: 700;
  letter-spacing: .01em; color: var(--ink); line-height: 1.15;
}
.sheet-rule { height: 3px; width: 54px; border-radius: 2px; background: var(--ink); margin-top: 17px; }

.rt-bar {
  display: none; align-items: center; gap: 6px;
  padding: 14px 32px 0;
}
.sheet.editing .rt-bar { display: flex; }
.rt {
  width: 27px; height: 27px; border-radius: 4px;
  background: var(--paper-2); border: 1px solid var(--ink-line);
  color: var(--ink); cursor: pointer; display: grid; place-items: center;
  font-size: .86rem; transition: background .18s;
}
.rt:hover { background: var(--ink-line); }
#rt-color {
  width: 27px; height: 27px; padding: 1px; cursor: pointer;
  border: 1px solid var(--ink-line); border-radius: 4px; background: none;
}
.rt-hint { font-size: .68rem; color: #9aa7b3; margin-left: auto; }

.sheet-body { flex: 1; padding: 16px 32px 20px; overflow-y: auto; min-height: 0; }
#sheet-desc { font-size: .88rem; line-height: 1.75; color: var(--ink-dim); }
#sheet-desc p { margin-bottom: 11px; }
#sheet-desc h4 {
  font-family: var(--f-cond); font-size: .68rem; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink); margin: 17px 0 7px;
}
#sheet-desc h4:first-child { margin-top: 0; }
#sheet-desc ul { list-style: none; margin-bottom: 13px; }
#sheet-desc li { position: relative; padding: 6px 0 6px 19px; border-bottom: 1px solid var(--paper-2); }
#sheet-desc li::before {
  content: ''; position: absolute; left: 2px; top: 15px;
  width: 7px; height: 2px; background: var(--ink);
}
#sheet-desc strong { color: var(--ink); font-weight: 600; }
.sheet.editing [contenteditable="true"] {
  outline: 1px dashed #9fc9c0; outline-offset: 4px;
  border-radius: 3px; cursor: text;
}

.sheet-foot {
  display: none; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 32px; border-top: 1px solid var(--ink-line); background: var(--paper-2);
}
.sheet.editing .sheet-foot { display: flex; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field span {
  font-family: var(--f-cond); font-size: .62rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-dim);
}
.color-field input {
  width: 32px; height: 25px; padding: 1px; cursor: pointer;
  border: 1px solid var(--ink-line); border-radius: 4px; background: none;
}
.sheet-foot-actions { display: flex; gap: 9px; }
.btn-danger, .btn-primary {
  padding: 7px 16px; border-radius: var(--r-sm); cursor: pointer;
  font-family: var(--f-cond); font-size: .7rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  transition: all .22s;
}
.btn-danger  { background: transparent; color: #c25f57; border: 1px solid rgba(194, 95, 87, .4); }
.btn-danger:hover { background: #c25f57; border-color: #c25f57; color: #fff; }
.btn-primary { background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.btn-primary:hover { background: #22323f; }

/* ───────────────────────── AVISOS ───────────────────────── */
.toast {
  position: fixed; bottom: 92px; left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 9998; padding: 10px 20px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  border-left: 2px solid var(--aqua); color: var(--text);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  font-family: var(--f-cond); font-size: .76rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.warn { border-left-color: var(--amber); }

.hint-bar {
  position: fixed; bottom: 18px; left: 18px; z-index: 104;
  display: flex; gap: 14px; align-items: center;
  font-size: .66rem; color: var(--dim-2);
  opacity: .85; transition: opacity .3s;
}
.hint-bar kbd {
  font-family: var(--f-mono); font-size: .6rem;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  border-radius: 3px; padding: 1.5px 5px; margin-right: 3px; color: var(--dim);
}

/* ───────────────────────── SCROLLBARS ───────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .13); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .22); }

/* ───────────────────────── RESPONSIVE ───────────────────────── */
@media (max-width: 1180px) {
  .hint-bar { display: none; }
  .panel-left { bottom: 150px; }
}

@media (max-width: 920px) {
  .topbar { height: 52px; padding: 0 12px; }
  .brand-sub { display: none; }
  .tool span { display: none; }
  .tool { padding: 7px 9px; }
  .panel-left  { width: 232px; top: 62px; bottom: 170px; }
  .panel-right { width: 232px; top: 62px; }
  .readout { display: none; }
  .dock { bottom: 12px; gap: 11px; padding: 8px 12px; border-radius: var(--r); }
  .dock-group + .dock-group { padding-left: 11px; }
  .sheet { grid-template-columns: 1fr; grid-template-rows: 180px 1fr; height: min(620px, 90vh); }
  .sheet-head { padding: 20px 22px 0; }
  .sheet-body { padding: 14px 22px 16px; }
  .rt-bar, .sheet-foot { padding-left: 22px; padding-right: 22px; }
  .edit-dock { font-size: .9em; }
  .edit-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
