:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --sidebar-width: 232px;
  --topbar-height: 66px;
  --demo-height: 34px;
  --bg: oklch(0.972 0.005 250);
  --surface: oklch(1 0 0);
  --surface-soft: oklch(0.985 0.004 250);
  --ink: oklch(0.22 0.025 252);
  --muted: oklch(0.48 0.025 252);
  --faint: oklch(0.64 0.018 252);
  --line: oklch(0.89 0.012 250);
  --line-strong: oklch(0.82 0.018 250);
  --accent: oklch(0.55 0.205 3);
  --accent-dark: oklch(0.46 0.19 3);
  --accent-soft: oklch(0.965 0.025 3);
  --sidebar: oklch(0.19 0.025 252);
  --sidebar-hover: oklch(0.25 0.028 252);
  --sidebar-line: oklch(0.31 0.026 252);
  --green: oklch(0.59 0.15 148);
  --green-soft: oklch(0.96 0.035 148);
  --amber: oklch(0.68 0.15 78);
  --amber-soft: oklch(0.97 0.04 78);
  --blue: oklch(0.58 0.15 245);
  --blue-soft: oklch(0.965 0.025 245);
  --red: oklch(0.57 0.2 28);
  --red-soft: oklch(0.965 0.035 28);
  --shadow: 0 12px 30px oklch(0.18 0.025 252 / 0.08);
  --shadow-soft: 0 4px 14px oklch(0.18 0.025 252 / 0.06);
  --z-sidebar: 40;
  --z-topbar: 35;
  --z-overlay: 60;
  --z-drawer: 70;
  --z-toast: 80;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: 0.58; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
[hidden] { display: none !important; }

.demo-strip { height: var(--demo-height); position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; background: oklch(0.94 0.025 78); border-bottom: 1px solid oklch(0.84 0.06 78); color: oklch(0.36 0.07 65); font-size: 12px; }
.demo-strip a { margin-left: 8px; color: inherit; font-weight: 700; }
.demo-strip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px oklch(0.68 0.15 78 / 0.14); }

