:root {
  --bg: #07090d;
  --panel: #0d1118;
  --panel2: #121824;
  --text: #f5f3ed;
  --muted: #a9b0bc;
  --gold: #d8ad3d;
  --cyan: #38e0d0;
  --line: #29313e;
  --bad: #ff7f7f;
  --ok: #75e6bb;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at 18% 0,#142238 0,#090c12 36%,#06080b 100%);
  color: var(--text);
  font: 16px/1.55 system-ui,-apple-system,Segoe UI,sans-serif;
}

button,input,select,textarea {
  font: inherit;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 99;
  background: #fff;
  color: #000;
  padding: .7rem 1rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .9rem clamp(1rem,4vw,3rem);
  background: rgba(7,9,13,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  gap: .8rem;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  color: var(--gold);
  font-size: 2rem;
}

.brand strong {
  display: block;
  letter-spacing: .08em;
}

.brand small {
  display: block;
  color: var(--gold);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.offline {
  color: var(--muted);
  font-size: .85rem;
  margin-right: .5rem;
}

.lang-btn {
  border: 1px solid var(--line);
  background: #111722;
  color: var(--text);
  padding: .45rem .65rem;
  border-radius: .55rem;
  cursor: pointer;
}

.lang-btn.active {
  border-color: var(--gold);
  color: var(--gold);
}

main {
  max-width: 1440px;
  margin: auto;
  padding: clamp(1.2rem,4vw,3.5rem);
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr .7fr;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.eyebrow {
  color: var(--gold);
  font-weight: 800;
  letter-spacing: .14em;
  font-size: .78rem;
}

.hero h1 {
  font-size: clamp(2.3rem,5vw,5rem);
  line-height: .98;
  margin: .35rem 0 1rem;
  max-width: 930px;
}

.lead {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 850px;
}

.privacy,.progress-card,.summary-card,fieldset {
  background: linear-gradient(180deg,rgba(18,24,36,.96),rgba(11,15,22,.96));
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
}

.privacy {
  padding: 1.2rem;
  border-left: 4px solid var(--cyan);
}

.privacy p {
  color: var(--muted);
  margin: .4rem 0 0;
}

.progress-card {
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
}

.progress-card>div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.progress-track {
  height: .55rem;
  background: #06080c;
  border-radius: 999px;
  overflow: hidden;
  margin-top: .7rem;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg,var(--gold),var(--cyan));
  transition: width .25s;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 390px;
  gap: 1.3rem;
  align-items: start;
}

form {
  display: grid;
  gap: 1rem;
}

fieldset {
  margin: 0;
  padding: 1.3rem;
  display: grid;
  gap: 1rem;
  min-width: 0;
}

legend {
  font-weight: 850;
  font-size: 1.05rem;
  padding: 0 .35rem;
  display: flex;
  gap: .7rem;
  align-items: center;
}

legend span:first-child {
  color: var(--gold);
  font-family: ui-monospace,monospace;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.two {
  grid-template-columns: repeat(2,minmax(0,1fr));
}

label {
  display: grid;
  gap: .45rem;
  font-weight: 700;
}

label>span {
  color: #e9e6dd;
}

input,select,textarea {
  width: 100%;
  border: 1px solid #354052;
  background: #080b11;
  color: var(--text);
  border-radius: .75rem;
  padding: .8rem .9rem;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,select:focus,textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(56,224,208,.13);
}

[aria-invalid=true] {
  border-color: var(--bad) !important;
}

.checks {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: .7rem;
}

.checks label {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .7rem;
  background: #080b11;
  border: 1px solid #303948;
  border-radius: .7rem;
}

.checks input {
  width: auto;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  padding: 1rem 0;
}

.form-actions button {
  border: 1px solid #374253;
  background: #121925;
  color: var(--text);
  padding: .75rem 1rem;
  border-radius: .7rem;
  font-weight: 800;
  cursor: pointer;
}

.form-actions button:hover {
  border-color: var(--cyan);
}

.form-actions .primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #111;
}

.form-actions .danger {
  margin-left: auto;
  border-color: #6e3d48;
  color: #ffb5bd;
}

.note {
  color: var(--muted);
  border-left: 3px solid var(--gold);
  padding-left: 1rem;
}

.summary-card {
  position: sticky;
  top: 6.2rem;
  padding: 1.2rem;
  min-width: 0;
}

.summary-card h2 {
  margin: .25rem 0 .8rem;
}

.summary-card pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 65vh;
  overflow: auto;
  background: #070a10;
  border: 1px solid #2c3543;
  padding: 1rem;
  border-radius: .8rem;
  color: #d7dbe2;
}

.fallback {
  display: flex;
  gap: .7rem;
  flex-wrap: wrap;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.fallback strong {
  width: 100%;
}

.fallback a,footer a {
  color: var(--cyan);
}

footer {
  max-width: 1440px;
  margin: auto;
  padding: 1.5rem clamp(1rem,4vw,3rem) 3rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

button:focus-visible,a:focus-visible {
  outline: 3px solid #fff2a6;
  outline-offset: 3px;
}

@media (max-width:980px) {
  .hero,.layout {
    grid-template-columns: 1fr;
  }
  .summary-card {
    position: static;
  }
  .offline {
    display: none;
  }
}

@media (max-width:640px) {
  .topbar {
    align-items: flex-start;
  }
  .brand strong {
    font-size: .8rem;
  }
  .brand small {
    font-size: .72rem;
  }
  .grid.two,.checks {
    grid-template-columns: 1fr;
  }
  .progress-card>div:first-child,footer {
    display: block;
  }
  .form-actions .danger {
    margin-left: 0;
  }
  .hero h1 {
    font-size: 2.4rem;
  }
}

@media print {
  .topbar,.form-actions,.fallback,footer,.skip {
    display: none !important;
  }
  body {
    background: #fff;
    color: #111;
  }
  .privacy,.progress-card,.summary-card,fieldset {
    box-shadow: none;
    background: #fff;
    border-color: #bbb;
  }
  .layout {
    display: block;
  }
  .summary-card {
    page-break-before: always;
  }
  .summary-card pre {
    max-height: none;
    background: #fff;
    color: #111;
  }
  .eyebrow {
    color: #765b00;
  }
}

.order-fieldset { border-color:rgba(212,175,55,.55); background:linear-gradient(180deg,rgba(212,175,55,.07),rgba(18,25,37,.42)); }

.order-fieldset legend span:first-child { color:var(--gold); }

.addon-checks { grid-template-columns:repeat(2,minmax(0,1fr)); margin:.65rem 0 1rem; }

.order-note { margin:.8rem 0 0; color:var(--muted); font-size:.88rem; }

@media (max-width: 660px) { .addon-checks { grid-template-columns:1fr; } }

.order-total-card { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-top:1rem; padding:1rem 1.1rem; border:1px solid rgba(212,175,55,.5); border-radius:14px; background:#090d14; }

.order-total-card strong { color:var(--gold); font-size:1.45rem; white-space:nowrap; }

.order-total-card small { flex-basis:100%; color:var(--muted); }

@media (max-width: 660px) { .order-total-card { align-items:flex-start; flex-wrap:wrap; } }

/* V1.6 mobile width guard */
.grid,.checks,label,input,select,textarea,.order-total-card,.local-files{min-width:0;max-width:100%}
@media (max-width:640px){
  fieldset{padding:1rem .75rem}
  .grid.two,.checks,.addon-checks{width:100%;min-width:0}
  label{width:100%;min-width:0}
  input,select,textarea{width:100%;min-width:0;max-width:100%}
  .order-total-card strong{white-space:normal}
}

/* Customer-ready scope summary: allow long package descriptions to wrap on all viewports. */
.package-scope-card{align-items:flex-start}
.package-scope-card strong{white-space:normal;overflow-wrap:anywhere;word-break:normal;font-size:1rem;line-height:1.45;text-align:right;max-width:72%}
@media (max-width:660px){.package-scope-card strong{max-width:100%;text-align:left}}

/* V1.6.3 mobile overflow repair */
html,body{max-width:100%;overflow-x:hidden}
@media (max-width:640px){
  main,.layout,.hero,.privacy,.progress-card,.summary-card,fieldset,.form-actions{
    max-width:100%;
    min-width:0;
  }
  .hero{overflow:hidden}
  .hero h1,
  .hero p,
  .privacy h2,
  .privacy p,
  fieldset legend,
  label,
  .addon-checks label,
  .order-note {
    max-width:100%;
    overflow-wrap:anywhere;
    word-break:normal;
    hyphens:auto;
  }
  .hero p,
  .privacy p,
  .progress-card,
  .order-note {
    max-width:min(100%,34ch);
  }
  .hero h1{font-size:clamp(2.1rem,10.8vw,2.65rem);line-height:1.02}
  .addon-checks label{display:flex;align-items:flex-start;gap:.65rem}
}

.public-intake-notice{max-width:1180px;margin:18px auto 0;padding:16px 18px;border:1px solid #526173;border-left:4px solid #d4af37;border-radius:12px;background:#111720;color:#e7ebef}.public-intake-notice a{color:#fff3a8}

/* RC5 public-intake narrow-screen containment */
.public-intake-notice,.public-intake-notice>div{min-width:0;max-width:100%;overflow-wrap:anywhere}
.public-intake-notice a{overflow-wrap:anywhere;word-break:break-word}

/* V1.0.3 secure intake submission */
.hp-field{
  position:absolute!important;
  left:-10000px!important;
  width:1px!important;
  height:1px!important;
  overflow:hidden!important;
}
.submission-panel{
  margin:24px 0 16px;
  padding:22px;
  border:1px solid rgba(212,175,55,.5);
  border-radius:14px;
  background:linear-gradient(135deg,rgba(212,175,55,.09),rgba(18,27,35,.96));
}
.submission-panel h2{
  margin:0 0 8px;
  color:#f4f5f2;
  font-size:1.2rem;
}
.submission-panel p{
  margin:8px 0;
  color:#c9d0d6;
  line-height:1.55;
}
.submit-primary{
  min-width:230px;
  margin-top:10px;
  padding:13px 18px;
  border:1px solid #e5c34d;
  border-radius:8px;
  background:#d4af37;
  color:#07090b;
  font-weight:800;
  cursor:pointer;
}
.submit-primary:hover:not(:disabled){
  background:#e5c34d;
  transform:translateY(-1px);
}
.submit-primary:disabled{
  cursor:wait;
  opacity:.82;
}
.submit-status{
  min-height:1.5em;
  margin-top:12px;
  padding:0;
  font-weight:700;
}
.submit-status.is-sending{color:#f0d876}
.submit-status.is-success{
  padding:12px 14px;
  border:1px solid rgba(94,214,154,.5);
  border-radius:8px;
  background:rgba(38,126,83,.18);
  color:#aef0ca;
}
.submit-status.is-error{
  padding:12px 14px;
  border:1px solid rgba(255,111,111,.55);
  border-radius:8px;
  background:rgba(143,35,35,.18);
  color:#ffb3b3;
}
@media (max-width:640px){
  .submission-panel{padding:18px}
  .submit-primary{width:100%;min-width:0}
}
@media print{
  .submission-panel{display:none!important}
}

/* V1.0.2 checkbox consistency and accessibility */
.checks label{
  align-items:flex-start;
}
.checks input[type="checkbox"]{
  appearance:auto;
  width:24px;
  height:24px;
  min-width:24px;
  min-height:24px;
  flex:0 0 24px;
  margin:.15rem 0 0;
  padding:0;
  accent-color:var(--cyan);
  cursor:pointer;
}
.checks input[type="checkbox"]:focus-visible{
  outline:3px solid #fff2a6;
  outline-offset:3px;
}
.checks label>span{
  min-width:0;
}
