:root {
  --brand: #2f6b4f;
  --brand-ink: #ffffff;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, white);
  --ink: #18201e;
  --ink-2: #4a5552;
  --ink-3: #7c8784;
  --line: #e3e8e6;
  --bg: #f4f6f5;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 22, .06), 0 6px 20px rgba(16, 24, 22, .08);
  --panel-w: 420px;
  --top-h: 64px;
}
:root { color-scheme: light; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); background-color: #fff; }
input::placeholder, textarea::placeholder { color: #9aa4a1; }
dialog { color: var(--ink); background: #fff; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Top bar ---------- */
.topbar { height: var(--top-h); display: flex; align-items: center; gap: 24px; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; min-width: 0; }
.brand img { height: 36px; width: auto; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps { flex: 1; display: flex; justify-content: center; gap: 4px; }
.steps button { border: 0; background: none; padding: 8px 14px; border-radius: 999px; display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-weight: 600; font-size: 14px; }
.steps button .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--bg); color: var(--ink-3); border: 1px solid var(--line); }
.steps button.done .n { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.steps button.on { color: var(--ink); background: var(--bg); }
.steps button.on .n { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.steps button:disabled { cursor: default; opacity: .5; }
.phone { color: var(--brand); font-weight: 700; text-decoration: none; white-space: nowrap; }
body.embed .topbar { --top-h: 56px; }

/* ---------- Layout ---------- */
.layout { display: flex; height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); }
.viewport { flex: 1; position: relative; overflow: hidden; background: #dfe9ef; min-width: 0; }
.viewport canvas { display: block; touch-action: none; }
.viewport { -webkit-user-select: none; user-select: none; }
.viewport.dragging .itemcard, .viewport.dragging .hint { opacity: .25; pointer-events: none; transition: opacity .15s; }
.panel { width: var(--panel-w); background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel-body { flex: 1; overflow-y: auto; padding: 24px 22px 28px; }
.panel-foot { border-top: 1px solid var(--line); padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; }
.total small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.total strong { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.nav { display: flex; gap: 8px; }
.total { position: relative; }
.total strong { display: inline-block; transition: color .3s; }
.total strong.bump { animation: bump .45s ease-out; }
@keyframes bump { 30% { transform: scale(1.07); } }
.delta { position: absolute; left: 0; top: -22px; font-size: 13px; font-weight: 800; padding: 2px 8px; border-radius: 999px; opacity: 0; pointer-events: none; white-space: nowrap; }
.delta.up { background: #fff1e6; color: #b54708; } .delta.down { background: #e7f6ec; color: #067647; }
.delta.show { animation: deltaPop 1.8s ease-out forwards; }
@keyframes deltaPop { 0% { opacity: 0; transform: translateY(6px); } 12% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
.neg { color: #067647 !important; }
@media (prefers-reduced-motion: reduce) { .total strong.bump, .delta.show { animation: none; } .delta.show { opacity: 1; } }

h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
.sub { margin: 0 0 20px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin: 22px 0 10px; font-weight: 700; }
h3:first-of-type { margin-top: 0; }

/* ---------- Buttons ---------- */
.btn { border: 1px solid transparent; border-radius: 10px; padding: 11px 20px; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .06s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--bg); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Viewport overlays ---------- */
.vp-top-left, .vp-top-right { position: absolute; top: 16px; display: flex; gap: 8px; z-index: 2; }
.vp-top-left { left: 16px; } .vp-top-right { right: 16px; }
.seg { display: flex; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--ink); color: #fff; }
.chip { display: flex; align-items: center; gap: 7px; border: 0; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-radius: 999px; padding: 9px 14px; font-weight: 600; font-size: 13px; box-shadow: var(--shadow); }
.chip:hover { background: #fff; }
.views { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 2px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); padding: 4px; border-radius: 12px; box-shadow: var(--shadow); z-index: 2; }
.views button { border: 0; background: none; padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.views button.on, .views button:hover { background: var(--bg); color: var(--ink); }
.hint { position: absolute; top: 66px; left: 50%; transform: translateX(-50%); background: rgba(24,32,30,.82); color: #fff; font-size: 13px; padding: 8px 14px; border-radius: 999px; z-index: 2; white-space: nowrap; transition: opacity .4s; pointer-events: none; }
.hint.gone { opacity: 0; }
.loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: #e9eff1; color: var(--ink-2); font-weight: 600; z-index: 4; transition: opacity .4s; }
.loading.gone { opacity: 0; pointer-events: none; }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: sp 0.9s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- Selected item card ---------- */
.itemcard { position: absolute; left: 16px; bottom: 70px; width: 340px; max-width: calc(100% - 32px); background: #fff; border-radius: var(--radius); box-shadow: 0 10px 40px rgba(16,24,22,.22); z-index: 3; padding: 16px; animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.itemcard .ic-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.itemcard .ic-title { font-weight: 800; font-size: 16px; }
.itemcard .ic-meta { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.itemcard .x, .dlg .x { border: 0; background: var(--bg); width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--ink-2); flex: none; }
.ic-label { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; margin: 14px 0 8px; }
.swaps { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.swap { flex: none; width: 96px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; padding: 8px; text-align: left; font-size: 12px; line-height: 1.3; }
.swap .ico { height: 44px; display: grid; place-items: center; background: var(--bg); border-radius: 6px; margin-bottom: 6px; color: var(--ink-2); overflow: hidden; }
.swap .ico img { width: 100%; height: 100%; object-fit: cover; }
.swap .ico svg { width: 30px; height: 30px; stroke-width: 1.5; }
.swap b { display: block; font-weight: 600; }
.swap span { color: var(--brand); font-weight: 700; }
.swap.on { border-color: var(--brand); background: var(--brand-soft); }
.ic-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.walls { display: flex; gap: 4px; }
.walls button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.walls button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.walls button:disabled { opacity: .4; cursor: not-allowed; }
.mv { display: flex; gap: 4px; margin-left: auto; }
.mv button { width: 34px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 8px; display: grid; place-items: center; }
.ic-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.link-danger { border: 0; background: none; color: #b42318; font-weight: 600; font-size: 13px; padding: 4px 0; }

/* ---------- Location (dealer / ZIP pricing) ---------- */
.locbar { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; background: #fafbfa; }
.locbar.need { border-color: var(--brand); background: var(--brand-soft); }
.locbar label, .locbar > span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.locbar b { font-size: 15px; }
.locbar small { color: var(--ink-2); font-size: 12.5px; }
.locbar select, .locbar input { width: 100%; border: 1px solid #d5dcd9; border-radius: 10px; padding: 10px 12px; font-size: 15px; background: #fff; color: var(--ink); }
.ziprow { display: flex; gap: 8px; } .ziprow input { flex: 1; min-width: 0; }

/* ---------- Step: style ---------- */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; padding: 0; text-align: left; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: #c9d2cf; box-shadow: var(--shadow); }
.card.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.card .thumb { aspect-ratio: 16/10; background: linear-gradient(#dfeaf2, #eef2f0); display: grid; place-items: center; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb svg { width: 80%; height: 80%; stroke-width: 1.4; }
.card .ct { padding: 10px 12px 12px; }
.card .ct b { display: block; font-size: 15px; }
.card .ct small { color: var(--ink-3); font-size: 12.5px; }
.card .ct small strong { color: var(--brand); }
.desc { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 14px 0 0; padding: 12px 14px; background: var(--bg); border-radius: 10px; }

/* ---------- Step: size ---------- */
.sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.size { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 6px; background: #fff; text-align: center; }
.size b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.size small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.size span { display: block; color: var(--brand); font-weight: 700; font-size: 13px; margin-top: 6px; }
.size.on { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- Step: colors ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 52px; text-align: center; border: 0; background: none; padding: 0; font-size: 11px; color: var(--ink-2); line-height: 1.2; }
.sw i { display: block; width: 44px; height: 44px; margin: 0 auto 5px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); box-shadow: inset 0 -6px 10px rgba(0,0,0,.12); position: relative; }
.sw.on i { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--brand); }
.sw.on i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 18px; border: solid #fff; border-width: 0 3px 3px 0; transform: translate(-50%, -62%) rotate(45deg); filter: drop-shadow(0 0 1px rgba(0,0,0,.6)); }
.sw em { display: block; font-style: normal; color: var(--brand); font-weight: 700; }
.chosen { font-size: 13px; color: var(--ink-2); margin: -4px 0 10px; }
.chosen b { color: var(--ink); }

/* ---------- Roofing ---------- */
.roofs { display: grid; gap: 8px; margin-bottom: 6px; }
.roofopt { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; padding: 12px; text-align: left; }
.roofopt .ri { width: 54px; height: 40px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.roofopt .ri svg { width: 40px; height: 28px; stroke-width: 1.4; }
.roofopt .rt { flex: 1; min-width: 0; }
.roofopt .rt b { display: block; font-size: 14.5px; }
.roofopt .rt small { display: block; color: var(--ink-3); font-size: 12px; line-height: 1.35; }
.roofopt em { font-style: normal; font-weight: 700; color: var(--brand); font-size: 13px; white-space: nowrap; }
.roofopt.on { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- Step: options ---------- */
.acc { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.acc > button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: #fff; padding: 14px; font-weight: 700; font-size: 15px; text-align: left; }
.acc > button .cnt { margin-left: auto; font-size: 12px; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 2px 8px; }
.acc > button .chev { transition: transform .2s; color: var(--ink-3); }
.acc.open > button .chev { transform: rotate(180deg); }
.acc .acc-body { display: none; padding: 0 14px 12px; }
.acc.open .acc-body { display: block; }
.opt { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.opt .ico { width: 46px; height: 46px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; color: var(--ink-2); flex: none; overflow: hidden; }
.opt .ico img { width: 100%; height: 100%; object-fit: cover; }
.opt .ico svg { width: 26px; height: 26px; stroke-width: 1.5; }
.opt .meta { flex: 1; min-width: 0; }
.opt .meta b { display: block; font-size: 14px; font-weight: 600; }
.opt .meta small { display: block; color: var(--ink-3); font-size: 12px; line-height: 1.35; }
.opt .meta .p { color: var(--brand); font-weight: 700; font-size: 13px; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 16px; display: grid; place-items: center; }
.qty button.add { background: var(--brand); color: #fff; border-color: var(--brand); }
.qty span { min-width: 16px; text-align: center; font-weight: 700; }
.tog { width: 44px; height: 26px; border-radius: 999px; background: #d7dedb; border: 0; position: relative; transition: background .15s; flex: none; }
.tog::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .15s; }
.tog.on { background: var(--brand); } .tog.on::after { left: 21px; }
.onshed { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.onshed button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 11px; font-size: 12.5px; font-weight: 600; }
.onshed button.std { background: var(--bg); }
.onshed button:hover { border-color: var(--brand); }

/* ---------- Step: quote ---------- */
.lines { border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; margin-bottom: 20px; }
.line { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.line:last-child { border-bottom: 0; }
.line small { display: block; color: var(--ink-3); font-size: 12px; }
.line.tot { font-weight: 800; font-size: 16px; border-top: 1px solid var(--line); border-bottom: 0; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #d5dcd9; border-radius: 10px; padding: 11px 12px; font-size: 15px; background: #fff; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field textarea { min-height: 70px; resize: vertical; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: var(--ink-3); line-height: 1.45; margin-top: 4px; }
.consent input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.err { color: #b42318; font-size: 13px; margin-top: 10px; }
.done { text-align: center; padding: 10px 0; }
.done .ok { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin: 0 auto 14px; }
.done .ok svg { width: 32px; height: 32px; stroke-width: 2.5; }
.done .qn { display: inline-block; font-weight: 800; background: var(--bg); border-radius: 8px; padding: 6px 12px; margin: 8px 0 18px; }
.stack { display: grid; gap: 10px; }

/* ---------- Dialog ---------- */
.dlg { border: 0; border-radius: 18px; padding: 0; width: min(920px, 94vw); max-height: 92vh; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.dlg::backdrop { background: rgba(16,24,22,.5); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); gap: 10px; }
.dlg-actions { display: flex; gap: 8px; align-items: center; }
.plan { padding: 12px; overflow: auto; max-height: calc(92vh - 70px); background: #fff; }
.plan svg { width: 100%; height: auto; display: block; }

.dlg.notice { width: min(400px, 92vw); }
.notice-body { padding: 26px 24px 20px; text-align: center; }
.notice-ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; background: #fff4e5; color: #b54708; }
.notice-ico svg { width: 26px; height: 26px; }
.notice-body h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.01em; text-transform: none; color: var(--ink); }
.notice-body p { margin: 0 0 18px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; white-space: pre-line; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; z-index: 50; box-shadow: var(--shadow); }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  :root { --top-h: 54px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .steps { justify-content: flex-end; }
  .steps button { padding: 6px; } .steps button .lbl { display: none; }
  .phone { display: none; }
  .layout { flex-direction: column; height: auto; min-height: calc(100dvh - var(--top-h)); }
  .viewport { flex: none; height: 46vh; height: 46dvh; position: sticky; top: 0; z-index: 1; }
  .panel { width: 100%; border-left: 0; flex: 1; }
  .panel-body { padding: 18px 16px 24px; overflow: visible; }
  .panel-foot { position: sticky; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(0,0,0,.06); }
  .total strong { font-size: 21px; }
  .btn { padding: 10px 16px; }
  .chip span { display: none; } .chip { padding: 9px; }
  .views { bottom: 10px; } .views button { padding: 6px 8px; font-size: 12px; }
  .hint { top: 60px; font-size: 12px; }
  .itemcard { left: 8px; right: 8px; bottom: 54px; width: auto; padding: 12px; max-height: calc(100% - 116px); overflow-y: auto; overscroll-behavior: contain; }
  .itemcard .ic-head { position: sticky; top: -12px; background: #fff; padding-top: 2px; z-index: 1; }
  .itemcard .ic-label { margin: 10px 0 6px; }
  .swap { width: 82px; padding: 6px; font-size: 11.5px; }
  .swap .ico { height: 32px; margin-bottom: 4px; }
  .swap .ico svg { width: 24px; height: 24px; }
  .sizes { grid-template-columns: repeat(3, 1fr); }
}
@media print {
  body * { visibility: hidden; }
  #planBox, #planBox * { visibility: visible; }
  #planBox { position: fixed; inset: 0; }
}

/* ======================================================================
   Device tuning — phones, tablets, laptops, large desktops
   ====================================================================== */
/* Small laptops / tablets in landscape: slimmer panel, more room for the 3D view */
@media (min-width: 901px) and (max-width: 1180px) { :root { --panel-w: 370px; } .sizes { grid-template-columns: repeat(3, 1fr); } }
/* Big screens */
@media (min-width: 1600px) { :root { --panel-w: 470px; } .cards { grid-template-columns: repeat(2, 1fr); } }

/* Phones & tablets (stacked layout) */
@media (max-width: 900px) {
  .hint { white-space: normal; width: max-content; max-width: calc(100% - 24px); text-align: center; line-height: 1.35; border-radius: 14px; }
  .views { max-width: calc(100% - 16px); overflow-x: auto; }
}
/* Large phones in portrait & tablets in portrait: use the width */
@media (min-width: 600px) and (max-width: 900px) and (min-height: 501px) {
  .viewport { height: 52vh; height: 52dvh; }
  .cards { grid-template-columns: repeat(4, 1fr); }
  .sizes { grid-template-columns: repeat(4, 1fr); }
  .form { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 700px) and (max-width: 900px) { .steps button .lbl { display: inline; font-size: 13px; } .steps button { padding: 6px 10px; } }
/* Small phones */
@media (max-width: 420px) {
  .next-long { display: none; }
  .form { grid-template-columns: 1fr; }
  .total strong { font-size: 20px; }
  .panel-foot { gap: 8px; } .nav .btn { padding: 10px 14px; }
}
/* Phones turned sideways: 3D on the left, panel on the right */
@media (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
  :root { --top-h: 46px; }
  .topbar { height: var(--top-h); }
  .layout { flex-direction: row; height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); min-height: 0; }
  .viewport { position: relative; top: auto; height: auto; flex: 1; }
  .panel { width: 46%; max-width: 420px; flex: none; border-left: 1px solid var(--line); min-height: 0; }
  .panel-body { overflow-y: auto; padding: 12px 14px 16px; }
  .panel-foot { position: static; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); box-shadow: none; }
  .total strong { font-size: 18px; } .total small { font-size: 10px; }
  .next-long { display: none; }
  .hint { display: none; }
  .views { bottom: 6px; } .vp-top-left, .vp-top-right { top: 8px; }
  .itemcard { bottom: 46px; max-height: calc(100% - 100px); }
  .cards { grid-template-columns: repeat(2, 1fr); } .card .thumb { aspect-ratio: 2 / 1; }
  h2 { font-size: 19px; } .sub { margin-bottom: 12px; }
}
/* Touch screens: bigger targets, no double-tap zoom on controls */
@media (pointer: coarse) {
  button, .btn, a { touch-action: manipulation; }
  .walls button { padding: 9px 12px; min-height: 40px; }
  .mv button { width: 44px; height: 40px; }
  .qty button { width: 38px; height: 38px; }
  .views button { min-height: 36px; }
  .itemcard .x, .dlg .x { width: 40px; height: 40px; }
  .seg button { padding: 9px 14px; }
}
/* iPhones zoom into any field under 16px — keep form text at 16px on phones & tablets */
@media (max-width: 1180px), (pointer: coarse) {
  .field input, .field textarea, .field select, .locbar select, .locbar input { font-size: 16px; }
}
.nav .btn { white-space: nowrap; }
@media (max-width: 1280px) { .next-long { display: none; } }
.opt .meta small.incl { color: var(--brand); font-weight: 600; margin-top: 2px; }
/* Dealer-facing configurator badge */
.dealer-badge { display: flex; align-items: center; gap: 6px; background: #1d2624; color: #fff; border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.dealer-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; }
.dealer-badge.cv { background: #fff4e5; color: #7a3d06; } .dealer-badge.cv .dot { background: #f5a524; }
.dealer-badge .dl-who { opacity: .7; font-weight: 500; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.dealer-badge button { border: 0; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.16); color: inherit; }
.dealer-badge.cv button { background: #fff; border: 1px solid #f0d3a8; }
@media (max-width: 900px) { .dealer-badge .dl-who { display: none; } .dealer-badge { padding: 4px 4px 4px 10px; font-size: 11.5px; } }
@media (max-width: 480px) { .dealer-badge .dl-txt { display: none; } }

/* Point of sale: sales rep designing for a contract */
.pos-bar { height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 20px; background: #12352d; color: #fff; position: relative; z-index: 4; }
.pos-bar .pos-txt { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; overflow: hidden; white-space: nowrap; }
.pos-bar .pos-txt b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.pos-bar .pos-txt span { font-size: 12.5px; opacity: .75; overflow: hidden; text-overflow: ellipsis; }
.pos-bar button { border: 0; border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.pos-bar .pos-save { background: #3ddc84; color: #0b2a20; }
.pos-bar .pos-cancel { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); }
body.has-pos-bar .layout { height: calc(100vh - var(--top-h) - 48px); height: calc(100dvh - var(--top-h) - 48px); }
@media (max-width: 900px) {
  .pos-bar { padding: 0 12px; gap: 8px; }
  .pos-bar .pos-txt span { display: none; }
  body.has-pos-bar .layout { height: auto; min-height: calc(100dvh - var(--top-h) - 48px); }
}
@media (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
  .pos-bar { height: 40px; }
  body.has-pos-bar .layout { height: calc(100vh - var(--top-h) - 40px); height: calc(100dvh - var(--top-h) - 40px); min-height: 0; }
}
.ic-row.hgt { align-items: center; gap: 12px; } .ic-row.hgt .mv { margin-left: 0; }
.link-sm { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 700; font-size: 12px; text-decoration: underline; cursor: pointer; }
.mv button:disabled { opacity: .35; cursor: not-allowed; }
/* phones: give the item card room while it's open */
@media (max-width: 900px) and (min-height: 501px) {
  body.card-open .viewport { height: 70vh; height: 70dvh; transition: height .2s; }
  body.card-open .itemcard { max-height: calc(100% - 104px); }
}
