/* ================================================================
   CoreLink 3D Studio — Stylesheet (Compact & Ultra-Responsive)
   Aesthetic: Premium Glassmorphism Dark Dashboard
   Accents: Neon Blue (#00f2fe) & Cyan (#4facfe)
   ================================================================ */

:root {
  --bg-dark:          #080a0f;
  --bg-panel:         rgba(16, 20, 29, 0.88);
  --bg-card:          rgba(24, 30, 43, 0.75);
  --bg-card-hover:    rgba(30, 38, 54, 0.85);
  --bg-input:         #0c1017;
  
  --border-subtle:    rgba(255, 255, 255, 0.07);
  --border-glass:     rgba(255, 255, 255, 0.12);
  --border-active:    #00f2fe;
  
  --accent-cyan:      #00f2fe;
  --accent-blue:      #4facfe;
  --accent-glow:      rgba(0, 242, 254, 0.25);
  --accent-glow-strong: rgba(0, 242, 254, 0.5);
  
  --text-main:        #f1f5f9;
  --text-muted:       #94a3b8;
  --text-ghost:       #64748b;
  
  --success:          #10b981;
  --warning:          #f59e0b;
  --danger:           #ef4444;
  
  --font-sans:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:        'Roboto Mono', monospace;
  
  --header-h:         46px;
  --left-panel-w:     320px;
  --right-panel-w:    370px;
  --radius-sm:        4px;
  --radius-md:        6px;
  --radius-lg:        10px;
  
  --ease:             cubic-bezier(0.16, 1, 0.3, 1);
  --transition:       all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ─────────────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(10, 13, 20, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 500;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.logo-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  box-shadow: 0 0 8px var(--accent-glow);
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo-text {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, #ffffff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.logo-badge {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
  letter-spacing: 0.08em;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-label {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-ghost);
  letter-spacing: 0.08em;
}

.session-id {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--accent-blue);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-ghost);
  transition: var(--transition);
}

