/* P2Pool eCash web UI. No external fonts or requests. */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --border: #e2e6f0;
  --text: #141a2e;
  --muted: #5d6680;
  --accent: #003399;
  --accent-soft: #e6ecfa;
  --star: #ffcc00;
  --pos: #0f8a4a;
  --neg: #c62f3a;
  --warn: #b7791f;
  --row-hover: #f1f4fc;
  --grid: #eceff6;
  --shadow: 0 1px 2px rgba(20, 26, 46, 0.06), 0 4px 16px rgba(20, 26, 46, 0.05);
  --radius: 10px;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0b1020;
    --surface: #121a30;
    --surface-2: #0f1628;
    --border: #243052;
    --text: #e6eaf5;
    --muted: #93a0c0;
    --accent: #6f95ff;
    --accent-soft: #1a2750;
    --pos: #37c47c;
    --neg: #ff6b76;
    --warn: #e8b04b;
    --row-hover: #17213d;
    --grid: #1c2644;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0b1020;
  --surface: #121a30;
  --surface-2: #0f1628;
  --border: #243052;
  --text: #e6eaf5;
  --muted: #93a0c0;
  --accent: #6f95ff;
  --accent-soft: #1a2750;
  --pos: #37c47c;
  --neg: #ff6b76;
  --warn: #e8b04b;
  --row-hover: #17213d;
  --grid: #1c2644;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 16px; }
section[id] { scroll-margin-top: 16px; }

/* Header */
.site-header { background: #003399; color: #fff; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand small { font-weight: 400; opacity: 0.7; font-size: 12px; display: block; letter-spacing: 0; }
.brand .tld { color: var(--star); }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { color: rgba(255, 255, 255, 0.82); padding: 6px 12px; border-radius: 6px; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, 0.1); text-decoration: none; color: #fff; }
.nav a[aria-current='page'] { background: rgba(255, 255, 255, 0.16); color: #fff; }
.header-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: rgba(255, 255, 255, 0.75); }
.theme-btn { background: rgba(255, 255, 255, 0.12); border: 0; color: #fff; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; font-size: 15px; }
.theme-btn:hover { background: rgba(255, 255, 255, 0.2); }

/* Intro */
.intro { padding: 24px 0 8px; }
.intro h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.02em; }
.intro p { margin: 0; color: var(--muted); max-width: 820px; }

/* Section headings */
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 28px 0 10px; }
.section-head h2 { font-size: 16px; margin: 0; }
.section-head .sub { color: var(--muted); font-size: 12px; }
.section-head .spacer { flex: 1; }

/* Controls */
input[type='text'], input[type='search'], select {
  font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 9px; min-width: 0;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button { font: inherit; border: 0; background: var(--surface-2); color: var(--muted); padding: 5px 11px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed='true'] { background: var(--accent); color: #fff; }
.btn {
  font: inherit; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.spacer { flex: 1; }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 16px 0 0; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); min-width: 0;
}
.stat .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.stat .val { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; overflow-wrap: anywhere; }
.stat .sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat.hero { border-top: 3px solid var(--accent); }

/* Reward split bar */
.split { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin-top: 8px; gap: 2px; background: var(--surface); }
.split i { display: block; height: 100%; }
.split .miners { background: var(--accent); }
.split .other { background: var(--border); }

/* Cards and tables */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
th:first-child, td:first-child { text-align: left; }
th.l, td.l { text-align: left; }
thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600;
  background: var(--surface-2); user-select: none;
}
tbody tr:hover { background: var(--row-hover); }
tbody tr.mine { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: 0; }
.rank { color: var(--muted); width: 28px; }
.addr { font: 12px var(--mono); }
.a-short { display: none; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.muted { color: var(--muted); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.num-strong { font-weight: 600; }
.share-bar { display: inline-block; width: 44px; height: 4px; background: var(--border); border-radius: 2px; vertical-align: middle; margin-left: 8px; overflow: hidden; }
.share-bar i { display: block; height: 100%; background: var(--accent); }
.empty, .loading { padding: 28px 16px; text-align: center; color: var(--muted); }
.table-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* Status dot */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.online { background: var(--pos); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pos) 20%, transparent); }
.dot.degraded { background: var(--warn); }
.dot.offline { background: var(--neg); }

