 /* ====== Global layout ================================================= */
    *{margin:0;padding:0;box-sizing:border-box}
    html,body{width:100%;height:100%}
    body{font-family:sans-serif;background:#000;display:flex}

    /* Split-pane flexbox --------------------------------------------------- */
    #viewer  {flex:2 1 0%;min-width:0;min-height:0;height:100%}  /* 66 ⅔ % */
    #controlPanel{flex:1 1 0%;min-width:0;height:100%;overflow-y:auto;
      background:#1e1e28;color:#fff;border-left:1px solid rgba(255,255,255,.2)}

    /* 3-D view overlay elements ------------------------------------------- */
    #dragOverlay{position:fixed;top:0;left:0;width:100vw;height:100vh;
      background:rgba(79,195,247,.2);backdrop-filter:blur(4px);z-index:200;
      display:none;align-items:center;justify-content:center;color:#fff;
      font-size:24px;font-weight:bold;text-align:center;
      border:4px dashed rgba(79,195,247,.8)}

    /* Control panel internals --------------------------------------------- */
    #panelHeader{background:rgba(50,50,60,.9);padding:12px 16px;
      border-bottom:1px solid rgba(255,255,255,.1);display:flex;
      justify-content:space-between;align-items:center}
    #panelTitle{font-weight:bold;font-size:14px}
    #toggleButton{background:none;border:none;color:#fff;font-size:18px;
      cursor:pointer;width:24px;height:24px;display:flex;align-items:center;
      justify-content:center;border-radius:4px;transition:background .2s}
    #toggleButton:hover{background:rgba(255,255,255,.1)}
    #panelContent{padding:16px;display:grid;grid-template-columns:1fr 1fr;gap:16px}
    #panelContent.collapsed{display:none}

    /* Content boxes -------------------------------------------------------- */
    .config,.uploader{padding:12px;border:1px solid rgba(255,255,255,.1);
      border-radius:8px;background:rgba(0,0,0,.2)}
    .config h2{margin-bottom:12px;font-size:16px;color:#4fc3f7}
    .config label{display:block;margin-bottom:8px;font-size:12px;color:#e0e0e0}
    .config input,.config select,.config textarea{width:100%;padding:6px 8px;
      margin-top:4px;background:rgba(255,255,255,.1);
      border:1px solid rgba(255,255,255,.2);border-radius:4px;color:#fff;
      font-size:12px;font-family:inherit}
    .config textarea{resize:vertical;min-height:90px}
    .config select option{color:#000;background:#fff}
    .config input[type="checkbox"]{width:auto;margin-right:8px;margin-top:0}
    .config input:focus,.config select:focus,.config textarea:focus{outline:none;
      border-color:#4fc3f7;box-shadow:0 0 0 2px rgba(79,195,247,.3)}

    /* File buttons -------------------------------------------------------- */
    #fileInput{width:100%;padding:8px;background:rgba(255,255,255,.1);
      border:1px solid rgba(255,255,255,.2);border-radius:4px;color:#fff;
      font-size:12px;margin-bottom:12px}
    #sendButton,#downloadButton{padding:8px 16px;font-size:12px;border:none;
      border-radius:6px;background:linear-gradient(135deg,#4fc3f7,#29b6f6);
      color:#fff;cursor:pointer;margin-right:8px;margin-bottom:8px;
      transition:all .2s}
    #sendButton:hover,#downloadButton:hover{background:linear-gradient(135deg,#29b6f6,#0288d1);transform:translateY(-1px)}
    #sendButton:disabled,#downloadButton:disabled{background:#555;cursor:not-allowed;transform:none}
    #downloadButton{display:none;background:linear-gradient(135deg,#66bb6a,#4caf50)}
    #downloadButton:hover{background:linear-gradient(135deg,#4caf50,#388e3c)}

    #status{font-style:italic;font-size:11px;color:#b0bec5;margin-top:8px;line-height:1.4;grid-column:1 / -1}
    #progressWrapper{margin-top:8px;height:6px;grid-column:1 / -1}
    #progressBar{width:100%;height:100%;appearance:none;-webkit-appearance:none;
      border:none;border-radius:3px;background:rgba(255,255,255,.1)}
    #progressBar::-webkit-progress-bar{background:rgba(255,255,255,.1);border-radius:3px}
    #progressBar::-webkit-progress-value{background:linear-gradient(90deg,#4fc3f7,#29b6f6);border-radius:3px}
    #progressBar::-moz-progress-bar{background:linear-gradient(90deg,#4fc3f7,#29b6f6);border-radius:3px}

    /* Color-map table ----------------------------------------------------- */
    #colorMapTable{width:100%;border-collapse:collapse;margin-top:8px}
    #colorMapTable th,#colorMapTable td{padding:4px}
    #colorMapTable th{text-align:left}

    .color-stop-row{display:flex;flex-direction:column;gap:4px;margin-bottom:8px;user-select:none}
    .stop-header{display:flex;align-items:center;gap:8px;cursor:move}
    .stop-header button{margin-left:auto}
    .color-stop-row input[type="range"]{width:100%}
    #addColorStop{margin-top:8px}

    /* Responsive breakpoint ---------------------------------------------- */
    @media(max-width:768px){
      body{flex-direction:column}
      #viewer{flex:none;width:100%;height:60vh}
      #controlPanel{flex:none;width:100%;height:40vh}
      #panelContent{grid-template-columns:1fr}
    }