:root {
  --bg: #f5efe5;
  --bg-strong: #ede4d6;
  --surface: rgba(252, 249, 244, 0.94);
  --surface-strong: rgba(255, 252, 248, 0.985);
  --surface-muted: rgba(247, 242, 233, 0.96);
  --line: rgba(54, 45, 34, 0.12);
  --line-strong: rgba(54, 45, 34, 0.22);
  --text: #2c251d;
  --muted: #7c7062;
  --muted-strong: #4d4338;
  --green: #2b8a57;
  --green-soft: #e5f5eb;
  --amber: #c7851c;
  --amber-soft: #fff3df;
  --red: #c34d42;
  --red-soft: #fde8e5;
  --slate: #70859a;
  --shadow: 0 24px 54px rgba(50, 42, 30, 0.07);
  --shadow-soft: 0 12px 28px rgba(50, 42, 30, 0.05);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --measure: 42rem;
  --measure-wide: 46rem;
  --font-ui: "IBM Plex Sans", "Manrope", "Segoe UI Variable", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: var(--font-ui);
  --font-body: "Charter", "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-data: "Menlo", "Monaco", "Cascadia Code", "SFMono-Regular", "SF Mono", "Roboto Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0) 36%),
    linear-gradient(180deg, #fbf7f1 0%, var(--bg) 100%);
  color: var(--text);
  font-family: var(--font-body);
}

body {
  position: relative;
  font-family: var(--font-body);
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" 1, "cv11" 1;
  font-synthesis: none;
}

button,
input {
  font: inherit;
  font-family: var(--font-ui);
}

button:focus-visible,
input:focus-visible,
.group-summary:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(112, 133, 154, 0.16);
}

.page-shell {
  position: relative;
  max-width: 1500px;
  margin: 0 auto;
  padding: 34px 32px 96px;
}

.page-shell::before {
  content: "";
  position: absolute;
  inset: 120px 8% auto auto;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 74%);
  pointer-events: none;
  z-index: 0;
}

.ambient {
  position: fixed;
  inset: auto;
  z-index: 0;
  pointer-events: none;
  filter: blur(82px);
  opacity: 0.22;
}

.ambient-a {
  top: 72px;
  right: 8%;
  width: 320px;
  height: 320px;
  background: rgba(67, 153, 104, 0.16);
}

.ambient-b {
  left: 8%;
  bottom: 10%;
  width: 280px;
  height: 280px;
  background: rgba(126, 160, 193, 0.12);
}

.hero,
.summary-band,
.toolbar,
.highlights,
.matrix-section {
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 420px);
  gap: 28px;
  align-items: end;
  padding: 10px 0 24px;
}

.hero-copy,
.panel-head > div,
.matrix-head > div {
  max-width: var(--measure-wide);
}

.eyebrow,
.panel-kicker,
.summary-kicker,
.meta-label,
.summary-label,
.matrix-note,
.hero-status-meta,
.search-field span {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1,
.panel h2,
.matrix-head h2 {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero h1 {
  margin-top: 10px;
  max-width: 10ch;
  font-size: clamp(46px, 7vw, 84px);
  line-height: 0.94;
}

.hero-text {
  max-width: var(--measure);
  margin: 18px 0 0;
  font-size: clamp(18px, 1.55vw, 20px);
  font-weight: 400;
  line-height: 1.78;
  color: var(--muted-strong);
}

.hero-status,
.panel,
.summary-band,
.matrix-section {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.hero-status {
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
}

.hero-status-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-ui);
  letter-spacing: -0.01em;
  color: var(--muted-strong);
}

.signal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--slate);
  box-shadow: 0 0 0 6px rgba(112, 133, 154, 0.12);
}

.signal-healthy {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(43, 138, 87, 0.12);
}

.signal-warning {
  background: var(--amber);
  box-shadow: 0 0 0 6px rgba(199, 133, 28, 0.12);
}

.signal-critical {
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(195, 77, 66, 0.14);
}

.signal-empty {
  background: var(--slate);
}

.hero-status-meta {
  margin-top: 18px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.72;
  text-transform: none;
  letter-spacing: 0;
}

.summary-band {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 24px;
  padding: 22px 24px;
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
}

.summary-lead {
  border-right: 1px solid var(--line);
  padding-right: 24px;
}

.summary-rate-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 8px;
}

