/* Krea - interfaz */
:root {
  --bg: #1f2124;
  --panel: #2b2e33;
  --panel2: #34383e;
  --line: #14161a;
  --line2: #454b53;
  --text: #dfe3e8;
  --text-dim: #9aa2ad;
  --accent: #2d8cf0;
  --accent2: #1c6fd0;
  --canvas-bg: #3d4147;
  --menu-h: 30px;
  --prop-h: 34px;
  --tool-w: 42px;
  --dock-w: 268px;
  --pal-w: 24px;
  --radius: 4px;
  --font: "Segoe UI", Roboto, system-ui, sans-serif;
}
body[data-ws="illustrator"] {
  --bg: #232323; --panel: #2c2c2c; --panel2: #383838; --line: #191919; --line2: #444;
  --canvas-bg: #4a4a4a; --accent: #ff9a00; --accent2: #d98200; --tool-w: 60px; --dock-w: 250px;
}
body[data-ws="photoshop"] {
  --bg: #1e1e1e; --panel: #323232; --panel2: #3c3c3c; --line: #1a1a1a; --line2: #4b4b4b;
  --text: #e6e6e6; --text-dim: #a0a0a0; --canvas-bg: #535353;
  --accent: #1473e6; --accent2: #0d5cba; --tool-w: 40px; --dock-w: 272px;
}
body[data-ws="canva"] {
  --bg: #ffffff; --panel: #ffffff; --panel2: #f4f5f7; --line: #e3e5e8; --line2: #d8dbe0;
  --text: #1f2430; --text-dim: #6b7280; --canvas-bg: #edeff2; --accent: #7d2ae8; --accent2: #6a1fc4;
  --dock-w: 300px; --menu-h: 46px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  font: 12px/1.4 var(--font);
  background: var(--bg); color: var(--text);
  display: grid; grid-template-rows: var(--menu-h) var(--prop-h) 1fr 24px;
  user-select: none; -webkit-user-select: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
.spacer { flex: 1; }

/* ---------------------------------------------------------- barra de menú */
#menubar {
  display: flex; align-items: center; gap: 4px; padding: 0 8px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 7px; padding-right: 10px; }
.brand .logo { width: 20px; height: 20px; display: block; object-fit: contain; }
.brand .bname { height: 15px; width: auto; display: block; }
/* El nombre viene en dos versiones: crema para los fondos oscuros y gris para
   los claros. Canva es la unica vista clara, asi que es la que las cambia. */
.brand .bname.claro { display: none; }
body[data-ws="canva"] .brand .bname.oscuro { display: none; }
body[data-ws="canva"] .brand .bname.claro  { display: block; }
#menus { display: flex; }
#menus > .m { padding: 5px 9px; border-radius: var(--radius); cursor: default; position: relative; }
#menus > .m:hover, #menus > .m.open { background: var(--panel2); }
#docname { color: var(--text-dim); }
#wsswitch { display: flex; align-items: center; gap: 3px; }
.wslabel { color: var(--text-dim); margin-right: 3px; }
#wsswitch button {
  background: transparent; border: 1px solid var(--line2); color: var(--text-dim);
  padding: 3px 9px; border-radius: 20px; cursor: pointer;
}
#wsswitch button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* «Instalar en el PC»: sólo sale en la versión de la nube (en la instalada
   sobra), por eso el JS lo esconde en localhost. */
#btnInstalar {
  background: transparent; border: 1px solid var(--line2); color: var(--text-dim);
  padding: 3px 10px; border-radius: 20px; cursor: pointer; margin-right: 12px;
  white-space: nowrap;
}
#btnInstalar:hover { border-color: var(--accent); color: var(--accent); }

