/*
VOICE  premium showroom, calm and confident; the kitchen sells itself
IDEA   a lit display kitchen on a plinth in a dark gallery
PICTURE the live 3D kitchen, full bleed, glass panels floating around it
COLOUR charcoal ground, sage support, brass accent; one palette in both themes
TYPE   Fraunces display, Inter UI, IBM Plex Sans Arabic for Arabic
LAYOUT app shell: header, catalogue | stage | inspector; stacks on phones
*/
:root {
  color-scheme: dark;
  --bg: #121513;
  --bg2: #181c19;
  --panel: rgba(30, 35, 31, 0.78);
  --panel-solid: #1e231f;
  --line: rgba(232, 226, 210, 0.12);
  --line2: rgba(232, 226, 210, 0.22);
  --ink: #efeadf;
  --muted: #a6ad9f;
  --sage: #8fa68a;
  --sage-d: #5f7a5e;
  --brass: #c9a46a;
  --brass-d: #a8834c;
  --warn: #e8957f;
  --ok: #9cc59a;
  --r: 14px;
  --display: "Fraunces", Georgia, serif;
  --ui: "Inter", "IBM Plex Sans Arabic", Arial, sans-serif;
}
:root[dir="rtl"] {
  --display: "IBM Plex Sans Arabic", "Fraunces", serif;
  --ui: "IBM Plex Sans Arabic", "Inter", Arial, sans-serif;
}
* {
  box-sizing: border-box;
  min-width: 0;
}
html {
  background: var(--bg);
}
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 70% -10%, #26302a 0%, transparent 60%),
    var(--bg);
  font: 15px/1.5 var(--ui);
  min-height: 100dvh;
  overflow-x: clip;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
  margin: 4px 0;
  line-height: 1.08;
  text-wrap: balance;
}
h1 {
  font-size: clamp(32px, 4.6vw, 64px);
  letter-spacing: -0.02em;
}
h2 {
  font-size: 22px;
}
h3 {
  font-size: 15px;
  font-family: var(--ui);
  font-weight: 600;
}
.muted,
small {
  color: var(--muted);
}
/* Controls */
button,
input,
select,
textarea,
.btn {
  font: inherit;
  color: inherit;
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  min-height: 40px;
}
input,
select,
textarea {
  width: 100%;
  margin: 5px 0;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.25);
}
select option {
  background: var(--panel-solid);
}
button,
summary,
select,
.btn {
  cursor: pointer;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
button:hover,
.btn:hover {
  border-color: var(--sage);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
.brass,
.dark {
  background: linear-gradient(180deg, #d4b07a, var(--brass-d));
  border-color: transparent;
  color: #1a1610;
  font-weight: 600;
}
.brass:hover,
.dark:hover {
  border-color: #f0d5a6;
}
.active,
[aria-pressed="true"]:not(.disc):not(.choice) {
  background: var(--sage);
  color: #10150f;
  border-color: transparent;
}
.ghost {
  background: transparent;
}
.link {
  background: none;
  border: 0;
  color: var(--brass);
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 8px 0;
}
label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px clamp(12px, 3vw, 36px);
  background: rgba(18, 21, 19, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo {
  font: 600 30px var(--display);
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: -0.02em;
}
.logo span {
  color: var(--brass);
}
.sub {
  font-weight: 500;
  color: var(--muted);
  padding-inline-start: 12px;
  border-inline-start: 1px solid var(--line2);
}
.grow {
  flex: 1;
}
.icon {
  width: 40px;
  padding: 0;
  font-size: 18px;
}
#switcher {
  display: flex;
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 3px;
  margin-inline-start: 14px;
}
#switcher button {
  border: 0;
  min-height: 34px;
  padding: 6px 14px;
  background: transparent;
}
/* Screens */
body:not([data-screen="advanced"]):not([data-screen="result"]) main,
body:not([data-screen="advanced"]):not([data-screen="result"]) > .title,
body:not([data-screen="start"]) #start,
body:not([data-screen="ideas"]) #ideas,
body:not([data-screen="wizard"]) #wizard,
body:not([data-screen="result"]) #resultActions,
body:not([data-screen="advanced"]) header > #undo,
body:not([data-screen="advanced"]) header > #redo,
body:not([data-screen="advanced"]) header > #share,
body[data-screen="start"] #switcher {
  display: none;
}
/* Start */
#start {
  position: relative;
  min-height: calc(100dvh - 61px);
  display: grid;
  align-items: end;
  overflow: hidden;
}
.hero {
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 60% at 65% 40%, #313a33, var(--bg) 75%);
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 45%;
  animation: drift 24s ease-in-out infinite alternate;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(18, 21, 19, 0.1) 0%,
    rgba(18, 21, 19, 0.35) 45%,
    var(--bg) 92%
  );
}
@keyframes drift {
  to {
    transform: scale(1.06) translateX(-1.5%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero img {
    animation: none;
  }
}
.heroInner {
  position: relative;
  z-index: 1;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 6vh, 80px) clamp(16px, 4vw, 48px);
}
.kicker {
  font-size: 14px;
  color: var(--brass);
}
.lede {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--muted);
  margin: 6px 0 26px;
}
.routes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.route {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: start;
  padding: 20px;
  border-radius: var(--r);
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line2);
  transition:
    transform 0.25s,
    border-color 0.25s;
}
.route:hover {
  transform: translateY(-3px);
  border-color: var(--brass);
}
.routeIcon {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: rgba(143, 166, 138, 0.15);
  color: var(--sage);
  display: grid;
  place-items: center;
}
.routeIcon svg {
  width: 32px;
}
.route strong {
  display: block;
  font: 400 22px var(--display);
}
.route small {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}
/* Portals (ideas, wizard, result) */
.portal {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 52px) clamp(16px, 4vw, 48px);
}
.portalHead {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}
#ideaGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 16px;
}
.idea {
  padding: 0;
  overflow: hidden;
  text-align: start;
  border-radius: var(--r);
  background: var(--panel-solid);
  transition:
    transform 0.25s,
    border-color 0.25s;
}
.idea:hover {
  transform: translateY(-3px);
  border-color: var(--brass);
}
.idea .shot {
  aspect-ratio: 52 / 34;
  background: radial-gradient(70% 70% at 50% 45%, #3a423c, #121513);
}
.idea img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.idea span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
}
.idea strong {
  font: 400 20px var(--display);
  display: block;
}
.idea b {
  color: var(--brass);
  white-space: nowrap;
  font-weight: 600;
}
/* Wizard */
.wizardWrap {
  max-width: 960px;
  margin: auto;
}
.stepMeta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}
.wizardWrap progress {
  width: 100%;
  height: 6px;
  accent-color: var(--brass);
  margin: 10px 0 20px;
}
.wizardWrap h1 {
  font-size: clamp(30px, 4vw, 48px);
  margin-bottom: 22px;
}
.shapeGrid,
.lookGrid,
.mustGrid,
.sizeGrid {
  display: grid;
  gap: 14px;
}
.shapeGrid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.lookGrid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}
.choice {
  padding: 0;
  border-radius: var(--r);
  overflow: hidden;
  text-align: start;
  background: var(--panel-solid);
}
.choice strong {
  display: block;
  padding: 12px 14px;
  font-weight: 500;
}
.choice svg {
  display: block;
  margin: 18px auto;
}
.choice[aria-pressed="true"] {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
  background: #262c27;
}
.lookGrid img,
.lookGrid .lookArt {
  width: 100%;
  aspect-ratio: 52 / 34;
  object-fit: cover;
  display: block;
  background: radial-gradient(70% 70% at 50% 45%, #3a423c, #121513);
}
.wizardNav {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding-top: 16px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.wizardNav button,
.resultButtons button,
.resultButtons .btn,
#full {
  padding: 12px 20px;
}
.sizeGrid {
  grid-template-columns: 1fr 1fr;
}
.sizeForm,
#mini,
.mustGrid label {
  padding: 18px;
  background: var(--panel-solid);
  border: 1px solid var(--line2);
  border-radius: var(--r);
}
.stepper {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.stepper button {
  width: 52px;
  height: 48px;
  font-size: 21px;
  flex: none;
}
.stepper input {
  text-align: center;
  height: 48px;
}
.sizeForm label {
  font-size: 15px;
}
.mustGrid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.mustGrid label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
  margin: 0;
}
.mustGrid input {
  width: 22px;
  height: 22px;
  min-height: 0;
  accent-color: var(--brass);
  margin: 0;
}
.mustGrid label:has(:checked) {
  border-color: var(--brass);
  background: #2a2a22;
}
#mini {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
}
#mini svg rect {
  fill: #232925;
  stroke: #47524a;
}
#mini svg path {
  stroke: var(--sage);
}
.guideHint {
  margin-top: 10px;
}
#wizardError,
#resultError {
  color: var(--warn);
}
#customise {
  margin: 14px 0 0;
}
/* Planner title */
.title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  padding: 18px clamp(12px, 2vw, 28px) 12px;
}
.title small {
  font-size: 13px;
  color: var(--brass);
}
.title h1 {
  font-size: clamp(26px, 3vw, 38px);
}
.titleActions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.badge {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 99px;
  border: 1px solid var(--line2);
  cursor: pointer;
}
.badge.warn {
  color: var(--warn);
  border-color: rgba(232, 149, 127, 0.5);
}
.badge.ok {
  color: var(--ok);
}
/* App shell */
main {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 270px;
  margin: 0 clamp(8px, 1.5vw, 20px) clamp(8px, 1.5vw, 20px);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg2);
  min-height: calc(100dvh - 160px);
}
aside {
  padding: 16px;
  max-height: calc(100dvh - 160px);
  overflow: auto;
  background: var(--panel-solid);
}
.catalog {
  border-inline-end: 1px solid var(--line);
}
.properties {
  border-inline-start: 1px solid var(--line);
}
summary {
  font-weight: 600;
  padding: 13px 0;
  list-style-position: inside;
}
details {
  border-top: 1px solid var(--line);
}
#products summary svg {
  vertical-align: middle;
  margin: 0 8px;
  color: var(--sage);
}
.card {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  text-align: start;
  gap: 10px;
  width: 100%;
  margin: 4px 0;
  padding: 6px;
  touch-action: none;
  user-select: none;
  background: rgba(255, 255, 255, 0.03);
}
.card svg {
  width: 46px;
  background: #2a302b;
  border-radius: 8px;
  pointer-events: none;
}
.card small {
  display: block;
  font-size: 12px;
  margin-top: 2px;
}
article {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(80% 80% at 50% 40%, #2b332d, #141815);
}
.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.bar nav {
  display: flex;
  gap: 4px;
}
.bar nav button {
  min-height: 36px;
  padding: 6px 12px;
}
.tools {
  margin-inline-start: auto;
}
#views {
  display: flex;
  flex: 1;
  min-height: 440px;
}
#plan,
#model {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
#plan {
  background: #171b18;
}
#views.split #plan {
  border-inline-end: 1px solid var(--line);
}
#svg,
#model canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.zoom {
  position: absolute;
  inset-inline-start: 10px;
  bottom: 10px;
  display: flex;
  gap: 4px;
}
.zoom button {
  min-width: 40px;
  background: var(--panel);
  backdrop-filter: blur(8px);
}
#walkPad {
  position: absolute;
  inset-inline-end: 14px;
  bottom: 14px;
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-areas: ". f ." "tl b tr" "s s s";
  gap: 6px;
  z-index: 2;
}
#walkPad button {
  background: var(--panel);
  backdrop-filter: blur(8px);
  min-height: 48px;
  padding: 0;
  touch-action: none;
}
#walkPad [data-walk="f"] {
  grid-area: f;
}
#walkPad [data-walk="tl"] {
  grid-area: tl;
}
#walkPad [data-walk="b"] {
  grid-area: b;
}
#walkPad [data-walk="tr"] {
  grid-area: tr;
}
#walkPad small {
  grid-area: s;
  text-align: center;
  font-size: 12px;
}
footer {
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding: 10px 14px;
}
.panelTabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.panelTabs button {
  min-height: 34px;
  padding: 5px 11px;
  font-size: 14px;
}
.panelTabs .count {
  margin-inline-start: 6px;
  font-size: 12px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--warn);
  color: #1b120f;
}
#selection h3 {
  font: 400 22px var(--display);
}
#selection p {
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.colourTargets {
  display: grid;
  gap: 6px;
  margin: 8px 0 14px;
}
.colourTarget {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: start;
  padding: 9px 10px;
}
.colourTarget i,
.hexLine i {
  display: block;
  flex: none;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line2);
  border-radius: 50%;
}
/* Checks */
.check {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  margin: 6px 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  width: 100%;
  text-align: start;
  font-size: 14px;
  line-height: 1.45;
}
.check i {
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 50%;
}
.check.warn i {
  background: var(--warn);
}
.check.tip i {
  background: var(--brass);
}
.check.ok i {
  background: var(--ok);
}
/* Result */
body[data-screen="result"] main {
  display: block;
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto;
}
body[data-screen="result"] .catalog,
body[data-screen="result"] .properties,
body[data-screen="result"] footer,
body[data-screen="result"] .views,
body[data-screen="result"] > .title {
  display: none;
}
body[data-screen="result"] #views {
  height: clamp(340px, 60vh, 760px);
  min-height: 0;
}
body[data-screen="result"] .bar strong {
  visibility: hidden;
}
#resultActions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  align-items: start;
  gap: 24px;
  padding-top: 18px;
}
.amount {
  font: 400 clamp(32px, 3.6vw, 52px) var(--display);
  color: var(--brass);
  margin: 2px 0 8px;
  white-space: nowrap;
}
.resultButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.resultChecks {
  grid-column: 1 / -1;
}
/* Budget */
.budgetBox {
  margin: 14px 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: rgba(255, 255, 255, 0.03);
}
.budgetRow {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.budgetRow input[type="range"] {
  flex: 1 1 200px;
  accent-color: var(--brass);
  min-height: 0;
  background: none;
  border: 0;
}
.budgetRow output {
  font-weight: 600;
  white-space: nowrap;
}
.meter {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 10px 0 6px;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--sage);
  border-radius: inherit;
  transition: width 0.3s;
}
.meter.over i {
  background: var(--warn);
}
/* Tour */
#tour {
  position: fixed;
  z-index: 30;
  width: 268px;
  padding: 16px;
  border: 1px solid var(--brass);
  border-radius: 12px;
  background: var(--panel-solid);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
