/* ============================================================
   Gang Sheet Builder v2 — Styles
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

.gsb-app {
    position: relative;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    color: #222;
    background: #1a1a2e;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
    height: 780px;
    box-shadow: 0 4px 24px rgba(0,0,0,.35);
}

/* ── Top bar ─────────────────────────────────────────────── */
.gsb-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: #0f0f1f;
    border-bottom: 1px solid #2a2a4a;
    flex-shrink: 0;
    flex-wrap: wrap;
    min-height: 48px;
}
.gsb-topbar-left, .gsb-topbar-center, .gsb-topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}
.gsb-topbar-left  { margin-right: 8px; }
.gsb-topbar-right { margin-left: auto; }

.gsb-qty-wrap { display: flex; align-items: center; gap: 6px; color: #ccc; font-size: 12px; }
.gsb-qty-spin { display: flex; align-items: center; border: 1px solid #444; border-radius: 4px; overflow: hidden; background:#222; }
.gsb-qty-spin input { width: 44px; text-align: center; background: transparent; border: none; color: #fff; font-size: 13px; padding: 3px 2px; }
.gsb-qty-spin input:focus { outline: none; }
.gsb-qty-btn { background: #333; border: none; color: #ccc; width: 22px; cursor: pointer; font-size: 10px; line-height: 1; padding: 4px 0; }
.gsb-qty-btn:hover { background: #444; }

.gsb-sel {
    background: #222;
    color: #eee;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    cursor: pointer;
}

.gsb-bar-btn {
    background: #2a2a44;
    color: #ccc;
    border: 1px solid #3a3a5a;
    border-radius: 4px;
    padding: 4px 9px;
    cursor: pointer;
    font-size: 13px;
    transition: background .12s;
    white-space: nowrap;
}
.gsb-bar-btn:hover     { background: #3a3a5a; color: #fff; }
.gsb-bar-btn.gsb-active { background: #6c47ff; border-color: #6c47ff; color: #fff; }

.gsb-toggle-btn.gsb-active { background: #6c47ff; border-color: #5a35e0; color: #fff; }

.gsb-margin-label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #bbb;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.gsb-margin-label input[type="checkbox"] { cursor: pointer; }
.gsb-margin-num {
    width: 52px;
    text-align: center;
    background: #222;
    border: 1px solid #444;
    border-radius: 4px;
    color: #eee;
    padding: 3px 4px;
    font-size: 12px;
}

.gsb-zoom-row { display: flex; align-items: center; gap: 4px; }
#gsb-zoom-pct { color: #bbb; font-size: 12px; min-width: 36px; text-align: center; }

.gsb-autonest-btn {
    background: #e86020;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 5px 13px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: background .12s;
}
.gsb-autonest-btn:hover { background: #c94e10; }
.gsb-autofill-btn { background: #1a7a3a; }
.gsb-autofill-btn:hover { background: #145c2b; }

/* ── Remove Background button ───────────────────────────── */
.gsb-rembg-btn {
    width: 100%;
    background: linear-gradient(135deg, #0ea5e9, #6c47ff);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: opacity .15s, transform .1s;
}
.gsb-rembg-btn:hover  { opacity: .88; }
.gsb-rembg-btn:active { transform: scale(.97); }

/* ── Upscale panel ───────────────────────────────────────── */
.gsb-upscale-head {
    font-size: 11px;
    font-weight: 700;
    color: #555;
    margin-bottom: 7px;
}
.gsb-upscale-btns {
    display: flex;
    gap: 6px;
}
.gsb-upscale-btn {
    flex: 1;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    transition: opacity .15s, transform .1s;
}
.gsb-upscale-btn small { display:block; font-size:10px; font-weight:400; opacity:.85; }
.gsb-upscale-btn:hover  { opacity: .88; }
.gsb-upscale-btn:active { transform: scale(.97); }
.gsb-upscale-hint {
    font-size: 10px;
    color: #aaa;
    margin: 5px 0 0;
    line-height: 1.4;
}

/* ── Right-click context menu ────────────────────────────── */
.gsb-ctx-menu {
    position: fixed;
    z-index: 9999999;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
    padding: 4px 0;
    min-width: 210px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
}
.gsb-ctx-item {
    padding: 9px 16px;
    cursor: pointer;
    color: #222;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background .1s;
}
.gsb-ctx-item:hover  { background: #f3efff; color: #6c47ff; }
.gsb-ctx-danger       { color: #cc0000; }
.gsb-ctx-danger:hover { background: #fff0f0; color: #aa0000; }
.gsb-ctx-sep {
    height: 1px;
    background: #eee;
    margin: 3px 0;
}

.gsb-action-btn {
    background: #2a2a44;
    color: #ddd;
    border: 1px solid #3a3a60;
    border-radius: 5px;
    padding: 5px 13px;
    cursor: pointer;
    font-size: 13px;
    transition: background .12s;
}
.gsb-action-btn:hover { background: #3a3a60; }
.gsb-action-primary   { background: #3a5acc; border-color: #3a5acc; color: #fff; }
.gsb-action-primary:hover { background: #2a4ab0; }

/* ── Body ────────────────────────────────────────────────── */
.gsb-body {
    display: flex;
    flex: 1;
    min-height: 0; /* allow flex children to shrink below content size */
    overflow: hidden;
}

/* ── Left icon nav ───────────────────────────────────────── */
.gsb-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 0;
    background: #12122a;
    width: 64px;
    flex-shrink: 0;
    border-right: 1px solid #2a2a44;
}
.gsb-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 52px;
    padding: 8px 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #888;
    cursor: pointer;
    transition: all .12s;
    line-height: 1;
}
.gsb-nav-btn:hover  { background: #2a2a44; color: #ccc; }
.gsb-nav-btn.active { background: #2a2a44; border-color: #4a4a6a; color: #fff; }
.gsb-nav-icon { font-size: 18px; display: block; }
.gsb-nav-lbl  { font-size: 9px; display: block; text-align: center; white-space: nowrap; }

/* ── Left panel ──────────────────────────────────────────── */
.gsb-panel {
    width: 220px;
    flex-shrink: 0;
    background: #1e1e38;
    border-right: 1px solid #2a2a44;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.gsb-tab { padding: 10px; display: flex; flex-direction: column; gap: 8px; }

/* Drop zone */
.gsb-dropzone {
    border: 2px dashed #3a3a5a;
    border-radius: 8px;
    padding: 16px 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.gsb-dropzone.gsb-dz-over,
.gsb-dropzone:hover { border-color: #6c47ff; background: rgba(108,71,255,.1); }
.gsb-dz-title { color: #bbb; font-size: 12px; margin: 0 0 8px; }
.gsb-upload-btn {
    background: #3a3a5a;
    color: #eee;
    border: 1px solid #5a5a7a;
    border-radius: 5px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 13px;
    transition: background .12s;
    width: 100%;
}
.gsb-upload-btn:hover { background: #5a5a7a; }
.gsb-dz-hint { color: #666; font-size: 10px; margin: 6px 0 0; line-height: 1.5; }

/* Add text */
.gsb-add-text-btn {
    width: 100%;
    background: #2a2a44;
    color: #ccc;
    border: 1px solid #3a3a5a;
    border-radius: 5px;
    padding: 7px;
    cursor: pointer;
    font-size: 13px;
    text-align: center;
    transition: background .12s;
}
.gsb-add-text-btn:hover { background: #3a3a5a; color: #fff; }

/* Thumbnails */
.gsb-thumbs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.gsb-thumb {
    position: relative;
    background: #2a2a44;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 1/1;
    border: 2px solid transparent;
    transition: border-color .15s;
    cursor: pointer;
}
.gsb-thumb:hover { border-color: #6c47ff; }
.gsb-thumb img { width:100%; height:100%; object-fit:contain; display:block; }
.gsb-th-count {
    position: absolute;
    bottom: 2px; right: 3px;
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
}
.gsb-th-del {
    position: absolute;
    top: 2px; right: 2px;
    background: rgba(0,0,0,.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 16px; height: 16px;
    font-size: 9px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.gsb-thumb:hover .gsb-th-del { display: flex; }
.gsb-thumb-spin { display:flex; align-items:center; justify-content:center; }
.gsb-mini-spin  { width:22px;height:22px; border:3px solid #444; border-top-color:#6c47ff; border-radius:50%; animation:gsb-spin .7s linear infinite; }

/* Settings tab */
.gsb-settings { display:flex; flex-direction:column; gap:10px; }
.gsb-chk-row  { display:flex; align-items:center; gap:8px; color:#ccc; cursor:pointer; font-size:12px; }
.gsb-legend   { display:flex; flex-direction:column; gap:6px; margin-top:6px; }
.gsb-legend-row { display:flex; align-items:center; gap:8px; color:#bbb; font-size:11px; }
.gsb-dot { width:12px; height:12px; border-radius:50%; display:inline-block; flex-shrink:0; }

/* ── Canvas column ───────────────────────────────────────── */
.gsb-canvas-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #ccc;
    overflow: hidden;
}
.gsb-ruler-row {
    display: flex;
    flex-shrink: 0;
    height: 20px;
}
.gsb-ruler-corner {
    width: 20px;
    height: 20px;
    background: #e0e0e0;
    flex-shrink: 0;
    border-right: 1px solid #bbb;
    border-bottom: 1px solid #bbb;
}
.gsb-ruler-h {
    flex: 1;
    height: 20px;
    display: block;
    background: #e0e0e0;
    border-bottom: 1px solid #bbb;
}
.gsb-canvas-row {
    flex: 1;
    display: flex;
    overflow: hidden;
}
.gsb-ruler-v {
    width: 20px;
    flex-shrink: 0;
    display: block;
    background: #e0e0e0;
    border-right: 1px solid #bbb;
}
.gsb-canvas-scroll {
    flex: 1;
    overflow: auto;
    background: #b0b0b0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 14px;
}
.gsb-canvas-outer {
    position: relative;
    display: inline-block;
    box-shadow: 0 2px 20px rgba(0,0,0,.4);
    flex-shrink: 0;
    overflow: visible;
}
.gsb-canvas-outer canvas#gsb-canvas {
    display: block;
}
.gsb-grid-canvas {
    position: absolute;
    top: 0; left: 0;
    pointer-events: none;
}

/* ── Right panel ─────────────────────────────────────────── */
.gsb-right {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden; /* children scroll themselves */
}

/* Top section: always visible (sheet card + actions) */
.gsb-right-static {
    flex-shrink: 0;
    overflow-y: auto;
    max-height: 50%; /* give half the panel to the static top */
    border-bottom: 2px solid #e8e8e8;
}

/* Bottom section: selected image props — scrolls independently */
.gsb-obj-props-wrap {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.gsb-right-head {
    padding: 10px 14px 8px;
    font-weight: 700;
    font-size: 12px;
    border-bottom: 1px solid #eee;
    background: #f8f8f8;
    letter-spacing: .2px;
}

/* Sheet card */
.gsb-sheet-card {
    margin: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    background: #fafafa;
}
.gsb-sc-top { display:flex; align-items:center; gap:6px; font-weight:600; font-size:13px; margin-bottom:6px; }
.gsb-sc-icon { font-size:16px; }
.gsb-sc-name-row { display:flex; align-items:center; gap:6px; margin-bottom:4px; }
#gsb-sc-name { font-size:13px; flex:1; outline:none; border-bottom:1px dashed transparent; transition: border-color .15s; }
#gsb-sc-name:focus { border-bottom-color:#6c47ff; }
.gsb-sc-edit { color:#bbb; cursor:pointer; font-size:13px; }
.gsb-sc-count { color:#888; font-size:12px; margin-bottom:10px; }
.gsb-sc-qty { display:flex; align-items:center; gap:8px; font-size:12px; }
.gsb-sc-qty-input { width:44px; text-align:center; border:1px solid #ddd; border-radius:4px; padding:3px; font-size:12px; }
.gsb-dup-btn {
    margin-left:auto;
    background:#f0f0f0;
    border:1px solid #ddd;
    border-radius:5px;
    padding:3px 10px;
    cursor:pointer;
    font-size:12px;
    transition:background .12s;
}
.gsb-dup-btn:hover { background:#e0e0e0; }

/* Right actions */
.gsb-right-actions { display:flex; flex-direction:column; gap:2px; padding:0 12px 12px; }
.gsb-ra-btn {
    background: transparent;
    border: none;
    text-align: left;
    padding: 8px 4px;
    cursor: pointer;
    color: #333;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
    transition: color .12s;
}
.gsb-ra-btn:hover   { color: #6c47ff; }
.gsb-ra-danger       { color: #cc0000; }
.gsb-ra-danger:hover { color: #990000; }

/* Object properties */
.gsb-obj-props {
    margin: 10px 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    background: #fafafa;
}
.gsb-obj-props-head { font-weight:600; font-size:12px; margin-bottom:8px; color:#555; }
.gsb-dpi-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
    background: #888;
}
.gsb-obj-btns { display:flex; flex-wrap:wrap; gap:5px; }
.gsb-ob {
    flex: 1 1 calc(50% - 3px);
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 4px;
    cursor: pointer;
    font-size: 11px;
    transition: background .12s;
    text-align: center;
    white-space: nowrap;
}
.gsb-ob:hover { background: #e0e0e0; }
.gsb-ob-full  { flex: 1 1 100%; }
.gsb-ob-green { background:#e8f5e9; color:#1a7a3a; border-color:#b2dfdb; }
.gsb-ob-green:hover { background:#c8e6c9; }
.gsb-ob-red   { background:#fdecea; color:#c62828; border-color:#ffcdd2; }
.gsb-ob-red:hover   { background:#ffcdd2; }

/* ── Properties panel blocks ─────────────────────────────── */
.gsb-prop-block {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.gsb-prop-block:last-child { border-bottom: none; margin-bottom: 0; }

/* W / H dimension row */
.gsb-prop-dims {
    display: flex;
    align-items: center;
    gap: 4px;
}
.gsb-prop-field {
    display: flex;
    align-items: center;
    gap: 3px;
    flex: 1;
    min-width: 0;
}
.gsb-prop-field label {
    font-size: 10px;
    font-weight: 700;
    color: #888;
    flex-shrink: 0;
}
.gsb-prop-field input[type="number"] {
    min-width: 0;
    width: 100%;
    padding: 4px 4px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 12px;
    text-align: center;
}
.gsb-prop-field input[type="number"]:focus {
    outline: none;
    border-color: #6c47ff;
    box-shadow: 0 0 0 2px rgba(108,71,255,.12);
}
.gsb-prop-field span {
    font-size: 10px;
    color: #aaa;
    flex-shrink: 0;
}

/* Lock button */
.gsb-lock-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .12s, border-color .12s;
    padding: 0;
}
.gsb-lock-btn.locked  { background: #efe8ff; border-color: #6c47ff; }
.gsb-lock-btn:hover   { border-color: #6c47ff; }

/* Quantity row */
.gsb-prop-qty-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.gsb-prop-qty-row label {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    flex-shrink: 0;
}
.gsb-prop-qty-input {
    width: 56px;
    padding: 5px 6px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 12px;
    text-align: center;
}
.gsb-prop-add-btn {
    flex: 1;
    background: #6c47ff;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background .12s;
}
.gsb-prop-add-btn:hover { background: #5535e0; }

/* ── Loading ─────────────────────────────────────────────── */
.gsb-loading {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gsb-loading-box {
    background: #fff;
    border-radius: 12px;
    padding: 32px 44px;
    text-align: center;
    box-shadow: 0 6px 40px rgba(0,0,0,.4);
}
.gsb-spinner {
    width: 40px; height: 40px;
    border: 5px solid #eee;
    border-top-color: #6c47ff;
    border-radius: 50%;
    animation: gsb-spin .75s linear infinite;
    margin: 0 auto 14px;
}
.gsb-loading-box p { margin:0; color:#444; font-size:14px; }

@keyframes gsb-spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   PRODUCT PAGE WIDGET (shown on WooCommerce product page)
══════════════════════════════════════════════════════════ */
.gsb-product-widget {
    margin-top: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.gsb-pw-divider {
    border-top: 1px solid #e5e5e5;
    margin-bottom: 18px;
}

/* Drop zone */
.gsb-pw-dropzone {
    border: 2px dashed #c0c0c0;
    border-radius: 10px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: #fafafa;
    margin-bottom: 12px;
}
.gsb-pw-dropzone.gsb-pw-over,
.gsb-pw-dropzone:hover {
    border-color: #e86020;
    background: #fff7f3;
}
.gsb-pw-dz-inner { pointer-events: none; }
.gsb-pw-dz-icon  { font-size: 32px; display: block; margin-bottom: 8px; }
.gsb-pw-dz-title { font-size: 14px; font-weight: 600; color: #333; margin: 0 0 4px; }
.gsb-pw-dz-hint  { font-size: 12px; color: #999; margin: 0; }

/* Uploaded file list */
.gsb-pw-file-list { margin-bottom: 12px; }
.gsb-pw-file-row  {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #f5f5f5;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 12px;
    color: #444;
}
.gsb-pw-fname   { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsb-pw-fstatus { flex-shrink: 0; margin-left: 8px; font-weight: 600; color: #888; }

/* "Créer mon design" button */
.gsb-pw-create-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: #e86020;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, transform .1s;
    letter-spacing: .3px;
}
.gsb-pw-create-btn:hover  { background: #c94e10; }
.gsb-pw-create-btn:active { transform: scale(.98); }
.gsb-pw-arrow { font-size: 20px; }
.gsb-pw-badge {
    background: #fff;
    color: #e86020;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ══════════════════════════════════════════════════════════
   FULL-SCREEN OVERLAY  (the builder modal)
══════════════════════════════════════════════════════════ */
body.gsb-body-lock { overflow: hidden; }

.gsb-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    background: #1a1a2e;
}

.gsb-overlay-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: #0f0f1f;
    border-bottom: 1px solid #2a2a4a;
    flex-shrink: 0;
}
.gsb-overlay-title {
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.gsb-overlay-close {
    background: #3a1a1a;
    color: #ff6666;
    border: 1px solid #5a2a2a;
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background .12s;
}
.gsb-overlay-close:hover { background: #5a2a2a; }

.gsb-overlay-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Builder app inside the overlay — fill remaining space, no fixed height */
.gsb-overlay-body .gsb-app {
    flex: 1;
    border-radius: 0;
    margin: 0;
    height: auto;   /* override the 780px fixed height */
    min-height: 0;
    box-shadow: none;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .gsb-app    { height: auto; min-height: 600px; }
    .gsb-body   { flex-direction: column; }
    .gsb-nav    { flex-direction: row; width: 100%; height: auto; }
    .gsb-panel  { width: 100%; max-height: 200px; }
    .gsb-right  { width: 100%; border-left: none; border-top: 1px solid #ddd; }
}

/* ── AI Generate panel ───────────────────────────────────── */
.gsb-ai-gen {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 10px;
}
.gsb-ai-gen-hint {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}
.gsb-ai-prompt {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color 0.2s;
}
.gsb-ai-prompt:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124,58,237,.15);
}
.gsb-ai-gen-btn {
    width: 100%;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.gsb-ai-gen-btn:hover { opacity: 0.88; }
.gsb-ai-gen-btn:active { opacity: 0.75; }
.gsb-ai-result {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.gsb-ai-result img {
    width: 100%;
    border-radius: 6px;
    border: 1px solid #ddd;
    display: block;
}
.gsb-ai-add-btn {
    width: 100%;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.gsb-ai-add-btn:hover { opacity: 0.88; }
.gsb-ai-error {
    font-size: 12px;
    color: #cc0000;
    background: #fff0f0;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    padding: 6px 8px;
    margin: 0;
}
