: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: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  color: var(--accent);
  font-size: 18px;
}

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

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

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  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;
}

.miner-recommend {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid rgba(48, 161, 245, 0.28);
  border-radius: 10px;
  background: rgba(48, 161, 245, 0.08);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.miner-recommend a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.miner-recommend a:hover {
  text-decoration: underline;
}

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

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

.wallet-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

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

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

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

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

.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: transparent;
  color: var(--muted);
  cursor: pointer;
}

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

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

.workers-block {
  margin-top: 4px;
}

.workers-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  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 tbody tr:last-child td {
  border-bottom: 0;
}

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

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

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

.worker-status.is-online::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-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;
  }
}

.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 {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

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

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

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

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

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

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

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