:root {
  color-scheme: dark;
  --bg: #111;
  --panel: #181818;
  --panel-2: #202020;
  --text: #eee;
  --muted: #a6adba;
  --line: #444;
  --accent: #1eb854;
  --accent-2: #38bdf8;
  --warn: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

.shell {
  width: min(1840px, 100%);
  margin: 0 auto;
  padding: 30px 20px 48px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100vw;
  min-height: 64px;
  margin: -30px calc(50% - 50vw) 30px;
  padding: 0 max(20px, calc((100vw - 1840px) / 2 + 20px));
  border-bottom: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.94);
  backdrop-filter: blur(8px);
}

.masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar .brand img {
  width: 28px;
  height: 28px;
}

.topbar .brand span {
  font-size: 18px;
  font-weight: 700;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.navlinks a {
  color: var(--muted);
}

.navlinks a:hover {
  color: var(--text);
}

.logo {
  display: block;
  height: 4em;
  margin: 0 auto 20px;
}

.masthead h1 {
  margin: 0 0 12px;
  font-size: 1.55em;
  text-align: center;
}

.section {
  padding: 0 0 30px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 17px;
}

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

.stat-grid,
.chart-grid {
  display: grid;
  gap: 12px;
}

.stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  width: 100%;
  margin-inline: auto;
  margin-bottom: 12px;
}

.stat-grid:last-child {
  margin-bottom: 0;
}

.pool-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.node-system-grid,
.node-mining-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.node-shares-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat,
.empty {
  border: 1px solid var(--line);
  background: var(--panel);
}

.stat {
  min-height: 82px;
  padding: 14px;
}

.stat span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 21px;
  font-weight: 700;
}

.chart-grid {
  width: 100%;
  margin: 0 auto;
  grid-template-columns: 1fr;
  gap: 28px;
}

.column {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  padding: 20px 30px;
}

.column-full {
  width: 100%;
  margin: 0 auto;
}

.chart-panel {
  border: 1px solid var(--line);
  background: #101010;
  padding: 24px 28px 16px;
}

.column h2,
.chart-panel h2 {
  margin: 0 0 16px;
  font-size: 1.22em;
  text-align: left;
  color: var(--text);
}

.chart {
  width: 100%;
  height: 330px;
  background: transparent;
}

.empty {
  padding: 18px;
  color: var(--muted);
}

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

.node-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.9em;
}

.node-table th,
.node-table td {
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
}

.node-table th {
  color: #888;
  font-weight: normal;
  border-bottom: 1px solid var(--line);
}

.node-table thead th {
  background: transparent;
  text-transform: none;
  font-size: inherit;
}

.node-table th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.node-table th[data-sort]:hover {
  color: var(--text);
}

.node-table th[data-sort]::after {
  content: "";
  display: inline-block;
  width: 1em;
  margin-left: 4px;
  color: #ccc;
}

.node-table th[data-sort].sort-asc::after {
  content: "\25B2";
}

.node-table th[data-sort].sort-desc::after {
  content: "\25BC";
}

.node-table td {
  border-bottom: 1px solid #333;
  vertical-align: middle;
}

.node-table td.node-down {
  color: var(--muted);
}

.node-table tbody th {
  color: var(--text);
  background: transparent;
  border-bottom: 1px solid #333;
  vertical-align: middle;
}

.node-table tbody tr:hover th,
.node-table tbody tr:hover td {
  background: #1a1a1a;
}

.node-table tbody tr:last-child th,
.node-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 720px) {
  .shell {
    padding: 20px 10px 36px;
  }

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

  .topbar {
    gap: 12px;
    margin: -20px calc(50% - 50vw) 24px;
    padding: 12px 10px;
  }

  .nav-actions {
    gap: 8px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
  }

  .chart {
    height: 290px;
  }

  .column {
    padding: 15px 20px;
  }

  .node-table {
    font-size: 0.75em;
  }

  .chart-panel {
    padding: 18px 14px 12px;
  }

  .pool-summary-grid,
  .shares-grid,
  .node-system-grid,
  .node-mining-grid,
  .node-shares-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}
