/* ============================================================
   RHRunner — OLED-black console
   Zero build · vanilla CSS · tokens below drive everything
   ============================================================ */

:root {
  /* base surfaces */
  --bg: #05070A;
  --bg-2: #06090D;
  --panel: #0A0F16;          /* card outer shell */
  --core: #0C1219;           /* card inner core */
  --core-2: #0E1521;         /* inner core hover */
  --field: #070B10;

  /* cool gray family (single hue, alpha steps) */
  --line: rgba(148, 163, 184, 0.14);
  --line-soft: rgba(148, 163, 184, 0.07);
  --shell: rgba(148, 163, 184, 0.09);   /* outer ring of double-ring card */
  --core-line: rgba(148, 163, 184, 0.06);
  --inset-hi: rgba(226, 238, 252, 0.05);
  --text: #E8EEF7;
  --text-2: #B7C3D4;
  --muted: #94A3B8;
  --faint: #6E7B8F;
  --gray-soft: rgba(148, 163, 184, 0.13);
  --gray-text: #ACB9CA;

  /* the one accent */
  --accent: #2DD4BF;
  --accent-hi: #45E1CE;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --accent-line: rgba(45, 212, 191, 0.38);
  --ink: #04211C;            /* text on accent */

  /* status (low-saturation bg + same-family text) */
  --ok: #34D399;   --ok-soft: rgba(52, 211, 153, 0.12);
  --err: #F87171;  --err-soft: rgba(248, 113, 113, 0.12);
  --warn: #FBBF24; --warn-soft: rgba(251, 191, 36, 0.12);

  /* radii — concentric: card 20 → core 14 (6px shell padding) */
  --r-card: 20px;
  --r-core: 14px;
  --r-md: 12px;
  --r-sm: 10px;

  /* motion — one curve only */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --t1: 200ms; --t2: 320ms; --t3: 500ms;

  /* type */
  --font-display: -apple-system, "SF Pro Display", "PingFang SC", "MiSans", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--font-display);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* film grain — fixed, feather light */
body::after {
  content: "";
  position: fixed; inset: 0;
  z-index: 200; pointer-events: none; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

a { color: var(--accent); text-decoration: none; transition: color var(--t1) var(--ease); }
a:hover { color: var(--accent-hi); }
h1 { font-size: 22px; letter-spacing: -0.01em; margin: 2px 0 0; font-weight: 650; }
h3 { font-size: 11px; margin: 18px 0 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; }
.muted { color: var(--muted); font-size: 12.5px; }
.error { color: var(--err); font-size: 12.5px; }
.hidden { display: none !important; }
.mono, .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* focus ring — visible, single accent */
:focus-visible {
  outline: 2px solid rgba(45, 212, 191, 0.65);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ============================================================
   Top floating capsule nav (the only backdrop-blur surface)
   ============================================================ */
.topbar {
  position: sticky; top: 14px; z-index: 40;
  padding: 0 18px;
}
.capsule {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(7, 11, 16, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 0 0 1px var(--shell), 0 18px 44px rgba(0, 0, 0, 0.45);
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 10px 6px 6px;
  font-weight: 700; font-size: 14px; color: var(--text);
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 999px;
  display: grid; place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.brand-mark .ic { width: 16px; height: 16px; }
#nav {
  display: flex; align-items: center; gap: 2px;
  margin: 0 auto; overflow-x: auto; scrollbar-width: none;
}
#nav::-webkit-scrollbar { display: none; }
#nav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  color: var(--muted); font-size: 13px; font-weight: 500;
  white-space: nowrap;
  transition: color var(--t1) var(--ease), background var(--t1) var(--ease),
    box-shadow var(--t1) var(--ease);
}
#nav a .ic { width: 15px; height: 15px; opacity: 0.9; }
#nav a:hover { color: var(--text); background: var(--gray-soft); text-decoration: none; }
#nav a:active { transform: scale(0.98); }
#nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.top-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.affiliate-mini {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  white-space: nowrap;
  transition: background var(--t1) var(--ease), color var(--t1) var(--ease), transform var(--t1) var(--ease);
}
.affiliate-mini .ic { width: 14px; height: 14px; }
.affiliate-mini:hover { color: var(--accent-hi); background: rgba(45, 212, 191, 0.18); }

/* ============================================================
   View & page scaffolding
   ============================================================ */
.view {
  max-width: 1240px; margin: 0 auto;
  padding: 38px 28px 110px;
}
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; margin: 4px 0 24px; flex-wrap: wrap;
}
.eyebrow {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--faint);
}
.banner-chip {
  display: inline-flex; align-items: center; gap: 7px;
  max-width: 560px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 11.5px; color: var(--muted);
  background: rgba(148, 163, 184, 0.05);
  box-shadow: inset 0 0 0 1px var(--core-line);
}
.banner-chip .ic { width: 13px; height: 13px; color: var(--accent); flex: none; }
.page-loading { padding: 90px 0; display: grid; place-items: center; }

