:root {
  color-scheme: dark;
  --bg: #050807;
  --sidebar: #080c0a;
  --panel: #0d1210;
  --panel-2: #101713;
  --panel-3: #151c19;
  --line: #243129;
  --line-soft: #18231d;
  --text: #f2f7f4;
  --muted: #9ba9a1;
  --soft: #71847a;
  --green: #00df72;
  --green-bright: #29f58b;
  --green-soft: rgba(0, 223, 114, 0.1);
  --red: #ff5864;
  --amber: #ffbd45;
  --blue: #4f8cff;
  --purple: #b56cff;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0; font-size: 42px; line-height: 1.05; font-weight: 760; }
h2 { margin: 0; font-size: 17px; }
h3 { margin: 0; font-size: 16px; }

.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  overflow: auto;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 88px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.brand:hover, .brand.active { background: var(--panel); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 223, 114, 0.7);
  border-radius: 5px;
  color: var(--green-bright);
  background: var(--green-soft);
  font-size: 23px;
  font-weight: 800;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { margin-top: 4px; color: var(--muted); }
.coin-nav { display: grid; }
.coin-button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 86px;
  width: 100%;
  padding: 12px 10px 12px 18px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.coin-button:hover, .coin-button.active { background: var(--panel-2); color: var(--text); }
.coin-button.active { border-left-color: var(--green); }
.coin-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 32px;
  border: 1px solid rgba(0, 223, 114, 0.25);
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green-bright);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.coin-button:nth-child(2) .coin-icon { border-color: rgba(181, 108, 255, 0.45); background: rgba(181, 108, 255, 0.12); color: #d3a8ff; }
.coin-button:nth-child(3) .coin-icon { border-color: rgba(79, 140, 255, 0.45); background: rgba(79, 140, 255, 0.12); color: #8db5ff; }
.coin-button:nth-child(4) .coin-icon { border-color: rgba(255, 145, 52, 0.45); background: rgba(255, 145, 52, 0.12); color: #ffae68; }
.coin-name { display: block; color: inherit; font-weight: 720; }
.coin-algo { display: block; margin-top: 4px; color: var(--soft); font-size: 12px; }
.sidebar-footer {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding: 22px 20px;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
}
.sidebar-footer small { color: var(--soft); }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 23px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.badge.online, .badge.ready, .health-ok {
  border-color: rgba(0, 223, 114, 0.55);
  background: var(--green-soft);
  color: var(--green-bright);
}
.badge.syncing, .health-syncing { border-color: rgba(255, 189, 69, 0.65); background: rgba(255, 189, 69, 0.1); color: var(--amber); }
.badge.degraded { border-color: rgba(255, 189, 69, 0.65); background: rgba(255, 189, 69, 0.1); color: var(--amber); }
.badge.offline, .badge.error, .health-bad { border-color: rgba(255, 88, 100, 0.65); background: rgba(255, 88, 100, 0.1); color: #ff9098; }

.main { min-width: 0; padding: 0 22px 44px; }
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 55px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.ticker { display: flex; gap: 28px; overflow-x: auto; color: var(--muted); white-space: nowrap; scrollbar-width: none; }
.ticker::-webkit-scrollbar { display: none; }
.ticker strong { color: var(--green-bright); }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--green-bright); font-size: 12px; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(0, 223, 114, 0.09); }
.signal { display: inline-flex; align-items: end; gap: 2px; height: 14px; margin-left: 7px; }
.signal i { display: block; width: 2px; background: var(--green); }
.signal i:nth-child(1) { height: 5px; }.signal i:nth-child(2) { height: 9px; }.signal i:nth-child(3) { height: 13px; }

.hero, .coin-page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 10px 0 12px;
}
.coin-page-head > .badge { justify-self: end; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 118px); gap: 8px; }
.hero-stat {
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}
.hero-stat span { display: block; color: var(--soft); font-size: 10px; text-transform: uppercase; }
.hero-stat strong { display: block; margin-top: 8px; font-size: 19px; }

