:root {
  --bg: #07080a;
  --fg: #ffffff;
  --muted: #8794a4;
  --accent: #30a1f5;
  --accent-rgb: 48, 161, 245;
  --live: #ff5b5b;
  --surface: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.1);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --page-max: 960px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
}

.hidden {
  display: none !important;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
  line-height: 1;
}

.brand-mark {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.35));
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-id {
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 16px;
}

.brand-only {
  color: var(--fg);
}

.brand-pearl {
  color: var(--accent);
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.live-badge[data-state="bad"] {
  cursor: help;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
}

.live-dot.is-ok {
  background: #34c759;
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.5);
}

.live-dot.is-bad {
  background: var(--live);
  box-shadow: 0 0 6px rgba(255, 91, 91, 0.55);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.main {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.title {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}

.stratum-endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.stratum-flag {
  flex: none;
  display: inline-flex;
  line-height: 0;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.stratum-addr {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg);
  word-break: break-all;
}

.btn-copy-stratum {
  flex: none;
}

.wallet-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.wallet-form label {
  font-size: 13px;
  color: var(--muted);
}

.wallet-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
}

.btn-primary {
  margin-top: 6px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  flex: none;
  align-self: flex-end;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-ghost:hover {
  color: var(--fg);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.btn-ghost:disabled {
  opacity: 0.55;
  cursor: progress;
}

.form-error {
  color: #f5564a;
  font-size: 13px;
}

.wallet-header {
  margin-bottom: 20px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid rgba(var(--accent-rgb), 0.55);
  border-radius: 14px;
}

.wallet-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.wallet-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wallet-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.wallet-label svg {
  flex: none;
  opacity: 0.85;
}

.stratum-endpoint-dashboard {
  margin-top: 0;
}

.wallet-display-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.wallet-display {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  word-break: break-all;
  line-height: 1.4;
}

.btn-copy-wallet {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-copy-wallet:hover {
  color: var(--fg);
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.08);
}

.btn-copy-wallet.is-copied {
  color: var(--accent);
  border-color: rgba(99, 179, 237, 0.45);
}

@media (max-width: 420px) {
  .wallet-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .btn-ghost {
    align-self: flex-end;
  }
}

.wallet-history {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.wallet-history-label {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.wallet-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallet-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wallet-history-pick {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 12px;
  text-align: left;
  word-break: break-all;
  cursor: pointer;
}

.wallet-history-del {
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.chart-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

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

.chart-head h2 {
  font-size: 16px;
  font-weight: 600;
}

.chart-summary {
  font-size: 12px;
  color: var(--muted);
}

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

.chart-wrap {
  position: relative;
  height: 220px;
  overflow: visible;
}

.chart-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  transform: translate(-50%, -100%);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(7, 8, 10, 0.94);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.chart-tooltip.visible {
  opacity: 1;
  visibility: visible;
}

.chart-tooltip-time {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.chart-tooltip-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
}

.chart-tooltip-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.chart-tooltip-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
}

.chart-wrap-income {
  position: relative;
  overflow: visible;
}

.chart-wrap-income canvas {
  position: relative;
  z-index: 2;
}

.chart-bg-val {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.earnings-chart-block {
  margin-bottom: 4px;
}

.earnings-chart-title {
  font-size: 14px;
  font-weight: 600;
}

.pool-viz-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 8px;
}

.workers-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.workers-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.workers-toggle-title {
  font-size: 15px;
  font-weight: 600;
}

.workers-toggle-meta {
  margin-left: auto;
  font-size: 13px;
}

.workers-toggle-icon {
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.workers-toggle.is-open .workers-toggle-icon {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.workers-panel {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

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

.workers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.workers-table th,
.workers-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.workers-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.workers-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.workers-table th.sortable::after {
  content: "\2195";
  margin-left: 5px;
  opacity: 0.25;
  font-size: 10px;
}

.workers-table th.sortable:hover::after {
  opacity: 0.6;
}

.workers-table th.sortable.is-sorted-asc::after {
  content: "\25B2";
  opacity: 1;
  color: var(--accent);
}

.workers-table th.sortable.is-sorted-desc::after {
  content: "\25BC";
  opacity: 1;
  color: var(--accent);
}

.workers-table th.sortable:hover {
  color: var(--fg);
}

.workers-table tbody tr:last-child td {
  border-bottom: 0;
}

.worker-name {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

.worker-ver {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.worker-pool {
  font-size: 12px;
  white-space: nowrap;
}

.worker-diff {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.worker-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.worker-status.is-online {
  color: #4cd07d;
}

.worker-status.is-idle {
  color: #e0a32e;
}

.worker-status.is-online::before,
.worker-status.is-idle::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.worker-status.is-offline {
  color: var(--muted);
}

.workers-empty {
  text-align: center;
  color: var(--muted);
}

@media (max-width: 720px) {
  .workers-table th:nth-child(4),
  .workers-table td:nth-child(4) {
    display: none;
  }
}

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

.metric {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
}

.metric-val {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.metric-val-sm {
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.metric-sub {
  font-size: 11px;
  color: var(--muted);
}

.metric-grid-3 {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 720px) {
  .metric-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.metric-grid-4 {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 720px) {
  .metric-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.login-pool {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-block-top {
  margin-bottom: 0;
}

.chart-wrap-lg {
  height: 240px;
}

@media (max-width: 480px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-card-head h2 {
  font-size: 16px;
  font-weight: 600;
}

.effort-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.effort-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.effort-head h2 {
  font-size: 16px;
  font-weight: 600;
}

.effort-active-pill {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(48, 161, 245, 0.14);
  border: 1px solid rgba(48, 161, 245, 0.35);
  color: #8fd0ff;
}

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

.effort-card {
  position: relative;
  padding: 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.effort-card.is-active {
  border-color: rgba(48, 161, 245, 0.55);
  box-shadow: inset 0 0 0 1px rgba(48, 161, 245, 0.18);
}

.effort-card.is-active::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
}

.effort-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.effort-pool-name {
  font-size: 13px;
  color: var(--muted);
}

.effort-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(48, 161, 245, 0.18);
  color: #9fd4ff;
}

.effort-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.effort-card[data-tone="low"] .effort-value {
  color: #4cd07d;
}

.effort-card[data-tone="mid"] .effort-value {
  color: #f5c842;
}

.effort-card[data-tone="high"] .effort-value {
  color: #f56a4a;
}

.effort-bar-wrap {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

/* PROP profitability cutoff (q* = 43.47%): mine below it, parked above it. */
.effort-threshold {
  position: absolute;
  top: -3px;
  height: 12px;
  width: 2px;
  margin-left: -1px;
  background: #f5f7fa;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
  border-radius: 1px;
  z-index: 2;
}

.effort-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4cd07d, #30a1f5);
  transition: width 0.35s ease;
}

.effort-card[data-tone="mid"] .effort-bar {
  background: linear-gradient(90deg, #f5c842, #f59a23);
}

.effort-card[data-tone="high"] .effort-bar {
  background: linear-gradient(90deg, #f56a4a, #d63b3b);
}

.effort-sub {
  font-size: 11px;
  color: var(--muted);
}

.effort-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

@media (max-width: 480px) {
  .effort-grid {
    grid-template-columns: 1fr;
  }
}

.balances-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fleet-hashrate-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

/* The chart card sits flush under the metric grid otherwise — give it air. */
.fleet-hashrate-block .chart-block {
  margin-top: 16px;
}

/* Before a full 1h window exists, Эффективный/КПД are computed over a partial,
   noisier window — dim them so the number reads as provisional (Номинал is
   instantaneous, so it stays at full strength). */
.fleet-hashrate-block.partial-window #fleetEffective,
.fleet-hashrate-block.partial-window #fleetEfficiency {
  opacity: 0.55;
}

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

.fleet-hashrate-head h2 {
  font-size: 16px;
  font-weight: 600;
}

.fleet-hashrate-head .muted {
  font-size: 13px;
}

.workers-toggle-meta.is-on {
  color: #46a758;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.workers-toggle-meta.is-off {
  color: var(--live);
  font-weight: 600;
}

.balances-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.balances-head h2 {
  font-size: 16px;
  font-weight: 600;
}

.balances-total {
  font-size: 13px;
}

.balances-note {
  font-size: 12px;
  line-height: 1.4;
}

.pool-balance-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.pool-balance-card {
  padding: 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pool-balance-title {
  font-size: 13px;
  color: var(--muted);
}

.pool-balance-total {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pool-balance-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.pool-balance-meta em {
  font-style: normal;
  color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 480px) {
  .pool-balance-grid {
    grid-template-columns: 1fr;
  }
}

.earnings-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.earnings-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.earnings-head h2 {
  font-size: 16px;
  font-weight: 600;
}

.earnings-sub {
  font-size: 12px;
}

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

/* Realized income is one card per pool (hero / kryptex / PPLNS) → three across. */
#realizedGrid {
  grid-template-columns: repeat(3, 1fr);
}

/* Real PRL/TH windows (1/6/12/24 h) → single row of four. */
#earningsGrid {
  grid-template-columns: repeat(4, 1fr);
}

.earnings-card {
  padding: 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.earnings-window {
  font-size: 12px;
  color: var(--muted);
}

.partial-tag {
  color: rgba(255, 255, 255, 0.45);
}

.src-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  margin-left: 5px;
  cursor: help;
}

.src-dot.pool {
  background: #e5484d;
  box-shadow: 0 0 4px rgba(229, 72, 77, 0.7);
}

.src-dot.fleet {
  background: #46a758;
}

.earnings-main {
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.earnings-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
}

.earnings-meta strong {
  color: var(--fg);
  font-weight: 600;
}

.earnings-hash {
  font-size: 11px;
}

.earnings-note {
  font-size: 12px;
  line-height: 1.4;
}

/* ----- income accuracy table (per pool × time window) */
.acc-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.acc-table th,
.acc-table td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.acc-table thead th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.acc-table thead th:first-child {
  text-align: left;
}

.acc-table tbody th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.acc-cell-total {
  font-size: 14px;
  font-weight: 600;
}

.acc-cell-total.adv-up {
  color: #46a758;
}

.acc-cell-total.adv-down {
  color: var(--live);
}

.acc-cell-split {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.acc-credited {
  color: #46a758;
}

.acc-maturing {
  color: var(--accent);
}

.acc-pill {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.acc-pill.acc-hi {
  background: rgba(70, 167, 88, 0.18);
  color: #46a758;
}

.acc-pill.acc-mid {
  background: rgba(245, 171, 53, 0.18);
  color: #f5ab35;
}

.acc-pill.acc-lo {
  background: rgba(229, 72, 77, 0.18);
  color: #e5484d;
}

.acc-pill.acc-na {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.acc-na-row {
  color: var(--muted);
  text-align: center;
}

.acc-err-row {
  color: #f0a35e;
  text-align: center;
}

.sources-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin: 12px 0;
  padding: 10px 14px;
  border: 1px solid #7a4a1e;
  background: rgba(240, 163, 94, 0.1);
  border-radius: 8px;
}

.sources-banner-text {
  color: #f0a35e;
  font-size: 13px;
  line-height: 1.4;
}

.sources-banner .btn-ghost {
  flex: 0 0 auto;
  white-space: nowrap;
}

.feegate-banner {
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid;
}

.feegate-banner-text {
  font-size: 13px;
  line-height: 1.4;
}

.feegate-banner.feegate-info {
  border-color: #2e5a7a;
  background: rgba(94, 170, 240, 0.08);
}
.feegate-banner.feegate-info .feegate-banner-text {
  color: #5eaaf0;
}

.feegate-banner.feegate-warn {
  border-color: #7a4a1e;
  background: rgba(240, 163, 94, 0.1);
}
.feegate-banner.feegate-warn .feegate-banner-text {
  color: #f0a35e;
}

.feegate-banner.feegate-bad {
  border-color: #7a1e2e;
  background: rgba(240, 94, 114, 0.1);
}
.feegate-banner.feegate-bad .feegate-banner-text {
  color: #f05e72;
}

.acc-table tr.acc-combined th,
.acc-table tr.acc-combined td {
  border-top: 2px solid var(--border);
  border-bottom: none;
}

.acc-table tr.acc-combined th {
  color: var(--accent);
}

/* Pool time-in-pool & worthiness: worth as a relative bar (length + 3-tier
   colour), time% as an orthogonal grey sparkbar, ① badge on the column winner. */
.pw-table td {
  vertical-align: middle;
}
.pw-cell {
  min-width: 110px;
}
.pw-cell.pw-empty {
  color: var(--muted);
  font-size: 14px;
}
.pw-metric {
  margin-top: 7px;
}
.pw-metric:first-child {
  margin-top: 0;
}
.pw-metric-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
}
.pw-metric-label {
  font-size: 10px;
  color: var(--muted);
}
.pw-metric-val {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pw-bar-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.pw-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  opacity: 0.9;
}
.pw-bar-fill.acc-hi {
  background: #46a758;
}
.pw-bar-fill.acc-mid {
  background: #f5ab35;
}
.pw-bar-fill.acc-lo {
  background: #e5484d;
}
.pw-rank {
  margin-right: 4px;
  font-weight: 700;
  color: var(--fg);
}
.pw-time-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--muted);
}
.pw-best {
  color: #46a758;
  font-weight: 600;
}
.pw-worst {
  color: #e5484d;
  font-weight: 600;
}

@media (max-width: 480px) {
  .earnings-grid {
    grid-template-columns: 1fr;
  }
  .acc-table th,
  .acc-table td {
    padding: 6px 5px;
  }
  .acc-cell-split {
    display: none;
  }
}

.footer {
  text-align: center;
  padding: 24px 20px 32px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.footer-tg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.footer-tg:hover {
  color: #29b6f6;
  border-color: rgba(41, 182, 246, 0.45);
  background: rgba(41, 182, 246, 0.08);
}

.footer-tg svg {
  flex: none;
  color: #29b6f6;
}

.footer-pps {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.footer-pps:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.footer-pps-logo {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

/* --- extra-config builder --- */
.config-builder {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 8px;
}

.cfg-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cfg-sub {
  font-size: 13px;
  line-height: 1.4;
}

.cfg-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.cfg-label {
  font-size: 14px;
  font-weight: 600;
}

.cfg-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.cfg-checks-col {
  flex-direction: column;
  gap: 9px;
}

.cfg-checks-col .cfg-check {
  align-items: flex-start;
}

.cfg-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.cfg-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.cfg-note {
  font-size: 12px;
  line-height: 1.45;
}

.cfg-f2account[hidden] {
  display: none;
}

.cfg-f2account {
  margin-top: 8px;
}

.cfg-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.cfg-inline input[type="text"] {
  font-family: var(--mono);
  font-size: 13px;
  padding: 4px 8px;
  min-width: 180px;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
}

.cfg-note code {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}

.cfg-output {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cfg-output-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.cfg-output-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.cfg-output-input:focus {
  outline: none;
  border-color: var(--accent);
}

.cfg-copy {
  flex: none;
  white-space: nowrap;
}

.cfg-ep-pool {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.cfg-ep-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cfg-ep-name {
  font-size: 13px;
  font-weight: 600;
}

.cfg-ep-clear {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
}

.cfg-ep-clear:hover {
  color: var(--fg);
  text-decoration: underline;
}

.cfg-ep-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.cfg-ep-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  font-size: 12.5px;
  text-align: left;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.cfg-ep-item:hover {
  border-color: var(--accent);
}

.cfg-ep-item.sel {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

.cfg-ep-badge {
  flex: none;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  color: var(--muted);
  border: 1px solid var(--border);
}

.cfg-ep-item.sel .cfg-ep-badge {
  color: #0b0e13;
  background: var(--accent);
  border-color: var(--accent);
}

.cfg-ep-lbl {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cfg-ep-host {
  flex: none;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}

.cfg-ep-preview {
  font-family: var(--mono);
  font-size: 11px;
  word-break: break-all;
}

@media (max-width: 560px) {
  .cfg-output-row {
    flex-direction: column;
  }

  .cfg-ep-list {
    grid-template-columns: 1fr;
  }
}
