:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #66736c;
  --line: #dfe5e1;
  --paper: #f6f8f4;
  --surface: #ffffff;
  --forest: #194d3a;
  --teal: #04747a;
  --amber: #b66a00;
  --red: #b42318;
  --shadow: 0 20px 60px rgba(19, 42, 33, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 48px);
}

.topbar h1,
.details h2,
.status-hero h2,
.login-panel h1 {
  letter-spacing: 0;
  margin: 0;
}

.topbar h1 {
  font-size: clamp(1.45rem, 2vw, 2.1rem);
}

.eyebrow,
.card-label {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.ghost-button,
.login-form button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 750;
}

.ghost-button {
  background: #e9efeb;
  color: var(--forest);
  padding: 10px 14px;
}

.dashboard {
  display: grid;
  gap: 22px;
  margin: 0 auto;
  max-width: 1120px;
  padding: 28px clamp(18px, 4vw, 48px) 48px;
}

.status-hero {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: clamp(22px, 4vw, 36px);
}

.status-hero h2 {
  font-size: clamp(1.6rem, 3vw, 3rem);
  line-height: 1.05;
  margin-top: 14px;
}

.status-hero p,
.card p {
  color: var(--muted);
  margin: 10px 0 0;
}

.health-pill {
  border-radius: 999px;
  color: white;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 7px 10px;
}

.health-pill.online {
  background: var(--forest);
}

.health-pill.stale,
.health-pill.waiting {
  background: var(--amber);
}

.health-pill.offline {
  background: var(--red);
}

.metric {
  border-left: 1px solid var(--line);
  min-width: 190px;
  padding-left: 24px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 0.85rem;
}

.metric strong {
  display: block;
  font-size: 1.55rem;
  margin-top: 6px;
}

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

.channels {
  display: grid;
  gap: 16px;
}

.section-heading h2 {
  font-size: 1.35rem;
  letter-spacing: 0;
  margin: 0;
}

.channel-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1.35fr repeat(4, 1fr);
}

.channel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  min-height: 145px;
  padding: 18px;
  text-align: left;
}

.channel-card:hover {
  border-color: var(--teal);
  box-shadow: 0 14px 40px rgba(4, 116, 122, 0.12);
}

.channel-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.channel-card strong {
  align-self: end;
  font-size: 1.45rem;
  line-height: 1;
}

.channel-card small {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.primary-channel {
  background: #123d31;
  color: white;
}

.primary-channel span,
.primary-channel small {
  color: rgba(255, 255, 255, 0.78);
}

.channel-feedback {
  color: var(--forest);
  min-height: 1.4em;
}

.card,
.details,
.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.card {
  min-height: 155px;
  padding: 20px;
}

.card strong {
  display: block;
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

.details {
  padding: 24px;
}

.details h2 {
  font-size: 1.2rem;
  margin-bottom: 18px;
}

dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

dl div {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 160px 1fr;
  padding-top: 12px;
}

dt {
  color: var(--muted);
  font-weight: 700;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  max-width: 420px;
  width: 100%;
}

.login-panel {
  box-shadow: var(--shadow);
  padding: 30px;
}

.brand-mark {
  align-items: center;
  background: var(--forest);
  border-radius: 8px;
  color: white;
  display: flex;
  font-weight: 850;
  height: 46px;
  justify-content: center;
  margin-bottom: 22px;
  width: 46px;
}

.login-panel h1 {
  font-size: 2rem;
}

.login-panel p {
  color: var(--muted);
  margin: 8px 0 24px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  color: var(--muted);
  display: grid;
  font-size: 0.9rem;
  font-weight: 700;
  gap: 8px;
}

.login-form input {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 12px;
}

.login-form button {
  background: var(--teal);
  color: white;
  padding: 13px;
}

.form-error {
  color: var(--red);
  min-height: 1.3em;
}

@media (max-width: 820px) {
  .status-hero,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 18px;
    width: 100%;
  }

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

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

@media (max-width: 560px) {
  .grid,
  .channel-grid,
  dl div {
    grid-template-columns: 1fr;
  }

  .card {
    min-height: 0;
  }
}
