/* Traza — mesa de dibujo */
:root {
  --bg: #f6f5f1;
  --paper: #ffffff;
  --ink: #151515;
  --ink-2: #4a4a48;
  --muted: #8a8a86;
  --line: #e2e0d9;
  --line-2: #d2d0c8;
  --accent: #e5361b;
  --accent-ink: #ffffff;
  --blue: #2563eb;
  --aux: #9aa0a6;
  --sel: #2563eb;
  --grid-minor: #eeece6;
  --grid-major: #dedbd2;
  --shadow: 0 6px 24px rgba(20, 20, 20, 0.08);
  --note: #fff8d6;
  --note-line: #e3c25b;
  --ins-fill: rgba(70, 140, 225, 0.10); --ins-line: rgba(37, 99, 235, 0.6); --ins-tick: #26303d; --ins-knob: #2563eb; --ins-leg: #8a929e;
  --c-gris: #6b7280; --c-marron: #8b4513; --c-rojo: #d7263d; --c-rojoI: #e00000; --c-naranja: #e07b00; --c-amarillo: #c99a00; --c-lima: #3fa600;
  --c-verde: #0f9668; --c-cian: #0091c2; --c-azul: #2563eb; --c-azulI: #0030ff; --c-morado: #7c3aed; --c-magenta: #e6007e;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --top-h: 52px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121315; --paper: #1a1b1e; --ink: #ecebe6; --ink-2: #b9b8b2; --muted: #85847f;
    --line: #2a2b2f; --line-2: #3a3b40; --aux: #6f747a; --sel: #5b8cff;
    --grid-minor: #212226; --grid-major: #2d2e33; --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    --ins-fill: rgba(120, 170, 255, 0.10); --ins-line: rgba(140, 180, 255, 0.65); --ins-tick: #d3d9e3; --ins-knob: #6b9bff; --ins-leg: #9aa3b0;
    --c-gris: #a3a9b3; --c-marron: #d39a6a; --c-rojo: #ff5a6e; --c-rojoI: #ff2b2b; --c-naranja: #ff9a2e; --c-amarillo: #ffd60a; --c-lima: #8cff3a;
    --c-verde: #2fd39a; --c-cian: #22d3ee; --c-azul: #6b9bff; --c-azulI: #3d7bff; --c-morado: #b49bff; --c-magenta: #ff40b4;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121315; --paper: #1a1b1e; --ink: #ecebe6; --ink-2: #b9b8b2; --muted: #85847f;
  --line: #2a2b2f; --line-2: #3a3b40; --aux: #6f747a; --sel: #5b8cff;
  --grid-minor: #212226; --grid-major: #2d2e33; --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  --ins-fill: rgba(120, 170, 255, 0.10); --ins-line: rgba(140, 180, 255, 0.65); --ins-tick: #d3d9e3; --ins-knob: #6b9bff; --ins-leg: #9aa3b0;
  --c-gris: #a3a9b3; --c-marron: #d39a6a; --c-rojo: #ff5a6e; --c-rojoI: #ff2b2b; --c-naranja: #ff9a2e; --c-amarillo: #ffd60a; --c-lima: #8cff3a;
  --c-verde: #2fd39a; --c-cian: #22d3ee; --c-azul: #6b9bff; --c-azulI: #3d7bff; --c-morado: #b49bff; --c-magenta: #ff40b4;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg);
  display: flex; flex-direction: column; overflow: hidden; -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; }
svg { display: block; }
kbd {
  font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 4px; background: var(--paper); color: var(--ink-2); white-space: nowrap;
}
[hidden] { display: none !important; }

/* ---------- Barra superior ---------- */
.top {
  height: var(--top-h); flex: none; display: flex; align-items: center; gap: 10px;
  padding: 0 12px; background: var(--paper); border-bottom: 1px solid var(--line); position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -0.02em; font-size: 17px; margin-right: 6px; white-space: nowrap; flex: none; }
