/* "Design your kitchen" (phase 6): the kitchen large on a dark stage, the parts and their materials beside it; on a phone
   the kitchen stays in view at the top while the materials scroll under it. Colours, corners and the font are the
   company's tokens from /identity.css.
   Since the redesign of 2026-10-29 the tool stands in the vitrine's room: the company's velvet (--cat-dark) under one warm
   light, the kitchen in a case framed by the brass hairline (--s), the materials on a darker tray. The room sets the
   page's own tokens again for everything inside it, so the parts below keep their rules and take the room's colours. */
.d-room { --bg: var(--w-deep); --sf: color-mix(in srgb, var(--w-bg) 94%, var(--w-ink)); --ink: var(--w-ink);
  --mut: color-mix(in srgb, var(--w-ink) 68%, var(--w-bg)); --ln: color-mix(in srgb, var(--w-ink) 15%, transparent);
  --p: var(--s-fill); --onp: var(--on-s); --p-text: var(--s-text);
  position: relative; isolation: isolate; background: var(--w-bg); color: var(--ink);
  scrollbar-color: color-mix(in srgb, var(--w-ink) 26%, transparent) transparent; }
.d-room::before { content: ""; position: absolute; z-index: -1; inset: 0 0 auto; height: 70vh; pointer-events: none;
  background: radial-gradient(46% 60% at 40% 0%, var(--w-glow), transparent 72%); }
.d-room ::selection { background: var(--s-fill); color: var(--on-s); }
.d-room :focus-visible { outline: 2px solid var(--s-text); outline-offset: 3px; }
.d-room .btn { font-family: inherit; }
.d-room .btn-o { background: none; border-color: color-mix(in srgb, var(--w-ink) 34%, transparent); }
.d-room .btn-o:hover { border-color: var(--s); filter: none; }
.d-head { padding-block: 40px 26px; display: grid; gap: 10px; }
.d-head h1 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); line-height: 1.15; }
.d-head p { color: var(--mut); max-width: 62ch; font-size: 1.08rem; }
.designer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); gap: 20px; align-items: start; padding-bottom: 56px; position: relative; }
.designer > .d-status { grid-column: 1 / -1; padding: 40px 0; color: var(--mut); }

/* the stage: the kitchen alone in its case, and under it the row of its controls; the two stay in view together */
.d-show { position: sticky; top: calc(88px + env(safe-area-inset-top, 0px)); display: grid; gap: 22px; min-width: 0; }
.d-stage { position: relative; aspect-ratio: 1.6; background: var(--bg); overflow: hidden; isolation: isolate;
  outline: 1px solid color-mix(in srgb, var(--s) 45%, transparent); outline-offset: 9px; box-shadow: 0 46px 90px -34px rgb(0 0 0 / .85); }
