.pa-model-editor{position:absolute;left:50%;bottom:1rem;z-index:8;width:min(44rem,calc(100% - 2rem));transform:translateX(-50%);display:grid;gap:.55rem;padding:.75rem;border:1px solid rgba(148,163,184,.42);border-radius:8px;background:rgba(8,18,32,.92);color:#f8fafc;box-shadow:0 1rem 2.5rem rgba(2,6,23,.35);backdrop-filter:blur(12px)}
.pa-model-editor-head,.pa-model-editor-modes,.pa-model-editor-actions{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap}.pa-model-editor-head{justify-content:space-between}.pa-model-editor-head strong{font-size:.9rem}.pa-model-editor button{min-height:2.25rem;border:1px solid #64748b;border-radius:8px;background:#172033;color:#f8fafc;padding:.35rem .7rem}.pa-model-editor button:hover,.pa-model-editor button:focus-visible,.pa-model-editor button.is-active{border-color:#38bdf8;background:#0c4a6e}.pa-model-editor button:focus-visible,.pa-model-editor input:focus-visible{outline:3px solid #7dd3fc;outline-offset:2px}
.pa-model-editor.is-selected{border-color:#38bdf8}.pa-model-editor-values{display:grid;grid-template-columns:repeat(7,minmax(4.5rem,1fr));gap:.4rem}.pa-model-editor-values label{display:grid;gap:.2rem;font-size:.7rem;color:#cbd5e1}.pa-model-editor-values input{width:100%;min-height:2rem;border:1px solid #64748b;border-radius:8px;background:#f8fafc;color:#0f172a;padding:.25rem .4rem}.pa-model-editor-status{margin:0;font-size:.75rem;color:#cbd5e1}.pa-model-editor-status[data-error="true"]{color:#fecaca}.pa-studio-mesh.is-model-selected [data-pa-mesh-canvas]{cursor:grab;outline:2px solid rgba(56,189,248,.75);outline-offset:-2px}.pa-studio-mesh.is-model-selected [data-pa-mesh-canvas].is-model-editing{cursor:grabbing;touch-action:none}.pa-studio-workspace-shell:not([data-workspace-mode="fix"]) .pa-model-editor{display:none}.pa-studio-workspace-shell[data-workspace-mode="fix"] .pa-model-editor.is-collapsed{left:1rem;bottom:5.25rem;width:min(23rem,calc(100% - 2rem));transform:none}
.pa-model-editor-body{display:grid;gap:.55rem}.pa-model-editor-body[hidden]{display:none}.pa-model-editor-selection{display:flex;justify-content:flex-end}.pa-model-editor.is-collapsed{width:min(23rem,calc(100% - 2rem))}.pa-model-editor-toggle{white-space:nowrap}.pa-model-editor-toggle i{transition:transform .18s ease}.pa-model-editor-toggle[aria-expanded="false"] i{transform:rotate(-90deg)}.pa-model-editor button:disabled,.pa-model-editor button:disabled:hover,.pa-model-editor button:disabled:focus-visible{border-color:#475569;background:#111827;color:#94a3b8;opacity:.72;cursor:not-allowed;box-shadow:none}
@media(max-width:760px){.pa-model-editor{position:relative;left:auto;bottom:auto;width:calc(100% - 1rem);transform:none;margin:.5rem}.pa-studio-workspace-shell[data-workspace-mode="fix"] .pa-model-editor.is-collapsed{left:auto;bottom:auto;width:calc(100% - 1rem)}.pa-model-editor-values{grid-template-columns:repeat(3,minmax(4.5rem,1fr))}.pa-model-editor-values label:last-child{grid-column:auto}.pa-model-editor-head{align-items:flex-start}}
@media(max-width:430px){.pa-model-editor-values{grid-template-columns:repeat(2,minmax(4.5rem,1fr))}.pa-model-editor-modes button{flex:1}}
@media(prefers-reduced-motion:reduce){.pa-model-editor,.pa-model-editor *{scroll-behavior:auto;transition:none!important}}

/* Final Dark paint contract for the deferred model editor. The base rules
   above remain the Light presentation; Dark uses only canonical flat roles. */
html[data-pa-theme="dark"] .pa-model-editor {
    border-color: #29434C;
    background: #152935;
    background-image: none;
    color: #F1F8F9;
    box-shadow: none;
    backdrop-filter: none;
    filter: none;
}

html[data-pa-theme="dark"] .pa-model-editor button {
    border-color: #29434C;
    background: #203E4D;
    background-image: none;
    color: #F1F8F9;
    box-shadow: none;
}

html[data-pa-theme="dark"] .pa-model-editor button:is(:hover, :focus-visible, .is-active) {
    border-color: #3FD0D5;
    background: #28B8C4;
    background-image: none;
    color: #081620;
    box-shadow: none;
}

html[data-pa-theme="dark"] .pa-model-editor button:focus-visible,
html[data-pa-theme="dark"] .pa-model-editor input:focus-visible {
    outline-color: #70E1DC;
    box-shadow: none;
}

html[data-pa-theme="dark"] .pa-model-editor.is-selected {
    border-color: #3FD0D5;
}

html[data-pa-theme="dark"] .pa-model-editor-values label,
html[data-pa-theme="dark"] .pa-model-editor-status {
    color: #C7D4D9;
}

html[data-pa-theme="dark"] .pa-model-editor-values input {
    border-color: #29434C;
    background: #0F1E27;
    background-image: none;
    color: #F1F8F9;
    box-shadow: none;
}

html[data-pa-theme="dark"] .pa-model-editor-status[data-error="true"] {
    color: #70E1DC;
}

html[data-pa-theme="dark"] .pa-studio-mesh.is-model-selected [data-pa-mesh-canvas] {
    outline-color: #70E1DC;
    box-shadow: none;
}

html[data-pa-theme="dark"] .pa-model-editor button:disabled,
html[data-pa-theme="dark"] .pa-model-editor button:disabled:hover,
html[data-pa-theme="dark"] .pa-model-editor button:disabled:focus-visible {
    border-color: #29434C;
    background: #0F1E27;
    background-image: none;
    color: #8298A2;
    opacity: 1;
    box-shadow: none;
}

/* The workspace shell owns placement. In Model Tools this editor is an
   inspector-native form, never another floating layer over the model. */
.pa-workspace-inspector-body .pa-model-editor[data-workspace-placement="model-tools-inspector"] {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 .65rem !important;
    border-color: #c8d7e1 !important;
    background: #f7fafc !important;
    color: #142d40 !important;
    box-shadow: none !important;
    transform: none !important;
    backdrop-filter: none !important;
}

.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"]
  :is(strong, label, .pa-model-editor-status) {
    color: #24445b !important;
}

.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"] button {
    border-color: #b8cad7 !important;
    background: #ffffff !important;
    color: #173047 !important;
}

.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"] button:is(:hover, :focus-visible, .is-active) {
    border-color: #168b94 !important;
    background: #dff4f4 !important;
    color: #07545d !important;
}

.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"] input {
    border-color: #b8cad7 !important;
    background: #ffffff !important;
    color: #142d40 !important;
}

/* The model editor is moved into a narrow inspector after startup, so viewport
   media queries cannot describe the space it actually receives. Give that
   placement its own bounded layout: the disclosure stays beside its title,
   tool modes share one row, exact values use two readable columns, and the
   longer commit actions get full-width rows instead of escaping the card. */
.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"] {
    min-width: 0 !important;
    overflow: hidden;
    box-sizing: border-box;
}

