/*
 * Custom wallpaper page (/custom-wallpaper).
 *
 * Translated from the approved MagicPath master (docs/design/custom-wallpaper-magicpath, Tailwind 4) and
 * docs/design/custom-wallpaper-design-system.md. Tokens live on .cw-page; every selector is prefixed .cw-page so
 * nothing reaches the site header, footer or other pages. Breakpoints: 640, 768, 1024, 1280.
 * Minimum text is 13px. Focus is always visible. Motion respects prefers-reduced-motion.
 */

/* ---- Fonts, self-hosted ---------------------------------------------------- */

@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/playfair-display/playfair-display-500.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/playfair-display/playfair-display-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/inter/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter/inter-600.woff2") format("woff2"); }

/* ---- Tokens ---------------------------------------------------------------- */

.cw-page {
    --cw-ink: #191919;
    --cw-ink-soft: #3f3f3a;
    --cw-muted: #6b6862;
    --cw-paper: #fbfaf7;
    --cw-sand: #f4f1e9;
    --cw-line: #e4e1d8;
    --cw-accent: #6fd39a;
    --cw-accent-deep: #1f7a4d;
    --cw-good: #1f7a4d;
    --cw-warn: #8a5a00;
    --cw-bad: #b3261e;
    --cw-radius: 6px;
    --cw-radius-lg: 10px;
    --cw-shadow: 0 20px 70px rgba(51, 46, 33, .09);
    --cw-serif: "Playfair Display", Georgia, "Times New Roman", serif;
    --cw-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

    display: block;
    width: 100%;
    min-width: 0;
    background: var(--cw-paper);
    color: var(--cw-ink);
    font-family: var(--cw-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: clip;
}

/* ---- Scoped reset ---------------------------------------------------------- */

.cw-page *,
.cw-page *::before,
.cw-page *::after { box-sizing: border-box; }

.cw-page h1, .cw-page h2, .cw-page h3, .cw-page p, .cw-page ul, .cw-page ol, .cw-page dl, .cw-page dd,
.cw-page figure, .cw-page fieldset, .cw-page legend { margin: 0; padding: 0; }
.cw-page ul, .cw-page ol { list-style: none; }
.cw-page fieldset { border: 0; min-width: 0; }
.cw-page img, .cw-page svg { display: block; max-width: 100%; }
.cw-page img { height: auto; }
.cw-page button, .cw-page input, .cw-page select, .cw-page textarea { font: inherit; color: inherit; margin: 0; }
.cw-page button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
.cw-page a { color: inherit; text-decoration: none; }
.cw-page summary { cursor: pointer; }

.cw-page :focus-visible { outline: 2px solid var(--cw-accent-deep); outline-offset: 2px; }
.cw-page .cw-dark :focus-visible { outline-color: var(--cw-accent); }

.cw-page .cw-sr {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Layout ---------------------------------------------------------------- */

.cw-page .cw-wrap { width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: 16px; }
.cw-page .cw-section { padding-block: 72px; }
.cw-page .cw-alt { background: var(--cw-sand); }
.cw-page .cw-dark { background: var(--cw-ink); color: #fff; }
.cw-page .cw-head { max-width: 760px; }
.cw-page .cw-head > p { margin-top: 16px; }
.cw-page .cw-after { margin-top: 24px; }
.cw-page .cw-grow { flex: 1; }
.cw-page .cw-block { width: 100%; }

.cw-page .cw-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center; }

@media (min-width: 640px) {
    .cw-page .cw-wrap { padding-inline: 32px; }
}

@media (min-width: 1024px) {
    .cw-page .cw-section { padding-block: 112px; }
    .cw-page .cw-split { gap: 80px; }
    .cw-page .cw-split-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cw-page .cw-split-5-7 { grid-template-columns: 5fr 7fr; }
    .cw-page .cw-split-7-5 { grid-template-columns: 7fr 5fr; }
    .cw-page .cw-split-4-8 { grid-template-columns: 4fr 8fr; align-items: start; }
}

/* ---- Type ------------------------------------------------------------------ */

.cw-page .cw-display,
.cw-page .cw-h2,
.cw-page .cw-h3 { font-family: var(--cw-serif); letter-spacing: -.01em; color: inherit; }
.cw-page .cw-display { font-size: clamp(40px, 6vw, 76px); font-weight: 500; line-height: 1.04; }
.cw-page .cw-h2 { font-size: clamp(28px, 3.4vw, 44px); font-weight: 500; line-height: 1.14; }
.cw-page .cw-h3 { font-size: 20px; font-weight: 600; line-height: 1.3; }
.cw-page .cw-eyebrow {
    font-family: var(--cw-sans); font-size: 13px; font-weight: 600; line-height: 1.4;
    letter-spacing: .14em; text-transform: uppercase; color: var(--cw-accent-deep);
}
.cw-page .cw-dark .cw-eyebrow { color: var(--cw-accent); }
.cw-page .cw-lede { color: var(--cw-ink-soft); }
.cw-page .cw-small { font-size: 14px; line-height: 1.5; }
.cw-page .cw-note { font-size: 13px; line-height: 1.45; color: var(--cw-muted); }
.cw-page .cw-muted { color: var(--cw-muted); }
.cw-page .cw-strong { font-weight: 600; }
.cw-page .cw-warn { color: var(--cw-warn); }
.cw-page .cw-good { color: var(--cw-good); }
.cw-page .cw-dark .cw-lede,
.cw-page .cw-dark .cw-note { color: rgba(255, 255, 255, .78); }

/* ---- Controls -------------------------------------------------------------- */

.cw-page .cw-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 10px 24px; border: 1px solid var(--cw-ink); border-radius: var(--cw-radius);
    font-size: 15px; font-weight: 500; line-height: 1.3; text-align: center; cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.cw-page .cw-btn-primary { background: var(--cw-ink); color: #fff; }
.cw-page .cw-btn-primary:hover:not(:disabled) { background: var(--cw-ink-soft); border-color: var(--cw-ink-soft); }
.cw-page .cw-btn-secondary { background: transparent; color: var(--cw-ink); }
.cw-page .cw-btn-secondary:hover:not(:disabled) { background: var(--cw-ink); color: #fff; }
.cw-page .cw-btn:disabled { cursor: not-allowed; background: var(--cw-line); border-color: var(--cw-line); color: var(--cw-muted); }
.cw-page .cw-btn[aria-busy="true"] { cursor: progress; }
.cw-page .cw-dark .cw-btn-primary { background: #fff; border-color: #fff; color: var(--cw-ink); }
.cw-page .cw-dark .cw-btn-primary:hover { background: var(--cw-sand); border-color: var(--cw-sand); }
.cw-page .cw-btn-outline { background: transparent; border-color: #fff; color: #fff; }
.cw-page .cw-btn-outline:hover { background: #fff; color: var(--cw-ink); }

.cw-page .cw-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
@media (min-width: 640px) {
    .cw-page .cw-actions { flex-direction: row; }
}

.cw-page .cw-link {
    font-size: 14px; font-weight: 500; color: var(--cw-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.cw-page .cw-link:hover { color: var(--cw-accent-deep); }
.cw-page .cw-link:disabled { color: var(--cw-muted); cursor: not-allowed; text-decoration: none; }

.cw-page .cw-iconbtn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; min-height: 40px; padding-inline: 8px;
    border: 1px solid var(--cw-line); border-radius: var(--cw-radius); background: var(--cw-paper); color: var(--cw-ink); font-size: 14px;
    transition: background-color 160ms ease, border-color 160ms ease;
}
.cw-page .cw-iconbtn-text { padding-inline: 12px; }
.cw-page .cw-iconbtn:hover:not(:disabled) { border-color: var(--cw-ink); }
.cw-page .cw-iconbtn:disabled { color: var(--cw-muted); cursor: not-allowed; }
.cw-page .cw-iconbtn[aria-pressed="true"] { background: var(--cw-ink); border-color: var(--cw-ink); color: #fff; }

.cw-page .cw-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--cw-sand); border-radius: var(--cw-radius); max-width: 100%; overflow-x: auto; }
.cw-page .cw-seg-full { display: flex; width: 100%; }
.cw-page .cw-seg-full > button { flex: 1; }
.cw-page .cw-seg button {
    min-height: 38px; padding-inline: 14px; border-radius: 4px; font-size: 14px; font-weight: 500; color: var(--cw-muted); white-space: nowrap; text-align: center;
    transition: background-color 160ms ease, color 160ms ease;
}
.cw-page .cw-seg button[aria-pressed="true"],
.cw-page .cw-seg button[aria-selected="true"] { background: #fff; color: var(--cw-ink); box-shadow: inset 0 0 0 1px var(--cw-ink); }
.cw-page .cw-seg button:disabled { cursor: not-allowed; }

.cw-page .cw-field {
    width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #8f8b80; border-radius: var(--cw-radius);
    background: #fff; color: var(--cw-ink); font-size: 16px; line-height: 1.3;
}
.cw-page .cw-field:hover { border-color: var(--cw-ink); }
.cw-page .cw-field[aria-invalid="true"] { border-color: var(--cw-bad); }
.cw-page .cw-field-sm { min-height: 44px; padding-block: 6px; font-size: 14px; width: auto; }
.cw-page .cw-error { margin-top: 4px; font-size: 13px; line-height: 1.4; color: var(--cw-bad); }

.cw-page .cw-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.5; cursor: pointer; }
.cw-page .cw-check input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--cw-ink); }
.cw-page .cw-range { width: 100%; height: 32px; accent-color: var(--cw-ink); }
.cw-page .cw-spread { display: flex; justify-content: space-between; }

.cw-page .cw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.cw-page .cw-chip {
    min-height: 40px; padding-inline: 18px; border: 1px solid var(--cw-line); border-radius: 999px; background: transparent;
    font-size: 14px; font-weight: 500; white-space: nowrap; text-align: center;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.cw-page .cw-chip:hover:not(:disabled) { border-color: var(--cw-ink); }
.cw-page .cw-chip[aria-pressed="true"] { background: var(--cw-ink); border-color: var(--cw-ink); color: #fff; }
.cw-page .cw-chip:disabled { cursor: default; }

.cw-page .cw-tag {
    position: absolute; left: 12px; bottom: 12px; z-index: 5; padding: 3px 8px; border-radius: 4px;
    background: var(--cw-ink); color: #fff; font-size: 13px; line-height: 1.4;
}

.cw-page .cw-notice {
    margin-top: 24px; padding: 16px 20px; border: 1px solid var(--cw-ink); border-radius: var(--cw-radius); background: #fff;
    display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between;
}

/* ---- Hero ------------------------------------------------------------------ */

.cw-page .cw-crumbs { padding-top: 8px; }
.cw-page .cw-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 24px; padding-bottom: 32px; }
.cw-page .cw-hero-grid .cw-display { margin-top: 16px; }
.cw-page .cw-hero-media { position: relative; }
.cw-page .cw-hero-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 55%; }
.cw-page .cw-trust { display: flex; flex-direction: column; gap: 4px 40px; padding-block: 20px; }
.cw-page .cw-trust li { display: flex; align-items: center; gap: 8px; }
.cw-page .cw-trust li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cw-accent); flex: none; }

@media (min-width: 640px) {
    .cw-page .cw-hero-media img { aspect-ratio: 16 / 8; }
    .cw-page .cw-trust { flex-direction: row; flex-wrap: wrap; }
}
@media (min-width: 1024px) {
    .cw-page .cw-hero-grid { grid-template-columns: 7fr 5fr; gap: 48px; align-items: end; padding-top: 40px; padding-bottom: 48px; }
    .cw-page .cw-hero-media img { aspect-ratio: 21 / 8; }
}

/* ---- Configurator ---------------------------------------------------------- */

.cw-page .cw-config-section { border-top: 1px solid var(--cw-line); padding-bottom: 112px; scroll-margin-top: 16px; }
.cw-page #gallery, .cw-page #cw-configure { scroll-margin-top: 16px; }
.cw-page .cw-config { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 32px; align-items: start; }
.cw-page .cw-preview { min-width: 0; }

.cw-page .cw-walltabs { margin-bottom: 12px; }
.cw-page .cw-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.cw-page .cw-zoom { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.cw-page .cw-zoom .cw-iconbtn { width: 40px; }
.cw-page .cw-zoom .cw-iconbtn-text { width: auto; }
.cw-page .cw-zoom-val { width: 50px; text-align: center; font-variant-numeric: tabular-nums; }

.cw-page .cw-stage {
    position: relative; height: 72vw; background: var(--cw-sand); border-radius: var(--cw-radius-lg); overflow: hidden;
}
.cw-page .cw-stage[data-view="room"] { height: auto; aspect-ratio: 1376 / 768; }
.cw-page .cw-stage-wall { position: absolute; inset: 0; }
.cw-page .cw-stage[data-view="room"] .cw-stage-wall { display: none; }
.cw-page .cw-stage-room { position: absolute; inset: 0; }
.cw-page .cw-stage-room img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cw-page .cw-stage-room img[data-cw="room-overlay"] { pointer-events: none; }
.cw-page .cw-room-slot { position: absolute; inset: 0; }
.cw-page .cw-stage-empty {
    position: absolute; inset: 24px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--cw-muted);
    border: 1px dashed var(--cw-muted); background: var(--cw-paper); padding: 16px; pointer-events: none;
}
.cw-page .cw-stage-wall canvas { position: absolute; display: block; touch-action: none; cursor: grab; }

/* Preview art: the canvas plus the finish overlay. It moves between the wall stage and the room slot. */
.cw-page .cw-art { position: absolute; box-shadow: 0 1px 3px rgba(25, 25, 25, .18); }
.cw-page .cw-art canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; }
.cw-page .cw-art canvas:active { cursor: grabbing; }
.cw-page .cw-art canvas:focus-visible { outline: 2px solid var(--cw-accent-deep); outline-offset: -3px; }
.cw-page .cw-finish { position: absolute; inset: 0; pointer-events: none; background-size: 320px 320px; mix-blend-mode: multiply; opacity: .9; }
.cw-page .cw-finish[data-effect="textured"] { background-size: 200px 200px; opacity: 1; }
.cw-page .cw-finish[data-effect="satin"],
.cw-page .cw-finish[data-effect="gloss"] { background-size: 100% 100%; mix-blend-mode: soft-light; opacity: .7; }
.cw-page .cw-dim { position: absolute; display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1; color: var(--cw-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cw-page .cw-dim span { font-weight: 500; }
.cw-page .cw-dim i { flex: 1; border-top: 1px solid rgba(25, 25, 25, .5); }
.cw-page .cw-dim-h { flex-direction: column; }
.cw-page .cw-dim-h span { writing-mode: vertical-rl; transform: rotate(180deg); }
.cw-page .cw-dim-h i { border-top: 0; border-left: 1px solid rgba(25, 25, 25, .5); }
.cw-page .cw-bad { color: var(--cw-bad); }
.cw-page .cw-wall.is-active { border-left: 2px solid var(--cw-ink); padding-left: 12px; }

.cw-page .cw-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin-top: 16px; font-size: 14px; line-height: 1.5; }
.cw-page .cw-sum dt { color: var(--cw-muted); }
.cw-page .cw-sum dd { font-weight: 600; overflow-wrap: anywhere; }

/* Step panel */
.cw-page .cw-panel { background: #fff; border: 1px solid var(--cw-line); border-radius: var(--cw-radius); min-width: 0; }
.cw-page .cw-step { border-bottom: 1px solid var(--cw-line); }
.cw-page .cw-step > summary {
    display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 16px; list-style: none;
    color: var(--cw-ink); /* style.css sets summary to red site-wide */
}
.cw-page .cw-step > summary::-webkit-details-marker { display: none; }
.cw-page .cw-step-num {
    display: inline-flex; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px;
    border: 1px solid var(--cw-ink); border-radius: 50%; font-size: 13px; font-weight: 600;
}
.cw-page .cw-step-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cw-page .cw-step-name { font-weight: 500; line-height: 1.3; }
.cw-page .cw-step-title .cw-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-page .cw-step-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 4px 16px 20px; }

.cw-page .cw-plus { position: relative; flex: none; width: 18px; height: 18px; transition: transform 160ms ease; }
.cw-page .cw-plus::before,
.cw-page .cw-plus::after { content: ""; position: absolute; left: 50%; top: 50%; background: currentColor; border-radius: 1px; }
.cw-page .cw-plus::before { width: 14px; height: 1.7px; transform: translate(-50%, -50%); }
.cw-page .cw-plus::after { width: 1.7px; height: 14px; transform: translate(-50%, -50%); }
.cw-page details[open] > summary .cw-plus { transform: rotate(45deg); }

.cw-page .cw-panel-foot { padding: 16px; border-top: 1px solid var(--cw-line); background: #fff; border-radius: 0 0 var(--cw-radius) var(--cw-radius); display: grid; gap: 8px; }
.cw-page .cw-foot-row { display: flex; align-items: center; gap: 12px; }
.cw-page .cw-total { text-align: right; }
.cw-page .cw-total-val { display: block; font-size: 28px; line-height: 1; min-width: 1ch; }

/* Step 1 */
.cw-page .cw-strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px; }
.cw-page .cw-swatch { flex: none; position: relative; width: 84px; scroll-snap-align: start; cursor: pointer; }
.cw-page .cw-swatch img { width: 84px; height: 63px; object-fit: cover; border-radius: 4px; outline: 1px solid var(--cw-line); }
.cw-page .cw-swatch:has(input:checked) img { outline: 2px solid var(--cw-ink); outline-offset: 1px; }
.cw-page .cw-swatch:has(input:focus-visible) img { outline: 2px solid var(--cw-accent-deep); outline-offset: 2px; }
.cw-page .cw-upload { display: grid; gap: 12px; }
.cw-page .cw-drop {
    display: grid; gap: 2px; padding: 24px 16px; border: 1px dashed #8f8b80; border-radius: var(--cw-radius);
    background: var(--cw-sand); text-align: center; cursor: pointer; transition: border-color 160ms ease;
}
.cw-page .cw-drop:hover,
.cw-page .cw-drop[data-over="true"] { border-color: var(--cw-ink); }
.cw-page .cw-focus-within:has(input:focus-visible) { outline: 2px solid var(--cw-accent-deep); outline-offset: 2px; }
.cw-page .cw-progress { height: 6px; background: var(--cw-sand); border-radius: 3px; overflow: hidden; }
.cw-page .cw-progress > span { display: block; height: 100%; width: 0; background: var(--cw-ink); transition: width 160ms ease; }
.cw-page .cw-quality { font-size: 14px; }

/* Step 2 */
.cw-page .cw-walls { display: grid; gap: 20px; }
.cw-page .cw-wall-head { display: flex; align-items: center; justify-content: space-between; min-height: 28px; margin-bottom: 4px; }
.cw-page .cw-wall-name { font-weight: 500; }
.cw-page .cw-wall-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cw-page .cw-pair { display: flex; gap: 8px; }
.cw-page .cw-pair > div { flex: 1; min-width: 0; }
.cw-page .cw-pair label { display: block; }

/* Step 3 */
.cw-page .cw-options { display: grid; gap: 4px; }
.cw-page .cw-option {
    position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center;
    padding: 8px 28px 8px 8px; border: 1px solid transparent; border-radius: var(--cw-radius); cursor: pointer; transition: border-color 160ms ease;
}
.cw-page .cw-option:hover { border-color: var(--cw-line); }
.cw-page .cw-option:has(input:checked) { border-color: var(--cw-ink); }
.cw-page .cw-option:has(input:checked)::after {
    content: ""; position: absolute; top: 10px; right: 10px; width: 12px; height: 12px; border-radius: 50%;
    background: var(--cw-accent); box-shadow: 0 0 0 1px var(--cw-ink);
}
.cw-page .cw-option:has(input:focus-visible) { outline: 2px solid var(--cw-accent-deep); outline-offset: 2px; }
.cw-page .cw-option img,
.cw-page .cw-option-ph { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; background: var(--cw-sand); }
.cw-page .cw-option-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }

/* Step 5 */
.cw-page .cw-price-rows { display: grid; gap: 6px; font-size: 14px; }
.cw-page .cw-price-rows > div { display: flex; justify-content: space-between; gap: 16px; }
.cw-page .cw-price-rows dt { color: var(--cw-muted); }
.cw-page .cw-price-rows dd { text-align: right; font-variant-numeric: tabular-nums; }

/* Mobile bar */
.cw-page .cw-bar {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
    min-height: 80px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--cw-line);
}
.cw-page .cw-bar-total { flex: 1; min-width: 0; }
.cw-page .cw-bar-val { display: block; font-size: 20px; line-height: 1.2; }
.cw-page .cw-bar .cw-btn { flex: none; }

@media (min-width: 1024px) {
    .cw-page .cw-config-section { padding-block: 80px; }
    .cw-page .cw-config { grid-template-columns: minmax(0, 1fr) 420px; gap: 40px; }
    .cw-page .cw-preview { position: sticky; top: 24px; }
    .cw-page .cw-stage { height: min(66vh, 640px); }
    .cw-page .cw-panel { position: sticky; top: 24px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; box-shadow: var(--cw-shadow); }
    .cw-page .cw-panel-scroll { flex: 1; min-height: 0; overflow-y: auto; }
    /* Steps are always open in the desktop column. */
    .cw-page .cw-step > summary { min-height: 0; padding: 20px 20px 12px; pointer-events: none; cursor: default; }
    .cw-page .cw-step > summary .cw-plus { display: none; }
    .cw-page .cw-step-body { padding: 0 20px 20px; }
    .cw-page .cw-panel-foot { padding: 16px 20px; }
    .cw-page .cw-bar { display: none; }
}
@media (min-width: 640px) and (max-width: 1023px) {
    .cw-page .cw-stage { height: 58vw; }
}
@media (min-width: 640px) {
    .cw-page .cw-sum { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* The site's bottom nav shows below 992px, so the bar sits on top of it (as the five-piece page does) and the floats clear both. */
@media (max-width: 991px) {
    .cw-page .cw-config-section { padding-bottom: 172px; }
    .cw-page .cw-bar { bottom: calc(60px + env(safe-area-inset-bottom, 0px)); padding-bottom: 12px; }
    html:has(.cw-page .cw-bar:not([hidden])) .watsapp_btn { bottom: calc(152px + env(safe-area-inset-bottom, 0px)) !important; }
    html:has(.cw-page .cw-bar:not([hidden])) #ppChatbot.pp-chatbot { bottom: calc(216px + env(safe-area-inset-bottom, 0px)) !important; }
}
/* WhatsApp and chat floats clear the fixed bar. master already offsets them below 992px; this covers 992 to 1023. */
@media (min-width: 992px) and (max-width: 1023px) {
    html:has(.cw-page) .watsapp_btn { bottom: calc(118px + env(safe-area-inset-bottom, 0px)); }
    html:has(.cw-page) #ppChatbot.pp-chatbot { bottom: calc(190px + env(safe-area-inset-bottom, 0px)); }
}

/* ---- Gallery --------------------------------------------------------------- */

.cw-page .cw-gallery-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 16px; min-height: 44px; }
.cw-page .cw-search { flex: 1 1 220px; max-width: 360px; }
.cw-page .cw-search .cw-field { width: 100%; }
.cw-page .cw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; margin-top: 24px; }
.cw-page .cw-grid > li { min-width: 0; }
.cw-page .cw-tile { display: flex; flex-direction: column; width: 100%; height: 100%; text-align: left; cursor: pointer; gap: 0; }
.cw-page .cw-tile:disabled { cursor: default; opacity: 1; }
.cw-page .cw-tile-media { position: relative; display: block; overflow: hidden; border-radius: var(--cw-radius-lg); aspect-ratio: 4 / 3; margin-bottom: 12px; background: var(--cw-line); }
.cw-page .cw-tile-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 240ms ease; }
.cw-page .cw-tile:hover:not(:disabled) .cw-tile-img,
.cw-page .cw-tile:focus-visible .cw-tile-img { transform: scale(1.03); }
.cw-page .cw-grid-lead > li:first-child { grid-column: span 2; }
.cw-page .cw-grid > li.cw-wide-m { grid-column: 1 / -1; }
.cw-page .cw-grid > li.cw-wide .cw-tile-media { aspect-ratio: 16 / 7; }
.cw-page .cw-more { margin-top: 40px; display: flex; justify-content: center; }
.cw-page .cw-empty,
.cw-page .cw-empty-state { margin-top: 32px; display: grid; gap: 16px; justify-items: start; }

