:root {
  --bg: #111111;
  --panel: #161616;
  --hover: #1c1c1c;
  --active: #1f1f1f;
  --ink: #e4e4e4;
  --muted: #737373;
  --line: #2a2a2a;
  --ok: #a3e635;
  --pend: #d4a017;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
}

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.brand {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 3px;
  border-radius: 1px;
  background: var(--ok);
  vertical-align: 0.05em;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
}

.meta-n {
  color: var(--ink);
}

.meta-n.ok {
  color: var(--ok);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.controls-row {
  display: grid;
  gap: 8px;
  align-items: stretch;
  width: 100%;
}

.scan-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.filter-row {
  grid-template-columns: 148px minmax(0, 1fr) 128px auto auto;
  align-items: center;
}

#exportMode {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  max-width: 140px;
}

.st.pending {
  color: var(--pend);
}

.st.claimable {
  color: var(--ok);
}

.st.soon {
  color: #eab308;
}

.st.pending-xfer {
  color: #38bdf8;
}

.controls-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-shrink: 0;
}

#target,
#search,
#filter,
#levelFilter,
.btn,
.file-btn {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

#target,
#search {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  font-family: var(--mono);
}

#target::placeholder,
#search::placeholder {
  color: #555;
  font-family: var(--sans);
}

#filter,
#levelFilter {
  width: 100%;
  padding: 0 10px;
  cursor: pointer;
}

#target:focus,
#search:focus,
#filter:focus,
#levelFilter:focus {
  outline: 1px solid #404040;
  outline-offset: 0;
}

.btn,
.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
  background: transparent;
}

.btn.primary {
  background: #1c1c1c;
}

.btn.sm {
  height: 28px;
  font-size: 11px;
  padding: 0 10px;
  background: transparent;
}

.controls-actions .btn.sm {
  margin-left: 0;
  height: 34px;
  font-size: 12px;
  padding: 0 12px;
}

.pager-btn.btn.sm {
  margin-left: 0;
}