.status-dot.online  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.offline { background: var(--danger); }
.status-dot.loading { background: var(--warning); animation: pulse 1.2s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.status-label {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.status-model {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-ghost);
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
}

.backend-toggle {
  display: flex;
  background: var(--bg-input);
  border-radius: 3px;
  padding: 1px;
  border: 1px solid var(--border-subtle);
}

.backend-btn {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  padding: 2px 5px;
  border: none;
  background: transparent;
  color: var(--text-ghost);
  border-radius: 2px;
  cursor: pointer;
  transition: var(--transition);
}

.backend-btn:hover { color: var(--text-main); }
.backend-btn.active {
  background: var(--accent-cyan);
  color: #000;
}

/* ── STUDIO LAYOUT GRID ─────────────────────────────────────── */
.studio-layout {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: var(--left-panel-w) 1fr var(--right-panel-w);
  gap: 0;
  overflow: hidden;
}

/* ── PANELS ─────────────────────────────────────────────────── */
.panel {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  z-index: 100;
}

.panel-left {
  border-right: 1px solid var(--border-glass);
}

.panel-right {
  border-left: 1px solid var(--border-glass);
}

.panel-header {
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.panel-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Custom Scrollbar */
.panel-content::-webkit-scrollbar,
.mesh-tree-list::-webkit-scrollbar,
.textures-list::-webkit-scrollbar,
.inspector-content::-webkit-scrollbar,
.ai-content::-webkit-scrollbar,
.json-code-block::-webkit-scrollbar {
  width: 5px;
}
.panel-content::-webkit-scrollbar-track,
.mesh-tree-list::-webkit-scrollbar-track,
.textures-list::-webkit-scrollbar-track,
.inspector-content::-webkit-scrollbar-track,
.ai-content::-webkit-scrollbar-track,
.json-code-block::-webkit-scrollbar-track {
  background: transparent;
}
.panel-content::-webkit-scrollbar-thumb,
.mesh-tree-list::-webkit-scrollbar-thumb,
.textures-list::-webkit-scrollbar-thumb,
.inspector-content::-webkit-scrollbar-thumb,
.ai-content::-webkit-scrollbar-thumb,
.json-code-block::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 3px;
}

/* ── CARDS & COLLAPSIBLE ACCORDIONS ────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: visible;
  transition: var(--transition);
  flex-shrink: 0;
}

.card.flex-grow-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--bg-card-hover);
}

.card-header {
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.card-header:hover {
  background: rgba(0, 242, 254, 0.08);
}

.card-icon {
  font-size: 13px;
}

.card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.01em;
  flex: 1;
}

.card-chevron {
  font-size: 10px;
  color: var(--accent-cyan);
  transition: transform 0.2s ease;
}

.card.collapsed .card-chevron {
  transform: rotate(-90deg);
}

.card.collapsed .card-body {
  display: none !important;
}

.card-body {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-body.card-body-flex {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ── COMPACT FORM ELEMENTS ──────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group.inline-row {
  display: grid;
  grid-template-columns: 75px 1fr;
  align-items: center;
  gap: 8px;
}

.form-group.slider-row {
  display: grid;
  grid-template-columns: 75px 1fr 34px;
  align-items: center;
  gap: 8px;
}

.form-group.emissive-row {
  display: grid;
  grid-template-columns: 75px minmax(0, 1fr);
  align-items: center;
  row-gap: 7px;
}

.emissive-color-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.emissive-value-line {
  grid-column: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 34px;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.emissive-value-line .color-hex-text { width: 72px; min-width: 0; }

.form-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.val-display {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 600;
  text-align: right;
}

.select-field,
.text-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 5px 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  outline: none;
  transition: var(--transition);
}

.select-field:focus,
.text-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-glow);
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-input {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  border: none;
  flex-shrink: 0;
}
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: 1px solid var(--border-glass); border-radius: var(--radius-sm); }
.color-action-label { color: var(--text-muted); font-size: 10px; white-space: nowrap; }

.color-picker-wrapper { position: relative; }

.light-controls,
.environment-controls,
.shader-effects { display: flex; flex-direction: column; gap: 8px; }
.light-control-row {
  display: grid;
  grid-template-columns: 72px 18px 48px 1fr 34px;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 10px;
}
.light-control-row input[type="range"] { min-width: 0; }
.light-color-input { width: 48px; padding: 4px; color: var(--text-main); background: var(--bg-input); border: 1px solid var(--border-glass); border-radius: 4px; font: 9px var(--font-mono); text-transform: uppercase; }
.light-control-row span { color: var(--accent-cyan); font-family: var(--font-mono); text-align: right; }
.environment-controls > .text-input { font-size: 10px; padding: 6px; }
.environment-file-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 6px;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 10px;
  overflow: hidden;
}
.choose-file-button {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}
.environment-file-picker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.environment-file-hint { color: var(--text-ghost); font-family: var(--font-mono); font-size: 9px; line-height: 1.35; }
.environment-controls .slider-row { grid-template-columns: 75px 1fr 34px; }

.color-hex-text {
  font-family: var(--font-mono);
  text-transform: uppercase;
  flex: 1;
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-input);
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn-toggle {
  padding: 6px 8px;
  min-height: 30px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-toggle:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-toggle.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(79, 172, 254, 0.2));
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-glow);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.preset-btn {
  padding: 6px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.preset-btn:hover {
  border-color: var(--accent-blue);
  color: var(--text-main);
}

.preset-btn.active {
  background: var(--accent-blue);
  color: #000;
  border-color: var(--accent-blue);
  font-weight: 700;
  box-shadow: 0 0 6px rgba(79, 172, 254, 0.4);
}
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.preset-btn:hover {
  border-color: var(--accent-blue);
  color: var(--text-main);
}

.preset-btn.active {
  background: var(--accent-blue);
  color: #000;
  border-color: var(--accent-blue);
  font-weight: 700;
  box-shadow: 0 0 6px rgba(79, 172, 254, 0.4);
}

.toggle-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding-top: 2px;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 26px;
  height: 14px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border-glass);
  transition: .2s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 8px;
  width: 8px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-ghost);
  transition: .2s;
}
.slider.round { border-radius: 14px; }
.slider.round:before { border-radius: 50%; }
input:checked + .slider { background-color: rgba(0, 242, 254, 0.2); border-color: var(--accent-cyan); }
input:checked + .slider:before { transform: translateX(12px); background-color: var(--accent-cyan); }

/* ── HEADER DONATE BUTTON ─────────────────────────────────── */
.btn-donate-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.16), rgba(79, 172, 254, 0.18));
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
}

