/* ─────────────────────────────────────────────
   VARIABLES & RESET
───────────────────────────────────────────── */
:root {
  --ink:        #1a1008;
  --ink-mid:    #3d2b1a;
  --ink-light:  #6b4f35;
  --parchment:  #f5ead8;
  --parchment2: #ede0c4;
  --parchment3: #e3d3b0;
  --gold:       #8b6914;
  --gold-light: #c9a227;
  --gold-faint: #f0e4b8;
  --cream:      #faf6ee;
  --soprav:     #2e6b3e;
  --soprav-bg:  #d4edda;
  --deport:     #8b1a1a;
  --deport-bg:  #fde8e8;
  --emigr:      #5a4a00;
  --emigr-bg:   #fdf6d3;
  --altro:      #1a4a6b;
  --altro-bg:   #ddeef9;
  --shadow:     0 4px 24px rgba(26,16,8,.14);
  --shadow-sm:  0 2px 8px rgba(26,16,8,.10);
  --radius:     3px;
  --transition: .22s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'EB Garamond', Georgia, serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Subtle parchment texture via pseudo */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(200,169,90,.09) 0%, transparent 70%),
    radial-gradient(ellipse 80% 40% at 80% 110%, rgba(139,105,20,.06) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}

/* ─────────────────────────────────────────────
   HEADER
───────────────────────────────────────────── */
.site-header {
  position: relative;
  text-align: center;
  padding: 3.2rem 2rem 2.4rem;
  background: var(--ink);
  color: var(--parchment);
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 100% 80% at 50% -20%, rgba(201,162,39,.18) 0%, transparent 65%),
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(201,162,39,.04) 39px, rgba(201,162,39,.04) 40px);
  pointer-events: none;
}

.header-ornament {
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold-light) 20%, var(--gold-light) 80%, transparent 100%);
  margin-bottom: 2rem;
  opacity: .7;
}
.header-ornament.bottom { margin-top: 2rem; margin-bottom: 0; }

.header-inner { position: relative; z-index: 1; }

.header-star {
  font-size: 1.1rem;
  color: var(--gold-light);
  letter-spacing: .3em;
  margin-bottom: .5rem;
  opacity: .8;
}

.site-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  font-weight: 400;
  letter-spacing: .14em;
  color: var(--parchment);
  line-height: 1.15;
}

.site-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1rem, 2.5vw, 1.45rem);
  font-style: italic;
  color: var(--gold-light);
  letter-spacing: .06em;
  margin: .5rem 0 1rem;
}

.site-desc {
  font-size: .93rem;
  color: rgba(245,234,216,.65);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.65;
  letter-spacing: .01em;
}

.sticky-tools {
  position: sticky;
  top: 0;
  z-index: 120;
  background: rgba(250,246,238,.96);
  box-shadow: 0 10px 24px rgba(26,16,8,.10);
}

.sticky-tools .controls-bar {
  margin-top: 1rem;
}

.sticky-tools .filter-panel {
  margin-bottom: 1rem;
}

/* ─────────────────────────────────────────────
   STATS BAR
───────────────────────────────────────────── */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  background: var(--ink-mid);
  padding: .9rem 2rem;
  border-bottom: 1px solid rgba(201,162,39,.25);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
}

.stat-num {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--gold-light);
  line-height: 1;
}

