@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500&display=swap');

:root {
  --black: #050607;
  --graphite: #101316;
  --panel: rgba(11, 14, 17, .88);
  --panel-soft: rgba(14, 18, 22, .74);
  --line: rgba(255, 255, 255, .17);
  --line-strong: rgba(255, 255, 255, .34);
  --white: #f6f7f7;
  --muted: #aeb4b8;
  --silver: #d7dbde;
  --blue: #00adef;
  --blue-deep: #007ead;
  --success: #8cc9b1;
  --danger: #e49a95;
  --serif: "Source Serif 4", "Times New Roman", serif;
  --sans: "Manrope", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--black); }
body { color: var(--white); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.svg-sprite { position: fixed; width: 0; height: 0; overflow: hidden; }
svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark { fill: none; stroke-width: 1.25; }

#mercedes-app {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.app-screen {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
  pointer-events: none;
}

.app-screen.is-active { display: block; }
.app-screen button, .app-screen input, .app-screen form, .app-screen dialog, .app-screen .tool-panel, .app-screen .showroom-drawer { pointer-events: auto; }

.brand-lockup {
  display: grid;
  grid-template-columns: 31px auto;
  grid-template-rows: 17px 13px;
  align-items: center;
  column-gap: 10px;
  letter-spacing: .01em;
}

.brand-lockup .brand-mark { grid-row: 1 / 3; width: 31px; height: 31px; color: #fff; }
.brand-lockup span { align-self: end; font-family: var(--serif); font-size: 16px; line-height: 1; }
.brand-lockup small { align-self: start; color: var(--muted); font-size: 8px; letter-spacing: .23em; line-height: 1.5; text-transform: uppercase; }
.brand-lockup--center { grid-template-columns: 48px auto; grid-template-rows: 26px 16px; }
.brand-lockup--center .brand-mark { width: 48px; height: 48px; }
.brand-lockup--center span { font-size: 25px; }
.brand-lockup--center small { font-size: 10px; }

.eyebrow {
  margin: 0 0 9px;
  color: var(--blue);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.015em; }
h1 { font-size: clamp(34px, 4.2vw, 62px); line-height: .98; }
h2 { font-size: clamp(27px, 3.1vw, 46px); line-height: 1.02; }
h3 { font-size: 22px; margin: 0; }
p { color: var(--silver); font-size: 12px; line-height: 1.7; }

.primary-button, .quiet-button, .text-button, .skip-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  gap: 16px;
  letter-spacing: .06em;
}

.primary-button {
  padding: 0 18px;
  border-color: var(--blue);
  background: var(--blue);
  color: #00151d;
  font-size: 11px;
  font-weight: 600;
}
.primary-button:hover, .primary-button:focus-visible { background: #35c4f7; }
.primary-button:disabled { border-color: var(--line); background: rgba(30,35,38,.82); color: var(--muted); cursor: wait; }
.primary-button svg { width: 15px; height: 15px; }
.quiet-button, .skip-button { padding: 0 16px; background: rgba(0,0,0,.25); color: var(--white); font-size: 10px; }
.text-button { min-height: auto; padding: 0; border: 0; background: none; color: var(--white); font-size: 11px; }
.text-button svg { width: 14px; }
.skip-button { width: 100%; margin-top: 8px; border: 0; background: transparent; color: var(--muted); }
.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel-soft);
  cursor: pointer;
}
.icon-button svg { width: 16px; height: 16px; }

.screen-splash {
  background:
    radial-gradient(circle at 72% 40%, rgba(45, 53, 58, .38), transparent 25%),
    linear-gradient(125deg, #050607 0%, #111518 53%, #020303 100%);
}
.screen-splash::before {
  content: "";
  position: absolute;
  inset: 0 0 0 46%;
  background:
    linear-gradient(115deg, transparent 28%, rgba(255,255,255,.07) 29%, transparent 29.5%),
    linear-gradient(110deg, transparent 46%, rgba(255,255,255,.045) 47%, transparent 48%);
  transform: skewX(-8deg);
}
.screen-splash .brand-lockup { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); }
.screen-splash .splash-rule { position: absolute; left: calc(50% - 60px); top: 57%; width: 120px; height: 1px; background: var(--line-strong); }
.screen-splash > p { position: absolute; left: 50%; top: 60%; transform: translateX(-50%); color: var(--muted); font-family: var(--serif); font-size: 14px; letter-spacing: .1em; white-space: nowrap; }
.screen-splash .text-button { position: absolute; right: 4vw; bottom: 4vw; }

