:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c232c;
  --line: #2a3038;
  --ink: #e6edf3;
  --muted: #9aa7b4;
  --accent: #4493f8;
  --accent-2: #2f6fed;
  --green: #3fb950;
  --orange: #d29922;
  --red: #f85149;
  --radius: 10px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* semantic surfaces (flip in light mode) */
  --topbar-grad: linear-gradient(180deg, #11161d, #0d1117);
  --sunken: #0b0f14;              /* footer / code boxes */
  --sunken-ink: #d6ecff;
  --disclaimer-ink: #7d8893;
  --disclaimer-strong: #9aa7b4;
  --mm-bg: #1c2230;              /* wallet-connect button (adapts per theme) */
  --mm-hover: #232b3b;
  --mm-ink: #fff;
  --chip-bg: #141a24;
  --net-badge-bg: #16222f;
  --net-badge-line: #2b4a63;
  --net-badge-ink: #d6ecff;
  --pay-warn-ink: #b7c2cd;
  --pay-warn-strong: #ffd9a8;
  --modal-scrim: rgba(6, 9, 13, .68);
  --toast-error-ink: #ffb4ac;
  --toast-error-line: #6e2b2b;
  --shadow: rgba(0, 0, 0, .4);
  --shadow-strong: rgba(0, 0, 0, .5);

  /* live console — kept as a dark "terminal" in BOTH themes so the coloured
     log output stays legible; hence its own vars, not overridden in light. */
  --term-bg: #0b0f14;
  --term-ink: #e6edf3;
  --term-tag: #9aa7b4;
  --term-hint: #9aa7b4;
  --term-thinking: #7d8893;
  --term-tool: #79c0ff;
  --term-tool-tag: #58a6ff;
  --term-result: #6fbf73;
  --term-status: #d2a8ff;
  --term-warn: #d29922;
  --term-error: #f85149;
  --term-done: #3fb950;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #eef1f6;
  --line: #d8dee7;
  --ink: #1a2029;
  --muted: #5a6572;
  --accent: #2f6fed;
  --accent-2: #2f6fed;
  --green: #1a7f37;
  --orange: #9a6700;
  --red: #cf222e;

  --topbar-grad: linear-gradient(180deg, #ffffff, #eef2f8);
  --sunken: #eef1f6;
  --sunken-ink: #1a4d80;
  --disclaimer-ink: #6b7480;
  --disclaimer-strong: #3a424d;
  --mm-bg: #ffffff;
  --mm-hover: #eef2f8;
  --mm-ink: #1a2029;
  --chip-bg: #eef1f6;
  --net-badge-bg: #e7f0fb;
  --net-badge-line: #b9d3f0;
  --net-badge-ink: #1a4d80;
  --pay-warn-ink: #4a5560;
  --pay-warn-strong: #9a5a00;
  --modal-scrim: rgba(20, 28, 40, .35);
  --toast-error-ink: #b3261e;
  --toast-error-line: #f0b4ae;
  --shadow: rgba(30, 40, 60, .16);
  --shadow-strong: rgba(30, 40, 60, .22);
}
* { box-sizing: border-box; }
/* The `hidden` attribute must always win over component display rules
   (.login-overlay/.user/.spinner/.adv-fields all set display:flex|inline-block,
   which would otherwise override [hidden] at equal specificity). */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: var(--topbar-grad);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 40px; height: 40px; display: block; flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(47,111,237,.35)); }
