:root {
  --bg: #080c11;
  --panel: #111821;
  --panel-soft: #151f2a;
  --panel-deep: #0d131b;
  --text: #eef4fb;
  --muted: #8ea0b5;
  --faint: #5d6d80;
  --line: #243244;
  --line-strong: #33465f;
  --green: #32d583;
  --blue: #5aa7ff;
  --amber: #ffc233;
  --red: #ff647c;
  --cyan: #45d6ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 0%, rgba(45, 93, 130, 0.18), transparent 28%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.02;
}

h2 {
  font-size: 16px;
}

.live-card,
.metric,
.panel,
.pool-button {
  border: 1px solid var(--line);
  background: rgba(17, 24, 33, 0.88);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  border-radius: 8px;
}

.live-card {
  min-width: 210px;
  padding: 12px 14px;
}

.live-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 5px;
}

.live-card span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--faint);
  box-shadow: 0 0 0 0 rgba(50, 213, 131, 0.35);
}

.live-dot.ok {
  background: var(--green);
  animation: pulse 1.7s infinite;
}

.live-dot.error {
  background: var(--red);
}

.live-dot.polling {
  background: var(--cyan);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(50, 213, 131, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(50, 213, 131, 0); }
  100% { box-shadow: 0 0 0 0 rgba(50, 213, 131, 0); }
}

.summary-grid {
  display: grid;
  grid-template-columns: 0.9fr 2.2fr 0.8fr 1fr 140px;
  gap: 12px;
  margin-bottom: 14px;
}

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

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}

.metric strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.refresh-button {
  border: 1px solid var(--line-strong);
  background: #1a2735;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
}

.refresh-button:hover {
  border-color: var(--cyan);
}

.layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 14px;
}