/* ============================================================
   Double-ring cards: outer shell + inner core w/ inset highlight
   ============================================================ */
.card {
  display: grid;
  border-radius: var(--r-card);
  padding: 6px;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--shell);
}
.card > .in {
  border-radius: var(--r-core);
  background: var(--core);
  box-shadow: inset 0 0 0 1px var(--core-line), inset 0 1px 0 var(--inset-hi);
  padding: 20px 20px 22px;
  min-width: 0;
}
.card-k {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 16px;
}
.gap-top { margin-top: 22px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.dash-a { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }  /* queue big / cost small */
.grid.dash-b { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }  /* today stats / failures */

.stat-card .num {
  font-size: 30px; font-weight: 600; line-height: 1.1;
  color: var(--text);
}
.stat-card .label { color: var(--muted); font-size: 12px; margin-top: 7px; }

/* inline stat strip (batch precheck) — stats, not cards */
.stat-strip { display: flex; flex-wrap: wrap; margin-bottom: 14px; }
.stat-strip .ss {
  display: flex; flex-direction: column; gap: 3px;
  padding: 4px 26px 4px 0; margin-right: 26px;
  border-right: 1px solid var(--line-soft);
}
.stat-strip .ss:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.stat-strip .ss .num { font-size: 26px; font-weight: 600; }
.stat-strip .ss .label { color: var(--muted); font-size: 12px; }
.stat-strip .ss.ok .num { color: var(--ok); }
.stat-strip .ss.err .num { color: var(--err); }

/* ============================================================
   Buttons — capsule CTAs, button-in-button tail icon
   ============================================================ */
.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--core-2); color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 9px 16px; min-height: 38px;
  font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: transform var(--t1) var(--ease), background var(--t1) var(--ease),
    border-color var(--t1) var(--ease), color var(--t1) var(--ease),
    box-shadow var(--t1) var(--ease);
}
.btn:hover { color: var(--text); border-color: rgba(148, 163, 184, 0.26); background: #111927; text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn .ic { width: 15px; height: 15px; }
.btn.primary {
  background: var(--accent); border-color: transparent;
  color: var(--ink); font-weight: 650;
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.22), 0 10px 26px rgba(45, 212, 191, 0.13);
}
.btn.primary:hover { background: var(--accent-hi); color: var(--ink); }
.btn.danger {
  background: transparent; border-color: rgba(248, 113, 113, 0.4); color: var(--err);
}
.btn.danger:hover { background: var(--err-soft); border-color: rgba(248, 113, 113, 0.6); color: #FCA5A5; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--gray-soft); }
.btn.small { min-height: 30px; padding: 5px 11px; border-radius: var(--r-sm); font-size: 12px; }
.btn.small .ic { width: 13px; height: 13px; }
.btn.icon { padding: 5px 8px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* capsule CTA with trailing button-in-button icon */
.btn.cta {
  border-radius: 999px;
  padding: 6px 6px 6px 18px; gap: 12px;
}
.cta-t { padding-left: 2px; }
.cta-ic {
  width: 30px; height: 30px; border-radius: 999px; flex: none;
  display: grid; place-items: center;
  background: rgba(4, 33, 28, 0.18);
  transition: background var(--t1) var(--ease), transform var(--t1) var(--ease);
}
.btn.cta:hover .cta-ic .ic { transform: translateX(2px); }
.cta-ic .ic { width: 14px; height: 14px; }

/* ============================================================
   Inputs
   ============================================================ */
input, select, textarea {
  background: var(--field); color: var(--text);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 12px; min-height: 40px;
  font: inherit; font-size: 13px; width: 100%;
  transition: border-color var(--t1) var(--ease), box-shadow var(--t1) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: rgba(148, 163, 184, 0.24); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
}
textarea { font-family: var(--font-mono); font-size: 12px; min-height: 90px; resize: vertical; }
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 14px;
  cursor: pointer;
}
input[type="checkbox"] {
  width: 16px; height: 16px; min-height: 0;
  accent-color: var(--accent); cursor: pointer;
}
input[type="file"] { padding: 6px; cursor: pointer; }
input[type="file"]::file-selector-button {
  appearance: none; border: 0;
  background: var(--core-2); color: var(--text-2);
  border-radius: 9px; padding: 8px 14px; margin-right: 12px;
  font: inherit; font-size: 12.5px; cursor: pointer;
  transition: background var(--t1) var(--ease), color var(--t1) var(--ease);
}
input[type="file"]::file-selector-button:hover { color: var(--text); background: #111927; }
label.fld { display: block; margin-bottom: 12px; }
label.fld > span {
  display: block; font-size: 11px; color: var(--muted);
  margin-bottom: 5px; letter-spacing: 0.02em;
}
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 0 0 auto; }
.flex-sp { flex: 1 1 auto !important; }

/* ============================================================
   Tables — dense 44px rows
   ============================================================ */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; color: var(--faint);
  font-weight: 700; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td {
  padding: 11px 12px; height: 44px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.tbl tbody tr { transition: background var(--t1) var(--ease); }
.tbl tbody tr:hover { background: rgba(148, 163, 184, 0.045); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.tot td {
  border-top: 1px solid var(--line);
  font-weight: 650; color: var(--text);
}
.tbl td.num, .tbl td.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* meter bar inside tables (costs) */
.meter {
  width: 100%; min-width: 90px; height: 8px;
  border-radius: 999px; overflow: hidden;
  background: rgba(148, 163, 184, 0.09);
}
.meter-f {
  height: 100%; border-radius: 999px;
  background: rgba(45, 212, 191, 0.55);
  transition: width var(--t3) var(--ease), background var(--t1) var(--ease);
}
.meter:hover .meter-f { background: rgba(45, 212, 191, 0.85); }
/* tiny inline meter (key queue usage) */
.meter.tiny { height: 4px; min-width: 64px; margin-top: 7px; }
.meter-f.warn { background: rgba(251, 191, 36, 0.7); }
.meter-f.crit { background: rgba(248, 113, 113, 0.75); }

/* 805 traceback panel (queue rows) */
.tb-row td { padding: 4px 12px 14px; }
.tb-panel {
  border-radius: var(--r-md);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--core-line);
  padding: 12px 14px;
}
.tb-head { margin-bottom: 10px; }
.tb-pre {
  margin: 0;
  font-size: 11.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
  color: var(--text-2);
  max-height: 260px; overflow: auto;
}
.btn.tb-toggle { margin-top: 5px; color: var(--err); }
.btn.tb-toggle:hover { color: #FCA5A5; background: var(--err-soft); }
.btn.tb-toggle.open { color: #FCA5A5; background: var(--err-soft); }
.tb-toggle .ic { width: 13px; height: 13px; }

/* ============================================================
   Status chips — low-sat bg + same-family text
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}
.badge.pending, .badge.submitting, .badge.queued, .badge.cancelled {
  color: var(--gray-text); background: var(--gray-soft);
}
.badge.running { color: var(--accent); background: var(--accent-soft); }
.badge.transferring {
  color: var(--accent); background: var(--accent-soft);
  animation: chipPulse 1.8s var(--ease) infinite;
}
.badge.succeeded { color: var(--ok); background: var(--ok-soft); }
.badge.failed { color: var(--err); background: var(--err-soft); }
.badge.expired { color: var(--warn); background: var(--warn-soft); }
.badge.builtin {
  color: var(--accent); background: transparent;
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
@keyframes chipPulse {
  0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.22); }
  70% { box-shadow: 0 0 0 6px rgba(45, 212, 191, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); }
}

/* ============================================================
   Queue live bar
   ============================================================ */
.qbar {
  display: flex; height: 26px;
  border-radius: 999px; overflow: hidden;
  background: rgba(148, 163, 184, 0.07);
  box-shadow: inset 0 0 0 1px var(--core-line);
}
.qbar.thin { height: 14px; }
.qbar > div { height: 100%; min-width: 0; transition: width var(--t3) var(--ease); }
.qbar .pending, .qbar .submitting, .qbar .queued { background: rgba(148, 163, 184, 0.32); }
.qbar .running { background: rgba(45, 212, 191, 0.75); }
.qbar .transferring { background: rgba(45, 212, 191, 0.42); animation: barPulse 1.6s var(--ease) infinite; }
.qbar .succeeded { background: rgba(52, 211, 153, 0.6); }
.qbar .failed { background: rgba(248, 113, 113, 0.55); }
.qbar .expired { background: rgba(251, 191, 36, 0.5); }
@keyframes barPulse { 50% { opacity: 0.45; } }
.qbar-labels { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.qbar-labels span {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted);
  padding: 5px 11px; border-radius: 999px;
  background: rgba(148, 163, 184, 0.05);
  box-shadow: inset 0 0 0 1px var(--core-line);
}
.qbar-labels span::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: var(--faint);
}
.qbar-labels span[data-s="pending"]::before,
.qbar-labels span[data-s="submitting"]::before,
.qbar-labels span[data-s="queued"]::before { background: rgba(148, 163, 184, 0.7); }
.qbar-labels span[data-s="running"]::before,
.qbar-labels span[data-s="transferring"]::before { background: var(--accent); }
.qbar-labels span[data-s="succeeded"]::before { background: var(--ok); }
.qbar-labels span[data-s="failed"]::before { background: var(--err); }
.qbar-labels span[data-s="expired"]::before { background: var(--warn); }
.qbar-labels b {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  color: var(--text-2); font-weight: 650;
}

/* queue stats strip */
.q-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.q-stats .qs {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted);
  padding: 5px 11px; border-radius: 999px;
  background: rgba(148, 163, 184, 0.05);
}
.q-stats .qs b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 650; }
.q-stats .qs-total { background: var(--accent-soft); color: var(--accent); }
.q-stats .qs-total b { color: var(--accent); }

/* failure list (dashboard) */
.fail-item + .fail-item { border-top: 1px solid var(--line-soft); margin-top: 11px; padding-top: 11px; }
.fail-item .fi-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.fail-item .fi-time { margin-left: auto; font-size: 11.5px; }

/* ============================================================
   Mini chart (7-day cost)
   ============================================================ */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 118px; }
