:root {
  --navy: #072c4a;
  --blue: #005ca5;
  --sky: #72c0ff;
  --gold: #f6b219;
  --ink: #25313b;
  --muted: #6b7883;
  --paper: #f1f6fd;
  --line: rgba(7,44,74,.13);
  --white: #fff;
  --header-h: 76px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { min-height: 100%; margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }

.config-header { position: fixed; z-index: 50; inset: 0 0 auto; min-height: var(--header-h); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 0 3.2vw; color: white; background: rgba(7,44,74,.96); backdrop-filter: blur(16px); }
.config-brand { display: flex; align-items: center; gap: 14px; width: fit-content; color: white; font-size: .88rem; font-weight: 800; letter-spacing: .18em; text-decoration: none; }
.config-brand img { width: 110px; height: 46px; object-fit: contain; filter: brightness(0) invert(1); }
.machine-nav { display: flex; gap: clamp(14px,2vw,30px); font-size: .86rem; font-weight: 700; }
.machine-nav a { padding: 28px 0 23px; border-bottom: 4px solid transparent; color: rgba(255,255,255,.68); text-decoration: none; white-space: nowrap; }
.machine-nav a:hover, .machine-nav a[aria-current="page"] { border-bottom-color: var(--gold); color: white; }
.config-header-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.language-picker { display: flex; align-items: center; gap: 7px; color: white; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.language-picker select { min-height: 38px; padding: 0 28px 0 11px; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; color: white; background: rgba(255,255,255,.1); font: inherit; cursor: pointer; }
.language-picker select option { color: var(--navy); background: white; }
.back-link { justify-self: end; padding: 11px 17px; border: 1px solid rgba(255,255,255,.62); border-radius: 999px; color: white; font-size: .86rem; font-weight: 750; text-decoration: none; }

.configurator { min-height: 100svh; padding: calc(var(--header-h) + 54px) clamp(20px,4.8vw,72px) 72px; background: radial-gradient(circle at 85% 14%, rgba(114,192,255,.2), transparent 28%), linear-gradient(180deg,#fff 0,var(--paper) 50%); }
.configurator-copy { max-width: 1500px; margin: 0 auto 44px; display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: end; }
.eyebrow { margin: 0 0 12px; color: var(--gold); font-size: .8rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; letter-spacing: -.045em; }
h1 { color: var(--navy); font-size: clamp(4rem,8vw,8rem); line-height: .82; }
h2 { color: var(--navy); font-size: clamp(1.7rem,2.5vw,2.5rem); line-height: 1.05; }
h3 { color: var(--navy); font-size: 1rem; letter-spacing: -.01em; }
.configurator-partners { justify-self: end; display: grid; gap: 12px; }
.brand-logos { display: flex; align-items: center; justify-content: flex-end; gap: 20px; }
.brand-logos img { width: auto; height: clamp(38px,4vw,58px); max-width: 170px; object-fit: contain; }
.configurator-partners > p { max-width: 520px; margin: 0; color: var(--muted); font-size: .78rem; font-weight: 700; line-height: 1.45; text-align: right; }

.configurator-layout { max-width: 1500px; margin: auto; display: grid; grid-template-columns: minmax(280px,340px) minmax(0,1fr); gap: clamp(28px,4vw,60px); align-items: start; }
.controls { position: sticky; top: calc(var(--header-h) + 24px); min-width: 0; }
.controls-header { margin-bottom: 14px; }
.controls-header .eyebrow { margin-bottom: 8px; }
#controlsForm { display: grid; }
.control-group { min-width: 0; margin: 0; padding: 22px 0; border: 0; border-top: 1px solid var(--line); }
legend { padding: 0; color: var(--navy); font-size: .76rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.clean-select { width: 100%; min-height: 52px; margin-top: 12px; padding: 0 44px 0 15px; border: 1px solid var(--line); border-radius: 14px; color: var(--navy); background: white; font-size: .94rem; font-weight: 750; cursor: pointer; }
.clean-select:focus { outline: 3px solid rgba(114,192,255,.35); border-color: var(--blue); }
.toggle-list { display: grid; margin-top: 8px; }
.option-check { min-width: 0; display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; padding: 13px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.option-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); }
.option-check strong, .option-check small { display: block; }
.option-check strong { color: var(--ink); font-size: .9rem; }
.option-check small { margin-top: 4px; color: var(--blue); font-size: .74rem; line-height: 1.35; }
.option-check.is-unavailable { opacity: .48; cursor: not-allowed; }

.summary { margin-top: 8px; padding-top: 24px; border-top: 1px solid var(--line); }
.summary-subtitle { margin-top: 26px; }
.summary dl { margin: 12px 0 0; }
.selection-summary, .facts-summary { display: grid; }
.selection-summary div, .facts-summary div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; padding: 9px 0; border-bottom: 1px solid rgba(7,44,74,.08); }
.summary dt { color: var(--muted); font-size: .74rem; line-height: 1.35; }
.summary dd { margin: 0; color: var(--navy); font-size: .75rem; font-weight: 780; line-height: 1.35; text-align: right; overflow-wrap: anywhere; }
.cta { min-height: 54px; margin-top: 24px; display: grid; place-items: center; border-radius: 999px; color: var(--navy); background: var(--gold); font-size: .84rem; font-weight: 850; text-decoration: none; }
.cta:hover { color: white; background: var(--navy); }

.visual-column { min-width: 0; display: grid; gap: 34px; }
.viewer-panel { height: clamp(560px,72vh,760px); min-height: 0; display: grid; grid-template-rows: auto minmax(420px,1fr) auto; overflow: hidden; border-radius: 30px; background: radial-gradient(circle at 50% 45%,rgba(114,192,255,.14),transparent 58%),linear-gradient(180deg,#fff,#eaf1f6); box-shadow: 0 26px 80px rgba(7,44,74,.14); }
.viewer-toolbar, .viewer-footer { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; background: rgba(255,255,255,.9); }
.viewer-toolbar { border-bottom: 1px solid var(--line); }
.viewer-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; font-weight: 750; flex-wrap: wrap; }
.viewer-toolbar span, .document-toolbar span { display: block; color: var(--blue); font-size: .7rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.viewer-toolbar strong, .document-toolbar strong { display: block; margin-top: 4px; color: var(--navy); }
.status-pill { min-width: 150px; padding: 9px 12px; border-radius: 999px; color: var(--muted); background: var(--paper); font-size: .7rem; font-weight: 850; text-align: center; text-transform: uppercase; }
.status-pill.is-ready { color: white; background: var(--blue); }
.status-pill.is-error { color: white; background: #a61217; }
.viewer { position: relative; min-height: 420px; }
.viewer::after { position: absolute; left: 50%; bottom: 7%; width: min(58vw,760px); height: min(13vw,180px); border-radius: 50%; background: radial-gradient(ellipse,rgba(246,178,25,.16),rgba(0,92,165,.08) 44%,transparent 72%); content: ""; filter: blur(8px); pointer-events: none; transform: translateX(-50%); }
.viewer canvas { position: relative; z-index: 1; display: block; width: 100%; height: 100%; }
.viewer-placeholder { min-height: 420px; height: 100%; display: grid; place-content: center; gap: 8px; padding: 24px; text-align: center; }
.viewer-placeholder strong { color: var(--navy); font-size: clamp(2.5rem,5vw,5rem); }
.viewer-placeholder span { color: var(--muted); }

.document-panel { min-width: 0; overflow: hidden; border-radius: 30px; background: white; box-shadow: 0 22px 68px rgba(7,44,74,.1); }
.document-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.document-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.document-tabs { display: flex; padding: 4px; border-radius: 999px; background: var(--paper); }
.document-tabs button { min-height: 34px; padding: 8px 13px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-size: .72rem; font-weight: 820; cursor: pointer; text-transform: uppercase; }
.document-tabs button[aria-selected="true"] { color: white; background: var(--navy); }
.document-toolbar a { padding: 10px 14px; border-radius: 999px; color: white; background: var(--blue); font-size: .75rem; font-weight: 820; text-decoration: none; }
.document-toolbar a[aria-disabled="true"] { color: var(--muted); background: var(--paper); pointer-events: none; }
.document-frame { min-height: 300px; display: grid; place-items: center; padding: clamp(12px,2vw,26px); background: #e8eef3; }
.document-frame img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; background: white; box-shadow: 0 8px 30px rgba(7,44,74,.13); }
.document-placeholder { display: none; margin: 0; padding: 54px 24px; color: var(--muted); font-weight: 750; text-align: center; }
.document-panel.is-empty .document-frame { display: none; }
.document-panel.is-empty .document-placeholder { display: block; }

@media (max-width: 1050px) {
  .config-header { grid-template-columns: 1fr auto; }
  .machine-nav { grid-column: 1 / -1; order: 3; justify-content: center; overflow-x: auto; }
  .machine-nav a { padding: 10px 0 12px; }
  .configurator { padding-top: calc(var(--header-h) + 78px); }
  .configurator-layout { grid-template-columns: 280px minmax(0,1fr); gap: 28px; }
}

@media (max-width: 800px) {
  .config-header { position: static; padding: 10px 18px; }
  .configurator { padding: 42px 18px 60px; }
  .configurator-copy, .configurator-layout { grid-template-columns: 1fr; }
  .configurator-partners { justify-self: start; }
  .brand-logos { justify-content: flex-start; flex-wrap: wrap; }
  .configurator-partners > p { text-align: left; }
  .controls { position: static; }
  .viewer-panel { height: 620px; }
}

@media (max-width: 560px) {
  :root { --header-h: 66px; }
  .config-brand img { width: 86px; height: 38px; }
  .back-link { padding: 9px 12px; font-size: .76rem; }
  .language-picker > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .config-header-actions { gap: 6px; }
  .machine-nav { justify-content: flex-start; }
  .configurator-copy { margin-bottom: 34px; gap: 30px; }
  h1 { font-size: clamp(3.6rem,20vw,5.4rem); }
  .brand-logos img { height: 42px; max-width: 40vw; }
  .viewer-panel { height: 560px; border-radius: 22px; }
  .viewer-toolbar { align-items: flex-start; flex-direction: column; }
  .document-panel { border-radius: 22px; }
  .document-toolbar { align-items: flex-start; flex-direction: column; }
  .document-actions, .document-tabs { width: 100%; }
  .document-tabs button { flex: 1; }
  .document-toolbar a { width: 100%; text-align: center; }
  .selection-summary div, .facts-summary div { grid-template-columns: 1fr; gap: 3px; }
  .summary dd { text-align: left; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