.pool-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.pool-button {
  color: var(--text);
  text-align: left;
  padding: 14px;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.pool-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.pool-button.active {
  border-color: rgba(69, 214, 255, 0.75);
  background: #142131;
}

.pool-button.unresolved {
  opacity: 0.78;
}

.pool-button .name {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}

.pool-button .id {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.pool-button .price {
  color: var(--cyan);
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

.status-tag.ok {
  color: var(--green);
  border-color: rgba(50, 213, 131, 0.35);
}

.status-tag.error {
  color: var(--red);
  border-color: rgba(255, 100, 124, 0.35);
}

.status-tag.unresolved {
  color: var(--amber);
  border-color: rgba(255, 194, 51, 0.32);
}

.workspace {
  display: grid;
  gap: 14px;
  min-width: 0;
}

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

.pool-hero {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, minmax(130px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.hero-title {
  min-width: 0;
}

.hero-title h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.hero-title p,
.small,
.row-sub,
.panel-subtitle {
  color: var(--muted);
}

.hero-title p {
  overflow-wrap: anywhere;
}

.source-summary {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  max-width: 520px;
}

.source-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfaf4;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.source-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.source-row span {
  color: var(--muted);
}

.source-row strong,
.source-row code {
  min-width: 0;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-field {
  display: grid;
  grid-template-columns: minmax(0, max-content) auto;
  align-items: center;
  justify-content: start;
  gap: 8px;
  min-width: 0;
}

.contract-address {
  position: relative;
  cursor: help;
  overflow: visible !important;
}

.contract-address::after {
  content: attr(data-full);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 24;
  width: max-content;
  max-width: none;
  padding: 8px 10px;
  border-radius: 12px;
  background: #050505;
  color: #f8f5eb;
  font: 700 12px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
  overflow-wrap: normal;
}

.contract-address:hover::after,
.contract-address:focus::after {
  opacity: 1;
  transform: translateY(0);
}

.copy-button {
  border: 0;
  border-radius: 999px;
  background: #050505;
  color: #f8f5eb;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  min-height: 24px;
  padding: 3px 7px;
}

.panel-subtitle {
  margin-top: 4px;
  font-size: 12px;
}

.big-number {
  padding: 12px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.big-number span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.big-number .metric-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}

.big-number .metric-hint {
  display: inline-flex !important;
  margin-bottom: 0;
}

.big-number strong {
  display: block;
  font-size: 19px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

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

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
}

.chart-controls {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 280px;
}

.value-filter-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.value-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.value-preset {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.value-filter input,
.value-preset select {
  width: 94px;
  border: 1px solid var(--line);
  background: var(--panel-deep);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}

.filter-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.filter-presets button {
  border: 1px solid var(--line);
  background: var(--panel-deep);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 9px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.zero-count {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 1.15em;
  height: 1.15em;
  margin: 0 1px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.5em;
  font-weight: 800;
  line-height: 1;
  vertical-align: -0.2em;
}

.price-metric-value {
  font-size: 22px;
  line-height: 1.1;
}

.price-number,
.price-pair {
  display: inline !important;
}

.token0,
.range-bar.token0 {
  background: var(--blue);
}

.active,
.range-bar.active {
  background: var(--green);
}

.token1,
.range-bar.token1 {
  background: var(--amber);
}

.chart-shell {
  border: 1px solid var(--line);
  background: #0d141d;
  border-radius: 8px;
  padding: 10px 12px 12px;
}

.chart {
  position: relative;
  height: 390px;
  overflow: hidden;
}

.value-axis {
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 56px;
  width: 64px;
  border-left: 1px solid rgba(142, 160, 181, 0.34);
  z-index: 4;
  pointer-events: none;
}

.value-axis-title,
.value-axis-label {
  position: absolute;
  left: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.value-axis-title {
  top: 0;
  font-weight: 700;
}

.value-axis-label {
  transform: translateY(50%);
}

.gridline,
.axis-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(142, 160, 181, 0.14);
}

.gridline.top {
  top: 16%;
}

.gridline.mid {
  top: 48%;
}

.axis-line {
  bottom: 56px;
  border-color: var(--line-strong);
}

.range-bar {
  position: absolute;
  bottom: 56px;
  min-width: 3px;
  border-radius: 3px 3px 0 0;
  opacity: 0.9;
  box-shadow:
    inset 1px 0 rgba(255, 255, 255, 0.28),
    inset -1px 0 rgba(0, 0, 0, 0.28);
  cursor: crosshair;
  transition: opacity 120ms ease, filter 120ms ease, outline-color 120ms ease;
}

.range-bar:hover {
  opacity: 1;
  filter: brightness(1.12);
  outline: 1px solid rgba(255, 255, 255, 0.65);
  z-index: 7;
}

.range-bar.selected {
  opacity: 1;
  outline: 2px solid rgba(255, 255, 255, 0.8);
  z-index: 8;
}

.bar-label {
  position: absolute;
  left: 8px;
  bottom: calc(100% + 6px);
  max-width: calc(100% - 12px);
  color: var(--text);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(8, 12, 17, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  padding: 2px 5px;
}

.current-line {
  position: absolute;
  top: 14px;
  bottom: 56px;
  width: 2px;
  background: var(--red);
  z-index: 30;
  pointer-events: none;
}

.current-line span {
  position: absolute;
  top: 0;
  left: 8px;
  transform: translateY(-2px);
  background: rgba(255, 100, 124, 0.13);
  border: 1px solid rgba(255, 100, 124, 0.46);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}

.chart-tooltip {
  position: absolute;
  z-index: 50;
  display: none;
  width: 220px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 12, 17, 0.94);
  color: var(--text);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.chart-tooltip.visible {
  display: grid;
  gap: 4px;
}

.chart-tooltip strong {
  font-size: 15px;
}

.chart-tooltip span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.axis-label {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 80px;
  color: var(--muted);
  font-size: 11px;
}

.axis-label::before {
  content: "";
  width: 1px;
  height: 8px;
  background: var(--line-strong);
  margin-bottom: 2px;
}

.axis-label strong {
  color: var(--text);
  font-weight: 650;
}

.axis-label.now strong {
  color: var(--red);
}

.axis-label.edge-start {
  transform: translateX(0);
  justify-items: start;
}

.axis-label.edge-end {
  transform: translateX(-100%);
  justify-items: end;
}

.segment-detail {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr 1fr 1fr 1.4fr;
  gap: 10px;
  margin-top: 12px;
}

.segment-detail > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-deep);
}

.segment-detail > div > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.segment-detail strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.segment-table {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-deep);
  max-height: 620px;
  overflow-y: auto;
}

.segment-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.segment-table-head span {
  color: var(--muted);
  font-size: 12px;
}

.segment-grid {
  display: grid;
  grid-template-columns: 48px 110px minmax(220px, 1.2fr) minmax(170px, 0.8fr) 120px;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 12px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
}

.segment-grid.header {
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--panel-deep);
}

.sort-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.sort-button:hover,
.sort-button.active {
  color: var(--cyan);
}

.segment-row {
  border: 0;
  border-bottom: 1px solid rgba(36, 50, 68, 0.72);
  background: transparent;
  cursor: pointer;
}

.segment-row:hover,
.segment-row.current {
  background: rgba(69, 214, 255, 0.08);
}

.segment-row:last-child {
  border-bottom: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.window-list,
.alert-list {
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 11px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.row-sub {
  margin-top: 5px;
  font-size: 12px;
}

.progress {
  height: 8px;
  background: #253242;
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--cyan);
}

.alert {
  padding: 11px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 8px;
}

.alert strong {
  display: block;
  margin-bottom: 4px;
}

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

.toast-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 80;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fbfaf4;
  color: var(--ink);
  box-shadow: 0 18px 45px rgba(27, 27, 25, 0.18);
  animation: toast-in 180ms ease-out;
}

.toast.error {
  border-color: rgba(217, 63, 85, 0.35);
}

.toast.warning {
  border-color: rgba(224, 162, 26, 0.42);
}

.toast.leaving {
  animation: toast-out 180ms ease-in forwards;
}

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

.toast-head strong {
  font-size: 14px;
}

.toast-head button {
  border: 0;
  border-radius: 999px;
  background: #050505;
  color: #f8f5eb;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  width: 24px;
  height: 24px;
  line-height: 1;
}

.toast p {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}

.toast > span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

.empty,
.error-text {
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.error-text {
  color: var(--red);
}

@media (max-width: 1080px) {
  .summary-grid,
  .layout,
  .pool-hero,
  .grid-2 {
    grid-template-columns: 1fr;
  }

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

  .live-card {
    width: 100%;
  }

  .panel-head {
    flex-direction: column;
  }

  .legend {
    justify-content: flex-start;
  }

  .chart-controls {
    justify-items: start;
    min-width: 0;
    width: 100%;
  }

  .chart {
    height: 360px;
  }

  .segment-detail,
  .segment-grid {
    grid-template-columns: 1fr;
  }

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

/* Editorial hardware-inspired theme */
:root {
  --bg: #030303;
  --paper: #f2eee3;
  --paper-soft: #fbf8ef;
  --ink: #0b0b0a;
  --ink-soft: #3d3a34;
  --muted: #716b60;
  --line: #d8d1c3;
  --line-strong: #12110f;
  --green: #2fcf82;
  --blue: #2f7fd5;
  --amber: #d89a12;
  --red: #c43e4f;
  --cyan: #0a6f86;
  --panel: var(--paper-soft);
  --panel-deep: #eee8da;
  --text: var(--ink);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", Times, serif;
}

.shell {
  width: min(1540px, calc(100vw - 72px));
  margin: 56px auto;
  padding: 54px;
  background: var(--paper);
  border: 1px solid #ede8db;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.44);
}

.topbar {
  align-items: flex-start;
  margin-bottom: 28px;
}

.eyebrow {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
}

h1 {
  max-width: 760px;
  color: var(--ink);
  font-size: clamp(52px, 6vw, 96px);
  font-weight: 500;
  letter-spacing: 0;
}

h2 {
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
}

.live-card,
.metric,
.panel,
.pool-button {
  border: 1px solid var(--line);
  background: rgba(251, 248, 239, 0.86);
  box-shadow: none;
  color: var(--ink);
}

.live-card {
  background: #0b0b0a;
  border-color: #0b0b0a;
  color: var(--paper);
}

.live-card span:last-child {
  color: #c8c0b0;
}

.live-dot.ok,
.live-dot.polling {
  background: #46d782;
}

.summary-grid {
  grid-template-columns: 0.8fr 2.1fr 0.72fr 0.95fr 140px;
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  padding: 15px 16px;
}

.metric span,
.big-number span,
.panel-subtitle,
.small,
.row-sub,
.hero-title p,
.segment-detail > div > span,
.segment-table-head span {
  color: var(--muted);
}

.metric span,
.big-number span,
.panel-subtitle,
.row-sub,
.segment-detail > div > span,
.segment-table-head span,
.axis-label,
.legend,
.pool-button .id,
.sort-button {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.metric strong {
  color: var(--ink);
  font-size: 18px;
}

.refresh-button {
  border: 1px solid #0b0b0a;
  background: #0b0b0a;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 700;
}

.refresh-button:hover {
  border-color: #0b0b0a;
  background: #24221d;
}

.layout {
  grid-template-columns: 310px 1fr;
  gap: 18px;
}

.pool-button {
  color: var(--ink);
  background: rgba(251, 248, 239, 0.68);
}

.pool-button:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.pool-button.active {
  border-color: var(--ink);
  background: #fffdf6;
}

.pool-button .price {
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
}

.status-tag {
  border-color: var(--line);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.status-tag.ok {
  color: #137242;
  border-color: rgba(19, 114, 66, 0.34);
  background: rgba(47, 207, 130, 0.1);
}

.status-tag.unresolved {
  color: #8a5a00;
  border-color: rgba(138, 90, 0, 0.28);
  background: rgba(216, 154, 18, 0.12);
}

.pool-hero {
  grid-template-columns: 1.35fr repeat(3, minmax(150px, 1fr));
}

.hero-title h2 {
  font-size: 38px;
  font-weight: 700;
}

.big-number,
.segment-detail > div,
.row,
.alert {
  background: #f7f3e9;
  border-color: var(--line);
}

.big-number strong {
  color: var(--ink);
  font-size: 24px;
}

.panel-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

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

.chart-controls {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.value-filter input,
.value-preset select,
.filter-presets button {
  background: #f7f3e9;
  border-color: var(--line);
  color: var(--ink);
}

.filter-presets button:hover,
.value-preset select:focus,
.value-filter input:focus {
  border-color: var(--ink);
}

.zero-count {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28) inset;
}

.price-metric-value {
  white-space: normal;
  font-size: 24px !important;
}

.big-number .price-metric-value .price-number,
.big-number .price-metric-value .price-pair {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 700;
  margin: 0;
}

.big-number .price-metric-value .price-number {
  white-space: nowrap;
  font-size: 24px;
}

.big-number .price-metric-value .price-pair {
  display: block !important;
  margin-top: 6px;
  font-size: 20px;
  line-height: 1.05;
  overflow-wrap: normal;
  white-space: nowrap;
}

.price-metric-value .zero-count {
  min-width: 1.25em;
  height: 1.25em;
  font-size: 0.58em;
}

.big-number .price-metric-value .zero-count {
  min-width: 1.1em;
  height: 1.1em;
  margin: 0 1px;
  background: #050505;
  border-color: #050505;
  color: #f8f5eb;
  font-size: 0.5em;
  position: static;
  top: auto;
  vertical-align: -0.18em;
}

.big-number.metric-compact strong {
  font-size: clamp(21px, 1.45vw, 24px);
  line-height: 1.12;
}

.legend i {
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.chart-shell {
  border-color: var(--line);
  background: #f7f3e9;
  border-radius: 8px;
}

.chart {
  height: 400px;
  background:
    linear-gradient(rgba(11, 11, 10, 0.03) 1px, transparent 1px),
    #f7f3e9;
  background-size: 100% 88px;
}

.gridline,
.axis-line {
  border-top-color: rgba(11, 11, 10, 0.13);
}

.axis-line {
  border-color: rgba(11, 11, 10, 0.34);
}

.range-bar {
  opacity: 0.9;
  border: 1px solid rgba(11, 11, 10, 0.24);
  box-shadow:
    inset 1px 0 rgba(255, 255, 255, 0.28),
    inset -1px 0 rgba(0, 0, 0, 0.2);
}

.range-bar:hover,
.range-bar.selected {
  outline-color: #0b0b0a;
  filter: brightness(1.03);
}

.bar-label {
  color: var(--paper);
  background: rgba(11, 11, 10, 0.88);
  border-color: rgba(11, 11, 10, 0.88);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.current-line {
  background: var(--red);
}

.current-line span {
  background: #0b0b0a;
  border-color: #0b0b0a;
  color: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.chart-tooltip {
  border-color: #0b0b0a;
  background: #0b0b0a;
  color: var(--paper);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.chart-tooltip span {
  color: #c8c0b0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.axis-label {
  color: var(--muted);
}

.axis-label::before {
  background: rgba(11, 11, 10, 0.4);
}

.axis-label strong {
  color: var(--ink);
}

.axis-label.now strong {
  color: var(--red);
}

.segment-detail strong,
.segment-grid,
.row,
.alert p {
  color: var(--ink);
}

.segment-detail strong .zero-count {
  margin-bottom: 0;
  vertical-align: -0.18em;
}

.segment-table {
  border-color: var(--line);
  background: #f7f3e9;
}

.segment-table-head,
.segment-grid.header {
  border-bottom-color: var(--line);
  background: #f7f3e9;
}

.segment-grid.header {
  color: var(--muted);
}

.sort-button:hover,
.sort-button.active {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.segment-row {
  border-bottom-color: var(--line);
  background: transparent;
}

.segment-row:hover,
.segment-row.current {
  background: #eee8da;
}

.progress {
  background: #ddd5c7;
}

.progress span {
  background: #0b0b0a;
}

.alert {
  border-left-color: var(--red);
}

.empty,
.error-text {
  color: var(--muted);
}

@media (max-width: 1080px) {
  .shell {
    width: min(680px, calc(100vw - 24px));
    margin: 12px auto;
    padding: 26px;
  }

  h1 {
    font-size: clamp(40px, 12vw, 58px);
  }

  .summary-grid,
  .layout,
  .pool-hero,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .chart {
    height: 360px;
  }
}

.pool-hero {
  grid-template-columns: minmax(230px, 1fr) minmax(180px, 0.78fr) minmax(140px, 0.62fr) minmax(140px, 0.62fr);
}

.hero-title h2 {
  font-size: clamp(32px, 3.2vw, 48px);
}

.price-metric-value {
  font-size: 22px !important;
}

.big-number .price-metric-value .price-number {
  font-size: 22px;
}

@media (max-width: 1080px) {
  .pool-hero {
    grid-template-columns: 1fr;
  }
}

.hidden {
  display: none !important;
}

.pool-sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
}

.pool-toolbar,
.pool-form {
  border: 1px solid var(--line);
  background: rgba(246, 244, 237, 0.72);
  border-radius: 28px;
  padding: 16px;
}

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

.pool-toolbar h2 {
  font-size: 20px;
}

.pool-toolbar p,
.pool-form span,
.form-error {
  color: var(--muted);
  font-size: 12px;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}

.hint-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(27, 27, 25, 0.18);
  border-radius: 999px;
  background: #fbfaf4;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.hint-icon::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: min(230px, 72vw);
  padding: 9px 11px;
  border-radius: 12px;
  background: #050505;
  color: #f8f5eb;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: normal;
}

.hint-icon:hover::after,
.hint-icon:focus::after,
.hint-icon:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pool-toolbar button,
.form-actions button,
.mini-action {
  border: 0;
  border-radius: 999px;
  background: #050505;
  color: #f8f5eb;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.pool-toolbar button,
.form-actions button {
  padding: 10px 14px;
}

.pool-toolbar button {
  min-height: 36px;
  padding: 7px 13px;
  font-size: 14px;
}

.pool-form {
  display: grid;
  gap: 12px;
}

.pool-form label {
  display: grid;
  gap: 6px;
}

.pool-form input,
.pool-form textarea,
.pool-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfaf4;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}

.pool-form textarea,
.pool-form input[spellcheck="false"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-actions {
  display: flex;
  gap: 8px;
}

.form-actions button[type="button"] {
  background: #e5e0d2;
  color: var(--ink);
}

.form-error {
  min-height: 16px;
  color: var(--red);
}

.pool-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  font-size: 11px;
}

.mini-action.danger {
  background: #f3d8d8;
  color: var(--red);
}

/* Rounded product-dashboard theme */
:root {
  --bg: #050505;
  --paper: #e9e5d9;
  --paper-soft: #f4f2ea;
  --ink: #1b1b19;
  --ink-soft: #494844;
  --muted: #76746c;
  --line: rgba(27, 27, 25, 0.08);
  --line-strong: rgba(27, 27, 25, 0.38);
  --green: #35cf7f;
  --blue: #2d7bd8;
  --amber: #e0a21a;
  --red: #d93f55;
  --cyan: #007f98;
  --lime: #e8ff3f;
  --orange: #ff9d69;
  --panel: #f6f4ed;
  --panel-deep: #eeece3;
  --text: var(--ink);
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  display: none;
}

.shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 48px 64px 48px 112px;
  background: var(--paper);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transition: padding-left 160ms ease;
}

body:has(.section-rail:not(.collapsed)) .shell {
  padding-left: 232px;
}

.topbar {
  align-items: flex-start;
  margin-bottom: 34px;
}

.eyebrow {
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
}

h1 {
  max-width: 720px;
  color: var(--ink);
  font-size: clamp(42px, 4vw, 72px);
  font-weight: 500;
  line-height: 0.98;
}

h2 {
  color: var(--ink);
  font-size: 24px;
  font-weight: 650;
}

.live-card {
  min-width: 210px;
  padding: 15px 18px;
  border: 0;
  border-radius: 28px;
  background: #f6f4ed;
  color: var(--ink);
}

.live-card span:last-child {
  color: var(--muted);
}

.live-dot.ok,
.live-dot.polling {
  background: var(--green);
}

.summary-grid {
  grid-template-columns: 0.78fr 2.05fr 0.75fr 0.95fr 140px;
  gap: 16px;
  margin-bottom: 22px;
}

.metric,
.panel,
.pool-button,
.big-number,
.segment-detail > div,
.row,
.alert {
  border: 1px solid var(--line);
  background: rgba(246, 244, 237, 0.82);
  border-radius: 28px;
  box-shadow: none;
  color: var(--ink);
}

.metric {
  padding: 18px 20px;
}

.metric span,
.big-number span,
.panel-subtitle,
.small,
.row-sub,
.hero-title p,
.segment-detail > div > span,
.segment-table-head span,
.axis-label,
.legend,
.pool-button .id,
.sort-button {
  color: var(--muted);
  font-family: inherit;
}

.metric strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 650;
}

.refresh-button {
  border: 0;
  border-radius: 22px;
  background: #050505;
  color: #f8f5eb;
  font-family: inherit;
  font-weight: 700;
}

.refresh-button:hover {
  background: #25241f;
}

.layout {
  grid-template-columns: 310px 1fr;
  gap: 22px;
}

.pool-list {
  gap: 14px;
}

.pool-button {
  padding: 18px;
  background: rgba(246, 244, 237, 0.55);
}

.pool-button.active {
  border-color: #0f0f0d;
  background: #fbfaf4;
}

.pool-button .price {
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
}

.status-tag {
  border: 0;
  background: #eef4e9;
  color: #137242;
  font-family: inherit;
}

.status-tag.unresolved {
  background: #f4ead2;
  color: #8a5a00;
}

.workspace {
  gap: 18px;
}

.panel {
  padding: 24px;
}

.pool-hero {
  grid-template-columns: minmax(260px, 1.7fr) repeat(3, minmax(122px, 0.85fr));
  gap: 16px;
  background: #f6f4ed;
}

.hero-title h2 {
  font-size: clamp(34px, 3.4vw, 52px);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 0.95;
  overflow-wrap: normal;
}

.big-number {
  padding: 20px;
  background: #fbfaf4;
}

.big-number strong {
  color: var(--ink);
  font-size: clamp(24px, 2vw, 30px);
  font-weight: 700;
  overflow-wrap: normal;
  word-break: normal;
}

.panel-head {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 16px;
}

.chart-controls {
  min-width: 340px;
  font-family: inherit;
}

.value-filter input,
.value-preset select,
.filter-presets button {
  background: #fbfaf4;
  border-color: var(--line);
  color: var(--ink);
  border-radius: 999px;
}

.filter-presets button:hover,
.value-preset select:focus,
.value-filter input:focus {
  border-color: var(--line-strong);
}

.legend {
  color: var(--muted);
  font-size: 14px;
}

.chart-shell {
  border: 1px solid var(--line);
  background: #f6f4ed;
  border-radius: 28px;
  padding: 16px 18px;
}

.chart {
  height: 440px;
  background:
    linear-gradient(rgba(27, 27, 25, 0.06) 1px, transparent 1px),
    #f6f4ed;
  background-size: 100% 92px;
}

.value-axis {
  border-left-color: rgba(27, 27, 25, 0.24);
}

.value-axis-title,
.value-axis-label {
  color: var(--muted);
}

.gridline,
.axis-line {
  border-top-color: rgba(27, 27, 25, 0.1);
}

.range-bar {
  border-radius: 12px 12px 0 0;
  border: 1px solid rgba(27, 27, 25, 0.22);
  opacity: 0.92;
  box-shadow: none;
}

.range-bar:hover,
.range-bar.selected {
  outline-color: #050505;
  filter: brightness(1.04);
}

.bar-label,
.current-line span,
.chart-tooltip {
  background: #050505;
  border-color: #050505;
  color: #f8f5eb;
  border-radius: 12px;
  font-family: inherit;
}

.current-line {
  background: var(--red);
}

.chart-tooltip span {
  color: #c8c0b0;
  font-family: inherit;
}

.axis-label strong {
  color: var(--ink);
}

.axis-label.now strong {
  color: var(--red);
}

.segment-detail {
  gap: 14px;
}

.segment-table {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #f6f4ed;
}

.segment-table-head,
.segment-grid.header {
  background: #f6f4ed;
  border-bottom-color: var(--line);
}

.segment-row {
  border-bottom-color: var(--line);
}

.segment-row:hover,
.segment-row.current {
  background: #fbfaf4;
}

.sort-button:hover,
.sort-button.active {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.grid-2 {
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.grid-2 .panel:first-child,
.grid-2 .panel:last-child {
  background: #f6f4ed;
  border-color: var(--line);
}

.grid-2 .panel .row,
.grid-2 .panel .alert,
.grid-2 .panel .empty {
  background: #fbfaf4;
  border-color: rgba(27, 27, 25, 0.08);
}

.grid-2 .panel:last-child h2,
.grid-2 .panel:last-child .alert strong,
.alert-emphasis {
  color: var(--red);
}

.progress {
  background: rgba(27, 27, 25, 0.14);
}

.progress span {
  background: #050505;
}

.zero-count {
  background: #050505;
  color: #f8f5eb;
  border-color: #050505;
  box-shadow: none;
}

.big-number .price-metric-value .price-number,
.big-number .price-metric-value .price-pair {
  color: var(--ink);
  font-family: inherit;
}

html {
  scroll-behavior: smooth;
}

.section-anchor,
#overview,
#poolManager,
#rangePanel,
#depthAlerts {
  scroll-margin-top: 24px;
}

.section-rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 70;
  display: grid;
  align-content: start;
  gap: 8px;
  width: 206px;
  padding: 28px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #f6f4ed;
  box-shadow: 18px 0 55px rgba(27, 27, 25, 0.08);
  backdrop-filter: blur(10px);
  transition: width 160ms ease, padding 160ms ease;
}

.section-rail.collapsed {
  width: 82px;
  padding: 28px 12px;
}

.rail-toggle,
.section-rail a {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.rail-toggle {
  background: #050505;
  color: #f8f5eb;
}

.rail-toggle::after {
  content: "数据导航";
  overflow: hidden;
  white-space: nowrap;
}

.section-rail a:hover {
  background: #f6f4ed;
}

.section-rail a span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #fbfaf4;
  color: var(--muted);
  font-size: 12px;
}

.section-rail.collapsed .rail-toggle,
.section-rail.collapsed a {
  grid-template-columns: 40px;
  justify-content: center;
}

.section-rail.collapsed .rail-toggle::after,
.section-rail.collapsed a strong {
  display: none;
}

.topbar-side {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 12px;
  min-width: min(820px, 50vw);
}

.topbar-side .live-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.site-meta {
  display: grid;
  grid-template-columns: minmax(104px, 0.48fr) minmax(104px, 0.48fr) minmax(240px, 1fr);
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.site-meta > div {
  min-width: 0;
  min-height: 76px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #f6f4ed;
}

.site-meta span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.site-meta strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-meta a {
  color: inherit;
  text-decoration: none;
}

.site-meta a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.author-meta p {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 7px;
  overflow: hidden;
}

.author-meta p a {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .shell {
    width: min(720px, calc(100vw - 24px));
    margin: 12px 12px 12px auto;
    padding: 24px 24px 24px 104px;
  }

  h1 {
    font-size: clamp(42px, 12vw, 60px);
  }

  .summary-grid,
  .layout,
  .pool-hero,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .topbar-side {
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
  }

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

  .section-rail {
    width: 82px;
    padding: 16px 12px;
  }

  .chart-controls {
    justify-items: start;
    min-width: 0;
    width: 100%;
  }

  .chart {
    height: 360px;
  }
}
