:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #172026;
  --muted: #64727d;
  --line: #d9e0e4;
  --watch: #0f766e;
  --watch-soft: #dff5f1;
  --danger: #b42318;
  --danger-soft: #fde4df;
  --quiet: #747b67;
  --quiet-soft: #ecefe6;
  --focus: #2563eb;
}

* {
  box-sizing: border-box;
}

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

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 16px;
}

h3 {
  font-size: 18px;
  line-height: 1.25;
}

.status-panel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9aa5ad;
}

.status-dot.ok {
  background: var(--watch);
}

.status-dot.error {
  background: var(--danger);
}

.temperature-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--panel);
  margin-bottom: 18px;
}

.temperature-item {
  min-height: 72px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.temperature-item:last-child {
  border-right: 0;
}

.temperature-item span,
.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.temperature-item strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  text-transform: capitalize;
}

.temperature-item.danger strong {
  color: var(--danger);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.main-column,
.side-column {
  display: grid;
  gap: 18px;
}

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

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.panel-head h2 {
  color: var(--ink);
}

.candidate-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.candidate {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.candidate.is-watch {
  border-left-color: var(--watch);
}

.candidate.is-danger {
  border-left-color: var(--danger);
  background: #fffafa;
}

.candidate.is-muted {
  border-left-color: var(--quiet);
  background: #fbfcf8;
}

.candidate-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ticker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meta,
.why {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.why {
  margin-top: 10px;
}

.why.muted {
  color: #7a5b57;
}

.label {
  min-width: 72px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--watch-soft);
  color: var(--watch);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.is-danger .label {
  background: var(--danger-soft);
  color: var(--danger);
}

.is-muted .label {
  background: var(--quiet-soft);
  color: var(--quiet);
}

.meter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.metric {
  min-width: 0;
}

.metric strong {
  display: block;
  margin: 3px 0 5px;
  font-size: 14px;
}

.metric.danger strong {
  color: var(--danger);
}

.mini-bar,
.heat-bar {
  height: 6px;
  border-radius: 999px;
  background: #e4e9ec;
  overflow: hidden;
}

.mini-bar::before,
.heat-bar::before {
  display: block;
  width: var(--value, var(--heat, 0%));
  height: 100%;
  background: var(--watch);
  content: "";
}

.metric.danger .mini-bar::before {
  background: var(--danger);
}

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

.compact-list,
.ranking-list {
  display: grid;
  gap: 8px;
}

.compact-item,
.ranking-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.compact-item strong,
.compact-item span {
  display: block;
}

.compact-item span,
.compact-item p,
.ranking-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.heat-bar {
  margin-top: 10px;
}

.ranking-list {
  padding: 12px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 28px 1fr 56px;
  align-items: center;
  gap: 8px;
}

.ranking-row > span {
  color: var(--muted);
  font-weight: 800;
}

.ranking-row b {
  text-align: right;
}

.ranking-row.is-danger b {
  color: var(--danger);
}

.job-grid {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  padding: 14px 16px 0;
  margin: 0;
  font-size: 13px;
}

.job-grid dt {
  color: var(--muted);
  font-weight: 800;
}

.job-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.warning-list {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
}

.warning-item {
  border-left: 4px solid var(--danger);
  background: var(--danger-soft);
  padding: 10px;
  color: #6f1d16;
  font-size: 13px;
  line-height: 1.45;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
  background: #fafbfb;
  font-size: 13px;
}

@media (max-width: 960px) {
  .shell {
    padding: 16px;
  }

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

  .temperature-band,
  .layout,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .temperature-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .temperature-item:last-child {
    border-bottom: 0;
  }

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