:root {
  color-scheme: light;
  --bg: #f0f3f7;
  --panel: #fff;
  --line: #d5dce5;
  --text: #192c43;
  --muted: #455b70;
  --accent: #214f7a;
  --shared: #157d84;
  --solo: #a05920;
  --difficulty: #6553a0;
  --mono: Consolas, "Courier New", monospace;
  font: 16px/1.55 Inter, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box }
body { margin: 0; background: var(--bg); color: var(--text) }
main {
  width: min(68rem, calc(100% - 2rem));
  margin-inline: auto;
  padding-block: clamp(1.25rem, 4vw, 2.6rem) 2rem;
}
header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .7rem 1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--line);
}
.pool-brand { display: flex; align-items: center; gap: .7rem }
.pool-brand img { display: block; border-radius: 4px }
h1, h2, h3, h4, p, dl, dd { margin: 0 }
h1 { font-size: 1.55rem; font-weight: 650; line-height: 1.2 }
h2 { font-size: 1.08rem; font-weight: 650 }
header p { margin-top: .2rem; font: .875rem/1.55 var(--mono) }
header p, .scope, .params p, dt { color: var(--muted) }
header .language-picker { margin-inline-start: auto }

.pool-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .55rem 1rem;
  margin: .65rem 0 1rem;
}
.pool-tabs { display: flex; flex-wrap: wrap; gap: .35rem }
.pool-tabs a {
  padding: .43rem .85rem; border: 1px solid transparent; border-radius: 3px;
  color: var(--accent); font-weight: 600; text-decoration: none;
}
.pool-tabs a:hover { border-color: var(--line); background: var(--panel) }
.pool-tabs a[aria-selected="true"] { border-color: var(--accent); background: var(--accent); color: #fff }
.scope { font-size: .9rem }
.params a { color: var(--accent); text-underline-offset: .18rem }
.pool-telemetry { margin: 1rem 0 1.4rem }
.network-metrics, .pool-charts { display: grid; gap: .8rem }
.network-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: .8rem }
.network-metrics div, .pool-chart {
  min-width: 0; padding: .85rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 3px;
}
.network-metrics dt { font-size: .88rem }
.network-metrics dd { margin-top: .18rem; font: 600 1.15rem/1.4 var(--mono); overflow-wrap: anywhere }
.pool-charts { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.chart-legend { display: flex; flex-wrap: wrap; margin-top: .3rem; gap: .3rem 1.1rem; font-size: .83rem; color: var(--muted) }
.series-key::before { content: ''; display: inline-block; width: .65rem; height: .22rem; margin-inline-end: .35rem; vertical-align: .22em; background: var(--series) }
.shared-key { --series: var(--shared) }
.solo-key { --series: var(--solo) }
.difficulty-key { --series: var(--difficulty) }
.chart-area { min-height: 11rem; display: grid; align-items: center; margin-top: .45rem }
.chart-area canvas { display: block; width: 100%; height: 11rem }
.chart-area canvas[hidden], .chart-empty[hidden] { display: none }
.chart-area canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.chart-empty { text-align: center; color: var(--muted); font-size: .87rem }
.chart-readout { min-height: 1.3em; color: var(--muted); font: .83rem/1.5 var(--mono); overflow-wrap: anywhere }
.chart-note { margin-top: .55rem }
@media (max-width: 680px) { .pool-charts { grid-template-columns: minmax(0, 1fr) } }
@media (max-width: 460px) {
  .network-metrics { grid-template-columns: minmax(0, 1fr); gap: .35rem }
  .network-metrics div { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem }
  .network-metrics dd { text-align: end }
}
.connections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem }
.connections section, .miner-lookup {
  min-width: 0;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.connections code {
  display: block;
  margin: .45rem 0;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.connections p { font-size: .94rem; color: var(--muted) }
code { font: .93rem/1.55 var(--mono) }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: .85rem;
  border: 1px solid var(--line);
  background: #f2f5fa;
}
.metrics[hidden] { display: none }
.metrics > div { padding: .45rem .55rem }
.metrics > div + div { border-inline-start: 1px solid var(--line) }
.metrics span { display: block; font-size: .875rem; color: var(--muted) }
.metrics strong { display: block; font: 600 1rem/1.45 var(--mono); overflow-wrap: anywhere }

.history :is(h3, h4) { margin: .85rem 0 .3rem; font-size: .95rem; font-weight: 600 }
.table-scroll { overflow-x: auto; border: 1px solid var(--line) }
table { width: 100%; border-collapse: collapse; text-align: start; font-size: .9rem }
th, td { padding: .36rem .55rem; text-align: start; white-space: nowrap }
th { background: #f2f5fa; color: var(--muted); font-weight: 580 }
td { border-top: 1px solid var(--line); font-variant-numeric: tabular-nums }
td a { color: var(--accent); font-family: var(--mono); text-underline-offset: .16rem }
:is(td a, .miner-entry input, .miner-entry button, .params :is(a, input, select, button), .history-pager button, .pool-tabs a, [role="tabpanel"]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.history-pager {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: .4rem; margin-top: .45rem; color: var(--muted); font-size: .83rem;
}
.history-pager button, .command-header button {
  padding: .27rem .6rem; border: 1px solid var(--line); border-radius: 3px;
  background: var(--panel); color: var(--accent); font: inherit; cursor: pointer;
}
.history-pager button:disabled { opacity: .5; cursor: default }
.history-pager button:not(:disabled):hover, .command-header button:hover { border-color: var(--accent) }
.history-pager[hidden] { display: none }
.estimates { margin-top: .55rem }

.miner-lookup { margin-top: 1.25rem; scroll-margin-top: 1rem }
.miner-lookup form { margin-top: .55rem }
:is(.params, .miner-lookup) label { display: block; margin-bottom: .3rem; color: var(--muted); font-size: .9rem }
.miner-entry { display: flex; align-items: center; gap: .55rem }
.miner-entry a { flex: none; font-size: .9rem }
.miner-entry :is(input, button), .miner-options :is(input, select) {
  min-height: 2.5rem;
  padding: .43rem .6rem;
  border: 1px solid #9aabba;
  border-radius: 3px;
  font: inherit;
}
.miner-entry input { min-width: 0; flex: 1; background: var(--bg); color: var(--text); font-family: var(--mono) }
.miner-entry button { background: #244e72; color: #fff; cursor: pointer }
.miner-entry button:hover { background: #163b5b }
.miner-lookup .scope { margin-top: .55rem }
.miner-lookup .connections { margin-top: .75rem }
.miner-lookup .connections[hidden] { display: none }
.miner-lookup .connections section { background: var(--bg) }
.miner-lookup h3 { font-size: 1rem }

.params {
  padding: 1rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 3px;
}
.miner-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin-block: .85rem }
.miner-options :is(input, select) { display: block; width: 100%; margin-top: .3rem; background: var(--bg); color: var(--text) }
.mining-command { min-width: 0; padding: .65rem; background: #f2f5fa; border: 1px solid var(--line); border-radius: 3px }
.command-header { display: flex; align-items: center; justify-content: space-between; gap: .4rem }
.command-header h3 { font-size: .95rem }
.command-header button { flex: none; font-size: .8rem }
.mining-command pre { margin: .5rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text) }
.mining-command code { font-size: .86rem }
.params p, dt { font-size: .9rem }
.params p { margin-top: .55rem }
#pool-host-note { margin-bottom: .55rem }

@media (max-width: 43rem) {
  .connections { grid-template-columns: minmax(0, 1fr) }
}
@media (max-width: 30rem) {
  .miner-entry { align-items: stretch; flex-direction: column }
  .miner-entry button { align-self: flex-start }
  .miner-options { grid-template-columns: minmax(0, 1fr) }
}

.pool-regions {
  display: flex;
  gap: .5rem;
  margin-block: .75rem;
}
.pool-regions[hidden] { display: none; }
.pool-regions a {
  padding: .35rem .65rem;
  border: 1px solid currentColor;
  border-radius: .25rem;
  text-decoration: none;
}
.pool-regions a[aria-current="page"] { font-weight: 700; }