#tour p {
  margin: 8px 0 12px;
}
/* Dialogs */
dialog {
  border: 1px solid var(--line2);
  border-radius: 18px;
  width: min(700px, 96vw);
  max-height: 92dvh;
  color: var(--ink);
  background: var(--panel-solid);
  padding: 20px;
}
dialog.wide {
  width: min(1100px, 96vw);
}
dialog::backdrop {
  background: rgba(8, 10, 9, 0.75);
  backdrop-filter: blur(4px);
}
dialog .bar {
  padding: 0 0 10px;
  margin-bottom: 8px;
}
.dlgActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
}
td,
th {
  text-align: end;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td:first-child,
th:first-child {
  text-align: start;
  white-space: normal;
}
th {
  color: var(--muted);
  font-weight: 500;
}
.tableWrap {
  overflow-x: auto;
}
.price {
  font: 400 28px var(--display);
  color: var(--brass);
  text-align: end;
  margin: 6px 0;
}
#leadForm {
  display: grid;
  gap: 4px;
}
#leadForm button {
  margin-top: 10px;
}
pre {
  white-space: pre-wrap;
  font: 13px/1.5 var(--ui);
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 10px;
  max-height: 260px;
  overflow: auto;
}
#guideList {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
#guideList li {
  display: flex;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}
