:root {
  font-family: Georgia, 'Times New Roman', serif;
  color: #25231f;
  background: #202427;
  --paper: #f4f0e7;
  --paper-dark: #e7e1d5;
  --ink: #25231f;
  --muted: #79766f;
  --line: #d2cbc0;
  --rust: #a65032;
  --rust-dark: #743723;
  /* Lo que reserva cada panel lateral a la galería (js/side-panels.js): su ancho si va fijo, o el de su solapa (26 px) si está plegado. */
  --library-width: 290px;
  --deck-list-width: 290px;
  --deck-editor-width: 26px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #202427; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar { min-height: 82px; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 10px 28px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand-block, .toolbar-actions, .filterbar, .gallery-heading, .sidebar-heading, .pagination { display: flex; align-items: center; }
.brand-block { gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: #f8f0e5; background: var(--rust); border-radius: 50%; font-size: 25px; font-weight: bold; box-shadow: inset 0 0 0 3px #d58d68; }
.brand-block strong { display: block; font-size: 22px; letter-spacing: .02em; }
.brand-block span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-family: 'Segoe UI', sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.toolbar-actions { gap: 8px; }
.tool-button, .clear-button, .pagination button { border: 1px solid var(--line); color: var(--ink); background: transparent; padding: 9px 13px; border-radius: 4px; font-family: 'Segoe UI', sans-serif; font-size: 13px; }
.tool-button:hover, .clear-button:hover, .pagination button:hover:not(:disabled) { color: white; background: var(--rust); border-color: var(--rust); }
.filterbar { flex: 1; justify-content: center; min-width: 0; gap: 10px; flex-wrap: wrap; row-gap: 8px; font-family: 'Segoe UI', sans-serif; }
.filterbar label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.filterbar select, .search-field input { height: 34px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); background: #fffdf9; padding: 0 10px; outline: none; font-size: 12px; }
.filter-row-break { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; }
.stack-toggle { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: #625e58; background: #fffdf9; }
.stack-toggle .ic { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.stack-toggle:hover, .stack-toggle.active { color: white; background: #c9b89f; border-color: #c9b89f; }
.color-filters { display: flex; gap: 3px; }
.color-toggle { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; color: #625e58; background: #fffdf9; font-family: 'Segoe UI', sans-serif; font-size: 11px; font-weight: 700; }
.color-toggle:hover, .color-toggle.active { color: white; background: #c9b89f; border-color: #c9b89f; }
.color-toggle img { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; }
.gallery-area .pagination button { color: #eee7dd; border-color: #606568; background: #343a3d; }
.gallery-area .pagination button:hover:not(:disabled) { color: #fff7ee; background: var(--rust); border-color: var(--rust); }
.library-drawer .tool-button, .deck-editor-drawer .tool-button, .deck-list-drawer .tool-button { color: #eee7dd; border-color: #606568; background: #343a3d; }
.library-drawer .tool-button:hover, .deck-editor-drawer .tool-button:hover, .deck-list-drawer .tool-button:hover { color: #fff7ee; background: var(--rust); border-color: var(--rust); }
.search-field { display: flex; align-items: center; width: 230px; flex: 0 0 auto; padding: 0 6px 0 10px; border: 1px solid var(--line); border-radius: 3px; background: #fffdf9; }
.search-field input { width: 100%; border: 0; padding-left: 0; }
/* La «×» de la búsqueda: a la derecha del todo, solo cuando hay algo escrito. Se quita la que pone el navegador en los campos de búsqueda. */
.search-field input::-webkit-search-cancel-button { appearance: none; display: none; }
.search-clear { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 4px; padding: 0; border: 0; border-radius: 50%; color: #8d877d; background: transparent; cursor: pointer; }
.search-clear .ic { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.search-clear:hover { color: white; background: var(--rust); }
.search-clear[hidden] { display: none; }
.search-field:focus-within { border-color: var(--rust); box-shadow: 0 0 0 2px #a6503220; }
.advanced-filterbar { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; padding: 4px 28px 6px; border-top: 1px solid transparent; font-family: 'Segoe UI', sans-serif; }
.toggle-filter { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; cursor: pointer; }
.toggle-filter input { width: 15px; height: 15px; accent-color: var(--rust); cursor: pointer; }
.legality-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.legality-filter select { height: 34px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); background: #fffdf9; padding: 0 10px; outline: none; font-size: 12px; }

.size-controls { display: flex; gap: 4px; align-items: center; }
.size-button { min-width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 3px; color: #827b71; background: #fffdf9; font-family: 'Segoe UI', sans-serif; font-size: 10px; letter-spacing: -2px; }
.size-button:hover, .size-button.active { color: white; background: var(--rust); border-color: var(--rust); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr); margin-left: var(--library-width); margin-right: calc(var(--deck-list-width) + var(--deck-editor-width)); height: calc(100vh - var(--topbar-height, 82px)); min-height: 420px;}
.gallery-area { min-height: 0; overflow-y: auto; }
.sidebar-heading { justify-content: space-between; padding: 20px 20px 14px; margin-bottom: 10px; border-bottom: 1px solid #45494b; color: #c9b89f; font-family: 'Segoe UI', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.count, .result-count { color: #a9a59e; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.tree { padding: 0 10px 20px; font-family: 'Segoe UI', sans-serif; }
.tree-node { margin: 2px 0; }
.tree-button { width: 100%; display: flex; justify-content: space-between; gap: 8px; border: 0; border-radius: 3px; padding: 9px 10px; color: #dcd5c9; background: transparent; text-align: left; font-size: 13px; }
.tree-button:hover, .tree-button.active { color: white; background: #a6503233; }
.tree-button.collection { color: #f0e9dd; font-weight: 600; }
.set-list { display: none; margin-left: 14px; border-left: 1px solid #55595a; padding-left: 6px; }
.tree-node.open .set-list { display: block; }
.set-button { font-size: 12px; color: #aaa8a2; }
.loading-row, .gallery-empty { padding: 24px; color: var(--muted); font-family: 'Segoe UI', sans-serif; font-size: 13px; }
.gallery-area { min-width: 0; background: #202427; }
.gallery-heading { position: relative; justify-content: space-between; padding: 24px 28px 18px; color: #efe8dd; }
.eyebrow { color: #c98a6d; font-family: 'Segoe UI', sans-serif; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 4px 0 0; font-size: 27px; font-weight: 400; }
.active-deck-label { display: block; margin-top: 6px; color: #c98a6d; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.gallery { display: grid; grid-template-columns: repeat(var(--gallery-columns, 5), minmax(0, 1fr)); gap: 16px; padding: 0 28px 28px; }
/* Galería en automático (U.19): el hueco de la barra de desplazamiento se reserva siempre. Sin él, que aparezca o desaparezca cambiaría el
   ancho útil y con él las columnas, y el cálculo se repetiría sin fin. */
.gallery-area.auto-fit { scrollbar-gutter: stable; }
.settings-check { display: flex; align-items: center; gap: 8px; padding: 0 20px; font-family: 'Segoe UI', sans-serif; font-size: 13px; cursor: pointer; }
.settings-grid label.settings-check { flex-direction: row; align-items: center; align-self: end; gap: 8px; min-height: 36px; padding: 0; }
.settings-grid label.settings-check input { padding: 0; }
.settings-grid .settings-note { grid-column: 1 / -1; margin-top: -4px; }
.settings-note { align-self: end; color: #8d877d; font-family: 'Segoe UI', sans-serif; font-size: 11px; }
.settings-grid input:disabled { opacity: .45; cursor: not-allowed; }
.gallery-area.size-compact { --card-width: 180px; }
.gallery-area.size-comfortable { --card-width: 230px; }
.gallery-area.size-large { --card-width: 310px; }
.card-tile { overflow: hidden; border: 1px solid #4a4e50; border-radius: 6px; background: #2d3235; box-shadow: 0 8px 18px #111a2a55; transition: transform .16s ease, border-color .16s ease; }
.card-tile[draggable="true"] { cursor: grab; }
.card-tile[draggable="true"]:active { cursor: grabbing; }
.card-tile:hover { transform: translateY(-3px); border-color: #bd7556; }
.card-tile img { display: block; width: 100%; aspect-ratio: 0.715; object-fit: cover; background: #3b4042; }
.card-tile { position: relative; }
.flip-card-button { position: absolute; right: 8px; bottom: 58px; z-index: 2; width: 32px; height: 32px; border: 1px solid #d2cbc0; border-radius: 50%; color: #fff7ee; background: #292d30cc; font-size: 20px; line-height: 1; }
.card-info { min-height: 65px; padding: 9px 11px 11px; color: #eee7dd; font-family: 'Segoe UI', sans-serif; }
.card-name { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; color: #aaa8a2; font-size: 11px; }
.pagination { justify-content: center; gap: 18px; padding: 8px 28px 28px; color: #c8c3bb; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.pagination button:disabled { cursor: default; opacity: .35; }
.gallery-heading > .compact-pagination { position: absolute; top: 50%; left: 50%; gap: 18px; padding: 0; transform: translate(-50%, -50%); }
.compact-pagination button { min-width: 30px; padding: 5px 8px; }
/* La carta del detalle mide lo que cabe en la ventana: como mucho su tamaño real (744×1039) y como poco 710 px de alto. Con una ventana alta
   nada cambia; con una baja la carta, el diálogo y los cuadros de texto se encogen juntos en vez de sacar scroll. 82 px = los 24 px de margen
   del diálogo, sus 2 de borde y los 28 px de relleno de arriba y de abajo. Los 736 px son el resto del ancho (flechas, huecos y propiedades).
   Los 710 px de mínimo son lo que necesita el panel «Básico» con sus dos textos a su altura mínima (medido): por debajo se solaparía con lo
   que va debajo, así que con ventanas de menos de ~790 px de alto se vuelve al scroll del diálogo. */
.card-detail-dialog { --detail-h: clamp(710px, calc(100vh - 82px), 1039px); --detail-w: calc(var(--detail-h) * 744 / 1039); width: min(98vw, calc(var(--detail-w) + 736px)); max-width: none; max-height: calc(100vh - 24px); overflow: auto; padding: 0; border: 1px solid #55595a; color: #eee7dd; background: #292d30; box-shadow: 0 18px 70px #000b; }
.card-detail-dialog::backdrop { background: #111820cc; }
.card-detail-shell { position: relative; display: grid; grid-template-columns: 48px var(--detail-w) minmax(460px, 1fr) 48px; gap: 22px; min-height: calc(var(--detail-h) + 56px); padding: 28px; }
.card-detail-close { position: absolute; top: 10px; right: 12px; }
.card-nav { align-self: center; border: 0; color: #f0dfd1; background: transparent; font-size: 58px; line-height: 1; }
.card-nav:disabled { cursor: default; opacity: .25; }
.card-detail-image { position: relative; }
.card-detail-image img { display: block; width: var(--detail-w); height: var(--detail-h); object-fit: contain; border-radius: 8px; box-shadow: 0 12px 30px #0008; }
.card-detail-properties { display: flex; flex-direction: column; gap: 10px; min-width: 460px; padding: 12px 14px; }
.card-detail-properties h2 { margin: 4px 0 10px; font-size: 24px; font-weight: 400; }
.detail-quality { margin: 0 0 12px; color: #c9b89f; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.card-detail-properties label { display: flex; flex-direction: column; gap: 5px; color: #c9b89f; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.card-detail-properties input, .card-detail-properties textarea { border: 1px solid #55595a; border-radius: 3px; color: #eee7dd; background: #202427; padding: 8px; resize: vertical; }
.toast { position: fixed; right: 320px; bottom: 20px; z-index: 100; display: none; padding: 12px 16px; border-left: 3px solid var(--rust); color: #f3e9dd; background: #343a3d; box-shadow: 0 8px 24px #0005; font-family: 'Segoe UI', sans-serif; font-size: 13px; }
.toast.visible { display: block; }
/* Acceso, cuenta y bloqueo de la aplicación sin sesión. */
body.session-locked .topbar, body.session-locked .workspace, body.session-locked .library-drawer, body.session-locked .deck-list-drawer, body.session-locked .deck-editor-drawer, body.session-locked .stack-panel { visibility: hidden; }
.access-dialog { width: min(400px, 94vw); }
.access-dialog .import-dialog-content { padding-bottom: 20px; }
.access-dialog::backdrop { background: #111820f2; }
.access-error { min-height: 1.2em; margin: 0 20px; color: #f0a48f; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.access-intro { margin: 0 20px; color: #c9b89f; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.access-secondary { background: transparent; border-color: #55595a; color: #c9b89f; }
.access-dialog [hidden] { display: none !important; } /* `.import-dialog-content label { display: flex }` anula el atributo hidden de las etiquetas */
/* Segundo factor (activar, códigos de recuperación, gestionar). Cada paso es un bloque con su propio espaciado: nada depende de los márgenes de `.import-action`. */
/* `.import-dialog` (más abajo en este fichero, misma especificidad) fija 460 px y ganaría por orden: se compone con la clase propia para que el ancho no dependa de dónde esté cada regla. */
.import-dialog.mfa-dialog { width: min(640px, 96vw); }
.mfa-step { display: flex; flex-direction: column; gap: 14px; padding: 4px 20px 4px; font-family: 'Segoe UI', sans-serif; }
.mfa-lead, .mfa-hint { margin: 0; color: #c9b89f; font-size: 12px; line-height: 1.45; }
.mfa-hint { color: #9a9185; font-size: 11px; }
.mfa-scan { display: grid; grid-template-columns: 216px 1fr; gap: 20px; align-items: start; }
.mfa-qr { display: block; width: 200px; height: 200px; padding: 8px; box-sizing: content-box; border-radius: 3px; background: #fff; image-rendering: pixelated; }
.mfa-scan-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mfa-block { display: flex; flex-direction: column; gap: 6px; }
.mfa-label { color: #9a9185; font-size: 11px; }
/* Con `label` delante: `.import-dialog-content label` (padding 0 20px) tiene más especificidad y sangraba el campo respecto al resto del bloque. */
.import-dialog-content label.mfa-field { display: flex; flex-direction: column; gap: 6px; padding: 0; color: #c9b89f; font-size: 12px; }
.mfa-error { min-height: 1.2em; margin: -4px 0 0; color: #f0a48f; font-size: 12px; }
/* Clic para copiar, como el id de la carta en el detalle (`.detail-id`): cursor de copiar, y un parpadeo de color al copiar. */
.mfa-copy { margin: 0; border: 1px solid #3a3f42; border-radius: 3px; padding: 9px 10px; color: #eee7dd; background: #101315; font: 13px Consolas, monospace; letter-spacing: 0.08em; text-align: left; word-break: break-all; cursor: copy; }
.mfa-copy:hover { border-color: #c9b89f; }
.mfa-copy.copied { color: #1d2022; background: #c9b89f; border-color: #c9b89f; }
.mfa-codes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mfa-code-item { margin: 0; border: 1px solid #3a3f42; border-radius: 3px; padding: 9px 10px; color: #eee7dd; background: #101315; font: 15px Consolas, monospace; letter-spacing: 0.06em; text-align: center; cursor: copy; }
.mfa-code-item:hover { border-color: #c9b89f; }
.mfa-code-item.copied { color: #1d2022; background: #c9b89f; border-color: #c9b89f; }
.mfa-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mfa-actions .import-action { margin: 0; flex: 1 1 140px; }
/* La casilla va a la IZQUIERDA de su texto y alineada con él: `.import-dialog-content label` pone las etiquetas en columna, de ahí que quedara encima y centrada. */
.import-dialog-content label.mfa-saved { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 0; color: #c9b89f; font-size: 13px; cursor: pointer; }
.mfa-saved input { width: 16px; height: 16px; margin: 0; padding: 0; flex: none; }
.mfa-dialog .mfa-step[hidden] { display: none !important; }
@media (max-width: 560px) { .mfa-scan { grid-template-columns: 1fr; justify-items: center; } .mfa-scan-side { width: 100%; } }
/* Diálogo propio de confirmación y de pregunta (en lugar de window.confirm y window.prompt). El mensaje respeta los saltos de línea. */
/* Tutoriales de primera vez (js/tutorial.js): la capa tapa la página, un marco resalta lo señalado (su sombra enorme oscurece el resto) y la
   burbuja lleva una flecha hacia ello. Mismos colores que el resto de diálogos. */
.tutorial-layer { position: fixed; inset: 0; z-index: 10000; font-family: 'Segoe UI', sans-serif; }
.tutorial-layer.centered { background: #111820c0; }
.tutorial-spot { position: fixed; border-radius: 6px; outline: 2px solid #c9b89f; box-shadow: 0 0 0 9999px #111820c0; pointer-events: none; }
.tutorial-spot[hidden], .tutorial-arrow[hidden], .tutorial-back[hidden] { display: none; }
.tutorial-bubble { position: fixed; width: 340px; max-width: calc(100vw - 24px); box-sizing: border-box; padding: 14px 16px; border: 1px solid #55595a; border-radius: 8px; color: #eee7dd; background: #292d30; box-shadow: 0 12px 40px #000b; }
.tutorial-title { display: block; margin-bottom: 6px; font-size: 15px; }
.tutorial-text p { margin: 0 0 6px; font-size: 13px; line-height: 1.45; }
.tutorial-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.tutorial-count { flex: 1; color: #a79d90; font-size: 12px; }
.tutorial-actions button { padding: 6px 12px; border: 1px solid #606568; border-radius: 4px; color: #eee7dd; background: #343a3d; font-size: 12px; cursor: pointer; }
.tutorial-actions button:hover { border-color: #a65032; }
.tutorial-actions .tutorial-skip { border-color: transparent; background: transparent; color: #a79d90; }
.tutorial-actions .tutorial-next { border-color: #a65032; background: #a65032; color: #fff7ee; }
.tutorial-actions .tutorial-next:hover { background: #bc5c3a; }
.tutorial-arrow { position: absolute; width: 11px; height: 11px; box-sizing: border-box; border: 1px solid #55595a; background: #292d30; transform: rotate(45deg); }
.tutorial-bubble[data-side='bottom'] .tutorial-arrow { top: -7px; border-width: 1px 0 0 1px; }
.tutorial-bubble[data-side='top'] .tutorial-arrow { bottom: -7px; border-width: 0 1px 1px 0; }
.tutorial-bubble[data-side='right'] .tutorial-arrow { left: -7px; border-width: 0 0 1px 1px; }
.tutorial-bubble[data-side='left'] .tutorial-arrow { right: -7px; border-width: 1px 1px 0 0; }
.confirm-dialog { width: min(480px, 94vw); }
.confirm-dialog::backdrop { background: #111820e6; }
.confirm-message { margin: 0 20px; color: #eee7dd; font-family: 'Segoe UI', sans-serif; font-size: 13px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; max-height: 50vh; overflow-y: auto; }
.confirm-field[hidden] { display: none; } /* el display: flex de `.import-dialog-content label` anularía hidden */
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 4px 20px 0; }
.confirm-actions .import-action { margin: 0; min-width: 96px; }
.confirm-dialog.danger #confirm-ok { background: #b3402a; border-color: #b3402a; }
.confirm-dialog.danger #confirm-ok:hover:not(:disabled) { background: #cc4a31; }
.confirm-dialog.danger .eyebrow { color: #e0907a; }
.confirm-actions .import-action:disabled { opacity: 0.45; cursor: not-allowed; }
.confirm-actions .import-action:focus-visible { outline: 2px solid #f3c3a9; outline-offset: 2px; }
.sessions-dialog { width: min(560px, 96vw); }
.sessions-list { list-style: none; margin: 0 20px 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.sessions-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #3c4144; border-radius: 4px; font-family: 'Segoe UI', sans-serif; font-size: 13px; color: #eee7dd; background: #202427; }
.sessions-item.current { border-color: #a65032; }
.sessions-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sessions-text strong { font-weight: 600; }
.sessions-text small { color: #a9a090; font-size: 12px; overflow-wrap: anywhere; }
.sessions-item button { border: 1px solid #55595a; border-radius: 3px; color: #eee7dd; background: transparent; padding: 5px 10px; font-family: inherit; font-size: 12px; cursor: pointer; }
.sessions-item button:hover:not(:disabled) { border-color: #a65032; background: #a6503233; }
.sessions-item button:disabled { opacity: 0.5; cursor: default; }
.sessions-dialog > .import-dialog-content > .import-action { margin: 0 20px 20px; width: calc(100% - 40px); }
.account-wrap, .import-wrap { position: relative; }
.import-wrap[hidden] { display: none; }
.import-menu { min-width: 190px; }
.import-menu button[hidden] { display: none; }
/* Menú que recoge los botones de acción cuando los filtros no caben en dos filas (js/bar-fold.js). Con la barra plegada, «Importar» queda vacío:
   sus tres opciones están en este menú. */
.actions-wrap { position: relative; }
.actions-wrap[hidden] { display: none; }
.actions-menu { min-width: 210px; }
.actions-menu button[hidden] { display: none; }
.actions-menu .tool-button { width: auto; height: auto; justify-content: flex-start; border: 0; border-radius: 0; color: #eee7dd; background: transparent; padding: 8px 10px; font-size: 12px; }
.actions-menu .tool-button:hover { color: #fff7ee; background: #a6503233; }
.bar-folded #import-wrap { display: none; }
/* Plegar más: lo que se encoge es la marca, nunca los filtros (1280 px es el ancho mínimo que se soporta). */
.bar-compact { gap: 16px; }
.bar-compact .brand-block span { display: none; }
.bar-mini .brand-block > div:not(.brand-mark) { display: none; }
.account-button small { margin-left: 4px; color: #79766f; font-size: 11px; }
.account-button:hover small { color: #fff7ee; }
.account-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 90; display: flex; flex-direction: column; min-width: 170px; padding: 5px; border: 1px solid #55595a; border-radius: 4px; background: #292d30; box-shadow: 0 8px 24px #0008; }
.account-menu[hidden] { display: none; }
.account-menu button { border: 0; padding: 8px 10px; color: #eee7dd; background: transparent; text-align: left; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.account-menu button:hover { background: #a6503233; }
.context-menu { position: fixed; z-index: 80; display: none; min-width: 130px; padding: 5px; border: 1px solid #55595a; border-radius: 4px; background: #292d30; box-shadow: 0 8px 24px #0008; }
.context-menu.visible { display: flex; flex-direction: column; }
.context-menu button { border: 0; padding: 8px 10px; color: #eee7dd; background: transparent; text-align: left; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.context-menu button:hover { background: #a6503233; }
.import-dialog { width: min(460px, 92vw); padding: 0; border: 1px solid #55595a; color: #eee7dd; background: #292d30; box-shadow: 0 18px 60px #000b; accent-color: var(--rust); /* casillas y deslizadores con el color del tema, no el azul del navegador */ }
.import-dialog::backdrop { background: #111820aa; }
.import-dialog-content { display: flex; flex-direction: column; gap: 12px; }
.import-dialog-content label { display: flex; flex-direction: column; gap: 6px; padding: 0 20px; color: #c9b89f; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.import-dialog-content input { border: 1px solid #55595a; border-radius: 3px; color: #eee7dd; background: #202427; padding: 9px; }
.import-action { margin: 0 20px; border: 1px solid #a65032; border-radius: 3px; color: #fff7ee; background: #a65032; padding: 10px; font-family: 'Segoe UI', sans-serif; }
.import-divider { padding: 6px 20px; color: #c98a6d; font-family: 'Segoe UI', sans-serif; font-size: 11px; letter-spacing: .12em; text-align: center; text-transform: uppercase; }
.import-status { min-height: 20px; margin: 0 20px 18px; color: #d8d1c5; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.import-progress { width: calc(100% - 40px); height: 7px; margin: 0 20px; accent-color: var(--rust); }
.gatherer-current-card { min-height: 20px; margin: 0 20px 20px; color: #f0c4aa; font-family: 'Segoe UI', sans-serif; font-size: 13px; }
.gatherer-counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 20px 20px; color: #c9b89f; font-family: 'Segoe UI', sans-serif; font-size: 12px; text-align: center; }
.gatherer-counters div { padding: 8px 4px; border: 1px solid #45494b; border-radius: 3px; }
.gatherer-counters strong { display: block; margin-top: 3px; color: #f0c4aa; font-size: 18px; }
/* Opciones del PDF: los selectores cortos van de dos en dos y las casillas en dos columnas, para que la ventana no sea tan larga. */
.pdf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 20px; }
.pdf-row > label { padding: 0; min-width: 0; }
.pdf-row select { min-width: 0; width: 100%; }
.pdf-checks { gap: 10px 12px; }
.pdf-checks .scry-check { align-items: flex-start; line-height: 1.3; }
.pdf-checks .scry-check input { flex: 0 0 15px; margin: 1px 0 0; }
.pdf-back-arts { display: flex; gap: 8px; overflow-x: auto; padding: 4px 20px 10px; }
.pdf-back-art { flex: 0 0 56px; height: 78px; padding: 2px; border: 2px solid transparent; background: #202427; }
.pdf-back-art.selected { border-color: #d58d68; }
.pdf-back-art img { width: 100%; height: 100%; object-fit: cover; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 20px; }
.settings-grid label { padding: 0; }
.settings-language-heading, .bulk-date { padding: 0 20px; color: #c9b89f; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.language-options { display: flex; flex-direction: column; gap: 5px; padding: 0 20px; }
.language-option { display: grid; grid-template-columns: 1fr 24px 28px 28px; align-items: center; gap: 4px; color: #eee7dd; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.language-option label { display: flex; flex-direction: row; align-items: center; gap: 7px; padding: 0; }
.language-order { color: #c98a6d; text-align: center; }
.language-move { border: 0; color: #eee7dd; background: #45494b; }
/* Paneles laterales (U.19, fase 2, js/side-panels.js): la Biblioteca a la izquierda y los Mazos y el Editor de mazos a la derecha. Fijos (sin
   `.floating`) reservan su ancho; plegados (`.collapsed`) dejan a la vista una solapa de 26 px y se despliegan (`.peek`) al acercar el ratón. El editor
   va DEBAJO de la lista (z-index menor): sale y se esconde por detrás de ella. Sin mazo abierto (`.empty`) deja la solapa, sin desplegarse. */
.library-drawer, .deck-list-drawer, .deck-editor-drawer { position: fixed; z-index: 10; top: var(--topbar-height, 82px); bottom: 0; overflow-y: auto; color: #eee7dd; background: #292d30; border-left: 1px solid #55595a; box-shadow: -12px 0 30px #10141699; transition: transform .22s ease; font-family: 'Segoe UI', sans-serif; }
.library-drawer { left: 0; width: 290px; color: #ece6db; border-left: 0; border-right: 1px solid #55595a; box-shadow: 12px 0 30px #10141699; }
.deck-list-drawer { right: 0; width: 290px; }
.deck-editor-drawer { right: var(--deck-list-width); z-index: 9; width: min(430px, 48vw); }
/* La Biblioteca y los Mazos son una columna: la cabecera (título y chincheta) queda FIJA arriba y solo la lista se desplaza, así la chincheta se alcanza aunque estés
   muy abajo. (El Editor de mazos no: allí se desplaza todo el panel.) */
.library-drawer, .deck-list-drawer { display: flex; flex-direction: column; overflow: hidden; }
.library-drawer > .sidebar-heading, .deck-list-drawer > .drawer-header { flex: none; }
.library-drawer > .tree, .deck-list-drawer > .deck-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
/* La barra de desplazamiento de la Biblioteca va a la IZQUIERDA (`direction: rtl` la cambia de lado; el contenido vuelve a `ltr`): plegada, solo asoma la franja derecha de
   26 px y, con la barra a la derecha, se comía la solapa. */
.library-drawer > .tree { direction: rtl; }
.library-drawer > .tree > * { direction: ltr; }
/* La solapa de estos dos paneles va fija sobre su franja visible (ya no hay scroll dentro del panel que la arrastre, como en el editor). */
.library-drawer.collapsed > .panel-edge, .deck-list-drawer.collapsed > .panel-edge { position: absolute; top: 0; bottom: 0; height: auto; margin: 0; }
.library-drawer.collapsed > .panel-edge { right: 0; left: auto; }
.deck-list-drawer.collapsed > .panel-edge { left: 0; right: auto; }
.library-drawer.collapsed { transform: translateX(calc(26px - 100%)); }
.deck-list-drawer.collapsed, .deck-editor-drawer.collapsed { transform: translateX(calc(100% - 26px)); }
.floating.peek { transform: translateX(0); }
.library-drawer.floating.peek, .deck-list-drawer.floating.peek { z-index: 11; }
/* La solapa. Es `sticky` y de la altura del panel, con margen inferior negativo para no ocupar sitio: así sigue a la vista aunque el contenido se haya
   desplazado antes de plegarse (un `absolute` dentro de un contenedor con scroll se iría con el contenido). */
.panel-edge { display: none; }
.collapsed > .panel-edge { display: flex; position: sticky; top: 0; z-index: 2; box-sizing: border-box; width: 26px; height: calc(100vh - var(--topbar-height, 82px)); margin-bottom: calc(var(--topbar-height, 82px) - 100vh); flex-direction: column; align-items: center; gap: 12px; padding-top: 18px; color: #c9b89f; background: #343a3d; border-right: 1px solid #45494b; cursor: pointer; }
.library-drawer.collapsed > .panel-edge { border-right: 0; border-left: 1px solid #45494b; }
.collapsed.empty > .panel-edge { cursor: default; }
.panel-edge .ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.panel-edge span { writing-mode: vertical-rl; font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.collapsed:not(.empty) > .panel-edge:hover { color: #fff7ee; background: var(--rust); }
body.panels-init .library-drawer, body.panels-init .deck-list-drawer, body.panels-init .deck-editor-drawer { transition: none; }
/* La chincheta de cada panel: junto al título (en el editor, junto a la ×, que sigue fija en la esquina). */
.panel-pin { flex: none; margin-left: 8px; }
.library-drawer .sidebar-heading .count { margin-left: auto; }
.deck-pin { position: absolute; top: 14px; right: 54px; margin-left: 0; }
.panel-pin[aria-pressed='true'], .deck-pin[aria-pressed='true'] { color: #fff7ee; background: var(--rust); border-color: var(--rust); }
.panel-pin:disabled, .deck-pin:disabled { opacity: .45; cursor: not-allowed; }
.deck-editor-column { min-width: 0; min-height: 100%; }
.deck-editor-column { border-right: 1px solid #45494b; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 16px; border-bottom: 1px solid #45494b; }
.drawer-header h2 { margin: 0; color: #c9b89f; font-family: 'Segoe UI', sans-serif; font-size: 16px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.icon-button { border: 0; color: #d8d1c5; background: transparent; font-size: 28px; line-height: 1; }
.import-dialog-content select { border: 1px solid #55595a; border-radius: 3px; color: #eee7dd; background: #202427; padding: 9px; }
.import-hint { margin: 0 20px; color: #8d877d; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.import-hint code { color: #c9b89f; }
.import-status.error { color: #e0907a; }
.deck-import-progress { display: flex; align-items: center; gap: 10px; margin: 0 20px; }
.deck-import-progress[hidden] { display: none; }
.deck-import-progress .import-progress { flex: 1; width: auto; height: 10px; margin: 0; }
.deck-import-percent { min-width: 38px; color: #c9b89f; font-family: 'Segoe UI', sans-serif; font-size: 12px; text-align: right; }
.new-deck-form { display: flex; gap: 8px; padding: 14px 18px; border-bottom: 1px solid #45494b; }
.new-deck-form input { min-width: 0; flex: 1; border: 1px solid #55595a; border-radius: 3px; color: #eee7dd; background: #202427; padding: 9px; }
.new-deck-form button, .deck-editor button { border: 1px solid #a65032; border-radius: 3px; color: #fff7ee; background: #a65032; padding: 8px 11px; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.deck-list { padding: 10px 12px; border-bottom: 1px solid #45494b; }
.deck-choice { width: 100%; display: flex; justify-content: space-between; gap: 8px; border: 0; border-radius: 3px; padding: 10px; color: #ddd5c8; background: transparent; text-align: left; font-family: 'Segoe UI', sans-serif; }
.deck-choice:hover, .deck-choice.active { color: white; background: #a6503233; }
.deck-folder-node .set-list { margin-left: 12px; }
.deck-node .deck-choice { padding-left: 16px; }
.deck-editor { min-height: calc(100% - 86px); margin: 16px 12px; padding: 16px 6px; border: 1px dashed #68615a; border-radius: 4px; }
.deck-drop-section { margin: 8px 0; padding: 8px; border: 1px dashed transparent; border-radius: 4px; }
.deck-drop-section.drop-active { border-color: #d58d68; background: #a650321c; }
.deck-editor h3 { margin: 0 0 12px; font-size: 18px; font-weight: 400; }
.deck-card-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 5px 0; padding: 6px; border: 1px solid #45494b; border-radius: 3px; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.deck-card-row img { width: 38px; aspect-ratio: .715; object-fit: cover; }
.deck-card-row[draggable="true"] { cursor: grab; }
.deck-card-row[draggable="true"]:active { cursor: grabbing; }
.deck-card-preview { position: relative; display: block; width: 38px; height: 53px; }
.deck-card-preview .card-tooltip { position: absolute; z-index: 20; top: 50%; left: 48px; display: none; width: 230px; transform: translateY(-50%); pointer-events: none; filter: drop-shadow(0 10px 18px #000b); }
.deck-card-preview .card-tooltip img { width: 230px; height: auto; border-radius: 6px; }
.deck-card-preview:hover .card-tooltip { display: block; }
.deck-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-card-row button { border: 0; padding: 2px 7px; color: #eee7dd; background: #45494b; }
.quantity-controls { display: inline-flex; align-items: center; gap: 4px; }
.quantity-controls strong { min-width: 18px; color: #f3c3a9; text-align: center; }
.sideboard-button { grid-column: 2 / -1; justify-self: end; color: #c9b89f !important; background: transparent !important; font-size: 11px; }
.deck-section-label { margin: 16px 0 6px; color: #c98a6d; font-family: 'Segoe UI', sans-serif; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
@media (max-width: 760px) {
  .topbar { height: auto; min-height: 72px; padding: 14px 16px; }
  .brand-block strong { font-size: 18px; }
  .tool-button span { display: none; }
  .topbar { flex-wrap: wrap; padding: 12px 16px; }
  .filterbar { order: 3; flex-basis: 100%; align-items: stretch; flex-wrap: wrap; gap: 8px; }
  .search-field { flex-basis: 100%; width: auto; }
  .library-drawer, .deck-list-drawer { width: min(320px, 86vw); }
  .deck-editor-drawer { width: min(390px, 94vw); }
  .gallery-heading { padding: 20px 16px 14px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 16px 20px; }
  .card-info { min-height: 58px; padding: 7px; }
  h1 { font-size: 22px; }
  .gallery-heading > .compact-pagination { position: static; transform: none; }
  .card-detail-shell { grid-template-columns: 34px minmax(150px, 1fr) 34px; gap: 8px; min-height: 0; padding: 34px 8px 12px; }
  .card-detail-properties { grid-column: 1 / -1; min-width: 0; }
  .card-detail-image { grid-column: 2; }
  .card-detail-image img { width: 100%; height: auto; }
  .card-nav-previous { grid-column: 1; grid-row: 1; }
  .card-nav-next { grid-column: 3; grid-row: 1; }
}
.card-stack-badge { position: absolute; left: 8px; bottom: 58px; z-index: 2; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid #d2cbc0; border-radius: 50%; color: #fff7ee; background: #292d30cc; font-family: 'Segoe UI', sans-serif; font-size: 13px; font-weight: 700; line-height: 1; }
#detail-stack-badge, #detail-flip-button { bottom: 16px; width: 72px; height: 72px; border-width: 2px; box-shadow: 0 4px 12px #0008; }
#detail-stack-badge { left: 18px; font-size: 32px; }
#detail-flip-button { right: 18px; display: flex; align-items: center; justify-content: center; font-size: 44px; }
#detail-flip-button[hidden], #detail-stack-badge[hidden] { display: none; }
.stack-panel { position: fixed; max-width: 1280px; max-height: calc(100vh - 24px); z-index: 1000; overflow: auto; overflow-y: auto; border: 1px solid #55595a; border-radius: 8px; background: var(--paper); box-shadow: 0 18px 40px #000c; }
.stack-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px solid #45494b; background: #292d30;}
.stack-panel-content { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; padding: 16px; }
.stack-card { display: flex; gap: 10px; padding: 8px; border: 1px solid #45494b; border-radius: 6px; cursor: grab; }
.stack-card img { width: 70px; height: auto;}
.stack-card:hover { border-color: #a65032; }
#stack-panel-title { color: #eee7dd; font-family: 'Segoe UI', sans-serif; font-weight: 600; font-size: 14px; }

/* Detalle de carta: aprovechamiento del espacio */
.card-detail-properties { min-height: 0; }
.card-detail-properties .detail-row { display: flex; gap: 10px; }
.card-detail-properties .detail-row > label { flex: 1 1 0; min-width: 0; }
.card-detail-properties .detail-row > label.detail-narrow { flex: 0 0 150px; }
.card-detail-properties .detail-text-field { flex: 1 1 0; min-height: 84px; }
.card-detail-properties .detail-text-field textarea { flex: 1 1 auto; min-height: 64px; resize: none; font-family: 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.45; }
.card-detail-properties .detail-row > .detail-mana { flex: 0 0 150px; min-width: 0; }
.card-detail-properties .detail-mana { display: flex; flex-direction: column; gap: 5px; color: #c9b89f; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.card-detail-properties .detail-mana > .mana-cost { display: flex; flex-wrap: wrap; align-content: center; align-items: center; gap: 2px; min-height: 35px; padding: 4px 6px; border: 1px solid #55595a; border-radius: 3px; background: #25292c; }
.mana-cost .mana-symbol { width: 22px; height: 22px; display: block; }
.mana-cost .mana-symbol-text { color: #eee7dd; font-size: 13px; }
.card-detail-properties .detail-flags-row { align-items: flex-end; }
.card-detail-properties .detail-flags-row > label.detail-check { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 6px; padding-bottom: 9px; font-size: 14px; cursor: pointer; }
.card-detail-properties .detail-check input { width: 16px; height: 16px; padding: 0; accent-color: #c9b89f; cursor: pointer; }
.card-detail-properties input[readonly] { color: #c9b89f; background: #25292c; cursor: default; }
.detail-legality { display: flex; flex-direction: column; gap: 6px; color: #c9b89f; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.detail-legality-list { display: flex; flex-wrap: wrap; gap: 5px; max-height: 96px; overflow-y: auto; }
.detail-legality-list .legal-chip { padding: 3px 9px; border: 1px solid #55595a; border-radius: 11px; color: #eee7dd; background: #202427; font-size: 11px; }
.detail-legality-list .legal-none { color: #8d877d; font-style: italic; }

/* Ventana de importacion de Scryfall */
.scryfall-dialog { width: min(520px, 94vw); }
.scryfall-dialog .import-dialog-content { gap: 0; padding-bottom: 20px; font-family: 'Segoe UI', sans-serif; }
.scry-step { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 0; }
.scry-step-title { display: flex; align-items: center; gap: 10px; color: #eee7dd; font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.scry-step-number { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff7ee; background: var(--rust); font-size: 12px; font-weight: 700; }
.scry-bulk-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid #45494b; border-radius: 4px; background: #202427; }
.scry-bulk-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.scry-bulk-info .bulk-date { margin: 0; padding: 0; color: #c9b89f; font-size: 12px; line-height: 1.4; }
.scry-badge { align-self: flex-start; padding: 2px 9px; border-radius: 10px; color: #eee7dd; background: #45494b; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.scry-badge.is-ok { color: #cfe8c9; background: #35523a; }
.scry-badge.is-stale { color: #f5dfb0; background: #6b5527; }
.scry-badge.is-missing { color: #f3c6b6; background: #70372a; }
.scry-file-button { flex: 0 0 auto; padding: 8px 12px !important; border: 1px solid #606568; border-radius: 3px; color: #eee7dd !important; background: #343a3d; font-size: 12px !important; cursor: pointer; white-space: nowrap; }
.scry-file-button:hover { color: #fff7ee !important; background: var(--rust); border-color: var(--rust); }
.scry-set-row { display: flex; gap: 8px; }
.scry-set-row select { flex: 1 1 auto; min-width: 0; height: 38px; border: 1px solid #55595a; border-radius: 3px; color: #eee7dd; background: #202427; padding: 0 10px; font-size: 13px; }
.scry-icon-action { flex: 0 0 38px; height: 38px; border: 1px solid #606568; border-radius: 3px; color: #eee7dd; background: #343a3d; font-size: 18px; line-height: 1; }
.scry-icon-action:hover { color: #fff7ee; background: var(--rust); border-color: var(--rust); }
.import-dialog-content label.scry-check { display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 0; color: #c9b89f; font-size: 12px; cursor: pointer; }
.scry-check input { width: 15px; height: 15px; padding: 0; accent-color: var(--rust); }
.scry-run { gap: 12px; padding-top: 22px; }
.scry-run .import-action, .scry-run .import-progress, .scry-run .import-status { margin: 0; width: 100%; }
.scry-primary { padding: 12px; font-size: 14px; font-weight: 600; }
.scry-primary:disabled { border-color: #55595a; color: #8d877d; background: #3a3e40; cursor: not-allowed; }
.scry-run .import-status { min-height: 18px; color: #d8d1c5; }

.detail-actions { display: flex; gap: 10px; }
.detail-actions .import-action { flex: 1; }
.detail-edit-button { background: #343a3d; border: 1px solid #606568; }
.detail-edit-button:hover { background: #a65032; border-color: #a65032; }

/* Candado y campos extra del detalle (1.4.7): solo editor y administrador. El candado es comodidad, no seguridad. */
.detail-lock { margin-left: 6px; border: 0; border-radius: 3px; padding: 0 6px; color: #c9b89f; background: #25292c; font-size: 13px; line-height: 1.5; cursor: pointer; }
.detail-lock:hover { color: #eee7dd; background: #343a3d; }
.detail-lock.open { color: #1d2022; background: #c9b89f; }
.detail-lock[hidden] { display: none; }
.card-detail-properties input:disabled, .card-detail-properties select:disabled { opacity: 1; color: #c9b89f; background: #25292c; }
.card-detail-properties select { border: 1px solid #55595a; border-radius: 3px; color: #eee7dd; background: #202427; padding: 8px; }
.card-detail-properties input[readonly], .card-detail-properties textarea[readonly] { color: #c9b89f; background: #25292c; cursor: default; }
.detail-tabs { display: flex; gap: 2px; border-bottom: 1px solid #3d4244; font-family: 'Segoe UI', sans-serif; }
.detail-tabs[hidden] { display: none; }
.detail-tabs button { border: 0; border-bottom: 2px solid transparent; padding: 6px 14px; color: #c9b89f; background: transparent; font-size: 13px; cursor: pointer; }
.detail-tabs button:hover { color: #eee7dd; }
.detail-tabs button.active { color: #eee7dd; border-bottom-color: #a65032; }
/* Cada pestaña es una columna que reparte el alto como lo hacía el diálogo: los textos se estiran y el resto no. */
.detail-pane { display: flex; flex: 1 1 0; flex-direction: column; gap: 10px; min-height: 0; }
.detail-pane[hidden] { display: none; }
.detail-more-grid { display: grid; flex: 1 1 auto; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 10px; overflow-y: auto; }
.detail-more-grid .detail-wide { grid-column: 1 / -1; }
.detail-more-grid textarea { min-height: 70px; resize: vertical; font-family: 'Segoe UI', sans-serif; font-size: 13px; }
.detail-note { min-height: 16px; margin: 0; color: #e0b36a; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.detail-note:empty { display: none; }
.detail-id { margin-left: 8px; border: 0; border-radius: 3px; padding: 1px 6px; color: #9a9185; background: #25292c; font: 11px Consolas, monospace; cursor: copy; user-select: all; }
.detail-id:hover { color: #eee7dd; }
.detail-id.copied { color: #1d2022; background: #c9b89f; }
.detail-id:empty { display: none; }

/* Gestion de usuarios (solo administrador) */
.users-dialog { width: min(920px, 96vw); }
/* El último elemento no debe rozar el borde del diálogo: el margen habitual de los demás (20px abajo). */
.users-dialog .import-dialog-content, .entity-dialog .import-dialog-content { padding-bottom: 20px; }
.users-table-wrap { max-height: 46vh; margin: 0 20px; overflow: auto; border: 1px solid #3c4144; border-radius: 3px; }
.users-table { width: 100%; border-collapse: collapse; font-family: 'Segoe UI', sans-serif; font-size: 12px; color: #eee7dd; }
.users-table th { position: sticky; top: 0; padding: 8px 10px; text-align: left; color: #c9b89f; background: #202427; font-weight: 600; }
.users-table td { padding: 7px 10px; border-top: 1px solid #3c4144; vertical-align: middle; }
.users-table tr.users-inactive td { color: #79766f; }
.users-table select, .users-actions button { border: 1px solid #55595a; border-radius: 3px; color: #eee7dd; background: #202427; padding: 5px 8px; font-family: inherit; font-size: 12px; }
.users-table select:disabled, .users-actions button:disabled { opacity: 0.45; cursor: not-allowed; }
.users-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.users-actions button:not(:disabled):hover { border-color: #a65032; background: #a6503233; }
.users-create { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.users-create h3 { margin: 0 20px; color: #c9b89f; font-family: 'Segoe UI', sans-serif; font-size: 13px; }
.users-create-row { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 12px; padding: 0 20px; }
.users-create-row label { padding: 0; }
.users-secret { display: flex; flex-direction: column; gap: 8px; margin: 0 20px; padding: 12px; border: 1px solid #a65032; border-radius: 3px; background: #1d2124; font-family: 'Segoe UI', sans-serif; font-size: 12px; color: #eee7dd; }
.users-secret[hidden] { display: none; } /* sin esto, display: flex de arriba anula el atributo hidden y el recuadro no se oculta */
.users-secret p { margin: 0; }
.users-secret-row { display: flex; align-items: center; gap: 10px; }
.users-secret-row code { flex: 1; padding: 8px 10px; border-radius: 3px; background: #101315; font-size: 16px; letter-spacing: 0.04em; user-select: all; }
.users-secret .import-action { margin: 0; }

/* Registro de cambios (solo administrador). Misma tabla y colores que la ventana de usuarios. */
.audit-dialog { width: min(1100px, 97vw); }
.audit-filters { display: grid; grid-template-columns: 1.1fr 1.6fr 1.2fr 1fr auto auto; gap: 12px; align-items: end; padding: 0 20px; }
.audit-filters label { padding: 0; }
.audit-filters select { width: 100%; }
.audit-filters .import-action { margin: 0; }
.import-dialog-content label.audit-check { display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 0; white-space: nowrap; cursor: pointer; }
.audit-table-wrap { max-height: 52vh; margin: 0 20px; overflow: auto; border: 1px solid #3c4144; border-radius: 3px; }
.audit-table { width: 100%; border-collapse: collapse; font-family: 'Segoe UI', sans-serif; font-size: 12px; color: #eee7dd; }
.audit-table th { position: sticky; top: 0; padding: 8px 10px; text-align: left; color: #c9b89f; background: #202427; font-weight: 600; }
.audit-table td { padding: 7px 10px; border-top: 1px solid #3c4144; vertical-align: top; overflow-wrap: anywhere; }
.audit-table td.audit-when { white-space: nowrap; color: #c9b89f; }
.audit-table tr.audit-failed td { color: #f0a48f; }
.audit-table tr.audit-expandable { cursor: pointer; }
.audit-table tr.audit-expandable:hover td, .audit-table tr.audit-open td { background: #a6503222; }
.audit-extra[hidden] { display: none; }
.audit-extra td { padding: 0; background: #1d2124; }
.audit-changes { display: flex; flex-direction: column; gap: 5px; padding: 10px 14px 12px; }
.audit-detail-row { color: #c9b89f; }
.audit-change { white-space: pre-wrap; overflow-wrap: anywhere; }
.audit-change code { padding: 1px 5px; border-radius: 3px; background: #101315; }
.audit-revert-row { margin-top: 6px; }
.audit-revert-row .audit-revert { margin: 0; }
.audit-revert:disabled { opacity: 0.45; cursor: not-allowed; }
.audit-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px 4px; font-family: 'Segoe UI', sans-serif; font-size: 12px; color: #c9b89f; }
.audit-pager .import-action { margin: 0; }
.audit-pager .import-action:disabled { opacity: 0.45; cursor: not-allowed; }

/* Mazos con dueño (1.4.5): insignias, barra del mazo abierto, aviso de solo lectura y los grupos de «lo de otros». */
.deck-badge { margin-left: 4px; font-size: 11px; opacity: .85; }
.deck-owner > .tree-button { color: #c98a6d; font-weight: 600; }
.deck-owner .deck-category > .tree-button { font-weight: 400; }
/* Filtros de rareza y especiales (legendaria, arte, ficha): botones redondos con icono, como los manás. Encendido = se muestra; apagado = se
   oculta (el mismo sentido que la casilla de antes). Los manás, al revés, vacíos significan «sin filtro». El espacio entre grupos lo separa. */
.round-toggle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: #8d877d; background: transparent; cursor: pointer; }
.round-toggle .ic { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.round-toggle:hover { border-color: #a65032; }
.round-toggle:focus-visible { outline: 2px solid #a65032; outline-offset: 2px; }
.round-toggle.active { color: white; background: #c9b89f; border-color: #c9b89f; }
.round-toggle:not(.active) { opacity: .55; }
/* Cada rareza lleva el color de su símbolo de set (negro, plata, oro, naranja); apagada, queda atenuada. */
.rarity-toggle.rarity-common.active { background: #2b2b2b; border-color: #2b2b2b; color: #f4f1ea; }
.rarity-toggle.rarity-uncommon.active { background: #9aa6ad; border-color: #9aa6ad; color: #fff; }
.rarity-toggle.rarity-rare.active { background: #c9a227; border-color: #c9a227; color: #fff; }
.rarity-toggle.rarity-mythic.active { background: #d2561f; border-color: #d2561f; color: #fff; }
.filter-gap { width: 14px; flex: 0 0 14px; }
.filter-row-break { gap: 6px; flex-wrap: nowrap; }
/* Botones redondos con icono (como los de los manás de los filtros). El icono hereda el color: así sigue el hover y el tema. */
.round-button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border-radius: 50%; line-height: 1; }
.round-button .ic { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
/* Cabecera del editor de mazos: los iconos van en su fila (y bajan solos si no caben) y la × queda SIEMPRE en la esquina superior derecha. */
#deck-editor-drawer .drawer-header { position: relative; flex-wrap: wrap; gap: 8px 10px; padding-right: 92px; }
.deck-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.deck-close { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 24px; }
.deck-close:hover { color: #fff7ee; background: #45494b; }
.deck-mine-label { margin-top: 4px; }
/* Arrastrar un mazo: los sitios donde se puede soltar se marcan mientras se arrastra, y el destino bajo el cursor se resalta. */
.deck-choice[draggable="true"] { cursor: grab; }
.deck-choice[draggable="true"]:active { cursor: grabbing; }
.deck-mine-label.drop-active, .deck-folder-node.drop-active > .tree-button { color: white; background: #a650324d; outline: 1px dashed #d58d68; outline-offset: -1px; border-radius: 3px; }
.deck-folder-node.drop-active { background: #a650321c; }
body.dragging-deck .deck-mine-label { outline: 1px dashed #68615a; outline-offset: 2px; border-radius: 3px; }
.deck-others-label { margin-top: 22px; }
.deck-precon-label { margin-top: 22px; }
/* Los títulos de «Mazos personales» y «Mazos preconstruidos» llevan dos botones pequeños y redondos a la derecha (nueva sección y nuevo mazo). */
.deck-mine-label, .deck-precon-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.deck-section-actions { display: inline-flex; gap: 4px; }
.section-button { width: 22px; height: 22px; border: 1px solid #606568; border-radius: 50%; color: #c9b89f; background: transparent; cursor: pointer; }
.section-button .ic { width: 13px; height: 13px; }
.section-button:hover { color: #fff7ee; background: var(--rust); border-color: var(--rust); }
.deck-precon-label.drop-active { color: white; background: #a650324d; outline: 1px dashed #d58d68; outline-offset: -1px; border-radius: 3px; }
body.dragging-deck .deck-precon-label { outline: 1px dashed #68615a; outline-offset: 2px; border-radius: 3px; }
/* Un nombre largo que se parte en dos líneas dejaba el contador pegado a su última palabra («Karlov (Inglés)4»): hueco fijo entre los dos, y el contador no se encoge. */
.tree-button > span:last-child, .deck-choice > span:last-child { flex: none; }
.tree-button > span:first-child, .deck-choice > .deck-choice-name { min-width: 0; }
.deck-choice-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-toolbar { margin: 0 0 12px; padding: 10px; border: 1px solid #45494b; border-radius: 4px; background: #2e3336; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.deck-notice { margin: 0 0 8px; color: #e7c9a5; line-height: 1.35; }
.deck-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.deck-toolbar-actions .deck-tool { flex: 0 0 auto; }
/* «Compartido»: botón redondo que se enciende (en el color del tema, no en el azul predefinido del navegador). */
.deck-share[aria-pressed="true"] { color: #fff7ee; background: var(--rust); border-color: var(--rust); }
.deck-share:disabled { cursor: not-allowed; opacity: .6; }
.deck-tool { border: 1px solid #606568; border-radius: 3px; padding: 5px 10px; color: #eee7dd; background: #343a3d; font: inherit; cursor: pointer; }
.deck-tool:hover { color: #fff7ee; border-color: var(--rust); background: var(--rust); }
.deck-tool.round-button { width: 28px; height: 28px; padding: 0; border-radius: 50%; }
/* Un mazo de solo lectura se atenúa SIN `opacity` en la fila: una opacidad menor que 1 crea un contexto de apilado por fila, y el tooltip de la
   carta grande (z-index 20) quedaba encerrado en la suya y lo tapaban los nombres de las filas de debajo. Se atenúa el contenido en su lugar. */
.deck-card-row.read-only > .deck-card-name, .deck-card-row.read-only > .quantity-controls { opacity: .92; }
.deck-card-row.read-only > .deck-card-preview > img { opacity: .92; }
.deck-card-row { position: relative; }
.deck-card-row:hover { z-index: 3; }
.deck-format { display: flex; align-items: center; gap: 5px; color: #eee7dd; }
.deck-format-wrap { display: inline-flex; align-items: center; gap: 4px; }
/* `.deck-editor button` (mas arriba) da relleno y fondo rojo a todo boton del panel del mazo; este, que va con mas especificidad, lo deja en un circulo del color del tema de los demas botones. */
.deck-editor .deck-format-help { box-sizing: border-box; width: 22px; height: 22px; min-width: 22px; padding: 0; flex: 0 0 22px; border-radius: 50%; border-color: #606568; color: #eee7dd; background: #343a3d; }
.deck-editor .deck-format-help:hover { color: #fff7ee; border-color: var(--rust); background: var(--rust); }
.deck-format-help .ic { width: 13px; height: 13px; }
/* Glosario de formatos: una ficha por formato; el del mazo abierto va resaltado. */
.glossary-dialog { width: min(560px, 94vw); }
.glossary-list { display: flex; flex-direction: column; gap: 10px; max-height: min(60vh, 520px); overflow-y: auto; padding: 0 20px 20px; }
.glossary-entry { padding: 10px 12px; border: 1px solid #45494b; border-radius: 4px; background: #2e3336; font-family: 'Segoe UI', sans-serif; font-size: 12px; color: #eee7dd; }
.glossary-entry.selected { border-color: var(--rust); }
.glossary-entry h3 { margin: 0 0 4px; font-size: 14px; color: #fff7ee; }
.glossary-entry p { margin: 0 0 6px; line-height: 1.45; }
.glossary-cards strong { color: #c9b89f; }
.glossary-rules { margin: 0 0 6px; padding-left: 18px; color: #c9b89f; }
.glossary-note { color: #f0c4aa; font-style: italic; }
.deck-format select { border: 1px solid #606568; border-radius: 3px; padding: 4px 6px; color: #eee7dd; background: #343a3d; font: inherit; }
.deck-format select:disabled { cursor: not-allowed; opacity: .7; }
.deck-legality { margin: 8px 0 0; font-weight: 600; line-height: 1.35; }
.deck-legality.legal { color: #9ccf9c; }
.deck-legality.illegal { color: #e7b27a; }
.deck-legal-issue { display: inline-block; min-width: 1.1em; margin-right: 6px; border-radius: 50%; color: #2e3336; background: #e7b27a; font-weight: 700; text-align: center; cursor: help; }
/* Revertir en bloque, dentro del registro de cambios (solo administrador). Plegado por defecto: es una herramienta de emergencia. */
.audit-bulk { margin: 10px 20px 0; border: 1px solid #3c4144; border-radius: 3px; background: #1d2124; }
.audit-bulk > summary { padding: 8px 12px; color: #c9b89f; cursor: pointer; font-family: 'Segoe UI', sans-serif; font-size: 13px; }
.audit-bulk[open] > summary { border-bottom: 1px solid #3c4144; }
.audit-bulk .access-intro, .audit-bulk .access-error, .audit-bulk .audit-bulk-summary { margin: 8px 12px 0; padding: 0; }
.audit-bulk-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; padding: 8px 12px 0; }
.audit-bulk-form label { padding: 0; }
.audit-bulk-form .import-action { margin: 0; }
.audit-bulk-form .import-action:disabled { opacity: 0.45; cursor: not-allowed; }
.audit-bulk-presets { display: flex; gap: 6px; }
.audit-bulk-presets .import-action { padding: 5px 8px; font-size: 12px; }
.audit-bulk-summary { color: #eee7dd; font-family: 'Segoe UI', sans-serif; font-size: 13px; }
.audit-bulk .audit-table-wrap { max-height: 28vh; margin: 10px 12px 12px; }
.audit-table tr.bulk-conflict td, .audit-table tr.bulk-skipped td { color: #f0a48f; }


/* Cambiar de idioma un mazo (TAREAS.md 8.2). Reutiliza el diálogo de importación y la tabla del registro. */
.deck-language-dialog { width: min(760px, 96vw); }
.deck-language-dialog .import-dialog-content { padding-bottom: 20px; }
.deck-language-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 20px; }
.deck-language-actions .import-action { margin: 0; flex: 1 1 auto; }
.deck-language-actions .import-action:disabled { opacity: 0.45; cursor: not-allowed; }
.import-dialog-content label.scry-check[hidden] { display: none; } /* sin esto, el display: flex de .scry-check anula el atributo hidden */
.import-dialog-content label#pdf-upscale-model-row[hidden] { display: none; } /* idem: el modelo de reescalado solo se ve con la casilla marcada */
.import-dialog-content label#deck-dialog-commander-label[hidden] { display: none; }
.import-dialog-content label#deck-dialog-format-label[hidden] { display: none; } /* idem: el display: flex de `.import-dialog-content label` anula hidden y el selector saldria tambien al editar */
.deck-language-dialog .import-status { min-height: 0; margin: 0 20px; }
.deck-language-dialog .import-status:empty, .deck-language-dialog .import-hint:empty { display: none; }
.deck-language-dialog .audit-bulk-summary { margin: 0 20px; }
.deck-language-dialog .audit-bulk-summary:empty { display: none; }
.deck-language-dialog .audit-table-wrap { max-height: 38vh; }
/* El estado también va escrito en la primera columna: el color solo refuerza. */
.audit-table tr.lang-change td:first-child, .audit-table tr.lang-merge td:first-child { color: #9fd0a0; }
.audit-table tr.lang-missing td, .audit-table tr.lang-outside td { color: #f0a48f; }
.audit-table tr.lang-same td { color: #79766f; }

/* Comparar dos mazos (TAREAS.md 7.3). Reutiliza el diálogo de importación y la tabla del registro. */
.deck-compare-dialog { width: min(760px, 96vw); }
.deck-compare-dialog .import-dialog-content { padding-bottom: 20px; }
/* El selector y la casilla del banquillo en una misma fila: el selector toma el sitio que sobra y la casilla se queda a su derecha, alineada con la caja del selector. */
.compare-pick { display: flex; align-items: flex-end; gap: 16px; padding: 0 20px; }
.compare-pick > label:first-child { flex: 1 1 auto; min-width: 0; padding: 0; }
.compare-pick > label.scry-check { flex: none; min-height: 38px; white-space: nowrap; }
.deck-compare-dialog .import-status { min-height: 0; margin: 0 20px; }
.deck-compare-dialog .import-status:empty, .deck-compare-dialog .import-hint:empty { display: none; }
.deck-compare-dialog .audit-bulk-summary { margin: 0 20px; }
.deck-compare-dialog .audit-bulk-summary:empty { display: none; }
.compare-lists { display: flex; flex-direction: column; gap: 12px; max-height: 46vh; margin: 0 20px; overflow: auto; }
.compare-section h3 { margin: 0 0 6px; font-size: 14px; color: #eee7dd; }
.compare-section .audit-table { width: 100%; }
.compare-qty { text-align: center; width: 64px; }
/* La cantidad distinta también va escrita (dos números distintos): el color solo refuerza. */
.audit-table tr.compare-differs td { color: #e6c27a; }

/* Mano de prueba (TAREAS.md 7.4). Las cartas van en abanico, como una mano sostenida. Cada carta gira sobre un punto de SU borde inferior, y ese
   punto cae sobre el eje vertical del abanico, pero no es el mismo en todas: en la de más a la derecha es el 0 % de su ancho (su borde
   izquierdo), en la de más a la izquierda el 100 % (su borde derecho), y en las demás se reparte entre los dos (--p, una fracción). Cada carta lleva su giro, su
   punto de giro y su orden en variables CSS (--a, --p, --z) que pone deck-hand.js por CSSOM (la CSP no permite el atributo style).
   Pasar el ratón la adelanta y la agranda SIN moverla ni enderezarla (así no se sale de la ventana); sin ratón, el foco hace lo mismo.
   El orden de las transformaciones importa: translateX(-p) va el primero (se aplica el último, ya sin girar) y lleva el punto de giro hasta el eje;
   rotate y translateY/scale siguen el eje de cada carta. */
/* Ancho: con el punto de giro en la esquina (0 % y 100 %), las cartas de los extremos se abren más: la de ±30° agrandada (×1,3) llega a unos 386 px
   del eje por su lado exterior, así que el área del abanico (el diálogo menos 40 px de márgenes) necesita ≥ 772 px; 830 px de diálogo deja margen. */
.deck-hand-dialog { width: min(830px, 96vw); }
.deck-hand-dialog .import-dialog-content { padding-bottom: 20px; }
.deck-hand-dialog .import-status { min-height: 0; margin: 0 20px; }
.deck-hand-dialog .import-status:empty, .deck-hand-dialog .import-hint:empty { display: none; }
.deck-hand-dialog .import-hint { margin: 0 20px; text-align: center; }
.deck-hand-counters, .deck-hand-hint { margin: 0 20px; text-align: center; }
.deck-hand-counters { color: #eee7dd; font-size: 14px; }
.deck-hand-hint { min-height: 1.4em; color: #e6c27a; font-size: 14px; }
/* El eje de giro (el borde inferior de las cartas) está a 128 px del fondo: una carta girada 30° baja unos 123 px por debajo del eje agrandada
   (×1,3), así que con menos margen el área (overflow: hidden) la cortaría por abajo. Por arriba, la esquina más alta de una carta marcada para el
   fondo y agrandada sube ≈ 384 px sobre el eje: 384 + 128 = 512 px. El alto deja un pequeño margen sobre eso. */
.deck-hand-fan { position: relative; height: 520px; margin: 0 20px; overflow: hidden; }
.hand-card { position: absolute; left: 50%; bottom: 128px; width: 190px; padding: 0; border: 0; background: none; border-radius: 8px; cursor: default;
  z-index: var(--z, 1); transform-origin: calc(var(--p, 0.5) * 100%) 100%; transform: translateX(calc(var(--p, 0.5) * -100%)) rotate(var(--a, 0deg));
  transition: transform 0.14s ease-out; }
.hand-card img { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55); pointer-events: none; }
.hand-card:hover, .hand-card:focus-visible { z-index: 1000; outline: none; transform: translateX(calc(var(--p, 0.5) * -100%)) rotate(var(--a, 0deg)) scale(1.3); }
.deck-hand-fan.choosing .hand-card { cursor: pointer; }
.hand-card.chosen { outline: 3px solid var(--rust); outline-offset: 2px; transform: translateX(calc(var(--p, 0.5) * -100%)) rotate(var(--a, 0deg)) translateY(-30px); }
.hand-card.chosen:hover, .hand-card.chosen:focus-visible { transform: translateX(calc(var(--p, 0.5) * -100%)) rotate(var(--a, 0deg)) translateY(-30px) scale(1.3); }
@media (prefers-reduced-motion: reduce) { .hand-card { transition: none; } }

/* Diálogo de un conjunto: código, tipo y fecha en una línea, y los cuatro símbolos de rareza. */
#entity-dialog { width: min(540px, 94vw); }
.import-dialog-content .entity-row { display: flex; gap: 10px; padding: 0 20px; }
.import-dialog-content .entity-row > label { flex: 1 1 0; min-width: 0; padding: 0; }
.import-dialog-content .entity-row > label.entity-code { flex: 0 0 96px; }
.import-dialog-content .entity-row > label.entity-date { flex: 0 0 128px; }
.import-dialog-content .entity-row input { min-width: 0; width: 100%; box-sizing: border-box; }
.import-dialog-content input[readonly] { color: #a99d8b; background: #23272a; cursor: default; }
.symbol-section { display: flex; flex-direction: column; gap: 8px; padding: 0 20px; }
.symbol-section[hidden] { display: none; }
.symbol-title { color: #c9b89f; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.symbol-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.symbol-cell { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; }
/* Los símbolos comunes son NEGROS: sobre el fondo oscuro del diálogo no se verían, de ahí el fondo claro. */
.symbol-slot { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; padding: 8px 6px 6px; border: 1px solid #55595a; border-radius: 4px; color: #eee7dd; background: #202427; font-family: 'Segoe UI', sans-serif; cursor: pointer; }
.symbol-slot:hover:not(:disabled), .symbol-slot:focus-visible { border-color: #c98a6d; outline: none; }
.symbol-slot:disabled { cursor: default; opacity: .6; }
.symbol-preview { display: flex; align-items: center; justify-content: center; width: 100%; height: 52px; border-radius: 3px; background: #d9d2c3; }
.symbol-preview img { max-width: 80%; max-height: 40px; }
/* «Ninguno»: un círculo discontinuo tachado, sin imagen. */
.symbol-none { position: relative; width: 30px; height: 30px; border: 2px dashed #7a7468; border-radius: 50%; }
.symbol-none::after { content: ''; position: absolute; left: 50%; top: -4px; width: 2px; height: 34px; background: #7a7468; transform: translateX(-50%) rotate(45deg); }
.symbol-name { font-size: 12px; }
.symbol-caption { color: #a99d8b; font-size: 11px; }
.symbol-slot.is-uploaded { border-color: #a65032; }
.symbol-slot.is-uploaded .symbol-caption { color: #e0a98f; }
.symbol-revert { border: 0; padding: 2px; color: #c98a6d; background: transparent; font-family: 'Segoe UI', sans-serif; font-size: 11px; text-decoration: underline; cursor: pointer; }
.symbol-revert[hidden] { display: none; }
.symbol-revert:disabled { opacity: .5; cursor: default; }
.symbol-help { margin: 0; color: #a99d8b; font-family: 'Segoe UI', sans-serif; font-size: 11px; line-height: 1.4; }
.symbol-status { min-height: 16px; margin: 0; color: #d8d1c5; font-family: 'Segoe UI', sans-serif; font-size: 12px; }
.symbol-status.error { color: #e0907a; }