.btn-donate-header:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.donate-icon {
  font-size: 12px;
}

/* ── MODALS ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 5, 10, 0.72);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  width: min(92vw, 480px);
  background: rgba(11, 16, 26, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.modal-close {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  cursor: pointer;
}

.modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.donate-warning,
.trash-desc {
  font-size: 12px;
  line-height: 1.5;
  color: #facc15;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 10px 12px;
  border-radius: 8px;
}

.btn-secondary,
.btn-danger-outline,
.btn-restore,
.btn-delete {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: var(--transition);
}

.donate-network-note {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.btn-secondary,
.btn-restore {
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.btn-danger-outline,
.btn-delete {
  padding: 7px 10px;
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.direct-payment-card {
  border: 1px solid rgba(0, 242, 254, 0.28);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(0, 242, 254, 0.08), rgba(255, 255, 255, 0.025));
  overflow: hidden;
}

.direct-payment-network {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
}

.network-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.network-token {
  margin-left: auto;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
}

.direct-payment-content {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 12px;
}

.direct-payment-address-group {
  min-width: 0;
  flex: 1;
}

.direct-payment-address-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.direct-payment-address-row code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
}

.btn-copy-address {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid rgba(0, 242, 254, 0.4);
  border-radius: 7px;
  background: rgba(0, 242, 254, 0.1);
  color: var(--text-main);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  transition: var(--transition);
}

.btn-copy-address:hover,
.btn-copy-address.copied {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.14);
  color: #86efac;
}

.copy-feedback {
  display: block;
  min-height: 15px;
  margin-top: 5px;
  color: var(--success);
  font-family: var(--font-mono);
  font-size: 10px;
}

.donate-qr-wrap {
  display: flex;
  flex: 0 0 144px;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
}

.donate-qr-wrap img {
  display: block;
  width: 144px;
  height: 144px;
  padding: 5px;
  border-radius: 6px;
  background: #fff;
}

@media (max-width: 560px) {
  .direct-payment-content { align-items: stretch; flex-direction: column; }
  .donate-qr-wrap { align-self: center; }
  .network-token { font-size: 8px; }
}

/* ── UPLOADER & FILE LIST ───────────────────────────────────── */
.upload-dropzone {
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.05);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.upload-icon { font-size: 18px; }
.upload-text { font-weight: 600; font-size: 12px; color: var(--text-main); }
.upload-sub  { font-size: 10px; color: var(--text-ghost); }

.upload-status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-ghost);
  text-align: center;
  word-break: break-all;
}
.upload-status.success { color: var(--success); }
.upload-status.loading { color: var(--warning); }
.upload-status.error   { color: var(--danger); }

.file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.file-item:hover,
.file-item.active {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.06);
}

.file-icon { font-size: 13px; }
.file-name {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-ghost);
}

.file-remove {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-remove:hover {
  background: rgba(239, 68, 68, 0.18);
}

.trash-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.trash-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.trash-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.trash-name {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trash-type {
  font-size: 10px;
  color: var(--text-ghost);
}

.trash-actions {
  display: flex;
  gap: 6px;
}

.trash-empty {
  color: var(--text-ghost);
  font-size: 11px;
  padding: 8px 0;
}

.btn-trash-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  cursor: pointer;
}

.trash-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

/* DEDICATED MODEL EXPORT PANEL IN ASSET LIBRARY */
.export-section {
  margin-top: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.export-icon {
  font-size: 14px;
}

.export-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.04em;
}

.export-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.35;
}

.export-form-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.export-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-export-primary {
  padding: 6px 12px;
  min-height: 32px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: var(--transition);
  box-shadow: 0 0 6px var(--accent-glow);
}

.btn-export-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 10px var(--accent-glow-strong);
}

