/* ==========================================================================
   Luckyfastblocks — design system
   Brand: Lucky Services (navy #1B2C7E / cyan #29ABE2), amber for values.
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #070911;
  --bg-glow-a: rgba(41, 171, 226, 0.14);
  --bg-glow-b: rgba(27, 44, 126, 0.18);
  --surface: #0e1220;
  --surface-2: #141a2b;
  --surface-3: #1a2136;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Brand */
  --brand: #29abe2;
  --brand-deep: #1b2c7e;
  --brand-soft: rgba(41, 171, 226, 0.12);

  /* Semantic */
  --amber: #f7b32b;
  --amber-soft: rgba(247, 179, 43, 0.12);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.12);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --violet: #a78bfa;

  /* Text */
  --text: #e8ecf5;
  --text-muted: #8b95ab;
  --text-dim: #5f6980;

  /* Metrics */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3);
  --maxw: 1180px;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* --------------------------------------------------------------- reset -- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 15% -10%, var(--bg-glow-b), transparent 60%),
    radial-gradient(800px 460px at 85% -5%, var(--bg-glow-a), transparent 62%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

a {
  color: var(--brand);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: #7fd0f5; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Numeric text lines up in columns */
.num { font-variant-numeric: tabular-nums; }

.mono {
  font-family: var(--mono);
  font-size: .92em;
  letter-spacing: -0.01em;
}

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* -------------------------------------------------------------- topbar -- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 9, 17, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }

.brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--brand), var(--brand-deep));
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 4px 14px rgba(41, 171, 226, .3);
  flex: none;
}

.brand__name { font-size: 16px; }
.brand__tag {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: -2px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.topnav a {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background .15s ease, color .15s ease;
}
.topnav a:hover { background: var(--surface-2); color: var(--text); }

/* Live indicator */
.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.live__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  flex: none;
}
.live[data-state="online"] { color: var(--green); border-color: rgba(52, 211, 153, .3); }
.live[data-state="online"] .live__dot {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
  animation: pulseDot 2s infinite;
}
.live[data-state="offline"] { color: var(--red); border-color: rgba(248, 113, 113, .3); }
.live[data-state="offline"] .live__dot { background: var(--red); }

@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, .5); }
  70%  { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---------------------------------------------------------------- page -- */
.page { padding-top: 34px; padding-bottom: 60px; }

.section { margin-top: 26px; }
.section--tight { margin-top: 0; }

.section__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.section__title {
  font-size: 17px;
  letter-spacing: -0.01em;
}

.section__meta {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-dim);
}

/* ---------------------------------------------------------------- hero -- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 6px 0 4px;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  border: 1px solid rgba(41, 171, 226, .22);
  color: #7fd0f5;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.hero__title {
  font-size: clamp(28px, 4.4vw, 44px);
  margin: 16px 0 12px;
  letter-spacing: -0.035em;
}

.hero__title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--brand) 10%, #7fd0f5 55%, var(--amber) 105%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 46ch;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.chip svg { flex: none; opacity: .85; }
.chip strong { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------ endpoints -- */
/* minmax(0,…) keeps the nowrap stratum URL from stretching the whole grid */
.endpoints { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }

