:root {
  --twilight-bg: #0B1220;
  --twilight-grid: #232B38;
  --twilight-surface: #111827;
  --twilight-surface-2: #172033;
  --twilight-steel: #1E293B;
  --twilight-border: #334155;
  --twilight-ink: #F8FAFC;
  --twilight-muted: #CBD5E1;
  --twilight-muted-2: #94A3B8;
  --twilight-primary: #6366F1;
  --twilight-primary-dark: #4338CA;
  --twilight-secondary: #A855F7;
  --twilight-shadow: #020617;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--twilight-bg); scroll-behavior: smooth; scrollbar-color: var(--twilight-border) transparent; }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow-x: hidden; background-color: var(--twilight-bg); background-image: linear-gradient(to right, var(--twilight-grid) 1.5px, transparent 1.5px), linear-gradient(to bottom, var(--twilight-grid) 1.5px, transparent 1.5px); background-size: 72px 72px; background-attachment: fixed; color: var(--twilight-ink); font-family: "JetBrains Mono", monospace; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
:focus-visible { outline: 2px solid #A5B4FC; outline-offset: 3px; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--twilight-border); border-radius: 999px; }

.app-shell { width: 100%; min-height: 100vh; padding: 32px 16px 48px; }
.page-grid { position: fixed; z-index: 0; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(148,163,184,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.035) 1px, transparent 1px); background-size: 24px 24px; opacity: .24; }
.app-card { position: relative; z-index: 1; width: min(100%, 760px); margin: 0 auto; overflow: hidden; isolation: isolate; border: 2px solid var(--twilight-border); border-radius: 12px; background: var(--twilight-surface); box-shadow: 5px 5px 0 var(--twilight-shadow); }
.window-header { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 2px solid var(--twilight-border); background: var(--twilight-surface); }
.window-brand { display: flex; min-width: 0; align-items: center; gap: 12px; }
.brand-logo { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border: 2px solid #48577A; border-radius: 9px; background: var(--twilight-surface-2); box-shadow: 3px 3px 0 var(--twilight-shadow); color: #A5B4FC; font-size: 19px; }
.brand-copy { min-width: 0; }
.brand-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.brand-copy h1 { margin: 0; color: var(--twilight-ink); font-family: "Space Grotesk", sans-serif; font-size: 19px; font-weight: 700; line-height: 1.1; letter-spacing: -.45px; }
.brand-copy p { margin: 5px 0 0; color: var(--twilight-muted-2); font-size: 9px; font-weight: 800; letter-spacing: 1.45px; line-height: 1.4; }
.brand-badge { display: inline-flex; min-height: 22px; align-items: center; padding: 3px 7px; border: 1px solid var(--twilight-border); border-radius: 5px; background: var(--twilight-bg); color: #C7D2FE; font-size: 8px; font-weight: 800; letter-spacing: .7px; }
.window-status { display: inline-flex; min-height: 32px; flex: 0 0 auto; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--twilight-border); border-radius: 6px; background: var(--twilight-bg); color: var(--twilight-muted); font-size: 9px; font-weight: 800; letter-spacing: .7px; }
.status-indicator { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #64748B; }
.status-indicator.is-online { background: #34D399; box-shadow: 0 0 0 3px rgba(52,211,153,.12); }
.status-indicator.is-offline { background: #F87171; }
.app-content { padding: 28px; }
.hero { padding: 10px 0 22px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.chip { display: inline-flex; min-height: 30px; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--twilight-border); border-radius: 6px; background: var(--twilight-bg); color: var(--twilight-muted); font-size: 9px; font-weight: 800; letter-spacing: .75px; }
.chip i { font-size: 12px; }
.chip-primary { color: #C7D2FE; border-color: #454B91; }
.chip-green { color: #A7F3D0; border-color: #285A4B; }
.hero h2 { max-width: 680px; margin: 0; color: var(--twilight-ink); font-family: "Space Grotesk", sans-serif; font-size: clamp(36px, 7vw, 58px); font-weight: 700; line-height: .99; letter-spacing: -2.2px; text-wrap: balance; }
.hero h2 span { display: inline; color: #A5B4FC; }
.hero-copy { max-width: 650px; margin: 20px 0 0; color: var(--twilight-muted); font-family: "Space Grotesk", sans-serif; font-size: clamp(14px, 1.8vw, 16px); font-weight: 500; line-height: 1.8; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--twilight-border); color: var(--twilight-muted-2); font-size: 9px; font-weight: 800; letter-spacing: 1px; }
.hero-meta span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta i { color: #34D399; }
.meta-separator { width: 4px; height: 4px; border-radius: 50%; background: #64748B; }

.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.feature-card { display: flex; min-width: 0; min-height: 120px; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 14px; border: 2px solid var(--twilight-border); border-radius: 9px; background: var(--twilight-surface-2); box-shadow: 3px 3px 0 var(--twilight-shadow); transition: transform 150ms ease, border-color 150ms ease; }
.feature-card:hover { transform: translate(-1px, -1px); border-color: #56658A; }
.feature-icon { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #465577; border-radius: 7px; background: var(--twilight-steel); color: #A5B4FC; font-size: 15px; }
.feature-green .feature-icon { color: #6EE7B7; }
.feature-purple .feature-icon { color: #C4B5FD; }
.feature-card strong { display: block; margin-top: 12px; color: var(--twilight-ink); font-family: "Space Grotesk", sans-serif; font-size: 14px; font-weight: 700; }
.feature-card > span { display: block; margin-top: 4px; color: var(--twilight-muted-2); font-size: 8px; font-weight: 800; letter-spacing: 1px; }

.guide-card, .panel, .status-board { border: 2px solid var(--twilight-border); border-radius: 10px; background: var(--twilight-surface-2); box-shadow: 4px 4px 0 var(--twilight-shadow); }
.guide-card { margin-top: 18px; padding: 20px; }
.section-heading { display: flex; align-items: flex-start; gap: 13px; }
.section-index { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border: 1px solid #465577; border-radius: 7px; background: var(--twilight-bg); color: #A5B4FC; font-size: 10px; font-weight: 800; }
.section-heading h3, .status-copy h3 { margin: 0; color: var(--twilight-ink); font-family: "Space Grotesk", sans-serif; font-size: 20px; font-weight: 700; letter-spacing: -.5px; }
.section-heading p, .status-copy p { margin: 5px 0 0; color: var(--twilight-muted-2); font-family: "Space Grotesk", sans-serif; font-size: 13px; line-height: 1.6; }
.guide-list { display: grid; gap: 12px; margin: 19px 0 0; padding: 0; list-style: none; counter-reset: none; }
.guide-list li { display: flex; align-items: flex-start; gap: 11px; color: var(--twilight-muted); font-family: "Space Grotesk", sans-serif; font-size: 13px; line-height: 1.55; }
.guide-number { display: inline-flex; min-width: 27px; height: 24px; flex: 0 0 27px; align-items: center; justify-content: center; border: 1px solid var(--twilight-border); border-radius: 5px; background: var(--twilight-bg); color: #C7D2FE; font-family: "JetBrains Mono", monospace; font-size: 9px; font-weight: 800; }
.guide-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; padding: 12px; border: 1px solid #285A4B; border-radius: 7px; background: #10251F; color: #A7F3D0; font-family: "Space Grotesk", sans-serif; font-size: 12px; line-height: 1.5; }
.guide-note i { flex: 0 0 auto; margin-top: 2px; }

.panel { margin-top: 20px; padding: 20px; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.eyebrow { display: block; color: #A5B4FC; font-size: 9px; font-weight: 800; letter-spacing: 1.4px; line-height: 1.5; }
.panel-heading-copy h3 { margin: 5px 0 0; color: var(--twilight-ink); font-family: "Space Grotesk", sans-serif; font-size: 22px; font-weight: 700; letter-spacing: -.6px; }
.panel-code { padding: 6px 8px; border: 1px solid var(--twilight-border); border-radius: 5px; background: var(--twilight-bg); color: var(--twilight-muted-2); font-size: 9px; font-weight: 800; letter-spacing: .9px; }
.stepper { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 22px; }
.step { display: flex; min-width: 0; min-height: 58px; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--twilight-border); border-radius: 7px; background: var(--twilight-bg); color: var(--twilight-muted-2); text-align: left; }
button.step { cursor: pointer; transition: border-color 150ms ease, background 150ms ease, transform 150ms ease; }
button.step:hover { border-color: #6976C2; }
button.step:active { transform: translateY(2px); }
.step.is-active { border-color: #6366F1; background: #20264D; color: var(--twilight-ink); }
.step.is-complete { border-color: #28765C; background: #10251F; color: #A7F3D0; }
.step-number { display: grid; width: 29px; height: 29px; flex: 0 0 29px; place-items: center; border: 1px solid var(--twilight-border); border-radius: 6px; background: var(--twilight-surface-2); color: #C7D2FE; font-size: 9px; font-weight: 800; }
.step.is-complete .step-number { color: #6EE7B7; }
.step-copy { display: block; min-width: 0; }
.step-copy strong { display: block; overflow: hidden; color: inherit; font-family: "Space Grotesk", sans-serif; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.step-copy small { display: block; margin-top: 3px; color: var(--twilight-muted-2); font-size: 7px; font-weight: 800; letter-spacing: .65px; }
.field-label { display: block; margin-bottom: 8px; color: var(--twilight-muted); font-size: 9px; font-weight: 800; letter-spacing: 1px; }
.input-shell { display: flex; min-height: 56px; align-items: center; gap: 11px; padding: 0 14px; border: 2px solid var(--twilight-border); border-radius: 7px; background: var(--twilight-bg); transition: border-color 150ms ease, box-shadow 150ms ease; }
.input-shell:focus-within { border-color: #818CF8; box-shadow: 3px 3px 0 var(--twilight-shadow); }
.input-shell.is-success { border-color: #28765C; }
.input-shell.is-error { border-color: #B45353; }
.input-icon { display: inline-flex; width: 20px; flex: 0 0 20px; justify-content: center; color: #A5B4FC; }
#main-input { width: 100%; min-width: 0; height: 52px; border: 0; outline: 0; background: transparent; color: var(--twilight-ink); font-family: "Space Grotesk", sans-serif; font-size: 15px; font-weight: 600; }
#main-input::placeholder { color: #64748B; font-weight: 500; }
#main-input:focus-visible { outline: 0; }
.input-state { display: inline-flex; width: 19px; flex: 0 0 19px; justify-content: center; color: #6EE7B7; }
.is-error .input-state { color: #FCA5A5; }
.field-help { margin: 8px 0 0; color: var(--twilight-muted-2); font-family: "Space Grotesk", sans-serif; font-size: 12px; line-height: 1.55; }

.action-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 18px; }
.soft-btn { --button-depth: 5px; --press-inset: 4px; --transform-speed: 160ms; --radius: 9px; position: relative; display: block; min-width: 0; height: 58px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text-color, var(--twilight-ink)); cursor: pointer; text-align: center; text-decoration: none; user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.soft-btn:focus-visible { outline: 2px solid #A5B4FC; outline-offset: 4px; }
.soft-btn:disabled { cursor: wait; opacity: .62; }
.soft-btn__wrapper { position: relative; display: block; width: 100%; height: 100%; }
.soft-btn__wrapper::before { position: absolute; z-index: 1; right: 0; bottom: 0; left: 0; height: calc(100% - var(--button-depth)); border-radius: var(--radius); background: var(--side-color); content: ""; }
.soft-btn__content { position: absolute; z-index: 2; top: 0; right: 0; left: 0; display: flex; width: 100%; height: calc(100% - var(--button-depth)); align-items: center; justify-content: center; overflow: hidden; border: var(--border-width, 0) solid var(--border-color, transparent); border-radius: var(--radius); background: var(--surface-color); color: var(--text-color); backface-visibility: hidden; transform: translateY(0); transform-origin: center; transition: transform var(--transform-speed) ease-out, filter var(--transform-speed) ease-out; }
.soft-btn__content::after { position: absolute; z-index: 3; inset: 0; border-radius: inherit; background: rgba(255,255,255,.04); content: ""; opacity: 0; pointer-events: none; transition: opacity var(--transform-speed) ease; }
.soft-btn:hover .soft-btn__content::after, .soft-btn:focus-visible .soft-btn__content::after { opacity: 1; }
.soft-btn:active .soft-btn__content { transform: translateY(var(--press-inset)); transition-duration: 110ms; }
.soft-btn__inner { position: relative; z-index: 4; display: inline-flex; width: 100%; height: 100%; align-items: center; justify-content: center; gap: 9px; padding: 0 9px; pointer-events: none; font-size: 11px; font-weight: 800; letter-spacing: .25px; line-height: 1.2; }
.soft-btn__inner i { flex: 0 0 auto; font-size: 15px; }
.variant-solid { --surface-color: #6366F1; --side-color: #4338CA; --text-color: #FFFFFF; --border-color: transparent; --border-width: 0; }
.variant-outline { --surface-color: #172033; --side-color: #020617; --text-color: #F8FAFC; --border-color: #334155; --border-width: 2px; }
.result-card { display: none; align-items: flex-start; gap: 12px; margin-top: 18px; padding: 15px; border: 2px solid #28765C; border-radius: 8px; background: #10251F; color: #A7F3D0; }
.result-card.is-visible { display: flex; }
.result-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 1px solid #28765C; border-radius: 7px; background: #15372D; color: #6EE7B7; }
.result-card strong { display: block; color: #D1FAE5; font-family: "Space Grotesk", sans-serif; font-size: 15px; }
.result-card p { margin: 4px 0 0; color: #A7F3D0; font-family: "Space Grotesk", sans-serif; font-size: 12px; line-height: 1.55; }

.status-board { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding: 18px 20px; }
.status-copy h3 { margin-top: 4px; font-size: 18px; }
.request-stat { min-width: 160px; padding: 11px 13px; border: 1px solid var(--twilight-border); border-radius: 7px; background: var(--twilight-bg); text-align: right; }
.request-stat span { display: block; color: var(--twilight-muted-2); font-size: 8px; font-weight: 800; letter-spacing: .8px; }
.request-stat strong { display: block; margin-top: 5px; color: var(--twilight-ink); font-family: "Space Grotesk", sans-serif; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.app-footer { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--twilight-border); text-align: center; }
.app-footer p { margin: 5px 0; color: var(--twilight-muted-2); font-size: 8px; font-weight: 700; letter-spacing: .7px; line-height: 1.7; }
.app-footer a { color: #A5B4FC; text-decoration: underline; text-underline-offset: 3px; }

.toast { position: fixed; z-index: 20; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: flex; width: max-content; max-width: min(420px, calc(100vw - 32px)); align-items: center; gap: 10px; padding: 12px 15px; transform: translateY(12px); border: 2px solid #454B91; border-radius: 8px; background: #111827; box-shadow: 4px 4px 0 #020617; color: #E2E8F0; opacity: 0; pointer-events: none; transition: opacity 150ms ease, transform 150ms ease; }
.toast.is-visible { transform: translateY(0); opacity: 1; }
.toast-icon { display: grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; border: 1px solid #5B62B8; border-radius: 6px; background: #252A58; color: #C7D2FE; }
#toast-text { font-family: "Space Grotesk", sans-serif; font-size: 13px; font-weight: 600; line-height: 1.4; }
.toast--error { border-color: #924040; }
.toast--error .toast-icon { border-color: #924040; background: #3B2020; color: #FCA5A5; }
.toast--warning { border-color: #8A652B; }
.toast--warning .toast-icon { border-color: #8A652B; background: #352A19; color: #FCD34D; }

@media (max-width: 620px) {
  .app-shell { padding: 16px 10px 30px; }
  .app-card { border-radius: 10px; }
  .window-header { min-height: 68px; padding: 11px 13px; gap: 8px; }
  .brand-logo { width: 39px; height: 39px; flex-basis: 39px; font-size: 17px; }
  .brand-copy h1 { font-size: 16px; }
  .brand-copy p { font-size: 7px; letter-spacing: 1.05px; }
  .brand-badge { min-height: 20px; padding-inline: 5px; font-size: 7px; }
  .window-status { min-height: 29px; gap: 6px; padding: 5px 7px; font-size: 7px; letter-spacing: .4px; }
  .app-content { padding: 19px 15px 18px; }
  .hero { padding-top: 7px; }
  .hero h2 { font-size: clamp(34px, 9vw, 48px); letter-spacing: -1.7px; }
  .hero-copy { margin-top: 15px; font-size: 14px; line-height: 1.7; }
  .feature-grid { gap: 8px; }
  .feature-card { min-height: 112px; padding: 10px; }
  .feature-card strong { font-size: 12px; }
  .feature-card > span { font-size: 7px; letter-spacing: .6px; }
  .guide-card, .panel { padding: 15px; }
  .section-heading h3 { font-size: 18px; }
  .section-heading p { font-size: 12px; }
  .guide-list li { font-size: 12px; }
  .panel-heading-copy h3 { font-size: 20px; }
  .stepper { gap: 6px; }
  .step { min-height: 54px; gap: 6px; padding: 7px 6px; }
  .step-number { width: 25px; height: 25px; flex-basis: 25px; }
  .step-copy strong { font-size: 10px; }
  .step-copy small { font-size: 6px; letter-spacing: .3px; }
  .action-grid { gap: 10px; }
  .soft-btn { height: 56px; --button-depth: 5px; --radius: 8px; }
  .soft-btn__inner { gap: 6px; padding-inline: 6px; font-size: 10px; }
  .soft-btn__inner i { font-size: 13px; }
  .status-board { align-items: flex-start; flex-direction: column; padding: 15px; }
  .request-stat { width: 100%; min-width: 0; text-align: left; }
}

@media (max-width: 380px) {
  .app-shell { padding-inline: 7px; }
  .app-content { padding-inline: 12px; }
  .window-status { max-width: 112px; white-space: nowrap; }
  .brand-copy p { letter-spacing: .7px; }
  .brand-badge { display: none; }
  .feature-card { min-height: 105px; padding: 9px; }
  .feature-card strong { font-size: 11px; }
  .stepper { grid-template-columns: 1fr; }
  .step { min-height: 46px; }
  .step-copy small { font-size: 7px; }
  .action-grid { grid-template-columns: 1fr; }
  .soft-btn { height: 54px; }
  .hero-meta { font-size: 8px; }
}

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