.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"]
  .pa-model-editor-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .5rem;
  }

.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"]
  .pa-model-editor-head > strong {
    min-width: 0;
    font-size: .82rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"]
  .pa-model-editor-toggle {
    min-width: 0;
    padding-inline: .5rem;
    font-size: .75rem;
    white-space: nowrap;
  }

.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"]
  :is(.pa-model-editor-body, .pa-model-editor-values, .pa-model-editor-values > label) {
    min-width: 0;
    max-width: 100%;
  }

.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"]
  .pa-model-editor-modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .4rem;
  }

.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"]
  .pa-model-editor-modes > button {
    min-width: 0;
    width: 100%;
    padding-inline: .3rem;
    font-size: .75rem;
    white-space: nowrap;
  }

.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"]
  .pa-model-editor-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"]
  .pa-model-editor-values > label:last-child {
    grid-column: 1 / -1;
  }

.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"]
  .pa-model-editor-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .4rem;
  }

.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"]
  :is(.pa-model-editor-selection > button, .pa-model-editor-actions > button) {
    min-width: 0;
    width: 100%;
    white-space: normal;
  }

.pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"]
  .pa-model-editor-status {
    overflow-wrap: anywhere;
  }

html[data-pa-theme="dark"] .pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"] {
    border-color: #29434C !important;
    background: #152935 !important;
    color: #F1F8F9 !important;
}

html[data-pa-theme="dark"] .pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"]
  :is(strong, label, .pa-model-editor-status) {
    color: #C7D4D9 !important;
}

html[data-pa-theme="dark"] .pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"] button {
    border-color: #29434C !important;
    background: #203E4D !important;
    color: #F1F8F9 !important;
}

html[data-pa-theme="dark"] .pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"] button:is(:hover, :focus-visible, .is-active) {
    border-color: #3FD0D5 !important;
    background: #28B8C4 !important;
    color: #081620 !important;
}

html[data-pa-theme="dark"] .pa-workspace-inspector-body
  .pa-model-editor[data-workspace-placement="model-tools-inspector"] input {
    border-color: #29434C !important;
    background: #0F1E27 !important;
    color: #F1F8F9 !important;
}