#guideList svg {
  flex: none;
  width: 64px;
  color: var(--sage);
}
#guideList p {
  margin: 4px 0 0;
  color: var(--muted);
}
#shotImg {
  width: 100%;
  border-radius: 12px;
  display: block;
}
/* Colour panel */
#colourPanel {
  position: fixed;
  z-index: 20;
  inset-inline-end: 12px;
  top: 72px;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100dvh - 90px);
  background: rgba(30, 35, 31, 0.92);
  backdrop-filter: blur(18px);
  padding: 18px;
  border: 1px solid var(--line2);
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.55);
  border-radius: 16px;
  overflow: auto;
}
.colourHead,
.hexLine {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: space-between;
}
.colourHead {
  margin-bottom: 10px;
}
#dismiss {
  font-size: 20px;
  width: 40px;
  padding: 0;
}
#colourPanel h3 {
  font-size: 14px;
  margin: 16px 0 8px;
}
.discs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.disc,
#plusColour,
.eye {
  width: 36px;
  height: 36px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.disc[aria-pressed="true"] {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}
#plusColour {
  font-size: 21px;
  background:
    linear-gradient(var(--panel-solid), var(--panel-solid)) padding-box,
    conic-gradient(#ec6474, #eabe43, #74b56f, #5d9cc9, #9974c1, #ec6474)
      border-box;
  border: 3px solid transparent;
}
.eye {
  display: grid;
  place-items: center;
}
#defaults {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px 3px;
  justify-items: center;
}
#surfaceMaterials button {
  background-size: cover;
}
#picker {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}
#sv {
  position: relative;
  height: 130px;
  border-radius: 8px;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, transparent),
    hsl(var(--h), 100%, 50%);
  touch-action: none;
  cursor: crosshair;
}
#cursor {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid white;
  box-shadow: 0 0 1px 1px #333;
  border-radius: 50%;
  pointer-events: none;
}
#hue {
  appearance: none;
  height: 12px;
  min-height: 0;
  background: linear-gradient(to right, red, yellow, lime, cyan, blue, magenta, red);
  border: 0;
  border-radius: 99px;
  padding: 0;
  margin: 15px 0;
}
#hue::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: transparent;
  border: 3px solid white;
  box-shadow: 0 0 2px #222;
}
.hexLine input {
  min-width: 0;
  flex: 1;
  margin: 0;
}
.hexLine .eye {
  flex: none;
  border-radius: 10px;
  width: 40px;
  height: 40px;
}
#hits:not(:empty) {
  padding-top: 8px;
}
/* Tablet */
@media (max-width: 1100px) {
  main {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .properties {
    grid-column: 1 / -1;
    max-height: none;
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }
  #views.split {
    flex-direction: column;
  }
  #views.split #plan {
    border-inline-end: 0;
    border-bottom: 1px solid var(--line);
  }
  .routes {
    grid-template-columns: 1fr;
    max-width: 560px;
  }
  .sub,
  #bookTop {
    display: none;
  }
}
/* Phone */
@media (max-width: 680px) {
  body {
    font-size: 15px;
  }
  header {
    gap: 6px;
    padding: 8px 10px;
  }
  .logo {
    font-size: 25px;
  }
  #switcher {
    margin-inline-start: 4px;
  }
  #switcher button {
    padding: 5px 9px;
    font-size: 14px;
  }
  #share {
    display: none !important;
  }
  #start {
    min-height: calc(100dvh - 57px);
  }
  .hero img {
    object-position: 60% 30%;
    height: 62%;
  }
  .route {
    padding: 14px;
  }
  .routeIcon {
    width: 44px;
    height: 44px;
  }
  .route strong {
    font-size: 19px;
  }
  main {
    display: flex;
    flex-direction: column;
    margin: 0 6px 6px;
  }
  aside {
    max-height: none;
  }
  .catalog {
    max-height: 240px;
    border-inline-end: 0;
    border-bottom: 1px solid var(--line);
  }
  #views {
    min-height: 420px;
  }
  .title {
    padding: 12px;
  }
  .title h1 {
    font-size: 26px;
  }
  .sizeGrid,
  #resultActions {
    grid-template-columns: 1fr;
  }
  .shapeGrid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .mustGrid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .resultButtons {
    justify-content: stretch;
  }
  .resultButtons > * {
    flex: 1 1 44%;
  }
  #mini {
    min-height: 130px;
  }
  #mini > div {
    zoom: 0.7;
  }
  #colourPanel {
    inset: auto 0 0;
    width: 100%;
    max-height: 66dvh;
    border-radius: 18px 18px 0 0;
    padding: 14px 18px max(18px, env(safe-area-inset-bottom));
  }
  #colourPanel .colourHead {
    position: sticky;
    top: -14px;
    background: var(--panel-solid);
    z-index: 1;
    padding: 4px 0;
  }
  dialog {
    padding: 16px;
  }
  .wizardNav {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    padding-bottom: 12px;
  }
}
/* Print */
@media print {
  body > *:not(#bill) {
    display: none !important;
  }
  html,
  body {
    background: #fff !important;
    color: #000;
  }
  dialog:modal,
  #bill {
    display: block;
    position: static;
    width: 100%;
    max-height: none;
    border: 0;
    background: #fff;
    color: #000;
  }
  #bill button,
  #budget,
  .dlgActions {
    display: none;
  }
  dialog::backdrop {
    display: none;
  }
  .price {
    color: #000;
  }
}
#switcher [aria-pressed="true"] {
  background: var(--sage);
  color: #10150f;
}
body[data-screen="result"] main {
  min-height: 0;
}
.ghost.active {
  background: var(--sage);
  color: #10150f;
}
.choice svg rect {
  fill: #232925;
  stroke: #47524a;
}
.choice svg path {
  stroke: var(--sage);
}
.heroInner h1,
.heroInner .lede,
.kicker {
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}
@media (max-width: 680px) {
  .hero img {
    height: 58%;
  }
  .hero::after {
    background: linear-gradient(180deg, transparent 0%, transparent 30%, var(--bg) 58%);
  }
  #switcher button {
    white-space: nowrap;
    font-size: 13px;
    padding: 5px 8px;
  }
  #redo,
  .sub {
    display: none !important;
  }
  #langBtn {
    padding: 6px 9px;
    font-size: 13px;
  }
  .title {
    flex-wrap: wrap;
    align-items: center;
  }
  .titleActions {
    width: 100%;
    justify-content: space-between;
  }
}
@media (max-width: 380px) {
  .logo {
    font-size: 22px;
  }
}
.idea span {
  flex-wrap: wrap;
}
@media (max-width: 680px) {
  .kicker {
    display: none;
  }
}
/* Rooms */
.pickLabel {
  margin: 0 0 8px;
  color: var(--ink);
  font-weight: 500;
}
.roomPick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.roomPick button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border-radius: 99px;
  background: var(--panel);
  backdrop-filter: blur(10px);
}
.roomPick svg {
  width: 24px;
  height: 24px;
  color: var(--sage);
}
.roomPick [aria-pressed="true"] {
  background: var(--sage);
  color: #10150f;
}
.roomPick [aria-pressed="true"] svg {
  color: #10150f;
}
.roomSel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
}
.roomSel select {
  width: auto;
  margin: 0;
  min-height: 40px;
}
.title {
  flex-wrap: wrap;
}
.buildWardrobe {
  width: 100%;
  margin: 4px 0 10px;
}
.idea .roomTag {
  display: inline-block;
  font-size: 12px;
  color: var(--brass);
  margin-bottom: 2px;
}
/* Wardrobe builder */
.wardGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 18px;
}
.wardDraw {
  background: #171b18;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.wardDraw svg {
  width: 100%;
  max-height: 58dvh;
  display: block;
}
.wardDraw .sec {
  cursor: pointer;
}
.wardToggle,
.doorPick,
.presetRow,
.partRow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.wardToggle button,
.doorPick button,
.presetRow button,
.partRow button {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 14px;
}
.doorPick [aria-pressed="true"],
.wardToggle [aria-pressed="true"] {
  background: var(--sage);
  color: #10150f;
}
.wardCtl h3 {
  margin-top: 16px;
}
.partList {
  list-style: none;
  padding: 0;
  margin: 10px 0;
  display: grid;
  gap: 4px;
}
.partList li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}
.partList li button {
  min-height: 30px;
  width: 30px;
  padding: 0;
}
.wardFoot {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.wardFoot .price {
  text-align: start;
}
#wardWarn {
  color: var(--warn);
  margin: 4px 0 0;
  font-size: 14px;
}
@media (max-width: 760px) {
  .wardGrid {
    grid-template-columns: 1fr;
  }
  .wardDraw svg {
    max-height: 40dvh;
  }
}