.stat-label {
  font-size: .72rem;
  color: rgba(245,234,216,.55);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.stat-item.esito-sopravvissuto .stat-num { color: #6fcf97; }
.stat-item.esito-deportato .stat-num { color: #eb5757; }

.stat-divider {
  color: rgba(201,162,39,.35);
  font-size: 1.4rem;
  line-height: 1;
  margin-top: -.2rem;
}

/* ─────────────────────────────────────────────
   CONTROLS BAR
───────────────────────────────────────────── */
.controls-bar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 2rem auto 0;
  padding: 0 2rem;
  position: relative; z-index: 1;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: .85rem; top: 50%;
  transform: translateY(-50%);
  width: 1rem; height: 1rem;
  color: var(--ink-light);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: .7rem 2.4rem .7rem 2.4rem;
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  color: var(--ink);
  background: white;
  border: 1.5px solid var(--parchment3);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(139,105,20,.12);
}

.search-input::placeholder { color: rgba(107,79,53,.45); font-style: italic; }

.clear-search {
  position: absolute; right: .65rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--ink-light); cursor: pointer;
  font-size: .8rem; opacity: 0;
  transition: opacity var(--transition);
  padding: .2rem .3rem;
}
.clear-search.visible { opacity: .6; }
.clear-search:hover { opacity: 1; }

.controls-right {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1.25rem;
  font-family: 'Cinzel', serif;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .09em;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn svg { width: .9rem; height: .9rem; flex-shrink: 0; }

.btn-add {
  background: var(--ink);
  color: var(--parchment);
  border-color: var(--ink);
}
.btn-add:hover {
  background: var(--ink-mid);
  border-color: var(--ink-mid);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-export {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}
.btn-export:hover {
  background: var(--gold-faint);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-save {
  background: var(--ink);
  color: var(--parchment);
  border-color: var(--ink);
}
.btn-save:hover { background: var(--ink-mid); }

.btn-secondary {
  background: transparent;
  color: var(--ink-mid);
  border-color: var(--parchment3);
}
.btn-secondary:hover { border-color: var(--ink-light); color: var(--ink); }

.btn-danger {
  background: transparent;
  color: var(--deport);
  border-color: #e0a0a0;
  font-size: .7rem;
  padding: .45rem .9rem;
}
.btn-danger:hover { background: var(--deport-bg); }

.btn-edit {
  background: transparent;
  color: var(--gold);
  border-color: #d4b87a;
  font-size: .7rem;
  padding: .45rem .9rem;
}
.btn-edit:hover { background: var(--gold-faint); }

/* ─────────────────────────────────────────────
   RESULTS INFO
───────────────────────────────────────────── */
.results-info {
  max-width: 1200px;
  margin: .6rem auto 0;
  padding: 0 2rem;
  font-size: .85rem;
  color: var(--ink-light);
  font-style: italic;
  min-height: 1.4em;
  position: relative; z-index: 1;
}

/* ─────────────────────────────────────────────
   TABLE
───────────────────────────────────────────── */
.table-wrap {
  max-width: 1200px;
  margin: 1rem auto 3rem;
  padding: 0 2rem;
  position: relative; z-index: 1;
}

.registry-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--parchment3);
}

.registry-table thead {
  background: var(--ink);
  position: sticky; top: 0; z-index: 2;
}

.registry-table thead th {
  font-family: 'Cinzel', serif;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--parchment);
  padding: 1rem .9rem;
  text-align: left;
  border-right: 1px solid rgba(245,234,216,.08);
  white-space: nowrap;
}

.registry-table thead th:last-child { border-right: none; }

.col-num { width: 3rem; text-align: center; }
.col-gender { width: 5rem; text-align: center; }
.col-villa { width: 6.5rem; text-align: center; }
.col-esito { width: 10rem; }

/* Table rows */
.registry-table tbody tr {
  border-bottom: 1px solid var(--parchment2);
  cursor: pointer;
  transition: background var(--transition);
  animation: rowIn .35s ease both;
}

@keyframes rowIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.registry-table tbody tr:nth-child(even) { background: #fdfaf4; }
.registry-table tbody tr:hover { background: var(--gold-faint); }
.registry-table tbody tr:last-child { border-bottom: none; }

.registry-table tbody td {
  padding: .8rem .9rem;
  font-size: .97rem;
  color: var(--ink);
  vertical-align: middle;
}

.td-num {
  font-family: 'Cinzel', serif;
  font-size: .7rem;
  color: var(--ink-light);
  text-align: center;
}

.td-name {
  font-weight: 500;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.td-name-main { font-size: 1rem; color: var(--ink); }
.td-name-sub { font-size: .8rem; color: var(--ink-light); font-style: italic; }

.td-gender {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: .75rem;
  letter-spacing: .05em;
  color: var(--ink-mid);
}

.td-birth, .td-origin {
  font-size: .9rem;
  color: var(--ink-mid);
}

.td-villa {
  text-align: center;
  font-size: .85rem;
}

.villa-yes { color: var(--soprav); font-weight: 600; }
.villa-no  { color: rgba(107,79,53,.35); }

/* ─────────────────────────────────────────────
   ESITO BADGES
───────────────────────────────────────────── */
.esito-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .65rem;
  border-radius: 2px;
  font-family: 'Cinzel', serif;
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .08em;
  white-space: nowrap;
}

.esito-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.esito-Sopravvissuto, .esito-Sopravvissuta {
  background: var(--soprav-bg);
  color: var(--soprav);
}
.esito-Sopravvissuto::before, .esito-Sopravvissuta::before { background: var(--soprav); }

.esito-Deportato, .esito-Deportata {
  background: var(--deport-bg);
  color: var(--deport);
}
.esito-Deportato::before, .esito-Deportata::before { background: var(--deport); }

.esito-Emigrato, .esito-Emigrata {
  background: var(--emigr-bg);
  color: var(--emigr);
}
.esito-Emigrato::before, .esito-Emigrata::before { background: var(--emigr); }

.esito-Altro {
  background: var(--altro-bg);
  color: var(--altro);
}
.esito-Altro::before { background: var(--altro); }

/* ─────────────────────────────────────────────
   LOADING / EMPTY STATES
───────────────────────────────────────────── */
.loading-row td, .empty-row td {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-light);
  font-style: italic;
  font-size: .95rem;
}

.loading-spinner {
  display: inline-block;
  width: 1.2rem; height: 1.2rem;
  border: 2px solid var(--parchment3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-right: .6rem;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────
   MODAL OVERLAY
───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,16,8,.62);
  backdrop-filter: blur(3px);
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-panel {
  background: var(--cream);
  border: 1px solid var(--parchment3);
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(26,16,8,.4), 0 0 0 1px rgba(201,162,39,.2);
  width: 100%;
  max-width: 700px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(16px) scale(.98);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}

.modal-overlay.open .modal-panel {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none; border: none;
  color: var(--ink-light);
  font-size: .8rem; cursor: pointer;
  width: 1.8rem; height: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background var(--transition), color var(--transition);
  z-index: 2;
}
.modal-close:hover { background: var(--parchment2); color: var(--ink); }

.modal-header {
  background: var(--ink);
  color: var(--parchment);
  padding: 1.8rem 2rem 1.4rem;
  border-radius: 4px 4px 0 0;
}

.modal-star {
  font-size: .8rem;
  color: var(--gold-light);
  letter-spacing: .2em;
  margin-bottom: .5rem;
  opacity: .7;
}

.modal-name {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: .06em;
  line-height: 1.2;
}

.modal-esito-badge { margin-top: .8rem; }

/* ─────────────────────────────────────────────
   MODAL BODY
───────────────────────────────────────────── */
.modal-body {
  padding: 1.8rem 2rem;
}

.modal-section {
  margin-bottom: 1.6rem;
}

.modal-section-title {
  font-family: 'Cinzel', serif;
  font-size: .68rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--parchment3);
  padding-bottom: .4rem;
  margin-bottom: 1rem;
}

.modal-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .8rem 1.2rem;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.field-label {
  font-family: 'Cinzel', serif;
  font-size: .62rem;
  letter-spacing: .1em;
  color: var(--ink-light);
  text-transform: uppercase;
}

.field-value {
  font-size: .97rem;
  color: var(--ink);
  line-height: 1.4;
}

.field-value.empty { color: rgba(107,79,53,.35); font-style: italic; }

.relazioni-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .2rem;
}

