/* RO Furniture Sofa Visualizer - front end. Everything is scoped under .rofsv-app. */
.rofsv-app{
  --rofsv-primary:#0A5EB0;--rofsv-accent:#00C6B7;
  --rofsv-bg:#f3f5f8;--rofsv-card:#ffffff;--rofsv-text:#1b2430;--rofsv-muted:#5e6b7a;
  --rofsv-line:#e1e6ec;--rofsv-soft:#eef2f7;--rofsv-stage:#e9edf2;--rofsv-focus:#0A5EB0;
  --rofsv-danger:#b42318;--rofsv-ok:#067647;
  --rofsv-card-r:14px;
  position:relative;box-sizing:border-box;width:100%;max-width:1280px;margin:0 auto;
  color:var(--rofsv-text);background:var(--rofsv-bg);border-radius:calc(var(--rofsv-card-r) + 2px);
  font:400 15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  overflow:hidden;
}
.rofsv-app[data-rofsv-theme="dark"]{
  --rofsv-bg:#0f141b;--rofsv-card:#18202a;--rofsv-text:#e8edf3;--rofsv-muted:#9aa7b6;
  --rofsv-line:#2a3544;--rofsv-soft:#212b38;--rofsv-stage:#121820;--rofsv-focus:#5ab0ff;
  --rofsv-danger:#ff8a80;--rofsv-ok:#5fd3a0;
  color-scheme:dark;
}
.rofsv-app *,.rofsv-app *::before,.rofsv-app *::after{box-sizing:border-box}
.rofsv-app h2,.rofsv-app h3,.rofsv-app p{margin:0}
.rofsv-app button{font-family:inherit}
.rofsv-app [hidden]{display:none!important}
.rofsv-app :focus-visible{outline:2px solid var(--rofsv-focus);outline-offset:2px}
.rofsv-app svg{display:block}
.rofsv-icon{width:1.25em;height:1.25em;flex:none}

