:root {
  color-scheme: dark;
  --bg: #0c1015;
  --panel: #131a21;
  --line: #29333b;
  --text: #eaf0f2;
  --muted: #91a2ad;
  --accent: #c8f178;
  --accent-dark: #1b2b15;
  --warm: #ffbf8b;
  font:
    15px/1.55 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
}
button,
a.button {
  cursor: pointer;
}
a.button.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button[aria-busy="true"] { cursor: wait; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
header,
main,
footer {
  max-width: 1420px;
  margin: auto;
  padding-inline: 48px;
}
header {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -1px;
}
.brand-icon {
  display: block;
  width: 38px;
  height: 38px;
  flex: none;
}
.tag,
.pill {
  font-size: 10px;
  letter-spacing: 1.3px;
  color: var(--accent);
  border: 1px solid #536542;
  border-radius: 5px;
  padding: 3px 7px;
  font-weight: 600;
}
.connection {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px #c8f13030;
}
.dot.offline {
  background: #ff8c78;
}
.tabs { display: flex; gap: 8px; padding-top: 24px; border-bottom: 1px solid var(--line); }
.tab { color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 18px 14px; cursor: pointer; font-size: 14px; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }
.setting-up .tabs, .setting-up .view { display: none; }
.wizard { max-width: 820px; margin: 48px auto 80px; border-top: 3px solid var(--accent); padding: 32px; }
.wizard-heading, .wizard-actions, .settings-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wizard-heading h2 { font-size: 28px; margin: 4px 0 20px; }
.wizard-steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 32px; }
.wizard-steps span { border-top: 3px solid var(--line); padding-top: 8px; color: var(--muted); font-size: 12px; }
.wizard-steps span.active { border-color: var(--accent); color: var(--text); }
.wizard-step h3 { font-size: 21px; }
.wizard-actions { justify-content: flex-end; margin-top: 28px; }
.wizard-actions #wizard-back { margin-right: auto; }
#wizard-error { color: var(--warm); min-height: 1em; }
.settings-page { max-width: 860px; margin-inline: auto; }
.settings-intro { padding: 26px 0 14px; }
.settings-intro h1 { font-size: 30px; letter-spacing: -1px; margin: 0; }
.settings { width: 100%; }
.inline-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.install-warning { max-width: 650px; margin-top: 18px; }
.eyebrow,
.small {
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 650;
  color: var(--muted);
}
.eyebrow {
  color: var(--accent);
}
h1 {
  font-size: clamp(40px, 4.7vw, 64px);
  line-height: 1.05;
  letter-spacing: -2.5px;
  margin: 20px 0;
}
h1 span {
  color: var(--accent);
}
h2 {
  font-size: 21px;
  letter-spacing: -0.5px;
  line-height: 1.3;
  margin: 8px 0 10px;
}
h3 {
  font-size: 18px;
  letter-spacing: -0.2px;
  margin: 10px 0;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 24px;
}
.manifest-option {
  margin-top: 16px;
}
.manifest-option label {
  margin-top: 0;
}
.manifest-option .copy-row {
  margin: 8px 0 14px;
}
.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, 130px);
  gap: 7px;
  margin: 22px 0 16px;
}
.copy-row input {
  font-family: monospace;
  font-size: 12px;
  min-width: 0;
  height: 40px;
  margin: 0;
}
.copy-row > .icon-button,
.copy-row > .button {
  width: 100%;
  height: 40px;
}
.copy-row > .button {
  padding-inline: 6px;
  white-space: nowrap;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 650;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 14px;
  line-height: 1.4;
  min-height: 44px;
  text-align: center;
  transition: filter 0.15s;
}
.button:hover {
  filter: brightness(1.08);
}
.primary {
  background: var(--accent);
  color: #172214;
}
.secondary {
  background: #26322c;
  border-color: #3b4b3c;
  color: var(--text);
}
.icon-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 6px;
  font-size: 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
  padding: 20px 0;
  margin-top: 26px;
  margin-bottom: 30px;
}
.stats > div {
  padding: 0 28px;
  border-left: 1px solid var(--line);
}
.stats > div:first-child {
  border: 0;
  padding-left: 0;
}
.stats strong {
  display: block;
  font-size: 21px;
  font-weight: 550;
  letter-spacing: -0.5px;
  margin-top: 6px;
}
.workspace {
  width: 100%;
}
.playing-section { margin-bottom: 38px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.session-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 18px; }
#empty, #no-results, #filter-empty { grid-column: 1 / -1; }
.results-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 18px 0 20px; }
.stream-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; max-width: 100%; }
.stream-filters > .small { margin-right: 4px; }
.stream-filters button { padding: 7px 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--muted); cursor: pointer; }
.stream-filters button:hover { border-color: var(--accent); color: var(--text); }
.stream-filters button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-dark); font-weight: 600; }
.stream-filters button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.source-filter-options { display: contents; }
.source-filters button { max-width: 100%; overflow-wrap: anywhere; }
#filter-count { margin-left: auto; white-space: nowrap; }
#filter-count:empty { display: none; }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.section-heading .pill {
  white-space: nowrap;
  color: var(--muted);
  border-color: var(--line);
  font-size: 9px;
}
.empty {
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 42px 30px;
  margin-bottom: 0;
  background: linear-gradient(135deg, #14201b55, transparent);
}
.empty p {
  font-size: 13px;
  max-width: 375px;
  margin: 12px auto;
  color: var(--muted);
}
.wave {
  font-size: 32px;
  letter-spacing: 4px;
  color: var(--accent);
  margin-bottom: 18px;
}
.playback > .panel {
  margin-top: 20px;
}
summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  list-style-position: outside;
  margin-left: 14px;
}
summary .small {
  font-size: 9px;
  float: right;
  margin-top: 3px;
}
details[open] > summary {
  margin-bottom: 20px;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #c1ced5;
  margin-top: 17px;
}
.settings label[hidden] { display: none; }
label small {
  font-weight: 400;
  color: var(--muted);
  display: block;
  margin: 4px 0;
}
input,
select {
  display: block;
  width: 100%;
  border: 1px solid #324049;
  border-radius: 6px;
  background: #0e151b;
  color: var(--text);
  padding: 10px 12px;
  margin-top: 7px;
  font-size: 13px;
  outline: none;
}
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #c8f12015;
}
input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}
.range-row {
  display: flex;
  align-items: center;
  gap: 15px;
}
.range-row output {
  min-width: 35px;
  font-family: monospace;
  font-size: 13px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 14px;
}
.help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1b252b;
  color: var(--text);
  border: 1px solid #3a4852;
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  min-height: 44px;
}
.text-button:hover {
  background: #26333b;
  border-color: var(--muted);
}
#sources, #wizard-sources {
  display: grid;
  gap: 10px;
  margin: 18px 0 12px;
  container-type: inline-size;
}
.source {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(160px, 1.2fr) 156px;
  grid-template-areas: "details url controls";
  align-items: center;
  gap: 0 16px;
  min-width: 0;
  border: 1px solid #334039;
  border-radius: 12px;
  background: linear-gradient(110deg, #19231f, #111920 60%);
  padding: 12px 14px;
}
.source:hover, .source:focus-within { border-color: #536542; }
.source-details { grid-area: details; display: flex; align-items: center; gap: 10px; min-width: 0; }
.source-icon { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; object-fit: contain; background: #26322c; }
.source[data-type="vixsrc"] img.source-icon,
.source[data-type="movy"] img.source-icon { padding: 5px; }
.source-icon-fallback { display: grid; place-items: center; color: var(--accent); font-size: 17px; font-weight: 650; }
.source-loading .source-icon-fallback::after {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid #536542;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: source-spin 800ms linear infinite;
}
@keyframes source-spin { to { transform: rotate(360deg); } }
.source-identity { min-width: 0; }
.source-name { display: block; font-size: 14px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; line-height: 1.4; }
.source-kind { display: block; margin-top: 3px; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
/* Shift the URL left slightly to leave more room before the switch. */
.source .source-url { grid-area: url; min-width: 0; margin: 0 8px 0 -8px; font-size: 11px; }
.source-url input { min-width: 0; margin-top: 5px; padding: 8px 10px; font-size: 12px; border-radius: 8px; }
.source-status { grid-column: 1 / -1; margin: 8px 0 0; overflow-wrap: anywhere; }
.source-controls { grid-area: controls; display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.source .source-toggle { display: flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; cursor: pointer; }
.source-toggle input {
  appearance: none;
  position: relative;
  display: inline-block;
  flex: 0 0 40px;
  width: 40px;
  height: 24px;
  padding: 0;
  margin: 0;
  border: 1px solid #52616b;
  border-radius: 999px;
  background: #29343c;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.source-toggle input::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #c0cbd2;
  transition: transform 160ms ease, background 160ms ease;
}
.source-toggle input:checked { background: var(--accent); border-color: var(--accent); }
.source-toggle input:checked::before { transform: translateX(16px); background: #1b2b15; }
.source-toggle input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; box-shadow: none; }
.source-toggle input:disabled { opacity: 0.45; cursor: not-allowed; }
.setting-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; margin-top: 0; color: var(--text); font-size: 14px; cursor: pointer; }
.dependent-setting { margin-top: 18px; padding-left: 16px; border-left: 2px solid var(--line); }
.dependent-setting label { margin-top: 0; }
.dependent-setting:has(input:disabled) { opacity: 0.45; }
.dependent-setting input:disabled { cursor: not-allowed; }
.source-actions { display: flex; align-items: center; gap: 6px; }
.source-order { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.source-order button { min-height: 34px; width: 30px; padding: 0; border: 0; border-radius: 0; background: #182229; font-size: 17px; }
.source-order button + button { border-left: 1px solid var(--line); }
.source-order button:focus-visible { outline-offset: -3px; }
.source .source-remove { display: grid; place-items: center; min-height: 34px; width: 30px; padding: 0; border-color: transparent; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.source .source-remove:hover { color: var(--warm); background: #ffbf8b10; border-color: #ffbf8b40; }
.source-disabled { background: #111920; border-color: var(--line); }
.source-disabled .source-name { color: var(--muted); }
@container (max-width: 640px) {
  .source { grid-template-columns: minmax(0, 1fr) 156px; grid-template-areas: "details controls" "url url"; row-gap: 10px; }
  .source .source-url { margin: 0; }
  .source-status { margin: 0; }
}
@container (max-width: 320px) {
  .source { grid-template-columns: minmax(0, 1fr); grid-template-areas: "details" "url" "controls"; padding: 12px; }
  .source-controls { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .source-toggle input, .source-toggle input::before { transition: none; }
  .source-loading .source-icon-fallback::after { animation: none; }
}
.settings hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 23px 0;
}
.switch-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.switch-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: var(--accent);
  margin: 3px 0;
}
.switch-row strong {
  font-size: 13px;
  font-weight: 550;
}
.switch-row small {
  font-size: 12px;
  line-height: 1.6;
  margin-top: 8px;
}
.settings details {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 24px;
}
.save {
  width: 100%;
  margin-top: 25px;
}
#resolve-status {
  font-size: 12px;
  display: block;
  color: var(--accent);
  margin-top: 8px;
}
.session {
  margin-bottom: 0;
  min-width: 0;
  container-type: inline-size;
}
.session-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.session-top .content { font-size: 12px; overflow-wrap: anywhere; }
.session .name {
  overflow-wrap: anywhere;
  white-space: pre-line;
  font-size: 13px;
}
.stream-info {
  background: #0e151b;
  border: 1px solid #243039;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}
.stream-info p { margin: 4px 0 0; }
.stream-info :empty, .sample-progress:empty { display: none; }
.session-state { margin: 14px 0 0; }
.session-state p { margin: 4px 0; }
.status {
  font-size: 12px;
  color: var(--accent);
}
.session-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 12px 20px;
  margin-top: 18px;
  padding: 14px;
  background: #0e151b;
  border-radius: 8px;
}
.session-metrics > div { min-width: 0; }
.session-metrics .small { display: block; letter-spacing: 0.7px; }
.session-metrics .small {
  font-size: 9px;
}
.session-metrics strong {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 18px 0;
}
.session details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}
.session summary { padding-block: 6px; }
.session summary:hover { color: var(--accent); }
.session details[open] > summary { margin-bottom: 10px; }
.technical-details h4 { margin: 16px 0 4px; font-size: 12px; }
.technical-details p, .technical-details pre { margin: 4px 0 0; }
.sync-action { margin-top: 18px; }
.sync-action .help { margin: 6px 0 0; }
.offset-form {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
}
.offset-form label {
  flex: 1 1 160px;
  margin-top: 0;
}
.offset-form input {
  min-width: 110px;
}
.errors {
  color: var(--warm);
  font-size: 12px;
  padding-left: 16px;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}
.errors:empty {
  display: none;
}
.errors li {
  margin-top: 6px;
}
.anchors {
  font-size: 11px;
  white-space: pre-wrap;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.anchors:empty { display: none; }
.events {
  color: var(--muted);
  font-size: 12px;
  list-style: none;
  padding: 0;
  overflow-wrap: anywhere;
}
.events li {
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}
footer {
  margin-top: 50px;
  padding-block: 25px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 22px;
  border-radius: 8px;
  background: var(--accent);
  color: #182118;
  font-size: 13px;
  font-weight: 550;
  max-width: 90vw;
  box-shadow: 0 5px 30px #0007;
  display: none;
}
code {
  font-size: 11px;
  color: #c4d6d8;
}
@media (max-width: 1050px) {
  header,
  main,
  footer {
    padding-inline: 28px;
  }
  .section-heading .pill {
    display: none;
  }
  .panel {
    padding: 20px;
  }
}
@media (max-width: 760px) {
  header,
  main,
  footer {
    padding-inline: 20px;
  }
  header {
    height: 78px;
  }
  .settings-intro { align-items: center; }
  .wizard { padding: 20px; margin-top: 24px; }
  .stats {
    grid-template-columns: 1fr 1fr;
    row-gap: 22px;
    margin-bottom: 28px;
  }
  .stats > div {
    padding: 0 18px;
  }
  .stats > div:nth-child(odd) {
    border: 0;
    padding-left: 0;
  }
  .stats strong {
    font-size: 19px;
  }
  .results-filters > .stream-filters, #filter-count { flex-basis: 100%; }
  #filter-count { margin-left: 0; }
  .connection {
    font-size: 11px;
  }
  .brand {
    font-size: 23px;
  }
  .session-metrics strong {
    font-size: 15px;
  }
  summary .small {
    display: none;
  }
  footer span {
    max-width: 200px;
    text-align: right;
  }
  .offset-form {
    gap: 8px;
  }
}
@media (max-width: 600px) {
  .copy-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .copy-row input { grid-column: 1 / -1; }
  .session-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .session-metrics .position-metric { grid-column: 1 / -1; }
  .session .actions, .offset-form { display: grid; grid-template-columns: minmax(0, 1fr); }
  .sync-action .button { width: 100%; }
  .session { padding: 16px; }
  .brand .tag { display: none; }
  .connection { max-width: 130px; }
}
@container (max-width: 520px) {
  .session-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .session-metrics .position-metric { grid-column: 1 / -1; }
}

[hidden] {
  display: none !important;
}
.session .name, .stream-title, .description, .file-details, .binge-group { white-space: pre-wrap; overflow-wrap: anywhere; }
.session .content-name { margin: 10px 0 14px; overflow-wrap: anywhere; }
.session.playing { border-color: var(--accent, #cdf475); }
.sample-progress { color: #cdf475; }

.automatic-next-episode { margin-bottom: 32px; overflow-wrap: anywhere; background: linear-gradient(120deg, #18241d80, transparent 65%), var(--panel); }
.automatic-next-episode .section-heading { margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.automatic-next-episode h2 { margin-bottom: 0; }
#automatic-next-episode .pill { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: 0; text-transform: none; padding: 5px 10px; border-radius: 999px; }
.automatic-episode { margin: 0; font-size: 22px; line-height: 1.4; }
.automatic-next-episode .automatic-message { margin: 6px 0 0; color: var(--muted); font-size: 14px; max-width: 72ch; }
.automatic-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; list-style: none; margin: 24px 0 0; padding: 0; }
.automatic-steps li { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 2px solid var(--line); color: var(--muted); font-size: 12px; }
.automatic-step-number { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; font-size: 11px; font-weight: 650; }
.automatic-steps li[data-state="current"] { border-color: var(--accent); color: var(--text); font-weight: 600; }
.automatic-steps li[data-state="current"] .automatic-step-number { background: var(--accent); border-color: var(--accent); color: var(--accent-dark); }
.automatic-steps li[data-state="complete"] { border-color: #536542; color: var(--accent); }
.automatic-steps li[data-state="complete"] .automatic-step-number { border-color: #536542; background: var(--accent-dark); font-size: 0; }
.automatic-steps li[data-state="complete"] .automatic-step-number::before { content: "✓"; font-size: 13px; }
.automatic-steps li[data-state="warning"] { border-color: #755d43; color: var(--warm); }
.automatic-steps li[data-state="warning"] .automatic-step-number { border-color: #755d43; background: #32261e; font-size: 0; }
.automatic-steps li[data-state="warning"] .automatic-step-number::before { content: "!"; font-size: 13px; }
.automatic-progress { margin: 16px 0 0; color: var(--accent); font-size: 12px; }
.automatic-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-top: 20px; font-size: 12px; color: var(--muted); }
.automatic-source { padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; background: #0e151b; }
.automatic-audio { color: var(--accent); }
.automatic-next-episode[data-audio="unmatched"] .automatic-audio { color: var(--warm); }
.automatic-expires { margin-left: auto; font-variant-numeric: tabular-nums; }
.automatic-details { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.automatic-details summary { width: fit-content; color: var(--muted); font-size: 12px; }
.automatic-details summary:hover { color: var(--text); }
.automatic-details dl { display: grid; gap: 10px; margin: 12px 0 0; font-size: 12px; }
.automatic-details dl > div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; }
.automatic-details dt { color: var(--muted); }
.automatic-details dd { margin: 0; white-space: pre-wrap; }
.automatic-next-episode[aria-busy="true"] .pill::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid #536542;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: source-spin 800ms linear infinite;
}
.automatic-next-episode[data-state="ready"] { border-color: #536542; }
.automatic-next-episode[aria-busy="true"] .pill,
.automatic-next-episode[data-state="ready"] .pill,
.automatic-next-episode[data-state="handedOff"] .pill { color: var(--accent); border-color: #536542; background: #c8f1780a; }
.automatic-next-episode[data-audio="unmatched"] .pill,
.automatic-next-episode[data-state="failed"] .pill,
.automatic-next-episode[data-state="unavailable"] .pill,
.automatic-next-episode[data-state="expired"] .pill { color: var(--warm); border-color: #755d43; }
.automatic-next-episode[data-state="waiting"] .pill,
.automatic-next-episode[data-state="canceled"] .pill { color: var(--muted); border-color: var(--line); }
@media (max-width: 600px) {
  .automatic-next-episode .section-heading { margin-bottom: 18px; }
  .automatic-episode { font-size: 19px; }
  .automatic-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; margin-top: 20px; }
  .automatic-steps li { gap: 7px; }
  .automatic-expires { margin-left: 0; }
  .automatic-details dl > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .automatic-next-episode[aria-busy="true"] .pill::before { animation: none; }
}