.chart .bar-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 6px; height: 100%;
  justify-content: flex-end; min-width: 0;
}
.chart .bar {
  width: 100%; max-width: 34px;
  background: rgba(45, 212, 191, 0.45);
  border-radius: 6px 6px 2px 2px; min-height: 3px;
  transition: height var(--t3) var(--ease), background var(--t1) var(--ease);
}
.chart .bar-wrap:hover .bar { background: rgba(45, 212, 191, 0.85); }
.chart .bar-label {
  font-size: 10px; color: var(--faint);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}

/* ============================================================
   Preset editor — three panes, tabs below 1200px, stack below 768px
   ============================================================ */
.editor3 {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 360px;
  gap: 16px; align-items: start;
}
.etab-r { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.etab-bar { display: none; }
.preset-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: var(--r-md);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px transparent;
  transition: background var(--t1) var(--ease), box-shadow var(--t1) var(--ease);
}
.preset-item:hover { background: var(--gray-soft); }
.preset-item:active { transform: scale(0.98); }
.preset-item.selected {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.preset-item .p-glyph { color: var(--muted); display: grid; place-items: center; flex: none; }
.preset-item .p-glyph .ic { width: 15px; height: 15px; }
.preset-item.selected .p-glyph { color: var(--accent); }
.preset-item .nm {
  flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px; color: var(--text-2);
}
.preset-item .p-txt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.p-desc {
  font-size: 11px; color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.preset-item.selected .nm { color: var(--text); }
.preset-item .btn.gen { color: var(--accent); }
.preset-item .btn.gen:hover { background: var(--accent-soft); color: var(--accent-hi); }
.field-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) 90px 64px 64px 30px 34px;
  gap: 6px; margin-bottom: 6px; align-items: center;
}
.field-row input, .field-row select { min-height: 34px; padding: 5px 8px; font-size: 12px; border-radius: 9px; }
.field-row.head { margin-bottom: 8px; }
.field-row.head span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.json-preview {
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.65;
  font-variant-numeric: tabular-nums;
  white-space: pre;
  color: var(--text-2);
  background: var(--bg);
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--core-line);
  padding: 14px;
  max-height: 420px; overflow: auto;
}
.json-preview::-webkit-scrollbar, .tbl-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
.json-preview::-webkit-scrollbar-thumb, .tbl-wrap::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.18); border-radius: 99px;
}

