/* ==========================================================================
   Caribbean Pergola Visualiser
   Styling derived from: Feb 2026_CB_Brand Guidelines.pdf
   Palette : Black #000000 · Cerulean #007CB2 · Prussian Blue #153148
             Alice Blue #F2FAFE · Smoke White #F5F5F6
   Type    : Outfit (Bold for headlines, Regular for body)
   ========================================================================== */

:root {
  /* Caribbean brand colours */
  --cb-black:     #000000;
  --cb-cerulean:  #007CB2;  /* primary accent */
  --cb-prussian:  #153148;
  --cb-alice:     #F2FAFE;
  --cb-smoke:     #F5F5F6;

  /* Primary brand gradient — Cerulean to Prussian Blue, balance at 20% */
  --cb-gradient: linear-gradient(135deg, var(--cb-cerulean) 0%, var(--cb-cerulean) 20%, var(--cb-prussian) 100%);

  /* Derived UI tones */
  --line:        rgba(21, 49, 72, .14);
  --line-strong: rgba(21, 49, 72, .28);
  --ink:         var(--cb-prussian);
  --ink-soft:    rgba(21, 49, 72, .66);
  --ink-faint:   rgba(21, 49, 72, .44);
  --surface:     #ffffff;

  --radius:    10px;
  --radius-sm: 6px;
  --shadow:    0 1px 2px rgba(21,49,72,.06), 0 8px 28px rgba(21,49,72,.08);

  --panel-w: 400px;
  --header-h: 68px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--cb-smoke);
  color: var(--ink);
  font-family: Outfit, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;          /* the app fills the viewport; panels scroll internally */
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: -.01em; }

button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Shell ------------------------------------------------------- */

.app {
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
  height: 100vh;
  height: 100dvh;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: var(--cb-black);
  color: #fff;
  min-width: 0;
}

/* Official horizontal lockup, reversed out (assets/brand/). The guidelines'
   minimum is 40 mm (~151 px) wide; clear space is built into the artwork. */
.brand { display: flex; align-items: center; flex-shrink: 0; line-height: 0; border-radius: 4px; }
.brand:focus-visible { outline: 2px solid var(--cb-cerulean); outline-offset: 6px; }
.brand__logo { height: 36px; width: auto; display: block; }

.masthead__title {
  margin: 0 auto 0 0; padding-left: 18px; border-left: 1px solid rgba(255,255,255,.22);
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255,255,255,.7);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.masthead__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.main { display: grid; grid-template-columns: 1fr var(--panel-w); min-height: 0; }
.main > * { min-height: 0; }

/* ---------- Stage ------------------------------------------------------- */

.stage { position: relative; min-width: 0; background: var(--cb-alice); overflow: hidden; }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.stage__loading {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 12px;
  justify-items: center; background: var(--cb-alice); color: var(--ink-soft);
  font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  transition: opacity .4s ease; z-index: 5;
}
.stage__loading[hidden] { display: none; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--line-strong); border-top-color: var(--cb-cerulean);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.stage__overlay {
  position: absolute; left: 20px; bottom: 20px; right: 20px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; pointer-events: none;
}

