:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e5eaf0;
  --text: #152033;
  --muted: #5b6b80;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --accent: #0f766e;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.04);
  --nav-w: 240px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.container-narrow { width: min(480px, calc(100% - 2rem)); margin: 0 auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid transparent; border-radius: 10px;
  padding: .7rem 1.05rem; font-weight: 600; font-size: .95rem;
  cursor: pointer; transition: .15s ease; background: var(--primary); color: #fff;
}
.btn:hover { background: var(--primary-hover); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #f8fafc; }
.btn-accent { background: var(--accent); }
.btn-danger { background: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: .4rem .7rem; font-size: .85rem; border-radius: 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
/* Stacked cards only — not tiles inside a grid */
.card + .card { margin-top: 1rem; }
.grid-2 > .card + .card,
.grid-3 > .card + .card,
.grid-2 > a.card + a.card,
.grid-3 > a.card + a.card {
  margin-top: 0;
}

/* Equal-height tiles used on workbench home + batch counters */
.card-tile {
  min-height: 8.5rem;
  height: 100%;
  margin-top: 0 !important;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.card-tile .h3 {
  margin: 0 0 .5rem;
}
.card-tile > p {
  margin: 0;
  flex: 1;
}
.card-tile .tile-label {
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
  margin: 0;
}
.card-tile .tile-value {
  margin: .35rem 0 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  flex: 1;
  display: flex;
  align-items: flex-end;
}

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; margin: 0 0 .75rem; letter-spacing: -.02em; }
.h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
.h3 { font-size: 1.05rem; margin: 0 0 .5rem; }

.badge {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: .15rem .55rem; font-size: .75rem; font-weight: 600;
  background: #e8eefc; color: #1d4ed8;
}
.badge.success { background: #dcfce7; color: var(--success); }
.badge.warning { background: #ffedd5; color: var(--warning); }
.badge.danger { background: #fee2e2; color: var(--danger); }
.badge.neutral { background: #eef2f7; color: var(--muted); }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .92rem; }
.field .hint { color: var(--muted); font-size: .82rem; margin-top: .3rem; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: .7rem .8rem; font: inherit; background: #fff; color: var(--text);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid rgba(29, 78, 216, .25); border-color: var(--primary);
}
.req { color: var(--danger); }

.alert {
  border-radius: 10px; padding: .85rem 1rem; margin-bottom: 1rem;
  border: 1px solid var(--border); background: #fff;
}
.alert.error { background: #fef2f2; border-color: #fecaca; color: var(--danger); }
.alert.success { background: #f0fdf4; border-color: #bbf7d0; color: var(--success); }
.alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }

/* Public header */
.public-header {
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.public-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .65rem; color: inherit; text-decoration: none; font-weight: 700; }
.sidebar .brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, #1d4ed8, #0f766e);
  color: #fff; display: grid; place-items: center; font-size: .85rem;
}
.nav-links { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-weight: 600; text-decoration: none; }
.nav-links a:hover { color: var(--primary); }

.hero {
  padding: 3rem 0 2rem;
}
.hero-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: 1.2fr .8fr;
  align-items: start;
}
.hero-card ul { margin: .5rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.feature-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
  padding: 1rem 0 3rem;
  align-items: stretch;
}
.feature-grid .card {
  margin-top: 0;
  height: 100%;
  min-height: 8.5rem;
}
.feature-grid .card h3 { margin-top: 0; }

/* App shell — XG Signal workspace language */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.app-shell { min-height: 100dvh; display: flex; }
.sidebar {
  --sidebar-bg: #0b1220;
  --sidebar-text: #d7e1f0;
  --sidebar-muted: #7f90aa;
  width: 264px; background: linear-gradient(180deg, #0d1729 0%, var(--sidebar-bg) 100%);
  border-right: 1px solid rgba(148,163,184,.12); color: var(--sidebar-text);
  padding: 18px 12px 14px; position: fixed; inset: 0 auto 0 0; z-index: 30;
  display: flex; flex-direction: column; gap: 0; overflow: hidden;
}
.sidebar-header { padding: 2px 8px 18px; }
.sidebar .brand {
  color: #fff; margin: 0; padding: 0; gap: .75rem; align-items: center;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px;
  background: linear-gradient(145deg, #2c6cf6 0%, #0f8b88 100%);
  box-shadow: 0 8px 20px rgba(28,106,220,.2); font-size: .95rem; letter-spacing: -.04em;
}
.brand-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-copy strong { font-size: 1rem; letter-spacing: -.02em; line-height: 1.2; }
.brand-copy small { color: #71839f; font-size: .63rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.sidebar-status { display: flex; align-items: center; gap: .45rem; margin: 14px 1px 0; color: #71839f; font-size: .68rem; font-weight: 600; }
.sidebar-status span { width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.1); }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; min-height: 0; overflow-y: auto; padding: 0 1px 8px; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 40px;
  padding: 0 .72rem; border: 1px solid transparent; border-radius: 11px;
  color: var(--sidebar-muted); text-decoration: none; font-size: .88rem; font-weight: 600;
  line-height: 1; transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
.nav-item:hover { color: #f4f8ff; background: rgba(148,163,184,.08); text-decoration: none; }
.nav-item.active {
  color: #f8fbff; background: linear-gradient(100deg, rgba(41,105,220,.28), rgba(38,117,157,.16));
  border-color: rgba(96,165,250,.16); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 8px 18px rgba(2,8,23,.16);
}
.nav-item.active::before { content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #60a5fa; }
.nav-icon { flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: #7085a3; }
.nav-item.active .nav-icon, .nav-item:hover .nav-icon { color: #8fc3ff; }
.sidebar-group { display: flex; flex: 0 0 auto; flex-direction: column; gap: 3px; width: 100%; min-width: 0; margin-top: 13px; }
.sidebar-group-title { color: #71839f; font-size: .62rem; font-weight: 700; letter-spacing: .12em; line-height: 1; padding: 0 .72rem 6px; }
.sidebar-admin-group { margin-top: 15px; padding-top: 13px; border-top: 1px solid rgba(148,163,184,.13); }
.sidebar-flex-spacer { flex: 1 1 auto; min-height: 12px; }
.sidebar-credit-card {
  display: block; margin: 0 2px 10px; padding: 11px 12px 10px; border: 1px solid rgba(96,165,250,.16);
  border-radius: 13px; background: linear-gradient(135deg, rgba(37,99,235,.18), rgba(15,118,110,.12)); color: #e8f2ff;
  text-decoration: none; transition: border-color .16s ease, transform .16s ease;
}
.sidebar-credit-card:hover { border-color: rgba(96,165,250,.38); transform: translateY(-1px); text-decoration: none; }
.credit-card-top { display: flex; align-items: center; justify-content: space-between; color: #91a9c8; font-size: .67rem; font-weight: 700; letter-spacing: .04em; }
.credit-card-icon { width: 15px; height: 15px; fill: none; stroke: #79b9ff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.credit-card-value { margin-top: 4px; font-size: 1.28rem; font-weight: 750; letter-spacing: -.03em; }
.credit-card-value small { color: #91a9c8; font-size: .68rem; font-weight: 600; }
.credit-card-link { display: flex; justify-content: space-between; margin-top: 7px; color: #82baff; font-size: .67rem; font-weight: 700; }
.sidebar-utility { display: flex; flex-direction: column; gap: 3px; padding-top: 7px; border-top: 1px solid rgba(148,163,184,.1); }
.sidebar-utility form { margin: 0; }
.nav-subtle { min-height: 34px; color: #7587a0; font-size: .78rem; }
.nav-subtle .nav-icon { width: 16px; height: 16px; flex-basis: 16px; }
.nav-logout { border: 0; background: transparent; font: inherit; cursor: pointer; text-align: left; }
.sidebar-user { display: flex; align-items: center; gap: .62rem; margin-top: 8px; padding: 9px 8px 0; border-top: 1px solid rgba(148,163,184,.1); color: #d7e1f0; text-decoration: none; }
.sidebar-user:hover { text-decoration: none; }
.user-avatar { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 28px; border-radius: 9px; background: rgba(96,165,250,.22); color: #b9dbff; font-size: .75rem; font-weight: 800; }
.user-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.user-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; }
.user-copy small { color: #71839f; font-size: .64rem; }
.user-chevron { color: #71839f; font-size: 1.2rem; line-height: 1; }
.main {
  margin-left: 264px; flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
.topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  min-height: 60px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem; gap: 1rem; position: sticky; top: 0; z-index: 15;
}
.topbar .credits {
  background: #eff6ff; color: #1d4ed8; font-weight: 700;
  border-radius: 999px; padding: .35rem .75rem; font-size: .9rem;
}
.content { padding: 1.25rem; width: min(1200px, 100%); margin: 0 auto; }
.history-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.history-filters .btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Mobile bottom nav */
.mobile-nav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(255,255,255,.96); border-top: 1px solid var(--border); backdrop-filter: blur(16px);
  padding: .38rem .5rem calc(.38rem + var(--safe-bottom));
  grid-template-columns: repeat(5, 1fr); gap: .25rem;
}
.mobile-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-align: center; color: var(--muted); font-size: .65rem; font-weight: 700;
  text-decoration: none; padding: .3rem .2rem; border-radius: 9px;
}
.mobile-nav-icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mobile-nav a.active { color: var(--primary); background: #eff6ff; }

/* Wizard */
.steps {
  display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.step-pill {
  border-radius: 999px; border: 1px solid var(--border); background: #fff;
  padding: .35rem .7rem; font-size: .8rem; color: var(--muted); font-weight: 600;
}
.step-pill.active { background: #eff6ff; border-color: #bfdbfe; color: var(--primary); }
.step-pill.done { background: #ecfdf5; border-color: #a7f3d0; color: var(--success); }
.wizard-panel { display: none; }
.wizard-panel.active { display: block; }
.mp-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem;
}
.mp-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.05rem;
  min-height: 4.5rem;
  background: #fff;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.mp-card:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}
.mp-card:focus-visible {
  outline: 2px solid rgba(29, 78, 216, .35);
  outline-offset: 2px;
}
/* Enlarge hit target: checkbox visual only, whole label receives clicks */
.mp-card input[type="checkbox"] {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary);
}
.mp-card strong {
  display: block;
  padding-right: 1.75rem;
  pointer-events: none;
}
.mp-card .small {
  pointer-events: none;
  margin-top: .25rem;
}
.mp-card.selected {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px var(--primary);
}
.cost-box {
  background: #f8fafc; border: 1px dashed var(--border); border-radius: 12px;
  padding: .9rem 1rem; margin-top: 1rem;
}
.sticky-actions {
  position: sticky; bottom: 0; background: linear-gradient(180deg, transparent, var(--bg) 28%);
  padding: 1rem 0 calc(.5rem + var(--safe-bottom)); margin-top: 1rem;
  display: flex; gap: .75rem; justify-content: flex-end;
}
.sticky-actions .btn { min-width: 120px; }

/* Results */
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab {
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: .4rem .85rem; font-weight: 600; font-size: .88rem; cursor: pointer; color: var(--muted);
}
.tab.active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.result-block { margin-bottom: 1rem; }
.result-block header {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .45rem;
}
.result-box {
  background: #f8fafc; border: 1px solid var(--border); border-radius: 10px;
  padding: .85rem 1rem; white-space: pre-wrap; word-break: break-word; font-size: .95rem;
}
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td {
  border-bottom: 1px solid var(--border); text-align: left; padding: .65rem .5rem; vertical-align: top;
}
table.data th { color: var(--muted); font-weight: 600; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: stretch;
}
.grid-2 > .card,
.grid-3 > .card,
.grid-2 > a.card,
.grid-3 > a.card {
  margin-top: 0;
  height: 100%;
  min-height: 8.5rem;
  box-sizing: border-box;
}

/* Batch progress steps */
.batch-steps {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.batch-step {
  flex: 1;
  min-width: 7rem;
  text-align: center;
  padding: .7rem .6rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
  font-size: .9rem;
}
.batch-step.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--primary);
  box-shadow: inset 0 0 0 1px #93c5fd;
}
.batch-step.done {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: var(--success);
}
.batch-step.failed {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
}
.badge.status-queued { background: #eef2f7; color: var(--muted); }
.badge.status-processing { background: #eff6ff; color: var(--primary); }
.badge.status-done { background: #dcfce7; color: var(--success); }
.badge.status-failed { background: #fee2e2; color: var(--danger); }
.badge.status-partial { background: #ffedd5; color: var(--warning); }

.footer-note {
  color: var(--muted); font-size: .82rem; padding: 2rem 0;
  border-top: 1px solid var(--border); margin-top: 2rem;
}

.menu-toggle { display: none; }
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 29;
}
.sidebar.open { transform: none; }

@media (max-width: 900px) {
  .hero-grid, .feature-grid, .grid-2, .grid-3, .mp-grid { grid-template-columns: 1fr; }
  .menu-toggle { display: inline-flex; }
  .sidebar {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(326px, calc(100vw - 24px));
    z-index: 40;
    box-shadow: 8px 0 24px rgba(0,0,0,.2);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .2s ease, visibility .2s ease;
  }
  .sidebar.open { display: flex; flex-direction: column; transform: translateX(0); visibility: visible; }
  .main { margin-left: 0; padding-bottom: 72px; }
  .mobile-nav { display: grid; }
  .sticky-actions {
    position: fixed; left: 0; right: 0; bottom: 58px;
    background: #fff; border-top: 1px solid var(--border);
    padding: .75rem 1rem calc(.75rem + var(--safe-bottom));
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .06);
    z-index: 35;
  }
  .sticky-actions .btn { flex: 1; }
  .content { padding: 1rem; padding-bottom: 7rem; }
  .topbar { padding: 0 .9rem; }
}

/* —— AI workbench launcher / batch hub (2026 SaaS) —— */
.eyebrow {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .5rem;
}
.launcher-hero { margin-bottom: 1.25rem; }
.launcher-lead { max-width: 40rem; margin: 0 0 .75rem; }
.launcher-balance {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .75rem; border-radius: 999px;
  background: #eef2ff; color: #3730a3; font-size: .9rem;
}
.launcher-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.launcher-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) {
  .launcher-grid, .launcher-grid-2 { grid-template-columns: 1fr; }
}
.launch-card {
  display: flex; flex-direction: column; gap: .35rem;
  padding: 1.25rem 1.3rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #fff 0%, #f8fafc 100%);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  min-height: 9.5rem;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.launch-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 8px 28px rgba(29, 78, 216, .08);
  transform: translateY(-1px);
  text-decoration: none;
}
.launch-card-accent {
  background: linear-gradient(165deg, #f0f9ff 0%, #fff 55%);
  border-color: #bae6fd;
}
.launch-card-btn {
  width: 100%; text-align: left; cursor: pointer; font: inherit;
}
.launch-card-btn.selected {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.launch-kicker {
  font-size: .75rem; font-weight: 700; color: var(--accent); letter-spacing: .02em;
}
.launch-cta {
  margin-top: auto; font-size: .9rem; font-weight: 700; color: var(--primary);
}
.launcher-quick {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
  margin-top: 1.1rem;
}
.chip {
  display: inline-flex; align-items: center;
  padding: .35rem .7rem; border-radius: 999px;
  border: 1px solid var(--border); background: #fff;
  font-size: .82rem; font-weight: 600; color: var(--text);
  text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: #93c5fd; text-decoration: none; }
.chip-toggle.selected, .chip.selected {
  background: #eff6ff; border-color: #93c5fd; color: var(--primary);
}
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; }

.stepper {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin: 1rem 0 1.1rem;
}
.stepper .step {
  flex: 1; min-width: 4.5rem; text-align: center;
  padding: .55rem .4rem; border-radius: 999px;
  border: 1px solid var(--border); background: #f8fafc;
  font-size: .8rem; font-weight: 700; color: var(--muted);
}
.stepper .step.active {
  background: #eff6ff; border-color: #93c5fd; color: var(--primary);
}
.stepper .step.done {
  background: #ecfdf5; border-color: #a7f3d0; color: var(--success);
}

.scheme-list { display: grid; gap: .65rem; }
.scheme-card {
  display: block; width: 100%; text-align: left;
  padding: 1rem 1.1rem; border-radius: 14px;
  border: 1px solid var(--border); background: #fff;
  cursor: pointer; font: inherit;
}
.scheme-card:hover { border-color: #93c5fd; }
.scheme-card.selected {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  background: #f8faff;
}
.scheme-card .scheme-name { font-weight: 700; margin: 0 0 .25rem; }
.scheme-card .scheme-meta { font-size: .82rem; color: var(--muted); }

.sticky-actions-inline {
  display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem;
}
.advanced-block {
  margin: .75rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .65rem .9rem;
  background: #fafbfc;
}
.advanced-block summary {
  cursor: pointer; font-weight: 700; font-size: .92rem; color: var(--muted);
}
.card.nested { box-shadow: none; background: #f8fafc; }

@media (max-width: 900px) {
  .sticky-actions-inline {
    position: sticky; bottom: 64px; z-index: 20;
    background: linear-gradient(180deg, transparent, #f4f6f9 28%);
    padding-top: .5rem; padding-bottom: .25rem;
  }
  .sticky-actions-inline .btn { flex: 1; min-width: 7rem; }
}

/* Single-product mode switch */
.wizard-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: .75rem;
}
.mode-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.mode-tag {
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 999px;
  padding: .3rem .75rem;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  color: var(--muted);
}
.mode-tag.active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: var(--primary);
}
.mode-hint { width: 100%; }

/* AI extract loading on 我的工作流 */
.wf-extract-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  margin: .25rem 0 .5rem;
}
.wf-extract-status {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
}
.wf-extract-status.loading { color: var(--primary); }
.wf-extract-status.success { color: var(--success); }
.wf-extract-status.error { color: var(--danger); }
.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid #c7d2fe;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
#wf-extract:disabled {
  opacity: .7;
  cursor: not-allowed;
}
@media (max-width: 900px) {
  .wf-extract-row { flex-direction: column; align-items: stretch; }
  .wf-extract-row .btn { width: 100%; }
}
