:root {
  color-scheme: light;
  --bg: #f4f1eb;
  --panel: #fffdfa;
  --panel-strong: #ffffff;
  --ink: #171717;
  --muted: #6c665f;
  --line: #dfd8cf;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --warn: #9a3412;
  --shadow: 0 18px 44px rgba(30, 25, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  width: min(1280px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.brand,
.list-meta,
.channel-item {
  display: flex;
  align-items: center;
}

.brand,
.list-meta {
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.1;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
}

.icon-button {
  width: 40px;
  background: #ede6dd;
  color: var(--ink);
  font-size: 22px;
}

.icon-button:hover,
.icon-button:focus-visible {
  transform: translateY(-1px);
}

.list-meta {
  color: var(--muted);
  font-size: 13px;
}

.channel-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: visible;
  padding-right: 2px;
}

.channel-item {
  width: 100%;
  gap: 11px;
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  text-align: left;
}

.channel-item:hover,
.channel-item.is-active {
  border-color: var(--accent);
}

.channel-item.is-active {
  background: #eef8f5;
}

.channel-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f5f0;
}

.channel-logo {
  width: 42px;
  height: 42px;
}

.channel-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.channel-main {
  min-width: 0;
}

.channel-name {
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-group {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage {
  display: grid;
  grid-template-rows: minmax(0, auto);
  min-width: 0;
  min-height: 0;
  padding: 0;
}

.player-wrap {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 320px;
  max-height: 68vh;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #0b0b0b;
  box-shadow: var(--shadow);
}

video {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #050505;
  object-fit: contain;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #12100e;
  color: #ede6dd;
  font-weight: 800;
  pointer-events: none;
}

.empty-state.is-hidden {
  display: none;
}

.is-error {
  color: var(--warn);
}

@media (max-width: 860px) {
  .shell {
    padding: 14px;
  }

  .sidebar {
    min-height: 0;
  }

  .channel-list {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }

  .stage {
    min-height: 0;
  }

  .player-wrap {
    min-height: 260px;
  }
}

@media (max-width: 520px) {
  .sidebar,
  .stage {
    padding: 0;
  }
}
