:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --panel: #ffffff;
  --line: #e4e7eb;
  --line-strong: #d5dae0;
  --text: #111318;
  --muted: #707781;
  --soft: #eef1f4;
  --green: #18b77b;
  --blue: #2078ff;
  --amber: #bf7a12;
  --shadow: 0 1px 2px rgba(17, 19, 24, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 26px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 720;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.pixel {
  width: 44px;
  height: 34px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 0;
  flex: 0 0 auto;
}

.pixel span {
  background: #ff987f;
}

.pixel span:nth-child(1) {
  grid-column: 2 / 4;
}

.pixel span:nth-child(2) {
  grid-column: 1 / 5;
  grid-row: 2;
}

.pixel span:nth-child(3) {
  grid-column: 2 / 4;
  grid-row: 3;
}

.pixel span:nth-child(4) {
  grid-column: 4;
  grid-row: 3;
  background: transparent;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.metrics article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metrics article {
  padding: 16px;
  min-width: 0;
}

.metrics span,
.metrics small,
.panel-head span,
.hero-label,
.hero-split span {
  color: var(--muted);
  font-size: 12px;
}

.metrics strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1;
  font-weight: 780;
}

.metrics small {
  display: block;
  margin-top: 7px;
}

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

.side,
.main {
  display: grid;
  gap: 16px;
  align-content: start;
}

.panel {
  padding: 18px;
  min-width: 0;
}

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

.panel h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 720;
}

.limits {
  display: grid;
  gap: 14px;
}

.limit-row {
  display: grid;
  gap: 7px;
}

.limit-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.limit-title strong {
  font-size: 13px;
}

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

.bar {
  height: 8px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
}

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

.heatmap {
  display: grid;
  grid-template-columns: repeat(26, minmax(0, 1fr));
  grid-template-rows: repeat(7, 11px);
  grid-auto-flow: column;
  gap: 3px;
  overflow: visible;
}

.heatmap button,
.legend i {
  min-width: 0;
  border: 0;
  border-radius: 2px;
  padding: 0;
  background: #e9edf1;
}

.heatmap button {
  width: 100%;
  height: 100%;
}

.legend i {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
}

.heatmap button[data-level="1"],
.legend i[data-level="1"] {
  background: #cde8dd;
}

.heatmap button[data-level="2"],
.legend i[data-level="2"] {
  background: #8bd9b9;
}

.heatmap button[data-level="3"],
.legend i[data-level="3"] {
  background: #37c892;
}

.heatmap button[data-level="4"],
.legend i[data-level="4"] {
  background: #139f6c;
}

.legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
}

.model-list,
.client-list {
  display: grid;
  gap: 12px;
}

.model-row,
.client-row {
  display: grid;
  gap: 6px;
}

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

.row-main b {
  font-weight: 690;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-main span,
.row-sub {
  color: var(--muted);
  font-size: 12px;
}

.mini-bar {
  height: 4px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
}

.mini-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
}

.hero {
  padding: 22px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 22px;
}

.tabs button {
  min-width: 42px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.tabs button.active {
  background: var(--soft);
  color: var(--text);
  font-weight: 680;
}

.hero-label {
  display: block;
  text-align: center;
  letter-spacing: 0.08em;
}

.hero > strong {
  display: block;
  margin: 10px 0 8px;
  text-align: center;
  font-size: clamp(46px, 9vw, 78px);
  line-height: 0.95;
  font-weight: 820;
}

.hero-cost {
  margin-bottom: 20px;
  color: #14966b;
  text-align: center;
  font-size: 22px;
  font-weight: 760;
}

.hero-split {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 16px;
  border-top: 5px solid var(--green);
}

.hero-split div {
  min-width: 0;
}

.hero-split b {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.chart-panel canvas {
  width: 100%;
  height: 300px;
  display: block;
}

.table-panel {
  padding-bottom: 8px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 660px;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

td {
  font-variant-numeric: tabular-nums;
}

.empty {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 860px) {
  .shell {
    width: min(100vw - 20px, 720px);
    padding-top: 12px;
  }

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

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

  .side {
    order: 2;
  }

  .main {
    order: 1;
  }
}

@media (max-width: 520px) {
  .metrics {
    gap: 8px;
  }

  .metrics article,
  .panel {
    padding: 14px;
  }

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