.home-search-shell {
  max-width: 880px;
  margin: 40px auto 24px;
  padding: 32px 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.home-search-input {
  width: 100%;
  padding: 18px 22px;
  font-size: 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0f141c;
  color: var(--text);
}

.home-search-input::placeholder {
  color: var(--muted);
}

.home-search-actions {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
}

.home-search-actions .button {
  padding: 10px 22px;
  font-size: 14px;
}
:root {
  --bg-1: #0b0f14;
  --bg-2: #111827;
  --panel: #141a22;
  --text: #e6edf3;
  --muted: #9aa4af;
  --accent: #59b0ff;
  --border: rgba(148, 163, 184, 0.2);
  --shadow: 0 18px 40px rgba(5, 8, 12, 0.6);
  --warn: #f1c768;
  --danger: #ff7b7b;
}

:root[data-theme="light"] {
  --bg-1: #f5f7fb;
  --bg-2: #e6edf7;
  --panel: #ffffff;
  --text: #111827;
  --muted: #5a6472;
  --accent: #2b6ff7;
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --warn: #c78100;
  --danger: #c94040;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  line-height: 1.5;
  background: radial-gradient(circle at 15% 20%, rgba(35, 62, 92, 0.35), transparent 55%),
              radial-gradient(circle at 70% 10%, rgba(43, 92, 133, 0.25), transparent 45%),
              linear-gradient(135deg, var(--bg-1), var(--bg-2));
  overflow-x: hidden;
}

:root[data-theme="light"] body {
  background: radial-gradient(circle at 15% 20%, rgba(100, 141, 204, 0.18), transparent 55%),
              radial-gradient(circle at 70% 10%, rgba(120, 170, 210, 0.14), transparent 45%),
              linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(48, 92, 134, 0.3), transparent 45%),
              radial-gradient(circle at 80% 0%, rgba(26, 55, 86, 0.4), transparent 40%);
  pointer-events: none;
  z-index: 0;
}

:root[data-theme="light"] .backdrop {
  background: radial-gradient(circle at 20% 20%, rgba(110, 150, 210, 0.18), transparent 45%),
              radial-gradient(circle at 80% 0%, rgba(120, 160, 210, 0.16), transparent 40%);
}

/* ===== HOME PAGE LAYOUT OVERRIDE ===== */
body.home-page {
  /* Remove all gradients and blue backgrounds for the homepage, use a neutral background */
  background: #0b0f14 !important;
  font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}
body.home-page .backdrop {
  display: none;
}
body.home-page .layout {
  grid-template-columns: 1fr !important;
  justify-items: center;
  align-items: start;
  padding: 32px 24px 60px;
}
body.home-page .panel {
  max-width: 1200px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
body.home-page .home-search-shell {
  max-width: 1120px;
  width: min(100%, 1120px);
  margin: 48px auto 32px;
  background: #10151c;
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 24px 60px rgba(4, 6, 12, 0.55);
}
body.home-page .home-search-input {
  font-size: 19px;
  padding: 20px 24px;
}
body.home-page.search-active .home-search-shell {
  margin: 20px auto 18px;
  padding: 18px 22px;
  gap: 12px;
  box-shadow: 0 16px 40px rgba(4, 6, 12, 0.45);
}
body.home-page.search-active .home-search-input {
  font-size: 16px;
  padding: 14px 18px;
}
body.home-page.search-active #home-search-message {
  display: none;
}
body.home-page .home-results {
  max-width: 1300px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  background: rgba(15, 20, 28, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  gap: 12px;
}

:root[data-theme="light"] .topbar {
  background: rgba(248, 250, 252, 0.96);
}

.brand .title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand .subtitle {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.app-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  background: #0d1117;
  object-fit: cover;
}

:root[data-theme="light"] .app-icon {
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#top-actions:empty {
  display: none;
}

.filters {
  gap: 10px;
}

.filters-block {
  display: block;
}

.filters-toggle {
  display: none;
}

.nav-toggle {
  display: none;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

body.home-page .home-search-actions {
  justify-content: center;
  gap: 10px;
}

body.home-page .home-search-toggles {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

body.home-page .home-source-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
}

body.home-page .home-advanced-toggle {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
  border-radius: 999px;
}

body.home-page .home-advanced-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

body.home-page #home-view-advanced {
  display: none;
}

body.home-page #home-advanced-panel .home-advanced-field.inline {
  display: none;
}

body.home-page .home-source-toggle {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #e5e7eb;
}