.screen-auth { background: #090b0d; pointer-events: auto; }
.auth-panel {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 2;
  width: min(43%, 530px);
  min-width: 410px;
  padding: clamp(24px, 4vw, 54px);
  background: linear-gradient(145deg, rgba(11,13,15,.98), rgba(4,5,6,.98));
  box-shadow: 30px 0 70px rgba(0,0,0,.38);
}
.auth-copy { margin-top: clamp(30px, 6vh, 64px); }
.auth-copy h1 { max-width: 430px; margin-bottom: 18px; }
.auth-copy > p:last-child { max-width: 390px; }
.auth-tabs { display: flex; margin-top: 24px; border-bottom: 1px solid var(--line); }
.auth-tabs button { flex: 1; padding: 10px 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; letter-spacing: .08em; }
.auth-tabs button.is-active { border-color: var(--blue); color: var(--white); }
.auth-form { margin-top: 18px; }
.auth-form label, .lead-modal label { display: block; margin-bottom: 12px; }
.auth-form label > span:first-child, .lead-modal label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 8px; letter-spacing: .13em; text-transform: uppercase; }
.field { display: flex; height: 39px; align-items: center; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.field svg { width: 15px; margin: 0 11px; color: var(--muted); }
.field input, .lead-modal input { min-width: 0; flex: 1; height: 100%; padding: 0 10px 0 0; border: 0; outline: 0; background: transparent; color: var(--white); font-size: 11px; }
.field:focus-within { border-color: var(--blue); }
.auth-form .primary-button { width: 100%; margin-top: 4px; }
.legal { position: absolute; bottom: 22px; left: clamp(24px, 4vw, 54px); color: #70767a; font-size: 8px; }
.auth-visual {
  position: absolute;
  inset: 0 0 0 min(43%, 530px);
  padding: 0 5vw 5vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    radial-gradient(ellipse at 58% 60%, rgba(255,255,255,.14), transparent 28%),
    linear-gradient(to top, rgba(0,0,0,.88), transparent 45%),
    url("./ui/backgrounds/mercedes-garage-background.png") center / cover;
}
.auth-visual::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.45), transparent 22%); }
.auth-visual p, .auth-visual span { position: relative; margin: 0; }
.auth-visual p { color: #fff; font-family: var(--serif); font-size: 25px; }
.auth-visual span { margin-top: 5px; color: var(--muted); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }

.simple-header { position: absolute; z-index: 3; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 24px 4vw; }
.screen-welcome {
  background:
    linear-gradient(90deg, rgba(2,3,3,.95) 0%, rgba(3,4,5,.72) 44%, rgba(3,4,5,.1) 70%),
    url("./ui/backgrounds/mercedes-garage-background.png") center / cover;
}
.welcome-copy { position: absolute; z-index: 2; left: 8vw; top: 27%; width: min(470px, 42vw); }
.welcome-copy p { max-width: 400px; }
.welcome-copy .primary-button { margin-top: 8px; }
.experience-steps { position: absolute; right: 4vw; bottom: 3vw; display: flex; gap: 1px; margin: 0; padding: 0; list-style: none; }
.experience-steps li { width: 145px; padding: 15px; border-top: 1px solid var(--line-strong); background: rgba(4,6,7,.72); backdrop-filter: blur(15px); }
.experience-steps li > * { display: block; }
.experience-steps span { margin-bottom: 10px; color: var(--blue); font-size: 8px; }
.experience-steps strong { font-family: var(--serif); font-size: 15px; font-weight: 400; }
.experience-steps small { margin-top: 3px; color: var(--muted); font-size: 8px; }

.screen-scan, .screen-ar {
  background: transparent;
}
.screen-scan { pointer-events: auto; background: rgba(3,4,5,.3); }
.screen-scan::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.62), transparent 35%, transparent 60%, rgba(0,0,0,.82)); }
.scan-reticle { position: absolute; left: 50%; top: 48%; width: 210px; height: 150px; transform: translate(-50%,-50%); border: 1px solid rgba(255,255,255,.42); }
.scan-reticle::before, .scan-reticle::after { content: ""; position: absolute; inset: -1px; border: 2px solid transparent; border-left-color: var(--blue); border-right-color: var(--blue); }
.scan-reticle svg { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; transform: translate(-50%,-50%); color: var(--blue); }
.scan-reticle i { position: absolute; left: 8px; right: 8px; top: 50%; height: 1px; background: var(--blue); box-shadow: 0 0 12px var(--blue); animation: scan 2.4s ease-in-out infinite; }
@keyframes scan { 0%,100% { transform: translateY(-55px); } 50% { transform: translateY(55px); } }
.scan-copy { position: absolute; left: 50%; bottom: 5vh; width: min(510px, 80vw); padding: 19px 22px; transform: translateX(-50%); display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 28px; background: var(--panel); border-left: 2px solid var(--blue); backdrop-filter: blur(18px); }
.scan-copy .eyebrow, .scan-copy h2, .scan-copy p { grid-column: 1; }
.scan-copy h2 { margin-bottom: 3px; font-size: 24px; }
.scan-copy p { margin: 0; font-size: 10px; }
.scan-copy .primary-button { grid-column: 2; grid-row: 1 / 4; }

.screen-tutorial {
  pointer-events: auto;
  background: linear-gradient(90deg, rgba(3,4,5,.72), rgba(3,4,5,.12));
}
.tutorial-card { position: absolute; top: 50%; left: 7vw; width: min(400px, 44vw); padding: 30px; transform: translateY(-50%); background: var(--panel); border-top: 1px solid var(--line-strong); backdrop-filter: blur(20px); }
.step-count { position: absolute; top: 18px; right: 22px; margin: 0; color: var(--muted); font-size: 9px; }
.tutorial-icon { width: 52px; height: 52px; margin-bottom: 28px; color: var(--blue); }
.tutorial-card h2 { margin-bottom: 10px; }
.tutorial-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

