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

[hidden] {
  display: none !important;
}

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface2: #242424;
  --border: #2e2e2e;
  --text: #e8e8e8;
  --text-muted: #888;
  --accent: #c8a97e;
  --accent-hover: #dbbe96;
  --danger: #c0392b;
  --danger-hover: #e74c3c;
  --play: #27ae60;
  --clean: #2980b9;
  --rate: #f39c12;
  --radius: 8px;
  --font: 'Segoe UI', system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* Header */
header {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: border-bottom-color 0.2s;
}
header.mode-play {
  border-bottom-color: var(--play);
}
header.mode-clean {
  border-bottom-color: var(--clean);
}
header.mode-rate {
  border-bottom-color: var(--rate);
}
header.mode-select {
  border-bottom-color: var(--danger);
}
.header-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
  margin-right: 0.5rem;
  display: flex;
  align-items: center;
}
nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Primary nav links (Collection / Activity) */
#nav-primary {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.nav-link {
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition:
    color 0.15s,
    border-color 0.15s;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--text);
}
.nav-link-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Main */
main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.55em 1.2em;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    background 0.15s,
    opacity 0.15s;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn-primary {
  background: var(--accent);
  color: #111;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface2);
  color: var(--text);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
}
.btn-play {
  background: var(--play);
  color: #fff;
}
.btn-play:hover:not(:disabled) {
  filter: brightness(1.1);
}
.btn-clean {
  background: var(--clean);
  color: #fff;
}
.btn-clean:hover:not(:disabled) {
  filter: brightness(1.1);
}
.btn-sm {
  padding: 0.35em 0.9em;
  font-size: 0.82rem;
}
.btn-lg {
  padding: 0.75em 1.8em;
  font-size: 1rem;
}

/* Cards & surfaces */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* Login */
.login-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 6rem;
}
.login-card {
  width: 100%;
  max-width: 360px;
}
.login-card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  color: var(--accent);
}
.login-card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.form-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  color: var(--text);
  padding: 0.6em 0.85em;
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea {
  resize: vertical;
  min-height: 80px;
}
.error-msg {
  color: #e74c3c;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Record list */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.list-header h1 {
  font-size: 1.4rem;
}
.list-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Mode toggle switches */
.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  user-select: none;
  transition: color 0.15s;
}
.mode-toggle:hover {
  color: var(--text);
}
.mode-toggle input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  width: 30px;
  height: 17px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.mode-toggle input[type='checkbox']::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  background: var(--text-muted);
  border-radius: 50%;
  transition:
    transform 0.2s,
    background 0.2s;
}
.mode-toggle-play input[type='checkbox']:checked {
  background: rgba(39, 174, 96, 0.2);
  border-color: var(--play);
}
.mode-toggle-play input[type='checkbox']:checked::after {
  transform: translateX(13px);
  background: var(--play);
}
.mode-toggle-play:has(input:checked) {
  color: #5dba80;
}
.mode-toggle-clean input[type='checkbox']:checked {
  background: rgba(41, 128, 185, 0.2);
  border-color: var(--clean);
}
.mode-toggle-clean input[type='checkbox']:checked::after {
  transform: translateX(13px);
  background: var(--clean);
}
.mode-toggle-clean:has(input:checked) {
  color: #5ba8d4;
}
.mode-toggle-rate input[type='checkbox']:checked {
  background: rgba(243, 156, 18, 0.2);
  border-color: var(--rate);
}
.mode-toggle-rate input[type='checkbox']:checked::after {
  transform: translateX(13px);
  background: var(--rate);
}
.mode-toggle-rate:has(input:checked) {
  color: #f1c40f;
}
.mode-toggle-select input[type='checkbox']:checked {
  background: rgba(192, 57, 43, 0.2);
  border-color: var(--danger);
}
.mode-toggle-select input[type='checkbox']:checked::after {
  transform: translateX(13px);
  background: var(--danger);
}
.mode-toggle-select:has(input:checked) {
  color: #e07060;
}

/* Mode banner */
.mode-banner {
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  overflow: hidden;
  max-height: 0;
  padding: 0 1rem;
  margin-bottom: 0;
  transition:
    max-height 0.2s ease,
    padding 0.2s ease,
    margin 0.2s ease;
}
.mode-banner-active {
  max-height: 60px;
  padding: 0.7rem 1rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  position: sticky;
  top: calc(56px + 0.5rem);
  z-index: 90;
}
.mode-banner-play {
  background: #0e2318;
  border: 1px solid rgba(39, 174, 96, 0.35);
  color: #5dba80;
}
.mode-banner-clean {
  background: #0d1e2e;
  border: 1px solid rgba(41, 128, 185, 0.35);
  color: #5ba8d4;
}
.mode-banner-rate {
  background: #251c08;
  border: 1px solid rgba(243, 156, 18, 0.35);
  color: #f1c40f;
}
.mode-banner-select {
  background: #231010;
  border: 1px solid rgba(192, 57, 43, 0.35);
  color: #e07060;
}

