/* Design tokens + fabric catalog UI live in cushion-fabric-ui.css (shared with /fabric/). */
/* Styles are scoped to .cushion-designer-app so the embed never restyles the
   host theme's body, buttons, or images. */
.cushion-designer-app *{box-sizing:border-box}
.cushion-designer-app{
  margin:0;
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  color:var(--ink);
  background:
    radial-gradient(90% 60% at 85% -5%,#fbf6ea 0%,rgba(251,246,234,0) 55%),
    linear-gradient(180deg,#f6f0e4 0%,#f1e9d9 100%);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
.cushion-designer-app button:not(.dim-picker-btn):not(.btn):not(.card):not(.fill-row):not(.fabric-dir-toast):not(.fab-toast-x):not(.cd-reset):not(.cd-share):not(.seg-tab):not(.joint-row):not(.wcc-pick__btn):not(.wcc-btn):not(.wcc-pick__item):not(.wcc-drawer__close){font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}
/* dim-picker-btn keeps its own chrome (chevron column) */}
.cushion-designer-app img{max-width:100%}

/* Full-bleed: break out of any width-constrained theme container so the
   configurator always spans the full viewport, regardless of block alignment
   or theme content width. The inner .main still caps (1600px default / 2400px
   on wide screens) and centers.
   --cd-vw is set in JS to the real client width (excludes the scrollbar) to
   avoid a stray horizontal scrollbar; it falls back to 100vw if JS is absent.
   The doubled class + !important defeat block-theme content-width rules
   (.is-layout-constrained > *) that would otherwise clamp it back to ~650px. */
.cushion-designer-app.cushion-designer-app{
  width:var(--cd-vw,100vw) !important;
  max-width:var(--cd-vw,100vw) !important;
  margin-left:calc(50% - var(--cd-vw,100vw) / 2) !important;
  margin-right:calc(50% - var(--cd-vw,100vw) / 2) !important;
  margin-top:0 !important;     /* kill the theme's default block spacing above */
  margin-bottom:0 !important;
  overflow-x:hidden;
}

.app{display:block}

/* ---------- Page intro (compact header row) ---------- */
.intro{max-width:1480px;margin:0 auto;padding:18px 32px 4px;
  display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:8px 24px}
.intro .eyebrow{font-size:11px;font-weight:700;letter-spacing:2px;text-transform:uppercase;color:var(--green-2)}
.intro h1{margin:4px 0 0;font-size:26px;line-height:1.05;font-weight:800;letter-spacing:-.5px}
.trust{display:flex;flex-wrap:wrap;gap:8px 16px;color:var(--ink-soft);font-size:12.5px;font-weight:600}
.trust span{display:flex;align-items:center;gap:6px}
.trust .tk{color:var(--green-2)}

/* ---------- Main layout ---------- */
.main{
  width:100%;            /* fill the flex column; auto margins alone would shrink-to-fit */
  max-width:1600px;margin:0 auto;padding:22px 32px 60px;
  display:grid;
  /* Preview ~48% so the 3D view stays large; fabric panel then lands ~4
     swatch columns (see .swatches minmax at ≥768px) instead of 6–7. */
  grid-template-columns:minmax(0,1fr) minmax(480px,48%);
  gap:28px;
  align-items:start;
}
.config{
  min-width:0;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:var(--shadow-sm);
  overflow:hidden;
}

/* Stepper */
.stepper{
  display:flex;gap:6px;align-items:center;
  padding:16px 22px;
  border-bottom:1px solid var(--line-2);
  background:var(--surface-2);
  border-radius:22px 22px 0 0;
  overflow-x:auto;scrollbar-width:none;
  /* Reserve the rendered pill's height before JS populates the stepper so the
     step body doesn't drop down on first paint (39px phone / 45px desktop). */
  min-height:39px;
}
@media (min-width:768px){.config-head .stepper{min-height:45px}}
.stepper::-webkit-scrollbar{display:none}
.step{
  display:flex;align-items:center;gap:9px;
  padding:7px 12px;border-radius:999px;white-space:nowrap;
  color:var(--muted);font-size:13px;font-weight:600;flex:none;
}
.step .num{
  width:24px;height:24px;border-radius:50%;display:grid;place-items:center;
  font-size:12px;font-weight:700;background:#e8e1d2;color:var(--muted);
  transition:.2s;
}
.step.active{color:var(--ink);background:var(--green-soft)}
.step.active .num{background:var(--green);color:#fff}
.step.done{color:var(--ink-soft)}
.step.done .num{background:var(--green-soft-2);color:var(--green-2)}
.step.clickable{cursor:pointer}
.step.clickable:hover{color:var(--ink)}
.step-sep{width:14px;height:2px;background:var(--line);border-radius:2px;flex:none}
/* Compact stepper: show only the numbers (+ the active step's label) when space is tight */
.stepper.compact{gap:3px;padding-left:16px;padding-right:16px}
.stepper.compact .step{padding:6px 7px;gap:0}
.stepper.compact .step .step-label{display:none}
.stepper.compact .step.active{gap:8px}
.stepper.compact .step.active .step-label{display:inline}
.stepper.compact .step-sep{width:7px}

/* Mobile / compact: one pill (7/7 · Filling) opens a step picker — no clipped dots. */
.stepper.mobile-stepper{
  position:relative;flex:1 1 auto;min-width:0;overflow:visible;
  padding:0;background:transparent;border:none;border-radius:0;
}
.step-pill{
  display:inline-flex;align-items:center;gap:10px;width:auto;max-width:100%;
  padding:8px 12px 8px 14px;border-radius:999px;cursor:pointer;
  background:#fff;border:1.5px solid var(--line);
  font:inherit;font-weight:700;font-size:14px;color:var(--ink);text-align:left;
}
.step-pill-num{flex:none;color:var(--green-2);font-size:13px;letter-spacing:.02em}
.step-pill-name{flex:none;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.step-pill-go{
  flex:none;display:inline-flex;align-items:center;gap:5px;
  margin-left:2px;padding:6px 10px 6px 12px;border-radius:999px;
  background:var(--green-soft);border:1.5px solid rgba(93,138,47,.28);
  font-size:12px;font-weight:700;color:var(--green-2);white-space:nowrap;line-height:1;
}
.step-pill-caret{
  flex:none;font-size:15px;font-weight:800;color:var(--green-2);line-height:1;
}
.step-menu-backdrop{
  position:fixed;inset:0;z-index:55;background:rgba(38,52,42,.28);
}
.step-menu{
  position:absolute;top:calc(100% + 6px);left:0;right:0;z-index:60;
  background:var(--surface);border:1.5px solid var(--line);border-radius:14px;
  box-shadow:var(--shadow-sm);padding:6px;
  max-height:min(52vh,340px);overflow-y:auto;-webkit-overflow-scrolling:touch;
}
.step-menu-item{
  display:flex;align-items:center;gap:10px;width:100%;
  padding:10px 12px;border:0;border-radius:10px;background:transparent;
  font:inherit;font-size:14px;font-weight:600;color:var(--ink);text-align:left;cursor:pointer;
}
.step-menu-item.done .step-menu-num{background:var(--green-soft-2);color:var(--green-2)}
.step-menu-item.current{background:var(--green-soft)}
.step-menu-item:disabled{opacity:.42;cursor:not-allowed}
.step-menu-num{
  flex:none;width:26px;height:26px;border-radius:50%;display:grid;place-items:center;
  font-size:12px;font-weight:800;background:#e8e1d2;color:var(--muted);
}
.step-menu-label{flex:1 1 auto;min-width:0}
.step-menu-sub{display:block;font-size:11px;font-weight:500;color:var(--muted,#6b7280);margin-top:1px}
.step-menu-item.done .step-menu-sub{color:var(--lime,#5d8a2f)}
.step-menu-here{
  flex:none;font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  color:var(--green-2);padding:3px 7px;border-radius:999px;background:rgba(93,138,47,.12);
}

/* Pinned control row. On desktop it holds the step pill; the mobile-only Back /
   price / Next controls inside it are hidden on wide layouts (those live in the
   footer below). */
.config-head{display:flex;align-items:stretch;position:relative;overflow:visible}
.config-head .stepper{flex:1 1 auto;min-width:0}
.cd-mback{display:none}
.config-head .top-actions{display:none}

/* Step body */
.step-body{padding:26px 28px 28px}
.cd-edit-loading{padding:52px 0;text-align:center;color:var(--muted);font-size:15px;font-weight:600}
.step-head{margin:0 0 4px}
.step-head h2{margin:0;font-size:25px;font-weight:800;letter-spacing:-.3px}
.step-head p{margin:8px 0 22px;color:var(--muted);font-size:14px;max-width:580px;line-height:1.55}
.step-head a{color:var(--ink);text-decoration:underline}

/* Option card grids */
.grid{display:grid;gap:14px}
/* Responsive: tiles flex between a min/max width so the row reflows with the panel
   width (≈3-up in the normal config panel, more on wide screens, fewer when narrow),
   while each card stays a proportional square — no stretched-wide cards. */
.grid.types{grid-template-columns:repeat(auto-fill,minmax(200px,260px));justify-content:center;gap:18px}
.grid.shapes{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}
.grid.two{grid-template-columns:repeat(auto-fit,minmax(230px,1fr));align-items:stretch}
.grid.fillings{grid-template-columns:repeat(auto-fit,minmax(195px,1fr))}
/* Edge / filling cards: equal height per row — Safari does not always stretch
   <button> grid items, and 1-line titles ("Knife Edge") made those cards shorter
   than neighbours with wrapped names ("No Welting / Box Edge"). */
.grid.two .card,.grid.fillings .card{
  display:flex;flex-direction:column;height:100%;width:100%;align-self:stretch;
}
.grid.two .card .name,.grid.fillings .card .name{line-height:1.25;min-height:2.5em}
.grid.two .card .desc,.grid.fillings .card .desc{min-height:3em}

.card{
  position:relative;text-align:left;
  background:var(--surface);
  border:1.5px solid var(--line);border-radius:var(--radius);
  padding:16px;transition:.16s ease;overflow:hidden;
}
/* Gate the lift to real pointers — on touch, :hover sticks after a tap and would
   leave the just-selected card raised above its neighbours (a staggered row). */
@media (hover:hover){.card:hover{transform:translateY(-3px);border-color:#bcd29a;box-shadow:var(--shadow-sm)}}
.card.sel,.card.sel:hover{transform:none}
.card.sel{border-color:var(--green);background:var(--green-soft);box-shadow:0 12px 28px -18px rgba(93,138,47,.7)}
.card .check{
  position:absolute;top:10px;right:10px;z-index:5;width:24px;height:24px;border-radius:50%;
  background:var(--green);color:#fff;display:none;place-items:center;font-size:13px;font-weight:900;
  box-shadow:0 0 0 2px var(--surface);
}
.card.sel .check{display:grid}
.card .ill{
  height:108px;display:flex;align-items:center;justify-content:center;margin-bottom:12px;
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  transition:border-color .16s ease, background .16s ease;
}
@media (hover:hover){.card:hover .ill{border-color:var(--green-soft-2)}}
.card.sel .ill{background:#fff;border-color:var(--green-soft-2)}
.card .name{font-weight:700;font-size:14.5px;color:var(--ink)}
.card .desc{font-size:12px;color:var(--muted);margin-top:6px;line-height:1.5}
/* Icon-led cards (Type & Shape steps) read better centered */
.grid.types .card,.grid.shapes .card{text-align:center}
/* Type cards are photo-led — trim the card padding so the render fills more.
   Always-on outline (not hover-only). */
.grid.types .card{
  padding:8px 12px 14px;
  border:1.5px solid #c9c0ae;
  background:var(--surface);
  box-shadow:none;
}
@media (hover:hover){
  .grid.types .card:hover{border-color:#a89f8c;box-shadow:var(--shadow-sm)}
}
.grid.types .card.sel{
  border-color:var(--green);
  background:var(--green-soft);
  box-shadow:0 12px 28px -18px rgba(93,138,47,.7);
}
/* Reserve a consistent title height (1- and 2-line names alike) so every icon
   card is the same height and the row stays aligned. Safari does not always
   stretch <button> grid items to equal heights, so without this a 1-line title
   ("Rounded Top") made its card shorter and the row staggered. */
.grid.types .card .name,.grid.shapes .card .name{line-height:1.3;min-height:2.2em;display:flex;align-items:center;justify-content:center;text-align:center}
/* Type step: full-bleed lifestyle product photos (landscape 3:2) on a photo card. */
.grid.types .card .ill{
  display:flex;align-items:center;justify-content:center;
  width:100%;max-width:none;height:auto;aspect-ratio:3/2;margin:0 auto 8px;
  padding:0;overflow:hidden;
  background:#fffdf8;border:none;border-radius:var(--radius-sm);
}
@media (hover:hover){.grid.types .card:hover .ill{border-color:transparent}}
.type-img{width:100%;height:100%;flex:none;object-fit:contain;object-position:center center;display:block;pointer-events:none;padding:0;box-sizing:border-box;transform-origin:center center}
/* Lifestyle photo types: full-bleed cover, centered crop. */
.grid.types .card[data-val="bench"] .type-img,
.grid.types .card[data-val="benchb"] .type-img,
.grid.types .card[data-val="benchback"] .type-img,
.grid.types .card[data-val="chaise"] .type-img,
.grid.types .card[data-val="bed"] .type-img,
.grid.types .card[data-val="chair"] .type-img,
.grid.types .card[data-val="chairnb"] .type-img,
.grid.types .card[data-val="ottoman"] .type-img,
.grid.types .card[data-val="love"] .type-img,
.grid.types .card[data-val="sofa"] .type-img,
.grid.types .card[data-val="toss"] .type-img,
.grid.types .card[data-val="lumbar"] .type-img,
.grid.types .card[data-val="bolster"] .type-img,
.grid.types .card[data-val="filling"] .type-img,
.grid.types .card[data-val="custom"] .type-img,
.grid.types .card[data-val="petbed"] .type-img{object-fit:cover;object-position:center center;transform:none}
/* Photos with more headroom — bias crop down so the product sits higher in-card. */
.grid.types .card[data-val="bench"] .type-img,
.grid.types .card[data-val="benchb"] .type-img,
.grid.types .card[data-val="benchback"] .type-img,
.grid.types .card[data-val="chaise"] .type-img,
.grid.types .card[data-val="bed"] .type-img,
.grid.types .card[data-val="chair"] .type-img,
.grid.types .card[data-val="chairnb"] .type-img,
.grid.types .card[data-val="sofa"] .type-img,
.grid.types .card[data-val="lumbar"] .type-img,
.grid.types .card[data-val="bolster"] .type-img,
.grid.types .card[data-val="petbed"] .type-img{object-position:center 78%}
/* Inline SVG fallback (only shown if a photo fails to load) keeps breathing room. */
.grid.types .card .ill .type-ico{width:100%;max-width:118px;height:auto;display:block;padding:10px;box-sizing:border-box}

/* section sub-heading inside a step */
.subhead{font-size:13px;font-weight:700;letter-spacing:.02em;color:var(--ink-soft);text-transform:uppercase;margin:4px 2px 12px}
.subhead:not(:first-of-type){margin-top:22px}
.seg-note{font-size:13px;color:var(--ink-soft);margin:0 2px 10px}
.seg-note.seg-note-warn{color:var(--ink);background:var(--green-soft);border:1px solid var(--green-soft-2);border-radius:10px;padding:10px 12px}
/* An empty slot keeps its one-line height so the guidance appearing/clearing
   never shifts the tabs + shape grid below it (no down-then-up jump on select). */
.seg-note-slot.is-empty{visibility:hidden}
.shape-block .grid.shapes{outline:2px solid transparent;outline-offset:4px;border-radius:14px}
/* Back/Seat shape toggle — two separate bordered chips (not one fused pill). */
.seg{display:flex;flex-wrap:wrap;gap:8px;background:transparent;border:none;padding:0;margin:0 0 16px}
.seg button{
  border:1.5px solid var(--line);background:#fff;color:var(--ink-soft);
  font:inherit;font-weight:600;font-size:14px;padding:8px 16px;border-radius:10px;cursor:pointer;
  transition:background .15s,border-color .15s,box-shadow .15s,color .15s;
}
.seg button.on{background:#fff;color:var(--ink);border-color:var(--ink-soft)}
.seg button.done{background:var(--green-soft);color:var(--green-2);border-color:var(--green)}
.seg button.on.done{background:var(--green-soft);color:var(--green-2);border-color:var(--green)}
.seg button.need-next{
  color:var(--ink);background:#fff;border-color:var(--green);
  box-shadow:0 0 0 3px rgba(93,138,47,.2);
}
@media (hover:hover){
  .seg button.need-next:hover{background:var(--green-soft)}
  .seg button.done:hover{background:var(--green-soft);border-color:var(--green-2)}
}
.seg button.need-pick{color:var(--ink);background:#fff;border:1.5px solid var(--green);box-shadow:0 0 0 3px rgba(93,138,47,.18)}
.seg button.need-pick-flash{animation:cd-pick-flash .9s ease}
.seg-seat-wrap{display:inline-flex;align-items:center;gap:2px;flex-wrap:nowrap}
.seg-nudge-arrow{
  font-size:28px;font-weight:700;line-height:1;color:var(--green-2);flex:none;
  margin-left:2px;padding-right:2px;
  animation:seg-arrow-nudge .95s ease-in-out infinite;
}
@keyframes seg-arrow-nudge{
  0%,100%{transform:translateX(0);opacity:.75}
  50%{transform:translateX(-6px);opacity:1}
}
.shape-block.need-pick-block .subhead{color:var(--green-2)}
.shape-block.need-pick-block .grid.shapes{outline-color:var(--green-soft-2)}
.shape-block.need-pick-flash .grid.shapes{animation:cd-pick-flash .9s ease}
.shape-more-cue{
  display:flex;align-items:flex-start;gap:10px;margin:0 0 14px;padding:12px 14px;
  border-radius:12px;background:var(--green-soft);border:1.5px solid var(--green-soft-2);
  font-size:13px;font-weight:600;color:var(--ink);line-height:1.45;
}
.shape-more-arrow{font-size:20px;line-height:1;color:var(--green-2);flex:none;margin-top:1px}
/* Same space-reservation trick as .seg-note-slot: cue clears but doesn't collapse. */
.shape-more-cue.is-empty{visibility:hidden}
@keyframes cd-pick-flash{
  0%,100%{box-shadow:0 0 0 3px rgba(93,138,47,.18)}
  50%{box-shadow:0 0 0 6px rgba(93,138,47,.34)}
}
/* shape svg */
.shape-svg{width:100%;max-width:112px;height:auto;color:#9aab84}
.card.sel .shape-svg{color:var(--green-2)}

/* Dimensions */
/* auto-fit reflows the inputs to the available width of the config pane itself,
   so they wrap to 2x2 (or 1-up) instead of squishing when the column is narrow. */
.dims{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(150px,100%),1fr));gap:16px;max-width:560px;overflow:visible}
.dims.four{grid-template-columns:repeat(auto-fit,minmax(min(150px,100%),1fr));max-width:740px}
.dim{
  position:relative;display:flex;flex-direction:column;height:100%;min-width:0;max-width:100%;overflow:visible;
  background:var(--surface-2);border:1.5px solid var(--line);border-radius:var(--radius-sm);padding:16px;
}
.dim label{display:block;font-size:12px;text-transform:uppercase;letter-spacing:1px;color:var(--ink-soft);font-weight:700}
.dim .sub{font-size:11px;color:var(--muted);margin-bottom:10px;line-height:1.35;min-height:2.7em;overflow-wrap:anywhere}
.dim .field{display:flex;align-items:center;gap:8px;margin-top:auto;min-width:0;width:100%}
.dim-picker{
  position:relative;flex:1;min-width:0;display:flex;align-items:stretch;
  background:#fff;border:1.5px solid var(--line);border-radius:10px;overflow:hidden;
}
.dim-picker.is-open,.dim-picker:focus-within,.dim-picker.is-nudge{border-color:var(--green)}
.dim-picker.is-nudge{box-shadow:0 0 0 3px rgba(93,138,47,.12)}
.dim-picker-input{
  flex:1;min-width:0;width:auto;border:none;border-radius:0;background:transparent;
  color:var(--ink);font-size:22px;font-weight:700;padding:10px 12px;outline:none;
  box-sizing:border-box;font-family:inherit;line-height:1.2;
}
/* Touch: whole field acts as a select trigger (no text caret). */
.dim-picker.is-touch .dim-picker-input{
  cursor:pointer;caret-color:transparent;-webkit-user-select:none;user-select:none;
}
.dim-picker.is-touch{cursor:pointer}
.dim-picker-btn{
  flex:0 0 40px;width:40px;padding:0;margin:0;border:none;border-left:1px solid var(--line);
  border-radius:0;background:#f3f4f2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23687567' d='M1 1l5 5 5-5'/%3E%3C/svg%3E")
    no-repeat center;cursor:pointer;appearance:none;-webkit-appearance:none;
}
.dim-picker-btn:hover,.dim-picker.is-open .dim-picker-btn{background-color:#e8ebe4}
.dim-picker-menu{
  /* Open upward (drop-up) so the option list is never clipped by the step footer. */
  position:absolute;left:0;right:0;top:auto;bottom:calc(100% + 4px);z-index:40;margin:0;padding:4px 0;
  list-style:none;background:#fff;border:1.5px solid var(--line);border-radius:10px;
  box-shadow:var(--shadow-sm);
  max-height:min(240px, 45vh);overflow-y:auto;-webkit-overflow-scrolling:touch;
}
.dim-picker-menu[hidden]{display:none}
.dim-picker-menu li{
  padding:7px 12px;font-size:14px;font-weight:700;color:var(--ink);cursor:pointer;
}
.dim-picker-menu li:hover,.dim-picker-menu li.is-active{background:var(--green-soft);color:var(--green-2)}
.dim:has(.dim-picker.is-open){position:relative;z-index:45}
.dim .unit{flex:none;color:var(--muted);font-weight:600;font-size:13px}
.hint{display:block;margin-top:18px;max-width:580px;padding:13px 15px;border-radius:12px;
  background:var(--green-soft);border:1px solid var(--green-soft-2);font-size:13px;color:var(--ink-soft);line-height:1.55}
.hint-thickness-warn{background:#fff8ed;border-color:#e8c88a;color:#5c4a1e}
.hint-thickness-warn p{margin:0}
.hint-thickness-warn p+p{margin-top:8px}
.hint-chaise{font-size:14px;line-height:1.5}
.hint-chaise.is-error{
  background:#fff8f6;border-color:#e4a59c;color:#7a2e22;
}
.hint-chaise.need-pick-flash{animation:cd-pick-flash .9s ease}
.hint.jointing-auto{margin-bottom:16px}
.hint-break{border:none;border-top:1px solid var(--green-soft-2);margin:12px 0}
.hint-bias{display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center}
.hint-bias-photo{
  width:min(140px,40vw);height:min(140px,40vw);object-fit:cover;border-radius:50%;
  border:1px solid var(--green-soft-2);padding:6px;background:#fff;
}
.hint-bias p{margin:0}
/* Seat/back connection — below dimensions so the dim grid stays above the fold. */
.connection-block{
  margin:24px 0 0;padding:16px 18px;border-radius:14px;
  background:var(--green-soft);border:1.5px solid var(--green-soft-2);
}
.connection-block.need-pick-block{border-color:var(--green);box-shadow:0 0 0 3px rgba(93,138,47,.15)}
.connection-block.need-pick-flash{animation:cd-pick-flash .9s ease}
.connection-block .connected-toggle{margin:0}
.connection-block .connected-toggle + .jointing-sub,
.connection-block .connected-toggle + .hint.jointing-auto{margin-top:16px;padding-top:16px;border-top:1px solid rgba(93,138,47,.18)}
.connection-block .jointing-sub .jointing-callout{margin-bottom:10px}
.jointing-block{
  margin:24px 0 0;padding:16px 18px;border-radius:14px;
  background:var(--green-soft);border:1.5px solid var(--green-soft-2);
}
.jointing-block.need-pick-block{border-color:var(--green);box-shadow:0 0 0 3px rgba(93,138,47,.15)}
.jointing-block.need-pick-flash{animation:cd-pick-flash .9s ease}
.jointing-callout{font-size:14px;font-weight:600;color:var(--ink);margin:0 0 14px;line-height:1.45}
.jointing-block .grid.two{max-width:none}
.jointing-list{display:flex;flex-direction:column;gap:10px}
.connected-toggle{display:flex;flex-wrap:wrap;gap:10px}
.connection-block .seg .seg-tab,
.connected-block .seg .seg-tab{
  flex:1 1 140px;padding:12px 14px;font-size:14px;text-align:center;
}
/* Selected chip on green callout — stay white so it doesn't blend into the block. */
.connection-block .seg .seg-tab.on.done,
.connected-block .seg .seg-tab.on.done{
  background:#fff;color:var(--green-2);border-color:var(--green);
  box-shadow:0 0 0 3px rgba(93,138,47,.18);
}
.connection-block .seg .seg-tab:not(.on),
.connected-block .seg .seg-tab:not(.on){color:var(--ink-soft)}
@media (hover:hover){
  .connection-block .seg .seg-tab:hover,
  .connected-block .seg .seg-tab:hover{border-color:var(--green-soft-2)}
}
.connection-block .seg .seg-tab:focus-visible,
.connected-block .seg .seg-tab:focus-visible{outline:2px solid var(--green-2);outline-offset:2px}
.joint-row{
  display:flex;align-items:flex-start;gap:12px;width:100%;text-align:left;cursor:pointer;
  padding:14px;background:#fff;border:1.5px solid var(--line);border-radius:var(--radius);transition:.16s;
  font:inherit;
}
.joint-row .joint-ill{
  flex:none;width:64px;height:64px;display:grid;place-items:center;
  background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-sm);
}
.joint-row .joint-ill .shape-svg{max-width:52px;max-height:44px}
.joint-row .joint-ill .ill-img{object-fit:cover;border-radius:var(--radius-sm)}
.joint-row .joint-body{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:4px}
.joint-row .joint-title{font-weight:800;font-size:16px;color:var(--ink);line-height:1.25;display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.joint-tag{font-size:11px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--green-2);padding:3px 8px;border-radius:999px;background:rgba(93,138,47,.12)}
.joint-row .joint-desc{font-size:14px;color:var(--muted);line-height:1.45}
.joint-row .joint-check{
  flex:none;width:30px;height:30px;margin-top:2px;border-radius:50%;border:1.5px solid var(--line);
  background:#fff;display:grid;place-items:center;color:#fff;font-size:15px;font-weight:900;
}
.joint-row.sel{border-color:var(--green);background:var(--green-soft)}
.joint-row.sel .joint-check{background:var(--green);border-color:var(--green)}
@media (hover:hover){.joint-row:hover{border-color:var(--green-soft-2)}}
.joint-row:focus-visible{outline:2px solid var(--green-2);outline-offset:2px}
.dim-section.dim-active{border-color:var(--green);background:var(--green-soft);box-shadow:0 0 0 3px rgba(93,138,47,.12)}
.dim-section .sub b{color:var(--green-2)}
/* Float above the card so the grid cell height never changes.
   Soft rose (not traffic-light red) — reads as error without fighting the green select state. */
.dim-range-msg{
  position:absolute;left:50%;bottom:calc(100% + 8px);transform:translateX(-50%);
  z-index:50;width:max-content;max-width:min(220px, 70vw);
  margin:0;padding:7px 11px;border-radius:10px;
  background:#fff5f3;color:#8b3a32;border:1px solid #e4a59c;
  font-size:11.5px;font-weight:700;line-height:1.35;
  text-align:center;pointer-events:none;
  box-shadow:var(--shadow-sm);
}
.dim-range-msg::after{
  content:"";position:absolute;top:100%;left:50%;transform:translateX(-50%);
  border:6px solid transparent;border-top-color:#e4a59c;
}
.dim-range-msg::before{
  content:"";position:absolute;top:100%;left:50%;transform:translateX(-50%);
  margin-top:-1px;border:5px solid transparent;border-top-color:#fff5f3;
}
.dim-range-msg[hidden]{display:none!important}
.dim.has-range-msg{border-color:#e4a59c;background:#fff8f6}

/* Seat/back connection modal (opens from Dimensions → Next). */
.connection-modal{
  position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;padding:20px;
  font-family:var(--font, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}
.connection-modal-backdrop{
  position:absolute;inset:0;background:rgba(20,24,20,.55);
  -webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);
}
.connection-modal-card{
  position:relative;z-index:1;width:100%;max-width:520px;max-height:88vh;overflow:auto;
  background:#fff;border-radius:16px;box-shadow:0 24px 70px rgba(0,0,0,.35);
  padding:24px 22px 20px;animation:fdIn .16s ease;outline:none;
}
.connection-modal-card:focus{outline:none}
.connection-modal-card:focus-visible{outline:2px solid var(--green-2);outline-offset:4px}
.connection-modal-x{
  position:absolute;top:10px;right:12px;z-index:2;border:none;background:rgba(0,0,0,.35);color:#fff;
  width:34px;height:34px;border-radius:50%;font-size:22px;line-height:1;cursor:pointer;
}
.connection-modal-x:hover{background:rgba(0,0,0,.6)}
.connection-modal-title{margin:0 28px 6px 0;font-size:20px;font-weight:800;color:var(--ink);line-height:1.2}
.connection-modal-sub{margin:0 0 18px;font-size:14px;color:var(--muted);line-height:1.45}
.connection-modal-body .jointing-callout{margin-bottom:12px}
.connection-modal-body .connected-toggle + .jointing-sub,
.connection-modal-body .connected-toggle + .hint.jointing-auto{
  margin-top:16px;padding-top:16px;border-top:1px solid var(--line);
}
.connection-modal-body .jointing-sub .jointing-callout{margin-bottom:10px}
.connection-modal-body .joint-row .joint-ill{
  width:112px;height:88px;border-radius:var(--radius-sm);
}
.connection-modal-body .joint-row .joint-ill .ill-img{object-fit:cover;border-radius:var(--radius-sm)}
.connection-modal-body .jointing-auto-block{margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}
.connection-modal-body .jointing-auto-ill{
  border-radius:var(--radius-sm);overflow:hidden;border:1px solid var(--line);background:var(--surface-2);margin-bottom:12px;
}
.connection-modal-body .jointing-auto-ill .ill-img{width:100%;height:140px;object-fit:cover;display:block}
.connection-modal-body .jointing-auto-block .hint.jointing-auto{margin:0}
.connection-modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:20px;padding-top:16px;border-top:1px solid var(--line)}
.connection-modal-actions .btn{min-width:120px;justify-content:center;margin:0}
.connection-modal-continue.is-disabled{opacity:.45;cursor:not-allowed}
/* Modals mount on document.body (outside .cushion-designer-app), so give their
   buttons full theme styling — otherwise host-theme defaults leak a blue :focus ring. */
.connection-modal .btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  font:inherit;font-weight:700;font-size:15px;line-height:1.2;
  border-radius:12px;padding:13px 18px;cursor:pointer;
  border:1.5px solid transparent;outline:none;
  transition:border-color .16s ease,background .16s ease,filter .16s ease,transform .16s ease,box-shadow .16s ease;
}
.connection-modal .btn:focus{outline:none}
.connection-modal .btn:focus-visible{outline:2px solid var(--green-2);outline-offset:2px}
.connection-modal .btn.primary{
  background:linear-gradient(180deg,var(--green),var(--green-2));
  color:#fff;border-color:transparent;
  box-shadow:0 14px 26px -14px rgba(76,116,36,.85);
}
.connection-modal .btn.primary:hover{filter:brightness(1.04);transform:translateY(-1px)}
.connection-modal .btn.primary:focus-visible{
  outline:2px solid var(--green-2);outline-offset:2px;
  box-shadow:0 14px 26px -14px rgba(76,116,36,.85),0 0 0 3px rgba(93,138,47,.22);
}
.connection-modal .btn.primary.is-disabled,
.connection-modal .btn.primary:disabled{
  opacity:.45;cursor:not-allowed;filter:none;transform:none;box-shadow:none;pointer-events:auto;
}
.connection-modal .btn.primary.is-disabled:hover{filter:none;transform:none}
.connection-modal .btn.ghost{
  background:#fff;border-color:var(--line);color:var(--ink);
}
.connection-modal .btn.ghost:hover{
  border-color:var(--green-soft-2);color:var(--green-2);background:var(--green-soft);transform:none;
}
.connection-modal .btn.ghost:focus-visible{
  outline:2px solid var(--green-2);outline-offset:2px;
}
.resume-modal .connection-modal-sub b{color:var(--ink);font-weight:700}
.resume-modal-actions{justify-content:stretch}
.resume-modal-actions .btn{flex:1 1 0;min-width:0}

/* Fabric detail overview (opens when the tile body is clicked) */
.fab-detail{position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;padding:20px;
  font-family:var(--font, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif)}
.fd-backdrop{position:absolute;inset:0;background:rgba(20,24,20,.55);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}
.fd-card{position:relative;z-index:1;display:flex;max-width:820px;width:100%;max-height:min(88vh,720px);overflow:hidden;
  background:#fff;border-radius:16px;box-shadow:0 24px 70px rgba(0,0,0,.35);animation:fdIn .16s ease}
@keyframes fdIn{from{transform:translateY(8px);opacity:0}to{transform:none;opacity:1}}
.fd-x{position:absolute;top:10px;right:12px;z-index:2;border:none;background:rgba(0,0,0,.35);color:#fff;
  width:34px;height:34px;border-radius:50%;font-size:22px;line-height:1;cursor:pointer}
.fd-x:hover{background:rgba(0,0,0,.6)}
.fd-media{flex:0 0 42%;min-height:280px;background-size:cover;background-position:center;overflow:hidden;position:relative}
.fd-media-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;display:block}
.fd-info{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;padding:22px 22px 18px}
.fd-head{flex:0 0 auto;padding-right:36px}
.fd-name{font-size:22px;font-weight:800;color:var(--ink);line-height:1.15}
.fd-sub{color:var(--muted);font-size:13px;margin:4px 0 12px}
.fd-rows{flex:1 1 auto;min-height:0;overflow:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.fd-row{display:flex;justify-content:space-between;gap:16px;padding:9px 0;border-top:1px solid var(--line,#e7e9e3);font-size:14px}
.fd-row span{color:var(--muted);flex:0 0 auto}
.fd-row b{color:var(--ink);text-align:right;font-weight:700}
.fd-row--stack{flex-direction:column;align-items:flex-start;gap:6px}
.fd-row--stack b{text-align:left;font-weight:600;line-height:1.5;font-size:13px}
.fd-actions{flex:0 0 auto;display:flex;gap:10px;flex-wrap:wrap;margin-top:14px;padding-top:12px;border-top:1px solid var(--line,#e7e9e3)}
.fab-detail .fd-actions .btn{flex:1;min-width:140px;margin-left:0;justify-content:center}
@media (max-width:560px){
  .fab-detail{padding:10px;align-items:stretch}
  .fd-card{flex-direction:column;max-height:min(94vh,100%);margin:auto 0}
  .fd-media{flex:none;width:100%;min-height:0;height:32vh}
  .fd-info{padding:16px 16px 14px}
  .fd-name{font-size:20px}
}

.swatch-cta{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;
  margin-top:16px;padding:14px 16px;border:1px dashed var(--line,#d8dcd4);border-radius:12px;
  background:rgba(0,0,0,.015);font-size:14px;color:var(--muted)}
.swatch-cta b{color:var(--ink,#2b2f2a)}
.swatch-cta .btn{white-space:nowrap}

/* Cording fabric picker — same swatch grid/tiles as the Fabric step (4-up at
   typical mobile widths via the shared .swatches rules above). */
.cord-section{margin-top:22px;padding-top:20px;border-top:1px dashed rgba(0,0,0,.12)}
.cord-head h3{margin:0 0 3px;font-size:16px;font-weight:800;color:var(--ink)}
.cord-head p{margin:0 0 14px;font-size:13px;color:var(--muted);line-height:1.45}

/* ---------- Stripe direction (directional fabrics) ---------- */
/* Mobile: fixed pill over the viewport. Desktop: same pill, centered above the footer. */
.fabric-dir-toast{
  display:none;align-items:center;justify-content:center;gap:8px;
  position:fixed;left:50%;bottom:24px;z-index:50;
  width:min(420px,calc(100vw - 24px));margin:0;
  padding:12px 18px;border:0;border-radius:999px;
  transform:translateX(-50%);
  background:linear-gradient(180deg,var(--green),var(--green-2));color:#fff;
  font:inherit;font-size:14px;font-weight:700;line-height:1.2;
  box-shadow:0 10px 28px rgba(44,55,38,.32);cursor:pointer;
  animation:fabricDirToastIn .28s ease;
}
.fabric-dir-toast:not([hidden]){display:flex}
.fabric-dir-toast-arrow{font-size:17px;font-weight:900;line-height:1}
@keyframes fabricDirToastIn{
  from{opacity:0;transform:translateX(-50%) translateY(10px)}
  to{opacity:1;transform:translateX(-50%) translateY(0)}
}
@media (min-width:768px){
  .fabric-dir-toast{
    position:relative;left:auto;bottom:auto;z-index:1;
    width:min(420px,calc(100% - 56px));max-width:420px;
    margin:8px auto 10px;align-self:center;
    padding:12px 18px;border-radius:999px;
    transform:none;flex:0 0 auto;
    box-shadow:0 10px 28px rgba(44,55,38,.28);
    animation:fabricDirToastInDesk .28s ease;
  }
  @keyframes fabricDirToastInDesk{
    from{opacity:0;transform:translateY(8px)}
    to{opacity:1;transform:translateY(0)}
  }
}
@media (prefers-reduced-motion:reduce){
  .fabric-dir-toast{animation:none}
}
.fabric-dir{margin-top:22px;padding-top:20px;border-top:1px dashed rgba(0,0,0,.12)}
.fabric-dir-head h3{margin:0 0 3px;font-size:16px;font-weight:800;color:var(--ink)}
.fabric-dir-head p{margin:0 0 14px;font-size:13px;color:var(--muted);line-height:1.45}
.dir-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.dir-card{display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;
  padding:16px 14px;cursor:pointer;font:inherit;
  background:var(--surface-2);border:1.5px solid var(--line);border-radius:var(--radius);
  color:var(--ink-soft);transition:.16s}
.dir-card .dir-ill{width:100%;height:70px;display:grid;place-items:center;
  background:#fff;border:1px solid var(--line);border-radius:var(--radius-sm);color:var(--muted)}
.dir-card .dir-ill .shape-svg{width:78px;height:auto}
/* WYSIWYG swatch tile: a square crop of the real fabric, rotated to match the
   on-cushion stripe direction. The box is square so a swatch filling it stays
   edge-to-edge under any 0/90/180/270 turn (no letterboxing). */
.dir-card .dir-ill.is-img{height:auto;aspect-ratio:1/1;overflow:hidden;position:relative;padding:0;
  width:100%;max-width:200px;margin-left:auto;margin-right:auto}
.dir-card .dir-ill.is-img .dir-swatch{position:absolute;top:50%;left:50%;
  width:141.42%;height:141.42%;display:block;
  transform-origin:center center;background-size:cover;background-position:center;
  background-repeat:no-repeat}
.dir-card .dir-name{font-size:14px;font-weight:800;color:var(--ink)}
.dir-card .dir-sub{font-size:12px;color:var(--muted)}
.dir-card.sel{
  border-color:var(--green);background:var(--green-soft);
  box-shadow:
    0 0 0 1px rgba(93,138,47,.14),
    0 0 16px rgba(93,138,47,.22),
    0 0 28px rgba(93,138,47,.10),
    0 12px 28px -18px rgba(93,138,47,.7);
}
.dir-card.sel .dir-ill{
  background:#fff;border-color:var(--green-soft-2);color:var(--green-2);
  box-shadow:0 0 12px rgba(93,138,47,.20);
}
@media (hover:hover){.dir-card:hover{border-color:var(--green-soft-2)}}

/* ---------- Option-card photos (fasteners + fillings) ---------- */
.ill-img{width:100%;height:100%;object-fit:contain;display:block;pointer-events:none}
/* Edge step uses full-bleed macro photos of the seam/welt. The photos are 4:3,
   so give the well a matching aspect ratio (instead of the short 108px default)
   so the whole corner is visible. The SVG fallback still centers because it is a
   .shape-svg, not an .ill-img. */
.grid.two .card[data-field="edge"] .ill{overflow:hidden;padding:0;height:auto;aspect-ratio:4/3;max-height:170px}
.grid.two .card[data-field="edge"] .ill .ill-img{object-fit:cover}

/* ---------- Fastener placement diagram ---------- */
.placement{margin-top:22px;padding-top:20px;border-top:1px dashed rgba(0,0,0,.12)}
.placement-head h3{margin:0 0 3px;font-size:16px;font-weight:800;color:var(--ink)}
.placement-head p{margin:0 0 12px;font-size:13px;color:var(--muted);line-height:1.45}
.placement-head b{color:var(--ink)}
.placement-stage{
  background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius);
  padding:8px 6px;display:flex;justify-content:center;align-items:center;width:100%;
}
.placement-svg{
  width:100%;max-width:min(560px,100%);height:auto;flex:0 1 auto;display:block;margin:0 auto;
  touch-action:manipulation;
}
.placement-multi .placement-svg{max-width:min(480px,100%)}
.pcushion{fill:#fff;stroke:var(--green-soft-2);stroke-width:2}
.pzipper-line{stroke:var(--muted);stroke-width:1.5;stroke-dasharray:5 4;fill:none}
.pzipper-text{fill:var(--ink-soft);font-size:11px;font-weight:600;text-anchor:middle;font-family:inherit;pointer-events:none}
.pzipper-arrow{fill:var(--muted)}
.pdim{pointer-events:none}
.pdim-box{fill:#e8e4dc;stroke:rgba(0,0,0,.08);stroke-width:1}
.pdim-val{fill:var(--ink);font-size:12px;font-weight:700;text-anchor:middle;font-family:inherit}
.pedge-lbl{fill:var(--muted);font-size:12px;font-weight:600;text-anchor:middle;font-family:inherit}
.pdot{cursor:pointer}
.pdot .pdot-hit{fill:transparent}
.pdot .pdot-dot{fill:#fff;stroke:var(--green);stroke-width:2;transition:.12s}
@media (hover:hover){.pdot:hover .pdot-dot{fill:var(--green-soft)}}
.pdot.on .pdot-dot{fill:var(--green);stroke:var(--green)}
.pdot:focus{outline:none}
.pdot:focus-visible .pdot-dot{stroke:var(--green-2);stroke-width:3}
.placement-hint{margin-top:12px;font-size:12px;color:var(--muted);line-height:1.5}
/* Two-diagram layout (seat + back) */
.placement-panel{margin-top:14px;width:100%}
.placement-panel:first-of-type{margin-top:0}
.placement-cap{font-size:11.5px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:var(--ink-soft);margin:0 0 5px}
/* Call-to-action line under the placement note */
.placement-cta{display:block;margin-top:8px;font-size:13.5px;color:var(--ink-soft);line-height:1.45}
.placement-cta b{color:var(--ink)}
.placement-cta.empty{font-weight:700;color:var(--green-2)}
.placement-status{
  display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;
}
.placement-chip{
  appearance:none;-webkit-appearance:none;border:1.5px solid var(--line);background:#fff;
  color:var(--ink);font:inherit;font-size:12.5px;font-weight:700;line-height:1.2;
  padding:8px 12px;border-radius:999px;cursor:pointer;
  transition:border-color .16s ease,background .16s ease,color .16s ease;
}
.placement-chip:hover{border-color:var(--green-soft-2);background:var(--green-soft);color:var(--green-2)}
.placement-chip.is-empty{border-color:#e4a59c;background:#fff8f6;color:#8b3a32}
.placement-chip.is-empty:hover{border-color:#d4887e;background:#fff1ee}
.placement-panel-flash{
  animation:cd-pick-flash .9s ease;
  border-radius:var(--radius);
}
/* Empty state: outline + gently pulse the diagram so it's obvious the shopper
   needs to tap a point (nothing is auto-placed). Stroke the dots green too. */
.placement.is-empty .placement-stage{border-color:var(--green-soft-2);background:var(--green-soft)}
.placement-chaise .placement-head p{max-width:none}
.placement-chaise .placement-svg{max-width:min(680px,100%)}
.placement-chaise .pedge-lbl-side{font-size:11px;font-weight:700;fill:var(--muted);text-anchor:middle;font-family:inherit}
.pcushion-seg{fill:#fff;stroke:var(--green-soft-2);stroke-width:1.5}
.psec-num{font-size:14px;font-weight:800;fill:var(--green-2);text-anchor:middle;dominant-baseline:middle;pointer-events:none;font-family:inherit}
.psec-break{stroke:var(--muted);stroke-width:1.5;stroke-dasharray:5 4;opacity:.75}
@media (prefers-reduced-motion:no-preference){
  .placement.is-empty .placement-stage{animation:cdStagePulse 1.6s ease-in-out infinite}
}
@keyframes cdStagePulse{0%,100%{box-shadow:0 0 0 0 rgba(122,162,74,0)}50%{box-shadow:0 0 0 5px rgba(122,162,74,.18)}}
/* Flash a panel briefly when it re-renders and needs attention */
@media (prefers-reduced-motion:no-preference){
  .cd-flash{animation:cdFlash 1.05s ease-out}
}
@keyframes cdFlash{0%{box-shadow:0 0 0 0 rgba(122,162,74,.55)}100%{box-shadow:0 0 0 14px rgba(122,162,74,0)}}

/* ---------- Filling options (compact selectable rows) ---------- */
.fill-list{display:flex;flex-direction:column;gap:10px}
.fill-row{display:flex;align-items:center;gap:14px;width:100%;text-align:left;cursor:pointer;
  padding:11px 14px;background:#fff;border:1.5px solid var(--line);border-radius:var(--radius);transition:.16s;
  font-family:inherit;color:inherit}
.fill-row .fill-ill{flex:none;width:92px;height:92px;display:grid;place-items:center;
  background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-sm);overflow:hidden}
.fill-row .fill-ill .ill-img{object-fit:cover}
.fill-row .fill-body{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:3px}
.fill-row .fill-title{font-weight:800;font-size:14.5px;color:var(--ink);display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.fill-row .fill-price{font-size:12.5px;font-weight:800;color:var(--green-2)}
.fill-row .fill-desc{font-size:12.5px;color:var(--muted);line-height:1.45}
.fill-row .fill-check{flex:none;width:26px;height:26px;border-radius:50%;border:1.5px solid var(--line);
  background:#fff;display:grid;place-items:center;color:#fff;font-size:14px;font-weight:900}
.fill-row.sel{border-color:var(--green);background:var(--green-soft)}
.fill-row.sel .fill-check{background:var(--green);border-color:var(--green)}
@media (hover:hover){.fill-row:hover{border-color:var(--green-soft-2)}}
.fill-row:focus-visible{outline:2px solid var(--green-2);outline-offset:2px}

/* Hover-to-enlarge: the filling/add-on thumbnail scales up into a floating
   preview so shoppers can inspect the material without leaving the step.
   Pointer-only (skipped on touch, where there's no hover). */
@media (hover:hover){
  .fill-row,.addon{position:relative}
  .fill-row .fill-ill,.addon .addon-ill{
    transition:transform .18s ease, box-shadow .18s ease, border-color .16s ease;
    transform-origin:left center;
  }
  .fill-row:hover,.addon:hover{z-index:30}
  .fill-row .fill-ill:hover,.addon .addon-ill:hover{
    transform:scale(2.4);
    border-color:var(--green-soft-2);
    background:#fff;
    box-shadow:0 20px 44px -14px rgba(0,0,0,.5);
  }
}

/* ---------- Batting add-on (filling step) ---------- */
/* Open animation is driven in JS (Web Animations / height px). */
.batting-slot-clip{min-height:0}
.addon{display:flex;align-items:center;gap:14px;margin-top:16px;padding:14px 16px;cursor:pointer;
  background:var(--surface-2);border:1.5px solid var(--line);border-radius:var(--radius);transition:.16s}
.addon .addon-ill{flex:none;width:92px;height:92px;display:grid;place-items:center;
  background:#fff;border:1px solid var(--line);border-radius:var(--radius-sm);overflow:hidden}
.addon .addon-body{flex:1 1 auto;min-width:0}
.addon .addon-title{font-weight:800;font-size:14.5px;color:var(--ink);display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.addon .addon-price{font-size:12.5px;font-weight:800;color:var(--green-2)}
.addon .addon-body p{margin:3px 0 0;font-size:12.5px;color:var(--muted);line-height:1.45}
.addon .addon-check{flex:none;width:26px;height:26px;border-radius:50%;border:1.5px solid var(--line);
  background:#fff;display:grid;place-items:center;color:#fff;font-size:14px;font-weight:900}
.addon.on{border-color:var(--green);background:var(--green-soft)}
.addon.on .addon-check{background:var(--green);border-color:var(--green)}
.addon.included{cursor:default}
@media (hover:hover){.addon.included:hover{border-color:var(--green)}}
@media (hover:hover){.addon:hover{border-color:var(--green-soft-2)}}
.addon:focus-visible{outline:2px solid var(--green-2);outline-offset:2px}
/* Batting add-on — nested under the selected fill row so it isn't below the fold. */
.batting-slot{margin-top:0}
.batting-slot-inline{margin:0 0 10px}
.batting-slot-inline > .batting-slot-clip{padding:0 0 0 12px;border-left:3px solid var(--green-soft-2)}
.batting-slot-lbl{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--green-2);margin:8px 0 6px 14px}
.batting-slot-inline .addon{margin-top:0}

/* ---------- Footer nav ---------- */
.footer{
  display:flex;align-items:center;gap:14px;
  padding:16px 28px;border-top:1px solid var(--line-2);
  background:var(--surface-2);
  border-radius:0 0 22px 22px;
}
.btn.primary{background:linear-gradient(180deg,var(--green),var(--green-2));color:#fff;margin-left:auto;box-shadow:0 14px 26px -14px rgba(76,116,36,.85)}
.btn.primary:hover{filter:brightness(1.04);transform:translateY(-1px)}
.btn.primary:disabled,.btn.primary.is-disabled{opacity:.5;cursor:not-allowed;box-shadow:none;filter:none;transform:none;pointer-events:auto}
.btn.primary.is-disabled:hover{filter:none;transform:none}
/* Keep footer labels on one line — at mid desktop widths the config column
   squeezes this row and "Add to Cart" / "‹ Back" otherwise wrap into tall stacks. */
.footer .btn{white-space:nowrap;flex-shrink:0}
.footer .progress-txt{font-size:13px;color:var(--muted);font-weight:600;white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis}
/* Right-aligned action cluster: quantity stepper sits just left of "Add to Cart". */
.footer-actions{margin-left:auto;display:flex;align-items:center;gap:14px;flex-shrink:0}
.footer-actions .btn.primary{margin-left:0}
/* Final step adds Qty + a longer CTA. Drop the redundant step label and tighten
   spacing so content can't overflow (.config clips overflow) and eat the right pad. */
.footer:has(#qtyFoot:not([hidden])){gap:10px}
.footer:has(#qtyFoot:not([hidden])) .progress-txt{display:none}
.footer:has(#qtyFoot:not([hidden])) .footer-actions{gap:10px}
.footer:has(#qtyFoot:not([hidden])) .qty-foot-lbl{display:none}
.footer:has(#qtyFoot:not([hidden])) .btn{padding-left:16px;padding-right:16px}
/* Nudge arrow pointing at the "Next" button once a type is chosen on Step 1. */
.next-nudge-arrow{
  font-size:26px;font-weight:700;line-height:1;color:var(--green-2);flex:none;align-self:center;
  margin:0 -4px 0 0;animation:next-arrow-nudge .95s ease-in-out infinite;
}
.next-nudge-arrow--m{font-size:22px}
@keyframes next-arrow-nudge{
  0%,100%{transform:translateX(0);opacity:.7}
  50%{transform:translateX(6px);opacity:1}
}
.qty-foot{display:flex;align-items:center;gap:10px}
.qty-foot[hidden]{display:none}
.qty-foot-lbl{font-size:13px;font-weight:700;color:var(--ink-soft)}
.qty-foot .qty-stepper{height:46px}
.qty-foot .qty-stepper .qbtn{width:38px;height:46px}
.qty-foot .qty-stepper input{height:46px;width:46px}

/* ---------- Right rail: live preview + summary ---------- */
.rail{
  min-width:0;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.preview{
  position:relative;display:grid;place-items:center;padding:26px 22px 18px;
  background:
    radial-gradient(120% 90% at 50% 12%,#ffffff 0%,#f3eee2 70%,#ece4d3 100%);
  min-height:300px;overflow:hidden;
}
.preview .floor{
  position:absolute;left:14%;right:14%;bottom:14%;height:42px;border-radius:50%;
  background:radial-gradient(ellipse,rgba(60,72,52,.22),transparent 70%);filter:blur(7px);
}
.stage{width:100%;max-width:380px;display:grid;place-items:center;position:relative;z-index:1}
.stage svg{width:100%;height:auto;max-height:300px;overflow:visible;
  filter:drop-shadow(0 22px 22px rgba(55,65,45,.26));transition:transform .55s ease}
.cd-svg-lbl-box{fill:#fff;stroke:rgba(55,65,45,.2);stroke-width:1}
.cd-svg-lbl-val{font:700 11px Inter,system-ui,sans-serif;fill:#2a3324}
.cd-svg-caption{font:700 9px Inter,system-ui,sans-serif;letter-spacing:.12em;fill:#6a7360}
.stage.flip svg{transform:scaleX(-1)}
.gl{position:absolute;inset:0;z-index:2;display:none;cursor:grab}
.gl.on{display:block}
.gl:active{cursor:grabbing}
.gl canvas{display:block;width:100%!important;height:100%!important}
.preview.gl-ready .stage{display:none}
.gl-notice{
  position:absolute;left:50%;bottom:12px;transform:translateX(-50%);z-index:6;
  max-width:min(92%,420px);padding:8px 12px;border-radius:10px;
  font-size:12px;line-height:1.35;font-weight:600;text-align:center;
  color:var(--ink-soft);background:rgba(255,255,255,.92);
  border:1px solid var(--line);box-shadow:0 6px 18px rgba(55,65,45,.12);
  pointer-events:none;
}
.preview.gl-ready .gl-notice{display:none}
.preview .badge{position:absolute;top:16px;left:16px;z-index:4;font-size:11px;font-weight:700;letter-spacing:1px;text-transform:uppercase;
  color:var(--ink-soft);background:rgba(255,255,255,.85);padding:6px 11px;border-radius:999px;border:1px solid var(--line)}
/* Text pill controls overlaid on the preview. */
.pv-btn{
  position:absolute;z-index:5;width:auto;height:auto;line-height:1;cursor:pointer;
  font:inherit;font-size:13px;font-weight:700;color:var(--ink);
  padding:9px 14px;border-radius:999px;
  background:#fff;border:1px solid var(--line);
  box-shadow:0 4px 14px -4px rgba(40,55,35,.3);
}
@media (hover:hover){.pv-btn:hover{background:var(--green-soft);border-color:var(--green-soft-2);color:var(--green-2)}}
/* Hide/Show Labels — both mobile and desktop (bottom-right). */
.pv-btn.labels{bottom:14px;right:14px}
/* Expand/Shrink the preview into a large inspector (bottom-left). Shown on every
   breakpoint — on desktop it pops the small rail preview into a full-height
   overlay inspector (the expanded styles live in the min-width:768px block). */
.pv-btn.expand{display:inline-flex;align-items:center;bottom:14px;left:16px}
/* Centred in the band between the Expand control (bottom-left) and the Hide
   Labels control (bottom-right) so it never sits under either pill. */
.drag-hint{position:absolute;bottom:18px;left:118px;right:132px;transform:none;z-index:4;font-size:11px;font-weight:600;color:var(--muted);
  background:rgba(255,255,255,.8);padding:6px 11px;border-radius:999px;border:1px solid var(--line);
  opacity:0;transition:opacity .4s;pointer-events:none;white-space:nowrap;text-align:center;
  overflow:hidden;text-overflow:ellipsis}
.preview.gl-ready .drag-hint{opacity:1}
.preview.gl-ready .drag-hint.hide{opacity:0}

/* Expanded preview (tablet/desktop): fixed overlay inspector. Phones use the
   in-flow rail height transition in the max-width:767px block instead. */
@media (min-width:768px){
  .cushion-designer-app.preview-expanded .preview{
    position:fixed;left:0;right:0;top:var(--cd-top,0px);bottom:0;
    /* aspect-ratio:auto is critical: the base rail rule sets 5/4, which at
       full viewport width computes a height taller than the screen — that
       over-constrains top/bottom, pushing the bottom controls (Shrink /
       Hide Labels) below the fold on wide displays. */
    aspect-ratio:auto;
    height:auto;min-height:0;max-height:none;z-index:60;border-radius:0;padding:24px;
  }
  .cushion-designer-app.preview-expanded .stage{max-width:min(560px,80vw)}
  .cushion-designer-app.preview-expanded .floor{display:block}
  .cushion-designer-app.preview-expanded .pv-btn.expand{bottom:max(18px,env(safe-area-inset-bottom));left:18px}
  .cushion-designer-app.preview-expanded .pv-btn.labels{bottom:max(18px,env(safe-area-inset-bottom));right:18px}
  .cushion-designer-app.preview-expanded .drag-hint{
    left:130px;right:150px;bottom:max(18px,env(safe-area-inset-bottom));
  }
}

/* Summary */
.summary{padding:18px 20px 20px;border-top:1px solid var(--line-2)}
.summary-scroll h3,.summary > h3{margin:0 0 12px;font-size:12px;text-transform:uppercase;letter-spacing:1.5px;color:var(--muted)}
.sum-rows{display:grid;gap:8px;margin-bottom:14px}
.sum-row{display:flex;justify-content:space-between;gap:12px;font-size:13.5px}
.sum-row .k{color:var(--muted)}
.sum-row .v{font-weight:600;text-align:right;color:var(--ink)}
.sum-row .v.empty{color:#aeb5a8;font-style:italic;font-weight:500}
.price-row{display:flex;align-items:center;justify-content:space-between;padding-top:14px;border-top:1px dashed var(--line)}
.price-row .lbl{font-size:13px;color:var(--muted)}
.price-row .amt{font-size:28px;font-weight:800;letter-spacing:-.5px;color:var(--ink)}
.price-row .amt.has-qty{display:flex;flex-direction:column;align-items:flex-end;gap:2px;line-height:1.15}
.price-row .amt small,#pricePer{display:block;font-size:13px;font-weight:600;color:var(--muted);letter-spacing:0}
#pricePer[hidden],#mPricePer[hidden]{display:none!important}
.mprice #mPricePer{display:block;font-size:11px;font-weight:600;color:var(--muted);margin-top:1px;line-height:1.2}
/* Preview-only embeds (e.g. /swingbeds): hide quote chrome, keep step text. */
.cushion-designer-app.cd-visual-only .summary-foot{display:none}
.cushion-designer-app.cd-visual-only .qty-foot{display:none!important}
.cushion-designer-app.cd-visual-only .qty-block{display:none!important}
.cushion-designer-app.cd-visual-only .top-actions .mprice #mPriceVal{font-size:12px;font-weight:600;color:var(--muted)}
.cushion-designer-app.cd-visual-only #dimsBtn{display:none!important}
/* Placeholder shown before the shopper has entered dimensions. */
.price-row .amt #priceVal.price-gated{font-size:15px;font-weight:700;color:var(--muted);letter-spacing:0}

/* Quantity stepper (final step, before Add to Cart) */
/* Desktop shows the quantity in the footer (left of Add to Cart); this in-step
   block is the mobile fallback, where the footer is hidden. */
.qty-block{display:none;align-items:center;justify-content:space-between;gap:16px;margin-top:18px;padding:16px 18px;border:1px solid var(--line);border-radius:14px;background:var(--card,#fff)}
.qty-block.qty-block-top{margin-top:0;margin-bottom:16px}
@media (max-width:767px){.qty-block{display:flex}}

/* Phones: collapsible running summary (rail summary is hidden). Hidden on Type — that step needs the space. */
.m-summary{display:none}
.m-summary-toggle{
  width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:7px 14px;border:0;border-bottom:1px solid var(--line-2);
  background:var(--surface-2);text-align:left;cursor:pointer;
}
.m-summary-meta{
  flex:1 1 auto;min-width:0;
  font-size:13px;font-weight:600;color:var(--ink);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.m-summary-chevron{
  flex:0 0 auto;display:grid;place-items:center;
  width:30px;height:30px;border-radius:50%;
  background:#fff;border:1.5px solid var(--line);
  font-size:18px;font-weight:800;color:var(--green-2);line-height:1;
  transition:transform .2s ease;
}
.m-summary.open .m-summary-chevron{transform:rotate(180deg)}
.m-summary-panel{display:none;padding:0;border-bottom:0;background:var(--surface)}
.m-summary-panel[hidden]{display:none!important}
.m-summary.open .m-summary-panel{
  display:flex;flex-direction:column;
  padding:10px 14px 14px;border-bottom:1px solid var(--line-2);
  max-height:min(50vh,380px);overflow:hidden;
}
.m-summary.open .m-summary-panel .m-summary-kicker{font-size:10px;font-weight:700;letter-spacing:1.2px;text-transform:uppercase;color:var(--muted);margin:0 0 8px;flex:0 0 auto}
.m-summary.open .m-summary-panel .sum-rows{
  flex:1 1 auto;min-height:0;margin-bottom:0;
  overflow-y:auto;-webkit-overflow-scrolling:touch;
}
.m-summary.open .m-summary-panel .cd-reset,
.m-summary.open .m-summary-panel .cd-share{flex:0 0 auto;margin-top:10px;margin-bottom:0}
.cd-reset,.cd-share{
  display:block;width:100%;margin-top:12px;padding:12px 14px;
  border:1.5px solid var(--green);border-radius:12px;background:var(--surface-2);
  font:inherit;font-size:14px;font-weight:700;color:var(--ink-soft);cursor:pointer;text-align:center;
}
.cd-reset[hidden],.cd-share[hidden]{display:none!important}
@media (hover:hover){.cd-reset:hover,.cd-share:hover{border-color:var(--green-2);color:var(--ink);background:var(--green-soft)}}
.cd-share[disabled]{cursor:default;border-color:var(--green-2);color:var(--ink);background:var(--green-soft)}
.summary .cd-reset,.summary .cd-share{margin:10px 0 4px}
.summary .cd-share + .cd-reset,
.m-summary-panel .cd-share + .cd-reset{margin-top:8px}
.qty-block .qty-lbl{display:flex;flex-direction:column;gap:2px}
.qty-block .qty-lbl b{font-size:15px;color:var(--ink)}
.qty-block .qty-lbl span{font-size:12.5px;color:var(--muted)}
.qty-stepper{display:flex;align-items:center;gap:0;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fff;flex:0 0 auto}
.qty-stepper .qbtn{width:42px;height:42px;border:0;background:transparent;font-size:22px;font-weight:600;line-height:1;color:var(--ink);cursor:pointer;display:flex;align-items:center;justify-content:center}
.qty-stepper .qbtn:hover{background:var(--bg,#f4f1ea)}
.qty-stepper .qbtn:active{background:var(--line)}
.qty-stepper input{width:52px;height:42px;border:0;border-left:1px solid var(--line);border-right:1px solid var(--line);text-align:center;font-size:16px;font-weight:700;color:var(--ink);background:#fff;-moz-appearance:textfield}
.qty-stepper input::-webkit-outer-spin-button,.qty-stepper input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
/* While the authoritative price is being re-quoted, dim it gently instead of
   flashing a placeholder number. */
.price-row .amt,.mobilebar .mprice{transition:opacity .15s ease}
.price-row .amt.updating,.mobilebar .mprice.updating{opacity:.4}

/* Mobile bottom action bar (hidden on desktop) */
.mobilebar{display:none}

/* ---------- Desktop: fixed-height shell, only step content scrolls ---------- */
/* Scoped to the embed so the host page keeps its normal scrolling. The designer
   fills the viewport height and scrolls its step content internally. */
@media (min-width:768px){
  .config-head{
    padding:14px 22px;
    border-bottom:1px solid var(--line-2);
    background:var(--surface-2);
    border-radius:22px 22px 0 0;
  }
  .config-head .stepper.mobile-stepper{padding:0;background:transparent;border:none;border-radius:0}
  .step-pill{max-width:min(100%,520px)}
  .step-menu{max-width:min(100%,520px)}
  .step-pill-go-txt{display:inline}
  /* Fill the viewport BELOW the site header (--cd-top is the header's height,
     measured in JS) so the designer is a self-contained panel and the theme
     footer sits cleanly beneath it. Falls back to full viewport height. */
  .cushion-designer-app{height:calc(100dvh - var(--cd-top, 0px));display:flex;flex-direction:column;overflow:hidden}
  .cushion-designer-app > .main{flex:1 1 auto;min-height:0;overflow:hidden}
  .main{flex:1 1 auto;min-height:0;overflow:hidden;padding-top:16px;padding-bottom:20px;align-items:stretch}
  .config{height:100%;display:flex;flex-direction:column;min-height:0}
  .step-body{flex:1 1 auto;min-height:0;overflow-y:auto;scrollbar-width:thin}
  .rail{height:100%;display:flex;flex-direction:column;min-height:0}
  /* Preview keeps a STABLE height (width-driven aspect, capped) so the 3D
     mockup never resizes as summary rows accumulate through the flow — the
     old flex sizing made the whole rail breathe on every selection. */
  .preview{flex:0 0 auto;aspect-ratio:5/4;min-height:240px;max-height:52%}
  /* Summary takes the remaining rail height and scrolls internally. */
  .summary{
    flex:1 1 auto;min-height:0;display:flex;flex-direction:column;
    padding:0;overflow:hidden;border-top:1px solid var(--line-2);
  }
  .summary-scroll{
    flex:1 1 auto;min-height:0;overflow-y:auto;
    padding:18px 20px 12px;scrollbar-width:thin;
  }
  .summary-foot{
    flex:0 0 auto;padding:0 20px 18px;background:var(--surface);
    border-top:1px solid var(--line-2);box-shadow:0 -6px 16px rgba(40,48,36,.06);
  }
  /* Keep the right-aligned price clear of the fixed chat launcher. */
  .summary-foot .price-row{padding-top:14px;border-top:none;margin:0;padding-right:72px}
  .summary .cd-reset,.summary .cd-share{margin:10px 0 4px}
}

/* ---------- Wide / full-screen ---------- */
/* Above the default 1600px cap: fill big monitors and keep preview ~half the
   row so the extra width goes to the 3D view (not more fabric columns). */
@media (min-width:1601px){
  .main{
    max-width:2400px;
    grid-template-columns:minmax(0,1fr) minmax(560px,50%);
  }
  /* Bigger tiles on large monitors; still reflows responsively, capped so cards
     stay proportional. */
  .grid.types{grid-template-columns:repeat(auto-fill,minmax(210px,270px))}
}

/* ---------- Responsive ---------- */
@media (max-width:1180px) and (min-width:768px){
  .main{grid-template-columns:1fr minmax(340px,400px);gap:22px}
}
@media (max-width:1024px) and (min-width:768px){
  /* Tablet portrait (e.g. iPad 768px): side-by-side with a narrower preview rail. */
  .main{grid-template-columns:1fr minmax(260px,340px);gap:16px;padding:16px 20px 32px}
  .step-body{padding:20px 22px 24px}
  .step-head h2{font-size:22px}
  .preview{min-height:240px;padding:20px 18px 14px}
  .stage{max-width:300px}
  /* Smaller cap here so the cramped iPad-portrait config panel still gets 2-up
     (never 1-up) while the roomier tablet-landscape panel lands 3-up. */
  .grid.types{grid-template-columns:repeat(auto-fill,minmax(150px,190px))}
  .grid.shapes{grid-template-columns:repeat(auto-fill,minmax(120px,1fr))}
}
@media (max-width:980px) and (min-width:768px){
  .main{grid-template-columns:1fr minmax(300px,340px);gap:18px;padding-left:20px;padding-right:20px}
}
@media (max-width:1080px){
  .nav{display:none}
}
@media (max-width:767px){
  /* Show the collapsible running summary on phones — except swingbeds / visual-only,
     where the 3D viewer takes that space and a final summary can cover the rest. */
  .m-summary{display:block;flex:0 0 auto;min-width:0}
  .m-summary[hidden]{display:none!important}
  .cushion-designer-app.cd-swing .m-summary,
  .cushion-designer-app.cd-visual-only .m-summary{display:none!important}
  .cushion-designer-app.cd-swing .m-summary,
  .cushion-designer-app.cd-visual-only .m-summary{display:none!important}
  /* Bottom nav height — used to float the stripe-direction toast above Next. */
  .config{--cd-mnav-h:52px}
  .fabric-dir-toast{
    bottom:calc(var(--cd-mnav-h) + max(7px, env(safe-area-inset-bottom)) + 10px);
    transform:translateX(-50%);
  }
  /* ---- Fixed app-shell: pinned preview + bottom control row, options scroll ----
     The whole designer fills the viewport below the site header; the 3D preview
     stays at the top, Back/step/price/Next sit on a bottom bar, and only
     .step-body scrolls. Mirrors desktop so the 3D is always glanceable. */
  .cushion-designer-app{height:calc(100dvh - var(--cd-top,0px));display:flex;flex-direction:column;overflow:hidden}
  /* min-width:0 on every link of the flex chain lets children shrink to the
     viewport instead of overflowing to their (wider) intrinsic content width. */
  .main{flex:1 1 auto;min-height:0;min-width:0;display:flex;flex-direction:column;align-items:stretch;overflow:hidden;padding:0;gap:0;max-width:none}
  .config{flex:1 1 auto;min-height:0;min-width:0;display:flex;flex-direction:column;border:none;border-radius:0;box-shadow:none;background:transparent}
  /* Compact pinned 3D preview: visible at the top of every step but only ~140px
     tall. Expanding grows the rail downward in-flow so the nav bar stays directly
     beneath the mockup (never jumps above it). */
  .rail{
    flex:0 0 auto;order:-1;min-width:0;border:none;border-radius:0;box-shadow:none;
    display:flex;flex-direction:column;
    height:140px;overflow:hidden;
    transition:height .42s cubic-bezier(.4,0,.2,1);
  }
  /* Swing beds: taller viewer (summary bar removed) so the frame fills the pane. */
  .cushion-designer-app.cd-swing .rail{height:min(42dvh, 320px)}
  .cushion-designer-app.cd-swing .step-body{padding:14px 16px 18px}
  .cushion-designer-app.cd-swing .step-body .step-head h2{font-size:22px;margin-bottom:4px}
  .cushion-designer-app.cd-swing .step-body .step-head p{font-size:13px;margin-bottom:12px}
  .cushion-designer-app.cd-swing .grid.types{
    grid-template-columns:minmax(0, 220px);
    justify-content:start;
    gap:10px;
  }
  .cushion-designer-app.cd-swing .grid.types .card{padding:6px 8px 10px}
  .cushion-designer-app.cd-swing .grid.types .card .ill{aspect-ratio:16/10;margin-bottom:4px}
  .cushion-designer-app.cd-swing .grid.types .card .name{font-size:13px;min-height:1.4em}
  .preview{
    flex:1 1 auto;min-height:0;height:100%;
    padding:8px 14px;overflow:hidden;
    transition:padding .42s cubic-bezier(.4,0,.2,1), box-shadow .42s cubic-bezier(.4,0,.2,1);
  }
  .preview .floor{display:none}
  .stage{max-width:150px;transition:max-width .42s cubic-bezier(.4,0,.2,1)}
  .preview .badge{font-size:10px;padding:4px 9px;top:8px;left:8px}
  .drag-hint{display:none}
  .preview .pv-btn{font-size:12px;padding:7px 11px}
  .pv-btn.labels{bottom:8px;right:8px}
  .pv-btn.expand{display:inline-flex;bottom:8px;left:8px}
  /* Swing beds: taller pinned preview + tighter option cards so the bed reads
     as the hero on phones instead of a postage stamp above a giant type card. */
  .cushion-designer-app.cd-swing .rail{height:232px}
  .cushion-designer-app.cd-swing .preview{padding:6px 10px}
  .cushion-designer-app.cd-swing .step-body{padding:14px 16px 18px}
  .cushion-designer-app.cd-swing .head{margin-bottom:10px}
  .cushion-designer-app.cd-swing .head h2{font-size:18px;margin:0 0 4px}
  .cushion-designer-app.cd-swing .head p{font-size:13px;margin:0}
  .cushion-designer-app.cd-swing .grid.types{
    grid-template-columns:minmax(0,280px);
    justify-content:center;
    gap:10px;
  }
  .cushion-designer-app.cd-swing .grid.types .card{padding:6px 8px 10px}
  .cushion-designer-app.cd-swing .grid.types .card .ill{aspect-ratio:16/9;margin-bottom:4px}
  .cushion-designer-app.cd-swing .grid.types .card .name{font-size:13px;min-height:1.4em}
  .cushion-designer-app.cd-swing .swatches.cpros-frame-finishes{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:8px;
  }
  .cushion-designer-app.preview-expanded .rail{
    /* Height only — do NOT snap flex-basis to 75dvh (that jumps the layout open). */
    height:75dvh;max-height:75dvh;
  }
  .cushion-designer-app.preview-expanded .preview{
    position:relative;left:auto;right:auto;top:auto;bottom:auto;
    height:100%;min-height:0;max-height:none;z-index:auto;
    padding:8px 12px 12px;
    border-bottom:1px solid var(--line-2);
    box-shadow:0 8px 28px -8px rgba(40,55,35,.18);
  }
  .cushion-designer-app.preview-expanded .stage{max-width:min(92vw,480px)}
  .cushion-designer-app.preview-expanded .pv-btn.expand{bottom:max(12px,env(safe-area-inset-bottom));left:12px}
  .cushion-designer-app.preview-expanded .pv-btn.labels{bottom:max(12px,env(safe-area-inset-bottom));right:12px}
  @media (prefers-reduced-motion:reduce){
    .rail,.preview,.stage{transition:none}
  }

  /* Pinned control row: thumb-reachable bar at the bottom of the shell. */
  .config-head{
    order:10;margin-top:auto;
    position:relative;overflow:visible;
    flex:0 0 auto;min-width:0;align-items:center;gap:8px;
    padding:7px 12px max(7px, env(safe-area-inset-bottom));
    background:var(--surface-2);border-top:1px solid var(--line-2);border-bottom:none;
    box-shadow:0 -6px 18px -10px rgba(40,55,35,.14);
  }
  /* Step picker opens upward so it stays on screen above the bottom bar. */
  .config-head .step-menu{top:auto;bottom:calc(100% + 6px)}
  .config-head .stepper{padding:4px 0;background:transparent;border:none;border-radius:0;overflow:visible}
  /* Pill shrink-wraps so "1/7 · Type ▾" stays grouped — not stretched toward Next. */
  .config-head .stepper.mobile-stepper{display:flex;align-items:center;justify-content:flex-start}
  .step-pill{flex:0 1 auto;min-width:0;max-width:100%;gap:6px;padding:7px 10px 7px 12px}
  .step-pill-name{flex:none}
  .step-pill-go-txt{display:none}
  .step-pill-go{
    padding:0;margin-left:1px;gap:0;
    background:transparent;border:none;border-radius:0;
  }
  .step-pill-caret{font-size:13px;font-weight:800;color:var(--muted)}
  .step-pill[aria-expanded="true"] .step-pill-caret{color:var(--green-2);transform:rotate(180deg)}
  .cd-mback{display:flex;flex:0 0 auto;width:34px;height:38px;padding:0;justify-content:center;font-size:20px;border-radius:10px}
  .cd-mback:disabled{opacity:.35}
  .config-head .top-actions{display:flex;flex:0 0 auto;align-items:center;gap:8px;margin-left:auto}
  .top-actions .mprice{display:flex;flex-direction:column;line-height:1;text-align:right}
  .top-actions .mprice #mPriceVal{font-size:16px;font-weight:800;color:var(--ink)}
  .top-actions .mprice small{display:none}
  .top-actions #mNextBtn{padding:10px 14px;font-size:14px;white-space:nowrap;margin-left:0}
  /* Inactive: muted white chip. Active (step complete): green + white text. */
  .top-actions #mNextBtn.btn.primary.is-disabled{
    background:#fff;color:var(--muted);border:1.5px solid var(--line);
    opacity:1;box-shadow:none;filter:none;transform:none;
  }
  .top-actions #mNextBtn.btn.primary:not(.is-disabled){
    background:linear-gradient(180deg,var(--green),var(--green-2));color:#fff;border:none;
    box-shadow:0 8px 18px -10px rgba(76,116,36,.85);
  }
  .top-actions #mNextBtn.btn.primary:not(.is-disabled):hover{filter:brightness(1.04)}

  /* Only this region scrolls (safe-area handled by the bottom control row). */
  .step-body{flex:1 1 auto;min-height:0;min-width:0;overflow-y:auto;-webkit-overflow-scrolling:touch;
    padding:16px 14px 20px;scrollbar-width:thin}
  /* Fabric/cording: less top pad so the sticky filter bar sits closer to the summary. */
  .step-body:has(.fabric-bar){padding-top:8px}
  .step-head:has(+ .fabric-bar) p{margin-bottom:8px}
  .step-head h2{font-size:20px}
  .step-head p{font-size:13px;margin:6px 0 14px;line-height:1.5}

  .shape-block[data-shape-section="corners"] .subhead{margin-bottom:6px}
  .shape-block[data-shape-section="corners"] .seg{margin-bottom:12px}

  .summary{display:none}
  .footer{display:none}
  .lead-pill{display:none}
  /* Dot stepper replaced by step pill + menu on compact layouts (see .mobile-stepper). */
}
@media (max-width:560px){
  .grid.types{grid-template-columns:repeat(2,1fr);gap:10px}
  .grid.shapes{grid-template-columns:repeat(2,1fr);gap:10px}
  .grid.types .card,.grid.shapes .card{padding:8px 6px}
  .grid.types .card .ill{max-width:100%;padding:0;margin-bottom:5px}
  .grid.shapes .card .ill{height:72px;margin-bottom:6px}
  .grid.types .card .name,.grid.shapes .card .name{font-size:12px;line-height:1.25}
  .shape-svg{max-width:96px}
  /* minmax(0,1fr) — grid items default to min-width:auto and the picker+unit
     row was wider than half the phone, clipping Width off-screen. */
  .dims,.dims.four{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-width:100%}
  .dim{padding:10px;min-width:0}
  .dim .field{gap:6px}
  .dim .unit{font-size:11px}
  .dim-picker-input{font-size:17px;padding:8px 8px}
  .dim-picker-btn{flex:0 0 32px;width:32px;min-width:32px}
  .grid.fillings,.grid.two{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
}

/* ---------- Landscape phones (short, wide viewports) ----------
   A rotated phone is ~852–932 wide × ~360–430 tall, so it is WIDER than the 767px
   portrait breakpoint and would otherwise fall back to the desktop layout crammed
   into ~400px of height (option cards become slivers, the summary eats half the
   width). Instead use a 2-pane shell: the 3D preview fills the LEFT, and the RIGHT
   pane is the pinned control row (stepper + price + Next) over the scrolling
   options. Targeted by short height so tablets and desktops are unaffected. This
   block is placed after the desktop rules so it wins at these dimensions. */
@media (max-height:480px) and (min-width:600px){
  .cushion-designer-app{height:calc(100dvh - var(--cd-top,0px));display:flex;flex-direction:column;overflow:hidden}
  .main{flex:1 1 auto;min-height:0;min-width:0;display:flex;flex-direction:row;align-items:stretch;gap:0;padding:0;max-width:none;overflow:hidden}

  /* Left pane: big 3D preview, full height. */
  .rail{order:-1;flex:0 0 40%;min-width:0;height:100%;display:flex;flex-direction:column;border:none;border-radius:0;box-shadow:none}
  .preview{flex:1 1 auto;min-height:0;height:auto;border-radius:0;padding:10px}
  .stage{max-width:62%}
  .summary{display:none}
  .preview .badge{top:10px;left:10px;font-size:10px}
  .drag-hint{display:none}
  .preview .pv-btn{font-size:12px;padding:7px 11px}
  .pv-btn.expand{display:inline-flex;bottom:10px;left:10px}
  .pv-btn.labels{bottom:10px;right:10px}
  .cushion-designer-app.preview-expanded .rail{flex:0 0 40%;min-width:40%;height:100%}
  .cushion-designer-app.preview-expanded .step-body{overflow:hidden}

  /* Right pane: pinned control row + scrolling options. */
  .config{flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column;border:none;border-radius:0;box-shadow:none;background:transparent}
  .footer{display:none}
  .config-head{flex:0 0 auto;min-width:0;display:flex;align-items:center;gap:8px;padding:6px 12px;
    background:var(--surface-2);border-bottom:1px solid var(--line-2)}
  .config-head .stepper{padding:4px 0;background:transparent;border:none;border-radius:0;overflow:visible}
  .config-head .stepper:not(.mobile-stepper){overflow-x:auto}
  .cd-mback{display:flex;flex:0 0 auto;width:34px;height:36px;padding:0;justify-content:center;font-size:20px;border-radius:10px}
  .cd-mback:disabled{opacity:.35}
  .config-head .top-actions{display:flex;flex:0 0 auto;align-items:center;gap:8px;margin-left:auto}
  .top-actions .mprice{display:flex;flex-direction:column;line-height:1;text-align:right}
  .top-actions .mprice #mPriceVal{font-size:15px;font-weight:800;color:var(--ink)}
  .top-actions .mprice small{display:none}
  .top-actions #mNextBtn{padding:9px 14px;font-size:14px;white-space:nowrap;margin-left:0}
  .top-actions #mNextBtn.btn.primary.is-disabled{
    background:#fff;color:var(--muted);border:1.5px solid var(--line);
    opacity:1;box-shadow:none;filter:none;transform:none;
  }
  .top-actions #mNextBtn.btn.primary:not(.is-disabled){
    background:linear-gradient(180deg,var(--green),var(--green-2));color:#fff;border:none;
    box-shadow:0 8px 18px -10px rgba(76,116,36,.85);
  }

  .m-summary{display:block;flex:0 0 auto;min-width:0}
  .m-summary[hidden]{display:none!important}
  .cushion-designer-app.cd-swing .m-summary,
  .cushion-designer-app.cd-visual-only .m-summary{display:none!important}
  .fabric-dir-toast{bottom:max(10px, env(safe-area-inset-bottom))}

  /* Only the options scroll. */
  .step-body{flex:1 1 auto;min-height:0;min-width:0;overflow-y:auto;-webkit-overflow-scrolling:touch;
    padding:12px 16px 18px;scrollbar-width:thin}
  .step-body:has(.fabric-bar){padding-top:8px}
  .step-head:has(+ .fabric-bar) p{margin-bottom:6px}
  .step-head{margin:0}
  .step-head h2{font-size:17px}
  .step-head p{font-size:12px;margin:4px 0 10px;line-height:1.45}

  /* Compact cards so a couple of rows show before scrolling. */
  .grid{gap:10px}
  .grid.types{grid-template-columns:repeat(2,1fr);gap:10px}
  .grid.types .card .ill{padding:0;margin-bottom:6px}
  .grid.shapes{grid-template-columns:repeat(auto-fill,minmax(104px,1fr))}
  .grid.shapes .card .ill{height:64px;margin-bottom:6px}
  .grid.two,.grid.fillings{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
  .grid.two .card .ill{height:72px;margin-bottom:6px}
  .grid.two .card .desc{font-size:11px;line-height:1.35;margin-top:4px;min-height:2.7em}
  .grid.two .card .name{min-height:2.5em}
  .dims,.dims.four{grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px}
  .card{padding:10px}
  .card .name{font-size:12.5px;line-height:1.25}
  /* Keep filling thumbnails compact on phones (bigger on laptop/desktop). */
  .fill-row .fill-ill,.addon .addon-ill{width:64px;height:64px}

  /* Quantity (last step): footer is hidden here, so surface the in-step block. */
  .qty-block{display:flex;margin-top:12px}

  /* Fastener diagram: slightly inset on phones so labels/dims don't clip. */
  .placement{margin-top:12px;padding-top:12px}
  .placement-head p{margin-bottom:8px}
  .placement-stage{
    padding:6px 10px;margin-left:0;margin-right:0;overflow:hidden;
  }
  .placement-svg{width:90%;max-width:min(440px,90%);max-height:132px;margin:0 auto}
  .placement-multi .placement-svg{max-width:min(400px,88%);max-height:108px}
  /* Chaise: fill the container so the end circles sit near the edges. */
  .placement-chaise .placement-stage{padding:8px 4px}
  .placement-chaise .placement-svg{width:100%;max-width:100%;max-height:230px}
  .placement-hint{margin-top:8px;font-size:11px}
  .placement-panel{margin-top:10px}
  .placement-cap{text-align:center;margin-bottom:3px}
}

/* ---------- Short desktop / laptop windows ----------
   A half-height browser window or a low-resolution screen leaves the fixed-height
   desktop shell (height:100dvh − header) too little room: the step body collapses
   to a tiny internal scroll and the option cards + dimension dropdowns get clipped.
   Above the landscape-phone breakpoint (min-height:481px) but below a comfortable
   height, release the viewport-height lock so the whole designer flows at its
   natural height and the page scrolls normally — nothing gets clipped. */
@media (min-width:768px) and (min-height:481px) and (max-height:600px){
  .cushion-designer-app{height:auto;min-height:0;overflow:visible}
  .cushion-designer-app > .main{overflow:visible}
  .main{overflow:visible}
  .config{height:auto;min-height:0}
  .rail{height:auto}
  .step-body{overflow:visible}
}

/* SEO body copy below the designer (outside the app shell) + accessible swatch photos */
.cd-seo-content{padding:0;border-top:1px solid var(--line);background:var(--surface-2)}
.cd-seo-details summary{
  padding:10px 28px;font-size:13px;font-weight:600;color:var(--muted);cursor:pointer;list-style:none;user-select:none
}
.cd-seo-details summary::-webkit-details-marker{display:none}
.cd-seo-details[open] summary{border-bottom:1px solid var(--line-2);color:var(--ink-soft)}
.cd-seo-inner{padding:14px 28px 20px}
.cd-seo-content h2{font-family:var(--serif);font-size:17px;font-weight:540;margin:0 0 8px;color:var(--ink)}
.cd-seo-content p{margin:0;color:var(--ink-soft);line-height:1.55;font-size:14px;max-width:720px}
@media (max-width:767px){
  /* Keep copy in the DOM for crawlers; remove from the designer viewport. */
  .cd-seo-content{
    position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
    clip:rect(0,0,0,0);white-space:nowrap;border:0
  }
}
.sw .sw-photo,.sw .sw-fill{width:100%;height:100%;object-fit:cover;display:block}
.sw .sw-fill{border-radius:inherit}

/* Swatch add-to-cart toast (matches fabric library page). */
.fab-toast-stack{
  position:fixed;top:84px;right:20px;z-index:100050;display:flex;flex-direction:column;gap:10px;
  max-width:min(360px,calc(100vw - 32px));pointer-events:none;
}
.fab-toast{
  display:flex;align-items:flex-start;gap:12px;padding:14px 16px;
  background:var(--surface,#fffdf8);border:1px solid var(--line,#e6dcc8);
  border-radius:16px;box-shadow:var(--shadow-sm,0 14px 30px -18px rgba(44,41,34,.34));
  pointer-events:auto;opacity:0;transform:translateX(16px);transition:opacity .22s ease,transform .22s ease;
}
.fab-toast.in{opacity:1;transform:none}
.fab-toast.out{opacity:0;transform:translateX(12px)}
.fab-toast-icon{
  flex:none;width:28px;height:28px;border-radius:50%;background:var(--green-soft,#edefe1);
  color:var(--green-2,#5d6740);display:grid;place-items:center;font-size:14px;font-weight:900;
}
.fab-toast-body{flex:1;min-width:0}
.fab-toast-title{font-size:14px;font-weight:800;color:var(--ink,#2c2922);line-height:1.35}
.fab-toast-sub{font-size:13px;color:var(--muted,#938b79);font-weight:600;margin-top:2px}
.fab-toast-link{
  display:inline-block;margin-top:8px;font-size:13px;font-weight:700;color:var(--green-2,#5d8a2f);
}
.fab-toast-link:hover{text-decoration:underline}
.fab-toast-x{
  flex:none;width:28px;height:28px;border-radius:8px;background:transparent;
  color:var(--muted,#938b79);font-size:20px;line-height:1;cursor:pointer;
}
.fab-toast-x:hover{background:var(--surface-2,#f8f1e5);color:var(--ink,#2c2922)}
.swatch-cta .btn.added,.fd-swatch.added{border-color:var(--green);color:var(--green-2);background:var(--green-soft)}
@media (max-width:760px){
  .fab-toast-stack{top:72px;right:12px;left:12px;max-width:none}
}

/* ---------- Custom template step (Custom Template type only) ---------- */
.custom-template-step{padding:0 2px 8px}
.custom-template-step .step-head{margin-bottom:12px}
.custom-template-step__body{
  font-size:14px;line-height:1.55;color:var(--ink-soft,#5c5749);
}
.custom-template-step__body p{margin:0 0 14px}
.custom-template-step__body h3{
  margin:22px 0 10px;font-size:15px;font-weight:700;color:var(--ink,#2c2922);
}
.custom-template-step__body h3 em{font-style:italic;font-weight:600}
.custom-template-step__body ul,
.custom-template-step__body ol{margin:0 0 14px;padding-left:22px}
.custom-template-step__body li{margin:0 0 6px}
.custom-template-step__accent{color:var(--green-2,#5d6740)}
.custom-template-step__italic{font-style:italic}
.custom-template-step__spaced{margin:16px 0!important}
.custom-template-step__mail{
  margin-top:20px!important;padding:14px 16px;
  background:var(--surface-2,#f8f1e5);border:1px solid var(--line,#e6dcc8);
  border-radius:var(--radius-sm,13px);font-weight:600;color:var(--ink,#2c2922);
}
.shapes--custom-only{max-width:220px}

/* Custom Template "what are you building" free-text on the Shape step. */
.custom-build-desc{margin-top:22px;max-width:540px}
.custom-build-desc__label{
  display:block;font-weight:700;font-size:15px;color:var(--ink,#2c2922);margin-bottom:4px;
}
.custom-build-desc__opt{font-weight:500;color:var(--muted,#938b79);font-size:13px}
.custom-build-desc__hint{margin:0 0 10px;font-size:13px;line-height:1.5;color:var(--muted,#938b79)}
.custom-build-desc__input{
  width:100%;box-sizing:border-box;resize:vertical;min-height:78px;
  padding:12px 14px;font:inherit;font-size:15px;color:var(--ink,#2c2922);
  background:var(--card,#fff);border:1px solid var(--line,#e6dcc8);border-radius:var(--radius-sm,13px);
}
.custom-build-desc__input::placeholder{color:#b3ab97}
.custom-build-desc__input:focus{
  outline:none;border-color:var(--green-soft-2,#aebd8e);
  box-shadow:0 0 0 3px var(--green-soft,#eef2e3);
}
