:root {
  color-scheme: dark;
  --bg: #090c11;
  --panel: #101620;
  --panel-2: #151d29;
  --line: #2a3443;
  --muted: #98a6b8;
  --text: #f4f7fb;
  --accent: #00b294;
  --accent-soft: rgba(0, 178, 148, .14);
  --danger: #ff7d7d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); overflow: hidden; }
button, select, input { font: inherit; }

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 12, 17, .92);
}

.brand-pair, .project-title { display: flex; align-items: center; }
.brand-pair { gap: 18px; }
.brand { min-height: 36px; display: grid; place-items: center; }
.brand--sovr { font-weight: 900; font-size: 1.45rem; letter-spacing: .16em; color: white; }
.brand--partner { min-width: 148px; padding: 8px 14px; border: 1px dashed #536174; border-radius: 6px; color: var(--muted); font-size: .8rem; }
.brand-divider { width: 1px; height: 30px; background: var(--line); }
.project-title { gap: 12px; font-size: .9rem; }
.project-title span { color: var(--muted); }

.workspace { height: calc(100% - 76px); display: grid; grid-template-columns: minmax(0, 1fr) 410px; }
.viewer-panel { position: relative; min-width: 0; background: radial-gradient(circle at 45% 40%, #202a38 0, #0b1017 58%, #07090d 100%); }
model-viewer { width: 100%; height: 100%; --poster-color: transparent; }
.viewer-state { color: var(--muted); }
.viewer-help { position: absolute; left: 20px; bottom: 18px; padding: 8px 11px; border-radius: 6px; background: rgba(7, 10, 15, .72); color: #c6d0dc; font-size: .78rem; backdrop-filter: blur(8px); }
.icon-button { position: absolute; right: 18px; bottom: 18px; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: rgba(16, 22, 32, .86); color: white; cursor: pointer; font-size: 1.25rem; }

.control-panel { overflow-y: auto; padding: 26px; background: var(--panel); border-left: 1px solid var(--line); }
.eyebrow { margin: 0 0 7px; color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 800; }
h1 { margin: 0; font-size: 1.55rem; line-height: 1.18; }
.panel-heading > p:last-child { color: var(--muted); line-height: 1.5; font-size: .9rem; }
.field-row { display: grid; gap: 7px; margin: 22px 0 15px; }
label { font-size: .88rem; font-weight: 650; }
select { width: 100%; padding: 11px 12px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; }

.dropzone { min-height: 144px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 18px; border: 1px dashed #526176; border-radius: 9px; background: #0c1119; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.dropzone:hover, .dropzone.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; opacity: 0; pointer-events: none; }
.dropzone small { color: var(--muted); }
.drop-icon { padding: 5px 7px; border: 1px solid var(--accent); border-radius: 4px; color: var(--accent); font-size: .7rem; font-weight: 900; }
.status { margin: 13px 0; min-height: 36px; padding: 9px 11px; border-left: 2px solid var(--line); color: var(--muted); font-size: .83rem; line-height: 1.4; }
.status.ok { border-color: var(--accent); color: #b9efe6; }
.status.error { border-color: var(--danger); color: #ffc0c0; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
h2 { margin: 0; font-size: .95rem; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: .82rem; }
.page-list { display: grid; gap: 10px; }
.page-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.page-card canvas { width: 76px; height: 76px; object-fit: contain; background: white; border-radius: 3px; }
.page-info { display: flex; min-width: 0; flex-direction: column; gap: 2px; font-size: .76rem; color: var(--muted); }
.page-info strong { color: var(--text); font-size: .86rem; }
.page-scale { color: #b9efe6; }
.page-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.page-actions button, .secondary-button { min-height: 38px; border: 1px solid var(--line); border-radius: 5px; background: #1b2533; color: var(--text); cursor: pointer; }
.page-actions button.active { border-color: var(--accent); background: var(--accent-soft); color: #c6fff5; }

.settings { margin: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.settings summary { padding: 14px 0; cursor: pointer; font-size: .86rem; font-weight: 700; }
.settings-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; padding-bottom: 14px; align-items: center; color: var(--muted); font-size: .8rem; }
.settings-grid label { font-size: .8rem; }
.settings-grid select { padding: 8px; }
.settings-grid output { color: var(--text); }
.secondary-button { width: 100%; background: transparent; }
button:hover { border-color: #526176; }
button:focus-visible, select:focus-visible, .dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 820px) {
  body { overflow: auto; }
  .topbar { height: auto; min-height: 68px; padding: 12px 16px; }
  .project-title span { display: none; }
  .brand--partner { min-width: 110px; }
  .workspace { height: auto; min-height: calc(100vh - 68px); grid-template-columns: 1fr; grid-template-rows: 52vh auto; }
  .control-panel { border-left: 0; border-top: 1px solid var(--line); padding: 22px 18px 34px; }
  .viewer-help { left: 10px; right: 62px; bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .icon-button { right: 10px; bottom: 10px; }
}
/* Partner proof workflow */
.workspace{grid-template-columns:minmax(0,1fr) 460px}.control-panel{padding:24px}.assignment{display:grid;gap:8px;border-left:3px solid var(--accent);background:var(--accent-soft);padding:16px;margin:22px 0 18px}.assignment strong{font-size:1.3rem}.assignment>span:last-child{font-size:.9rem;line-height:1.6;color:#bdd8d3}.help{font-size:.875rem;line-height:1.55;color:var(--muted)}.wall-list{display:grid;gap:18px}.wall-card{padding:16px;background:var(--panel-2);border:1px solid var(--line);border-radius:8px}.wall-card h3{margin:0;font-size:1.1rem}.wall-size{color:var(--muted);font-size:.875rem;margin:5px 0 12px}.wall-preview{display:block;width:100%;height:185px;object-fit:contain;background:#080d14;margin:0 0 14px}.wall-card label{display:grid;gap:6px;margin:10px 0;font-size:.875rem;min-width:0}.wall-card select{min-width:0;font-size:.875rem}.two-fields{display:grid;grid-template-columns:1fr 1.3fr;gap:10px}.crop-fields{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.crop-fields>span{grid-column:1/-1;font-size:.875rem;color:var(--muted);line-height:1.5;margin-top:8px}.crop-fields input{width:100%;min-width:0;background:#0c1119;color:white;border:1px solid var(--line);padding:9px 5px;border-radius:4px}.check-result{font-size:.875rem;line-height:1.55;color:#b9efe6;border-left:2px solid var(--accent);padding-left:10px}.check-result.warning{color:#f8d7a0;border-color:#d9a04e}.texture-info{font-size:.875rem;color:var(--muted);margin-bottom:0}.confirm-row{display:flex;align-items:flex-start;gap:10px;margin:20px 0;line-height:1.5}.confirm-row input{width:18px;height:18px;flex-shrink:0;accent-color:var(--accent);margin-top:2px}.primary-button{width:100%;min-height:48px;background:var(--accent);color:#061a17;font-weight:750;border:0;border-radius:6px;cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}.spread-preview{position:relative;margin:14px 0;background:white}.spread-preview canvas{display:block;width:100%;height:auto}#split-line{position:absolute;top:0;bottom:0;width:2px;background:#ff4e76;pointer-events:none;box-shadow:0 0 0 1px white}#split-position{width:100%;accent-color:var(--accent);margin-top:10px}.status{font-size:.875rem;overflow-wrap:anywhere}.dropzone small{font-size:.875rem}.dropzone{line-height:1.5}.text-button,.settings summary,.settings-grid,.settings-grid label{font-size:.875rem}[hidden]{display:none!important}
@media(max-width:950px){.workspace{grid-template-columns:minmax(0,1fr) 400px}.control-panel{padding:18px}}@media(max-width:820px){.workspace{grid-template-columns:1fr;grid-template-rows:48vh auto}.control-panel{padding:22px 18px}.project-title{font-size:.875rem}.brand--partner{min-width:0;font-size:.75rem}.brand-pair{gap:10px}.topbar{gap:14px;padding:12px}.brand--sovr{font-size:1.1rem}.wall-preview{height:220px}}@media(max-width:400px){.project-title{display:none}.two-fields{grid-template-columns:1fr}.crop-fields{grid-template-columns:repeat(2,1fr)}}

.crop-overview{display:block;width:100%;height:120px;object-fit:contain;background:#080d14;margin-top:14px}
.carpet-panel{margin:18px 0 22px;padding:16px;background:#16252b;border:1px solid #367c72;border-radius:9px}.carpet-panel .section-title{margin:0 0 12px;gap:10px}.carpet-panel h2{font-size:1.1rem}.carpet-badge{font-size:.875rem;color:#a8d7cd}.carpet-picker{background:#0c151d;border:1px solid #54786f;border-radius:7px;overflow:hidden}.carpet-picker summary{display:flex;align-items:center;gap:12px;padding:12px;cursor:pointer;list-style:none;min-height:80px}.carpet-picker summary::-webkit-details-marker{display:none}.carpet-selection{display:grid;gap:4px;flex:1;min-width:0}.carpet-selection strong{font-size:1.0625rem}.carpet-selection small{font-size:.875rem;color:#b1c7c3}.carpet-chevron{font-size:1.5rem}.carpet-picker[open] .carpet-chevron{transform:rotate(180deg)}.carpet-swatch{--carpet-tint:#bdbdbd;display:block;flex-shrink:0;width:62px;height:52px;border:1px solid #ffffff38;border-radius:4px;background-color:var(--carpet-tint);background-image:url('assets/carpet-felt.png');background-blend-mode:multiply;background-size:155px 155px}.carpet-picker fieldset{border:0;border-top:1px solid var(--line);margin:0;padding:6px;display:grid;gap:3px}.carpet-option{display:flex;align-items:center;gap:12px;padding:8px;border:1px solid transparent;border-radius:5px;cursor:pointer;font-size:1rem;font-weight:500}.carpet-option:has(input:checked){background:var(--accent-soft);border-color:var(--accent)}.carpet-option:hover{background:#ffffff0c}.carpet-option input{accent-color:var(--accent);width:18px;height:18px;flex-shrink:0}.carpet-option .carpet-swatch{width:54px;height:42px}.carpet-status{font-size:.875rem;color:#c2e7df;line-height:1.5;margin:12px 0 0}.carpet-caption{font-size:.8125rem;line-height:1.5;color:var(--muted);margin:8px 0 0}.carpet-picker summary:focus-visible,.carpet-option:focus-within{outline:2px solid var(--accent);outline-offset:-2px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:400px){.carpet-panel .section-title{align-items:flex-start;flex-direction:column}.carpet-panel{padding:12px}}

.ppi-result,.color-result{font-size:.875rem;line-height:1.55;color:#b9efe6;border-left:2px solid var(--accent);padding:10px;background:#0c151d}.ppi-result.warning,.color-result.warning{color:#f8d7a0;border-color:#d9a04e}

.camera-panel{position:absolute;top:18px;left:18px;right:18px;max-width:490px;background:rgba(9,16,23,.94);border:1px solid var(--line);border-radius:8px;padding:12px;z-index:5}.camera-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}.camera-heading strong{font-size:1rem}#hotspot-navigation{display:flex;flex-wrap:wrap;gap:6px}.camera-preset{color:var(--text);background:#1b2533;border:1px solid #465569;border-radius:5px;min-height:38px;padding:7px 10px;font-size:.875rem;cursor:pointer}.camera-preset[aria-pressed=true],.stand-hotspot[aria-pressed=true]{background:#087563;border-color:#65e3c8;color:white}#hotspot-status{font-size:.8125rem;color:var(--muted);line-height:1.4;margin:9px 0 0}.stand-hotspot{background:#102b30;color:#fff;border:1px solid #64d7bf;box-shadow:0 2px 10px #0008;border-radius:18px;padding:7px 12px;cursor:pointer;font:600 14px system-ui;white-space:nowrap}.stand-hotspot:focus-visible{outline:3px solid white;outline-offset:3px}@media(max-width:820px){.camera-panel{top:10px;left:10px;right:10px;padding:9px}#hotspot-status{margin-top:6px}.camera-heading{margin-bottom:6px}.stand-hotspot{font-size:12px;padding:5px 8px}}

.viewer-panel.stand-loading model-viewer,.viewer-panel.stand-loading .camera-panel,.viewer-panel.stand-loading .viewer-help,.viewer-panel.stand-loading #reset-camera{opacity:0;pointer-events:none}
#stand-loading{position:absolute;inset:0;z-index:20;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#1b252b;padding:2rem;text-align:center}
#stand-loading[hidden]{display:none}

.brand--sovr img{display:block;width:72px;height:54px;object-fit:contain}.brand--partner{background:transparent;border:0;padding:0;min-width:0}.brand--partner img{display:block;width:180px;height:auto;max-width:100%}@media(max-width:600px){.brand--sovr img{width:56px;height:42px}.brand--partner img{width:132px}.brand--partner{padding:0}.project-title{min-width:0}}