/* Filter bar (search + dropdowns) */
.filter-bar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}
.filter-selects {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}
.search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.55em 0.9em;
  font-size: 0.9rem;
  font-family: inherit;
  flex: 1;
  min-width: 160px;
  max-width: 280px;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
}
.filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5em 0.75em;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
}
.filter-select:focus {
  outline: none;
  border-color: var(--accent);
}
.filter-select-active {
  border-color: var(--accent);
  background: rgba(200, 169, 126, 0.08);
  color: var(--text);
}

/* Legacy .search-bar (kept for safety) */
.search-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.search-bar input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.55em 0.9em;
  font-size: 0.9rem;
  font-family: inherit;
  flex: 1;
  max-width: 340px;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
}

.record-table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
thead th {
  text-align: left;
  padding: 0.6rem 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
thead th:hover {
  color: var(--text);
}
.th-sorted {
  color: var(--accent) !important;
}

/* Row states */
.record-row {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.record-row:hover {
  background: var(--surface2);
}
.mode-row-play:hover {
  background: rgba(39, 174, 96, 0.08);
}
.mode-row-clean:hover {
  background: rgba(41, 128, 185, 0.08);
}
.mode-row-rate:hover {
  background: rgba(243, 156, 18, 0.08);
}
.mode-row-select {
  cursor: pointer;
}
.mode-row-select:hover {
  background: rgba(192, 57, 43, 0.06);
}
.row-selected {
  background: rgba(192, 57, 43, 0.1) !important;
  box-shadow: inset 3px 0 0 var(--danger);
}
.row-selected:hover {
  background: rgba(192, 57, 43, 0.15) !important;
}

.td-interactive-rating .stars {
  display: inline-flex;
}
.star-clickable {
  color: var(--text-muted);
  transition: color 0.1s;
}
.star-clickable:hover {
  color: var(--accent);
}
.interactive-stars:hover .star-clickable {
  color: var(--accent);
}
.interactive-stars .star-clickable {
  color: var(--accent);
}
.row-logging {
  opacity: 0.5;
  pointer-events: none;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
tbody tr:hover {
  background: var(--surface2);
}
tbody td {
  padding: 0.75rem 0.85rem;
  vertical-align: middle;
}
thead th {
  vertical-align: middle;
}
.td-muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}
.empty-state p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

/* Rating stars */
.stars {
  color: var(--accent);
  letter-spacing: 1px;
  font-size: 0.85rem;
}
.stars-empty {
  color: var(--border);
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.badge-discogs {
  background: rgba(243, 100, 32, 0.15);
  border-color: rgba(243, 100, 32, 0.4);
  color: #f36420;
  font-size: 0.65rem;
  padding: 0.15em 0.45em;
  flex-shrink: 0;
}

/* Record detail */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.detail-title {
  flex: 1;
}
.detail-title h1 {
  font-size: 1.7rem;
  line-height: 1.2;
}
.detail-title .artist {
  color: var(--accent);
  font-size: 1rem;
  margin-top: 0.25rem;
}
.detail-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.detail-field {
}
.detail-field dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.detail-field dd {
  font-size: 0.95rem;
}

.action-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem;
  background: var(--surface2);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.action-bar .action-info {
  flex: 1;
  min-width: 200px;
}
.action-bar .action-info dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.action-bar .action-info dd {
  font-size: 0.9rem;
}
.action-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Event log */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.event-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.event-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  background: var(--surface2);
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.88rem;
}
.event-badge-play {
  background: rgba(39, 174, 96, 0.15);
  color: #5dba80;
  border: 1px solid rgba(39, 174, 96, 0.3);
}
.event-badge-clean {
  background: rgba(41, 128, 185, 0.15);
  color: #5ba8d4;
  border: 1px solid rgba(41, 128, 185, 0.3);
}
.event-time {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-left: auto;
  white-space: nowrap;
}
.event-notes {
  color: var(--text-muted);
  font-style: italic;
}

/* Record form */
.form-section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 1.25rem 0 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0 1rem;
}
.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}
.back-link:hover {
  color: var(--text);
}