.relazione-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .75rem;
  background: var(--parchment);
  border: 1px solid var(--parchment3);
  border-radius: 2px;
  font-size: .85rem;
  color: var(--ink-mid);
  cursor: pointer;
  transition: background var(--transition);
}
.relazione-chip:hover { background: var(--gold-faint); }
.relazione-chip .chip-tipo { font-size: .72rem; color: var(--ink-light); }

.modal-actions {
  display: flex;
  gap: .6rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--parchment2);
  margin-top: .5rem;
}

/* ─────────────────────────────────────────────
   FORM PANEL
───────────────────────────────────────────── */
.form-panel {
  max-width: 800px;
}

.edit-form { padding: 1.8rem 2rem; }

.form-section-label {
  font-family: 'Cinzel', serif;
  font-size: .68rem;
  letter-spacing: .15em;
  color: var(--gold);
  border-bottom: 1px solid var(--parchment3);
  padding-bottom: .4rem;
  margin: 1.4rem 0 .9rem;
}
.form-section-label:first-child { margin-top: 0; }

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .7rem;
}

.form-row label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1;
  min-width: 160px;
  font-family: 'Cinzel', serif;
  font-size: .68rem;
  letter-spacing: .08em;
  color: var(--ink-mid);
  text-transform: uppercase;
}

.form-row.full label { flex: 1 1 100%; }

.label-check {
  flex-direction: row !important;
  align-items: center;
  gap: .6rem !important;
  min-width: 140px;
}

.form-row input[type="text"],
.form-row select,
.form-row textarea {
  padding: .55rem .75rem;
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  color: var(--ink);
  background: white;
  border: 1.5px solid var(--parchment3);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(139,105,20,.1);
}

.form-row textarea { resize: vertical; min-height: 70px; }

.form-row input[type="checkbox"] {
  width: 1rem; height: 1rem;
  accent-color: var(--gold);
  cursor: pointer;
}

.req { color: var(--deport); }

.form-actions {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  padding-top: 1.2rem;
  border-top: 1px solid var(--parchment2);
  margin-top: 1rem;
}