body.home-page .home-source-panel {
  position: absolute;
  z-index: 20;
  background: #0f141b;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 10px;
  margin-top: 6px;
  display: none;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}

body.home-page .home-source-panel.open {
  display: flex;
}

body.home-page .home-source-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  font-size: 14px;
  cursor: pointer;
  color: #d0d7de;
}
body.home-page .home-source-panel .home-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #121821;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  padding: 6px 10px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
body.home-page .home-source-panel .home-source-pill input {
  accent-color: var(--accent);
}
body.home-page .home-source-panel .home-source-pill span {
  font-size: 13px;
}
body.home-page .home-source-panel .home-source-pill.selected {
  border-color: var(--accent);
  background: rgba(239, 68, 68, 0.12);
  color: #fff;
}

.home-advanced-toggle {
  text-align: right;
}

.home-results {
  margin-top: 16px;
  padding: 20px 22px 26px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 16px;
  background: #0f141b;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-left: auto;
  margin-right: auto;
}

.home-results.hidden {
  display: none;
}

.home-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.home-results-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-result-card {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(10, 14, 20, 0.85);
}

.home-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.home-result-destination {
  font-size: 12px;
  color: var(--muted);
  margin-top: -4px;
}

.home-result-badge {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.home-results-detail {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.home-results-detail.home-results-error {
  color: var(--danger);
  font-weight: 600;
}

.home-result-badge.long {
  min-width: 80px;
  text-align: center;
}

.home-result-badge.searching {
  background: rgba(90, 90, 255, 0.15);
  color: #5a5aff;
}

.home-result-badge.matched {
  background: rgba(27, 201, 176, 0.15);
  color: #1bc9b0;
}

.home-result-badge.queued {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}

.home-result-badge.downloading {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.home-result-badge.complete {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.home-result-badge.failed {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.home-candidate-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-candidate-row {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 16px;
  min-height: 112px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  width: 100%;
}

.home-candidate-row:last-child {
  border-bottom: none;
}

.home-candidate-artwork {
  width: 168px;
  height: 94px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

/* Ensure artwork thumbnails always display */
.home-candidate-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block !important;
  visibility: visible !important;
}

.home-candidate-artwork:empty::before {
  display: none !important;
  content: "";
}

.home-candidate-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

body.home-page .home-candidate-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.home-candidate-meta {
  font-size: 12px;
  color: var(--muted);
}

body.home-page .home-candidate-source-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.home-candidate-source {
  font-weight: 700;
  color: inherit;
  visibility: visible;
}

.home-candidate-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  justify-content: center;
  flex-shrink: 0;
}

.home-candidate-state {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.home-candidate-open {
  text-transform: none;
  padding: 6px 10px;
  font-size: 12px;
}

.home-candidate-state.searching {
  background: rgba(59, 130, 246, 0.15);
  color: #5f9bff;
}

.home-candidate-state.matched {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.home-candidate-state.queued {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.home-candidate-state.skipped {
  background: rgba(14, 165, 233, 0.1);
  color: #38bdf8;
}

.home-candidate-state.failed {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.home-results-empty {
  text-align: center;
  color: var(--muted);
}
.page-hidden {
  display: none !important;
}

.page-full {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 150px);
  min-height: 420px;
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 20px;
  padding: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: calc(100vh - 90px);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel.subtle {
  border-style: dashed;
}

.panel.subtle .panel-title {
  color: var(--muted);
}

.panel.full {
  grid-column: 1 / -1;
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

#metrics-panel {
  display: flex;
  flex-direction: column;
}

#metrics-panel .panel-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#metrics-panel .panel-footer {
  margin-top: auto;
  padding-top: 12px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.group {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.group-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.row.tight {
  gap: 8px;
  align-items: center;
}

.row > input,
.row > select,
.row > textarea {
  flex: 1 1 220px;
  min-width: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 200px;
  font-size: 13px;
  color: var(--muted);
}

.field.gap-top {
  margin-top: 6px;
}

.field.short {
  flex: 0 1 220px;
  max-width: 240px;
}

.field.medium {
  flex: 1 1 320px;
  max-width: 420px;
}

.field.long {
  flex: 1 1 520px;
  max-width: 640px;
}

.field.full {
  flex: 1 1 100%;
  max-width: none;
  grid-column: 1 / -1;
}

.grid .field.short,
.grid .field.medium,
.grid .field.long {
  justify-self: start;
}

.field.inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.field span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.delivery-options {
  gap: 16px;
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.radio span {
  text-transform: none;
  letter-spacing: normal;
}

.radio input {
  margin: 0;
}

input, textarea {
  font-family: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  color: var(--text);
  background: #0f141c;
}

:root[data-theme="light"] input,
:root[data-theme="light"] textarea,
:root[data-theme="light"] select {
  background: #f8fafc;
}

select {
  font-family: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  color: var(--text);
  background: #0f141c;
}

input::placeholder,
textarea::placeholder {
  color: #6c7886;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.button {
  border: none;
  background: var(--accent);
  color: #081221;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
}

.button:hover {
  filter: brightness(0.95);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.button.remove {
  color: var(--danger);
  border-color: var(--danger);
}

.button.remove:hover {
  background: rgba(255, 123, 123, 0.12);
}

.button.small {
  padding: 6px 12px;
  font-size: 12px;
}

a[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.4;
}

.notice {
  font-size: 13px;
  color: var(--muted);
}

.hidden {
  display: none;
}

.notice.warn {
  color: var(--warn);
}

.notice.critical {
  color: var(--danger);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #0f1724;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
}

.chip.running {
  background: var(--accent);
  color: #fff;
}

.chip.idle {
  background: #0f1724;
  color: var(--accent);
}

.meta {
  font-size: 12px;
  color: var(--muted);
}

.meta a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.meta a:hover {
  text-decoration: underline;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.stat .label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.stat span:not(.label) {
  font-size: 14px;
  font-weight: 600;
}

.version-block {
  align-items: flex-start;
}

.version-block .stat .meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #0f1724;
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.log-output {
  background: #0d1117;
  color: #d8dee9;
  border-radius: 10px;
  padding: 12px;
  min-height: 200px;
  overflow: auto;
  font-family: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
  font-size: 12px;
}

:root[data-theme="light"] .log-output {
  background: #f1f5f9;
  color: #0f172a;
}

.table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  max-width: 100%;
}


#search-requests-panel .table-wrap {
  height: 260px;
  overflow-y: auto;
}

.source-priority-list {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 36, 0.4);
}

:root[data-theme="light"] .source-priority-list {
  background: #f8fafc;
}

.source-priority-row {
  justify-content: space-between;
  flex-wrap: nowrap;
}

.source-priority-row .field.inline {
  margin: 0;
}

#downloads-panel .table-wrap,
#history-panel .table-wrap {
  flex: 1;
  min-height: 0;
}

#logs-panel .log-output {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table thead {
  background: #0f1724;
}

.table tbody tr:nth-child(even) {
  background: #111927;
}

.table tbody tr.selected {
  background: rgba(89, 176, 255, 0.18);
}


.cell-title {
  font-weight: 600;
  font-size: 12px;
}

.candidate-artwork {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}

:root[data-theme="light"] .table thead {
  background: #f1f5f9;
}

:root[data-theme="light"] .table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.playlist-separator {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 10px 0 0;
}

.account-row .account-name {
  flex: 0 1 180px;
  max-width: 200px;
}

.account-row .field {
  flex: 1 1 360px;
  max-width: 520px;
}

.playlist-row .playlist-name {
  flex: 0 1 180px;
  max-width: 200px;
}

.playlist-row .playlist-id {
  flex: 1 1 280px;
  max-width: 340px;
}

.playlist-row .playlist-folder {
  flex: 1 1 240px;
  max-width: 300px;
}

.playlist-row .playlist-account {
  flex: 0 1 180px;
  max-width: 200px;
}

.playlist-row .playlist-format {
  flex: 0 1 140px;
  max-width: 160px;
}

.playlist-row .field.inline {
  flex: 0 1 220px;
  max-width: 260px;
}

.spotify-playlist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.spotify-playlist-row:last-child {
  border-bottom: none;
}

.spotify-playlist-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spotify-playlist-title {
  font-weight: 700;
}

.spotify-playlist-summary {
  color: var(--muted);
  font-size: 12px;
}

.spotify-playlist-status {
  font-size: 12px;
  color: var(--muted);
}

.spotify-import-button {
  white-space: nowrap;
}

.filters .field.inline {
  flex: 0 1 240px;
  max-width: 280px;
}

.filters .field.long {
  flex: 1 1 360px;
  max-width: 440px;
}

.group .row + .notice,
.group .grid + .notice {
  margin-top: 6px;
}

.account-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.row.space-between {
  justify-content: space-between;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(720px, 92vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.browser-list {
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #0f141c;
}

:root[data-theme="light"] .browser-list {
  background: #f8fafc;
}

.browser-item {
  text-align: left;
  border: 1px solid transparent;
  padding: 8px 10px;
  border-radius: 8px;
  background: #131a24;
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
  font-size: 13px;
  cursor: pointer;
}

:root[data-theme="light"] .browser-item {
  background: #ffffff;
}

.browser-item:hover {
  border-color: var(--accent);
}

.browser-item.selected {
  border-color: var(--accent);
  background: rgba(89, 176, 255, 0.15);
}

.browser-item.empty,
.browser-item.error {
  cursor: default;
  background: #0f141c;
  color: var(--muted);
}

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

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .top-nav,
  .top-actions {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
    align-self: flex-start;
  }

  .top-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel);
  }

  body.nav-open .top-nav {
    display: flex;
  }

  .nav-actions {
    width: 100%;
    flex-direction: column;
  }

  .nav-actions .button,
  .nav-actions a.button {
    width: 100%;
  }
}

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

  .layout {
    padding: 12px;
    gap: 12px;
  }

  .topbar {
    padding: 10px 14px;
  }

  .brand .title {
    font-size: 18px;
  }

  .brand .subtitle {
    font-size: 11px;
    letter-spacing: 1px;
  }

  .panel {
    padding: 14px;
  }

  .panel-title {
    margin-bottom: 8px;
  }

  .stack {
    gap: 8px;
  }

  .row {
    gap: 8px;
  }

  .row {
    flex-direction: column;
    align-items: stretch;
  }

  .row > input,
  .row > select,
  .row > textarea {
    width: 100%;
    flex: 1 1 auto;
  }

  .field.short,
  .field.medium,
  .field.long {
    max-width: none;
    flex: 1 1 auto;
    width: 100%;
  }

  .field.inline {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-actions {
    width: 100%;
  }

  .button {
    width: 100%;
  }

  input,
  textarea,
  select {
    padding: 8px;
    font-size: 13px;
  }

  .button {
    padding: 8px 12px;
    font-size: 13px;
  }

  .button.small {
    padding: 6px 10px;
    font-size: 12px;
  }

  .account-actions {
    width: 100%;
    margin-left: 0;
  }

  .table th,
  .table td {
    word-break: break-word;
    padding: 8px;
    font-size: 11px;
  }

  .page-full {
    height: calc(100vh - 140px);
    min-height: 280px;
  }

  .filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .filters .field.inline {
    width: 100%;
  }

  .filters-toggle {
    display: inline-flex;
  }

  .filters-block {
    display: none;
  }

  .filters-block.open {
    display: block;
  }
}

body.home-page .home-results-progress {
  font-size: 13px;
  color: var(--muted);
  margin-top: -4px;
}

body.home-page .home-results.has-results .home-results-progress {
  display: none;
}
body.home-page .home-results.search-complete .home-results-progress {
  display: none;
}

body.home-page #home-results-list {
  width: 100%;
}

body.home-page .home-enqueue-error {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  color: #ffd7d7;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  max-width: 220px;
  text-align: right;
}

.home-candidate-row:hover {
  background: rgba(255,255,255,0.03);
}

/* ===== HOME PAGE COLOR TUNING ===== */
body.home-page {
  --accent: #ef4444;
}
body.home-page .button {
  background: #12161d;
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text);
}
body.home-page .button.ghost {
  background: transparent;
  color: #d0d7de;
  border-color: rgba(148, 163, 184, 0.3);
}
body.home-page .home-search-actions .button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0f14;
}
body.home-page .button:hover {
  background: #222;
}
body.home-page .home-candidate-row:hover {
  background: rgba(255,255,255,0.04);
}

/* ===== HOME SOURCES FINAL OVERRIDES ===== */
body.home-page .home-source-toggle {
  color: #e5e7eb !important;
  background: #121821 !important;
}

body.home-page .home-source-panel {
  background: #0f141b !important;
}

body.home-page .home-source-panel label,
body.home-page .home-source-panel span {
  color: #e5e7eb !important;
}

/* ===== HOME SEARCH WIDTH AUTHORITY ===== */
body.home-page .home-search-shell {
  max-width: 1200px !important;
}

body.home-page .home-search-input {
  font-size: 20px !important;
  padding: 22px 26px !important;
}

/* ===== HOME SEARCH PROGRESS HARD STOP ===== */
body.home-page .home-results.has-results .home-results-progress,
body.home-page .home-results.search-complete .home-results-progress {
  display: none !important;
}
