/* Deck Designer — scoped styles (uses tokens from /css/styles.css). */
.dd-body { background: var(--bg-soft); color: var(--ink); }

.dd-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.dd-header-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; }
.dd-back { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; }
.dd-back:hover { color: var(--navy); }

.dd-main { padding: 28px 0 60px; }
.dd-intro { max-width: 720px; margin: 0 0 22px; }
.dd-intro h1 { font-family: 'Montserrat', sans-serif; font-size: clamp(1.7rem, 4vw, 2.5rem); color: var(--navy-deep); margin: 6px 0 8px; }
.dd-intro p { color: var(--muted); font-size: 1.02rem; line-height: 1.6; }

/* layout: visual (sticky) + controls */
.dd-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 26px; align-items: start; }
@media (max-width: 900px) { .dd-layout { grid-template-columns: 1fr; } }

.dd-stage { position: sticky; top: 84px; }
@media (max-width: 900px) { .dd-stage { position: static; } }
.dd-canvas { background: #eef3ee; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.dd-canvas svg { display: block; width: 100%; height: auto; }
.dd-stagebar { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.dd-dims { font-family: 'IBM Plex Mono', 'Montserrat', monospace; font-weight: 700; color: var(--navy); font-size: 1.05rem; }
.dd-reset { background: none; border: 0; color: var(--muted); font-weight: 600; cursor: pointer; font-size: .9rem; }
.dd-reset:hover { color: var(--navy); }

/* control groups */
.dd-controls { display: flex; flex-direction: column; gap: 18px; }
.dd-group > label { display: block; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); margin-bottom: 9px; }

/* segmented buttons */
.dd-seg { display: flex; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.dd-seg.dd-seg-wrap { flex-wrap: wrap; }
.dd-seg button { flex: 1 1 auto; min-width: 72px; border: 0; background: none; padding: 9px 10px; border-radius: 7px; font-family: 'Inter', sans-serif; font-weight: 600; font-size: .86rem; color: var(--muted); cursor: pointer; white-space: nowrap; transition: .15s; }
.dd-seg button:hover { background: var(--bg-soft); color: var(--ink); }
.dd-seg button.on { background: var(--navy); color: #fff; }

/* sliders */
.dd-slider { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.dd-slider span { width: 52px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.dd-slider input[type=range] { flex: 1; accent-color: var(--navy); }
.dd-slider output { width: 52px; text-align: right; font-weight: 700; color: var(--ink); font-size: .9rem; }

/* color swatches */
.dd-swatches { display: flex; gap: 8px 10px; flex-wrap: wrap; margin-bottom: 12px; }
/* each color is its own column cell so long names wrap under the swatch instead of overlapping neighbours */
.dd-swatchcell { width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 2px 0 0; background: none; border: 0; cursor: pointer; font-family: inherit; }
.dd-swatchbox { width: 40px; height: 40px; border-radius: 9px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.dd-swatchcell.on .dd-swatchbox { box-shadow: 0 0 0 3px var(--navy); }
.dd-swatchlbl { font-size: .64rem; line-height: 1.15; color: var(--muted); text-align: center; }
.dd-swatchcell.on .dd-swatchlbl { color: var(--navy); font-weight: 700; }

/* checkboxes */
.dd-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 480px) { .dd-checks { grid-template-columns: 1fr; } }
.dd-chk { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: .86rem; cursor: pointer; }
.dd-chk input { accent-color: var(--navy); width: 16px; height: 16px; }
.dd-chk:has(input:checked) { border-color: var(--navy); background: #f0f5fb; }

/* summary + CTA */
.dd-summary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.dd-summary h3 { font-family: 'Montserrat', sans-serif; font-size: .95rem; color: var(--navy-deep); margin: 0 0 8px; }
.dd-summary ul { list-style: none; margin: 0; padding: 0; }
.dd-summary li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.dd-summary li:last-child { border-bottom: 0; }
.dd-summary li .k { color: var(--muted); }
.dd-summary li .v { color: var(--ink); font-weight: 600; text-align: right; }
.dd-book { width: 100%; justify-content: center; }
.dd-fineprint { font-size: .78rem; color: var(--muted); line-height: 1.5; text-align: center; margin: 4px 2px 0; }

/* selects + 3D button */
.dd-selrow { display: flex; gap: 8px; }
.dd-select { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-family: 'Inter', sans-serif; font-size: .88rem; color: var(--ink); }
.dd-stagebtns { display: flex; gap: 10px; align-items: center; }
.dd-3dbtn { padding: 8px 14px; font-size: .85rem; }
[hidden] { display: none !important; }

/* 3D modal */
.dd-modal { position: fixed; inset: 0; background: rgba(10, 20, 32, .72); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.dd-modal.open { display: flex; }
.dd-modal-inner { background: #fff; border-radius: 14px; width: min(960px, 96vw); overflow: hidden; box-shadow: var(--shadow-lg); }
.dd-modal-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dd-modal-head strong { font-family: 'Montserrat', sans-serif; color: var(--navy-deep); }
.dd-modal-hint { color: var(--muted); font-size: .8rem; }
.dd-modal-close { margin-left: auto; background: none; border: 0; font-size: 1.2rem; color: var(--muted); cursor: pointer; line-height: 1; }
.dd-modal-close:hover { color: var(--navy); }
.dd-3dcanvas { width: 100%; height: min(60vh, 520px); background: #dfeaf2; }
.dd-3dcanvas canvas { display: block; }
.dd-3dstatus { padding: 8px 16px; color: var(--muted); font-size: .85rem; min-height: 0; }
.dd-3dstatus:empty { padding: 0; }

.dd-footer { background: var(--navy-deep); color: #cdd8e4; padding: 22px 0; font-size: .85rem; }
.dd-footer p { margin: 4px 0; }
.dd-footer a { color: #fff; text-decoration: none; }
.dd-footer a:hover { text-decoration: underline; }

/* multi-platform manager */
.dd-platcard { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.dd-platcard-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dd-platcard-head b { font-size: .85rem; color: var(--navy-deep); }
.dd-platrm { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .95rem; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.dd-platrm:hover { color: #c0392b; background: #fdecea; }
.dd-seg-sm { margin: 6px 0; }
.dd-seg-sm button { min-width: 0; padding: 6px 7px; font-size: .78rem; }
/* readable "add" buttons on the light control panel (global .btn-ghost is white-on-transparent) */
#ddAddPlat, .dd-addbtn { background: #eef3f9; color: var(--navy); border: 1.5px solid var(--navy); border-radius: 9px; font-weight: 700; font-family: 'Montserrat', sans-serif; font-size: .85rem; padding: 9px 12px; cursor: pointer; }
#ddAddPlat:hover:not(:disabled), .dd-addbtn:hover:not(:disabled) { background: var(--navy); color: #fff; }
#ddAddPlat:disabled { background: #eef1f4; color: #9aa3ad; border-color: #d3d9df; cursor: default; }
.dd-stairrow { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; margin-bottom: 8px; background: #fff; }
.dd-stairrow-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.dd-stairrow-head .dd-select { flex: 1; }
.dd-stairrow .dd-slider { margin: 4px 0; }

/* customer build notes */
.dd-notes { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-family: 'Inter', sans-serif; font-size: .9rem; color: var(--ink); resize: vertical; min-height: 68px; }
.dd-notes:focus { outline: none; border-color: var(--navy); }

/* save & come-back-later panel */
.dd-savebox { position: relative; background: #f0f5fb; border: 1px solid #d7e3f1; border-radius: var(--radius); padding: 14px 16px; }
.dd-savemsg { font-size: .82rem; line-height: 1.4; color: var(--navy); margin: 8px 0 0; min-height: 1em; }
.dd-savemsg:empty { margin: 0; min-height: 0; }

/* same-device resume banner */
.dd-resume-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #fff7e6; border: 1px solid #f0d9a6; border-radius: 10px; padding: 10px 12px; margin-bottom: 4px; font-size: .86rem; color: #7a5c15; font-weight: 600; }
.dd-resume-actions { display: flex; align-items: center; gap: 8px; }
.dd-resume-actions .dd-addbtn { padding: 6px 12px; font-size: .8rem; }

/* first-visit guided tour (coach-marks) */
.dd-tour { position: fixed; inset: 0; z-index: 200; }
.dd-tour-backdrop { position: fixed; inset: 0; }
.dd-tour-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(12, 22, 34, .62); outline: 2px solid rgba(255, 255, 255, .9); transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease; pointer-events: none; }
.dd-tour-tip { position: fixed; z-index: 201; width: 300px; max-width: calc(100vw - 24px); background: #fff; border-radius: 12px; box-shadow: 0 14px 44px rgba(10, 20, 32, .38); padding: 15px 17px; font-family: 'Inter', sans-serif; }
.dd-tour-count { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.dd-tour-title { font-family: 'Montserrat', sans-serif; font-size: 1.02rem; color: var(--navy-deep); margin: 4px 0 6px; }
.dd-tour-body { font-size: .9rem; line-height: 1.5; color: var(--ink); margin: 0 0 14px; }
.dd-tour-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dd-tour-skip { background: none; border: 0; color: var(--muted); font-weight: 600; font-size: .84rem; cursor: pointer; }
.dd-tour-skip:hover { color: var(--navy); }
.dd-tour-btns { display: flex; gap: 8px; }
.dd-tour-back { background: #eef3f9; color: var(--navy); border: 1.5px solid var(--navy); border-radius: 8px; font-weight: 700; font-size: .84rem; padding: 6px 13px; cursor: pointer; }
.dd-tour-next { background: var(--navy); color: #fff; border: 0; border-radius: 8px; font-weight: 700; font-size: .84rem; padding: 7px 16px; cursor: pointer; }
.dd-tour-next:hover { background: var(--navy-deep); }
/* "take a tour" launcher in the intro */
.dd-tourbtn { margin-top: 12px; background: #eef3f9; color: var(--navy); border: 1.5px solid var(--navy); border-radius: 9px; font-weight: 700; font-family: 'Montserrat', sans-serif; font-size: .85rem; padding: 8px 15px; cursor: pointer; }
.dd-tourbtn:hover { background: var(--navy); color: #fff; }