.brand h1 { font-size: 17px; margin: 0; }
.tagline { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

/* ---- generate bar ---- */
.generate { padding: 16px 22px 6px; border-bottom: 1px solid var(--line); }
.gen-row { display: flex; gap: 10px; flex-wrap: wrap; }
#protocol {
  flex: 1 1 320px; min-width: 220px; padding: 11px 14px; font-size: 15px;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
}
#protocol:focus { outline: none; border-color: var(--accent); }
#keySource, #model {
  padding: 11px 12px; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px;
}
#model { max-width: 240px; }
button {
  cursor: pointer; font-size: 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  padding: 11px 16px; transition: background .15s, border-color .15s, opacity .15s;
}
button:hover { border-color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--accent-2); border-color: var(--accent-2); font-weight: 600; }
button.primary:hover { background: #3a7bef; }
button.ghost { padding: 6px 11px; }
button.danger { background: #3a1d1d; border-color: #6e2b2b; color: #ffb4ac; }
button.danger:hover { background: #502424; }

.gen-advanced { margin-top: 8px; }
.adv-toggle { font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.adv-fields { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
#apiKey {
  width: 100%; max-width: 640px; padding: 9px 12px; font-family: var(--mono); font-size: 12px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
}
.hint { font-size: 11px; color: var(--muted); max-width: 720px; }
.warnings { margin-top: 8px; }
.warnings .w { font-size: 12px; color: var(--orange); padding: 2px 0; }

/* ---- layout ---- */
.layout {
  display: grid; grid-template-columns: minmax(320px, 1.05fr) minmax(360px, 1.25fr);
  gap: 16px; padding: 16px 22px 24px; align-items: start;
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2);
}
.panel-head h2 { margin: 0; font-size: 14px; letter-spacing: .02em; }

/* ---- reports ---- */
.reports { max-height: 70vh; overflow-y: auto; }
.report-card {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.report-card:last-child { border-bottom: none; }
.rc-main { flex: 1 1 auto; min-width: 0; }
.rc-title { font-weight: 600; font-size: 14px; margin: 0 0 3px; }
.rc-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.rc-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.rc-actions button { padding: 6px 10px; font-size: 12px; }
.badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .05em;
  padding: 2px 8px; border-radius: 999px; text-transform: uppercase;
}
.badge.green { color: #0b5c2e; background: #d6f0df; }
.badge.orange { color: #6e3c00; background: #f7e4c5; }
.badge.red { color: #6e1410; background: #f6cfcb; }
.badge.default { color: #2a3340; background: #d7dde5; }
.score-chip {
  font-family: var(--mono); font-size: 12px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px;
}
.model-chip {
  font-size: 10px; font-weight: 600; letter-spacing: .02em; color: var(--accent);
  background: rgba(68,147,248,.12); border: 1px solid rgba(68,147,248,.35);
  border-radius: 6px; padding: 1px 7px;
}
.empty { color: var(--muted); padding: 20px 16px; font-size: 13px; }

/* ---- live console ---- */
.live-controls { display: flex; align-items: center; gap: 10px; }
.run-status { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.run-status.running { color: var(--accent); }
.run-status.done { color: var(--green); }
.run-status.error { color: var(--red); }
.run-status.stopped { color: var(--orange); }
.console {
  height: 70vh; overflow-y: auto; padding: 12px 16px; font-family: var(--mono);
  font-size: 12.5px; line-height: 1.5; background: var(--term-bg); color: var(--term-ink);
}
.console-hint { color: var(--term-hint); font-family: "Segoe UI", sans-serif; font-size: 13px; }
.line { margin: 2px 0; white-space: pre-wrap; word-break: break-word; }
.line .tag {
  display: inline-block; min-width: 64px; margin-right: 8px; font-size: 10px;
  text-transform: uppercase; letter-spacing: .04em; color: var(--term-tag);
}
.line.assistant { color: var(--term-ink); }
.line.thinking { color: var(--term-thinking); font-style: italic; }
.line.tool { color: var(--term-tool); }
.line.tool .tag { color: var(--term-tool-tag); }
.line.tool_result { color: var(--term-result); }
.line.status { color: var(--term-status); }
.line.log.warn { color: var(--term-warn); }
.line.log.error, .line.error { color: var(--term-error); }
.line.done { color: var(--term-done); font-weight: 600; }
.line.stopped { color: var(--term-warn); font-weight: 600; }
.line a { color: var(--term-tool); }

/* ---- spinner ---- */
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(68,147,248,.25); border-top-color: var(--accent);
  animation: spin .8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  padding: 10px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 4px 14px var(--shadow);
  z-index: 50; max-width: 80vw;
}
.toast.error { border-color: var(--toast-error-line); color: var(--toast-error-ink); }

/* ---- auth ---- */
.user { display: flex; align-items: center; gap: 8px; }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); object-fit: cover; }
.user-email { font-size: 12px; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#logoutBtn { padding: 6px 11px; font-size: 12px; }

.login-overlay {
  position: fixed; inset: 0; z-index: 100; padding: 20px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: 100%; max-width: 380px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 36px 28px; box-shadow: 0 10px 40px var(--shadow-strong);
}
.login-logo { width: 64px; height: 64px; margin: 0 auto 14px; display: block;
  filter: drop-shadow(0 3px 10px rgba(47,111,237,.4)); }
.login-card h2 { margin: 0 0 4px; font-size: 18px; }
.login-sub { margin: 0 0 22px; font-size: 13px; color: var(--muted); }
.gbtn { display: flex; justify-content: center; min-height: 44px; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 18px 4px;
  color: var(--muted); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.mm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 44px; padding: 0 18px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--mm-ink);
  background: var(--mm-bg); border: 1px solid var(--line); border-radius: 999px;
  transition: background .15s, border-color .15s; }
.mm-btn:hover { background: var(--mm-hover); border-color: #E17726; }
.mm-btn:disabled { opacity: .6; cursor: progress; }
.login-error { margin: 16px 0 0; font-size: 12px; color: var(--red); }

/* Billing: balance chip + per-report price hint */
.balance-chip {
  font-size: 13px; color: var(--muted);
  background: var(--chip-bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px; white-space: nowrap;
}
.balance-chip b { color: var(--ink); font-weight: 600; }
.price-hint { font-size: 12px; color: var(--muted); align-self: center; white-space: nowrap; }

/* ---- site disclaimer (footer) ---- */
.site-disclaimer {
  border-top: 1px solid var(--line); background: var(--sunken);
  padding: 16px 22px 26px;
}
.site-disclaimer p {
  margin: 0 auto; max-width: 1100px;
  font-size: 11px; line-height: 1.6; color: var(--disclaimer-ink);
}
.site-disclaimer strong { color: var(--disclaimer-strong); }

/* ---- modal (top-up) ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 90; padding: 20px;
  background: var(--modal-scrim); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.modal-card {
  width: 100%; max-width: 440px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px 22px 18px; box-shadow: 0 14px 50px var(--shadow-strong);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-x { background: none; border: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 0 4px; }
.modal-x:hover { color: var(--ink); border: none; }
.pay-net { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; }
.net-badge {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px;
  color: var(--net-badge-ink); background: var(--net-badge-bg); border: 1px solid var(--net-badge-line); border-radius: 999px; padding: 5px 12px;
}
.net-sub { font-size: 12px; color: var(--muted); }
.pay-label { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 0; }
#topupAmount {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font-size: 16px;
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
}
.pay-warn { margin: 14px 0; padding-left: 18px; font-size: 12px; line-height: 1.55; color: var(--pay-warn-ink); }
.pay-warn li { margin: 5px 0; }
.pay-warn strong { color: var(--pay-warn-strong); }
.pay-to { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.pay-to code {
  display: inline-block; margin-top: 4px; word-break: break-all; font-family: var(--mono);
  font-size: 12px; color: var(--sunken-ink); background: var(--sunken); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 8px; width: 100%;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.pay-status { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.pay-status.error { color: var(--red); }
.pay-status.ok { color: var(--green); }

/* ============ Pre-auth landing page ============ */
.landing { min-height: 100vh; }
.lp-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; max-width: 1120px; margin: 0 auto; padding: 16px 28px;
}
.lp-nav .brand { gap: 10px; }
.lp-brand { font-size: 20px; font-weight: 700; letter-spacing: .2px; }
.lp-brand b { color: var(--accent); }
.lp-nav-right { display: flex; align-items: center; gap: 10px; }
.lp-connect { width: auto; min-height: 40px; padding: 0 16px; }

.lp-main { max-width: 1000px; margin: 0 auto; padding: 8px 28px 64px; }

.lp-hero { text-align: center; padding: 52px 0 44px; }
.lp-badge {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--accent);
  background: rgba(68,147,248,.10); border: 1px solid rgba(68,147,248,.32);
  border-radius: 999px; padding: 6px 14px;
}
.lp-hero h1 {
  font-size: clamp(30px, 5vw, 50px); line-height: 1.08; letter-spacing: -.5px;
  margin: 20px auto 0; max-width: 780px;
}
.lp-sub {
  font-size: clamp(15px, 2vw, 18px); color: var(--muted);
  max-width: 700px; margin: 18px auto 0; line-height: 1.6;
}
.lp-cta-row { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 30px; }
.lp-cta { font-size: 16px; padding: 14px 28px; }
.lp-cta-note { font-size: 13px; color: var(--muted); }
.lp-hero .gbtn { justify-content: center; margin-top: 14px; }
.lp-hero .login-divider { max-width: 260px; margin: 16px auto; }

.lp-section { padding: 34px 0; border-top: 1px solid var(--line); }
.lp-section h2 { font-size: 24px; margin: 0 0 14px; }
.lp-section > p { color: var(--muted); line-height: 1.65; max-width: 780px; font-size: 15.5px; }
.lp-section strong, .lp-section b { color: var(--ink); }

.lp-risks { list-style: none; padding: 0; margin: 22px 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.lp-risks li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.lp-risks b { display: block; font-size: 15px; margin-bottom: 4px; }
.lp-risks span { font-size: 13px; color: var(--muted); }

.lp-steps { list-style: none; padding: 0; margin: 6px 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.lp-steps li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.lp-step-n { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent-2); color: #fff; font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.lp-steps b { display: block; margin-bottom: 4px; }
.lp-steps span { font-size: 13px; color: var(--muted); }

.lp-final { text-align: center; padding: 48px 0; border-top: 1px solid var(--line); }
.lp-final h2 { font-size: 26px; margin: 0 0 18px; }
.lp-final .lp-cta { margin-bottom: 8px; }

.lp-faq dl { margin: 8px 0 0; max-width: 800px; }
.lp-faq dt { font-weight: 600; margin-top: 16px; }
.lp-faq dd { margin: 6px 0 0; color: var(--muted); line-height: 1.6; font-size: 14px; }

@media (max-width: 640px) {
  .lp-nav { padding: 12px 16px; }
  .lp-main { padding: 4px 16px 44px; }
  .lp-hero { padding: 32px 0 28px; }
}

/* ============ theme + language controls ============ */
.topbar-right { display: flex; align-items: center; gap: 12px; }
.ui-controls { display: flex; align-items: center; gap: 8px; }

.lang-select {
  appearance: none; -webkit-appearance: none;
  background-color: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 26px 7px 12px; font-size: 12px; font-weight: 600; line-height: 1;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='10'%20height='10'%20viewBox='0%200%2012%2012'%3E%3Cpath%20d='M2%204l4%204%204-4'%20fill='none'%20stroke='%238b95a1'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 10px;
}
.lang-select:hover { border-color: var(--accent); }
.lang-select:focus { outline: none; border-color: var(--accent); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 34px; padding: 0; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
/* Dark theme shows a sun (click → go light); light theme shows a moon. */
.theme-toggle svg { display: none; }
.theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }

/* Cookie-consent card (EU/GDPR). A compact floating card, bottom-left on desktop
   and a full-width sheet on mobile. Accept / decline get equal prominence. */
.cookie-consent {
  position: fixed; z-index: 1000;
  left: 20px; bottom: 20px;
  width: min(430px, calc(100vw - 40px));
  display: flex; gap: 14px;
  padding: 18px 20px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 50px -12px var(--shadow-strong), 0 0 0 1px rgba(255,255,255,.02) inset;
  animation: cc-rise .38s cubic-bezier(.16,.84,.44,1) both;
}
.cookie-consent[hidden] { display: none; }
@keyframes cc-rise {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .cookie-consent { animation: none; } }

.cookie-consent .cc-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
}
.cookie-consent .cc-body { flex: 1 1 auto; min-width: 0; }
.cookie-consent .cc-title {
  display: block; color: var(--ink);
  font-size: 14.5px; font-weight: 650; letter-spacing: .1px; margin-bottom: 5px;
}
.cookie-consent .cc-desc {
  margin: 0 0 14px; color: var(--muted);
  font-size: 12.5px; line-height: 1.55;
}
.cookie-consent .cc-desc strong { color: var(--ink); font-weight: 600; }
.cookie-consent .cc-desc a { color: var(--accent); text-decoration: none; }
.cookie-consent .cc-desc a:hover { text-decoration: underline; }

.cookie-consent .cc-actions { display: flex; gap: 9px; }
.cookie-consent .cc-btn {
  flex: 1 1 0; min-width: 0; white-space: nowrap;
  padding: 9px 14px; border-radius: 9px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s, transform .05s;
}
.cookie-consent .cc-btn:active { transform: translateY(1px); }
.cookie-consent .cc-decline {
  background: transparent; color: var(--ink);
  border-color: var(--line);
}
.cookie-consent .cc-decline:hover { background: var(--panel-2); border-color: var(--muted); }
.cookie-consent .cc-accept {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--accent) 60%, transparent);
}
.cookie-consent .cc-accept:hover { filter: brightness(1.06); }

@media (max-width: 560px) {
  .cookie-consent {
    left: 0; right: 0; bottom: 0; width: auto;
    border-radius: 16px 16px 0 0;
    border-left: none; border-right: none; border-bottom: none;
  }
}

/* Admin: live active-sessions monitor */
.admin-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
  border-radius: 999px; background: var(--accent-2); color: #fff;
}
.admin-badge[hidden] { display: none; }
.admin-card { max-width: 640px; width: min(640px, calc(100vw - 32px)); }
.admin-sub { margin: -4px 0 12px; color: var(--muted); font-size: 12.5px; }
.admin-jobs { display: flex; flex-direction: column; gap: 8px; max-height: 56vh; overflow-y: auto; margin-bottom: 14px; }
.admin-jobs .empty { color: var(--muted); font-size: 13px; text-align: center; padding: 22px 0; }
.admin-job {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2);
}
.admin-job .aj-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.admin-job .aj-proto { font-weight: 600; color: var(--ink); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-job .aj-user { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.admin-job .aj-meta { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.admin-job .aj-elapsed { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); min-width: 54px; text-align: right; }
.admin-job .pill.running {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px; color: var(--green);
  background: color-mix(in srgb, var(--green) 16%, transparent);
}
.admin-job .aj-stop { padding: 5px 12px; font-size: 12px; }
