:root {
  --bg: #06111f;
  --bg-mid: #0a1a32;
  --panel: #0e1d36;
  --panel-2: #12243f;
  --line: #1e3658;
  --line-strong: #2a4a76;
  --ink: #eef3fb;
  --muted: #8fa3c0;
  --faint: #6b819e;
  --accent: #4d8dff;
  --accent-2: #3b78f0;
  --accent-ink: #ffffff;
  --copy: #3dcc8e;
  --skip: #f07171;
  --caution: #e8b84a;
  --queued: #6ba3e8;
  --fail: #f07171;
  --shadow: 0 12px 40px rgba(2, 8, 22, 0.45);
  --radius: 12px;
  --font: "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 50% -8%, rgba(55, 118, 210, 0.26), transparent 58%),
    radial-gradient(720px 380px at 100% 0%, rgba(24, 72, 150, 0.16), transparent 50%),
    linear-gradient(180deg, #0b1c38 0%, #071424 42%, #050f1c 100%);
  background-attachment: fixed;
}

a {
  color: #8bb4ff;
  text-decoration: none;
}
a:hover { color: #c5d9ff; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1.25rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid rgba(80, 130, 190, 0.16);
  background: rgba(7, 16, 32, 0.82);
  backdrop-filter: blur(18px) saturate(1.15);
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.08rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.brand:hover { color: var(--ink); text-decoration: none; }

.mark {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.4rem;
  background: linear-gradient(145deg, #6aa4ff 0%, #2f6ae8 100%);
  box-shadow: 0 0 0 1px rgba(90, 150, 255, 0.28), 0 6px 14px rgba(24, 70, 170, 0.4);
  position: relative;
}
.mark::before,
.mark::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
}
.mark::before { width: 0.7rem; height: 0.7rem; opacity: 0.85; }
.mark::after {
  width: 0.22rem;
  height: 0.22rem;
  background: #fff;
  border: 0;
}

.tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  flex: 1;
  min-width: 12rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

nav a {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.38rem 0.7rem;
  border-radius: 8px;
}
nav a:hover {
  color: var(--ink);
  background: rgba(77, 141, 255, 0.1);
  text-decoration: none;
}
nav a.is-active {
  color: var(--ink);
  background: rgba(77, 141, 255, 0.16);
}
nav a.nav-logout {
  color: var(--faint);
}

main {
  padding: 1.5rem 1.5rem 4.5rem;
  max-width: 1120px;
  margin: 0 auto;
}

h1 {
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
}
h2 {
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.muted { color: var(--muted); }
.err { color: #ff9a94; }

.page-head {
  margin-bottom: 1rem;
}
.page-head h1 { margin-bottom: 0.25rem; }
.page-head .muted { margin: 0; font-size: 0.9rem; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .tag { flex-basis: 100%; min-width: 0; }
  main { padding: 1.1rem 1rem 4.2rem; }
  .top { padding: 0.8rem 1rem; }
  .bottom { padding: 0.4rem 1rem 0.65rem; }
}

@media (max-width: 640px) {
  .row {
    flex-direction: column;
    align-items: stretch;
  }
  .row button { width: 100%; }
  nav { width: 100%; }
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 32%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: var(--shadow);
}

.panel > .muted:first-of-type { margin-top: 0; }
.panel h1 + .muted,
.panel .lede {
  margin: 0 0 1rem;
  font-size: 0.88rem;
}

.stack { display: flex; flex-direction: column; gap: 1.15rem; margin-top: 1.15rem; }
.follow-panel { margin-top: 1rem; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: #c5d4ea;
}

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0.85rem 0 0.35rem;
}
label:first-child { margin-top: 0; }

input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: rgba(5, 14, 28, 0.72);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font: 15px/1.4 var(--font);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="text"]:hover,
input[type="number"]:hover,
input[type="password"]:hover,
textarea:hover,
select:hover {
  border-color: var(--line-strong);
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 141, 255, 0.22);
}

input[spellcheck="false"],
#solo-address,
#lookup-address,
#bulk-addresses,
textarea:not(.notes) {
  font-family: var(--mono);
  font-size: 0.84rem;
}

textarea { min-height: 8.5rem; resize: vertical; }
textarea.notes {
  min-height: 5.2rem;
  font-family: var(--font);
  font-size: 0.9rem;
}

.row {
  display: flex;
  gap: 0.65rem;
  align-items: end;
  margin-top: 0.85rem;
}
.row > * { flex: 1; }
.row .grow { flex: 3; }
.row button { flex: 0 0 auto; }

button, .btn {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, #5b9aff 0%, var(--accent-2) 100%);
  color: var(--accent-ink);
  font-weight: 650;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 16px rgba(30, 80, 180, 0.28);
  transition: filter 0.12s ease, transform 0.12s ease;
}
button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }

