:root {
  --accent-base: #5B5BD6; --accent: var(--accent-base);
  --bg: #F3F3F6;
  --card: #FFFFFF;
  --ink: #1D1D1F;
  --muted: #6E6E73;
  --line: rgba(0, 0, 0, 0.09);
  --soft: rgba(0, 0, 0, 0.04);
  --danger: #E5484D;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161618; --card: #232326; --ink: #F2F2F7; --muted: #A1A1A8;
    --line: rgba(255, 255, 255, 0.1); --soft: rgba(255, 255, 255, 0.06); color-scheme: dark;
    --accent: color-mix(in srgb, var(--accent-base) 64%, white);
  }
}
:root[data-theme="dark"] {
  --accent: color-mix(in srgb, var(--accent-base) 64%, white);
  --bg: #161618; --card: #232326; --ink: #F2F2F7; --muted: #A1A1A8;
  --line: rgba(255, 255, 255, 0.1); --soft: rgba(255, 255, 255, 0.06); 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-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
input, textarea, select { -webkit-user-select: text; user-select: text; font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ───────── barra superior */
.top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); flex: none; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand b { display: block; font-size: 16px; white-space: nowrap; }
.brand span { font-size: 11px; color: var(--muted); }
.tabs { display: flex; gap: 4px; background: var(--soft); padding: 3px; border-radius: 10px; margin: 0 auto; }
.tab { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 500; color: var(--muted); }
.tab.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tab.active svg { color: var(--accent); }
.top-right { display: flex; align-items: center; gap: 8px; }

/* ───────── controles */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--soft); padding: 0; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.on { background: color-mix(in srgb, var(--accent) 20%, transparent); border-color: var(--accent); color: var(--accent); }
.icon-btn.danger { color: var(--danger); }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--soft); font-weight: 500; white-space: nowrap; color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.google { color: var(--ink); background: var(--card); }
.btn svg { width: 16px; height: 16px; }
.spacer { flex: 1; }
input[type="range"] { accent-color: var(--accent); }
input.small, .hrow input:not([type]) { height: 30px; border-radius: 7px; border: 1px solid var(--line); background: var(--card); padding: 0 8px; min-width: 0; }
input.small { width: 80px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

main { flex: 1; min-height: 0; position: relative; }
.view { display: none; height: 100%; }
.view.active { display: flex; }

/* ───────── Diseñador */
#view-designer { gap: 14px; padding: 14px; }
.board { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.bar { padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.steps { font-size: 12px; color: var(--muted); margin-left: 4px; white-space: nowrap; }
#stepsSlider { width: 110px; }
.canvas-wrap { flex: 1; position: relative; margin: 8px; border-radius: 8px; overflow: hidden; min-height: 300px; }
#sheet { position: absolute; inset: 0; display: block; touch-action: none; cursor: crosshair; }
.zoom { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 2px; padding: 3px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); }
.zoom button { border: 0; background: transparent; height: 28px; min-width: 30px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.text-pop { position: absolute; display: flex; gap: 6px; padding: 8px; background: var(--card); border-radius: 10px; box-shadow: 0 4px 18px rgba(0,0,0,.22); }
.text-pop input { width: 220px; height: 32px; border-radius: 7px; border: 1px solid var(--line); background: var(--card); padding: 0 8px; }
.hint { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: color-mix(in srgb, var(--card) 90%, transparent);
  border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; font-size: 12px; color: var(--muted); pointer-events: none; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }

.panel { width: 300px; flex: none; display: flex; flex-direction: column; overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; gap: 8px; padding: 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0 0 2px; font-size: 18px; }
.panel-head p { margin: 0; font-size: 12px; color: var(--muted); }
.panel-head .icon-btn { border: 0; background: transparent; color: var(--muted); }
.panel-body { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 18px; -webkit-overflow-scrolling: touch; }
.panel-body section { display: flex; flex-direction: column; gap: 7px; }
.panel-body h3 { margin: 0; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
#instList { display: flex; flex-direction: column; gap: 8px; }
.note { margin: 0; font-size: 12px; color: var(--muted); }
.coord { margin: 0; color: var(--muted); }
.hrow { display: flex; align-items: center; gap: 8px; }
.hrow label { font-size: 12px; }
.hrow input[type="range"] { flex: 1; }
@media (min-width: 981px) {
  body.panel-hidden .panel { display: none; }
}

.switch { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 32px; height: 19px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(13px); }

.swatches { display: flex; flex-direction: column; gap: 8px; }
.swatch-grid { display: grid; grid-template-columns: repeat(9, 24px); gap: 6px; }
.other-color { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0; outline-offset: 2px; box-shadow: inset 0 0 0 1px rgba(127,127,127,.35); }
.swatch.on { outline: 2px solid var(--ink); }
.swatches input[type="color"] { width: 30px; height: 26px; border: 0; padding: 0; background: none; }

.shapes { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.shape-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 8px; border: 0; background: var(--soft); font-size: 10px; line-height: 1.15; text-align: center; min-height: 64px; }
.shape-btn canvas { width: 44px; height: 34px; }

.keypad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.keypad button { height: 32px; border-radius: 7px; border: 1px solid var(--line); background: var(--soft); font-size: 14px; }
.keypad button.op { color: var(--accent); font-weight: 600; }
#calcIn { flex: 1; }
.calc-res { color: var(--accent); white-space: nowrap; }

/* ───────── Mi colección */
#view-collection { flex-direction: column; overflow-y: auto; padding: 22px 26px 40px; -webkit-overflow-scrolling: touch; }
.coll-head h1 { margin: 0; font-size: 24px; }
.coll-head p { margin: 4px 0 18px; color: var(--muted); }
.group { margin-bottom: 26px; }
.group h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.group h2 small { font-weight: 500; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.item { display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); }
.item .thumb { aspect-ratio: 16 / 10; background: #1F2250 center / cover no-repeat; position: relative; width: 100%; }
.item .thumb .play { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; }
.item .thumb .play svg { width: 14px; height: 14px; }
.item .thumb.empty { display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.6); font-size: 12px; padding: 12px; text-align: center; }
.item .meta { padding: 10px 12px 12px; }
.item b { display: block; font-size: 14px; }
.item span { font-size: 12px; color: var(--muted); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state h2 { color: var(--ink); }

/* ───────── ventanas */
dialog { border: 0; border-radius: 14px; padding: 0; background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); max-width: min(92vw, 860px); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog form { padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: min(86vw, 340px); }
dialog h3 { margin: 0; font-size: 17px; }
dialog .field { height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); padding: 0 10px; width: 100%; }
dialog select.field { appearance: auto; }
dialog .actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
dialog video { width: min(80vw, 800px); aspect-ratio: 16 / 10; background: #000; border-radius: 10px; display: block; }
dialog .vid-wrap { position: relative; }
dialog .vid-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; text-align: center; padding: 20px; }
.muted { color: var(--muted); font-size: 12px; margin: 0; }
.menu-list { display: flex; flex-direction: column; gap: 6px; }
.menu-list .btn { justify-content: flex-start; height: 40px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1D1D1F; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.3); max-width: 90vw; }

#account .user { display: flex; align-items: center; gap: 8px; }
#account .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; border: 0; }

/* ───────── pantallas angostas (iPad vertical, celular) */
@media (max-width: 980px) {
  .panel { position: absolute; right: 10px; top: 10px; bottom: 10px; z-index: 20; box-shadow: 0 10px 40px rgba(0,0,0,.28); }
  body:not(.panel-open) .panel { display: none; }
  #view-designer { padding: 10px; }
  .brand div span { display: none; }
}
@media (max-width: 640px) {
  .brand div { display: none; }
  .tab span { display: none; }
  .btn span { display: none; }
  .btn { padding: 0 9px; }
  #stepsSlider { width: 70px; }
}

.icon-btn.lang { font-size: 12px; font-weight: 700; width: auto; padding: 0 9px; }
.small.num { width: 54px; }
.table-ops { flex-wrap: wrap; gap: 6px; }
.table-ops .btn { height: 28px; padding: 0 8px; font-size: 12px; }
#tableAdd { align-self: flex-start; }
.hl-swatches { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hl-swatch { width: 28px; height: 18px; border-radius: 5px; border: 1px solid rgba(127,127,127,.3); padding: 0; }
.hl-swatch.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.hl-swatches input[type="color"] { width: 30px; height: 22px; border: 0; padding: 0; background: none; }
#updateBtn { position: relative; }
#updateBtn.has-update { color: var(--accent); border-color: var(--accent); }
#updateBtn.has-update::after { content: ""; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
#updateBtn.spin svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ctx-menu { position: absolute; z-index: 30; min-width: 190px; padding: 5px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; flex-direction: column; }
.ctx-menu button { display: flex; justify-content: space-between; align-items: center; gap: 16px; border: 0; background: transparent; padding: 7px 10px; border-radius: 6px; text-align: left; font-size: 13px; }
.ctx-menu button:hover:not(:disabled) { background: var(--accent); color: #fff; }
.ctx-menu button:hover:not(:disabled) small { color: rgba(255,255,255,.8); }
.ctx-menu button:disabled { opacity: .4; cursor: default; }
.ctx-menu button[data-act="del"]:not(:disabled) { color: var(--danger); }
.ctx-menu button[data-act="del"]:hover:not(:disabled) { background: var(--danger); color: #fff; }
.ctx-menu small { color: var(--muted); font-size: 11px; }
.ctx-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.ink-bar { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 15; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); box-shadow: 0 4px 16px rgba(0,0,0,.15); max-width: calc(100% - 20px); overflow-x: auto; }
.ink-bar .ib-dot { width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0; flex: none; box-shadow: inset 0 0 0 1px rgba(127,127,127,.35); }
.ink-bar .on { outline: 2px solid var(--ink); outline-offset: 2px; }
.ink-bar input[type="color"] { width: 26px; height: 22px; border: 0; padding: 0; background: none; flex: none; }
.ink-bar input[type="range"] { width: 90px; flex: none; }
.ink-bar .ib-sep { width: 1px; height: 18px; background: var(--line); flex: none; }

/* ───────── biblioteca: carpetas y cuadernos */
#view-designer.lib-mode .board, #view-designer.lib-mode .panel { display: none !important; }
#view-designer:not(.lib-mode) #libView { display: none; }
.nb-title { font-weight: 600; font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.nb-title i { width: 10px; height: 14px; border-radius: 2px; display: inline-block; flex: none; }
.lib-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.lib-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--soft); padding: 3px; border-radius: 9px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 500; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg svg { width: 15px; height: 15px; }
.crumbs { display: flex; align-items: center; gap: 4px; font-weight: 600; min-width: 0; flex-wrap: wrap; }
.crumbs button { border: 0; background: transparent; padding: 4px 6px; border-radius: 6px; color: var(--accent); font-weight: 600; }
.crumbs button.cur { color: var(--ink); }
.crumbs button.drop { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.crumbs svg { width: 12px; height: 12px; color: var(--muted); transform: rotate(-90deg); }
.lib-head select { height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); padding: 0 8px; }
.lib-body { flex: 1; overflow-y: auto; padding: 24px; -webkit-overflow-scrolling: touch; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 26px 20px; }
.lib-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; border-radius: 12px; padding: 6px 4px; }
.lib-card.drop { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.lib-thumb { position: relative; width: 150px; height: 124px; cursor: pointer; }
.lib-art { width: 100%; height: 100%; }
.lib-star { position: absolute; top: 6px; right: 8px; border: 0; background: transparent; padding: 4px; color: #fff; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.lib-card.notebook .lib-star { right: 26px; }
.lib-star svg { width: 17px; height: 17px; }
.lib-star.on { color: #E5484D; }
.lib-star.on svg { fill: #E5484D; }
.lib-name { font-weight: 500; font-size: 14px; display: inline-flex; align-items: flex-start; gap: 2px; max-width: 170px; }
.lib-name span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lib-more { border: 0; background: transparent; padding: 1px; color: var(--muted); flex: none; }
.lib-more svg { width: 14px; height: 14px; }
.lib-date { font-size: 11px; color: var(--muted); }
.lib-empty { text-align: center; color: var(--muted); padding: 90px 20px; }
.lib-menu { position: fixed; z-index: 60; }
.pick-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.pick-grid .c { width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; box-shadow: inset 0 0 0 1px rgba(127,127,127,.3); }
.pick-grid .c.on { outline: 2px solid var(--ink); outline-offset: 2px; }
.pick-grid .ic { width: 34px; height: 30px; border-radius: 7px; border: 1px solid var(--line); background: var(--soft); display: inline-flex; align-items: center; justify-content: center; }
.pick-grid .ic.on { background: color-mix(in srgb, var(--accent) 25%, transparent); border-color: var(--accent); }
.pick-grid .ic svg { width: 20px; height: 20px; }
.edit-preview { width: 150px; height: 124px; flex: none; }
.lib-art { width: 100%; height: 100%; stroke: none; overflow: visible; }
.lib-art .lib-front { filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.18)); }

/* ───────── páginas del cuaderno */
.board-main { flex: 1; display: flex; min-height: 0; }
.pages-bar { width: 170px; flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; }
body.pages-hidden .pages-bar { display: none; }
#pagesBtn.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pages-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 6px 14px; }
.pages-head b { font-size: 14px; }
.pg-count { font-size: 12px; color: var(--muted); }
.pages-head .icon-btn { width: 28px; height: 28px; }
.pages-list { flex: 1; overflow-y: auto; padding: 4px 14px 16px; display: flex; flex-direction: column; gap: 14px; -webkit-overflow-scrolling: touch; }
.pg-item { display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 8px; padding: 4px; }
.pg-item.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.pg-item.drop-after { box-shadow: 0 3px 0 var(--accent); }
.pg-thumb { width: 132px; display: flex; justify-content: center; cursor: pointer; }
.pg-thumb img, .pg-thumb .ph { max-width: 132px; max-height: 190px; border-radius: 3px; box-shadow: 0 0 0 1px var(--line), 0 1px 4px rgba(0,0,0,.12); background: var(--card); display: block; }
.pg-thumb .ph { width: 132px; height: 74px; }
.pg-item.cur .pg-thumb img, .pg-item.cur .pg-thumb .ph { box-shadow: 0 0 0 2.5px var(--accent), 0 1px 4px rgba(0,0,0,.12); }
.pg-foot { display: flex; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); }
.pg-item.cur .pg-foot { color: var(--accent); font-weight: 600; }
.pg-foot button { border: 0; background: transparent; padding: 2px; color: inherit; display: inline-flex; }
.pg-foot svg { width: 13px; height: 13px; }
.page-nav { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 3px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.page-nav button { border: 0; background: transparent; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.page-nav button:disabled { opacity: .3; }
.page-nav svg { width: 15px; height: 15px; }
.page-nav span { min-width: 46px; text-align: center; }

.add-pop { position: fixed; z-index: 70; width: 330px; max-width: calc(100vw - 16px); max-height: calc(100vh - 20px); overflow-y: auto; background: var(--card); border-radius: 14px;
  box-shadow: 0 12px 44px rgba(0,0,0,.28), 0 0 0 1px var(--line); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.add-pop h4 { margin: 0; text-align: center; font-size: 15px; }
.add-pop .seg { display: flex; }
.add-pop .seg button { flex: 1; justify-content: center; padding: 6px 6px; font-size: 12.5px; }
.add-pop .lbl { font-size: 12px; color: var(--muted); margin: 2px 0 -4px; }
.tpl-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tpl { border: 0; background: transparent; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ink); }
.tpl img { width: 92px; height: 52px; border-radius: 4px; box-shadow: 0 0 0 1px var(--line), 0 1px 3px rgba(0,0,0,.12); object-fit: cover; background: #fff; }
.tpl:hover img, .tpl:focus-visible img { box-shadow: 0 0 0 2px var(--accent); }
.add-pop .wide { border: 0; background: var(--soft); border-radius: 10px; padding: 10px 12px; text-align: left; font-size: 14px; display: flex; align-items: center; gap: 10px; color: var(--ink); }
.add-pop .wide:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.add-pop .wide svg { width: 18px; height: 18px; color: var(--accent); }
.add-pop .wide.link { background: transparent; color: var(--accent); justify-content: center; padding: 4px; font-size: 13px; }
.add-pop .group { display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; gap: 1px; background: var(--line); }
.add-pop .group .wide { border-radius: 0; background: var(--card); }
.add-pop .group .wide:hover { background: var(--soft); }
@media (max-width: 700px) { .pages-bar { width: 128px; } .pg-thumb, .pg-thumb .ph { width: 100px; } .pg-thumb img { max-width: 100px; } .pages-list { padding: 4px 8px 12px; } }

/* ───────── barra estilo Goodnotes en «liquid glass»: pestañas + herramientas */
.bar.gn { padding: 0; gap: 0; color: var(--ink); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 72%, transparent), color-mix(in srgb, var(--card) 45%, transparent));
  backdrop-filter: blur(24px) saturate(1.8); -webkit-backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(0,0,0,.04); position: relative; z-index: 5; }
.tab-strip { display: flex; align-items: stretch; gap: 4px; padding: 6px 8px 6px; min-height: 42px; overflow-x: auto; scrollbar-width: none; }
.tab-strip::-webkit-scrollbar { display: none; }
.bar.gn .tab-strip { border-bottom: 1px solid var(--line); }
.tab-home { border: 0; background: transparent; color: inherit; width: 40px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; opacity: .75; }
.tab-home svg { width: 19px; height: 19px; }
.tab-home.on, .nb-tab.on { background: color-mix(in srgb, var(--card) 85%, transparent); opacity: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.7), 0 0 0 .5px var(--line); }
.nb-tab { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; min-width: 120px; max-width: 260px; flex: 0 1 220px; border-radius: 10px; cursor: pointer; font-weight: 500; font-size: 13.5px; opacity: .75; }
.nb-tab:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nb-tab.on { font-weight: 600; }
.nb-tab i { width: 9px; height: 13px; border-radius: 2px; flex: none; }
.nb-tab span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-tab button { border: 0; background: transparent; color: inherit; width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; opacity: .6; flex: none; }
.nb-tab button:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); opacity: 1; }
.nb-tab button svg { width: 13px; height: 13px; }
.lib-tabs { color: var(--ink); border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 72%, transparent), color-mix(in srgb, var(--soft) 80%, transparent)); }
.gn-tools { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 6px 10px; }
.gn-side { display: flex; align-items: center; gap: 4px; min-width: 0; }
.gn-side.right { justify-content: flex-end; }
.gn-center { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; padding: 3px; border-radius: 14px;
  background: color-mix(in srgb, var(--card) 40%, transparent); box-shadow: inset 0 0 0 .5px var(--line), inset 0 1px 0 rgba(255,255,255,.5); }
.bar.gn .icon-btn { background: transparent; border-color: transparent; color: var(--ink); border-radius: 10px; }
.bar.gn .icon-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.bar.gn .icon-btn.on { background: color-mix(in srgb, var(--card) 92%, transparent); color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.8), 0 0 0 .5px var(--line); }
.bar.gn .icon-btn:disabled { opacity: .3; }
.bar.gn .steps { color: var(--muted); }
.bar.gn .ib-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.bar.gn #stepsSlider { width: 90px; }
@media (max-width: 1100px) { .gn-tools { grid-template-columns: auto 1fr auto; } .gn-center { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; } .bar.gn .steps, .bar.gn #stepsSlider { display: none; } }
#view-designer.is-board #pagesBtn, #view-designer.is-board #addPageBtn, #view-designer.is-board .pages-bar, #view-designer.is-board .page-nav { display: none !important; }

/* barra del lápiz: grosores + colores favoritos + agregar */
.ink-bar .ib-w { border: 0; background: transparent; color: var(--ink); width: 34px; height: 26px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.ink-bar .ib-w svg { width: 28px; height: 14px; }
.ink-bar .ib-w.on { background: color-mix(in srgb, var(--ink) 12%, transparent); outline: 0; }
.ink-bar .ib-dot { width: 24px; height: 24px; }
.ink-bar .ib-dot.on { outline: 0; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.ink-bar .ib-add { position: relative; width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--ink) 45%, transparent); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.ink-bar .ib-add svg { width: 15px; height: 15px; }
.ink-bar .ib-add input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

/* exportar: elegir páginas y OneNote */
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.pick-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; max-height: 260px; overflow-y: auto; padding: 4px 2px; margin: 6px 0; }
.pp { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; border-radius: 8px; padding: 4px; }
.pp-img { width: 88px; height: 62px; display: flex; align-items: center; justify-content: center; background: var(--soft); border-radius: 4px; box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.pp-img img { max-width: 100%; max-height: 100%; }
.pp.on .pp-img { box-shadow: 0 0 0 2.5px var(--accent); }
.pp-n { font-size: 12px; display: flex; align-items: center; gap: 4px; }
.onenote-box { margin-top: 14px; padding: 12px; border-radius: 10px; background: var(--soft); display: flex; flex-direction: column; gap: 6px; }
.onenote-box b { font-size: 14px; }
#dlg { max-width: min(640px, 94vw); }

/* panel de páginas (como Goodnotes): ⋯ Páginas ×, y abajo Página / Importar */
.pages-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px; padding: 8px 6px 6px; }
.pages-head b { text-align: center; font-size: 14.5px; }
.pages-head .pg-count { font-weight: 500; }
.pages-head .icon-btn { width: 30px; height: 30px; border: 0; background: transparent; }
.pages-foot { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.pages-foot .btn { flex: 1; justify-content: center; padding: 0 6px; font-size: 12.5px; }
.pages-foot[hidden] { display: none; }
.pg-item { position: relative; }
.pg-check { position: absolute; top: 8px; right: 8px; z-index: 2; width: 20px; height: 20px; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 1.5px var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; }
.pg-item.picked .pg-check { background: var(--accent); box-shadow: none; }
.pg-item.picked .pg-thumb img, .pg-item.picked .pg-thumb .ph { box-shadow: 0 0 0 2.5px var(--accent); }
.inst-pop { width: 290px; }
.inst-row { justify-content: space-between; cursor: pointer; }
.inst-row .switch { display: inline-flex; }
.pages-foot .btn { min-width: 0; gap: 4px; padding: 0 4px; }
.pages-foot .btn svg { flex: none; }
.tabs[hidden] { display: none; }
/* sin panel derecho: todas las herramientas van en la barra superior */
#panel { display: none !important; }
.float-card { position: absolute; left: 12px; bottom: 12px; z-index: 16; width: 240px; padding: 10px 12px; border-radius: 14px; display: flex; flex-direction: column; gap: 6px;
  background: color-mix(in srgb, var(--card) 70%, transparent); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 6px 24px rgba(0,0,0,.16), inset 0 0 0 .5px var(--line); }
.float-card h3 { margin: 0; font-size: 11px; color: var(--muted); }
.float-card[hidden] { display: none; }
/* figuras y tabla (ventanas flotantes de la barra) */
.add-pop { background: color-mix(in srgb, var(--card) 78%, transparent); backdrop-filter: blur(24px) saturate(1.7); -webkit-backdrop-filter: blur(24px) saturate(1.7); }
.shapes-pop { width: 372px; }
.sp-colors { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sp-dot { width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0; box-shadow: inset 0 0 0 1px rgba(127,127,127,.35); }
.sp-dot.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.shapes-pop .ib-add { position: relative; width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--ink) 45%, transparent); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.shapes-pop .ib-add svg { width: 13px; height: 13px; } .shapes-pop .ib-add input { position: absolute; inset: 0; opacity: 0; }
.sp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 330px; overflow-y: auto; }
.sp-grid .shape-btn { border: 0; background: color-mix(in srgb, var(--ink) 4%, transparent); border-radius: 10px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--ink); line-height: 1.15; }
.sp-grid .shape-btn:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.sp-grid canvas { width: 44px; height: 34px; }
.table-pop { width: auto; }
.tp-grid { display: grid; grid-template-columns: repeat(10, 20px); gap: 3px; }
.tp-grid span { width: 20px; height: 20px; border-radius: 3px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 30%, transparent); cursor: pointer; }
.tp-grid span.on { background: color-mix(in srgb, var(--accent) 35%, transparent); box-shadow: inset 0 0 0 1px var(--accent); }
/* borrador: tipo y tamaño */
.ink-bar .ib-type { border: 0; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); height: 28px; border-radius: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; font-size: 12.5px; font-weight: 600; }
.ink-bar .ib-type svg { width: 15px; height: 15px; } .ink-bar .ib-type svg.chev { width: 11px; height: 11px; }
.ink-bar .ib-size { border: 0; background: transparent; width: 36px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }
.ink-bar .ib-size i { border-radius: 50%; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 50%, transparent); display: block; }
.ink-bar .ib-size.on i { box-shadow: inset 0 0 0 2.5px var(--accent); }
.eraser-pop { width: 320px; }
.er-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.er-t { border: 0; background: transparent; border-radius: 12px; padding: 12px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink); }
.er-t svg { width: 20px; height: 20px; }
.er-t.on { background: color-mix(in srgb, var(--card) 90%, transparent); box-shadow: 0 2px 8px rgba(0,0,0,.12), 0 0 0 .5px var(--line); }
.lasso-pop { width: 320px; }
.multi-bar { position: absolute; z-index: 17; display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 78%, transparent); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 6px 22px rgba(0,0,0,.18), inset 0 0 0 .5px var(--line); }
.multi-bar[hidden] { display: none; }
.multi-bar button { border: 0; background: transparent; width: 36px; height: 32px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.multi-bar button:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.multi-bar button.danger { color: var(--danger); }
.multi-bar svg { width: 18px; height: 18px; }
/* color de la hoja */
.pc-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pc { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--ink); padding: 2px; width: 48px; }
.pc i { width: 40px; height: 26px; border-radius: 6px; display: block; box-shadow: inset 0 0 0 1px rgba(127,127,127,.35); }
.pc i.auto { background: linear-gradient(135deg, #fff 50%, #1e1e21 50%); }
.pc.on i { box-shadow: 0 0 0 2.5px var(--accent); }
.pages-foot .btn.icon-only { flex: 1; padding: 0; }
.pages-foot .btn.icon-only svg { width: 18px; height: 18px; }
.pick-grid .c.other { position: relative; background: conic-gradient(#f03e3e, #fab005, #40c057, #15aabf, #4c6ef5, #be4bdb, #f03e3e); cursor: pointer; display: inline-block; }
.pick-grid .c.other input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.pick-grid { max-width: 330px; }
.top-right { margin-left: auto; }
.ink-bar .ib-size.on { outline: 0; }

/* Animaker: lista de mi colección */
.anim-pop { width: 340px; }
.anim-pop .field { width: 100%; margin-bottom: 8px; }
.an-list { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.an-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; border: 0; background: transparent; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.an-row:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.an-th { width: 44px; height: 44px; flex: none; border-radius: 8px; background: #1F2250 center/cover no-repeat; }
.an-tx { display: flex; flex-direction: column; min-width: 0; }
.an-tx b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-tx small { font-size: 11px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-empty { padding: 14px 6px; font-size: 13px; opacity: .7; }
.anim-pop .lbl { margin: 6px 4px 2px; font-size: 11px; font-weight: 600; opacity: .6; text-transform: uppercase; }

/* barra de formato de tabla */
.table-bar { align-items: center; }
.table-bar button { position: relative; }
.table-bar button.wide { width: auto; padding: 0 8px; }
.table-bar button.on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.table-bar .ib-sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }
.tb-chip { position: absolute; left: 9px; right: 9px; bottom: 4px; height: 3px; border-radius: 2px; }
.tb-txt { font-size: 12px; font-weight: 600; }
svg.ln { width: 48px; height: 12px; }
.tb-pop { width: 260px; }
.tb-pop .seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 2px; border-radius: 9px; background: color-mix(in srgb, var(--ink) 7%, transparent); margin-bottom: 10px; }
.tb-pop .seg button { border: 0; background: transparent; font: inherit; font-size: 11.5px; padding: 5px 2px; border-radius: 7px; color: var(--ink); }
.tb-pop .seg button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.tb-pop .tb-sw { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin-bottom: 8px; }
.tb-pop .tb-sw .c { width: 24px; height: 24px; border-radius: 5px; border: 0; box-shadow: inset 0 0 0 1px rgba(127,127,127,.3); }
.tb-pop .tb-sw .c.on { box-shadow: 0 0 0 2px var(--accent); }
.tb-row { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; font: inherit; color: var(--ink); text-align: left; }
.tb-row:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.tb-row.on { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.tb-pop .lbl { margin: 8px 4px 4px; font-size: 11px; font-weight: 600; opacity: .6; text-transform: uppercase; }

/* editor de ecuaciones π */
.eq-btn span { font: italic 600 19px "Times New Roman", serif; line-height: 1; }
.eq-panel { position: absolute; top: 0; right: 0; height: 100%; width: 380px; max-width: 92%; border: 0; z-index: 30; background: transparent; color-scheme: normal; box-shadow: -8px 0 30px rgba(0,0,0,.12); }
.eq-panel[hidden] { display: none; }

/* globos «liquid glass» de la pluma y del trazo */
.glass-pop { background: color-mix(in srgb, var(--card) 62%, transparent) !important; backdrop-filter: blur(28px) saturate(1.8); -webkit-backdrop-filter: blur(28px) saturate(1.8);
  border: .5px solid color-mix(in srgb, #fff 35%, transparent); box-shadow: 0 18px 50px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.35); border-radius: 18px; }
.st-pop, .pen-pop { width: 300px; }
.st-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 10px; }
.st-tile { border: 0; background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); border-radius: 12px; height: 66px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 11.5px; cursor: pointer; }
.st-tile.on { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 0 0 0 1.2px color-mix(in srgb, var(--accent) 60%, transparent); color: var(--accent); }
.st-w { display: flex; align-items: center; gap: 10px; }
.st-w span { width: 58px; font-size: 13px; }
.st-w input { flex: 1; accent-color: var(--accent); }
.pen-prev { width: 100%; height: 64px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 4%, transparent); display: block; margin-bottom: 10px; }
.pen-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.pen-t { border: 0; background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); border-radius: 12px; height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font: inherit; font-size: 10.5px; cursor: pointer; }
.pen-t svg { width: 20px; height: 20px; }
.pen-t.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pen-sl { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; font-size: 12px; }
.pen-sl span { display: flex; justify-content: space-between; }
.pen-sl b { font-weight: 500; opacity: .6; }
.pen-sl input { accent-color: var(--accent); }
.glass-pop .lbl { margin: 8px 2px 4px; font-size: 11px; font-weight: 600; opacity: .6; text-transform: uppercase; }
.card-bar button.wide { width: auto; padding: 0 14px; gap: 8px; font: inherit; font-weight: 600; font-size: 13px; }
.card-bar .eq-i { font: italic 600 18px "Times New Roman", serif; }
#animatorBtn.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }

/* menú flotante de la página */
.pg-menu { min-width: 250px; padding: 6px; }
.pg-menu button { display: flex; align-items: center; gap: 10px; width: 100%; }
.pg-menu button svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.pg-menu .pg-h { margin: 4px 10px 6px; font-size: 11.5px; font-weight: 600; opacity: .6; }
.pg-menu .pg-chev { margin-left: auto; opacity: .5; font-weight: 600; }
.pg-menu .pg-back span { font-weight: 600; }
.pg-menu button { justify-content: flex-start; text-align: left; }
.pg-menu button span { flex: 1; text-align: left; }
.pg-menu button .pg-chev { flex: none; }

/* letras del Restyle */
@font-face { font-family: "Kalam"; src: url("vendor/fonts/kalam-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Patrick Hand"; src: url("vendor/fonts/patrick-hand-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Caveat"; src: url("vendor/fonts/caveat-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Gochi Hand"; src: url("vendor/fonts/gochi-hand-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Dancing Script"; src: url("vendor/fonts/dancing-script-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Nunito"; src: url("vendor/fonts/nunito-latin-400-normal.woff2") format("woff2"); font-display: swap; }
.rs-line { width: 100%; margin-bottom: 6px; }
.rs-styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rs-st { border: 0; border-radius: 12px; background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; padding: 6px; }
.rs-st span { font-size: 20px; white-space: nowrap; overflow: hidden; max-width: 100%; }
.rs-st small { font-size: 11px; opacity: .6; }
.rs-st.on { background: color-mix(in srgb, var(--accent) 15%, transparent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.rs-col { display: flex; gap: 8px; }
#rsBody .lbl { margin: 10px 2px 6px; font-size: 11px; font-weight: 600; opacity: .6; text-transform: uppercase; }

/* planos */
.planes-pop { width: 360px; }
.pl-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pl-card { border: 0; border-radius: 12px; background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; font: inherit; font-size: 11px; cursor: pointer; }
.pl-card:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pl-card canvas { width: 92px; height: 74px; }
.pl-row { display: flex; gap: 8px; }
.pl-row label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; flex: 1; }
.pl-row input { width: 100%; border-radius: 8px; border: .5px solid var(--line); background: var(--card); color: var(--ink); padding: 5px 6px; font: inherit; }
.multi-bar .eq-i { font: italic 600 15px "Times New Roman", serif; }

/* menú Exportar */
.exp-pop { width: 330px; }
.exp-card { border-radius: 16px; background: color-mix(in srgb, var(--ink) 5%, transparent); margin-bottom: 10px; overflow: hidden; }
.exp-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.exp-card > * + * { border-top: .5px solid var(--line); }
.exp-row svg { width: 18px; height: 18px; flex: none; }
.exp-main { display: flex; align-items: center; gap: 12px; flex: 1; border: 0; background: transparent; color: inherit; font: inherit; padding: 0; text-align: left; cursor: pointer; }
.exp-sw { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.exp-sw small { font-size: 9px; opacity: .6; }
.exp-link { border: 0; background: transparent; color: var(--muted, #888); cursor: pointer; padding: 2px; }
.exp-link.on { color: var(--accent); }
.exp-linkbox { padding: 0 14px 12px; }
.exp-linkbox .field { width: 100%; margin-bottom: 6px; }
.exp-linkbox p { font-size: 11.5px; margin: 0; }
button.exp-row:hover, .exp-main:hover { opacity: .85; }

/* fuentes de texto (Canva) */
@font-face { font-family: "Open Sans"; src: url("vendor/fonts/canva/OpenSans_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("vendor/fonts/canva/OpenSans_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("vendor/fonts/canva/OpenSans_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("vendor/fonts/canva/OpenSans_700Bold_Italic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("vendor/fonts/canva/Poppins_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("vendor/fonts/canva/Poppins_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("vendor/fonts/canva/Poppins_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("vendor/fonts/canva/Poppins_700Bold_Italic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("vendor/fonts/canva/Montserrat_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("vendor/fonts/canva/Montserrat_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("vendor/fonts/canva/Montserrat_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("vendor/fonts/canva/Montserrat_700Bold_Italic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("vendor/fonts/canva/DMSans_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("vendor/fonts/canva/DMSans_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("vendor/fonts/canva/DMSans_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("vendor/fonts/canva/DMSans_700Bold_Italic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("vendor/fonts/canva/Inter_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("vendor/fonts/canva/Inter_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("vendor/fonts/canva/Inter_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("vendor/fonts/canva/Inter_700Bold_Italic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Lato"; src: url("vendor/fonts/canva/Lato_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("vendor/fonts/canva/Lato_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("vendor/fonts/canva/Lato_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Lato"; src: url("vendor/fonts/canva/Lato_700Bold_Italic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("vendor/fonts/canva/Roboto_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("vendor/fonts/canva/Roboto_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("vendor/fonts/canva/Roboto_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("vendor/fonts/canva/Roboto_700Bold_Italic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Raleway"; src: url("vendor/fonts/canva/Raleway_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Raleway"; src: url("vendor/fonts/canva/Raleway_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Raleway"; src: url("vendor/fonts/canva/Raleway_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Raleway"; src: url("vendor/fonts/canva/Raleway_700Bold_Italic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Josefin Sans"; src: url("vendor/fonts/canva/JosefinSans_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Josefin Sans"; src: url("vendor/fonts/canva/JosefinSans_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Josefin Sans"; src: url("vendor/fonts/canva/JosefinSans_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Josefin Sans"; src: url("vendor/fonts/canva/JosefinSans_700Bold_Italic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("vendor/fonts/canva/SpaceGrotesk_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("vendor/fonts/canva/SpaceGrotesk_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Quicksand"; src: url("vendor/fonts/canva/Quicksand_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Quicksand"; src: url("vendor/fonts/canva/Quicksand_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Comfortaa"; src: url("vendor/fonts/canva/Comfortaa_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Comfortaa"; src: url("vendor/fonts/canva/Comfortaa_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("vendor/fonts/canva/Fredoka_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("vendor/fonts/canva/Fredoka_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Baloo 2"; src: url("vendor/fonts/canva/Baloo2_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Baloo 2"; src: url("vendor/fonts/canva/Baloo2_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("vendor/fonts/canva/Oswald_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("vendor/fonts/canva/Oswald_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Bebas Neue"; src: url("vendor/fonts/canva/BebasNeue_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Anton"; src: url("vendor/fonts/canva/Anton_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo Black"; src: url("vendor/fonts/canva/ArchivoBlack_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Abril Fatface"; src: url("vendor/fonts/canva/AbrilFatface_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Righteous"; src: url("vendor/fonts/canva/Righteous_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("vendor/fonts/canva/PlayfairDisplay_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("vendor/fonts/canva/PlayfairDisplay_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("vendor/fonts/canva/PlayfairDisplay_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("vendor/fonts/canva/PlayfairDisplay_700Bold_Italic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Lora"; src: url("vendor/fonts/canva/Lora_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("vendor/fonts/canva/Lora_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("vendor/fonts/canva/Lora_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Lora"; src: url("vendor/fonts/canva/Lora_700Bold_Italic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Merriweather"; src: url("vendor/fonts/canva/Merriweather_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Merriweather"; src: url("vendor/fonts/canva/Merriweather_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Merriweather"; src: url("vendor/fonts/canva/Merriweather_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Merriweather"; src: url("vendor/fonts/canva/Merriweather_700Bold_Italic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("vendor/fonts/canva/CourierPrime_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("vendor/fonts/canva/CourierPrime_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("vendor/fonts/canva/CourierPrime_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("vendor/fonts/canva/CourierPrime_700Bold_Italic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Pacifico"; src: url("vendor/fonts/canva/Pacifico_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lobster"; src: url("vendor/fonts/canva/Lobster_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Great Vibes"; src: url("vendor/fonts/canva/GreatVibes_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Indie Flower"; src: url("vendor/fonts/canva/IndieFlower_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Shadows Into Light"; src: url("vendor/fonts/canva/ShadowsIntoLight_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Permanent Marker"; src: url("vendor/fonts/canva/PermanentMarker_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Amatic SC"; src: url("vendor/fonts/canva/AmaticSC_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Amatic SC"; src: url("vendor/fonts/canva/AmaticSC_700Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
.text-bar { align-items: center; }
.text-bar .tb-font { width: 150px; height: 30px; border-radius: 8px; border: 0; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); display: flex; align-items: center; justify-content: space-between; padding: 0 10px; font-size: 14px; cursor: pointer; }
.text-bar .tb-font span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.text-bar .tb-size { display: flex; align-items: center; border: .5px solid var(--line); border-radius: 8px; height: 30px; }
.text-bar .tb-size button { width: 26px; }
.text-bar .tb-size b { min-width: 30px; text-align: center; font-size: 13px; }
.text-bar .tb-col { display: flex; flex-direction: column; align-items: center; font-weight: 600; font-size: 15px; line-height: 1; }
.text-bar .tb-col i { width: 18px; height: 4px; border-radius: 2px; margin-top: 2px; }
.text-bar button.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.text-bar .tb-b { font-weight: 800; } .text-bar .tb-i { font-style: italic; font-family: Georgia, serif; } .text-bar .tb-u { text-decoration: underline; } .text-bar .tb-s { text-decoration: line-through; }
.font-pop { width: 330px; }
.font-pop .fp-search { width: 100%; margin-bottom: 8px; }
.fp-cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 4px; scrollbar-width: none; }
.fp-cats button { flex: none; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 10px; height: 34px; padding: 0 12px; font-size: 15px; cursor: pointer; }
.fp-cats button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.fp-list { max-height: 360px; overflow-y: auto; }
.fp-row { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; color: var(--ink); padding: 8px 10px; border-radius: 10px; cursor: pointer; text-align: left; }
.fp-row:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.fp-row.on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.fp-row b { font-weight: 400; font-size: 17px; white-space: nowrap; }
.fp-row small { font-size: 15px; opacity: .55; white-space: nowrap; }
.fp-row .ck { margin-left: auto; color: var(--accent); }
.fp-h { margin: 6px 4px 4px; font-size: 11px; font-weight: 600; opacity: .6; text-transform: uppercase; }

/* ───── páginas abajo (como Canva), cuadrícula y temporizador */
.bottom-pages { display: none; flex-direction: column; border-top: 1px solid var(--line); flex: none; }
body.pages-bottom .bottom-pages { display: flex; }
body.pages-bottom .pages-bar, body.pages-bottom #pageNav { display: none; }
body.pages-bottom #layoutBottomBtn { color: var(--accent); }
.pg-strip { display: flex; gap: 12px; overflow-x: auto; padding: 10px 14px; align-items: center; scrollbar-width: thin; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.pg-strip[hidden] { display: none; }
.st-item { position: relative; flex: none; cursor: pointer; }
.st-thumb { width: 112px; height: 63px; border-radius: 8px; overflow: hidden; background: var(--card); border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; align-items: center; justify-content: center; }
.st-thumb img { width: 100%; height: 100%; object-fit: contain; }
.st-item.cur .st-thumb { border: 2.5px solid var(--accent); }
.st-n { position: absolute; left: 5px; bottom: 5px; font-size: 11px; font-weight: 600; padding: 0 5px; border-radius: 999px; background: color-mix(in srgb, var(--card) 80%, transparent); backdrop-filter: blur(8px); }
.st-add { flex: none; width: 112px; height: 63px; border-radius: 8px; border: 0; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.st-add svg, .gd-add svg { width: 22px; height: 22px; }
.st-add:hover, .gd-add:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.pg-footer { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 44px; }
.pg-footer .spacer { flex: 1; }
.btn.plain { background: transparent; border-color: transparent; box-shadow: none; }
.btn.plain svg { width: 16px; height: 16px; }
.pg-footer .ft-pages.on { background: color-mix(in srgb, var(--ink) 8%, transparent); }
#ftZoom { width: 140px; accent-color: var(--accent); }
.ft-pct { width: 44px; text-align: right; font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.ft-num { font-variant-numeric: tabular-nums; font-size: 13px; }
.pg-footer [hidden] { display: none !important; }
@media (max-width: 700px) { #ftZoom, .ft-pct, #ftTimer span, .ft-pages span { display: none; } }

.page-grid { position: absolute; inset: 0; z-index: 30; background: color-mix(in srgb, var(--bg, var(--card)) 82%, transparent); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); overflow: auto; }
.page-grid[hidden] { display: none; }
.pg-grid-bar { position: sticky; top: 14px; margin: 14px auto 0; width: max-content; display: flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 999px; z-index: 2; box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.pg-grid-bar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.pg-grid-bar .muted { min-width: 10px; font-size: 13px; }
.pg-grid-bar .btn.plain { font-weight: 600; }
.pg-grid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; padding: 26px 28px 28px; }
.gd-item { position: relative; cursor: pointer; }
.gd-thumb { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--card); border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); box-shadow: 0 2px 8px rgba(0,0,0,.08); display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.gd-item:hover .gd-thumb { transform: translateY(-2px); }
.gd-thumb img { width: 100%; height: 100%; object-fit: contain; }
.gd-item.cur .gd-thumb { outline: 2.5px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.gd-item.picked .gd-thumb { border: 2.5px solid var(--accent); }
.gd-check { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--ink) 35%, transparent); background: var(--card); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.gd-item:hover .gd-check, .gd-item.picked .gd-check, .page-grid.sel .gd-check { opacity: 1; }
.gd-item.picked .gd-check { background: var(--accent); border-color: var(--accent); }
.gd-n { display: block; margin-top: 6px; font-size: 13px; }
.gd-item.cur .gd-n { color: var(--accent); font-weight: 600; }
.gd-add { aspect-ratio: 16 / 9; border-radius: 12px; border: 0; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); display: flex; align-items: center; justify-content: center; }

.class-timer { position: absolute; top: 16px; right: 16px; z-index: 35; width: 260px; padding: 12px 16px 16px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,.14); display: flex; flex-direction: column; gap: 10px; }
.class-timer[hidden] { display: none; }
.ct-head { display: flex; align-items: center; justify-content: space-between; }
.ct-head .icon-btn { width: 26px; height: 26px; }
.ct-ring { position: relative; width: 148px; height: 148px; margin: 0 auto; }
.ct-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ct-ring circle { fill: none; stroke-width: 9; }
.ct-ring .bg { stroke: color-mix(in srgb, var(--ink) 10%, transparent); }
.ct-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.class-timer.done .fg { stroke: #FF3B30; }
.ct-time { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ct-time span { font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.class-timer.done .ct-time span { color: #FF3B30; font-size: 24px; }
.ct-time small { font-size: 11px; color: var(--muted, #888); }
.ct-row { display: flex; gap: 8px; }
.ct-row .btn { flex: 1; justify-content: center; }
.ct-presets { display: flex; align-items: center; gap: 6px; justify-content: center; }
.ct-presets button { width: 32px; height: 28px; border-radius: 8px; border: 0; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.ct-presets button.on { background: var(--accent); color: #fff; }
.ct-presets span { font-size: 12px; color: var(--muted, #888); }
.st-hide { flex: none; width: 36px; height: 63px; border: 0; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }
.st-hide svg { width: 16px; height: 16px; }
.st-hide:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }

/* pie fijo siempre; la tira solo con las páginas abajo */
.bottom-pages { display: flex !important; }
body:not(.pages-bottom) .pg-strip { display: none; }
body.pages-bottom.pages-hidden .pg-strip { display: none; }
#pageNav { display: none !important; }
.canvas-wrap > .zoom { display: none; }
/* pantalla completa (presentar) */
body.presenting header.top, body.presenting .pages-bar, body.presenting .bottom-pages, body.presenting #libView, body.presenting .panel { display: none !important; }
body.presenting main { padding: 0 !important; margin: 0 !important; max-width: none !important; height: 100vh; }
body.presenting .board { border-radius: 0 !important; border: 0 !important; box-shadow: none !important; height: 100vh; }
body.presenting .canvas-wrap { margin: 0; border-radius: 0; }
.present-bar { display: none; position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 40; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.14); font-size: 13px; font-variant-numeric: tabular-nums; }
body.presenting .present-bar { display: flex; }
.page-sbar { display: none; position: absolute; right: 8px; top: 85px; bottom: 85px; width: 34px; z-index: 39; cursor: grab; touch-action: none; }
body.presenting .page-sbar.show { display: block; }
.page-sbar .trk, .page-sbar .thm { position: absolute; right: 0; width: 5px; border-radius: 99px; transition: width .15s, background .15s; }
.page-sbar .trk { top: 0; bottom: 0; background: color-mix(in srgb, var(--ink, #000) 6%, transparent); }
.page-sbar .thm { top: 0; background: color-mix(in srgb, var(--accent) 60%, transparent); }
.page-sbar:hover .trk, .page-sbar.drag .trk, .page-sbar:hover .thm, .page-sbar.drag .thm { width: 8px; }
.page-sbar.drag .thm { background: var(--accent); }
.page-sbar .lbl { display: none; position: absolute; right: 22px; padding: 4px 10px; border-radius: 999px; font: 600 13px system-ui; font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.page-sbar.drag .lbl { display: block; }
.present-bar .sep { width: 1px; height: 16px; background: var(--line); }
body.presenting #view-designer { padding: 0; }

/* barra de la línea (como Canva) */
.line-bar button { min-width: 34px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.line-bar button img { display: block; }
.line-bar .ln-dot { width: 22px; height: 22px; border-radius: 50%; border: .5px solid color-mix(in srgb, var(--ink) 25%, transparent); display: block; }
.line-bar .ln-swap { min-width: 22px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: -1px; }
.line-bar .ln-check { width: 18px; height: 18px; display: block; border-radius: 3px; background: repeating-conic-gradient(var(--ink) 0 25%, transparent 0 50%) 0 0 / 6px 6px; opacity: .75; }
.ln-pop { width: 300px; padding: 16px !important; }
.ln-dashes { display: flex; gap: 8px; margin-bottom: 14px; }
.ln-dashes button { flex: 1; height: 40px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); background: color-mix(in srgb, var(--ink) 3%, transparent); display: flex; align-items: center; justify-content: center; }
.ln-dashes button.on { border: 2px solid var(--accent); }
.ln-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; margin: 6px 0; }
.ln-row input[type=range] { flex: 1; accent-color: var(--accent); }
.ln-num { width: 44px; height: 30px; border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.ln-lbl { margin: 12px 0 4px; font-size: 13px; }
input.switch { appearance: none; -webkit-appearance: none; width: 42px; height: 26px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 18%, transparent); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
input.switch:checked { background: #34C759; }
input.switch:checked::after { transform: translateX(16px); }
.ln-list { width: 250px; padding: 10px !important; }
.ln-list h4 { margin: 0 8px 6px; }
.ln-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; background: transparent; color: var(--ink); border-radius: 10px; font-size: 14px; text-align: left; }
.ln-list button:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.ln-list button span { flex: 1; }
.ln-list button b { color: var(--accent); }

/* cronómetro | temporizador */
.ct-head { gap: 8px; }
.ct-tabs { flex: 1; display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.ct-tabs button { flex: 1; height: 26px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.ct-tabs button.on { background: color-mix(in srgb, var(--ink) 14%, transparent); color: var(--ink); }
.ct-time.sw span { font-size: 26px; }
.btn.round { height: 44px; border-radius: 999px; border: 0; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); font-weight: 600; box-shadow: none; }
.btn.round.go { background: #34C759; color: #fff; }
.btn.round.go.pause { background: #FF9500; }
.btn.round.stop { background: #FF3B30; color: #fff; }
.class-timer .btn.round.go:not(.pause)[data-ct="go"] { background: var(--accent); }
.ct-laps { max-height: 110px; overflow: auto; font-size: 12px; }
.ct-laps div { display: flex; justify-content: space-between; padding: 5px 2px; border-bottom: .5px solid var(--line); }
.ct-laps b { font-weight: 500; font-variant-numeric: tabular-nums; }
.class-timer { width: 270px; }

/* texto nuevo como en Canva */
.text-pop.canva { padding: 0; background: transparent; box-shadow: none; border-radius: 0; gap: 0; }
.text-pop.canva #textOk { display: none; }
.text-pop.canva input { border: 2px solid var(--accent); border-radius: 0; background: transparent; padding: 0 7px; outline: none; box-shadow: none; }
.text-pop.canva input::placeholder { color: color-mix(in srgb, var(--ink) 18%, transparent); }
.tp-bar, .tp-move, .tp-h { display: none; }
.text-pop.canva .tp-bar { display: flex; position: absolute; left: 50%; bottom: calc(100% + 18px); transform: translateX(-50%); gap: 2px; padding: 4px 6px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0,0,0,.12); white-space: nowrap; }
.tp-bar button { width: 36px; height: 32px; border: 0; background: transparent; color: var(--ink); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.tp-bar button:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.tp-bar svg, .tp-move svg { width: 18px; height: 18px; }
.text-pop.canva .tp-move { display: inline-flex; position: absolute; left: 50%; top: calc(100% + 18px); transform: translateX(-50%); width: 34px; height: 34px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent); background: var(--card); color: var(--ink); align-items: center; justify-content: center; cursor: move; touch-action: none; }
.text-pop.canva .tp-h { display: block; position: absolute; background: #fff; border: 1px solid rgba(0,0,0,.25); box-shadow: 0 1px 2px rgba(0,0,0,.15); pointer-events: none; }
.tp-h.c1, .tp-h.c2, .tp-h.c3, .tp-h.c4 { width: 12px; height: 12px; border-radius: 50%; }
.tp-h.c1 { left: -6px; top: -6px; } .tp-h.c2 { right: -6px; top: -6px; } .tp-h.c3 { left: -6px; bottom: -6px; } .tp-h.c4 { right: -6px; bottom: -6px; }
.tp-h.s1, .tp-h.s2 { width: 8px; height: 18px; border-radius: 6px; top: 50%; margin-top: -9px; }
.tp-h.s1 { left: -4px; } .tp-h.s2 { right: -4px; }
/* botones en cápsula (Ordenar / Nuevo) */
.lib-head select#libSort { appearance: none; -webkit-appearance: none; height: 30px; border-radius: 999px; border: .5px solid color-mix(in srgb, var(--ink) 8%, transparent);
  background: color-mix(in srgb, var(--ink) 5.5%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding: 0 30px 0 14px; font-weight: 600; font-size: 13px; color: var(--ink); cursor: pointer; transition: background-color .12s; }
.lib-head select#libSort:hover { background-color: color-mix(in srgb, var(--ink) 9%, transparent); }
.lib-head #libNew { height: 30px; border-radius: 999px; padding: 0 14px; font-weight: 600; font-size: 13px; border: .5px solid rgba(255,255,255,.18);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--accent) 92%, white), var(--accent)); color: #fff; box-shadow: 0 2px 5px color-mix(in srgb, var(--accent) 30%, transparent); transition: box-shadow .12s, filter .12s; }
.lib-head #libNew:hover { filter: brightness(1.05); box-shadow: 0 3px 9px color-mix(in srgb, var(--accent) 40%, transparent); }
.lib-head #libNew svg { width: 14px; height: 14px; }

/* al presentar: solo las herramientas, flotando arriba en vidrio */
body.presenting .board { position: relative; }
body.presenting .bar.gn { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 45; background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; width: auto; }
body.presenting .bar.gn .tab-strip, body.presenting .bar.gn .gn-side.right, body.presenting .bar.gn #pagesBtn, body.presenting .bar.gn #animatorBtn,
body.presenting .bar.gn .steps, body.presenting .bar.gn #stepsSlider, body.presenting .bar.gn .nb-title { display: none !important; }
body.presenting .bar.gn .gn-tools { display: flex; gap: 6px; padding: 0; }
body.presenting .bar.gn .gn-side { flex: none; padding: 3px; border-radius: 14px; background: color-mix(in srgb, var(--card) 62%, transparent); backdrop-filter: blur(24px) saturate(1.8); -webkit-backdrop-filter: blur(24px) saturate(1.8); box-shadow: 0 6px 20px rgba(0,0,0,.12); }
body.presenting .bar.gn .gn-center { box-shadow: 0 6px 20px rgba(0,0,0,.12); }
body.presenting .ink-bar { top: 66px; }

.tp-kind { display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 7%, transparent); margin-bottom: 8px; }
.tp-kind button { flex: 1; height: 26px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.tp-kind button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.pages-head b { white-space: nowrap; flex: 1; }

/* manipulables */
.shapes-pop .seg { display: flex; }
.shapes-pop .seg button { flex: 1; justify-content: center; font-size: 12.5px; padding: 6px 4px; }
.shapes-pop .mp-h { margin: 12px 2px 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.shapes-pop .mp-grid .shape-btn canvas { width: 100%; height: 40px; }
.shapes-pop .mp-set { display: block; width: 100%; margin: 6px 0 0; padding: 7px 10px; border-radius: 10px; border: 1px dashed var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); font: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.shapes-pop { max-height: 70vh; overflow-y: auto; }
.shapes-pop .mp-grid { max-height: none; overflow: visible; flex-shrink: 0; }
.shapes-pop .mp-grid .shape-btn { min-height: 62px; flex-shrink: 0; }
.shapes-pop .mp-grid .shape-btn canvas { width: 52px; height: 40px; }

/* herramientas de clase */
.ct-panel { position: fixed; z-index: 80; width: 356px; border-radius: 24px; padding: 0 0 14px; background: color-mix(in srgb, var(--card) 72%, transparent); backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5); border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); box-shadow: 0 18px 50px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.5); max-height: calc(100vh - 20px); overflow-y: auto; }
.ct-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 8px 18px; font-weight: 700; font-size: 14px; cursor: grab; touch-action: none; user-select: none; }
.ct-head:active { cursor: grabbing; }
.ct-x { border: 0; background: color-mix(in srgb, var(--ink) 8%, transparent); width: 28px; height: 28px; border-radius: 50%; font-size: 13px; color: var(--ink); cursor: pointer; }
.ct-body { padding: 0 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ct-tabs, .ct-dice { display: flex; gap: 3px; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 7%, transparent); width: 100%; }
.ct-tabs button, .ct-dice button { flex: 1; border: 0; background: transparent; padding: 6px 2px; border-radius: 9px; font: inherit; font-size: 12px; font-weight: 600; color: var(--ink); cursor: pointer; }
.ct-tabs button.on, .ct-dice button.on { background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.18); color: var(--accent); }
.ct-cv { border-radius: 16px; max-width: 100%; }
.ct-result { min-height: 28px; font-weight: 700; font-size: 20px; text-align: center; }
.ct-result.big { font-size: 30px; }
.ct-result.pop { animation: ctpop .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes ctpop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ct-go { border: 0; border-radius: 14px; padding: 10px 30px; font: inherit; font-weight: 700; color: #fff; background: var(--accent); cursor: pointer; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.ct-rm { font-size: 12.5px; display: flex; gap: 6px; align-items: center; color: var(--muted); }
.ct-lists { width: 100%; }
.ct-edit { width: 100%; text-align: left; border: 0; background: color-mix(in srgb, var(--ink) 6%, transparent); padding: 8px 12px; border-radius: 10px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.ct-names { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ct-names textarea { width: 100%; box-sizing: border-box; border-radius: 10px; border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 80%, transparent); padding: 8px; font: inherit; font-size: 13px; color: var(--ink); resize: vertical; }
.ct-save { display: flex; gap: 6px; }
.ct-save input { flex: 1; min-width: 0; border-radius: 9px; border: 1px solid var(--line); padding: 6px 8px; font: inherit; font-size: 12.5px; background: color-mix(in srgb, var(--card) 80%, transparent); color: var(--ink); }
.ct-save button, .ct-row > button:first-child { border: 0; border-radius: 9px; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 600; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); cursor: pointer; }
.ct-row { position: relative; display: flex; gap: 4px; margin-top: 4px; }
.ct-row > button:first-child { flex: 1; text-align: left; }
.ct-dots { border: 0; background: transparent; font-size: 18px; width: 30px; color: var(--ink); cursor: pointer; }
.ct-menu { position: absolute; right: 0; top: 30px; z-index: 3; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 22px rgba(0,0,0,.2); padding: 4px; }
.ct-menu button { border: 0; background: transparent; padding: 7px 12px; font: inherit; font-size: 12.5px; color: #E5484D; cursor: pointer; white-space: nowrap; }

.cap-btn { display: none; position: absolute; left: 16px; bottom: 16px; z-index: 40; width: 44px; height: 44px; border-radius: 50%; border: 0; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); box-shadow: 0 6px 20px rgba(0,0,0,.16); }
.cap-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body.presenting .cap-btn { display: flex; }
.shot-flash { position: absolute; inset: 0; z-index: 60; pointer-events: none; background: #fff; animation: shotflash .7s ease-out forwards; box-shadow: inset 0 0 0 6px rgba(255,255,255,.9); }
@keyframes shotflash { 0% { opacity: .95; } 100% { opacity: 0; } }
.fp-row{position:relative}.fp-star{margin-left:auto;padding:0 6px;font-size:16px;color:var(--muted);cursor:pointer}.fp-star.on{color:#F5B301}.fp-row .ck{margin-left:6px}
.rs-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.rs-head h3{margin:0;font-size:16px}
.rs-circ{width:36px;height:36px;border-radius:50%;border:0;background:color-mix(in srgb,var(--ink) 8%,transparent);color:var(--ink);font-size:16px;font-weight:700;cursor:pointer}
.rs-circ.ok{background:var(--accent);color:#fff}.rs-circ:disabled{opacity:.4}

/* menús de vidrio con íconos */
.ctx-menu, .lib-menu { background: color-mix(in srgb, var(--card) 72%, transparent); backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5); border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.45); }
.ctx-menu button { justify-content: flex-start; gap: 10px; border-radius: 9px; }
.ctx-menu button .mi { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ctx-menu button span { flex: 1; }
.lib-art { filter: drop-shadow(0 6px 10px rgba(30,30,70,.10)); }
.lib-thumb:hover .lib-art { transform: translateY(-2px); transition: transform .15s; }
.lib-card { background: transparent; }

.lib-view { margin-right: 8px; }
.lib-view button { padding: 6px 9px; }
.lib-list { display: flex; flex-direction: column; gap: 6px; }
.lib-row { display: flex; align-items: center; gap: 14px; padding: 6px 14px; border-radius: 14px; background: color-mix(in srgb, var(--ink) 3.5%, transparent); }
.lib-row:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.lib-rthumb { width: 56px; height: 46px; flex: none; cursor: pointer; overflow: hidden; }
.lib-rthumb .lib-art { transform: scale(.4); transform-origin: center; width: 140px; height: 116px; margin: -35px 0 0 -42px; }
.lib-rname { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.lib-rname b { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-rname small { color: var(--muted); font-size: 12px; }
.lib-rstar { border: 0; background: transparent; color: var(--muted); padding: 4px; }
.lib-rstar svg { width: 17px; height: 17px; } .lib-rstar.on { color: #E5484D; } .lib-rstar.on svg { fill: #E5484D; }
.lib-row .lib-more svg { width: 18px; height: 18px; }
@media (max-width: 640px) { .lib-row .lib-date { display: none; } }
.lib-head .lib-view { display: inline-flex; flex: none; width: auto; margin-right: 8px; }
.lib-head .lib-view button { display: inline-flex; padding: 6px 10px; }
.lib-head .lib-view svg { width: 17px; height: 17px; }
.lib-head .seg.lib-view { flex-direction: row; flex-wrap: nowrap; min-width: 76px; }
.lib-head .seg.lib-view button { flex: none; }

.ink-pop { width: 260px; } .ink-pop h4 small { font-weight: 500; opacity: .6; margin-left: 4px; }
.ink-pop .ip-fav { position: relative; display: inline-flex; } .ink-pop .ip-x { position: absolute; top: -5px; right: -5px; width: 15px; height: 15px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg, #fff); font-size: 11px; line-height: 15px; padding: 0; display: none; cursor: pointer; }
.ink-pop .ip-fav:hover .ip-x { display: block; }
.ink-pop .ip-new { position: relative; display: inline-flex; align-items: center; justify-content: center; border: 1.5px dashed color-mix(in srgb, var(--ink) 45%, transparent); background: transparent; }
.ink-pop .ip-new input { position: absolute; inset: 0; opacity: 0; cursor: pointer; } .ink-pop .ip-new svg { width: 13px; height: 13px; }
.ib-dot.on { position: relative; } .ib-dot.on::after { content: "▾"; position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%); font-size: 10px; color: var(--muted); }
.ink-pop .ip-new { border: 0; background: var(--accent); color: #fff; } .ink-pop .ip-new svg { stroke: #fff; }
.ink-pop .c.other.ip-new { background: var(--accent) !important; }
.ink-pop .pick-grid .muted { width: 100%; }

/* selector de colores flotante (igual que en la Mac): pestañas, círculos con ✓ y rueda */
.sw-tabs { display: flex; margin: 0 0 10px; }
.sw-tabs button { flex: 1; font-size: 12px; padding: 5px 4px; }
.tb-pop .tb-sw.sw30 { grid-template-columns: repeat(8, 30px); gap: 10px; justify-content: start; max-width: none; margin-bottom: 10px; }
.sw30 .c { width: 30px; height: 30px; border-radius: 50%; position: relative; box-shadow: inset 0 0 0 1px rgba(127,127,127,.28); }
.sw30 .c.on { outline: none; }
.sw30 .c.on::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 14px; border: solid #fff; border-width: 0 2.4px 2.4px 0; transform: translate(-50%, -62%) rotate(45deg); }
.sw30 .c.on.lt::after { border-color: #000; }
.sw-d { position: relative; display: inline-flex; }
.sw-x { position: absolute; top: -6px; right: -6px; z-index: 2; width: 16px; height: 16px; padding: 0; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg, #fff); font-size: 11px; line-height: 16px; cursor: pointer; opacity: 0; transition: opacity .12s; }
.sw-d:hover .sw-x { opacity: 1; }
.sw-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.sw-foot code { font: 600 11px ui-monospace, Menlo, monospace; color: var(--muted); }
.sw-wheel { position: relative; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; background: conic-gradient(#f03e3e, #fab005, #40c057, #15aabf, #4c6ef5, #be4bdb, #f03e3e); box-shadow: inset 0 0 0 1px rgba(127,127,127,.3); }
.sw-wheel input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.tb-pop:has(.sw-root) { width: 352px; }
.tb-pop .seg.sw-tabs { grid-template-columns: repeat(3, 1fr); }
.tb-pop .tb-sw.sw30 .c { width: 30px; height: 30px; border-radius: 50%; }
.tb-pop .tb-sw.sw30 .c.on { box-shadow: inset 0 0 0 1px rgba(127,127,127,.28); }

/* aún no lanzados en la versión web: modo animador y acceso a animaciones */
#animatorBtn, #animBtn, #stepsLabel, #stepsSlider { display: none !important; }

/* tutorial guiado */
#tour { position: fixed; inset: 0; z-index: 400; }
#tour .tour-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(10,10,20,.72), 0 0 0 3px #fff, 0 0 18px 4px rgba(124,108,255,.8); pointer-events: none; transition: all .25s ease; }
#tour .tour-card { position: fixed; background: var(--card); color: var(--ink); border-radius: 14px; padding: 14px 16px 12px; box-shadow: 0 12px 40px rgba(0,0,0,.4); transition: left .25s, top .25s; }
#tour .tour-n { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
#tour h4 { margin: 2px 0 6px; font-size: 17px; }
#tour p { margin: 0 0 12px; font-size: 14px; line-height: 1.45; }
#tour .tour-btns { display: flex; gap: 8px; align-items: center; }
#tour .tour-btns span { flex: 1; }
#tour .tour-btns button { border: 0; border-radius: 10px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink); }
#tour .tour-btns .tour-next { background: #5b5bd6; color: #fff; }
#tour .tour-btns .tour-skip { background: none; color: var(--muted); padding-left: 0; }

/* figuras: igual que en la Mac (cuadrícula de 4 × 84 px, etiquetas de 9 px) */
.shapes-pop { width: 400px; }
.shapes-pop .sp-grid { grid-template-columns: repeat(4, 84px); gap: 8px; max-height: 290px; justify-content: center; }
.shapes-pop .sp-grid .shape-btn { width: 84px; height: 70px; padding: 0; justify-content: center; font-size: 9px; border-radius: 10px; }
.shapes-pop .sp-grid canvas { width: 48px; height: 38px; }

.wm-video { position: absolute; right: 12px; bottom: 44px; display: flex; align-items: center; gap: 8px; color: #fff; opacity: .4; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.wm-video svg { width: 30px; height: 30px; }
.wm-video span { display: flex; flex-direction: column; line-height: 1.15; }
.wm-video b { font-size: 14px; } .wm-video i { font-size: 10px; font-style: normal; }