#ar-hud { position: absolute; inset: 0; transition: opacity .25s; pointer-events: none; }
.ar-header { position: absolute; z-index: 4; top: 0; left: 0; right: 0; height: 58px; display: flex; align-items: center; padding: 0 18px; background: linear-gradient(to bottom, rgba(3,4,5,.9), rgba(3,4,5,.55)); border-bottom: 1px solid rgba(255,255,255,.08); }
.ar-header .brand-lockup { margin-right: 24px; }
.vehicle-title { padding-left: 20px; border-left: 1px solid var(--line); }
.vehicle-title p { margin: 0; color: var(--white); font-family: var(--serif); font-size: 14px; line-height: 1.1; }
.vehicle-title span { color: var(--muted); font-size: 7px; letter-spacing: .12em; text-transform: uppercase; }
.ar-header .hud-button--status { margin-left: auto; width: auto; height: 32px; padding: 0 12px; flex-direction: row; gap: 8px; background: rgba(5,7,8,.4); }
.hud-button--status i { width: 6px; height: 6px; border-radius: 50%; background: #d3af70; box-shadow: 0 0 8px rgba(211,175,112,.65); }
.hud-button--status.is-ready i { background: var(--success); box-shadow: 0 0 8px rgba(140,201,177,.7); }

.hud-rail { position: absolute; z-index: 4; top: 50%; display: flex; flex-direction: column; gap: 5px; transform: translateY(-50%); }
.hud-rail--left { left: 18px; }
.hud-rail--right { right: 18px; }
.hud-button {
  width: 53px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 3px;
  background: rgba(8,10,12,.64);
  backdrop-filter: blur(15px);
  cursor: pointer;
}
.hud-button svg { width: 17px; height: 17px; }
.hud-button span { margin-top: 4px; color: var(--silver); font-size: 7px; letter-spacing: .04em; }
.hud-button.is-active { border-color: var(--blue); background: rgba(0,91,126,.4); }
.hud-button--accent { color: #001820; border-color: var(--blue); background: var(--blue); }
.hud-button--accent span { color: #001820; font-weight: 600; }

.place-guidance { position: absolute; z-index: 2; left: 50%; top: 49%; transform: translate(-50%,-50%); text-align: center; transition: opacity .3s; }
.place-guidance.is-hidden { opacity: 0; }
.surface-ring { display: block; width: 145px; height: 54px; margin: auto; border: 1px solid var(--blue); border-radius: 50%; box-shadow: 0 0 22px rgba(0,173,239,.3), inset 0 0 22px rgba(0,173,239,.15); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); opacity: .55; } }
.place-guidance p { margin-top: 13px; padding: 6px 11px; background: rgba(0,0,0,.62); color: var(--white); font-size: 9px; letter-spacing: .04em; }

.feature-dock { position: absolute; z-index: 5; bottom: 12px; left: 50%; display: flex; gap: 4px; padding: 5px; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.13); background: rgba(7,9,10,.78); backdrop-filter: blur(18px); }
.feature-button { min-width: 63px; height: 45px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 9px; border: 0; border-right: 1px solid rgba(255,255,255,.08); background: transparent; cursor: pointer; }
.feature-button:last-child { border-right: 0; }
.feature-button svg { width: 17px; height: 17px; color: var(--silver); }
.feature-button span { margin-top: 4px; color: var(--muted); font-size: 7px; white-space: nowrap; }
.feature-button.is-active { background: rgba(255,255,255,.09); }
.feature-button.is-active svg, .feature-button.is-active span { color: var(--blue); }
.feature-button--showroom { min-width: 83px; margin-left: 3px; background: rgba(0,126,173,.3); }