button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
button.secondary:hover {
  filter: none;
  background: rgba(77, 141, 255, 0.1);
  border-color: var(--accent);
}

button:disabled { opacity: 0.5; cursor: wait; filter: none; transform: none; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 16, 32, 0.35);
}

.table-scroll table { margin: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 36rem;
}

th, td {
  text-align: left;
  padding: 0.62rem 0.75rem;
  border-bottom: 1px solid rgba(80, 130, 190, 0.12);
  vertical-align: top;
}

thead th {
  color: var(--faint);
  font-weight: 650;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(10, 24, 48, 0.7);
  position: sticky;
  top: 0;
}

table.bulk-intel-table { min-width: 58rem; }

th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable:hover { color: var(--ink); }
th.sortable.is-sorted { color: var(--ink); }
th.sortable[aria-sort="ascending"]::after { content: " ↑"; font-weight: 700; }
th.sortable[aria-sort="descending"]::after { content: " ↓"; font-weight: 700; }

td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 0.82rem;
  white-space: nowrap;
}

.bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.15rem;
  align-items: end;
  margin: 0 0 0.85rem;
}
.bulk-toolbar label { margin: 0; }
.bulk-toolbar select {
  width: auto;
  min-width: 10.5rem;
}
.bulk-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
  padding-bottom: 0.45rem;
}
.bulk-check input {
  width: auto;
  accent-color: var(--accent);
  cursor: pointer;
}
.bulk-count {
  margin: 0 0 0.45rem auto;
  padding: 0;
  font-size: 0.82rem;
}

.wallets-toolbar input[type="search"] {
  width: min(18rem, 100%);
  min-width: 12rem;
}

.pager {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0.85rem;
}
.pager button {
  min-width: 6.5rem;
}
.pager-page {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.pager-page-label {
  white-space: nowrap;
}
.pager-page-input {
  width: 3.6rem;
  min-width: 3.6rem;
  padding: 0.38rem 0.35rem;
  text-align: center;
}
.pager-page-go {
  min-width: 3.25rem !important;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}

tbody tr:hover td { background: rgba(77, 141, 255, 0.05); }
tbody tr:last-child td { border-bottom: 0; }

.notes-cell {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.84rem;
}

.notes-form { margin: 0 0 1.1rem; }

.wallet-note {
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 16, 32, 0.45);
}
.wallet-note .note-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.wallet-note .note-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.wallet-note .muted { margin: 0.4rem 0 0; font-size: 0.82rem; }

.mono {
  font-family: var(--mono);
  font-size: 0.8rem;
  word-break: break-all;
}

.addr-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem 0.4rem;
  max-width: 100%;
}
.token-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem 0.4rem;
  max-width: 100%;
}
.token-line .token-name {
  font-weight: 600;
}
.token-line .token-mint-short {
  font-size: 0.82em;
  color: var(--muted);
}
.token-line .dex-link {
  width: auto;
  min-width: 1.45rem;
  padding: 0 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.run-id {
  font-size: 0.78em;
  margin-top: 0.15rem;
}
.addr-line .mono {
  margin: 0;
}
.icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(77, 141, 255, 0.08);
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  text-decoration: none;
}
.icon-btn:hover {
  color: var(--ink);
  background: rgba(77, 141, 255, 0.16);
  text-decoration: none;
}
.icon-btn svg {
  width: 0.85rem;
  height: 0.85rem;
  display: block;
}
.icon-btn img {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
  border-radius: 3px;
}
.icon-btn.copied {
  color: var(--copy);
  border-color: rgba(61, 204, 142, 0.4);
}

