:root {
  color-scheme: dark;
  --bg: #090d11;
  --surface: #10161d;
  --surface-2: #151d25;
  --surface-3: #1b2630;
  --text: #eef3f5;
  --muted: #8c9aa5;
  --line: #25313b;
  --green: #42d493;
  --blue: #58b7ee;
  --yellow: #f3c969;
  --red: #ff6f6f;
  --ink: #071014;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(88, 183, 238, 0.06), transparent 300px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 48px 48px, 48px 48px, auto;
}

button,
input,
code {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 36px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 14, 18, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  border: 1px solid rgba(78, 224, 160, 0.4);
  border-radius: 8px;
  color: var(--ink);
  background: var(--green);
  font-weight: 900;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

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

.eyebrow,
.label {
  margin: 0;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.05;
}

h2 {
  margin: 8px 0 12px;
  max-width: 760px;
  font-size: 44px;
  line-height: 1.03;
  letter-spacing: 0;
}

h2 span {
  color: var(--green);
}

h3 {
  margin-bottom: 0;
  font-size: 17px;
}

main {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 22px clamp(16px, 4vw, 36px) 42px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(243, 201, 105, 0.16);
}

.status-pill.ok .dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(78, 224, 160, 0.14);
}

.status-pill.bad .dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 111, 111, 0.16);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 480px);
  gap: 18px;
  align-items: stretch;
  min-height: 320px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.subcopy {
  max-width: 700px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.command-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  max-width: 820px;
  margin-top: 14px;
}

.command-row code {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #d4f2fb;
  background: rgba(0, 0, 0, 0.34);
  overflow-x: auto;
  white-space: nowrap;
}

.icon-button,
.ghost-button,
.search-form button {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
}

.icon-button {
  width: 44px;
  min-width: 44px;
}

.ghost-button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
}

.search-form button {
  padding: 0 16px;
  color: var(--ink);
  border-color: rgba(78, 224, 160, 0.6);
  background: var(--green);
  font-weight: 800;
}

.icon-button:hover,
.ghost-button:hover {
  border-color: var(--blue);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.network-panel,
.panel,
.status-grid article,
.search-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 22, 29, 0.94);
}

.network-panel {
  position: relative;
  min-height: 300px;
  overflow: hidden;
}

#poolCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 300px;
}

.canvas-overlay {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.canvas-overlay div {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(10, 14, 18, 0.76);
}

.canvas-overlay span {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 19px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-overlay small,
.status-grid small,
.facts dt,
td,
.list-state,
.round-list,
.mini-metrics span {
  color: var(--muted);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.status-grid article {
  min-height: 150px;
  padding: 14px;
}

.status-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

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

.status-grid article h3 {
  margin-bottom: 12px;
}

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

.status-values div {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.022);
}

.status-values span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.status-values strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
  padding: 14px;
}

.search-form {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.search-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.25);
  outline: none;
}

.search-form input:focus {
  border-color: var(--blue);
}

.miner-result {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.35fr);
  gap: 10px;
  margin-bottom: 10px;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mini-metrics div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.mini-metrics span,
.mini-metrics strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-metrics strong {
  margin-top: 4px;
  font-size: 18px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  gap: 10px;
}

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

.panel.wide {
  min-height: 230px;
}

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

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

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

th {
  color: #c8d2da;
  font-weight: 750;
}

td code,
.mono {
  color: #d8f1fb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge.good {
  color: #09271d;
  background: var(--green);
}

.badge.bad {
  color: #3b0b0b;
  background: var(--red);
}

.badge.neutral {
  color: #071014;
  background: var(--yellow);
}

.facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.facts div {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1fr);
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.facts dt,
.facts dd {
  margin: 0;
}

.facts dd {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 750;
}

.round-list {
  display: grid;
  gap: 10px;
}

.round-card {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.024);
}

.round-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.round-card strong,
.round-card small {
  overflow-wrap: anywhere;
}

.round-card small {
  color: var(--muted);
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

@media (max-width: 1080px) {
  .hero,
  .content-grid,
  .miner-result,
  .search-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 700px) {
  .topbar,
  .top-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .status-pill {
    width: 100%;
  }

  .status-pill {
    justify-content: center;
  }

  .command-row,
  .search-form {
    flex-direction: column;
  }

  .command-row code {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .icon-button,
  .search-form button {
    width: 100%;
  }

  .status-grid,
  .status-values,
  .canvas-overlay,
  .mini-metrics {
    grid-template-columns: 1fr;
  }

  .network-panel,
  #poolCanvas {
    min-height: 390px;
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 32px;
  }

  .facts div {
    grid-template-columns: 1fr;
  }
}
