    /* ── Viewport ── */
    #viewport {
      flex: 1;
      min-width: 0;
      min-height: 0;
      position: relative;
      overflow: hidden;
    }

    #canvas {
      display: block;
      width: 100%;
      height: 100%;
    }

    #viewport-logo {
      position: absolute;
      top: 10px;
      left: 14px;
      z-index: 10;
      padding: 4px 2px;
      filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
    }

    #capture-btn {
      position: absolute;
      right: 10px;
      bottom: 8px;
      z-index: 10;
      padding: 5px 9px;
      border: 1px solid rgba(255, 255, 255, 0.28);
      border-radius: 3px;
      background: rgba(14, 15, 19, 0.78);
      color: rgba(255, 255, 255, 0.78);
      font: 600 11px/1.2 Georgia, 'Times New Roman', serif;
      cursor: pointer;
      text-shadow: 0 1px 3px #000;
    }

    #capture-btn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
    #capture-btn:disabled { display: none; }

    /* ── Loading overlay ── */
    #loading-overlay {
      position: absolute;
      inset: 0;
      background: rgba(12, 13, 16, 0.88);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 14px;
      pointer-events: none;
      transition: opacity 0.3s;
    }

    #loading-overlay.hidden { opacity: 0; pointer-events: none; }

    .spinner {
      width: 36px; height: 36px;
      border: 3px solid var(--border);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }

    @keyframes spin { to { transform: rotate(360deg); } }

    #loading-text {
      font-size: 12px;
      color: var(--text-muted);
      letter-spacing: 0.05em;
    }

    /* ── Status bar ── */
    #viewport-readout {
      position: absolute;
      bottom: 10px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      max-width: calc(100% - 20px);
      pointer-events: none;
    }

    #status-bar {
      position: absolute;
      left: 10px;
      bottom: 10px;
      max-width: calc(100% - 100px);
      background: var(--status-bg);
      border: 1px solid var(--border);
      padding: 5px 14px;
      border-radius: 4px;
      font-size: 11px;
      color: var(--text-muted);
      pointer-events: none;
      overflow-wrap: anywhere;
      transition: opacity 0.5s;
    }

    /* ── Empty state ── */
    #empty-state {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
      pointer-events: none;
    }

    #empty-state .big {
      font-size: 48px;
      opacity: 0.12;
    }

    #empty-state p {
      color: var(--text-muted);
      font-size: 13px;
    }

    #empty-state.hidden { display: none; }

    /* ── No-model notice ── */
    #no-model-notice {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      pointer-events: none;
    }

    #no-model-notice h2 {
      font-size: 16px;
      color: var(--text);
    }

    #no-model-notice p {
      font-size: 12px;
      color: var(--text-muted);
      max-width: 300px;
      text-align: center;
      line-height: 1.6;
    }

    #no-model-notice code {
      background: var(--border);
      padding: 1px 5px;
      border-radius: 3px;
      font-family: monospace;
      font-size: 11px;
      color: var(--accent);
    }

    #no-model-notice.hidden { display: none; }

    #animation-export-dialog {
      margin: auto;
      width: min(420px, calc(100vw - 24px));
      max-height: calc(100vh - 24px);
      overflow-y: auto;
      padding: 20px;
      background: var(--sidebar-bg);
      color: var(--text);
      border: 1px solid var(--border);
      border-radius: 8px;
    }
    #animation-export-dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
    #animation-export-dialog h2 { font-size: 17px; margin-bottom: 10px; }
    #animation-export-dialog p { font-size: 12px; line-height: 1.5; margin: 8px 0; }
    #animation-export-dialog label { display: block; margin: 12px 0 4px; }
    #animation-export-dialog select, #animation-export-name {
      width: 100%;
      padding: 7px;
      border: 1px solid var(--border);
      border-radius: 3px;
      background: var(--bg);
      color: var(--text);
      font: inherit;
    }
    #animation-export-dialog .export-loop-label { display: flex; align-items: center; gap: 8px; }
    #animation-export-advanced { margin-top: 16px; }
    #animation-export-warning { color: #ffce8a; }
    #animation-export-progress { width: 100%; margin-top: 10px; }
    .export-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
    .export-actions button {
      padding: 8px 12px;
      background: var(--bg);
      color: var(--text);
      border: 1px solid var(--border);
      border-radius: 3px;
      cursor: pointer;
    }
    .export-actions button:disabled { cursor: not-allowed; opacity: 0.5; }
    #animation-export-save { background: var(--accent); color: #fff; }

