/* OmniSolver Models · studio.css — generation + editor workspace */
.studio { display: grid; grid-template-columns: 1fr 380px; gap: var(--s-4);
  max-width: var(--maxw-wide); margin: 0 auto; padding: var(--s-4) var(--s-5) var(--s-9);
  align-items: start; }
.viewport-wrap { display: flex; flex-direction: column; gap: var(--s-3); }

.viewport { position: relative; border-radius: var(--r-xl); overflow: hidden;
  background: var(--grad-hero); border: 1px solid var(--glass-border);
  box-shadow: var(--sh-3), var(--glow-soft), var(--sh-inset); height: min(64vh, 620px); }
.viewport::after { content:""; position:absolute; inset:0; pointer-events:none; border-radius: inherit;
  box-shadow: inset 0 0 120px rgba(0,0,0,.45); }
.viewport #gl { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.viewport #gl:active { cursor: grabbing; }
.vp-empty, .vp-fallback { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; color: rgba(246,250,249,.6);
  text-align: center; padding: 24px; }
.vp-empty .icon { width: 46px; height: 46px; stroke-width: 1.2; opacity: .5; }
.vp-fallback img { max-width: 70%; max-height: 70%; border-radius: var(--r-md); }

.vp-overlay-metrics { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px;
  flex-wrap: wrap; max-width: 70%; }
.vp-overlay-metrics .m { background: rgba(10,16,18,.62); backdrop-filter: blur(8px);
  color: var(--text-2); padding: 4px 9px; border-radius: var(--r-pill); font-size: var(--fs-xs);
  font-family: var(--font-mono); border: 1px solid rgba(255,255,255,.1); }
.vp-overlay-metrics .m b { color: var(--teal-hi); }

.vp-toolbar { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 6px;
  background: rgba(13,16,20,.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--glass-border);
  border-radius: var(--r-pill); box-shadow: var(--sh-2); max-width: calc(100% - 24px); }
.seg { display: flex; background: var(--surface-3); border-radius: var(--r-pill); padding: 2px; min-width: 0; }
.seg button { border: none; background: transparent; font: inherit; font-size: var(--fs-xs); font-weight: 600;
  padding: 5px 10px; border-radius: var(--r-pill); cursor: pointer; color: var(--text-muted); white-space: nowrap; }
.vp-toolbar .seg { flex: none; }
.seg button.active { background: var(--surface-1); color: var(--teal-hi); box-shadow: var(--sh-1); }
.light-sel { width: auto; padding: 5px 8px; font-size: var(--fs-xs); }

.vp-bottom { padding: var(--s-4); }
.vp-bottom .stage-rail { max-height: 0; overflow: hidden; transition: max-height var(--t-mid); }
.vp-bottom.expanded .stage-rail { max-height: 220px; }

/* inspector */
.inspector { position: relative; background: var(--glass-bg); -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border); border-radius: var(--r-lg);
  box-shadow: var(--sh-2); padding: var(--s-5); position: sticky; top: calc(var(--nav-h) + 16px); }
.insp-tabs { display: flex; gap: 4px; background: var(--surface-3); border-radius: var(--r-sm);
  padding: 3px; margin-bottom: var(--s-5); }
.insp-tabs button { flex: 1; border: none; background: transparent; font: inherit; font-size: var(--fs-sm);
  font-weight: 600; padding: 8px; border-radius: var(--r-xs); cursor: pointer; color: var(--text-muted); }
.insp-tabs button.active { background: var(--surface-1); color: var(--text); box-shadow: var(--sh-1); }

.presets { margin-top: var(--s-4); } .presets .lbl { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips .chip { cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface-1);
  transition: all var(--t-fast); }
.chips .chip:hover { border-color: var(--line-teal); }
.chips .chip.active { background: rgba(17,158,144,.12); color: var(--teal-lo); border-color: var(--line-teal); }

.upload-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; justify-content: center; }

.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.metrics-block { margin-top: var(--s-6); }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.metric-grid .metric-chip { width: 100%; }

.beforeafter { margin-top: var(--s-5); padding: var(--s-4); background: var(--surface-2);
  border-radius: var(--r-md); border: 1px solid var(--line); }