.bottom {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  padding: 0.45rem 1.5rem 0.7rem;
  pointer-events: none;
}
.sol-price-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 650;
  padding: 0.22rem 0.62rem 0.22rem 0.32rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(7, 16, 32, 0.88);
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.1);
}
.sol-price-pill img {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: block;
}
.sol-price-pill[hidden] { display: none; }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1.2;
  vertical-align: middle;
}

.badge.COPY {
  color: #9ef0c8;
  background: rgba(61, 204, 142, 0.14);
  border-color: rgba(61, 204, 142, 0.32);
}
.badge.SKIP {
  color: #ffb3ae;
  background: rgba(240, 113, 113, 0.14);
  border-color: rgba(240, 113, 113, 0.32);
}
.badge.CAUTION {
  color: #f5d48a;
  background: rgba(232, 184, 74, 0.14);
  border-color: rgba(232, 184, 74, 0.32);
}
.badge.PASS {
  color: #9ef0c8;
  background: rgba(61, 204, 142, 0.14);
  border-color: rgba(61, 204, 142, 0.32);
}
.badge.FAIL {
  color: #ffb3ae;
  background: rgba(240, 113, 113, 0.14);
  border-color: rgba(240, 113, 113, 0.32);
}
.badge.postponed {
  color: #f5d48a;
  background: rgba(232, 184, 74, 0.16);
  border-color: rgba(232, 184, 74, 0.4);
  letter-spacing: 0.03em;
}
.postponed-next { margin-left: 0.4rem; white-space: nowrap; }
.badge.queued,
.badge.running {
  color: #b7d4f7;
  background: rgba(107, 163, 232, 0.14);
  border-color: rgba(107, 163, 232, 0.32);
}
.badge.done {
  color: #9ef0c8;
  background: rgba(61, 204, 142, 0.12);
  border-color: rgba(61, 204, 142, 0.28);
}
.badge.failed {
  color: #ffb3ae;
  background: rgba(240, 113, 113, 0.14);
  border-color: rgba(240, 113, 113, 0.32);
}
.badge.solo,
.badge.bulk {
  color: var(--muted);
  background: rgba(143, 163, 192, 0.1);
  border-color: rgba(143, 163, 192, 0.22);
}
.badge.muted {
  color: var(--faint);
  background: rgba(143, 163, 192, 0.12);
  border-color: rgba(143, 163, 192, 0.28);
  letter-spacing: 0.04em;
}
.badge.fetchcomplete,
.badge.fetchunused {
  color: #9ef0c8;
  background: rgba(61, 204, 142, 0.14);
  border-color: rgba(61, 204, 142, 0.32);
  letter-spacing: 0.04em;
}
.badge.fetchempty,
.badge.fetchtrunc,
.badge.fetchincomplete {
  color: #f5d48a;
  background: rgba(232, 184, 74, 0.16);
  border-color: rgba(232, 184, 74, 0.4);
  letter-spacing: 0.04em;
}

.criteria { min-width: 44rem; }
.criteria td:nth-child(2) { white-space: nowrap; }
.criteria tr.is-muted td { opacity: 0.62; }

.flash { margin: 0.65rem 0 0; font-size: 0.88rem; min-height: 1.2em; }
.flash.ok { color: var(--copy); }