.app-shell { min-height: 100vh; padding-top: var(--demo-height); display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { width: var(--sidebar-width); position: fixed; inset: var(--demo-height) auto 0 0; z-index: var(--z-sidebar); display: flex; flex-direction: column; background: var(--sidebar); color: oklch(0.94 0.008 250); box-shadow: 10px 0 28px oklch(0.12 0.02 252 / 0.12); }
.brand { height: var(--topbar-height); display: flex; align-items: center; gap: 11px; padding: 0 18px; border-bottom: 1px solid var(--sidebar-line); }
.brand-mark { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--accent); color: white; font-weight: 800; box-shadow: 0 0 0 5px oklch(0.55 0.205 3 / 0.12), 0 6px 16px oklch(0.1 0.02 252 / 0.25); }
.brand-copy { min-width: 0; display: grid; line-height: 1.25; }
.brand-copy strong { font-size: 15px; }
.brand-copy small { margin-top: 2px; color: oklch(0.73 0.018 250); font-size: 11px; }
.nav { flex: 1; overflow-y: auto; padding: 15px 10px; }
.nav-group { margin: 12px 10px 6px; color: oklch(0.67 0.018 250); font-size: 11px; font-weight: 700; }
.nav-item { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px; margin: 3px 0; padding: 8px 11px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: oklch(0.75 0.018 250); text-align: left; transition: color 160ms ease, background 160ms ease, border-color 160ms ease; }
.nav-item:hover { color: white; background: var(--sidebar-hover); border-color: var(--sidebar-line); }
.nav-item.active { color: white; background: oklch(0.29 0.035 252); border-color: oklch(0.4 0.045 252); box-shadow: 0 5px 14px oklch(0.1 0.02 252 / 0.2); }
.nav-item.active .nav-icon { color: oklch(0.83 0.12 3); }
.nav-icon { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 auto; }
.nav-icon svg { width: 19px; height: 19px; }
.nav-count { min-width: 21px; height: 21px; margin-left: auto; display: inline-grid; place-items: center; border-radius: 99px; background: var(--accent); color: white; font-size: 11px; font-weight: 800; }
.sidebar-foot { min-height: 72px; display: grid; gap: 3px; align-content: center; padding: 12px 18px; border-top: 1px solid var(--sidebar-line); color: oklch(0.7 0.018 250); }
.sidebar-foot small { font-size: 10px; }
.service-state { display: flex; align-items: center; gap: 7px; color: oklch(0.86 0.025 150); font-size: 11px; }
.service-state i, .status-signal i, .inline-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.sidebar-overlay { display: none; position: fixed; inset: var(--demo-height) 0 0 0; z-index: 39; border: 0; background: oklch(0.12 0.02 252 / 0.48); }
.stage { min-width: 0; grid-column: 2; }
.topbar { height: var(--topbar-height); position: sticky; top: var(--demo-height); z-index: var(--z-topbar); display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 28px; background: oklch(1 0 0 / 0.94); border-bottom: 1px solid var(--line); box-shadow: 0 4px 18px oklch(0.18 0.025 252 / 0.04); backdrop-filter: blur(14px); }
.topbar-context, .topbar-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-context small, .user-copy small { color: var(--muted); font-size: 11px; }
.topbar h1 { margin: 1px 0 0; font-size: 15px; line-height: 1.3; }
.menu-button { display: none !important; }
.version-button { min-width: 92px; display: grid; justify-items: end; padding: 4px 12px 4px 8px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); line-height: 1.25; }
.version-button:hover { color: var(--accent); background: var(--bg); }
.version-button small { font-size: 10px; }
.version-button strong { color: var(--ink); font-size: 12px; }
.user-copy { display: grid; text-align: right; line-height: 1.25; }
.user-copy strong { font-size: 13px; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; }

.main { width: min(1480px, 100%); margin: 0 auto; padding: 28px 30px 48px; }
.view { display: none; }
.view.active { display: block; }
.page-head { min-height: 52px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.page-head h2, .section-head h3, .detail-head h3, .proxy-current h3 { margin: 0; text-wrap: balance; }
.page-head h2 { font-size: 21px; line-height: 1.3; }
.page-head p, .section-head p { margin: 5px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid transparent; border-radius: 7px; font-weight: 680; transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease; }
.button svg { width: 17px; height: 17px; }
.button.primary { background: var(--accent); border-color: var(--accent); color: white; box-shadow: 0 5px 14px oklch(0.55 0.205 3 / 0.18); }
.button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.button.secondary:hover { border-color: oklch(0.7 0.03 250); background: var(--surface-soft); }
.button.wide { width: 100%; }
.button.light { background: white; border-color: white; color: var(--sidebar); }
.button.ghost-dark { background: transparent; border-color: oklch(0.42 0.025 252); color: oklch(0.86 0.01 250); }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); }
.icon-button:hover { color: var(--ink); background: var(--bg); }
.icon-button.dark { border-color: oklch(0.4 0.025 252); background: transparent; color: white; }
.icon-button svg { width: 18px; height: 18px; }
.text-button { border: 0; background: transparent; color: var(--accent); font-weight: 700; }