/* header */
.rofsv-header{background:var(--rofsv-hdr-bg,linear-gradient(135deg,#0A5EB0,#00C6B7));color:var(--rofsv-hdr-fg,#fff);padding:var(--rofsv-hdr-pad,28px)}
.rofsv-header-inner{display:flex;align-items:center;gap:18px;max-width:1240px;margin:0 auto}
.rofsv-header-icon{display:inline-flex;width:var(--rofsv-hdr-icon,40px);height:var(--rofsv-hdr-icon,40px);flex:none}
.rofsv-header-icon svg,.rofsv-header-icon .rofsv-icon{width:100%;height:100%}
.rofsv-logo{height:var(--rofsv-logo-h,48px);width:auto;max-width:200px;object-fit:contain;flex:none}
.rofsv-company{font-size:12px;letter-spacing:.08em;text-transform:uppercase;opacity:.85;font-weight:600}
.rofsv-title{font-size:var(--rofsv-hdr-title,28px);line-height:1.15;font-weight:700;color:inherit}
.rofsv-subtitle{font-size:var(--rofsv-hdr-sub,16px);opacity:.92;margin-top:4px}
.rofsv-desc{font-size:14px;opacity:.85;margin-top:6px;max-width:720px}
.rofsv-align-center .rofsv-header-inner{justify-content:center;text-align:center}
.rofsv-align-right .rofsv-header-inner{justify-content:flex-end;text-align:right}
.rofsv-logo-right .rofsv-header-inner{flex-direction:row-reverse}
.rofsv-logo-top .rofsv-header-inner{flex-direction:column;align-items:flex-start}
.rofsv-logo-top.rofsv-align-center .rofsv-header-inner{align-items:center}
.rofsv-logo-top.rofsv-align-right .rofsv-header-inner{align-items:flex-end}

/* footer */
.rofsv-footer{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px 16px;padding:14px 24px;background:var(--rofsv-ftr-bg,#0b2440);color:var(--rofsv-ftr-fg,#dbe7f5);font-size:13px}
.rofsv-footer a{color:inherit;text-decoration:underline;text-underline-offset:2px}

/* mount + workspace */
.rofsv-mount{padding:20px}
.rofsv-loading{padding:40px;text-align:center;color:var(--rofsv-muted)}
.rofsv-empty{padding:40px;text-align:center;color:var(--rofsv-muted)}
.rofsv-workspace{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(320px,1fr);gap:20px;align-items:start}
.rofsv-stage-col{display:flex;flex-direction:column;gap:16px;min-width:0;position:sticky;top:16px}
.rofsv-panel-col{display:flex;flex-direction:column;gap:16px;min-width:0}
.rofsv-layout-stacked .rofsv-workspace{grid-template-columns:minmax(0,1fr)}
.rofsv-layout-stacked .rofsv-stage-col{position:static}

/* cards */
.rofsv-card{background:var(--rofsv-card);border:1px solid var(--rofsv-border-l,var(--rofsv-line));border-radius:var(--rofsv-card-r);box-shadow:var(--rofsv-shadow,0 1px 2px rgba(16,24,40,.06),0 4px 14px rgba(16,24,40,.07));padding:16px;min-width:0}
.rofsv-app[data-rofsv-theme="dark"] .rofsv-card{border-color:var(--rofsv-line)}
.rofsv-panel-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.rofsv-panel-head h3{font-size:16px;font-weight:650;color:var(--rofsv-text)}
.rofsv-panel-icon{display:inline-flex;width:30px;height:30px;align-items:center;justify-content:center;border-radius:9px;background:var(--rofsv-soft);color:var(--rofsv-primary);flex:none}
.rofsv-app[data-rofsv-theme="dark"] .rofsv-panel-icon{color:var(--rofsv-accent)}
.rofsv-panel-icon svg{width:18px;height:18px}
.rofsv-muted{color:var(--rofsv-muted);font-size:13px}

/* stage */
.rofsv-stage{padding:0;overflow:hidden}
.rofsv-stage-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid var(--rofsv-line)}
.rofsv-stage-title{font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rofsv-stage-tools{display:inline-flex;gap:6px}
.rofsv-canvas-wrap{position:relative;background:var(--rofsv-stage);line-height:0}
.rofsv-canvas{display:block;width:100%;height:auto;max-width:100%}
.rofsv-busy{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(15,20,27,.45);color:#fff;font-size:14px;line-height:1.4}
.rofsv-previewbadge{position:absolute;top:10px;left:10px;padding:3px 10px;border-radius:99px;background:#f79009;color:#fff;font-size:12px;font-weight:600;line-height:1.5}
.rofsv-notes{padding:0 14px;display:flex;flex-direction:column;gap:6px}
.rofsv-notes:not(:empty){padding:10px 14px}
.rofsv-note{display:flex;gap:8px;align-items:flex-start;padding:8px 10px;border-radius:9px;font-size:13px;line-height:1.4;background:var(--rofsv-soft);color:var(--rofsv-text)}
.rofsv-note svg{width:16px;height:16px;margin-top:2px;flex:none}
.rofsv-note-warn{background:#fff4e0;color:#7a4b00}
.rofsv-app[data-rofsv-theme="dark"] .rofsv-note-warn{background:#3a2c10;color:#ffd48a}
.rofsv-note-error{background:#fdecea;color:var(--rofsv-danger)}
.rofsv-app[data-rofsv-theme="dark"] .rofsv-note-error{background:#3b1c1a}
.rofsv-actions{display:flex;flex-wrap:wrap;gap:8px;padding:12px 14px 4px}
.rofsv-msg{padding:0 14px 12px;font-size:13px;color:var(--rofsv-muted);min-height:0}
.rofsv-msg:empty{padding:0}
.rofsv-msg-error{color:var(--rofsv-danger)}
.rofsv-msg-ok,.rofsv-msg-success{color:var(--rofsv-ok)}
.rofsv-shareout{display:flex;gap:8px;padding:0 14px 12px}
.rofsv-shareout .rofsv-input{flex:1;min-width:0}

/* buttons */
.rofsv-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:var(--rofsv-radius,10px);padding:var(--rofsv-btn-pad,10px 16px);font-size:var(--rofsv-btn-fs,14px);font-weight:600;line-height:1.2;cursor:pointer;transition:background .15s,transform .05s,box-shadow .15s}
.rofsv-btn:active{transform:translateY(1px)}
.rofsv-btn:disabled{opacity:.55;cursor:not-allowed}
.rofsv-btn svg{width:18px;height:18px}
.rofsv-btn-primary{background:var(--rofsv-btn-p-bg,#0A5EB0);color:var(--rofsv-btn-p-fg,#fff)}
.rofsv-btn-primary:hover:not(:disabled){background:var(--rofsv-btn-p-hv,#084c8e)}
.rofsv-btn-secondary{background:var(--rofsv-btn-s-bg,#eef2f7);color:var(--rofsv-btn-s-fg,#1b2430);border-color:var(--rofsv-line)}
.rofsv-btn-secondary:hover:not(:disabled){background:var(--rofsv-btn-s-hv,#e1e8f0)}
.rofsv-app[data-rofsv-theme="dark"] .rofsv-btn-secondary{background:#243041;color:#e8edf3}
.rofsv-btn-enquiry{background:var(--rofsv-btn-e-bg,#00C6B7);color:var(--rofsv-btn-e-fg,#06302d)}
.rofsv-btn-enquiry:hover:not(:disabled){background:var(--rofsv-btn-e-hv,#00a99c)}
.rofsv-iconbtn{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:1px solid var(--rofsv-line);border-radius:9px;background:var(--rofsv-card);color:var(--rofsv-text);cursor:pointer;font-size:20px;line-height:1}
.rofsv-iconbtn:hover{background:var(--rofsv-soft)}
.rofsv-iconbtn.is-active{background:var(--rofsv-primary);border-color:var(--rofsv-primary);color:#fff}
.rofsv-iconbtn svg{width:18px;height:18px}

/* form controls */
.rofsv-select,.rofsv-input{width:100%;min-height:40px;padding:8px 12px;border:1px solid var(--rofsv-line);border-radius:10px;background:var(--rofsv-card);color:var(--rofsv-text);font:inherit;font-size:14px}
.rofsv-select{margin-bottom:10px}
textarea.rofsv-input{resize:vertical;min-height:70px}
.rofsv-hex{width:110px;flex:none;margin:0}
.rofsv-colorinput{width:42px;height:38px;padding:2px;border:1px solid var(--rofsv-line);border-radius:8px;background:var(--rofsv-card);cursor:pointer}
.rofsv-range{display:flex;align-items:center;gap:10px;margin-top:10px;font-size:13px;color:var(--rofsv-muted)}
.rofsv-range input{flex:1;accent-color:var(--rofsv-primary)}
.rofsv-hp{position:absolute!important;left:-9999px!important;width:1px;height:1px;opacity:0}

/* tabs / chips */
.rofsv-tabs{display:flex;flex-wrap:wrap;gap:4px;padding:4px;margin-bottom:12px;background:var(--rofsv-soft);border-radius:11px}
.rofsv-tab{flex:1 1 auto;border:0;background:transparent;color:var(--rofsv-muted);padding:7px 12px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap}
.rofsv-tab.is-active{background:var(--rofsv-card);color:var(--rofsv-primary);box-shadow:0 1px 3px rgba(16,24,40,.12)}
.rofsv-app[data-rofsv-theme="dark"] .rofsv-tab.is-active{color:var(--rofsv-accent)}
.rofsv-zonebar{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-bottom:10px}
.rofsv-zonelabel{font-size:12px;color:var(--rofsv-muted);font-weight:600}
.rofsv-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 11px;border:1px solid var(--rofsv-line);border-radius:99px;background:var(--rofsv-card);color:var(--rofsv-text);font-size:12.5px;font-weight:600;cursor:pointer}
.rofsv-chip.is-active{border-color:var(--rofsv-primary);background:var(--rofsv-primary);color:#fff}
.rofsv-chip-dot{width:12px;height:12px;border-radius:50%;border:1px solid rgba(0,0,0,.25);background:var(--rofsv-soft)}

/* item grids */
.rofsv-cards-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:10px}
.rofsv-room-grid{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}
.rofsv-item{position:relative;display:flex;flex-direction:column;gap:6px;padding:6px;border:2px solid var(--rofsv-line);border-radius:12px;background:var(--rofsv-card);color:var(--rofsv-text);cursor:pointer;text-align:center;transition:border-color .15s,transform .1s}
.rofsv-item:hover{border-color:var(--rofsv-primary);transform:translateY(-1px)}
.rofsv-item.is-selected{border-color:var(--rofsv-primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--rofsv-primary) 25%,transparent)}
.rofsv-item-img{display:flex;align-items:center;justify-content:center;aspect-ratio:4/3;border-radius:8px;overflow:hidden;background:var(--rofsv-soft)}
.rofsv-item-img.rofsv-wide{aspect-ratio:16/10}
.rofsv-item-img img{width:100%;height:100%;object-fit:cover}
.rofsv-item-name{font-size:12.5px;font-weight:600;line-height:1.25;overflow-wrap:anywhere}
.rofsv-check{position:absolute;top:8px;right:8px;display:none;width:20px;height:20px;align-items:center;justify-content:center;border-radius:50%;background:var(--rofsv-primary);color:#fff}
.rofsv-check svg{width:13px;height:13px}
.is-selected>.rofsv-check{display:inline-flex}

/* fabrics */
.rofsv-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px;align-items:start;margin-bottom:10px}
.rofsv-filters .rofsv-select{margin:0}
.rofsv-viewtoggle{display:flex;gap:6px;justify-content:flex-end}
.rofsv-swatches{max-height:340px;overflow:auto;padding:2px;margin:0 -2px}
.rofsv-view-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:10px}
.rofsv-view-list{display:flex;flex-direction:column;gap:8px}
.rofsv-swatch{position:relative;display:flex;flex-direction:column;gap:5px;padding:5px;border:2px solid var(--rofsv-line);border-radius:12px;background:var(--rofsv-card);color:var(--rofsv-text);cursor:pointer;text-align:left}
.rofsv-swatch:hover{border-color:var(--rofsv-primary)}
.rofsv-swatch.is-selected{border-color:var(--rofsv-primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--rofsv-primary) 25%,transparent)}
.rofsv-swatch-img{display:block;aspect-ratio:1;border-radius:8px;overflow:hidden;background:var(--rofsv-soft)}
.rofsv-swatch-img img{width:100%;height:100%;object-fit:cover}
.rofsv-swatch-info{display:flex;flex-direction:column;min-width:0}
.rofsv-swatch-name{font-size:12px;font-weight:600;line-height:1.25;overflow-wrap:anywhere}
.rofsv-swatch-meta{font-size:11px;color:var(--rofsv-muted)}
.rofsv-view-list .rofsv-swatch{flex-direction:row;align-items:center;gap:12px}
.rofsv-view-list .rofsv-swatch-img{width:54px;flex:none}
.rofsv-view-list .rofsv-check{top:50%;margin-top:-10px}

/* custom upload */
.rofsv-custom{margin-top:12px}
.rofsv-drop{display:flex;align-items:center;justify-content:center;gap:8px;padding:14px;border:2px dashed var(--rofsv-line);border-radius:12px;color:var(--rofsv-muted);font-size:13px;font-weight:600;cursor:pointer;text-align:center}
.rofsv-drop:hover,.rofsv-drop.is-drag{border-color:var(--rofsv-primary);color:var(--rofsv-primary);background:var(--rofsv-soft)}
.rofsv-drop svg{width:20px;height:20px}
.rofsv-file{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden}
.rofsv-custom-prev{display:flex;align-items:center;gap:10px;margin-top:8px;font-size:13px}
.rofsv-custom-prev img{width:44px;height:44px;border-radius:8px;object-fit:cover;border:1px solid var(--rofsv-line)}
.rofsv-details{margin-top:10px;font-size:13px}
.rofsv-details summary{cursor:pointer;font-weight:600;color:var(--rofsv-muted)}
.rofsv-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}
.rofsv-field{display:flex;flex-direction:column;gap:4px;font-size:12.5px;font-weight:600;color:var(--rofsv-muted)}
.rofsv-field-full{grid-column:1/-1}
.rofsv-err{color:var(--rofsv-danger);font-weight:500;font-size:12px;min-height:0}

/* walls */
.rofsv-walls{display:grid;grid-template-columns:repeat(auto-fill,minmax(34px,1fr));gap:8px}
.rofsv-wall{position:relative;aspect-ratio:1;border-radius:50%;border:2px solid var(--rofsv-card);box-shadow:0 0 0 1px var(--rofsv-line);cursor:pointer;padding:0}
.rofsv-wall:hover{box-shadow:0 0 0 2px var(--rofsv-primary)}
.rofsv-wall.is-selected{box-shadow:0 0 0 3px var(--rofsv-primary)}
.rofsv-wallcustom{display:flex;align-items:center;gap:8px;margin-top:12px;font-size:13px;font-weight:600;color:var(--rofsv-muted)}
.rofsv-wallnote{margin-top:8px}

/* summary */
.rofsv-summary:empty{display:none}
.rofsv-dl{display:grid;grid-template-columns:auto 1fr;gap:6px 16px;margin:0;font-size:13.5px}
.rofsv-dl dt{color:var(--rofsv-muted);font-weight:600}
.rofsv-dl dd{margin:0;display:flex;align-items:center;gap:6px;min-width:0;overflow-wrap:anywhere}
.rofsv-dot{display:inline-block;width:14px;height:14px;border-radius:50%;border:1px solid rgba(0,0,0,.25)}

/* enquiry modal */
.rofsv-modal{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(10,18,28,.62);overflow:auto}
.rofsv-dialog{width:100%;max-width:560px;max-height:calc(100vh - 32px);overflow:auto;background:var(--rofsv-card);color:var(--rofsv-text);border-radius:16px;padding:20px;box-shadow:0 24px 60px rgba(0,0,0,.35)}
.rofsv-dialog-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}
.rofsv-dialog-head h3{font-size:18px;font-weight:700}
.rofsv-form{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}
.rofsv-form .rofsv-msg,.rofsv-form .rofsv-modal-actions,.rofsv-consent{grid-column:1/-1}
.rofsv-form .rofsv-msg{padding:0}
.rofsv-consent{display:flex;gap:8px;align-items:flex-start;font-size:13px;color:var(--rofsv-muted)}
.rofsv-modal-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.rofsv-success{grid-column:1/-1;text-align:center;padding:10px 0}
.rofsv-success>span{display:inline-flex;width:44px;height:44px;border-radius:50%;background:var(--rofsv-ok);color:#fff;align-items:center;justify-content:center;margin-bottom:8px}
.rofsv-success svg{width:24px;height:24px}
.rofsv-ref{margin-top:6px;font-size:15px}
.rofsv-ref b{font-family:ui-monospace,Menlo,Consolas,monospace;letter-spacing:.02em}

/* fullscreen */
.rofsv-app:fullscreen{overflow:auto;max-width:none;border-radius:0}

/* responsive */
@media (max-width:980px){
  .rofsv-workspace{grid-template-columns:minmax(0,1fr)}
  .rofsv-stage-col{position:static}
}
@media (max-width:600px){
  .rofsv-mount{padding:12px}
  .rofsv-header{padding:20px 16px}
  .rofsv-header-inner{gap:12px}
  .rofsv-title{font-size:min(var(--rofsv-hdr-title,28px),24px)}
  .rofsv-actions .rofsv-btn{flex:1 1 calc(50% - 8px)}
  .rofsv-form,.rofsv-form-grid{grid-template-columns:1fr}
  .rofsv-cards-grid{grid-template-columns:repeat(auto-fill,minmax(92px,1fr))}
  .rofsv-footer{padding:12px 16px}
}
@media (prefers-reduced-motion:reduce){
  .rofsv-app *{transition:none!important}
}
@media print{
  .rofsv-panel-col,.rofsv-actions,.rofsv-stage-tools,.rofsv-modal{display:none!important}
}

/* user guide */
.rofsv-guide{margin-bottom:20px;padding:0}
.rofsv-guide-sum{display:flex;align-items:center;gap:10px;padding:14px 16px;font-weight:650;font-size:15px;cursor:pointer;list-style:none}
.rofsv-guide-sum::-webkit-details-marker{display:none}
.rofsv-guide-sum::after{content:"";margin-left:auto;width:8px;height:8px;border-right:2px solid var(--rofsv-muted);border-bottom:2px solid var(--rofsv-muted);transform:rotate(45deg);transition:transform .15s}
.rofsv-guide[open] .rofsv-guide-sum::after{transform:rotate(225deg)}
.rofsv-guide-steps{margin:0;padding:0 18px 16px 44px;color:var(--rofsv-text);display:grid;gap:6px}
.rofsv-guide-steps li::marker{color:var(--rofsv-primary);font-weight:700}
/* tint overlay on swatches, tight action rows */
.rofsv-swatch-img{position:relative}
.rofsv-tint{position:absolute;inset:0;mix-blend-mode:color;pointer-events:none}
.rofsv-actions-tight{padding:10px 0 0}
