/* Ruble Pool Stats UI v1.0.0
 * Additive production overlay for stable merged-mining telemetry.
 * Historical pool assets remain unchanged.
 */

#panel-miners [data-miner-mode-panel][hidden] {
  display: none !important;
}

.merge-metrics > .stats-hashrate-primary,
.miner-merge-stats > .stats-hashrate-primary {
  border-color: rgba(66, 214, 154, .32);
  background: linear-gradient(145deg, rgba(66, 214, 154, .09), rgba(9, 13, 17, .94));
  box-shadow: inset 3px 0 0 rgba(66, 214, 154, .72);
}

.miner-merge-stats > .stats-hashrate-primary {
  grid-column: span 2;
}

.stats-hashrate-volatile {
  border-style: dashed !important;
}

.stats-metric-note {
  display: block;
  margin-top: 6px;
  color: #788292;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.stats-metric-note.is-live {
  color: #75d7ad;
}

.stats-metric-note.is-warming {
  color: #ddb96d;
}

.stats-value-unavailable {
  color: #8b94a3 !important;
  font-size: .9em !important;
  white-space: normal !important;
}

.stats-v2-panel {
  margin: 16px 0;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(17, 21, 29, .95), rgba(8, 10, 14, .96));
}

.stats-v2-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.stats-v2-head h4 {
  margin: 0;
  color: #eef1f6;
  font-size: 18px;
  letter-spacing: -.02em;
}

.stats-v2-head p {
  max-width: 680px;
  margin: 6px 0 0;
  color: #858e9e;
  font-size: 13px;
  line-height: 1.5;
}

.stats-v2-availability {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  color: #9ca5b4;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stats-v2-availability.is-live {
  border-color: rgba(66, 214, 154, .32);
  background: rgba(66, 214, 154, .08);
  color: #75d7ad;
}

.stats-v2-availability.is-warming {
  border-color: rgba(238, 178, 62, .32);
  background: rgba(238, 178, 62, .08);
  color: #ddb96d;
}

.stats-v2-availability.is-partial {
  border-color: rgba(98, 155, 255, .3);
  background: rgba(98, 155, 255, .08);
  color: #9cbbf8;
}

#panel-miners .miner-merge-head > .merge-state-pill {
  display: none;
}

.stats-context-badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.stats-context-badges > span {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  color: #9ca5b4;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stats-context-badges > .is-live {
  border-color: rgba(66, 214, 154, .32);
  background: rgba(66, 214, 154, .08);
  color: #75d7ad;
}

.stats-context-badges > .is-recent {
  border-color: rgba(238, 178, 62, .32);
  background: rgba(238, 178, 62, .08);
  color: #ddb96d;
}

.stats-context-badges > .is-idle {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  color: #aab2c0;
}

.stats-v2-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.stats-v2-metric {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px;
  background: rgba(0, 0, 0, .16);
}

.stats-v2-metric small {
  display: block;
  color: #7e8797;
  font-size: 12px;
  line-height: 1.3;
}

.stats-v2-metric strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  color: #edf0f5;
  font-size: 15px;
  line-height: 1.35;
}

.stats-v2-reasons {
  grid-column: span 2;
}

.personal-work-note {
  display: block;
  margin-top: 5px;
  color: #8d97a7;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.stats-card-table td[data-state="unavailable"] {
  color: #8b94a3;
}

tr[data-stats-page-hidden="true"] {
  display: none !important;
}

.stats-table-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 10px 0 4px;
}

.stats-table-pager span {
  color: #8d97a7;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.stats-table-pager button {
  min-width: 84px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
  color: #e5e9f0;
  cursor: pointer;
}

.stats-table-pager button:disabled {
  cursor: default;
  opacity: .4;
}

.dashboard-tab-mobile-controls {
  display: none;
}

.hash-link {
  color: #9ecbff;
  text-decoration: underline;
  text-decoration-color: rgba(158, 203, 255, .45);
  text-underline-offset: 3px;
}

.hash-link:hover {
  color: #d7ebff;
  text-decoration-color: currentColor;
}

.hash-link:focus-visible,
.stats-table-pager button:focus-visible,
.dashboard-tab-mobile-controls button:focus-visible {
  outline: 3px solid rgba(80, 164, 255, .72);
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  .stats-v2-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-tab-mobile-controls {
    display: grid;
    grid-template-columns: minmax(96px, auto) minmax(0, 1fr) minmax(72px, auto);
    gap: 8px;
    align-items: center;
    padding: 8px 0;
  }

  .dashboard-tab-mobile-controls button {
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 10px;
    background: rgba(255, 255, 255, .05);
    color: #e9edf4;
    font: inherit;
    font-weight: 700;
  }

  .dashboard-tab-mobile-controls button:disabled {
    opacity: .42;
  }

  .dashboard-tab-mobile-controls span {
    min-width: 0;
    color: #a9b2c2;
    font-size: 12px;
    line-height: 1.35;
    text-align: center;
  }

  .stats-v2-panel {
    padding: 16px;
  }

  .stats-v2-head {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-context-badges {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .stats-context-badges > span {
    white-space: normal;
  }

  .stats-table-pager {
    justify-content: space-between;
  }

  .stats-v2-availability {
    align-self: flex-start;
    white-space: normal;
  }

  .stats-v2-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #panel-merged .data-table-wrap:has(.stats-card-table),
  #panel-blocks .data-table-wrap:has(.stats-card-table),
  #panel-miners .data-table-wrap:has(.stats-card-table),
  #panel-credits .data-table-wrap:has(.stats-card-table),
  #panel-payouts .data-table-wrap:has(.stats-card-table) {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .stats-card-table {
    display: block;
    min-width: 0 !important;
  }

  .stats-card-table caption {
    display: block;
    padding: 0 0 10px;
    text-align: left;
    white-space: normal;
  }

  .stats-card-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .stats-card-table tbody {
    display: grid;
    gap: 12px;
  }

  .stats-card-table tbody tr {
    display: block;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 14px;
    background: rgba(11, 14, 20, .94);
  }

  .stats-card-table tbody tr[data-stats-page-hidden="true"] {
    display: none !important;
  }

  .stats-card-table tbody td {
    display: grid;
    grid-template-columns: minmax(96px, 38%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    width: auto;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
  }

  .stats-card-table tbody td:last-child {
    border-bottom: 0;
  }

  .stats-card-table tbody td::before {
    content: attr(data-label);
    color: #7f8999;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .stats-card-table tbody td[colspan] {
    display: block;
  }

  .stats-card-table tbody td[colspan]::before {
    content: none;
  }

  .stats-card-table .hash-cell {
    max-width: 100%;
    white-space: normal;
    word-break: break-all;
  }
}

@media (max-width: 390px) {
  .miner-merge-stats > .stats-hashrate-primary,
  .stats-v2-reasons {
    grid-column: auto;
  }

  .stats-v2-grid {
    grid-template-columns: 1fr;
  }

  .stats-card-table tbody td {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stats-v2-panel,
  .stats-card-table tbody tr {
    scroll-behavior: auto;
  }
}
