/* ── Reset & base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #0189c6;
  --primary-dark:  #015f8a;
  --primary-light: #d6eef8;
  --blue:          #1a4a8a;
  --blue-light:    #e8eef8;
  --cream:         #fdf8ef;
  --cream-dark:    #f5edda;
  --gold:          #c8922a;
  --text:          #1a1a1a;
}

body {
  font-family: 'Josefin Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header & nav ──────────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: var(--cream);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 2px solid #1a1a1a;
  box-shadow: inset 0 -3px 0 0 var(--primary), inset 0 -5px 0 0 #1a1a1a;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.home-link {
  font-family: 'Alfa Slab One', serif;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--cream);
  text-decoration: none;
}
.home-link:hover { text-decoration: underline; text-underline-offset: 3px; color: var(--cream); }

.header-sep { color: rgba(253,248,239,0.5); font-size: 1.1rem; }

.set-label {
  font-size: 1rem;
  color: rgba(253,248,239,0.85);
  font-weight: 500;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.set-header-date {
  font-size: 0.8rem;
  font-weight: 400;
  color: rgba(253,248,239,0.6);
  margin-left: 0.3rem;
}

nav { display: flex; align-items: center; gap: 0.4rem; }

nav a {
  font-family: 'Oswald', sans-serif;
  color: rgba(253,248,239,0.75);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.5rem;
  border-radius: 4px;
  transition: color 0.15s;
}
nav a:hover { color: var(--cream); text-decoration: none; }
nav a.active { color: var(--cream); font-weight: 600; }

.step-num {
  background: rgba(253,248,239,0.25);
  border-radius: 50%;
  width: 1.4em;
  height: 1.4em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  font-weight: 700;
  line-height: 1;
}
nav a.active .step-num { background: var(--cream); color: var(--primary); }

.nav-sep { color: rgba(253,248,239,0.4); font-size: 1.1rem; }

/* ── Main ──────────────────────────────────────────────────────────────── */
main { flex: 1; padding: 1.5rem; max-width: 1100px; width: 100%; margin: 0 auto; }

footer {
  text-align: center;
  padding: 1rem;
  color: #888;
  font-size: 0.8rem;
  border-top: 1px solid var(--cream-dark);
}

/* ── Cards (UI panels) ─────────────────────────────────────────────────── */
.page-section { display: flex; flex-direction: column; gap: 1.25rem; }

.card {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  border: 2px solid #1a1a1a;
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px #1a1a1a;
}

.card h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card h2 .step-num {
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  width: 1.65em;
  height: 1.65em;
  flex-shrink: 0;
}


