:root {
  --ink: #1d1f1e; --green: #1f2a24; --mute: #716d66; --line: #dcd8d0; --stone: #f3f1ec; --stone-2: #e9e5dd; --white: #fff; --gold: #b8933e;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --r: 4px;
  color-scheme: light; box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--sans); font-weight: 300; font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--stone); -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.view { height: 100%; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }

/* ---------- top bar ---------- */
.bar { display: flex; align-items: center; gap: 28px; padding: 0 48px; height: 96px; flex: 0 0 auto; background: var(--white); border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; }
.wordmark img { height: 38px; width: auto; display: block; }
.bar-mid { display: flex; align-items: center; gap: 6px; margin: 0 auto; }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; position: relative; }
.ico { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 10px 16px; cursor: pointer; font-weight: 400; letter-spacing: .02em; border-bottom: 1px solid transparent; }
.ico:hover { border-bottom-color: var(--ink); }
.pill { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; background: transparent; border: 1px solid var(--ink); border-radius: var(--r); padding: 12px 26px; cursor: pointer; font-weight: 400; letter-spacing: .04em; position: relative; transition: background .2s, color .2s; }
.pill:hover { background: var(--ink); color: var(--white); }
.pill.solid { background: var(--green); color: var(--white); border-color: var(--green); }
.pill.solid:hover { background: #2f3f36; border-color: #2f3f36; }
.outline { display: inline-block; border: 1px solid currentColor; padding: 14px 36px; letter-spacing: .06em; font-weight: 400; transition: background .2s, color .2s; }
.outline:hover { background: var(--white); color: var(--ink); }
.round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); cursor: pointer; font-size: 20px; line-height: 1; }
.badge { position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--white); font-size: 11px; font-weight: 500; display: grid; place-items: center; }
.menu { position: absolute; right: 0; top: 56px; background: var(--white); border: 1px solid var(--line); padding: 6px; box-shadow: 0 20px 50px rgba(29,31,30,.14); display: flex; flex-direction: column; min-width: 200px; z-index: 20; }
.menu a, .menu button { text-align: left; background: none; border: 0; padding: 12px 14px; cursor: pointer; letter-spacing: .02em; }
.menu a:hover, .menu button:hover { background: var(--stone); }