/* Connect */
.connect { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.connect .card { padding: 14px 16px; }
.connect h3 { margin: 0 0 8px; font-size: 14px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; align-items: center; }
.kv dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; }
.stratum { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; }
.stratum code { font: 12px var(--mono); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 7px; border-radius: 4px; overflow-wrap: anywhere; }
.copy { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px 5px; border-radius: 4px; font-size: 13px; }
.copy:hover { color: var(--accent); background: var(--accent-soft); }
.copy.done { color: var(--pos); }
.connect ol, .connect ul { margin: 0; padding-left: 18px; color: var(--muted); }
.connect li { margin: 4px 0; }
.connect li b, .connect li code { color: var(--text); }
.connect li code { font: 12px var(--mono); }

/* Chart */
.chart-card { padding: 14px 16px 10px; }
.chart-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 6px; }
.chart-head h3 { margin: 0; font-size: 14px; }
.chart-head .sub { color: var(--muted); font-size: 12px; }
.chart { position: relative; height: 240px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--border); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent); opacity: 0.1; }
.chart .end-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .end-label { fill: var(--text); font-size: 12px; font-weight: 600; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; }
.chart .hover-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.tooltip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 9px; font-size: 12px; box-shadow: var(--shadow); white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px)); z-index: 2;
}
.tooltip .t { color: var(--muted); }
.tooltip .v { display: flex; align-items: center; gap: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tooltip .key { width: 12px; height: 2px; border-radius: 1px; background: var(--accent); }
details.data { margin-top: 6px; font-size: 12px; }
details.data summary { cursor: pointer; color: var(--muted); }
details.data .table-scroll { max-height: 260px; overflow-y: auto; margin-top: 6px; border: 1px solid var(--border); border-radius: 6px; }
details.data th, details.data td { padding: 5px 8px; }

/* Download page */
.dl-card { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; padding: 18px 20px; margin-top: 16px; border-top: 3px solid var(--accent); }
.dl-main { display: flex; flex-direction: column; gap: 6px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px; font: inherit; font-weight: 600; font-size: 15px;
  background: var(--accent); color: #fff !important; border: 0; border-radius: 8px; padding: 11px 18px; cursor: pointer;
}
.btn-primary:hover { text-decoration: none; filter: brightness(1.1); }
.btn-primary .size { font-weight: 400; opacity: 0.8; font-size: 13px; }
.dl-meta { color: var(--muted); font-size: 12px; }
.dl-side { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.dl-side .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.feature h3 { margin: 0 0 4px; font-size: 14px; }
.feature p { margin: 0; color: var(--muted); font-size: 13px; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps > li { counter-increment: step; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 14px 56px; box-shadow: var(--shadow); min-width: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: 16px; top: 14px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.steps h3 { margin: 2px 0 4px; font-size: 14px; }
.steps p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.steps p:last-child { margin-bottom: 0; }
.codeblock { position: relative; margin: 6px 0; }
.codeblock pre {
  margin: 0; font: 12px/1.6 var(--mono); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 40px 10px 12px; overflow-x: auto; white-space: pre;
}
.codeblock .copy { position: absolute; top: 6px; right: 6px; background: var(--surface); }
table.wrap td, table.wrap th { white-space: normal; min-width: 90px; }
table.wrap td:first-child { min-width: 0; white-space: nowrap; }
.btn-primary .size { white-space: nowrap; }
code.inline { white-space: nowrap; font: 12px var(--mono); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 4px; }
.cta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 14px 16px; margin-top: 12px; }
.cta p { margin: 0; color: var(--muted); }
.cta b { color: var(--text); }

/* Notes / footer */
.note { color: var(--muted); font-size: 12px; margin: 12px 2px 32px; }
.site-footer { border-top: 1px solid var(--border); padding: 24px 0 40px; color: var(--muted); font-size: 13px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.error-box { padding: 12px 16px; border: 1px solid var(--neg); color: var(--neg); border-radius: 8px; margin: 16px 0 0; background: var(--surface); }
.warn-box { padding: 12px 16px; border: 1px solid var(--warn); color: var(--text); border-radius: 8px; margin: 16px 0 0; background: var(--surface); }
.warn-box b { color: var(--warn); }

@media (max-width: 1100px) {
  .hide-md { display: none; }
}

@media (max-width: 720px) {
  .site-header .wrap { gap: 8px 16px; padding-top: 8px; padding-bottom: 8px; }
  .header-meta { margin-left: auto; }
  .header-meta .upd { display: none; }
  .nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -8px; }
  .nav a { padding: 6px 10px; white-space: nowrap; }
  .a-full { display: none; }
  .a-short { display: inline; }
  .share-bar { display: none; }
  .btn-primary { width: 100%; justify-content: center; }
  .dl-card { padding: 16px; }
  .intro h1 { font-size: 20px; }
  th, td { padding: 8px 8px; }
  .hide-sm { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 12px; }
  .stat .val { font-size: 18px; }
  .chart { height: 200px; }
}
