:root {
  --bg: #11141a;
  --panel: #171b23;
  --panel-hi: #212734;
  --line: #2a3140;
  --text: #e6e9ef;
  --muted: #8b94a7;
  --accent: #4c9aff;
  --sidebar-width: 320px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
}

/* ---- sidebar ---- */

#sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

#sidebar header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}

#sidebar h1 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
}

#filter {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

#filter:focus {
  outline: none;
  border-color: var(--accent);
}

#list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.day {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 14px;
  background: var(--panel-hi);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  border: 0;
  border-left: 3px solid transparent;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.item:hover { background: var(--panel-hi); }

.item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.item[aria-current="true"] {
  background: var(--panel-hi);
  border-left-color: var(--accent);
}

.item .time {
  display: block;
  font-variant-numeric: tabular-nums;
}

.item .meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#status {
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

/* ---- player ---- */

main {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

#player:not([src]) { display: none; }

#placeholder {
  position: absolute;
  margin: 0;
  padding: 0 20px;
  color: var(--muted);
  text-align: center;
}

#placeholder[hidden] { display: none; }

@media (max-width: 700px) {
  body { flex-direction: column; }
  #sidebar {
    width: 100%;
    flex: 0 0 45vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
