/* FChat homepage: neutral workspace, shared by the welcome and conversation views. */
:root {
    --primary-color: #24262a;
    --primary-hover: #101114;
    --background-color: #fff;
    --sidebar-bg: #f7f7f8;
    --text-primary: #202124;
    --text-secondary: #64666c;
    --border-color: #e5e6e9;
    --bubble-user-bg: #24262a;
    --home-muted: #73757b;
    --home-width: 760px;
}
html, body { width: 100%; height: 100%; }
body { height: 100dvh; overflow: hidden; }
a, button, label.btn { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, label:focus-within, .chat-inpt-box .input-group .btn:focus-visible {
    outline: 2px solid #536996 !important;
    outline-offset: 3px;
}
.app-wrapper { min-height: 0; }
.Sidebar { width: 246px; padding: 32px 20px 20px; gap: 24px; overflow-y: auto; }
.sidebar-header .brand-title { background: none; -webkit-text-fill-color: currentColor; font-size: 22px; font-weight: 700; letter-spacing: -.8px; }
.brand-ai { margin-left: 8px; border: 1px solid #d8d9dc; border-radius: 5px; padding: 2px 5px; font-size: 11px; color: #6a6c72; font-weight: 500; letter-spacing: 0; }
.Sidebar .new-chat-btn-container { margin: 0 !important; }
.new-chat-btn-container .btn { min-height: 46px; border-radius: 9px; box-shadow: none; font-size: 14px; justify-content: flex-start !important; padding: 12px 14px; }
.new-chat-btn-container .btn:hover { box-shadow: none; transform: none; }
.sidebar-nav { margin: 0; padding: 0; overflow: visible; flex-shrink: 0; }
.Sidebar .nav-link, #offcanvasSidebar .nav-link { min-height: 44px; padding: 10px 14px; font-size: 14px; border: 0; background: transparent; text-align: left; border-radius: 8px; }
.Sidebar .nav-link { margin: 0 0 4px; }
.Sidebar .nav-link i { color: #777980; }
.Sidebar .nav-link.active { background: #e9eaed; color: #282a30; }
.Sidebar .nav-link:hover { background: #e9eaed; }
.home-section-label { font-size: 11px; color: var(--home-muted); margin: 0 14px 12px; }
.home-recent { min-width: 0; }
.home-recent button { border: 0; background: none; color: var(--text-secondary); width: 100%; text-align: left; font: inherit; font-size: 12px; border-radius: 8px; padding: 11px 14px; }
.home-recent button:hover { background: #e9eaed; }
.home-recent-item { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-history-empty { color: var(--home-muted); font-size: 12px; margin: 0 14px 7px; line-height: 1.8; }
.home-recent .home-history-all { color: #73757b; font-size: 11px; }
.home-history-all i { margin-left: 8px; }
.home-sidebar-spacer { flex: 1; min-height: 20px; }
.home-desktop-link { border: 1px solid #dedfe2; border-radius: 10px; padding: 16px 13px; background: #f9f9fa; text-decoration: none; color: var(--text-primary); }
.home-desktop-link:hover { color: var(--primary-color); background: #f0f1f3; }
.home-desktop-link > span { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.home-desktop-link small { display: block; font-size: 11px; color: var(--home-muted); margin: 8px 0 0 27px; }
.home-desktop-link small i { float: right; }
.sidebar-footer { margin: 0; padding-top: 14px; border-top: 1px solid #dedfe2; }
.sidebar-footer .user-name { font-size: 13px; overflow-wrap: anywhere; }
.sidebar-footer .user-profile { padding: 0 8px; }
.sidebar-footer .user-avatar { font-size: 28px; color: #6c6f77; }
.sidebar-footer .nav-link { font-size: 12px; }
.chat { min-height: 0; }
.home-topbar { height: 87px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 40px; }
.home-breadcrumb { display: flex; align-items: center; gap: 14px; color: #53555b; font-size: 12px; }
.home-breadcrumb i, .home-breadcrumb span { color: #85878e; }
.home-top-actions { display: flex; align-items: center; gap: 18px; }
.home-announcement, .home-top-up { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; color: var(--text-secondary); background: none; border: 0; font-size: 12px; text-decoration: none; }
.home-top-up { border: 1px solid var(--border-color); border-radius: 7px; padding: 0 13px; }
.home-top-up:hover, .home-announcement:hover { background: #f4f4f6; color: var(--text-primary); }
.home-workspace { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.home-intro, .chat-inpt-box, .home-suggestions { width: calc(100% - 88px); max-width: var(--home-width); margin-left: auto; margin-right: auto; flex-shrink: 0; }
.chat.is-empty .home-workspace { overflow-y: auto; padding: 40px 0 30px; }
#logo-box.home-intro { pointer-events: auto; align-items: flex-start; justify-content: flex-start; margin-top: auto; }
.home-eyebrow { display: flex; align-items: center; gap: 8px; color: #73757b; font-size: 10px; letter-spacing: 1.8px; margin-bottom: 24px; }
.home-eyebrow > span { width: 7px; height: 7px; border-radius: 50%; background: #7d7f85; flex-shrink: 0; }
.home-intro h1 { font-size: 39px; font-weight: 600; letter-spacing: -1.7px; line-height: 1.4; margin: 0 0 13px; color: var(--text-primary); }
.home-intro h1 span { color: #686b74; }
.home-intro p { font-size: 14px; color: var(--home-muted); margin: 0; line-height: 1.8; }
.chat-inpt-box { padding: 0; margin-top: 0 !important; margin-bottom: 14px; }
.chat.is-empty .chat-inpt-box { margin-top: 34px !important; margin-bottom: 0; }
.chat-inpt-box .input-group { border-radius: 17px !important; padding: 16px 20px !important; border: 1px solid #dcdde1 !important; box-shadow: 0 5px 22px #11182706 !important; flex-wrap: nowrap; }
.chat-inpt-box .input-group:focus-within { border-color: #969ba5 !important; box-shadow: 0 4px 20px #11182709 !important; }
.model-selector-wrapper { position: static; padding: 0 0 12px; pointer-events: auto; z-index: 21; align-items: center; flex-wrap: wrap; width: 100%; }
.model-selector-wrapper .dropdown { min-width: 0; max-width: 100%; }
#dropdownMenuButton, #groupDropdownButton { border: 1px solid #e3e4e7; border-radius: 7px; padding: 7px 10px; font-size: 12px; box-shadow: none; background: #fafafb; backdrop-filter: none; max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
#dropdownMenuButton:hover, #groupDropdownButton:hover { background: #f1f2f4; box-shadow: none; }
#groupDropdownButton { border-color: transparent; background: transparent; color: var(--home-muted); font-weight: 400; }
#dropdownMenuButton::after, #groupDropdownButton::after { font-size: 10px; }
.model-selector-wrapper .dropdown-menu { max-width: min(650px, calc(100vw - 40px)) !important; min-width: min(240px, calc(100vw - 40px)) !important; }
.dropdown-menu-style { border-radius: 10px; font-size: 13px; }
.chat-inpt-box textarea { font-size: 15px; min-height: 48px !important; max-height: 30dvh; overflow-y: auto !important; }
.chat.is-empty .chat-inpt-box textarea { min-height: 106px !important; padding-top: 5px !important; }
.chat-inpt-box textarea::placeholder { color: #767981 !important; }
.chat-inpt-box .input-group-append { gap: 6px !important; align-items: center; }
.chat-inpt-box .input-group .btn { height: 40px !important; width: auto !important; min-width: 40px; padding: 0 7px !important; gap: 7px; border-radius: 7px !important; font-size: 16px; color: #72757d; position: relative; }
.home-tool-label, .home-image-label { font-size: 11px; line-height: 1.5; white-space: nowrap; }
.chat-inpt-box .input-group #sendButton { background: #24262a; color: #fff; width: 36px !important; min-width: 36px; height: 36px !important; border-radius: 9px !important; margin-left: auto !important; }
.chat-inpt-box .input-group #sendButton:hover { background: #101114; }
.chat-inpt-box .input-group #sendButton:disabled { opacity: .45; }
.chat-inpt-box .home-file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.home-input-help { display: flex; justify-content: space-between; color: #777a82; font-size: 10px; padding: 10px 5px 0; gap: 12px; }
.home-suggestions { margin-top: 30px; margin-bottom: auto; }
.home-suggestions-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 11px; color: #74777f; }
.home-suggestions-heading button { background: none; border: 0; color: inherit; padding: 8px 0 8px 12px; min-height: 36px; }
.home-suggestions-heading button i { margin-right: 5px; }
.home-prompt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home-prompt-card { border: 1px solid #e5e6e9; background: #fafafb; border-radius: 11px; padding: 17px 16px; text-align: left; color: var(--text-primary); }
.home-prompt-card:hover { background: #f3f4f6; border-color: #b9bdc6; }
.home-prompt-icon { display: flex; justify-content: space-between; color: #71757e; margin-bottom: 14px; font-size: 18px; }
.home-prompt-icon .bi-arrow-up-right { font-size: 12px; color: #92969f; }
.home-prompt-card strong { display: block; font-weight: 500; font-size: 12px; margin-bottom: 7px; }
.home-prompt-card small { display: block; color: #737780; font-size: 11px; line-height: 1.6; }
.home-providers { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-top: 30px; color: #777b84; font-size: 11px; }
.home-providers > span { font-size: 10px; }
.home-providers b { font-weight: 500; }
.home-footer { flex-shrink: 0; padding: 12px 20px 16px; color: #7b7e86; text-align: center; font-size: 10px; }
.home-footer span { border-left: 1px solid #d9dce1; padding-left: 12px; margin-left: 12px; }
.chat.is-empty #messages-box { display: none; }
#messages-box { padding-top: 20px; min-height: 0; }
#messages { max-width: 800px; }
.chat:not(.is-empty) .home-intro, .chat:not(.is-empty) .home-suggestions { display: none !important; }
.chat:not(.is-empty) .home-footer { display: none; }
.chat:not(.is-empty) .home-input-help { padding-bottom: 0; }
@media (max-width: 1100px) and (min-width: 992px) { .Sidebar { width: 218px; padding-left: 15px; padding-right: 15px; } .home-topbar { padding: 0 28px; } .home-intro, .chat-inpt-box, .home-suggestions { width: calc(100% - 64px); } }
@media (max-width: 991.98px) {
    .navbar { min-height: 68px; padding: 14px 22px !important; }
    .navbar-brand { font-size: 19px; }
    .navbar-toggler { min-width: 44px; min-height: 44px; }
    .home-topbar { height: 52px; padding: 0 22px; }
    .home-breadcrumb { font-size: 11px; }
    .home-top-actions { gap: 12px; }
    .home-announcement, .home-top-up { min-height: 36px; font-size: 11px; }
    .home-intro, .chat-inpt-box, .home-suggestions { width: calc(100% - 40px); }
    .chat.is-empty .home-workspace { padding-top: 30px; }
    #messages-box { padding-top: 16px; }
    #offcanvasSidebar .sidebar-nav { margin-top: 16px; }
    #offcanvasSidebar .sidebar-footer { margin-top: auto; }
}
@media (max-width: 600px) {
    .home-breadcrumb { display: none; }
    .home-topbar { justify-content: flex-end; }
    .home-eyebrow { font-size: 9px; letter-spacing: 1.2px; margin-bottom: 21px; }
    .home-intro h1 { font-size: 30px; line-height: 1.45; letter-spacing: -1px; }
    .home-intro p { font-size: 12px; max-width: 300px; }
    .chat.is-empty .chat-inpt-box { margin-top: 29px !important; }
    .chat-inpt-box .input-group { padding: 16px !important; border-radius: 14px !important; }
    .chat.is-empty .chat-inpt-box textarea { min-height: 126px !important; font-size: 16px; }
    .home-image-label { display: none; }
    .chat-inpt-box .input-group-append { gap: 2px !important; }
    .chat-inpt-box .input-group .btn { min-height: 44px !important; min-width: 44px; gap: 5px; padding: 0 5px !important; }
    .chat-inpt-box .input-group #sendButton { min-width: 44px; width: 44px !important; }
    .home-tool-label { font-size: 10px; }
    .home-input-help { font-size: 10px; }
    .home-input-help span:last-child { display: none; }
    .home-prompt-grid { grid-template-columns: 1fr; gap: 9px; }
    .home-prompt-card { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 0 10px; padding: 15px; min-height: 69px; }
    .home-prompt-icon { grid-row: 1 / 3; align-self: center; margin: 0; }
    .home-prompt-icon .bi-arrow-up-right { display: none; }
    .home-prompt-card strong { margin-bottom: 5px; }
    .home-providers { gap: 13px; }
    .home-providers > span { width: 100%; }
    .home-footer { font-size: 9px; line-height: 1.8; }
    .home-footer span { display: block; border: 0; margin: 0; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* Model controls share the input surface but retain their own geometry. */
.chat-inpt-box .input-group #dropdownMenuButton,
.chat-inpt-box .input-group #groupDropdownButton {
    width: auto !important; height: auto !important; min-height: 34px;
    padding: 7px 10px !important; margin: 0 !important;
    border-radius: 7px !important; font-size: 12px; line-height: 1.6;
    display: block; color: var(--text-primary); background: #fafafb;
}
.chat-inpt-box .input-group #groupDropdownButton { background: transparent; color: var(--home-muted); }
@media (pointer: coarse) {
    .chat-inpt-box .input-group #dropdownMenuButton,
    .chat-inpt-box .input-group #groupDropdownButton { min-height: 44px; }
    .home-suggestions-heading button, .home-announcement, .home-top-up { min-height: 44px; }
}
#dropdownMenuButton::before { content: "\F589"; font-family: "bootstrap-icons"; margin-right: 7px; font-weight: 400; }
@media (max-width: 991.98px) {
    .navbar { min-height: 76px; }
    .home-topbar { height: 0; padding: 0; }
    .home-breadcrumb, .home-announcement { display: none; }
    .home-top-actions { position: fixed; top: 20px; right: 86px; z-index: 20; }
    .chat.is-empty .home-workspace { padding-top: 48px; }
    .home-top-up { background: #fff; }
}

/* Keep the welcome composer spacious; reserve more room for active messages. */
.chat:not(.is-empty) .chat-inpt-box .input-group { padding: 10px 16px !important; }
.chat:not(.is-empty) .model-selector-wrapper { padding-bottom: 6px; }
.chat:not(.is-empty) .chat-inpt-box textarea {
    min-height: 32px !important;
    padding: 0 0 4px !important;
}
.chat:not(.is-empty) .chat-inpt-box .input-group-append { margin-top: 2px; }
/* History drawer uses the same neutral surfaces and typography as the workspace. */
#offcanvasNavbar.home-history-drawer {
    width: min(440px, 100vw); background: #fff; border: 0;
    border-left: 1px solid var(--border-color); box-shadow: -12px 0 48px #1118270d;
}
.home-history-header { padding: 28px 26px 22px; align-items: flex-start; }
.home-history-eyebrow { color: #797c84; font-size: 9px; letter-spacing: 1.7px; margin-bottom: 10px; }
.home-history-header .offcanvas-title { color: var(--text-primary); font-size: 23px; font-weight: 600; letter-spacing: -.6px; }
.home-history-header p { color: var(--home-muted); font-size: 12px; margin: 9px 0 0; }
.home-history-header .btn-close { margin: -4px -8px 0 12px; width: 32px; height: 32px; padding: 6px; background-size: 12px; border-radius: 8px; opacity: .5; }
.home-history-header .btn-close:hover { background-color: #f0f1f3; opacity: 1; }
.home-history-toolbar { display: flex; gap: 10px; padding: 0 26px 24px; border-bottom: 1px solid #eeeff1; }
.home-history-toolbar > button, .home-history-import {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
    flex: 1; min-width: 0; min-height: 38px; margin: 0; padding: 8px 12px;
    border: 1px solid #e3e5e9; border-radius: 8px; background: #fff;
    font-size: 12px; font-weight: 500; color: #535760; cursor: pointer;
}
.home-history-toolbar > button:hover, .home-history-import:hover { background: #f6f7f9; border-color: #cdd0d7; }
.home-history-import input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.home-history-body { padding: 22px 16px; }
.home-history-list-heading { display: flex; justify-content: space-between; padding: 0 10px 12px; font-size: 11px; color: #767a83; }
#offcanvasNavbar .chatMsgItem { display: flex; align-items: center; gap: 6px; margin: 3px 0; padding: 8px; background: transparent; border: 1px solid transparent; border-radius: 10px; transform: none; }
#offcanvasNavbar .chatMsgItem:hover { background: #f7f7f9; border-color: transparent; transform: none; }
#offcanvasNavbar .chatMsgItem.is-current { background: #f0f1f4; border-color: #e5e7eb; }
.home-history-open { display: flex; flex: 1; align-items: flex-start; gap: 12px; min-width: 0; padding: 7px 2px; border: 0; background: none; text-align: left; color: var(--text-primary); border-radius: 6px; }
.home-history-row-icon { font-size: 16px; color: #858992; margin-top: 2px; flex-shrink: 0; }
.home-history-copy { display: block; min-width: 0; }
.home-history-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; color: #353941; font-size: 13px; font-weight: 500; line-height: 1.65; }
.home-history-meta { display: block; margin-top: 4px; font-size: 10px; font-weight: 400; color: #7a7e87; }
.home-history-actions { display: flex; flex-shrink: 0; gap: 2px; }
.home-history-actions button { display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: #828791; width: 30px; height: 32px; padding: 0; font-size: 14px; }
.home-history-actions button:hover { background: #e5e7ec; color: #353941; }
.home-history-actions button[data-action="delete"]:hover { background: #fff0f0; color: #b53a43; }
.home-history-empty { padding: 65px 12px; text-align: center; color: var(--home-muted); }
.home-history-empty > i { display: block; font-size: 26px; margin-bottom: 16px; color: #9b9fa7; }
.home-history-empty strong { display: block; font-size: 14px; font-weight: 500; color: #555a63; }
.home-history-empty p { font-size: 12px; line-height: 1.8; margin: 9px 0 0; }
.home-history-footer { flex-shrink: 0; border-top: 1px solid #eeeff1; padding: 16px 26px; font-size: 11px; color: #777c86; background: #fafafb; }
.home-history-footer i { margin-right: 7px; }
@media (max-width: 600px), (pointer: coarse) {
    .home-history-actions { gap: 0; }
    .home-history-actions button { width: 44px; height: 44px; }
    .home-history-toolbar > button, .home-history-import { min-height: 44px; }
    .home-history-open { min-height: 44px; }
}
@media (max-width: 380px) {
    .home-history-header { padding: 24px 20px 20px; }
    .home-history-toolbar { padding: 0 20px 20px; }
    .home-history-body { padding: 20px 10px; }
    .home-history-open { gap: 8px; }
    .home-history-row-icon { display: none; }
}
