:root {
  color-scheme: dark;
  --bg: #111417;
  --panel: #1c2228;
  --panel-2: #222a31;
  --text: #eef3f8;
  --muted: #9ba9b4;
  --line: #33404a;
  --accent: #29c7ac;
  --warn: #f0b44c;
  --hot: #ff6470;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

.rowlink {
  color: var(--text);
  text-decoration: none;
}

.rowlink:hover {
  color: var(--accent);
  text-decoration: underline;
}

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

.topbar,
.metrics,
.grid {
  display: grid;
  gap: 16px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-bottom: 22px;
}

.topbar h1,
.auth h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}

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

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

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

nav a,
button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

nav a.active,
button {
  background: var(--accent);
  border-color: var(--accent);
  color: #061412;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.metrics div,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics div {
  padding: 18px;
}

.metrics span {
  display: block;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
}

.metrics small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.grid.two {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.panel {
  padding: 18px;
  overflow: hidden;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

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

.actionbar p {
  margin: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-grid div {
  min-width: 0;
  background: #101418;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.summary-grid small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.summary-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row {
  display: grid;
  grid-template-columns: 64px minmax(80px, 1fr) 72px 84px;
  gap: 10px;
  align-items: center;
  min-height: 32px;
}

.bar {
  height: 8px;
  background: #101418;
  border-radius: 999px;
  overflow: hidden;
}

.bar i,
.trend i {
  display: block;
  background: var(--accent);
}

.row span,
.row em {
  text-align: right;
}

.row em {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.row em.ok {
  color: var(--accent);
}

.row em.watch {
  color: var(--warn);
}

.row em.hot {
  color: var(--hot);
}

.trend {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(26px, 1fr);
  gap: 8px;
  align-items: end;
  height: 240px;
}

.trend div {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  height: 100%;
}

.trend i {
  align-self: end;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
}

.trend span {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.list p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.list.decisions p {
  grid-template-columns: minmax(0, 1fr) 120px auto;
  align-items: center;
}

.list form {
  margin: 0;
}

.list button {
  padding: 7px 10px;
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--line);
}

.split-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.status {
  color: var(--muted);
  white-space: nowrap;
}

.status.implemented {
  color: var(--accent);
}

.status.pending-reload {
  color: var(--warn);
}

.status.enabled-not-in-map {
  color: var(--hot);
}

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

.list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list.wide span {
  white-space: normal;
}

.auth {
  width: min(440px, 100%);
  margin: 10vh auto;
}

.auth .panel {
  display: grid;
  gap: 14px;
}

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

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101418;
  color: var(--text);
  padding: 12px;
  font: inherit;
}

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

.notice.danger {
  border-color: rgba(255, 100, 112, .6);
  color: #ffd5d9;
}

code {
  color: var(--accent);
}

@media (max-width: 900px) {
  .topbar,
  .grid.two,
  .grid.three,
  .metrics,
  .actionbar,
  .summary-grid,
  .split-lists {
    grid-template-columns: 1fr;
  }

  nav {
    justify-content: flex-start;
  }

  .row {
    grid-template-columns: 48px minmax(70px, 1fr) 54px;
  }

  .row em {
    grid-column: 1 / -1;
    text-align: left;
    padding-left: 0;
  }

  .list.decisions p {
    grid-template-columns: 1fr;
  }
}