/* ─────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1.5rem 2rem;
  font-family: 'Cinzel', serif;
  font-size: .68rem;
  letter-spacing: .12em;
  color: var(--ink-light);
  opacity: .6;
  position: relative; z-index: 1;
}
.footer-dot { margin: 0 .6rem; }

/* ─────────────────────────────────────────────
   SCROLLBAR
───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--parchment2); }
::-webkit-scrollbar-thumb { background: var(--parchment3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-light); }

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 768px) {
  .stats-bar { gap: 1rem; padding: .75rem 1rem; }
  .controls-bar { padding: 0 1rem; }
  .table-wrap { padding: 0 1rem; }
  .modal-panel { max-height: 92vh; }
  .modal-body, .edit-form { padding: 1.2rem 1.2rem; }
  .col-birth, .col-origin { display: none; }

  .registry-table thead th,
  .registry-table tbody td { padding: .7rem .6rem; }
}

@media (max-width: 520px) {
  .controls-right { width: 100%; justify-content: flex-end; }
  .col-gender { display: none; }
}

/* ─── Fonti list ─── */
.fonti-list {
  grid-column: 1 / -1;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-size: .9rem;
  color: var(--ink-mid);
}
.fonti-list li::before {
  content: '·';
  margin-right: .5rem;
  color: var(--gold);
}

.estratti-list {
  grid-column: 1 / -1;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}

.estratti-list li {
  padding: .85rem 1rem;
  background: rgba(255,255,255,.58);
  border: 1px solid var(--parchment3);
  border-left: 3px solid var(--gold);
}

.estratto-source {
  display: block;
  margin-bottom: .35rem;
  font-family: 'Cinzel', serif;
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
}

.estratto-context {
  display: block;
  color: var(--ink-mid);
  font-size: .95rem;
  line-height: 1.5;
}

.audit-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .8rem;
  width: 100%;
  padding: .8rem 1rem;
  background: var(--parchment);
  border: 1px solid var(--parchment3);
}

/* ─── Import button ─── */
.btn-import {
  background: transparent;
  color: var(--ink-mid);
  border-color: var(--parchment3);
}
.btn-import:hover {
  background: var(--parchment2);
  border-color: var(--ink-light);
  transform: translateY(-1px);
}
.btn-import:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

/* ─── Interactive refinements ─── */
.filter-panel {
  width: min(calc(100% - 4rem), 1200px);
  margin: 1rem auto 0;
  padding: 1rem;
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,.76);
  border: 1px solid var(--parchment3);
  box-shadow: var(--shadow-sm);
}

.filter-panel::before {
  content: none;
}

.filter-grid,
.filter-actions {
  position: relative;
  z-index: 1;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: .75rem;
  align-items: end;
}

.filter-grid label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-family: 'Cinzel', serif;
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-light);
  min-width: 0;
}

.filter-grid select {
  width: 100%;
  min-height: 2.35rem;
  padding: .45rem .55rem;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: .96rem;
  color: var(--ink);
  background: #fffdf8;
  border: 1.5px solid var(--parchment3);
  border-radius: var(--radius);
  outline: none;
  box-shadow: 0 1px 0 rgba(26,16,8,.04);
}

.filter-grid select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(139,105,20,.1);
}

.filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .85rem;
}

.live-status,
.page-info {
  color: var(--ink-light);
  font-size: .86rem;
  font-style: italic;
}

.table-wrap {
  overflow: auto;
  scrollbar-gutter: stable;
  width: min(calc(100% - 4rem), 1080px);
  max-width: none;
  margin: 1rem auto 3rem;
  padding: 0;
  max-height: 72vh;
  border: 1px solid var(--parchment3);
  background: rgba(255, 255, 255, .65);
  scrollbar-width: auto;
  scrollbar-color: #8c724c #e8dbc3;
}

.table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #e8dbc3;
  border-radius: 6px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #b79b6d 0%, #8c724c 100%);
  border: 2px solid #e8dbc3;
  border-radius: 8px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #c8a86f 0%, #9a7746 100%);
}

.registry-table {
  min-width: 980px;
}

.registry-table tbody tr {
  will-change: transform, opacity;
}

.th-sort {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.th-sort::after {
  content: '↕';
  color: rgba(245,234,216,.45);
  font-family: Georgia, serif;
  font-size: .75rem;
  line-height: 1;
}

.th-sort.active::after {
  content: '↑';
  color: var(--gold-light);
}

.th-sort.active[data-dir="desc"]::after {
  content: '↓';
}

.col-page,
.td-page {
  width: 7rem;
  color: var(--ink-light);
}

.muted-dash {
  color: rgba(107,79,53,.35);
  font-size: .9rem;
}

.pager-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
  padding: .85rem 0 0;
}

.page-jump {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.page-jump-label {
  font-family: 'Cinzel', serif;
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-light);
}