/* ---------- library ---------- */
.lib-body { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.hero { position: relative; height: clamp(420px, 62vh, 680px); overflow: hidden; background: #2a2d2b; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,22,21,.62) 0%, rgba(20,22,21,.25) 55%, rgba(20,22,21,0) 100%); }
.hero-copy { position: absolute; left: 6%; top: 50%; transform: translateY(-50%); max-width: 560px; color: var(--white); z-index: 1; }
.hero-copy h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 6.2vw, 84px); line-height: 1; margin: 0 0 22px; letter-spacing: .01em; }
.hero-copy p { font-size: 18px; line-height: 1.6; margin: 0 0 34px; max-width: 46ch; }
.seg { display: inline-flex; border: 1px solid var(--line); background: var(--white); padding: 4px; margin: 56px auto 36px; position: relative; left: 50%; transform: translateX(-50%); }
.seg button { border: 0; background: none; padding: 10px 26px; cursor: pointer; letter-spacing: .04em; }
.seg button[aria-selected="true"] { background: var(--ink); color: var(--white); }
.seg button:disabled { color: var(--mute); cursor: not-allowed; }
.lib-tabs, .chips, .room-grid, .strip { margin-left: 48px; margin-right: 48px; }
.lib-tabs { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.tabs { display: flex; gap: 32px; }
.tabs button { border: 0; background: none; padding: 10px 0; font-family: var(--serif); font-size: 30px; font-weight: 500; cursor: pointer; border-bottom: 1.5px solid transparent; letter-spacing: .01em; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--ink); }
.tabs button:disabled { color: var(--mute); cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips button { background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 10px 20px; cursor: pointer; letter-spacing: .03em; font-weight: 400; }
.chips button:hover { border-color: var(--ink); }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 32px; margin-top: 36px; }
.card { position: relative; border: 0; padding: 0; background: var(--stone-2); overflow: hidden; cursor: pointer; aspect-ratio: 4/3; text-align: left; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.card:hover img { transform: scale(1.03); }
.card .size { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 26px 24px; color: var(--white); background: linear-gradient(to top, rgba(20,22,21,.72), transparent); display: flex; flex-direction: column; gap: 3px; }
.card .size b { font-family: var(--serif); font-size: 30px; font-weight: 400; line-height: 1.1; }
.card .size span { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.heart { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.92); border: 0; display: grid; place-items: center; cursor: pointer; }
.heart[aria-pressed="true"] svg { fill: var(--gold); stroke: var(--gold); }
.strip { display: flex; justify-content: center; gap: 64px; padding: 64px 0 72px; margin-top: 56px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.strip a { display: inline-flex; align-items: center; gap: 16px; font-size: 18px; letter-spacing: .02em; }
.strip-ico { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--ink); display: grid; place-items: center; }
.strip-ico svg { width: 24px; height: 24px; }

/* ---------- scene ---------- */
.scene-wrap { flex: 1; min-height: 0; padding: 28px 48px 20px; display: grid; place-items: center; }
.scene { position: relative; max-width: 100%; max-height: 100%; overflow: hidden; background: var(--stone-2); box-shadow: 0 30px 80px rgba(29,31,30,.18); }
#view { display: block; max-width: 100%; max-height: calc(100vh - 96px - 300px); width: auto; height: auto; }
.pins { position: absolute; inset: 0; pointer-events: none; }
.pin { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; background: rgba(255,255,255,.92); color: var(--ink); border: 0; padding: 10px 20px 10px 12px; border-radius: 999px; cursor: pointer; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; font-weight: 400; backdrop-filter: blur(8px); box-shadow: 0 8px 28px rgba(0,0,0,.22); }
.pin .tick { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--ink); display: grid; place-items: center; }
.pin .tick svg { width: 13px; height: 13px; stroke-width: 2; }
.pin.has .tick { background: var(--green); border-color: var(--green); color: var(--white); }
.pin:not(.has) .tick { color: transparent; }
.pin[aria-selected="true"] { background: var(--green); color: var(--white); }
.pin[aria-selected="true"] .tick { border-color: var(--white); }
.pin[aria-selected="true"].has .tick { background: var(--white); color: var(--green); }
.status { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); background: rgba(29,31,30,.9); color: var(--white); padding: 9px 18px; font-size: 13px; letter-spacing: .04em; }
.compare { position: absolute; inset: 0; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; }
#cmpB { clip-path: inset(0 0 0 var(--cut, 50%)); }
.cmp-handle { position: absolute; top: 0; bottom: 0; left: var(--cut, 50%); width: 1px; background: var(--white); cursor: ew-resize; }
.cmp-handle::after { content: "⇔"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: var(--white); color: var(--ink); display: grid; place-items: center; font-size: 18px; }
.cmp-tags { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; pointer-events: none; }
.cmp-tags span { background: rgba(255,255,255,.92); color: var(--ink); padding: 7px 14px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-actions { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.cmp-actions button { background: var(--white); border: 0; padding: 10px 18px; cursor: pointer; letter-spacing: .04em; }

/* ---------- drawer ---------- */
.drawer { flex: 0 0 auto; background: var(--white); border-top: 1px solid var(--line); padding: 0 48px 22px; }
.handle { width: 48px; height: 2px; background: var(--line); margin: 10px auto 8px; }
.tools { display: flex; justify-content: center; gap: 4px; }
.tools button { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 10px 20px; cursor: pointer; letter-spacing: .04em; font-weight: 400; border-bottom: 1px solid transparent; }
.tools button:hover { border-bottom-color: var(--ink); }
.tools button[aria-pressed="true"] { border-bottom-color: var(--ink); color: var(--green); }
.tools button:disabled { opacity: .3; cursor: not-allowed; border-bottom-color: transparent; }
.popover { margin: 10px auto 0; max-width: 900px; background: var(--stone); padding: 16px 22px; display: flex; flex-wrap: wrap; gap: 16px 36px; }
.pop-row { display: flex; align-items: center; gap: 14px; flex: 1 1 340px; }
.lbl { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); white-space: nowrap; display: flex; gap: 8px; }
.lbl output { color: var(--ink); }
.swatch-row { display: flex; gap: 8px; }
.swatch-row button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.swatch-row button[aria-pressed="true"] { outline: 1.5px solid var(--ink); outline-offset: 2px; border-color: var(--white); }
#groutCustom { width: 26px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; cursor: pointer; }
input[type=range] { accent-color: var(--green); flex: 1; }
.popover .chips { margin: 0; }
.popover .chips button { padding: 6px 14px; font-size: 14px; }
.size { display: flex; align-items: center; gap: 6px; }
.size input { width: 72px; padding: 7px 8px; border: 1px solid var(--line); background: var(--white); }
.tray { margin-top: 16px; }
.tray-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.tray-title { font-family: var(--serif); font-weight: 500; font-size: 28px; letter-spacing: .01em; }
.tray-tools { display: flex; gap: 6px; }
.tray-tools .ico { position: relative; padding: 6px 12px; }
.swatches { display: flex; gap: 20px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.sw { position: relative; flex: 0 0 150px; padding: 0; background: none; cursor: pointer; scroll-snap-align: start; }
.sw img { width: 150px; height: 150px; object-fit: cover; display: block; background: var(--stone-2); transition: opacity .2s; }
.sw:hover img { opacity: .9; }
.sw .name { display: block; margin-top: 8px; font-size: 12.5px; line-height: 1.35; color: var(--ink); white-space: normal; max-height: 2.7em; overflow: hidden; letter-spacing: .01em; }
.sw[aria-pressed="true"] img { outline: 1.5px solid var(--ink); outline-offset: 3px; }
.sw .heart { top: 8px; right: 8px; width: 32px; height: 32px; }
.sw .heart svg { width: 15px; height: 15px; }
.empty { color: var(--mute); padding: 40px 0; text-align: center; width: 100%; }

/* ---------- catalogue ---------- */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; top: 96px; background: var(--white); z-index: 30; display: flex; flex-direction: column; padding: 22px 48px; box-shadow: 0 -24px 60px rgba(29,31,30,.14); border-top: 1px solid var(--line); }
.sheet-head { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.sheet-head input, .sheet-head select { padding: 13px 18px; border: 1px solid var(--line); background: var(--white); letter-spacing: .02em; }
.sheet-head input { flex: 1; }
.cat-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 22px; align-content: start; }
.cat-grid .sw { flex: none; width: 100%; }
.cat-grid .sw img { width: 100%; height: auto; aspect-ratio: 1; }
.more { margin-top: 14px; background: none; border: 1px solid var(--ink); padding: 12px; cursor: pointer; letter-spacing: .06em; }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 34px; max-width: 500px; width: calc(100% - 40px); background: var(--white); }
dialog::backdrop { background: rgba(29,31,30,.5); }
dialog h2 { font-family: var(--serif); font-size: 36px; font-weight: 400; margin: 0 0 8px; line-height: 1.1; }
dialog p { margin: 0 0 18px; color: var(--mute); }
.dlg-row { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.dlg-row input { flex: 1; padding: 12px 14px; border: 1px solid var(--line); }
.dlg-row label { display: flex; align-items: center; gap: 10px; flex: 1; }
.dlg-row label input { width: 110px; flex: none; }
.est { background: var(--stone); padding: 16px 18px; margin-bottom: 16px; line-height: 1.7; }
.close { margin-top: 6px; }

body.kiosk .bar-mid #btnShare, body.kiosk .bar-right, body.kiosk .wordmark { pointer-events: none; }

@media (max-width: 900px) {
  .bar { padding: 0 18px; gap: 12px; height: 68px; }
  .wordmark img { height: 26px; }
  .bar-mid .ico span, .bar-mid .pill span { display: none; }
  .bar-mid .ico, .bar-mid .pill { padding: 10px; }
  .hero { height: 56vh; }
  .hero-copy { left: 20px; right: 20px; }
  .seg { margin: 32px auto 24px; }
  .lib-tabs, .chips, .room-grid, .strip { margin-left: 18px; margin-right: 18px; }
  .tabs button { font-size: 24px; }
  .room-grid { grid-template-columns: 1fr; gap: 18px; margin-top: 22px; }
  .strip { gap: 20px; padding: 36px 0; flex-direction: column; align-items: flex-start; }
  .scene-wrap { padding: 12px 12px 8px; }
  #view { max-height: calc(100vh - 68px - 300px); }
  .drawer { padding: 0 14px 14px; }
  .tools button { padding: 8px 10px; font-size: 14px; }
  .sw { flex-basis: 110px; }
  .sw img { width: 110px; height: 110px; }
  .sheet { top: 68px; padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { .card img, .sw img, .pill { transition: none; } }
