:root {
  --bg: #090c0b;
  --bg-soft: #0f1412;
  --panel: #111714;
  --panel-high: #161d19;
  --line: #27302c;
  --line-soft: #1d2521;
  --text: #f3f5f0;
  --muted: #99a49e;
  --dim: #69736e;
  --green: #b8ff63;
  --green-strong: #78d82e;
  --gold: #ffc85a;
  --red: #ff716c;
  --blue: #79c7ff;
  --radius: 18px;
  --mono: "SFMono-Regular", "Roboto Mono", "Cascadia Code", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  max-width: 100%;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 78% -8%, rgba(120, 216, 46, 0.1), transparent 29rem),
    linear-gradient(180deg, #0a0e0c 0%, var(--bg) 45%);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1440px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 0 42px 30px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 4px;
  padding: 8px;
  border: 1px solid #526059;
  border-radius: 10px;
  transform: rotate(180deg);
}

.brand-mark i {
  display: block;
  border-radius: 2px;
  background: var(--green);
}

.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 14px; }
.brand-mark i:nth-child(3) { height: 22px; }

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: 0.18em;
  font-size: 14px;
}

.brand small {
  margin-top: 1px;
  color: var(--dim);
  font: 9px/1.3 var(--mono);
  letter-spacing: 0.1em;
}

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

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(255, 200, 90, 0.08);
}

.header-meta.is-ready .live-dot {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(184, 255, 99, 0.08);
}

.header-meta.is-error .live-dot {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(255, 113, 108, 0.08);
}

.version-pill {
  margin-left: 6px;
  padding: 3px 8px;
  color: #c2ccc6;
  border: 1px solid var(--line);
  border-radius: 99px;
  font: 10px var(--mono);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 60px;
  align-items: end;
  padding: 72px 0 54px;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--green);
  font: 10px/1.4 var(--mono);
  letter-spacing: 0.18em;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(46px, 6.2vw, 91px);
  font-weight: 520;
  line-height: 0.95;
  letter-spacing: -0.064em;
}

.hero h1 span {
  color: var(--green);
}