/* ============================================================
   Wizard / overlays / modals
   ============================================================ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(3, 5, 8, 0.82);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 18px;
}
.modal { width: 620px; max-width: 96vw; max-height: 92vh; overflow: auto; }
.login-box h2 { margin: 6px 0 6px; font-size: 19px; }
.login-box input { margin: 14px 0 12px; }

.wizard .w-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.wizard .w-head h2 { margin: 2px 0 0; font-size: 19px; }
.w-step {
  font-size: 11px; color: var(--muted);
  padding: 5px 11px; border-radius: 999px;
  background: rgba(148, 163, 184, 0.06);
  box-shadow: inset 0 0 0 1px var(--core-line);
}
.wizard-steps { display: flex; gap: 10px; margin: 2px 0 20px; }
.wizard-steps .ws {
  flex: 1; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--faint);
  padding-bottom: 9px;
  border-bottom: 2px solid rgba(148, 163, 184, 0.12);
  min-width: 0;
  transition: color var(--t2) var(--ease), border-color var(--t2) var(--ease);
}
.wizard-steps .ws::before {
  content: attr(data-n);
  width: 20px; height: 20px; border-radius: 999px; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10.5px;
  background: rgba(148, 163, 184, 0.1); color: var(--muted);
  transition: background var(--t2) var(--ease), color var(--t2) var(--ease),
    box-shadow var(--t2) var(--ease);
}
.wizard-steps .ws.on {
  color: var(--accent); border-bottom-color: var(--accent); font-weight: 600;
}
.wizard-steps .ws.on::before {
  background: var(--accent); color: var(--ink);
}
.wizard-steps .ws.done { color: var(--muted); border-bottom-color: rgba(52, 211, 153, 0.35); }
.wizard-steps .ws.done::before {
  background: var(--ok-soft); color: var(--ok);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.35);
}
.wizard-steps .ws span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-copy { font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
.w-foot { margin-top: 22px; justify-content: space-between; }

/* invite CTA — capsule, coin lead, arrow tail (copy stays verbatim) */
.invite-big {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 16px 0;
  padding: 8px 8px 8px 20px;
  border-radius: 999px;
  background: var(--accent); color: var(--ink);
  font-weight: 700; font-size: 14.5px; line-height: 1.45;
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.25), 0 14px 34px rgba(45, 212, 191, 0.16);
  transition: background var(--t1) var(--ease), transform var(--t1) var(--ease),
    box-shadow var(--t1) var(--ease);
}
.invite-big .ib-t { flex: 1; min-width: 0; }
.invite-big .ib-ic {
  width: 36px; height: 36px; border-radius: 999px; flex: none;
  display: grid; place-items: center;
  background: rgba(4, 33, 28, 0.18);
  transition: transform var(--t1) var(--ease);
}
.invite-big .ib-ic .ic { width: 16px; height: 16px; }
.invite-big:hover {
  background: var(--accent-hi); color: var(--ink); text-decoration: none;
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.35), 0 18px 44px rgba(45, 212, 191, 0.22);
}
.invite-big:hover .ib-ic .ic { transform: translateX(2px); }
.invite-big:active { transform: scale(0.98); }