.page-jump-input {
  width: 4.8rem;
  min-height: 2.3rem;
  padding: .45rem .55rem;
  font-family: 'EB Garamond', serif;
  font-size: .98rem;
  color: var(--ink);
  background: #fffdf8;
  border: 1.5px solid var(--parchment3);
  border-radius: var(--radius);
  outline: none;
}

.page-jump-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(139,105,20,.1);
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.top-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--gold), var(--soprav), var(--gold-light));
  transition: transform .2s ease;
}

.top-progress.active {
  animation: progressSlide 1.1s ease-in-out infinite;
}

@keyframes progressSlide {
  0% { transform: scaleX(.08); opacity: .55; }
  50% { transform: scaleX(.72); opacity: 1; }
  100% { transform: scaleX(1); opacity: .55; }
}

.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 250;
  max-width: min(360px, calc(100vw - 2rem));
  padding: .75rem .95rem;
  background: var(--ink);
  color: var(--parchment);
  border: 1px solid rgba(201,162,39,.35);
  box-shadow: var(--shadow);
  border-radius: 4px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--deport);
  color: #fff4f4;
}

.esito-badge.esito-sopravvissuto {
  background: var(--soprav-bg);
  color: var(--soprav);
}
.esito-badge.esito-sopravvissuto::before { background: var(--soprav); }

.esito-badge.esito-deportato {
  background: var(--deport-bg);
  color: var(--deport);
}
.esito-badge.esito-deportato::before { background: var(--deport); }

.esito-badge.esito-emigrato {
  background: var(--emigr-bg);
  color: var(--emigr);
}
.esito-badge.esito-emigrato::before { background: var(--emigr); }

.esito-badge.esito-altro {
  background: var(--altro-bg);
  color: var(--altro);
}
.esito-badge.esito-altro::before { background: var(--altro); }