.readout {
  pointer-events: auto;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 0;
  display: flex; gap: 22px;
  box-shadow: var(--shadow);
}
.readout div { min-width: 0; }
.readout dt { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.readout dd { margin: 2px 0 0; font-size: 15px; font-weight: 700; }

.viewbar { pointer-events: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.viewbar button {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px; letter-spacing: .06em;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background .15s, border-color .15s, color .15s;
}
.viewbar button:hover { border-color: var(--cb-cerulean); color: var(--cb-cerulean); }
.viewbar button[aria-pressed="true"] { background: var(--cb-cerulean); border-color: var(--cb-cerulean); color: #fff; }

/* ---------- Configurator panel ------------------------------------------ */

.panel {
  display: grid; grid-template-rows: auto auto 1fr auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  min-height: 0;
  min-width: 0;
}

.sheet-handle { display: none; }

.panel__head { padding: 20px 22px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.panel__head h1 { font-size: 22px; }
.panel__head p { margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); }

.panel__body { overflow-y: auto; padding: 4px 16px 20px; scrollbar-width: thin; min-width: 0; }

/* Step bar — pinned above the steps, shows where you are */
.steps {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.steps__item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: 0; border-radius: var(--radius-sm); padding: 6px 2px;
  cursor: pointer; color: var(--ink-soft); transition: background .15s, color .15s;
}
.steps__item:hover { background: var(--cb-alice); color: var(--ink); }
.steps__num {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); font-size: 12px; font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}
.steps__label { font-size: 11px; font-weight: 500; letter-spacing: .02em; }
.steps__item[aria-current="step"] { color: var(--cb-cerulean); }
.steps__item[aria-current="step"] .steps__num { background: var(--cb-cerulean); border-color: var(--cb-cerulean); color: #fff; }
.steps__item:focus-visible { outline: 2px solid var(--cb-cerulean); outline-offset: 1px; }

/* Steps — one open at a time; closed ones read as a tidy summary row */
.step {
  border: 1px solid var(--line); border-radius: var(--radius);
  margin-top: 10px; background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.step.is-open { border-color: rgba(0,124,178,.35); box-shadow: 0 6px 22px rgba(21,49,72,.08); }

.step__head {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  width: 100%; padding: 13px 14px; background: none; border: 0; border-radius: var(--radius);
  text-align: left; cursor: pointer; color: var(--ink);
}
.step__head:hover { background: var(--cb-alice); }
.step.is-open .step__head { border-radius: var(--radius) var(--radius) 0 0; }
.step.is-open .step__head:hover { background: none; }
.step__head:focus-visible { outline: 2px solid var(--cb-cerulean); outline-offset: -2px; }

.step__num {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--cb-alice); color: var(--cb-prussian); font-size: 13px; font-weight: 700;
  transition: background .2s, color .2s;
}
.step.is-open .step__num { background: var(--cb-cerulean); color: #fff; }

.step__text { display: flex; flex-direction: column; min-width: 0; }
.step__title { font-size: 15px; font-weight: 600; line-height: 1.25; }
.step__value {
  font-size: 13px; color: var(--ink-soft); line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.step.is-open .step__value { color: var(--cb-cerulean); }

.step__chevron { color: var(--ink-faint); transition: transform .22s cubic-bezier(.4,0,.2,1), color .15s; }
.step.is-open .step__chevron { transform: rotate(180deg); color: var(--cb-cerulean); }

.step__body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.step__body[hidden] { display: none; }
.step__body > .field:first-child,
.step__body > .swatches:first-child { margin-top: 14px; }

.btn--next {
  width: 100%; margin-top: 18px; padding: 11px 16px;
  background: var(--cb-alice); color: var(--cb-cerulean); border-color: rgba(0,124,178,.25);
}
.btn--next:hover { background: var(--cb-cerulean); color: #fff; border-color: var(--cb-cerulean); }

.field { margin-bottom: 16px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field__label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; min-width: 0; }
.field__label span:first-child { font-size: 14px; font-weight: 500; }
.field__value { font-size: 14px; font-weight: 700; color: var(--cb-cerulean); font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }
.field__hint { margin: 6px 0 0; font-size: 12px; color: var(--ink-faint); }

/* Segmented control */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button {
  background: #fff; border: 0; border-right: 1px solid var(--line);
  padding: 10px 8px; font-size: 13px; cursor: pointer; transition: background .15s, color .15s;
}
.segmented button:last-child { border-right: 0; }
.segmented button:hover { background: var(--cb-alice); }
.segmented button[aria-pressed="true"] { background: var(--cb-prussian); color: #fff; }

/* Range */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line-strong); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-strong); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; margin-top: -8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--cb-cerulean); border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(21,49,72,.35);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--cb-cerulean); border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(21,49,72,.35);
}
input[type="range"]:focus-visible { outline: 2px solid var(--cb-cerulean); outline-offset: 4px; border-radius: 4px; }

/* Colour swatches */
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.swatch { background: none; border: 0; padding: 0; cursor: pointer; text-align: center; }
.swatch__chip {
  display: block; width: 100%; aspect-ratio: 1; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); box-shadow: inset 0 -12px 18px rgba(0,0,0,.14);
  transition: box-shadow .15s, transform .15s;
}
.swatch[aria-pressed="true"] .swatch__chip {
  box-shadow: inset 0 -12px 18px rgba(0,0,0,.14), 0 0 0 2px #fff, 0 0 0 4px var(--cb-cerulean);
}
.swatch:hover .swatch__chip { transform: translateY(-1px); }
.swatch__name { display: block; margin-top: 6px; font-size: 11px; line-height: 1.25; color: var(--ink-soft); }
.swatch__ral { display: block; font-size: 10px; color: var(--ink-faint); }

/* Range end labels */
.range-ends { display: flex; justify-content: space-between; margin-top: 2px; font-size: 11px; color: var(--ink-faint); }

.field__label--section { margin: 20px 0 0; }
.field__label--section span { font-size: 11px !important; font-weight: 700 !important; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.field__hint--above { margin: -2px 0 10px; }

/* Switch rows */
.switch-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.switch-row:has(+ .btn--next) { border-bottom: 0; }
.switch-row__text strong { display: block; font-size: 14px; font-weight: 600; }
.switch-row__text small { display: block; font-size: 12px; color: var(--ink-faint); line-height: 1.35; margin-top: 1px; }

.switch {
  -webkit-appearance: none; appearance: none; margin: 0; flex: none;
  position: relative; width: 42px; height: 24px; border-radius: 12px;
  background: var(--line-strong); cursor: pointer; transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(21,49,72,.3); transition: transform .2s cubic-bezier(.4,0,.2,1);
}
.switch:checked { background: var(--cb-cerulean); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--cb-cerulean); outline-offset: 2px; }

.mini-toggle { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.mini-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--cb-cerulean); }
.mini-toggle[hidden] { display: none; }

