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

/* ── THEME TOKENS ────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  --bg:            #f5f6f8;
  --surface:       #ffffff;
  --surface-2:     #fafbfc;   /* table headers, subtle fills */
  --surface-3:     #f3f4f6;   /* tags, inline code, muted badges */
  --row-hover:     #f8f9fb;
  --border:        #e2e4e9;
  --border-soft:   #f0f1f5;   /* row separators */
  --border-strong: #c0c4cc;   /* hover state on controls */
  --text-1:        #111827;
  --text-2:        #4b5563;
  --text-3:        #6b7280;   /* smallest readable text — 4.8:1 on surface */
  --text-4:        #9ca3af;   /* decorative only: icons, separators */
  --accent:        #0078d4;
  --accent-ring:   rgba(0, 120, 212, .12);
  --accent-fg:     #ffffff;   /* text on an accent fill */
  --badge-yes-bg:  #dcfce7;
  --badge-yes-fg:  #15803d;
  --badge-no-bg:   #f3f4f6;
  --badge-no-fg:   #4b5563;
  --tag-arch-bg:   #eff6ff;
  --tag-arch-fg:   #1d4ed8;
  --tag-bg:        #f3f4f6;
  --tag-fg:        #4b5563;
  --overlay:       rgba(0, 0, 0, .45);
  --heart:         #e5534b;
  --select-arrow:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

  /* Accent stripes on stat cards (referenced from app.js) */
  --card-1:        #0078d4;
  --card-2:        #7c3aed;
  --card-3:        #0891b2;
  --card-4:        #16a34a;
  --card-5:        #f59e0b;
  --c-added:       #16a34a;
  --c-removed:     #dc2626;
  --c-updated:     #7c3aed;

  --radius:        8px;
  --shadow:        0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-nav:    0 1px 4px rgba(0,0,0,.04);
  --shadow-modal:  0 20px 60px rgba(0,0,0,.18);
}

/* Dark palette. The inline script in <head> resolves the OS preference into an
   explicit data-theme before first paint, so one selector covers both cases. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:            #0f1115;
  --surface:       #171a21;
  --surface-2:     #1c2029;
  --surface-3:     #232833;
  --row-hover:     #20242e;
  --border:        #2a2f3a;
  --border-soft:   #23272f;
  --border-strong: #3a4150;
  --text-1:        #e6e8ee;
  --text-2:        #b3b9c6;
  --text-3:        #8b93a3;
  --text-4:        #6b7280;
  --accent:        #4cadff;
  --accent-ring:   rgba(76, 173, 255, .20);
  --accent-fg:     #0b1220;
  --badge-yes-bg:  rgba(34, 197, 94, .16);
  --badge-yes-fg:  #4ade80;
  --badge-no-bg:   rgba(148, 163, 184, .14);
  --badge-no-fg:   #9aa4b2;
  --tag-arch-bg:   rgba(59, 130, 246, .18);
  --tag-arch-fg:   #7cb2ff;
  --tag-bg:        rgba(148, 163, 184, .13);
  --tag-fg:        #b3b9c6;
  --overlay:       rgba(0, 0, 0, .6);
  --heart:         #ff6b63;
  --select-arrow:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%238b93a3' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

  --card-1:        #4cadff;
  --card-2:        #a78bfa;
  --card-3:        #22d3ee;
  --card-4:        #4ade80;
  --card-5:        #fbbf24;
  --c-added:       #4ade80;
  --c-removed:     #f87171;
  --c-updated:     #a78bfa;

  --shadow:        0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
  --shadow-nav:    0 1px 4px rgba(0,0,0,.4);
  --shadow-modal:  0 20px 60px rgba(0,0,0,.6);
}

html { font-size: 100%; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
}

/* ── FOCUS ───────────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.nav-btn:focus-visible {
  outline-offset: -2px;
  border-radius: 0;
}
input[type="search"]:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ── LOADING ─────────────────────────────────────────────────────────────── */
#loading {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-3);
  font-size: .875rem;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── HEADER ──────────────────────────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.header-brand { display: flex; align-items: center; gap: 12px; }