@media (min-width: 1024px) {
    .cw-page .cw-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; }
    .cw-page .cw-grid-lead > li:first-child { grid-row: span 2; }
    .cw-page .cw-grid > li.cw-wide { grid-column: span 2; }
    .cw-page .cw-grid > li.cw-wide-m { grid-column: span 2; }
    .cw-page .cw-grid-lead > li:first-child .cw-tile-media { flex: 1; aspect-ratio: auto; min-height: 220px; }
}

.cw-page .cw-dialog { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: var(--cw-radius-lg); background: var(--cw-paper); color: var(--cw-ink); }
.cw-page .cw-dialog::backdrop { background: rgba(25, 25, 25, .6); }
.cw-page .cw-dialog-body { display: grid; gap: 24px; padding: 24px; }
.cw-page .cw-dialog-body img { width: 100%; border-radius: var(--cw-radius-lg); object-fit: cover; aspect-ratio: 4 / 3; }
.cw-page .cw-dialog-body .cw-actions { flex-direction: column; }
@media (min-width: 768px) {
    .cw-page .cw-dialog-body { grid-template-columns: 1.4fr 1fr; align-items: center; }
}

/* ---- Measuring guide ------------------------------------------------------- */

.cw-page .cw-mlist { margin-top: 32px; border-top: 1px solid var(--cw-line); }
.cw-page .cw-mstep { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--cw-line); cursor: pointer; }
.cw-page .cw-mstep:has(input:focus-visible) { outline: 2px solid var(--cw-accent-deep); outline-offset: 2px; }
.cw-page .cw-mnum { flex: none; width: 24px; font-size: 24px; line-height: 1.3; color: var(--cw-muted); }
.cw-page .cw-mtitle { display: block; }
.cw-page .cw-mbody { display: none; margin-top: 4px; }
.cw-page .cw-mstep:has(input:checked) .cw-mbody { display: block; }
.cw-page .cw-diagram { background: var(--cw-sand); border-radius: var(--cw-radius-lg); padding: 16px; }
.cw-page .cw-diagram svg { width: 100%; height: auto; }
.cw-page .cw-diagram figcaption { margin-top: 12px; text-align: center; }
.cw-page .cw-d-wall { fill: var(--cw-paper); stroke: var(--cw-muted); stroke-width: 1.5; }
.cw-page .cw-d-open { fill: var(--cw-sand); stroke: var(--cw-line); stroke-width: 1.5; }
.cw-page .cw-d-line { stroke: var(--cw-line); stroke-width: 1.5; }
.cw-page .cw-d-floor { stroke: var(--cw-muted); stroke-width: 1.5; }
.cw-page .cw-d-label { fill: transparent; font-size: 18px; font-weight: 600; }
.cw-page .cw-d-dash { stroke: var(--cw-accent-deep); stroke-width: 2; stroke-dasharray: 8 6; opacity: 0; }
.cw-page .cw-d-trim { fill: none; stroke: var(--cw-accent-deep); stroke-width: 2.5; stroke-dasharray: 8 6; opacity: 0; }
.cw-page .cw-measure:has(input[value="0"]:checked) .m0:is(.cw-d-line, .cw-d-open),
.cw-page .cw-measure:has(input[value="1"]:checked) .m1:is(.cw-d-line, .cw-d-open),
.cw-page .cw-measure:has(input[value="3"]:checked) .m3:is(.cw-d-line, .cw-d-open) { stroke: var(--cw-accent-deep); stroke-width: 3; }
.cw-page .cw-measure:has(input[value="0"]:checked) .m0.cw-d-label,
.cw-page .cw-measure:has(input[value="1"]:checked) .m1.cw-d-label,
.cw-page .cw-measure:has(input[value="3"]:checked) .m3.cw-d-label,
.cw-page .cw-measure:has(input[value="4"]:checked) .m4.cw-d-label { fill: var(--cw-accent-deep); }
.cw-page .cw-measure:has(input[value="2"]:checked) .m2.cw-d-dash,
.cw-page .cw-measure:has(input[value="4"]:checked) .m4.cw-d-trim { opacity: 1; }
@media (min-width: 640px) {
    .cw-page .cw-diagram { padding: 32px; }
}

