:root {
  color-scheme: dark;
  --bg: #000;
  --shell: #171a22;
  --panel: #272b38;
  --text: #f4f6fb;
  --muted: #a7aec0;
  --faint: #8b93a6;
  --accent: #c9d2fb;
  --track: #3c4252;
  --line: rgba(255, 255, 255, 0.06);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  letter-spacing: -0.011em;
}

button, input { font: inherit; color: inherit; }

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.player {
  width: min(760px, 100%);
  background: var(--shell);
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.top, .transport-meta, .filter, .dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 650;
}

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

.icon { display: grid; }
.icon svg { width: 22px; height: 22px; display: block; }

.icon-button, .ctrl, .bookmark, .ghost, .text-button, .speed, .primary {
  border: 0;
  background: none;
  cursor: pointer;
}

.icon-button, .ctrl, .bookmark {
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.icon-button { width: 36px; height: 36px; color: #e8eaf2; }
.icon-button:hover, .ctrl:hover, .bookmark:hover, .view:hover { background: rgba(255, 255, 255, 0.05); }

.now {
  margin-top: 16px;
  padding: 18px 18px 14px;
  border-radius: 18px;
  background: var(--panel);
}

.kicker {
  margin: 0 0 14px;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.now-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.now-copy { min-width: 0; }
.now-copy h2, .now-copy p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-copy h2 { font-size: 1.2rem; font-weight: 650; }
.show-name { margin-top: 4px; color: #d5d9e6; }
.ep-meta { margin-top: 3px; color: var(--faint); font-size: 0.92rem; }

.art {
  width: 76px;
  height: 76px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: #12141c;
  color: var(--muted);
}
.art.small { width: 52px; height: 52px; border-radius: 10px; }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.scrub { margin-top: 16px; }
#seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--progress, 0%), var(--track) var(--progress, 0%));
  cursor: pointer;
}
#seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}
#seek::-moz-range-track { height: 4px; border: 0; background: transparent; }
#seek::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }

.times, .transport-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}
.times { display: flex; justify-content: space-between; }

.transport {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}
.ctrl { width: 40px; height: 40px; color: #fff; }
.ctrl svg, .bookmark svg, .view svg { width: 22px; height: 22px; display: block; }
#play {
  width: 58px;
  height: 58px;
  background: #fff;
  color: #1a1d27;
}
#play[data-icon="play"] .icon { transform: translateX(1px); }
button:disabled { opacity: 0.35; cursor: default; }
.speed { color: #e6e8f0; padding: 0; }

.library h2 { margin: 22px 0 8px; font-size: 1.45rem; font-weight: 650; }
.views { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.view {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 8px 12px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
}
.view strong { font-size: 0.98rem; }
.view span { color: var(--faint); font-size: 0.82rem; }
.view[aria-selected="true"] { background: rgba(255, 255, 255, 0.045); }

.status { min-height: 0; margin: 12px 0 0; color: var(--muted); }
.status:empty { display: none; }
.status.is-error { color: #f0b4b4; }

.rows { display: grid; gap: 4px; margin-top: 8px; }
.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border-radius: 14px;
}
.row.current { background: rgba(201, 210, 251, 0.1); }
.episode-main {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.episode-main:hover { background: rgba(255, 255, 255, 0.04); }
.copy { min-width: 0; }
.copy strong, .copy em, .copy p { display: block; }
.copy em { margin-top: 3px; color: var(--faint); font-style: normal; font-size: 0.82rem; }
.copy p {
  margin: 4px 0 0;
  color: #b7becc;
  font-size: 0.86rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bookmark { width: 40px; height: 40px; color: var(--faint); }
.bookmark[aria-pressed="true"] { color: var(--accent); }
.show-actions { display: grid; gap: 6px; justify-items: end; padding-right: 8px; }
.text-button { padding: 0; color: var(--muted); }
.text-button:hover { color: #fff; }
.danger:hover { color: #ffb4b4; }
.filter { margin-top: 12px; color: var(--muted); }
.empty { margin: 14px 4px 6px; color: var(--muted); }
.empty p { margin: 4px 0 0; }

.sheet {
  width: min(440px, calc(100vw - 32px));
  margin: auto;
  padding: 22px;
  border: 0;
  border-radius: 20px;
  background: #1c1f2a;
  color: var(--text);
}
dialog { padding: 0; border: 0; background: transparent; }
dialog::backdrop { background: rgba(0, 0, 0, 0.64); }
.sheet h3 { margin: 0 0 8px; font-size: 1.2rem; }
.sheet p { margin: 0 0 14px; color: var(--muted); }
.sheet input {
  width: 100%;
  margin: 6px 0 8px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: #11131a;
  font-size: 16px;
}
.dialog-actions { gap: 8px; margin-top: 8px; }
.primary {
  padding: 10px 16px;
  border-radius: 999px;
  background: #fff;
  color: #161820;
  font-weight: 650;
}
.ghost { padding: 10px 12px; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff;
  color: #161820;
  opacity: 0;
  pointer-events: none;
  transition: 160ms ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 640px) {
  .stage { padding: 0; }
  .player { border-radius: 0; min-height: 100vh; padding: 16px; }
  .view span { display: none; }
}
