:root {
  color-scheme: dark;
  --bg: #0f1113;
  --panel: #181b20;
  --line: #30343b;
  --text: #f5f7fa;
  --muted: #9ca6b3;
  --accent: #24b47e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  height: 100vh;
  overflow: hidden;
}
.player {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  min-width: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
h1 { margin: 0; font-size: 22px; letter-spacing: 0; }
p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
#playlist-link, button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 9px 12px;
  text-decoration: none;
}
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 280px;
  background: #050607;
  border: 1px solid #252a31;
  border-radius: 8px;
  overflow: hidden;
}
video { width: 100%; height: 100%; background: #050607; display: block; }
.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.empty.hidden { display: none; }
.now {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.now img, .logo {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}
.now span { color: var(--muted); font-size: 12px; display: block; }
.now strong { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.guide {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--panel);
}
.auth, .search {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.auth { grid-template-columns: minmax(0, 1fr) auto; }
.search span { color: var(--muted); font-size: 12px; }
input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101318;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}
input:focus { border-color: var(--accent); }
.groups {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.group {
  white-space: nowrap;
  cursor: pointer;
}
.group.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #061108;
  font-weight: 700;
}
.summary {
  padding: 11px 14px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.channels {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.channel {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 70px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
}
.channel:hover, .channel.active { background: #222730; }
.channel.active { box-shadow: inset 3px 0 0 var(--accent); }
.channel strong, .channel span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel strong { font-size: 14px; }
.channel span { margin-top: 4px; color: var(--muted); font-size: 12px; }

@media (max-width: 860px) {
  .shell { display: flex; flex-direction: column; height: auto; min-height: 100vh; overflow: visible; }
  .player { padding: 12px; }
  .video-frame { min-height: auto; }
  .guide { border-left: 0; border-top: 1px solid var(--line); }
  .channels { overflow: visible; }
}