.status-band { min-height: 96px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); overflow: hidden; }
.status-band > div { min-width: 0; display: grid; align-content: center; gap: 2px; padding: 16px 20px; }
.status-band > div + div { border-left: 1px solid var(--line); }
.status-band span, .status-band small { color: var(--muted); font-size: 11px; }
.status-band strong { margin-top: 2px; font-size: 20px; line-height: 1.2; }
.status-signal { display: inline-flex; align-items: center; gap: 7px; width: fit-content; }
.status-signal.ok { color: oklch(0.43 0.12 148); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.75fr); gap: 18px; align-items: start; }
.account-workspace, .account-detail, .activity-section, .scan-primary, .scan-aside, .filter-bar, .jobs, .proxy-accounts, .proxy-form, .api-form, .response-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-soft); }
.section-head { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.section-head.compact { min-height: 68px; }
.section-head h3 { font-size: 15px; }
.section-head p { font-size: 11px; }
.search { width: min(250px, 46%); height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--muted); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { width: 16px; height: 16px; flex: 0 0 auto; }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.account-list { max-height: 496px; overflow: auto; }
.account-row { width: 100%; min-height: 78px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 16px; border: 0; border-bottom: 1px solid var(--line); background: white; color: var(--ink); text-align: left; }
.account-row:last-child { border-bottom: 0; }
.account-row:hover { background: var(--surface-soft); }
.account-row.selected { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.account-avatar, .detail-avatar { display: grid; place-items: center; border-radius: 50%; color: white; font-weight: 800; }
.account-avatar { width: 38px; height: 38px; }
.detail-avatar { width: 46px; height: 46px; background: var(--accent); font-size: 16px; }
.account-copy { min-width: 0; display: grid; gap: 3px; }
.account-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-state { display: grid; justify-items: end; gap: 4px; }
.account-state span { font-size: 11px; }
.account-state small { color: var(--faint); font-size: 10px; }
.state-ok { color: oklch(0.43 0.12 148); }
.state-warning { color: oklch(0.48 0.12 75); }
.state-expired { color: var(--red); }
.empty-list { padding: 40px 20px; color: var(--muted); text-align: center; }

.account-detail { position: sticky; top: calc(var(--demo-height) + var(--topbar-height) + 18px); padding: 18px; }
.detail-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.detail-head small, .proxy-current small { color: var(--muted); font-size: 10px; }
.detail-head h3, .proxy-current h3 { margin-top: 2px; font-size: 16px; }
.inline-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 10px; }
.inline-status.ok { color: oklch(0.43 0.12 148); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 8px 0; }
.detail-grid div { min-width: 0; padding: 10px 6px; }
.detail-grid dt { color: var(--muted); font-size: 10px; }
.detail-grid dd { margin: 4px 0 0; overflow: hidden; font-size: 12px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; }
.credential-health { padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); }
.health-label { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.progress { height: 7px; margin: 9px 0 7px; border-radius: 99px; background: oklch(0.9 0.01 250); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width 240ms ease; }
.credential-health small { color: var(--muted); font-size: 10px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.quick-actions button { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); text-align: left; }
.quick-actions button:hover { border-color: var(--accent); background: var(--accent-soft); }
.quick-actions svg { width: 18px; color: var(--accent); }
.quick-actions span { min-width: 0; display: grid; }
.quick-actions strong { font-size: 11px; }
.quick-actions small { color: var(--muted); font-size: 9px; }

.activity-section { margin-top: 18px; }
.activity-table-wrap { overflow-x: auto; }
.activity-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.activity-table th, .activity-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.activity-table th { color: var(--muted); background: var(--surface-soft); font-size: 10px; font-weight: 680; }
.activity-table tbody tr:last-child td { border-bottom: 0; }
.table-account { display: inline-flex; align-items: center; gap: 8px; }
.avatar-xs { width: 25px; height: 25px; display: inline-grid; place-items: center; border-radius: 50%; color: white; font-size: 10px; font-style: normal; font-weight: 800; }
.coral { background: var(--accent); }.blue { background: var(--blue); }.green { background: var(--green); }.amber { background: var(--amber); }
.run-status { min-height: 24px; display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; }
.run-status.success { background: var(--green-soft); color: oklch(0.4 0.13 148); }
.run-status.running { background: var(--blue-soft); color: oklch(0.42 0.13 245); }
.run-status.warning { background: var(--amber-soft); color: oklch(0.43 0.12 70); }

.step-caption { color: var(--muted); font-size: 12px; font-weight: 700; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 18px; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.steps li { position: relative; min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 10px 18px; color: var(--muted); }
.steps li + li { border-left: 1px solid var(--line); }
.steps span { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--bg); font-size: 11px; }
.steps strong { font-size: 12px; }
.steps li.active { color: var(--accent); background: var(--accent-soft); }
.steps li.active span, .steps li.done span { border-color: var(--accent); background: var(--accent); color: white; }
.steps li.done { color: var(--ink); }
.scan-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr); gap: 18px; align-items: start; }
.scan-primary { min-height: 470px; display: grid; place-items: center; padding: 34px; }
.scan-card { width: min(420px, 100%); display: grid; justify-items: center; text-align: center; }
.scan-card h3 { margin: 20px 0 6px; font-size: 17px; }
.scan-card p { max-width: 48ch; margin: 0; color: var(--muted); font-size: 12px; }
.qr-code { width: 210px; aspect-ratio: 1; display: grid; grid-template-columns: repeat(13, 1fr); gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: var(--shadow); }
.qr-code i { background: transparent; }
.qr-code i.on { background: var(--ink); border-radius: 1px; }
.qr-timer { margin-top: 12px; color: var(--muted); font-size: 11px; }
.qr-timer strong { color: var(--ink); }
.scan-demo-action { margin-top: 20px; }
.scan-aside { padding: 18px; }
.scan-aside h3 { margin: 0 0 16px; font-size: 15px; }
.field { display: grid; gap: 6px; }
.field > span, .filter-bar label > span { color: var(--muted); font-size: 11px; font-weight: 680; }
.field select, .field input, .field textarea, .filter-bar select, .filter-bar input { width: 100%; min-height: 39px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: white; color: var(--ink); }
.field textarea { resize: vertical; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; line-height: 1.6; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 15px 0; border-block: 1px solid var(--line); }
.setting-row > span { display: grid; }
.setting-row strong { font-size: 12px; }
.setting-row small { color: var(--muted); font-size: 10px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 42px; height: 23px; position: relative; display: block; border-radius: 99px; background: var(--line-strong); transition: background 160ms ease; }
.switch span::after { content: ""; width: 17px; height: 17px; position: absolute; left: 3px; top: 3px; border-radius: 50%; background: white; box-shadow: 0 1px 4px oklch(0.18 0.02 250 / 0.25); transition: transform 160ms ease; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(19px); }
.security-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 16px; padding: 12px; border-radius: 7px; background: var(--blue-soft); color: oklch(0.4 0.09 245); font-size: 10px; }
.security-note svg { width: 17px; flex: 0 0 auto; }
.scan-success-icon { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.scan-success-icon svg { width: 31px; height: 31px; }
.scan-account-card { width: 100%; margin-top: 20px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; text-align: left; }
.scan-account-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.scan-account-card dt { color: var(--muted); font-size: 9px; }
.scan-account-card dd { margin: 2px 0 0; overflow: hidden; font-size: 11px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.scan-input { width: 100%; margin-top: 14px; text-align: left; }
.scan-finish-actions { display: flex; gap: 8px; margin-top: 18px; }

.filter-bar { display: grid; grid-template-columns: 210px 180px minmax(220px, 1fr); gap: 12px; padding: 14px; }
.filter-bar label { display: grid; gap: 5px; }
.run-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin: 12px 0; padding: 0 4px; color: var(--muted); font-size: 11px; }
.run-summary span { display: inline-flex; align-items: center; gap: 6px; }
.run-summary strong { color: var(--ink); }
.run-summary small { margin-left: auto; }
.dot { width: 7px; height: 7px; border-radius: 50%; }.dot.green { background: var(--green); }.dot.amber { background: var(--amber); }.dot.gray { background: var(--faint); }
.jobs { overflow: hidden; }
.job-row { min-height: 84px; display: grid; grid-template-columns: minmax(230px, 1.2fr) minmax(190px, 0.8fr) 120px 190px; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.job-row:last-child { border-bottom: 0; }
.job-main { min-width: 0; display: flex; align-items: center; gap: 11px; }
.job-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.job-icon svg { width: 18px; }
.job-main > span { min-width: 0; display: grid; }
.job-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-main small, .job-meta small { color: var(--muted); font-size: 10px; }
.job-meta { display: grid; gap: 3px; }
.job-meta strong { font-size: 11px; }
.job-controls { display: flex; justify-content: flex-end; gap: 7px; }
.job-controls .icon-button { width: 34px; height: 34px; }
.job-controls .run-job { color: var(--accent); }
.job-toggle { display: flex; align-items: center; gap: 8px; font-size: 11px; }

.proxy-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.proxy-accounts { overflow: hidden; }
.proxy-account { width: 100%; min-height: 62px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: white; color: var(--ink); text-align: left; }
.proxy-account:last-child { border-bottom: 0; }
.proxy-account:hover { background: var(--surface-soft); }
.proxy-account.selected { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.proxy-account > span:nth-child(2) { min-width: 0; flex: 1; display: grid; }
.proxy-account strong { font-size: 12px; }
.proxy-account small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.proxy-form { padding: 18px; }
.proxy-current { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.mode-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 18px 0; padding: 0; border: 0; }
.mode-options legend { margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.mode-options label { min-width: 0; position: relative; display: flex; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.mode-options label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px oklch(0.55 0.205 3 / 0.08); }
.mode-options input { margin: 2px 0 0; accent-color: var(--accent); }
.mode-options span { min-width: 0; display: grid; }
.mode-options strong { font-size: 11px; }
.mode-options small { color: var(--muted); font-size: 9px; }
.proxy-fields { display: grid; gap: 13px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.proxy-test { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 14px; border: 1px solid oklch(0.86 0.05 148); border-radius: 7px; background: var(--green-soft); }
.proxy-test > div { display: grid; gap: 2px; }
.proxy-test strong { font-size: 12px; }
.proxy-test small { color: oklch(0.45 0.055 148); font-size: 9px; }

.api-layout { display: grid; grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr); gap: 18px; align-items: start; }
.api-form { display: grid; gap: 14px; padding: 18px; }
.response-panel { overflow: hidden; background: oklch(0.18 0.025 252); color: oklch(0.92 0.012 250); }
.response-head { height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid oklch(0.3 0.025 252); }
.response-head span { font-weight: 700; }
.response-head small { color: oklch(0.68 0.018 250); }
.response-panel pre { min-height: 390px; max-height: 560px; margin: 0; overflow: auto; padding: 18px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; line-height: 1.7; white-space: pre-wrap; }

.placeholder-view { min-height: calc(100vh - var(--demo-height) - var(--topbar-height) - 80px); place-items: center; }
.placeholder-view.active { display: grid; }
.placeholder-view > div { max-width: 460px; text-align: center; }
.placeholder-view h2 { margin: 15px 0 6px; }
.placeholder-view p { margin: 0 0 18px; color: var(--muted); }
.placeholder-icon { width: 56px; height: 56px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--accent); box-shadow: var(--shadow-soft); }
.placeholder-icon svg { width: 25px; height: 25px; }

.log-drawer { width: min(560px, 100vw); position: fixed; inset: var(--demo-height) 0 0 auto; z-index: var(--z-drawer); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; background: var(--sidebar); color: white; box-shadow: -18px 0 50px oklch(0.1 0.02 252 / 0.32); transform: translateX(105%); transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1); }
.log-drawer.open { transform: translateX(0); }
.log-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 19px 20px; border-bottom: 1px solid var(--sidebar-line); }
.log-head small { color: oklch(0.7 0.018 250); }
.log-head h2 { margin: 3px 0 0; font-size: 17px; }
.log-meta { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--sidebar-line); color: oklch(0.7 0.018 250); font-size: 10px; }
.log-meta label { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.log-meta input { accent-color: var(--accent); }
.log-output { min-width: 0; margin: 0; overflow: auto; padding: 18px 20px; background: oklch(0.15 0.022 252); color: oklch(0.84 0.035 148); font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.log-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--sidebar-line); }
.drawer-overlay { display: none; position: fixed; inset: var(--demo-height) 0 0 0; z-index: var(--z-overlay); border: 0; background: oklch(0.12 0.02 252 / 0.5); }
.drawer-overlay.open { display: block; }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: var(--z-toast); display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: min(380px, calc(100vw - 32px)); display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 7px; background: white; box-shadow: var(--shadow); animation: toast-in 180ms ease-out; }
.toast i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--green); }
.toast.error i { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 1040px) {
  .status-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-band > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .status-band > div:nth-child(4) { border-top: 1px solid var(--line); }
  .dashboard-grid, .scan-layout { grid-template-columns: minmax(0, 1fr); }
  .account-detail { position: static; }
  .job-row { grid-template-columns: minmax(220px, 1fr) 140px 180px; }
  .job-meta { display: none; }
}