@media (max-width: 1050px) {
  .filter-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 900px) {
  .controls-bar {
    grid-template-columns: 1fr;
  }

  .controls-right {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .table-wrap {
    width: calc(100% - 2rem);
  }

  .filter-panel {
    width: calc(100% - 2rem);
    padding: .85rem 1rem;
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .filter-actions,
  .pager-bar {
    align-items: stretch;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .page-jump {
    width: 100%;
    justify-content: flex-start;
  }

  .pager-bar .btn {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 460px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .controls-right {
    justify-content: stretch;
  }

  .controls-right .btn {
    flex: 1;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* GPT Taste redesign */
*, *::before, *::after {
  letter-spacing: 0 !important;
}

:root {
  --ink: #191817;
  --ink-mid: #32302c;
  --ink-light: #6e6960;
  --paper: #f3efe6;
  --paper-soft: #faf8f2;
  --paper-line: #ded7c8;
  --ember: #a6422d;
  --ember-dark: #762d22;
  --sage: #4d6b57;
  --sage-soft: #dfe9df;
  --blueprint: #243c45;
  --blueprint-soft: #d8e4e5;
  --gold: #b9822f;
  --gold-light: #d8b16b;
  --gold-faint: #f3dfb8;
  --cream: var(--paper);
  --parchment: var(--paper-soft);
  --parchment2: #ebe3d5;
  --parchment3: var(--paper-line);
  --soprav: var(--sage);
  --soprav-bg: var(--sage-soft);
  --deport: var(--ember-dark);
  --deport-bg: #f3ddd7;
  --emigr: #8b6424;
  --emigr-bg: #f6e8c8;
  --altro: var(--blueprint);
  --altro-bg: var(--blueprint-soft);
  --radius: 8px;
  --shadow: 0 22px 70px rgba(25, 24, 23, .14);
  --shadow-sm: 0 12px 34px rgba(25, 24, 23, .11);
  --transition: .25s cubic-bezier(.22, 1, .36, 1);
}

html {
  scroll-padding-top: 7rem;
}

body {
  width: 100%;
  max-width: 100vw;
  background:
    linear-gradient(135deg, rgba(166, 66, 45, .08), transparent 28%),
    linear-gradient(225deg, rgba(77, 107, 87, .10), transparent 35%),
    var(--paper);
  color: var(--ink);
  font-family: "Outfit", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  background:
    linear-gradient(rgba(25, 24, 23, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 24, 23, .025) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .58;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

.lux-nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  z-index: 190;
  width: min(1120px, calc(100% - 2rem));
  min-height: 4.25rem;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: .6rem .75rem .6rem .65rem;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 8px;
  background: rgba(250, 248, 242, .74);
  box-shadow: 0 18px 54px rgba(25, 24, 23, .14);
  backdrop-filter: blur(18px);
}

.nav-brand,
.nav-links,
.nav-action {
  min-width: 0;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-weight: 800;
  color: var(--ink);
}

.nav-brand img {
  width: 2.35rem;
  height: 2.35rem;
  object-fit: contain;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: .35rem;
}

.nav-links a,
.nav-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0 .95rem;
  border-radius: 8px;
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink-mid);
}

.nav-links a:hover {
  background: rgba(25, 24, 23, .06);
}

.nav-action {
  background: var(--ink);
  color: #fffaf0;
}

.hero-section {
  position: relative;
  min-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, .72fr);
  align-items: end;
  gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(8rem, 13vh, 10rem) max(1.25rem, calc((100vw - 1180px) / 2)) clamp(5rem, 10vh, 8rem);
  color: #fff8ec;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(12, 11, 10, .92), rgba(12, 11, 10, .72) 52%, rgba(12, 11, 10, .30)),
    url("https://picsum.photos/seed/modena-memory/2200/1400") center / cover no-repeat;
  filter: contrast(1.08) saturate(.78);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .20), transparent 40%, rgba(0, 0, 0, .55)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 7px);
  mix-blend-mode: soft-light;
}

.hero-copy {
  max-width: min(1120px, 94vw);
  padding-bottom: 1rem;
}

.hero-overline,
.section-overline {
  margin: 0 0 1rem;
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gold-light);
}

.hero-copy h1 {
  max-width: min(1120px, 94vw);
  margin: 0;
  font-size: clamp(3rem, 6vw, 6.7rem);
  line-height: .91;
  font-weight: 800;
  text-wrap: balance;
}

.inline-hero-image {
  display: inline-block;
  width: clamp(5.2rem, 10vw, 10rem);
  height: clamp(2rem, 4vw, 4.2rem);
  margin: 0 .15em;
  border: 1px solid rgba(255, 248, 236, .52);
  border-radius: 999px;
  vertical-align: .03em;
  background: url("https://picsum.photos/seed/inline-ledger/600/260") center / cover no-repeat;
  filter: grayscale(1) contrast(1.25) brightness(.92);
}

.hero-desc {
  max-width: 690px;
  margin: 1.55rem 0 0;
  color: rgba(255, 248, 236, .80);
  font-size: clamp(1rem, 1.5vw, 1.24rem);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 2rem;
}

.btn {
  min-height: 2.75rem;
  border-radius: 8px;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: .92rem;
  font-weight: 800;
  text-transform: none;
}

.btn-hero-primary,
.btn-add,
.btn-save {
  background: #fff8ec;
  color: #171513;
  border-color: #fff8ec;
}

.btn-hero-primary:hover,
.btn-add:hover,
.btn-save:hover {
  background: #ffffff;
  color: #171513;
  transform: translateY(-2px);
}

.btn-hero-secondary,
.btn-export,
.btn-secondary,
.btn-footer {
  background: transparent;
  color: #fff8ec;
  border-color: rgba(255, 248, 236, .46);
}

.btn-hero-secondary:hover,
.btn-export:hover,
.btn-footer:hover {
  background: rgba(255, 248, 236, .12);
  color: #fff8ec;
  transform: translateY(-2px);
}

.hero-art {
  align-self: center;
  margin: 0;
  width: min(360px, 100%);
  aspect-ratio: 3 / 4.25;
  justify-self: end;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 236, .26);
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .42);
}

.hero-art img,
.bento-media img,
.accordion-panel img,
.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(.82) contrast(1.18) saturate(.72);
  transition: transform .7s ease, filter .7s ease;
}

.group-card:hover img,
.accordion-panel:hover img,
.gallery-card:hover img,
.hero-art:hover img {
  transform: scale(1.055);
  filter: grayscale(.35) contrast(1.16) saturate(.86);
}

.interest-section,
.accordion-section,
.desire-section,
.archive-workspace {
  padding: clamp(7rem, 12vw, 12rem) max(1.25rem, calc((100vw - 1180px) / 2));
}

.section-intro {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(280px, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
  margin-bottom: 2rem;
}

.section-intro h2,
.pin-copy h2,
.workspace-head h2,
.site-footer h2 {
  margin: 0;
  font-size: clamp(2.25rem, 4.4vw, 5.1rem);
  line-height: .98;
  font-weight: 800;
  text-wrap: balance;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(175px, auto);
  grid-auto-flow: dense;
  gap: .9rem;
}

.bento-card {
  position: relative;
  overflow: hidden;
  min-height: 175px;
  border: 1px solid rgba(25, 24, 23, .12);
  border-radius: 8px;
  background: rgba(250, 248, 242, .78);
  box-shadow: var(--shadow-sm);
}

.bento-large {
  grid-column: span 8;
  grid-row: span 2;
  min-height: 420px;
  color: #fff8ec;
  background: #171513;
}

.bento-media {
  position: absolute;
  inset: 0;
}

.bento-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 11, 10, .10), rgba(12, 11, 10, .84));
}