.summary-rate {
  font-family: var(--font-ui);
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.summary-rate.level-healthy {
  color: var(--green);
}

.summary-rate.level-warning {
  color: var(--amber);
}

.summary-rate.level-critical {
  color: var(--red);
}

.summary-rate.level-no_data {
  color: var(--slate);
}

.summary-rate-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.summary-caption {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.72;
  color: var(--muted-strong);
}

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

.summary-cell {
  padding: 4px 24px;
  border-left: 1px solid var(--line);
}

.summary-cell strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-data);
  font-size: 23px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
}

.window-switch {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: none;
}

.window-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  border-radius: 999px;
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.window-switch button:hover {
  transform: translateY(-1px);
}

.window-switch button.is-active {
  background: var(--text);
  color: #fffaf2;
}

.search-field {
  display: grid;
  gap: 8px;
  min-width: min(360px, 100%);
}

.search-field input {
  width: 100%;
  padding: 14px 18px;
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  outline: none;
  color: var(--text);
  box-shadow: none;
}

.search-field input::placeholder {
  color: rgba(83, 74, 63, 0.62);
}

.search-field input:focus {
  border-color: rgba(112, 133, 154, 0.48);
  box-shadow: 0 0 0 4px rgba(112, 133, 154, 0.12);
}

.highlights {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 22px;
  margin-top: 24px;
}

.panel,
.matrix-section {
  border-radius: var(--radius-lg);
  padding: 22px;
}

.panel-head,
.matrix-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.panel h2,
.matrix-head h2 {
  margin-top: 8px;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.08;
}

.error-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.error-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.error-chip strong {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.error-chip span {
  font-size: 12px;
  color: var(--muted);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 18px;
  margin-top: 22px;
}

.meta-grid strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-data);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.matrix-section {
  margin-top: 24px;
}

.matrix-head h2 {
  font-size: clamp(30px, 3.4vw, 40px);
}

.matrix-note {
  max-width: 32rem;
  text-align: right;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.72;
  text-transform: none;
  letter-spacing: 0;
}

.group-stack {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.provider-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.provider-group.level-healthy {
  border-color: rgba(43, 138, 87, 0.16);
}

.provider-group.level-warning {
  border-color: rgba(199, 133, 28, 0.2);
}

.provider-group.level-critical {
  border-color: rgba(195, 77, 66, 0.22);
}

.group-summary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background-color 180ms ease, transform 180ms ease;
}

.group-summary:hover {
  background: rgba(255, 255, 255, 0.42);
}

.group-summary-main,
.group-summary-side,
.group-title-row,
.group-subtitle {
  display: flex;
  align-items: center;
}

.group-summary-main {
  gap: 14px;
  min-width: 0;
}

.group-title-row {
  gap: 12px;
}

.group-copy {
  min-width: 0;
}

.group-handle {
  width: 18px;
  display: grid;
  grid-template-columns: repeat(2, 4px);
  grid-auto-rows: 4px;
  gap: 3px;
  opacity: 0.42;
}

.group-handle i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
}

.group-title-row h3 {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.group-subtitle {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.group-toggle {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-size: 15px;
}

.group-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(112, 133, 154, 0.08);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.group-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-strong);
  font-family: var(--font-ui);
  font-size: 13px;
}

.group-count i {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: var(--slate);
}

.group-count.tone-healthy i {
  background: var(--green);
}

.group-count.tone-warning i {
  background: var(--amber);
}

.group-count.tone-critical i {
  background: var(--red);
}

.group-summary-side {
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.group-rate,
.group-action,
.group-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.group-rate {
  background: rgba(112, 133, 154, 0.08);
  color: var(--muted-strong);
  font-family: var(--font-data);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.group-level {
  background: rgba(112, 133, 154, 0.08);
  color: var(--muted-strong);
}

.group-level.level-healthy {
  background: var(--green-soft);
  color: var(--green);
}

.group-level.level-warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.group-level.level-critical {
  background: var(--red-soft);
  color: var(--red);
}

.group-rate.level-healthy {
  color: var(--green);
}

.group-rate.level-warning {
  color: var(--amber);
}

.group-rate.level-critical {
  color: var(--red);
}

.group-action {
  background: rgba(33, 29, 24, 0.96);
  color: #fffaf2;
  font-weight: 800;
}

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

.status-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  min-height: 340px;
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid rgba(39, 35, 29, 0.08);
  box-shadow: var(--shadow-soft);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
  animation: rise 500ms ease both;
}

.status-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 48px rgba(50, 42, 30, 0.12);
}