.header-logo {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.header-logo svg { width: 16px; height: 16px; stroke: var(--accent-fg); }
.header-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -.01em;
}
.header-sub {
  font-size: .75rem;
  color: var(--text-3);
  margin-top: 1px;
}
.header-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: .75rem;
  color: var(--text-3);
}
.header-dates { display: flex; align-items: center; gap: 20px; }
.header-meta strong { color: var(--text-2); font-weight: 500; }
.header-link {
  font-size: .75rem;
  color: var(--text-3);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color .15s;
}
.header-link:hover { color: var(--text-1); }

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-3);
  cursor: pointer;
  flex-shrink: 0;
  transition: color .15s, border-color .15s, background .15s;
}
.theme-toggle:hover {
  color: var(--text-1);
  border-color: var(--border-strong);
}
.theme-toggle svg { width: 15px; height: 15px; }
/* Show the icon for the theme you would switch *to* */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── NAVIGATION ──────────────────────────────────────────────────────────── */
.topnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-nav);
}
.topnav-inner {
  padding: 0 40px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-btn {
  height: 44px;
  padding: 0 14px;
  border: none;
  background: none;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color .15s;
  white-space: nowrap;
  border-radius: 0;
}
.nav-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity .15s;
}
.nav-btn:hover { color: var(--text-1); }
.nav-btn.active { color: var(--accent); }
.nav-btn.active::after { opacity: 1; }

.nav-sep {
  flex: 1;
}

/* ── MAIN ────────────────────────────────────────────────────────────────── */
main {
  padding: 32px 40px 56px;
}

/* App-shell layout (wide screens): the chrome is fixed and <main> is the scroll
   container, so the catalog table can flex into whatever space is left over
   instead of guessing at it with a viewport calculation. */
@media (min-width: 769px) {
  #app  { display: flex; flex-direction: column; height: 100dvh; }
  main  { flex: 1; min-height: 0; overflow-y: auto; }
  .topnav { position: static; }

  #view-catalog { display: flex; flex-direction: column; height: 100%; }
  #view-catalog .table-card {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
  }
  #view-catalog .table-scroll { flex: 1; min-height: 0; max-height: none; }
}

/* ── STAT CARDS ──────────────────────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--card-color, var(--border));
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1;
  letter-spacing: -.02em;
}
/* Cards in the changes view act as section filters */
.stat-card-filter {
  cursor: pointer;
  user-select: none;
  transition: box-shadow .12s ease, border-color .12s ease, opacity .12s ease;
}
.stat-card-filter:hover { border-color: var(--card-color, var(--border)); }
.stat-card-filter:focus-visible {
  outline: 2px solid var(--card-color, var(--border));
  outline-offset: 2px;
}
.stat-card-filter.active {
  border-color: var(--card-color, var(--border));
  box-shadow: inset 0 0 0 1px var(--card-color, var(--border)), var(--shadow);
}
/* Once one card is active the others step back, so the scope is obvious.
   The reset card is exempt — it is the one you reach for while a filter runs. */
.stats.has-filter .stat-card-filter:not(.active):not([data-action="reset"]) { opacity: .55; }
/* Nothing to clear yet — the reset card should not invite a click */
.stat-card-filter.is-idle { cursor: default; opacity: .7; }
.stat-card-filter.is-idle:hover { border-color: var(--border); }
.stat-card-filter.active .stat-label::after {
  content: " ×";
  font-weight: 600;
  color: var(--card-color, var(--text-3));
}
@media (prefers-reduced-motion: reduce) {
  .stat-card-filter { transition: none; }
}

.stat-label {
  font-size: .6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  margin-top: 7px;
}

/* ── CONTROLS ────────────────────────────────────────────────────────────── */
.controls-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.search-wrap {
  flex: 1;
  min-width: 240px;
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-4);
  pointer-events: none;
  width: 15px;
  height: 15px;
}
input[type="search"] {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .875rem;
  color: var(--text-1);
  background: var(--bg);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type="search"]::placeholder { color: var(--text-3); }
