:root {
  --bg: #070a11;
  --surface: #0d1320;
  --surface-2: #111a2b;
  --panel: rgba(17, 26, 43, 0.9);
  --panel-2: rgba(10, 15, 29, 0.92);
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(255, 122, 26, 0.34);
  --text: #f8fafc;
  --soft: #cbd5e1;
  --muted: #94a3b8;
  --accent: #ff7a1a;
  --accent-2: #40d6c4;
  --danger: #fb7185;
  --success: #34d399;
  --warning: #fbbf24;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 122, 26, 0.08), transparent 26rem),
    linear-gradient(135deg, #070a11 0%, #0d1320 46%, #080d16 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.5;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: rgba(7, 10, 17, 0.94);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 76px;
  padding: 8px;
  text-decoration: none;
}

.brand-logo-img {
  display: block;
  width: min(220px, 100%);
  height: auto;
}

.status-pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.86rem;
  white-space: nowrap;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(255, 122, 26, 0.15);
}

.status-pill.online .pulse {
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.14);
}

.status-pill.offline .pulse {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(251, 113, 133, 0.14);
}

.side-nav {
  display: grid;
  gap: 16px;
  overflow: auto;
  padding-right: 4px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-tab,
.nav-subtab {
  text-decoration: none;
  border-radius: 8px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav-tab {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab:hover {
  border-color: var(--line-strong);
  background: rgba(255, 122, 26, 0.12);
}

.nav-subtab {
  display: block;
  margin-left: 12px;
  padding: 7px 10px;
  border-left: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--muted);
  font-size: 0.84rem;
}

.nav-subtab:hover {
  color: var(--text);
  background: rgba(64, 214, 196, 0.08);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  gap: 6px;
}

.sidebar-footer span {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 800;
}

.sidebar-footer strong {
  color: var(--soft);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.content {
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.content-header {
  min-height: 240px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 22px;
  margin-bottom: 18px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 122, 26, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(64, 214, 196, 0.1), transparent 48%),
    var(--panel-2);
  box-shadow: var(--shadow);
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 900;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(2.3rem, 4vw, 4.8rem);
  line-height: 0.98;
}

h2 {
  font-size: clamp(1.35rem, 1.7vw, 1.9rem);
  line-height: 1.05;
}

.hero-text,
.wallet-copy p,
.connect-card p,
.legal-callout p,
.workers-subtitle,
.muted,
.help-text {
  color: var(--soft);
  line-height: 1.65;
}

.hero-text {
  max-width: 720px;
  margin: 18px 0 0;
  font-size: 1.02rem;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.last-refresh {
  color: var(--muted);
  font-size: 0.9rem;
}

.button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}

.button-primary {
  color: #130905;
  background: linear-gradient(135deg, #ffb15f, #ff7a1a);
}

.button-ghost {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.card,
.wallet-card,
.connect-card,
.legal-callout {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 118px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}

.metric-card.primary {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.18), rgba(17, 26, 43, 0.95));
}

.metric-card span,
dt,
.miner-stat span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 900;
}

.metric-card strong {
  font-size: clamp(1.45rem, 2vw, 2.15rem);
  overflow-wrap: anywhere;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.span-7 {
  grid-column: span 7;
}

.span-5 {
  grid-column: span 5;
}

.span-12 {
  grid-column: span 12;
}

.card,
.wallet-card,
.connect-card,
.legal-callout {
  padding: 22px;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.card-title-row.compact {
  margin-bottom: 16px;
}

.round-visual {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.ring {
  --progress: 0;
  width: 168px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--surface) 58%, transparent 59%),
    conic-gradient(var(--accent) calc(var(--progress) * 1%), rgba(255,255,255,0.09) 0);
}

.ring span {
  font-size: 1.6rem;
  font-weight: 900;
}

dl {
  margin: 0;
}

.round-details dl,
.term-list {
  display: grid;
  gap: 10px;
}

.round-details dl div,
.term-list div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

dd {
  margin: 0;
  color: var(--text);
  font-weight: 900;
  text-align: right;
  overflow-wrap: anywhere;
}

.wallet-section,
.rewards-section {
  margin-bottom: 18px;
}

.wallet-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr) minmax(240px, 0.7fr);
  gap: 22px;
  align-items: center;
}

.wallet-form {
  display: grid;
  gap: 9px;
}

.wallet-form label {
  color: var(--soft);
  font-weight: 900;
}

.wallet-input-row {
  display: flex;
  gap: 10px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 17, 0.86);
  color: var(--text);
  min-height: 44px;
  padding: 0 12px;
  font: inherit;
}

select {
  width: auto;
  min-width: 132px;
}

.error-text {
  margin: 0;
  min-height: 20px;
  color: var(--danger);
  font-weight: 800;
}

.miner-results {
  display: grid;
  gap: 10px;
}

.miner-stat {
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  gap: 5px;
}

.miner-stat strong {
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 8, 14, 0.7);
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.worker-name-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.worker-avatar {
  width: 34px;
  aspect-ratio: 1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #130905;
  background: var(--accent);
  font-weight: 900;
}

.worker-name-cell small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.worker-hashrate-value {
  color: var(--text);
  font-weight: 900;
}

.worker-status-pill,
.reward-card-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.08);
}

.worker-status-pill.is-active,
.reward-card-status.is-success {
  color: #052016;
  background: var(--success);
}

.worker-status-pill.is-waiting,
.reward-card-status.is-waiting {
  color: #231600;
  background: var(--warning);
}

.reward-card-status.is-live,
.reward-card-status.is-info {
  color: #041f1d;
  background: var(--accent-2);
}

.reward-card-status.is-error {
  color: #2c0710;
  background: var(--danger);
}

.rewards-heading {
  margin-bottom: 18px;
}

.reward-icon-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.reward-icon-card {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  align-content: space-between;
  gap: 16px;
}

.reward-status-main {
  grid-column: span 2;
  border-color: var(--line-strong);
}

.reward-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.reward-card-name {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 900;
}

.reward-card-value {
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

.reward-status-value {
  font-size: 1.55rem;
}

.connect-card,
.legal-callout {
  display: grid;
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.command-stack {
  display: grid;
  gap: 10px;
}

.command-box {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.command-box code {
  flex: 1;
  min-width: 0;
  color: #e2e8f0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.copy-button {
  color: #130905;
  background: var(--accent-2);
}

.legal-callout {
  border-color: rgba(64, 214, 196, 0.28);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 12px 0 4px;
}

.footer a,
.legal-callout a {
  color: var(--accent-2);
}

.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;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    overflow-x: auto;
  }

  .sidebar-footer {
    display: none;
  }

  .content {
    width: min(100% - 24px, 1280px);
  }

  .wallet-card,
  .connect-card,
  .legal-callout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .content-header {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .header-actions {
    align-items: flex-start;
  }

  .metric-strip,
  .reward-icon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-7,
  .span-5,
  .span-12 {
    grid-column: span 12;
  }

  .round-visual {
    grid-template-columns: 1fr;
  }

  .ring {
    width: 148px;
  }
}

@media (max-width: 560px) {
  .sidebar {
    padding: 16px 12px;
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  .metric-strip,
  .reward-icon-grid {
    grid-template-columns: 1fr;
  }

  .reward-status-main {
    grid-column: span 1;
  }

  .wallet-input-row,
  .command-box {
    flex-direction: column;
    align-items: stretch;
  }

  h1 {
    font-size: 2.2rem;
  }
}