@media (max-width: 820px) {
  :root { --sidebar-width: 260px; --topbar-height: 60px; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { transform: translateX(-105%); transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .sidebar-overlay { display: block; }
  .stage { grid-column: 1; }
  .menu-button { display: grid !important; }
  .topbar { padding: 0 14px; }
  .main { padding: 20px 14px 40px; }
  .user-copy { display: none; }
  .version-button { min-width: 74px; padding-right: 9px; }
  .page-head { align-items: flex-start; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-search { grid-column: 1 / -1; }
  .proxy-layout, .api-layout { grid-template-columns: minmax(0, 1fr); }
  .proxy-accounts > div:last-child { display: flex; overflow-x: auto; }
  .proxy-account { min-width: 210px; border-right: 1px solid var(--line); border-bottom: 0; }
  .mode-options { grid-template-columns: minmax(0, 1fr); }
  .job-row { grid-template-columns: minmax(0, 1fr) 108px; }
  .job-toggle { grid-column: 1; }
  .job-controls { grid-column: 2; grid-row: 1 / span 2; }
}

@media (max-width: 560px) {
  .demo-strip { justify-content: flex-start; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .demo-strip a { margin-left: auto; flex: 0 0 auto; }
  .topbar-actions .user-avatar { display: none; }
  .page-head { display: grid; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .status-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-band > div { padding: 13px; }
  .status-band strong { font-size: 17px; }
  .section-head { align-items: flex-start; }
  .search { width: 48%; }
  .account-row { grid-template-columns: auto minmax(0, 1fr); }
  .account-state { grid-column: 2; justify-items: start; display: flex; gap: 8px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .quick-actions { grid-template-columns: minmax(0, 1fr); }
  .steps strong { display: none; }
  .steps li { justify-content: center; padding-inline: 8px; }
  .scan-primary { min-height: 430px; padding: 24px 16px; }
  .qr-code { width: 190px; }
  .scan-account-card dl { grid-template-columns: minmax(0, 1fr); }
  .scan-finish-actions { width: 100%; display: grid; }
  .filter-bar { grid-template-columns: minmax(0, 1fr); }
  .filter-search { grid-column: auto; }
  .run-summary { gap: 10px; }
  .run-summary small { width: 100%; margin-left: 0; }
  .job-row { grid-template-columns: minmax(0, 1fr) auto; padding: 13px; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .proxy-test { align-items: stretch; flex-direction: column; }
  .log-drawer { top: 0; }
  .drawer-overlay { inset: 0; }
  .toast-region { right: 16px; bottom: 16px; left: 16px; }
  .toast { min-width: 0; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
