:root {
  --bg: #f3f5fa;
  --panel: #ffffff;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --faint: #98a2b3;
  --line: #e5e9f2;
  --line-strong: #d5dbe8;
  --blue: #1b4dff;
  --blue-deep: #0a2fb8;
  --blue-soft: #edf1ff;
  --cyan: #06a7c7;
  --green: #0a9b6d;
  --green-soft: #e8f8f1;
  --red: #d92d20;
  --red-soft: #fef0ee;
  --amber: #b45309;
  --amber-soft: #fff7e6;
  --navy: #0b1222;
  --navy-2: #101a31;
  --radius: 16px;
  --shadow: 0 14px 34px rgba(17, 24, 39, 0.06), 0 2px 6px rgba(17, 24, 39, 0.03);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(1100px 520px at 82% -8%, #e8eeff 0%, rgba(232, 238, 255, 0) 62%),
    radial-gradient(760px 420px at 4% 30%, #eef8ff 0%, rgba(238, 248, 255, 0) 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); }

.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  padding: 22px 16px 18px;
  color: #dbe4ff;
  background:
    radial-gradient(420px 260px at 20% 0%, rgba(43, 88, 255, 0.35), transparent 65%),
    linear-gradient(180deg, #0b1222 0%, #0c1529 60%, #0a1220 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 62%);
}
.sidebar > * { position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 4px 10px; }
.brand-mark {
  overflow: hidden;
  padding: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #4f7cff 0%, #1b4dff 55%, #0b2fa8 100%);
  box-shadow: 0 10px 22px rgba(27, 77, 255, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.brand-logo { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.brand strong { display: block; color: #fff; font-size: 16px; letter-spacing: 0.01em; }
.brand small { display: block; margin-top: 2px; color: #8798bd; font-size: 10.5px; letter-spacing: 0.03em; }
.side-section-label {
  padding: 0 10px;
  color: #6d7fa6;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.side-nav { display: grid; gap: 4px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 11px;
  border-radius: 10px;
  color: #aebcdc;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.side-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(59, 103, 255, 0.4), rgba(59, 103, 255, 0.12));
  box-shadow: inset 0 0 0 1px rgba(110, 145, 255, 0.25);
}
.side-link.active .ico { color: #8fb0ff; }
.side-link .side-dot {
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: #6f8dff;
  box-shadow: 0 0 0 4px rgba(111, 141, 255, 0.12);
}
.side-scenarios { display: grid; gap: 5px; }
.side-scenario {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #9fb0d4;
  background: transparent;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.side-scenario:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.side-scenario span { color: #7184ad; font-size: 10px; }
.side-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(130, 160, 255, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(52, 92, 220, 0.18), rgba(16, 26, 49, 0.5));
}
.side-note .ico { color: #87a6ff; }
.side-note strong { display: block; margin: 8px 0 4px; color: #f4f7ff; font-size: 12.5px; }
.side-note p { margin: 0; color: #8fa1c6; font-size: 11px; line-height: 1.55; }
.side-footer { margin-top: auto; color: #5d6f94; font-size: 10px; letter-spacing: 0.05em; padding: 0 4px; }

/* ---------- Main / topbar ---------- */
.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 30px;
  background: rgba(243, 245, 250, 0.84);
  border-bottom: 1px solid rgba(220, 226, 240, 0.8);
  backdrop-filter: blur(16px);
}
.breadcrumb { color: var(--faint); font-size: 11px; letter-spacing: 0.02em; }
.breadcrumb span { margin: 0 6px; color: #c3cad9; }
.topbar h1 { margin: 4px 0 0; font-size: 18px; letter-spacing: -0.01em; }
.topbar-right { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-green { color: var(--green); background: var(--green-soft); border-color: #c9f0df; }
.badge-blue { color: var(--blue); background: var(--blue-soft); border-color: #d6e0ff; }
.badge-ghost { background: rgba(255, 255, 255, 0.6); }
.content { max-width: 1560px; margin: 0 auto; padding: 24px 30px 54px; }
.view { display: none; animation: viewIn 0.28s ease; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 28px;
  padding: 34px;
  overflow: hidden;
  color: #fff;
  border-radius: 24px;
  background:
    radial-gradient(620px 320px at 82% 8%, rgba(65, 122, 255, 0.55), transparent 64%),
    radial-gradient(460px 260px at 4% 110%, rgba(0, 195, 255, 0.18), transparent 62%),
    linear-gradient(135deg, #0a1020 0%, #101d3d 52%, #15377f 100%);
  box-shadow: 0 22px 50px rgba(11, 18, 34, 0.18);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(100deg, transparent 20%, #000 100%);
}
.hero > * { position: relative; z-index: 1; }
.eyebrow {
  display: inline-block;
  color: #8fb0ff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.hero h2 {
  margin: 12px 0 12px;
  font-size: clamp(28px, 3.1vw, 42px);
  line-height: 1.16;
  letter-spacing: -0.035em;
}
.hero h2 em { color: #9bb8ff; font-style: normal; }
.hero-copy p { max-width: 610px; margin: 0; color: #a9b8d8; font-size: 13.5px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-actions .btn-ghost { background: rgba(255, 255, 255, 0.08); color: #e8efff; border-color: rgba(255, 255, 255, 0.18); }
.hero-actions .btn-ghost:hover { background: rgba(255, 255, 255, 0.14); }
.hero-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  padding: 18px;
  border: 1px solid rgba(150, 180, 255, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.045));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
}
.flow-node {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(5, 12, 28, 0.36);
  color: #eef3ff;
  font-size: 12.5px;
  font-weight: 700;
}
.flow-arrow .ico { width: 13px; height: 13px; }
.flow-node span { display: block; margin-top: 3px; color: #8598bd; font-size: 10.5px; font-weight: 500; }
.flow-node.active { border-color: rgba(115, 151, 255, 0.5); background: rgba(43, 80, 190, 0.3); }
.flow-arrow { display: flex; align-items: center; justify-content: center; height: 14px; color: #6d84b7; font-size: 12px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 5px;
}
.hero-stats div {
  padding: 10px 11px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.hero-stats b { display: block; font-size: 18px; color: #fff; font-variant-numeric: tabular-nums; }
.hero-stats span { display: block; margin-top: 2px; color: #8194bb; font-size: 9.5px; letter-spacing: 0.04em; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.metric {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.03);
}
.metric-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--blue);
  background: var(--blue-soft);
}
.metric b { display: block; font-size: 20px; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.metric span { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; }

/* ---------- Stepper ---------- */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 24px 0 14px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}
.step { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.step-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 10px;
  color: var(--muted);
  background: #f0f3fa;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: all 0.2s ease;
}
.step-copy strong { display: block; font-size: 12.5px; }
.step-copy span { display: block; margin-top: 1px; color: var(--faint); font-size: 10px; }
.step.active .step-num { color: #fff; background: var(--blue); box-shadow: 0 7px 16px rgba(27, 77, 255, 0.28); }
.step.done .step-num { color: var(--green); background: var(--green-soft); }
.step.done .step-num::after { content: "✓"; font-size: 13px; }
.step.done .step-num span { display: none; }
.step-line { flex: 0 0 54px; height: 1px; margin: 0 14px; background: var(--line); }

/* ---------- Panels ---------- */
.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.step-kicker { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.panel-head h3 { margin: 6px 0 4px; font-size: 19px; letter-spacing: -0.02em; }
.panel-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.panel-chip {
  flex: none;
  padding: 7px 10px;
  border: 1px solid #dbe4ff;
  border-radius: 9px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.panel-chip b { font-size: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  border: 0;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { color: #fff; background: var(--blue); box-shadow: 0 9px 20px rgba(27, 77, 255, 0.24); }
.btn-primary:hover { background: #1240e6; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { color: var(--ink-2); background: #fff; border: 1px solid var(--line-strong); }
.btn-ghost:hover { border-color: #b9c5dc; background: #fbfcff; }
.btn-dark { color: #fff; background: var(--navy); }
.btn-dark:hover { background: #16213b; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 11.5px; border-radius: 9px; }
.text-btn { padding: 3px; border: 0; color: var(--blue); background: none; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.text-btn:hover { color: var(--blue-deep); }
.text-btn.danger { color: var(--red); }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}

/* ---------- Step 1: scenarios ---------- */
.step1-grid { display: grid; grid-template-columns: minmax(0, 1fr) 302px; gap: 16px; }
.scenario-grid { display: grid; gap: 10px; }
.scenario-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: start;
  width: 100%;
  padding: 17px 17px 15px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.scenario-card:hover { border-color: #b9c8f8; transform: translateY(-1px); }
.scenario-card.selected {
  border-color: var(--blue);
  background: linear-gradient(180deg, #f8faff 0%, #fff 82%);
  box-shadow: 0 0 0 3px rgba(27, 77, 255, 0.08);
}
.scenario-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--blue);
  background: linear-gradient(145deg, #edf2ff, #dfe8ff);
}
.scenario-card.selected .scenario-icon { color: #fff; background: linear-gradient(135deg, #4f7cff, #1b4dff); box-shadow: 0 8px 16px rgba(27, 77, 255, 0.22); }
.scenario-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.scenario-title h4 { margin: 0; font-size: 15px; letter-spacing: -0.01em; }
.scenario-meta { margin-top: 3px; color: var(--faint); font-size: 10.5px; }
.scenario-desc { margin: 7px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.55; }
.scenario-tag {
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}
.scenario-check {
  position: relative;
  width: 19px;
  height: 19px;
  margin-top: 2px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
}
.scenario-card.selected .scenario-check { border-color: var(--blue); background: var(--blue); }
.scenario-card.selected .scenario-check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2.5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.rail {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 18px;
  border: 1px solid #dfe7fa;
  border-radius: 16px;
  background: linear-gradient(180deg, #f7faff 0%, #fbfdff 100%);
}
.rail-label { color: var(--faint); font-size: 9.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.rail-scenario {
  padding: 12px 13px;
  border: 1px solid #d8e3ff;
  border-radius: 11px;
  color: var(--blue);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}
.rail-scenario small { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; font-weight: 500; }
.rail-row { display: flex; align-items: center; justify-content: space-between; padding: 2px 1px; color: var(--muted); font-size: 11.5px; }
.rail-row b { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px dashed #dce5f7; color: var(--ink-2); font-size: 11.5px; font-weight: 600; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex: none;
  border-radius: 999px;
  background: #c9d2e5;
  transition: background 0.2s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.2);
  transition: transform 0.2s ease;
}
.switch-row input:checked + .switch { background: var(--blue); }
.switch-row input:checked + .switch::after { transform: translateX(16px); }
.rail-note { color: var(--faint); font-size: 10px; line-height: 1.55; }
.rail-divider { height: 1px; background: #e1e9f8; }
.rail-mini { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.rail-mini .ico { color: var(--green); }
.step-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 17px; border-top: 1px dashed var(--line); }
.footer-hint { color: var(--faint); font-size: 10.5px; line-height: 1.5; }
.footer-hint b { color: var(--ink-2); }

/* ---------- Step 2: config ---------- */
.config-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; }
.field-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; color: var(--ink-2); font-size: 11.5px; font-weight: 800; }
.field-label span { color: var(--faint); font-size: 10px; font-weight: 500; }
.id-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.id-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 84px;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: all 0.16s ease;
}
.id-card:hover { border-color: #b9c8f8; transform: translateY(-1px); }
.id-card.selected { border-color: var(--blue); background: #f7faff; box-shadow: 0 0 0 3px rgba(27, 77, 255, 0.07); }
.id-card-top { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 8px; }
.id-card strong { font-size: 12.5px; }
.id-card small { color: var(--faint); font-size: 9.5px; }
.id-card .mini-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; }
.mini-tag { padding: 2px 5px; border-radius: 4px; color: #5c6b8a; background: #f0f3fa; font-size: 8.5px; font-weight: 700; letter-spacing: 0.03em; }
.id-card.selected .mini-tag { color: var(--blue); background: #e8eeff; }
.id-card .method-count { color: var(--faint); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.config-aside { display: flex; flex-direction: column; gap: 14px; padding-left: 20px; border-left: 1px solid var(--line); }
.method-stack { display: grid; gap: 7px; }
.method-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 10px 11px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.16s ease;
}
.method-card:hover:not(:disabled) { border-color: #b9c8f8; }
.method-card.selected { border-color: var(--blue); background: #f7faff; }
.method-card:disabled { opacity: 0.42; cursor: not-allowed; background: #fafbfe; }
.method-radio { width: 15px; height: 15px; border: 1.5px solid var(--line-strong); border-radius: 50%; background: #fff; }
.method-card.selected .method-radio { border: 4px solid var(--blue); }
.method-copy strong { display: block; font-size: 11.5px; }
.method-copy span { display: block; margin-top: 2px; color: var(--faint); font-size: 9.5px; line-height: 1.4; }
.method-out { color: var(--faint); font-family: var(--mono); font-size: 9px; }
.combo-preview { padding: 12px 13px; border: 1px solid #dbe4ff; border-radius: 11px; background: var(--blue-soft); }
.combo-preview span { display: block; color: #5a73b5; font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; }
.combo-preview strong { display: block; margin: 4px 0 5px; color: var(--blue-deep); font-size: 13px; }
.combo-preview code { display: block; color: #3f5590; font-family: var(--mono); font-size: 9.5px; line-height: 1.5; word-break: break-word; }
.quick-test { padding-top: 3px; }
.quick-input-row { display: flex; gap: 6px; }
.quick-input-row input {
  min-width: 0;
  flex: 1;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
  outline: none;
}
.quick-input-row input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27, 77, 255, 0.08); }
.quick-input-row button { padding: 0 12px; border: 0; border-radius: 9px; color: #fff; background: var(--navy); font-size: 11px; font-weight: 700; cursor: pointer; }
.quick-output { display: flex; align-items: flex-start; gap: 7px; margin-top: 7px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfe; }
.quick-output span { flex: none; color: var(--faint); font-size: 9px; padding-top: 1px; }
.quick-output code { min-width: 0; flex: 1; color: var(--ink-2); font-family: var(--mono); font-size: 9.5px; line-height: 1.45; word-break: break-all; }
.quick-output button { flex: none; padding: 0; border: 0; color: var(--blue); background: none; font-size: 9px; font-weight: 700; cursor: pointer; }
.rule-note { margin-top: 10px; padding: 9px 10px; border-left: 2px solid #c8d6ff; color: var(--muted); background: #fafbff; font-size: 9.5px; line-height: 1.55; }

/* ---------- Step 3: upload ---------- */
.upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) 322px; gap: 20px; }
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 28px 20px 24px;
  text-align: center;
  border: 1.5px dashed #b9c8f8;
  border-radius: 15px;
  background:
    radial-gradient(380px 160px at 50% 0%, #f0f5ff 0%, transparent 80%),
    #fbfcff;
  cursor: pointer;
  transition: all 0.18s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--blue); background: #f6f9ff; box-shadow: inset 0 0 0 3px rgba(27, 77, 255, 0.04); }
.drop-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 5px;
  border-radius: 12px;
  color: var(--blue);
  background: #eaf0ff;
}
.dropzone strong { font-size: 13px; }
.dropzone span { color: var(--faint); font-size: 10.5px; line-height: 1.5; }
.dropzone .btn { margin-top: 8px; }
.upload-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 10px 2px 0; }
.file-chip {
  display: none;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid #dbe4ff;
  border-radius: 7px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 10px;
  font-weight: 600;
}
.file-chip.show { display: inline-flex; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paste-box { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfe; }
.paste-box textarea {
  width: 100%;
  min-height: 108px;
  padding: 10px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
  outline: none;
}
.paste-box textarea:focus { border-color: var(--blue); }
.paste-actions { display: flex; gap: 7px; margin-top: 8px; }
.progress { position: relative; height: 24px; margin-top: 12px; overflow: hidden; border-radius: 7px; background: #eef2fa; }
.progress .bar { height: 100%; width: 0; background: linear-gradient(90deg, #4f7cff, #1b4dff); transition: width 0.18s ease; }
.progress span { position: absolute; inset: 0; display: grid; place-items: center; color: #33415c; font-size: 9.5px; font-weight: 700; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.stats-row div { padding: 9px 11px; border: 1px solid #e6ecfb; border-radius: 10px; background: #f8faff; }
.stats-row span { display: block; color: var(--faint); font-size: 9px; letter-spacing: 0.04em; }
.stats-row b { display: block; margin-top: 2px; font-size: 16px; font-variant-numeric: tabular-nums; }
.stats-row b.good { color: var(--green); }
.stats-row b.bad { color: var(--red); }
.table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.preview-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.preview-table th {
  padding: 9px 10px;
  text-align: left;
  color: var(--muted);
  background: #f8faff;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.preview-table th:nth-child(1) { width: 38px; }
.preview-table th:nth-child(2) { width: 22%; }
.preview-table th:nth-child(3) { width: 22%; }
.preview-table th:nth-child(5) { width: 72px; }
.preview-table td { padding: 9px 10px; border-bottom: 1px solid #f0f3f9; font-size: 10px; vertical-align: middle; }
.preview-table tr:last-child td { border-bottom: 0; }
.preview-table tr.row-error td { background: #fffafa; }
.preview-table .idx { color: var(--faint); font-family: var(--mono); }
.preview-table .raw { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.preview-table code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #33415c; font-family: var(--mono); font-size: 9.5px; }
.preview-table .hash-cell code { color: var(--blue-deep); }
.status-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 5px; font-size: 8.5px; font-weight: 800; white-space: nowrap; }
.status-ok { color: var(--green); background: var(--green-soft); }
.status-dup { color: var(--amber); background: var(--amber-soft); }
.status-error { color: var(--red); background: var(--red-soft); }
.empty-row td { padding: 34px 10px !important; text-align: center; color: var(--faint); font-size: 11px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; border-top: 1px solid var(--line); background: #fafbfe; }
.table-footer > span { color: var(--faint); font-size: 9.5px; }
.pager { display: flex; align-items: center; gap: 7px; }
.pager button { padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-2); background: #fff; font-size: 9px; cursor: pointer; }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.pager span { color: var(--muted); font-family: var(--mono); font-size: 9px; }
.export-rail { display: flex; flex-direction: column; gap: 9px; padding: 17px; border: 1px solid #dfe7fa; border-radius: 16px; background: linear-gradient(180deg, #f8faff, #fcfdff); }
.export-summary { padding: 11px 12px; border: 1px solid #dbe4ff; border-radius: 10px; background: #fff; }
.export-summary span { display: block; color: var(--faint); font-size: 9px; }
.export-summary strong { display: block; margin: 3px 0 7px; color: var(--blue-deep); font-size: 12px; }
.export-summary b { color: var(--ink); font-size: 19px; font-variant-numeric: tabular-nums; }
.check-row { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 10.5px; cursor: pointer; }
.check-row input { accent-color: var(--blue); }
.submit-card { margin-top: 3px; padding: 12px; border: 1px solid #dce4f5; border-radius: 11px; background: #fff; }
.submit-head { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 10.5px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.1); }
.submit-head strong { font-size: 11px; }
.submit-card p { margin: 6px 0 9px; color: var(--faint); font-size: 9.5px; line-height: 1.5; }
.privacy-note { margin: 2px 0 0; color: var(--faint); font-size: 9px; line-height: 1.5; }

/* ---------- Matrix view ---------- */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 4px 2px 18px; }
.view-head h2 { margin: 7px 0 6px; font-size: 28px; letter-spacing: -0.035em; }
.view-head p { max-width: 720px; margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.metric-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 14px; }
.metric-card { padding: 17px 17px 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 4px 12px rgba(17, 24, 39, 0.03); }
.metric-card b { display: block; font-size: 31px; line-height: 1; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.metric-card span { display: block; margin-top: 6px; color: var(--ink-2); font-size: 11.5px; font-weight: 700; }
.metric-card small { display: block; margin-top: 3px; color: var(--faint); font-size: 9.5px; line-height: 1.4; }
.metric-card.accent { color: #fff; background: linear-gradient(145deg, #0b1222, #173a8f); border-color: transparent; }
.metric-card.accent span { color: #dbe6ff; }
.metric-card.accent small { color: #8fa8dc; }
.matrix-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 10px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; font-size: 10.5px; font-weight: 700; cursor: pointer; }
.chip:hover { border-color: #b9c8f8; color: var(--blue); }
.chip.active { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 5px 12px rgba(27, 77, 255, 0.2); }
.matrix-note { color: var(--faint); font-size: 10px; }
.matrix-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.matrix-table { width: 100%; min-width: 880px; border-collapse: collapse; }
.matrix-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 13px;
  text-align: left;
  color: var(--muted);
  background: #f8faff;
  border-bottom: 1px solid var(--line);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.matrix-table td { padding: 12px 13px; border-bottom: 1px solid #f0f3f9; font-size: 11px; vertical-align: middle; }
.matrix-table tr:last-child td { border-bottom: 0; }
.matrix-table tr:hover td { background: #fbfcff; }
.matrix-family { color: var(--faint); font-size: 9.5px; }
.matrix-id { font-weight: 700; }
.matrix-id small { display: block; margin-top: 2px; color: var(--faint); font-size: 9px; font-weight: 500; }
.method-cell { text-align: center; }
.method-cell.dim { opacity: .3; }
.method-cell .dot { display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 6px; font-size: 10px; font-weight: 800; }
.dot.yes { color: var(--green); background: var(--green-soft); }
.dot.no { color: #c4cbda; background: #f6f8fc; }
.method-cell .label { display: block; max-width: 112px; margin: 4px auto 0; color: var(--faint); font-family: var(--mono); font-size: 8px; line-height: 1.3; word-break: break-word; }
.scenario-inline { display: flex; flex-wrap: wrap; gap: 3px; }
.scene-pill { padding: 3px 6px; border-radius: 4px; background: #f0f3fa; color: #66758f; font-size: 8.5px; font-weight: 700; }
.scene-pill.on { color: var(--blue); background: var(--blue-soft); }
.callout { display: flex; gap: 11px; margin-top: 14px; padding: 14px 16px; border: 1px solid #dbe4ff; border-radius: 13px; background: #f8faff; }
.callout .ico { color: var(--blue); margin-top: 1px; }
.callout strong { display: block; margin-bottom: 3px; font-size: 11.5px; }
.callout p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.6; }

/* ---------- Templates ---------- */
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.template-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.03);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.template-card:hover { border-color: #b9c8f8; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(17, 24, 39, 0.07); }
.template-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.file-badge { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; color: var(--blue); background: var(--blue-soft); font-size: 9px; font-weight: 900; letter-spacing: 0.02em; }
.file-badge.xls { color: var(--green); background: var(--green-soft); }
.file-badge.csv { color: var(--amber); background: var(--amber-soft); }
.file-size { color: var(--faint); font-family: var(--mono); font-size: 9px; }
.template-card h4 { margin: 0; font-size: 13px; line-height: 1.4; }
.template-card p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.template-card .source { color: var(--faint); font-size: 9px; line-height: 1.5; }
.template-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 3px; }
.template-actions .btn { flex: 1; }
.source-note { margin-top: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--muted); font-size: 10.5px; line-height: 1.65; }
.source-note strong { color: var(--ink-2); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.about-card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 4px 12px rgba(17, 24, 39, 0.03); }
.about-card h3 { margin: 0 0 9px; font-size: 14px; }
.about-card p { margin: 0 0 8px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.about-card p:last-child { margin-bottom: 0; }
.formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 9px 0;
  padding: 10px 12px;
  border: 1px solid #e3e9f7;
  border-radius: 9px;
  background: #f9fbff;
  color: #33415c;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.6;
}
.formula b { color: var(--blue); }
.about-list { margin: 0; padding-left: 16px; color: var(--muted); font-size: 10.5px; line-height: 1.8; }
.about-list strong { color: var(--ink-2); }
.flow-list { display: grid; gap: 8px; margin-top: 4px; }
.flow-step { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 9px; align-items: start; }
.flow-step b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; color: var(--blue); background: var(--blue-soft); font-size: 9px; }
.flow-step span { color: var(--muted); font-size: 10.5px; line-height: 1.55; padding-top: 3px; }
.disclaimer { margin-top: 18px; color: var(--faint); font-size: 9.5px; line-height: 1.6; }
.page-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 9.5px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  color: #fff;
  background: rgba(11, 18, 34, 0.94);
  box-shadow: 0 16px 36px rgba(11, 18, 34, 0.28);
  font-size: 11.5px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #7a1d16; }
.toast.success { background: #075c43; }

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr); }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1120px) {
  .app { grid-template-columns: 84px minmax(0, 1fr); }
  .sidebar { padding: 18px 10px; align-items: center; }
  .brand { padding: 0 0 10px; }
  .brand div:last-child, .side-section-label, .side-link span:not(.side-dot), .side-scenarios, .side-note, .side-footer { display: none; }
  .side-nav { width: 100%; }
  .side-link { justify-content: center; padding: 0; }
  .side-link .side-dot { position: absolute; top: 7px; right: 7px; margin: 0; }
  .side-link { position: relative; }
  .hero { grid-template-columns: 1fr; }
  .hero-panel { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; }
  .hero-stats { display: none; }
  .flow-arrow { height: auto; }
  .step1-grid, .config-grid, .upload-grid { grid-template-columns: 1fr; }
  .config-aside { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .id-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .export-rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .export-rail .rail-label, .export-rail .export-summary, .export-rail .privacy-note { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .topbar { padding: 13px 18px; align-items: flex-start; }
  .topbar-right .badge-ghost { display: none; }
  .content { padding: 18px 18px 42px; }
  .hero { padding: 24px 20px; }
  .hero h2 { font-size: 28px; }
  .hero-panel { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .id-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stepper { padding: 10px 12px; }
  .step-copy span { display: none; }
  .step-line { flex-basis: 18px; margin: 0 8px; }
  .about-grid { grid-template-columns: 1fr; }
  .view-head { align-items: flex-start; flex-direction: column; }
  .step-footer { flex-direction: column; align-items: stretch; }
  .step-footer .btn { width: 100%; }
  .template-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
    overflow-x: auto;
  }
  .brand { padding: 0; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 11px; }
  .side-nav { display: flex; width: auto; margin-left: auto; }
  .side-link { width: 36px; min-height: 36px; }
  .topbar { position: static; flex-direction: column; gap: 8px; }
  .topbar h1 { font-size: 16px; }
  .hero-actions .btn { width: 100%; }
  .metrics { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .export-rail { grid-template-columns: 1fr; }
  .preview-table th:nth-child(3), .preview-table td:nth-child(3) { display: none; }
  .panel { padding: 17px; border-radius: 16px; }
  .step-copy strong { font-size: 10.5px; }
}