.tool-panel {
  position: absolute;
  z-index: 6;
  right: 83px;
  bottom: 70px;
  width: 310px;
  padding: 17px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(21px);
  transition: .2s ease;
}
.tool-panel.is-open { opacity: 1; visibility: visible; transform: none; }
.tool-panel > header { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.tool-panel header .eyebrow { margin-bottom: 3px; }
.tool-panel header h3 { font-size: 19px; }
.tool-panel .icon-button { width: 29px; height: 29px; background: transparent; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 12px; }
.preset-button { height: 60px; padding: 8px; border: 1px solid var(--line); border-radius: 2px; background: rgba(255,255,255,.03); color: var(--muted); cursor: pointer; text-align: left; }
.preset-button strong, .preset-button span { display: block; }
.preset-button strong { color: var(--white); font-family: var(--serif); font-size: 14px; font-weight: 400; }
.preset-button span { margin-top: 4px; font-size: 7px; letter-spacing: .07em; text-transform: uppercase; }
.preset-button.is-active { border-color: var(--blue); background: rgba(0,173,239,.09); }
.scale-range { width: 100%; margin: 15px 0 5px; accent-color: var(--blue); }
.panel-note { margin: 9px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 13px; }
.swatch { aspect-ratio: 1.4; border: 1px solid var(--line); border-radius: 2px; background: var(--swatch); cursor: pointer; }
.swatch.is-active { outline: 1px solid var(--blue); outline-offset: 2px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.toggle-row p { margin: 0; color: var(--white); font-size: 10px; }
.toggle-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 7px; }
.switch { width: 43px; height: 23px; padding: 2px; border: 1px solid var(--line); border-radius: 14px; background: #24282b; cursor: pointer; }
.switch::before { content: ""; display: block; width: 17px; height: 17px; border-radius: 50%; background: var(--silver); transition: .2s; }
.switch.is-on { border-color: var(--blue); background: var(--blue-deep); }
.switch.is-on::before { transform: translateX(18px); background: #fff; }
.feature-copy { padding-top: 13px; }
.feature-copy h4 { margin: 0 0 5px; font-family: var(--serif); font-size: 18px; font-weight: 400; }
.feature-copy p { margin-bottom: 11px; font-size: 9px; }
.feature-copy .primary-button { width: 100%; }

.showroom-drawer {
  position: absolute;
  z-index: 12;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(385px, 42vw);
  padding: 24px;
  overflow-y: auto;
  transform: translateX(103%);
  border-left: 1px solid var(--line);
  background: rgba(7,9,10,.95);
  backdrop-filter: blur(24px);
  transition: transform .3s cubic-bezier(.22,.8,.24,1);
}
.showroom-drawer.is-open { transform: none; }
.showroom-drawer > header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.showroom-drawer header h2 { margin: 0; font-size: 29px; }
.vehicle-card { position: relative; margin-bottom: 8px; padding: 13px; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.vehicle-card.is-selected { border-color: var(--blue); }
.vehicle-card.is-selected::after { content: ""; position: absolute; top: 10px; right: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.vehicle-silhouette { height: 54px; display: grid; place-items: center; margin-bottom: 9px; background: linear-gradient(120deg, #22282c, #111416); }
.vehicle-silhouette svg { width: 72px; height: 42px; color: var(--silver); }
.vehicle-card p { margin: 0; color: var(--white); font-family: var(--serif); font-size: 14px; line-height: 1.3; }
.vehicle-card span, .vehicle-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 7px; letter-spacing: .09em; text-transform: uppercase; }
.vehicle-card small { color: var(--blue); }
.vehicle-card.is-locked { opacity: .45; }
.showroom-drawer > .primary-button { width: 100%; margin-top: 8px; }

.editorial-sheet {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: none;
  padding: 8vh 7vw;
  background: linear-gradient(90deg, rgba(2,3,4,.96) 0%, rgba(3,4,5,.78) 43%, rgba(3,4,5,.12) 76%);
  backdrop-filter: blur(2px);
  pointer-events: auto;
}
.editorial-sheet.is-open { display: block; }
.editorial-back { position: absolute; top: 24px; left: 28px; display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--silver); font-size: 9px; letter-spacing: .07em; }
.editorial-back svg { width: 14px; transform: rotate(180deg); }
.editorial-copy { position: absolute; top: 50%; left: 8vw; width: min(440px, 42vw); transform: translateY(-50%); }
.editorial-copy h2 { max-width: 410px; margin-bottom: 14px; }
.editorial-copy > p { max-width: 385px; }
.editorial-copy ul { max-width: 380px; margin: 24px 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.editorial-copy li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 8px; }
.editorial-copy li span { color: var(--muted); }
.editorial-copy li strong { font-weight: 500; letter-spacing: .06em; }
.editorial-nav { position: absolute; right: 4vw; top: 24px; display: flex; gap: 2px; }
.editorial-nav button { padding: 9px 13px; border: 0; border-bottom: 1px solid transparent; background: rgba(5,7,8,.58); color: var(--muted); cursor: pointer; font-size: 8px; }
.editorial-nav button.is-active { border-bottom-color: var(--blue); color: #fff; }
.editorial-dots { position: absolute; right: 4vw; bottom: 4vh; display: flex; gap: 7px; }
.editorial-dots i { width: 20px; height: 2px; background: rgba(255,255,255,.3); }
.editorial-dots i.is-active { background: var(--blue); }

dialog { color: var(--white); }
.feature-modal, .lead-modal {
  position: absolute;
  z-index: 30;
  width: min(430px, 82vw);
  max-height: 84vh;
  margin: auto;
  padding: 30px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #0c0f11;
  box-shadow: 0 25px 80px rgba(0,0,0,.68);
}
dialog::backdrop { background: rgba(0,0,0,.65); }
.feature-modal .icon-button, .lead-modal > .icon-button { position: absolute; top: 14px; right: 14px; background: transparent; }
.modal-icon { width: 38px; height: 38px; margin-bottom: 23px; color: var(--blue); }
.feature-modal h2, .lead-modal h2 { margin-bottom: 11px; font-size: 30px; }
.feature-modal > p, .lead-modal > p { font-size: 10px; }
.feature-modal > small { display: block; margin: 18px 0; padding: 10px; border-left: 1px solid var(--blue); background: rgba(0,173,239,.07); color: var(--muted); font-size: 8px; line-height: 1.5; }
.feature-modal .primary-button { width: 100%; }
.lead-modal form { margin-top: 18px; }
.lead-modal input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.lead-modal input:focus { border-color: var(--blue); outline: 0; }
.lead-modal form .primary-button { width: 100%; }
.lead-success { padding: 26px 0 6px; text-align: center; }
.lead-success > svg { width: 35px; height: 35px; color: var(--success); }
.lead-success h3 { margin: 13px 0 5px; }
.modal-backdrop { position: absolute; z-index: 10; inset: 0; display: none; background: rgba(0,0,0,.38); backdrop-filter: blur(3px); }
.modal-backdrop.is-open { display: block; }

.toast { position: absolute; z-index: 60; left: 50%; bottom: 76px; min-width: 190px; padding: 9px 14px; transform: translate(-50%, 15px); opacity: 0; border: 1px solid var(--line); background: rgba(5,7,8,.9); color: var(--white); font-size: 9px; text-align: center; transition: .25s; }
.toast.is-visible { transform: translate(-50%,0); opacity: 1; }

.rotate-device { display: none; position: absolute; z-index: 90; inset: 0; align-items: center; justify-content: center; flex-direction: column; padding: 40px; background: #050607; text-align: center; pointer-events: auto; }
.rotate-device svg { width: 46px; height: 46px; margin-bottom: 20px; color: var(--blue); }
.rotate-device h2 { margin-bottom: 6px; font-size: 27px; }
.rotate-device p { color: var(--muted); }

@media (max-width: 820px) and (orientation: landscape) {
  .brand-lockup { grid-template-columns: 26px auto; grid-template-rows: 14px 11px; column-gap: 7px; }
  .brand-lockup .brand-mark { width: 26px; height: 26px; }
  .brand-lockup span { font-size: 13px; }
  .brand-lockup small { font-size: 6px; }
  .auth-panel { min-width: 350px; padding: 18px 30px; }
  .auth-copy { margin-top: 18px; }
  .auth-copy h1 { margin-bottom: 9px; font-size: 31px; }
  .auth-copy > p:last-child { display: none; }
  .auth-tabs { margin-top: 11px; }
  .auth-form { margin-top: 10px; }
  .auth-form label { margin-bottom: 7px; }
  .field { height: 34px; }
  .primary-button { min-height: 36px; }
  .legal { display: none; }
  .welcome-copy { top: 25%; }
  .experience-steps li { width: 112px; padding: 10px; }
  .ar-header { height: 47px; padding: 0 10px; }
  .vehicle-title p { font-size: 11px; }
  .hud-rail--left { left: 8px; }
  .hud-rail--right { right: 8px; }
  .hud-button { width: 44px; height: 40px; }
  .hud-button svg { width: 14px; height: 14px; }
  .feature-dock { bottom: 6px; }
  .feature-button { min-width: 50px; height: 38px; padding: 0 5px; }
  .feature-button--showroom { min-width: 68px; }
  .tool-panel { right: 58px; bottom: 54px; width: 290px; }
}

@media (orientation: portrait) and (max-width: 700px) {
  .app-screen.is-active { display: none; }
  .rotate-device { display: flex; }
}

/* Mercedes AR Studio v2 ----------------------------------------------------
   Camera-first interface: onboarding is a set of compact glass sheets laid
   over the live XR canvas, never a replacement image or opaque loading page. */
.ui-icon, .success-icon {
  width: 1.1em;
  height: 1.1em;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  pointer-events: none;
}
.primary-button .ui-icon, .text-button .ui-icon { width: 15px; height: 15px; }
.icon-button .ui-icon { width: 16px; height: 16px; }
.field .ui-icon { width: 15px; height: 15px; margin: 0 11px; }
.hud-button .ui-icon, .feature-button .ui-icon { width: 17px; height: 17px; }
.feature-button.is-active .ui-icon { filter: brightness(0) saturate(100%) invert(54%) sepia(90%) saturate(2050%) hue-rotate(158deg) brightness(99%); }
.vehicle-silhouette .ui-icon { width: 72px; height: 42px; opacity: .75; }
.editorial-back .ui-icon { width: 14px; height: 14px; }
.success-icon { width: 35px; height: 35px; margin: auto; }

.simple-header, .ar-header {
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}

.screen-splash {
  pointer-events: auto;
  background: linear-gradient(to top, rgba(2,3,4,.92), rgba(2,3,4,.36) 48%, transparent 76%);
}
.screen-splash::before { display: none; }
.screen-splash .brand-lockup {
  left: max(28px, env(safe-area-inset-left));
  top: auto;
  bottom: max(70px, calc(env(safe-area-inset-bottom) + 54px));
  transform: none;
}
.screen-splash .splash-rule { left: max(28px, env(safe-area-inset-left)); top: auto; bottom: max(56px, calc(env(safe-area-inset-bottom) + 40px)); width: 210px; }
.screen-splash > p { left: max(28px, env(safe-area-inset-left)); top: auto; bottom: max(19px, env(safe-area-inset-bottom)); transform: none; margin: 0; }
.screen-splash .text-button { right: max(28px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); }

.screen-auth { background: linear-gradient(to top, rgba(2,3,4,.8), transparent 78%); }
.auth-panel {
  inset: auto auto max(12px, env(safe-area-inset-bottom)) 50%;
  width: min(920px, calc(100vw - max(32px, env(safe-area-inset-left)) - max(32px, env(safe-area-inset-right))));
  min-width: 0;
  max-height: calc(100dvh - max(24px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
  padding: 20px 24px;
  display: grid;
  grid-template-columns: minmax(230px, .82fr) minmax(300px, 1fr);
  grid-template-areas: "brand tabs" "copy form" "copy legal";
  column-gap: 32px;
  overflow-y: auto;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-top-color: var(--line-strong);
  border-radius: 7px;
  background: rgba(8,11,13,.88);
  box-shadow: 0 18px 60px rgba(0,0,0,.42);
  backdrop-filter: blur(24px);
}
.auth-panel > .brand-lockup { grid-area: brand; align-self: start; }
.auth-copy { grid-area: copy; margin-top: 23px; }
.auth-copy h1 { margin-bottom: 10px; font-size: clamp(28px, 3.1vw, 45px); }
.auth-tabs { grid-area: tabs; margin-top: 0; align-self: end; }
.auth-form { grid-area: form; margin-top: 13px; }
.legal { position: static; grid-area: legal; align-self: end; margin: 10px 0 0; }
.auth-visual { display: none; }

.screen-welcome {
  pointer-events: auto;
  background: linear-gradient(to top, rgba(2,3,4,.85), rgba(2,3,4,.18) 62%, transparent 84%);
}
.welcome-copy {
  left: max(28px, env(safe-area-inset-left));
  top: auto;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(440px, 45vw);
  padding: 18px 21px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--blue);
  border-radius: 5px;
  background: rgba(8,11,13,.82);
  backdrop-filter: blur(20px);
}
.welcome-copy h1 { margin-bottom: 10px; font-size: clamp(31px, 4vw, 50px); }
.welcome-copy > p:last-of-type { margin-bottom: 9px; line-height: 1.45; }
.experience-steps { right: max(28px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); }

.scan-reticle .ui-icon { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; transform: translate(-50%,-50%); }
.scan-copy { bottom: max(12px, env(safe-area-inset-bottom)); }

.screen-tutorial { background: linear-gradient(to top, rgba(2,3,4,.72), transparent 62%); }
.tutorial-card {
  left: 50%;
  top: auto;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(760px, calc(100vw - max(32px, env(safe-area-inset-left)) - max(32px, env(safe-area-inset-right))));
  min-height: 126px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  column-gap: 20px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-left: 2px solid var(--blue);
  border-radius: 6px;
  background: rgba(8,11,13,.86);
}
.tutorial-icon { width: 48px; height: 48px; margin: 0; }
.tutorial-copy .eyebrow { margin-bottom: 4px; }
.tutorial-copy h2 { margin-bottom: 5px; font-size: 27px; }
.tutorial-copy > p:last-child { margin: 0; max-width: 470px; font-size: 10px; line-height: 1.5; }
.tutorial-actions { margin: 0; align-self: end; }
.step-count { top: 12px; right: 16px; }

.camera-sheet {
  position: absolute;
  z-index: 95;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(760px, calc(100vw - max(28px, env(safe-area-inset-left)) - max(28px, env(safe-area-inset-right))));
  padding: 17px 18px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 18px);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  background: rgba(7,10,12,.95);
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  backdrop-filter: blur(24px);
  transition: .22s ease;
  pointer-events: auto;
}
.camera-sheet.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.has-camera-alert .screen-scan.is-active .scan-copy,
.has-camera-alert .screen-tutorial.is-active .tutorial-card {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.camera-sheet.is-error { border-left-color: var(--danger); }
.camera-sheet__icon { width: 38px; height: 38px; }
.camera-sheet.is-error .camera-sheet__icon { filter: grayscale(.2) sepia(.35) hue-rotate(305deg); }
.camera-sheet__copy .eyebrow { margin-bottom: 3px; }
.camera-sheet__copy h2 { margin: 0 0 4px; font-size: 22px; }
.camera-sheet__copy p:last-child { margin: 0; font-size: 9px; line-height: 1.45; }
.camera-sheet__actions { display: flex; gap: 7px; }
.camera-sheet__actions button { min-height: 36px; }

.rotate-device { z-index: 110; background: radial-gradient(circle at 50% 34%, #172027, #050607 58%); }
.rotate-device__visual { position: relative; width: 104px; height: 72px; margin-bottom: 24px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 12px; transform: rotate(-7deg); box-shadow: 0 0 35px rgba(0,173,239,.13); }
.rotate-device__visual img { width: 38px; height: 38px; }
.rotate-device__visual i { position: absolute; right: 5px; width: 2px; height: 18px; border-radius: 3px; background: var(--blue); }
.rotate-device .eyebrow { color: var(--blue); }
.rotate-device h2 { max-width: 310px; margin-bottom: 9px; font-size: 31px; }
.rotate-device > p:last-child { max-width: 320px; margin: 0; font-size: 11px; line-height: 1.55; }

@media (max-height: 520px) and (orientation: landscape) {
  .simple-header { padding-top: max(9px, env(safe-area-inset-top)); padding-bottom: 9px; }
  .screen-splash .brand-lockup { bottom: max(58px, calc(env(safe-area-inset-bottom) + 48px)); }
  .screen-splash .splash-rule { bottom: max(46px, calc(env(safe-area-inset-bottom) + 36px)); }

  .auth-panel { bottom: max(7px, env(safe-area-inset-bottom)); padding: 12px 16px; column-gap: 22px; }
  .auth-copy { margin-top: 13px; }
  .auth-copy h1 { margin-bottom: 6px; font-size: 26px; }
  .auth-copy > p:last-child { display: none; }
  .auth-tabs button { padding: 6px 0; }
  .auth-form { margin-top: 7px; }
  .auth-form label { margin-bottom: 6px; }
  .field { height: 32px; }
  .primary-button, .quiet-button, .skip-button { min-height: 33px; }
  .skip-button { margin-top: 2px; }
  .legal { display: none; }

  .welcome-copy { bottom: max(8px, env(safe-area-inset-bottom)); padding: 12px 15px; }
  .welcome-copy h1 { margin-bottom: 5px; font-size: 29px; }
  .welcome-copy > p:last-of-type { display: none; }
  .welcome-copy .primary-button { margin-top: 3px; }
  .experience-steps { bottom: max(8px, env(safe-area-inset-bottom)); }
  .experience-steps li { width: 100px; padding: 9px; }
  .experience-steps span { margin-bottom: 4px; }
  .experience-steps small { display: none; }

  .scan-reticle { top: 43%; width: 170px; height: 104px; }
  .scan-copy { bottom: max(7px, env(safe-area-inset-bottom)); padding: 11px 14px; }
  .scan-copy h2 { font-size: 20px; }
  .scan-copy p { display: none; }

  .tutorial-card { bottom: max(7px, env(safe-area-inset-bottom)); min-height: 94px; padding: 12px 15px; grid-template-columns: 42px 1fr auto; column-gap: 13px; }
  .tutorial-icon { width: 37px; height: 37px; }
  .tutorial-copy h2 { margin-bottom: 2px; font-size: 22px; }
  .tutorial-copy > p:last-child { max-width: 380px; font-size: 8px; }
  .tutorial-actions { gap: 4px; }

  .camera-sheet { bottom: max(7px, env(safe-area-inset-bottom)); padding: 11px 13px; grid-template-columns: 32px minmax(0, 1fr) auto; }
  .camera-sheet__icon { width: 29px; height: 29px; }
  .camera-sheet__copy h2 { font-size: 18px; }
  .camera-sheet__copy p:last-child { max-width: 350px; font-size: 8px; }
  .camera-sheet__actions button { min-height: 31px; padding: 0 10px; }
}

@media (max-width: 720px) and (orientation: landscape) {
  .auth-panel { grid-template-columns: minmax(190px, .75fr) minmax(260px, 1fr); }
  .auth-copy h1 { font-size: 24px; }
  .welcome-copy { width: 43vw; }
  .experience-steps li { width: 92px; }
  .tutorial-card { width: calc(100vw - max(20px, env(safe-area-inset-left)) - max(20px, env(safe-area-inset-right))); }
  .tutorial-copy > p:last-child { max-width: 310px; }
}

@media (orientation: portrait) and (max-width: 700px) {
  .app-screen.is-active { display: none; }
  .rotate-device { display: flex; padding-left: max(30px, env(safe-area-inset-left)); padding-right: max(30px, env(safe-area-inset-right)); }
}

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

/* System diagnostics: intentionally independent from the AR hierarchy/UI. */
.system-diagnostics {
  position: fixed;
  z-index: 1000;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  width: min(470px, calc(100vw - 20px));
  max-height: calc(100dvh - max(20px, env(safe-area-inset-top)) - max(10px, env(safe-area-inset-bottom)));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(153, 211, 236, .34);
  border-radius: 8px;
  background: rgba(5, 8, 10, .97);
  color: #eef6f9;
  box-shadow: 0 18px 70px rgba(0, 0, 0, .75), 0 0 0 1px rgba(0, 173, 239, .08) inset;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  pointer-events: auto;
  transition: width .2s ease, height .2s ease, max-height .2s ease, transform .2s ease;
}
.system-diagnostics button { font-family: inherit; pointer-events: auto; }
.system-diagnostics__header {
  min-height: 52px;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  background: linear-gradient(90deg, rgba(0, 173, 239, .13), rgba(255, 255, 255, .025));
}
.system-diagnostics__identity {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.system-diagnostics__identity span { min-width: 0; display: block; }
.system-diagnostics__identity strong,
.system-diagnostics__identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.system-diagnostics__identity strong { color: #f6fbfd; font-size: 11px; letter-spacing: .02em; }
.system-diagnostics__identity small { margin-top: 3px; color: #a7b9c1; font-size: 8px; }
.system-diagnostics__status { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #00adef; box-shadow: 0 0 10px rgba(0, 173, 239, .8); }
.system-diagnostics[data-health="ok"] .system-diagnostics__status { background: #78d2aa; box-shadow: 0 0 10px rgba(120, 210, 170, .8); }
.system-diagnostics[data-health="warn"] .system-diagnostics__status { background: #e0b56c; box-shadow: 0 0 10px rgba(224, 181, 108, .8); }
.system-diagnostics[data-health="error"] .system-diagnostics__status { background: #ff6f6f; box-shadow: 0 0 11px rgba(255, 78, 78, .85); }
.system-diagnostics__window-controls { display: flex; align-items: stretch; }
.system-diagnostics__window-controls button {
  width: 39px;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .025);
  color: #d8e5ea;
  cursor: pointer;
  font-size: 16px;
}
.system-diagnostics__window-controls button:active { background: rgba(0, 173, 239, .18); }
.system-diagnostics__body { min-height: 0; display: flex; flex-direction: column; padding: 10px; }
.diagnostics-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.diagnostics-overview article { min-width: 0; padding: 8px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 4px; background: rgba(255, 255, 255, .025); }
.diagnostics-overview small, .diagnostics-overview strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diagnostics-overview small { color: #78909a; font-size: 7px; letter-spacing: .1em; text-transform: uppercase; }
.diagnostics-overview strong { margin-top: 4px; color: #e7f2f6; font-size: 9px; font-weight: 600; }
.diagnostics-overview strong[data-state="ok"] { color: #78d2aa; }
.diagnostics-overview strong[data-state="warn"] { color: #e0b56c; }
.diagnostics-overview strong[data-state="error"] { color: #ff8585; }
.diagnostics-session { display: flex; justify-content: space-between; gap: 8px; padding: 8px 1px 6px; color: #71858e; font-size: 7px; }
.diagnostics-actions { display: grid; grid-template-columns: 1fr 1.25fr .72fr .9fr; gap: 4px; }
.diagnostics-actions button,
.system-diagnostics footer button {
  min-height: 30px;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 3px;
  background: rgba(255, 255, 255, .045);
  color: #dce9ed;
  font-size: 7px;
  cursor: pointer;
}
#diagnostics-request-camera { border-color: rgba(0, 173, 239, .55); background: rgba(0, 126, 173, .2); }
#diagnostics-download { color: #031117; border-color: #00adef; background: #00adef; font-weight: 700; }
.diagnostics-actions button:disabled { opacity: .45; cursor: wait; }
.diagnostics-log {
  min-height: 90px;
  max-height: min(53dvh, 480px);
  margin: 9px 0 0;
  padding: 0 3px 0 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #3c5965 transparent;
  list-style: none;
}
.diagnostics-entry { margin: 0 0 5px; padding: 8px 9px; border: 1px solid rgba(255, 255, 255, .08); border-left: 3px solid #2e798f; border-radius: 4px; background: rgba(255, 255, 255, .025); }
.diagnostics-entry[data-level="ok"] { border-left-color: #78d2aa; }
.diagnostics-entry[data-level="warn"] { border-left-color: #e0b56c; }
.diagnostics-entry[data-level="error"] { border-left-color: #ff6f6f; background: rgba(124, 30, 30, .12); }
.diagnostics-entry__meta { display: flex; align-items: center; gap: 7px; color: #748b94; font-size: 7px; text-transform: uppercase; }
.diagnostics-entry__meta b { padding: 2px 5px; border-radius: 8px; background: rgba(0, 173, 239, .16); color: #8bdcff; }
.diagnostics-entry h3 { margin: 5px 0 3px; color: #edf6f9; font: 600 10px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; }
.diagnostics-entry p { margin: 0; color: #a9bbc2; font-size: 8px; line-height: 1.45; overflow-wrap: anywhere; }
.diagnostics-entry details { margin-top: 6px; color: #78909a; font-size: 7px; }
.diagnostics-entry summary { cursor: pointer; color: #75cbe9; }
.diagnostics-entry pre { max-height: 170px; margin: 5px 0 0; padding: 6px; overflow: auto; background: #020405; color: #9db0b7; white-space: pre-wrap; overflow-wrap: anywhere; }
.system-diagnostics footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; color: #71858e; font-size: 7px; }
.system-diagnostics footer button { min-height: 24px; border: 0; background: transparent; color: #8bbdce; }
.system-diagnostics.is-minimized { width: min(360px, calc(100vw - 20px)); max-height: 52px; }
.system-diagnostics.is-minimized .system-diagnostics__body,
.system-diagnostics.is-minimized .system-diagnostics__window-controls { display: none; }
.system-diagnostics.is-minimized .system-diagnostics__header { border-bottom: 0; }
.system-diagnostics.is-maximized {
  inset: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  width: auto;
  max-height: none;
  border-radius: 6px;
}
.system-diagnostics.is-maximized .system-diagnostics__body { flex: 1; }
.system-diagnostics.is-maximized .diagnostics-log { flex: 1; max-height: none; }

@media (max-height: 520px) and (orientation: landscape) {
  .system-diagnostics { top: max(5px, env(safe-area-inset-top)); right: max(5px, env(safe-area-inset-right)); width: min(485px, 61vw); max-height: calc(100dvh - 10px); }
  .system-diagnostics__header { min-height: 45px; }
  .system-diagnostics__identity { padding: 6px 9px; }
  .system-diagnostics__body { padding: 7px; }
  .diagnostics-overview article { padding: 6px; }
  .diagnostics-session { padding: 5px 1px; }
  .diagnostics-actions button { min-height: 27px; }
  .diagnostics-log { margin-top: 6px; max-height: calc(100dvh - 166px); }
  .diagnostics-entry { padding: 6px 7px; }
  .system-diagnostics.is-minimized { width: min(355px, 52vw); max-height: 45px; }
}

@media (orientation: portrait) and (max-width: 700px) {
  .system-diagnostics { top: auto; right: max(7px, env(safe-area-inset-right)); bottom: max(7px, env(safe-area-inset-bottom)); left: max(7px, env(safe-area-inset-left)); width: auto; max-height: min(68dvh, 620px); }
  .system-diagnostics.is-minimized { left: auto; width: min(360px, calc(100vw - 14px)); }
  .system-diagnostics.is-maximized { top: max(6px, env(safe-area-inset-top)); max-height: none; }
  .diagnostics-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diagnostics-actions { grid-template-columns: 1fr 1.2fr; }
}
