:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  color: #25231f;
  background: #f5f3ee;
  --paper: #fffefa;
  --muted: #6c675e;
  --border: #e2ded5;
  --accent: #8b3127;
  --accent-wash: #f5eae4;
  --ink: #28241f;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button, input, select, a, summary { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
p { margin: 0; color: var(--muted); line-height: 1.5; }
h1, h2 { margin: 0; }
a { color: inherit; }

.icon-library, .sr { position: absolute; width: 0; height: 0; overflow: hidden; }
button svg, label svg, summary svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: #efebe3; border-color: #ccc3b5; }
button[aria-pressed=true] { color: var(--accent); background: var(--accent-wash); border-color: var(--accent); }
button:disabled { cursor: default; opacity: .45; }
button.primary { color: white; background: var(--ink); border-color: var(--ink); }
button.primary:hover { background: #45392f; border-color: #45392f; }

.top {
  min-height: 69px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px max(28px, calc((100vw - 1536px) / 2));
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}
.brand img { width: 134px; display: block; }
.division { width: 1px; height: 24px; background: var(--border); }
.brand-caption { font-size: .85rem; color: var(--muted); }
.quiet { margin-left: auto; border-color: transparent; }

main { max-width: 1600px; margin: auto; padding: 0 32px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 29px 0 25px; }
.eyebrow { font-size: .7rem; font-weight: 700; letter-spacing: .18em; color: var(--accent); }
h1 {
  font: 400 clamp(2.8rem, 4.6vw, 5rem)/.97 Georgia, 'Times New Roman', serif;
  letter-spacing: -.065em;
  margin: 8px 0 9px;
}
.intro p:last-child { font-size: .96rem; }
.actions, .viewer-actions, .editing { display: flex; flex-wrap: wrap; gap: 8px; }
.actions { padding-bottom: 2px; }
.actions button { min-height: 44px; padding-inline: 15px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, 25%); align-items: stretch; gap: 16px; }
.viewer, .catalog { min-width: 0; background: var(--paper); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.viewer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 55px; padding: 8px 13px 8px 18px; }
.viewer-head strong { font-size: .92rem; }
.viewer-actions { gap: 4px; }
.viewer-actions button { min-height: 36px; border-color: transparent; font-size: .82rem; padding: 7px 9px; }
.viewer-actions button[aria-pressed=true] { border-color: #dfb7aa; }
.viewport {
  position: relative;
  isolation: isolate;
  background: #ded9cf;
  overflow: hidden;
  aspect-ratio: 1.72;
  display: grid;
  place-items: center;
}
.viewport.panoramic { aspect-ratio: 2.26; cursor: grab; touch-action: none; }
.viewport.panoramic:active { cursor: grabbing; }
.viewport.tracing { cursor: crosshair; }
#stage { position: absolute; top: 0; left: 0; }
canvas { display: block; width: 100%; height: 100%; }
#pins { position: absolute; inset: 0; pointer-events: none; }
.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  border-radius: 50%;
  min-height: 0;
  height: 34px;
  width: 34px;
  padding: 0;
  border: 2px solid white;
  background: #fffefa;
  box-shadow: 0 2px 10px #0005;
}
.pin[aria-pressed=true] { background: var(--accent); border-color: white; color: white; }
.panbar { display: flex; align-items: center; gap: 15px; padding: 10px 18px; background: #eeebe3; font-size: .85rem; }
.panbar input { flex: 1; }

.surface-panel { padding: 13px 16px 12px; }
.surface-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.surface-top h2 { font-size: .94rem; }
.surface-top button { border-color: transparent; min-height: 32px; padding: 5px 8px; }
#surfaces { display: flex; gap: 7px; flex-wrap: wrap; }
.surface { flex: 1; min-width: 130px; justify-content: start; text-align: left; padding: 7px 10px; min-height: 50px; }
.surface b, .surface small { display: block; }
.surface b { font-size: .82rem; }
.surface small { font-weight: 400; margin-top: 3px; font-size: .75rem; color: var(--muted); }
.mini { width: 28px; height: 28px; border-radius: 4px; background: #eeeae1 center/cover; border: 1px solid #0001; flex: none; }
.editing { margin-top: 6px; gap: 6px; }
.editing button { border-color: transparent; min-height: 32px; padding: 5px 8px; font-size: .8rem; }
.editing button.primary { border-color: var(--ink); }
#notice { font-size: .8rem; padding: 3px 0; }
#notice:empty { display: none; }

.catalog { display: flex; flex-direction: column; }
.catalog-head { padding: 19px 16px 13px; }
.catalog-head h2 { font: 400 2.05rem/1 Georgia, 'Times New Roman', serif; letter-spacing: -.045em; }
#target { font-size: .83rem; margin-top: 7px; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #f9f7f2;
  padding: 7px 9px;
  color: var(--muted);
  margin-top: 14px;
}
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search input { color: var(--ink); width: 100%; min-width: 0; border: 0; background: none; font-size: .87rem; outline: none; }
.filters { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.filters button { font-size: .77rem; padding: 4px 9px; min-height: 29px; }
#products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 0 16px 16px;
  max-height: 420px;
  overflow: auto;
  scroll-padding: 5px;
  align-content: start;
}
#products > p { grid-column: 1/-1; font-size: .86rem; padding-block: 8px; }
.product { position: relative; display: block; padding: 0 0 8px; text-align: left; overflow: hidden; }
.product:focus-visible { outline-offset: -3px; }
.product img { width: 100%; aspect-ratio: 1.43; display: block; object-fit: cover; background: #ede7dc; }
.product[aria-pressed=true]::after {
  content: '✓';
  position: absolute;
  top: 7px;
  right: 7px;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--accent);
  border-radius: 50%;
  font-size: .75rem;
}
.product strong, .product small { display: block; padding-inline: 8px; }
.product strong { font-size: .81rem; margin: 8px 0 4px; }
.product small { line-height: 1.3; font-size: .73rem; font-weight: 400; color: var(--muted); }

.settings { border-top: 1px solid var(--border); margin-top: auto; }
.settings summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.settings summary::-webkit-details-marker { display: none; }
.settings summary:hover { background: #f6f2e9; }
.settings summary .chevron { margin-left: auto; }
.settings[open] .chevron { transform: rotate(180deg); }
.settings-body { padding: 0 16px 16px; }
.settings p { font-size: .82rem; }
.settings fieldset { padding: 0; border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 0; min-width: 0; }
.settings fieldset:disabled { opacity: .55; }
.settings label { font-size: .79rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 5px; }
.settings select, .settings input { width: 100%; margin: 0; }
.settings select, .settings input[type=color] { border: 1px solid var(--border); border-radius: 4px; background-color: var(--paper); color: inherit; min-height: 31px; padding: 3px 6px; }
input[type=range] { accent-color: var(--accent); }

footer { display: flex; justify-content: space-between; gap: 12px; padding: 15px 0 19px; color: var(--muted); font-size: .76rem; }
footer a { text-decoration-color: #9e9484; text-underline-offset: 3px; }
dialog { width: min(650px, calc(100% - 28px)); border: 1px solid var(--border); border-radius: 8px; padding: 24px; background: var(--paper); color: inherit; }
dialog::backdrop { background: #25221bb0; }
dialog h2 { font: 400 2rem Georgia, 'Times New Roman', serif; letter-spacing: -.04em; margin-bottom: 6px; }
dialog li { margin-block: 8px; line-height: 1.45; }
.close { float: right; min-width: 38px; font-size: 1.1rem; }
#sceneGrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
#sceneGrid button { display: block; text-align: left; padding: 0; overflow: hidden; }
#sceneGrid img { width: 100%; aspect-ratio: 1.38; object-fit: cover; display: block; }
#sceneGrid span { display: block; padding: 8px; }

@media (max-width: 1000px) {
  main { padding-inline: 19px; }
  .top { padding-inline: 19px; }
  .layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; }
  .surface { min-width: 104px; }
}

@media (max-width: 740px) {
  .top { min-height: 58px; gap: 12px; }
  .brand img { width: 105px; }
  .brand-caption { font-size: .76rem; }
  .quiet { gap: 5px; padding-inline: 7px; }
  .intro { flex-direction: column; align-items: start; gap: 14px; padding-block: 22px 18px; }
  .layout { grid-template-columns: 1fr; }
  .viewport { aspect-ratio: 1.43; }
  #products { max-height: 390px; }
  .product img { aspect-ratio: 1.65; }
}

@media (max-width: 400px) {
  main, .top { padding-inline: 12px; }
  .actions { gap: 6px; }
  .actions button { padding-inline: 8px; font-size: .77rem; gap: 5px; }
  .viewer-head { padding-inline: 10px; }
  .viewer-actions button { padding-inline: 6px; }
  .viewer-actions button span { display: none; }
  #sceneGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: no-preference) {
  button, summary { transition: background-color .15s, color .15s, border-color .15s; }
}
.mini { display: grid; place-items: center; font-size: .75rem; color: #65534b; }
.wizard { max-width: 1320px; }
#steps { display:flex; gap:10px; flex-wrap:wrap; padding:21px 0; }
#steps button { border-radius:100px; font-weight:400; min-height:32px; padding:5px 12px; }
#steps button[aria-current=step] { color:var(--accent); border-color:var(--accent); font-weight:700; }
.wizard-card { padding:clamp(18px,3vw,35px); border:1px solid var(--border); background:var(--paper); border-radius:9px; min-width:0; }
.wizard-card h1 { font-size:clamp(2.1rem,4.3vw,4.4rem); margin:9px 0 15px; line-height:1; }
.wizard-card h2 { font:400 clamp(1.8rem,3vw,2.6rem)/1.08 Georgia,serif; letter-spacing:-.04em; margin:8px 0 12px; }
.wizard-card h3 { font-size:1rem; margin:19px 0 9px; }
.wizard-card label { display:grid; gap:5px; font-size:.84rem; font-weight:600; }
.wizard-card input:not([type=range]), .wizard-card textarea, .wizard-card select {
  padding:9px; border:1px solid var(--border); border-radius:5px; background:#fff; color:var(--ink); font:inherit; width:100%; min-height:38px;
}
.wizard-card input[type=color] { padding:4px; }
.hero-flow { display:grid; grid-template-columns:1fr 1.08fr; min-height:460px; overflow:hidden; border:1px solid var(--border); border-radius:9px; background:var(--paper); }
.hero-flow .wizard-card { border:0; border-radius:0; align-self:center; padding:clamp(20px,4vw,54px); }
.hero-flow figure { margin:0; min-height:320px; position:relative; }
.hero-flow figure img { position:absolute; width:100%; height:100%; object-fit:cover; }
.hero-flow figcaption { position:absolute; bottom:12px; right:12px; color:#fff; background:#28241fcf; padding:6px 9px; border-radius:4px; font-size:.75rem; }
.flow-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:17px; }
.workspace-flow { display:grid; grid-template-columns:minmax(0,1fr) minmax(340px,.95fr); align-items:start; gap:16px; }
.room-pane { position:sticky; top:12px; padding:12px; border:1px solid var(--border); border-radius:8px; background:var(--paper); }
.room-pane > p { padding:8px 3px 1px; font-size:.83rem; }
.mark-photo { position:relative; }
.mark-photo img { width:100%; display:block; border-radius:5px; }
.mark-photo.marking { cursor:crosshair; }
.marker { position:absolute; transform:translate(-50%,-50%); border-radius:50%; display:grid; place-items:center; width:28px; height:28px; background:var(--accent); color:#fff; border:2px solid #fff; pointer-events:none; font-size:.75rem; box-shadow:0 1px 6px #0007; }
.zone-tabs { display:flex; flex-wrap:wrap; gap:6px; margin:13px 0; }
.zone-tabs button { font-size:.78rem; padding:5px 9px; min-height:32px; }
.field-grid { display:grid; grid-template-columns:1fr 1fr; gap:11px; margin:10px 0; }
.wide { grid-column:1/-1; }
.swatch-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; max-height:275px; overflow:auto; margin:10px 0; }
.swatch-list button { display:block; padding:0 0 6px; text-align:left; overflow:hidden; font-size:.76rem; }
.swatch-list img { width:100%; aspect-ratio:1.6; display:block; object-fit:cover; margin-bottom:5px; }
.swatch-list span { display:block; padding:2px 6px; }
.swatch-list small { display:block; padding:0 6px; color:var(--muted); }
details.placement { margin:13px 0; padding:9px 11px; border:1px solid var(--border); border-radius:5px; }
.placement summary { cursor:pointer; font-size:.9rem; font-weight:700; }
.zone-summary { display:grid; gap:7px; padding:0; list-style:none; }
.zone-summary li { background:#f5f1e8; padding:10px 12px; border-radius:4px; font-size:.85rem; }
.message { margin-top:12px; background:var(--accent-wash); color:var(--accent); padding:12px 14px; border-radius:6px; }
.notice { font-size:.83rem; margin-top:11px; }
.result-flow img { display:block; width:100%; max-height:65vh; object-fit:contain; background:#eee8de; border-radius:5px; margin-top:12px; }
.view-strip { display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); gap:9px; margin-top:12px; }
.view-strip figure { padding:8px; border:1px solid var(--border); border-radius:5px; margin:0; }
.view-strip img { width:100%; aspect-ratio:1.45; object-fit:cover; border-radius:3px; }
.view-strip figcaption { font-size:.78rem; padding-bottom:5px; }
.view-strip button { min-height:29px; padding:4px 7px; }
#sphere { width:100%; display:block; background:#ddd2c4; aspect-ratio:1.75; border-radius:5px; cursor:grab; touch-action:none; margin:14px 0; }
#progress progress { width:100%; margin:13px 0; accent-color:var(--accent); }
.capture-dialog .qr { display:block; width:min(250px,100%); aspect-ratio:1; height:auto; margin:14px auto; }
.close-capture { float:right; }
.capture-network { margin:8px 0; font-size:.86rem; }
.capture-link { display:inline-block; margin:5px 0; }
body > main:not(.wizard) .stack { display:grid; gap:12px; padding:12px 0; }
body > main:not(.wizard) p { margin-bottom:10px; }
@media(max-width:760px){
  .hero-flow,.workspace-flow { grid-template-columns:1fr; }
  .hero-flow figure { min-height:220px; }
  .room-pane { position:static; }
  #steps { padding:12px 0; gap:5px; }
  #steps button { padding:4px 8px; font-size:.72rem; }
}
.design-swatches { max-height:none; }

/* Editorial presentation and project flow */
:root {
  background:#f6f4ef;
  --paper:#fffdf9;
  --border:#ded9cf;
  --accent:#a3342b;
  --accent-wash:#f5e9e4;
  --ink:#211f1b;
}
.top { min-height:76px; }
.brand img { width:150px; }
.brand-site { margin-left:auto; text-decoration:none; font-size:.83rem; font-weight:600; }
.brand-site span { margin-left:4px; color:var(--accent); }
.wizard { max-width:1440px; }
.hero-flow {
  margin-top:26px;
  min-height:clamp(480px,42vw,680px);
  grid-template-columns:minmax(0,.87fr) minmax(0,1.13fr);
  border:0;
  border-radius:3px;
  background:#292723;
  color:#fffdf8;
}
.hero-flow .wizard-card {
  padding:clamp(30px,5vw,82px);
  background:none;
}
.hero-flow .eyebrow { color:#f2977b; letter-spacing:.22em; }
.hero-flow h1 { font-size:clamp(2.8rem,5.3vw,5.8rem); line-height:.98; margin:18px 0 22px; letter-spacing:-.062em; }
.hero-flow .wizard-card > p:not(.eyebrow) { color:#e1d9ce; max-width:390px; }
.hero-flow .flow-actions { margin-top:28px; gap:10px; }
.hero-flow button { min-height:48px; padding:10px 15px; border-color:#8c8276; color:#fffdf9; }
.hero-flow button:hover { background:#433e37; border-color:#fffdf9; }
.hero-flow button.primary { background:#fffaf1; color:#25211e; border-color:#fffaf1; }
.hero-flow button.primary:hover { background:#e8dcd0; border-color:#e8dcd0; }
.hero-flow .notice { margin-top:15px; font-size:.8rem; }
.hero-flow figure img { object-position:52% 49%; }
.hero-flow figcaption { bottom:18px; right:18px; background:#221f1be8; border-radius:3px; }
.flow-overview { padding:29px 0 20px; border-bottom:1px solid var(--border); }
.flow-overview h2 { font:400 clamp(1.65rem,3vw,2.3rem) Georgia,serif; letter-spacing:-.045em; }
.flow-overview ol { display:grid; grid-template-columns:repeat(4,1fr); gap:0; padding:0; margin:14px 0 0; list-style:none; }
.flow-overview li { padding:12px 16px 10px; border-left:1px solid var(--border); }
.flow-overview li:first-child { padding-left:0; border-left:0; }
.flow-overview strong { display:block; margin-bottom:5px; font-size:.91rem; }
.flow-overview span { color:var(--muted); font-size:.85rem; line-height:1.4; }
#steps { padding:23px 0 18px; gap:4px; }
#steps button { border:0; border-bottom:2px solid transparent; border-radius:0; padding:7px 12px 10px; }
#steps button[aria-current=step] { background:none; border-bottom-color:var(--accent); }
.workspace-flow { gap:22px; }
.workspace-flow .wizard-card { border-radius:4px; padding:clamp(18px,2.5vw,34px); }
.workspace-flow h2,.result-flow h2 { font-size:clamp(2.15rem,3.6vw,3.4rem); }
.room-pane { padding:0; border-radius:4px; overflow:hidden; }
.mark-photo img { border-radius:0; }
.room-pane > p { padding:12px 15px; }
.swatch-list { gap:9px; }
.design-swatches { margin-top:18px; }
.swatch-list button { position:relative; padding:0 0 7px; text-wrap:pretty; }
.swatch-list button[aria-pressed=true]::after {
  content:'✓'; display:grid; place-items:center; position:absolute; top:6px; right:6px;
  width:22px; height:22px; border-radius:50%; background:var(--accent); color:white; font-size:.75rem;
}
.swatch-list img { aspect-ratio:1.55; }
.swatch-list span { font-size:.85rem; }
.swatch-list .product-use { margin-top:3px; font-size:.69rem; }
.field-grid { gap:13px; }
.zone-tabs { margin:17px 0; }
.zone-tabs button { border-radius:100px; padding-inline:12px; }
.result-flow img { max-height:70vh; }
@media(max-width:960px){
  .hero-flow { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .hero-flow .wizard-card { padding:30px; }
  .hero-flow h1 { font-size:clamp(2.7rem,6vw,4.3rem); }
}
@media(max-width:760px){
  .top { min-height:63px; }
  .brand img { width:108px; }
  .brand-site { font-size:.72rem; }
  .hero-flow { margin-top:13px; grid-template-columns:1fr; min-height:0; }
  .hero-flow .wizard-card { padding:23px 19px; }
  .hero-flow h1 { margin:12px 0 15px; }
  .hero-flow .flow-actions { margin-top:18px; }
  .hero-flow button { min-height:42px; font-size:.81rem; }
  .hero-flow figcaption { right:8px; bottom:8px; }
  .flow-overview { padding:20px 0 15px; }
  .flow-overview ol { grid-template-columns:repeat(2,1fr); gap:8px 0; }
  .flow-overview li:nth-child(3) { padding-left:0; border-left:0; }
  #steps { padding-block:12px; gap:0; }
  #steps button { padding-inline:6px; }
  .workspace-flow { gap:12px; }
  .swatch-list span { font-size:.77rem; }
}

/* Surface assignments share identifiers and colours with the photo. */
.placement-flow { grid-template-columns:minmax(0,1.12fr) minmax(355px,.96fr); }
.map-head { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:12px 15px; }
.map-head h3 { margin:0; font-size:.95rem; }
.map-head span,.map-caption span { color:var(--muted); font-size:.8rem; }
.map-caption { padding:13px 15px; display:grid; gap:4px; font-size:.9rem; }
.zone-map .marking { outline:3px solid var(--accent); outline-offset:-3px; }
.zone-map .marker { pointer-events:auto; width:36px; height:36px; min-height:0; padding:0; color:white; background:var(--zone-color); border:2px solid white; }
.zone-map .marker:hover,.zone-map .marker[aria-pressed=true] { background:var(--zone-color); color:white; border-color:white; }
.zone-map .marker[aria-pressed=true] { outline:2px solid var(--zone-color); outline-offset:2px; }
.zone-map .marking .marker { pointer-events:none; }
.zone-cards { display:grid; gap:6px; margin-top:16px; }
.zone-card { width:100%; justify-content:flex-start; text-align:left; gap:10px; padding:8px; min-height:55px; }
.zone-card[aria-pressed=true] { color:var(--ink); background:#f7f1e9; border-color:var(--zone-color); }
.zone-number { display:inline-grid; place-items:center; width:26px; height:26px; flex:none; border-radius:50%; color:white; background:var(--zone-color); font-size:.79rem; font-weight:700; }
.zone-info { flex:1; display:grid; min-width:0; gap:2px; }
.zone-info small { font-weight:400; color:var(--muted); font-size:.76rem; }
.zone-card img,.empty-tile { width:42px; height:39px; flex:none; object-fit:cover; border-radius:4px; }
.empty-tile { border:1px dashed var(--border); }
.zone-add,.zone-mark-actions { display:flex; gap:7px; flex-wrap:wrap; margin-top:8px; }
.zone-add button { font-size:.8rem; min-height:34px; }
.zone-editor { margin-top:18px; border-top:1px solid var(--border); padding-top:13px; }
.zone-editor > h3:first-child { display:flex; align-items:center; gap:8px; margin-top:0; }
@media(max-width:760px){.placement-flow { grid-template-columns:minmax(0,1fr); } .zone-map .marker{width:33px;height:33px;} }
.zone-heading { display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; gap:6px; margin-top:18px; }
.zone-heading h3 { margin:0; }
.zone-heading span { font-size:.77rem; color:var(--muted); }
.zone-cards { margin-top:8px; }
.zone-action-label { font-size:.81rem; font-weight:700; margin-top:12px; }
.placement-flow .swatch-list button { min-height:0; }
.placement-flow .swatch-list img { aspect-ratio:1.8; }
@media(max-width:400px){
  .zone-heading span { font-size:.72rem; }
  .placement-flow .wizard-card { padding:14px; }
  .placement-flow .swatch-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .placement-flow .field-grid { grid-template-columns:minmax(0,1fr); }
}

@media (min-width:761px) {
  .placement-flow .zone-map {
    position:sticky;
    top:12px;
    align-self:start;
  }

  .zone-map .mark-photo {
    width:fit-content;
    max-width:100%;
    margin-inline:auto;
  }

  .zone-map .mark-photo img {
    width:auto;
    max-width:100%;
    max-height:calc(100dvh - 150px);
  }
}
.zone-description { margin-top:10px; }
.zone-description summary { font-size:.83rem; color:var(--muted); cursor:pointer; }
#pending-zones:empty { display:none; }
#pending-zones:not(:empty) { padding:9px 11px; border-left:3px solid var(--accent); background:var(--accent-wash); color:var(--ink); }

/* White-label studio */
:root { --ink:#202222; --paper:#fff; --muted:#575b58; --border:#dedfdb; --accent:#30594e; --accent-wash:#e9f0ec; background:#f5f6f3; }
.studio-top { min-height:65px; gap:12px; }
.studio-brand { padding:0; border:0; font-size:1rem; }
.studio-brand:hover { background:none; }
.studio-symbol { display:grid; place-items:center; width:33px; height:33px; color:#fff; background:var(--accent); border-radius:8px; font-size:1.35rem; }
.header-favorites { margin-left:auto; }
.room-intro { padding:30px 0 21px; }
.room-intro h1 { font:600 clamp(2.4rem,5vw,4.3rem)/1.02 Arial,sans-serif; letter-spacing:-.065em; margin:8px 0; }
.rooms-home { padding-bottom:5px; }
.room-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:13px; }
.room-choice { display:block; text-align:left; padding:0; min-width:0; background:white; overflow:hidden; border-radius:10px; }
.room-choice img { width:100%; aspect-ratio:.91; object-fit:cover; display:block; transition:filter .18s; }
.room-choice:hover img { filter:brightness(.97); }
.room-choice > span { display:flex; justify-content:space-between; align-items:center; padding:13px; font-size:1rem; }
.room-choice > span span { color:var(--accent); }
.personal-room { margin-top:17px; display:flex; justify-content:space-between; align-items:center; gap:12px; padding:16px 18px; background:white; border:1px solid var(--border); border-radius:10px; }
.personal-room h2 { font-size:1.05rem; margin-bottom:3px; }
.personal-room p { font-size:.88rem; }
.personal-room .flow-actions { margin:0; flex-shrink:0; }
.project-flow { display:grid; grid-template-columns:minmax(0,1fr) minmax(320px,32%); gap:15px; align-items:start; }
.project-main { display:grid; gap:12px; min-width:0; }
.project-main .room-pane { position:static; background:#fff; }
.project-main .zone-map .mark-photo { width:fit-content; max-width:100%; margin:auto; }
.project-main .zone-map .mark-photo > img { display:block; width:auto; max-width:100%; max-height:calc(100dvh - 185px); margin:auto; }
.project-main .map-caption { background:#fbfcfa; }
.zone-map .marker { display:flex; align-items:center; justify-content:center; min-width:35px; width:auto; height:35px; padding:0 6px; gap:4px; border-radius:24px; }
.zone-map .marker img { width:19px; height:19px; object-fit:cover; border-radius:50%; }
.zone-map .drop-ready { outline:3px dashed var(--accent); outline-offset:-4px; }
.project-main .zone-card[aria-pressed=true] { background:var(--accent-wash); }
.project-main .zone-panel { padding:17px; border-radius:8px; }
.project-main .zone-panel h2 { font:600 clamp(1.35rem,2.4vw,2rem)/1.12 Arial,sans-serif; letter-spacing:-.045em; margin:0 0 7px; }
.active-material { margin-top:10px; font-weight:600; color:var(--ink); font-size:.85rem; }
.side-catalog { display:flex; flex-direction:column; position:sticky; top:12px; max-height:calc(100dvh - 24px); min-width:0; border:1px solid var(--border); border-radius:10px; overflow:auto; background:white; }
.side-catalog-head { padding:17px 15px 8px; }
.side-catalog h2 { font:600 1.7rem/1.15 Arial,sans-serif; letter-spacing:-.055em; margin:4px 0 6px; }
.side-catalog p:not(.eyebrow) { font-size:.82rem; }
.catalog-search { margin-top:12px; }
.catalog-search,.catalog-filters label { display:grid; gap:4px; font-size:.77rem; font-weight:600; }
.catalog-search input,.catalog-filters select { width:100%; min-width:0; padding:7px; font:inherit; min-height:35px; border:1px solid var(--border); border-radius:5px; background:white; color:var(--ink); }
.catalog-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 8px; margin-top:8px; }
.catalog-target { display:flex; justify-content:space-between; align-items:center; gap:5px; margin-top:9px; font-size:.85rem; }
.catalog-target button { border:0; min-height:28px; padding:4px 6px; font-size:.75rem; }
.tile-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-content:start; gap:7px; padding:0 15px 12px; }
.tile-product { display:block; padding:0; text-align:left; overflow:hidden; cursor:grab; align-self:stretch; }
.tile-product:active { cursor:grabbing; }
.tile-product img { display:block; width:100%; aspect-ratio:1.8; object-fit:cover; }
.tile-product-info { display:grid; gap:3px; padding:7px; }
.tile-product small { font-size:.69rem; line-height:1.25; font-weight:400; color:var(--muted); }
.tile-product[aria-pressed=true] .tile-product-info strong::after { content:' ✓'; }
.tile-empty { grid-column:1/-1; padding:8px 0; }
.catalog-generate { position:sticky; bottom:0; margin-top:auto; padding:10px 15px; background:white; border-top:1px solid var(--border); }
.catalog-generate button { width:100%; }
.mobile-catalog-link { display:none; margin-top:7px; }
#favorite-list { display:grid; gap:12px; margin-top:12px; max-height:65vh; overflow:auto; }
#favorite-list article { border:1px solid var(--border); padding:9px; border-radius:7px; }
#favorite-list img { width:100%; max-height:230px; object-fit:contain; display:block; margin-bottom:7px; background:#f5f6f3; }
#favorite-list .flow-actions { margin-top:7px; }
@media(max-width:900px){.room-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } .room-choice img { aspect-ratio:1.15; }}
@media(max-width:760px){
  .project-flow { grid-template-columns:minmax(0,1fr); }
  .side-catalog { position:static; max-height:none; }
  .project-main .zone-map .mark-photo > img { max-height:70dvh; }
  .mobile-catalog-link { display:inline-flex; }
  .personal-room { align-items:start; flex-direction:column; }
  .room-grid { gap:7px; }
  .room-choice > span { padding:8px; font-size:.8rem; }
  .room-choice img { aspect-ratio:.93; }
  .room-intro { padding:18px 0 13px; }
}
.map-caption .zone-add { margin-top:5px; }
@media(min-width:761px){
  .project-main { display:contents; }
  .project-main .room-pane { position:sticky; top:12px; grid-column:1; grid-row:1 / span 2; align-self:start; }
  .project-main .zone-map .mark-photo > img { max-height:calc(100dvh - 196px); }
  .project-flow .side-catalog { position:relative; top:auto; grid-column:2; grid-row:1; max-height:calc(100dvh - 36px); }
  .project-flow .zone-panel { grid-column:2; grid-row:2; }
}
.map-assignments { display:flex; gap:5px; flex-wrap:wrap; margin-top:4px; }
.map-assignments button { display:grid; grid-template-columns:auto 1fr; text-align:left; justify-items:start; gap:1px 6px; min-height:34px; padding:3px 7px; font-size:.75rem; }
.map-assignments .zone-number { grid-row:1 / span 2; width:19px; height:19px; font-size:.68rem; }
.map-assignments small { grid-column:2; font-size:.68rem; color:var(--muted); font-weight:400; }
@media(min-width:761px){
  .project-flow .side-catalog { max-height:calc(100dvh - 145px); }
  .project-main .zone-map .mark-photo > img { max-height:calc(100dvh - 232px); }
}

.startup {
  position:fixed; z-index:100; inset:0; display:grid; place-items:center; overflow:hidden;
  background:#23221f; color:#fff; transition:opacity .32s ease,visibility .32s ease;
}
.startup-done { opacity:0; visibility:hidden; pointer-events:none; }
.startup-grid {
  position:absolute; inset:-35%; opacity:.48; transform:rotate(-16deg);
  background:
    radial-gradient(ellipse at center,#c98a591c 0%,transparent 59%),
    repeating-linear-gradient(0deg,transparent 0 84px,#e5cbb02a 85px 86px),
    repeating-linear-gradient(90deg,transparent 0 84px,#e5cbb02a 85px 86px);
  animation:opening-grid 1.35s cubic-bezier(.2,.8,.2,1) both;
}
.startup-card { z-index:1; width:min(320px,78vw); text-align:center; animation:opening-mark .68s cubic-bezier(.2,.8,.2,1) both; }
.startup-logo { background:#fdfbf5; padding:22px 24px; border-radius:14px; box-shadow:0 18px 80px #0006; }
.startup-logo img { width:min(230px,100%); height:auto; display:block; margin:auto; }
.startup-card p { margin:16px 0 12px; color:#efece4; font-size:.86rem; letter-spacing:.12em; }
.loading-track { height:3px; overflow:hidden; border-radius:5px; background:#c7cec96b; }
.loading-track::before { content:''; display:block; width:45%; height:100%; background:var(--accent); border-radius:inherit; animation:loading-sweep 1.25s ease-in-out infinite; }
.startup .loading-track::before { background:#f1b55a; }
.generation-dialog { width:min(450px,calc(100% - 26px)); padding:30px; text-align:center; }
.generation-dialog::backdrop { background:#1b201ec4; backdrop-filter:blur(4px); }
.generation-dialog .loading-track { margin:17px 0 12px; }
.generation-dialog .generation-note { font-size:.8rem; }
.generation-visual { width:76px; height:76px; display:grid; grid-template-columns:repeat(2,1fr); gap:5px; margin:0 auto 19px; transform:rotate(-8deg); }
.generation-visual span { border-radius:6px; background:var(--accent); animation:tile-breathe 1.55s ease-in-out infinite; }
.generation-visual span:nth-child(2) { animation-delay:.18s; }
.generation-visual span:nth-child(3) { animation-delay:.42s; }
.generation-visual span:nth-child(4) { animation-delay:.28s; }
@keyframes opening-mark { from { opacity:0; transform:translateY(12px) scale(.94); } to { opacity:1; transform:none; } }
@keyframes opening-grid { from { opacity:0; transform:rotate(-20deg) scale(1.11); } to { opacity:.48; transform:rotate(-16deg); } }
@keyframes loading-sweep { from { transform:translateX(-105%); } to { transform:translateX(325%); } }
@keyframes tile-breathe { 0%,100% { opacity:.34; transform:scale(.91); } 50% { opacity:1; transform:scale(1); } }
@media(prefers-reduced-motion:reduce) {
  .startup,.startup-grid,.startup-card,.loading-track::before,.generation-visual span { animation:none; transition:none; }
  .loading-track::before { transform:translateX(60%); }
}

/* Room editor and material inspection */
.room-choice,.side-catalog,.project-main .zone-panel,.project-main .room-pane { border-radius:12px; }
.room-choice:focus-visible,.tile-product:focus-visible,.marker:focus-visible { outline:3px solid var(--accent); outline-offset:-3px; }
.side-catalog-head { padding:21px 20px 12px; }
.side-catalog h2 { font-size:1.95rem; }
.side-catalog-head > p:nth-of-type(2) { line-height:1.5; max-width:36ch; }
.catalog-search { margin-top:16px; }
.catalog-search input,.catalog-filters select { min-height:40px; padding:9px 10px; }
.catalog-filters { gap:9px 11px; margin-top:11px; }
.catalog-target { padding-top:9px; margin-top:11px; border-top:1px solid var(--border); }
.tile-list { gap:10px; padding:0 20px 15px; }
.tile-product { border-radius:7px; }
.tile-product-info { padding:9px; gap:4px; }
.catalog-generate { padding:12px 20px; }
.catalog-generate .primary { min-height:44px; background:var(--accent); border-color:var(--accent); }
.catalog-generate .primary:hover { background:#24463d; border-color:#24463d; }
.map-assignments button { padding:6px 8px; }
.zone-map .marker:hover,.zone-map .marker:focus-visible { z-index:2; }
.zone-map .marker:focus-visible { outline-offset:3px; }
.marker-tip {
  position:absolute; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%) translateY(3px);
  display:grid; gap:2px; width:max-content; max-width:160px; text-align:left; white-space:normal;
  padding:8px 10px; background:#252b28; color:white; border-radius:7px;
  box-shadow:0 3px 14px #141a1640; opacity:0; pointer-events:none; transition:opacity .16s,transform .16s;
}
.marker-tip strong { font-size:.8rem; }
.marker-tip small { font-size:.73rem; font-weight:400; }
.marker-tip small:last-child { opacity:.8; }
.zone-map .marker:hover .marker-tip,.zone-map .marker:focus-visible .marker-tip { opacity:1; transform:translateX(-50%); }
.zone-map .marker.tip-below .marker-tip { bottom:auto; top:calc(100% + 8px); }
.zone-map .marker.tip-right .marker-tip { left:0; transform:none; }
.zone-map .marker.tip-left .marker-tip { left:auto; right:0; transform:none; }

#zoom-dialog { width:min(1160px,calc(100% - 24px)); max-height:94dvh; padding:0; border:1px solid var(--border); border-radius:13px; overflow:auto; }
#zoom-dialog::backdrop { background:#151916d9; }
.zoom-header { display:flex; align-items:start; justify-content:space-between; gap:12px; padding:17px 20px 12px; }
.zoom-header h2 { margin:0; }
.zoom-header p { margin:4px 0 0; font-size:.84rem; }
.zoom-header button { min-width:42px; }
.zoom-controls { display:flex; align-items:center; flex-wrap:wrap; gap:9px; padding:0 20px 13px; }
.zoom-controls label { min-width:9rem; font-size:.86rem; }
.zoom-controls input { flex:1; min-width:65px; max-width:260px; }
.zoom-controls button { min-width:40px; }
#zoom-viewport { height:clamp(200px,66dvh,820px); overflow:auto; background:var(--field); overscroll-behavior:contain; }
#zoom-image { display:block; height:auto; max-width:none; margin:auto; user-select:none; }
#zoom-viewport.can-pan { cursor:grab; }
#zoom-viewport.can-pan:active { cursor:grabbing; }
@media(max-width:420px) {
  .zoom-header,.zoom-controls { padding-inline:12px; }
  .zoom-controls label { min-width:auto; }
  .side-catalog-head,.tile-list,.catalog-generate { padding-inline:15px; }
}

.startup { background:radial-gradient(ellipse at 51% 38%,#47372c 0%,#262520 55%,#1d231f 100%); }
.startup-card { width:min(392px,76vw); animation:opening-mark .85s cubic-bezier(.16,1,.3,1) both; }
.startup-logo { position:relative; isolation:isolate; overflow:hidden; border-radius:12px; padding:25px 27px; }
.startup-logo::after { content:''; position:absolute; inset:0; background:linear-gradient(108deg,transparent 25%,#ffffff80 48%,transparent 72%); transform:translateX(-110%); animation:brand-shine .84s .38s ease both; pointer-events:none; }
.startup-logo img { width:100%; max-width:288px; }
.startup-orbit { position:absolute; inset:0; display:grid; place-items:center; pointer-events:none; }
.startup-orbit i { position:absolute; width:clamp(260px,43vw,620px); aspect-ratio:1; border:1px solid #e7c8a955; border-radius:28px; opacity:0; animation:brand-tile 1.35s cubic-bezier(.18,.72,.29,1) both; }
.startup-orbit i:nth-child(2) { animation-delay:.12s; width:clamp(250px,50vw,760px); }
.startup-orbit i:nth-child(3) { animation-delay:.21s; width:clamp(240px,59vw,850px); }
.startup-orbit i:nth-child(4) { animation-delay:.30s; width:clamp(230px,65vw,940px); }
@keyframes brand-shine { to { transform:translateX(105%); } }
@keyframes brand-tile { 0% { opacity:0; transform:rotate(34deg) scale(.55); } 53% {opacity:.7} 100% { opacity:.13; transform:rotate(23deg) scale(1); } }

.generation-dialog { width:min(520px,calc(100% - 24px)); padding:0; border-radius:16px; overflow:hidden; text-align:left; }
.generation-art { height:clamp(145px,24vh,250px); overflow:hidden; position:relative; background:#363c37; }
.generation-art > img { display:block; width:100%; height:100%; object-fit:cover; opacity:.77; }
.generation-glass { position:absolute; inset:0; background:linear-gradient(0deg,#171e1ce8,transparent 80%); }
.generation-glass::after { content:''; width:100%; height:75%; position:absolute; left:0; top:0; background:linear-gradient(0deg,transparent,#e9f6ea55,transparent); animation:generation-scan 3.75s ease-in-out infinite; }
.generation-samples { position:absolute; bottom:17px; left:24px; display:flex; gap:7px; }
.generation-samples img { width:47px; height:47px; border:1px solid #ffffffb3; border-radius:7px; object-fit:cover; box-shadow:0 6px 16px #0005; animation:sample-float 3.75s ease-in-out infinite; }
.generation-samples img:nth-child(2) { animation-delay:.2s; }
.generation-samples img:nth-child(3) { animation-delay:.4s; }
.generation-samples img:nth-child(4) { animation-delay:.6s; }
.generation-body { padding:21px 24px 24px; min-height:224px; }
.generation-body h2 { font:600 clamp(1.55rem,4vw,2.25rem)/1.05 Arial,sans-serif; margin:6px 0 10px; }
#progress-status { min-height:2.4em; }
.generation-detail { background:var(--accent-wash); border:1px solid #d4e2d8; border-radius:8px; padding:10px 12px; min-height:76px; }
.generation-detail span { color:var(--accent); font-weight:700; font-size:.81rem; }
.generation-detail p { color:var(--ink); font-size:.84rem; margin-top:3px; }
@keyframes generation-scan { 0% {transform:translateY(-95%);} 60%,100% {transform:translateY(150%);} }
@keyframes sample-float { 0%,60%,100% {transform:translateY(0);} 29% {transform:translateY(-5px);} }
@media(prefers-reduced-motion:reduce) {
  .startup-card,.startup-orbit i,.startup-logo::after,.generation-glass::after,.generation-samples img { animation:none; }
  .startup-logo::after,.generation-glass::after { display:none; }
  .marker-tip { transition:none; }
}

.room-intro h2 { font:600 clamp(2rem,4.3vw,3.75rem)/1.03 Arial,sans-serif; letter-spacing:-.065em; margin:8px 0; }

.room-opening { background:radial-gradient(ellipse at 50% 57%,#3a342b 0%,#201f1a 53%,#141613 100%); }
.room-opening .startup-grid { opacity:.26; }
.opening-brand { position:absolute; inset:clamp(18px,4vh,42px) auto auto clamp(18px,4vw,58px); width:clamp(103px,13vw,164px); padding:9px 12px; border-radius:5px; background:#f7f4eb; z-index:1; }
#opening-room { width:min(92vw,1200px); height:min(75svh,690px); display:block; margin-top:-5svh; }
.opening-caption { position:absolute; inset:auto 20px clamp(22px,5svh,60px); display:grid; gap:7px; justify-items:center; text-align:center; }
.opening-caption span { font-size:.66rem; letter-spacing:.21em; color:#d9ba8b; }
.opening-caption strong { font:400 clamp(1.35rem,3.2vw,2.35rem)/1.1 Georgia,serif; color:#f5eee0; }
.opening-caption .loading-track { width:min(180px,46vw); margin-top:4px; }
@media(max-width:600px){ #opening-room{width:99vw;height:65svh;} }
.opening-brand { inset:clamp(17px,4svh,45px) auto auto 50%; transform:translateX(-50%); width:clamp(143px,18vw,230px); padding:11px 15px; box-shadow:0 10px 35px #0005; }

/* Shared surfaces and contrast for both themes. */
:root {
  color-scheme:light; --page:#f4f5f1; --paper:#fff; --subtle:#f7f8f5; --ink:#212824;
  --muted:#555e58; --border:#dce1db; --accent:#315c50; --accent-wash:#e7f1eb;
  --solid:#315c50; --solid-hover:#25483f; --on-solid:#fff; --field:#fff;
  --veil:#171f1bcc; --panel-shadow:0 8px 24px #18261d07;
}
:root[data-theme=dark] {
  color-scheme:dark; --page:#161a18; --paper:#202622; --subtle:#252d28; --ink:#eef3ee;
  --muted:#b3c1b7; --border:#3c4941; --accent:#a0d5c0; --accent-wash:#2a4137;
  --solid:#aad9c6; --solid-hover:#c3e6d8; --on-solid:#162720; --field:#191f1b;
  --veil:#080b0add; --panel-shadow:0 8px 24px #090f0b30;
}
@media(prefers-color-scheme:dark) {
  :root:not([data-theme]) {
    color-scheme:dark; --page:#161a18; --paper:#202622; --subtle:#252d28; --ink:#eef3ee;
    --muted:#b3c1b7; --border:#3c4941; --accent:#a0d5c0; --accent-wash:#2a4137;
    --solid:#aad9c6; --solid-hover:#c3e6d8; --on-solid:#162720; --field:#191f1b;
    --veil:#080b0add; --panel-shadow:0 8px 24px #090f0b30;
  }
}
:root,body { background:var(--page); color:var(--ink); }
:focus-visible { outline-color:var(--accent); }
.studio-top { background:var(--paper); border-color:var(--border); min-height:68px; }
.studio-symbol { background:var(--solid); color:var(--on-solid); }
.header-actions { display:flex; gap:10px; align-items:center; margin-left:auto; }
.theme-switch { display:flex; gap:2px; align-items:center; padding:3px; background:var(--subtle); border:1px solid var(--border); border-radius:8px; }
.theme-switch button { min-height:32px; padding:4px 7px; border:1px solid transparent; font-size:.79rem; }
.theme-switch button[aria-pressed=true] { background:var(--paper); border-color:var(--border); color:var(--accent); }
.theme-switch button svg { width:16px; height:16px; }
.header-favorites { margin:0; }
.room-choice,.personal-room,.project-main .room-pane,.side-catalog,.project-main .zone-panel,.catalog-generate,dialog { background:var(--paper); border-color:var(--border); color:var(--ink); }
.room-choice,.personal-room,.project-main .room-pane,.side-catalog,.project-main .zone-panel { box-shadow:var(--panel-shadow); }
.room-choice > span { padding:12px 14px; }
.room-intro { padding-block:33px 23px; }
.room-intro .eyebrow { letter-spacing:.17em; }
.project-main .map-caption,.zone-summary li,#favorite-list img,.result-flow img { background:var(--subtle); }
.catalog-target { letter-spacing:.005em; }
.catalog-search input,.catalog-filters select,.wizard-card input:not([type=range]),.wizard-card textarea,.wizard-card select { background:var(--field); border-color:var(--border); color:var(--ink); }
.catalog-search input::placeholder,.wizard-card input::placeholder,.wizard-card textarea::placeholder { opacity:1; color:var(--muted); }
button { color:var(--ink); border-color:var(--border); }
button:hover,.product:hover,.settings summary:hover { background:var(--subtle); border-color:var(--accent); }
button[aria-pressed=true],button.is-active { color:var(--accent); border-color:var(--accent); background:var(--accent-wash); }
button.primary,.catalog-generate .primary { color:var(--on-solid); background:var(--solid); border-color:var(--solid); }
button.primary:hover,.catalog-generate .primary:hover { background:var(--solid-hover); border-color:var(--solid-hover); }
#steps button[aria-current=step] { background:transparent; }
.generation-detail { border-color:var(--border); }
dialog::backdrop,.generation-dialog::backdrop,#zoom-dialog::backdrop { background:var(--veil); }
@media(max-width:530px) {
  .studio-top { min-height:59px; gap:6px; }
  .studio-brand { font-size:.86rem; gap:6px; }
  .studio-symbol { width:29px; height:29px; }
  .header-actions { gap:5px; }
  .theme-switch button { padding-inline:5px; }
  .theme-switch button .mode-label,.header-favorites span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .header-favorites { padding-inline:8px; }
  .room-intro { padding-block:22px 15px; }
}

/* Atmospheric gallery, with the same controls and room photography in both themes. */
:root {
  --gallery-sky:#f5f4f1;
  --gallery-glow:#fff;
  --gallery-ground:#f5f4f1;
  --gallery-ink:#222220;
  --gallery-muted:#595955;
  --gallery-glass:#fff;
  --gallery-line:#d9d8d4;
  --gallery-shadow:0 5px 18px #1919190b;
}
:root[data-theme=dark] {
  --gallery-sky:#171717; --gallery-glow:#262626; --gallery-ground:#171717; --gallery-ink:#f8f8f6;
  --gallery-muted:#c4c4bf; --gallery-glass:#222; --gallery-line:#41413e;
  --gallery-shadow:0 5px 18px #0003;
}
@media(prefers-color-scheme:dark) {
  :root:not([data-theme]) {
    --gallery-sky:#171717; --gallery-glow:#262626; --gallery-ground:#171717; --gallery-ink:#f8f8f6;
    --gallery-muted:#c4c4bf; --gallery-glass:#222; --gallery-line:#41413e;
    --gallery-shadow:0 5px 18px #0003;
  }
}
body {
  min-height:100svh;
  background:var(--gallery-ground);
  color:var(--gallery-ink);
}
body .studio-top {
  position:relative; max-width:min(1392px,calc(100% - 40px)); margin:15px auto 0;
  min-height:58px; padding:8px 14px; border:1px solid var(--gallery-line);
  border-radius:16px; background:var(--gallery-glass); box-shadow:var(--gallery-shadow);
  -webkit-backdrop-filter:blur(15px); backdrop-filter:blur(15px);
}
body .studio-brand { color:var(--gallery-ink); }
body .studio-symbol { border-radius:9px; box-shadow:inset 0 1px 1px #ffffff50; }
body .theme-switch { border-color:var(--gallery-line); background:transparent; border-radius:100px; }
body .theme-switch button { border-radius:100px; padding-inline:9px; }
body .theme-switch button[aria-pressed=true] { box-shadow:0 2px 5px #17233419; }
body .header-favorites { color:var(--gallery-ink); border-color:var(--gallery-line); border-radius:100px; }
.rooms-home .room-intro { text-align:center; padding:clamp(32px,6vh,72px) 8px clamp(24px,4vh,42px); }
.rooms-home .room-intro h2 {
  font:500 clamp(2.65rem,6.4vw,6rem)/.99 Arial,sans-serif;
  letter-spacing:-.075em; color:var(--gallery-ink); margin:11px 0 13px;
}
.rooms-home .room-intro p:not(.eyebrow),.rooms-home .personal-room p { color:var(--gallery-muted); }
.rooms-home .room-intro .eyebrow { color:var(--gallery-muted); letter-spacing:.21em; }
.rooms-home .room-grid { gap:clamp(7px,1.15vw,16px); }
.rooms-home .room-choice {
  position:relative; isolation:isolate; border:1px solid var(--gallery-line);
  border-radius:15px; background:#25313a; box-shadow:var(--gallery-shadow);
  transition:transform .25s,border-color .25s,box-shadow .25s;
}
.rooms-home .room-choice img { aspect-ratio:.97; transition:transform .55s ease; }
.rooms-home .room-choice::after {
  content:''; position:absolute; inset:38% 0 0; pointer-events:none;
  background:linear-gradient(transparent,#161616b8 82%,#111e);
}
.rooms-home .room-choice > span {
  position:absolute; z-index:1; inset:auto 0 0; gap:3px; padding:11px 12px 12px;
  color:#fff; font-size:clamp(.81rem,1.35vw,1.16rem);
}
.rooms-home .room-choice > span span {
  display:grid; place-items:center; width:30px; height:30px; border:1px solid #ffffff85;
  border-radius:50%; color:#fff; background:#fff2; font-size:.9rem;
}
.rooms-home .room-choice:is(:hover,:focus-visible) { border-color:var(--gallery-ink); transform:translateY(-4px); }
.rooms-home .room-choice:is(:hover,:focus-visible) img { transform:scale(1.045); }
.rooms-home .room-choice:focus-visible { outline:3px solid var(--gallery-ink); outline-offset:3px; }
.rooms-home .personal-room {
  margin-top:clamp(12px,2.3vw,25px); padding:15px clamp(12px,2vw,22px);
  color:var(--gallery-ink); background:var(--gallery-glass); border:1px solid var(--gallery-line); border-radius:15px; box-shadow:var(--gallery-shadow);
}
.rooms-home .personal-room button { border-radius:100px; padding-inline:13px; }
body footer { color:var(--gallery-muted); }
@media(max-width:760px) {
  body .studio-top { max-width:calc(100% - 22px); margin-top:9px; min-height:51px; padding:6px 8px; }
  .rooms-home .room-intro { padding-top:26px; }
  .rooms-home .room-choice { border-radius:10px; }
  .rooms-home .room-choice > span { padding:7px; }
  .rooms-home .room-choice > span span { width:19px; height:19px; font-size:.7rem; }
  .rooms-home .personal-room .flow-actions { flex-shrink:1; }
}
@media(prefers-reduced-motion:reduce) {
  .rooms-home .room-choice,.rooms-home .room-choice img { transition:none; }
  .rooms-home .room-choice:is(:hover,:focus-visible),.rooms-home .room-choice:is(:hover,:focus-visible) img { transform:none; }
}

/* The opening shares the gallery's day and night palette. */
:root { --opening-core:#fff; --opening-mid:#ebeae7; --opening-edge:#deddd9; --opening-ray:#fff; --opening-grid:#2323231a; --opening-mark:#fff; --opening-track:#2223; --opening-run:#252525; }
:root[data-theme=dark] { --opening-core:#383838; --opening-mid:#222; --opening-edge:#111; --opening-ray:#fff2; --opening-grid:#fff2; --opening-mark:#f9f9f7; --opening-track:#fff3; --opening-run:#eee; }
@media(prefers-color-scheme:dark) {
  :root:not([data-theme]) { --opening-core:#383838; --opening-mid:#222; --opening-edge:#111; --opening-ray:#fff2; --opening-grid:#fff2; --opening-mark:#f9f9f7; --opening-track:#fff3; --opening-run:#eee; }
}
.room-opening {
  isolation:isolate;
  background:radial-gradient(ellipse at 56% 52%,var(--opening-core),var(--opening-mid) 48%,var(--opening-edge) 100%);
  color:var(--gallery-ink);
}
.room-opening .startup-grid { display:none; }
.room-opening .opening-brand {
  width:clamp(130px,15vw,202px); inset:clamp(15px,4svh,43px) auto auto 50%;
  background:var(--opening-mark); border:1px solid #fffc; border-radius:13px; padding:10px 14px;
  box-shadow:0 8px 30px #0b172b29; backdrop-filter:blur(12px);
  animation:opening-brand-reveal .7s ease-out both;
}
.room-opening .opening-caption {
  width:max-content; max-width:calc(100% - 30px); inset:auto auto clamp(17px,4svh,45px) 50%;
  transform:translateX(-50%); padding:11px 25px 13px; border:1px solid var(--gallery-line);
  border-radius:15px; background:var(--gallery-glass); box-shadow:var(--gallery-shadow); backdrop-filter:blur(14px);
  animation:opening-caption-reveal .65s .12s ease-out both;
}
.room-opening .opening-caption span { color:var(--gallery-muted); }
.room-opening .opening-caption strong { color:var(--gallery-ink); font:500 clamp(1.35rem,3vw,2.15rem)/1.05 Arial,sans-serif; letter-spacing:-.05em; }
.room-opening .loading-track { background:var(--opening-track); }
.room-opening .loading-track::before { background:var(--opening-run); }
@keyframes opening-light { from { transform:translate(-5%,4%) scale(.93); opacity:.2; } to { transform:none; opacity:.66; } }
@keyframes opening-horizon { from { opacity:0; } to { opacity:.75; } }
@keyframes opening-brand-reveal { from { opacity:0; transform:translate(-50%,-8px); } to { opacity:1; transform:translate(-50%,0); } }
@keyframes opening-caption-reveal { from { opacity:0; transform:translate(-50%,8px); } to { opacity:1; transform:translate(-50%,0); } }
@media(prefers-reduced-motion:reduce) {
  .room-opening::before,.room-opening::after,.room-opening .opening-caption,.room-opening .opening-brand { animation:none; }
}

body .studio-symbol, .rooms-home .personal-room .primary {
  background:var(--gallery-ink); border-color:var(--gallery-ink); color:var(--gallery-ground);
}
body .theme-switch button[aria-pressed=true] { color:var(--gallery-ink); }
.room-opening .opening-brand { box-shadow:0 5px 18px #0002; }
.room-opening .opening-caption { border:0; box-shadow:none; background:none; backdrop-filter:none; }

/* The editor, results and dialogs use the same design system as the gallery. */
:root {
  --page:var(--gallery-ground);
  --paper:var(--gallery-glass);
  --subtle:var(--gallery-sky);
  --ink:var(--gallery-ink);
  --muted:var(--gallery-muted);
  --border:var(--gallery-line);
  --accent:var(--gallery-ink);
  --solid:var(--gallery-ink);
  --on-solid:var(--gallery-ground);
  --panel-shadow:var(--gallery-shadow);
  --accent-wash:color-mix(in srgb,var(--gallery-ink) 9%,var(--paper));
  --field:var(--paper);
  --solid-hover:color-mix(in srgb,var(--gallery-ink) 86%,var(--gallery-ground));
}
body .studio-top { background:var(--paper); }
#steps { gap:5px; padding-block:19px 15px; }
#steps button {
  min-height:36px; border:1px solid transparent; border-radius:100px;
  padding:6px 12px; color:var(--muted);
}
#steps button[aria-current=step] {
  color:var(--ink); background:var(--paper); border-color:var(--border); font-weight:700;
}
#steps button:disabled { opacity:.55; }
.project-main .room-pane,.project-main .zone-panel,.side-catalog,.result-flow,.panorama-flow {
  border-radius:15px; box-shadow:var(--panel-shadow);
}
.map-head { padding:13px 17px; }
.map-head h3 { font-size:1.02rem; }
.project-main .map-caption { padding:13px 17px; }
.map-assignments button,.zone-add button,.zone-mark-actions button,.catalog-generate .primary,
.result-flow .flow-actions button,.panorama-flow .flow-actions button {
  border-radius:100px; padding-inline:12px;
}
.catalog-search input,.catalog-filters select,.wizard-card input:not([type=range]),.wizard-card textarea,.wizard-card select {
  border-radius:8px;
}
.side-catalog h2,.project-main .zone-panel h2,.result-flow h2,.panorama-flow h2,dialog h2 {
  color:var(--ink); font-family:Arial,sans-serif; font-weight:500; letter-spacing:-.055em;
}
.side-catalog h2 { font-size:clamp(1.75rem,2.6vw,2.5rem); }
.wizard-card.result-flow,.wizard-card.panorama-flow { padding:clamp(16px,3vw,36px); }
.result-flow h2,.panorama-flow h2 { margin:0 0 9px; font-size:clamp(2rem,4vw,3.8rem); line-height:1.02; }
.result-flow > p,.panorama-flow > p { max-width:70ch; }
.result-flow img,#sphere { margin-top:17px; border-radius:11px; }
.panorama-flow .view-strip figure { border-radius:10px; background:var(--subtle); }
.panorama-flow .view-strip img { border-radius:7px; }
.generation-detail { background:var(--accent-wash); }
@media(max-width:760px) {
  #steps { gap:3px; padding-block:13px 10px; }
  #steps button { min-height:33px; padding-inline:7px; }
}

.project-main .map-caption {
  gap:10px; padding:12px 15px; border-top:1px solid var(--border); background:var(--paper);
}
.map-control-head { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:7px 12px; }
.map-control-head h4 { margin:0 0 2px; color:var(--ink); font-size:.93rem; letter-spacing:-.02em; }
.map-control-head p { margin:0; color:var(--muted); font-size:.78rem; line-height:1.35; }
.map-caption .map-control-head .zone-add { margin:0; gap:6px; }
.map-control-head .zone-add button { min-height:34px; background:var(--subtle); }
.map-control-head .zone-add button:hover { background:var(--accent-wash); }
.map-assignments { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; margin:0; }
.map-assignments button {
  position:relative; display:flex; align-items:center; justify-content:flex-start; gap:8px; min-width:0; min-height:42px;
  text-align:left; padding:6px 8px; border-radius:8px; background:var(--subtle);
}
.map-assignments button[aria-pressed=true] { color:var(--ink); border-color:var(--accent); background:var(--accent-wash); }
.map-assignments .map-zone-text { display:grid; gap:2px; min-width:0; color:inherit; }
.map-zone-text strong { font-size:.79rem; }
.map-zone-text small { color:var(--muted); font-size:.72rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.map-assignments img { width:24px; height:24px; margin-left:auto; border-radius:4px; object-fit:cover; }
@media(min-width:761px) {
  .project-main .zone-map:has(.map-assignments button:nth-child(4)) .mark-photo > img { max-height:calc(100dvh - 281px); }
}
@media(max-width:530px) {
  .map-assignments { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .project-main .map-caption { padding:11px; }
}

.catalog-filter-panel { margin-top:10px; padding-block:4px; }
.catalog-filter-panel summary { color:var(--muted); font-size:.79rem; cursor:pointer; }
.catalog-filter-panel summary:hover { color:var(--ink); }
.catalog-continue { padding:10px 20px; border-top:1px solid var(--border); background:var(--paper); }
.catalog-continue button { width:100%; min-height:38px; }
#zone-review { scroll-margin-top:12px; }
.proposal-final { margin-top:18px; padding-top:15px; border-top:1px solid var(--border); }
.proposal-final h3 { margin:0 0 6px; }
.proposal-final p { font-size:.85rem; }
.proposal-final .primary { width:100%; min-height:43px; margin-top:12px; }
.proposal-final .primary:disabled { opacity:1; color:var(--muted); background:var(--subtle); border-color:var(--border); }
#pending-zones:not(:empty) { padding:0; border:0; background:none; color:var(--muted); }

.editor-sidebar { min-width:0; background:var(--paper); border:1px solid var(--border); box-shadow:var(--panel-shadow); }
.project-flow .editor-sidebar .side-catalog {
  position:static; max-height:none; border:0; box-shadow:none; background:transparent; overflow:visible;
}
.project-flow .editor-sidebar .tile-list { max-height:clamp(220px,45vh,420px); overflow:auto; scrollbar-gutter:stable; }
.editor-sidebar .catalog-continue { padding-block:11px; }
.project-flow .editor-sidebar .zone-panel { border:0; border-top:1px solid var(--border); box-shadow:none; padding:20px; }
@media(min-width:761px){
  .project-flow .editor-sidebar { grid-column:2; grid-row:1; }
  .project-main .room-pane { grid-row:1; }
}
@media(max-width:420px){
  .project-flow .editor-sidebar .zone-panel { padding:15px; }
}

.editor-sidebar .active-zone-bar {
  display:flex; align-items:center; gap:9px; padding:9px; margin:10px 0;
  background:var(--subtle); border:1px solid var(--border);
}
.active-zone-bar > span:nth-child(2) { display:grid; gap:2px; flex:1; min-width:0; }
.active-zone-bar strong { font-size:.86rem; }
.active-zone-bar small { color:var(--muted); font-size:.78rem; }
.active-zone-bar img { width:34px; height:34px; object-fit:cover; }
.project-flow .editor-sidebar .zone-panel { padding:10px 20px 20px; border-top:0; }
.zone-edit-options { margin-top:0; }
.zone-edit-options > summary { font-weight:600; }
.proposal-progress { display:flex; justify-content:space-between; gap:8px; font-size:.85rem; margin-bottom:6px; }
.proposal-progress span { color:var(--muted); }
#next-zone { margin-top:8px; min-height:34px; }
#active-zone-issue { color:var(--muted); margin-top:4px; }
#active-zone-issue:empty { display:none; }

/* Product identity from the style guide, shared by every screen. */
:root {
  --gallery-ground:#dee8f4; --gallery-sky:#e8f0f6; --gallery-ink:#202c39; --gallery-muted:#47586b;
  --gallery-glass:#fff; --gallery-line:#ccd7e3; --gallery-shadow:0 12px 28px #243a5514;
  --sky-start:#d9e5f4; --sky-light:#fffdf5; --sky-end:#eef0f4; --glass:#ffffffb8;
  --accent:#30594e; --solid:#30594e; --solid-hover:#25483f; --on-solid:#fff;
  --accent-wash:#e8f0f6; --panel-radius:16px; --control-radius:10px;
}
:root[data-theme=dark] {
  --gallery-ground:#101621; --gallery-sky:#28374c; --gallery-ink:#f0f3fa; --gallery-muted:#bcc9db;
  --gallery-glass:#182337; --gallery-line:#3e4e65; --gallery-shadow:0 12px 28px #0004;
  --sky-start:#293b55; --sky-light:#425169; --sky-end:#101621; --glass:#182337d9;
  --accent:#b4dece; --solid:#b4dece; --solid-hover:#c6e7db; --on-solid:#142c24; --accent-wash:#28374c;
}
@media(prefers-color-scheme:dark) {
  :root:not([data-theme]) {
    --gallery-ground:#101621; --gallery-sky:#28374c; --gallery-ink:#f0f3fa; --gallery-muted:#bcc9db;
    --gallery-glass:#182337; --gallery-line:#3e4e65; --gallery-shadow:0 12px 28px #0004;
    --sky-start:#293b55; --sky-light:#425169; --sky-end:#101621; --glass:#182337d9;
    --accent:#b4dece; --solid:#b4dece; --solid-hover:#c6e7db; --on-solid:#142c24; --accent-wash:#28374c;
  }
}
body {
  background:radial-gradient(ellipse at 76% 4rem,var(--sky-light),transparent 31rem),
    linear-gradient(150deg,var(--sky-start),var(--sky-end) 43rem);
  background-repeat:no-repeat; background-color:var(--sky-end);
}
body .studio-top { background:var(--glass); border-radius:17px; }
body .studio-symbol,.rooms-home .personal-room .primary { background:var(--solid); color:var(--on-solid); border-color:var(--solid); }
body .theme-switch button[aria-pressed=true] { color:var(--accent); }
.brand-placeholder { font-weight:700; letter-spacing:.025em; white-space:nowrap; }
.room-opening { background:radial-gradient(ellipse at 67% 38%,var(--sky-light),var(--sky-start) 48%,var(--sky-end)); }
.room-opening .opening-brand { width:auto; min-width:136px; text-align:center; color:var(--ink); background:var(--glass); border:1px solid var(--border); }
.room-opening .loading-track::before { background:var(--solid); }
.rooms-home .room-choice,.project-flow .editor-sidebar,.project-main .room-pane,.wizard-card,.personal-room,dialog {
  border-radius:var(--panel-radius); overflow:clip;
}
.project-flow .editor-sidebar .side-catalog,.project-flow .editor-sidebar .zone-panel { border-radius:0; }
button,.catalog-search input,.catalog-filters select,.zone-edit-options { border-radius:var(--control-radius); }
.theme-switch,.theme-switch button { border-radius:999px; }
main.wizard { padding-bottom:24px; }
.capture-page .studio-top { justify-content:space-between; }
.capture-main { max-width:560px; margin:22px auto; }
.capture-main .wizard-card { padding:22px; }
.capture-main h1 { font-size:clamp(2rem,8vw,3rem); line-height:1.04; margin-bottom:9px; }
.capture-actions { display:grid; gap:8px; margin:17px 0; }
.capture-choice { position:relative; display:flex; justify-content:center; align-items:center; min-height:46px; border:1px solid var(--border); padding:8px; border-radius:var(--control-radius); cursor:pointer; }
.capture-choice input { position:absolute; inset:0; width:100%; opacity:0; cursor:pointer; }
.capture-choice:focus-within { outline:3px solid var(--accent); outline-offset:2px; }
.capture-choice:first-child { background:var(--solid); color:var(--on-solid); }
.capture-main #send:not([hidden]) { width:100%; margin-top:10px; }
.capture-main .privacy { font-size:.81rem; margin-top:13px; }
.capture-main #message:empty { display:none; }
.capture-main #message { margin-top:16px; text-align:center; }
.capture-main #preview:not([hidden]) { display:block; width:100%; max-height:320px; object-fit:contain; margin:14px 0 4px; border-radius:var(--control-radius); }
.capture-photos { display:grid; gap:10px; }
.capture-photos > div { padding:10px; border:1px solid var(--border); border-radius:var(--control-radius); }
.capture-photos img { display:block; width:100%; max-height:220px; object-fit:contain; margin:7px 0; }
.capture-photo-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin-top:10px; }
.capture-photo-actions button { min-height:40px; padding-inline:14px; }
@media(max-width:540px){
  .studio-top .studio-brand { font-size:.75rem; }
  .studio-top .studio-symbol { width:23px; height:23px; }
}
@media(max-width:365px){.studio-top .studio-brand{font-size:0}.studio-top .studio-symbol{font-size:1rem}}

.brand-home { min-height:36px; padding:4px 5px; border-color:transparent; color:var(--ink); font-size:.92rem; }
.brand-home:hover { border-color:var(--border); }

.zone-map .marker { z-index:1; }
.tile-entry { position:relative; min-width:0; display:grid; }
.tile-entry .tile-product { width:100%; }
.tile-heart { position:absolute; top:5px; right:5px; min-width:33px; min-height:33px; padding:0; background:var(--paper); font-size:1rem; z-index:1; }
.favorite-tabs { display:flex; gap:7px; margin-top:10px; }

#quote-dialog label { display:grid; gap:5px; font-size:.86rem; }
#quote-dialog input,#quote-dialog textarea { min-width:0; width:100%; min-height:40px; border:1px solid var(--border); border-radius:8px; background:var(--field); padding:7px 9px; color:var(--ink); }
#quote-dialog textarea { resize:vertical; }
#quote-status { margin-top:9px; font-size:.88rem; }
#quote-status:empty { display:none; }
.quote-cta { font-weight:700; border-color:var(--accent); color:var(--accent); }
@media print {
  body:has(#print-sheet:not([hidden])) { background:#fff; color:#111; }
  body:has(#print-sheet:not([hidden])) > :not(#print-sheet) { display:none!important; }
  #print-sheet { margin:0; font:12pt Arial,sans-serif; }
  #print-sheet h1 { font-size:23pt; margin:0 0 8pt; }
  #print-sheet p { color:#333; }
  #print-sheet img { width:100%; max-height:100mm; object-fit:contain; display:block; margin:10pt 0; }
  #print-sheet table { border-collapse:collapse; width:100%; }
  #print-sheet td,#print-sheet th { padding:6pt; text-align:left; border-bottom:1pt solid #ddd; }
}

.tile-heart {
  top:7px; right:7px; display:grid; place-items:center; width:42px; height:42px; min-width:42px; min-height:42px;
  background:var(--paper); color:var(--ink); border:1px solid var(--border); border-radius:50%;
  box-shadow:0 2px 10px #1113;
}
.tile-heart svg,.header-favorites svg {
  width:20px; height:20px; display:block; fill:none; stroke:currentColor;
  stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round;
}
.tile-heart:hover { background:var(--paper); color:var(--accent); border-color:var(--accent); }
.tile-heart[aria-pressed=true] { background:var(--solid); color:var(--on-solid); border-color:var(--solid); }
.tile-heart[aria-pressed=true] svg { fill:currentColor; }
.tile-heart:focus-visible { outline:3px solid var(--accent); outline-offset:2px; }
@media(prefers-reduced-motion:no-preference) {
  .tile-heart { transition:background .16s,color .16s,transform .16s; }
  .tile-heart:active { transform:scale(.91); }
}

.zone-edit-options { padding:11px 13px; background:var(--subtle); }
.placement-location { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 12px; margin-top:10px; }
.placement-location button { min-height:34px; }
.placement-location .zone-description { margin:0; }
.placement-location .zone-description[open] { flex:1 1 100%; }
.placement-location .zone-description label { display:grid; gap:5px; margin-top:8px; font-size:.82rem; }
.placement-main { margin-top:13px; }
.placement-extras { border-top:1px solid var(--border); margin-top:11px; padding-top:10px; }
.placement-extras > summary { cursor:pointer; font-size:.83rem; color:var(--muted); }

.capture-dialog [hidden] { display:none !important; }
.capture-local { margin-top:12px; }

.photo-compare { position:relative; isolation:isolate; overflow:hidden; }
.result-flow .compare-result { width:fit-content; max-width:100%; margin:17px auto 0; border-radius:11px; }
.result-flow .compare-base { display:block; width:auto; max-width:100%; max-height:70vh; margin:0; }
.photo-compare .compare-layer { position:absolute; inset:0; width:100%; height:100%; max-width:none; max-height:none; margin:0; border-radius:0; object-fit:contain; object-position:center; clip-path:inset(0 0 0 var(--split)); pointer-events:none; }
.compare-divider { position:absolute; top:0; bottom:0; left:clamp(1px,var(--split),calc(100% - 1px)); z-index:2; width:2px; transform:translateX(-50%); background:white; box-shadow:0 0 4px #0008; pointer-events:none; }
.compare-divider span { position:absolute; top:50%; left:50%; display:grid; place-items:center; width:44px; height:44px; transform:translate(-50%,-50%); border-radius:50%; background:white; color:#21312d; font-size:22px; font-weight:700; box-shadow:0 2px 10px #0006; }
.compare-label { position:absolute; top:12px; z-index:2; padding:4px 9px; border-radius:5px; background:var(--overlay-label); color:white; font-size:.8rem; pointer-events:none; }
.compare-original { left:12px; }
.compare-proposal { right:12px; }
.photo-compare .compare-range { appearance:none; position:absolute; z-index:3; inset:0 auto 0 -22px; width:calc(100% + 44px); height:100%; margin:0; padding:0; border:0; border-radius:0; outline:0; background:transparent; cursor:ew-resize; }
.compare-range::-webkit-slider-thumb { appearance:none; width:44px; height:44px; pointer-events:auto; background:transparent; cursor:ew-resize; touch-action:none; }
.compare-range::-moz-range-thumb { width:44px; height:44px; border:0; pointer-events:auto; background:transparent; cursor:ew-resize; touch-action:none; }
.photo-compare:has(.compare-range:focus-visible) .compare-divider span { outline:3px solid var(--accent,#315b51); outline-offset:3px; }
.compare-hint { color:var(--muted); text-align:center; font-size:.85rem; }

.result-flow .result-actions { flex-wrap:nowrap; gap:7px; overflow-x:auto; padding:4px 4px 9px; scroll-padding-inline:4px; }
.result-flow .result-actions button { display:inline-flex; flex:0 0 auto; align-items:center; gap:7px; min-height:44px; padding:7px 11px; white-space:nowrap; font-size:.82rem; }
.result-actions svg { width:17px; height:17px; flex:none; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.result-materials { margin-top:24px; }
.result-materials h3 { margin:0 0 12px; font-size:1.15rem; letter-spacing:-.02em; }
.result-materials .zone-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(290px,100%),1fr)); gap:12px; margin:0; padding:0; list-style:none; }
.result-materials .zone-summary li { margin:0; padding:15px; border:1px solid var(--border); border-radius:10px; }
.result-material { display:flex; align-items:center; gap:12px; }
.result-flow .result-material img { flex:none; width:57px; height:57px; object-fit:cover; border:1px solid var(--border); border-radius:6px; margin:0; }
.result-material h4 { margin:2px 0; font-size:1rem; line-height:1.2; }
.result-material p,.result-zone { margin:0; color:var(--muted); font-size:.78rem; }
.result-zone { font-weight:700; }
.result-materials dl { display:grid; grid-template-columns:repeat(auto-fit,minmax(82px,1fr)); gap:10px 12px; margin:13px 0 0; padding-top:12px; border-top:1px solid var(--border); }
.result-materials dt { color:var(--muted); font-size:.75rem; }
.result-materials dd { margin:2px 0 0; font-weight:650; font-size:.85rem; overflow-wrap:anywhere; }
.compare-result .compare-range { touch-action:pan-y; }

.wall-scope { display:grid; gap:6px; margin:12px 0; padding:10px 12px; border:1px solid var(--border); border-radius:9px; }
.wall-scope legend { padding-inline:4px; font-size:.84rem; font-weight:700; }
.wall-scope label { display:flex; align-items:center; gap:7px; min-height:27px; font-size:.84rem; }
.wall-scope input { accent-color:var(--accent); margin:0; }
.wall-scope small { color:var(--muted); }
.placement-location[hidden] { display:none; }
#zoom-dialog { width:min(1320px,calc(100% - 24px)); }
.zoom-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,26%); }
.zoom-layout:has(#zoom-materials[hidden]) { grid-template-columns:minmax(0,1fr); }
#zoom-viewport { touch-action:none; display:flex; }
#zoom-image { flex:none; margin:auto; }
#zoom-materials { padding:16px; overflow:auto; max-height:66dvh; border-left:1px solid var(--border); }
#zoom-materials h3 { margin:0 0 12px; font-size:1rem; }
#zoom-material-list { display:grid; gap:8px; list-style:none; margin:0; padding:0; }
#zoom-material-list li > :is(button,div) { display:flex; align-items:center; width:100%; padding:8px; text-align:left; gap:10px; border:1px solid var(--border); border-radius:8px; background:var(--subtle); }
#zoom-material-list img { width:46px; height:46px; border-radius:5px; object-fit:cover; flex:none; }
#zoom-material-list span { display:grid; gap:3px; }
#zoom-material-list small { color:var(--muted); font-size:.75rem; }
#zoom-material-list strong { line-height:1.14; }
@media (max-width:680px) {
  .zoom-layout { grid-template-columns:minmax(0,1fr); }
  #zoom-viewport { height:48dvh; }
  #zoom-materials { max-height:none; padding:12px; border-left:0; border-top:1px solid var(--border); }
  #zoom-material-list { display:flex; overflow:auto; padding-bottom:4px; }
  #zoom-material-list li { flex:0 0 min(235px,82%); }
}
.header-guide { display:inline-flex; align-items:center; min-height:40px; padding:6px 9px; color:var(--muted); font-size:.84rem; font-weight:700; text-decoration:none; white-space:nowrap; }
.header-guide:hover { color:var(--ink); text-decoration:underline; }
@media (max-width:550px) { .header-guide { font-size:.75rem; padding-inline:4px; } }

/* El fondo del documento coincide con el final del degradado: sin franjas al hacer scroll ni con el rebote del móvil. */
:root { background-color:var(--sky-end); }
body { min-height:100vh; min-height:100dvh; }


/* Zonas: botón «×» visible para quitar una zona directamente. */
.zone-chip { position:relative; display:grid; min-width:0; }
.zone-chip > button[data-zone] { width:100%; }
.map-assignments .zone-remove {
  position:absolute; top:-8px; right:-8px; z-index:1; display:grid; place-items:center;
  width:24px; height:24px; min-height:0; padding:0; border-radius:50%; gap:0; grid-template-columns:none; justify-content:center; align-content:center;
  background:var(--paper); border:1px solid var(--border); color:var(--muted);
  font-size:1rem; line-height:1; box-shadow:0 1px 4px #0002;
}
.map-assignments .zone-remove svg { display:block; width:10px; height:10px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
.map-assignments .zone-remove:hover { color:var(--danger); border-color:var(--danger); background:var(--paper); }
@media (pointer:coarse) { .map-assignments .zone-remove { width:30px; height:30px; top:-10px; right:-10px; } }

/* Desplegables: mismo aspecto que el resto de campos, con flecha propia. */
select, .wizard-card select, .catalog-filters select, .settings select, dialog select {
  -webkit-appearance:none; appearance:none; width:100%; min-width:0; min-height:40px;
  padding:8px 36px 8px 11px; border:1px solid var(--border); border-radius:var(--control-radius, 10px);
  background-color:var(--field, var(--paper)); color:var(--ink); font:inherit; line-height:1.25; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%237d857f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center; background-size:14px 14px;
  text-overflow:ellipsis; transition:border-color .15s, box-shadow .15s;
}
select:hover { border-color:color-mix(in srgb, var(--accent) 45%, var(--border)); }
select:focus-visible { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
select:disabled { opacity:.55; cursor:default; }
select option { background:var(--paper); color:var(--ink); }

/* Grespania · warm neutrals, anniversary red and gold. */
:root {
  --gallery-ground:#f4f1ed;
  --gallery-sky:#f1e8df;
  --gallery-ink:#252321;
  --gallery-muted:#5a5048;
  --gallery-glass:#fffefa;
  --gallery-line:#d9d0c7;
  --gallery-shadow:0 12px 28px #42261512;
  --sky-start:#eee5dc;
  --sky-light:#fffdf7;
  --sky-end:#f4f1ed;
  --glass:#ffffffd9;
  --accent:#a92126;
  --solid:#a92126;
  --solid-hover:#891c20;
  --on-solid:#fff;
  --accent-wash:#f7e7e5;
  --grespania-gold:#f3a600;
  --danger:#a92126; --danger-wash:#f7e7e5;
  --success:#285b44; --success-wash:#e4f0e7;
  --overlay-label:#211c19f5;
}
:root[data-theme=dark] {
  --page:var(--gallery-ground);
  --paper:var(--gallery-glass);
  --subtle:var(--gallery-sky);
  --ink:var(--gallery-ink);
  --muted:var(--gallery-muted);
  --border:var(--gallery-line);
  --panel-shadow:var(--gallery-shadow);
  --gallery-ground:#171619;
  --gallery-sky:#2a272c;
  --gallery-ink:#f6f1ef;
  --gallery-muted:#c9bec1;
  --gallery-glass:#211f23;
  --gallery-line:#565057;
  --gallery-shadow:0 14px 36px #08070a55;
  --sky-start:#242025;
  --sky-light:#32282e;
  --sky-end:#171619;
  --glass:#211f23;
  --field:#1a181c;
  --accent:#ffa3a4;
  --solid:#aa2734;
  --solid-hover:#bf3542;
  --on-solid:#fff;
  --accent-wash:#39262d;
  --veil:#0d0b10da;
  --danger:#ffb0ae;
  --danger-wash:#432830;
  --success:#a9dfc0;
  --success-wash:#23342d;
  --overlay-label:#211c23f5;
}
@media (prefers-color-scheme:dark) {
  :root:not([data-theme]) {
    --page:var(--gallery-ground);
    --paper:var(--gallery-glass);
    --subtle:var(--gallery-sky);
    --ink:var(--gallery-ink);
    --muted:var(--gallery-muted);
    --border:var(--gallery-line);
    --panel-shadow:var(--gallery-shadow);
    --gallery-ground:#171619;
    --gallery-sky:#2a272c;
    --gallery-ink:#f6f1ef;
    --gallery-muted:#c9bec1;
    --gallery-glass:#211f23;
    --gallery-line:#565057;
    --gallery-shadow:0 14px 36px #08070a55;
    --sky-start:#242025;
    --sky-light:#32282e;
    --sky-end:#171619;
    --glass:#211f23;
    --field:#1a181c;
    --accent:#ffa3a4;
    --solid:#aa2734;
    --solid-hover:#bf3542;
    --on-solid:#fff;
    --accent-wash:#39262d;
    --veil:#0d0b10da;
    --danger:#ffb0ae;
    --danger-wash:#432830;
    --success:#a9dfc0;
    --success-wash:#23342d;
    --overlay-label:#211c23f5;
  }
}
.grespania-logo,.room-opening .opening-brand.grespania-logo {
  display:inline-flex;align-items:center;justify-content:center;
  padding:5px 8px;background:#fff;border:1px solid #e8ded8;border-radius:7px;
}
.grespania-logo img { display:block;width:clamp(100px,15vw,155px);height:auto;max-width:100%; }
.room-opening .opening-brand.grespania-logo { padding:8px 12px; }
.room-opening .opening-brand.grespania-logo img { width:clamp(125px,18vw,190px); }
.room-opening .loading-track::before { background:var(--solid); }

/* Grespania workspace */
body .studio-top { width:auto; max-width:none; margin:0; padding:9px clamp(12px,3vw,48px); border-radius:0; }
main.wizard { width:100%; max-width:none; margin:0; padding-inline:clamp(12px,2.5vw,42px); }
main.wizard #steps[hidden] { display:none; }
.project-flow { width:100%; }
.resume-card { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:14px 18px; margin:0 0 16px; border:1px solid var(--border); border-radius:12px; background:var(--paper); }
.resume-card > div { flex:1 1 220px; display:grid; gap:3px; }
.resume-card span,.saved-context { font-size:.84rem; color:var(--muted); }
.saved-context { padding:7px 10px; margin:0 0 11px; border-radius:7px; background:var(--subtle); }
.editor-heading { display:flex; align-items:flex-start; gap:10px; padding:4px 0 9px; }
.editor-index { display:inline-grid; place-items:center; flex:none; width:26px; height:26px; border-radius:7px; background:var(--accent-wash); color:var(--accent); font-size:.84rem; }
.editor-heading h2 { margin:0; font-size:clamp(1.35rem,2vw,1.9rem); }
.editor-heading p { margin:4px 0 0; font-size:.85rem; color:var(--muted); }
.project-flow .editor-sidebar .zone-first { padding-block:16px; border-bottom:1px solid var(--border); }
.zone-first .wall-scope,.coverage-field,.facet-group { min-width:0; border:0; padding:0; margin:10px 0; }
.zone-first .wall-scope { display:flex; flex-wrap:wrap; gap:2px 12px; }
.coverage-field legend,.facet-group legend { margin:0 0 6px; padding:0; font-size:.88rem; font-weight:700; }
.coverage-options,.facet-options { display:flex; flex-wrap:wrap; gap:6px; }
.coverage-options button,.facet-options button { display:inline-flex; align-items:center; gap:6px; padding:4px 8px; min-height:38px; border-radius:7px; font-size:.77rem; }
.coverage-options button[aria-pressed=true],.facet-options button[aria-pressed=true] { color:var(--accent); background:var(--accent-wash); border-color:var(--accent); }
.coverage-icon { width:19px; height:15px; border:1px solid currentColor; border-radius:3px; display:block; flex:none; --side:to right; background:linear-gradient(var(--side),currentColor 50%,transparent 50%); }
.coverage-icon.is-full { background:currentColor; }
.coverage-icon.is-right { --side:to left; }
.coverage-icon.is-top { --side:to bottom; }
.coverage-icon.is-bottom { --side:to top; }
.coverage-icon.is-custom { background:none; border-style:dashed; }
.visual-filters { display:grid; grid-template-columns:minmax(0,1fr); margin-top:9px; }
.facet-group { margin:0; padding:10px 0; border-bottom:1px solid var(--border); }
.facet-group small,.facet-hint { display:block; font-size:.73rem; color:var(--muted); margin:0 0 6px; }
.filter-color,.filter-sample { width:22px; height:22px; border:1px solid var(--border); border-radius:4px; flex:none; object-fit:cover; background:var(--sample); }
.filter-diagram { width:var(--tile-w); height:var(--tile-h); border:1px solid currentColor; border-radius:2px; flex:none; background:var(--subtle); }
.catalog-target { margin-top:12px; justify-content:flex-start; flex-wrap:wrap; }
.catalog-target .primary { margin-left:auto; }
#tile-count { margin:7px 0 0; font-size:.82rem; color:var(--muted); }
.project-flow .editor-sidebar .tile-list { max-height:none; overflow:visible; }
#favorite-dialog { width:min(950px,calc(100% - 24px)); max-height:88dvh; padding:0; border:1px solid var(--border); }
.library-header { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; padding:20px 22px 12px; }
.library-header h2,.library-header p { margin:0 0 4px; }
.library-header p:not(.eyebrow) { color:var(--muted); font-size:.85rem; }
.library-header form { flex:none; }
.library-header form .close { position:static; min-width:38px; }
#favorite-dialog .favorite-tabs { display:flex; gap:7px; overflow:auto; margin:0; padding:0 22px 12px; border-bottom:1px solid var(--border); }
#favorite-dialog .favorite-tabs button { border-radius:7px; white-space:nowrap; }
#favorite-dialog #favorite-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(205px,100%),1fr)); gap:12px; margin:0; padding:15px 22px 22px; }
#favorite-dialog #favorite-list article { min-width:0; padding:10px; border:1px solid var(--border); border-radius:10px; display:grid; gap:8px; align-content:start; }
#favorite-dialog #favorite-list article img { width:100%; height:127px; object-fit:cover; border-radius:6px; }
dialog.capture-dialog { width:min(510px,calc(100% - 22px)); max-height:91dvh; padding:22px; text-align:left; }
.capture-dialog > h2 { margin:5px 0 8px; }
.capture-dialog > p { margin:7px 0; color:var(--muted); }
.qr-stage:not(:has(canvas[hidden])) { display:grid; place-items:center; padding:8px; margin:12px 0; border:1px solid var(--border); border-radius:12px; background:var(--subtle); }
.capture-dialog .qr { width:min(200px,56vw); height:auto; margin:0; border-radius:5px; }
.qr-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; list-style-position:inside; padding:0; margin:8px 0 14px; }
.qr-steps li { font-size:.76rem; border:1px solid var(--border); border-radius:7px; padding:7px 8px; }
.capture-status { font-weight:700; color:var(--accent) !important; }
@media (min-width:1100px) {
 .project-flow { grid-template-columns:minmax(0,1.35fr) minmax(390px,1fr); }
 .visual-filters { grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 14px; }
 .facet-group:nth-child(5),.facet-group:nth-child(6) { grid-column:1 / -1; }
}
@media(max-width:760px){
 .editor-sidebar .tile-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
 #favorite-dialog .favorite-tabs,#favorite-dialog #favorite-list { padding-inline:12px; }
 .library-header { padding:16px 12px 10px; }
 .qr-steps { grid-template-columns:1fr; gap:4px; }
}

.inspection-dialog { width:min(980px,calc(100% - 24px)); max-height:92dvh; padding:0; }
.material-inspection { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:20px; padding:4px 22px 22px; }
#tile-model-view { position:relative; display:grid; place-items:center; min-height:300px; height:clamp(300px,48dvh,480px); overflow:hidden; perspective:800px; isolation:isolate; touch-action:none; cursor:grab; border:1px solid var(--border); border-radius:12px; background:radial-gradient(ellipse at 50% 35%,var(--paper),var(--subtle)); }
#tile-model-view:active { cursor:grabbing; }
#tile-model-view::before { content:''; position:absolute; left:20%; right:20%; bottom:18%; height:12%; border-radius:50%; background:radial-gradient(ellipse,#1e151064,transparent 69%); filter:blur(10px); }
#tile-model { position:relative; width:var(--model-w); height:var(--model-h); transform-style:preserve-3d; }
.tile-face { position:absolute; display:block; backface-visibility:hidden; border:1px solid #261e191f; }
.face-top,.face-back { inset:0; }
.face-top { transform:translateZ(calc(var(--model-d)/2)); background:var(--tile-texture) center / 100% 100% no-repeat; }
.face-back { transform:rotateY(180deg) translateZ(calc(var(--model-d)/2)); background:repeating-linear-gradient(45deg,#ad9984 0 4px,#bdab98 4px 8px); }
.face-north,.face-south { left:0; top:calc((var(--model-h) - var(--model-d))/2); width:var(--model-w); height:var(--model-d); background:#a9937d; }
.face-north { transform:rotateX(90deg) translateZ(calc(var(--model-h)/2)); }
.face-south { transform:rotateX(-90deg) translateZ(calc(var(--model-h)/2)); }
.face-west,.face-east { top:0; left:calc((var(--model-w) - var(--model-d))/2); width:var(--model-d); height:var(--model-h); background:#c2ab94; }
.face-west { transform:rotateY(-90deg) translateZ(calc(var(--model-w)/2)); }
.face-east { transform:rotateY(90deg) translateZ(calc(var(--model-w)/2)); }
.material-controls,.format-body > label { display:flex; align-items:center; flex-wrap:wrap; gap:9px; margin-top:8px; }
.material-controls label { display:flex; align-items:center; gap:5px; }
.material-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px 14px; margin:0; }
.material-facts div { padding:5px 0; border-bottom:1px solid var(--border); }
.material-facts dt { color:var(--muted); font-size:.77rem; }
.material-facts dd { margin:2px 0 0; font-weight:650; }
.result-materials [data-material-index] { margin-top:11px; }
.format-body { padding:0 22px 20px; }
.format-canvas { position:relative; width:fit-content; max-width:100%; margin:auto; border-radius:4px; overflow:hidden; }
.format-canvas img { display:block; max-width:100%; width:auto; height:auto; max-height:56dvh; }
#format-overlay { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.format-footprint,.format-outline { stroke:var(--format-accent); stroke-width:2px; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.format-footprint { fill:#17110d80; stroke-opacity:.6; }
.format-face { fill:var(--paper); }
.format-outline { fill:none; filter:drop-shadow(0 2px 2px #17110d); }
@media(max-width:650px){.material-inspection{grid-template-columns:1fr;gap:13px;padding-inline:12px}#tile-model-view{min-height:245px;height:36dvh}.format-body{padding-inline:12px}}
@media print {
 #print-sheet { --border:#e2d8d0; --muted:#5a5048; print-color-adjust:exact; -webkit-print-color-adjust:exact; }
 #print-sheet .print-brand { display:flex; justify-content:space-between; align-items:center; border-bottom:2pt solid #a92126; padding-bottom:7pt; margin-bottom:13pt; }
 #print-sheet .print-brand img { width:40mm; margin:0; }
 #print-sheet .print-brand span { color:#a92126; font-size:9pt; font-weight:bold; letter-spacing:.08em; }
 #print-sheet .print-scene { max-height:103mm; margin-bottom:13pt; }
 #print-sheet .print-material { display:grid; grid-template-columns:26mm 1fr; gap:10pt; break-inside:avoid; border-top:1pt solid #e2d8d0; padding:8pt 0; }
 #print-sheet .print-material img { width:26mm; height:26mm; margin:0; object-fit:contain; }
 #print-sheet .print-material h2,#print-sheet .print-material p { margin:0 0 3pt; }
 #print-sheet .material-facts { grid-template-columns:repeat(3,minmax(0,1fr)); gap:2pt 8pt; font-size:9pt; }
 #print-sheet .material-facts div { padding:2pt 0; }
 #print-sheet .material-facts dt { font-size:8pt; }
}

/* Continuous editor surface and compact catalogue controls */
body:has(.project-flow) { background:var(--page); }
.project-flow { --editor-gutter:clamp(15px,2.4vw,38px); gap:0; }
.project-flow .editor-sidebar,.project-flow .project-main .room-pane { border:0; border-radius:0; background:transparent; box-shadow:none; }
.project-flow .map-head { padding:4px 0 12px; }
.project-flow .map-head h3 { font-size:clamp(1.1rem,1.7vw,1.5rem); letter-spacing:-.035em; }
.project-flow .zone-map .mark-photo { border-radius:9px; }
.project-flow .project-main .map-caption { background:transparent; border-top:0; border-radius:0; padding:14px 0 5px; }
.project-flow .editor-sidebar .zone-panel,.project-flow .side-catalog-head,.project-flow .editor-sidebar .tile-list { padding-inline:0; }
.project-flow .editor-sidebar .zone-first { padding-top:0; padding-bottom:17px; }
.project-flow .editor-heading h2 { margin:0; font-size:clamp(1.3rem,1.8vw,1.8rem); }
.project-flow #draft-status { width:fit-content; background:none; padding:0; margin:0 0 9px; font-size:.76rem; }
.project-flow #draft-status::before { content:''; display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--accent); margin-right:7px; vertical-align:2px; }
.zone-first .placement-extras .field-grid { margin-top:11px; gap:12px; }
.zone-first .placement-extras label,.zone-first #coverage-height,.zone-first .zone-description label { display:grid; align-content:start; gap:5px; font-size:.8rem; font-weight:650; }
.zone-first :is(input[type=text],input[type=number],input[data-field=location],input[type=color],textarea) { width:100%; min-width:0; min-height:40px; padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:var(--paper); color:var(--ink); font:inherit; }
.zone-first input[type=color] { padding:5px; cursor:pointer; }
.zone-first textarea { min-height:74px; resize:vertical; }
.zone-first .placement-extras .wide { grid-column:1/-1; }
.zone-first #coverage-height[hidden] { display:none; }
.catalog-search { margin-top:9px; }
.catalog-search-field { display:flex; position:relative; align-items:center; }
.catalog-search-field svg { width:17px; height:17px; left:11px; position:absolute; stroke:var(--muted); fill:none; stroke-width:1.7; stroke-linecap:round; pointer-events:none; }
.catalog-search-field input { background:var(--paper); padding-inline-start:35px; font-size:.82rem; }
.visual-filters { display:block; }
.facet-section { padding:14px 0; border-bottom:1px solid var(--border); }
.facet-section h3 { font-size:.88rem; margin:0 0 10px; color:var(--ink); }
.facet-grid { display:grid; gap:6px; }
.facet-grid .facet-group {
  display:grid; grid-template-columns:7.5ch minmax(0,1fr);
  align-items:start; gap:5px 15px; margin:0; padding:0; border:0;
}
.facet-label { color:var(--muted); font-size:.76rem; font-weight:650; padding-top:10px; overflow-wrap:anywhere; }
.facet-options { gap:4px 5px; }
.facet-options button,.facet-fixed {
  display:inline-flex; align-items:center; gap:6px; min-height:36px; max-width:100%;
  padding:5px 8px; border:1px solid transparent; border-radius:5px;
  font-size:.75rem; line-height:1.2; color:var(--ink); font-weight:600; background:transparent;
}
.facet-options button:hover { border-color:var(--border); background:var(--paper); }
.facet-options button[aria-pressed=true] {
  border-color:var(--accent); background:var(--accent-wash); color:var(--accent);
}
.facet-options button:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
.facet-fixed { font-weight:500; color:var(--muted); }
.facet-options .filter-sample,.facet-options .filter-color { width:21px; height:21px; border-radius:3px; }
.facet-options small { margin:2px 0 0; font-size:.63rem; font-weight:500; line-height:1.2; }
.facet-hint { margin:0; padding:9px 0; }
@container (max-width:360px) {
  .facet-grid .facet-group { grid-template-columns:minmax(0,1fr); }
  .facet-label { padding-top:3px; }
  .facet-options button,.facet-fixed { min-height:44px; }
}
.catalog-target { border-top:0; gap:7px; margin:10px 0 0; padding:0; }
#filter-selection { color:var(--muted); font-size:.75rem; }
#filter-selection:empty { display:none; }
.catalog-target #apply-filters { min-height:37px; padding:6px 13px; }
@media(min-width:761px){
 .project-flow .project-main .room-pane { padding-right:var(--editor-gutter); }
 .project-flow .editor-sidebar { padding-left:var(--editor-gutter); border-left:1px solid var(--border); }
}
@media(max-width:760px){
 .project-flow .editor-sidebar { border-top:1px solid var(--border); margin-top:15px; padding-top:14px; }
 .project-flow .map-head { padding-top:0; }
}

/* Flat page hierarchy across the visualizer. */
body { background:var(--page); }
.project-flow .editor-sidebar .zone-panel { background:transparent; box-shadow:none; border-radius:0; }
.project-flow .editor-sidebar .zone-first { padding-top:1px; }
.editor-sidebar { container-type:inline-size; }
.zone-first .wall-scope { gap:6px; }
.zone-first .wall-scope label { display:inline-flex; padding:6px 9px; gap:6px; align-items:center; min-height:35px; border:1px solid transparent; border-radius:7px; font-size:.81rem; }
.zone-first .wall-scope label:has(input:checked) { background:var(--accent-wash); border-color:var(--border); }
.zone-first .placement-location { align-items:flex-start; flex-wrap:wrap; }
.zone-first .placement-location[hidden] { display:none; }
.zone-first .zone-description[open] { flex-basis:100%; }
.zone-first .zone-description label { max-width:100%; margin-top:9px; }
.zone-first .coverage-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.zone-first .coverage-options button { width:100%; min-width:0; justify-content:flex-start; text-align:left; white-space:normal; line-height:1.14; }
.zone-first .coverage-options button[aria-pressed=true] { color:var(--accent); background:var(--paper); border-color:var(--accent); }
@container (max-width:415px) { .zone-first .coverage-options { grid-template-columns:repeat(2,minmax(0,1fr)); } }
#steps {
  column-gap:clamp(14px,3vw,42px); row-gap:4px;
  padding-block:clamp(12px,1.8vw,24px) 0;
  border-bottom:1px solid var(--border); margin-bottom:clamp(24px,3vw,42px);
}
#steps button,#steps button[aria-current=step] { border:0; border-bottom:2px solid transparent; background:none; border-radius:0; padding:9px 2px 12px; min-height:42px; }
#steps button[aria-current=step] { color:var(--accent); border-bottom-color:var(--accent); }
.rooms-home .room-intro { text-align:left; padding:clamp(22px,4vh,50px) 0 clamp(16px,3vh,29px); }
.rooms-home .room-intro h2 { font-size:clamp(2.1rem,5.4vw,4.65rem); }
.rooms-home .room-choice,.rooms-home .room-choice:is(:hover,:focus-visible) { background:transparent; border:0; border-radius:0; box-shadow:none; transform:none; overflow:visible; }
.rooms-home .room-choice::after { display:none; }
.rooms-home .room-choice img,.rooms-home .room-choice:is(:hover,:focus-visible) img { border-radius:8px; transform:none; }
.rooms-home .room-choice > span { position:static; color:var(--ink); padding:7px 0; border-bottom:1px solid var(--border); }
.rooms-home .room-choice > span span { color:var(--accent); border:0; background:transparent; }
.rooms-home .personal-room,.resume-card { padding-inline:0; background:transparent; border:0; border-top:1px solid var(--border); border-radius:0; box-shadow:none; }
.wizard-card.result-flow,.wizard-card.panorama-flow,.capture-main .wizard-card { background:transparent; border:0; border-radius:0; box-shadow:none; padding-inline:0; }
.wizard-card.result-flow,.wizard-card.panorama-flow { padding-top:0; }
.result-flow .result-actions { padding-inline:0; padding-bottom:12px; border-bottom:1px solid var(--border); }
.result-materials .zone-summary { grid-template-columns:1fr; gap:0; }
.result-materials .zone-summary li { display:grid; grid-template-columns:minmax(180px,28%) minmax(0,1fr) auto; align-items:center; gap:12px; padding:13px 0; border:0; border-top:1px solid var(--border); border-radius:0; background:none; }
.result-materials .zone-summary li dl { margin:0; padding:0; border:0; }
.result-materials [data-material-index] { margin:0; justify-self:start; }
.panorama-flow .view-strip { margin-block:15px; }
.panorama-flow .view-strip figure { background:transparent; border-radius:0; }
body.capture-page main.capture-main { max-width:none; width:min(100%,960px); padding-inline:clamp(15px,4vw,44px); }
body.capture-page .capture-main .wizard-card { padding-block:10px; }
body.capture-page .capture-main .capture-choice { border-radius:8px; box-shadow:none; }
.privacy-page .capture-main article { background:none; box-shadow:none; border:0; border-radius:0; }
@media(max-width:800px) {
 .result-materials .zone-summary li { grid-template-columns:1fr; gap:8px; }
}


.wizard-card.result-flow { display:grid; gap:22px; width:100%; margin-inline:auto; }
.result-heading { margin:0; padding-bottom:clamp(14px,2vw,24px); border-bottom:1px solid var(--border); }
.result-heading h2 { margin:0; font-size:clamp(1.8rem, 3vw, 2.65rem); letter-spacing:-.045em; line-height:1.1; }
.result-details,.result-visual { min-width:0; }
.result-visual { margin:0; }
.result-visual figcaption { margin:0 0 10px; color:var(--muted); font-size:.83rem; line-height:1.45; }
.result-flow .result-materials { margin:0; }
.result-flow .result-materials h3 { margin-bottom:14px; }
.result-flow .zone-summary li { grid-template-columns:minmax(0,1fr); gap:12px; padding:16px 0; }
.result-flow .zone-summary dl { grid-template-columns:repeat(auto-fit,minmax(85px,1fr)); gap:10px 16px; }
.result-flow .result-actions {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px;
  overflow:visible; margin-top:16px; padding:16px 0 0; border:0; border-top:1px solid var(--border);
}
.result-flow .result-actions button { min-height:42px; white-space:normal; text-align:left; }
@media(min-width:1050px) {
  .wizard-card.result-flow {
    grid-template-columns:minmax(220px, .85fr) minmax(0, 2.5fr) minmax(165px, .65fr);
    gap:24px clamp(16px,2vw,32px);
    align-items:start;
  }
  .result-heading { grid-column:1/-1; }
  .result-flow .result-visual { position:sticky; top:16px; }
  .result-flow .result-actions {
    grid-template-columns:minmax(0,1fr);
    margin:0; padding:0 0 0 12px; border:0; border-left:1px solid var(--border);
  }
  .result-flow .result-actions button { width:100%; justify-content:flex-start; }
}
.result-flow .compare-result { width:100%; margin:0; border-radius:2px; }
.result-flow .compare-base { width:100%; max-height:none; border-radius:0; }
.compare-divider span svg { width:25px; height:25px; }
.result-flow .compare-divider { inset:0; width:auto; transform:none; background:none; box-shadow:none; }
.result-flow .compare-divider::before { content:""; position:absolute; inset-block:0; left:clamp(1px,var(--split),calc(100% - 1px)); width:2px; background:white; box-shadow:0 0 4px #0008; }
.result-flow .compare-divider span { left:clamp(24px,var(--split),calc(100% - 24px)); }


.result-flow .result-materials .zone-summary li { gap:14px; padding-block:18px; }
.result-flow .result-material { align-items:flex-start; gap:11px; }
.result-flow .result-material > div { min-width:0; }
.result-flow .result-material h4 { overflow-wrap:anywhere; }
.result-flow .result-zone { display:block; margin-bottom:4px; }
.result-flow .zone-summary li dl {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 14px;
  padding-top:11px; border-top:1px solid var(--border);
}
.result-flow .zone-summary li [data-material-index] { width:100%; justify-self:stretch; min-height:36px; }

#material-dialog { border-radius:4px; }
#material-dialog .library-header { margin-bottom:0; }
#material-dialog .library-header h2 { font-size:clamp(1.4rem,3vw,2rem); line-height:1.12; overflow-wrap:anywhere; }
#material-dialog .material-inspection { padding-top:14px; gap:clamp(16px,3vw,34px); }
#tile-model-view { border-radius:3px; background:radial-gradient(ellipse at 50% 36%,var(--paper),var(--subtle)); }
#material-hint {
  position:absolute; inset:auto 12px 10px; color:var(--muted);
  text-align:center; font-size:.76rem; pointer-events:none;
}
#material-dialog .material-controls {
  display:grid; grid-template-columns:auto minmax(0,1fr) auto auto;
  gap:8px; margin-top:0; padding:9px 0; color:var(--muted); font-size:.8rem;
}
#material-zoom { width:100%; min-width:0; accent-color:var(--accent); }
#material-zoom-value { min-width:5ch; text-align:right; font-variant-numeric:tabular-nums; }
#material-reset { border-radius:4px; font-size:.78rem; }
.material-specs h3 { margin:0 0 12px; padding-bottom:9px; border-bottom:1px solid var(--border); font-size:1rem; }
.material-specs .material-facts { gap:8px 18px; }
.material-specs .material-facts div { padding:5px 0 9px; min-width:0; }
.material-specs dd { overflow-wrap:anywhere; }
@media(max-width:420px) {
  #material-dialog .material-controls { grid-template-columns:auto minmax(0,1fr) auto; }
  #material-reset { grid-column:1/-1; justify-self:start; }
}

#format-dialog { width:min(1140px, calc(100% - 24px)); border-radius:4px; }
#format-dialog .library-header { margin-bottom:0; }
#format-dialog .library-header h2 { font-size:clamp(1.4rem,3vw,2rem); }
#format-dialog .format-body { padding-top:14px; }
#format-dialog .format-canvas img { max-height:65dvh; }
.format-lift {
  --lift-x:28px; --lift-y:-54px; --lift-scale:1.44; --lift-height:1.44; --lift-angle:0deg;
  transform-box:view-box;
  transform:translate(var(--lift-x),var(--lift-y)) rotate(var(--lift-angle)) scale(var(--lift-scale),var(--lift-height));
  animation:format-piece-lift 650ms cubic-bezier(.22,.7,.22,1) both;
  filter:drop-shadow(2px 9px 6px #130c09bb);
}
.format-floor .format-lift { --lift-x:0px; --lift-y:-88px; --lift-scale:1.44; --lift-height:1.44; --lift-angle:0deg; }
.format-lift .format-outline { stroke-width:3px; }
@keyframes format-piece-lift {
  0% { transform:none; }
  72% { transform:translate(calc(var(--lift-x) * 1.1),calc(var(--lift-y) * 1.1)) rotate(var(--lift-angle)) scale(calc(var(--lift-scale) + .05),calc(var(--lift-height) + .05)); }
  100% { transform:translate(var(--lift-x),var(--lift-y)) rotate(var(--lift-angle)) scale(var(--lift-scale),var(--lift-height)); }
}
@media(prefers-reduced-motion:reduce) { .format-lift { animation:none; } }

/* Shared visualizer dialog frame and header. */
:is(#favorite-dialog,#material-dialog,#format-dialog,#quote-dialog,#zoom-dialog,#progress,dialog.capture-dialog) {
  border:1px solid var(--border); border-radius:4px;
}
:is(#favorite-dialog,#material-dialog,#format-dialog,#quote-dialog,#zoom-dialog,#progress,dialog.capture-dialog)::backdrop {
  background:var(--veil); backdrop-filter:blur(3px);
}
dialog .library-header {
  gap:14px; padding:18px clamp(14px,3vw,24px) 14px;
  border-bottom:1px solid var(--border);
}
dialog .library-header h2 {
  margin:0; font-size:clamp(1.4rem,3vw,2rem); line-height:1.12;
  overflow-wrap:anywhere;
}
dialog .library-header h2 + p { margin:6px 0 0; line-height:1.45; }
dialog .library-header button.close {
  position:static; display:grid; place-items:center; flex:none; width:38px; height:38px;
  padding:0; border-radius:4px; font-size:1.25rem;
}
#quote-dialog { padding:0; }
#quote-form { padding:16px clamp(14px,3vw,24px) 20px; }
#quote-form .field-grid { gap:12px; }
#quote-form .flow-actions { gap:8px; }
#quote-status:empty { display:none; }
#zoom-dialog .zoom-header { background:var(--paper); }
#zoom-dialog .zoom-controls { border-block:0; border-bottom:1px solid var(--border); }
#favorite-dialog #favorite-list article,#favorite-dialog #favorite-list article img { border-radius:4px; }
dialog.capture-dialog { padding:0 clamp(14px,3vw,24px) 19px; }
.capture-dialog .library-header { padding-inline:0; }
.capture-dialog .qr-stage,.capture-dialog .qr-steps li { border-radius:4px; }
#progress .generation-detail { border-radius:4px; }

#format-tooltips { position:absolute; inset:0; pointer-events:none; }
.format-callout {
  position:absolute; left:0; top:0; visibility:hidden;
  width:max-content; max-width:min(150px,45%); padding:6px 8px; border-top:2px solid var(--format-accent);
  border-radius:3px; background:var(--overlay-label); color:#fff; box-shadow:0 3px 11px #0006;
  font-size:.72rem; line-height:1.3;
  animation:format-callout-in 300ms 380ms ease-out both;
}
.format-callout strong,.format-callout span { display:block; overflow-wrap:anywhere; }
.format-callout span { margin-top:2px; }
@keyframes format-callout-in { from { opacity:0; translate:0 9px; } to { opacity:1; translate:0 0; } }
@media(prefers-reduced-motion:reduce) { .format-callout { animation:none; } }

#material-dialog .face-top { background:none; background-color:var(--subtle); overflow:hidden; }
#material-dialog .face-top::before {
  content:''; position:absolute; inset:0; background:var(--tile-texture) center / cover no-repeat;
}
#material-dialog .is-texture-turned .face-top::before {
  inset:50% auto auto 50%; width:var(--model-h); height:var(--model-w);
  transform:translate(-50%,-50%) rotate(90deg);
}
#material-sample { display:block; max-width:94%; max-height:90%; object-fit:contain; }
#material-sample[hidden],#tile-model[hidden],.is-flat #material-hint { display:none; }
#tile-model-view.is-flat { cursor:default; touch-action:auto; }
#tile-model-view.is-flat::before { display:none; }
#material-flat { grid-column:1/-1; justify-self:start; border-radius:4px; font-size:.78rem; }
#format-dialog { width:min(1380px,calc(100% - 24px)); }
#format-dialog .format-canvas img { max-height:75dvh; }
#format-dialog .format-body { padding-inline:clamp(10px,2vw,20px); }

@media(max-width:760px) {
  main.wizard { padding-inline:clamp(12px,4vw,24px); }
  .studio-top { gap:8px; }
  .studio-top .header-actions { min-width:0; flex-wrap:wrap; justify-content:flex-end; }
  .studio-top .grespania-logo { flex:none; }
  .rooms-home .room-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .rooms-home .personal-room .flow-actions { display:grid; grid-template-columns:minmax(0,1fr); width:100%; }
  .project-flow .map-control-head { flex-wrap:wrap; }
  .project-flow .map-assignments button,.zone-first .coverage-options button,
  .zone-first .wall-scope label,.editor-sidebar .catalog-target button,
  .result-flow .result-actions button,.result-flow .zone-summary li [data-material-index],
  .panorama-flow .flow-actions button,.capture-page .capture-choice { min-height:44px; }
  .editor-sidebar .catalog-target .primary { flex:1 1 100%; margin-left:0; }
  .editor-sidebar input[type=search],.zone-first :is(input[type=text],input[type=number],input[data-field=location],textarea),
  #quote-form :is(input,textarea) { font-size:16px; }
  .result-flow .result-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .panorama-flow .view-strip { grid-template-columns:repeat(auto-fit,minmax(min(100px,100%),1fr)); }
  .panorama-flow canvas { max-width:100%; }
  dialog .library-header button.close { width:44px; height:44px; }
  #favorite-dialog .favorite-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); overflow:visible; }
  #favorite-dialog .favorite-tabs button { min-width:0; min-height:44px; white-space:normal; }
  #zoom-material-list { display:grid; overflow:visible; }
  #zoom-dialog .zoom-controls button,#material-dialog button:not(.close) { min-height:44px; }
  #format-dialog .format-body { padding-bottom:12px; }
  .format-callout { font-size:.65rem; padding:4px 5px; }
}
@media(max-width:370px) {
  .studio-top .header-actions { gap:4px; }
  .studio-top .header-guide { white-space:normal; text-align:center; }
  .panorama-flow .flow-actions,#quote-form .flow-actions { display:grid; grid-template-columns:minmax(0,1fr); }
}

#zoom-materials { min-width:0; }
#zoom-material-list { gap:0; }
#zoom-material-list li { min-width:0; padding:8px 0; border-bottom:1px solid var(--border); }
#zoom-material-list li > :is(button,div) {
  display:grid; grid-template-columns:52px minmax(0,1fr); align-items:start;
  gap:12px; min-height:68px; padding:8px; border-radius:3px;
}
#zoom-material-list img { width:52px; height:52px; margin:0; border-radius:2px; object-fit:contain; background:var(--paper); }
#zoom-material-list span { min-width:0; gap:4px; overflow-wrap:anywhere; }
#zoom-material-list small { line-height:1.3; }
.result-flow .result-locate {
  width:100%; text-align:left; justify-content:flex-start; padding:5px;
  border:1px solid transparent; border-radius:3px; background:transparent;
}
.result-flow .result-locate:is(:hover,[aria-pressed=true]) { border-color:var(--border); background:var(--paper); }
.result-flow .result-locate > span { min-width:0; overflow-wrap:anywhere; }
.result-flow .result-locate strong,.result-flow .result-locate small { display:block; }
.result-flow .result-locate small { color:var(--muted); margin-top:4px; }
.result-zone-marker {
  position:absolute; z-index:4; pointer-events:none; display:grid; place-items:center;
  left:clamp(19px,var(--zone-x),calc(100% - 19px)); top:clamp(19px,var(--zone-y),calc(100% - 19px));
  width:36px; height:36px; transform:translate(-50%,-50%); color:white; font-weight:700;
  border:2px solid white; border-radius:50%; background:#a52324; box-shadow:0 0 0 4px #a5232466;
}
.result-zone-marker[hidden],#result-zone-status:empty { display:none; }
#result-zone-status { margin:8px 0 0; color:var(--muted); font-size:.85rem; }
@media(min-width:1050px) {
  .result-flow .result-actions { position:sticky; top:16px; max-height:calc(100dvh - 32px); overflow:auto; }
}
.placement-outline { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.placement-outline polygon { fill:#a523243d; stroke:#b62628; stroke-width:2px; vector-effect:non-scaling-stroke; }
.result-outline { z-index:3; }

.map-assignments button .zone-number { color:#fff; }

#steps.pan-steps { column-gap:clamp(10px,2.5vw,34px); }
#steps .pan-step-number {
  display:inline-grid; place-items:center; width:1.55em; height:1.55em;
  margin-inline-end:.45em; border-radius:50%; background:var(--subtle); color:var(--ink);
}
#steps [aria-current=step] .pan-step-number { background:var(--accent); color:var(--paper); }


/* Preserve contrast for fields, status messages and photo overlays in either theme. */
.message { color:var(--danger); background:var(--danger-wash); }
#quote-form :is(input,textarea) {
  background:var(--field); color:var(--ink); border-color:var(--border);
}
#quote-form :is(input,textarea)::placeholder,.catalog-search-field input::placeholder { color:var(--muted); opacity:1; }
input:is([type=range],[type=radio],[type=checkbox]) { accent-color:var(--accent); }
.room-choice:focus-visible,button:focus-visible,.header-guide:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.capture-dialog .qr { background:#fff; }
.capture-page #message:not(:empty),#quote-status:not(:empty) { color:var(--ink); background:var(--subtle); padding:8px 12px; }

.panorama-base-layout { display:grid; gap:clamp(16px,2.5vw,36px); margin-top:20px; }
.panorama-base-photos { min-width:0; }
.panorama-base-photos .view-strip { margin-top:0; }
.panorama-base-actions { display:grid; gap:8px; margin:0; }
.panorama-base-actions button { width:100%; min-height:44px; }
@media(min-width:761px) {
  .panorama-base-layout { grid-template-columns:minmax(0,1fr) minmax(212px,19%); align-items:start; }
  .panorama-base-actions { position:sticky; top:16px; padding-left:14px; border-left:1px solid var(--border); }
  .panorama-base-actions button { justify-content:flex-start; text-align:left; }
}

/* Panorama setup and saved projects */
.panorama-base-heading { max-width:74ch; }
.panorama-base-heading p { margin:12px 0 0; color:var(--muted); line-height:1.55; }
.panorama-base-layout { gap:clamp(24px,4vw,56px); margin-top:clamp(24px,4vw,42px); }
.panorama-photos-heading {
  display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline;
  gap:8px; border-bottom:1px solid var(--border); padding-bottom:12px;
}
.panorama-base-layout h3 { font-size:1rem; margin:0; }
.panorama-photos-heading p,.panorama-base-actions p { margin:0; color:var(--muted); font-size:.875rem; line-height:1.45; }
.panorama-flow .panorama-base-photos .view-strip {
  grid-template-columns:repeat(auto-fill,minmax(min(100%,225px),1fr));
  gap:clamp(12px,2vw,22px); margin-top:16px;
}
.panorama-flow .panorama-base-photos figure { padding:0; background:var(--paper); min-width:0; }
.panorama-flow .panorama-base-photos figure img {
  display:block; width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:0;
}
.panorama-base-photos figcaption {
  display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center;
  gap:8px; min-height:56px; padding:8px 12px; font-size:.875rem; font-weight:650;
}
.panorama-view-tools { display:flex; flex-wrap:wrap; align-items:center; gap:5px; }
.panorama-view-tools button { min-width:36px; min-height:36px; border-radius:4px; }
.panorama-base-actions { gap:0; }
.panorama-base-actions section { display:grid; gap:9px; padding-bottom:16px; margin-bottom:16px; border-bottom:1px solid var(--border); }
.panorama-upload-buttons { display:grid; gap:8px; }
.panorama-base-actions button { border-radius:4px; white-space:normal; }
@media(min-width:900px) {
  .panorama-base-layout { grid-template-columns:minmax(0,1fr) minmax(236px,24%); }
  .panorama-base-actions { padding-left:clamp(16px,3vw,36px); }
}
@media(max-width:899px) {
  .panorama-base-actions { padding-top:18px; border-top:1px solid var(--border); }
  .panorama-view-tools button { min-width:44px; min-height:44px; }
}

#favorite-dialog {
  --library-padding:clamp(16px,4vw,36px);
  width:min(1020px,calc(100% - 24px)); max-height:min(90dvh,900px); background:var(--paper);
}
#favorite-dialog[open] { display:grid; grid-template-rows:auto auto minmax(150px,1fr); overflow:hidden; }
#favorite-dialog .library-header { padding:clamp(18px,3vw,30px) var(--library-padding) 16px; border-bottom:0; }
#favorite-dialog .favorite-tabs {
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; padding:0 var(--library-padding);
}
#favorite-dialog .favorite-tabs button {
  min-width:0; min-height:44px; background:transparent; border:0; border-bottom:2px solid transparent;
  border-radius:0; color:var(--muted); white-space:normal;
}
#favorite-dialog .favorite-tabs button[aria-pressed=true] { border-bottom-color:var(--accent); color:var(--accent); font-weight:750; }
#favorite-dialog #favorite-list {
  grid-template-columns:repeat(auto-fill,minmax(min(100%,230px),1fr)); align-content:start;
  gap:18px; max-height:none; padding:clamp(16px,3vw,30px) var(--library-padding); background:var(--subtle);
}
#favorite-dialog #favorite-list article {
  display:flex; flex-direction:column; gap:10px; margin:0; padding:14px; background:var(--paper); border-radius:4px;
}
#favorite-dialog #favorite-list article img { height:auto; max-height:none; aspect-ratio:16/10; margin:0; object-fit:cover; }
#favorite-dialog #favorite-list[data-view=products] article img { object-fit:contain; }
#favorite-dialog #favorite-list article strong { line-height:1.3; overflow-wrap:anywhere; }
#favorite-dialog #favorite-list article small { color:var(--muted); }
#favorite-dialog #favorite-list article .flow-actions { margin-top:auto; padding-top:5px; gap:6px; flex-wrap:wrap; }
#favorite-dialog #favorite-list article button { min-height:38px; border-radius:4px; }
.favorite-empty {
  grid-column:1/-1; margin:0; padding:clamp(22px,6vw,44px); text-align:center;
  color:var(--muted); background:var(--paper); border:1px dashed var(--border);
}
@media(max-width:440px) {
  #favorite-dialog .favorite-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #favorite-dialog #favorite-list article button { min-height:44px; }
}
