:root {
  color-scheme: dark;
  --bg: #0b0d0e;
  --bg-2: #111517;
  --panel: #171c1f;
  --panel-2: #20272b;
  --line: #333b40;
  --line-soft: #ffffff14;
  --text: #f4f6f7;
  --muted: #9ba6ad;
  --muted-2: #737f87;
  --gold: #f2c94c;
  --gold-2: #d8ad3d;
  --green: #35d084;
  --blue: #77b7ff;
  --red: #ef6b73;
  --shadow: 0 24px 80px #0000005c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
  background:
    linear-gradient(#121516f5, #090a0b),
    repeating-linear-gradient(90deg, #ffffff06 0 1px, transparent 1px 72px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

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

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

h1,
h2,
p {
  margin: 0;
  overflow-wrap: anywhere;
}

svg {
  display: block;
}

.app-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

.ticker-rail {
  z-index: 50;
  position: fixed;
  inset: 0 0 auto;
  height: 40px;
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
  background: #070809db;
  overflow: hidden;
}

.ticker-track {
  min-width: 100%;
  display: flex;
  animation: ticker 34s linear infinite;
}

.ticker-row {
  min-width: max-content;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 18px;
  color: var(--muted);
  white-space: nowrap;
  line-height: 40px;
}

.ticker-row strong {
  color: var(--text);
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.site-header {
  z-index: 40;
  position: fixed;
  inset: 40px 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 max(24px, calc(50vw - 590px));
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(18px);
  background: #0f1112db;
}

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

.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.brand span {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: var(--muted);
  font-weight: 700;
}

.nav-links,
.header-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links {
  color: #c9d1d9;
  font-size: 0.94rem;
  font-weight: 700;
}

.nav-links a:hover {
  color: var(--gold);
}

.header-actions {
  gap: 10px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070809;
  padding: 3px;
}

.lang-switch button {
  min-width: 48px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.lang-switch button.is-active {
  color: #17120a;
  background: var(--gold);
}

.icon-text,
.icon-button,
.primary-button,
.mode-bar button,
.copy-line {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff0a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.16s, border-color 0.16s, background 0.16s;
}

.icon-text {
  padding: 0 14px;
  font-weight: 800;
}

.icon-button {
  width: 42px;
  padding: 0;
}

.icon-text:hover,
.icon-button:hover,
.copy-line:hover {
  background: #ffffff14;
  border-color: #c9d1d994;
}

.primary-button {
  border-color: #f2c94c6b;
  color: #17120a;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  padding: 0 16px;
  font-weight: 850;
  white-space: nowrap;
}

.primary-button:hover {
  transform: translateY(-1px);
}

.app-shell i,
.app-shell .lucide {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

main {
  width: min(1180px, calc(100vw - 32px));
  max-width: 100%;
  margin: 0 auto;
  padding-top: 156px;
}

.hero-ops {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  align-items: stretch;
  gap: 22px;
  min-height: calc(100vh - 156px);
  padding-bottom: 48px;
}

.hero-copy,
.pool-panel,
.connect-card,
.data-panel,
.chart-panel,
.miner-summary article {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1b2023, #141719);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  min-height: 520px;
  padding: clamp(26px, 5vw, 56px);
  border-radius: 8px;
}

.eyebrow {
  width: fit-content;
  max-width: 100%;
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 850;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  font-size: clamp(2.55rem, 6vw, 5.8rem);
  line-height: 0.95;
  font-weight: 900;
}

.lead {
  max-width: 650px;
  color: #c2c9ce;
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  line-height: 1.75;
}

.quick-search,
.miner-search {
  display: grid;
  gap: 10px;
}

.quick-search label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.search-row,
.miner-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.quick-search input,
.miner-search input,
.miner-search select {
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #070809;
  padding: 0 14px;
  outline: none;
}

.miner-search {
  grid-template-columns: minmax(0, 1fr) 136px auto;
  margin-bottom: 18px;
}

.quick-search input:focus,
.miner-search input:focus,
.miner-search select:focus {
  border-color: #f2c94c91;
}

.pool-overview {
  display: grid;
  gap: 18px;
}

.pool-panel {
  border-radius: 8px;
  padding: clamp(20px, 3vw, 28px);
}

.pool-panel.is-pplns {
  border-top: 3px solid var(--gold);
}

.pool-panel.is-solo {
  border-top: 3px solid var(--green);
}

.panel-title,
.panel-heading,
.card-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title div {
  display: grid;
  gap: 4px;
}

.panel-title span,
.card-kicker,
.metric-grid span,
.mini-rows span,
.miner-summary span {
  color: var(--muted);
}

.panel-title strong {
  font-size: 1.3rem;
}

.live-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 6px #ef6b731f;
}

.live-dot.is-live {
  background: var(--green);
  box-shadow: 0 0 0 6px #35d0841f;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.metric-grid div,
.mini-rows div {
  min-width: 0;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.metric-grid strong,
.mini-rows strong,
.miner-summary strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  overflow-wrap: anywhere;
}

.connect-section,
.miner-section,
.activity-section {
  padding: 54px 0;
}

.section-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.section-heading > span {
  width: 42px;
  height: 3px;
  background: var(--gold);
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.mode-bar {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070809;
}

.mode-bar button {
  min-width: 118px;
  border-color: transparent;
  background: transparent;
  font-weight: 850;
}

.mode-bar button.is-active {
  color: #17120a;
  background: var(--gold);
}

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

.connect-card,
.data-panel,
.chart-panel {
  border-radius: 8px;
  padding: 18px;
}

.tier-card {
  grid-column: 1 / -1;
}

.card-kicker {
  justify-content: flex-start;
  margin-bottom: 14px;
  font-weight: 850;
}

.copy-line {
  width: 100%;
  min-height: 54px;
  justify-content: space-between;
  padding: 0 14px;
  text-align: left;
}

.copy-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.connect-details div {
  min-width: 0;
  border-top: 1px solid var(--line-soft);
  padding-top: 11px;
}

.connect-details dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.connect-details dd {
  min-width: 0;
  margin: 5px 0 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.mini-rows {
  display: grid;
  gap: 12px;
}

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

.tier-item {
  min-width: 0;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0708098c;
  padding: 12px;
}

.tier-heading {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.tier-heading strong {
  font-size: 1rem;
}

.tier-heading span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.tier-copy {
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: 36px minmax(52px, 1fr) 18px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff08;
  padding: 0 10px;
  text-align: left;
}

.tier-copy:hover {
  border-color: #c9d1d994;
  background: #ffffff14;
}

.tier-copy span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
}

.tier-copy strong {
  min-width: 0;
  font-size: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: nowrap;
}

.miner-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 0.66fr);
  gap: 16px;
}

.miner-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.miner-summary article {
  min-height: 114px;
  border-radius: 8px;
  padding: 16px;
}

.chart-panel {
  min-height: 260px;
}

.panel-heading {
  margin-bottom: 14px;
}

.panel-heading a {
  color: var(--gold);
  font-weight: 850;
}

#hashrate-chart {
  width: 100%;
  height: 240px;
}

.chart-axis {
  stroke: #ffffff1f;
}

.chart-line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
}

.chart-fill {
  fill: #f2c94c1f;
}

.chart-label {
  fill: var(--muted);
  font-size: 12px;
}

.activity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
  align-items: start;
}

.activity-card {
  min-width: 0;
}

.activity-card.is-wide {
  grid-column: 1 / -1;
}

.row-list {
  display: grid;
  gap: 2px;
}

.data-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line-soft);
  color: #dbe1e5;
  padding: 13px 0;
}

.data-row:first-child {
  border-top: 0;
}

a.data-row {
  color: #dbe1e5;
}

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

.block-row {
  grid-template-columns: minmax(0, 1fr) max-content max-content;
}

.solo-row {
  grid-template-columns: minmax(0, 1fr) minmax(118px, auto) minmax(96px, auto);
}

.row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.row-kicker,
.row-sub,
.metric-inline span,
.empty-row {
  color: var(--muted);
}

.row-kicker {
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.row-main strong {
  min-width: 0;
  font-size: 0.92rem;
}

.row-sub {
  min-width: 0;
  font-size: 0.8rem;
}

.row-value {
  min-width: 0;
  color: var(--text);
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
}

.metric-inline {
  min-width: 0;
  display: grid;
  gap: 4px;
  justify-items: end;
  white-space: nowrap;
}

.metric-inline span {
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.metric-inline strong {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.truncate {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-row {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  background: #ffffff0a;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.status-pill.confirmed,
.status-pill.paid,
.status-pill.unlocked {
  color: var(--green);
  border-color: #35d08459;
}

.status-pill.pending {
  color: var(--gold);
  border-color: #f2c94c59;
}

.toast {
  z-index: 80;
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  min-height: 44px;
  display: none;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #090a0bf2;
  box-shadow: var(--shadow);
  padding: 10px 14px;
}

.toast.is-visible {
  display: flex;
}

@media (max-width: 980px) {
  .site-header {
    padding: 0 16px;
  }

  .nav-links {
    display: none;
  }

  .hero-ops,
  .miner-layout,
  .connect-grid,
  .activity-grid {
    grid-template-columns: 1fr;
  }

  .activity-card.is-wide {
    grid-column: auto;
  }

  .hero-copy {
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 70px;
    gap: 10px;
  }

  .brand img {
    width: 44px;
    height: 44px;
  }

  .brand small,
  .icon-text {
    display: none;
  }

  main {
    width: min(100% - 24px, 1180px);
    padding-top: 132px;
  }

  .hero-ops {
    min-height: auto;
    padding-bottom: 24px;
  }

  .search-row,
  .miner-search {
    grid-template-columns: 1fr;
  }

  .miner-search select,
  .primary-button {
    width: 100%;
  }

  .metric-grid,
  .miner-summary,
  .tier-grid {
    grid-template-columns: 1fr;
  }

  .connect-details {
    grid-template-columns: 1fr;
  }

  .mode-bar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mode-bar button {
    min-width: 0;
  }

  .block-row,
  .payment-row,
  .solo-row {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
  }

  .row-value,
  .metric-inline {
    justify-items: start;
    text-align: left;
  }

  .metric-inline strong {
    max-width: 100%;
  }
}
