/* Velduro Texture Studio — Luxury Industrial Bicycle Fitting Bench */
:root {
  --ink:#171a18;
  --ink-2:#2c322e;
  --dim:#636b65;
  --border:#dcdad2;
  --border-subtle:#eae8e1;
  --paper:#efeee9;
  --panel:#ffffff;
  --canvas:#f7f7f3;
  --grid:rgba(28, 34, 30, 0.055);
  --header:#151817;
  --gold:#c8a768;
  --gold-bright:#dbc088;
  --accent:#9c7a3c;
  --accent-soft:#f6f0e2;
  --light:#f8f7f3;
  --ghost:#c4c7be;
  --stripe:#628479;
  --warm:#cfa364;
  --focus:#246585;
  --radius:8px;
  --shadow-card:0 1px 2px rgba(18, 22, 20, .05), 0 12px 28px rgba(18, 22, 20, .055);
  --body:"Inter",-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",sans-serif;
  --display:"SF Pro Display","Helvetica Neue","Inter",sans-serif;
  --mono:"SF Mono","IBM Plex Mono",ui-monospace,Menlo,monospace;
}

*{box-sizing:border-box}
html,body{overflow-x:clip}
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font:14px/1.45 var(--body);
  -webkit-font-smoothing:antialiased;
}
button,input,select{font:inherit}
button,select,input[type=color]{cursor:pointer}
button,select{
  color:var(--ink);
  border:1px solid var(--border);
  background:var(--panel);
  border-radius:6px;
  transition:border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
button{padding:.44rem .78rem;font-weight:580;letter-spacing:.01em}
button:hover,select:hover{border-color:var(--accent);background:#fcfbf7}
button:active{transform:translateY(.5px)}
input:disabled,button:disabled{cursor:not-allowed;color:#9aa19c;background:#f3f2ed;border-color:var(--border-subtle);opacity:.72}
h1,h2{text-wrap:balance}
button[aria-pressed=true]{
  border-color:var(--accent);
  background:var(--accent-soft);
  color:var(--ink);
  box-shadow:inset 0 0 0 1px rgba(156, 122, 60, .25);
}
:focus-visible{outline:2px solid var(--focus);outline-offset:2px}

/* Top Bar */
.mast{
  background:var(--header);
  color:var(--light);
  border-bottom:1px solid rgba(200, 167, 104, .28);
  box-shadow:0 4px 18px rgba(0, 0, 0, .12);
}
.mast-inner,main{max-width:1520px;margin:auto;padding-inline:clamp(16px,2.8vw,44px)}
.mast-inner,.brand,nav,.figure-head,.row,.range-caption,.models,.motion{display:flex;align-items:center}
.mast-inner{min-height:60px;justify-content:space-between;gap:14px}
.brand{gap:16px;font-size:15px;font-weight:600;letter-spacing:.04em}
.brand img{width:88px;height:38px;object-fit:contain;object-position:left center}
.brand span{border-left:1px solid rgba(248, 247, 243, .22);padding-left:16px;color:rgba(248, 247, 243, .9)}
nav{gap:8px}
nav button{
  background:rgba(255,255,255,.05);
  color:var(--light);
  border-color:rgba(255,255,255,.18);
  font-size:12.5px;
  padding:.42rem .88rem;
  border-radius:6px;
}
nav button:hover{background:rgba(255,255,255,.12);border-color:rgba(200,167,104,.65)}
nav .primary{
  color:#151817;
  background:linear-gradient(180deg, var(--gold-bright), var(--gold));
  border-color:var(--gold);
  font-weight:650;
  box-shadow:0 1px 4px rgba(0,0,0,.22);
}
nav .primary:hover{filter:brightness(1.06);background:linear-gradient(180deg, var(--gold-bright), var(--gold))}

/* Main Grid */
main{padding-block:clamp(14px,1.8vw,24px)}
.layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 396px;
  gap:clamp(16px,2vw,28px);
  align-items:start;
}
.preview{min-width:0}

/* Compact Model Header */
.figure-head{justify-content:space-between;gap:14px;margin-bottom:12px}
.figure-head > div:first-child{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
h1,h2,p{margin:0}
h1{
  font:700 clamp(28px,2.8vw,40px)/1 var(--display);
  letter-spacing:-.035em;
  color:var(--ink);
}
.figure-head button,.motion button{font-size:12.5px}
.models{
  gap:6px;
  margin:0;
  padding:3px;
  background:#e6e4dd;
  border-radius:9px;
  border:1px solid var(--border);
}
.models button{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:36px;
  padding:3px 13px 3px 6px;
  border:1px solid transparent;
  background:transparent;
  border-radius:6px;
  color:var(--dim);
  font-weight:600;
}
.models button:hover{color:var(--ink);background:rgba(255,255,255,.55);border-color:transparent}
.models button[aria-pressed=true]{
  background:var(--panel);
  color:var(--ink);
  border-color:rgba(156,122,60,.35);
  box-shadow:0 1px 3px rgba(0,0,0,.08);
}
.models img{width:54px;height:32px;object-fit:contain}
.frame-colors{
  display:flex;
  align-items:center;
  gap:4px;
  padding:3px;
  background:#e6e4dd;
  border-radius:9px;
  border:1px solid var(--border);
}
.frame-colors button{
  display:flex;
  align-items:center;
  gap:6px;
  min-height:36px;
  padding:4px 10px;
  border:1px solid transparent;
  background:transparent;
  border-radius:6px;
  color:var(--dim);
  font-size:12px;
  font-weight:600;
  white-space:nowrap;
}
.frame-colors button:hover{color:var(--ink);background:rgba(255,255,255,.55);border-color:transparent}
.frame-colors button[aria-pressed=true]{
  background:var(--panel);
  color:var(--ink);
  border-color:rgba(156,122,60,.4);
  box-shadow:0 1px 3px rgba(0,0,0,.08);
}
.frame-colors .swatch{
  width:13px;
  height:13px;
  border-radius:50%;
  border:1.5px solid rgba(255,255,255,.85);
  box-shadow:0 0 0 1px rgba(0,0,0,.22);
  flex:none;
}
#original{
  font-size:12.5px;
  padding:.42rem .85rem;
  border-radius:7px;
  background:var(--panel);
}

/* Studio Stage */
#frontMountStatus{
  margin:0;
  padding:8px 16px;
  background:var(--accent-soft);
  color:var(--ink-2);
  font-size:13px;
}
.stage{
  position:relative;
  background-color:var(--canvas);
  background-image:
    radial-gradient(ellipse 84% 72% at 50% 48%, rgba(255,255,255,.88) 0%, rgba(247,247,243,.35) 62%, rgba(226,224,216,.38) 100%),
    linear-gradient(var(--grid) 1px,transparent 1px),
    linear-gradient(90deg,var(--grid) 1px,transparent 1px);
  background-size:100% 100%, 32px 32px, 32px 32px;
  isolation:isolate;
  border:1px solid var(--border);
  border-radius:var(--radius) var(--radius) 0 0;
  overflow:hidden;
  box-shadow:0 2px 14px rgba(18, 22, 20, .04);
}
canvas{width:100%;height:auto;display:block}
.tick{width:10px;height:10px;position:absolute;border:solid rgba(156, 122, 60, .65);pointer-events:none}
.tl{top:10px;left:10px;border-width:1.5px 0 0 1.5px}.tr{top:10px;right:10px;border-width:1.5px 1.5px 0 0}
.bl{bottom:10px;left:10px;border-width:0 0 1.5px 1.5px}.br{bottom:10px;right:10px;border-width:0 1.5px 1.5px 0}

/* Motion Scrubber */
.motion{
  gap:16px;
  border:1px solid var(--border);
  border-top:0;
  padding:11px 16px;
  background:var(--panel);
}
.motion button{
  min-width:86px;
  border-radius:6px;
  background:#f8f7f2;
}
.travel-control{flex:1;min-width:0}
.range-caption,.row{justify-content:space-between}
.range-caption{font-size:12px;color:var(--dim);font-weight:550;margin-bottom:2px}
input[type=range]{
  display:block;
  width:100%;
  margin:2px 0;
  height:18px;
  accent-color:var(--accent);
  cursor:pointer;
}
output{font:550 12px var(--mono);color:var(--ink-2);font-variant-numeric:tabular-nums}

/* Right Studio Inspector */
.inspector{
  background:var(--panel);
  border:1px solid var(--border);
  border-top:3px solid var(--gold);
  border-radius:var(--radius);
  box-shadow:var(--shadow-card);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
h2{
  font-size:15px;
  font-weight:680;
  letter-spacing:.02em;
  padding:11px 16px;
  border-bottom:1px solid var(--border-subtle);
  background:linear-gradient(180deg, #fdfcf9, #f9f8f4);
}
.control-section,details{padding:11px 16px}
.heading,legend,summary{font-size:12.5px;font-weight:650;color:var(--ink-2);letter-spacing:.015em}
.heading{display:block;margin-bottom:6px}
select{
  appearance:none;
  -webkit-appearance:none;
  padding:6px 28px 6px 10px;
  width:100%;
  font-size:13px;
  font-weight:520;
  background-color:#faf9f6;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.2L6 7.8L9.5 4.2' fill='none' stroke='%23636b65' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 9px center;
  border-radius:6px;
}
fieldset{border:0;padding:0;margin:10px 0 8px;min-width:0}
legend{padding:0;margin-bottom:6px}
.surface-actions{display:grid;grid-template-columns:1fr auto;gap:6px;margin-top:8px}
#upload{width:100%;font-size:12.5px;border-style:dashed;background:#faf9f5;padding:.4rem .7rem}
#clearSurface{font-size:12.5px;padding:.4rem .7rem;white-space:nowrap}
.row{font-size:12.5px;margin-top:8px;color:var(--dim)}
input[type=color]{width:38px;height:26px;border:1px solid var(--border);border-radius:5px;background:var(--panel);padding:2px}
details{border-top:1px solid var(--border-subtle)}
summary{
  cursor:pointer;
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
summary::-webkit-details-marker{display:none}
summary::after{
  content:"";
  width:7px;height:7px;
  border-right:1.5px solid var(--dim);
  border-bottom:1.5px solid var(--dim);
  transform:rotate(45deg);
  transition:transform .16s ease;
  margin-right:2px;
}
details[open] summary::after{transform:rotate(225deg)}
.adjustments,.part-grid{display:grid;align-items:center;gap:5px 10px;margin-top:10px;font-size:12.5px}
.adjustments{grid-template-columns:4.2em minmax(0,1fr) 3.8em}
.adjustments output{text-align:right}
.part-grid{grid-template-columns:auto minmax(0,1fr)}
.part-grid input{justify-self:end}
#status{font-size:12px;color:var(--dim);min-height:1.4em;margin-top:10px}

@media(min-width:1000px){.preview{position:sticky;top:16px}}
@media(max-width:1040px){.layout{grid-template-columns:minmax(0,1fr)}}
@media(max-width:780px){
  .mast-inner{flex-wrap:wrap;padding-block:8px;gap:8px}
  .brand{gap:10px}.brand img{width:74px;height:32px}.brand span{font-size:14px;padding-left:10px}
  .motion{padding:9px 12px}
  .inspector{margin-top:4px}
  .figure-head{flex-wrap:wrap;gap:8px;margin-bottom:10px}
  .figure-head .models{order:1;width:100%}
  .figure-head .models button{flex:1;justify-content:center;min-height:36px}
  .mast-inner nav{flex-wrap:wrap;gap:5px}
  nav button{padding:6px 9px}
}
@media(max-width:450px){
  .mast-inner{display:grid;grid-template-columns:minmax(0,1fr)}
  .mast-inner nav button{flex:1}
  main{padding-inline:12px}
  .brand img{width:62px;height:28px}
  .figure-head button{font-size:12px}
  .models img{width:44px}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto;transition:none!important}}
