  @import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&display=swap');

  :root {
    --bg: #d9dee6;
    --surface: #e7ebf1;
    --surface2: #f1f4f8;
    --surface3: #fbfcfe;
    --border: #b8c0cc;
    --accent: #4f61d6;
    --accent2: #cc5d82;
    --accent3: #2f9b74;
    --text: #1b2230;
    --text-muted: #5a6778;
    --text-dim: #7b8697;
    --panel-w: 280px;
    --header-h: 52px;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: 'Google Sans', 'Google Sans Text', 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(180deg, #eef2f7 0%, var(--bg) 100%);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-size: 12px;
  }

  /* HEADER */
  header {
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    flex-shrink: 0;
    z-index: 10;
  }
  .logo {
    font-family: 'Google Sans', 'Google Sans Text', 'Segoe UI', Arial, sans-serif;
    font-weight: 800;
    font-size: 23px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #43e8a0 0%, #6c63ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
  }
  .logo-sub {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    opacity: 0.55;
    margin-left: 7px;
    -webkit-text-fill-color: var(--text-muted);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
  }
  header .sep { flex: 1; }
  .header-btn {
    background: var(--surface3);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'Google Sans', 'Google Sans Text', 'Segoe UI', Arial, sans-serif;
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .header-btn:hover { background: var(--surface2); border-color: var(--accent); color: var(--accent); }
  .header-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
  .header-btn.primary:hover { background: #6070db; }
  .header-btn.success { background: var(--accent3); border-color: var(--accent3); color: #0a0a0f; }
  .header-btn:disabled,
  .prim-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: var(--border);
    color: var(--text-dim);
    box-shadow: none;
  }

  /* HEADER DROPDOWN */
  .hdr-dropdown-wrap { position: relative; }
  .hdr-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 148px;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(30,40,72,0.18);
    z-index: 50;
    padding: 4px 0;
    overflow: hidden;
  }
  .hdr-dropdown-menu.open { display: block; }
  .hdr-dd-item {
    padding: 7px 14px;
    font-size: 11px;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
    white-space: nowrap;
  }
  .hdr-dd-item:hover { background: rgba(79, 97, 214, 0.09); color: var(--accent); }
  .hdr-dd-sep { height: 1px; background: var(--border); margin: 4px 0; }

  /* VIEWPORT UPLOAD SPINNER */
  .viewport-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    background: rgba(215, 222, 232, 0.75);
    backdrop-filter: blur(3px);
    z-index: 20;
  }
  .viewport-spinner.hidden { display: none; }
  .vs-ring {
    width: 40px; height: 40px;
    border: 3px solid rgba(79,97,214,0.18);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
  }
  .vs-msg { font-size: 11px; color: var(--text-muted); }

  @keyframes spin { to { transform: rotate(360deg); } }

  /* MAIN LAYOUT */
  .main {
    display: flex;
    flex: 1;
    overflow: hidden;
  }

  /* LEFT PANEL */
  .panel-left {
    width: var(--panel-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
  }

  /* RIGHT PANEL */
  .panel-right {
    width: var(--panel-w);
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
  }

  /* VIEWPORT */
  .viewport {
    flex: 1;
    position: relative;
    background: linear-gradient(180deg, #edf1f6 0%, #d6dce5 100%);
    overflow: hidden;
  }
  #three-canvas {
    width: 100%;
    height: 100%;
    display: block;
  }
  .scene-step-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.0); /* transparent so animation/logo always visible */
    z-index: 2;
    pointer-events: all;
    transition: opacity 0.25s ease;
  }
  .scene-step-overlay.hidden {
    opacity: 0;
    visibility: hidden;
  }
  .scene-step-card {
    max-width: 360px;
    border: 1px solid rgba(79, 97, 214, 0.18);
    background: rgba(251, 253, 255, 0.82); /* more transparent so animation/logo show through */
    border-radius: 12px;
    box-shadow: 0 16px 30px rgba(49, 65, 92, 0.10);
    padding: 16px 18px;
    text-align: center;
    pointer-events: all;
  }
  .scene-step-kicker {
    font-size: 10px;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
  }
  .scene-step-title {
    font-family: 'Google Sans', 'Google Sans Text', 'Segoe UI', Arial, sans-serif;
    font-size: 18px;
    letter-spacing: 0.2px;
    margin-bottom: 8px;
    color: var(--text);
  }
  .scene-step-text {
    font-size: 11px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 10px;
  }

  /* PANEL SECTIONS */
  .panel-section {
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .panel-title {
    font-family: 'Google Sans', 'Google Sans Text', 'Segoe UI', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 14px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
  }
  .panel-title .add-btn {
    width: 18px; height: 18px;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.15s;
    line-height: 1;
    padding-bottom: 1px;
  }
  .panel-title .add-btn:hover { border-color: var(--accent); color: var(--accent); }
  .panel-title .add-btn.is-locked { opacity: 0.45; }

  .panel-body {
    padding: 8px;
  }

  /* SCENE TREE */
  .scene-tree { overflow-y: auto; max-height: 220px; }
  .tree-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.1s;
    user-select: none;
  }
  .tree-item:hover { background: var(--surface3); }
  .tree-item.selected { background: rgba(108,99,255,0.15); border: 1px solid rgba(108,99,255,0.3); }
  .tree-item.target-item {
    border: 1px dashed var(--border);
    margin-bottom: 6px;
    background: rgba(255,255,255,0.55);
  }
  .tree-item.target-item.ready {
    border-style: solid;
    border-color: rgba(47, 155, 116, 0.55);
    background: rgba(47,155,116,0.08);
  }
  .tree-item.target-item .tree-label {
    font-weight: 600;
  }
  .tree-icon { font-size: 13px; width: 18px; text-align: center; }
  .tree-label { flex: 1; font-size: 11px; color: var(--text); }
  .tree-vis {
    width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim);
    font-size: 10px;
    cursor: pointer;
    border-radius: 3px;
    transition: color 0.1s;
  }
  .tree-vis:hover { color: var(--text); }
  .tree-delete {
    width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim);
    font-size: 10px;
    cursor: pointer;
    border-radius: 3px;
    transition: color 0.1s;
    opacity: 0;
  }
  .tree-item:hover .tree-delete { opacity: 1; }
  .tree-delete:hover { color: var(--accent2) !important; opacity: 1 !important; }

  /* ASSET IMPORTS */
  .import-zone {
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    margin: 4px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
  }
  .import-zone:hover { border-color: var(--accent); color: var(--accent); background: rgba(108,99,255,0.05); }
  .import-zone.dragover { border-color: var(--accent); color: var(--accent); background: rgba(108,99,255,0.1); }
  .import-zone .iz-icon { font-size: 20px; display: block; margin-bottom: 4px; }
  .import-zone.is-locked { opacity: 0.55; }
  .import-zone.is-locked:hover {
    border-color: var(--border);
    color: var(--text-muted);
    background: transparent;
  }

  .asset-list { max-height: none; overflow-y: visible; }
  .asset-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.1s;
  }
  .asset-item:hover { background: var(--surface3); }
  .asset-thumb {
    width: 28px; height: 28px;
    border-radius: 4px;
    background: var(--surface3);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
  }
  .asset-name { font-size: 11px; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .asset-type { font-size: 9px; color: var(--text-muted); }

  /* PRIMITIVES */
  .prim-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 4px;
  }
  .prim-btn {
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    color: var(--text-muted);
    font-family: 'Google Sans', 'Google Sans Text', 'Segoe UI', Arial, sans-serif;
    font-size: 9px;
  }
  .prim-btn:hover { border-color: var(--accent3); color: var(--accent3); background: rgba(67,232,160,0.05); }
  .prim-icon { font-size: 18px; display: block; margin-bottom: 3px; }

  /* PROPERTIES PANEL */
  .props-scroll { overflow: visible; flex: 0 0 auto; min-width: 0; }
  .prop-group { padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .prop-group-title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 8px;
  }
  .prop-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    min-width: 0;
  }
  .prop-label { font-size: 10px; color: var(--text-muted); width: 50px; flex-shrink: 0; }
  .prop-inputs { display: flex; gap: 4px; flex: 1; min-width: 0; }
  .axis-inputs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  .axis-inputs .prop-input {
    font-size: 9px;
    padding: 4px 3px;
  }
  .prop-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: 'Google Sans', 'Google Sans Text', 'Segoe UI', Arial, sans-serif;
    font-size: 10px;
    padding: 4px 6px;
    min-width: 0;
    transition: border-color 0.15s;
  }
  .prop-input:focus { outline: none; border-color: var(--accent); }
  .prop-input[type="color"] { padding: 2px; width: 40px; cursor: pointer; }
  .prop-checkbox { accent-color: var(--accent); }
  .prop-btn {
    flex: 1;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: 'Google Sans', 'Google Sans Text', 'Segoe UI', Arial, sans-serif;
    font-size: 9px;
    padding: 4px 3px;
    cursor: pointer;
    min-width: 0;
  }
  .prop-btn:hover { border-color: var(--accent); color: var(--accent); }

  /* INTERACTION BUILDER */
  .interaction-list { padding: 4px; min-width: 0; }
  .interaction-item {
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
  }
  .int-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
  .int-drag-handle {
    width: 18px;
    min-width: 18px;
    height: 18px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text-dim);
    cursor: grab;
    font: inherit;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    touch-action: none;
  }
  .int-drag-handle:hover { color: var(--accent); background: rgba(79, 97, 214, 0.08); }
  .int-drag-handle:active { cursor: grabbing; }
  .int-label { font-size: 10px; color: var(--text-muted); width: 62px; }
  .int-select {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: 'Google Sans', 'Google Sans Text', 'Segoe UI', Arial, sans-serif;
    font-size: 9px;
    padding: 3px 5px;
  }
  .int-select:focus { outline: none; border-color: var(--accent); }
  .int-delete { color: var(--accent2); cursor: pointer; font-size: 12px; }
  .interaction-item { cursor: default; }
  .interaction-item.dragging {
    opacity: 0.72;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(79, 97, 214, 0.2) inset;
  }
  .interaction-item.drop-before {
    box-shadow: 0 -2px 0 0 var(--accent), 0 0 0 1px rgba(79, 97, 214, 0.2) inset;
  }
  .interaction-item.drop-after {
    box-shadow: 0 2px 0 0 var(--accent), 0 0 0 1px rgba(79, 97, 214, 0.2) inset;
  }
  body.interaction-dragging {
    user-select: none;
    cursor: grabbing;
  }

  /* STATE MACHINE */
  .state-machine {
    padding: 8px;
    display: grid;
    gap: 8px;
    overflow: visible;
    min-width: 0;
  }
  .sm-subtitle {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--text-dim);
  }
  .sm-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }
  .sm-row.wrap {
    flex-wrap: wrap;
  }
  .sm-list {
    display: grid;
    gap: 6px;
  }
  .sm-item {
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px;
    display: grid;
    gap: 6px;
  }
  .sm-item.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(79, 97, 214, 0.2) inset;
  }
  .sm-label {
    font-size: 10px;
    color: var(--text-muted);
    width: 56px;
    flex-shrink: 0;
  }
  .sm-input,
  .sm-select {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: 'Google Sans', 'Google Sans Text', 'Segoe UI', Arial, sans-serif;
    font-size: 10px;
    padding: 4px 6px;
    min-width: 0;
  }
  .sm-input:focus,
  .sm-select:focus {
    outline: none;
    border-color: var(--accent);
  }
  .sm-btn {
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    font-family: 'Google Sans', 'Google Sans Text', 'Segoe UI', Arial, sans-serif;
    font-size: 10px;
    padding: 4px 8px;
    cursor: pointer;
  }
  .sm-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
  .sm-btn.danger:hover {
    border-color: var(--accent2);
    color: var(--accent2);
  }
  .sm-edit {
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    display: grid;
    gap: 6px;
  }
  .sm-empty {
    color: var(--text-dim);
    font-size: 10px;
  }
  .sm-prop-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }
  .sm-check {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--text-muted);
  }
  .sm-check input {
    accent-color: var(--accent);
  }
  .sm-flow {
    font-size: 10px;
    color: var(--text-muted);
  }
  .sm-help {
    font-size: 10px;
    color: var(--text-dim);
    line-height: 1.5;
  }
  .sm-edit .sm-row .sm-label {
    width: 64px;
  }
  .sm-graph-strip {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface3);
    padding: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    overflow: hidden;
  }
  .sm-node {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 9px;
    white-space: nowrap;
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
  }
  .sm-node.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(79, 97, 214, 0.09);
  }
  .sm-link {
    font-size: 9px;
    color: var(--text-dim);
    white-space: nowrap;
    cursor: pointer;
  }

  /* VIEWPORT TOOLS */
  .viewport-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
    z-index: 3;
  }
  .vp-btn {
    background: rgba(251,252,254,0.9);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-family: 'Google Sans', 'Google Sans Text', 'Segoe UI', Arial, sans-serif;
    font-size: 10px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.15s;
    backdrop-filter: blur(6px);
  }
  .vp-btn:hover { border-color: var(--accent); color: var(--accent); }
  .vp-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(79, 97, 214, 0.12); }

  /* STATUS BAR */
  .statusbar {
    height: 26px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 16px;
    flex-shrink: 0;
  }
  .status-item { font-size: 10px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
  .status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent3); }
  .status-dot.dirty { background: var(--accent2); }
  .status-dot.saved { background: var(--accent3); }

  .viewport-info {
    position: absolute;
    bottom: 12px; right: 12px;
    background: rgba(251,252,254,0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 10px;
    color: var(--text-muted);
    backdrop-filter: blur(6px);
    line-height: 1.7;
  }

  /* HIDDEN INPUTS */
  input[type="file"] { display: none; }

  /* SCROLLBAR */
  ::-webkit-scrollbar { width: 4px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

  /* PARTICLE MODAL */
  .modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
  }
  .modal-overlay.open { display: flex; }
  .modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    width: 360px;
    font-size: 12px;
  }
  .modal-title {
    font-family: 'Google Sans', 'Google Sans Text', 'Segoe UI', Arial, sans-serif;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--accent);
  }
  .modal-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .modal-label { font-size: 11px; color: var(--text-muted); width: 110px; flex-shrink: 0; }
  .modal-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: 'Google Sans', 'Google Sans Text', 'Segoe UI', Arial, sans-serif;
    font-size: 11px;
    padding: 5px 8px;
  }
  .modal-input:focus { outline: none; border-color: var(--accent); }
  .modal-footer { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }

  /* IMAGE TARGET PREVIEW */
  .target-preview {
    width: 100%;
    min-height: 122px;
    background: linear-gradient(180deg, rgba(255,255,255,0.75) 0%, rgba(236,240,246,0.9) 100%);
    border: 1px dashed var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 4px 0 8px;
    cursor: pointer;
    position: relative;
    transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s, background 0.18s;
  }
  .target-preview:hover,
  .target-preview.dragover {
    border-color: var(--accent);
    box-shadow: 0 10px 24px rgba(79, 97, 214, 0.12);
    transform: translateY(-1px);
  }
  .target-preview.is-pending {
    border-color: rgba(79, 97, 214, 0.45);
  }
  .target-preview.is-ready {
    border-color: rgba(47, 155, 116, 0.7);
    box-shadow: 0 10px 24px rgba(47, 155, 116, 0.14);
  }
  .target-preview.needs-attention {
    animation: target-pulse 0.7s ease;
  }
  .target-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  .target-preview .tp-placeholder {
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.6;
  }
  .workflow-note {
    margin: 2px 0 10px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.6;
  }
  .target-meta {
    display: grid;
    gap: 3px;
    margin-bottom: 10px;
  }
  .target-file {
    font-size: 10px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .target-upload-status {
    font-size: 10px;
    color: var(--text-muted);
  }
  .target-actions {
    display: flex;
    gap: 8px;
  }
  .target-actions .header-btn {
    flex: 1;
  }
  .scene-step-card .target-preview {
    margin-top: 2px;
  }
  .target-badge {
    position: absolute;
    top: 4px; right: 4px;
    background: var(--accent3);
    color: #f8fbff;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    letter-spacing: 0.5px;
  }

  .no-select { display: flex; align-items: center; justify-content: center; height: 80px; color: var(--text-dim); font-size: 11px; }
  .is-locked { pointer-events: none; }
  body.target-required .props-scroll,
  body.target-required .interaction-list,
  body.target-required .scene-tree {
    background: rgba(255,255,255,0.15);
  }

  @keyframes target-pulse {
    0% { box-shadow: 0 0 0 0 rgba(79, 97, 214, 0.28); }
    100% { box-shadow: 0 0 0 18px rgba(79, 97, 214, 0); }
  }

  .panel-section.scrollable { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
  .panel-section.scrollable .scene-tree { flex: 1; max-height: none; }

  /* MODE PICKER inside sceneStepOverlay */
  .mp-wide { max-width: 800px !important; }
  .mp-row {
    display: flex;
    gap: 10px;
    margin-top: 14px;
  }
  .mp-card {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 10px 14px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    user-select: none;
  }
  .mp-card:hover {
    background: rgba(79, 97, 214, 0.08);
    border-color: var(--accent);
    transform: translateY(-2px);
  }
  .mp-card.disabled {
    opacity: 0.38;
    pointer-events: none;
  }
  .mp-icon {
    font-size: 26px;
    display: block;
    margin-bottom: 8px;
  }
  .mp-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
  }
  .mp-desc {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.45;
  }
  .mp-badge {
    display: inline-block;
    margin-top: 5px;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 8px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* ASSETS PANEL (bottom of left panel) */
  .assets-section {
    flex: 0 0 210px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
  }
  .assets-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 4px 8px;
  }
  .assets-sub-title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 5px 8px 3px;
  }
  .assets-empty,
  .assets-loading {
    font-size: 10px;
    color: var(--text-dim);
    padding: 10px 8px;
    text-align: center;
  }

  /* PRIMITIVE TEXTURE SLOT */
  .prim-tex-slot {
    flex: 1;
    height: 56px;
    border: 1px dashed rgba(79, 97, 214, 0.35);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: var(--surface3);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  }
  .prim-tex-slot:hover,
  .prim-tex-slot.dragover {
    border-color: var(--accent);
    background: rgba(79, 97, 214, 0.05);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75), 0 0 0 2px rgba(79, 97, 214, 0.12);
  }
  .prim-tex-slot.has-texture {
    border-style: solid;
    border-color: var(--accent3);
  }
  .pts-hint {
    font-size: 9px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
    pointer-events: none;
    padding: 0 4px;
  }
  .pts-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
  }
  .pts-clear {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 15px;
    height: 15px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    padding: 0;
  }
  .pts-clear:hover { background: rgba(204, 93, 130, 0.9); }