.endpoint {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.endpoint__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.coin {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #0b0e18;
  flex: none;
}
.coin--btc { background: linear-gradient(140deg, #f7931a, #ffb75e); }
.coin--bch { background: linear-gradient(140deg, #0ac18e, #57e3bd); }

.endpoint__name { font-size: 14.5px; font-weight: 650; }

.endpoint__badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.copyfield {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .3);
  overflow: hidden;
}

.copyfield code {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: #9fe0ff;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.copyfield code::-webkit-scrollbar { display: none; }

.copybtn {
  flex: none;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-muted);
  padding: 0 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.copybtn:hover { background: var(--brand); color: #06121b; }
.copybtn[data-copied="1"] { background: var(--green); color: #06211a; }

/* Standalone copy button (outside a .copyfield) */
.copybtn--inline {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 11px;
  background: var(--surface-2);
  font-size: 11.5px;
}

.endpoint__link {
  display: inline-block;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.endpoint__link:hover { color: var(--brand); }

/* -------------------------------------------------------------- search -- */
.search {
  display: flex;
  gap: 10px;
  margin-top: 26px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.search__field {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.search__field svg {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  pointer-events: none;
}

.search input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, .32);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13.5px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search input::placeholder { color: var(--text-dim); font-family: var(--font); }
.search input:focus {
  outline: none;
  border-color: rgba(41, 171, 226, .55);
  box-shadow: 0 0 0 3px rgba(41, 171, 226, .13);
}

/* -------------------------------------------------------------- button -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(120deg, var(--brand), #1d7fb8);
  color: #04121c;
  box-shadow: 0 6px 18px rgba(41, 171, 226, .28);
}
.btn--primary:hover { color: #04121c; box-shadow: 0 8px 24px rgba(41, 171, 226, .4); }

.btn--ghost {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-muted);
}
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }

/* ----------------------------------------------------------------- KPI -- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.kpi-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* luck pill shown as a KPI value */
.kpi__value .badge {
  font-size: 16px;
  padding: 5px 14px;
  vertical-align: middle;
}

.kpi {
  position: relative;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.kpi::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), transparent 70%);
  opacity: .55;
}
.kpi--amber::after { background: linear-gradient(90deg, var(--amber), transparent 70%); }
.kpi--green::after { background: linear-gradient(90deg, var(--green), transparent 70%); }
.kpi--violet::after { background: linear-gradient(90deg, var(--violet), transparent 70%); }

.kpi__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.kpi__value {
  margin-top: 6px;
  font-size: clamp(21px, 2.6vw, 27px);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  word-break: break-word;
}
.kpi__value .unit {
  font-size: .55em;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 3px;
  letter-spacing: 0;
}

.kpi--amber .kpi__value { color: var(--amber); }
.kpi--green .kpi__value { color: var(--green); }
.kpi--violet .kpi__value { color: var(--violet); }

.kpi__foot { margin-top: 4px; font-size: 12px; color: var(--text-dim); }

/* Value updated flash */
.flash { animation: flashValue 1.1s ease-out; }
@keyframes flashValue {
  0%   { color: #fff; text-shadow: 0 0 14px rgba(127, 208, 245, .8); }
  100% { text-shadow: none; }
}

/* ------------------------------------------------------- hashrate strip -- */
.rate-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.rate {
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .2s ease, transform .2s ease;
}
.rate:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.rate__label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.rate__value {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.rate__value .unit {
  font-size: .6em;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 3px;
}

.rate__bar {
  margin-top: 9px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
}
.rate__bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand));
  transition: width .6s cubic-bezier(.22, 1, .36, 1);
}

/* --------------------------------------------------------------- chart -- */
.chart {
  position: relative;
  width: 100%;
  height: 220px;
  touch-action: pan-y;
}

.chart__svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart__grid {
  stroke: rgba(255, 255, 255, .07);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart__line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.chart__area { stroke: none; }
.chart__stop-top    { stop-color: var(--brand); stop-opacity: .38; }
.chart__stop-bottom { stop-color: var(--brand); stop-opacity: 0; }

.chart__ylabel,
.chart__xlabel {
  fill: var(--text-dim);
  font-family: var(--font);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.chart__cursor {
  stroke: var(--brand);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  /* stroke-opacity, not opacity: the JS toggles the `opacity` attribute to
     show/hide the crosshair, and a CSS `opacity` rule would override it. */
  stroke-opacity: .55;
  vector-effect: non-scaling-stroke;
}

.chart__dot {
  fill: var(--brand);
  stroke: var(--surface);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.chart__dot-static { fill: var(--brand); opacity: .8; }

.chart__tip {
  position: absolute;
  top: 4px;
  left: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
  z-index: 2;
}
.chart__tip.show { opacity: 1; }
.chart__tip b { display: block; color: var(--text); font-variant-numeric: tabular-nums; }
.chart__tip span { color: var(--text-dim); font-size: 11px; }

.chart__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  padding: 0 16px;
}

/* Range toggle */
.rangebtns { display: flex; gap: 2px; padding: 2px; background: var(--surface-2); border-radius: 9px; }

.rangebtn {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.rangebtn:hover { color: var(--text); }
.rangebtn[aria-pressed="true"] { background: var(--surface-3); color: var(--brand); }

/* --------------------------------------------------------------- panel -- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .015);
}

.panel__title {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.panel__count {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.panel__tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.panel__body { padding: 10px; }
.panel__body--flush { padding: 0; }

.btn--block { width: 100%; }

.scroll-y {
  max-height: 430px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.scroll-y::-webkit-scrollbar { width: 8px; }
.scroll-y::-webkit-scrollbar-track { background: transparent; }
.scroll-y::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 4px;
  border: 2px solid var(--surface);
}
.scroll-y::-webkit-scrollbar-thumb:hover { background: #2a3452; }
.scroll-y--short { max-height: 300px; }

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

/* --------------------------------------------------------- leaderboard -- */
.lb-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  transition: background .18s ease;
}
.lb-row + .lb-row { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.lb-row:hover { background: var(--surface-2); }

.rank {
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--surface-3);
  color: var(--text-muted);
}
.rank--1 { background: linear-gradient(140deg, #f7b32b, #ffd97a); color: #3a2a00; }
.rank--2 { background: linear-gradient(140deg, #b6c0d4, #e6ecf7); color: #2a3040; }
.rank--3 { background: linear-gradient(140deg, #c1783c, #e3a869); color: #331c07; }

.lb-row__main { min-width: 0; }

.addr {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.addr:hover { color: var(--brand); }

.lb-row__sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.lb-row__sub b { color: var(--text-muted); font-weight: 600; }

.lb-row__rate {
  text-align: right;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
  white-space: nowrap;
}
.lb-row__rate .unit { font-size: .68em; color: var(--text-muted); margin-left: 2px; }
.lb-row__rate small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* -------------------------------------------------------------- blocks -- */
.block-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  transition: background .18s ease;
}
.block-row + .block-row { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.block-row:hover { background: var(--surface-2); }

.block-row__height {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.block-row__height svg { color: var(--brand); opacity: .8; flex: none; }

.block-row__meta {
  min-width: 0;
  font-size: 12px;
  color: var(--text-dim);
}
.block-row__meta .addr { font-size: 11.5px; color: var(--text-muted); }

/* date · reward · confirmations, separated by dots */
.block-row__facts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.block-row__facts > * + *::before {
  content: '·';
  margin-right: 6px;
  color: var(--text-dim);
  opacity: .6;
}
.block-row__facts .reward { color: var(--amber); font-weight: 600; }

.block-row__right {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.badge {
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge--luck-great { background: var(--green-soft); color: var(--green); border-color: rgba(52, 211, 153, .25); }
.badge--luck-good  { background: var(--brand-soft); color: var(--brand); border-color: rgba(41, 171, 226, .25); }
.badge--luck-ok    { background: var(--amber-soft); color: var(--amber); border-color: rgba(247, 179, 43, .25); }
.badge--luck-bad   { background: var(--red-soft);   color: var(--red);   border-color: rgba(248, 113, 113, .25); }
.badge--muted      { background: var(--surface-3);  color: var(--text-muted); }

.iconlink {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  color: var(--text-dim);
  transition: background .15s ease, color .15s ease;
  flex: none;
}
.iconlink:hover { background: var(--surface-3); color: var(--brand); }

.new-row { animation: newRow 2.2s ease-out; }
@keyframes newRow {
  0%   { background: rgba(247, 179, 43, .18); }
  100% { background: transparent; }
}

/* ---------------------------------------------------------------- logs -- */
.log-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 7px 12px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  transition: background .15s ease;
}
.log-row:hover { background: var(--surface-2); }

.log-row__time { color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

.log-row__tag {
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-family: var(--font);
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--text-dim);
}
.log-row__tag[data-kind="block"]  { background: var(--amber-soft); color: var(--amber); }
.log-row__tag[data-kind="chain"]  { background: var(--brand-soft); color: var(--brand); }
.log-row__tag[data-kind="worker"] { background: var(--green-soft); color: var(--green); }
.log-row__tag[data-kind="error"]  { background: var(--red-soft);   color: var(--red); }

.log-row__msg { overflow-wrap: anywhere; }

/* --------------------------------------------------------- empty state -- */
.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13.5px;
}
.empty svg { display: block; margin: 0 auto 10px; opacity: .35; }
.empty b { display: block; color: var(--text-muted); font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }

/* ---------------------------------------------------------------- CTA --- */
.cta {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(41, 171, 226, .2);
  background:
    radial-gradient(500px 200px at 12% 0%, rgba(41, 171, 226, .13), transparent 70%),
    linear-gradient(160deg, var(--surface-2), var(--surface));
}
.cta__text { flex: 1; min-width: 240px; }
.cta__title { font-size: 17px; }
.cta__sub { margin-top: 4px; color: var(--text-muted); font-size: 14px; }

/* -------------------------------------------------------------- footer -- */
.footer {
  border-top: 1px solid var(--border);
  padding: 26px 0 34px;
  color: var(--text-dim);
  font-size: 13px;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
}
.footer nav { display: flex; flex-wrap: wrap; gap: 16px; margin-left: auto; }
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--brand); }

/* ================================================== miner detail page === */
.miner-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.miner-head__id { min-width: 0; flex: 1; }

.miner-head__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.miner-head__addr {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: clamp(14px, 2.4vw, 19px);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Offline-alerts panel on the miner page */
.connect { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.connect__lead { font-size: 14px; color: var(--text-muted); }
.connect__note { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.connect__note code { color: var(--text-muted); }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

table.data {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

table.data th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  text-align: right;
  padding: 10px 14px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
table.data th:first-child,
table.data td:first-child { text-align: left; }

table.data td {
  padding: 11px 14px;
  text-align: right;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  white-space: nowrap;
}
table.data tbody tr:hover { background: var(--surface-2); }
table.data td:first-child {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.data .dim { color: var(--text-dim); }

.dot-state {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
}
.dot-state--on  { background: var(--green); box-shadow: 0 0 8px rgba(52, 211, 153, .7); }
.dot-state--off { background: var(--text-dim); }

/* ----------------------------------------------------------- not found -- */
.notfound {
  min-height: 68vh;
  display: grid;
  place-items: center;
  text-align: center;
}
.notfound__card {
  max-width: 460px;
  padding: 38px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.notfound__icon {
  width: 54px; height: 54px;
  margin: 0 auto 16px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--amber-soft);
  color: var(--amber);
}
.notfound h1 { font-size: 21px; margin-bottom: 8px; }
.notfound p { color: var(--text-muted); font-size: 14px; margin-bottom: 8px; }
.notfound .addr {
  display: inline-block;
  max-width: 100%;
  margin: 6px 0 20px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--border);
  color: var(--amber);
  white-space: normal;
  overflow-wrap: anywhere;
}
.notfound__hint { font-size: 12.5px; color: var(--text-dim); margin-top: 18px; }

/* ------------------------------------------------------------- toast --- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------- responsive -- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rate-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .shell { padding: 0 14px; }
  .kpi-grid--3 { grid-template-columns: 1fr; }
  .page { padding-top: 24px; padding-bottom: 48px; }
  .topbar__inner { height: 56px; gap: 10px; }
  .brand__tag { display: none; }
  .topnav { gap: 0; }
  .topnav a { padding: 6px 8px; font-size: 12.5px; }
  .topnav a[data-optional] { display: none; }
  .search { flex-direction: column; }
  .search .btn { width: 100%; }
  .rate-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb-row { grid-template-columns: 30px minmax(0, 1fr); row-gap: 6px; }
  .lb-row__rate { grid-column: 2; text-align: left; }
  /* height + luck stay on one line, miner/date wrap underneath */
  .block-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .block-row__height { grid-area: 1 / 1; }
  .block-row__right  { grid-area: 1 / 2; }
  .block-row__meta   { grid-area: 2 / 1 / 3 / -1; }
  .log-row { grid-template-columns: auto auto; justify-content: start; }
  .log-row__tag { justify-self: start; }
  .log-row__msg { grid-column: 1 / -1; }
  .cta { padding: 18px; }
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