.bento-content {
  position: absolute;
  inset: auto 0 0;
  padding: clamp(1.25rem, 3vw, 2.4rem);
}

.bento-content p,
.bento-text p,
.pin-copy p,
.gallery-card p,
.accordion-panel p {
  color: rgba(25, 24, 23, .68);
  line-height: 1.58;
}

.bento-large .bento-content p {
  max-width: 520px;
  color: rgba(255, 248, 236, .72);
}

.stat-card,
.bento-text {
  grid-column: span 4;
  padding: 1.35rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.stat-card.is-green {
  background: var(--sage);
  color: #f7fff4;
}

.stat-card.is-red {
  background: var(--ember);
  color: #fff5f1;
}

.stat-num {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: clamp(2.3rem, 5vw, 5.7rem);
  font-weight: 800;
  line-height: .9;
  color: currentColor;
}

.stat-label {
  margin-top: .75rem;
  color: currentColor;
  opacity: .72;
  font-size: .93rem;
  font-weight: 800;
  text-transform: uppercase;
}

.bento-large .stat-label {
  color: #fff8ec;
}

.bento-text h3,
.accordion-panel h3,
.gallery-card h3 {
  margin: 0 0 .7rem;
  font-size: clamp(1.35rem, 2vw, 2.25rem);
  line-height: 1;
}

.accordion-section {
  padding-top: 0;
}

.horizontal-accordion {
  display: flex;
  gap: .9rem;
  min-height: 460px;
}

.accordion-panel {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-width: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff8ec;
  transition: flex .65s cubic-bezier(.22, 1, .36, 1);
}

.accordion-panel.active,
.accordion-panel:hover {
  flex: 2.45;
}

.accordion-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 10%, rgba(0, 0, 0, .82));
}

.accordion-panel div {
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1;
}

.accordion-panel p,
.gallery-card p {
  color: rgba(255, 248, 236, .72);
}

.marquee-band {
  overflow: hidden;
  border-block: 1px solid rgba(25, 24, 23, .14);
  background: var(--ink);
  color: #fff8ec;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeMove 32s linear infinite;
}

.marquee-track span {
  padding: 1.2rem 2.2rem;
  font-size: clamp(1.6rem, 3.4vw, 3.9rem);
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: .86;
}

@keyframes marqueeMove {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.desire-section {
  background: #141311;
  color: #fff8ec;
}

.pin-layout {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.pin-copy {
  top: 7rem;
  min-height: 60vh;
}

.pin-copy p {
  max-width: 520px;
  color: rgba(255, 248, 236, .68);
  font-size: 1.04rem;
}

.scroll-gallery {
  display: grid;
  gap: 1.2rem;
}

.gallery-card {
  overflow: hidden;
  min-height: 560px;
  border: 1px solid rgba(255, 248, 236, .18);
  border-radius: 8px;
  background: #211f1b;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
}

.gallery-card img {
  height: 360px;
}

.gallery-card h3,
.gallery-card p {
  padding-inline: clamp(1.25rem, 3vw, 2rem);
}

.gallery-card h3 {
  padding-top: 1.4rem;
  color: #fff8ec;
}

.gallery-card p {
  padding-bottom: 1.8rem;
}

.archive-workspace {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .40), rgba(255, 255, 255, .74)),
    var(--paper);
}

.workspace-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.2rem;
}