.status-card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: rgba(112, 133, 154, 0.22);
}

.status-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.68) 0%, rgba(255, 255, 255, 0) 74%);
  pointer-events: none;
}

.status-card.level-healthy::after {
  background: rgba(43, 138, 87, 0.86);
}

.status-card.level-warning::after {
  background: rgba(199, 133, 28, 0.86);
}

.status-card.level-critical::after {
  background: rgba(195, 77, 66, 0.9);
}

.card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.card-ident {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.provider-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--muted-strong);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.04em;
  background: var(--surface);
}

.card-title {
  margin: 0;
  font-family: var(--font-body);
  font-size: 29px;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.card-note {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.64;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.status-pill.level-healthy {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.level-warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill.level-critical {
  background: var(--red-soft);
  color: var(--red);
}

.status-pill.level-no_data {
  background: rgba(112, 133, 154, 0.12);
  color: var(--slate);
}

.card-rate {
  display: grid;
  gap: 10px;
}

.card-rate-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.card-rate-value {
  font-family: var(--font-ui);
  font-size: clamp(36px, 5vw, 60px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.card-rate-value.level-healthy {
  color: var(--green);
}

.card-rate-value.level-warning {
  color: var(--amber);
}

.card-rate-value.level-critical {
  color: var(--red);
}

.card-rate-value.level-no_data {
  color: var(--slate);
}

.metric-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(128px, 1.16fr) minmax(0, 0.92fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric {
  padding: 15px 10px 15px 0;
}

.metric + .metric {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.metric span {
  display: block;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  color: var(--muted);
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-data);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.18;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.metric-fraction {
  letter-spacing: -0.03em;
}

.card-footer {
  display: grid;
  gap: 16px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-head span,
.history-head strong {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

.history-head strong {
  font-family: var(--font-data);
  font-weight: 800;
  letter-spacing: 0.06em;
}

.history-strip {
  display: grid;
  grid-template-columns: repeat(60, minmax(0, 1fr));
  gap: 4px;
  align-items: end;
  padding-top: 2px;
}

.history-bar {
  display: block;
  min-height: 34px;
  border-radius: 999px;
  background: rgba(112, 133, 154, 0.14);
}

.history-bar.tone-healthy {
  background: rgba(43, 138, 87, 0.82);
}

.history-bar.tone-warning {
  background: rgba(199, 133, 28, 0.72);
}

.history-bar.tone-critical {
  background: rgba(195, 77, 66, 0.82);
}

.history-bar.tone-empty {
  background: rgba(112, 133, 154, 0.14);
}

.error-block {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.error-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
}

.error-row span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  line-height: 1.4;
  padding-top: 2px;
}

.error-row strong,
.error-row p {
  margin: 0;
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.58;
  color: var(--muted-strong);
}

.empty-state {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 253, 249, 0.88);
  border: 1px dashed var(--line-strong);
  color: var(--muted-strong);
}

.hidden {
  display: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .hero,
  .summary-band,
  .highlights {
    grid-template-columns: 1fr;
  }

  .summary-lead {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 20px;
  }

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

  .summary-cell:nth-child(odd) {
    border-left: 0;
  }

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

@media (min-width: 1620px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .page-shell {
    padding: 28px 16px 72px;
  }

  .page-shell::before {
    display: none;
  }

  .toolbar,
  .panel-head,
  .matrix-head {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-grid,
  .meta-grid,
  .card-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .summary-cell,
  .metric {
    border-left: 0;
    padding-left: 0;
  }

  .summary-cell {
    padding: 0;
  }

  .metric {
    min-width: 0;
    padding: 12px 0;
  }

  .metric + .metric {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .status-card {
    min-height: auto;
  }

  .group-summary,
  .group-summary-main,
  .group-summary-side {
    flex-direction: column;
    align-items: stretch;
  }

  .group-summary-side {
    gap: 10px;
  }

  .group-handle {
    display: none;
  }

  .hero h1 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .hero-text,
  .hero-status-meta,
  .summary-caption,
  .matrix-note {
    font-size: 15px;
    line-height: 1.66;
  }
}

@media (min-width: 821px) and (max-width: 980px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .metric:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}
