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

.wait-header,
.state-panel,
.list-panel,
.source-panel,
.emergency-note {
  border: 1px solid var(--owtl-line);
  border-radius: var(--owtl-radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--owtl-shadow);
}

.wait-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  align-items: end;
  padding: 34px 30px 30px;
  overflow: hidden;
  position: relative;
}

.wait-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--owtl-carbon), var(--owtl-coral), var(--owtl-amber), var(--owtl-green), var(--owtl-blue));
}

.wait-header h1 {
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 5.2rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.wait-lede {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--owtl-ink);
  font-size: 1.02rem;
  font-weight: 720;
  line-height: 1.6;
}

.wait-summary {
  display: grid;
  gap: 5px;
  min-width: 190px;
  padding: 18px;
  border: 1px solid var(--owtl-carbon);
  border-radius: var(--owtl-radius);
  background: #fff;
}

.wait-summary span,
.timestamp,
.count-chip {
  color: var(--owtl-muted);
  font-size: 0.82rem;
  font-weight: 820;
}

.wait-summary strong {
  font-size: 1.45rem;
  line-height: 1.1;
}

.emergency-note {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding: 14px 16px;
  border-color: color-mix(in srgb, var(--owtl-coral) 58%, var(--owtl-line));
}

.emergency-note strong {
  color: #9e2f22;
}

.emergency-note span {
  color: var(--owtl-muted);
  font-weight: 700;
}

.state-panel,
.list-panel,
.source-panel {
  margin-top: 22px;
  padding: 24px;
}

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

.panel-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.state-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.state-tabs button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--owtl-line);
  border-radius: var(--owtl-radius);
  background: #fff;
  color: var(--owtl-ink);
  font-weight: 850;
  cursor: pointer;
}

.state-tabs button[aria-selected="true"] {
  border-color: var(--owtl-carbon);
  background: var(--owtl-carbon);
  color: #fff;
}

.state-note {
  margin: -6px 0 18px;
  color: var(--owtl-muted);
  font-weight: 690;
  line-height: 1.55;
}

.hospital-list {
  display: grid;
  gap: 12px;
}

.hospital-card {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(170px, 0.7fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--owtl-line);
  border-radius: var(--owtl-radius);
  background: #fff;
}

.hospital-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.hospital-meta,
.metric-subtext,
.source-row,
.empty-copy {
  color: var(--owtl-muted);
  font-size: 0.88rem;
  font-weight: 680;
  line-height: 1.5;
}

.metric-box {
  display: grid;
  gap: 4px;
}

.metric-label {
  color: var(--owtl-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-value {
  color: var(--owtl-ink);
  font-size: 1.45rem;
  font-weight: 930;
  line-height: 1.05;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--owtl-carbon);
  border-radius: var(--owtl-radius);
  background: #fff;
  color: var(--owtl-ink);
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.map-link:hover {
  border-color: var(--owtl-blue);
}

.source-list {
  display: grid;
  gap: 10px;
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--owtl-line);
  border-radius: var(--owtl-radius);
  background: #fff;
}

.source-row strong {
  color: var(--owtl-ink);
}

.source-row a {
  color: var(--owtl-blue);
  font-weight: 820;
}

.source-row.skipped {
  background: #fff9f6;
}

.empty-copy {
  padding: 18px;
  border: 1px dashed var(--owtl-line);
  border-radius: var(--owtl-radius);
}

@media (max-width: 800px) {
  .wait-shell {
    width: min(100% - 20px, 720px);
    padding-top: 16px;
  }

  .wait-header {
    grid-template-columns: 1fr;
    padding: 22px 20px;
  }

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

  .hospital-card {
    grid-template-columns: 1fr;
  }

  .map-link {
    width: 100%;
  }
}
