/* Bindexp Notes · estilos
   Marca: azul #5271ff · violeta #9c1df5 · rosa #f982c2 · tinta #0A0A0B · Geist */

:root {
  --blue: #5271ff;
  --violet: #9c1df5;
  --pink: #f982c2;
  --grad: linear-gradient(100deg, #5271ff 0%, #9c1df5 56%, #f982c2 100%);
  --grad-suave: linear-gradient(135deg, rgba(82, 113, 255, 0.14), rgba(156, 29, 245, 0.1) 60%, rgba(249, 130, 194, 0.12));

  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --surface-3: #f4f4f5;
  --text: #0a0a0b;
  --text-2: #52525b;
  --text-3: #a1a1aa;
  --border: rgba(10, 10, 11, 0.07);
  --border-2: rgba(10, 10, 11, 0.13);
  --desk: #e9eaee;
  --glass: rgba(255, 255, 255, 0.8);
  --glass-borde: rgba(255, 255, 255, 0.9);
  --hover: rgba(10, 10, 11, 0.045);
  --activo: rgba(82, 113, 255, 0.1);
  --peligro: #e11d48;
  --ok: #16a34a;

  --sombra-1: 0 1px 2px rgba(10, 10, 11, 0.05), 0 1px 1px rgba(10, 10, 11, 0.03);
  --sombra-2: 0 12px 32px -14px rgba(10, 10, 11, 0.22), 0 2px 6px rgba(10, 10, 11, 0.05);
  --sombra-3: 0 30px 70px -24px rgba(10, 10, 11, 0.38), 0 10px 24px -10px rgba(10, 10, 11, 0.14);

  --r: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --snap: cubic-bezier(0.32, 0.72, 0, 1);
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;
  --barra: 54px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0b0b0d;
    --surface: #141417;
    --surface-2: #18181b;
    --surface-3: #1f1f23;
    --text: #f4f4f5;
    --text-2: #b4b4bb;
    --text-3: #6b6b74;
    --border: rgba(255, 255, 255, 0.07);
    --border-2: rgba(255, 255, 255, 0.13);
    --desk: #0f0f12;
    --glass: rgba(24, 24, 27, 0.78);
    --glass-borde: rgba(255, 255, 255, 0.08);
    --hover: rgba(255, 255, 255, 0.06);
    --activo: rgba(82, 113, 255, 0.2);
    --sombra-2: 0 14px 34px -14px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.4);
    --sombra-3: 0 30px 70px -20px rgba(0, 0, 0, 0.8), 0 10px 24px -10px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0b0b0d;
  --surface: #141417;
  --surface-2: #18181b;
  --surface-3: #1f1f23;
  --text: #f4f4f5;
  --text-2: #b4b4bb;
  --text-3: #6b6b74;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.13);
  --desk: #0f0f12;
  --glass: rgba(24, 24, 27, 0.78);
  --glass-borde: rgba(255, 255, 255, 0.08);
  --hover: rgba(255, 255, 255, 0.06);
  --activo: rgba(82, 113, 255, 0.2);
  --sombra-2: 0 14px 34px -14px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.4);
  --sombra-3: 0 30px 70px -20px rgba(0, 0, 0, 0.8), 0 10px 24px -10px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* ================================================================ base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
body {
  position: fixed;
  inset: 0;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#app {
  position: fixed;
  inset: 0;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
  opacity: 0.38;
}
input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}
h1,
h2,
p {
  margin: 0;
}
.ic {
  width: 22px;
  height: 22px;
  flex: none;
  display: block;
}
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* pantalla de carga */
#carga {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 100;
  transition: opacity 0.35s var(--ease);
}
#carga.fuera {
  opacity: 0;
  pointer-events: none;
}
.carga-mark {
  width: 64px;
  height: 64px;
  animation: latido 1.4s var(--ease) infinite;
}
@keyframes latido {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.92); opacity: 0.7; }
}