/* informational note panels */
.kbd-note {
  background: rgba(148, 163, 184, 0.05);
  box-shadow: inset 0 0 0 1px var(--core-line);
  border-radius: var(--r-md);
  padding: 13px 15px; font-size: 12.5px; color: var(--muted); line-height: 1.7;
}
.ent-note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  color: var(--text-2); font-size: 12.5px; line-height: 1.65;
}
.ent-note .ic { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 2px; }
.type-panel { margin: 4px 0 12px; border-radius: var(--r-md); overflow: hidden; }
.type-panel .tp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px;
  background: rgba(148, 163, 184, 0.04);
  box-shadow: inset 0 0 0 1px var(--core-line);
  font-size: 12px;
}
.type-panel .tp-row + .tp-row { margin-top: 6px; }
.type-panel .tp-row.hi {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.type-panel .tp-row.hi .muted { color: var(--text-2); }

/* ============================================================
   Batch — steps, chips, drop zones
   ============================================================ */
.step-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step-n {
  width: 24px; height: 24px; border-radius: 999px; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.step-h h2 {
  font-size: 11px; font-weight: 700; margin: 0;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--core-2); color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 6px 13px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  cursor: grab; user-select: none;
  transition: color var(--t1) var(--ease), box-shadow var(--t1) var(--ease), transform var(--t1) var(--ease);
}
.chip:hover { color: var(--text); box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.3); }
.chip:active { transform: scale(0.98); }
.chip.dragging { opacity: 0.4; }
.drop-zone {
  min-height: 40px; border-radius: var(--r-md);
  padding: 5px; display: flex;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  transition: border-color var(--t1) var(--ease), background var(--t1) var(--ease);
}
.drop-zone.over { border-color: var(--accent); background: var(--accent-soft); }
.map-row {
  display: grid; grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px; margin-bottom: 9px; align-items: center;
}
.map-row .mk {
  font-size: 12.5px; color: var(--text-2);
  font-family: var(--font-mono);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.map-row .mk small { color: var(--faint); font-family: var(--font-display); }
.out-link {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  color: var(--accent); background: var(--accent-soft);
  transition: background var(--t1) var(--ease), transform var(--t1) var(--ease);
}
.out-link:hover { background: rgba(45, 212, 191, 0.22); color: var(--accent-hi); }
.out-link:active { transform: scale(0.98); }
.out-link .ic { width: 14px; height: 14px; }

/* ============================================================
   Toast / callouts / empty / errors
   ============================================================ */
.toast {
  position: fixed; bottom: 26px; right: 26px; z-index: 99;
  background: var(--core-2); color: var(--text);
  padding: 12px 18px; border-radius: var(--r-md);
  box-shadow: 0 0 0 1px var(--line), 0 18px 44px rgba(0, 0, 0, 0.5);
  max-width: 380px; font-size: 13px;
}
.toast.err { box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.45), 0 18px 44px rgba(0, 0, 0, 0.5); color: #FECACA; }

.callout {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 16px; border-radius: var(--r-md);
  background: rgba(148, 163, 184, 0.045);
  box-shadow: inset 0 0 0 1px var(--core-line);
  color: var(--muted); font-size: 12.5px; line-height: 1.65;
  margin-bottom: 16px;
}
.callout .ic { width: 16px; height: 16px; color: var(--faint); flex: none; margin-top: 2px; }

.inline-err {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 15px; border-radius: var(--r-md);
  background: var(--err-soft);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.3);
  color: #FCA5A5; font-size: 12.5px; line-height: 1.6;
}
.inline-err .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--err); }