.hero-copy {
  max-width: 680px;
  margin: 27px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.hero-aside {
  min-width: 205px;
  padding-bottom: 5px;
}

.hero-time {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-time span,
.hero-time strong {
  display: block;
}

.hero-time span {
  color: var(--dim);
  font-size: 11px;
}

.hero-time strong {
  margin-top: 4px;
  font: 18px var(--mono);
}

.refresh-button {
  width: 100%;
  margin-top: 14px;
  padding: 10px 14px;
  color: #d9e1dc;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.refresh-button:hover {
  color: var(--green);
  border-color: #58675f;
}

.refresh-button:active {
  transform: translateY(1px);
}

.refresh-button.is-loading span {
  display: inline-block;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 17px 20px;
  background: rgba(255, 200, 90, 0.055);
  border: 1px solid rgba(255, 200, 90, 0.24);
  border-radius: 12px;
}

.status-banner.is-ready {
  background: rgba(184, 255, 99, 0.045);
  border-color: rgba(184, 255, 99, 0.25);
}

.status-banner.is-error {
  background: rgba(255, 113, 108, 0.045);
  border-color: rgba(255, 113, 108, 0.25);
}

.status-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: rgba(255, 200, 90, 0.08);
  border-radius: 9px;
  font: 13px var(--mono);
}

.status-banner.is-ready .status-icon {
  color: var(--green);
  background: rgba(184, 255, 99, 0.08);
}

.status-banner.is-error .status-icon {
  color: var(--red);
  background: rgba(255, 113, 108, 0.08);
}

.status-banner strong,
.status-banner p {
  display: block;
  margin: 0;
}

.status-banner strong {
  font-size: 13px;
}

.status-banner p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.request-link {
  color: var(--muted);
  font-size: 12px;
  text-underline-offset: 3px;
}

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

.metric-card {
  min-height: 150px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, var(--panel-high), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric-card::after {
  content: "";
  width: 58px;
  height: 3px;
  position: absolute;
  right: 20px;
  top: 22px;
  background: var(--blue);
  border-radius: 99px;
  opacity: 0.7;
}

.metric-card.accent-green::after { background: var(--green); }
.metric-card.accent-gold::after { background: var(--gold); }
.metric-card.accent-red::after { background: var(--red); }

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.metric-card strong {
  display: block;
  margin: 17px 0 10px;
  font: 38px/1 var(--mono);
  letter-spacing: -0.05em;
}

.panel {
  background: rgba(16, 22, 19, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.chart-panel {
  min-height: 330px;
  padding: 25px 26px 22px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 560;
  letter-spacing: -0.035em;
}

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

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

.legend i {
  width: 16px;
  height: 3px;
  display: inline-block;
  border-radius: 99px;
  background: var(--blue);
}

.legend .legend-burn { background: var(--green); }

.bar-chart {
  min-height: 220px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 24px;
  border-bottom: 1px solid var(--line);
}

.chart-placeholder {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  color: var(--dim);
  font-size: 12px;
}

.bar-column {
  min-width: 0;
  display: grid;
  grid-template-rows: 22px 150px 22px;
  gap: 7px;
  align-items: end;
  text-align: center;
}

.bar-value {
  overflow: hidden;
  color: var(--muted);
  font: 10px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 150px;
  display: flex;
  align-items: end;
  justify-content: center;
  background-image: linear-gradient(to top, var(--line-soft) 1px, transparent 1px);
  background-size: 100% 50px;
}

.bar-fill {
  width: min(38px, 64%);
  min-height: 3px;
  background: linear-gradient(180deg, var(--blue), #4384ac);
  border-radius: 5px 5px 0 0;
  transition: height 420ms ease;
}

.bar-column.is-burn .bar-fill {
  background: linear-gradient(180deg, var(--green), #4f9821);
}

.bar-label {
  overflow: hidden;
  font: 11px var(--mono);
  text-overflow: ellipsis;
}

.monitor-section {
  min-width: 0;
  max-width: 100%;
  margin-top: 12px;
  overflow: hidden;
}

.monitor-heading {
  align-items: center;
  padding: 24px 26px;
  border-bottom: 1px solid var(--line);
}

.filters {
  display: flex;
  gap: 8px;
}

.filters input,
.filters select {
  min-height: 38px;
  color: #dce4df;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.filters input {
  width: 190px;
  padding: 0 12px;
}

.filters select {
  padding: 0 28px 0 10px;
}

.filters input:focus,
.filters select:focus {
  border-color: #607168;
  box-shadow: 0 0 0 3px rgba(184, 255, 99, 0.05);
}

.table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

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

th,
td {
  padding: 17px 13px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

th:first-child,
td:first-child { padding-left: 26px; }

th:last-child,
td:last-child { padding-right: 26px; }

th {
  color: var(--dim);
  font: 9px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

td {
  color: #c9d1cc;
  font-size: 12px;
}

tbody tr {
  transition: background 150ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.018);
}

.token-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.token-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--green);
  background: #18211c;
  border: 1px solid #2b3831;
  border-radius: 50%;
  font: 9px var(--mono);
}

.token-cell strong,
.token-cell small {
  display: block;
}

.token-cell strong {
  color: var(--text);
  font-size: 12px;
}

.token-cell small {
  margin-top: 1px;
  color: var(--dim);
  font: 9px var(--mono);
}

.status-pill,
.mechanism-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  white-space: nowrap;
  font: 9px var(--mono);
  text-transform: uppercase;
}

.status-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.status-pill.active {
  color: var(--green);
  border-color: rgba(184, 255, 99, 0.24);
}

.status-pill.active::before { background: var(--green); }
.status-pill.paused { color: var(--gold); }
.status-pill.paused::before { background: var(--gold); }
.status-pill.proposal { color: var(--blue); }
.status-pill.proposal::before { background: var(--blue); }
.status-pill.inactive { color: var(--red); }
.status-pill.inactive::before { background: var(--red); }

.amount-cell strong,
.amount-cell small {
  display: block;
}

.amount-cell strong {
  color: var(--text);
  font: 11px var(--mono);
}

.amount-cell small {
  margin-top: 3px;
  color: var(--dim);
  font-size: 10px;
}

.effect-burn { color: var(--green); }
.effect-neutral { color: var(--gold); }
.effect-unclear { color: var(--muted); }

.evidence-button {
  min-width: 30px;
  min-height: 30px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.evidence-button:hover {
  color: var(--green);
  border-color: #5b6b62;
}

.table-empty {
  min-width: 100%;
  padding: 58px 24px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.watchlist-grid {
  max-width: 840px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin: 18px auto 0;
}

.watchlist-grid span {
  padding: 4px 9px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 99px;
  font: 10px var(--mono);
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 46px 0 20px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.method-grid article {
  min-height: 190px;
  padding: 28px;
  background: var(--bg-soft);
}

.method-index {
  color: var(--green);
  font: 10px var(--mono);
}

.method-grid h3 {
  margin: 28px 0 9px;
  font-size: 15px;
}

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

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 0 0;
  color: var(--dim);
  border-top: 1px solid var(--line);
  font-size: 10px;
}

footer p { margin: 0; }
footer code { font-family: var(--mono); }

dialog {
  width: min(650px, calc(100vw - 32px));
  max-height: calc(100vh - 42px);
  padding: 0;
  color: var(--text);
  background: var(--panel);
  border: 1px solid #344039;
  border-radius: 18px;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.65);
}

dialog::backdrop {
  background: rgba(3, 5, 4, 0.77);
  backdrop-filter: blur(7px);
}

.dialog-shell {
  position: relative;
  padding: 32px;
}

.dialog-close {
  width: 32px;
  height: 32px;
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.dialog-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 26px;
}

.dialog-title h2,
.dialog-title p { margin: 0; }
.dialog-title p { color: var(--muted); font-size: 11px; }

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

.detail-grid > div {
  padding: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.detail-grid span,
.detail-grid strong {
  display: block;
}

.detail-grid span {
  color: var(--dim);
  font-size: 10px;
}

.detail-grid strong {
  margin-top: 4px;
  color: #dfe5e1;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.detail-notes {
  margin: 20px 0 0;
  padding-top: 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.detail-links a {
  padding: 7px 10px;
  color: var(--green);
  border: 1px solid rgba(184, 255, 99, 0.22);
  border-radius: 8px;
  text-decoration: none;
  font-size: 11px;
}

.sr-only {
  width: 1px;
  height: 1px;
  position: absolute;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .page-shell { padding: 0 24px 26px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-heading { align-items: flex-start; flex-direction: column; }
  .filters { width: 100%; }
  .filters label:first-child { flex: 1; }
  .filters input { width: 100%; }
}

@media (max-width: 720px) {
  .page-shell { padding: 0 16px 24px; }
  .site-header { min-height: 72px; }
  #header-status { display: none; }
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 52px 0 36px;
  }
  .hero h1 { font-size: clamp(42px, 12vw, 60px); }
  .hero-aside { display: flex; gap: 12px; align-items: stretch; }
  .hero-time { flex: 1; padding: 12px 0; }
  .refresh-button { width: auto; margin-top: 0; }
  .status-banner { grid-template-columns: auto minmax(0, 1fr); }
  .request-link { display: none; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 130px; padding: 18px; }
  .metric-card strong { font-size: 29px; }
  .chart-panel { padding: 22px 18px 16px; }
  .panel-heading { flex-direction: column; gap: 12px; }
  .bar-chart {
    grid-template-columns: repeat(6, minmax(44px, 1fr));
    overflow-x: auto;
  }
  .filters { flex-wrap: wrap; }
  .filters label:first-child { flex: 1 0 100%; }
  .filters label:not(:first-child) { flex: 1; }
  .filters select { width: 100%; }
  .method-grid { grid-template-columns: 1fr; }
  .method-grid article { min-height: auto; }
  footer { flex-direction: column; }
}

@media (max-width: 460px) {
  .brand small { display: none; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 114px; }
  .hero-aside { display: block; }
  .refresh-button { width: 100%; margin-top: 12px; }
  .detail-grid { grid-template-columns: 1fr; }
  .dialog-shell { padding: 26px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
