:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #181b1f;
  --muted: #66706b;
  --line: #d8ded7;
  --accent: #176b53;
  --accent-strong: #0e513d;
  --selected: #285f9f;
  --danger: #a7332f;
  --warning: #8a5a00;
  --shadow: 0 12px 32px rgba(24, 27, 31, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.danger {
  background: var(--danger);
}

.danger:hover {
  background: #842622;
}

a,
.link-button {
  color: var(--accent-strong);
}

.link-button {
  min-height: auto;
  padding: 0;
  border-radius: 0;
  color: var(--accent-strong);
  background: transparent;
}

.link-button:hover {
  color: var(--ink);
  background: transparent;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 128px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}

label {
  font-size: 13px;
  font-weight: 650;
  color: #303733;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
}

.login-panel {
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.app-page {
  min-height: 100vh;
  height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}

.viewer-page {
  background: #181b1f;
}

.admin-page {
  color-scheme: dark;
  --bg: #181b1f;
  --panel: #111417;
  --ink: #f5f7f4;
  --muted: #b8c2bc;
  --line: #2b3430;
  --accent: #176b53;
  --accent-strong: #89c2ab;
  --selected: #477364;
  --danger: #a7332f;
  --warning: #c8b16c;
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
}

.app-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.viewer-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  background: #181b1f;
}

.player-area {
  position: relative;
  display: grid;
  min-height: 0;
  overflow: hidden;
  place-items: center;
  padding: 0 0 8px;
  background: #181b1f;
}

.player-frame {
  position: relative;
  justify-self: center;
  align-self: center;
  width: min(100%, 92.444dvh);
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-frame.is-disabled {
  border: 1px solid rgba(137, 194, 171, 0.14);
  background: #101417;
}

#player {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

.player-frame.is-disabled #player {
  visibility: hidden;
  pointer-events: none;
}

.player-message {
  position: absolute;
  inset: auto 20px 20px;
  max-width: 720px;
  border-radius: 6px;
  padding: 14px 16px;
  color: #fff;
  background: rgba(12, 14, 15, 0.82);
}

.player-frame.is-disabled .player-message {
  inset: 0;
  display: grid;
  max-width: none;
  border-radius: 0;
  place-items: center;
  padding: 20px;
  color: #cfd8d2;
  background: #101417;
  text-align: center;
}

.bottom-toolbar {
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 56px;
  border-top: 1px solid rgba(212, 234, 223, 0.12);
  padding: 8px 18px max(8px, env(safe-area-inset-bottom));
  color: #f5f7f4;
  background: #181b1f;
}

.worldcup-summary {
  position: relative;
  display: grid;
  justify-items: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0 0 8px;
  background: #181b1f;
}

.match-rail-shell {
  position: relative;
  display: grid;
  min-height: 0;
  width: 100%;
  min-width: 0;
  height: 100%;
}

.worldcup-summary::before,
.worldcup-summary::after {
  position: absolute;
  z-index: 2;
  right: 0;
  left: 0;
  height: 34px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
  content: "";
}

.worldcup-summary::before {
  top: 0;
  background: linear-gradient(#181b1f, rgba(24, 27, 31, 0));
}

.worldcup-summary::after {
  bottom: 0;
  background: linear-gradient(rgba(24, 27, 31, 0), #181b1f);
}

.worldcup-summary.has-top-overflow::before,
.worldcup-summary.has-bottom-overflow::after {
  opacity: 1;
}

.match-rail {
  display: grid;
  align-content: start;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 0 16px 8px;
  scrollbar-gutter: stable;
  scrollbar-color: #3a4842 transparent;
  scrollbar-width: thin;
}

.match-group {
  display: grid;
  gap: 6px;
}

.match-group-label {
  position: sticky;
  z-index: 3;
  top: 0;
  margin: 0;
  padding: 6px 0 3px;
  color: #89c2ab;
  background: #181b1f;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.match-group-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr));
  gap: 7px;
}

.match-group[data-timeline-label="Now"] .match-segment,
.match-group[data-timeline-label="Next"] .match-segment {
  grid-column: 1 / -1;
}

.match-segment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "teams time"
    "meta meta"
    "stadium stadium";
  align-items: center;
  column-gap: 16px;
  row-gap: 5px;
  min-height: 76px;
  border: 1px solid #2b3430;
  border-radius: 8px;
  padding: 9px 11px;
  color: #f5f7f4;
  background: #111417;
  text-align: left;
}

.match-segment.is-active {
  border-color: #477364;
  background: #17201d;
}

.match-teams {
  grid-area: teams;
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 4px 8px;
  flex-wrap: wrap;
  overflow: visible;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.15;
  white-space: normal;
}

.match-team {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.match-team-name {
  min-width: 0;
  overflow-wrap: break-word;
}

.match-versus {
  flex: 0 0 auto;
  color: #87918c;
  font-weight: 750;
}

.match-time {
  grid-area: time;
  color: #c3cdc7;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.match-card-meta,
.match-card-stadium {
  display: block;
  overflow: hidden;
  color: #b8c2bc;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-card-meta {
  grid-area: meta;
}

.match-card-stadium {
  grid-area: stadium;
}

.match-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 1em;
  line-height: 0;
  color: #c3cdc7;
  background: transparent;
  font-size: inherit;
  font-weight: 800;
}

.match-flag img {
  width: auto;
  height: 1em;
  object-fit: contain;
}

.match-rail-top {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 18px;
  display: grid;
  width: 36px;
  min-height: 36px;
  place-items: center;
  border: 1px solid #3f514a;
  border-radius: 999px;
  padding: 0;
  color: #d9f0e5;
  background: rgba(17, 20, 23, 0.9);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.match-rail-top:hover {
  background: #17201d;
}

.match-channel-link {
  min-height: 0;
  border-radius: 4px;
  padding: 0;
  color: #d9f0e5;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.match-channel-link:hover {
  color: #fff;
  background: transparent;
}

.match-channel-link:disabled {
  cursor: wait;
}

.match-channel-link.is-live {
  color: #89c2ab;
  text-decoration: none;
}

.match-channel-link.is-live:disabled {
  cursor: default;
  opacity: 1;
}

.match-channel-link.is-live::after {
  content: " live";
  color: #89c2ab;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.match-channel-link.is-pending::after {
  content: " pending";
  color: #c8b16c;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.match-switch-confirm,
.match-switch-notice {
  display: grid;
  gap: 8px;
  margin-top: 3px;
  border: 1px solid #3a4842;
  border-radius: 6px;
  padding: 8px;
  color: #dbe4df;
  background: #151a1d;
  font-size: 12px;
}

.match-switch-actions {
  display: flex;
  gap: 8px;
}

.match-confirm-button,
.match-cancel-button {
  min-height: 30px;
  border-radius: 5px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.match-cancel-button {
  color: #dbe4df;
  background: #2a3034;
}

.match-cancel-button:hover {
  background: #353d42;
}

.bottom-toolbar nav {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 14px;
}

.bottom-toolbar a,
.bottom-toolbar .link-button {
  color: #d4eadf;
}

.bottom-toolbar .link-button:hover,
.bottom-toolbar a:hover {
  color: #fff;
}

.viewer-count-pill {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: #d4eadf;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.viewer-count-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #89c2ab;
  box-shadow: 0 0 0 0 rgba(137, 194, 171, 0.32);
  animation: viewer-dot-pulse 2.6s ease-out infinite;
}

@keyframes viewer-dot-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(137, 194, 171, 0.28);
    opacity: 0.78;
  }

  70% {
    box-shadow: 0 0 0 8px rgba(137, 194, 171, 0);
    opacity: 1;
  }

  100% {
    box-shadow: 0 0 0 0 rgba(137, 194, 171, 0);
    opacity: 0.78;
  }
}

@media (prefers-reduced-motion: reduce) {
  .viewer-count-dot {
    animation: none;
  }
}

.admin-workspace {
  width: min(1220px, calc(100vw - 32px));
  height: 100%;
  margin: 0 auto;
  padding: 18px 0 28px;
  overflow: auto;
}

.admin-shell .admin-workspace {
  min-height: 0;
}

.admin-page input,
.admin-page select,
.admin-page textarea {
  border-color: #34403b;
  color: #f5f7f4;
  background: #151a1d;
}

.admin-page input::placeholder,
.admin-page textarea::placeholder {
  color: #87918c;
}

.admin-page label {
  color: #dbe4df;
}

.admin-page .panel {
  box-shadow: var(--shadow);
}

.admin-page .link-button {
  color: #d4eadf;
}

.admin-page .link-button:hover {
  color: #fff;
}

.control-metrics {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.45fr) minmax(0, 0.65fr);
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.control-metrics > div {
  min-width: 0;
  padding: 7px 8px;
  background: var(--panel);
}

.control-metrics dt {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.control-metrics dd {
  margin: 0;
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice {
  margin-top: 0;
  border: 1px solid rgba(200, 177, 108, 0.45);
  border-radius: 8px;
  padding: 9px 11px;
  color: #f4d27a;
  background: rgba(138, 90, 0, 0.18);
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.admin-matches-panel {
  margin-top: 10px;
}

.admin-match-list {
  display: grid;
  gap: 8px;
}

.admin-match-group {
  display: grid;
  gap: 6px;
}

.admin-match-group-label {
  color: #89c2ab;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.admin-match-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 7px;
}

.admin-match-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  background: #151a1d;
}

.admin-match-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.admin-match-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.2;
}

.admin-match-time {
  color: #c3cdc7;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-match-meta,
.admin-match-stadium {
  overflow: hidden;
  color: #b8c2bc;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-match-auto-stop {
  color: #c8b16c;
  font-size: 12px;
  font-weight: 750;
}

.admin-match-channel-toggle {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  min-height: 22px;
  border-radius: 4px;
  padding: 0;
  color: #89c2ab;
  background: transparent;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-match-channel-toggle:hover {
  color: #d9f0e5;
  background: transparent;
}

.admin-match-channel-chevron {
  display: inline-block;
  color: #c3cdc7;
  font-size: 12px;
  line-height: 1;
  transition: transform 120ms ease;
}

.admin-match-channel-toggle[aria-expanded="true"] .admin-match-channel-chevron {
  transform: rotate(90deg);
}

.admin-match-channel-count {
  color: #87918c;
  font-size: 10px;
  font-weight: 750;
  text-transform: none;
}

.admin-match-channel-list {
  display: grid;
  gap: 4px;
}

.admin-match-channel-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 6px;
}

.admin-match-channel-region {
  color: #89c2ab;
  font-size: 12px;
  font-weight: 800;
}

.admin-match-channel-actions {
  min-width: 0;
  color: #87918c;
  font-size: 12px;
}

.admin-match-empty {
  color: #87918c;
  font-size: 12px;
}

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

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.75fr);
  gap: 10px;
  margin-top: 10px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.panel-heading h1 {
  margin: 0;
  font-size: 17px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 13px;
}

.control-panel {
  display: grid;
  align-content: start;
  gap: 8px;
}

.control-panel .panel-heading {
  margin-bottom: 0;
}

.control-title {
  display: block;
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-meta {
  min-height: 0;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.control-context {
  margin: 0;
  border-left: 3px solid var(--line);
  padding: 2px 0 2px 10px;
  color: #dbe4df;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.stream-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stream-actions button {
  flex: 0 1 auto;
}

.source-attributes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 6px;
  margin: 0;
}

.source-attributes > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  background: #151a1d;
}

.source-attributes dt {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.source-attributes dd {
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
}

.badge.live {
  color: #fff;
  background: var(--accent);
}

.badge.selected {
  color: #fff;
  background: var(--selected);
}

.badge.pending {
  color: #181b1f;
  background: #c8b16c;
}

.badge.neutral {
  color: #c3cdc7;
  background: #2a3034;
}

.switch-confirm {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(200, 177, 108, 0.45);
  border-radius: 8px;
  padding: 9px;
  background: rgba(138, 90, 0, 0.18);
}

.switch-confirm p {
  margin: 0;
  color: #f4d27a;
  font-size: 14px;
}

.switch-confirm div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #151a1d;
}

.secondary:hover {
  color: var(--ink);
  background: #20262a;
}

.stack,
.settings {
  display: grid;
  gap: 8px;
}

.manual-source-editor {
  display: grid;
  gap: 8px;
}

.manual-rows {
  display: grid;
  gap: 8px;
}

.manual-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 0.85fr);
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #151a1d;
}

.manual-field {
  display: grid;
  gap: 5px;
}

.manual-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.manual-url,
.manual-row-actions {
  grid-column: 1 / -1;
}

.manual-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.check-row input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.channel-panel {
  display: flex;
  flex-direction: column;
  grid-column: 1 / -1;
  min-height: 0;
}

.channel-panel .panel-heading {
  align-items: stretch;
}

.channel-panel .panel-heading input {
  max-width: 320px;
}

.channel-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px;
  min-height: 120px;
  max-height: min(420px, 42dvh);
  overflow: auto;
  padding-right: 2px;
}

.channel-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 7px;
  background: #151a1d;
  cursor: pointer;
}

.channel-item:hover {
  border-color: #477364;
  background: #17201d;
}

.channel-item:focus-visible {
  outline: 3px solid rgba(137, 194, 171, 0.24);
  outline-offset: 2px;
}

.channel-item.is-selected {
  border-color: var(--selected);
  box-shadow: 0 0 0 1px rgba(137, 194, 171, 0.24);
}

.channel-item.is-live {
  border-color: var(--accent);
  background: #13231e;
}

.channel-logo {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  color: var(--muted);
  background: #20262a;
  font-weight: 800;
}

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

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

.channel-meta strong,
.channel-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-meta span {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.channel-badges {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

@media (max-width: 820px) {
  .player-area {
    align-items: start;
    padding-top: 32px;
  }

  .player-frame {
    align-self: start;
  }

  .bottom-toolbar {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 14px;
    min-height: 56px;
    padding: 8px 18px max(8px, env(safe-area-inset-bottom));
    font-size: 14px;
  }

  .bottom-toolbar nav {
    gap: 12px;
  }

  .worldcup-summary {
    width: 100%;
  }

  .worldcup-summary {
    flex: 0 1 auto;
  }

  .worldcup-summary {
    padding: 4px 0 8px;
  }

  .match-rail-shell {
    width: 100%;
  }

  .match-rail {
    width: 100%;
  }

  .match-group-cards {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  }

  .match-segment {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "teams time"
      "meta meta"
      "stadium stadium";
    gap: 4px 8px;
    min-height: 78px;
    padding: 8px 10px;
  }

  .match-time {
    justify-self: end;
  }

  .match-teams {
    font-size: 15px;
  }

  .match-card-meta,
  .match-card-stadium {
    font-size: 12px;
  }

  .admin-workspace {
    width: min(100vw - 20px, 1220px);
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .panel {
    padding: 10px;
  }

  textarea {
    min-height: 92px;
    max-height: 150px;
  }

  .panel-heading {
    gap: 8px;
    margin-bottom: 10px;
  }

  .panel-heading h1 {
    font-size: 17px;
  }

  .control-grid,
  .admin-grid {
    gap: 10px;
    margin-top: 10px;
  }

  .notice {
    margin-top: 10px;
    padding: 10px 12px;
  }

  .control-panel {
    gap: 8px;
  }

  .control-title {
    font-size: 18px;
  }

  .control-meta {
    min-height: 0;
    font-size: 13px;
    line-height: 1.35;
  }

  .source-attributes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .source-attributes > div {
    padding: 7px 8px;
  }

  .stream-actions {
    gap: 8px;
  }

  .stream-actions button {
    flex: 1 1 0;
    min-height: 38px;
    padding: 0 8px;
  }

  .control-metrics > div {
    padding: 6px 7px;
  }

  .control-metrics dt {
    font-size: 9px;
  }

  .control-metrics dd {
    font-size: 11px;
  }

  .control-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .channel-item {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }

  .channel-list {
    grid-template-columns: 1fr;
    max-height: min(320px, 38dvh);
  }

  .manual-row {
    grid-template-columns: 1fr;
  }

  .channel-badges {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
  }

  .channel-badges .badge {
    min-height: 18px;
    padding: 0 6px;
    font-size: 10px;
  }

  .channel-panel .panel-heading {
    flex-direction: column;
  }

  .channel-panel .panel-heading input {
    max-width: none;
  }
}

@media (max-width: 520px) {
  .match-segment {
    grid-template-columns: 1fr;
    grid-template-areas:
      "teams"
      "time"
      "meta"
      "stadium";
  }

  .match-time {
    justify-self: start;
  }
}