.btn.icon-btn {
  width: 28px;
  min-width: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn .ico {
  width: 14px;
  height: 14px;
  display: block;
}

.btn:hover:not(:disabled),
.file-btn:hover {
  border-color: #525252;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.file-name {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-msg {
  margin: 0;
  min-height: 0;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
}

.scan-msg:empty {
  display: none;
}

.scan-msg.err {
  color: #f87171;
}

/* Dual-phase scan progress (variant D) */
.prog {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.prog strong {
  color: var(--ink);
  font-weight: 500;
}

.prog-track {
  height: 2px;
  background: var(--line);
  border-radius: 1px;
  overflow: hidden;
}

.prog-fill {
  height: 100%;
  width: 0%;
  background: var(--ok);
  border-radius: 1px;
  transition: width 0.35s linear;
}

.prog-fill.warn {
  background: var(--pend);
}

.prog-d {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.prog-d[hidden] {
  display: none;
}

.prog-d-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.prog-d-phase {
  color: var(--pend);
}

.prog-d-rates {
  font-size: 12px;
  color: #444;
  font-variant-numeric: tabular-nums;
}

.prog-d-meters {
  display: grid;
  gap: 6px;
}

.prog-d-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.prog-d-line .lbl {
  color: #555;
  font-size: 11px;
}

.prog-d-line .pct {
  text-align: right;
  color: var(--ink);
  font-size: 11px;
}

.prog-d-cur {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prog-d-workers {
  margin-left: 10px;
  color: #555;
  font-size: 11px;
}

.prog-d-active {
  display: grid;
  gap: 2px;
  font-size: 11px;
  color: #555;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  max-height: 7.5em;
  overflow: auto;
}

.prog-d-active[hidden] {
  display: none;
}

.prog-d-active .row {
  display: grid;
  grid-template-columns: 7.5em minmax(0, 1fr) 2.5em;
  gap: 8px;
}

.prog-d-active .row .ph {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #666;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 4px;
  overflow: hidden;
}

.panel-body {
  display: flex;
  align-items: stretch;
  min-height: 0;
}

.table-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.table-scroll {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: min(72vh, 760px);
  position: relative;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: #141414;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

.pager-nav {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: #1a1a1a;
}

.pager-label {
  padding: 0 12px;
  min-width: 9.5em;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-variant-numeric: tabular-nums;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--ink);
  white-space: nowrap;
}

.pager .btn.sm.pager-btn {
  margin-left: 0;
  min-width: 2rem;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 0;
  background: transparent;
}

.pager .btn.sm.pager-btn:hover:not(:disabled) {
  background: #222;
  border-color: transparent;
}

table.feed {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}

.feed th,
.feed td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.feed th {
  position: sticky;
  top: 0;
  background: #1a1a1a;
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  font-family: var(--sans);
  z-index: 1;
  white-space: nowrap;
}

.feed th.sortable {
  cursor: pointer;
  user-select: none;
}

.feed th.sortable:hover,
.feed th.sortable.on {
  color: var(--ink);
}

.feed th:nth-child(1),
.feed td:nth-child(1) {
  width: 11%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.feed th:nth-child(2),
.feed td:nth-child(2),
.feed th:nth-child(3),
.feed td:nth-child(3) {
  width: 10%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed th:nth-child(4),
.feed td:nth-child(4) {
  width: 8%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed th:nth-child(5),
.feed td:nth-child(5) {
  width: 14%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed th:nth-child(6),
.feed td:nth-child(6) {
  width: 30%;
}

.feed th:nth-child(7),
.feed td:nth-child(7) {
  width: 7%;
  white-space: nowrap;
}

.feed th:nth-child(8),
.feed td:nth-child(8) {
  width: 10%;
  white-space: nowrap;
}

.feed td.to {
  color: var(--muted);
}

.feed td.amt {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}

.feed td.usd {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.feed td.row-actions {
  width: 36px;
  text-align: right;
  padding-right: 8px;
}

.feed .row-del {
  opacity: 0.45;
}
.feed tr:hover .row-del,
.feed tr.active .row-del {
  opacity: 1;
}

.feed tbody tr {
  cursor: pointer;
}

.feed tbody tr:hover {
  background: var(--hover);
}

.feed tbody tr.active {
  background: color-mix(in srgb, var(--ok) 10%, var(--active));
}

.feed tbody tr.active td {
  box-shadow: none;
}

.feed td.usd.pos {
  color: var(--ok);
}

.st {
  color: var(--muted);
  font-size: 11px;
  font-family: var(--sans);
}

.st.hit {
  color: var(--ok);
}

.st.pending {
  color: var(--pend);
}

.st.fail {
  color: #f87171;
}

.empty-msg {
  margin: 0;
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
  animation: detail-fade 0.14s ease-out;
}

.detail-backdrop[hidden] {
  display: none;
}

@keyframes detail-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.detail {
  width: min(560px, 100%);
  max-height: min(82vh, 740px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  background: #171717;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.5);
  text-align: left;
  animation: detail-pop 0.16s ease-out;
}

@keyframes detail-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.detail-empty {
  margin: 0;
  padding: 20px 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.detail-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  padding: 14px 16px 12px;
  flex-wrap: wrap;
  text-align: left;
  background: #171717;
  border-bottom: 1px solid var(--line);
}

.detail-head .kind {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
  line-height: 1.45;
  padding-top: 2px;
}
.detail-head .kind.hit {
  color: var(--ok);
}
.detail-head .kind.pending {
  color: var(--pend);
}
.detail-head .kind.fail {
  color: #f87171;
}

.detail-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--mono);
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  padding-top: 1px;
}

.detail-head .detail-actions {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
  margin-left: auto;
}

.detail-head .detail-actions .btn {
  margin-left: 0;
  color: var(--muted);
}
.detail-head .detail-actions .btn:hover:not(:disabled) {
  color: var(--ink);
}

.detail > .kv {
  padding: 4px 16px 16px;
}

.detail-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--line);
  background: #171717;
  position: sticky;
  top: 53px;
  z-index: 1;
}

.detail-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  margin: 0 0 -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}

.detail-tab:hover {
  color: var(--ink);
}

.detail-tab.on {
  color: var(--ink);
  border-bottom-color: var(--pend);
}

.detail-panel {
  padding: 4px 0 12px;
}

.detail-panel > .kv {
  padding: 4px 16px 8px;
}

.detail-tip {
  margin: 0;
  padding: 8px 16px 4px;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--sans);
  line-height: 1.4;
}

.xfer-dest {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 16px 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121212;
}

.xfer-dest-k {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--sans);
  text-transform: lowercase;
}

.xfer-dest-in {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
}

.action-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px 4px;
}

.action-pick {
  appearance: none;
  border: 1px solid var(--line);
  background: #121212;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.action-pick:hover {
  color: var(--ink);
  border-color: #404040;
}

.action-pick.on {
  color: var(--ink);
  border-color: var(--pend);
  background: #1c1c14;
}

.action-card {
  padding: 4px 16px 16px;
}

.action-fn {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--ok);
  margin: 8px 0 2px;
  word-break: break-word;
}

.action-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--sans);
}

