:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --text: #172026;
  --muted: #68737d;
  --line: #dfe4e8;
  --panel: #ffffff;
  --panel-soft: #f9fbfb;
  --accent: #0f8f6f;
  --accent-strong: #08765a;
  --install: #d97706;
  --active: #0f8f6f;
  --danger: #b42318;
  --shadow: 0 12px 28px rgba(20, 31, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

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

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
}

.token-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

input,
button {
  height: 36px;
  border-radius: 8px;
  font: inherit;
}

input {
  width: 220px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0 11px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 143, 111, 0.14);
}

button {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

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

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

.metric {
  min-height: 92px;
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

.metric.accent {
  border-color: rgba(15, 143, 111, 0.35);
  background: #f1fbf7;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 12px;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.chart-panel {
  min-height: 360px;
}

#trendChart {
  display: block;
  width: 100%;
  height: auto;
  padding: 10px 12px 2px;
}

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

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
}

.install-dot {
  background: var(--install);
}

.active-dot {
  background: var(--active);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #fbfcfc;
}

td:last-child,
th:last-child {
  text-align: right;
}

tr:last-child td {
  border-bottom: 0;
}

.recent-panel {
  grid-column: 1 / -1;
}

.status {
  min-height: 20px;
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.status.error {
  color: var(--danger);
}

.empty {
  color: var(--muted);
  text-align: center;
}

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

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .token-form {
    width: 100%;
  }

  input {
    width: 100%;
  }

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

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

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

  h1 {
    font-size: 26px;
  }
}
