/* ==========================================================================
   ai4save Core Application Stylesheet (app.css)
   Extracted from head.php for browser caching & production minification
   ========================================================================== */

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f4f4f5;
}

.theme-dark ::-webkit-scrollbar-track,
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #18181b;
}

::-webkit-scrollbar-thumb {
    background: #71717a;
    border-radius: 9999px;
    border: 2px solid #f4f4f5;
}

::-webkit-scrollbar-thumb:hover {
    background: #27272a;
}

.theme-dark ::-webkit-scrollbar-thumb,
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-color: #18181b;
}

.theme-dark ::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #fafafa;
}

/* KaTeX Math Styling */
.katex-display-container {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0;
}

.katex-display-container .katex-display {
    margin: 0.35rem 0;
}

.theme-dark .katex,
[data-theme="dark"] .katex,
.dark .katex {
    color: #f4f4f5;
}

/* Smooth scroll & Global typography scaling */
html {
    scroll-behavior: smooth;
    font-family: 'Space Grotesk', sans-serif;
    background-color: #ffffff;
    color: #09090b;
    font-size: 15px;
    /* Reverted from 18px */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
        /* Reverted from 19px */
    }
}

/* Minimalist background (Solid White) */
.clean-grid {
    background-color: #ffffff;
}

/* Minimalist Panels - Solid Black Crisp Border Style */
.clean-panel {
    background-color: #ffffff;
    border: 1.5px solid #09090b !important;
    transition: border-color 0.15s ease-in-out;
}

.clean-panel div[class*="border-"],
.clean-panel form[class*="border-"],
.clean-panel input[class*="border-"],
.clean-panel select[class*="border-"],
.clean-panel button[class*="border-"]:not(.clean-panel-light-border) {
    border-color: #09090b !important;
}

.clean-panel-light-border {
    border-color: #e4e4e7 !important;
}

.clean-panel-light-border:hover {
    border-color: #d4d4d8 !important;
}

.clean-panel-hover:hover {
    border-color: #09090b;
}

/* Container max-width */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@media (min-width: 640px) {
    .container {
        max-width: 640px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Live demo message streaming pulse indicator */
@keyframes cursor-blink {
    50% {
        opacity: 0;
    }
}

.chat-cursor {
    display: inline-block;
    width: 2px;
    height: 14px;
    background-color: #09090b;
    margin-left: 2px;
    animation: cursor-blink 0.8s infinite;
    vertical-align: middle;
}

@keyframes rainbowBorderScroll {
    0% {
        background-position: 0% 50%, 0% 50%;
    }

    50% {
        background-position: 0% 50%, 100% 50%;
    }

    100% {
        background-position: 0% 50%, 0% 50%;
    }
}

.thought-details {
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
    border-radius: 10px !important;
    background: rgba(244, 246, 255, 0.6) !important;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}

.thought-details summary {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    color: #6366f1 !important;
    font-size: 12px;
    font-weight: 600;
    user-select: none;
    cursor: pointer;
}

.thought-details summary::-webkit-details-marker {
    display: none !important;
}

.thought-details>div {
    margin: 0 !important;
    padding: 4px 10px 8px 10px !important;
    color: #64748b !important;
    font-size: 11.5px;
    line-height: 1.55;
    max-height: 220px;
    overflow-y: auto;
}

/* Hide scrollbar for elements */
.scrollbar-hide::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar,
.scrollbar-none::-webkit-scrollbar {
    display: none;
    height: 0;
    width: 0;
}

.scrollbar-hide,
.no-scrollbar,
.scrollbar-none {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Markdown Heading styles overrides (fixes Tailwind CSS preflight heading resets) */
#chatboxTranscript h1,
#editorPreview h1 {
    font-size: 1.5em;
    font-weight: 700;
    margin: 0;
    color: #000000;
    line-height: inherit;
}

#chatboxTranscript h2,
#editorPreview h2 {
    font-size: 1.3em;
    font-weight: 700;
    margin: 0;
    color: #000000;
    line-height: inherit;
}

#chatboxTranscript h3,
#editorPreview h3 {
    font-size: 1.15em;
    font-weight: 600;
    margin: 0;
    color: #000000;
    line-height: inherit;
}

#chatboxTranscript h4,
#editorPreview h4 {
    font-size: 1.05em;
    font-weight: 700;
    margin: 0;
    color: #000000;
    text-transform: lowercase;
    /* Matches lowercase aesthetic */
    line-height: inherit;
}