.d-canvas, .d-poster { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
.d-poster { object-fit: cover; filter: blur(10px) saturate(.9); transform: scale(1.06); transition: opacity .6s ease; background: transparent; }
.d-canvas { opacity: 0; transition: opacity .45s ease; }
.d-stage.ready .d-canvas { opacity: 1; }
.d-stage.ready .d-poster { opacity: 0; }
.d-stage.busy.ready .d-canvas { opacity: .82; }
.d-stage.busy::after { content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px; z-index: 4;
  background: linear-gradient(90deg, transparent, var(--s), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: d-load 1.2s linear infinite; }
@keyframes d-load { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@media (prefers-reduced-motion: reduce) { .d-stage.busy::after { animation: none; background-size: 100% 100%; opacity: .6; } .d-poster, .d-canvas { transition: none; } }

/* the row of the kitchen's controls: the kitchen picker, the views, and the loading word; on a computer above the kitchen, so
   it is seen at once, on a phone under it */
.d-bar { order: -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; }
.d-bar .d-status { flex-basis: 100%; margin: 0; color: var(--mut); font-size: .95rem; }
.d-bar .d-status:empty { display: none; }
.d-scenes-box { position: relative; z-index: 5; }
.d-pick { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 5px 16px 5px 5px; border-radius: var(--r); font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
  background: color-mix(in srgb, var(--w-bg) 90%, transparent); color: var(--w-ink); border: 1px solid color-mix(in srgb, var(--s) 50%, transparent); }
html[dir="rtl"] .d-pick { padding: 5px 5px 5px 16px; }
.d-pick:hover { border-color: var(--s); }
.d-pick img { width: 56px; height: 35px; border-radius: 1px; object-fit: cover; }
.d-pick .caret, .d-slot-head:not([disabled])::after { flex: none; width: 7px; height: 7px; margin: -4px 4px 0; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.d-pick[aria-expanded="true"] .caret, .d-slot.open .d-slot-head::after { margin-top: 4px; transform: rotate(-135deg); }
.d-scenes { position: absolute; top: calc(100% + 8px); inset-inline-start: 0; width: min(660px, calc(100vw - 48px)); max-height: min(70vh, 560px); overflow: auto;
  background: var(--bg); color: var(--ink); border: 1px solid color-mix(in srgb, var(--s) 40%, transparent); border-radius: var(--r); box-shadow: 0 18px 50px rgb(0 0 0 / .5); padding: 16px; display: grid; gap: 10px; }
.d-scenes h3 { font-size: .95rem; color: var(--mut); }
.d-scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.d-scene-grid button { padding: 0; background: none; border: 0; color: inherit; font: inherit; font-size: .92rem; text-align: start; cursor: pointer; display: grid; gap: 6px; }
.d-scene-grid img { width: 100%; aspect-ratio: 1.6; outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .2s; }
.d-scene-grid button.on img, .d-scene-grid button:hover img { outline-color: var(--p); }
/* the kitchens on a phone: a sheet from the bottom of the screen over the dimmed page (outside the room, so its colours are named) */
.d-sheet { position: fixed; inset: auto 0 0; width: 100%; max-width: 100vw; max-height: 82vh; margin: 0; padding: 0; border: 0; overflow: hidden;
  border-top: 1px solid color-mix(in srgb, var(--s) 45%, transparent); border-radius: var(--r) var(--r) 0 0; background: var(--w-bg); color: var(--w-ink); }
.d-sheet::backdrop { background: rgb(0 0 0 / .6); }
.d-sheet-in { display: grid; gap: 12px; max-height: 82vh; overflow: auto; overscroll-behavior: contain; padding: 0 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
.d-sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 8px; background: var(--w-bg); }
.d-sheet-head h2 { font-size: 1.2rem; }
.d-sheet-x { position: relative; flex: none; width: 44px; height: 44px; border: 1px solid color-mix(in srgb, var(--w-ink) 26%, transparent); border-radius: var(--r); background: none; color: inherit; cursor: pointer; }
.d-sheet-x::before, .d-sheet-x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 2px; margin: -1px 0 0 -8px; background: currentColor; transform: rotate(45deg); }
.d-sheet-x::after { transform: rotate(-45deg); }
.d-sheet h3 { font-size: .95rem; color: color-mix(in srgb, var(--w-ink) 68%, var(--w-bg)); }
.d-sheet .d-scene-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.d-sheet .d-scene-grid button { color: var(--w-ink); font-size: .95rem; }
.d-sheet .d-scene-grid button.on img { outline-color: var(--s-text); }
.d-sheet :focus-visible { outline: 2px solid var(--s-text); outline-offset: 3px; }

/* the views */
.d-views { display: flex; gap: 6px; flex-wrap: wrap; }
.d-views button { min-height: 44px; padding: 7px 16px; border-radius: var(--r); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
  background: none; color: var(--w-ink); border: 1px solid color-mix(in srgb, var(--w-ink) 26%, transparent); }
.d-views button:hover { border-color: var(--s); }
.d-views button.on { background: var(--s-fill); color: var(--on-s); border-color: transparent; }

/* the panel */
.d-panel { position: sticky; top: calc(88px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - 104px); display: flex; flex-direction: column; gap: 12px;
  background: var(--sf); border: 1px solid var(--ln); border-radius: var(--r); padding: 14px; }
.d-hint { font-size: .95rem; color: var(--mut); }
.d-slots { display: flex; flex-direction: column; gap: 8px; overflow: auto; min-height: 0; flex: 1; overscroll-behavior: contain; }
.d-slot { border: 1px solid var(--ln); border-radius: var(--r); background: var(--bg); }
.d-slot.open { border-color: color-mix(in srgb, var(--s) 55%, transparent); }
.d-slot.open .d-slot-top { position: sticky; top: 0; z-index: 2; background: var(--bg); border-radius: var(--r) var(--r) 0 0; }
.d-slot-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; background: none; border: 0; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.d-slot-head[disabled] { cursor: default; }
.d-slot-head:not([disabled])::after { content: ""; margin-inline: auto 8px; color: var(--mut); }
.d-slot-head img, .d-sw { width: 56px; height: 56px; flex: none; border-radius: 1px; object-fit: cover; }
.d-t { display: grid; min-width: 0; line-height: 1.35; }
.d-t small { color: var(--mut); font-size: .88rem; }
.d-t b { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-t span { color: var(--mut); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 8px 10px; scrollbar-width: thin; }
.d-chips button { flex: none; min-height: 40px; padding: 6px 14px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--w-ink) 24%, transparent); background: none; color: inherit; font: inherit; font-size: .9rem; cursor: pointer; }
.d-chips button.on { background: var(--s-fill); color: var(--on-s); border-color: transparent; font-weight: 600; }
.d-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px 8px; padding: 2px 8px 12px; }
.d-grid button { padding: 0; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; display: grid; gap: 5px; align-content: start; }
.d-grid img { width: 100%; aspect-ratio: 1; border-radius: 1px; outline: 1px solid transparent; outline-offset: 3px; transition: outline-color .15s; }
.d-grid button:hover img { outline-color: color-mix(in srgb, var(--s) 50%, transparent); }
.d-grid button.on img { outline: 2px solid var(--s-text); }
.d-grid span { font-size: .8rem; line-height: 1.35; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.d-light { display: flex; align-items: center; gap: 10px; font-size: .92rem; color: var(--mut); }
.d-light input { flex: 1; accent-color: var(--s-fill); }
.d-note { font-size: .85rem; color: var(--mut); line-height: 1.55; }
.d-actions, .d-more { display: grid; gap: 8px; }
.d-actions .btn, .d-more .btn { width: 100%; }
.d-more { gap: 2px; }
.d-call { min-height: 44px; background: none; border: 0; padding: 4px; color: var(--s-text); font: inherit; font-size: 1rem; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; cursor: pointer; }
.d-copy { width: 100%; font: inherit; font-size: .8rem; padding: 6px 8px; border: 1px solid var(--ln); border-radius: 8px; background: var(--bg); color: var(--ink); direction: ltr; }
.d-toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50;
  background: var(--w-bg); color: var(--w-ink); padding: 10px 18px; border: 1px solid var(--s); border-radius: var(--r); font-weight: 600; font-size: .95rem; transition: opacity .25s, transform .25s; }
.d-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* the request */
.d-dialog { border: 0; border-radius: var(--r); padding: 24px; width: min(440px, calc(100vw - 32px)); background: var(--bg); color: var(--ink); box-shadow: 0 24px 70px rgb(0 0 0 / .4); }
.d-dialog::backdrop { background: rgb(0 0 0 / .55); }
.d-req { display: grid; gap: 4px; }
.d-req h2 { font-size: 1.3rem; }
.d-req > p { color: var(--mut); font-size: .9rem; }
.d-req label { display: grid; gap: 4px; margin-top: 10px; font-size: .85rem; font-weight: 600; }
.d-req input, .d-req textarea { width: 100%; font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--ln); border-radius: calc(var(--r) * .6); background: var(--sf); color: var(--ink); }
.d-req input[type="tel"] { text-align: start; }
html[dir="rtl"] .d-req input[type="tel"] { text-align: right; }
.d-req .d-consent { font-size: .88rem; margin-top: 10px; }
.d-req .btns { margin-top: 14px; }
.d-err { color: #b3261e; font-size: .85rem; min-height: 1.2em; }
.d-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
html[data-mode="dark"] .d-err { color: #ffb4ab; }
.d-ok { font-size: 1rem; color: var(--ink); margin-block: 8px; }

/* phones and narrow windows: the kitchen at the top of the screen, the parts under it, the actions at the bottom */
@media (max-width: 900px) {
  .d-head { padding-block: 20px 14px; gap: 6px; }
  .d-head p { font-size: 1rem; }
  .designer { grid-template-columns: minmax(0, 1fr); gap: 0; padding-inline: 0; padding-bottom: 0; }
  .d-show { display: contents; }   /* on a phone the kitchen alone stays at the top while the parts scroll; its row scrolls away */
  .d-bar { order: 0; flex-direction: column; align-items: stretch; padding: 12px 14px 4px; }
  .d-views { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .d-views::-webkit-scrollbar { display: none; }
  .d-views button { flex: none; }
  .d-stage { position: sticky; top: calc(77px + env(safe-area-inset-top, 0px)); z-index: 6; outline: 0; box-shadow: 0 1px 0 color-mix(in srgb, var(--s) 45%, transparent); }   /* under the header (76 px and its line) */
  .d-panel { position: static; max-height: none; border-radius: 0; border-inline: 0; border-bottom: 0; padding: 12px max(14px, env(safe-area-inset-left, 0px)) 0; }
  .d-slots { overflow: visible; }
  .d-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
  .d-slot.open .d-slot-top { top: calc(77px + env(safe-area-inset-top, 0px) + 62.5vw); }   /* under the kitchen, which stays at the top */
  .d-actions { position: sticky; bottom: 0; z-index: 4; margin-inline: -14px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--w-bg); border-top: 1px solid color-mix(in srgb, var(--s) 30%, transparent); }
  .d-actions.two { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }   /* WhatsApp and the picture at the thumb, like the vitrine's bar */
  .d-actions .btn { min-height: 50px; padding: 6px 10px; font-size: .95rem; line-height: 1.25; }   /* a long name (English) takes two lines, never the screen's edge */
  .d-more { padding: 8px 0 20px; }
  .d-pick { font-size: .9rem; }
  .d-pick img { width: 44px; height: 28px; }
  .d-views button { padding: 6px 12px; font-size: .9rem; }
}
/* by day the room is the company's paper: its cards white, its deep tray a stone grey */
html[data-mode="light"] .d-room { --bg: #FFFFFF; --sf: color-mix(in srgb, var(--w-bg) 55%, #FFFFFF); }
html[data-mode="light"] .d-stage { box-shadow: 0 40px 80px -40px var(--w-shadow); }
