/* Reset y Estructura Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Cabecera Principal */
.navbar {
  height: 60px;
  background-color: var(--bg-toolbar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: white;
  font-size: 18px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-badge {
  background-color: rgba(59, 130, 246, 0.2);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.nav-tabs {
  display: flex;
  gap: 8px;
  background-color: var(--bg-app);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background-color: var(--primary);
  color: white;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
}

/* Contenedor de Vistas */
.main-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.view-container {
  display: none;
  height: 100%;
}

.view-container.active {
  display: flex;
}

/* ========================================================
   VISTA 1: ESTUDIO CALIGRÁFICO
   ======================================================== */
.studio-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

.studio-sidebar {
  width: 380px;
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-section {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-section h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--border-focus);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-container input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
}

.slider-value {
  width: 44px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-align: right;
}

.btn-primary {
  width: 100%;
  padding: 10px 16px;
  background-color: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  padding: 8px 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
}

/* Área de Texto y Editor */
.editor-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
  font-family: var(--font-sans);
}

/* Viewport del Lienzo A4 */
.studio-viewport {
  flex: 1;
  background-color: #0b1120;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: auto;
  padding: 40px;
}

.viewport-toolbar {
  position: absolute;
  top: 16px;
  display: flex;
  gap: 8px;
  background-color: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  z-index: 10;
}

.toolbar-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.toolbar-btn:hover {
  background-color: var(--bg-card-hover);
}

.canvas-shadow-wrapper {
  box-shadow: var(--shadow-xl);
  border-radius: 4px;
  overflow: hidden;
  background-color: white;
  display: inline-block;
}

#preview-canvas {
  display: block;
  max-height: calc(100vh - 180px);
  width: auto;
  object-fit: contain;
}

/* ========================================================
   VISTA 2: CLONADOR DE LIBRETA (SCANNER)
   ======================================================== */
.scanner-layout {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.scanner-left {
  width: 440px;
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.upload-dropzone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  background-color: rgba(15, 23, 42, 0.4);
  transition: all 0.2s ease;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--primary);
  background-color: rgba(37, 99, 235, 0.08);
}

.upload-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.biometrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.bio-card {
  background-color: var(--bg-app);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.bio-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.bio-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
  font-family: var(--font-mono);
}

.scanner-right {
  flex: 1;
  background-color: #0b1120;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}

.audit-img-wrapper {
  max-width: 95%;
  max-height: 90%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

#audit-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ========================================================
   VISTA 3: GESTOR DE LETRAS (LIBRARY)
   ======================================================== */
.library-layout {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
}

.library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.glyph-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px;
  padding-right: 6px;
}

.glyph-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s, border-color 0.2s;
}

.glyph-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
}

