    :root {
      --bg: #fafaf6;
      --paper: #ffffff;
      --ink: #111113;
      --muted: #5c5c62;
      --line: #e4e4dc;
      --soft: #f2f2eb;
      --accent-yellow: #f5c518;
      --accent-yellow-glow: rgba(245, 197, 24, 0.45);
      --font-main: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
      --font-mono: "JetBrains Mono", monospace;
      --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.05);
      --shadow-elevated: 0 24px 60px rgba(0, 0, 0, 0.10);
    }

    html[data-theme="dark"] {
      --bg: #050507;
      --paper: #121215;
      --ink: #f5f5f2;
      --muted: #9e9ea4;
      --line: #24242a;
      --soft: #1a1a20;
      --accent-yellow: #f5c518;
      --accent-yellow-glow: rgba(245, 197, 24, 0.55);
      --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.55);
      --shadow-elevated: 0 24px 60px rgba(0, 0, 0, 0.85);
    }

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

    body {
      font-family: var(--font-main);
      background-color: var(--bg);
      color: var(--ink);
      overflow: hidden;
      width: 100vw;
      height: 100vh;
      user-select: none;
      -webkit-user-select: none;
      transition: color 2.5s ease;
    }

    /* Page Space Transition Overlay */
    .space-transition-overlay {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      background: var(--bg);
      z-index: 100;
      pointer-events: none;
      opacity: 1;
      transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .space-transition-overlay.hidden {
      opacity: 0;
      pointer-events: none;
      display: none;
    }

    /* Dual Full-Screen Gradient Backdrop Layers */
    .bg-gradient-layer {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 0;
      transition: opacity 3.8s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .bg-gradient-layer.light {
      background: radial-gradient(circle at 50% 35%, #ffffff 0%, #f6f6ee 50%, #e8e8dc 100%);
      opacity: 1;
    }

    .bg-gradient-layer.dark {
      background: radial-gradient(circle at 50% 35%, #15151a 0%, #08080a 55%, #010102 100%);
      opacity: 0;
    }

    html[data-theme="dark"] .bg-gradient-layer.light {
      opacity: 0;
    }

    html[data-theme="dark"] .bg-gradient-layer.dark {
      opacity: 1;
    }

    #webgl-canvas {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      z-index: 1;
      cursor: grab;
    }

    #webgl-canvas:active {
      cursor: grabbing;
    }

    #css3d-canvas-layer {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      z-index: 2;
      pointer-events: none;
    }

    /* Top HUD Header */
    .hud-header {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      z-index: 20;
      padding: 22px 32px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      pointer-events: none;
      opacity: 0;
      transform: translateY(-20px);
      transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .hud-header.loaded {
      opacity: 1;
      transform: translateY(0);
    }

    .hud-brand {
      pointer-events: auto;
      display: flex;
      align-items: center;
      gap: 12px;
      text-decoration: none;
      color: var(--ink);
      font-weight: 700;
      font-size: 14px;
      letter-spacing: -0.02em;
      background: var(--paper);
      padding: 8px 18px 8px 10px;
      border-radius: 99px;
      border: 1px solid var(--line);
      box-shadow: var(--shadow-soft);
      transition: transform 0.2s ease, border-color 0.2s ease, background 0.3s ease;
    }

    .hud-brand:hover {
      transform: translateY(-1px);
      border-color: var(--ink);
    }

    .hud-avatar-icon {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: var(--ink);
      color: var(--paper);
      display: grid;
      place-items: center;
      font-size: 12px;
      font-weight: 800;
      cursor: pointer;
      user-select: none;
      transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
    }

    .hud-avatar-icon:hover {
      transform: scale(1.12);
      box-shadow: 0 0 10px rgba(245, 197, 24, 0.45);
    }

    .hud-avatar-icon:active {
      transform: scale(0.92);
    }

    .hud-center {
      pointer-events: auto;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .hemisphere-pill {
      display: inline-flex;
      align-items: center;
      gap: 9px;
      padding: 9px 20px;
      border-radius: 99px;
      background: var(--paper);
      border: 1px solid var(--line);
      box-shadow: var(--shadow-soft);
      font-size: 13px;
      font-weight: 750;
      letter-spacing: 0.03em;
      text-transform: uppercase;
      transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .hemisphere-indicator-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--accent-yellow);
      box-shadow: 0 0 12px var(--accent-yellow-glow);
      animation: pulseGlow 2s infinite ease-in-out;
    }

    @keyframes pulseGlow {

      0%,
      100% {
        transform: scale(1);
        opacity: 0.9;
      }

      50% {
        transform: scale(1.35);
        opacity: 1;
      }
    }

    .hud-controls {
      pointer-events: auto;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .btn-pill {
      font-family: var(--font-main);
      font-size: 13px;
      font-weight: 650;
      color: var(--ink);
      background: var(--paper);
      border: 1px solid var(--line);
      padding: 0 18px;
      height: 42px;
      border-radius: 99px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      cursor: pointer;
      text-decoration: none;
      box-shadow: var(--shadow-soft);
      transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.3s ease;
    }

    .btn-pill:hover {
      transform: translateY(-1px);
      box-shadow: var(--shadow-elevated);
      border-color: var(--ink);
    }

    .btn-pill.primary {
      background: var(--ink);
      color: var(--paper);
      border-color: var(--ink);
    }

    .btn-pill.primary:hover {
      border-color: var(--accent-yellow);
    }

    .btn-icon {
      width: 42px;
      height: 42px;
      padding: 0;
      border-radius: 50%;
    }

    .btn-icon svg {
      width: 18px;
      height: 18px;
      stroke: currentColor;
      fill: none;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .ui-icon {
      width: 14px;
      height: 14px;
      stroke: currentColor;
      fill: none;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
      display: inline-block;
      vertical-align: middle;
      flex-shrink: 0;
    }

    /* Floating Bottom Preset Toolbar */
    .bottom-bar {
      position: absolute;
      bottom: 26px;
      left: 50%;
      transform: translateX(-50%) translateY(30px);
      z-index: 20;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px;
      border-radius: 99px;
      background: var(--paper);
      border: 1px solid var(--line);
      box-shadow: var(--shadow-elevated);
      opacity: 0;
      transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease, border-color 0.3s ease;
    }

    .bottom-bar.loaded {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    .preset-btn {
      font-family: var(--font-main);
      font-size: 12px;
      font-weight: 700;
      color: var(--muted);
      background: transparent;
      border: none;
      padding: 9px 16px;
      border-radius: 99px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s ease;
    }

    .preset-btn:hover {
      color: var(--ink);
      background: var(--soft);
    }

    .preset-btn.active {
      color: var(--paper);
      background: var(--ink);
    }

    /* Hover Tooltip */
    .hotspot-tooltip {
      position: absolute;
      z-index: 25;
      pointer-events: none;
      transform: translate(-50%, -130%);
      padding: 8px 16px;
      background: var(--ink);
      color: var(--paper);
      border-radius: 8px;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: -0.01em;
      white-space: nowrap;
      opacity: 0;
      transition: opacity 0.2s ease, transform 0.2s ease;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    }

    .hotspot-tooltip.show {
      opacity: 1;
      transform: translate(-50%, -145%);
    }

    .hotspot-tooltip::after {
      content: "";
      position: absolute;
      bottom: -4px;
      left: 50%;
      transform: translateX(-50%);
      border-width: 4px 4px 0;
      border-style: solid;
      border-color: var(--ink) transparent transparent;
    }

    /* =========================================================================
       💬 FLOATING CHAT BUBBLE DETAIL POPOVER (Non-Modal, Click Outside to Dismiss)
       ========================================================================= */
    .drawer-overlay {
      position: fixed;
      inset: 0;
      z-index: 50;
      background: transparent; /* No blocking screen blackout! */
      pointer-events: none;
      transition: opacity 0.25s ease;
    }

    .drawer-overlay.open {
      pointer-events: auto;
    }

    .drawer-panel {
      position: fixed;
      bottom: 96px;
      right: 28px;
      width: min(380px, 90vw);
      max-height: min(460px, 75vh);
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 20px;
      box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      z-index: 51;
      transform: translateY(20px) scale(0.95);
      opacity: 0;
      pointer-events: none;
      transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .drawer-overlay.open .drawer-panel {
      transform: translateY(0) scale(1);
      opacity: 1;
      pointer-events: auto;
    }

    .drawer-header {
      padding: 16px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--line);
      background: var(--soft);
    }

    .drawer-kicker {
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--muted);
      margin-bottom: 2px;
    }

    .drawer-title {
      font-size: 16px;
      font-weight: 800;
      letter-spacing: -0.02em;
      line-height: 1.2;
      color: var(--ink);
    }

    .drawer-close-btn {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: transparent;
      border: 1px solid var(--line);
      color: var(--ink);
      display: grid;
      place-items: center;
      cursor: pointer;
      font-size: 12px;
      transition: transform 0.2s ease, background 0.2s ease;
    }

    .drawer-close-btn:hover {
      transform: scale(1.08);
      background: var(--line);
    }

    .drawer-body {
      padding: 16px 20px;
      overflow-y: auto;
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .drawer-section-title {
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--muted);
      margin-bottom: 4px;
    }

    .drawer-copy {
      font-size: 13px;
      line-height: 1.5;
      color: var(--ink);
    }

    .drawer-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin-top: 2px;
    }

    .drawer-tag {
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 600;
      padding: 3px 8px;
      border-radius: 6px;
      background: var(--soft);
      color: var(--ink);
      border: 1px solid var(--line);
    }

    .drawer-actions {
      padding: 12px 20px;
      border-top: 1px solid var(--line);
      display: flex;
      background: var(--soft);
    }

    .drawer-actions .btn-pill {
      width: 100%;
      height: 38px;
      font-size: 12px;
    }

    /* Toast Notification */
    .toast-pill {
      position: absolute;
      top: 92px;
      left: 50%;
      transform: translateX(-50%) translateY(-20px);
      background: var(--ink);
      color: var(--paper);
      padding: 10px 22px;
      border-radius: 99px;
      font-size: 13px;
      font-weight: 750;
      box-shadow: var(--shadow-elevated);
      opacity: 0;
      pointer-events: none;
      transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
      z-index: 30;
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .toast-pill.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    @media (max-width: 768px) {
      .hud-header {
        padding: 14px 18px;
      }

      .hud-brand span {
        display: none;
      }

      .bottom-bar {
        bottom: 16px;
        gap: 4px;
        padding: 4px;
      }

      .preset-btn {
        padding: 6px 12px;
        font-size: 11px;
      }
    }

    /* =========================================================================
       🛠️ 3D VISUAL OBJECT INSPECTOR & LIVE TRANSFORM EDITOR UI
       ========================================================================= */
    .btn-pill.btn-editor-active {
      background: var(--accent-yellow) !important;
      color: #111116 !important;
      border-color: #f5c518 !important;
      font-weight: 800 !important;
    }

    .world-editor-panel {
      position: fixed;
      top: 76px;
      right: 20px;
      width: 400px;
      max-height: calc(100vh - 110px);
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 20px;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
      backdrop-filter: blur(24px);
      -webkit-backdrop-filter: blur(24px);
      z-index: 9999;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      scrollbar-width: none !important;
      -ms-overflow-style: none !important;
      transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .world-editor-panel::-webkit-scrollbar {
      display: none !important;
      width: 0 !important;
      height: 0 !important;
    }

    .world-editor-panel.hidden {
      display: none !important;
      opacity: 0;
      pointer-events: none;
      transform: translateY(-16px) scale(0.96);
    }

    /* 🪐 Community Planets Left-Hand Side Card in Studio Mode */
    .community-planets-panel {
      position: fixed;
      top: 76px;
      left: 20px;
      width: 400px;
      max-height: calc(100vh - 110px);
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 20px;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
      backdrop-filter: blur(24px);
      -webkit-backdrop-filter: blur(24px);
      z-index: 9999;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      scrollbar-width: none !important;
      -ms-overflow-style: none !important;
      transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .community-planets-panel::-webkit-scrollbar {
      display: none !important;
      width: 0 !important;
      height: 0 !important;
    }

    .community-planets-panel.hidden {
      display: none !important;
      opacity: 0;
      pointer-events: none;
      transform: translateX(-20px) scale(0.96);
    }

    .planet-mod-section {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-bottom: 12px;
    }

    .planet-mod-section-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      color: var(--muted);
      padding: 4px 2px;
    }

    .planet-mod-count-pill {
      font-size: 10px;
      font-weight: 800;
      padding: 1px 7px;
      border-radius: 12px;
      background: var(--soft);
      border: 1px solid var(--line);
      color: var(--ink);
    }

    .planet-row-item {
      background: var(--soft);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 8px 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .planet-row-item:hover {
      border-color: rgba(245, 197, 24, 0.5);
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .planet-row-item.inactive {
      opacity: 0.65;
      background: rgba(0, 0, 0, 0.02);
    }

    .planet-icon-action-btn {
      width: 28px;
      height: 28px;
      padding: 0;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: var(--paper);
      color: var(--ink);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s ease;
    }

    .planet-icon-action-btn:hover:not(:disabled) {
      background: var(--soft);
      transform: scale(1.08);
    }

    .planet-icon-action-btn.danger:hover:not(:disabled) {
      background: rgba(239, 68, 68, 0.15);
      border-color: #ef4444;
      color: #ef4444;
    }

    .planet-icon-action-btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
      pointer-events: none;
    }

    @media (max-width: 900px) {
      .community-planets-panel {
        left: 12px;
        right: 12px;
        width: auto;
        top: auto;
        bottom: 12px;
        max-height: 50vh;
      }
    }

    .editor-header {
      padding: 12px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--line);
      background: var(--soft);
    }

    .editor-title {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      font-weight: 800;
      color: var(--ink);
    }

    .editor-close-btn {
      background: transparent;
      border: none;
      font-size: 15px;
      color: var(--ink);
      opacity: 0.6;
      cursor: pointer;
      padding: 4px 6px;
      border-radius: 6px;
      transition: opacity 0.2s, background 0.2s;
    }

    .editor-close-btn:hover {
      opacity: 1;
      background: var(--line);
    }

    .editor-body {
      padding: 14px 16px;
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-width: none !important;
      -ms-overflow-style: none !important;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .editor-body::-webkit-scrollbar {
      display: none !important;
      width: 0 !important;
      height: 0 !important;
    }

    .editor-action-bar {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
    }

    .editor-action-bar-4 {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr 1fr;
      gap: 5px;
    }

    .editor-sub-btn {
      padding: 7px 10px;
      border-radius: 8px;
      background: var(--soft);
      border: 1px solid var(--line);
      color: var(--ink);
      font-family: var(--font-main);
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      transition: all 0.2s ease;
    }

    .editor-sub-btn:hover {
      background: var(--line);
    }

    .editor-sub-btn.danger {
      color: #ff4444;
      border-color: rgba(255, 68, 68, 0.25);
    }

    .editor-sub-btn.danger:hover {
      background: #ff4444;
      color: #fff;
    }

    .editor-field-group {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .editor-field-group input[type="range"] {
      width: 100%;
      accent-color: #f5c518;
      cursor: pointer;
    }

    .editor-label {
      font-size: 12px;
      font-weight: 750;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: var(--muted);
    }

    .editor-select {
      width: 100%;
      padding: 10px 12px;
      border-radius: 10px;
      background: var(--paper);
      border: 1px solid var(--line);
      color: var(--ink);
      font-family: var(--font-main);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      outline: none;
    }

    .editor-mode-toolbar {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 6px;
      background: var(--soft);
      padding: 4px;
      border-radius: 12px;
    }

    .editor-mode-btn {
      border: none;
      background: transparent;
      padding: 8px 0;
      border-radius: 8px;
      font-family: var(--font-main);
      font-size: 12px;
      font-weight: 700;
      color: var(--ink);
      cursor: pointer;
      transition: background 0.2s, color 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .editor-mode-btn:hover {
      background: var(--line);
    }

    .editor-mode-btn.active {
      background: var(--paper);
      color: var(--ink);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
      font-weight: 800;
    }

    .editor-section-title {
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      color: var(--muted);
      margin-top: 4px;
    }

    .editor-num-row {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 8px;
    }

    .editor-num-input {
      display: flex;
      align-items: center;
      background: var(--soft);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 4px 8px;
      gap: 6px;
    }

    .editor-num-input label {
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 700;
      color: var(--muted);
    }

    .editor-num-input input {
      width: 100%;
      border: none;
      background: transparent;
      color: var(--ink);
      font-family: var(--font-mono);
      font-size: 12px;
      font-weight: 600;
      outline: none;
    }

    .editor-quick-scale {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 12px;
      font-weight: 600;
      color: var(--ink);
    }

    .editor-quick-scale input[type="range"] {
      flex: 1;
      accent-color: #f5c518;
      cursor: pointer;
    }

    .editor-quick-scale span {
      font-family: var(--font-mono);
      font-size: 12px;
      min-width: 44px;
      text-align: right;
    }

    .editor-quick-rot-bar {
      display: flex;
      gap: 4px;
      margin-top: 6px;
    }

    .editor-quick-rot-bar .editor-sub-btn {
      flex: 1;
      padding: 6px 2px;
      font-size: 11px;
      font-weight: 700;
    }

    .editor-accordion {
      background: var(--soft);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 10px 12px;
      margin-top: 4px;
    }

    .editor-accordion summary {
      cursor: pointer;
      font-size: 12px;
      font-weight: 750;
      color: var(--ink);
      user-select: none;
      display: flex;
      align-items: center;
      justify-content: space-between;
      list-style: none;
    }

    .editor-accordion summary::-webkit-details-marker {
      display: none;
    }

    .editor-accordion-content {
      padding-top: 10px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .editor-input {
      width: 100%;
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 6px 8px;
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 600;
      color: var(--ink);
      outline: none;
    }

    .editor-input:focus {
      border-color: #f5c518;
    }

    .editor-footer {
      padding: 12px 14px;
      display: flex;
      gap: 6px;
      border-top: 1px solid var(--line);
      background: var(--soft);
    }

    .editor-btn {
      flex: 1;
      padding: 9px 8px;
      border-radius: 10px;
      border: 1px solid var(--line);
      font-family: var(--font-main);
      font-size: 11.5px;
      font-weight: 750;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      white-space: nowrap;
    }

    .editor-btn.primary {
      background: var(--ink);
      color: var(--paper);
      border-color: var(--ink);
    }

    .editor-btn.primary:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    }

    .editor-btn.secondary {
      background: var(--paper);
      color: var(--ink);
    }

    .editor-btn.secondary:hover {
      border-color: var(--ink);
    }

    .editor-btn.danger {
      background: rgba(255, 68, 68, 0.1);
      color: #ff4444;
      border-color: rgba(255, 68, 68, 0.2);
    }

    .editor-btn.danger:hover {
      background: #ff4444;
      color: #fff;
    }

    .editor-toast {
      position: fixed;
      bottom: 86px;
      left: 50%;
      transform: translateX(-50%) translateY(20px);
      background: #18181f;
      color: #ffffff;
      padding: 12px 24px;
      border-radius: 99px;
      font-size: 13px;
      font-weight: 700;
      box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
      border: 1px solid rgba(255, 255, 255, 0.15);
      opacity: 0;
      pointer-events: none;
      transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
      z-index: 2000;
      text-align: center;
      max-width: 90vw;
    }

    .editor-toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    /* ==========================================================================
       🪐 EXPANDABLE HUD BUTTONS (Hover Expands Label: Fullscreen, Reset View, Theme Switch, Planet)
       ========================================================================== */
    .btn-hud-expand {
      display: inline-flex;
      align-items: center;
      gap: 0;
      transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
      overflow: hidden;
      padding: 0 12px;
      border-radius: 999px;
      height: 42px;
      font-weight: 700;
      cursor: pointer;
    }

    .btn-hud-expand .hud-btn-text {
      white-space: nowrap;
      overflow: hidden;
      max-width: 0;
      opacity: 0;
      margin-left: 0;
      transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, margin-left 0.35s ease;
      font-weight: 700;
      font-size: 13px;
      letter-spacing: -0.01em;
    }

    .btn-hud-expand:hover {
      padding: 0 16px 0 12px;
      transform: translateY(-1px);
    }

    .btn-hud-expand:hover .hud-btn-text {
      max-width: 150px;
      opacity: 1;
      margin-left: 7px;
    }

    .btn-orbit-expand {
      background: #f5c518 !important;
      color: #000000 !important;
      border: 1.5px solid #f5c518 !important;
      display: inline-flex;
      align-items: center;
      gap: 0;
      transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
      overflow: hidden;
      padding: 0 12px;
      border-radius: 999px;
      height: 42px;
      font-weight: 800;
      box-shadow: 0 4px 14px rgba(245, 197, 24, 0.35);
      cursor: pointer;
    }

    .btn-orbit-expand svg {
      stroke: none !important;
      fill: #000000 !important;
      color: #000000 !important;
      flex-shrink: 0;
      width: 18px;
      height: 18px;
    }

    .btn-orbit-expand svg path {
      stroke: none !important;
      fill: #000000 !important;
    }

    .btn-orbit-expand .orbit-btn-text,
    .btn-orbit-expand .hud-btn-text {
      white-space: nowrap;
      overflow: hidden;
      max-width: 0;
      opacity: 0;
      margin-left: 0;
      transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, margin-left 0.35s ease;
      font-weight: 800;
      font-size: 13px;
      color: #000000;
      letter-spacing: -0.01em;
    }

    .btn-orbit-expand:hover {
      padding: 0 16px 0 12px;
      transform: translateY(-1px);
    }

    .btn-orbit-expand:hover .orbit-btn-text,
    .btn-orbit-expand:hover .hud-btn-text {
      max-width: 170px;
      opacity: 1;
      margin-left: 9px;
    }

    /* When user does NOT have a planet created yet: expanded by default with breathing pulse */
    .btn-orbit-expand.no-planet {
      animation: orbitBreathingPulse 2.2s infinite ease-in-out;
      padding: 0 16px 0 12px;
    }

    .btn-orbit-expand.no-planet .orbit-btn-text,
    .btn-orbit-expand.no-planet .hud-btn-text {
      max-width: 170px;
      opacity: 1;
      margin-left: 9px;
    }

    /* When user ALREADY HAS a planet: collapsed by default, expands on hover */
    .btn-orbit-expand.has-planet {
      padding: 0 12px;
      box-shadow: var(--shadow-soft);
    }

    .btn-orbit-expand.has-planet .orbit-btn-text,
    .btn-orbit-expand.has-planet .hud-btn-text {
      max-width: 0;
      opacity: 0;
      margin-left: 0;
    }

    .btn-orbit-expand.has-planet:hover {
      padding: 0 16px 0 12px;
      transform: translateY(-1px);
      box-shadow: 0 6px 18px rgba(245, 197, 24, 0.45);
    }

    .btn-orbit-expand.has-planet:hover .orbit-btn-text,
    .btn-orbit-expand.has-planet:hover .hud-btn-text {
      max-width: 170px;
      opacity: 1;
      margin-left: 9px;
    }

    @keyframes orbitBreathingPulse {
      0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 197, 24, 0.7), 0 4px 14px rgba(245, 197, 24, 0.35);
      }
      50% {
        transform: scale(1.06);
        box-shadow: 0 0 22px 6px rgba(245, 197, 24, 0.55), 0 8px 24px rgba(245, 197, 24, 0.45);
      }
    }

    /* ==========================================================================
       🪐 FLOATING CUSTOMIZER CARD PANEL (Live 3D in Space)
       ========================================================================== */
    .orbit-customizer-card {
      position: fixed;
      top: 76px;
      right: 24px;
      width: 400px;
      max-height: calc(100vh - 100px);
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 24px;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
      z-index: 1200;
      padding: 24px;
      display: flex;
      flex-direction: column;
      transform: translateX(120%);
      opacity: 0;
      pointer-events: none;
      transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
      overflow-y: auto;
      scrollbar-width: none;
    }

    .orbit-customizer-card::-webkit-scrollbar {
      display: none;
    }

    .orbit-customizer-card.active {
      transform: translateX(0);
      opacity: 1;
      pointer-events: auto;
    }

    @media (max-width: 600px) {
      .orbit-customizer-card {
        right: 12px;
        left: 12px;
        width: auto;
        top: auto;
        bottom: 12px;
        max-height: 80vh;
        transform: translateY(120%);
      }
      .orbit-customizer-card.active {
        transform: translateY(0);
      }
    }

    /* ==========================================================================
       🪐 ORBIT UNIVERSE & VISITOR PLANET CUSTOMIZER MODAL
       ========================================================================== */
    .orbit-modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(5, 5, 8, 0.75);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      z-index: 1200;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      pointer-events: none;
      transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
      padding: 20px;
    }

    .orbit-modal-overlay.active {
      opacity: 1;
      pointer-events: auto;
    }

    .orbit-modal-container {
      width: 100%;
      max-width: 860px;
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 28px;
      box-shadow: var(--shadow-elevated);
      display: grid;
      grid-template-columns: 340px 1fr;
      overflow: hidden;
      max-height: 90vh;
      transform: scale(0.94) translateY(16px);
      transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @media (max-width: 768px) {
      .orbit-modal-container {
        grid-template-columns: 1fr;
        max-height: 95vh;
        overflow-y: auto;
      }
    }

    .orbit-modal-overlay.active .orbit-modal-container {
      transform: scale(1) translateY(0);
    }

    /* Left Preview Column */
    .orbit-preview-col {
      background: var(--soft);
      padding: 24px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      border-right: 1px solid var(--line);
      position: relative;
    }

    .orbit-preview-canvas-box {
      width: 100%;
      height: 320px;
      border-radius: 20px;
      background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.15) 0%, rgba(0, 0, 0, 0.25) 100%);
      overflow: hidden;
      position: relative;
      border: 1px solid var(--line);
    }

    .orbit-preview-canvas {
      width: 100%;
      height: 100%;
      display: block;
    }

    .orbit-preview-tip {
      font-size: 11px;
      font-weight: 600;
      color: var(--muted);
      margin-top: 8px;
      text-align: center;
    }

    .orbit-orbit-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--paper);
      padding: 6px 14px;
      border-radius: 99px;
      font-size: 12px;
      font-weight: 700;
      color: var(--ink);
      border: 1px solid var(--line);
      margin-bottom: 12px;
    }

    /* Right Form Settings Column */
    .orbit-form-col {
      padding: 32px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      overflow-y: auto;
      max-height: 90vh;
    }

    .orbit-form-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      margin-bottom: 20px;
    }

    .orbit-form-title {
      font-size: 22px;
      font-weight: 800;
      letter-spacing: -0.02em;
    }

    .orbit-form-subtitle {
      font-size: 13px;
      color: var(--muted);
      margin-top: 4px;
    }

    .orbit-tabs-nav {
      display: flex;
      gap: 6px;
      background: var(--soft);
      padding: 4px;
      border-radius: 12px;
      margin-bottom: 20px;
      border: 1px solid var(--line);
    }

    .orbit-tab-btn {
      flex: 1;
      background: transparent;
      border: none;
      padding: 8px 12px;
      font-size: 12px;
      font-weight: 700;
      color: var(--muted);
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s ease;
      font-family: inherit;
    }

    .orbit-tab-btn.active {
      background: var(--paper);
      color: var(--ink);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .orbit-tab-panel {
      display: none;
    }

    .orbit-tab-panel.active {
      display: block;
    }

    /* Form Fields */
    .orbit-field {
      margin-bottom: 18px;
    }

    .orbit-label {
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      font-weight: 750;
      margin-bottom: 6px;
      color: var(--ink);
    }

    .orbit-input {
      width: 100%;
      background: var(--soft);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 10px 14px;
      font-family: inherit;
      font-size: 14px;
      color: var(--ink);
      outline: none;
      transition: border-color 0.2s ease;
    }

    .orbit-input:focus {
      border-color: var(--accent-yellow);
    }

    .orbit-textarea {
      min-height: 80px;
      resize: vertical;
    }

    .orbit-chips-group {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .orbit-chip-btn {
      background: var(--soft);
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 6px 12px;
      font-size: 12px;
      font-weight: 650;
      color: var(--ink);
      cursor: pointer;
      transition: all 0.2s ease;
      font-family: inherit;
    }

    .orbit-chip-btn.active {
      background: var(--ink);
      color: var(--paper);
      border-color: var(--ink);
    }

    .orbit-color-swatches {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .orbit-color-circle {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      cursor: pointer;
      border: 2px solid transparent;
      transition: transform 0.2s ease, border-color 0.2s ease;
    }

    .orbit-inline-row {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    .orbit-color-swatches.inline-swatches {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 4px 8px;
      background: var(--soft);
      border-radius: 12px;
      border: 1px solid var(--line);
    }

    .orbit-actions {
      display: flex;
      gap: 10px;
      margin-top: 24px;
      padding-top: 16px;
      border-top: 1px solid var(--line);
    }

    .orbit-btn-cancel {
      flex: 0 0 95px;
      background: var(--soft);
      color: var(--ink);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 12px 14px;
      font-size: 13px;
      font-weight: 750;
      cursor: pointer;
      transition: all 0.2s ease;
      font-family: inherit;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    .orbit-btn-cancel:hover {
      background: rgba(255, 68, 68, 0.12);
      color: #ff3b30;
      border-color: rgba(255, 68, 68, 0.35);
      transform: translateY(-1px);
    }

    .orbit-btn-launch {
      flex: 1;
      background: #000000;
      color: #ffffff;
      border: none;
      border-radius: 14px;
      padding: 12px 20px;
      font-size: 14px;
      font-weight: 800;
      cursor: pointer;
      transition: all 0.2s ease;
      font-family: inherit;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }

    html[data-theme="dark"] .orbit-btn-launch {
      background: #f5c518;
      color: #000000;
    }

    .orbit-btn-launch:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }

    /* ==========================================================================
       🪐 PLANET INSPECTION SIDE CARD (Matches Studio & Customizer Card Look)
       ========================================================================== */
    .planet-inspect-card {
      position: fixed;
      top: 76px;
      right: 24px;
      width: 380px;
      max-height: calc(100vh - 100px);
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 24px;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
      z-index: 1200;
      padding: 24px;
      display: flex;
      flex-direction: column;
      gap: 16px;
      transform: translateX(120%);
      opacity: 0;
      pointer-events: none;
      transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
      overflow-y: auto;
      scrollbar-width: none;
    }

    .planet-inspect-card::-webkit-scrollbar {
      display: none;
    }

    .planet-inspect-card.active {
      transform: translateX(0);
      opacity: 1;
      pointer-events: auto;
    }

    @media (max-width: 600px) {
      .planet-inspect-card {
        right: 12px;
        left: 12px;
        width: auto;
        top: auto;
        bottom: 12px;
        max-height: 80vh;
        transform: translateY(120%);
      }
      .planet-inspect-card.active {
        transform: translateY(0);
      }
    }

    .planet-inspect-avatar {
      width: 44px;
      height: 44px;
      border-radius: 14px;
      background: var(--soft);
      border: 1px solid var(--line);
      display: grid;
      place-items: center;
      font-size: 22px;
      flex-shrink: 0;
    }

    .planet-inspect-quote-box {
      background: var(--soft);
      border: 1px solid var(--line);
      border-radius: 16px;
      padding: 16px 18px;
      position: relative;
      margin-bottom: 10px;
    }

    .planet-quote-mark {
      display: none; /* removed — quote rendered via CSS ::before on the paragraph */
    }

    .planet-inspect-card .planet-card-msg {
      font-size: 13.5px;
      line-height: 1.6;
      font-style: italic;
      color: var(--ink);
      max-width: 100%;
      white-space: normal;
      word-break: break-word;
      margin: 0;
    }

    .planet-inspect-card .planet-card-msg::before {
      content: '\201C';
      font-size: 20px;
      line-height: 1;
      font-family: Georgia, serif;
      color: var(--accent-yellow);
      margin-right: 3px;
      vertical-align: -3px;
    }

    .planet-inspect-meta {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-bottom: 10px;
    }

    .planet-meta-item {
      background: var(--soft);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 10px 14px;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .planet-meta-label {
      display: flex;
      align-items: center;
      gap: 5px;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: var(--muted);
    }

    .planet-meta-label .ui-icon {
      flex-shrink: 0;
    }

    .planet-meta-val {
      font-size: 13px;
      font-weight: 800;
      color: var(--ink);
    }

    .planet-inspect-actions {
      display: flex;
      gap: 8px;
      margin-top: 6px;
      padding-top: 14px;
      border-top: 1px solid var(--line);
    }