.empty {
  display: grid; place-items: center; gap: 7px;
  padding: 46px 20px; text-align: center;
}
.empty-ic {
  width: 46px; height: 46px; border-radius: 999px;
  display: grid; place-items: center;
  color: var(--faint);
  background: rgba(148, 163, 184, 0.06);
  box-shadow: inset 0 0 0 1px var(--core-line);
  margin-bottom: 4px;
}
.empty-ic .ic { width: 20px; height: 20px; }
.empty-t { margin: 0; font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.empty .muted { margin: 0; max-width: 340px; line-height: 1.65; }

/* 404 */
.nf-code {
  font-size: 40px; font-weight: 600; color: var(--faint);
  padding: 10px 26px; border-radius: var(--r-md);
  background: rgba(148, 163, 184, 0.05);
  box-shadow: inset 0 0 0 1px var(--core-line);
  margin-bottom: 6px;
}

/* test result icons */
.ic-ok { color: var(--ok); display: inline-flex; }
.ic-err { color: var(--err); display: inline-flex; }
.test-res { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; margin: 10px 0 0; }
.test-res .ic { width: 16px; height: 16px; }
.demo-ok {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 15px; border-radius: var(--r-md);
  background: var(--ok-soft);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.3);
  color: var(--text-2); font-size: 12.5px;
}
.demo-ok .ic { width: 16px; height: 16px; color: var(--ok); flex: none; margin-top: 2px; }

