/* ==========================================================================
   Soapband 3up - Modern AI Studio Design System
   Aesthetics: Deep Slate Dark Mode + Cyber Azure/Purple Glassmorphism
   ========================================================================== */

:root {
    --bg-base: #0b0f17;
    --bg-surface: #121824;
    --bg-surface-elevated: #1a2234;
    --bg-glass: rgba(18, 24, 36, 0.75);
    --bg-glass-card: rgba(26, 34, 52, 0.6);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 242, 254, 0.3);
    
    --primary: #00f2fe;
    --primary-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --accent-purple: #9d4edd;
    --accent-gradient: linear-gradient(135deg, #7928ca 0%, #ff0080 100%);
    
    --text-main: #f0f4f8;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --sidebar-width: 280px;
    --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.15);
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: 'Pretendard', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* App Layout */
.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 15% 20%, rgba(79, 172, 254, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 85% 80%, rgba(157, 78, 221, 0.05) 0%, transparent 40%),
                var(--bg-base);
}

/* ==========================================================================
   Sidebar Styling
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 50;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
    padding: 18px 20px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b0f17;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-main);
}

.brand-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(0, 242, 254, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
    width: fit-content;
    margin-top: 2px;
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.mobile-close-btn {
    display: none;
}

/* Ecosystem Nav */
.ecosystem-nav {
    padding: 4px 16px 12px;
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-dim);
    margin-bottom: 8px;
    display: block;
}

.nav-pills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.nav-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.nav-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-pill.active {
    background: rgba(0, 242, 254, 0.12);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.dot.green { background: #10b981; }
.dot.purple { background: #a855f7; }
.dot.cyan { background: var(--primary); }

/* Sidebar New Chat Action */
.sidebar-action {
    padding: 6px 16px 14px;
}

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 16px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.new-chat-btn:hover {
    background: rgba(0, 242, 254, 0.08);
    border-color: var(--border-glow);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* History List */
.chat-history-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
}

.history-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    padding: 8px 8px 4px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 4px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    user-select: none;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.history-item.active {
    background: rgba(0, 242, 254, 0.1);
    color: var(--primary);
    border-color: rgba(0, 242, 254, 0.3);
    font-weight: 500;
}

.history-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.history-delete-btn {
    opacity: 0;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.history-item:hover .history-delete-btn {
    opacity: 0.7;
}

.history-delete-btn:hover {
    opacity: 1 !important;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-surface);
}

.server-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-dim);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-indicator.online {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.footer-actions {
    display: flex;
    gap: 8px;
}

.footer-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.footer-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

/* ==========================================================================
   Main Chat Area
   ========================================================================== */
.chat-main {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Top Nav */
.top-nav {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    z-index: 10;
}

.mobile-menu-btn {
    display: none;
}

.model-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.model-select-wrap:hover {
    border-color: var(--border-glow);
}

.model-select {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    font-family: inherit;
}

.model-select option {
    background: var(--bg-surface-elevated);
    color: var(--text-main);
}

.live-metric {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
}

.live-metric .metric-icon {
    color: #eab308;
}

/* ==========================================================================
   Chat Messages Container
   ========================================================================== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 0 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Welcome Hero */
.welcome-hero {
    max-width: 800px;
    width: 100%;
    margin: auto;
    padding: 40px 24px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.welcome-hero.hidden {
    display: none;
}

.hero-icon-glow {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.2) 0%, rgba(0, 242, 254, 0.3) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: 0 0 35px rgba(0, 242, 254, 0.25);
    margin-bottom: 24px;
    border: 1px solid rgba(0, 242, 254, 0.4);
    animation: floatAnim 4s ease-in-out infinite;
}

@keyframes floatAnim {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.hero-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.8px;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 540px;
    margin-bottom: 36px;
}

.hero-subtitle strong {
    color: var(--primary);
}

.starter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
}

.starter-card {
    background: var(--bg-glass-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.starter-card:hover {
    background: rgba(0, 242, 254, 0.06);
    border-color: var(--border-glow);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.starter-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.starter-text {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.4;
}

/* Messages List */
.messages-list {
    width: 100%;
    max-width: 860px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message-row {
    display: flex;
    gap: 16px;
    width: 100%;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-row.user {
    justify-content: flex-end;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 700;
}

.avatar.assistant {
    background: var(--primary-gradient);
    color: #0b0f17;
    box-shadow: 0 2px 10px rgba(0, 242, 254, 0.25);
}

.message-bubble {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 14.5px;
    line-height: 1.65;
    position: relative;
    word-break: break-word;
}

.message-row.user .message-bubble {
    background: var(--bg-surface-elevated);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    border-top-right-radius: 4px;
}

.message-row.assistant .message-bubble {
    background: transparent;
    color: var(--text-main);
    padding-left: 0;
    width: 100%;
}

/* Real-time Web Search Indicators & Source Chips */
.search-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.25);
    border-radius: var(--radius-full);
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.sources-box {
    margin-bottom: 14px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.sources-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 8px;
}

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

.source-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 11.5px;
    text-decoration: none;
    transition: var(--transition);
    max-width: 220px;
}

.source-chip:hover {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.source-chip-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Markdown Rendering in Assistant Message */
.message-bubble h1, .message-bubble h2, .message-bubble h3 {
    margin: 18px 0 10px;
    color: #ffffff;
    font-weight: 700;
}
.message-bubble h1 { font-size: 1.4rem; }
.message-bubble h2 { font-size: 1.25rem; }
.message-bubble h3 { font-size: 1.1rem; }

.message-bubble p {
    margin-bottom: 12px;
}
.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble ul, .message-bubble ol {
    margin: 8px 0 14px 24px;
}

.message-bubble li {
    margin-bottom: 6px;
}

.message-bubble blockquote {
    border-left: 3px solid var(--primary);
    padding: 6px 14px;
    margin: 12px 0;
    color: var(--text-muted);
    background: rgba(0, 242, 254, 0.04);
    border-radius: 0 8px 8px 0;
}

.message-bubble code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    color: #38bdf8;
}

.message-bubble pre {
    margin: 16px 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #0d1117 !important;
    border: 1px solid var(--border-subtle);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    background: #161b22;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
}

.code-copy-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.message-bubble pre code {
    display: block;
    padding: 14px 16px;
    background: transparent;
    color: #e6edf3;
    overflow-x: auto;
}

.message-bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13.5px;
}

.message-bubble th, .message-bubble td {
    border: 1px solid var(--border-subtle);
    padding: 8px 12px;
    text-align: left;
}

.message-bubble th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

/* Typing Indicator Dots */
.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
}
.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

.stats-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   Chat Input Fixed Box
   ========================================================================== */
.input-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 0 20px 20px;
    background: linear-gradient(to top, var(--bg-base) 70%, transparent);
    pointer-events: none;
    z-index: 20;
}

.input-card {
    pointer-events: auto;
    width: 100%;
    max-width: 860px;
    background: rgba(18, 24, 36, 0.85);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 10px 14px 10px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: var(--transition);
}

.input-card:focus-within {
    border-color: rgba(0, 242, 254, 0.4);
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.15), 0 10px 40px -10px rgba(0, 0, 0, 0.6);
}

.card-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preset-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-dim);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.04);
    width: fit-content;
}