/* ================================================================ botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  box-shadow: var(--sombra-1);
  font-weight: 550;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.btn .ic {
  width: 19px;
  height: 19px;
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn.primario {
  position: relative;
  color: #fff;
  border: 0;
  background: var(--grad);
  background-size: 140% 100%;
  box-shadow: 0 8px 22px -10px rgba(122, 60, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn.primario:hover {
  background-position: 100% 0;
}
.btn.peligro {
  color: #fff;
  background: var(--peligro);
  border: 0;
}
.btn.fantasma {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-2);
}
.btn.fantasma:hover {
  background: var(--hover);
}
.btn.grande {
  height: 48px;
  padding: 0 22px;
  font-size: 15.5px;
  border-radius: 14px;
}
.btn.ancho {
  width: 100%;
}
.btn.cargando span::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 10px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: gira 0.7s linear infinite;
}
@keyframes gira {
  to { transform: rotate(360deg); }
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s, transform 0.15s var(--ease);
}
.icon-btn:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}
.icon-btn:active:not(:disabled) {
  transform: scale(0.92);
}
.icon-btn.chico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}
.icon-btn.chico .ic {
  width: 18px;
  height: 18px;
}
.icon-btn.acento {
  color: var(--blue);
}

/* ================================================================ campos */
.campo {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  outline: none;
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.campo {
  height: auto;
  padding: 10px 13px;
  resize: vertical;
  line-height: 1.5;
}
.campo:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(82, 113, 255, 0.16);
}
.campo.error {
  border-color: var(--peligro);
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.14);
  animation: sacude 0.35s;
}
@keyframes sacude {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.campo-grande {
  height: 50px;
  font-size: 17px;
  border-radius: 13px;
}
.etiqueta-campo {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.etiqueta-campo > span,
.pp-etiqueta {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.pp-etiqueta {
  margin-bottom: 8px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 11px;
  background: var(--surface-3);
  border: 1px solid var(--border);
}
.segmented button {
  height: 32px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.segmented button.activo {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sombra-1), 0 0 0 1px var(--border);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip,
.chip-papel {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 520;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.chip .ic {
  width: 16px;
  height: 16px;
}
.chip.activo,
.chip-papel.activo {
  border-color: var(--blue);
  background: var(--activo);
  box-shadow: 0 0 0 1px var(--blue);
}
.chip-punto,
.chip-muestra {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.chip-muestra {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-2);
}
.chip-nuevo {
  border-style: dashed;
  color: var(--text-2);
}

.switch-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  cursor: pointer;
}
.switch-fila span {
  display: grid;
}
.switch-fila strong {
  font-weight: 560;
  font-size: 14.5px;
}
.switch-fila small {
  color: var(--text-3);
  font-size: 12.5px;
}
.switch {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s var(--snap);
}
.switch:checked {
  background: var(--blue);
  border-color: var(--blue);
}
.switch:checked::after {
  transform: translateX(18px);
}

/* muestras de color */
.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}
.swatch::before {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(10, 10, 11, 0.14);
  transition: transform 0.2s var(--snap);
}
.swatch.activo::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  border: 2px solid var(--c);
  box-shadow: inset 0 0 0 2px var(--surface);
}
.swatch.activo::before {
  transform: scale(0.82);
}
.color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 4px 14px 14px;
}
.swatch-big {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(10, 10, 11, 0.14);
  position: relative;
  display: grid;
  place-items: center;
  color: var(--text-3);
  transition: transform 0.18s var(--snap);
}
.swatch-big .ic {
  width: 18px;
  height: 18px;
}
.swatch-big:active {
  transform: scale(0.9);
}
.swatch-big.activo {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--blue);
}
.swatch-libre {
  background: conic-gradient(from 0deg, #ff4d4d, #ffd24d, #4dff88, #4dd2ff, #7a4dff, #ff4dd2, #ff4d4d);
  cursor: pointer;
  overflow: hidden;
}
.swatch-libre input {
  opacity: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.fondos .swatch-big {
  border: 1px dashed var(--border-2);
}

/* ================================================================ avisos */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 90;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px 11px 14px;
  border-radius: 14px;
  background: rgba(20, 20, 23, 0.92);
  color: #fff;
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: var(--sombra-3);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition: opacity 0.25s var(--ease), transform 0.35s var(--ease);
}
.toast.in {
  opacity: 1;
  transform: none;
}
.toast-ic .ic {
  width: 19px;
  height: 19px;
  opacity: 0.85;
}
.toast.ok .toast-ic {
  color: #86efac;
}
.toast.error {
  background: rgba(159, 18, 57, 0.95);
}
.toast-btn {
  margin-left: 6px;
  padding: 6px 11px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 600;
  font-size: 13.5px;
  color: #fff;
}

/* ================================================================ globos */
.pop-capa {
  position: fixed;
  inset: 0;
  z-index: 70;
}
.pop {
  position: fixed;
  min-width: 200px;
  max-width: calc(100vw - 20px);
  overflow: auto;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  border: 1px solid var(--glass-borde);
  box-shadow: var(--sombra-3), 0 0 0 1px var(--border);
  border-radius: 18px;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  transform-origin: var(--flecha, 50%) top;
  transition: opacity 0.16s var(--ease), transform 0.3s var(--ease);
  -webkit-user-select: none;
  user-select: none;
}
.pop.arriba {
  transform-origin: var(--flecha, 50%) bottom;
  transform: translateY(6px) scale(0.97);
}
.pop.in {
  opacity: 1;
  transform: none;
}
.pop-capa.fuera {
  pointer-events: none;
}
.pop-titulo {
  padding: 14px 16px 8px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.pop-pad {
  padding: 4px 16px 16px;
}
.pop-pad .pop-titulo {
  padding-left: 0;
}
.pop-texto {
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 12px;
}
.menu {
  padding: 6px;
  display: grid;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 12px 0 10px;
  border-radius: 11px;
  text-align: left;
  font-size: 14.5px;
  font-weight: 500;
  transition: background 0.12s;
}
.menu-item:hover:not(:disabled),
.menu-item:active:not(:disabled) {
  background: var(--hover);
}
.menu-ic {
  width: 22px;
  color: var(--text-2);
}
.menu-ic .ic {
  width: 20px;
  height: 20px;
}
.menu-txt {
  flex: 1;
}
.menu-det {
  font-size: 12px;
  color: var(--text-3);
}
.menu-check {
  color: var(--blue);
}
.menu-check .ic {
  width: 18px;
  height: 18px;
}
.menu-item.marcado .menu-txt {
  font-weight: 600;
}
.menu-item.peligro,
.menu-item.peligro .menu-ic {
  color: var(--peligro);
}
.menu-sep {
  height: 1px;
  margin: 5px 10px;
  background: var(--border-2);
}
.menu-titulo {
  padding: 10px 12px 4px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ================================================================ hojas */
.sheet-fondo {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(10, 10, 11, 0);
  transition: background 0.25s;
}
.sheet-fondo.in {
  background: rgba(10, 10, 11, 0.32);
}
.sheet {
  width: min(560px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--sombra-3);
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.2s var(--ease), transform 0.45s var(--ease);
  overflow: hidden;
}
.sheet-fondo.in .sheet {
  opacity: 1;
  transform: none;
}
.sheet-chica {
  width: min(420px, 100%);
}
.sheet-papel,
.sheet-share {
  width: min(640px, 100%);
}
.sheet-cab {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 8px 24px;
}
.sheet-titulo {
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.025em;
}
.sheet-sub {
  font-size: 13.5px;
  color: var(--text-3);
  margin-top: 1px;
}
.sheet-x {
  margin: -4px -6px 0 0;
}
.sheet-cuerpo {
  padding: 10px 24px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.sheet-texto {
  color: var(--text-2);
}
.sheet-pie {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom) * 0);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ================================================================ login */
.login {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 24px;
  padding: 24px;
  overflow: hidden;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}
.login.saliendo {
  opacity: 0;
  transform: scale(1.02);
}
.login-aurora {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(40% 38% at 28% 30%, rgba(82, 113, 255, 0.28), transparent 70%),
    radial-gradient(34% 34% at 72% 36%, rgba(156, 29, 245, 0.22), transparent 70%),
    radial-gradient(38% 36% at 56% 76%, rgba(249, 130, 194, 0.26), transparent 70%);
  filter: blur(20px);
  animation: aurora 18s ease-in-out infinite alternate;
}
@keyframes aurora {
  to { transform: rotate(8deg) scale(1.08); }
}
.login-card {
  position: relative;
  width: min(400px, 100%);
  padding: 40px 32px 32px;
  border-radius: 28px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  backdrop-filter: blur(30px) saturate(1.5);
  border: 1px solid var(--glass-borde);
  box-shadow: var(--sombra-3);
  text-align: center;
}
.login-mark {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  padding: 15px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 12px 30px -12px rgba(122, 60, 255, 0.5), 0 0 0 1px var(--border);
}
.login-mark .mark {
  width: 100%;
  height: 100%;
}
.login h1 {
  font-size: 30px;
  font-weight: 720;
  letter-spacing: -0.035em;
}
.login h1 span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-sub {
  color: var(--text-2);
  margin: 6px 0 24px;
}
.login-form {
  display: grid;
  gap: 10px;
  text-align: left;
}
.login-form .btn {
  margin-top: 6px;
}
.login-error {
  color: var(--peligro);
  font-size: 13.5px;
  min-height: 1px;
  text-align: center;
}
.login-pie {
  position: relative;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}

/* ================================================================ biblioteca */
.library {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 264px 1fr;
  background: var(--bg);
}
.lib-side {
  display: flex;
  flex-direction: column;
  padding: calc(18px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  min-height: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 22px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  padding: 7px;
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--sombra-1), 0 0 0 1px var(--border);
}
.brand-mark .mark {
  width: 100%;
  height: 100%;
}
.brand strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.brand div span {
  font-size: 13px;
  font-weight: 600;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.side-nav {
  flex: 1;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 2px;
  margin: 0 -4px;
  padding: 0 4px;
}
.side-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 8px 0 10px;
  border-radius: 11px;
  font-weight: 520;
  font-size: 14.5px;
  color: var(--text-2);
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.side-item:hover {
  background: var(--hover);
  color: var(--text);
}
.side-item.activo {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sombra-1), 0 0 0 1px var(--border);
}
.side-item.activo .side-ic {
  color: var(--blue);
}
.side-ic .ic {
  width: 20px;
  height: 20px;
}
.side-punto {
  width: 11px;
  height: 11px;
  margin: 0 4.5px;
  border-radius: 4px;
  flex: none;
}
.side-txt {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-n {
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.side-mas {
  display: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: var(--text-3);
}
.side-mas .ic {
  width: 18px;
  height: 18px;
}
.side-item.activo .side-mas,
.side-item:hover .side-mas {
  display: grid;
}
.side-item.activo:has(.side-mas) .side-n,
.side-item:hover:has(.side-mas) .side-n {
  display: none;
}
.side-sec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 6px 6px 10px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.side-sec:empty {
  padding: 10px 0 0;
  margin: 0 10px 8px;
  border-bottom: 1px solid var(--border);
}
.side-vacio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin: 2px 0;
  border-radius: 11px;
  border: 1px dashed var(--border-2);
  color: var(--text-3);
  font-size: 13.5px;
}
.side-vacio .ic {
  width: 19px;
  height: 19px;
}
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 6px 0 8px;
  border-top: 1px solid var(--border);
}
.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-weight: 650;
}
.side-user-txt {
  flex: 1;
  min-width: 0;
  display: grid;
  line-height: 1.25;
}
.side-user-txt strong {
  font-size: 14px;
  text-transform: capitalize;
}
.side-sync {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-sync::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ok);
  vertical-align: 1px;
}
.side-sync[data-estado='subiendo']::before,
.side-sync[data-estado='pendiente']::before {
  background: var(--blue);
  animation: latido 1s infinite;
}
.side-sync[data-estado='offline']::before,
.side-sync[data-estado='error']::before {
  background: #f59e0b;
}
.side-sync[data-estado='sesion']::before {
  background: var(--peligro);
}

.lib-main {
  position: relative;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(22px + env(safe-area-inset-top)) calc(32px + env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) 32px;
  min-width: 0;
}
.lib-cab {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-bottom: 26px;
}
.lib-hamburguesa {
  display: none;
}
.lib-titulo {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}
.lib-titulo h1 {
  font-size: 32px;
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.lib-titulo p {
  width: 100%;
  color: var(--text-3);
  font-size: 14px;
}
.lib-titulo-punto {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  align-self: center;
}
.lib-acciones {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lib-buscar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text-3);
  width: 220px;
  transition: width 0.3s var(--ease), border-color 0.15s, box-shadow 0.15s;
}
.lib-buscar:focus-within {
  width: 260px;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(82, 113, 255, 0.14);
}
.lib-buscar .ic {
  width: 18px;
  height: 18px;
}
.lib-buscar input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 14.5px;
  color: var(--text);
}
.lib-acciones .btn {
  margin-left: 6px;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 30px 22px;
}
.lib-grid.ver-paginas {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.nb {
  position: relative;
  min-width: 0;
  animation: entra 0.5s var(--ease) both;
  animation-delay: calc(var(--i) * 28ms);
}
@keyframes entra {
  from { opacity: 0; transform: translateY(10px); }
}
.nb-abrir {
  display: block;
  width: 100%;
  transition: transform 0.35s var(--ease);
}
.nb-abrir:hover {
  transform: translateY(-4px) rotate(-0.4deg);
}
.nb-abrir:active {
  transform: scale(0.97);
}

/* portada tipo agenda */
.nb-cover {
  position: relative;
  display: block;
  aspect-ratio: 0.76;
  border-radius: 6px 14px 14px 6px;
  overflow: hidden;
  background: var(--cov, #5271ff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset -1px 0 0 rgba(0, 0, 0, 0.08),
    0 1px 1px rgba(10, 10, 11, 0.06),
    0 18px 30px -18px rgba(10, 10, 11, 0.55),
    0 6px 12px -6px rgba(10, 10, 11, 0.18);
  color: #fff;
}
.nb-cover::before {
  /* grano del cuero */
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.18;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.nb-cover::after {
  /* brillo */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 38%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.14) 100%);
  pointer-events: none;
}
.nb-lomo {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 13px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.26), rgba(0, 0, 0, 0.05) 70%, rgba(255, 255, 255, 0.14));
  border-right: 1px solid rgba(0, 0, 0, 0.1);
}
.nb-elastico {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 16%;
  width: 7px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.18) 45%, rgba(255, 255, 255, 0.08));
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.08), -1px 0 2px rgba(0, 0, 0, 0.2);
  z-index: 1;
}
.nb-etiqueta {
  position: absolute;
  left: 22%;
  right: 30%;
  top: 22%;
  padding: 9px 9px 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.93);
  color: #18181b;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 6px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  z-index: 2;
}
.nb-etiqueta span {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-align: left;
  word-break: break-word;
}
.nb-fav {
  position: absolute;
  right: 5%;
  top: 5%;
  color: #fde047;
  z-index: 2;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}
