:root {
  color-scheme: dark;
  font: 18px system-ui, sans-serif;
  background: #10191c;
  color: #f5f2e9;
  --accent: #f3cb81;
  --panel: #1c2a2e;
  --muted: #becac9;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header, nav, .actions, .catalog-head, .filters, .player-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}
header {
  background: #141f22;
  border-bottom: 1px solid #354548;
  padding: 18px 5vw;
  flex-wrap: wrap;
  justify-content: space-between;
}
.brand { font-weight: 780; font-size: 1.3rem; }
.brand span { color: var(--accent); margin-right: 6px; }
nav { flex-wrap: wrap; }
main { margin: 36px auto; width: min(90vw, 1500px); }
button, input, select {
  font: inherit;
  color: inherit;
  background: var(--panel);
  border: 1px solid #485b5d;
  border-radius: 9px;
  padding: 11px 15px;
}
button { cursor: pointer; }
button:hover, button[aria-current="page"], #import { background: var(--accent); color: #172023; }
:focus { outline: 3px solid var(--accent); outline-offset: 3px; }
h1 { margin: 0 0 18px; font-size: clamp(1.7rem, 4vw, 3rem); }
.panel { max-width: 720px; margin: 7vh auto 0; padding: 30px; background: var(--panel); border-radius: 16px; }
form { display: grid; gap: 18px; }
label { display: grid; gap: 7px; color: var(--muted); }
input { min-width: 0; }
.actions, .filters, .catalog-head { flex-wrap: wrap; }
.catalog-head { justify-content: space-between; margin-bottom: 16px; }
.catalog-head h1 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr)); gap: 14px; }
.tile {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  overflow-wrap: anywhere;
}
.tile span { font-size: .79rem; opacity: .8; }
#back, #more { margin: 14px 0; }
#status, #play-status { color: var(--accent); }
#player { position: fixed; inset: 0; background: #0a1012; padding: 2vh 4vw; overflow: auto; }
.player-bar h2 { flex: 1; font-size: clamp(1rem, 2.7vw, 1.5rem); }
video { display: block; width: 100%; height: 75vh; background: #000; }

.discovery-suppressed, .discovery-only #playlist-nav, .discovery-only #manage,
.discovery-only #discover-toggle, .discovery-only #setup { display: none; }
.discovery-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.discovery-form input { flex: 1 1 280px; }
.discovery-form button { background: var(--accent); color: #172023; }
.discovery-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-height: 205px;
  padding: 18px;
  border-radius: 12px;
  background: var(--panel);
}
.discovery-card h3, .discovery-card p { margin: 0; }
.discovery-card p, .source-note { color: var(--muted); font-size: .85rem; }
.discovery-card img { width: 85px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 5px; }
.discovery-card a, .source-note a, #discovery-results > a { color: var(--accent); }
.discovery-card a:first-of-type { margin-top: auto; }