/* Showroom branding: the planner wears the showroom's name; ARTEK stays small. */
.logo img { height: 28px; width: auto; display: block; }
.byArtek {
  position: fixed; inset-inline-end: 12px; bottom: 8px; z-index: 5;
  font: 500 10.5px/1 Inter, system-ui, sans-serif; letter-spacing: .06em;
  color: rgba(230, 226, 214, .45); text-decoration: none;
}
.byArtek:hover { color: rgba(230, 226, 214, .85); }
body:not([data-screen="start"]):not([data-screen="ideas"]) .byArtek { display: none; }
.quotePage .byArtekQuote { font-size: 11px; opacity: .6; }

/* Phones and tablets: the booking button lives in a bar at the bottom. */
#bookBar { display: none; }
@media (max-width: 1100px) {
  body:not([data-screen="start"]) #bookBar {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    position: fixed; z-index: 40; left: 10px; right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    min-height: 48px; border-radius: 14px; font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  }
  body:not([data-screen="start"]) { padding-bottom: 72px; }
}
@media (max-width: 680px) {
  .hero::after {
    background: linear-gradient(180deg, rgba(18, 21, 19, .55) 0%, rgba(18, 21, 19, .72) 34%, var(--bg) 58%);
  }
}

/* Long showroom names stay on one line in the header. */
header .logo { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
@media (max-width: 680px) {
  header .logo { max-width: 30vw; font-size: 17px; }
}

/* ---- Phones: the planner works like an app ---------------------------- */
#mobileTabs { display: none; }
@media (max-width: 760px) {
  /* The wizard has its own sticky Back / Next bar. */
  body[data-screen="wizard"] #bookBar,
  body[data-screen="advanced"] #bookBar { display: none !important; }
  body[data-screen="wizard"] { padding-bottom: 0; }
  /* The result screen already has the bottom booking bar. */
  body[data-screen="result"] #bookResult { display: none; }

  /* Two columns instead of one long list. */
  #ideaGrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  #ideaGrid .idea strong { font-size: 15px; }
  #ideaGrid .idea small { font-size: 12px; }
  .lookGrid { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* Advanced planner: plan on top, one panel below, tab bar at the bottom. */
  body[data-screen="advanced"] { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  body[data-screen="advanced"] .title { padding: 8px 10px; gap: 8px; flex-wrap: nowrap; }
  body[data-screen="advanced"] .title > div:first-child { display: none; }
  body[data-screen="advanced"] .roomSel { font-size: 0; flex: 1 1 120px; min-width: 110px; }
  body[data-screen="advanced"] .roomSel select { font-size: 15px; width: 100%; min-height: 42px; }
  body[data-screen="advanced"] .titleActions { gap: 6px; }
  body[data-screen="advanced"] #quote { min-height: 42px; white-space: nowrap; }
  body[data-screen="advanced"] main > article {
    order: 0; position: sticky; top: var(--hdr, 57px); z-index: 6;
    background: var(--bg); box-shadow: 0 12px 20px -12px rgba(0, 0, 0, .6);
  }
  body[data-screen="advanced"] main > article .bar { padding: 6px 8px; gap: 6px; }
  body[data-screen="advanced"] main > article .bar > strong { display: none; }
  body[data-screen="advanced"] #views { min-height: 0; height: 44dvh; }
  body[data-screen="advanced"] #tip { font-size: 12.5px; padding: 6px 10px; }
  body[data-screen="advanced"] .catalog { order: 1; max-height: none; border-bottom: 0; }
  body[data-screen="advanced"] .properties { order: 2; }
  body[data-screen="advanced"] .panelTabs { display: none; }
  body[data-screen="advanced"]:not([data-mp="catalog"]) .catalog { display: none; }
  body[data-screen="advanced"][data-mp="catalog"] .properties { display: none; }
  body[data-screen="advanced"] #mobileTabs {
    display: grid; grid-template-columns: repeat(3, 1fr) 1.35fr; gap: 6px;
    position: fixed; z-index: 41; left: 0; right: 0; bottom: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--panel-solid, #1a1e1b); border-top: 1px solid var(--line);
  }
  #mobileTabs button, #mobileTabs a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px; padding: 4px; border-radius: 12px; font-size: 12.5px; font-weight: 600;
    text-decoration: none; border: 1px solid transparent; background: transparent; color: var(--muted, #a9b0a6);
  }
  #mobileTabs svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  #mobileTabs [aria-pressed="true"] { color: var(--ink, #f1ede4); background: rgba(143, 166, 138, .18); border-color: rgba(143, 166, 138, .35); }
  #mobileTabs a.brass { background: linear-gradient(180deg, #d4b07a, var(--brass-d)); color: #1a1610; }

  /* Bigger touch targets. */
  #switcher button, .views button, .tools button, .zoom button { min-height: 40px; min-width: 40px; }
}
@media (max-width: 760px) {
  body[data-screen="advanced"] #checkBadge { max-width: 110px; font-size: 12px; line-height: 1.25; }
}

/* Phones: nothing may be wider than the screen (it made the page zoom out
   and pushed the bottom bars off screen). */
@media (max-width: 760px) {
  html { overflow-x: clip; }
  header { flex-wrap: nowrap; min-width: 0; }
  header > * { flex-shrink: 1; min-width: 0; }
  header .logo { max-width: 26vw; }
  #langBtn { font-size: 0; padding-inline: 10px; min-width: 40px; }
  #langBtn::after { content: attr(data-short); font-size: 14px; }
  main, .title, main > * { min-width: 0; max-width: 100%; }
  body[data-screen="advanced"] .roomSel { flex: 1 1 90px; min-width: 90px; }
  body[data-screen="advanced"] #quote { white-space: normal; line-height: 1.2; font-size: 13.5px; padding-inline: 10px; }
  body[data-screen="advanced"] .titleActions { flex-wrap: nowrap; min-width: 0; }
}
@media (max-width: 760px) {
  /* Sticky needs a parent that does not clip. */
  body[data-screen="advanced"] main { overflow: visible; }
}
@media (max-width: 760px) {
  /* Quote on phones: item, quantity and total only. */
  #lines .opt { display: none; }
  #lines table { width: 100%; }
}

/* No page zoom: pinch and double-tap only move the plan and the 3D view,
   never the page itself. */
html, body { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, a, select, input, label, summary { touch-action: manipulation; }
/* iPhone zooms into any field smaller than 16px when it is tapped. */
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px !important; }
}

/* ---- Mobile polish round 2 ------------------------------------------- */
#model[data-loading]::after {
  content: attr(data-loading); position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted, #a9b0a6); font-size: 14px;
}
#model { position: relative; }
#lines td .w { color: var(--muted, #a9b0a6); font-size: .9em; }
#lines td small.each { display: block; color: var(--muted, #a9b0a6); font-size: 11.5px; }
/* Ideas: the chosen room first, others on request. */
#ideaGrid.onlyMine .otherRoom { display: none; }
#ideasMore { display: block; margin: 16px auto 8px; min-height: 44px; }
/* Wardrobe builder: price and "Add to room" always visible. */
#wardDlg .wardFoot {
  position: sticky; bottom: -20px; z-index: 2; margin: 0 -20px -20px; padding: 12px 20px;
  background: var(--panel-solid, #1a1e1b); border-top: 1px solid var(--line);
}
.wardHint { margin: 0 0 8px; }
#wardDlg .partList button[data-del] { min-width: 40px; min-height: 40px; }

