:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #65727c;
  --line: #d8e0e5;
  --panel: #ffffff;
  --page: #f4f7f8;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --blue: #1d4ed8;
  --warn: #b45309;
  --good: #15803d;
  --shadow: 0 10px 24px rgba(23, 32, 38, 0.08);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

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

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

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-shell[hidden],
.shell[hidden] {
  display: none;
}

.auth-panel {
  width: min(420px, 100%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.08;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 20px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.wide {
  margin-top: 18px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 11px;
}

form {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 0 6px;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.check {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 650;
}

.check input {
  width: 16px;
  min-height: 16px;
}

button,
.link-button {
  border: 0;
  border-radius: 6px;
  min-height: 42px;
  padding: 9px 14px;
  color: white;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.secondary {
  color: var(--ink);
  background: #e8eef2;
}

.secondary:hover {
  background: #dbe5eb;
}

.status-pill,
.event-status {
  border-radius: 999px;
  padding: 7px 11px;
  background: #e8eef2;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill[data-mode="live"],
.event-status[data-status="live"] {
  color: white;
  background: var(--good);
}

.status-pill[data-mode="dry"] {
  background: #fef3c7;
  color: var(--warn);
}

.event-status[data-status="draft"] {
  background: #e0e7ff;
  color: var(--blue);
}

.event-list {
  display: grid;
  gap: 14px;
}

.event-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdfe;
}

.event-main {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
}

.metrics strong,
.metrics span {
  display: block;
}

.metrics strong {
  font-size: 22px;
}

.metrics span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.stream-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.stream-box > div {
  display: grid;
  gap: 6px;
}

code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  border-radius: 6px;
  background: #101820;
  color: #d8f3dc;
  padding: 8px;
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  padding: 10px;
  font-size: 13px;
}

th {
  color: var(--muted);
  background: #edf3f6;
}

.actions,
.tabs,
.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.mini-actions {
  margin: 8px 0;
}

.mini-actions button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.pipeline-cell {
  display: grid;
  gap: 4px;
}

.job-status {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.viewer-link {
  color: var(--blue);
  font-weight: 800;
  align-self: center;
}

.empty {
  color: var(--muted);
  padding: 12px 0;
}

.form-message {
  color: var(--warn);
  min-height: 18px;
  font-size: 13px;
  font-weight: 700;
}

.player-region {
  overflow: hidden;
  border-radius: 8px;
  background: #111827;
  aspect-ratio: 16 / 9;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 820px) {
  .grid,
  .metrics,
  .stream-box,
  .form-row {
    grid-template-columns: 1fr;
  }

  .language-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .event-main {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .language-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }
}