.brand svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: square; }
.brand svg path:last-child { stroke: var(--accent); }
.group { display: flex; align-items: center; gap: 4px; }
.spacer { flex: 1; }
.btn {
  border: 1px solid var(--line-2); background: var(--paper); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-weight: 500;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled, .btn:disabled:hover { opacity: 0.4; cursor: default; background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.danger { color: #c62828; }
.btn.danger:hover { border-color: #c62828; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid transparent; background: transparent;
  border-radius: 8px; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }
.icon-btn svg, .chip svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chip {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--paper); color: var(--muted); font-size: 13px; font-weight: 500;
}
.chip svg { width: 17px; height: 17px; }
.chip[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); background: var(--bg); }
.panel-toggle { display: none; }

.menu { position: relative; }
.menu-pop {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 250px; background: var(--paper); border: 1px solid var(--line-2);
  border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 50;
}
.menu.open .menu-pop { display: block; }
.menu-pop button {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; text-align: left;
  border: 0; background: transparent; padding: 9px 10px; border-radius: 6px; cursor: pointer;
}
.menu-pop button:hover { background: var(--bg); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* ---------- Disposición ---------- */
.main { flex: 1; display: flex; min-height: 0; }

.tools {
  width: 92px; flex: none; background: var(--paper); border-right: 1px solid var(--line); overflow-y: auto; overflow-x: hidden;
  padding: 8px 6px 16px; scrollbar-width: thin;
}
.tool-group-title {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; cursor: pointer;
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.01em; text-transform: uppercase; color: var(--muted); white-space: nowrap;
  padding: 12px 2px 6px; border-top: 1px solid var(--line); margin-top: 4px;
}
.tgroup:first-child .tool-group-title { border-top: 0; margin-top: 0; padding-top: 4px; }
.tool-group-title:hover { color: var(--ink); }
.tool-group-title svg { width: 9px; height: 9px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform 0.15s; flex: none; }
.tgroup.closed .tool-group-title svg { transform: rotate(-90deg); }
.tgroup.closed .tg-body { display: none; }
.tool {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px;
  border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer; color: var(--ink-2);
  font-size: 11px; line-height: 1.15; text-align: center;
}
.tool svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tool svg .f { fill: currentColor; stroke: none; }
.tool svg .a { stroke: var(--accent); }
.tool:hover { background: var(--bg); color: var(--ink); }
.tool[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tool[aria-pressed="true"] svg .a { stroke: #ff7a5c; }

.stage { flex: 1; position: relative; min-width: 0; background: var(--paper); overflow: hidden; }
#canvas { width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
#canvas.tool-move { cursor: default; }
#canvas.can-drag { cursor: grab; }
#canvas.dragging { cursor: grabbing; }

/* Elementos del dibujo */
.grid-minor { stroke: var(--grid-minor); stroke-width: 1; fill: none; }
.grid-major { stroke: var(--grid-major); stroke-width: 1; fill: none; }
.grid-origin { stroke: var(--muted); stroke-width: 1; fill: none; }
.halo { fill: none; stroke: var(--sel); stroke-width: 9; stroke-opacity: 0.25; stroke-linecap: round; }
.hover { fill: none; stroke: var(--sel); stroke-width: 7; stroke-opacity: 0.13; stroke-linecap: round; }
.halo-pt { fill: var(--sel); fill-opacity: 0.25; }
.hover-pt { fill: var(--sel); fill-opacity: 0.14; }
.pt { stroke: var(--paper); stroke-width: 1.5; }
.pt-free { fill: var(--blue); }
.pt-dep { fill: var(--ink); }
.pt-on { fill: var(--paper); stroke: var(--blue); stroke-width: 2; }
.pt-prev { fill: var(--blue); opacity: 0.6; }
.pt-tr { fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; }
.prev { opacity: 0.55; }
.lbl { font-weight: 500; paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
.snap-mark { fill: none; stroke: var(--accent); stroke-width: 2; }
.snap-dot { fill: var(--accent); }

/* Indicaciones */
.hint {
  position: absolute; top: 12px; left: 12px; right: 12px; margin-inline: auto; width: fit-content; z-index: 5;
  display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-size: 13.5px; box-shadow: var(--shadow); pointer-events: none;
  transition: background 0.2s;
}
.hint .tname { background: var(--accent); color: #fff; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; font-size: 12.5px; }
.hint .stepn { font-family: var(--mono); font-size: 11.5px; opacity: 0.6; white-space: nowrap; }
.hint.warn { background: #b42318; }
.hint.warn .tname { background: #fff; color: #b42318; }
.replay-banner {
  position: absolute; top: 58px; left: 12px; right: 12px; margin-inline: auto; width: fit-content; z-index: 5; padding: 6px 12px; border-radius: 8px;
  background: #fff4cc; color: #5c4400; font-size: 13px; border: 1px solid #f0d77a;
}

.status {
  position: absolute; left: 10px; bottom: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  pointer-events: none; display: flex; gap: 14px; background: color-mix(in srgb, var(--paper) 80%, transparent); padding: 2px 6px; border-radius: 6px;
}
.status b { color: var(--ink-2); font-weight: 500; }

/* Barra de medidas exactas */
.inputbar {
  position: absolute; left: 12px; right: 12px; margin-inline: auto; width: fit-content; bottom: 36px; z-index: 6; display: flex; align-items: flex-end;
  flex-wrap: wrap; justify-content: center; gap: 8px; padding: 10px 12px;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow);
}
.inputbar .ib-title { align-self: center; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-right: 2px; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field span { font-size: 11px; color: var(--muted); font-weight: 500; }
.field .wrap { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); }
.field .wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 20%, transparent); }
.field input {
  width: 84px; border: 0; background: transparent; padding: 7px 4px 7px 9px; font-family: var(--mono); font-size: 13.5px; color: var(--ink); outline: none;
}
.field input::placeholder { color: var(--muted); opacity: 0.8; }
.field .unit { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-right: 8px; }
.inputbar .btn { padding: 7px 12px; }
.inputbar .seg { display: flex; gap: 4px; align-self: center; }
.inputbar .seg .chip { height: 32px; }

/* ---------- Panel derecho ---------- */
.panel { width: 290px; flex: none; background: var(--paper); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tab {
  flex: 1; border: 0; background: transparent; padding: 12px 8px; cursor: pointer; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.count { font-family: var(--mono); font-size: 11px; background: var(--bg); border: 1px solid var(--line); padding: 0 6px; border-radius: 999px; color: var(--ink-2); }
.tab-body { flex: 1; overflow-y: auto; padding: 14px; min-height: 0; }

.empty { color: var(--muted); line-height: 1.55; font-size: 13.5px; }
.empty .big { font-size: 15px; color: var(--ink-2); font-weight: 600; margin: 0 0 6px; }
.p-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.p-type { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; }
.p-name {
  font-size: 18px; font-weight: 700; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin-left: -6px;
  width: 100%; background: transparent; color: var(--ink); font-family: var(--font);
}
.p-name:hover { border-color: var(--line-2); }
.p-name:focus { border-color: var(--blue); outline: none; }
.p-desc { color: var(--ink-2); font-size: 13px; margin: 2px 0 14px; line-height: 1.45; }
.p-sec { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.p-sec h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.p-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.p-fields .field input { width: 100%; }
.p-fields .field .wrap { width: 100%; }
.ro input { color: var(--ink-2); }
.lt-list { display: flex; flex-direction: column; gap: 4px; }
.lt {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: transparent; border-radius: 8px;
  padding: 6px 8px; cursor: pointer; text-align: left;
}
.lt:hover { border-color: var(--line-2); background: var(--bg); }
.lt[aria-pressed="true"] { border-color: var(--ink); background: var(--bg); }
.lt svg { width: 46px; height: 12px; flex: none; }
.lt b { font-weight: 600; font-size: 12.5px; display: block; }
.lt small { color: var(--muted); font-size: 11px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.p-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.p-actions .btn { flex: 1; }
.note { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.45; }

/* Pasos */
.replay { position: sticky; top: -14px; background: var(--paper); padding: 0 0 10px; margin-top: -2px; border-bottom: 1px solid var(--line); z-index: 1; }
.replay-btns { display: flex; justify-content: center; gap: 2px; }
.replay-btns .play { background: var(--ink); color: var(--paper); }
.replay-btns .play:hover { background: var(--accent); color: #fff; }
.replay input[type="range"] { width: 100%; accent-color: var(--accent); margin-top: 6px; }
.steps { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: s; }
.steps li {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 6px; padding: 6px 6px; border-radius: 8px; cursor: pointer;
  font-size: 13px;
}
.steps li:hover { background: var(--bg); }
.steps li.sel { background: color-mix(in srgb, var(--sel) 12%, transparent); }
.steps li.future { opacity: 0.35; }
.steps li.now { box-shadow: inset 3px 0 0 var(--accent); }
.steps li.hid .s-txt { text-decoration: line-through; color: var(--muted); }
.steps .s-n { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }
.steps .s-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps .s-txt b { font-weight: 600; margin-right: 4px; }
.steps .eye { width: 26px; height: 26px; }
.steps .eye svg { width: 16px; height: 16px; }

/* ---------- Diálogos ---------- */
.dlg {
  border: 1px solid var(--line-2); border-radius: 16px; padding: 26px 28px 22px; max-width: 520px; width: calc(100% - 32px);
  background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}
.dlg::backdrop { background: rgba(15, 15, 15, 0.45); }
.dlg h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.02em; }
.dlg p { color: var(--ink-2); line-height: 1.5; }
.dlg form { display: flex; justify-content: flex-end; margin-top: 18px; }
.tips { padding-left: 20px; line-height: 1.55; color: var(--ink-2); }
.tips li { margin-bottom: 10px; }
.tips b { color: var(--ink); }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; font-size: 13px; color: var(--ink-2); margin: 14px 0; }
.muted { color: var(--muted) !important; font-size: 13px; }

/* ---------- Tablet y móvil ---------- */
@media (max-width: 1100px) {
  .chip span { display: none; }
  .chip { padding: 0 9px; }
}
@media (max-width: 900px) {
  .panel-toggle { display: grid; }
  .panel {
    position: fixed; right: 0; top: var(--top-h); bottom: 0; z-index: 30; box-shadow: var(--shadow);
    transform: translateX(100%); transition: transform 0.25s ease; width: min(320px, 92vw);
  }
  body.panel-open .panel { transform: none; }
}
@media (max-width: 680px) {
  :root { --top-h: 50px; }
  .top { gap: 4px; padding: 0 6px; }
  .brand span { display: none; }
  .toggles .chip:nth-child(2), .toggles .chip:nth-child(3), [data-act="theme"] { display: none; }
  .mode-seg .chip span { display: none; }
  .icon-btn { width: 32px; height: 34px; }
  .menu .btn { padding: 6px 9px; }
  .main { flex-direction: column-reverse; }
  .tools {
    width: 100%; height: auto; display: flex; overflow-x: auto; overflow-y: hidden; border-right: 0; border-top: 1px solid var(--line);
    padding: 6px; gap: 2px; flex: none; padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
  .tool-group-title { display: none; }
  .tgroup, .tgroup .tg-body, .tgroup.closed .tg-body { display: contents; }
  .tool { width: 66px; flex: none; font-size: 10px; padding: 6px 2px; }
  .tool svg { width: 24px; height: 24px; }
  .hint { top: 8px; left: 8px; right: 8px; font-size: 12.5px; border-radius: 14px; }
  .hint .stepn { display: none; }
  .inputbar { bottom: 10px; left: 8px; right: 8px; }
  .field input { width: 70px; }
  .status { display: none; }
}

/* ---------- Editor de piezas 3D ---------- */
.pe {
  width: min(1180px, 96vw); height: min(780px, 94vh); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line-2);
  border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}
.pe[open] { display: grid; grid-template-rows: auto 1fr auto; }
.pe::backdrop { background: rgba(15, 15, 15, 0.5); }
.pe-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.pe-title h2 { margin: 0; font-size: 19px; letter-spacing: -0.02em; }
.pe-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); max-width: 44ch; }
.pe-seg { display: flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; margin-left: auto; }
.pe-tool { display: flex; align-items: center; gap: 6px; border: 0; background: var(--paper); padding: 8px 12px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.pe-tool + .pe-tool { border-left: 1px solid var(--line-2); }
.pe-tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.pe-tool[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.pe-actions { display: flex; align-items: center; gap: 2px; }
.pe-ex { font: inherit; font-size: 13px; padding: 7px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--paper); color: var(--ink); margin: 0 4px; }
.pe-body { display: grid; grid-template-columns: 1fr 300px; min-height: 0; }
.pe-stage { position: relative; min-height: 0; background: var(--bg); }
.pe-svg { width: 100%; height: 100%; display: block; }
.pe-hint { position: absolute; left: 12px; right: 12px; bottom: 10px; margin: 0 auto; width: fit-content; max-width: calc(100% - 24px); background: var(--ink); color: var(--paper); font-size: 13px; padding: 7px 14px; border-radius: 999px; pointer-events: none; }
.pe-floor { fill: var(--paper); stroke: var(--line-2); stroke-width: 0.02; cursor: pointer; }
.pe-floor:hover { fill: color-mix(in srgb, var(--accent) 25%, var(--paper)); }
.pe-face { stroke: #262626; stroke-width: 0.028; stroke-linejoin: round; cursor: pointer; }
.pe-face:hover { stroke: var(--accent); stroke-width: 0.06; }
.pe-axis { stroke: var(--accent); stroke-width: 0.05; }
.pe-axl { font-size: 0.36px; fill: var(--accent); font-family: var(--mono); text-anchor: middle; }
.pe-side { border-left: 1px solid var(--line); padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.pe-side h4 { margin: 4px 0 0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.pe-mini { width: 100%; height: 210px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.pe-vis { stroke: var(--ink); stroke-width: 0.06; stroke-linecap: round; }
.pe-hid { stroke: var(--ink-2); stroke-width: 0.04; stroke-dasharray: 0.18 0.12; }
.pe-empty { font-size: 8px; fill: var(--muted); text-anchor: middle; }
.pe-check { margin: 2px 0; font-size: 13.5px; font-weight: 600; min-height: 1.2em; }
.pe-check.good { color: #0a8a50; }
.pe-check.bad { color: #c62828; }
.pe-field { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.pe-field input { width: 64px; font-family: var(--mono); font-size: 13px; padding: 5px 7px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--bg); color: var(--ink); }
.pe-ins { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.pe-ins legend { font-size: 11px; color: var(--muted); padding: 0 4px; }
.pe-ins label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.pe-ins input { accent-color: var(--ink); }
.pe-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); }
.pe-count { margin-right: auto; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.p-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.p-btns .btn { padding: 6px 10px; font-size: 13px; }
@media (max-width: 820px) {
  .pe { width: 100vw; height: 100dvh; border-radius: 0; }
  .pe-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .pe-side { border-left: 0; border-top: 1px solid var(--line); max-height: 40vh; }
  .pe-mini { height: 150px; }
  .pe-seg { margin-left: 0; }
}

/* ---------- Ejercicios guiados ---------- */
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }
.tabs .tab { font-size: 13px; padding: 12px 4px; }
.ex-kicker { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); }
.ex-home h3, .ex-card h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -0.02em; }
.ex-p { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 0 0 10px; }
.ex-lib h4, .ex-teacher h4 { margin: 14px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.ex-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 9px 10px; margin-bottom: 6px;
}
.ex-item:hover { border-color: var(--ink); background: var(--bg); }
.ex-item b { display: block; font-size: 13.5px; font-weight: 600; }
.ex-item small { font-size: 11.5px; color: var(--muted); }
.ex-item svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.ex-sep { border-top: 1px solid var(--line); margin: 12px 0; }
.ex-home > .btn, .ex-teacher .btn { width: 100%; }
.ex-teacher { margin-top: 6px; }
.ex-statement { font-size: 14px; line-height: 1.5; margin: 0 0 12px; padding: 10px 12px; background: var(--bg); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
.ex-prog { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.ex-prog div { height: 100%; background: var(--accent); transition: width 0.4s ease; }
.ex-progt { margin: 4px 0 10px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.ex-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ex-steps li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: start; font-size: 13.5px; line-height: 1.45; padding: 8px; border-radius: 10px; border: 1px solid var(--line); }
.ex-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--bg); border: 1px solid var(--line-2); }
.ex-steps li.done { border-color: color-mix(in srgb, #0a8a50 40%, transparent); background: color-mix(in srgb, #0a8a50 7%, transparent); }
.ex-steps li.done .ex-n { background: #0a8a50; border-color: #0a8a50; color: #fff; }
.ex-steps li.now { border-color: var(--ink); }
.ex-steps li.now .ex-n { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ex-steps li.locked { color: var(--muted); font-style: italic; }
.ex-steps em { color: var(--muted); font-size: 12px; }
.ex-win { margin-top: 12px; padding: 12px; border-radius: 10px; background: #0a8a50; color: #fff; display: flex; flex-direction: column; gap: 2px; }
.ex-win b { font-size: 15px; }
.ex-win span { font-size: 13px; opacity: 0.9; }
.ex-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ex-btns .btn { flex: 1 1 auto; padding: 7px 10px; font-size: 13px; }
.ex-links { display: flex; justify-content: space-between; margin-top: 12px; }
.lnk { border: 0; background: none; padding: 2px 0; color: var(--muted); font-size: 12.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.lnk:hover { color: var(--ink); }
.ex-f { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.ex-f input, .ex-f textarea, .ex-steptext {
  font: inherit; font-size: 13.5px; font-weight: 400; color: var(--ink); padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); resize: vertical;
}
.ex-auth { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; }
.ex-auth li { border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; display: flex; flex-direction: column; gap: 6px; }
.ex-chk { display: flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; }
.ex-chk input { accent-color: var(--ink); }
.ex-steptext { width: 100%; }
.ex-empty { font-size: 13px; color: var(--muted); font-style: italic; }


/* ---------- Barra por categorías: carril + cinta ---------- */
.work { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.work .stage { flex: 1; min-height: 0; }
.tools { width: 78px; padding: 8px 6px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.rail-sep { height: 1px; background: var(--line); margin: 6px 4px; flex: none; }
.cat {
  width: 100%; flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px; position: relative;
  border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer; color: var(--ink-2); font-size: 10.5px; line-height: 1.15; text-align: center;
}
.cat svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cat svg .f { fill: currentColor; stroke: none; }
.cat svg .a { stroke: var(--accent); }
.cat:hover { background: var(--bg); color: var(--ink); }
.cat[aria-pressed="true"] { background: var(--bg); color: var(--ink); border-color: var(--line-2); font-weight: 600; }
.cat[aria-pressed="true"]::before { content: ""; position: absolute; left: -6px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.cat.has-tool::after { content: ""; position: absolute; top: 6px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tools > .tool { flex: none; }
.ribbon {
  flex: none; display: flex; align-items: stretch; gap: 2px; padding: 5px 8px; background: var(--paper); border-bottom: 1px solid var(--line);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; min-height: 66px;
}
.rb-title {
  align-self: center; flex: none; font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent);
  padding: 0 12px 0 4px; margin-right: 4px; border-right: 1px solid var(--line); max-width: 96px; white-space: normal; line-height: 1.2;
}
.ribbon .tool { width: 80px; flex: none; padding: 6px 3px; font-size: 10.5px; }
.ribbon .tool svg { width: 24px; height: 24px; }
@media (max-width: 680px) {
  .tools { flex-direction: row; width: 100%; height: auto; overflow-x: auto; overflow-y: hidden; padding: 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .tools > .tool, .cat { width: 70px; flex: none; }
  .rail-sep { width: 1px; height: auto; margin: 4px 4px; }
  .cat[aria-pressed="true"]::before { left: 10px; right: 10px; top: auto; bottom: -6px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .rb-title { display: none; }
  .ribbon { min-height: 60px; padding: 4px 6px; }
  .ribbon .tool { width: 68px; font-size: 10px; }
}
.cat span { font-size: 10px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
.rb-title { font-size: 9.5px; max-width: 92px; overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }
.ribbon .tool { width: 76px; }

.halo-box { fill: var(--sel); fill-opacity: 0.12; stroke: var(--sel); stroke-width: 1.5; stroke-dasharray: 4 3; }
.hover-box { fill: var(--sel); fill-opacity: 0.06; stroke: var(--sel); stroke-opacity: 0.5; stroke-width: 1; }
:root[data-theme="dark"] { --note: #3a3418; --note-line: #8a7424; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --note: #3a3418; --note-line: #8a7424; } }

/* ---------- Edición tipo CAD ---------- */
.top-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.sel-win { fill: rgba(37, 99, 235, 0.08); stroke: #2563eb; stroke-width: 1; }
.sel-cross { fill: rgba(16, 150, 100, 0.08); stroke: #10966a; stroke-width: 1; stroke-dasharray: 6 4; }
.grip { fill: #2563eb; stroke: #fff; stroke-width: 1.5; cursor: move; }
.ib-modes { flex-wrap: wrap; }
.ib-break { flex-basis: 100%; height: 0; }
.ib-textf textarea {
  width: min(360px, 70vw); font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--bg); color: var(--ink); resize: vertical; min-height: 34px;
}
.ib-textf textarea:focus { outline: none; border-color: var(--blue); }
.inputbar .swatches { align-self: center; }
.inputbar .swatches { gap: 4px; max-width: 260px; }
.inputbar .sw { width: 18px; height: 18px; }
.p-textarea { margin: 6px 0 10px; }
.p-textarea textarea { width: 100%; font: inherit; font-size: 14px; padding: 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--ink); resize: vertical; }
.del-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.fs-off { display: none; }
body.is-fs .fs-on { display: none; }
body.is-fs .fs-off { display: block; }
#canvas.tool-pan { cursor: grab; }

/* ---------- Tableros (arriba) y hojas (abajo, como Excel) ---------- */
.boards { flex: none; display: flex; align-items: flex-end; gap: 4px; padding: 6px 8px 0; background: var(--bg); border-bottom: 1px solid var(--line); min-height: 38px; }
.bd-tabs { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: thin; min-width: 0; }
.bd-tab {
  flex: none; display: flex; align-items: center; gap: 6px; max-width: 220px; padding: 6px 6px 6px 12px; cursor: pointer;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 9px 9px 0 0; background: var(--paper); color: var(--ink-2); font-size: 13px;
  opacity: 0.75; position: relative; top: 1px;
}
.bd-tab:hover { opacity: 1; }
.bd-tab.active { opacity: 1; color: var(--ink); font-weight: 600; box-shadow: inset 0 3px 0 var(--accent); border-color: var(--line-2); }
.bd-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-badge { font-size: 10px; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); font-weight: 600; }
.bd-x { border: 0; background: transparent; color: var(--muted); width: 20px; height: 20px; border-radius: 5px; cursor: pointer; font-size: 15px; line-height: 1; }
.bd-x:hover { background: var(--bg); color: var(--ink); }
.bd-add, .sh-add { flex: none; border: 1px dashed var(--line-2); background: transparent; color: var(--ink-2); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 18px; margin-bottom: 3px; }
.bd-add:hover, .sh-add:hover { border-style: solid; color: var(--ink); background: var(--paper); }
.bd-space { flex: 1; }
.bd-files { flex: none; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 5px 10px; margin-bottom: 4px; cursor: pointer; font-size: 13px; font-weight: 500; }
.bd-files svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bd-files:hover { border-color: var(--ink); }
.tab-edit { font: inherit; font-size: 13px; width: 140px; padding: 2px 6px; border: 1px solid var(--blue); border-radius: 5px; background: var(--paper); color: var(--ink); outline: none; }
.sheets { flex: none; display: flex; align-items: center; gap: 4px; padding: 5px 8px; background: var(--paper); border-top: 1px solid var(--line); min-height: 42px; }
.sh-tabs { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: thin; min-width: 0; align-items: center; }
.sh-tab { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 5px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 500; max-width: 200px; }
.sh-tab:hover { background: var(--bg); }
.sh-tab.active { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
.sh-n { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 5px; font-size: 11px; font-weight: 700; }
.sh-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-tools { display: none; gap: 1px; }
.sh-tab:hover .sh-tools { display: flex; }
.sh-tools button { border: 0; background: transparent; color: inherit; width: 20px; height: 20px; border-radius: 5px; cursor: pointer; font-size: 12px; opacity: 0.8; }
.sh-tools button:hover { background: rgba(127, 127, 127, 0.25); opacity: 1; }
.sh-palette { position: fixed; z-index: 100; display: grid; grid-template-columns: repeat(5, 28px); gap: 4px; padding: 8px; background: var(--paper); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); }
.sh-palette button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid rgba(0, 0, 0, 0.15); cursor: pointer; font-size: 9px; }

/* Cuenta */
.acct-btn { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 500; position: relative; }
.acct-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.acct-btn:hover { border-color: var(--ink); }
#cloudState { width: 7px; height: 7px; border-radius: 50%; display: none; }
#cloudState[data-state="ok"] { display: block; background: #0a8a50; }
#cloudState[data-state="err"] { display: block; background: #c62828; }
.acct-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.acct-f input, .acct-f select { font: inherit; font-size: 15px; font-weight: 400; padding: 9px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--ink); }
.acct-msg { color: #c62828; font-size: 13.5px; margin: 4px 0 10px; }
.acct-msg.ok { color: #0a8a50; }
.acct-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.acct-alt { font-size: 13px; color: var(--muted); margin-top: 14px; }
.acct-pw summary { cursor: pointer; font-size: 13.5px; margin: 8px 0; }

/* Gestor de archivos */
.fm { width: min(1100px, 96vw); height: min(780px, 92vh); padding: 0; border: 1px solid var(--line-2); border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3); max-width: none; max-height: none; }
.fm[open] { display: grid; grid-template-rows: auto auto 1fr; }
.fm::backdrop { background: rgba(15, 15, 15, 0.5); }
.fm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.fm-head h2 { margin: 0 10px 0 0; font-size: 19px; }
.fm-head input, .fm-head select { font: inherit; font-size: 13.5px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--ink); }
.fm-head input { flex: 1; min-width: 160px; }
.fm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
#fm-count { font-family: var(--mono); color: var(--muted); }
.fm-list { overflow-y: auto; padding: 14px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; align-content: start; }
.fm-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; background: var(--paper); }
.fm-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.fm-thumb { height: 130px; background: #fff; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.fm-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.fm-thumb span { font-size: 12px; color: #999; }
.fm-info { padding: 9px 11px 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fm-info b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-info small { color: var(--muted); font-size: 11.5px; }
.fm-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.fm-badges i { font-style: normal; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--ink-2); }
.fm-badges .b-cl { color: #1d5fd6; border-color: #a9c1f0; }
.fm-badges .b-ex { color: var(--accent); }
.fm-badges .b-op { color: #0a8a50; border-color: #9fd6bc; }
.fm-acts { display: flex; gap: 4px; padding: 8px 10px 10px; }
.fm-acts .btn { padding: 5px 9px; font-size: 13px; }
.fm-acts .btn.primary { flex: 1; }
.fm-empty { color: var(--muted); grid-column: 1 / -1; text-align: center; padding: 40px; }
@media (max-width: 680px) {
  .bd-files { padding: 5px 7px; font-size: 0; gap: 0; }
  .bd-files svg { width: 18px; height: 18px; }
  .acct-btn span { display: none; }
}
.bd-tabs { overflow-y: hidden; }
#acctBox form { display: block; margin-top: 10px; }
#acctBox .acct-btns { display: flex; }
#acctBox h2 { margin-bottom: 4px; }

/* Modo manual: instrumentos de dibujo */
.mode-seg { gap: 0; }
.mode-seg .chip:first-child { border-radius: 999px 0 0 999px; }
.mode-seg .chip:last-child { border-radius: 0 999px 999px 0; margin-left: -1px; }
#instr { pointer-events: none; }
.ins-body { fill: var(--ins-fill); stroke: var(--ins-line); stroke-width: 1.2; }
.ins-body.on { stroke-width: 2; }
.ins-hole { fill: var(--paper); fill-opacity: 0.5; stroke: var(--ins-line); stroke-width: 1; }
.ins-tick { fill: none; stroke: var(--ins-tick); stroke-width: 1; }
.ins-lbl { font: 600 10px var(--mono); fill: var(--ins-tick); text-anchor: middle; dominant-baseline: middle; }
.ins-name { font: 600 12px var(--font); fill: var(--ins-line); text-anchor: middle; }
.ins-rot circle { fill: var(--paper); stroke: var(--ins-knob); stroke-width: 1.6; }
.ins-rot path { fill: none; stroke: var(--ins-knob); stroke-width: 1.6; stroke-linecap: round; }
.ins-free circle { fill: var(--paper); stroke: var(--ins-leg); stroke-width: 1.6; stroke-dasharray: 3 2; }
.ins-free path { fill: none; stroke: var(--ins-tick); stroke-width: 1.4; stroke-linecap: round; }
.ins-pin { fill: var(--accent); stroke: var(--paper); stroke-width: 1.5; }
.ins-pivot { fill: none; stroke: var(--accent); stroke-width: 2; }
.ins-trace { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.ins-read { font: 600 12px var(--mono); fill: var(--accent); paint-order: stroke; stroke: var(--paper); stroke-width: 3px; }
.ins-leg { fill: none; stroke: var(--ins-leg); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; }
.ins-needle { stroke: var(--ink); stroke-width: 2; }
.ins-hinge { fill: var(--ins-leg); stroke: var(--paper); stroke-width: 1.5; }
.ins-knob.head { fill: var(--ins-knob); stroke: var(--paper); stroke-width: 2; }
.ins-pt { fill: var(--paper); stroke: var(--ins-knob); stroke-width: 2; }
.ins-pt.needle { stroke: var(--ink); }
.ins-lock { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.tool.ins-toggle[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ins-knob); }
.help-h { font-size: 14px; margin: 18px 0 8px; }

/* Modo vídeo */
.video-dlg { max-width: 860px; }
.vd-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 22px; align-items: start; margin-top: 10px; }
.vd-prev { display: flex; justify-content: center; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.vd-prev canvas { max-width: 100%; max-height: 58vh; height: auto; width: auto; background: #fff; border-radius: 6px; box-shadow: var(--shadow); }
.vd-opts { display: flex; flex-direction: column; gap: 10px; }
.vd-opts .acct-f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.vd-opts select, .vd-opts input[type="text"], .vd-opts #vdTitle { font: inherit; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--paper); color: var(--ink); }
.vd-chk { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); }
.vd-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.vd-status { font-size: 13px; color: var(--ink-2); min-height: 1.4em; margin: 0; }
.vd-open { width: 100%; margin-top: 10px; }
@media (max-width: 680px) { .vd-grid { grid-template-columns: 1fr; } .vd-prev canvas { max-height: 40vh; } }

/* Cuenta: plan y pagos */
.acct-plan { margin: 4px 0 8px; }
.acct-pay { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.acct-chk { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); margin: 2px 0 10px; line-height: 1.4; }
.acct-chk input { margin-top: 2px; flex: none; }
.small { font-size: 12.5px; }
/* Funciones Pro que aún no existen */
.menu-h { display: block; padding: 4px 12px 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pro-tag { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; padding: 2px 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); margin-left: 6px; vertical-align: 1px; }
.pro-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 0 0 4px; }
.pro-door { margin: 10px 0; }
.pro-card { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; padding: 12px 14px; border: 1px dashed var(--accent); border-radius: 10px; background: var(--paper); color: var(--ink); cursor: pointer; font: inherit; }
.pro-card:hover { background: var(--bg); }
.pro-card b { display: block; font-size: 14px; }
.pro-card small { color: var(--muted); font-size: 12px; }