.action-card .kv {
  margin: 0;
}

.action-data {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.action-data-h {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  margin-bottom: 6px;
}

.action-data-h .btn {
  flex: 0 0 auto;
}

.action-data-v {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.45;
  cursor: pointer;
}

.action-data-v:hover {
  color: #f0f0f0;
}

.st.pending-xfer {
  color: var(--pend);
}

.kv {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 0;
  width: 100%;
  font-family: var(--mono);
  font-size: 12px;
  text-align: left;
}

.kv-row {
  display: contents;
}

.kv-k,
.kv-v {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.kv-k {
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 400;
}

.kv-v {
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

.kv-v.copy {
  cursor: inherit;
}

.kv-v.copy:hover {
  color: #f0f0f0;
}

@media (max-width: 900px) {
  .detail {
    width: min(100%, 480px);
  }
}

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

  .scan-row,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .controls-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .controls-actions .btn,
  .controls-actions .file-btn {
    width: 100%;
  }

  .detail-backdrop {
    padding: 12px;
    align-items: flex-end;
  }

  .detail {
    width: 100%;
    max-height: min(88vh, 720px);
    border-radius: 8px 8px 4px 4px;
  }
}

/* Settings — same controls / panel language as main */
a,
.nav-link {
  color: var(--ink);
  text-decoration: none;
}
a:hover,
.nav-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
button.nav-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
}
button.nav-btn:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.meta a,
.meta .nav-link {
  color: var(--ink);
}
.meta a:hover,
.meta .nav-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.brand-link {
  color: inherit;
  text-decoration: none;
}
.brand-link:hover {
  text-decoration: none;
  color: var(--ink);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-msg {
  margin: -6px 0 12px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line));
  border-radius: 4px;
  background: #1a1a1a;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.err {
  color: #f87171;
  border-color: #3f2a2a;
}

.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.settings-block {
  padding: 14px 14px 16px;
  border-bottom: 1px solid var(--line);
}
.settings-block:last-child {
  border-bottom: none;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.settings-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.settings-head .btn.sm {
  margin-left: 0;
  flex-shrink: 0;
}

.settings-head-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ankr-row {
  grid-template-columns: minmax(0, 1fr) 148px 88px auto;
  align-items: center;
}

#ankrCheckBtn {
  color: var(--muted);
  height: 34px;
  width: 34px;
  min-width: 34px;
}
#ankrCheckBtn:hover:not(:disabled) {
  color: var(--ink);
}

.tg-row {
  grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.6fr) 80px;
  align-items: center;
}

.sink-row {
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}

.proxy-toggles {
  display: flex;
  gap: 14px;
  align-items: center;
}

.proxy-row {
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
}

.proxy-row .controls-actions {
  justify-self: end;
}

