:root {
  color-scheme: light;
  --bg: #f6fafc;
  --panel: #ffffff;
  --ink: #162033;
  --muted: #607089;
  --line: rgba(22, 32, 51, .12);
  --brand: #0d8dd8;
  --accent: #16b8a6;
  --warning: #ffb020;
  --radius: 8px;
  --shadow: 0 18px 48px rgba(20, 55, 90, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(140deg, rgba(13, 141, 216, .14), transparent 28rem),
    linear-gradient(300deg, rgba(22, 184, 166, .14), transparent 30rem),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.hero > div,
.panel,
.endpoint-grid a,
.status-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
}

.hero > div:first-child {
  padding: clamp(24px, 5vw, 54px);
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1;
}

h2 { margin-bottom: 0; }
p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 17px;
}

.status-card {
  display: grid;
  align-content: end;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(255, 176, 32, .22), rgba(22, 184, 166, .16)),
    #fff;
}

.status-card strong {
  display: block;
  margin: 8px 0;
  font-size: 30px;
}

.status-card small { color: var(--muted); }

.endpoint-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.endpoint-grid a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 12px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
  word-break: break-word;
}

.live-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.live-summary article {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
}

.live-summary strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 28px;
}

.live-summary small {
  color: var(--muted);
  line-height: 1.45;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
}

.panel {
  padding: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.stream-grid,
.source-list {
  display: grid;
  gap: 10px;
}

.stream-card,
.source-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.stream-card {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
}

.stream-card img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
}

.stream-card div,
.source-card {
  padding: 12px;
}

.stream-card span,
.source-card span {
  color: var(--muted);
  font-size: 12px;
}

.meta-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8f6ff;
  color: var(--brand);
  font-weight: 900;
  font-size: 12px;
}

.badge.live {
  background: #e8fff8;
  color: #0a8f74;
}

.card-actions {
  margin-top: 12px;
}

.card-actions a,
.watch-btn {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius);
  background: #e8f6ff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.watch-btn {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
}

.empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.watch-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 20, 34, .72);
}

.watch-modal.is-open {
  display: flex;
}

.watch-dialog {
  width: min(1040px, 100%);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .35);
}

.watch-head,
.watch-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.watch-head h2 {
  margin: 2px 0 0;
}

.watch-dialog iframe {
  display: block;
  width: 100%;
  height: min(64vh, 620px);
  border: 0;
  background: #061427;
}

.watch-foot {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.watch-foot a {
  color: var(--brand);
  font-weight: 900;
}

@media (max-width: 960px) {
  .hero,
  .content-grid,
  .live-summary,
  .endpoint-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .stream-card {
    grid-template-columns: 1fr;
  }

  .stream-card img {
    height: 190px;
  }

  .watch-head,
  .watch-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .watch-dialog iframe {
    height: 54vh;
  }
}