.nb-fav .ic {
  width: 16px;
  height: 16px;
}
.cov-aurora { --cov: linear-gradient(150deg, #5271ff 0%, #7b3cf5 48%, #c65bd8 78%, #f982c2 100%); }
.cov-tinta { --cov: linear-gradient(160deg, #26262b, #0a0a0b); }
.cov-tinta .nb-elastico { background: var(--grad); opacity: 0.9; }
.cov-azul { --cov: linear-gradient(160deg, #6481ff, #3450e0); }
.cov-lavanda { --cov: linear-gradient(160deg, #a94af7, #7512c4); }
.cov-rosa { --cov: linear-gradient(160deg, #fb9ccf, #e0539f); }
.cov-arena { --cov: linear-gradient(160deg, #efe6d6, #d5c4a6); }
.cov-bosque { --cov: linear-gradient(160deg, #1a8a7f, #0c4f4a); }
.cov-grafito { --cov: linear-gradient(160deg, #56565e, #27272a); }

.nb-pagina {
  display: block;
  aspect-ratio: 0.77;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 1px var(--border), 0 14px 26px -16px rgba(10, 10, 11, 0.45), 0 4px 8px -4px rgba(10, 10, 11, 0.1);
}
.nb-pagina img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.nb-pagina-vacia {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(#fff 0 17px, #e3e8f0 17px 18px);
}
.nb-meta {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-top: 11px;
}
.nb-meta-txt {
  flex: 1;
  min-width: 0;
  display: grid;
  line-height: 1.3;
}
.nb-meta-txt strong {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nb-meta-txt span {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nb-proy {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  margin-right: 6px;
}
.nb-mas {
  margin: -3px -6px 0 0;
}

.vacio {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 80px 20px;
  color: var(--text-2);
}
.vacio h2 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}
.vacio-ic {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--surface);
  color: var(--text-3);
  box-shadow: var(--sombra-1), 0 0 0 1px var(--border);
  margin-bottom: 8px;
}
.vacio-grande {
  padding-top: 60px;
}
.vacio-grande .btn {
  margin-top: 14px;
}
.vacio-cuaderno {
  width: 150px;
  margin-bottom: 22px;
  transform: rotate(-4deg);
  animation: flota 5s ease-in-out infinite;
}
@keyframes flota {
  50% { transform: rotate(-2deg) translateY(-8px); }
}

.aviso-instalar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 10px 14px 16px;
  margin-bottom: 26px;
  border-radius: 16px;
  background: var(--grad-suave), var(--surface);
  border: 1px solid rgba(82, 113, 255, 0.25);
}
.aviso-instalar > div {
  flex: 1;
  display: grid;
  font-size: 13.5px;
  color: var(--text-2);
}
.aviso-instalar strong {
  font-size: 14.5px;
  color: var(--text);
}
.aviso-ic {
  color: var(--blue);
}
.lib-fondo-velo {
  display: none;
}

/* elección de portada y proyecto */
.covers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 12px;
}
.cover-op {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 6px 4px;
  border-radius: 12px;
  transition: background 0.15s;
}
.cover-op.activo {
  background: var(--activo);
}
.cover-mini {
  width: 52px;
  aspect-ratio: 0.76;
  border-radius: 3px 8px 8px 3px;
}
.cover-mini-papel {
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--text-3);
  box-shadow: 0 0 0 1px var(--border-2), 0 6px 12px -8px rgba(0, 0, 0, 0.4);
}
.cover-op.activo .cover-mini {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.cover-nombre {
  font-size: 12px;
  color: var(--text-2);
}
.proy-colores {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
}
.nueva-nota .pp-fila {
  margin-top: 18px;
}

/* ================================================================ papel */
.paper-picker {
  display: grid;
  gap: 18px;
}
.tpl-galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 14px 12px;
}
.tpl-grupo {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 2px;
}
.tpl {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 7px;
}
.tpl-hoja {
  display: block;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border-2), 0 8px 16px -10px rgba(10, 10, 11, 0.45);
  transition: transform 0.25s var(--ease), box-shadow 0.2s;
}
.tpl-hoja canvas {
  display: block;
}
.tpl.activo .tpl-hoja {
  box-shadow: 0 0 0 2px var(--blue), 0 0 0 6px rgba(82, 113, 255, 0.18), 0 10px 18px -10px rgba(82, 113, 255, 0.6);
  transform: translateY(-2px);
}
.tpl-nombre {
  font-size: 12.5px;
  font-weight: 520;
  color: var(--text-2);
  text-align: center;
}
.tpl.activo .tpl-nombre {
  color: var(--blue);
  font-weight: 620;
}
.pp-doble {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
}

/* ================================================================ editor */
.editor {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--desk);
}
.ed-bar {
  position: relative;
  z-index: 10;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: calc(var(--barra) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) calc(10px + env(safe-area-inset-right)) 0 calc(8px + env(safe-area-inset-left));
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
}
.ed-bar-l,
.ed-bar-r {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.ed-bar-l {
  flex: 1;
}
.ed-titulo {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 38px;
  padding: 0 8px 0 10px;
  border-radius: 10px;
  font-weight: 620;
  font-size: 15.5px;
  letter-spacing: -0.015em;
  transition: background 0.15s;
}
.ed-titulo:hover {
  background: var(--hover);
}
.ed-titulo-txt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 34vw;
}
.ed-titulo .ic {
  width: 16px;
  height: 16px;
  color: var(--text-3);
}
.sync-ind {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--ok);
}
.sync-ind .ic {
  width: 19px;
  height: 19px;
}
.sync-ind[data-estado='subiendo'],
.sync-ind[data-estado='pendiente'] {
  color: var(--blue);
}
.sync-ind[data-estado='subiendo'] .ic {
  animation: latido 1s infinite;
}
.sync-ind[data-estado='offline'],
.sync-ind[data-estado='error'] {
  color: #f59e0b;
}
.sync-ind[data-estado='sesion'] {
  color: var(--peligro);
}
.bar-sep {
  width: 1px;
  height: 22px;
  margin: 0 6px;
  background: var(--border-2);
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.stage canvas {
  position: absolute;
  left: 0;
  top: 0;
  touch-action: none;
}
.stage[data-tool='pen'] .live,
.stage[data-tool='highlighter'] .live,
.stage[data-tool='shape'] .live,
.stage[data-tool='lasso'] .live {
  cursor: crosshair;
}
.stage[data-tool='eraser'] .live {
  cursor: none;
}
.stage[data-tool='text'] .live {
  cursor: text;
}
.stage[data-tool='laser'] .live {
  cursor: none;
}

/* barra flotante de herramientas */
.dock {
  position: absolute;
  z-index: 8;
  transition: left 0.4s var(--ease);
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  max-width: calc(100% - 20px);
  padding: 5px;
  border-radius: 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  border: 1px solid var(--glass-borde);
  box-shadow: var(--sombra-2), 0 0 0 1px var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.dock::-webkit-scrollbar {
  display: none;
}
.dock-tools,
.dock-ops {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}
.dock-ops {
  gap: 6px;
  padding-right: 4px;
}
.dock.sin-ops .dock-sep,
.dock.sin-ops .dock-ops {
  display: none;
}
.dock-sep {
  width: 1px;
  height: 28px;
  margin: 0 6px;
  background: var(--border-2);
  flex: none;
}
.tool {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 44px;
  border-radius: 12px;
  color: var(--text-2);
  transition: background 0.18s, color 0.18s;
  overflow: hidden;
}
.tool:hover {
  background: var(--hover);
}
.tool.activo {
  color: var(--blue);
  background: var(--grad-suave);
}
.tool.activo::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 14px;
  height: 3px;
  margin-left: -7px;
  border-radius: 3px;
  background: var(--grad);
}
.tool.es-arte {
  place-items: end center;
}
.pen-art {
  width: 22px;
  height: 40px;
  transform: translateY(9px);
  transition: transform 0.3s var(--snap);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.18));
}
.tool.es-arte.activo .pen-art {
  transform: translateY(1px);
}
.tool.es-arte.activo::after {
  display: none;
}

.op-grupo {
  display: flex;
  align-items: center;
  gap: 1px;
}
.op-tipo,
.op-fuente {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 8px 0 11px;
  border-radius: 10px;
  background: var(--surface-3);
  font-size: 13.5px;
  font-weight: 580;
  white-space: nowrap;
}
.op-fuente span {
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: 500;
}
.op-tipo .ic,
.op-fuente .ic {
  width: 15px;
  height: 15px;
  color: var(--text-3);
}
.op-grosor {
  display: grid;
  place-items: center;
  width: 30px;
  height: 34px;
  border-radius: 9px;
  transition: background 0.15s;
}
.op-grosor .punto {
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.2s var(--snap);
}
.op-grosor .punto-borrador {
  border-radius: 50%;
  border: 1.5px solid var(--text-2);
}
.op-grosor.activo {
  background: var(--activo);
}
.op-grosor.activo .punto {
  background: var(--blue);
}
.op-grosor.activo .punto-borrador {
  border-color: var(--blue);
  background: rgba(82, 113, 255, 0.15);
}
.op-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px 0 9px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 560;
  color: var(--text-2);
  background: var(--surface-3);
  white-space: nowrap;
}
.op-toggle .ic {
  width: 17px;
  height: 17px;
}
.op-toggle.activo {
  color: var(--blue);
  background: var(--activo);
  box-shadow: inset 0 0 0 1px rgba(82, 113, 255, 0.4);
}
.op-pista {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  padding: 0 6px;
}
.op-forma {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.op-forma .ic {
  width: 19px;
  height: 19px;
}
.op-forma.activo {
  background: var(--activo);
  color: var(--blue);
}
.fondo-muestra {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px dashed var(--border-2);
}
.op-seg {
  padding: 2px;
}
.op-seg button {
  height: 30px;
  font-size: 13px;
  padding: 0 11px;
}
.op-stepper {
  display: flex;
  align-items: center;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-3);
}
.op-stepper button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 34px;
  color: var(--text-2);
}
.op-stepper .ic {
  width: 15px;
  height: 15px;
}
.op-stepper .op-tam {
  width: 30px;
  font-size: 13.5px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.pen-list {
  display: grid;
  padding: 0 6px 6px;
}
.pen-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 6px 6px;
  border-radius: 13px;
  text-align: left;
  transition: background 0.15s;
}
.pen-row:hover {
  background: var(--hover);
}
.pen-row.activo {
  background: var(--activo);
}
.pen-row-arte {
  width: 30px;
  height: 46px;
  display: grid;
  place-items: end center;
  overflow: hidden;
}
.pen-row-arte .pen-art {
  transform: translateY(8px);
}
.pen-row-txt {
  flex: 1;
  display: grid;
  line-height: 1.3;
}
.pen-row-txt strong {
  font-size: 14.5px;
  font-weight: 600;
}
.pen-row-txt small {
  font-size: 12px;
  color: var(--text-3);
}
.pen-row-trazo svg {
  width: 84px;
  height: 28px;
  color: var(--text);
}
.pen-extra {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 6px 6px;
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-2);
}
.pen-extra input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}
.grosor-prev {
  width: 100%;
  height: 48px;
  display: block;
  margin: 2px 0 8px;
}
.grosor-valor {
  margin-left: 6px;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
}
.rango {
  width: 100%;
  accent-color: var(--blue);
}
.font-list {
  max-height: min(430px, 60vh);
  overflow-y: auto;
  padding: 0 6px 8px;
}
.font-cat {
  padding: 10px 10px 4px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.font-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 18px;
  text-align: left;
}
.font-row:hover {
  background: var(--hover);
}
.font-row.activo {
  background: var(--activo);
}
.tam-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 0 12px 12px;
}
.tam-grid button {
  height: 38px;
  border-radius: 10px;
  background: var(--surface-3);
  font-weight: 560;
  font-variant-numeric: tabular-nums;
}
.tam-grid button.activo {
  background: var(--blue);
  color: #fff;
}

.editor.con-panel .dock {
  left: calc(50% + 108px);
  max-width: calc(100% - 236px);
}

/* píldoras de página y zoom */
.pill {
  position: absolute;
  z-index: 6;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: var(--sombra-2), 0 0 0 1px var(--border);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}
.pill-pagina {
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
}
.pill-zoom {
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.3s var(--ease);
}
.pill-zoom.visible {
  opacity: 1;
  transform: translateX(-50%);
  pointer-events: auto;
}

/* barra de la selección */
.sel-bar {
  position: absolute;
  z-index: 7;
  left: 0;
  top: 0;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(20, 20, 23, 0.94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--sombra-3);
  color: #fff;
  animation: aparece 0.22s var(--ease);
}
@keyframes aparece {
  from { opacity: 0; }
}
.sel-bar[hidden] {
  display: none;
}
.sel-btn {
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: 56px;
  padding: 6px 8px 5px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 560;
  color: rgba(255, 255, 255, 0.88);
}
.sel-btn .ic {
  width: 19px;
  height: 19px;
}
.sel-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.sel-btn.peligro {
  color: #fda4af;
}

/* cuadro de texto en edición */
.text-edit {
  position: absolute;
  z-index: 7;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}
.text-edit[hidden] {
  display: none;
}
.te-area {
  display: block;
  width: 100%;
  border: 0;
  outline: 1.5px solid var(--blue);
  outline-offset: 0;
  box-shadow: 0 0 0 5px rgba(82, 113, 255, 0.16);
  resize: none;
  overflow: hidden;
  background: transparent;
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}
.te-area::placeholder {
  color: rgba(113, 113, 122, 0.6);
}
.te-asa {
  position: absolute;
  display: grid;
  place-items: center;
  touch-action: none;
}
.te-mover {
  left: -14px;
  top: -34px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(82, 113, 255, 0.7);
  cursor: move;
}
.te-mover .ic {
  width: 17px;
  height: 17px;
}
.te-ancho {
  right: -9px;
  top: 50%;
  width: 18px;
  height: 36px;
  margin-top: -18px;
  cursor: ew-resize;
}
.te-ancho::before {
  content: '';
  width: 6px;
  height: 26px;
  border-radius: 4px;
  background: #fff;
  border: 1.5px solid var(--blue);
}
.te-listo {
  position: absolute;
  right: -14px;
  top: -34px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(22, 163, 74, 0.7);
}
.te-listo .ic {
  width: 17px;
  height: 17px;
}

/* aviso breve de deshacer / rehacer */
.hud {
  position: absolute;
  z-index: 9;
  left: 50%;
  top: 42%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(20, 20, 23, 0.86);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #fff;
  font-weight: 600;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.2s, transform 0.3s var(--snap);
  pointer-events: none;
}
.hud.in {
  opacity: 1;
  transform: translate(-50%, -50%);
}

/* panel de páginas */
.pages-panel {
  position: absolute;
  z-index: 9;
  left: 0;
  top: calc(var(--barra) + env(safe-area-inset-top));
  bottom: 0;
  width: 216px;
  display: flex;
  flex-direction: column;
  padding-left: env(safe-area-inset-left);
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  backdrop-filter: blur(24px) saturate(1.5);
  border-right: 1px solid var(--border);
  box-shadow: var(--sombra-3);
  transform: translateX(calc(-100% - 20px));
  transition: transform 0.4s var(--ease);
}
.pages-panel.abierto {
  transform: none;
}
.pp-cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 6px 18px;
}
.pp-titulo {
  font-weight: 650;
  font-size: 15px;
}
.pp-lista {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 18px 16px;
  display: grid;
  align-content: start;
  gap: 16px;
}
.pp-item {
  display: grid;
  gap: 6px;
}
.pp-hoja {
  display: block;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border-2), 0 10px 18px -12px rgba(10, 10, 11, 0.5);
  transition: box-shadow 0.2s, transform 0.25s var(--ease);
  justify-self: center;
}
.pp-hoja:active {
  transform: scale(0.97);
}
.pp-canvas {
  display: block;
  width: 150px;
  height: auto;
}
.pp-item.actual .pp-hoja {
  box-shadow: 0 0 0 2px var(--blue), 0 0 0 6px rgba(82, 113, 255, 0.16), 0 10px 18px -12px rgba(82, 113, 255, 0.6);
}
.pp-pie-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 0 4px;
}
.pp-num {
  font-size: 12.5px;
  font-weight: 620;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.pp-item.actual .pp-num {
  color: var(--blue);
}
.pp-pie {
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
.pp-nueva {
  width: 100%;
  color: var(--blue);
}

/* ================================================================ compartir */
.share {
  display: grid;
  gap: 18px;
}
.sh-resumen {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.sh-mini-wrap {
  position: relative;
  flex: none;
}
.sh-mini {
  display: block;
  width: 62px;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 0 0 1px var(--border-2), 0 6px 14px -8px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}
.sh-mini-hoja {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--border-2);
  transform: rotate(5deg) translate(4px, 1px);
}
.sh-resumen-txt {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}
.sh-resumen-txt strong {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sh-resumen-txt > span {
  font-size: 13px;
  color: var(--text-3);
}
.sh-info {
  color: var(--text-2) !important;
  font-weight: 520;
}
.sh-barra {
  height: 3px;
  border-radius: 3px;
  margin-top: 6px;
  background: var(--border);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s;
}
.sh-barra i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grad);
  transition: width 0.25s var(--ease);
}
.generando .sh-barra {
  opacity: 1;
}
.sh-bloque {
  display: grid;
  gap: 8px;
}
.sh-seg {
  justify-self: start;
}
.sh-rango {
  max-width: 220px;
}
.sh-switches {
  gap: 0;
  padding: 2px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.sh-switches .switch-fila + .switch-fila {
  border-top: 1px solid var(--border);
}
.sh-correo {
  padding: 16px;
  border-radius: 18px;
  background: var(--grad-suave), var(--surface);
  border: 1px solid rgba(82, 113, 255, 0.22);
}
.sh-correo-cab {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.sh-correo-cab div {
  display: grid;
}
.sh-correo-cab small {
  color: var(--text-3);
  font-size: 12.5px;
}
.sh-correo-ic {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--grad);
  color: #fff;
}
.sh-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -6px 0 14px;
}
.sh-chips .chip {
  height: 28px;
  font-size: 12.5px;
  padding: 0 10px;
}
.sh-msg {
  min-height: 90px;
}
.sh-copia {
  margin: -4px 0 12px;
}
.sh-mi {
  margin-top: 4px;
}
.sh-correo .btn.primario {
  width: 100%;
}
.sh-otros {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fallo {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

/* ================================================================ pantallas angostas */
@media (max-width: 760px) {
  .library {
    grid-template-columns: 1fr;
  }
  .lib-side {
    position: absolute;
    z-index: 20;
    top: 0;
    bottom: 0;
    left: 0;
    width: 282px;
    transform: translateX(-100%);
    transition: transform 0.4s var(--ease);
    box-shadow: var(--sombra-3);
  }
  .library.menu-abierto .lib-side {
    transform: none;
  }
  .library.menu-abierto .lib-fondo-velo {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgba(10, 10, 11, 0.25);
  }
  .lib-hamburguesa {
    display: inline-grid;
    margin-right: -6px;
  }
  .lib-cab {
    align-items: center;
  }
  .lib-main {
    padding-left: calc(20px + env(safe-area-inset-left));
    padding-right: calc(20px + env(safe-area-inset-right));
  }
  .lib-titulo {
    flex: 1;
  }
  .lib-acciones {
    width: 100%;
  }
  .lib-buscar,
  .lib-buscar:focus-within {
    flex: 1;
    width: auto;
  }
}
@media (max-width: 620px) {
  .lib-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 22px 16px;
  }
  .lib-acciones .btn span {
    display: none;
  }
  .lib-acciones .btn {
    width: 40px;
    padding: 0;
  }
  .ed-titulo-txt {
    max-width: 28vw;
  }
  .sh-otros {
    grid-template-columns: 1fr;
  }
  .dock {
    left: 10px;
    right: 10px;
    transform: none;
    max-width: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
