:root {
  --bg: #0a0b10;
  --bg-2: #0f1118;
  --surface: #14161f;
  --surface-2: #1a1d29;
  --surface-3: #222636;
  --border: #262a3a;
  --border-strong: #353a50;
  --text: #eef0f7;
  --text-2: #b4b9cc;
  --muted: #858ba3;
  --violet: #8b5cf6;
  --violet-2: #a78bfa;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .65);
  --focus: 0 0 0 3px rgba(139, 92, 246, .55);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--violet-2); }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
svg { flex-shrink: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--violet); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.skip-link:focus { top: 12px; }

.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 45% at 85% -5%, rgba(99, 102, 241, .22), transparent 70%),
    radial-gradient(50% 40% at 0% 10%, rgba(139, 92, 246, .16), transparent 70%),
    radial-gradient(40% 30% at 50% 110%, rgba(59, 130, 246, .10), transparent 70%);
}

.container { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 16px; }
main.container { flex: 1; padding-top: 28px; padding-bottom: 64px; outline: none; }
@media (min-width: 640px) { .container { padding: 0 24px; } main.container { padding-top: 40px; } }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(10, 11, 16, .72); border-bottom: 1px solid rgba(255,255,255,.05); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px; border-radius: 10px; font-size: 15px; color: var(--text-2); }
.brand strong { color: var(--text); font-weight: 800; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); position: relative; box-shadow: 0 6px 18px -6px rgba(139,92,246,.8); }
.brand-mark::after { content: ""; position: absolute; left: 11px; top: 8px; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.badge-local { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: rgba(20,22,31,.6); }
.badge-local svg { width: 14px; height: 14px; fill: none; stroke: var(--success); stroke-width: 2; }
@media (max-width: 480px) { .badge-local { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 14px; border: 1px solid transparent;
  font-weight: 700; font-size: 15.5px; text-decoration: none; line-height: 1.2;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, opacity .15s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 28px -10px rgba(124, 92, 246, .85); }
.btn-primary:hover { box-shadow: 0 14px 34px -10px rgba(124, 92, 246, 1); transform: translateY(-1px); }
.btn-secondary { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); background: rgba(255,255,255,.03); }
.btn-danger { background: #3a1820; border-color: #6b2632; color: #fecaca; }
.btn-danger:hover { background: #4a1d28; }
.btn-lg { min-height: 56px; padding: 14px 28px; font-size: 16.5px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.link-btn { background: none; border: 0; padding: 4px 2px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 13.5px; border-radius: 6px; }
.link-btn:hover { color: var(--text); }

/* Cards & generic */
.card { background: linear-gradient(180deg, rgba(26,29,41,.92), rgba(20,22,31,.92)); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
@media (min-width: 640px) { .card { padding: 28px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--violet-2); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.stack > * + * { margin-top: 16px; }

.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-tile { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: rgba(139, 92, 246, .14); color: var(--violet-2); border: 1px solid rgba(139, 92, 246, .28); }

/* Landing */
.hero { text-align: center; padding: 24px 0 8px; }
.hero h1 { font-size: clamp(36px, 8vw, 64px); font-weight: 800; margin-top: 18px; }
.hero .subtitle { font-size: clamp(16px, 3.4vw, 20px); font-weight: 600; color: var(--text-2); margin-top: 8px; }
.hero .promise { max-width: 640px; margin: 22px auto 0; font-size: clamp(16px, 3vw, 18.5px); color: var(--text-2); }
.hero-cta { margin-top: 30px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero-meta { margin-top: 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-size: 14px; color: var(--muted); }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

.steps3 { display: grid; gap: 14px; margin-top: 48px; }
@media (min-width: 720px) { .steps3 { grid-template-columns: repeat(3, 1fr); } }
.step3 { position: relative; padding: 22px; border-radius: var(--radius); border: 1px solid var(--border); background: rgba(20,22,31,.7); }
.step3 .num { position: absolute; top: 18px; right: 20px; font-size: 13px; font-weight: 800; color: var(--muted); }
.step3 h3 { font-size: 17px; margin-top: 14px; }
.step3 p { margin-top: 6px; color: var(--text-2); font-size: 14.5px; }

.notice { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: rgba(20,22,31,.7); font-size: 14.5px; color: var(--text-2); }
.notice svg { width: 20px; height: 20px; margin-top: 2px; fill: none; stroke: var(--violet-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.notice strong { color: var(--text); }
.notice.warn { border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.06); }
.notice.warn svg { stroke: var(--warning); }
.notice.ok svg { stroke: var(--success); }
.notices { display: grid; gap: 12px; margin-top: 24px; }
@media (min-width: 720px) { .notices { grid-template-columns: 1fr 1fr; } }

/* Progress / stepper */
.form-head { margin-bottom: 22px; }
.progress-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.progress-meta .count { color: var(--text-2); }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 10px; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; background: var(--grad); border-radius: inherit; transition: width .35s ease; }
.stepper { display: flex; gap: 6px; margin-top: 14px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.stepper button { flex: 1 0 auto; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.stepper button .lbl { display: none; }
@media (min-width: 860px) { .stepper button .lbl { display: inline; font-weight: 600; } .stepper button { flex: 1 1 0; min-width: 0; } .stepper button .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
.stepper button.done { color: var(--text-2); border-color: var(--border-strong); }
.stepper button.current { background: rgba(139,92,246,.16); border-color: rgba(139,92,246,.6); color: #fff; }

.section-title { display: flex; gap: 14px; align-items: center; margin-top: 26px; }
.section-title h1 { font-size: clamp(24px, 5vw, 32px); font-weight: 800; outline: none; }
.section-intro { color: var(--text-2); margin-top: 10px; }

/* Fields */
.fields { display: grid; gap: 14px; margin-top: 24px; }
.field { padding: 20px; border-radius: var(--radius); background: rgba(20,22,31,.82); border: 1px solid var(--border); transition: border-color .2s; }
.field:focus-within { border-color: rgba(139, 92, 246, .55); }
.field.invalid { border-color: rgba(248, 113, 113, .7); }
.field-label { display: flex; gap: 10px; align-items: baseline; font-weight: 700; font-size: 16px; color: var(--text); }
.field-label .qn { flex-shrink: 0; color: var(--muted); font-size: 13px; font-weight: 700; min-width: 22px; }
.req { color: var(--violet-2); margin-left: 2px; }
.tag { display: inline-block; margin-left: 8px; vertical-align: 2px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted); }
.tag.rec { color: #93c5fd; border-color: rgba(59,130,246,.4); }
.field-help { margin: 6px 0 0 32px; font-size: 14px; color: var(--muted); }
.field-body { margin: 12px 0 0 32px; }
@media (max-width: 520px) { .field-help, .field-body { margin-left: 0; } .field { padding: 16px; } }
.input, .textarea {
  width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-2);
  padding: 13px 14px; font-size: 16px; line-height: 1.55; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #5f6580; }
.input:focus, .textarea:focus { outline: none; border-color: var(--violet); box-shadow: var(--focus); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.error { display: flex; gap: 6px; align-items: center; margin-top: 8px; color: #fca5a5; font-size: 14px; font-weight: 600; }
.error:empty { display: none; }

.chips-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip-quick { font-size: 13px; padding: 6px 12px; min-height: 34px; border-radius: 999px; border: 1px dashed var(--border-strong); background: transparent; color: var(--muted); }
.chip-quick:hover { color: var(--text); border-color: var(--violet); }
.chip-quick[aria-pressed="true"] { border-style: solid; border-color: var(--violet); color: #fff; background: rgba(139,92,246,.15); }

.options { display: flex; flex-wrap: wrap; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text-2); font-weight: 600; font-size: 15px; cursor: pointer; user-select: none;
  transition: border-color .15s, background-color .15s, color .15s;
}
.option span::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); transition: all .15s; flex-shrink: 0; }
.option input[type="checkbox"] + span::before { border-radius: 5px; }
.option:hover span { border-color: #4b5170; color: var(--text); }
.option input:checked + span { border-color: var(--violet); background: rgba(139,92,246,.14); color: #fff; }
.option input:checked + span::before { border-color: var(--violet); background: var(--violet); box-shadow: inset 0 0 0 3px var(--bg-2); }
.option input:focus-visible + span { box-shadow: var(--focus); }
.other-wrap, .note-wrap { margin-top: 12px; }
.other-wrap label, .note-wrap label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }

.step-note { margin-top: 18px; }

.form-nav { display: flex; gap: 12px; margin-top: 28px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.form-nav .spacer { flex: 1; }
@media (max-width: 520px) {
  .form-nav { position: sticky; bottom: 0; margin-left: -16px; margin-right: -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(10,11,16,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border); flex-wrap: nowrap; }
  .form-nav .btn { flex: 1; padding-left: 12px; padding-right: 12px; }
  .form-nav .spacer { display: none; }
}
.alert { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid rgba(248,113,113,.45); background: rgba(248,113,113,.08); color: #fecaca; font-weight: 600; font-size: 14.5px; }
.alert:empty { display: none; }

/* Review */
.page-head h1 { font-size: clamp(28px, 6vw, 40px); font-weight: 800; margin-top: 10px; outline: none; }
.page-head p { color: var(--text-2); margin-top: 10px; }
.review-list { display: grid; gap: 14px; margin-top: 26px; }
.review-section header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.review-section h2 { font-size: 18px; display: flex; align-items: center; gap: 12px; }
.review-section h2 .icon-tile { width: 36px; height: 36px; border-radius: 10px; }
.review-section h2 .icon { width: 18px; height: 18px; }
.qa { display: grid; gap: 4px; padding: 14px 0; border-top: 1px solid var(--border); }
.qa:first-of-type { margin-top: 14px; }
.qa dt { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.qa dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); font-size: 15px; }
.qa dd.empty { color: var(--muted); font-style: italic; }
.qa.missing dd { color: #fca5a5; font-style: normal; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pill.ok { color: var(--success); background: rgba(52,211,153,.1); }
.pill.bad { color: #fca5a5; background: rgba(248,113,113,.1); }
.review-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; align-items: center; }
.tools-row { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 20px; }

/* Result */
.success-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(52,211,153,.1); color: var(--success); font-weight: 700; font-size: 13.5px; }
.success-badge svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.summary-grid { display: grid; gap: 12px; margin-top: 24px; }
@media (min-width: 640px) { .summary-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 880px) { .summary-grid { grid-template-columns: repeat(3, 1fr); } }
.sum { padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); background: rgba(20,22,31,.82); min-width: 0; }
.sum .k { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.sum .k svg { width: 16px; height: 16px; color: var(--violet-2); }
.sum .v { margin-top: 8px; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.prompt-card { margin-top: 28px; }
.prompt-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.prompt-card-head h2 { font-size: 20px; }
.stats { font-size: 13px; color: var(--muted); font-weight: 600; }
.prompt-box {
  width: 100%; margin-top: 14px; height: 420px; max-height: 60vh; resize: vertical;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.6; color: #d7dbea;
  background: #07080c; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 16px; white-space: pre-wrap;
}
.prompt-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
@media (max-width: 520px) { .prompt-actions .btn { flex: 1 1 100%; } }
.copy-status { margin-top: 12px; font-size: 14.5px; font-weight: 600; min-height: 1px; }
.copy-status.ok { color: var(--success); }
.copy-status.fail { color: var(--warning); }

.howto { margin-top: 22px; }
.howto h2 { font-size: 20px; }
.howto ol { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.howto li { counter-increment: s; display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); color: var(--text-2); }
.howto li::before { content: counter(s); flex-shrink: 0; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; font-size: 14px; }
.howto li strong { color: var(--text); }
.continue-cmd { margin-top: 10px; display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.continue-cmd code { flex: 1 1 260px; font-family: var(--mono); font-size: 13.5px; padding: 10px 12px; border-radius: 10px; background: #07080c; border: 1px solid var(--border-strong); color: #e9d5ff; overflow-wrap: anywhere; }
.continue-cmd .btn { min-height: 42px; padding: 8px 14px; font-size: 14px; }
.howto-cta { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; }

.final-band { margin-top: 28px; text-align: center; padding: 32px 22px; border-radius: var(--radius); border: 1px solid rgba(139,92,246,.35); background: radial-gradient(80% 120% at 50% 0%, rgba(139,92,246,.18), rgba(20,22,31,.9)); }
.final-band h2 { font-size: clamp(22px, 4.5vw, 28px); }
.final-band p { color: var(--text-2); margin: 10px auto 0; max-width: 560px; }
.final-band .row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 20px; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 22px 0 calc(22px + env(safe-area-inset-bottom)); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; font-size: 13.5px; color: var(--muted); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60;
  padding: 12px 18px; border-radius: 12px; background: #1f2333; border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-weight: 600; font-size: 14.5px; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Modal */
.modal { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 26px; max-width: 440px; width: calc(100% - 32px); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.modal h2 { font-size: 20px; }
.modal p { margin-top: 10px; color: var(--text-2); font-size: 15px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* Motion */
.view-enter { animation: enter .35s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