/* Spinner */
.spinner {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* Enrichment progress — thin line at very top + banner below header */
#enrich-banner {
  background: #1e1a12;
  border-bottom: 1px solid #3a2e10;
  padding: 0.5rem 1.5rem;
}
.enrich-banner-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.enrich-banner-text {
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
}
.enrich-banner-track {
  width: 240px;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
}
.enrich-banner-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.8s ease;
  min-width: 4px;
}

/* Toast */
#toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  z-index: 999;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.2s,
    transform 0.2s;
  pointer-events: none;
  max-width: 320px;
}
#toast.show {
  opacity: 1;
  transform: translateY(0);
}
#toast.toast-error {
  border-color: var(--danger);
  color: #e74c3c;
}

/* Bulk action bar */
.bulk-bar {
  overflow: hidden;
  max-height: 0;
  transition:
    max-height 0.2s ease,
    margin 0.2s ease;
  margin-bottom: 0;
}
.bulk-bar-active {
  max-height: 60px;
  margin-bottom: 0.75rem;
}
.bulk-bar-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.bulk-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.bulk-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  color: var(--text);
  padding: 0.4em 0.65em;
  font-size: 0.85rem;
  font-family: inherit;
  width: 140px;
}
.bulk-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Column picker */
.col-picker-wrap {
  position: relative;
}
.col-picker-drop {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0;
  z-index: 200;
  min-width: 160px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.col-picker-drop.open {
  display: block;
}
.col-picker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}
.col-picker-item:hover {
  background: var(--surface2);
}
.col-picker-item input[type='checkbox'] {
  accent-color: var(--accent);
  cursor: pointer;
}

/* Discogs links */
.td-artist {
  /* intentionally not flex — keeps table-cell vertical-align: middle working */
}
.td-artist .badge-discogs {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.35rem;
}
.discogs-link {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-decoration: none;
  opacity: 0.7;
  flex-shrink: 0;
}
.discogs-link:hover {
  color: var(--accent);
  opacity: 1;
}
.discogs-link-detail {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 0.4rem;
}
.discogs-link-detail:hover {
  color: var(--accent);
}

/* Mobile sort bar (hidden on desktop) */
.mobile-sort-bar {
  display: none;
}
.mobile-sort-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Activity view */
.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.activity-header h1 {
  font-size: 1.4rem;
}
.activity-type-bar {
  display: flex;
  gap: 0.4rem;
}
.activity-type-btn {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.activity-type-btn:hover {
  color: var(--text);
  background: var(--surface);
}
.activity-type-active {
  background: var(--surface);
  color: var(--text);
  border-color: var(--accent);
}

.activity-group {
  margin-bottom: 2rem;
}
.activity-group-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.activity-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.05em 0.55em;
  color: var(--text-muted);
  letter-spacing: 0;
  text-transform: none;
}
.activity-group-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.activity-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  background: var(--surface2);
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.88rem;
  flex-wrap: wrap;
}
.activity-row-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}
.activity-record-link {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
  flex-wrap: wrap;
}
.activity-record-link:hover .activity-album,
.activity-record-link:hover .activity-artist {
  color: var(--accent);
}
.activity-artist {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-sep {
  color: var(--text-muted);
  flex-shrink: 0;
}
.activity-album {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-notes {
  flex-shrink: 0;
}

/* ── Mobile ─────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  main {
    padding: 1rem;
  }

  /* Fix 1: prevent header overflow — tighten logo, nav links, hide sync button */
  .header-inner {
    padding: 0 0.75rem;
  }

  .logo {
    font-size: 1rem;
    margin-right: 0.2rem;
  }

  .logo-sub {
    display: none;
  }

  .nav-link {
    padding: 0 0.45rem;
    font-size: 0.82rem;
  }

  #nav {
    gap: 0.35rem;
  }

  #btn-sync-discogs .btn-text,
  #btn-add-nav .btn-text {
    display: none;
  }

  #nav .btn-sm {
    padding: 0.35em 0.6em;
  }

  /* Fix 2: filter bar — search full-width, selects scroll horizontally */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .search-input {
    max-width: 100%;
    flex: none;
    width: 100%;
  }

  .filter-selects {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    width: 100%;
    min-width: 0;
  }

  .filter-selects::-webkit-scrollbar {
    display: none;
  }

  .filter-select,
  .filter-selects .btn {
    flex-shrink: 0;
  }

  /* Show sort bar on mobile */
  .mobile-sort-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
  }

  /* Tighten cell padding on mobile */
  tbody td,
  thead th {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  /* Detail view: allow action-info to shrink */
  .action-bar .action-info {
    min-width: 130px;
  }

  .list-header h1,
  .activity-header h1 {
    font-size: 1.2rem;
  }

  .activity-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Toast: center at bottom on mobile */
  #toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: none;
  }
}
