:root {
  color-scheme: light;
  --purple: #312882;
  --purple-dark: #21185f;
  --purple-soft: #eeecfa;
  --green: #95c121;
  --green-dark: #5f8700;
  --ink: #1e2430;
  --muted: #5f6978;
  --line: #e3e6ec;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;
  --background: #f7f8fa;
  --green-soft: #f4f8e9;
  --shadow-card: 0 8px 28px rgba(34, 31, 61, .065);
  --shadow-soft: 0 4px 16px rgba(34, 31, 61, .055);
  --radius-card: 18px;
  --radius-inner: 14px;
  --warning: #fff6da;
  --danger: #a92834;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--background);
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px clamp(18px, 4vw, 48px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 13px; }
.brand img { width: 52px; height: 52px; object-fit: contain; }
.brand h1 { margin: 2px 0 0; font-size: clamp(1.35rem, 3vw, 2rem); color: var(--purple); }
.eyebrow { margin: 0; color: var(--green-dark); font-size: .77rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.status-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.status-pills span {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--purple);
  background: var(--purple-soft);
  font-size: .78rem;
  font-weight: 800;
}

.shell {
  display: grid;
  grid-template-columns: minmax(286px, 330px) minmax(0, 1fr);
  gap: 28px;
  width: min(1200px, calc(100% - 36px));
  margin: 24px auto 30px;
}

.assistant-panel, .work-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.assistant-panel { align-self: start; position: sticky; top: 18px; overflow: hidden; }
.avatar-stage {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 11px;
  background: radial-gradient(circle at 50% 20%, #ffffff 0 12%, #f5f4fb 54%, #eceaf6 100%);
}

.avatar { position: relative; width: 150px; height: 170px; }
.assistant-orb {
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  border: 2px solid rgba(49, 40, 130, .14);
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 24px rgba(49, 40, 130, .11);
}
.assistant-orb img { width: 78px; height: 78px; object-fit: contain; }
.assistant-wave {
  position: absolute;
  bottom: 22px;
  width: 7px;
  border-radius: 999px;
  background: var(--green);
  transform-origin: bottom;
}
.wave-one { left: 61px; height: 15px; }
.wave-two { left: 76px; height: 24px; }
.wave-three { left: 91px; height: 18px; }
.avatar-face {
  position: absolute;
  z-index: 2;
  left: 31px;
  top: 25px;
  width: 88px;
  height: 108px;
  border-radius: 48% 48% 44% 44%;
  background: #f1c7a9;
  box-shadow: inset 0 -7px rgba(170, 105, 82, .11);
}
.avatar-hair {
  position: absolute;
  z-index: 3;
  left: 23px;
  top: 12px;
  width: 104px;
  height: 60px;
  border-radius: 58px 58px 22px 32px;
  background: #49342d;
  transform: rotate(-4deg);
}
.avatar-body {
  position: absolute;
  left: 9px;
  bottom: 0;
  width: 132px;
  height: 64px;
  border-radius: 58px 58px 8px 8px;
  background: var(--purple);
}
.eye { position: absolute; top: 48px; width: 8px; height: 8px; border-radius: 50%; background: #2a2626; }
.eye.left { left: 24px; }
.eye.right { right: 24px; }
.mouth {
  position: absolute;
  left: 36px;
  bottom: 23px;
  width: 18px;
  height: 7px;
  border-radius: 0 0 14px 14px;
  border-bottom: 3px solid #934f56;
}
.avatar-stage.speaking .mouth { animation: talk .22s ease-in-out infinite alternate; }
.avatar-stage.speaking .avatar { animation: friendly-nod .9s ease-in-out infinite alternate; }
.avatar-stage.speaking .assistant-wave { animation: assistant-wave .42s ease-in-out infinite alternate; }
.avatar-stage.speaking .wave-two { animation-delay: .12s; }
.avatar-stage.speaking .wave-three { animation-delay: .24s; }
@keyframes talk { to { height: 15px; width: 13px; left: 38px; background: #9a5860; } }
@keyframes friendly-nod { to { transform: translateY(2px) rotate(.5deg); } }
@keyframes assistant-wave { to { transform: scaleY(.4); } }

.speaking-indicator { color: var(--purple); font-weight: 800; font-size: .86rem; }
.conversation { display: grid; gap: 8px; max-height: 240px; overflow: auto; padding: 16px; }
.message { padding: 10px 12px; border-radius: 12px; font-size: .88rem; line-height: 1.5; }
.message.assistant { background: var(--purple-soft); color: var(--purple-dark); border-bottom-left-radius: 4px; }
.message.system { background: #eef7d8; color: #3d5a00; border-bottom-right-radius: 4px; }
.assistant-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 16px; }

.session-facts { margin: 0; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.session-facts div { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; }
.session-facts dt { color: var(--muted); }
.session-facts dd { margin: 0; font-weight: 800; }

.work-panel { padding: clamp(22px, 3vw, 32px); min-width: 0; }
.safety-banner { display: grid; gap: 4px; padding: 13px 15px; border-left: 4px solid var(--green); border-radius: var(--radius-inner); background: var(--green-soft); }
.safety-banner span { color: #52602f; font-size: .9rem; }

.progress { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; margin: 22px 0 30px; padding: 13px 0 15px; border-bottom: 1px solid var(--line); list-style: none; }
.progress li { display: grid; grid-template-columns: 29px minmax(0, 1fr); align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: .74rem; font-weight: 800; line-height: 1.2; }
.progress-number { display: grid; place-items: center; width: 29px; height: 29px; aspect-ratio: 1; border-radius: 50%; background: #e8ebef; }
.progress-label { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.progress li.active { color: var(--purple); }
.progress li.active .progress-number { color: #fff; background: var(--purple); }
.progress li.done .progress-number { color: #fff; background: var(--green-dark); }

.step { display: none; }
.step.active { display: block; }
.step h2 { margin: 5px 0 8px; color: var(--purple); font-size: clamp(1.45rem, 3vw, 1.95rem); line-height: 1.2; }
.step h2:focus { outline: 2px solid rgba(49, 40, 130, .2); outline-offset: 5px; border-radius: 6px; }
.lead { max-width: 720px; margin: 0 0 22px; color: var(--muted); line-height: 1.55; }

.intro-player {
  overflow: hidden;
  scroll-margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.real-video-wrap { position: relative; background: #15122b; aspect-ratio: 16 / 9; }
.real-video-wrap video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #15122b;
}
.intro-text-fallback { border-top: 1px solid var(--line); }
.intro-text-fallback > summary {
  padding: 15px 20px;
  color: var(--purple);
  background: #f8f8fc;
  font-weight: 850;
  cursor: pointer;
}
.intro-text-fallback[open] > summary { border-bottom: 1px solid var(--line); }
.text-intro-actions { padding: 0 22px 20px; }
.intro-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  background:
    radial-gradient(circle at 72% 22%, rgba(149, 193, 33, .58), transparent 23%),
    linear-gradient(135deg, #312882 0%, #4a3ba6 58%, #20175e 100%);
}
.video-badge {
  position: absolute;
  left: 18px;
  top: 18px;
  padding: 7px 10px;
  color: #fff;
  background: rgba(0, 0, 0, .32);
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 900;
}
.video-illustration {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  color: var(--purple);
  background: #fff;
  border: 9px solid var(--green);
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
  font-size: 3rem;
  font-weight: 950;
  transition: transform .35s ease;
}
.intro-player.text-playing .video-illustration { transform: scale(1.06); animation: video-pulse 1.25s ease-in-out infinite alternate; }
@keyframes video-pulse { to { box-shadow: 0 18px 42px rgba(0, 0, 0, .32); } }
.intro-caption { min-height: 150px; padding: 20px 22px 16px; }
.intro-caption h3 { margin: 5px 0 7px; color: var(--purple); font-size: 1.25rem; }
.intro-caption p:last-child { margin-bottom: 0; color: var(--muted); line-height: 1.55; }
.video-progress { height: 8px; background: #e7e9ee; }
.video-progress span { display: block; width: 25%; height: 100%; background: var(--green); transition: width .35s ease; }
.concept-note, .memory-note { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.intro-actions { justify-content: flex-start; }
.contact-intake, .start-route-section, .callback-panel {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}
.contact-intake { border-left: 4px solid var(--green); }
.contact-intake h3, .start-route-section h3, .callback-panel h3 { margin: 4px 0 5px; color: var(--purple); }
.contact-intake p, .start-route-section > p, .callback-panel p { margin: 0; color: var(--muted); line-height: 1.5; }
.contact-intake .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; margin-top: 4px; }
.contact-intake .field { margin-bottom: 4px; }
.compact-choice-group { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 4px 0; }
.compact-choice-group legend { grid-column: 1 / -1; }
.start-route-section { background: #f7f6fc; }
.start-route-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.start-route-grid .readiness-card { height: 100%; }
.entry-choice-screen {
  grid-column: 1 / -1;
  gap: 24px;
  margin-top: 0;
  padding: clamp(24px, 4vw, 42px);
  background: linear-gradient(145deg, #fff 0%, #f8f7fd 58%, #f2f8e5 100%);
  box-shadow: var(--shadow-card);
}
.entry-choice-heading { display: grid; gap: 8px; max-width: 780px; }
.entry-choice-heading h2 { margin: 0; color: var(--purple); font-size: clamp(1.75rem, 3vw, 2.45rem); line-height: 1.15; }
.entry-choice-heading > p:last-child { margin: 0; color: var(--muted); font-size: 1.02rem; line-height: 1.6; }
.entry-choice-screen .readiness-card { position: relative; gap: 12px; padding: 22px; border-color: #dfe2e9; box-shadow: var(--shadow-soft); }
.entry-choice-screen .readiness-card p:not(.eyebrow) { min-height: 7.5em; }
.entry-choice-screen .recommended-choice { border: 2px solid var(--green); background: var(--green-soft); }
.choice-recommendation { position: absolute; top: -13px; right: 16px; padding: 5px 10px; border-radius: 999px; color: #fff; background: var(--purple); font-size: .72rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.entry-choice-note { padding: 14px 16px; border-left: 5px solid var(--green); border-radius: 12px; background: #fff; }
.later-choice-button { justify-self: start; }
.callback-panel { border-left: 4px solid var(--purple); background: var(--green-soft); }
.callback-panel .button { justify-self: start; }
.experience-badge { display: inline-flex; width: fit-content; margin: 0 0 18px; padding: 8px 11px; border-radius: 999px; color: #fff; background: var(--purple); font-size: .8rem; font-weight: 900; }
.readiness-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.readiness-card { display: grid; align-content: start; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-inner); background: #fff; box-shadow: 0 2px 8px rgba(34, 31, 61, .035); }
.readiness-card h3, .later-panel h3, .device-card h3, .handoff-panel h3 { margin: 0; color: var(--purple); }
.readiness-card p:not(.eyebrow), .later-panel p, .device-card p, .handoff-panel p { margin: 0; color: var(--muted); line-height: 1.5; }
.readiness-card .button { align-self: end; justify-self: start; margin-top: 4px; }
.later-panel, .handoff-panel { display: grid; gap: 16px; margin-top: 18px; padding: 18px; border: 1px solid #c9dd91; border-left: 5px solid var(--green); border-radius: 15px; background: #f2f8e4; }
.later-panel[hidden], .handoff-panel[hidden] { display: none; }
.future-contact-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.future-contact-fields span { display: grid; gap: 4px; padding: 12px; border-radius: 11px; background: #fff; }
.future-contact-fields small { color: var(--muted); line-height: 1.35; }
.resume-panel { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.resume-code, .device-badge { display: inline-flex; width: fit-content; padding: 7px 10px; border-radius: 999px; color: #fff; background: var(--purple); font-size: .78rem; font-weight: 900; letter-spacing: .04em; }
.device-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; margin: 18px 0; padding: 18px; border-radius: 15px; background: var(--purple-soft); }
.device-copy { display: grid; gap: 7px; }
.device-actions { display: grid; gap: 9px; min-width: 190px; }
.device-mode-button.selected { color: #fff; background: var(--purple); border-color: var(--purple); box-shadow: 0 0 0 4px rgba(91, 48, 124, .14); }
.handoff-panel { grid-template-columns: 112px minmax(0, 1fr); align-items: center; }
.phone-claim-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; margin: 0 0 18px; padding: 18px; border: 2px solid var(--green); border-left: 7px solid var(--purple); border-radius: 15px; background: #f2f8e4; }
.phone-claim-panel[hidden] { display: none; }
.phone-claim-panel h2 { margin: 3px 0 6px; color: var(--purple); }
.phone-claim-panel p { margin: 0; line-height: 1.45; }
.phone-claim-panel .handoff-status { grid-column: 1 / -1; }
.phone-return-panel { margin-top: 18px; padding: 20px; border: 2px solid var(--green); border-left: 7px solid var(--purple); border-radius: 16px; background: #f2f8e4; }
.phone-return-panel[hidden] { display: none; }
.phone-return-panel h3 { margin: 4px 0 8px; color: var(--purple); }
.phone-return-panel p:last-child { margin: 0; color: var(--ink); line-height: 1.55; }
.handoff-symbol { display: grid; place-items: center; min-height: 112px; border-radius: 16px; color: #fff; background: var(--purple); font-size: 1.1rem; font-weight: 950; line-height: 1.2; text-align: center; }
.handoff-symbol span { color: var(--green); font-size: 1.5rem; }
.handoff-ready { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #c9dd91; }
.handoff-ready[hidden] { display: none; }
.handoff-status { flex-basis: 100%; margin: 0; color: var(--purple-dark) !important; font-weight: 800; }
.handoff-status.connected { color: var(--green-dark) !important; }
.handoff-status.failed { color: var(--danger) !important; }
.handoff-qr-panel { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 20px; align-items: center; margin-top: 14px; padding: 18px; border: 1px solid #c9dd91; border-radius: 14px; background: #fff; }
.handoff-qr-panel[hidden] { display: none; }
.handoff-qr-panel strong { display: block; margin-bottom: 7px; color: var(--purple); font-size: 1.05rem; }
.handoff-qr-code { display: grid; place-items: center; width: min(100%, 260px); aspect-ratio: 1; padding: 10px; border: 2px solid var(--purple); border-radius: 12px; background: #fff; }
.handoff-qr-code img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.handoff-steps { margin: 10px 0 12px; padding-left: 22px; color: var(--ink); line-height: 1.55; }
.qr-placeholder { display: grid; place-items: center; width: 112px; height: 112px; border: 10px solid #fff; outline: 2px solid var(--purple); color: #fff; background: repeating-conic-gradient(from 45deg, var(--purple) 0 25%, #fff 0 50%) 50% / 22px 22px; }
.qr-placeholder span { display: grid; place-items: center; width: 46px; height: 46px; color: var(--purple); background: #fff; border: 3px solid var(--purple); font-weight: 950; }
.photo-device-reminder { margin: 0 0 18px; padding: 14px 16px; border-left: 5px solid var(--purple); border-radius: 12px; background: var(--purple-soft); }
.photo-device-reminder strong { color: var(--purple); }
.photo-device-reminder p { margin: 5px 0 0; color: var(--muted); line-height: 1.45; }
.marker-scan-stage { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; align-items: center; margin: 18px 0; padding: 20px; border: 2px solid #c9dd91; border-left: 7px solid var(--green); border-radius: 16px; background: #f2f8e4; }
.marker-scan-stage[hidden], #photoFlowStage[hidden] { display: none; }
.large-qr { width: 138px; height: 138px; }
.guided-task { display: grid; gap: 4px; margin: 0 0 16px; padding: 16px 18px; color: #fff; background: var(--purple); border-radius: 14px; }
.guided-task span { color: var(--green); font-size: .76rem; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.guided-task strong { font-size: 1.2rem; }
.guided-task p { margin: 0; color: #fff; line-height: 1.45; }
.auto-destination { display: grid; gap: 3px; margin: 0 0 16px; padding: 14px 16px; border: 2px solid #c9dd91; border-radius: 13px; background: #f2f8e4; }
.auto-destination span { color: var(--green-dark); font-size: .76rem; font-weight: 950; letter-spacing: .06em; text-transform: uppercase; }
.auto-destination strong { color: var(--purple); font-size: 1.06rem; }
.auto-destination small { color: var(--muted); line-height: 1.4; }
.compact-destination { max-width: 720px; }
.instruction-card, .route-turn-help, .contact-card {
  margin: 16px 0 20px;
  padding: 16px;
  border: 1px solid #c9dd91;
  border-left: 5px solid var(--green);
  border-radius: 13px;
  background: #f2f8e4;
}
.instruction-card strong, .route-turn-help strong, .contact-card strong { color: var(--purple); }
.instruction-card ol { margin: 10px 0 0; padding-left: 22px; line-height: 1.6; }
.route-turn-help p, .contact-card p { margin: 6px 0 0; line-height: 1.5; }

.field { display: grid; align-content: start; gap: 7px; margin-bottom: 16px; }
.field > span { font-weight: 800; }
.field small { color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cdd4dd;
  border-radius: 11px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field textarea { resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(149, 193, 33, .25); border-color: var(--green-dark); }
.room-system-grid { display: grid; gap: 16px; margin-top: 18px; }
.system-explainer, .system-plan, .room-question-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.system-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.system-comparison article { padding: 14px; border-radius: 12px; background: var(--purple-soft); }
.system-comparison strong { color: var(--purple); }
.system-comparison p { margin: 6px 0 0; color: var(--muted); line-height: 1.48; }
.system-choice-group { margin-top: 20px; }
.recommended-choice { border-left: 5px solid var(--green); }
.system-plan { margin: 16px 0; color: var(--ink); background: #f2f8e4; line-height: 1.5; }
.system-plan strong { color: var(--purple); }
.compact-plan { padding: 13px 15px; }
.room-question-list { display: grid; gap: 14px; margin-bottom: 18px; }
.room-question-card h3 { margin: 0 0 12px; color: var(--purple); }
.room-details-first { padding: 16px; border-left: 5px solid var(--green); border-radius: 14px; background: #f2f8e4; }
.room-details-first > strong { color: var(--purple); }
.room-details-first > p { margin: 6px 0 15px; line-height: 1.5; }
.room-details-first .room-question-list { margin-bottom: 0; }
.check-row { display: flex; align-items: flex-start; gap: 11px; margin: 14px 0; line-height: 1.45; }
.check-row input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--purple); }

.danger-stop { margin: 18px 0; padding: 16px; border-left: 5px solid var(--danger); border-radius: 12px; background: #fff0f1; }
.danger-stop strong { color: var(--danger); }
.danger-stop p { margin: 6px 0 0; line-height: 1.55; }
.marker-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(230px, .65fr); gap: 24px; align-items: start; margin: 22px 0; }
.marker-print-stack { display: grid; gap: 18px; }
.placement-marker {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(150px, .75fr);
  grid-template-rows: auto 1fr auto;
  width: 100%;
  aspect-ratio: 297 / 210;
  overflow: hidden;
  color: #000;
  background: #fff;
  border: 1px solid #777;
  border-radius: 8px;
  box-shadow: 0 12px 25px rgba(34, 31, 61, .12);
}
.marker-measure-frame { position: absolute; z-index: 3; inset: 18px; border: 6px solid #000; pointer-events: none; }
.marker-top { grid-column: 1 / -1; display: flex; z-index: 1; align-items: center; justify-content: center; gap: 18px; min-height: 42px; margin: 30px 42px 0; color: #fff; background: #000; font-weight: 950; letter-spacing: .11em; }
.marker-top::before, .marker-top::after { content: "\2191"; color: #fff; font-size: 1.55rem; line-height: 1; }
.marker-corner { position: absolute; z-index: 4; width: 38px; height: 38px; border: 6px solid #000; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px #fff; transform: translate(-50%, -50%); }
.marker-corner::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #000; }
.marker-corner-top-left { top: 0; left: 0; }
.marker-corner-top-right { top: 0; left: 100%; }
.marker-corner-bottom-left { top: 100%; left: 0; }
.marker-corner-bottom-right { top: 100%; left: 100%; }
.marker-center { z-index: 1; }
.marker-cross-target { position: absolute; z-index: 2; top: 50%; left: 50%; display: grid; place-items: center; gap: 3px; width: 112px; text-align: center; transform: translate(-50%, -50%); }
.marker-cross-target strong { margin-top: 1px; font-size: .68rem; letter-spacing: .07em; }
.marker-cross-target small { color: #4d4a57; font-size: .56rem; font-weight: 800; }
.marker-cross { position: relative; width: clamp(34px, 6vw, 48px); height: clamp(34px, 6vw, 48px); }
.marker-cross::before, .marker-cross::after { content: ""; position: absolute; left: 50%; top: 50%; background: #000; transform: translate(-50%, -50%); }
.marker-cross::before { width: 100%; height: 6px; }
.marker-cross::after { width: 6px; height: 100%; }
.marker-qr-side { display: grid; z-index: 1; min-width: 0; place-items: center; align-content: center; gap: 4px; margin: 0 36px 0 0; padding: 10px 14px 20px; border-left: 2px dashed #000; text-align: center; }
.marker-qr-grid { position: relative; display: grid; grid-template-columns: repeat(21, 1fr); width: min(100%, 128px); aspect-ratio: 1; padding: 7px; background: #fff; border: 4px solid #000; }
.marker-qr-grid i { background: #fff; }
.marker-qr-grid i.on { background: #171425; }
.marker-qr-logo { position: absolute; z-index: 2; left: 50%; top: 50%; width: 22%; height: 22%; padding: 3px; object-fit: contain; background: #fff; border: 3px solid #fff; transform: translate(-50%, -50%); }
.marker-qr-side strong { font-size: .72rem; }
.marker-qr-side small { color: var(--danger); font-size: .62rem; font-weight: 900; }
.marker-footer { grid-column: 1 / -1; display: flex; z-index: 1; justify-content: space-between; gap: 12px; margin: 0 42px 30px; padding: 9px 14px; color: #fff; background: #000; font-size: .76rem; font-weight: 900; }
.marker-safety-list { display: grid; gap: 12px; margin: 18px 0; }
.marker-safety-card { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.marker-safety-card > strong { color: var(--purple); }
.marker-safety-actions { display: grid; gap: 8px; margin-top: 11px; }
.marker-safety-actions label { display: flex; align-items: flex-start; gap: 9px; line-height: 1.4; }
.marker-safety-actions input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--purple); }
.a4-instructions h3 { margin: 0 0 8px; color: var(--purple); }
.a4-instructions ol { margin: 0 0 18px; padding-left: 22px; line-height: 1.55; }
.choice-group { display: grid; gap: 10px; margin: 18px 0; padding: 0; border: 0; }
.choice-group legend { margin-bottom: 10px; color: var(--purple); font-weight: 900; }
.choice-card { display: flex; align-items: flex-start; gap: 12px; min-height: 100%; padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius-inner); background: #fff; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.choice-card:has(input:checked) { border-color: var(--green-dark); box-shadow: 0 0 0 3px rgba(149, 193, 33, .18); }
.choice-card input { width: 21px; height: 21px; flex: 0 0 auto; accent-color: var(--purple); }
.choice-card span { display: grid; gap: 4px; }
.choice-card small { color: var(--muted); line-height: 1.4; }
.a4-checks, .overview-route { margin: 16px 0; padding: 15px; border-radius: 12px; background: #f2f8e4; }
.overview-route strong { color: var(--green-dark); }
.overview-route p { margin-bottom: 0; line-height: 1.5; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 16px; border: 1px solid transparent; border-radius: 11px; font-weight: 850; line-height: 1.25; text-align: center; transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.button.primary { color: #fff; background: var(--purple); }
.button.primary:hover { background: var(--purple-dark); }
.button.secondary { color: #243500; background: var(--green); }
.button.quiet { color: var(--purple); background: var(--purple-soft); }
.button.danger { color: #fff; background: var(--danger); }
.button:focus-visible { outline: 3px solid rgba(49, 40, 130, .2); outline-offset: 3px; }
.button:not(:disabled):active { transform: translateY(1px); }
.guide-target { position: relative; z-index: 2; outline: 4px solid var(--green) !important; outline-offset: 5px; animation: guide-pulse .75s ease-in-out 2 alternate; }
@keyframes guide-pulse { from { box-shadow: 0 0 0 0 rgba(149, 193, 33, .48); } to { box-shadow: 0 0 0 12px rgba(149, 193, 33, 0); } }
.validation { min-height: 22px; margin: 8px 0; color: var(--danger); font-weight: 750; }

.camera-grid { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 16px; }
.capture-plan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.capture-target { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 10px; min-height: 72px; padding: 12px; text-align: left; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.capture-target > span { grid-row: 1 / 3; display: grid; place-items: center; width: 36px; height: 36px; color: #fff; background: var(--muted); border-radius: 50%; font-weight: 900; }
.capture-target small { color: var(--muted); }
.capture-target.active { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(49, 40, 130, .12); }
.capture-target.active > span { background: var(--purple); }
.camera-card, .canvas-wrap { position: relative; overflow: hidden; border-radius: 15px; background: #141620; }
.camera-card { aspect-ratio: 16 / 10; }
.camera-card video { display: block; width: 100%; height: 100%; object-fit: cover; }
#photoCanvas, #routeCanvas { display: block; width: 100%; height: auto; object-fit: contain; }
.camera-empty { position: absolute; inset: 0; display: grid; place-content: center; gap: 5px; text-align: center; color: #fff; }
.camera-empty span { color: #bec3ce; font-size: .86rem; }
.camera-controls { display: grid; align-content: start; gap: 10px; }
.file-fallback { display: grid; gap: 7px; color: var(--muted); font-size: .82rem; }
.file-fallback input { width: 100%; font-size: .78rem; }
.photo-editor { margin-top: 20px; }
.photo-editor p { color: var(--purple); font-weight: 800; }
.analysis-status { margin: 10px 0; padding: 12px 14px; color: #243500; background: #f2f8e4; border-left: 5px solid var(--green); border-radius: 11px; font-weight: 800; line-height: 1.45; }
.photo-processing-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(26, 23, 52, .72);
  backdrop-filter: blur(3px);
}
.photo-processing-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(360px, 100%);
  padding: 26px 22px;
  border: 2px solid rgba(149, 193, 33, .72);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(17, 14, 44, .34);
  text-align: center;
}
.photo-processing-card strong { color: var(--purple); font-size: 1.12rem; }
.photo-processing-card span:last-child { color: var(--muted); line-height: 1.5; }
.photo-processing-spinner {
  width: 46px;
  height: 46px;
  border: 5px solid #dedaf3;
  border-top-color: var(--green-dark);
  border-radius: 50%;
  animation: photo-processing-spin .8s linear infinite;
}
@keyframes photo-processing-spin { to { transform: rotate(360deg); } }
.canvas-wrap { cursor: crosshair; }
.unit-canvas-wrap { cursor: grab; }
.unit-canvas-wrap:active { cursor: grabbing; }
.unit-canvas-wrap canvas, .route-canvas-wrap canvas { touch-action: none; user-select: none; }
.route-drawing-status { margin: 12px 0 8px; color: var(--purple); font-weight: 800; line-height: 1.45; }
.route-drawing-done { width: 100%; margin-bottom: 16px; }
.unit-tools {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}
.unit-tools > span { display: grid; gap: 2px; text-align: center; }
.unit-tools small { color: var(--muted); }
.square-button { min-width: 48px; min-height: 48px; padding: 0; font-size: 1.55rem; }
.route-deferred-row { padding: 14px; border-radius: 12px; background: var(--warning); }
.route-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.route-tab {
  min-height: 44px;
  padding: 9px 13px;
  color: var(--purple);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 850;
}
.route-tab.active { color: #fff; background: var(--purple); border-color: var(--purple); }
.route-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.compact-choice-group { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.voice-route-panel { display: grid; gap: 12px; margin: 14px 0; padding: 15px; border-radius: 13px; background: var(--purple-soft); }
.voice-route-panel p { margin: 0; color: var(--ink); font-weight: 500; }
.voice-route-panel .route-tools { margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; margin-top: 22px; padding-top: 4px; }
.next-button { margin-top: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }

.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.result-card { padding: 18px; border-radius: 15px; border: 1px solid var(--line); }
.result-card.success { background: #f1f8df; border-color: #c9dd91; }
.result-card.blocked { background: var(--warning); border-color: #ead692; }
.result-card.estimate { background: var(--purple-soft); border-color: #cbc6e8; }
.result-card.estimate strong { color: var(--purple); }
.result-card strong { display: block; margin: 5px 0 6px; font-size: 1.25rem; }
.result-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.result-label { color: var(--purple); font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.summary-card, .boundary-card, .contact-card { margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; }
.summary-card h3 { margin-top: 0; color: var(--purple); }
.summary-card dl { margin: 0; }
.summary-card dl div { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr; gap: 16px; padding: 9px 0; border-bottom: 1px solid #edf0f3; }
.summary-card dl div:last-child { border-bottom: 0; }
.summary-card dt { color: var(--muted); }
.summary-card dd { margin: 0; font-weight: 750; }
.boundary-card { border-left: 5px solid var(--purple); background: var(--purple-soft); }
.boundary-card p { margin-bottom: 0; }
.contact-card { border-left: 5px solid var(--green); background: #f2f8e4; }

footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 18px; padding: 8px 20px 28px; color: var(--muted); font-size: .82rem; }
footer strong { color: var(--purple); }

@media (max-width: 860px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .status-pills { justify-content: flex-start; }
  .shell { grid-template-columns: 1fr; }
  .assistant-panel { position: static; }
  .avatar-stage { min-height: 210px; }
  .avatar { transform: scale(.82); margin: -8px 0; }
  .camera-grid { grid-template-columns: 1fr; }
  .camera-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .marker-layout { grid-template-columns: 1fr; }
  .progress { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .device-card { grid-template-columns: 1fr; }
  .device-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phone-claim-panel { grid-template-columns: 1fr; }
  .entry-choice-screen .start-route-grid { grid-template-columns: 1fr; }
  .entry-choice-screen .readiness-card p:not(.eyebrow) { min-height: 0; }
}

@media (max-width: 720px) {
  .contact-intake .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 18px, 1200px); margin: 10px auto 20px; gap: 12px; }
  .assistant-panel, .work-panel { border-radius: 15px; }
  .progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .marker-layout, .capture-plan, .readiness-grid, .future-contact-fields, .handoff-panel, .start-route-grid, .compact-choice-group { grid-template-columns: 1fr; }
  .handoff-qr-panel { grid-template-columns: 1fr; }
  .handoff-qr-code { justify-self: center; }
  .marker-scan-stage { grid-template-columns: 1fr; }
  .marker-scan-stage .large-qr { justify-self: center; }
  .compact-choice-group legend { grid-column: auto; }
  .placement-marker { grid-template-columns: 1.15fr .85fr; }
  .marker-top { min-height: 35px; font-size: .72rem; }
  .marker-footer { flex-direction: column; gap: 2px; font-size: .65rem; }
  .form-grid, .result-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .camera-controls { grid-template-columns: 1fr; }
  .summary-card dl div { grid-template-columns: 1fr; gap: 3px; }
  .row-actions .button { width: 100%; }
  .intro-visual { min-height: 210px; }
  .unit-tools { max-width: none; }
  .system-comparison { grid-template-columns: 1fr; }
  .device-actions { grid-template-columns: 1fr; }
  .qr-placeholder { width: 92px; height: 92px; }
  .compact-choice-group { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .guide-target { animation: none; }
  .photo-processing-spinner { animation: none; border-top-color: var(--purple); }
  html:focus-within { scroll-behavior: auto; }
}

@page { size: A4 landscape; margin: 8mm; }

@media print {
  body { min-width: 0; margin: 0; background: #fff; }
  body > .topbar, body > footer, .assistant-panel, .safety-banner, .progress,
  .work-panel > :not(.step[data-step="3"]),
  .step[data-step="3"] > :not(#printerMarkerFlow),
  #printerMarkerFlow > :not(.marker-layout),
  .marker-layout > :not(.marker-print-stack) { display: none !important; }
  .shell, .work-panel, .step[data-step="3"], #printerMarkerFlow, .marker-layout, #markerPrintStack { display: block !important; }
  .shell { width: auto; margin: 0; }
  .work-panel { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .marker-layout { margin: 0; }
  #markerPrintStack { width: 281mm; }
  .placement-marker { width: 281mm; height: 194mm; aspect-ratio: auto; border: 0; border-radius: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .placement-marker:last-child { break-after: auto; page-break-after: auto; }
  .marker-measure-frame { inset: 9mm; border-width: 2.2mm; }
  .marker-top { min-height: 15mm; margin: 14mm 22mm 0; font-size: 18pt; }
  .marker-corner { width: 18mm; height: 18mm; border-width: 2.3mm; box-shadow: 0 0 0 1.2mm #fff; }
  .marker-corner::after { inset: 4.8mm; }
  .marker-cross-target { width: 42mm; gap: 1mm; }
  .marker-cross-target strong { font-size: 12pt; }
  .marker-cross-target small { font-size: 8.5pt; }
  .marker-cross { width: 26mm; height: 26mm; }
  .marker-cross::before { height: 2mm; }
  .marker-cross::after { width: 2mm; }
  .marker-qr-side strong { font-size: 11pt; }
  .marker-qr-side { margin-right: 18mm; padding: 4mm 4mm 9mm; }
  .marker-qr-grid { width: 55mm; padding: 3mm; border-width: 1.5mm; }
  .marker-qr-logo { padding: 1mm; border-width: 1mm; }
  .marker-footer { margin: 0 22mm 14mm; padding: 3mm 7mm; font-size: 11pt; }
}
body.after-external-film [data-step="1"] > .eyebrow,
body.after-external-film [data-step="1"] > h2,
body.after-external-film [data-step="1"] > .lead,
body.after-external-film #introPlayer,
body.after-external-film .intro-actions,
body.after-external-film [data-step="1"] > .concept-note {
  display: none;
}

body.after-external-film #contactIntake {
  margin-top: 0;
  scroll-margin-top: 24px;
}