/* ---- Materials ------------------------------------------------------------- */

.cw-page .cw-materials { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px 24px; margin-top: 40px; }
.cw-page .cw-materials > li { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cw-page .cw-materials .cw-h3 { margin-top: 8px; }
.cw-page .cw-texture { position: relative; display: block; }
.cw-page .cw-texture img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: var(--cw-radius-lg); }
.cw-page .cw-materials .cw-link { align-self: flex-start; }
.cw-page .cw-compare-block { margin-top: 64px; padding-top: 40px; border-top: 1px solid rgba(25, 25, 25, .2); }
.cw-page .cw-table-wrap { margin-top: 24px; overflow-x: auto; border: 1px solid var(--cw-line); border-radius: var(--cw-radius); background: #fff; }
.cw-page .cw-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; line-height: 1.5; text-align: left; }
.cw-page .cw-table th,
.cw-page .cw-table td { padding: 12px 16px; vertical-align: top; border-top: 1px solid var(--cw-line); min-width: 160px; }
.cw-page .cw-table thead th { border-top: 0; font-family: var(--cw-serif); font-size: 16px; font-weight: 600; }
.cw-page .cw-table tbody th { font-size: 13px; font-weight: 500; color: var(--cw-muted); width: 140px; min-width: 120px; }
@media (min-width: 640px) {
    .cw-page .cw-materials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cw-page .cw-texture img { aspect-ratio: 4 / 3; }
}
@media (min-width: 1024px) {
    .cw-page .cw-materials { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---- How to order ---------------------------------------------------------- */

.cw-page .cw-steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 40px; }
.cw-page .cw-steps > li { padding-top: 16px; border-top: 1px solid var(--cw-ink); }
.cw-page .cw-step-big { display: block; font-size: 56px; line-height: 1; margin-bottom: 16px; }
@media (min-width: 640px) {
    .cw-page .cw-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .cw-page .cw-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---- Rooms and styles ------------------------------------------------------ */

.cw-page .cw-rooms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; margin-top: 40px; }
.cw-page .cw-rooms .cw-tile { display: block; }
.cw-page .cw-room-frame { position: relative; display: block; aspect-ratio: 1376 / 768; overflow: hidden; border-radius: var(--cw-radius-lg); margin-bottom: 12px; }
.cw-page .cw-room-plate,
.cw-page .cw-room-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.cw-page .cw-room-art { position: absolute; left: 0; right: 0; top: 0; height: var(--cw-floor); background-size: cover; background-position: center; transition: transform 240ms ease; }
.cw-page .cw-rooms .cw-tile:hover .cw-room-art,
.cw-page .cw-rooms .cw-tile:focus-visible .cw-room-art { transform: scale(1.03); }
.cw-page .cw-room-overlay { pointer-events: none; }
@media (min-width: 1024px) {
    .cw-page .cw-rooms { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; }
}

.cw-page .cw-style-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin-top: 24px; }
.cw-page .cw-style-link { display: flex; align-items: center; gap: 12px; padding-block: 6px; color: var(--cw-muted); transition: color 160ms ease; }
.cw-page .cw-style-link:hover,
.cw-page .cw-style-link:focus-visible { color: var(--cw-ink); }
.cw-page .cw-style-name { font-size: 22px; line-height: 1.35; }
.cw-page .cw-style-pics { position: relative; order: -1; aspect-ratio: 4 / 3; border-radius: var(--cw-radius-lg); overflow: hidden; background: var(--cw-sand); }
.cw-page .cw-style-pics img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 240ms ease; }
.cw-page .cw-style-pics img[data-art="mountains"] { opacity: 1; }
.cw-page .cw-split:has(.cw-style-link:is(:hover, :focus-visible)) .cw-style-pics img { opacity: 0; }
.cw-page .cw-split:has(.cw-style-link[data-art="mountains"]:is(:hover, :focus-visible)) .cw-style-pics img[data-art="mountains"],
.cw-page .cw-split:has(.cw-style-link[data-art="floral"]:is(:hover, :focus-visible)) .cw-style-pics img[data-art="floral"],
.cw-page .cw-split:has(.cw-style-link[data-art="marble"]:is(:hover, :focus-visible)) .cw-style-pics img[data-art="marble"],
.cw-page .cw-split:has(.cw-style-link[data-art="geometric"]:is(:hover, :focus-visible)) .cw-style-pics img[data-art="geometric"],
.cw-page .cw-split:has(.cw-style-link[data-art="jaali"]:is(:hover, :focus-visible)) .cw-style-pics img[data-art="jaali"],
.cw-page .cw-split:has(.cw-style-link[data-art="mandala"]:is(:hover, :focus-visible)) .cw-style-pics img[data-art="mandala"],
.cw-page .cw-split:has(.cw-style-link[data-art="botanical"]:is(:hover, :focus-visible)) .cw-style-pics img[data-art="botanical"] { opacity: 1; }
@media (min-width: 1024px) {
    .cw-page .cw-style-list { grid-template-columns: minmax(0, 1fr); }
    .cw-page .cw-style-name { font-size: 32px; line-height: 1.3; }
    .cw-page .cw-style-pics { order: 0; }
}

