:root {
  color-scheme: dark;
  --bg: #07100f;
  --panel: #101b19;
  --panel-2: #142421;
  --line: #253a35;
  --text: #f0f5ef;
  --muted: #92a59f;
  --green: #7ed7ad;
  --green-bright: #b5f4d2;
  --orange: #f1a66b;
  --blue: #69a6d9;
  --yellow: #d5c469;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 80% -20%, rgb(38 100 75 / 20%), transparent 38rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

.topbar,
main,
footer {
  width: min(1440px, calc(100% - 48px));
  margin-inline: auto;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: #07100f;
  background: var(--green);
  font-weight: 900;
}

.status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.status span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
}

main {
  padding-block: 58px 72px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  margin-bottom: 38px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.96;
  letter-spacing: -0.065em;
  font-weight: 650;
}

h2 {
  margin-bottom: 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.lede {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.period {
  min-width: 220px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(16 27 25 / 70%);
}

.period span,
.period small {
  display: block;
}

.period span {
  font-weight: 650;
}

.period small {
  margin-top: 5px;
  color: var(--muted);
}

.error {
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid #713e35;
  border-radius: 10px;
  color: #ffb7aa;
  background: #2a1512;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
}

.metric {
  position: relative;
  min-height: 170px;
  padding: 24px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric.primary {
  background: var(--green);
  color: #07100f;
}

.metric.bedrock::after {
  content: "";
  position: absolute;
  inset: auto 22px 20px auto;
  width: 38px;
  height: 38px;
  border: 7px solid var(--green);
  border-left-color: transparent;
  border-radius: 50%;
  opacity: 0.7;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary .metric-label,
.primary p {
  color: #183b2e;
}

.metric strong {
  display: block;
  margin-top: 20px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
  letter-spacing: -0.055em;
}

.metric p {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 20px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 26px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 28px;
}

.legend {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.swatch.total {
  background: #314d46;
}

.swatch.ai {
  background: var(--green);
}

.chart {
  min-height: 260px;
}

.chart svg {
  display: block;
  width: 100%;
  height: 260px;
  overflow: visible;
}

.chart text {
  fill: var(--muted);
  font-size: 10px;
}

.service-list,
.budget-list,
.token-list {
  display: grid;
  gap: 16px;
}

.service-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  font-size: 13px;
}

.service-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #cbd7d3;
}

.service-cost {
  font-variant-numeric: tabular-nums;
}

.bar {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #1d302c;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.token-layout {
  display: grid;
  grid-template-columns: 170px 1fr;
  align-items: center;
  gap: 34px;
}

.donut {
  position: relative;
  display: grid;
  place-content: center;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  text-align: center;
  background: conic-gradient(var(--green) 0 100%);
}

.donut::before {
  content: "";
  position: absolute;
  inset: 19px;
  border-radius: inherit;
  background: var(--panel);
}

.donut span,
.donut small {
  position: relative;
}

.donut span {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

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

.token-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.token-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.token-row span:nth-child(2) {
  color: var(--muted);
}

.insight {
  margin: 24px 0 0;
  padding: 13px 15px;
  border-left: 2px solid var(--green);
  color: var(--muted);
  background: #0b1614;
  font-size: 13px;
  line-height: 1.5;
}

.budget {
  display: grid;
  gap: 8px;
}

.budget-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}

.budget-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.priority {
  display: grid;
  gap: 5px;
  margin-top: 26px;
  padding: 16px;
  border-radius: 10px;
  color: #12251f;
  background: var(--green-bright);
  font-size: 13px;
}

.actions {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 40px;
  margin-top: 20px;
}

.actions ol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.actions li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  color: #c8d5d0;
  font-size: 13px;
  line-height: 1.5;
}

.actions li span {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 980px) {
  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

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

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

@media (max-width: 680px) {
  .topbar,
  main,
  footer {
    width: min(100% - 28px, 1440px);
  }

  main {
    padding-top: 38px;
  }

  .hero,
  footer {
    align-items: stretch;
    flex-direction: column;
  }

  .period {
    min-width: 0;
  }

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

  .metric {
    min-height: 145px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:last-child {
    border-bottom: 0;
  }

  .panel {
    padding: 20px;
  }

  .panel-head,
  .token-layout,
  .actions {
    grid-template-columns: 1fr;
  }

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

  .token-layout {
    justify-items: center;
  }

  .token-list {
    width: 100%;
  }

  .actions ol {
    grid-template-columns: 1fr;
  }
}
