:root {
  color-scheme: dark;
  --bg: #071012;
  --panel: #0d191b;
  --line: #203236;
  --ink: #eff7f5;
  --muted: #91a9a5;
  --accent: #51e0bd;
  --bad: #ef7d7d;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(circle at 78% -10%, #12302d 0, transparent 34%), var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

main {
  width: min(1180px, calc(100% - 64px));
  margin: auto;
  min-height: 100vh;
  padding: 28px 0 48px;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.brand {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: .16em;
}

nav div { display: flex; gap: 28px; }
nav a.active { color: var(--ink); }
a { color: var(--accent); text-decoration: none; }

header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 72px 0 42px;
}

.eyebrow {
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
  margin: 0 0 14px;
}

h1 {
  font-size: 3.8rem;
  line-height: 1;
  letter-spacing: -.055em;
  margin: 0;
}

h2 {
  font-size: 1.5rem;
  letter-spacing: -.02em;
  margin: 0 0 14px;
}

.status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--muted);
  font-size: .82rem;
  white-space: nowrap;
}

.status.good { border-color: #286e60; color: var(--accent); }
.status.bad { border-color: #713a3a; color: var(--bad); }

.metrics,
.miner-metrics {
  display: grid;
  border: 1px solid var(--line);
}

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

.miner-metrics {
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
}

article {
  padding: 24px;
  border-right: 1px solid var(--line);
}

.metrics article:last-child { border: 0; }

.miner-metrics article {
  border: 0;
  background: var(--bg);
}

.miner-metrics .metric-primary {
  grid-column: span 2;
  background: #0a1718;
}

.miner-metrics .metric-balance {
  grid-column: span 2;
  background: #0a1718;
}

.miner-metrics .metric-balance strong {
  font-size: 1.65rem;
  font-variant-numeric: tabular-nums;
}

.miner-metrics .metric-available strong { color: var(--accent); }

article span {
  display: block;
  color: var(--muted);
  font-size: .8rem;
  margin-bottom: 10px;
}

article strong { font-size: 1.3rem; }

.panel {
  margin-top: 24px;
  border: 1px solid var(--line);
  background: rgba(13, 25, 27, .8);
  padding: 28px;
}

.split {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 42px;
  align-items: center;
}

.muted { color: var(--muted); line-height: 1.6; }
.form-note { color: var(--muted); font-size: .78rem; margin: 12px 0 0; }

.button,
button {
  display: inline-block;
  border: 0;
  background: var(--accent);
  color: #04110e;
  font-weight: 800;
  padding: 12px 18px;
  margin-top: 10px;
  cursor: pointer;
}

pre {
  margin: 0;
  border: 1px solid var(--line);
  background: #071012;
  padding: 22px;
  overflow: auto;
  color: #c9d8d5;
  line-height: 1.7;
}

form { display: flex; gap: 10px; max-width: 760px; }

input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: #071012;
  color: var(--ink);
  padding: 13px 15px;
  font: inherit;
}

input:focus { border-color: var(--accent); outline: 1px solid var(--accent); }
form button { margin: 0; }

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

.miner-page { width: min(1420px, calc(100% - 64px)); }
.miner-header { padding: 60px 0 32px; }
.miner-header h1 { font-size: 2.9rem; }

.wallet-address {
  max-width: 900px;
  margin: 16px 0 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .84rem;
  overflow-wrap: anywhere;
}

.address-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 0 0 24px;
  padding: 18px;
}

.address-panel form { flex: 1; max-width: 900px; }
.address-panel .form-note { margin: 0; white-space: nowrap; }

.notice {
  margin-top: 24px;
  border: 1px solid var(--line);
  padding: 16px 18px;
  color: var(--muted);
}

.error-notice { border-color: #713a3a; color: var(--bad); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 24px;
}

.data-panel { min-width: 0; }

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

.panel-heading h2 { margin: 0; }

.section-meta {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
  text-align: right;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

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

th {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

tbody tr:last-child td { border-bottom: 0; }
.numeric { font-variant-numeric: tabular-nums; }
.worker-name { color: var(--ink); font-weight: 700; }

.block-hash {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.block-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  text-transform: capitalize;
}

.block-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  content: '';
}

.block-status.mature { color: var(--accent); }
.block-status.mature::before { background: var(--accent); }
.block-status.immature::before { background: #e9c46a; }
.block-status.pending::before { background: #e9c46a; }
.block-status.orphaned { color: var(--bad); }
.block-status.orphaned::before { background: var(--bad); }
.block-status.stale { color: var(--bad); }
.block-status.stale::before { background: var(--bad); }

.empty-state {
  margin: 0;
  padding: 32px 12px 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state[hidden],
.notice[hidden] { display: none; }

footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 24px;
  font-size: .82rem;
}

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

@media (max-width: 900px) {
  .metrics,
  .miner-metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics article { border-bottom: 1px solid var(--line); }
  .miner-metrics .metric-primary { grid-column: span 2; }
  .split { grid-template-columns: 1fr; }
  .address-panel { align-items: stretch; flex-direction: column; }
  .address-panel .form-note { white-space: normal; }
}