#chatboxTranscript p,
#editorPreview p {
    margin-bottom: 0.75rem;
}

#chatboxTranscript p:last-child,
#editorPreview p:last-child {
    margin-bottom: 0;
}

/* Notion-style Toggle Headings & Draggable Blocks */
.notion-toggle-summary::-webkit-details-marker,
.code-interpreter-widget summary::-webkit-details-marker {
    display: none;
}

.notion-toggle-summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    margin-left: -6px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.12s ease;
    line-height: inherit !important;
}

.notion-toggle-summary:hover {
    background-color: #f4f4f5;
    /* zinc-100 */
}

.notion-caret {
    font-size: 16px;
    color: #09090b !important;
    /* Pitch black for high contrast & prominence */
    transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1);
}

#editorPreview u,
#chatboxTranscript u {
    text-decoration: underline !important;
}

details[open]>.notion-toggle-summary .notion-caret,
details[open] .ci-chevron {
    transform: rotate(90deg);
}

.ci-chevron {
    transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1);
}

/* Premium Code Interpreter Accordion & Terminal Box Styling (Gentle Gray & Clean Contrast) */
.code-interpreter-widget {
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    background-color: #f1f3f5 !important;
    color: #1f2937;
    margin-top: 0.5rem;
    margin-bottom: 0.95rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.code-interpreter-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.75rem;
    background-color: #e5e7eb;
    cursor: pointer;
    user-select: none;
    font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #d1d5db;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.code-interpreter-summary:hover {
    background-color: #d1d5db;
    color: #111827;
}

.code-interpreter-body {
    padding: 0.6rem 0.85rem !important;
    background-color: #f1f3f5 !important;
    font-family: "Space Mono", monospace, SFMono-Regular;
    font-size: 0.82rem;
    color: #1f2937 !important;
    line-height: 1.5;
    overflow-x: auto;
}

.code-interpreter-body pre {
    background-color: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: "Space Mono", monospace !important;
}

.code-interpreter-body code {
    background-color: transparent !important;
    font-family: "Space Mono", monospace !important;
    color: #1f2937 !important;
}

/* Vivid Syntax Colors - High Contrast on Gray Background */
.code-interpreter-body .hljs-keyword,
.code-interpreter-body .hljs-selector-tag,
.code-interpreter-body .hljs-subst,
.code-interpreter-body span[class*="keyword"] {
    color: #0284c7 !important;
    /* Vivid Blue Keyword */
    font-weight: bold !important;
}

.code-interpreter-body .hljs-string,
.code-interpreter-body .hljs-title,
.code-interpreter-body .hljs-section,
.code-interpreter-body .hljs-attribute,
.code-interpreter-body .hljs-template-tag,
.code-interpreter-body .hljs-template-variable,
.code-interpreter-body .hljs-type,
.code-interpreter-body span[class*="string"] {
    color: #15803d !important;
    /* Rich Green String */
}

.code-interpreter-body .hljs-comment,
.code-interpreter-body .hljs-quote,
.code-interpreter-body .hljs-deletion,
.code-interpreter-body .hljs-meta,
.code-interpreter-body span[class*="comment"] {
    color: #6b7280 !important;
    /* Gray Comment */
    font-style: italic !important;
}

.code-interpreter-body .hljs-number,
.code-interpreter-body .hljs-regexp,
.code-interpreter-body .hljs-literal,
.code-interpreter-body .hljs-link,
.code-interpreter-body span[class*="number"] {
    color: #c026d3 !important;
    /* Fuchsia Number */
    font-weight: bold !important;
}

.code-interpreter-body .hljs-built_in,
.code-interpreter-body .hljs-bullet,
.code-interpreter-body .hljs-symbol,
.code-interpreter-body span[class*="built_in"] {
    color: #c2410c !important;
    /* Dark Orange Built-in */
    font-weight: bold !important;
}

.code-interpreter-body .hljs-title.function_ {
    color: #2563eb !important;
    /* Royal Blue Functions */
}

.code-interpreter-output {
    margin-top: 0.5rem;
    padding: 0.65rem 0.9rem;
    background-color: #1f2937;
    border-top: 1px dashed #9ca3af;
    border-radius: 0 0 0.5rem 0.5rem;
    font-family: "Space Mono", monospace;
    font-size: 0.82rem;
    color: #10b981;
    /* Emerald output text */
    white-space: pre-wrap;
    word-break: break-all;
}

