:root {
  color-scheme: light;
  --indigo-950: #201d5b;
  --indigo-900: #29256f;
  --indigo-800: #38348d;
  --indigo-100: #ecebff;
  --ink: #23233a;
  --muted: #62637a;
  --line: #ddddec;
  --surface: #ffffff;
  --page: #f5f5fa;
  --yellow: #f5c84c;
  --yellow-soft: #fff7db;
  --error: #a52635;
  --success: #247454;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); line-height: 1.55; }
button, input { font: inherit; }
a { color: var(--indigo-800); text-underline-offset: 3px; }
a:hover { color: var(--indigo-950); }
:focus-visible { outline: 3px solid #e0a900; outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link { position: absolute; top: 8px; left: 8px; z-index: 5; padding: 9px 13px; color: white; background: var(--indigo-950); border-radius: 7px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.topbar { background: var(--indigo-900); color: white; border-bottom: 4px solid var(--yellow); }
.topbar-inner { max-width: 1040px; min-height: 68px; margin: auto; padding: 0 24px; display: flex; align-items: center; gap: 12px; }
.brand-name { font-size: 14px; font-weight: 680; letter-spacing: .01em; }
.local-badge { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; color: #e8e8ff; font-size: 12px; }
.local-badge span { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }

.page-shell { max-width: 880px; margin: 0 auto; padding: 44px 24px 32px; }
.intro { margin: 0 auto 23px; }
.eyebrow { margin: 0 0 8px; color: var(--indigo-800); font-size: 11px; font-weight: 800; letter-spacing: .105em; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 680px; margin-bottom: 10px; color: var(--indigo-950); font-size: clamp(30px, 5vw, 43px); line-height: 1.12; letter-spacing: -.035em; }
.intro-copy { max-width: 650px; margin-bottom: 27px; color: var(--muted); font-size: 16px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.step { display: flex; align-items: center; gap: 9px; min-height: 45px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.65); color: #77778b; font-size: 13px; font-weight: 650; }
.step-number { display: grid; flex: 0 0 24px; place-items: center; width: 24px; height: 24px; border: 1px solid #c8c8d9; border-radius: 50%; font-size: 11px; }
.step.is-current { border-color: var(--indigo-800); background: white; color: var(--indigo-950); box-shadow: 0 0 0 1px var(--indigo-800) inset; }
.step.is-current .step-number { border-color: var(--indigo-800); background: var(--indigo-800); color: white; }
.step.is-complete { border-color: #b7ddcd; background: #f1fbf6; color: #245e48; }
.step.is-complete .step-number { border-color: #70b393; background: #e5f5ed; color: #1f6848; }

.privacy-note { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 17px; padding: 16px 18px; border: 1px solid #e7cc72; border-radius: 11px; background: var(--yellow-soft); }
.privacy-icon { display: grid; flex: 0 0 25px; place-items: center; width: 25px; height: 25px; margin-top: 1px; border-radius: 50%; background: #f0ce5b; color: #3f350c; font-size: 14px; font-weight: 900; }
.privacy-note strong { display: block; margin-bottom: 2px; color: #332c10; font-size: 14px; }
.privacy-note p { margin: 0; color: #625829; font-size: 13px; }

.form-card, .result-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 8px 28px rgba(33,31,83,.055); }
.form-card { padding: 25px 28px 22px; }
.card-heading, .guide-heading { display: flex; align-items: flex-start; gap: 12px; }
.section-index { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 34px; border-radius: 8px; background: var(--indigo-100); color: var(--indigo-800); font-size: 11px; font-weight: 850; }
.card-heading h2, .guide-heading h2 { margin: 0 0 3px; color: var(--indigo-950); font-size: 21px; line-height: 1.25; }
.card-heading p { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 19px; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; color: #292943; font-size: 13px; font-weight: 720; }
.field input { display: block; width: 100%; min-height: 47px; padding: 10px 12px; border: 1px solid #c9c9d9; border-radius: 8px; background: #fff; color: var(--ink); }
.field input::placeholder { color: #85859a; }
.field input:hover { border-color: #9292ad; }
.field input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.field-help { min-height: 20px; margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.field-error { min-height: 0; margin: 0; color: var(--error); font-size: 12px; line-height: 1.4; }
.field-error:not(:empty) { margin-top: 5px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 95px; }
.show-password { position: absolute; top: 50%; right: 7px; transform: translateY(-50%); min-height: 34px; padding: 5px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--indigo-800); font-size: 12px; font-weight: 700; cursor: pointer; }
.show-password:hover { background: var(--indigo-100); }
.form-actions, .result-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 12px; min-height: 45px; padding: 10px 16px; border: 1px solid transparent; border-radius: 8px; font-weight: 720; font-size: 13px; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.button-primary { background: var(--indigo-900); color: white; }
.button-primary:hover { background: var(--indigo-950); }
.button-secondary { border-color: #b5b4d0; background: white; color: var(--indigo-900); }
.button-secondary:hover { border-color: var(--indigo-800); background: #f5f4ff; }
.button-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.button-quiet:hover { background: #f0eff8; color: var(--indigo-950); }
.button-small { min-height: 38px; padding: 7px 10px; font-size: 12px; }
.form-status, .copy-status { min-height: 0; margin: 0; color: var(--muted); font-size: 12px; }
.form-status:not(:empty), .copy-status:not(:empty) { margin-top: 9px; }

.result-card { margin-top: 18px; padding: 26px 28px 29px; border-top: 4px solid #4da57e; }
.result-heading { display: flex; align-items: flex-start; gap: 13px; }
.success-mark { display: grid; flex: 0 0 34px; place-items: center; width: 34px; height: 34px; margin-top: 1px; border-radius: 50%; background: #e7f6ee; color: var(--success); font-weight: 900; }
.result-heading .eyebrow { margin-bottom: 5px; }
.result-heading h2 { margin: 0 0 3px; color: var(--indigo-950); font-size: 22px; line-height: 1.25; }
.result-intro { margin: 0; color: var(--muted); font-size: 13px; }
.result-meta { display: grid; grid-template-columns: 1fr auto; gap: 15px; margin: 21px 0 0; padding: 14px 15px; border-radius: 9px; background: #f6f6fb; }
.result-meta div { min-width: 0; }
.result-meta dt { margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 650; }
.result-meta dd { overflow-wrap: anywhere; margin: 0; color: var(--ink); font-size: 13px; font-weight: 650; }
.result-meta code, code { padding: 1px 4px; border-radius: 4px; background: #eeedf5; color: #34305e; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.result-actions { margin-top: 15px; }
.preview-block { margin-top: 22px; }
.preview-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.preview-heading h3 { margin: 0; color: var(--indigo-950); font-size: 14px; }
.masked-label { color: var(--muted); font-size: 11px; }
#json-preview { overflow: auto; max-height: 300px; margin: 0; padding: 16px; border: 1px solid #d9d8e7; border-radius: 9px; background: #f7f7fa; color: #33324c; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }

.install-guide { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.guide-heading { margin-bottom: 18px; }
.guide-heading .eyebrow { margin-bottom: 3px; }
.guide-heading h2 { font-size: 20px; }
.install-steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.install-steps > li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; padding: 0 0 19px; }
.install-steps > li:last-child { padding-bottom: 7px; }
.install-number { display: grid; place-items: center; width: 25px; height: 25px; margin-top: 1px; border: 1px solid #c5c4dc; border-radius: 50%; color: var(--indigo-800); font-size: 11px; font-weight: 800; }
.install-steps strong { display: block; margin-bottom: 3px; color: #2b2b45; font-size: 13px; }
.install-steps p { margin: 0 0 7px; color: var(--muted); font-size: 12px; }
.install-steps b { color: #38375a; }
.guide-note { padding: 8px 10px; border-left: 3px solid var(--yellow); background: #fff9e5; color: #5c5123 !important; }
blockquote { margin: 8px 0; padding: 10px 13px; border-left: 3px solid var(--indigo-800); border-radius: 0 6px 6px 0; background: #f4f3ff; color: var(--indigo-950); font-size: 13px; font-weight: 650; }
.troubleshooting { margin-top: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 9px; background: #fbfbfd; }
.troubleshooting summary, .references summary { color: var(--indigo-900); font-size: 13px; font-weight: 700; cursor: pointer; }
.troubleshooting ul { display: grid; gap: 6px; margin: 12px 0 9px; padding-left: 21px; color: var(--muted); font-size: 12px; }
.troubleshooting > p { margin: 0; color: var(--muted); font-size: 12px; }
.page-footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-top: 21px; color: #74748a; font-size: 11px; }
.page-footer > p { max-width: 480px; margin: 0; }
.references { flex: 0 0 auto; }
.references summary { font-size: 11px; }
.references ul { display: grid; gap: 5px; margin: 8px 0 0; padding-left: 18px; }
.references a { font-size: 11px; }

@media (max-width: 640px) {
  .topbar-inner { min-height: 61px; padding: 0 17px; }
  .brand-name { max-width: 190px; font-size: 12px; line-height: 1.25; }
  .local-badge { gap: 5px; font-size: 10px; }
  .local-badge span { width: 7px; height: 7px; }
  .page-shell { padding: 29px 16px 25px; }
  .intro-copy { font-size: 14px; }
  .steps { grid-template-columns: 1fr; gap: 7px; }
  .step { min-height: 40px; padding: 6px 10px; }
  .form-card, .result-card { padding: 20px 17px; border-radius: 12px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .field-wide { grid-column: auto; }
  .field-help { min-height: 0; }
  .form-actions { align-items: stretch; }
  .form-actions .button-primary { flex: 1 1 100%; }
  .form-actions .button-quiet { width: 100%; }
  .result-heading h2 { font-size: 20px; }
  .result-meta { grid-template-columns: 1fr; gap: 10px; }
  .result-actions { align-items: stretch; }
  .result-actions .button-primary, .result-actions .button-secondary { flex: 1 1 100%; }
  .result-actions .button-small { width: 100%; }
  .preview-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  #json-preview { max-height: 250px; font-size: 11px; }
  .page-footer { flex-direction: column; }
  .references { align-self: flex-start; }
}

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