.proxy-status {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
  font-size: 12px;
  position: relative;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.switch-ui {
  position: relative;
  width: 28px;
  height: 16px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.12s ease, background 0.12s ease;
}
.switch input:checked + .switch-ui {
  border-color: color-mix(in srgb, var(--ok) 45%, #2a2a2a);
  background: color-mix(in srgb, var(--ok) 12%, #1c1c1c);
}
.switch input:checked + .switch-ui::after {
  transform: translateX(12px);
  background: var(--ok);
}
.switch:hover .switch-ui {
  border-color: #525252;
}
.switch-label {
  line-height: 1;
}

/* chains table — own columns, don't inherit results-feed widths */
.settings-panel .table-scroll {
  overflow-x: auto;
  max-height: none;
}

table.feed.chains {
  table-layout: auto;
  width: 100%;
}

.chains th,
.chains td {
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  width: auto !important;
  color: inherit;
  font-variant-numeric: normal;
  vertical-align: middle;
}

.chains th.col-on,
.chains td.col-on {
  width: 40px !important;
  padding-right: 4px;
  text-align: center;
}
.chains td.col-on .switch {
  justify-content: center;
}

.chains th.col-actions,
.chains td.col-actions {
  width: 40px !important;
  text-align: right;
  padding-right: 10px;
}

.chains tr.off td:not(.col-on):not(.col-actions) {
  color: var(--muted);
  opacity: 0.55;
}

.chains td.small {
  font-size: 11px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.chains .chain-cell {
  width: 100%;
  min-width: 0;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  padding: 0 6px;
}

.chains .chain-cell:hover,
.chains .chain-cell:focus {
  border-color: var(--line);
  background: var(--panel);
  outline: none;
}

.chains input.chain-cell[data-field="chainId"] {
  width: 72px;
  font-variant-numeric: tabular-nums;
}

.chains input.chain-cell[data-field="ankr"],
.chains input.chain-cell[data-field="debank"] {
  width: 72px;
}

.chains select.chain-cell[data-field="rpcMode"] {
  width: 72px;
  cursor: pointer;
}

.chains input.chain-rpcs {
  min-width: 160px;
  max-width: 360px;
  font-family: var(--mono);
  font-size: 11px;
}

.chains .row-del {
  opacity: 0.55;
}
.chains tr:hover .row-del {
  opacity: 1;
}

.settings-add-row {
  margin-top: 10px;
  grid-template-columns: 1fr 88px 72px 72px 72px minmax(0, 1.4fr) auto;
}

#ankrApiKey,
#ankrPlan,
#rpcRps,
#newRpcMode,
#transferSink,
.tg-row input,
.sink-row input,
.settings-add-row input,
.settings-add-row select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-family: var(--mono);
  padding: 0 12px;
  width: 100%;
  min-width: 0;
}

.settings-add-row input,
.settings-add-row select {
  background: var(--bg);
}

#ankrApiKey::placeholder,
#transferSink::placeholder,
.tg-row input::placeholder,
.sink-row input::placeholder,
.settings-add-row input::placeholder {
  color: #555;
  font-family: var(--sans);
}

#ankrPlan,
#newRpcMode {
  cursor: pointer;
  padding: 0 10px;
}

.mono {
  font-family: var(--mono);
}

.danger-btn {
  min-width: 28px;
  height: 28px;
  line-height: 1;
}

/* —— live console —— */
.nav-current {
  color: var(--ink);
}

.console-filter-row {
  grid-template-columns: 128px minmax(0, 1fr) auto;
}

.console-scroll {
  max-height: min(72vh, 760px);
}

.console-log {
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink);
}

.console-line {
  display: grid;
  grid-template-columns: 92px 52px minmax(0, 1fr);
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px solid transparent;
  align-items: start;
}

.console-line:hover {
  background: var(--hover);
}

.console-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.console-lvl {
  color: var(--muted);
  text-transform: lowercase;
  font-size: 11px;
  padding-top: 1px;
}

.console-text {
  min-width: 0;
  word-break: break-word;
  white-space: pre-wrap;
}

.console-line.lv-error .console-lvl,
.console-line.lv-error .console-text {
  color: #f87171;
}

.console-line.lv-http .console-lvl {
  color: var(--ok);
}

.console-line.lv-rpc .console-lvl {
  color: var(--ink);
}

.console-line.lv-info .console-lvl {
  color: var(--pend);
}

.console-scroll:has(.console-line) .empty-msg {
  display: none;
}

@media (max-width: 900px) {
  .ankr-row,
  .tg-row,
  .sink-row,
  .proxy-row {
    grid-template-columns: 1fr;
  }
  .proxy-row .controls-actions {
    justify-self: stretch;
  }
  .settings-add-row {
    grid-template-columns: 1fr 1fr;
  }
  .settings-add-row .btn {
    grid-column: 1 / -1;
  }
  .console-filter-row {
    grid-template-columns: 1fr;
  }
  .console-line {
    grid-template-columns: 72px 40px minmax(0, 1fr);
    gap: 6px;
    padding: 5px 10px;
    font-size: 11px;
  }
}

/* —— login —— */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-box {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-box .brand {
  margin: 0 0 6px;
  text-align: center;
}

#stepCode {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#stepSend[hidden],
#stepCode[hidden] {
  display: none !important;
}

.login-row {
  grid-template-columns: 1fr;
}

.login-row input {
  height: 34px;
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  text-align: center;
}

.login-row input::placeholder {
  color: #555;
  font-family: var(--sans);
  letter-spacing: 0;
}

.login-row input:focus {
  outline: 1px solid #404040;
  outline-offset: 0;
}

.login-row input.login-bad {
  border-color: #7f1d1d;
  outline-color: #7f1d1d;
}

.login-actions {
  width: 100%;
}

.login-actions .btn {
  flex: 1;
}