input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  background: var(--surface);
}
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.controls-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}
select {
  padding: 8px 30px 8px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .8125rem;
  color: var(--text-2);
  background: var(--bg);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 9px center;
  transition: border-color .15s;
}
select:focus { border-color: var(--accent); }
.clear-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .8125rem;
  color: var(--text-2);
  background: var(--bg);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.clear-btn:hover { border-color: var(--border-strong); background: var(--surface-3); }
.clear-btn:disabled { opacity: .4; cursor: default; pointer-events: none; }

/* ── TOOLBAR ─────────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -.01em;
}
.section-count {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 2px 10px;
  white-space: nowrap;
}
/* keep legacy selector working for any leftover references */
.result-count { font-size: .8125rem; color: var(--text-3); }

/* ── TABLE ───────────────────────────────────────────────────────────────── */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
/* Fallback for narrow screens, where the app-shell layout is off and the page
   scrolls normally. A proportion of the viewport, not an offset guess. */
.table-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 70dvh;
  min-height: 200px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8125rem;
  table-layout: fixed;
}
thead th {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 9px 14px;
  text-align: left;
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  white-space: nowrap;
  user-select: none;
  overflow: hidden;
}
/* Only the tables that scroll inside their own box get a pinned header row —
   scoping this keeps the docs/stats tables from floating theirs over the page. */
.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
thead th.sortable { cursor: pointer; }
thead th.sortable:hover { color: var(--text-2); background: var(--surface-3); }
/* Reserve the arrow slot up front so sorting never shifts the column width */
thead th.sortable::after {
  content: '';
  display: inline-block;
  width: 1.1em;
  font-size: .625rem;
  color: var(--accent);
}
thead th.sort-asc::after  { content: ' ▲'; }
thead th.sort-desc::after { content: ' ▼'; }

/* Column resize handle */
.col-resize {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 5px;
  cursor: col-resize;
  background: transparent;
  z-index: 3;
}
.col-resize:hover, .col-resize.active { background: var(--accent); opacity: .4; }
tbody tr { transition: background .08s; }
tbody tr:hover td { background: var(--row-hover); }
tbody tr:not(:last-child) td { border-bottom: 1px solid var(--border-soft); }
td {
  padding: 9px 14px;
  color: var(--text-2);
  vertical-align: middle;
}
td.col-num  { color: var(--text-3); font-size: .75rem; width: 44px; }
td.col-pub  { color: var(--text-1); font-weight: 500; }
td.col-name { color: var(--text-1); }
td.col-ver  {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', Menlo, monospace;
  font-size: .75rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge-yes { background: var(--badge-yes-bg); color: var(--badge-yes-fg); }
.badge-no  { background: var(--badge-no-bg);  color: var(--badge-no-fg); }

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 500;
  white-space: nowrap;
}
.tag-arch {
  background: var(--tag-arch-bg);
  color: var(--tag-arch-fg);
  font-family: ui-monospace, 'Cascadia Code', Menlo, monospace;
  font-size: .75rem;
}
.tag-locale {
  background: var(--tag-bg);
  color: var(--tag-fg);
  margin: 1px;
}

/* Empty state */
.empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-3);
}
.empty-state svg { stroke: var(--text-4); }
.empty-state p { font-size: .9375rem; margin-top: 12px; }

/* ── STATISTICS VIEW ─────────────────────────────────────────────────────── */
.stats-page-header {
  margin-bottom: 24px;
}
.stats-page-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-1);
}
.stats-page-header p {
  font-size: .8125rem;
  color: var(--text-3);
  margin-top: 4px;
}
#stats-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.stats-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--card-color, var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.stats-block-title {
  font-size: .8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  margin-bottom: 16px;
}
/* Publisher bars */
.pub-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: .8125rem;
}
.pub-name {
  width: 160px;
  flex-shrink: 0;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .3s ease;
}
.pub-count {
  width: 36px;
  text-align: right;
  font-size: .75rem;
  color: var(--text-3);
  flex-shrink: 0;
}
/* Stats tables */
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8125rem;
}
.stats-table thead th {
  padding: 6px 10px;
  text-align: left;
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.stats-table tbody td {
  padding: 7px 10px;
  color: var(--text-2);
  vertical-align: middle;
}
.stats-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid var(--border-soft);
}
.stats-table tbody tr:hover td { background: var(--row-hover); }
.stats-note {
  margin-top: 10px;
  font-size: .75rem;
  color: var(--text-3);
}

