:root {
  color-scheme: light;
  --bg: #f5f7f8; --surface: #fff; --surface-soft: #f8fafb;
  --text: #192d38; --muted: #60747e; --border: #dce5e9;
  --accent: #087f73; --accent-soft: #e7f5f1; --accent-text: #08695e;
  --orange: #a75a19; --orange-soft: #fff1df; --focus: #1aa491;
  --danger: #a63838; --danger-bg: #fff0ef;
  --shadow: 0 8px 32px rgb(27 51 66 / 4%);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; transition: background-color .2s, color .2s; }
body.dark-mode {
  color-scheme: dark;
  --bg: #101a20; --surface: #18252d; --surface-soft: #1c2c35;
  --text: #e9f1f4; --muted: #a3b5bf; --border: #32444e;
  --accent: #67d9bd; --accent-soft: #203e38; --accent-text: #85e7ce;
  --orange: #f4bc7e; --orange-soft: #3b3028; --focus: #67d9bd;
  --danger: #ffb0a9; --danger-bg: #3b2629;
  --shadow: 0 8px 32px rgb(0 0 0 / 12%);
}
[hidden] { display: none !important; }
a { color: var(--accent-text); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; }
button, summary, input[type=checkbox] { cursor: pointer; }
button { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.shell { width: calc(100% - 64px); margin: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); font-weight: 750; text-decoration: none; letter-spacing: -.3px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); font-weight: 850; }
.theme-control { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); cursor: pointer; }
.switch { display: inline-flex; position: relative; width: 42px; height: 25px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; z-index: 1; }
.slider { width: 100%; border: 1px solid var(--border); border-radius: 20px; background: var(--surface-soft); }
.slider:before { content: ''; position: absolute; top: 5px; left: 5px; width: 15px; height: 15px; border-radius: 50%; background: var(--muted); transition: transform .2s; }
.switch input:checked + .slider:before { transform: translateX(17px); background: var(--accent); }
.switch input:focus-visible + .slider { outline: 3px solid var(--focus); outline-offset: 3px; }
.hero { padding: 44px 0 30px; max-width: 780px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--accent-text); text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 750; }
.network-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
h1 { font-size: clamp(30px, 4.2vw, 48px); line-height: 1.15; letter-spacing: -.045em; margin: 0 0 16px; font-weight: 750; }
.hero p:last-child { font-size: 17px; color: var(--muted); margin: 0; max-width: 650px; }
h2, h3, p { margin-top: 0; }
h2 { font-size: 19px; letter-spacing: -.025em; margin-bottom: 4px; }
h3 { font-size: 16px; letter-spacing: -.015em; margin-bottom: 4px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); min-width: 0; }
.setup { padding: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.section-heading p, .helper { color: var(--muted); font-size: 13px; margin: 0; }
.badge { border: 1px solid var(--border); border-radius: 20px; padding: 4px 10px; font-size: 11px; color: var(--muted); font-weight: 650; }
.context-grid { display: grid; grid-template-columns: minmax(0, 1fr) 170px 160px; gap: 18px; padding-bottom: 26px; border-bottom: 1px solid var(--border); }
.field { min-width: 0; }
label.field-label { display: block; font-size: 13px; font-weight: 650; margin-bottom: 8px; }
input[type=text], input[type=number], select { display: block; width: 100%; min-width: 0; height: 46px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); color: var(--text); transition: border-color .2s, box-shadow .2s; }
input::placeholder { color: var(--muted); opacity: .9; }
input[type=text] { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 12px; }
input:hover, select:hover { border-color: var(--muted); }
input:focus, select:focus { border-color: var(--accent); }
.field .helper { display: block; margin-top: 7px; font-size: 12px; }
.epoch-stepper { display: flex; gap: 4px; }
.epoch-stepper input { text-align: center; padding: 6px; appearance: textfield; }
.epoch-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.epoch-stepper button { width: 34px; flex: 0 0 34px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface-soft); font-size: 18px; }
.validator-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin: 26px 0; }
.validator { border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.validator-title { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.validator-title h3 { margin: 0; }
.number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--orange-soft); color: var(--orange); font-size: 12px; font-weight: 750; }
.second .number { background: var(--accent-soft); color: var(--accent-text); }
.validator-bottom { display: flex; align-items: end; gap: 20px; justify-content: space-between; margin-top: 18px; }
.fee { width: 110px; flex-shrink: 0; }
.directory-link { font-size: 12px; padding-bottom: 12px; }
details.advanced { border-top: 1px solid var(--border); padding: 18px 0; }
summary { color: var(--muted); font-size: 13px; font-weight: 600; }
details[open] summary { margin-bottom: 18px; color: var(--text); }
.advanced-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 16px 0 10px; }
.actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding-top: 20px; border-top: 1px solid var(--border); }
.check-label { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 11px 24px; border-radius: 9px; border: 0; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; }
body.dark-mode .primary { color: #102b26; }
.primary:hover { filter: brightness(.92); }
button:disabled, .setup input:disabled, .setup select:disabled { cursor: wait; opacity: .65; }
.primary[aria-busy=true]:before, .spinner { content: ''; width: 19px; height: 19px; flex-shrink: 0; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .85s linear infinite; }
.loader { display: none; align-items: center; justify-content: center; gap: 10px; min-height: 110px; padding: 22px; color: var(--accent-text); font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }
.info-box, .warning-box { padding: 14px 18px; border: 1px solid var(--border); border-radius: 10px; margin: 20px 0; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.info-box { background: var(--accent-soft); color: var(--accent-text); }
.warning-box { background: var(--danger-bg); color: var(--danger); }
.disclaimer { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 16px 0 0; }
.empty-state { text-align: center; border: 1px dashed var(--border); border-radius: 16px; margin: 28px 0; padding: 35px 20px; color: var(--muted); }
.empty-state h2 { color: var(--text); font-size: 17px; }
.empty-state p { margin: 4px 0 0; font-size: 13px; }
.results { margin-top: 32px; }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.results-grid > .result-panel:nth-child(even) .number { background: var(--accent-soft); color: var(--accent-text); }
.result-panel { overflow: hidden; margin-bottom: 20px; }
.panel-heading { padding: 20px 22px 16px; display: flex; align-items: center; gap: 10px; }
.panel-heading h3 { margin: 0; }
.table-container { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
th { background: var(--surface-soft); color: var(--muted); font-size: 10px; letter-spacing: .03em; font-weight: 650; text-transform: uppercase; text-align: left; }
td, th { padding: 13px 16px; border-top: 1px solid var(--border); }
tbody tr:hover, tr:hover td { background: var(--surface-soft); }
table input[type=checkbox] { width: 13px; height: 13px; }
tr.delegate-row td { background: var(--accent-soft); }
.copy-emoji { cursor: pointer; }
.chart-panel { padding: 22px; margin-bottom: 20px; }
.chart-container { display: none; position: relative; height: 390px; width: 100%; min-width: 0; }
.chart-container canvas { max-width: 100%; }
.chart-panel h3 { margin-bottom: 4px; }
.chart-panel .helper { margin-bottom: 18px; }
.footer { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; border-top: 1px solid var(--border); margin-top: 38px; padding: 22px 0 32px; color: var(--muted); font-size: 12px; }
.footer p { margin: 0; }
.support { margin-top: 18px; color: var(--muted); font-size: 12px; }
.support summary { font-size: 12px; }
.support-body { padding: 16px 0; overflow-wrap: anywhere; }
.support-body img { display: block; width: 128px; margin: 12px 0; border-radius: 8px; }
@media (max-width: 900px) { .context-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .wallet-field { grid-column: 1 / -1; } .results-grid { grid-template-columns: minmax(0, 1fr); gap: 0; } }
@media (max-width: 620px) {
  .shell { width: calc(100% - 28px); } .topbar { padding: 18px 0; } .hero { padding: 30px 0 24px; }
  .hero p:last-child { font-size: 15px; } .setup { padding: 18px; } .validator-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .validator { padding: 16px; } .context-grid { gap: 14px; } .section-heading { gap: 8px; }
  .field input, .field select { font-size: 16px; }
  .advanced-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; } .actions { align-items: stretch; } .primary { width: 100%; }
  .chart-panel { padding: 16px 10px; } .chart-container { height: 420px; } .panel-heading { padding: 16px; }
  td, th { padding: 12px; } .badge { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *:before { animation-duration: 2s !important; transition: none !important; } }
