:root {
  --ink: #173e5a;
  --muted: #6d8291;
  --line: #d7e2e9;
  --paper: #f2f7fa;
  --panel: #fff;
  --green: #0871ad;
  --lime: #75c9f2;
  --orange: #f0a332;
  --red: #d95b4e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(145deg, #f8fbfd, #e9f2f7);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 1500px; margin: auto; min-height: 100vh; padding: 28px; }
.topbar { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; }
.brand-block { display: flex; align-items: center; gap: 22px; }
.brand-logo { width: 220px; height: auto; border-radius: 4px; mix-blend-mode: multiply; }
.header-actions { display: flex; align-items: end; gap: 9px; }
.job-name { display: grid; gap: 5px; }
.job-name input { width: 210px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.print-button { height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: var(--green); color: white; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.print-button:hover { background: #095c4c; }
.bottom-print { width: 100%; height: 44px; margin-top: 14px; }
.project-tools { display: flex; align-items: center; gap: 7px; margin: -8px 0 16px; }
.project-tools select { min-width: 220px; }
.project-tools button { height: 32px; padding: 0 11px; border: 0; border-radius: 7px; background: var(--green); color: white; font-size: 9px; font-weight: 900; letter-spacing: .05em; }
.project-tools button.secondary { background: #e5ebe7; color: var(--ink); }
.project-tools button.danger { background: transparent; border: 1px solid #e5c1bc; color: #b24d42; }
#saveStatus { color: var(--green); font-size: 10px; font-weight: 750; }
.print-header, .print-summary { display: none; }
.print-logo { width: 170px; height: auto; margin-bottom: 6px; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 900; letter-spacing: .22em; margin-bottom: 5px; }
h1 { font-size: clamp(28px, 3vw, 46px); letter-spacing: -.045em; margin: 0; line-height: 1; }
.unit-switch { display: flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: white; }
.unit { border: 0; background: transparent; color: var(--muted); border-radius: 7px; padding: 8px 13px; font-size: 11px; font-weight: 800; }
.unit.active { color: white; background: var(--ink); }
.workspace { display: grid; grid-template-columns: 390px 1fr; min-height: 720px; background: white; border: 1px solid #cbdbe5; border-radius: 18px; overflow: hidden; box-shadow: 0 18px 60px #123f5c18; }
.controls { padding: 8px 28px 22px; overflow: auto; max-height: calc(100vh - 130px); }
.panel-section { padding: 22px 0; border-bottom: 1px solid var(--line); }
.section-heading, .section-heading > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-heading h2 { font-size: 16px; margin: 0; letter-spacing: -.02em; }
.step { display: inline-grid; place-items: center; width: 27px; height: 27px; background: #edf1ee; border-radius: 50%; font-size: 10px; font-weight: 900; color: var(--muted); }
.step.accent { background: #d8f1fc; color: var(--green); }
select { border: 1px solid var(--line); background: #fafbfa; color: var(--ink); border-radius: 8px; padding: 7px 28px 7px 10px; font-size: 12px; font-weight: 700; }
.field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 17px; }
.field-grid.two { grid-template-columns: repeat(2, 1fr); }
label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
label > span { display: flex; align-items: center; margin-top: 7px; height: 43px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; overflow: hidden; }
input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; padding: 10px; color: var(--ink); font-weight: 750; }
input:focus { background: #f3fff0; }
.suffix { padding-right: 9px; color: #91a099; font-size: 10px; text-transform: lowercase; }
.field-note { margin: 8px 1px 0; color: #8b9691; font-size: 9px; line-height: 1.35; }
.material-section { border-bottom: 0; }
.collapse-button { border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; background: white; color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: .05em; }
.visibility-toggle { margin-top: 15px; }
.visibility-toggle { display: flex; align-items: center; gap: 7px; cursor: pointer; color: #607069; font-size: 9px; white-space: nowrap; }
.visibility-toggle input { width: 14px; height: 14px; margin: 0; accent-color: var(--green); }
.visibility-toggle span { display: none; }
.wall-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.wall-options label { display: flex; align-items: center; gap: 5px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfb; color: #607069; cursor: pointer; text-transform: none; letter-spacing: 0; }
.wall-options input { width: 14px; height: 14px; margin: 0; padding: 0; accent-color: var(--green); }
.quick-items { display: flex; gap: 6px; margin-top: 10px; }
.quick-items button { flex: 1; padding: 7px 4px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #607069; font-size: 10px; font-weight: 800; }
.quick-items button:hover { border-color: var(--green); color: var(--green); }
.result-card { display: flex; gap: 13px; padding: 16px; margin-top: 12px; border: 1px solid #abd4e9; background: #eef8fd; border-radius: 12px; transition: .2s; }
.result-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: white; font-weight: 900; }
.result-card small { display: block; color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: .13em; }
.result-card strong { display: block; margin: 2px 0 3px; font-size: 15px; }
.result-card p { margin: 0; color: #547168; font-size: 11px; line-height: 1.45; }
.result-card.caution { border-color: #f0c477; background: #fff8e9; }
.result-card.caution .result-icon { background: var(--orange); }
.result-card.caution small { color: #aa6911; }
.result-card.no { border-color: #edb5ae; background: #fff3f1; }
.result-card.no .result-icon { background: var(--red); }
.result-card.no small { color: #ad443a; }
.result-card.item-hidden { opacity: .45; }
.disclaimer { color: #8b9691; font-size: 9px; line-height: 1.45; margin: 12px 3px 0; }
.viewer-panel { position: relative; min-width: 0; overflow: hidden; background: #e9f2f7; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#scene:active { cursor: grabbing; }
.viewer-top { position: absolute; top: 22px; left: 24px; padding: 7px 10px; border-radius: 6px; background: #ffffffc7; backdrop-filter: blur(10px); color: #52635c; font-size: 9px; font-weight: 900; letter-spacing: .13em; }
.live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 5px; box-shadow: 0 0 0 4px #0d756018; }
.view-actions { position: absolute; top: 22px; right: 22px; display: flex; gap: 5px; }
.view-actions button { border: 0; border-radius: 7px; padding: 9px 11px; background: #183029e8; color: white; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 8px 12px; border-radius: 6px; background: #17211ed9; color: #dce8e2; font-size: 8px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.legend { position: absolute; left: 23px; bottom: 21px; display: flex; gap: 15px; color: #52635c; font-size: 9px; font-weight: 750; }
.legend i { display: inline-block; width: 11px; height: 11px; vertical-align: -2px; margin-right: 4px; border-radius: 2px; }
.car-swatch { background: #e0e8e3; border: 1px solid #879a92; }
.item-swatch { background: var(--lime); border: 1px solid #6f9228; }
.dimensions-overlay { position: absolute; right: 22px; bottom: 54px; padding: 10px 12px; border-left: 2px solid var(--green); background: #ffffffb8; color: #4d6058; font-size: 10px; line-height: 1.55; backdrop-filter: blur(8px); }
.mobile-scroll-nav { display: none; }
@media (max-width: 850px) {
  .app-shell { padding: 15px; }
  .workspace { grid-template-columns: 1fr; }
  .controls { max-height: none; }
  .viewer-panel { min-height: 580px; }
  .topbar { align-items: start; }
  .header-actions { align-items: stretch; flex-wrap: wrap; justify-content: end; }
  .job-name input { width: 170px; }
  .project-tools { flex-wrap: wrap; margin-top: 0; }
}
@media (max-width: 480px) {
  .app-shell { padding: 8px; }
  .topbar { display: block; margin-bottom: 12px; }
  .eyebrow { font-size: 9px; }
  h1 { font-size: 30px; margin-bottom: 16px; }
  .brand-block { display: block; }
  .brand-logo { width: min(250px, 76vw); margin-bottom: 12px; }
  .header-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  .job-name { grid-column: 1 / -1; }
  .job-name input { width: 100%; height: 46px; font-size: 16px; }
  .print-button { height: 44px; }
  .unit-switch { justify-self: end; }
  .unit { min-width: 44px; min-height: 38px; }
  .project-tools { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 0 0 10px; }
  .project-tools select { grid-column: 1 / -1; width: 100%; min-width: 0; height: 44px; font-size: 14px; }
  .project-tools button { height: 42px; }
  #saveStatus { align-self: center; }
  .workspace { border-radius: 12px; }
  .field-grid, .field-grid.two { grid-template-columns: 1fr 1fr; gap: 10px; }
  .controls { padding: 4px 15px 18px; }
  .panel-section { padding: 18px 0; }
  label > span { height: 48px; }
  input { font-size: 16px; }
  select { min-height: 40px; }
  .quick-items button { min-height: 40px; }
  .result-card { padding: 13px; }
  .viewer-panel { min-height: 68svh; }
  #scene { touch-action: pan-y; }
  .viewer-top { top: 12px; left: 12px; }
  .view-actions { top: 10px; right: 10px; }
  .view-actions button { min-width: 38px; min-height: 38px; padding: 7px 9px; }
  .hint { bottom: 11px; font-size: 7px; }
  .dimensions-overlay { right: 10px; bottom: 44px; font-size: 9px; }
  .legend { display: none; }
  .mobile-scroll-nav { position: fixed; z-index: 20; top: 50%; right: 5px; display: grid; place-items: center; gap: 4px; transform: translateY(-50%); padding: 5px 4px; border: 1px solid #cfd8d3; border-radius: 18px; background: #ffffffdc; box-shadow: 0 5px 18px #13251e25; backdrop-filter: blur(8px); }
  .mobile-scroll-nav button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: white; font-size: 17px; font-weight: 900; }
  .mobile-scroll-nav span { width: 3px; height: 25px; border-radius: 3px; background: #a9b8b1; }
}
@media print {
  @page { size: letter landscape; margin: .35in; }
  html, body { width: 10.3in; height: 7.8in; margin: 0; overflow: hidden; }
  body { background: white; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .app-shell { max-width: none; min-height: 0; padding: 0; }
  .topbar, .project-tools, .controls, .viewer-top, .view-actions, .hint { display: none !important; }
  .mobile-scroll-nav { display: none !important; }
  .print-header { position: relative; display: flex; align-items: end; justify-content: space-between; min-height: .48in; padding: 0 2.35in 4px 0; border-bottom: 2px solid var(--ink); }
  .print-header small { color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: .16em; }
  .print-logo { position: absolute; right: 0; top: 50%; display: block; width: 1.45in; transform: translateY(-50%); }
  .print-header h2 { margin: 0; font-size: 19px; line-height: 1.05; }
  .print-header p { margin: 1px 0 0; color: var(--muted); font-size: 10px; }
  #printDate { position: absolute; right: 1.58in; bottom: 5px; color: var(--muted); font-size: 9px; white-space: nowrap; }
  .print-summary { display: flex; gap: 24px; padding: 5px 0; color: #4d6058; font-size: 9px; }
  .print-summary b { color: var(--ink); }
  .workspace { display: block; min-height: 0; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
  .viewer-panel { width: 100%; height: 6.75in; border: 1px solid var(--line); break-inside: avoid; }
  #scene { width: 100% !important; height: 100% !important; object-fit: contain; }
  .dimensions-overlay { background: #ffffffe8; }
}