/* Dark Mode Overrides */
.theme-dark .code-interpreter-widget,
[data-theme="dark"] .code-interpreter-widget {
    border-color: #3f3f46;
    background-color: #27272a !important;
    color: #f4f4f5;
}

.theme-dark .code-interpreter-summary,
[data-theme="dark"] .code-interpreter-summary {
    background-color: #323236;
    border-bottom-color: #3f3f46;
    color: #d4d4d8;
}

.theme-dark .code-interpreter-summary:hover,
[data-theme="dark"] .code-interpreter-summary:hover {
    background-color: #3f3f46;
    color: #ffffff;
}

.theme-dark .code-interpreter-body,
[data-theme="dark"] .code-interpreter-body {
    background-color: #27272a !important;
    color: #f4f4f5 !important;
}

.theme-dark .code-interpreter-body code,
[data-theme="dark"] .code-interpreter-body code {
    color: #f4f4f5 !important;
}

.theme-dark .code-interpreter-body pre {
    background-color: transparent !important;
}

/* SVG Code Viewer & Live Preview Styling */
.svg-viewer-widget {
    border-radius: 0.75rem;
    border: 1px solid #e4e4e7;
    background-color: #ffffff;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.theme-dark .svg-viewer-widget,
[data-theme="dark"] .svg-viewer-widget {
    border-color: #27272a;
    background-color: #18181b;
}

.svg-canvas-bg {
    background-color: #f8fafc;
    background-image: radial-gradient(#cbd5e1 1.2px, transparent 1.2px);
    background-size: 16px 16px;
}

.theme-dark .svg-canvas-bg,
[data-theme="dark"] .svg-canvas-bg {
    background-color: #09090b;
    background-image: radial-gradient(#27272a 1.2px, transparent 1.2px);
}

.code-block-widget {
    border-radius: 0.75rem;
    border: 1px solid #e4e4e7;
    background-color: #f8fafc;
    color: #09090b;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.code-block-header {
    background-color: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
}

.code-block-body {
    background-color: #f8fafc;
    color: #0f172a;
}

.theme-dark .code-block-widget,
[data-theme="dark"] .code-block-widget {
    border-color: #27272a;
    background-color: #09090b;
    color: #f4f4f5;
}

.theme-dark .code-block-header,
[data-theme="dark"] .code-block-header {
    background-color: #18181b;
    border-bottom-color: #27272a;
    color: #a1a1aa;
}

.theme-dark .code-block-body,
[data-theme="dark"] .code-block-body {
    background-color: #09090b;
    color: #f4f4f5;
}

.code-block-body::-webkit-scrollbar,
.code-interpreter-body::-webkit-scrollbar,
.svg-code-pane::-webkit-scrollbar {
    height: 4px;
}

.code-block-body::-webkit-scrollbar-thumb,
.code-interpreter-body::-webkit-scrollbar-thumb,
.svg-code-pane::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.theme-dark .code-block-body::-webkit-scrollbar-thumb,
[data-theme="dark"] .code-block-body::-webkit-scrollbar-thumb,
.theme-dark .code-interpreter-body::-webkit-scrollbar-thumb,
[data-theme="dark"] .code-interpreter-body::-webkit-scrollbar-thumb {
    background: #3f3f46;
}

.notion-toggle-content {
    transition: opacity 0.15s ease;
}

.notion-drag-handle {
    opacity: 0.15;
    transition: opacity 0.15s ease, color 0.15s ease;
    font-size: 11px;
}

.notion-delete-btn {
    opacity: 0.15;
    transition: opacity 0.15s ease, color 0.15s ease;
    font-size: 11px;
}

.notion-toggle:hover .notion-drag-handle,
.notion-toggle:hover .notion-delete-btn,
.notion-toggle:hover .notion-toggle-btn {
    opacity: 1;
}

.notion-toggle-btn {
    opacity: 0.15;
    transition: opacity 0.15s ease, color 0.15s ease;
    font-size: 11px;
}

/* Notion-style ordinary content blocks */
.notion-block {
    position: relative;
    min-height: 28px;
    transition: background-color 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.notion-block:hover {
    background-color: rgba(244, 244, 245, 0.55);
}

.notion-block.is-dragging {
    opacity: 0.45;
}

.notion-block.is-drag-over-before::before,
.notion-block.is-drag-over-after::after {
    content: '';
    position: absolute;
    left: 24px;
    right: 4px;
    height: 2px;
    border-radius: 999px;
    background: #18181b;
    pointer-events: none;
}

.notion-block.is-drag-over-before::before {
    top: -1px;
}

.notion-block.is-drag-over-after::after {
    bottom: -1px;
}

.notion-block-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
    width: 24px;
    height: 26px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 5px;
    background: #f4f4f5;
    color: #71717a;
    opacity: 0.9;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1;
    vertical-align: middle;
    cursor: grab;
}

.notion-block-handle:hover {
    background: #e4e4e7;
    color: #18181b;
}

.notion-block-handle:active {
    cursor: grabbing;
    background: #d4d4d8;
}

.notion-block-content>p,
.notion-block-content>ul,
.notion-block-content>ol,
.notion-block-content>blockquote,
.notion-block-content>pre {
    margin-top: 0 !important;
    margin-bottom: 0.35rem !important;
}

.notion-block-content:empty::before {
    content: 'Type \'/\' for commands';
    color: #a1a1aa;
    pointer-events: none;
}

/* When toggle is "flattened" to a plain heading, hide caret and body */
.notion-toggle.is-flat>.notion-toggle-summary .notion-caret,
.notion-toggle.is-flat>.notion-toggle-content {
    display: none;
}

.notion-toggle.is-flat>.notion-toggle-summary {
    cursor: default;
}

/* Style for active drag target */
.notion-toggle[draggable="true"] {
    transition: border 0.1s ease, background-color 0.15s ease, opacity 0.15s ease;
}

/* Sync Chatbox Console Typography with the Sans-Serif Editor Preview (Excluding i tags to keep FontAwesome working) */
#chatboxTranscript,
#chatboxTranscript p,
#chatboxTranscript li,
#chatboxTranscript summary,
#chatboxTranscript div {
    font-family: 'Space Grotesk', sans-serif !important;
    line-height: 1.625 !important;
    color: #09090b !important;
    letter-spacing: normal !important;
}

/* Normal text and paragraphs (excluding code widgets & badges) */
#chatboxTranscript p,
#chatboxTranscript li {
    font-size: 0.875rem !important;
    /* 14px text-sm matching editor preview body */
}

#chatboxTranscript>span,
#chatboxTranscript .bot-response-content>span,
#chatboxTranscript .user-message-bubble span:not(.text-\[10px\]) {
    font-size: 0.875rem;
}