/* affiliate footer */
.affiliate-footer {
  margin-top: 18px; padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 12px; line-height: 1.65;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.affiliate-footer a { color: var(--accent); font-weight: 600; }
.affiliate-footer a:hover { color: var(--accent-hi); }

/* ============================================================
   Skeletons — opacity pulse, no gradient sweep
   ============================================================ */
.skeleton {
  display: inline-block;
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.09);
  animation: skPulse 1.3s var(--ease) infinite alternate;
}
@keyframes skPulse { from { opacity: 0.45; } to { opacity: 1; } }

/* ============================================================
   Entrance — IntersectionObserver, staggered
   ============================================================ */
.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity var(--t3) var(--ease), transform var(--t3) var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
  .editor3 { grid-template-columns: 1fr; }
  .etab-bar {
    display: flex; gap: 6px; margin-bottom: 14px;
  }
  .etab-bar label {
    flex: 1; text-align: center;
    padding: 11px 10px; border-radius: 999px;
    font-size: 12.5px; font-weight: 600; color: var(--muted);
    background: var(--core);
    box-shadow: inset 0 0 0 1px var(--core-line);
    cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: color var(--t1) var(--ease), background var(--t1) var(--ease), box-shadow var(--t1) var(--ease);
  }
  .e-pane { display: none; }
  #etab-a:checked ~ .e-pane.pa,
  #etab-b:checked ~ .e-pane.pb,
  #etab-c:checked ~ .e-pane.pc { display: grid; }
  #etab-a:checked ~ .etab-bar label[for="etab-a"],
  #etab-b:checked ~ .etab-bar label[for="etab-b"],
  #etab-c:checked ~ .etab-bar label[for="etab-c"] {
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent-line);
  }
}
@media (max-width: 1100px) {
  .grid.dash-a, .grid.dash-b { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .view { padding: 26px 18px 90px; }
  .topbar { top: 8px; padding: 0 10px; }
}
@media (max-width: 860px) {
  .capsule { flex-wrap: wrap; border-radius: 22px; row-gap: 4px; }
  #nav { order: 3; width: 100%; }
  .top-tools { margin-left: auto; }
  .affiliate-mini span { display: none; }
  .affiliate-mini { padding: 8px; }
  .affiliate-mini .ic { width: 16px; height: 16px; }
}
@media (max-width: 768px) {
  .etab-bar { display: none; }
  .e-pane { display: grid !important; }
  .btn, .btn.small { min-height: 44px; }
  .btn.small { padding: 8px 13px; }
  #nav a { padding: 10px 13px; }
  .tbl td { height: 48px; }
  .field-row { grid-template-columns: minmax(0,1fr) 76px 56px 56px 28px 30px; }
  .map-row { grid-template-columns: 1fr; gap: 6px; }
  input, select, textarea { min-height: 44px; }
  .page-head { margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  .badge.transferring, .qbar .transferring, .skeleton { animation: none; }
  * { transition-duration: 1ms !important; }
}

/* 设置页/队列页复选框行：长 i18n 文案必须在行内换行，禁止撑破 390px 视口 */
label.row > span.muted { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