.glyph-thumb {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.glyph-thumb img {
  max-height: 100%;
  max-width: 100%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.glyph-char {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.glyph-variants {
  font-size: 11px;
  color: var(--text-muted);
}


/* ========================================================
   Utilidades (sustituyen a los antiguos style="" en línea: la CSP no permite estilos en línea)
   ======================================================== */
.hidden { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.muted { color: var(--text-muted); font-size: 13px; }
.hint { color: var(--text-muted); font-size: 12px; margin-top: 6px; }
.center { text-align: center; }
.mt-14 { margin-top: 14px; }
.btn-block { width: 100%; }
.btn-inline { width: auto; display: inline-flex; }
.panel-title { font-size: 18px; margin-bottom: 6px; }
.section-label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 10px; }
.page-indicator { font-size: 12px; font-weight: 600; padding: 4px 8px; }
.sidebar-grow { flex: 1; display: flex; flex-direction: column; }
.check-label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check-label a { color: var(--text-primary); }
.danger-text { color: var(--danger) !important; }
.warning-text { color: var(--warning) !important; }
.btn-link {
  background: none; border: none; padding: 0;
  color: var(--text-primary); font-size: inherit; cursor: pointer; text-decoration: underline;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-danger { background-color: var(--danger); }
.btn-danger:hover { background-color: #dc2626; }
.glyph-fallback { font-size: 24px; }
.audit-placeholder { color: var(--text-muted); font-size: 14px; text-align: center; padding: 60px; }
.dropzone-title { font-size: 14px; font-weight: 600; }

/* Cuenta */
.account-user { display: flex; align-items: center; gap: 10px; }
.account-name { font-size: 13px; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lock-icon { font-size: 11px; margin-left: 2px; }

.demo-banner {
  background: var(--warning-bg);
  color: var(--warning);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 13px;
  padding: 8px 24px;
  text-align: center;
  flex-shrink: 0;
}
.demo-banner .btn-link { color: var(--warning); font-weight: 600; }

/* Ventanas */
.modal {
  position: fixed; inset: 0;
  background: rgba(2, 6, 23, 0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
}
.modal-card {
  position: relative;
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xl);
  max-height: 92vh; overflow-y: auto;
}
.modal-card h2 { font-size: 18px; margin-bottom: 14px; }
.modal-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer;
}
.auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.auth-tab {
  flex: 1; padding: 8px; border-radius: var(--radius-sm);
  background: var(--bg-app); border: 1px solid var(--border-subtle);
  color: var(--text-muted); cursor: pointer; font-weight: 600;
}
.auth-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.auth-form .btn-primary { margin-top: 6px; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card); color: var(--text-main);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  padding: 10px 18px; font-size: 13px; box-shadow: var(--shadow-xl); z-index: 200;
  max-width: 90vw;
}
.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--danger); }

/* Paneles bloqueados sin sesión */
.locked-panel { width: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.locked-card {
  max-width: 460px; text-align: center;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 32px;
}
.locked-card h2 { font-size: 20px; margin-bottom: 8px; }
.locked-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 18px; }
.locked-icon { font-size: 36px; margin-bottom: 8px; }

/* ========================================================
   CREAR MI LETRA
   ======================================================== */
.create-layout { display: flex; width: 100%; height: 100%; overflow: hidden; }
.create-steps {
  width: 420px; flex-shrink: 0; overflow-y: auto;
  background: var(--bg-card); border-right: 1px solid var(--border-subtle);
  padding: 20px; display: flex; flex-direction: column; gap: 18px;
}
.step-card { border-bottom: 1px solid var(--border-subtle); padding-bottom: 18px; }
.step-card:last-child { border-bottom: none; }
.step-card h3 { font-size: 15px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.step-card .muted { margin-bottom: 12px; }
.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.group-checks { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.group-check {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  background: var(--bg-app);
}
.group-name { font-size: 13px; font-weight: 600; min-width: 92px; }
.group-sample { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tips { margin: 14px 0 0 18px; color: var(--text-muted); font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.upload-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.file-btn { cursor: pointer; position: relative; }
.upload-status { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.upload-line { color: var(--text-muted); }
.upload-line.ok { color: var(--success); }
.upload-line.error { color: var(--danger); }

.sheets-list { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; background: #0b1120; }
.sheet-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 16px; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 12px; }
.sheet-body { display: flex; gap: 16px; align-items: flex-start; }
.sheet-preview { width: 180px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); flex-shrink: 0; background: #fff; }
.cell-grid { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.cell-row { display: flex; align-items: center; gap: 6px; }
.cell-row-char { width: 26px; font-weight: 700; text-align: center; color: var(--text-muted); flex-shrink: 0; }
.cell-tile {
  width: 64px; height: 52px; flex-shrink: 0;
  background: #fbfbf8; border: 2px solid var(--success); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; padding: 2px; cursor: pointer;
}
.cell-tile img { max-width: 100%; max-height: 100%; }
.cell-tile.dudosa { border-color: var(--warning); }
.cell-tile.excluded { opacity: 0.25; border-style: dashed; border-color: var(--text-disabled); }
.cell-tile.empty { background: transparent; border: 1px dashed var(--border-subtle); cursor: default; }

/* Mis letras */
.library-actions { display: flex; gap: 10px; align-items: center; }
.library-select { width: 260px; }

/* ========================================================
   Móvil: todo en una columna con desplazamiento
   ======================================================== */
@media (max-width: 900px) {
  body { height: auto; min-height: 100vh; overflow: auto; }
  .navbar { height: auto; flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .nav-tabs { order: 3; width: 100%; overflow-x: auto; }
  .tab-btn { white-space: nowrap; padding: 6px 10px; }
  .status-indicator { display: none; }
  .main-content { overflow: visible; }
  .view-container.active { display: block; }
  .studio-layout, .scanner-layout, .create-layout { flex-direction: column; height: auto; }
  .studio-sidebar, .scanner-left, .create-steps { width: 100%; border-right: none; }
  .studio-viewport { padding: 56px 8px 16px; }
  #preview-canvas { max-height: none; width: 100%; height: auto; }
  .sheets-list { overflow: visible; padding: 12px; }
  .sheet-body { flex-direction: column; }
  .sheet-preview { width: 100%; max-width: 360px; }
  .cell-tile { width: 46px; height: 40px; }
  .library-layout { height: auto; }
  .library-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .library-actions { flex-direction: column; align-items: stretch; }
  .library-select { width: 100%; }
}

/* ========================================================
   Páginas, invitaciones y "Mi cuenta"
   ======================================================== */
.pages-pill {
  background: var(--success-bg); color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.35); border-radius: var(--radius-full);
  padding: 4px 12px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.pages-pill:hover { background: rgba(16, 185, 129, 0.2); }
.tab-btn { position: relative; }
.tab-dot {
  position: absolute; top: 4px; right: 4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--danger);
}
.verify-banner { background: var(--primary-light); color: var(--primary); border-bottom-color: var(--primary-border); }
.verify-banner .btn-link { color: var(--primary); font-weight: 600; }
.auth-info {
  background: var(--success-bg); color: var(--success);
  border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; margin-bottom: 12px;
}
.modal-subtitle { font-size: 14px; margin: 16px 0 6px; }
.rule-text { margin-bottom: 12px; }
.code-input { text-transform: uppercase; letter-spacing: 2px; font-family: var(--font-mono); }

.account-layout { width: 100%; height: 100%; overflow-y: auto; padding: 20px; }
.account-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px;
  max-width: 1100px; margin: 0 auto;
}
.account-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 18px; border-bottom: 1px solid var(--border-subtle);
}
.account-card-wide { grid-column: 1 / -1; }
.pages-big { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 10px; }
.pages-big span:first-child { font-size: 44px; font-weight: 800; color: var(--success); line-height: 1; }
.pages-big-unit { color: var(--text-muted); font-size: 14px; }
.pages-equiv {
  margin-left: 8px; padding: 2px 10px; border-radius: var(--radius-full);
  background: var(--primary-light); color: var(--primary); font-size: 14px; font-weight: 700;
}

.history-list, .checklist, .invitee-list, .document-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.history-list li, .invitee-list li {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border-subtle);
}
.history-date { color: var(--text-muted); font-size: 12px; }
.history-delta { font-weight: 700; font-family: var(--font-mono); min-width: 36px; text-align: right; }
.history-delta.plus { color: var(--success); }
.history-delta.minus { color: var(--text-muted); }

.checklist li { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 6px 0; }
.checklist li.done { color: var(--text-muted); text-decoration: line-through; }
.check-mark { width: 20px; text-align: center; color: var(--success); font-weight: 700; }
.checklist .btn-link { margin-left: auto; }

.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg-app); border: 1px dashed var(--primary-border); border-radius: var(--radius-md);
  padding: 10px 14px; margin-bottom: 12px;
}
.code-label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; }
.code-value { font-family: var(--font-mono); font-size: 22px; font-weight: 800; letter-spacing: 3px; color: var(--text-primary); }
.share-row { display: flex; gap: 8px; margin-bottom: 10px; }
.share-link { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12px; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn {
  display: inline-flex; align-items: center; padding: 7px 14px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600; color: #fff; text-decoration: none; border: none; cursor: pointer;
  background: var(--bg-card-hover);
}
.share-wa { background: #1fa855; }
.share-tg { background: #2a9fd8; }
.share-x { background: #111; border: 1px solid #333; }
.share-mail { background: #64748b; }
.share-native { background: var(--primary); }
.share-btn:hover { filter: brightness(1.1); }

.reward-progress { margin: 16px 0 6px; }
.progress-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.progress-bar { height: 8px; background: var(--bg-app); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--success), #34d399); transition: width 0.4s; }
.list-title { font-size: 13px; color: var(--text-muted); text-transform: uppercase; margin-top: 16px; }
.invitee-name { font-weight: 700; }
.invitee-status { font-size: 12px; text-align: right; }
.invitee-status.ok { color: var(--success); }
.invitee-status.pending { color: var(--warning); }
.invitee-status.wait { color: var(--text-muted); }

.redeem-form { display: flex; gap: 8px; }
.document-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border-subtle);
}
.document-info { display: flex; flex-direction: column; min-width: 0; }
.document-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

@media (max-width: 900px) {
  .account-layout { height: auto; padding: 12px; }
  .account-grid { grid-template-columns: 1fr; }
  .share-row { flex-direction: column; }
  .document-list li { flex-direction: column; align-items: flex-start; }
  .account-name { display: none; }
}

/* ========================================================
   Protección de la vista previa
   ======================================================== */
#preview-canvas {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;   /* sin menú de «guardar imagen» al mantener pulsado en el móvil */
}
.preview-shield {
  display: none;
  position: absolute; inset: 0; z-index: 20;
  align-items: center; justify-content: center;
  background: rgba(11, 17, 32, 0.55);
}
.preview-shield-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  max-width: 320px; padding: 22px; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border-subtle); color: var(--text-main);
  font-size: 13px;
}
.preview-shield-card strong { font-size: 16px; }
.preview-shield-card span { color: var(--text-muted); }
/* Sin transición: tiene que taparse en el mismo instante */
.preview-shielded .canvas-shadow-wrapper { filter: blur(28px) grayscale(1); }
.preview-shielded .preview-shield { display: flex; }

.print-notice { display: none; }
@media print {
  body { display: block; height: auto; overflow: visible; background: #fff; color: #000; }
  body > *:not(.print-notice) { display: none !important; }
  .print-notice { display: block !important; padding: 40px; font-family: var(--font-sans); }
  .print-notice h1 { font-size: 22px; margin-bottom: 12px; }
}