/* ── CHANGES VIEW ────────────────────────────────────────────────────────── */
.changes-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}
.changes-tab {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.changes-tab:hover { background: var(--bg); color: var(--text-1); }
.changes-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.changes-meta {
  font-size: .8125rem;
  color: var(--text-3);
  margin-bottom: 24px;
}
.changes-meta strong { color: var(--text-2); }
.changes-section { margin-bottom: 28px; }
.changes-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: .875rem;
}
.changes-no-data {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: .875rem;
}

/* ── DOCS VIEW ───────────────────────────────────────────────────────────── */
.docs-container {
  max-width: 860px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.docs-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
}
.docs-section h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 8px;
}
.docs-section p {
  font-size: .875rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 16px;
}
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8125rem;
}
.docs-table thead th {
  padding: 8px 12px;
  text-align: left;
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.docs-table thead th:first-child { border-radius: 4px 0 0 0; }
.docs-table thead th:last-child  { border-radius: 0 4px 0 0; }
.docs-table tbody td {
  padding: 9px 12px;
  color: var(--text-2);
  vertical-align: top;
  line-height: 1.5;
}
.docs-table tbody tr:not(:last-child) td { border-bottom: 1px solid var(--border-soft); }
.docs-table tbody tr:hover td { background: var(--row-hover); }
.docs-table code {
  font-family: ui-monospace, 'Cascadia Code', Menlo, monospace;
  font-size: .8125rem;
  background: var(--surface-3);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text-1);
}

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
footer {
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .75rem;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
footer a { color: var(--text-3); text-decoration: none; }
footer a:hover { color: var(--text-1); }
.footer-links { display: flex; align-items: center; gap: 8px; }
.footer-sep { color: var(--border-strong); }
.footer-imprint-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: var(--text-3);
  cursor: pointer;
  font-family: inherit;
}
.footer-imprint-btn:hover { color: var(--text-1); }
.heart { color: var(--heart); }

/* ── IMPRINT MODAL ───────────────────────────────────────────────────────── */
.imprint-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(2px);
  z-index: 1000;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}
.imprint-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.imprint-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(.96);
  transition: transform .18s ease;
}
.imprint-overlay.open .imprint-modal {
  transform: scale(1);
}
.imprint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.imprint-title {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text-1);
}
.imprint-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  border-radius: 6px;
  color: var(--text-3);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.imprint-close:hover { background: var(--bg); color: var(--text-1); }
.imprint-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  font-size: .875rem;
  color: var(--text-2);
  line-height: 1.6;
}
.imprint-label {
  font-size: .75rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 500;
}
.imprint-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1);
}
.imprint-body a { color: var(--accent); text-decoration: none; }
.imprint-body a:hover { text-decoration: underline; }
.imprint-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner  { padding: 0 16px; gap: 12px; }
  .header-dates  { display: none; }
  .header-sub    { display: none; }
  .header-meta   { gap: 14px; flex-shrink: 0; }
  /* Let the title ellipsis rather than wrap out of the fixed-height header */
  .header-brand      { min-width: 0; }
  .header-brand > div { min-width: 0; }
  .header-title  {
    font-size: .9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topnav-inner  { padding: 0 16px; gap: 0; }
  main           { padding: 16px 16px 40px; }
  footer         { padding: 16px; flex-direction: column; text-align: center; }
  .stats-grid    { grid-template-columns: 1fr; }
  .docs-container { max-width: 100%; }

  /* Data tables: give the remaining columns room and scroll sideways rather
     than crushing eight columns into a phone width. */
  #view-catalog table,
  #view-changes table { min-width: 580px; }
  td, thead th { padding: 9px 10px; }

  /* Drop the two lowest-value catalog columns: row number and locales */
  #view-catalog thead th:nth-child(1),
  #view-catalog tbody td:nth-child(1),
  #view-catalog thead th:nth-child(8),
  #view-catalog tbody td:nth-child(8) { display: none; }
}

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