.btn-export-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── CENTER CANVAS ─────────────────────────────────────────── */
.canvas-container {
  position: relative;
  background: #040508;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.viewport-header {
  height: 36px;
  background: rgba(12, 16, 24, 0.92);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 10;
  flex-shrink: 0;
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* macOS Window Action Buttons (Red/Yellow/Green Dots) */
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: none;
  outline: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  display: inline-block;
  padding: 0;
}

.dot:hover {
  transform: scale(1.2);
  filter: brightness(1.2);
}

.dot:active {
  transform: scale(0.95);
}

.dot.red    { background: #ff5f56; box-shadow: 0 0 4px rgba(255, 95, 86, 0.4); }
.dot.yellow { background: #ffbd2e; box-shadow: 0 0 4px rgba(255, 189, 46, 0.4); }
.dot.green  { background: #27c93f; box-shadow: 0 0 4px rgba(39, 201, 63, 0.4); }

.dot.active-dot {
  box-shadow: 0 0 8px #ff5f56;
}

.viewport-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewport-quick-tools {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tool-btn {
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tool-btn:hover,
.tool-btn.active {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
  font-weight: 600;
}

.tool-btn.accent-btn {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.25), rgba(79, 172, 254, 0.25));
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}

.tool-btn.accent-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 8px var(--accent-glow);
}

#viewport3d {
  width: 100%;
  height: 100%;
  flex: 1;
  display: block;
  cursor: grab;
}
#viewport3d:active { cursor: grabbing; }

.canvas-drop-overlay {
  position: absolute;
  inset: 36px 0 0 0;
  background: rgba(4, 5, 8, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.canvas-drop-overlay.active {
  opacity: 1;
}

.drop-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  border: 2px dashed var(--accent-cyan);
  border-radius: var(--radius-lg);
  background: rgba(0, 242, 254, 0.05);
}

.drop-icon { font-size: 28px; }
.drop-main {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-cyan);
}

.viewport-hud {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  pointer-events: none;
  z-index: 10;
}

.hud-badge {
  padding: 3px 8px;
  background: rgba(12, 16, 24, 0.88);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  backdrop-filter: blur(6px);
}

.hud-badge.accent {
  border-color: rgba(0, 242, 254, 0.4);
}

.hud-label { color: var(--text-ghost); }
.hud-val   { color: var(--accent-cyan); font-weight: 600; }

/* ── RIGHT PANEL: INSPECTOR & AI ────────────────────────────── */
.inspector-section {
  flex: 0 0 auto;
  max-height: 44%;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-glass);
  overflow-y: auto;
  overflow-x: hidden;
}

.inspector-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.stat-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-ghost);
  text-transform: uppercase;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-tree-container,
.textures-list-container {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tree-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.tree-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-cyan);
}

.mesh-tree-list {
  max-height: 100px;
  overflow-y: auto;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tree-node-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}

.tree-node-item:hover {
  background: rgba(0, 242, 254, 0.08);
}

.tree-node-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-node-verts { color: var(--text-ghost); font-size: 10px; margin-right: 6px; }

.textures-list {
  max-height: 85px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.texture-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
}

.tex-type { color: var(--accent-blue); font-weight: 600; }
.tex-info { color: var(--text-ghost); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }

/* ── AI SECTION & EXPANDED JSON CONSOLE ───────────────────────── */
.ai-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(8, 11, 18, 0.5);
  min-height: 0;
}

.ai-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 8px;
  overflow: hidden;
}

.ai-input-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.ai-input-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
}

.ai-status-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.ai-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 6px 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.4;
  resize: none;
  outline: none;
  transition: var(--transition);
}

.ai-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-glow);
}

.btn-ai-submit {
  width: 100%;
  padding: 8px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
  box-shadow: 0 0 8px var(--accent-glow);
}

.btn-ai-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 12px var(--accent-glow-strong);
}

.btn-ai-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip-btn {
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  color: var(--text-ghost);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.chip-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* AI Output JSON Block (EXPANDED TO FILL EMPTY SPACE) */
.ai-output-box {
  flex: 1;
  background: #06080d;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 140px;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.output-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.06em;
}

.output-sub {
  font-size: 10px;
  color: var(--text-ghost);
}

.json-code-block {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: #38bdf8;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.execution-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--border-subtle);
}

.exec-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.exec-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