@media (max-width: 760px) {
  /* Result: booking sits with the other actions, nothing floats over them. */
  body[data-screen="result"] #bookBar { display: none !important; }
  body[data-screen="result"] { padding-bottom: 0; }
  body[data-screen="result"] #bookResult { display: flex !important; order: -1; grid-column: 1 / -1; width: 100%; min-height: 50px; justify-content: center; }
  .resultButtons { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
  .resultButtons button { min-height: 46px; }

  /* Advanced: a fixed app screen. The plan stays put; the panel under it
     scrolls on its own and ends above the tab bar. */
  body[data-screen="advanced"] {
    height: 100dvh; overflow: hidden; padding-bottom: 0;
    display: flex; flex-direction: column;
  }
  body[data-screen="advanced"] > header, body[data-screen="advanced"] > .title { flex: none; }
  body[data-screen="advanced"] main {
    flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
    margin-bottom: calc(66px + env(safe-area-inset-bottom));
  }
  body[data-screen="advanced"] main > article { position: static; flex: none; }
  body[data-screen="advanced"] #views { height: 36dvh; }
  body[data-screen="advanced"] main > aside {
    flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch; padding-bottom: 16px;
  }
  /* 44px touch targets. */
  .views button, [data-view], #wardDlg button, .doorPick button, .presetRow button, .partRow button { min-height: 44px; }

}

/* ---- Materials & cut list ---------------------------------------------- */
#cutDlg .bar > div { display: flex; gap: 8px; }
.cutStats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 4px 0 14px; }
.cutStat { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.cutStat b { display: block; font-size: 22px; color: var(--brass, #c9a66b); }
.cutStat span { color: var(--muted, #a9b0a6); font-size: 13px; }
#cutBody h3 { margin: 16px 0 6px; font-size: 16px; }
.cutT { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cutT th, .cutT td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: start; }
.cutT th { color: var(--muted, #a9b0a6); font-weight: 500; }
.cutCols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cutUnit { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 8px 0; overflow-x: auto; }
.cutUnit summary, .cutSet summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.cutCost { margin: 14px 0 0; font-size: 15px; }
.cutSet { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.cutGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 10px 0; }
.cutGrid label { display: grid; gap: 4px; font-size: 13px; color: var(--muted, #a9b0a6); }
#cutBody .small { font-size: 12.5px; }
@media (max-width: 760px) {
  .cutCols { grid-template-columns: 1fr; }
  .cutT { font-size: 12.5px; }
  .cutT th, .cutT td { padding: 5px 4px; }
}

.cutWarn { border: 1px solid #c0533f; background: rgba(192, 83, 63, 0.12); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; }
.cutWarn ul { margin: 6px 0 0; padding-inline-start: 18px; }
.cutOk { color: #8fc49a; margin: 0 0 12px; font-size: 14px; }
.cutPlans { margin: 12px 0; }
.cutPlans summary, .cutAdd summary { cursor: pointer; font-weight: 600; min-height: 36px; display: flex; align-items: center; }
.cutPlans h4 { margin: 12px 0 6px; }
.cutBoards { display: flex; flex-wrap: wrap; gap: 10px; }
.cutBoard { margin: 0; text-align: center; font-size: 12px; color: var(--muted, #a9b0a6); }
.cutBoard svg { width: 150px; height: auto; display: block; }
.cutBoard rect { fill: rgba(201, 166, 107, 0.25); stroke: var(--brass, #c9a66b); stroke-width: 0.5; }
.cutBoard rect.sheet { fill: rgba(255, 255, 255, 0.04); stroke: var(--line2, #555); stroke-width: 0.8; }
.cutBoard text { font-size: 5px; fill: var(--ink, #eee); text-anchor: middle; dominant-baseline: middle; }
.cutEdit { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 8px 0; align-items: end; }
.cutEdit label { display: grid; gap: 3px; font-size: 12.5px; color: var(--muted, #a9b0a6); }
.cutEdit label.chk, .cutGrid label.chk { display: flex; gap: 6px; align-items: center; }
.cutEdit input, .cutEdit select { min-height: 40px; }
.cutAdd { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