/* Multi-select chips */
.chips { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.chip svg { display: none; }
.chip:hover { border-color: var(--cb-cerulean); color: var(--cb-cerulean); }
.chip[aria-pressed="true"] { background: var(--cb-prussian); border-color: var(--cb-prussian); color: #fff; }
.chip[aria-pressed="true"] svg { display: block; }
.chip:focus-visible { outline: 2px solid var(--cb-cerulean); outline-offset: 2px; }

.sub-options { margin: -4px 0 18px; padding: 14px; background: var(--cb-alice); border-radius: var(--radius-sm); }
.sub-options[hidden] { display: none; }
.sub-options .field { margin-bottom: 12px; }
.sub-options .field:last-child { margin-bottom: 0; }

.fabric-swatches { display: flex; gap: 8px; }
.fabric {
  width: 38px; height: 38px; padding: 3px; border-radius: 50%; border: 2px solid transparent;
  background: none; cursor: pointer; transition: border-color .15s;
}
.fabric span { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.fabric:hover { border-color: var(--line-strong); }
.fabric[aria-pressed="true"] { border-color: var(--cb-cerulean); }
.fabric:focus-visible { outline: 2px solid var(--cb-cerulean); outline-offset: 1px; }

/* Scene bar — time of day and furniture, on the 3D view */
.scenebar {
  position: absolute; top: 16px; right: 16px; z-index: 4;
  display: flex; align-items: center; gap: 8px;
}
.scenebar__times {
  display: flex; padding: 3px; gap: 2px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
}
.scenebar__times button {
  border: 0; background: none; border-radius: 999px; padding: 7px 13px;
  font-size: 12px; font-weight: 500; cursor: pointer; color: var(--ink-soft); white-space: nowrap;
  transition: background .15s, color .15s;
}
.scenebar__times button:hover { color: var(--ink); }
.scenebar__times button[aria-pressed="true"] { background: var(--cb-prussian); color: #fff; }
.scenebar__toggle {
  display: flex; align-items: center; gap: 7px; padding: 8px 13px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
  font-size: 12px; font-weight: 500; color: var(--ink-soft); cursor: pointer;
}
.scenebar__toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--cb-cerulean); }

/* ---------- Specification footer ---------------------------------------- */

.quote { border-top: 1px solid var(--line); background: var(--cb-smoke); padding: 14px 22px 18px; min-width: 0; }

.summary-head {
  display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 12px; padding: 2px 0;
  background: none; border: 0; cursor: pointer; color: var(--ink); text-align: left;
}
.summary-head__title { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.summary-head__count {
  margin-left: auto; font-size: 12px; font-weight: 600; color: var(--cb-cerulean);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.summary-head__chevron { color: var(--cb-cerulean); transition: transform .2s; }
.summary-head[aria-expanded="true"] .summary-head__chevron { transform: rotate(180deg); }
.summary-head:hover .summary-head__title { color: var(--ink); }
.summary-head:focus-visible { outline: 2px solid var(--cb-cerulean); outline-offset: 2px; border-radius: 4px; }

.summary-lines {
  list-style: none; margin: 0 0 14px; padding: 0;
  max-height: 180px; overflow-y: auto; scrollbar-width: thin;
}
.summary-lines[hidden] { display: none; }
.summary__line {
  position: relative; padding: 3px 0 3px 15px;
  font-size: 13px; line-height: 1.35; color: var(--ink-soft);
}
.summary__line::before {
  content: ""; position: absolute; left: 0; top: 10px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--cb-cerulean);
}

.quote__note { margin: 10px 0 0; font-size: 11px; line-height: 1.45; color: var(--ink-faint); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 13px 18px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: filter .15s, background .15s, color .15s;
}
.btn--primary { background: var(--cb-gradient); color: #fff; width: 100%; }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; padding: 9px 14px; font-size: 13px; white-space: nowrap; }
.btn--ghost:hover { background: rgba(255,255,255,.1); }
.btn--quiet { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.btn--quiet:hover { border-color: var(--cb-cerulean); color: var(--cb-cerulean); }

/* ---------- Enquiry dialog ---------------------------------------------- */

dialog {
  border: 0; border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 32px));
  box-shadow: 0 24px 70px rgba(0,0,0,.3); color: var(--ink);
}
dialog::backdrop { background: rgba(21,49,72,.55); backdrop-filter: blur(3px); }
.dialog__head { background: var(--cb-gradient); color: #fff; padding: 22px 26px; }
.dialog__head h2 { font-size: 22px; }
.dialog__head p { margin: 6px 0 0; font-size: 13px; color: rgba(255,255,255,.82); }
.dialog__body { padding: 22px 26px; max-height: min(58vh, 460px); overflow-y: auto; }
.dialog__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 26px 22px; border-top: 1px solid var(--line); }
.dialog__foot .btn--primary { width: auto; }

.summary { background: var(--cb-alice); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; font-size: 13px; }
.summary h3 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.summary ul { margin: 0; padding-left: 18px; color: var(--ink-soft); }
.summary li { padding: 1px 0; }

.summary__link { display: block; margin-top: 12px; }
.summary__link span { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 5px; }
.summary__link input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 8px 10px; background: #fff; font-size: 12px; color: var(--ink-soft);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: block; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid span { display: block; font-size: 12px; font-weight: 500; margin-bottom: 5px; }
.form-grid input, .form-grid textarea, .form-grid select {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; background: #fff;
}
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus {
  outline: 2px solid var(--cb-cerulean); outline-offset: -1px; border-color: transparent;
}
.form-grid textarea { resize: vertical; min-height: 78px; }
.consent { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: var(--ink-soft); }
.consent input { width: 17px; height: 17px; accent-color: var(--cb-cerulean); margin-top: 1px; flex: none; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--cb-prussian); color: #fff; padding: 12px 20px; border-radius: 40px;
  font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.28);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 50;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Responsive --------------------------------------------------- */

@media (max-width: 1040px) {
  :root { --panel-w: 340px; }
  .swatches { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  :root {
    --header-h: 56px;
  }
  .app {
    position: relative;
    overflow: hidden;
  }
  .main {
    display: block;
    position: relative;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    overflow: hidden;
  }
  .masthead__title { display: none; }
  .masthead { padding: 0 12px; gap: 8px; }
  .masthead__actions { gap: 6px; }
  .btn--ghost { padding: 7px 10px; font-size: 12px; }
  .brand__logo { height: 31px; }                 /* ~152 px wide: the 40 mm minimum */
  .btn--ghost span { display: none; }             /* icon-only actions on phones */
  .btn--ghost { padding: 8px 10px; }
  .scenebar { top: 10px; right: 10px; left: 10px; justify-content: center; flex-wrap: wrap; }
  .scenebar__times button { padding: 6px 10px; }
  .steps { padding: 8px 10px; }
  .form-grid { grid-template-columns: 1fr; }

  /* Stage fills the entire main viewport */
  .stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  /* Overlay sits cleanly above the peeking bottom sheet */
  .stage__overlay {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 84px;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
    transition: bottom .28s ease;
  }
  .readout { display: none; }
  .viewbar { pointer-events: auto; justify-content: center; }

  /* Bottom sheet panel */
  .sheet-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0 4px;
    cursor: pointer;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
  }
  .sheet-handle__bar {
    width: 42px;
    height: 5px;
    background: var(--line-strong);
    border-radius: 3px;
    transition: background .15s;
  }
  .sheet-handle:hover .sheet-handle__bar {
    background: var(--cb-cerulean);
  }

  .panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px rgba(21, 49, 72, 0.18);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    max-height: 82vh;
    max-height: 82dvh;
    transform: translateY(calc(100% - 68px));
    transition: transform .32s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
  }
  .panel.is-expanded {
    transform: translateY(0);
  }
  /* Only the title bar peeks out while the sheet is down. */
  .panel:not(.is-expanded) .steps { visibility: hidden; }

  .panel__head {
    padding: 4px 18px 10px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
  }
  .panel__head h1 { font-size: 16px; margin: 0; }
  .panel__head p { display: none; }
  .panel__head::after {
    content: "Configure ▴";
    font-size: 12px;
    font-weight: 600;
    color: var(--cb-cerulean);
  }
  .panel.is-expanded .panel__head::after {
    content: "Done ▾";
  }

  .panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 0 18px 14px;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }

  .quote {
    padding: 10px 18px 14px;
    border-top: 1px solid var(--line);
    background: var(--cb-smoke);
    flex-shrink: 0;
  }
  .summary-lines { max-height: 66px; margin-bottom: 8px; }
  .quote__note { display: none; }
  .btn--primary { padding: 11px 16px; font-size: 14px; }
}