.section-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.section-tabs button {
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.section-tabs button:hover, .section-tabs button.active { border-bottom-color: var(--green); color: var(--green-bright); }

.panel, .metric-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.panel { margin-bottom: 16px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 51px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-count { color: var(--green-bright); font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric-grid.compact { grid-template-columns: repeat(2, minmax(220px, 1fr)); padding: 16px; }
.metric-card { min-height: 210px; padding: 17px; }
.metric-title { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }
.metric-symbol { width: 30px; height: 30px; border: 1px solid rgba(0, 223, 114, 0.5); border-radius: 50%; background: var(--green-soft); }
.metric-symbol::after { content: ''; display: block; width: 8px; height: 8px; margin: 10px; border-radius: 50%; background: var(--green); }
.metric-list { display: grid; gap: 10px; }
.metric-line { display: grid; grid-template-columns: minmax(110px, 1.2fr) minmax(80px, 1fr); align-items: center; gap: 12px; }
.metric-line span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.metric-line strong { color: var(--text); overflow-wrap: anywhere; }
.value-good { color: var(--green-bright) !important; }
.stat-primary { color: var(--text) !important; font-size: 24px; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(250px, 0.9fr); gap: 14px; }
.overview-grid > *, .metric-grid > *, .worker-summary-grid > * { min-width: 0; }
.lower-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.trend-panel { min-height: 275px; }
.chart-body { min-height: 190px; padding: 15px 16px 0; }
.hashrate-svg { display: block; width: 100%; height: 176px; overflow: visible; }
.chart-grid-line { stroke: #1a251f; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-area { fill: rgba(0, 223, 114, 0.08); }
.chart-line { fill: none; stroke: var(--green); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-average { stroke: #8a9a92; stroke-width: 1; stroke-dasharray: 6 6; vector-effect: non-scaling-stroke; }
.chart-legend { display: flex; justify-content: center; gap: 24px; padding: 4px 15px 14px; color: var(--muted); font-size: 11px; }
.chart-legend span::before { content: ''; display: inline-block; width: 18px; margin-right: 7px; vertical-align: middle; border-top: 2px solid var(--green); }
.chart-legend .legend-average::before { border-top: 1px dashed #8a9a92; }
.range-switch { display: inline-flex; gap: 5px; }
.range-switch button { min-width: 38px; height: 29px; border: 1px solid var(--line); border-radius: 3px; background: #090d0b; color: var(--muted); cursor: pointer; font-size: 11px; }
.range-switch button.active, .range-switch button:hover { border-color: rgba(0, 223, 114, 0.55); background: var(--green-soft); color: var(--green-bright); }

.worker-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.worker-summary-grid .metric-card { min-height: 185px; padding: 15px; }
.worker-summary-grid .metric-line { grid-template-columns: 1fr 1fr; }
.worker-summary-grid .metric-title { margin-bottom: 13px; }
.worker-trend { min-height: 270px; }
.lookup-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.lookup-hero { grid-template-columns: 180px minmax(240px, 1fr) auto; align-items: center; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); box-shadow: var(--shadow); }
.lookup-hero strong { font-size: 13px; }
.lookup-form input, .start-grid input, .start-grid select, .command-label textarea, .settings-form input, .settings-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #070a08;
  color: var(--text);
}
.lookup-form input { min-height: 42px; padding: 0 12px; }
.lookup-form button, .settings-form button, .start-actions button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(0, 223, 114, 0.65);
  border-radius: 3px;
  background: var(--green-soft);
  color: var(--green-bright);
  font-weight: 800;
  cursor: pointer;
}
.lookup-form button:disabled, .lookup-form input:disabled { opacity: 0.45; cursor: not-allowed; }

.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { height: 42px; padding: 0 13px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
th { color: var(--soft); font-size: 10px; text-transform: uppercase; }
td { color: #b5c4bc; font-size: 13px; }
tbody tr:hover { background: rgba(0, 223, 114, 0.035); }
.compact-table { min-width: 560px; }
.sort-button { padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: inherit; font-weight: 800; text-transform: inherit; }
.sort-button:hover { color: var(--green-bright); }
.coin-cell { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 750; }
.table-coin-button { padding: 0; border: 0; background: transparent; cursor: pointer; }
.finder, .compact-address, .wallet-address { color: var(--green-bright); font-weight: 750; }
.no-copy { user-select: none; -webkit-user-select: none; }
.mature-new { color: var(--amber); font-weight: 800; }
.mature-done { color: var(--green-bright); font-weight: 800; }
.empty-state, .empty-note { color: var(--soft); text-align: center; }
.payments-panel { min-height: 210px; }
.payments-table { min-width: 760px; }
.blocks-panel .table-wrap { max-height: 620px; }

.worker-name-stack { display: inline-flex; flex-direction: column; gap: 4px; }
.worker-name-cell { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
.worker-dot { display: inline-block; width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(255, 88, 100, 0.1); }
.worker-dot.active { background: var(--green-bright); box-shadow: 0 0 0 3px rgba(0, 223, 114, 0.1); }

.health-strip {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 59px;
  padding: 10px 16px;
  margin-top: 2px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}
.health-strip > span { display: grid; grid-template-columns: 24px auto; grid-template-rows: auto auto; column-gap: 8px; min-width: max-content; }
.health-strip i { grid-row: 1 / 3; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--green-soft); color: var(--green-bright); font-style: normal; }
.health-strip b { font-size: 11px; }.health-strip small { color: var(--soft); font-size: 10px; }
.health-strip .health-updated { display: block; margin-left: auto; color: var(--muted); font-size: 11px; }

.wallet-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 14px; padding: 16px; }
.wallet-stat-grid.single { grid-template-columns: 1fr; }
.wallet-stat-card { min-width: 0; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); }
.wallet-stat-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 0 14px; border-bottom: 1px solid var(--line-soft); }
.wallet-stat-card header span { color: var(--muted); }

.connect-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 14px; padding: 16px; }
.connect-box { padding: 16px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); }
.kv-list { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px 14px; }
.kv-list span { color: var(--soft); font-size: 11px; text-transform: uppercase; }
.kv-list strong { overflow-wrap: anywhere; }
.code-value { display: grid; gap: 4px; color: var(--green-bright); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.url-line { display: block; }

.start-builder { display: grid; gap: 14px; padding: 16px; }
.start-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 12px; }
.start-grid label, .command-label, .settings-form label { display: grid; gap: 6px; color: var(--soft); font-size: 11px; text-transform: uppercase; }
.start-grid input, .start-grid select { min-height: 42px; padding: 0 11px; }
.command-label textarea { min-height: 112px; padding: 11px; resize: vertical; color: var(--green-bright); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.45; text-transform: none; }
.start-actions { display: flex; align-items: center; gap: 12px; }
.app-list { display: grid; gap: 8px; padding: 16px; }
.app-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 55px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); }
.app-row:hover { border-color: rgba(0, 223, 114, 0.55); }
.app-row strong, .app-row small { display: block; }
.app-row small { margin-top: 3px; color: var(--muted); }.app-row > span:last-child { color: var(--green-bright); font-weight: 800; }