/* ---- Before and after ------------------------------------------------------ */

.cw-page .cw-ba { position: relative; margin-top: 32px; aspect-ratio: 1376 / 768; border-radius: var(--cw-radius-lg); overflow: hidden; background: var(--cw-line); }
.cw-page .cw-ba-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cw-page .cw-ba-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--cw-ba-pos)); }
.cw-page .cw-ba-art { position: absolute; left: 0; right: 0; top: 0; height: var(--cw-floor); background-size: cover; background-position: center; }
.cw-page .cw-ba-after .cw-ba-img:last-child { pointer-events: none; }
.cw-page .cw-ba-label { position: absolute; top: 12px; z-index: 5; padding: 2px 8px; border-radius: 4px; background: var(--cw-ink); color: #fff; font-size: 13px; line-height: 1.5; }
.cw-page .cw-ba-before { left: 12px; }
.cw-page .cw-ba-afterlabel { right: 12px; }
.cw-page .cw-compare { position: absolute; inset: 0; z-index: 6; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.cw-page .cw-compare:disabled { cursor: default; }
.cw-page .cw-compare:focus-visible { outline: none; }
.cw-page .cw-compare:focus-visible ~ .cw-compare-handle span { outline: 2px solid #fff; outline-offset: 3px; }
.cw-page .cw-compare-handle { position: absolute; top: 0; bottom: 0; left: var(--cw-ba-pos); z-index: 4; width: 2px; background: #fff; pointer-events: none; }
.cw-page .cw-compare-handle span {
    position: absolute; top: 50%; left: 50%; display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: var(--cw-ink); color: #fff;
}

/* ---- Installation ---------------------------------------------------------- */

.cw-page .cw-install { padding-block: 16px; border-top: 1px solid var(--cw-line); }
.cw-page .cw-install:first-child { padding-top: 0; border-top: 0; }
.cw-page .cw-install dl { margin-top: 8px; }
.cw-page .cw-install dl > div { padding-block: 8px; }

/* ---- Commercial and samples ------------------------------------------------ */

.cw-page .cw-ruled { margin-top: 32px; }
.cw-page .cw-ruled li { padding-block: 10px; border-top: 1px solid rgba(255, 255, 255, .2); font-size: 18px; }
.cw-page .cw-cta-col { align-self: center; }
.cw-page .cw-sample-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cw-page .cw-sample-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--cw-radius-lg); }

/* ---- FAQ ------------------------------------------------------------------- */

.cw-page .cw-faqs { border-top: 1px solid var(--cw-line); }
.cw-page .cw-faq { border-bottom: 1px solid var(--cw-line); }
.cw-page .cw-faq summary { display: flex; justify-content: space-between; gap: 16px; padding-block: 20px; font-size: 17px; font-weight: 500; line-height: 1.4; list-style: none; }
.cw-page .cw-faq summary::-webkit-details-marker { display: none; }
.cw-page .cw-faq p { padding-bottom: 20px; max-width: 680px; color: var(--cw-ink-soft); }
@media (min-width: 1024px) {
    .cw-page .cw-sticky { position: sticky; top: 32px; }
}

/* ---- Breadcrumb (shared partial, restyled to the page) ---------------------- */

.cw-page .pp-visible-breadcrumb { font-size: 13px; color: var(--cw-muted); padding: 8px 0 0; margin: 0; }
.cw-page .pp-visible-breadcrumb a { color: var(--cw-ink); text-decoration: underline; text-underline-offset: 3px; }
.cw-page .pp-visible-breadcrumb [aria-current="page"] { color: var(--cw-muted); font-weight: 400; }

/* ---- Hidden attribute and motion ------------------------------------------- */

/* Last, so it wins ties against component display rules above. */
.cw-page [hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
    /* !important: must beat every component's own transition and any site-wide animation, whatever its specificity. */
    .cw-page *,
    .cw-page *::before,
    .cw-page *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
