:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff8eb;
  background: #171719;
  line-height: 1.45;
  --bg: #171719;
  --panel: #222225;
  --panel-2: #2a2a2e;
  --line: #3c3c42;
  --text: #fff8eb;
  --muted: #bbb7af;
  --orange: #ff7a18;
  --focus: #ffbd70;
  --red: #e83128;
  --red-dark: #a61d19;
  --green: #61d18b;
  --rust: var(--orange);
  --ink: var(--text);
  --paper: var(--panel);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--orange); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .35rem clamp(1rem, 4vw, 3rem);
  background: #171719f5;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px #0005;
  backdrop-filter: blur(10px);
}
.brand-lockup { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.brand { display: flex; align-items: center; gap: .5rem; min-width: 0; color: var(--text); text-decoration: none; }
.podcast-logo { display: block; width: clamp(225px, 21vw, 260px); height: auto; }
.vault-label { flex: 0 0 auto; color: var(--orange); font-size: .58rem; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.brand-divider { width: 1px; height: 34px; flex: 0 0 auto; background: var(--line); }
.roasted-brand { display: flex; align-items: center; flex: 0 1 145px; min-width: 105px; }
.roasted-brand img { display: block; width: 100%; height: auto; }
nav { display: flex; gap: 1rem; align-items: center; }
nav a, .link { min-height: auto; color: var(--text); background: none; border: 0; padding: 0; text-decoration: none; font: inherit; }
nav a:hover, .link:hover { color: var(--orange); }
nav form { margin: 0; }
main { max-width: 1400px; margin: auto; padding: clamp(1rem, 3vw, 2.5rem); }
h1 { font-size: clamp(1.8rem, 5vw, 3.4rem); line-height: 1; letter-spacing: -.04em; margin: .4rem 0 1rem; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--orange);
  color: var(--bg);
  padding: .65rem 1rem;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { filter: brightness(1.08); }
button:active, .button:active { transform: translateY(1px); }
button.danger, .button.danger { background: var(--red-dark); color: white; }
button.secondary, .button.secondary { background: #303035; border-color: #4a4a51; color: var(--text); }
.button.disabled { opacity: .38; cursor: default; pointer-events: none; }
input, textarea, select {
  width: 100%;
  padding: .7rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #111113;
  color: var(--text);
}
input[type="range"] { accent-color: var(--orange); }
label { color: var(--muted); font-weight: 750; }
.hero { display: flex; align-items: end; justify-content: space-between; margin-bottom: 1.4rem; }
.queue-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.queue-tabs a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: transparent;
  color: var(--text);
  border: 2px solid var(--orange);
  border-radius: 999px;
  padding: .5rem .85rem;
  text-decoration: none;
  font-weight: 850;
}
.queue-tabs a.active { background: var(--orange); color: var(--bg); }
.queue-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 .38rem;
  border: 1px solid #ffffff26;
  border-radius: 999px;
  background: #ffffff17;
  color: var(--text);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.queue-tabs a.active .queue-count { background: var(--bg); color: var(--orange); border-color: var(--bg); }
.filters {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(140px, 1fr));
  gap: .6rem;
  margin-bottom: 1.2rem;
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  padding: 0 1rem 1rem;
  box-shadow: 0 7px 22px #0004;
}
.card > a { text-decoration: none; color: inherit; }
.card h2 { position: relative; z-index: 1; font-size: 1.08rem; line-height: 1.3; background: var(--panel); }
.thumb {
  height: 135px;
  margin: 0 -1rem;
  display: grid;
  place-items: center;
  position: relative;
  background: linear-gradient(145deg, #3c2518, #111113);
  color: #f2cfa9;
  text-transform: uppercase;
  overflow: hidden;
}
.thumb b {
  position: absolute;
  bottom: .5rem;
  right: .5rem;
  background: #000d;
  color: white;
  padding: .25rem .45rem;
  border-radius: 6px;
  font-size: .72rem;
}
.meta, .note { font-size: .85rem; color: var(--muted); }
.tags { display: flex; gap: .3rem; flex-wrap: wrap; }
.tags span { background: var(--panel-2); border: 1px solid var(--line); padding: .15rem .45rem; border-radius: 999px; font-size: .75rem; }
.error { background: #3a1c1c; border: 1px solid #74413e; color: #ffb0aa; padding: .65rem; border-radius: 9px; }
.quick { margin-top: .8rem; }
.quick label { font-size: .75rem; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.card-actions { display: flex; justify-content: flex-end; margin-top: .85rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.card-delete {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .45rem .75rem;
  border: 1px solid #8d4945;
  border-radius: 9px;
  color: #ffaaa4;
  font-size: .82rem;
  font-weight: 850;
  text-decoration: none;
}
.card-delete:hover { background: #3a1c1c; color: #ffd3d0; }
.form-page, .login, .detail {
  max-width: 900px;
  margin: 2rem auto;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: clamp(1rem, 4vw, 2.5rem);
  border-radius: 15px;
  box-shadow: 0 18px 48px #0005;
}
.login { max-width: 440px; }
.share-kicker {
  margin: 0 0 .35rem;
  color: var(--orange);
  font-size: .78rem;
  font-weight: 950;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.shared-title { color: var(--muted); overflow-wrap: anywhere; }
.phone-share {
  margin-top: 2rem;
  padding: 1.1rem;
  border: 1px solid #ff7a1866;
  border-radius: 12px;
  background: linear-gradient(145deg, #332318, #1c1c1f);
}
.phone-share h2 { margin: 0 0 .5rem; }
.phone-share p { margin: .55rem 0; }
.phone-share .secondary { margin: .4rem 0; }
.install-status { color: var(--text); }
.platform-note { color: var(--muted); font-size: .86rem; }
.result { display: grid; gap: .4rem; border-bottom: 1px solid var(--line); padding: 1rem 0; }
.result.bad b { color: #ff9b95; }
.detail video, .show video { width: 100%; max-height: 72vh; background: #000; border: 1px solid var(--line); border-radius: 10px; }
.archive-frame { width: 100%; height: 65vh; border: 1px solid var(--line); border-radius: 10px; background: white; }
.show-frame { height: 72vh; }
.detail dl { display: grid; grid-template-columns: 8rem 1fr; }
.detail dt { font-weight: bold; }
.detail code { overflow-wrap: anywhere; }
.source-warning { color: var(--muted); }
.music-scan-status { margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.music-scan-status h2 { margin-top: 0; }
.music-scan-badge { display: inline-block; margin: .65rem 0 0; padding: .35rem .7rem; border: 1px solid #356a4b; border-radius: 999px; background: #183525; color: #bff3d1; font-size: .82rem; font-weight: 850; }
.music-scan-badge.warning { border-color: #7a5b2e; background: #3a2d18; color: #ffd694; }
.show { text-align: center; }
.show-tabs { justify-content: center; }
.show-controls { display: flex; justify-content: center; gap: 1rem; align-items: center; margin: 1rem; }
.show-controls form { margin: 0; }
.shortcut-hint { color: var(--muted); margin: .5rem 0 0; }
kbd { display: inline-block; min-width: 1.8em; padding: .08rem .35rem; border: 1px solid #5a5a61; border-bottom-width: 3px; border-radius: 5px; background: #303035; color: var(--text); font: 800 .82em/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; text-align: center; }
.message { padding: .8rem; background: #183525; border: 1px solid #356a4b; color: #bff3d1; border-radius: 9px; margin-bottom: 1rem; }
progress { width: 100%; height: 1.5rem; accent-color: var(--orange); }
.discovery-hero { align-items: center; }
.discovery-sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.discovery-source-card, .discovery-panel, .discovery-run-header {
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  box-shadow: 0 12px 30px #0004;
}
.discovery-source-card h2, .discovery-panel h2 { margin: 0; }
.source-card-heading { display: flex; justify-content: space-between; gap: 1rem; }
.source-card-heading p { margin: .35rem 0 0; color: var(--muted); }
.source-state { align-self: start; padding: .25rem .6rem; border-radius: 999px; background: #3a1c1c; color: #ffb0aa; font-weight: 900; font-size: .75rem; text-transform: uppercase; }
.source-state.enabled { background: #183525; color: #bff3d1; }
.discovery-stats { display: grid; gap: .35rem; margin: 1rem 0; color: var(--muted); }
.discovery-stats b { color: var(--orange); }
.discovery-run-form p { margin: .55rem 0; }
.discovery-run-form label { display: block; font-size: .8rem; }
.discovery-run-form .button { margin-top: .45rem; }
.latest-run { color: var(--muted); font-size: .82rem; }
.discovery-panel { margin-top: 1rem; }
.run-list { display: grid; }
.run-list a { display: grid; grid-template-columns: minmax(150px, .8fr) 2fr auto; gap: .7rem; padding: .7rem 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.run-list span, .run-list time { color: var(--muted); }
.discovery-panel summary { cursor: pointer; color: var(--orange); font-size: 1.2rem; font-weight: 900; }
.daily-remaining { padding: .5rem .85rem; border: 1px solid #ff7a1866; border-radius: 999px; color: var(--orange); font-weight: 900; }
.run-summary { padding: .8rem; border-left: 4px solid var(--orange); background: var(--panel-2); }
.copy-batches { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin: 1rem 0; }
.copy-status { color: var(--green); }
.bulk-actions { position: sticky; top: 78px; z-index: 3; display: flex; flex-wrap: wrap; gap: .5rem; padding: .75rem; border: 1px solid var(--line); border-radius: 12px; background: #171719f5; box-shadow: 0 8px 24px #0007; backdrop-filter: blur(10px); }
.bulk-actions input { flex: 1 1 220px; width: auto; }
.candidate-list { display: grid; gap: .85rem; margin-top: 1rem; }
.candidate-section-title {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.candidate-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 7px 22px #0004; }
.candidate-card > img { grid-column: 2; width: min(320px, 100%); max-height: 180px; object-fit: cover; border-radius: 9px; }
.candidate-select { grid-row: 1 / span 2; display: flex; flex-direction: column; gap: .65rem; align-items: center; }
.candidate-select input[type="checkbox"] { width: 1.4rem; height: 1.4rem; accent-color: var(--orange); }
.candidate-select input[type="number"] { width: 4.5rem; }
.candidate-copy { grid-column: 2; }
.candidate-copy h2 { margin: .4rem 0; font-size: 1.35rem; }
.candidate-heading, .candidate-links { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.candidate-status, .candidate-score { padding: .25rem .55rem; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: .75rem; font-weight: 900; }
.candidate-score { color: var(--orange); }
.candidate-recommended { border-color: #ff7a1888; }
.candidate-imported { border-color: #356a4b; }
.candidate-duplicate, .candidate-rejected { opacity: .72; }
.discussion-hook { color: #ffd6ac; }
.qualification, .warning { padding: .6rem; border-radius: 8px; background: #3a2d18; color: #ffd694; }
.candidate-links { margin: .8rem 0; }
.candidate-links a { padding-right: .5rem; }
.candidate-copy details { border-top: 1px solid var(--line); padding-top: .7rem; }
.candidate-copy summary { cursor: pointer; color: var(--muted); font-weight: 800; }
.candidate-copy dl { display: grid; grid-template-columns: 9rem 1fr; gap: .3rem .7rem; }
.candidate-copy dt { font-weight: 900; }
.candidate-copy dd { margin: 0; color: var(--muted); }
@media (max-width: 800px) {
  header { align-items: center; flex-wrap: wrap; }
  .brand-lockup { width: 100%; justify-content: center; }
  .podcast-logo { width: min(230px, 54vw); }
  .roasted-brand { flex-basis: min(135px, 32vw); }
  nav { width: 100%; gap: .65rem; flex-wrap: wrap; justify-content: center; font-size: .85rem; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters input:first-child { grid-column: 1 / -1; }
  .hero { align-items: center; }
  .cards { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .show-controls { flex-wrap: wrap; }
  .discovery-sources { grid-template-columns: 1fr; }
  .run-list a { grid-template-columns: 1fr; gap: .2rem; }
  .bulk-actions { top: 126px; }
  .candidate-card { gap: .6rem; padding: .8rem; }
  .candidate-copy dl { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  header { padding: .3rem .7rem; }
  .brand-lockup { gap: .4rem; }
  .podcast-logo { width: 205px; }
  .vault-label { font-size: .5rem; }
  .brand-divider { height: 28px; }
  .roasted-brand { flex-basis: 110px; min-width: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