.beforeafter .ba-row { display: flex; justify-content: space-between; font-size: var(--fs-sm);
  padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.beforeafter .ba-row b { font-family: var(--font-mono); }
.beforeafter .ba-row .down { color: var(--ok); }

@media (max-width: 980px) {
  .studio { grid-template-columns: 1fr; }
  .inspector { position: static; }
  .viewport { height: 52vh; }
}
@media (max-width: 560px) {
  .studio { padding: var(--s-4) var(--s-4) var(--s-9); }
  .viewport { height: min(52vh, 460px); border-radius: var(--r-lg); }
  .vp-toolbar {
    left: var(--s-3); right: var(--s-3); bottom: var(--s-3); transform: none;
    display: flex; flex-wrap: wrap; justify-content: center; border-radius: var(--r-lg);
  }
  .vp-toolbar .seg { flex: 1 0 100%; justify-content: center; overflow-x: auto; scrollbar-width: none; }
  .vp-toolbar .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: 1; min-width: max-content; padding: 5px 9px; }
  .vp-toolbar .btn-icon { background: var(--surface-3); color: var(--text-2); border-color: var(--line); }
  .light-sel { max-width: 72px; padding: 5px 22px 5px 8px; }
}

/* panel headers — make each tab feel purposeful, not flimsy */
.panel-intro { margin-bottom: var(--s-5); padding-bottom: var(--s-4); border-bottom: 1px solid var(--line-soft); }
.panel-intro h2 { font-size: var(--fs-md); margin: 0 0 4px; }
.panel-intro p { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.5; }
.insp-panel .lbl { margin-top: 4px; }
.opt-profiles .chip { cursor: pointer; }
/* advanced optimize settings, tucked away so the panel reads simple */
.opt-advanced { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 12px; background: var(--glass-bg); }
.opt-advanced summary { cursor: pointer; padding: 11px 0; font-size: var(--fs-sm); color: var(--text-2);
  font-weight: 600; list-style: none; user-select: none; }
.opt-advanced summary::-webkit-details-marker { display: none; }
.opt-advanced summary::before { content: "+"; color: var(--teal); font-family: var(--font-mono); margin-right: 7px; }
.opt-advanced[open] summary::before { content: "\2212"; }
.opt-advanced[open] { padding-bottom: 14px; }

/* editor panel */
.ed-sec { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 10px; padding: 0 12px; background: var(--glass-bg); }
.ed-sec summary { cursor: pointer; padding: 12px 0; font-weight: 600; font-size: var(--fs-sm); list-style: none; user-select: none; color: var(--text); }
.ed-sec summary::-webkit-details-marker { display: none; }
.ed-sec summary::after { content: "+"; float: right; color: var(--teal); font-family: var(--font-mono); }
.ed-sec[open] summary::after { content: "\2212"; }
.ed-sec[open] { padding-bottom: 14px; }
.ed-parts { display: flex; flex-direction: column; gap: 6px; }
.ed-part { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; color: var(--text); font: inherit; font-size: var(--fs-sm); text-align: left; width: 100%; }
.ed-part:hover { border-color: var(--line-teal); }
.ed-part.active { border-color: var(--teal); background: rgba(34,199,182,.1); }
.ed-part .sw { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line-strong); flex: none; }
.ed-part .nm { flex: 1; text-transform: capitalize; }
.ed-part .tn { font-family: var(--font-mono); color: var(--text-muted); font-size: var(--fs-xs); }
.ed-mat { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.mat-color { width: 46px; height: 28px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-xs); background: none; cursor: pointer; }
.lod-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.lod-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 11px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); color: var(--text); }
.lod-row:hover { border-color: var(--line-teal); color: var(--text); }
.read-list { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.read-row { display: flex; align-items: flex-start; gap: 9px; }
.read-row .rd-ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 12px; margin-top: 1px; }
.read-row.ok .rd-ic { background: var(--ok-soft); color: var(--ok); }
.read-row.warn .rd-ic { background: var(--warn-soft); color: var(--warn); }
.read-row.fail .rd-ic { background: var(--danger-soft); color: var(--danger); }
.read-row .rd-body { display: flex; flex-direction: column; gap: 1px; }