.settings-form { display: grid; grid-template-columns: minmax(190px, 240px) minmax(180px, 240px) auto minmax(180px, 1fr); gap: 10px; align-items: end; padding: 16px; }
.settings-form.simple { grid-template-columns: minmax(190px, 240px) auto minmax(180px, 1fr); }
.settings-form input, .settings-form select { min-height: 40px; padding: 0 10px; }
.settings-form button { min-height: 40px; }
.form-message { display: flex; align-items: center; min-height: 40px; color: var(--muted); }.form-message.success { color: var(--green-bright); }.form-message.error { color: #ff9098; }

.split-grid { display: grid; grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.4fr); gap: 14px; }
.news-list { display: grid; gap: 14px; max-height: 300px; overflow: auto; padding: 16px; }
.news-item time { color: var(--green-bright); font-size: 12px; }.news-item strong { display: block; margin: 6px 0; }.news-item p, .muted { color: var(--muted); }
.bar-chart { display: grid; grid-template-columns: repeat(24, 1fr); align-items: end; gap: 4px; min-height: 150px; padding: 14px 8px 0; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bar { min-height: 3px; background: var(--green); opacity: 0.9; }
.classic-shell { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 620px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--sidebar); }
.classic-menu { display: grid; align-content: start; gap: 2px; padding: 14px 10px; border-right: 1px solid var(--line); }.classic-menu strong, .classic-menu a { padding: 10px; }.classic-menu strong { color: var(--green-bright); }.classic-menu a { color: var(--muted); }
.classic-main { min-width: 0; padding: 16px; }.classic-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }.classic-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }.classic-stat { min-height: 72px; padding: 11px; border: 1px solid var(--line); background: var(--panel); }.classic-stat span { color: var(--soft); font-size: 11px; text-transform: uppercase; }.classic-stat strong { display: block; margin-top: 8px; }

@media (max-width: 1250px) {
  .worker-summary-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .overview-metrics { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .overview-metrics .metric-card:last-child { grid-column: 1 / -1; min-height: auto; }
}
@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { min-height: 70px; }.coin-nav { display: flex; width: 100%; max-width: 100vw; overflow-x: auto; }.coin-button { min-width: 170px; min-height: 68px; flex: 0 0 170px; }.sidebar-footer { display: none; }
  .overview-grid, .split-grid { grid-template-columns: 1fr; }
  .health-strip { gap: 20px; }
}
@media (max-width: 760px) {
  .main { padding: 0 12px 30px; }
  .topbar { grid-template-columns: 1fr auto; }.ticker { gap: 18px; }
  h1 { font-size: 32px; }
  .hero, .coin-page-head { align-items: flex-start; }
  .hero { display: grid; }.hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }.hero-stat { min-width: 0; }
  .metric-grid, .overview-metrics, .worker-summary-grid, .metric-grid.compact, .connect-grid, .start-grid, .wallet-stat-grid, .classic-shell, .classic-stat-grid { grid-template-columns: 1fr; }
  .overview-metrics .metric-card:last-child { grid-column: auto; }
  .lookup-hero { grid-template-columns: 1fr; }
  .metric-card { min-height: auto; }
  .settings-form, .settings-form.simple { grid-template-columns: 1fr; }
  .health-strip { align-items: flex-start; }
  .health-strip .health-updated { margin-left: 0; }
}
@media (max-width: 480px) {
  .brand { padding: 12px; }.brand-mark { width: 40px; height: 40px; }.coin-button { min-width: 150px; flex-basis: 150px; padding-left: 10px; }.coin-button .badge { display: none; }
  .status #statusText { display: none; }.ticker { font-size: 12px; }
  .hero-stats { grid-template-columns: 1fr; }.hero-stat { min-height: 56px; }
  .coin-page-head { display: grid; }.coin-page-head > .badge { justify-self: start; }.section-tabs { margin-bottom: 13px; }
  .chart-body { padding-inline: 8px; }.chart-legend { gap: 12px; }
}