/* ── Game name inline collapsed display ────────────────────────────────── */
.setting-value-inline {
  font-weight: 400;
  color: #555;
  flex: 1;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.setting-value-inline {
  text-decoration: underline;
  text-underline-offset: 2px;
}
a.setting-value-inline:hover { color: #1a1a1a; }


/* ── Hints & badges ────────────────────────────────────────────────────── */
.hint { color: #666; font-size: 0.875rem; margin-bottom: 0.75rem; }
.hint.small { font-size: 0.8rem; margin-top: 0.5rem; }

.badge {
  background: var(--cream-dark);
  color: var(--primary-dark);
  border-radius: 99px;
  padding: 0.1em 0.55em;
  font-size: 0.85em;
  font-weight: 600;
  vertical-align: middle;
}

/* ── Alerts ────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error { background: #fde8ec; color: #8b1a2a; border: 1px solid #f0b0bc; }
.alert-warn  { background: #fff8e1; color: #7d5a00; border: 1px solid #ffe082; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 5px;
  border: 1px solid #d0c8b8;
  background: var(--cream);
  color: #333;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--cream-dark); text-decoration: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-dark);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 0.85rem;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  line-height: 1;
}
.btn-icon:hover { color: var(--primary); background: var(--primary-light); }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.login-form { display: flex; flex-direction: column; gap: 0.85rem; }
.login-form label {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #222;
}
.login-form .url-input { width: 100%; box-sizing: border-box; }

.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.inline-form input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 0.45rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.9rem;
  font-family: inherit;
}

.service-email-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  padding: 0.6rem 0.85rem;
  background: #fde8ec;
  border: 1px solid #f0b0bc;
  border-radius: 6px;
  font-size: 0.9rem;
}
.service-email-row code {
  font-family: inherit;
  font-size: 0.875rem;
  color: #333;
  word-break: break-all;
}
.btn-copy {
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  white-space: nowrap;
  border-radius: 4px;
  border: 1px solid #e08090;
  background: #fff;
  color: #8b1a2a;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-copy:hover { background: #fce0e6; }

.btn-inline-copy {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--primary-dark);
  cursor: pointer;
  text-decoration: underline dotted;
}
.btn-inline-copy:hover { color: var(--primary); }
.copy-confirm {
  font-size: 0.8em;
  color: #2a7a2a;
  font-weight: 600;
  margin-left: 0.3em;
  animation: copy-fade 1.8s ease forwards;
}
@keyframes copy-fade {
  0%   { opacity: 1; }
  60%  { opacity: 1; }
  100% { opacity: 0; }
}

.import-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.import-waiting { display: flex; flex-direction: column; gap: 0.85rem; }
.import-progress { display: flex; align-items: center; gap: 0.6rem; font-size: 0.95rem; color: #555; }
.review-loading-state { display: flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 2.5rem 1rem; color: #555; font-size: 0.95rem; }
.url-input {
  flex: 1;
  min-width: 300px;
  padding: 0.45rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.9rem;
  font-family: inherit;
}

/* ── Library header ────────────────────────────────────────────────────── */
.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.empty-state { color: #888; font-style: italic; padding: 1rem 0; text-align: center; }

.progress-hint {
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
  align-self: center;
}

/* ── Sticky CTA bar (step 1 → step 2) ─────────────────────────────────── */
.has-sticky-cta { padding-bottom: 104px; }

.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--primary);
  color: var(--cream);
  padding: 1.35rem 1.5rem;
  display: flex;
  justify-content: center;
  border-top: 2px solid #1a1a1a;
  box-shadow: inset 0 3px 0 0 var(--primary), inset 0 5px 0 0 #1a1a1a;
  z-index: 200;
}

.sticky-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1100px;
  gap: 1rem;
}

.sticky-cta-center {
  position: relative;
}

.sticky-cta-link {
  background: none;
  border: none;
  padding: 0;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.8rem;
  color: rgba(253, 248, 239, 0.65);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.sticky-cta-link:hover { color: var(--cream); }

.sticky-cta-link--left {
  position: absolute;
  right: calc(100% + 0.75rem);
  top: 50%;
  transform: translateY(-50%);
}

.approval-counter-footer {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.78rem;
  color: rgba(253, 248, 239, 0.75);
  font-family: 'Josefin Sans', sans-serif;
  letter-spacing: 0.02em;
}

.sticky-cta-label {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.92;
}

.sticky-cta-btn {
  background: var(--cream);
  color: var(--primary);
  border: none;
  font-weight: 700;
  padding: 0.55rem 1.4rem;
  white-space: nowrap;
}
.sticky-cta-btn:hover { background: var(--cream); color: var(--primary-dark); }

/* ── Card thumbnail grid ───────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eee;
}

.page-info { font-size: 0.875rem; color: #888; }

.btn-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.card-thumb {
  border: 2px solid #1a1a1a;
  border-radius: 0;
  overflow: hidden;
  background: #fafafa;
  display: flex;
  flex-direction: column;
}

.card-thumb img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
  background: var(--cream);
  display: block;
}

.card-thumb-footer {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.75rem;
  background: #fff;
  border-top: 1px solid #eee;
}

.card-id { font-weight: 700; color: var(--primary); flex-shrink: 0; }
.card-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #555; display: flex; align-items: center; gap: 4px; }
.delete-form { flex-shrink: 0; }

.color-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.15);
}
.color-swatch--red    { background: #c41e3a; }
.color-swatch--orange { background: #F58F29; }
.color-swatch--yellow { background: #E8EC67; }
.color-swatch--green  { background: #2e7d32; }
.color-swatch--blue   { background: #1565c0; }
.color-swatch--navy   { background: #1a237e; }
.color-swatch--purple { background: #6a1b9a; }
.color-swatch--pink   { background: #c2185b; }
.color-swatch--dark   { background: #333; }
.color-swatch--light  { background: #bbb; }
.color-swatch--unknown { background: #ccc; }

.card-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  padding: 0.1rem 0.2rem;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.card-delete-btn:hover { color: #c0185f; background: #fce8f1; }

/* ── Suggestion grid (step 2) ──────────────────────────────────────────── */
.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.suggestion-card {
  border: 2px solid #1a1a1a;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: block;
  background: var(--cream);
}
.suggestion-card:has(input:checked) {
  background: var(--primary);
  border-color: var(--primary-dark);
  box-shadow: inset 0 0 0 3px var(--primary), inset 0 0 0 5px var(--primary-dark);
}
.suggestion-card:has(input:checked) .suggestion-level { color: rgba(253,248,239,0.65); }
.suggestion-card:has(input:checked) .suggestion-count { color: var(--cream); }
.suggestion-card:has(input:checked) .suggestion-detail { color: rgba(253,248,239,0.75); }
.suggestion-card:has(input:checked) .custom-input { color: var(--cream); }
.suggestion-card:has(input:checked) .custom-input::placeholder { color: rgba(253,248,239,0.45); }
.suggestion-card:has(input:checked) .custom-tablas-label { color: var(--cream); }

.suggestion-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }

.suggestion-body {
  padding: 1rem;
  text-align: center;
}
.suggestion-level { font-size: 0.8rem; text-transform: uppercase; color: #888; letter-spacing: 0.05em; margin-bottom: 0.3rem; }
.suggestion-count { font-family: 'Oswald', sans-serif; font-size: 1.75rem; font-weight: 700; color: var(--text); }
.suggestion-detail { font-size: 0.8rem; color: #666; margin-top: 0.2rem; }

.custom-card .suggestion-body { display: block; text-align: center; }
.custom-count-row { justify-content: center; }
.custom-card #custom-detail { margin-top: 0.2rem; }
.custom-count-row {
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
}
.custom-input {
  width: 3ch;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-family: 'Oswald', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}
.custom-input::-webkit-outer-spin-button,
.custom-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.custom-input:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.custom-input::placeholder { color: #bbb; }
.custom-tablas-label {
  font-family: 'Oswald', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

.form-actions { display: flex; gap: 0.75rem; align-items: center; }
.btn-back { display: inline-block; margin-bottom: 0.75rem; }

/* ── Tabla list (step 3) ───────────────────────────────────────────────── */
.action-group { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.tabla-list { display: flex; flex-direction: column; gap: 1rem; }

.tabla-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border: 2px solid #1a1a1a;
  border-radius: 0;
  flex-wrap: wrap;
  background: var(--cream);
}

.tabla-info { min-width: 90px; }
.tabla-info strong { display: block; }
.tabla-info .hint { margin: 0; }

.generate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.generate-header .btn-back { margin-bottom: 0; }
.generate-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── PDF Preview modal (after .modal base to ensure specificity wins) ───── */

.tabla-label {
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.tabla-viewer { width: 100%; }

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 2px;
  width: 61%;
  aspect-ratio: 3/4;
  margin: 0 auto;
}

.mini-cell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.mini-cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--cream);
  border-radius: 0;
  border: 1px solid #1a1a1a;
  display: block;
}

.cell-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.mini-cell:hover .cell-overlay {
  opacity: 1;
  pointer-events: auto;
}

.cell-count {
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1;
}

.cell-refresh {
  background: rgba(255, 255, 255, 0.92);
  border: none;
  border-radius: 50%;
  width: 1.35rem;
  height: 1.35rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #222;
  padding: 0;
  line-height: 1;
  transition: background 0.12s, transform 0.12s;
}
.cell-refresh:hover:not(:disabled) {
  background: #fff;
  transform: rotate(-30deg);
}
.cell-refresh:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.swap-hint {
  font-size: 0.48rem;
  font-family: 'Josefin Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
  text-align: center;
}
.swap-hint--safe    { color: #86efac; }
.swap-hint--caution { color: #fcd34d; }
@keyframes spin {
  to { transform: rotate(-360deg); }
}
.cell-refresh--spinning {
  animation: spin 0.7s linear infinite;
}

.sticky-cta-btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }
.sticky-cta-btn--disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ── Lock / approval button ─────────────────────────────────────────────── */
.lock-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border-radius: 5px;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.lock-btn--unlocked { background: #fce8f1; color: #c0185f; border: 1px solid #e07aab; }
.lock-btn--unlocked:hover { background: #f9d4e6; }
.lock-btn--locked { background: #d4edda; color: #155724; border: 1px solid #b8dfc4; }
.lock-btn--locked:hover { background: #c3e6cb; }

.setup-steps {
  margin: 0.75rem 0 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.875rem;
}
.setup-steps code {
  background: rgba(0,0,0,0.08);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.9em;
}

.mini-missing {
  height: 100%;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 2px;
  font-size: 0.5rem;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
}

/* ── Home page ─────────────────────────────────────────────────────────── */
.home-center {
  max-width: 680px;
  width: 85%;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-center form,
.home-center .btn-new-set { width: 100%; text-align: center; }

.btn-new-set {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 1rem;
  padding: 0.6rem 1.4rem;
}

.set-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}
.set-row:last-child { border-bottom: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 5px;
  color: #999;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--primary); background: var(--primary-light); text-decoration: none; }

.icon-btn-disabled {
  color: #ddd;
  cursor: not-allowed;
}

.icon-btn-delete { background: none; border: none; padding: 0; cursor: pointer; font-size: inherit; }
.icon-btn-delete:hover { color: #c0185f; background: #fce8f1; }

/* ── Secondary button ──────────────────────────────────────────────────── */
.btn-secondary {
  background: #fff;
  color: #c0185f;
  border-color: #c0185f;
}
.btn-secondary:hover { background: #fce8f1; }

/* ── Delete confirmation modal ─────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.modal {
  background: #fff;
  border-radius: 8px;
  padding: 1.75rem;
  max-width: 400px;
  width: 90%;
  border: 2px solid #1a1a1a;
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px #1a1a1a, 0 8px 32px rgba(0,0,0,0.18);
}

.modal-msg {
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ── Download options modal ─────────────────────────────────────────────── */
.modal--download { max-width: 520px; }

/* ── PDF Preview modal ───────────────────────────────────────────────────── */
.modal.modal--preview {
  width: min(77vw, 731px);
  max-width: none;
  height: min(77vh, 765px);
  max-height: none;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.preview-modal-header .modal-title { margin: 0; }
.preview-modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}
.preview-modal-close:hover { background: var(--bg); }
.preview-frame-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
}
.preview-frame-wrap iframe {
  position: absolute;
  top: 0;
  left: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 6px);
  border: none;
  display: block;
}
.preview-loading {
  position: absolute;
  inset: 6px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  z-index: 1;
}
.preview-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.modal-title {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.download-option {
  padding: 1rem 0;
  border-top: 1px solid #e8e0d5;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.download-option-title {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}

.download-option-desc {
  font-size: 0.82rem;
  color: #777;
  line-height: 1.45;
  margin: 0;
}

.download-option .btn { align-self: flex-start; margin-top: 0.2rem; }

.tabla-picker { display: flex; flex-direction: column; gap: 0.4rem; width: 100%; }

.tabla-chips-field {
  min-height: 2.2rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.3rem 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  background: #fafafa;
}

.tabla-chips-placeholder {
  font-size: 0.82rem;
  color: #bbb;
  font-family: 'Josefin Sans', sans-serif;
  pointer-events: none;
}

.tabla-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--primary);
  border-radius: 3px;
  padding: 0.15rem 0.45rem;
  font-size: 0.78rem;
  font-family: 'Josefin Sans', sans-serif;
}

.tabla-chip-remove {
  background: none;
  border: none;
  padding: 0 0 0 0.1rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--primary-dark);
  opacity: 0.5;
}
.tabla-chip-remove:hover { opacity: 1; }

.tabla-dropdown-wrap { position: relative; }

.tabla-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  font-family: 'Josefin Sans', sans-serif;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.12s;
}
.tabla-dropdown-trigger:hover { border-color: var(--primary); color: var(--primary-dark); }

.tabla-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-height: 180px;
  overflow-y: auto;
  z-index: 600;
  padding: 0.3rem 0;
}

.tabla-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.4rem 0.9rem;
  font-size: 0.84rem;
  font-family: 'Josefin Sans', sans-serif;
  color: var(--text);
  cursor: pointer;
}
.tabla-dropdown-item:hover { background: var(--primary-light); color: var(--primary-dark); }


.set-info {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}

.set-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #222;
  flex-shrink: 0;
}

.set-meta {
  font-size: 0.85rem;
  color: #888;
  flex-shrink: 0;
}

.set-date {
  font-size: 0.8rem;
  color: #bbb;
  flex-shrink: 0;
}

.set-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