/* Responsive styling for Code Interpreter & Code Blocks (Optimized for Mobile) */
.code-interpreter-summary span,
.code-interpreter-summary button,
.code-block-header span,
.code-block-header button,
.svg-viewer-header span,
.svg-viewer-header button {
    white-space: nowrap !important;
}

@media (max-width: 768px) {
    .code-interpreter-summary {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.72rem !important;
        gap: 0.25rem !important;
    }

    .code-interpreter-summary span,
    .code-interpreter-summary button {
        font-size: 0.7rem !important;
    }

    .code-interpreter-summary .ci-badge {
        font-size: 0.6rem !important;
        padding: 0.05rem 0.3rem !important;
    }

    .code-interpreter-body,
    .code-interpreter-body pre,
    .code-interpreter-body code,
    .code-interpreter-body span,
    .code-block-body,
    .code-block-body pre,
    .code-block-body code,
    .code-block-body span {
        font-size: 0.72rem !important;
        line-height: 1.38 !important;
    }

    .code-block-header {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.7rem !important;
    }

    .code-block-header span,
    .code-block-header button {
        font-size: 0.7rem !important;
    }

    .code-block-body {
        padding: 0.5rem !important;
    }

    .code-interpreter-output {
        font-size: 0.7rem !important;
        padding: 0.4rem 0.6rem !important;
    }

    .svg-viewer-header {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.7rem !important;
    }

    .svg-viewer-header span,
    .svg-viewer-header button {
        font-size: 0.7rem !important;
    }

    .svg-code-pane {
        font-size: 0.72rem !important;
    }

    .svg-code-pane pre,
    .svg-code-pane code,
    .svg-code-pane span {
        font-size: 0.72rem !important;
        line-height: 1.38 !important;
    }

    /* Inline markdown code in mobile */
    #chatboxTranscript :not(pre)>code,
    .bot-response-content :not(pre)>code {
        font-size: 0.75rem !important;
        padding: 0.1rem 0.3rem !important;
    }
}