.file {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.file label { margin-top: 0.55rem; }
input[type="file"] {
  width: 100%;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.2rem;
}
input[type="file"]::file-selector-button {
  appearance: none;
  background: rgba(77, 141, 255, 0.12);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  margin-right: 0.65rem;
  font: 600 0.8rem/1.2 var(--font);
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover {
  background: rgba(77, 141, 255, 0.2);
  border-color: var(--accent);
}

.empty {
  text-align: center;
  padding: 1.75rem 1rem;
}
.empty-title {
  margin: 0 0 0.3rem;
  font-weight: 650;
}
.empty .muted { margin: 0; font-size: 0.88rem; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  align-items: center;
  margin: 0 0 0.75rem;
}
.meta-row .when {
  color: var(--muted);
  font-size: 0.85rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0.85rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(80, 130, 190, 0.14);
  color: var(--muted);
  font-size: 0.85rem;
}
.lead { margin: 0.5rem 0 0; }

.intel-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.9rem 0 0;
}
.intel-stat {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
}
.intel-stat.is-emphasis {
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(77, 141, 255, 0.2);
}
.intel-label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 650;
}
.intel-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.25;
}
@media (max-width: 840px) {
  .intel-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.progress {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.15rem 0 0;
}
.progress-caption {
  margin: 0.7rem 0 0.35rem;
  font-size: 0.85rem;
}
.progress-track {
  flex: 1;
  height: 0.55rem;
  min-width: 5.5rem;
  background: rgba(4, 12, 28, 0.95);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2f6ae8 0%, #6aa4ff 100%);
  border-radius: inherit;
  transition: width 0.28s ease;
}
.progress-fill.is-indeterminate {
  width: 34%;
  animation: progress-indeterminate 1.35s ease-in-out infinite;
}
.progress-fraction {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 0.82rem;
  color: var(--ink);
  min-width: 3.6rem;
  text-align: right;
  letter-spacing: 0.01em;
}
.progress.compact {
  margin: 0.4rem 0 0;
  max-width: 12.5rem;
}
.progress.compact .progress-track {
  height: 0.42rem;
  min-width: 4.25rem;
}
.progress.compact .progress-fraction {
  font-size: 0.75rem;
  min-width: 3.1rem;
}

.progress-eta {
  flex: 0 0 auto;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.eta {
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
}

.eta--calculating {
  font-style: italic;
  opacity: 0.85;
}

.queue-job-eta {
  margin-top: 0.25rem;
}

.progress.compact .progress-eta {
  font-size: 0.7rem;
}

@keyframes progress-indeterminate {
  0% { transform: translateX(-130%); }
  100% { transform: translateX(300%); }
}

/* Centered login — same theme, app-like shell */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-page main {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
  padding: 1.5rem 1.25rem 0.35rem;
}
.login-shell {
  width: 100%;
  max-width: 24.5rem;
}
.login-brand {
  text-align: center;
  margin-bottom: 1.35rem;
}
.login-brand .brand {
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}
.login-brand .tag {
  min-width: 0;
  font-size: 0.88rem;
}
.login-card {
  padding: 1.4rem 1.45rem 1.5rem;
}
.login-card h1 {
  font-size: 1.28rem;
  margin-bottom: 0.3rem;
}
.login-card .lede {
  margin-bottom: 1.1rem;
}
.login-card label { margin-top: 0.9rem; }
.login-card input {
  font-size: 16px;
}
.login-card .row {
  margin-top: 1.15rem;
}
.login-card button {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
}
.login-card .err { margin: 0 0 0.85rem; }

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 1.7rem;
  cursor: pointer;
}

.theme-toggle {
  appearance: none;
  background: rgba(77, 141, 255, 0.1);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: none;
  width: 2.05rem;
  height: 2.05rem;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover {
  filter: none;
  background: rgba(77, 141, 255, 0.18);
}
.theme-toggle .theme-icon {
  width: 1rem;
  height: 1rem;
  display: block;
}

.scan-window-panel {
  margin-bottom: 1.15rem;
}
.scan-window-panel .window-fields {
  margin-top: 0;
  max-width: 32rem;
}
.window-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.85rem;
}
.time-combo {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
}
.time-combo input {
  flex: 0 0 4.5rem;
  width: 4.5rem;
}
.time-combo select {
  flex: 1;
  min-width: 0;
}

.rpc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0.15rem;
}
.rpc-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0.18rem 0.5rem 0.18rem 0.28rem;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1.2;
}
.rpc-pill img {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: block;
}
.rpc-pill.green {
  color: #9ef0c8;
  background: rgba(61, 204, 142, 0.14);
  border-color: rgba(61, 204, 142, 0.35);
}
.rpc-pill.yellow {
  color: #f5d48a;
  background: rgba(232, 184, 74, 0.14);
  border-color: rgba(232, 184, 74, 0.35);
}
.rpc-pill.red {
  color: #ffb3ae;
  background: rgba(240, 113, 113, 0.14);
  border-color: rgba(240, 113, 113, 0.35);
}