.pill-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
}

/* Web Search Toggle Button */
.web-search-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 11.5px;
    cursor: pointer;
    transition: var(--transition);
}

.web-search-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.web-search-toggle.active {
    background: rgba(0, 242, 254, 0.1);
    border-color: rgba(0, 242, 254, 0.3);
    color: var(--primary);
}

.web-search-toggle.forced-on {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #10b981;
}

.web-search-toggle.forced-off {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--border-subtle);
    color: var(--text-dim);
    opacity: 0.7;
}

.input-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.prompt-textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 14.5px;
    line-height: 1.5;
    padding: 4px 6px;
    resize: none;
    max-height: 180px;
    outline: none;
    font-family: inherit;
}

.prompt-textarea::placeholder {
    color: var(--text-dim);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-send {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--primary-gradient);
    border: none;
    color: #0b0f17;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.btn-stop {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-stop:hover {
    background: rgba(239, 68, 68, 0.3);
}

.btn-stop.hidden {
    display: none;
}

.input-disclaimer {
    font-size: 11px;
    color: var(--text-dim);
    text-align: center;
    letter-spacing: -0.2px;
}

/* ==========================================================================
   Modal Dialogs
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: var(--transition);
}

.modal-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-card {
    width: 100%;
    max-width: 520px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
    font-size: 17px;
    font-weight: 700;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.modal-body {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: 70vh;
    overflow-y: auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.preset-btn {
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.preset-btn.active {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.modal-textarea {
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.5;
    outline: none;
    font-family: inherit;
    resize: vertical;
}

.modal-textarea:focus {
    border-color: var(--border-glow);
}

.slider-header {
    display: flex;
    justify-content: space-between;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

.field-hint {
    font-size: 11px;
    color: var(--text-dim);
}

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(0, 0, 0, 0.15);
}

.primary-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--primary-gradient);
    border: none;
    color: #0b0f17;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.secondary-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.secondary-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   Responsive Mobile Adjustments
   ========================================================================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.8);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 40;
        display: none;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-close-btn {
        display: flex;
    }

    .starter-grid {
        grid-template-columns: 1fr;
    }

    .top-nav {
        padding: 0 14px;
    }

    .chat-messages {
        padding: 16px 0 140px;
    }

    .input-container {
        padding: 0 10px 10px;
    }

    .message-bubble {
        max-width: 92%;
    }
}
