
    .sg-wrapper {
        --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
        --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
        display: flex;
        justify-content: center;
        padding: clamp(0px, 5vw, 0px) 20px;
    }

    .sg-panel {
        position: relative;                
        width: 100%;
        max-width: 1400px;
        border-radius: 28px;
        padding: clamp(28px, 5vw, 56px);
    }
    
    #bgCanvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.5; z-index: 0; }
    .sg-content { position: relative; z-index: 1; }

    /* ---------- START BUTTON ---------- */
    .search-box-start { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 20px; padding: 12px; display: flex; flex-direction: column; gap: 12px; max-width: 600px; margin: 0 auto; position: relative; z-index: 10; box-shadow: 0 12px 30px rgba(0,0,0,0.03); transition: all 0.3s; align-items: center; justify-content: center; }
    .search-btn { height: 60px; border-radius: 14px; width: 100%; border: none; color: #fff; background: linear-gradient(135deg, var(--primary-color), var(--primary-gradient-end)); font-size: 16px; font-weight: 800; cursor: pointer; transition: all 0.25s var(--ease-out); display: flex; align-items: center; justify-content: center; gap: 8px; position: relative; overflow: hidden; }
    .search-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 22px var(--primary-shadow); }
    .search-btn:disabled { opacity: 0.5; cursor: not-allowed; }

    /* ---------- LOADING STATE ---------- */
    .sg-loading { text-align: center; padding: 40px 0; }
    .sg-orb { width: 80px; height: 80px; border-radius: 50%; background: var(--bg-body); border: 2px solid var(--primary-light); margin: 0 auto 24px auto; display: flex; align-items: center; justify-content: center; color: var(--primary-color); font-size: 32px; box-shadow: 0 0 0 16px var(--primary-light); transition: all 0.3s; animation: pulse 2s infinite ease-in-out; }
    
    .sg-thinking-log { list-style: none; margin: 0; padding: 0 10px; display: flex; flex-direction: column; gap: 12px; max-width: 400px; margin: 0 auto; }
    .sg-thinking-log li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; color: var(--text-muted); animation: slideInUp 0.4s ease forwards; }
    .sg-thinking-log li.active { color: var(--text-main); font-weight: 700; }
    .sg-thinking-log li.done { color: var(--text-muted); opacity: 0.6; }
    .sg-log-dot { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-color); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
    .sg-thinking-log li.active .sg-log-dot { border-color: var(--primary-color); color: var(--primary-color); }
    .sg-thinking-log li.done .sg-log-dot { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }

    /* ---------- RESULTS DASHBOARD ---------- */
    .sg-result { animation: fadeIn 0.5s ease; }
    .sg-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 30px; flex-wrap: wrap; }
    .sg-btn-ghost { background: transparent; border: 1px solid var(--border-color); border-radius: 10px; padding: 8px 16px; font-size: 13.5px; font-weight: 700; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s; }
    .sg-btn-ghost:hover { border-color: var(--primary-color); color: var(--primary-color); }

    /* Stats Strip */
    .stats-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 30px; }
    .sc { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 12px; position: relative; overflow: hidden; }
    .sc::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent); pointer-events: none; }
    .sc-lbl { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--text-muted); position: relative; z-index: 1; }
    .sc-val { font-size: 28px; font-weight: 900; color: var(--text-main); font-family: 'Space Mono', monospace; line-height: 1; position: relative; z-index: 1; }
    .text-emerald-500 { color: #10b981 !important; }

    /* Workspace Grid */
    .workspace-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
    @media (min-width: 1100px) { .workspace-grid { grid-template-columns: 1fr 1fr; } }
    
    /* Workspace Panel */
    .ws-panel { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; height: 100%; min-height: 700px; }
    .panel-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
    .panel-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border-color); background: var(--bg-body); flex-wrap: wrap; gap: 12px; }
    .panel-title { font-size: 16px; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 8px; margin: 0; }

    /* Tabs */
    .tabs-header { display: flex; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--border-color); overflow-x: auto; background: var(--bg-body); }
    .tab-btn { background: var(--card-bg); border: 1px solid var(--border-color); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 700; color: var(--text-muted); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 8px; transition: 0.2s; }
    .tab-btn:hover { border-color: var(--primary-color); color: var(--text-main); }
    .tab-btn.active { background: var(--primary-color); border-color: var(--primary-color); color: white; box-shadow: 0 4px 12px var(--primary-shadow); }

    /* Forms */
    .input-group { margin-bottom: 20px; }
    .ig-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
    .ig-label { font-size: 14px; font-weight: 700; color: var(--text-main); }
    .ig-req { color: #ef4444; font-weight: 900; margin-left: 4px; }
    .c-input { width: 100%; padding: 14px 16px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 12px; font-size: 15px; color: var(--text-main); transition: 0.2s; }
    .c-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 4px var(--primary-light); }
    textarea.c-input { min-height: 100px; resize: vertical; }

    /* Custom Dropdown */
    .custom-dropdown { position: relative; width: 100%; }
    .cd-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 12px; cursor: pointer; transition: 0.2s; user-select: none; }
    .cd-header:hover { border-color: var(--primary-color); }
    .custom-dropdown.active .cd-header { border-color: var(--primary-color); box-shadow: 0 0 0 4px var(--primary-light); }
    .cd-value { font-size: 15px; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cd-body { display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); z-index: 50; overflow: hidden; animation: fadeIn 0.2s ease; }
    .custom-dropdown.active .cd-body { display: block; }
    .cd-list { max-height: 220px; overflow-y: auto; padding: 6px; }
    .cd-item { padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--text-main); border-radius: 8px; cursor: pointer; transition: 0.15s; }
    .cd-item:hover { background: var(--primary-light); color: var(--primary-color); }
    .cd-item.active { background: var(--primary-color); color: #fff; font-weight: 700; }

    /* FAQ Box */
    .faq-item { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 16px; padding: 20px; margin-bottom: 16px; position: relative; }
    .faq-remove { position: absolute; top: 16px; right: 16px; background: rgba(239, 68, 68, 0.1); color: #ef4444; border: none; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
    .faq-remove:hover { background: #ef4444; color: white; }

    /* Template Tags */
    .template-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 24px; }
    .tmpl-tag { background: rgba(59, 130, 246, 0.1); color: #3b82f6; border: 1px dashed rgba(59, 130, 246, 0.3); padding: 6px 12px; border-radius: 100px; font-size: 12px; font-weight: 800; cursor: pointer; transition: 0.2s; }
    .tmpl-tag:hover { background: #3b82f6; color: white; border-style: solid; }

    /* Code Box Output */
    .code-box-wrapper { flex: 1; background: #0f172a; position: relative; overflow: hidden; display: flex; flex-direction: column; }
    .code-box { padding: 24px; font-family: 'Space Mono', monospace; font-size: 14px; line-height: 1.6; color: #e2e8f0; overflow-y: auto; overflow-x: auto; flex: 1; white-space: pre-wrap; word-break: break-all; }
    
    .h-key { color: #38bdf8; font-weight: bold; }
    .h-str { color: #a3e635; }
    .h-num { color: #f472b6; }
    .h-bool { color: #fbbf24; font-weight: bold; }
    .h-tag { color: #94a3b8; font-style: italic; }

    /* ---------- HISTORY SECTION ---------- */
    .sg-history-section { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 20px; padding: 24px; margin-top: 30px; }
    .sg-history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
    .sg-history-title { font-size: 15px; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 8px; margin: 0; }
    .sg-history-list { display: flex; flex-direction: column; gap: 10px; }
    .sg-history-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; cursor: pointer; transition: 0.2s; gap: 12px; }
    .sg-history-item:hover { border-color: var(--primary-color); transform: translateY(-1px); }
    .sg-history-info { display: flex; align-items: center; gap: 10px; overflow: hidden; flex: 1; }
    .sg-history-badge { font-size: 12px; font-weight: 800; padding: 4px 8px; border-radius: 6px; background: var(--primary-light); color: var(--primary-color); font-family: 'Space Mono', monospace; white-space: nowrap; }
    .sg-history-title-txt { font-size: 13.5px; font-weight: 700; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .sg-history-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
    .sg-history-time { font-size: 12px; color: var(--text-muted); }
    .sg-history-del { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 6px; transition: 0.2s; display: flex; align-items: center; }
    .sg-history-del:hover { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

    /* ---------- BENTO BOX FEATURES (.sg-) ---------- */
    .console-features { margin-top: 50px; width: 100%; }
    .bento-features-cluster { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(130px, auto); gap: 20px; width: 100%; position: relative; z-index: 2; }
    .bento-card { background: rgba(255, 255, 255, 0.015); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--border-color); border-radius: 24px; padding: 28px; display: flex; flex-direction: column; align-items: flex-start; position: relative; overflow: hidden; transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 0 4px 20px rgba(0,0,0,0.02); }
    
    .bento-card::before {
        content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
        width: 150px; height: 150px; background-size: contain; background-repeat: no-repeat; background-position: center;
        opacity: 0.03; transition: all 0.5s ease; pointer-events: none; z-index: 0;
    }
    .bento-card:hover::before { opacity: 0.08; transform: translate(-50%, -50%) scale(1.1); }
    .dark-mode .bento-card::before { filter: invert(1); opacity: 0.05; }
    
    .bento-card::after { content: ''; position: absolute; inset: 0; border-radius: 24px; background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 100%); pointer-events: none; }
    .bento-card:hover { transform: translateY(-4px) scale(1.01); border-color: var(--primary-color); box-shadow: 0 12px 30px rgba(0,0,0,0.06); }
    .bento-card-content { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; gap: 12px; }
    
    .dashed-ring-wrapper { position: relative; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; width: 44px; height: 44px; }
    .dashed-ring-wrapper::after { content: ''; position: absolute; top: -5px; left: -5px; right: -5px; bottom: -5px; border: 1px dashed var(--border-color); border-radius: 16px; opacity: 0.5; transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1); z-index: 0; transform-origin: center center; }
    .bento-card:hover .dashed-ring-wrapper::after { opacity: 1; transform: scale(1.1) rotate(180deg); border-color: var(--primary-color); }
    .bc-icon-wrapper { width: 44px; height: 44px; border-radius: 12px; background: var(--bg-body); border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all 0.4s ease; margin-bottom: 0; position: relative; z-index: 1; }
    .bento-card:hover .bc-icon-wrapper { background: linear-gradient(135deg, var(--primary-color), var(--border-color)); color: white; border-color: transparent; transform: scale(1.1) rotate(4deg); }
    .bc-title { font-size: 16px; font-weight: 800; color: var(--text-main); margin: 0; }
    .bc-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; margin: 0; font-weight: 500; }
    
    @media (max-width: 900px) {
        .bento-features-cluster { grid-template-columns: repeat(2, 1fr); }
    }
    @media (max-width: 600px) {
        .bento-features-cluster { grid-template-columns: 1fr; }
        .workspace-grid { grid-template-columns: 1fr; }
    }

    /* Smooth Scrolling */
    #page-content, .page-content, .sg-wrapper, html {
        scroll-behavior: smooth;
    }

    /* Zero-Inline Enhancements */
    .sc.sc-schema { border-top: 3px solid #ef4444; }
    .sc-lbl i.text-danger { width: 16px; height: 16px; color: #ef4444; }
    .sc-lbl i.text-primary { width: 16px; height: 16px; color: var(--primary-color); }
    .sc-lbl i.text-purple { width: 16px; height: 16px; color: #a855f7; }
    .sc-lbl i.text-emerald { width: 16px; height: 16px; color: #10b981; }
    .tab-btn i { width: 16px; height: 16px; }
    .templates-container { padding: 16px 24px 0 24px; }
    .templates-header { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
    .templates-header i { width: 14px; height: 14px; }
    .templates-list { display: flex; flex-wrap: wrap; gap: 8px; }
    hr.solid-divider { border: 0; border-bottom: 1px solid var(--border-color); margin: 16px 0; }
    .panel-body.editor-body { overflow-y: auto; max-height: 600px; padding-top: 0; }
    .cd-header i { width: 14px; height: 14px; }
    .faq-intro-text { font-size: 14px; color: var(--text-muted); font-weight: 500; margin-bottom: 20px; }
    .faq-remove i { width: 16px; height: 16px; }
    .input-group.mb-0 { margin-bottom: 0; }
    .sg-btn-ghost.btn-add-faq { width: 100%; border-style: dashed; justify-content: center; padding: 12px; margin-top: 8px; }
    .panel-title i.text-json { color: #3b82f6; }
    .code-actions-group { display: flex; gap: 8px; flex-wrap: wrap; }
    .sg-btn-ghost.btn-sm { margin: 0; font-size: 12px; padding: 6px 12px; }
    .sg-btn-ghost.btn-sm i { width: 14px; height: 14px; }
    .sg-btn-ghost.btn-xs { padding: 4px 10px; font-size: 12px; }
    .sg-btn-ghost.btn-xs i { width: 12px; height: 12px; }
    .sg-btn-ghost.btn-save-script { margin: 0; font-size: 12px; padding: 6px 12px; background: var(--primary-color); color: white; border-color: var(--primary-color); }
    .sg-btn-ghost.btn-save-script i { width: 14px; height: 14px; }
    .panel-body.code-body { padding: 0; display: flex; flex-direction: column; flex: 1; }
    .code-box-wrapper.no-radius { border: 0; border-radius: 0; }
    .sg-history-title i { color: var(--primary-color); }
    .sg-history-del i { width: 14px; height: 14px; }