:root {
  color-scheme: dark;
  --bg: #0d0f0e;
  --panel: #151816;
  --panel-2: #1c201d;
  --line: #2b312d;
  --text: #eef1eb;
  --muted: #9ba49b;
  --accent: #d7a64a;
  --good: #80c77b;
  --warn: #d6bd6d;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

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

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 0.98;
  letter-spacing: 0;
}

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

.sync-state {
  min-width: 120px;
  text-align: right;
}

.sync-state span {
  display: block;
  color: var(--accent);
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.sync-state small,
.metric-label,
label span,
.muted {
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 24px 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.metric {
  min-height: 92px;
  padding: 18px;
  background: var(--panel);
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 24px;
}

.controls {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(130px, 0.7fr)) minmax(150px, 0.6fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 24px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

select,
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.checkline {
  grid-template-columns: 18px 1fr;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.checkline input {
  min-height: 18px;
  padding: 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr {
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

tbody tr:hover,
tbody tr.is-selected {
  background: #22261f;
}

.channel-cell {
  display: grid;
  grid-template-columns: 78px minmax(180px, 1fr);
  gap: 12px;
  align-items: center;
}

.thumb {
  width: 78px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #070807;
  border-radius: 4px;
}

.name {
  display: block;
  font-weight: 800;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag,
.fit {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.fit.strict {
  border-color: rgba(128, 199, 123, 0.45);
  color: var(--good);
}

.fit.watch {
  border-color: rgba(214, 189, 109, 0.45);
  color: var(--warn);
}

.number {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.detail {
  position: sticky;
  top: 18px;
  min-height: 420px;
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.detail-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 18px;
  background: var(--panel);
  border-radius: 6px;
}

.detail dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  margin: 20px 0;
}

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

.detail dd {
  margin: 0;
}

.links {
  display: grid;
  gap: 10px;
}

.links a {
  display: flex;
  justify-content: space-between;
  min-height: 42px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 140ms ease, color 140ms ease;
}

.links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 1040px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls,
  .workspace {
    grid-template-columns: 1fr;
  }

  .detail {
    position: static;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 24px 0 0;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 20px, 1440px);
    padding: 18px 0;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .metrics {
    grid-template-columns: 1fr;
  }
}