.workspace-actions {
  display: flex;
  gap: .7rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.archive-workspace .btn-add {
  background: var(--ink);
  color: #fff8ec;
  border-color: var(--ink);
}

.archive-workspace .btn-export,
.archive-workspace .btn-secondary {
  color: var(--ink);
  border-color: rgba(25, 24, 23, .18);
}

.archive-workspace .btn-export:hover,
.archive-workspace .btn-secondary:hover {
  background: rgba(25, 24, 23, .06);
  color: var(--ink);
}

.sticky-tools {
  position: sticky;
  top: 5.8rem;
  z-index: 110;
  margin: 0 0 1rem;
  padding: .95rem;
  border: 1px solid rgba(25, 24, 23, .12);
  border-radius: 8px;
  background: rgba(250, 248, 242, .84);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
}

.sticky-tools .controls-bar,
.controls-bar {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  grid-template-columns: minmax(260px, 1fr) auto;
}

.sticky-tools .filter-panel,
.filter-panel {
  width: 100%;
  margin: .9rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.search-input,
.filter-grid select,
.page-jump-input,
.form-row input[type="text"],
.form-row select,
.form-row textarea {
  min-height: 2.85rem;
  border-radius: 8px;
  border: 1px solid rgba(25, 24, 23, .16);
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  font-family: "Outfit", system-ui, sans-serif;
  font-size: .98rem;
}

.filter-grid {
  grid-template-columns: repeat(9, minmax(92px, 1fr));
}

.filter-grid label,
.page-jump-label,
.field-label,
.form-row label,
.form-section-label,
.modal-section-title {
  color: var(--ink-light);
  font-family: "Outfit", system-ui, sans-serif;
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-actions {
  justify-content: flex-start;
}

.results-info {
  max-width: none;
  margin: .65rem 0 0;
  padding: 0;
  color: var(--ink-light);
  font-style: normal;
}

.table-wrap {
  width: 100%;
  max-width: none;
  max-height: 78vh;
  margin: .9rem 0 0;
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(25, 24, 23, .14);
  border-radius: 8px;
  background: rgba(250, 248, 242, .74);
  box-shadow: var(--shadow);
}

.registry-table {
  min-width: 980px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: rgba(255, 255, 255, .88);
}

.registry-table thead {
  background: var(--ink);
}

.registry-table thead th {
  top: 0;
  color: #fff8ec;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: .78rem;
  font-weight: 800;
}

.registry-table tbody td {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: .95rem;
}

.td-name-main {
  font-size: 1rem;
  font-weight: 800;
}

.td-name-sub {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: .82rem;
  font-style: normal;
}

.registry-table tbody tr:nth-child(even) {
  background: rgba(36, 60, 69, .035);
}

.registry-table tbody tr:hover {
  background: rgba(166, 66, 45, .10);
}

.pager-bar {
  padding: .9rem;
  background: rgba(250, 248, 242, .90);
}

.modal-panel {
  border-radius: 8px;
  background: var(--paper-soft);
}

.modal-header {
  border-radius: 8px 8px 0 0;
  background: var(--ink);
  color: #fff8ec;
}

.modal-name {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  font-weight: 800;
}

.modal-body,
.edit-form {
  font-family: "Outfit", system-ui, sans-serif;
}

.field-value {
  font-size: .98rem;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.25rem;
  padding: clamp(5rem, 10vw, 8rem) max(1.25rem, calc((100vw - 1180px) / 2));
  background: var(--ink);
  color: #fff8ec;
  text-align: left;
  opacity: 1;
}

.site-footer h2 {
  max-width: 920px;
}

.btn-footer {
  color: #fff8ec;
}

@media (max-width: 1020px) {
  .hero-section,
  .pin-layout,
  .section-intro,
  .workspace-head,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .hero-art {
    justify-self: start;
    width: min(420px, 82vw);
  }

  .bento-large,
  .stat-card,
  .bento-text {
    grid-column: span 6;
  }

  .filter-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .lux-nav {
    left: .5rem !important;
    right: auto;
    width: 4.75rem !important;
    max-width: 4.75rem;
    transform: none !important;
    display: flex;
    justify-content: space-between;
  }

  .nav-links {
    display: none;
  }

  .nav-brand {
    width: 2.45rem;
    overflow: hidden;
  }

  .nav-brand span {
    display: none;
  }

  .nav-action {
    display: none !important;
  }

  .hero-section {
    min-height: auto;
    padding-top: 7rem;
    display: block;
    overflow: hidden;
  }

  .hero-copy h1 {
    max-width: 100%;
    font-size: clamp(2.05rem, 9.2vw, 3.05rem);
    line-height: 1;
    text-wrap: initial;
  }

  .inline-hero-image {
    width: clamp(3.8rem, 17vw, 4.8rem);
    height: clamp(1.5rem, 6.8vw, 2rem);
  }

  .hero-art {
    margin-top: 2rem;
    width: 100%;
    aspect-ratio: 16 / 10;
  }

  .interest-section,
  .accordion-section,
  .desire-section,
  .archive-workspace {
    padding-block: 5.5rem;
  }

  .bento-grid {
    grid-template-columns: 1fr;
  }

  .bento-large,
  .stat-card,
  .bento-text {
    grid-column: span 1;
  }

  .horizontal-accordion {
    flex-direction: column;
    min-height: auto;
  }

  .accordion-panel,
  .accordion-panel.active,
  .accordion-panel:hover {
    flex: none;
    min-height: 260px;
  }

  .sticky-tools {
    top: 5.25rem;
  }

  .sticky-tools .controls-bar {
    grid-template-columns: 1fr;
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 500px) {
  .lux-nav {
    top: .5rem;
  }

  .hero-actions,
  .workspace-actions,
  .pager-bar {
    align-items: stretch;
  }

  .hero-actions .btn,
  .workspace-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none !important;
  }
}