.menu-pop {
  position: fixed; z-index: 500; min-width: 210px; padding: 4px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); display: none;
  max-height: calc(100vh - 16px); overflow-y: auto;   /* que nunca se salga */
}
.menu-pop::-webkit-scrollbar { width: 8px; }
.menu-pop::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 4px; }
.menu-pop.show { display: block; }
.menu-pop .it {
  display: flex; align-items: center; gap: 10px; padding: 5px 10px;
  border-radius: 4px; cursor: default; white-space: nowrap;
}
.menu-pop .it:hover { background: var(--accent); color: #fff; }
.menu-pop .it.dis { opacity: .38; pointer-events: none; }
.menu-pop .it .k { margin-left: auto; color: var(--text-dim); font-size: 11px; }
.menu-pop .it:hover .k { color: #e8eefc; }
.menu-pop .sep { height: 1px; background: var(--line2); margin: 4px 6px; }
.menu-pop .grp { padding: 4px 10px 2px; color: var(--text-dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; }

/* ---------------------------------------------------------- barra de propiedades */
#propbar {
  display: flex; align-items: center; gap: 6px; padding: 0 8px; overflow-x: auto;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
#propbar::-webkit-scrollbar { height: 0; }
.pgrp { display: flex; align-items: center; gap: 4px; }
.pgrp + .pgrp::before { content: ""; width: 1px; height: 18px; background: var(--line2); margin: 0 5px; }
.plab { color: var(--text-dim); font-size: 11px; }
.num, select.sel, input.txt {
  background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 3px 5px; width: 62px; outline: none;
}
.num:focus, input.txt:focus, select.sel:focus { border-color: var(--accent); }
select.sel { width: auto; padding: 3px 4px; }
.btn {
  background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 3px 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.btn:hover { border-color: var(--accent); }
.btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.icon { padding: 3px 6px; min-width: 26px; justify-content: center; }
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* ---------------------------------------------------------- área central */
#workspace { display: flex; min-height: 0; overflow: hidden; }
#toolbox {
  width: var(--tool-w); background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; overflow-y: auto;
}
#toolbox::-webkit-scrollbar { width: 0; }
.tool {
  position: relative; width: 32px; height: 32px; border-radius: var(--radius);
  display: grid; place-items: center; cursor: pointer; color: var(--text-dim);
  border: 1px solid transparent; background: transparent;
}
.tool:hover { background: var(--panel2); color: var(--text); }
.tool.on { background: var(--accent); color: #fff; }
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tool .fly { position: absolute; right: 1px; bottom: 1px; width: 0; height: 0;
  border-left: 4px solid transparent; border-bottom: 4px solid currentColor; }
.tsep { width: 22px; height: 1px; background: var(--line2); margin: 3px 0; }
body[data-ws="illustrator"] #toolbox { flex-flow: row wrap; justify-content: center; padding: 6px 2px; }
body[data-ws="canva"] #toolbox { display: none; }

#stage { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; background: var(--canvas-bg); }
#rulers { position: relative; height: 18px; }
#rulerCorner { position: absolute; left: 0; top: 0; width: 18px; height: 18px; z-index: 3;
  background: var(--panel); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 9px; display: grid; place-items: center; color: var(--text-dim); cursor: pointer; }
#rulerH { position: absolute; left: 18px; top: 0; height: 18px; right: 0; cursor: ns-resize; }
#rulerV { position: absolute; left: 0; top: 18px; width: 18px; z-index: 2; cursor: ew-resize; }
#canvasWrap { flex: 1; position: relative; margin-left: 18px; min-height: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* ---------------------------------------------------------- canales */
.canal {
  display: flex; align-items: center; gap: 8px; padding: 3px 6px; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius);
}
.canal:hover { background: var(--panel2); }
.canal.off { opacity: .45; }
.canalmini {
  width: 42px; height: 30px; object-fit: contain; background: #fff;
  border: 1px solid var(--line2); border-radius: 2px;
}

/* ------------------------------------------------ aviso de versión nueva */
.vernueva {
  position: fixed; right: 14px; bottom: 34px; z-index: 900;
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--accent); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 12px;
}

/* ---------------------------------------------------------- exportar */
.expwrap { display: flex; gap: 12px; align-items: flex-start; }
.expleft { flex: 0 0 440px; display: flex; flex-direction: column; gap: 6px; }
.expright { flex: 1; min-width: 300px; display: flex; flex-direction: column; gap: 2px; max-height: 460px; overflow-y: auto; }
.exprev {
  width: 100%; max-height: 340px; object-fit: contain; background: #2a2d31;
  border: 1px solid var(--line2); border-radius: var(--radius);
}
.expmini { display: flex; justify-content: center; }
.expmini .exprev { max-height: 190px; }

/* ---------------------------------------------------------- vectorizar */
.trprev {
  width: 100%; max-height: 250px; object-fit: contain; background: #fff;
  border: 1px solid var(--line2); border-radius: var(--radius);
}

/* ---------------------------------------------------------- logos */
.logogrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.logocard {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px;
  background: #fff; border: 2px solid var(--line2); border-radius: var(--radius); cursor: pointer;
}
.logocard:hover { border-color: var(--accent2); }
.logocard.on { border-color: var(--accent); }
.logocard img { max-width: 100%; height: 74px; object-fit: contain; }
.logocard .plab { color: #5b6270; font-size: 10.5px; text-align: center; }

/* ------------------------------------------------------ plantillas */
.chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 8px 4px; }
.chip {
  font: inherit; font-size: 11.5px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  background: var(--panel2); color: var(--text-dim); border: 1px solid var(--line2);
}
.chip:hover { border-color: var(--accent2); color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.plgrid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  max-height: 60vh; overflow: auto; padding: 4px 2px;
}
.plcard {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 7px; background: #fff; border: 2px solid var(--line2); border-radius: var(--radius); cursor: pointer;
}
.plcard:hover { border-color: var(--accent); }
.plcard img { max-width: 100%; height: 118px; object-fit: contain; }
.plcard .tname { color: #5b6270; }
.plmia {
  position: absolute; top: 5px; right: 5px; font-size: 9px; font-weight: 600;
  background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 999px;
}
.pldet { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.plprev {
  flex: 0 0 300px; min-height: 320px; display: grid; place-items: center;
  background: #f2f3f5; border: 1px solid var(--line2); border-radius: var(--radius); padding: 12px;
}
.plprev img { max-width: 100%; max-height: 320px; object-fit: contain; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.pltit { margin: 0 0 2px; font-size: 16px; }
/* la capa «Fondo» del panel de capas: se distingue de las de verdad */
.layer.fondo { border-top: 1px solid var(--line2); opacity: .92; }
.layer.fondo .lname { font-style: italic; }

.progbar { height: 6px; border-radius: 3px; background: var(--panel2); border: 1px solid var(--line2); margin: 8px 0; overflow: hidden; }
.progbar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.implog { max-height: 190px; overflow: auto; border: 1px solid var(--line2); border-radius: var(--radius); background: var(--panel2); }
.implinea {
  display: flex; gap: 8px; justify-content: space-between; align-items: baseline;
  padding: 3px 8px; font-size: 11.5px; border-bottom: 1px solid var(--line2);
}
.implinea:last-child { border-bottom: 0; }
.implinea b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.implinea span { color: var(--text-dim); white-space: nowrap; }
.implinea.bien span { color: #7ee2a0; }
.implinea.mal span { color: #ffa6a6; }
@media (max-width: 900px) { .plgrid { grid-template-columns: repeat(2, 1fr); } }

/* -------------------------------------------- comprobación de imprenta */
.pfhead {
  padding: 6px 10px; border-radius: var(--radius); font-weight: 600;
  border: 1px solid var(--line2); background: var(--panel2);
}
.pfhead.bien { border-color: #2fb344; color: #7ee2a0; }
.pfhead.medio { border-color: #d99b1c; color: #ffd77a; }
.pfhead.mal { border-color: #e05252; color: #ffa6a6; }
.pfrow {
  display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px;
  border: 1px solid var(--line2); border-radius: var(--radius); background: var(--panel2);
}
.pfrow.clic { cursor: pointer; }
.pfrow.clic:hover { border-color: var(--accent); }
.pfrow .pfico { font-size: 13px; line-height: 1.3; }
.pfrow.error { border-left: 3px solid #e05252; }
.pfrow.aviso { border-left: 3px solid #d99b1c; }
.pfrow.info { border-left: 3px solid var(--line2); opacity: .85; }
.dpi { font-variant-numeric: tabular-nums; }
.dpi.bien { color: #7ee2a0; }
.dpi.medio { color: #ffd77a; }
.dpi.mal { color: #ffa6a6; }

/* ------------------------------------------------ pestañas de documentos */
#doctabs {
  display: flex; align-items: stretch; gap: 2px; height: 24px; padding: 0 4px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  font-size: 11px; color: var(--text-dim); overflow-x: auto; overflow-y: hidden; flex: none;
}
#doctabs::-webkit-scrollbar { height: 0; }
.dtab {
  display: flex; align-items: center; gap: 6px; padding: 0 6px 0 10px; max-width: 220px;
  cursor: pointer; white-space: nowrap; border: 1px solid var(--line2); border-top: none;
  border-radius: 0 0 4px 4px; background: var(--panel2);
}
.dtab:hover { color: var(--text); }
.dtab.on { background: var(--canvas-bg); color: var(--text); border-color: var(--accent); }
.dtname { overflow: hidden; text-overflow: ellipsis; }
.dtx { opacity: .5; padding: 0 2px; font-size: 13px; line-height: 1; border-radius: 3px; }
.dtx:hover { opacity: 1; background: var(--line2); color: #fff; }
.dtadd {
  flex: none; align-self: center; width: 20px; height: 18px; margin-left: 2px;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 3px;
  cursor: pointer; line-height: 1; color: var(--text-dim);
}
.dtadd:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------------------------------------------------------- IA / JSON */
.ta {
  width: 100%; background: var(--panel2); color: var(--text); border: 1px solid var(--line2);
  border-radius: var(--radius); padding: 6px 8px; resize: vertical; outline: none;
  user-select: text; -webkit-user-select: text;
}
.ta:focus { border-color: var(--accent); }
.ta.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 11.5px; }
pre.code {
  background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 8px; overflow-x: auto; font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 11px; color: var(--text); user-select: text; -webkit-user-select: text;
}

/* ---------------------------------------------------------- barra de páginas */
#pagebar {
  display: flex; align-items: flex-end; gap: 2px; height: 26px; padding: 0 4px;
  background: var(--panel); border-top: 1px solid var(--line);
  font-size: 11px; color: var(--text-dim); overflow-x: auto; overflow-y: hidden;
}
#pagebar::-webkit-scrollbar { height: 0; }
#pagebar .pgb {
  flex: none; min-width: 20px; height: 18px; margin-bottom: 3px; padding: 0 4px;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 3px;
  cursor: pointer; line-height: 1; font-size: 10px;
}
#pagebar .pgb:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
#pagebar .pgb.dis { opacity: .35; pointer-events: none; }
#pagebar .pgnum { flex: none; padding: 0 6px 4px; color: var(--accent); font-variant-numeric: tabular-nums; }
#pagebar .ptabs { display: flex; align-items: flex-end; gap: 2px; margin-left: 8px; }
#pagebar .ptab {
  flex: none; padding: 3px 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; cursor: pointer; border: 1px solid var(--line2); border-bottom: none;
  border-radius: 4px 4px 0 0; background: var(--panel2);
}
#pagebar .ptab:hover { color: var(--text); }
#pagebar .ptab.on { background: var(--canvas-bg); color: var(--text); border-color: var(--line2); }
#pagebar .ptabin {
  width: 130px; padding: 2px 6px; background: var(--panel2); color: var(--text);
  border: 1px solid var(--accent); border-radius: 4px 4px 0 0; outline: none;
}

body.norulers #rulers { display: none; }
body.norulers #canvasWrap { margin-left: 0; }
body.norulers #rulerV { display: none; }

#textEditor {
  position: absolute; display: none; z-index: 20; background: rgba(255,255,255,.06);
  border: 1px dashed var(--accent); color: transparent; caret-color: var(--accent);
  padding: 0; margin: 0; resize: none; overflow: hidden; outline: none;
  transform-origin: 0 0; min-height: 1.2em;
  /* el body lleva user-select:none y se hereda: aquí hay que escribir y seleccionar */
  user-select: text; -webkit-user-select: text;
}
input, textarea { user-select: text; -webkit-user-select: text; }
#floatbar {
  position: absolute; z-index: 15; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: none; gap: 6px; padding: 6px 8px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 30px; box-shadow: 0 6px 22px rgba(0,0,0,.35);
}
body[data-ws="canva"] #floatbar { display: flex; }

/* ---------------------------------------------------------- muelles / paneles */
.dock {
  width: var(--dock-w); background: var(--panel); border-left: 1px solid var(--line);
  overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column;
}
#leftdock { border-left: 0; border-right: 1px solid var(--line); display: none; }
body[data-ws="canva"] #leftdock { display: flex; }
body[data-ws="canva"] #rightdock { display: none; }
.dock::-webkit-scrollbar { width: 9px; }
.dock::-webkit-scrollbar-thumb { background: #4a5058; border-radius: 5px; }
.panel { border-bottom: 1px solid var(--line); }
.panel > h3 {
  margin: 0; padding: 7px 10px; font-size: 11px; font-weight: 600; letter-spacing: .4px;
  text-transform: uppercase; color: var(--text-dim); cursor: pointer;
  display: flex; align-items: center; gap: 6px; background: var(--panel);
}
.panel > h3::before { content: "▾"; font-size: 9px; }
.panel.closed > h3::before { content: "▸"; }
.panel.closed > .body { display: none; }
.panel > .body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 6px; }
.row .lab { color: var(--text-dim); width: 58px; flex: none; font-size: 11px; }
.row.wrap { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.grid8 { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.sw {
  display: inline-block; width: 20px; height: 14px; border: 1px solid var(--line2);
  border-radius: 3px; vertical-align: middle;
  background-image: linear-gradient(45deg,#888 25%,transparent 25%,transparent 75%,#888 75%),
                    linear-gradient(45deg,#888 25%,#fff 25%,#fff 75%,#888 75%);
  background-size: 8px 8px; background-position: 0 0, 4px 4px;
}
.sw i { display: block; width: 100%; height: 100%; border-radius: 2px; }

/* capas */
.layer, .objrow {
  display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 4px; cursor: pointer;
}
.layer { background: var(--panel2); margin-bottom: 3px; }
.layer.on { outline: 1px solid var(--accent); }
.objrow { padding-left: 16px; font-size: 11.5px; color: var(--text-dim); }
.objrow.on { background: var(--accent); color: #fff; }
.objrow:hover { background: rgba(255,255,255,.06); }
.eye, .lock { width: 16px; text-align: center; opacity: .8; }
.eye.off, .lock.off { opacity: .25; }
.lname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini { background: none; border: 0; color: var(--text-dim); cursor: pointer; padding: 2px 4px; border-radius: 3px; }
.mini:hover { background: var(--panel2); color: var(--text); }

/* selector de color */
#svbox { width: 100%; height: 120px; border-radius: 4px; cursor: crosshair; display: block; }
#huebar { width: 100%; height: 14px; border-radius: 3px; cursor: pointer; display: block; }
.colorTabs { display: flex; gap: 3px; }
.colorTabs .btn { flex: 1; justify-content: center; }
.stopbar { position: relative; height: 26px; border-radius: 3px; border: 1px solid var(--line2); }
.stopbar .strip { position: absolute; inset: 0 0 10px 0; border-radius: 2px 2px 0 0; }
.stop { position: absolute; bottom: 0; width: 11px; height: 11px; margin-left: -5px; border-radius: 2px;
  border: 1px solid #fff; box-shadow: 0 0 0 1px #000; cursor: pointer; }
.stop.on { outline: 2px solid var(--accent); }

/* paleta lateral estilo Corel */
#palette {
  width: var(--pal-w); background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; padding: 2px 0; overflow-y: auto;
}
#palette::-webkit-scrollbar { width: 0; }
#palette .psw { width: 18px; height: 13px; margin-bottom: 1px; border: 1px solid rgba(0,0,0,.35); cursor: pointer; flex: none; }
#palette .psw:hover { outline: 2px solid #fff; z-index: 2; }
body[data-ws="illustrator"] #palette, body[data-ws="canva"] #palette { display: none; }

/* barra de estado */
#statusbar {
  display: flex; align-items: center; gap: 10px; padding: 0 8px;
  background: var(--panel); border-top: 1px solid var(--line); font-size: 11px; color: var(--text-dim);
}
.st-style { display: flex; align-items: center; gap: 5px; }
.st-lab { color: var(--text-dim); }
.st-num { font-variant-numeric: tabular-nums; }
.st-zoom { display: flex; align-items: center; gap: 3px; }
.st-zoom button { background: var(--panel2); border: 1px solid var(--line2); border-radius: 3px;
  width: 20px; height: 17px; cursor: pointer; line-height: 1; }
#zoomInput { width: 42px; background: var(--panel2); border: 1px solid var(--line2);
  border-radius: 3px; padding: 1px 3px; text-align: right; }

/* modales */
#modalbg { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none;
  place-items: center; z-index: 900; }
#modalbg.show { display: grid; }
#modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 8px;
  min-width: 380px; max-width: 92vw; max-height: 88vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.5); }
#modal h2 { margin: 0; padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--line); }
#modal .mbody { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
#modal .mfoot { padding: 10px 16px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 8px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; padding: 5px 14px; }
.card { background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px;
  padding: 8px; cursor: pointer; text-align: center; }
.card:hover { border-color: var(--accent); }
.card b { display: block; font-size: 12px; }
.card span { color: var(--text-dim); font-size: 11px; }

#toast { position: fixed; left: 50%; bottom: 46px; transform: translateX(-50%);
  background: #111; color: #fff; padding: 8px 14px; border-radius: 20px; z-index: 1000;
  opacity: 0; transition: opacity .25s; pointer-events: none; }
#toast.show { opacity: .95; }

/* elementos de Canva */
.canva-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.canva-tabs .btn { flex: 1; justify-content: center; flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 2px; }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px; align-content: start; }
.thumb { min-height: 84px; border: 1px solid var(--line2); border-radius: 6px; background: var(--panel2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 4px; cursor: pointer; }
.thumb:hover { border-color: var(--accent); }
.thumb svg { width: 34px; height: 34px; color: var(--accent); }
.tprev { height: 48px; display: grid; place-items: center; }
.tprev i { display: block; background: var(--bg); border: 1px solid var(--line2); border-radius: 2px; }
body[data-ws="canva"] .tprev i { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.tname { font-size: 10.5px; color: var(--text-dim); text-align: center; line-height: 1.2; }