.threshold-cell {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}
.info-tip {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--muted);
  cursor: help;
  margin-top: 0.12rem;
}
.info-tip svg {
  display: block;
  width: 14px;
  height: 14px;
}

.docs h1 { margin-bottom: 0.5rem; }
.docs h2 {
  margin: 1.4rem 0 0.5rem;
  font-size: 1.02rem;
}
.docs h3 {
  margin: 1rem 0 0.4rem;
  font-size: 0.92rem;
  font-weight: 650;
}
.docs p { margin: 0 0 0.7rem; }
.docs ul { margin: 0 0 0.85rem; padding-left: 1.15rem; color: var(--ink); }
.docs li { margin: 0.2rem 0; }
.docs pre {
  margin: 0 0 0.9rem;
  padding: 0.75rem 0.85rem;
  overflow-x: auto;
  background: rgba(4, 12, 24, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  color: #d5e4f7;
}
.docs .code-label {
  margin: 0.85rem 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}

.rescan-bar {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.rescan-bar .rescan-row { margin-top: 0; }
.rescan-hint { margin: 0.45rem 0 0; font-size: 0.85rem; }

.peer-panel h2 { margin-top: 0; }
.peer-empty { margin: 0.75rem 0 0; }
.peer-table .scan-next-btn {
  padding: 0.38rem 0.7rem;
  font-size: 0.8rem;
  white-space: nowrap;
}
.peer-table td.peer-action { width: 1%; white-space: nowrap; }
.peer-table .mono { font-size: 0.8rem; word-break: break-all; }

.truncation-banner {
  margin: 0.9rem 0 0;
  padding: 0.9rem 1rem 1rem;
  border-radius: 10px;
  border: 2px solid var(--skip);
  background: rgba(240, 113, 113, 0.14);
  box-shadow: 0 0 0 1px rgba(240, 113, 113, 0.25), 0 10px 28px rgba(80, 16, 16, 0.18);
}
.truncation-banner.is-warning {
  border-color: #f07171;
  background: linear-gradient(180deg, rgba(240, 113, 113, 0.22), rgba(240, 113, 113, 0.1));
  color: #ffe8e6;
}
.truncation-kicker {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.truncation-banner p { margin: 0 0 0.5rem; font-size: 0.95rem; line-height: 1.45; }
.truncation-banner p:last-child { margin: 0; }
.truncation-banner strong { color: #fff; }

@media (max-width: 640px) {
  .window-fields { grid-template-columns: 1fr; }
}

.config-form { margin: 0; }
.config-section {
  margin: 1.5rem 0 0.35rem;
  font-size: 1.05rem;
}
.config-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}
.config-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.95rem 1rem 1rem;
  background: rgba(6, 16, 32, 0.28);
  transition: opacity 0.15s ease;
}
.config-card.is-muted {
  opacity: 0.58;
}
.config-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.config-card-head h2 { margin: 0 0 0.3rem; font-size: 0.98rem; }
.config-card-head .muted { margin: 0; font-size: 0.84rem; }
.config-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 1rem;
  margin-top: 0.7rem;
}
.config-field label { margin-top: 0.45rem; }
.config-input {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.config-input input { flex: 1; min-width: 0; }
.field-suffix {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  min-width: 1.8rem;
}
.field-hint { margin: 0.3rem 0 0; font-size: 0.78rem; }
.config-actions { margin-top: 1.1rem; }
.config-actions button { flex: 0 0 auto; }
.config-updates { margin-bottom: 1rem; }
.config-updates-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.config-updates-head .config-section { margin-top: 0; }
.config-updates-head button { flex: 0 0 auto; align-self: center; }
.config-pull-wrap {
  display: inline-flex;
  flex: 0 0 auto;
  align-self: center;
}
button.config-pull-locked:disabled { cursor: not-allowed; }
button.config-pull-locked:disabled:hover {
  background: transparent;
  border-color: var(--line-strong);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
  flex: 0 0 auto;
  margin: 0;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.toggle-track {
  width: 2.35rem;
  height: 1.28rem;
  border-radius: 999px;
  background: rgba(143, 163, 192, 0.18);
  border: 1px solid var(--line-strong);
  position: relative;
  flex: 0 0 auto;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 0.12rem;
  left: 0.12rem;
  width: 0.94rem;
  height: 0.94rem;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.15s ease;
}
.toggle input:checked + .toggle-track {
  background: rgba(232, 184, 74, 0.32);
  border-color: rgba(232, 184, 74, 0.55);
}
.toggle input:checked + .toggle-track::after {
  transform: translateX(1.04rem);
}
.toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .config-fields { grid-template-columns: 1fr; }
  .config-card-head { flex-direction: column; }
}

/* Day / light theme. Night remains the default (`data-theme="night"`). */
html[data-theme="day"] {
  --bg: #f4f7fb;
  --bg-mid: #e8eef7;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --line: #d5deea;
  --line-strong: #b7c6db;
  --ink: #132037;
  --muted: #5b6e88;
  --faint: #7a8ba3;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-ink: #ffffff;
  --copy: #178a58;
  --skip: #c24141;
  --caution: #b45309;
  --queued: #2563eb;
  --fail: #c24141;
  --shadow: 0 10px 28px rgba(30, 50, 80, 0.08);
}

html[data-theme="day"] body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 50% -8%, rgba(37, 99, 235, 0.08), transparent 58%),
    linear-gradient(180deg, #f7f9fc 0%, #eef3f9 42%, #e8eef6 100%);
}

html[data-theme="day"] .top {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: var(--line);
}

html[data-theme="day"] a { color: #1d4ed8; }
html[data-theme="day"] a:hover { color: #1e40af; }
html[data-theme="day"] .err { color: #b42318; }

html[data-theme="day"] .panel {
  background: var(--panel);
}

html[data-theme="day"] input[type="text"],
html[data-theme="day"] input[type="number"],
html[data-theme="day"] input[type="password"],
html[data-theme="day"] textarea,
html[data-theme="day"] select {
  background: #fff;
  color: var(--ink);
}

html[data-theme="day"] .table-scroll {
  background: #fff;
}

html[data-theme="day"] thead th {
  background: #f3f6fb;
}

html[data-theme="day"] th.sortable:hover,
html[data-theme="day"] th.sortable.is-sorted {
  color: var(--ink);
}

html[data-theme="day"] tbody tr:hover td { background: rgba(37, 99, 235, 0.05); }

html[data-theme="day"] .wallet-note {
  background: #f3f6fb;
}

html[data-theme="day"] code { color: #1e3a5f; }

html[data-theme="day"] .docs pre {
  background: #f3f6fb;
  color: #132037;
}

html[data-theme="day"] .progress-track {
  background: #e8eef7;
}

html[data-theme="day"] .badge.COPY,
html[data-theme="day"] .badge.PASS,
html[data-theme="day"] .badge.done {
  color: #0f7a4d;
  background: rgba(23, 138, 88, 0.12);
  border-color: rgba(23, 138, 88, 0.32);
}
html[data-theme="day"] .badge.SKIP,
html[data-theme="day"] .badge.FAIL,
html[data-theme="day"] .badge.failed {
  color: #b42318;
  background: rgba(194, 65, 65, 0.1);
  border-color: rgba(194, 65, 65, 0.28);
}
html[data-theme="day"] .badge.postponed {
  color: #9a4d0a;
  background: rgba(180, 83, 9, 0.1);
  border-color: rgba(180, 83, 9, 0.28);
  letter-spacing: 0.03em;
}
html[data-theme="day"] .badge.CAUTION {
  color: #9a4d0a;
  background: rgba(180, 83, 9, 0.1);
  border-color: rgba(180, 83, 9, 0.28);
}
html[data-theme="day"] .badge.fetchcomplete,
html[data-theme="day"] .badge.fetchunused {
  color: #0f7a4d;
  background: rgba(23, 138, 88, 0.12);
  border-color: rgba(23, 138, 88, 0.32);
}
html[data-theme="day"] .badge.fetchempty,
html[data-theme="day"] .badge.fetchtrunc,
html[data-theme="day"] .badge.fetchincomplete {
  color: #9a4d0a;
  background: rgba(180, 83, 9, 0.1);
  border-color: rgba(180, 83, 9, 0.28);
}
html[data-theme="day"] .badge.muted {
  color: #5b6b82;
  background: rgba(91, 107, 130, 0.1);
  border-color: rgba(91, 107, 130, 0.24);
}
html[data-theme="day"] .flash.ok { color: #0f7a4d; }
html[data-theme="day"] .config-card {
  background: #fff;
}
html[data-theme="day"] .toggle-track {
  background: #e8eef7;
}
html[data-theme="day"] .toggle-track::after {
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
}
html[data-theme="day"] .config-card.is-muted {
  opacity: 0.72;
}
html[data-theme="day"] .rpc-pill.green {
  color: #0f7a4d;
  background: rgba(23, 138, 88, 0.12);
  border-color: rgba(23, 138, 88, 0.32);
}
html[data-theme="day"] .rpc-pill.yellow {
  color: #9a4d0a;
  background: rgba(180, 83, 9, 0.1);
  border-color: rgba(180, 83, 9, 0.28);
}
html[data-theme="day"] .rpc-pill.red {
  color: #b42318;
  background: rgba(194, 65, 65, 0.1);
  border-color: rgba(194, 65, 65, 0.28);
}
html[data-theme="day"] .icon-btn {
  background: rgba(37, 99, 235, 0.06);
}
html[data-theme="day"] .icon-btn:hover {
  background: rgba(37, 99, 235, 0.12);
}
html[data-theme="day"] .intel-stat {
  background: #fff;
}
html[data-theme="day"] .truncation-banner.is-warning {
  background: linear-gradient(180deg, #fff1f0, #ffe4e1);
  border-color: #c24141;
  color: #7a1515;
  box-shadow: 0 0 0 1px rgba(194, 65, 65, 0.18);
}
html[data-theme="day"] .truncation-banner strong { color: inherit; }
html[data-theme="day"] .sol-price-pill {
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--line);
}

@media (prefers-reduced-motion: reduce) {
  button, input, textarea, select, .progress-fill, .toggle-track, .toggle-track::after { transition: none; }
  .progress-fill.is-indeterminate {
    animation: none;
    width: 100%;
    opacity: 0.4;
  }
}

.active-job-panel {
  margin-bottom: 1rem;
}
.active-job-panel.is-idle {
  border-color: var(--line);
}
.active-job-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}
.active-job-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.active-job-detail {
  margin: 0.35rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.active-job-meta {
  margin: 0;
}
.active-job-lane .badge {
  vertical-align: middle;
}
.active-job-head-actions {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.active-job-queue-link {
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
}
.active-job-queue-link:hover {
  text-decoration: underline;
}
.active-job-panel--linkable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.active-job-panel--linkable:hover,
.active-job-panel--linkable:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
  outline: none;
}

.queue-foot {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}
.queue-active-panel h2,
.queue-lanes-panel h2 {
  margin-top: 0;
  font-size: 1.05rem;
}
.queue-active-panel--busy {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 8%, var(--panel)) 0%,
    var(--panel) 55%
  );
}
.queue-active-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.queue-active-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.queue-active-type {
  font-weight: 600;
}
.queue-active-detail {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.queue-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}
@media (max-width: 900px) {
  .queue-lanes {
    grid-template-columns: 1fr;
  }
}
.queue-lane {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem;
  background: var(--panel-2);
  min-height: 8rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.queue-lane.is-empty {
  opacity: 0.72;
}
.queue-lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.queue-lane-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 18%, var(--panel));
  color: var(--text);
}
.queue-lane-hint {
  margin: 0;
  font-size: 0.82rem;
}
.queue-lane-empty {
  margin: auto 0 0;
  font-size: 0.88rem;
}
.queue-lane-jobs {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.35rem;
}
.queue-job-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: var(--panel);
}
.queue-job-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}
.queue-job-detail {
  margin-top: 0.25rem;
  font-size: 0.92rem;
}
.queue-job-meta,
.queue-job-when {
  margin-top: 0.2rem;
  font-size: 0.82rem;
}
