    * { box-sizing: border-box; }
    html, body { height: 100%; }
    body {
      margin: 0; font-family: system-ui, Arial, sans-serif; background: #111; color: #eee;
      display: flex; flex-direction: column;
    }
    .toolbar {
      display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
      padding: 10px 16px; background: #1e1e1e; border-bottom: 1px solid #333;
    }
    .toolbar input[type="text"] {
      flex: 1 1 300px; padding: 8px 10px; border-radius: 6px;
      border: 1px solid #444; background: #2a2a2a; color: #eee;
    }
    .toolbar button, .toolbar label.btn {
      padding: 8px 14px; border: 0; border-radius: 6px; cursor: pointer;
      background: #2f7cf6; color: #fff; font-size: 14px;
    }
    .toolbar button.nav { background: #444; }
    .toolbar label.btn { background: #3a9d5d; }
    .toolbar input[type="file"] { display: none; }
    .open-form { display: contents; }
    body.has-image .open-form { display: none; }
    #status { font-size: 13px; color: #aaa; }

    .stage { position: relative; flex: 1 1 auto; min-height: 0; }
    #panorama { width: 100%; height: 100%; }
    #drop-hint {
      position: absolute; inset: 0; display: flex; align-items: center; text-align: center;
      justify-content: center; color: #777; pointer-events: none; font-size: 18px; padding: 16px;
    }
    body.dragover #panorama { outline: 3px dashed #2f7cf6; outline-offset: -6px; }

    /* Dải ảnh trong thư mục "file" */
    .gallery {
      flex: 0 0 auto; display: flex; gap: 8px; overflow-x: auto;
      padding: 8px 16px; background: #1a1a1a; border-top: 1px solid #333;
    }
    .gallery .empty { color: #888; font-size: 14px; padding: 8px 0; }
    .thumb {
      flex: 0 0 auto; width: 80px; cursor: pointer; border: 2px solid transparent;
      border-radius: 6px; background: #222; overflow: hidden; padding: 0; color: inherit;
      font: inherit; text-align: left;
    }
    .thumb img { display: block; width: 100%; height: 40px; object-fit: cover; }
    .thumb span {
      display: block; font-size: 10px; padding: 2px 4px;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .thumb:hover { border-color: #555; }
    .thumb.active { border-color: #2f7cf6; }