/* ==========================================================================
   iOS & Mobile Full-Bleed PWA Fit System (Exact Pixel Viewport)
   ========================================================================== */
@media (max-width: 767px) {

    html,
    body {
        width: 100vw !important;
        height: var(--app-height, 100vh) !important;
        max-height: var(--app-height, 100vh) !important;
        min-height: var(--app-height, 100vh) !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background-color: #edf2f6 !important;
        touch-action: pan-x pan-y !important;
        -webkit-text-size-adjust: 100% !important;
    }

    /* Prevent iOS auto-zoom when focusing inputs/textareas */
    input,
    textarea,
    select {
        font-size: 16px !important;
    }

    #workspaceMainRoot {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: var(--app-height, 100vh) !important;
        max-height: var(--app-height, 100vh) !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        background-color: #edf2f6 !important;
    }

    #splitWorkspaceContainer {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        background-color: #edf2f6 !important;
    }

    /* Floating mobile menu button */
    #floatingMobileMenuBtn {
        position: fixed !important;
        top: 10px !important;
        left: 12px !important;
        z-index: 80 !important;
        border-color: transparent !important;
        background-image: linear-gradient(#ffffff, #ffffff), linear-gradient(135deg, #ff3b30, #ff9500, #ffcc00, #34c759, #00c7be, #007aff, #af52de, #ff3b30) !important;
        -webkit-background-clip: padding-box, border-box !important;
        background-clip: padding-box, border-box !important;
        background-origin: padding-box, border-box !important;
        background-size: 100% 100%, 300% 300% !important;
        animation: rainbowBorderScroll 2.5s linear infinite !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18), 0 0 10px rgba(99, 102, 241, 0.25) !important;
        transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease !important;
        transform-origin: center center;
    }

    #floatingMobileMenuBtn:active {
        transform: scale(0.95) !important;
    }

    /* Main chat panel and wrappers full height */
    #chatboxWrapper,
    #chatboxPanel {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        background-color: #edf2f6 !important;
    }

    #chatboxTranscript {
        flex: 1 1 0% !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-y: auto !important;
        padding-top: 50px !important;
        padding-bottom: 0.5rem !important;
        background-color: #edf2f6 !important;
    }

    /* Chat Input Area fixed tight to the bottom edge */
    #chatboxInputArea {
        flex-shrink: 0 !important;
        width: 100% !important;
        padding-left: max(0.25rem, env(safe-area-inset-left, 0.25rem)) !important;
        padding-right: max(0.25rem, env(safe-area-inset-right, 0.25rem)) !important;
        padding-bottom: 0.5rem !important;
        padding-top: 0.25rem !important;
        background-color: #edf2f6 !important;
        position: relative !important;
        z-index: 30 !important;
    }

    #chatEditorForm {
        padding: 4px !important;
        border-radius: 12px !important;
        align-items: center !important;
        min-height: 64px !important;
        gap: 4px !important;
        border: 1.5px solid #cbd5e1 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    }

    #chatEditorForm>div.flex-col {
        flex-direction: column !important;
        align-self: center !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        margin-bottom: 0 !important;
    }

    #chatEditorForm #promptPopoverBtn {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        border-radius: 8px !important;
        background-color: #fffbeb !important;
        border: 1px solid #fde68a !important;
        color: #d97706 !important;
        box-shadow: 0 1px 2px rgba(217, 119, 6, 0.1) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #chatEditorForm #promptPopoverBtn:hover {
        background-color: #fef3c7 !important;
        color: #b45309 !important;
    }

    #chatEditorForm #promptPopoverBtn i {
        font-size: 13px !important;
    }

    #chatEditorForm #btnSubmitChat {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        border-radius: 8px !important;
        background-color: #2563eb !important;
        color: #ffffff !important;
        border: 1px solid #1d4ed8 !important;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #chatEditorForm #btnSubmitChat:hover {
        background-color: #1d4ed8 !important;
    }

    #chatEditorForm #btnSubmitChat #btnSubmitIcon {
        font-size: 12px !important;
    }

    /* Khi đã gõ chữ trong mobile view: ẩn nút bóng đèn, làm nút gửi cao full input như PC view */
    #chatboxInput:not(:placeholder-shown) ~ div #promptPopoverWrapper,
    #chatboxInput:not(:placeholder-shown) ~ div #promptPopoverBtn,
    #chatboxInput:not(:placeholder-shown) ~ div .prompt-popover-wrapper,
    #chatEditorForm.has-chat-text #promptPopoverWrapper,
    #chatEditorForm.has-chat-text #promptPopoverBtn,
    #chatEditorForm.has-chat-text .prompt-popover-wrapper,
    #chatEditorForm:has(#chatboxInput:not(:placeholder-shown)) #promptPopoverWrapper,
    #chatEditorForm:has(#chatboxInput:not(:placeholder-shown)) #promptPopoverBtn,
    #chatEditorForm:has(#chatboxInput:not(:placeholder-shown)) .prompt-popover-wrapper {
        display: none !important;
    }

    #chatboxInput:not(:placeholder-shown) ~ div.flex-col,
    #chatEditorForm.has-chat-text > div.flex-col,
    #chatEditorForm:has(#chatboxInput:not(:placeholder-shown)) > div.flex-col {
        align-self: stretch !important;
        height: auto !important;
        min-height: 100% !important;
        justify-content: stretch !important;
    }

    #chatboxInput:not(:placeholder-shown) ~ div #btnSubmitChat,
    #chatEditorForm.has-chat-text #btnSubmitChat,
    #chatEditorForm:has(#chatboxInput:not(:placeholder-shown)) #btnSubmitChat {
        width: 36px !important;
        height: 100% !important;
        min-height: 100% !important;
        flex: 1 1 auto !important;
        min-width: 36px !important;
        border-radius: 10px !important;
        align-self: stretch !important;
    }
    #chatboxInput:not(:placeholder-shown) ~ div #btnSubmitChat #btnSubmitIcon,
    #chatEditorForm.has-chat-text #btnSubmitChat #btnSubmitIcon,
    #chatEditorForm:has(#chatboxInput:not(:placeholder-shown)) #btnSubmitChat #btnSubmitIcon {
        font-size: 16px !important;
    }

    #chatEditorForm.chat-form-compact {
        min-height: 0 !important;
        padding-top: 4px !important;
        padding-bottom: 4px !important;
    }

    #chatEditorForm.chat-form-compact>div.flex-col {
        flex-direction: row !important;
        align-self: center !important;
        gap: 4px !important;
    }

    #chatEditorForm.chat-form-compact #chatboxInput {
        height: 24px !important;
        min-height: 24px !important;
        max-height: 24px !important;
        overflow: hidden !important;
    }

    #chatEditorForm.chat-form-compact:focus-within {
        min-height: 64px !important;
        padding-top: 4px !important;
        padding-bottom: 4px !important;
    }

    #chatEditorForm.chat-form-compact:focus-within>div.flex-col {
        flex-direction: column !important;
    }

    #chatEditorForm.chat-form-compact:focus-within #chatboxInput {
        height: auto !important;
        min-height: 24px !important;
        max-height: 72px !important;
        overflow-y: auto !important;
    }

    #chatboxInput {
        min-height: 24px !important;
        max-height: 72px !important;
        align-self: center !important;
        padding: 0 6px !important;
        margin: 0 !important;
        font-size: 17px !important;
        line-height: 26px !important;
        box-sizing: border-box !important;
        overflow-y: auto !important;
        resize: none !important;
    }

    /* All tab wrappers */
    .workspace-tab-wrapper {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    #appsWrapper>div:first-child,
    #modelsWrapper>header,
    #apiWrapper>header,
    #homepageWrapper>header {
        min-height: 52px !important;
        padding-top: 0 !important;
    }

    /* Off-canvas sidebar drawers */
    #leftSidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        height: 100% !important;
        min-height: 100% !important;
        z-index: 90 !important;
        padding-top: 0 !important;
        padding-bottom: max(1rem, env(safe-area-inset-bottom, 1rem)) !important;
    }

    .sidebar-right-panel {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 72px !important;
        height: 100% !important;
        min-height: 100% !important;
        z-index: 85 !important;
        padding-top: 0 !important;
        padding-bottom: max(1rem, env(safe-area-inset-bottom, 1rem)) !important;
    }

    /* Theme settings modal & popups */
    #theme-settings-modal .modal-content-container,
    .modal-content-container {
        padding-top: 0 !important;
        padding-bottom: 0.5rem !important;
    }
}