
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    color: #f5f5f5;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    overflow: hidden;
}

body {
    display: flex;
}

html.embedded-settings,
html.embedded-settings body {
    background: transparent !important;
}

html.embedded-settings body {
    display: block;
}

html.embedded-settings .app {
    display: none !important;
}

button, input, select {
    font: inherit;
}

button {
    cursor: pointer;
}

.material-symbols-rounded {
    font-size: 21px;
    line-height: 1;
    font-variation-settings:
        "FILL" 0,
        "wght" 400,
        "GRAD" 0,
        "opsz" 24;
}

.app {
    width: 100vw;
    height: 100vh;
    display: flex;
    background: #000000;
}

.sidebar {
    width: 230px;
    min-width: 230px;
    height: 100vh;
    background: #111111;
    border-right: 1px solid #242424;
    display: flex;
    flex-direction: column;
    transition: width 0.22s ease, min-width 0.22s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 56px;
    min-width: 56px;
}

.sidebar-header {
    min-height: 72px;
    padding: 0 18px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
}

.sidebar-toggle {
    margin-left: 0;
    order: 2;
}

.sidebar.collapsed .sidebar-header {
    min-height: 56px;
    padding: 0;
    flex-direction: column;
    justify-content: center;
    gap: 0;
}

.sidebar.collapsed .sidebar-toggle {
    margin-left: 0;
}

.sidebar-logo {
    width: 68px;
    height: 30px;
    max-height: 30px;
    object-fit: contain;
    margin-right: 8px;
}

.sidebar-logo.collapsed-logo {
    display: none;
}

.sidebar.collapsed .sidebar-logo {
    width: 20px;
    height: 20px;
    max-height: 20px;
    margin-right: 0;
}

.sidebar.collapsed .sidebar-logo.full-logo {
    display: none;
}

.sidebar.collapsed .sidebar-logo.collapsed-logo {
    display: block;
}

.sidebar-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #a0a0a0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: #202020;
    color: #f5f5f5;
}

.sidebar-toggle:hover {
    background: #202020;
}

.sidebar-toggle-tooltip {
    position: fixed;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    background: #242424;
    color: #f5f5f5;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) translateX(-3px);
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
}

.sidebar-toggle-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%);
}

.sidebar-toggle-tooltip kbd {
    padding: 2px 5px;
    border: 1px solid #484848;
    border-radius: 6px;
    background: #303030;
    color: inherit;
    font: inherit;
    font-size: 11px;
}

.chat-search-tooltip,
.sidebar-item-tooltip {
    position: fixed;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    background: #242424;
    color: #f5f5f5;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) translateX(-3px);
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
}

.chat-search-tooltip.is-visible,
.sidebar-item-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%);
}

.chat-search-tooltip kbd {
    padding: 2px 5px;
    border: 1px solid #484848;
    border-radius: 6px;
    background: #303030;
    color: inherit;
    font: inherit;
    font-size: 11px;
}

.modal.settings-modal.chat-search-modal {
    width: min(620px, 94vw);
    max-height: min(660px, 86vh);
    padding-top: 28px;
    overflow-y: auto;
    border: 0;
}

.chat-search-field {
    min-height: 46px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 999px;
    background: #000;
    color: #a0a0a0;
    transition: background-color 0.15s ease;
}

.chat-search-field > .sidebar-line-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
}

.chat-search-modal-input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: #f5f5f5;
    font-size: 14px;
}

.chat-search-modal-input:focus-visible {
    outline: none;
}

.chat-search-modal-input::placeholder {
    color: #888;
}

.chat-search-results {
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
    min-height: 110px;
    max-height: min(420px, 58vh);
    margin-top: 14px;
    padding: 0 2px 2px;
    scrollbar-color: #454545 transparent;
    scrollbar-width: thin;
}

.chat-search-results::-webkit-scrollbar {
    width: 6px;
}

.chat-search-results::-webkit-scrollbar-track {
    background: transparent;
}

.chat-search-results::-webkit-scrollbar-thumb {
    border: 1px solid transparent;
    border-radius: 999px;
    background: #454545;
    background-clip: padding-box;
}

.chat-search-results::-webkit-scrollbar-thumb:hover {
    background: #666;
    background-clip: padding-box;
}

.chat-search-result {
    width: 100%;
    min-height: 52px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #f5f5f5;
    text-align: left;
}

.chat-search-result:hover,
.chat-search-result:focus-visible {
    outline: none;
    background: #1b1b1b;
}

.chat-search-result-icon {
    flex: 0 0 auto;
    color: #999;
    font-size: 19px;
}

.chat-search-result-copy {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

.chat-search-result-title,
.chat-search-result-snippet {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-search-result-title {
    font-size: 13px;
    font-weight: 600;
}

.chat-search-result-snippet,
.chat-search-empty {
    color: #999;
    font-size: 12px;
}

.chat-search-empty {
    min-height: 110px;
    display: grid;
    place-items: center;
    padding: 14px 12px;
    color: #999;
    text-align: center;
}

html[data-theme="light"] .chat-search-tooltip,
html[data-theme="light"] .sidebar-item-tooltip {
    border-color: #dedede;
    background: #fff;
    color: #111;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
}

html[data-theme="light"] .chat-search-tooltip kbd,
html[data-theme="light"] .sidebar-item-tooltip kbd {
    border-color: #dedede;
    background: #f3f3f3;
}

html[data-theme="light"] .chat-search-field {
    background: #f5f5f5;
    color: #777;
}

html[data-theme="light"] .chat-search-field:focus-within {
    background: #f0f0f0;
}

html[data-theme="light"] .chat-search-modal-input {
    color: #111;
}

html[data-theme="light"] .chat-search-results {
    scrollbar-color: #c8c8c8 transparent;
}

html[data-theme="light"] .chat-search-results::-webkit-scrollbar-thumb {
    background: #c8c8c8;
    background-clip: padding-box;
}

html[data-theme="light"] .chat-search-results::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
    background-clip: padding-box;
}

html[data-theme="light"] .chat-search-modal-input::placeholder,
html[data-theme="light"] .chat-search-result-snippet,
html[data-theme="light"] .chat-search-empty {
    color: #777;
}

html[data-theme="light"] .chat-search-result {
    color: #111;
}

html[data-theme="light"] .chat-search-result:hover,
html[data-theme="light"] .chat-search-result:focus-visible {
    background: #f0f0f0;
}

.sidebar-actions {
    padding: 4px 14px 4px;
}
.sidebar.collapsed .sidebar-actions { padding: 4px 10px; }

.sidebar-product-nav {
    padding: 0 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-line-icon {
    display: block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-product-link {
    width: 100%;
    min-height: 36px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 999px;
    color: #d8d8d8;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.sidebar-product-link:hover { background: #202020; color: #fff; }
.sidebar-product-link .material-symbols-rounded { color: #aaa; font-size: 18px; }
.sidebar-product-link .sidebar-agent-icon { width: 18px; height: 18px; flex: 0 0 18px; object-fit: contain; border-radius: 5px; }
.product-link-hidden { display: none !important; }
.sidebar.collapsed .sidebar-product-nav { padding-inline: 10px; }
.sidebar.collapsed .sidebar-product-link { width: 36px; padding: 0; justify-content: center; }
.sidebar.collapsed .sidebar-product-link span:last-child { display: none; }
.sidebar.collapsed .sidebar-line-icon { width: 16px; height: 16px; flex-basis: 16px; }

.new-chat {
    width: 100%;
    height: 36px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: #f5f5f5;
    font-size: 13px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 8px;
    gap: 10px;
    white-space: nowrap;
}

.new-chat:hover {
    background: #202020;
}

.new-chat > .sidebar-action-icon {
    color: inherit;
}

.sidebar-toggle > .sidebar-panel-glyph {
    position: relative;
    width: 17px;
    height: 16px;
    border: 1.7px solid #d8d8d8;
    border-radius: 5px;
}

.sidebar-toggle > .sidebar-panel-glyph::before {
    content: "";
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 4px;
    width: 1.7px;
    border-radius: 999px;
    background: #d8d8d8;
}

.sidebar.collapsed .new-chat {
    width: 36px;
    padding: 0;
    margin: 0 auto;
    justify-content: center;
}




.hide-collapsed {
    display: inline;
}

.sidebar.collapsed .hide-collapsed {
    display: none !important;
}

.history-label {
    padding: 18px 12px 8px;
    color: #7d7d7d;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.chat-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0 10px 4px;
    scrollbar-color: #454545 transparent;
    scrollbar-width: thin;
}
.chat-list::-webkit-scrollbar { width: 6px; }
.chat-list::-webkit-scrollbar-track { background: transparent; }
.chat-list::-webkit-scrollbar-thumb {
    border: 1px solid transparent;
    border-radius: 999px;
    background: #454545;
    background-clip: padding-box;
}
.chat-list::-webkit-scrollbar-thumb:hover {
    background: #666;
    background-clip: padding-box;
}
html[data-theme="light"] .chat-list { scrollbar-color: #c8c8c8 transparent; }
html[data-theme="light"] .chat-list::-webkit-scrollbar-thumb {
    background: #c8c8c8;
    background-clip: padding-box;
}
html[data-theme="light"] .chat-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
    background-clip: padding-box;
}

.sidebar.collapsed .history-label,
.sidebar.collapsed .chat-list {
    display: none;
}

.chat-item {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    border-radius: 999px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    color: #d6d6d6;
    font-size: 13px;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.chat-item-title {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 8px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 8px), transparent 100%);
}

.chat-item-markers {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    color: #888;
    pointer-events: none;
}
.chat-item-markers .material-symbols-rounded { font-size: 15px; }
.chat-item:hover .chat-item-markers,
.chat-item.active .chat-item-markers { color: #bdbdbd; }

.chat-item:hover,
.chat-item.active {
    background: #1b1b1b;
    color: white;
}

.sidebar-spacer { display: none; }

.sidebar-footer {
    padding: 10px 14px 14px;
    border-top: 1px solid #242424;
    margin-top: auto;
    position: relative;
}
.sidebar.collapsed .sidebar-footer { padding: 8px 10px 10px; }

.user-btn {
    width: 100%;
    height: 42px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
    font-size: 13px;
}

.user-btn:hover {
    background: #202020;
}
/* Usage & Resets lives in the account menu (click your name). Same look as the Usage & Resets panel. */
.sidebar-footer #creditsButton { display: none; }
.account-menu { position: absolute; left: 0; right: 0; bottom: calc(100% - 2px); z-index: 1000; background: rgba(15, 15, 15, 0.96); border: 0; border-radius: 18px; padding: 14px; box-shadow: 0 24px 60px rgba(0,0,0,0.4); min-width: 0; max-height: min(620px, calc(100vh - 170px)); overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; }
.account-menu::-webkit-scrollbar { display: none; }
.account-menu[hidden], .account-menu [hidden] { display: none !important; }
.sidebar.collapsed .account-menu { right: auto; width: 290px; }
.account-menu [data-am-view] { display: flex; flex-direction: column; gap: 2px; }
.account-menu h3 { margin: 0 0 8px; color: #f5f5f5; font-size: 15px; }
.account-menu .am-note { margin: 0 0 12px; padding: 0; color: #bdbdbd; font-size: 13px; line-height: 1.5; }
.account-menu button { width: 100%; min-height: 40px; border: 0; background: transparent; color: #f5f5f5; padding: 0 10px; border-radius: 999px; text-align: left; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 650; cursor: pointer; }
.account-menu button:hover, .account-menu button:focus-visible { background: #202020; color: #ffffff; outline: none; }
.account-menu button:disabled { opacity: .45; cursor: not-allowed; }
.account-menu button:not(.am-primary):disabled:hover { background: transparent; }
.account-menu .sidebar-line-icon, .account-menu .material-symbols-rounded { width: 18px; height: 18px; font-size: 18px; color: #a8a8a8; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.account-menu .am-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-menu small { color: #999; font-size: 12px; font-weight: 600; }
.account-menu .am-back { width: auto; align-self: flex-start; min-height: 34px; margin: 0 0 12px; padding: 0 9px; gap: 5px; color: #bdbdbd; }
.account-menu .am-primary { min-height: 36px; justify-content: center; gap: 8px; background: #ffffff; color: #111111; font-weight: 750; }
.account-menu .am-primary:hover, .account-menu .am-primary:focus-visible { background: #e9e9e9; color: #111111; }
.account-menu .am-primary:disabled { background: #ffffff; }
.account-menu .am-primary .material-symbols-rounded, .account-menu .am-primary small { color: #111111; }
.account-menu .am-primary small { opacity: .6; }
.account-menu .am-quiet { min-height: 36px; margin-top: 8px; justify-content: center; gap: 8px; color: #a8a8a8; }
.account-menu #amAccounts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.account-menu .am-row { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 14px; background: #141414; }
.account-menu .am-acct { min-height: 44px; padding: 6px 8px; border-radius: 10px; font-weight: 400; }
.account-menu .am-acct:hover { background: #1f1f1f; }
.account-menu .am-acct[aria-current="true"] { cursor: default; }
.account-menu .am-acct[aria-current="true"]:hover { background: transparent; }
.account-menu .am-av { width: 30px; height: 30px; border-radius: 50%; background: #2b2b2b; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; overflow: hidden; }
.account-menu .am-av img { width: 100%; height: 100%; object-fit: cover; }
.account-menu .am-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.account-menu .am-who b, .account-menu .am-who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-menu .am-who b { color: #f5f5f5; font-weight: 650; font-size: 13px; }
.account-menu .am-who small { font-weight: 400; }
.account-menu .am-check { color: #71dda0 !important; }
.account-menu .am-x { width: 32px; min-height: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 50%; flex: none; }
.account-menu .am-danger, .account-menu .am-danger .material-symbols-rounded { color: #ff8585; }
.account-menu .am-danger:hover { color: #ff8585; }
.account-menu .am-status { margin-top: 7px; padding: 0 4px; color: #ff8585; font-size: 12px; line-height: 1.45; }
.account-menu .am-status:empty { display: none; }
.account-menu .am-status.am-info { color: #a9a9a9; }
.user-btn .am-hint { margin-left: auto; padding: 3px 10px; border-radius: 999px; background: #f5f5f5; color: #111; font-size: 12px; font-weight: 650; white-space: nowrap; }
.sidebar.collapsed .user-btn .am-hint { display: none; }
@media (max-width: 900px) {
    .account-menu { border-radius: 16px; z-index: 10050; max-height: min(62vh, 620px); -webkit-overflow-scrolling: touch; }
}
html[data-theme="light"] .account-menu { background: rgba(255,255,255,0.98); box-shadow: 0 24px 60px rgba(0,0,0,0.12); }
html[data-theme="light"] .account-menu h3, html[data-theme="light"] .account-menu .am-who b { color: #111111; }
html[data-theme="light"] .account-menu .am-note { color: #666666; }
html[data-theme="light"] .account-menu button { color: #111111; }
html[data-theme="light"] .account-menu button:hover, html[data-theme="light"] .account-menu button:focus-visible { background: #eeeeee; color: #111111; }
html[data-theme="light"] .account-menu .sidebar-line-icon, html[data-theme="light"] .account-menu .material-symbols-rounded { color: #666666; }
html[data-theme="light"] .account-menu .am-back, html[data-theme="light"] .account-menu .am-quiet { color: #666666; }
html[data-theme="light"] .account-menu .am-primary, html[data-theme="light"] .account-menu .am-primary:disabled { background: #111111; color: #ffffff; }
html[data-theme="light"] .account-menu .am-primary:hover, html[data-theme="light"] .account-menu .am-primary:focus-visible { background: #2a2a2a; color: #ffffff; }
html[data-theme="light"] .account-menu .am-primary .material-symbols-rounded, html[data-theme="light"] .account-menu .am-primary small { color: #ffffff; }
html[data-theme="light"] .account-menu .am-row { background: #f7f7f7; }
html[data-theme="light"] .account-menu .am-acct:hover { background: #ececec; }
html[data-theme="light"] .account-menu .am-acct[aria-current="true"]:hover { background: transparent; }
html[data-theme="light"] .account-menu .am-av { background: #e4e4e4; color: #222222; }
html[data-theme="light"] .account-menu .am-check { color: #1f9d5a !important; }
html[data-theme="light"] .account-menu .am-danger, html[data-theme="light"] .account-menu .am-danger .material-symbols-rounded { color: #d33a3a; }
html[data-theme="light"] .account-menu .am-status { color: #d33a3a; }
html[data-theme="light"] .account-menu .am-status.am-info { color: #666666; }
html[data-theme="light"] .user-btn .am-hint { background: #111; color: #fff; }

.sidebar.collapsed .user-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
    margin: 0 auto;
    height: 36px;
}

.avatar {
    width: 26px;
    min-width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #dcdcdc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main {
    flex: 1;
    min-width: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #0b0b0b;
}

.topbar {
    height: 64px;
    min-height: 64px;
    border-bottom: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 18px;
    position: relative;
}

.model-area {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 260px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.top-btn {
    height: 38px;
    border-radius: 999px;
    border: 1px solid #303030;
    background: #171717;
    color: #f5f5f5;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-btn:hover {
    background: #202020;
}

.upgrade-plan-pill {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid #303030;
    border-radius: 999px;
    background: #f5f5f5;
    color: #0a0a0a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}
.upgrade-plan-pill[hidden] { display: none !important; }

.upgrade-plan-pill:hover { background: #ffffff; }

.credits-widget {
    position: relative;
    width: 100%;
    margin-bottom: 6px;
}

.sidebar-credits-btn {
    width: 100%;
    min-height: 40px;
    padding: 0 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #f5f5f5;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 650;
    text-align: left;
}
.sidebar-credits-btn:hover { background: #202020; }
.sidebar-credits-btn > .sidebar-line-icon { color: #a8a8a8; }
.sidebar-credits-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.credits-summary-text { color: #999999; font-size: 12px; white-space: nowrap; }
.sidebar.collapsed .sidebar-credits-btn { width: 36px; min-height: 36px; padding: 0; margin: 0 auto; justify-content: center; }
.sidebar.collapsed .sidebar-credits-label,
.sidebar.collapsed .credits-summary-text { display: none; }

.guest-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid #303030;
    background: #151515;
    color: #dcdcdc;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.install-pwa-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #303030;
    background: #ffffff;
    color: #000000;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.install-pwa-btn .material-symbols-rounded {
    font-size: 18px;
}

.guest-pill button,
.guest-signin-btn {
    border: 0;
    background: #ffffff;
    color: #000000;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.guest-pill button {
    height: 28px;
    padding: 0 10px;
}

.guest-signin-btn {
    width: 100%;
    min-height: 42px;
    margin-bottom: 14px;
}

.guest-note {
    margin: 0 0 14px;
    color: #a8a8a8;
    font-size: 13px;
    line-height: 1.45;
}

.credits-pill {
    background: #171717;
    border-color: #303030;
    color: #f5f5f5;
    padding: 0 14px;
}

.credits-mobile-text {
    display: none;
}

.mobile-model-slot {
    display: none;
}

.credits-pill.low {
    border-color: #ffb347;
    color: #ffd48b;
}

.low-credit-toast {
    position: fixed;
    top: 72px;
    right: 20px;
    width: min(360px, calc(100vw - 32px));
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid #4a3d28;
    border-radius: 16px;
    background: rgba(20, 20, 20, 0.98);
    color: #f5f5f5;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
    z-index: 10060;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.low-credit-toast.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.low-credit-toast.out { border-color: #653535; }
.low-credit-toast-icon { color: #ffbe66; font-size: 23px; flex: 0 0 auto; }
.low-credit-toast.out .low-credit-toast-icon { color: #ff7979; }
.low-credit-toast-content { min-width: 0; flex: 1; }
.low-credit-toast-title { margin: 0; font-size: 14px; font-weight: 750; line-height: 1.3; }
.low-credit-toast-message { margin: 4px 0 11px; color: #bdbdbd; font-size: 13px; line-height: 1.4; }
.low-credit-toast-action {
    min-height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: #f3f3f3;
    color: #111111;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}
.low-credit-toast-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.low-credit-toast-action.secondary {
    background: transparent;
    color: #e8e8e8;
    border: 1px solid #454545;
}
.low-credit-toast-close {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #a8a8a8;
    cursor: pointer;
}
.low-credit-toast-close:hover { background: #2b2b2b; color: #ffffff; }
.low-credit-toast-close .material-symbols-rounded { font-size: 19px; }

@media (max-width: 600px) {
    .low-credit-toast { top: 66px; right: 12px; width: calc(100vw - 24px); }
}

.icon-pill-btn {
    height: 38px;
    width: 38px;
    border-radius: 999px;
    border: 1px solid #303030;
    background: #171717;
    color: #f5f5f5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-pill-btn:hover {
    background: #202020;
}

.credits-panel,
.credits-info-panel {
    position: absolute;
    left: -14px;
    bottom: calc(100% + 8px);
    top: auto;
    right: -14px;
    width: auto;
    min-width: 0;
    max-width: none;
    background: rgba(15, 15, 15, 0.96);
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.4);
    z-index: 1000;
    display: none;
    padding: 14px;
    max-height: min(620px, calc(100vh - 170px));
    overflow-y: auto;
    scrollbar-width: none;
}
.credits-panel::-webkit-scrollbar,
.credits-info-panel::-webkit-scrollbar { display: none; }

.credits-panel.open,
.credits-info-panel.open {
    display: block;
}

.credits-panel h3,
.credits-info-panel h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.credits-panel p,
.credits-info-panel p {
    margin: 0 0 10px;
    color: #bdbdbd;
    font-size: 13px;
    line-height: 1.5;
}

.credits-stat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.credits-stat-item {
    border: 0;
    border-radius: 12px;
    padding: 8px 10px;
    background: #141414;
}

.credits-stat-item strong {
    display: block;
    color: white;
    margin-bottom: 2px;
}

.credits-stat-item span {
    color: #b9b9b9;
    font-size: 12px;
}

.credits-section-divider {
    width: 100%;
    height: 1px;
    background: #303030;
    margin: 18px 0;
}

.credits-reset-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 16px;
    background: #141414;
}

.credits-reset-section { padding: 2px 0 0; }
.credits-reset-count { width: 100%; color: #f5f5f5; font-size: 14px; font-weight: 750; text-align: left; }
.credits-usage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.credits-usage-head strong { color: #f5f5f5; font-size: 14px; font-weight: 750; }
.credits-usage-head > span { color: #a0a0a0; font-size: 13px; font-weight: 600; white-space: nowrap; }
.credits-usage-track { position: relative; width: 100%; height: 18px; margin-top: 12px; overflow: hidden; border: 0; border-radius: 999px; background: #2b2b2b; }
.credits-usage-fill { width: 0%; min-width: 0; height: 100%; border-radius: inherit; background: #f5f5f5; transition: width .3s ease; }
.credits-next-reset { margin: 4px 0 0 !important; color: #999 !important; font-size: 12px !important; }
.credits-reset-btn {
    width: 100%;
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: #ffffff;
    color: #111111;
    font-weight: 750;
    cursor: pointer;
}
.credits-reset-btn:disabled { opacity: .45; cursor: not-allowed; }
.credits-reset-status { min-height: 18px; margin-top: 7px; color: #a9a9a9; font-size: 12px; }
.credits-reset-status.error { color: #ff8585; }
.credits-reset-status.success { color: #71dda0; }
.credits-about-btn {
    width: 100%;
    min-height: 36px;
    margin-top: 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #a8a8a8;
    font-weight: 650;
    cursor: pointer;
}
.credits-about-btn:hover { background: #202020; color: #ffffff; }
.credits-upgrade-section {
    margin-top: 12px;
    padding: 13px;
    border: 0;
    border-radius: 16px;
    background: #141414;
}
.credits-upgrade-section[hidden] { display: none; }
.credits-upgrade-section strong { display: block; color: #f5f5f5; font-size: 14px; }
.credits-upgrade-section p { margin: 5px 0 11px; }
.credits-upgrade-link {
    min-height: 36px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ffffff;
    color: #111111;
    text-decoration: none;
    font-size: 13px;
    font-weight: 750;
}
.credits-info-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    margin: 0 0 12px;
    padding: 0 9px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #bdbdbd;
    font-weight: 650;
}
.credits-info-back:hover { background: #202020; color: #ffffff; }
.credits-info-back .material-symbols-rounded { font-size: 18px; }

.content-area {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.content-area.welcome-mode {
    justify-content: center;
}

.content-area.welcome-mode .chat-window {
    flex: 0 0 auto;
    overflow: visible;
    padding-bottom: 0;
    transform: translateY(-30px);
}

.content-area.welcome-mode .input-area {
    transform: translateY(-10px);
}

.chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 52px max(22px, calc((100% - 760px) / 2)) 24px;
}

.welcome {
    text-align: center;
}

.welcome-text {
    font-size: 30px !important;
    font-weight: 700;
    color: #ffffff !important;
    margin: 0;
    letter-spacing: -0.02em;
}

.welcome img {
    max-width: 120px;
    max-height: 70px;
    object-fit: contain;
    margin-bottom: 24px;
}

.welcome h1 {
    margin: 0;
    font-size: clamp(42px, 7vw, 64px);
    font-weight: 750;
    letter-spacing: -0.04em;
}

.welcome p {
    color: #a0a0a0;
    font-size: 18px;
    margin-top: 14px;
}

.launch-banner {
    margin: 26px auto 0;
    display: inline-flex;
    border: 1px solid #303030;
    background: #151515;
    color: #dcdcdc;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
}

.message {
    display: flex;
    flex-direction: column;
    margin-bottom: 28px;
    align-items: flex-start;
}

.message.user {
    align-items: flex-end;
}

.message.ai {
    align-items: flex-start;
}

.message.support {
    align-items: stretch;
}

.message.ai .bubble {
    width: 100%;
    max-width: 760px;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

.bubble {
    max-width: 760px;
    line-height: 1.65;
    font-size: 15px;
    white-space: pre-wrap;
    word-break: break-word;
}

.user .bubble {
    background: #1a1a1a;
    border: 0;
    padding: 12px 18px;
    border-radius: 24px;
}

.timer-row {
    display: flex;
    justify-content: flex-start;
    margin: -10px 0 32px;
}

.secret-timer {
    width: min(100%, 760px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.timer-card {
    width: min(100%, 420px);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px;
    border: 1px solid #2d223c;
    border-radius: 36px;
    background: radial-gradient(circle at 34% 18%, rgba(143, 88, 255, 0.18), transparent 42%), #101010;
    box-shadow: 0 22px 70px rgba(0,0,0,0.32);
}

.timer-face {
    position: relative;
    width: 178px;
    aspect-ratio: 1;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
}

.timer-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 18px rgba(143, 88, 255, 0.24));
    transform: rotate(-90deg);
}

.timer-ring-track,
.timer-ring-progress {
    fill: none;
    stroke-width: 14;
}

.timer-ring-track {
    stroke: #242028;
}

.timer-ring-progress {
    stroke: #8f58ff;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.22s linear;
}

.timer-core {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: #101010;
    border: 1px solid #2d2d2d;
    box-shadow: inset 0 0 26px rgba(143, 88, 255, 0.12);
}

.timer-time {
    position: relative;
    z-index: 1;
    color: #ffffff;
    font-size: 38px;
    font-weight: 760;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.timer-label {
    position: absolute;
    z-index: 1;
    bottom: 42px;
    color: #aaa0ba;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.timer-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    min-width: 112px;
}

.timer-control-btn {
    min-width: 112px;
    height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid #343036;
    background: #181818;
    color: #f5f5f5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.timer-control-btn:hover {
    background: #242424;
    border-color: #4a4a4a;
}

.timer-control-btn .material-symbols-rounded {
    font-size: 20px;
}

.timer-ended-row {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d8d0e8;
    font-size: 14px;
    font-weight: 650;
}

.timer-replay-btn {
    height: 36px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid #343434;
    background: #181818;
    color: #f5f5f5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 650;
}

.timer-replay-btn:hover {
    background: #242424;
    border-color: #4a4a4a;
}

.timer-replay-btn .material-symbols-rounded {
    font-size: 18px;
}

.markdown-content {
    white-space: normal;
}

.markdown-content p,
.markdown-content ul,
.markdown-content ol,
.markdown-content blockquote,
.markdown-table-wrap,
.markdown-image {
    margin: 0 0 12px;
}

.markdown-content p:last-child,
.markdown-content ul:last-child,
.markdown-content ol:last-child,
.markdown-content blockquote:last-child,
.markdown-table-wrap:last-child,
.markdown-image:last-child {
    margin-bottom: 0;
}

.markdown-content h2,
.markdown-content h3 {
    margin: 16px 0 8px;
    line-height: 1.25;
    font-weight: 750;
}

.markdown-content h2:first-child,
.markdown-content h3:first-child {
    margin-top: 0;
}

.markdown-content h2 {
    font-size: 22px;
}

.markdown-content h3 {
    font-size: 18px;
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 22px;
}

.markdown-content li {
    margin: 4px 0;
}

.markdown-content blockquote {
    border-left: 3px solid #4a4a4a;
    color: #cfcfcf;
    padding-left: 12px;
}

.markdown-content code.inline-code {
    background: #1f1f1f;
    border: 1px solid #343434;
    border-radius: 6px;
    padding: 1px 5px;
    font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
    font-size: 0.92em;
}

.markdown-content a {
    color: #7fb3ff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.markdown-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: #a0a0a0;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 8px;
}

.markdown-copy-btn:hover {
    background: #262626;
    color: #f5f5f5;
}

.markdown-copy-btn.copied {
    color: #8fd18f;
}

.markdown-image {
    display: block;
    max-width: min(100%, 520px);
    max-height: 420px;
    border-radius: 12px;
    object-fit: contain;
    background: #000000;
}

.markdown-table-wrap {
    position: relative;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #343434;
    border-radius: 12px;
}

.markdown-table-tools,
.markdown-output-tools {
    display: flex;
    justify-content: flex-end;
    padding: 8px 10px;
    background: #1c1c1c;
    border-bottom: 1px solid #303030;
}

.markdown-content table {
    width: 100%;
    min-width: 360px;
    border-collapse: collapse;
    font-size: 14px;
}

.markdown-content th,
.markdown-content td {
    border-bottom: 1px solid #303030;
    padding: 9px 11px;
    text-align: left;
    vertical-align: top;
}

.markdown-content th {
    background: #1c1c1c;
    color: #ffffff;
    font-weight: 700;
}

.markdown-content tr:last-child td {
    border-bottom: 0;
}

.markdown-quote-wrap,
.markdown-output-block {
    margin: 0 0 12px;
}

.markdown-quote-wrap blockquote {
    margin-bottom: 8px;
}

.markdown-output-block {
    border: 1px solid #343434;
    border-radius: 12px;
    overflow: hidden;
}

.markdown-output-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    background: #1c1c1c;
    border-bottom: 1px solid #303030;
    font-weight: 700;
}

.markdown-output-body {
    padding: 12px;
}

.code-block-wrapper {
    margin: 12px 0;
    border: 1px solid #343434;
    border-radius: 14px;
    overflow: hidden;
    background: #141414;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #1c1c1c;
    border-bottom: 1px solid #2a2a2a;
    font-size: 12px;
    color: #999;
}

.code-block-lang {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.code-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: #a0a0a0;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 8px;
}

.code-copy-btn:hover {
    background: #262626;
    color: #f5f5f5;
}

.code-copy-btn.copied {
    color: #8fd18f;
}

.code-block-wrapper pre {
    margin: 0;
    padding: 14px;
    overflow-x: auto;
}

.code-block-wrapper code {
    font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.55;
    color: #e6e6e6;
    white-space: pre;
}

.typing-row {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 28px;
}

.typing-bubble {
    color: #a0a0a0;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.65;
    font-size: 15px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #a0a0a0;
    border-radius: 50%;
    animation: typingPulse 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typingPulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

.thinking-card {
    width: min(100%, 760px);
    color: #a8a8a8;
}

.thinking-summary {
    min-height: 34px;
    padding: 5px 11px;
    border: 0;
    background: transparent;
    color: #a8a8a8;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    cursor: pointer;
}

.thinking-summary:hover {
    background: #171717;
    color: #eeeeee;
}

.thinking-summary-left {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.thinking-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #a0a0a0;
    animation: thinkingGlow 1.2s ease-in-out infinite;
}

.thinking-chevron {
    font-size: 18px;
    opacity: 0.7;
}

.thinking-details {
    margin: 8px 0 0 9px;
    padding: 2px 0 2px 14px;
    border-left: 1px solid #303030;
}

.thinking-card.expanded {
    width: min(100%, 760px);
}

.thinking-card.expanded .thinking-summary {
    width: auto;
    min-height: 34px;
    padding: 5px 11px;
    justify-content: flex-start;
    border-radius: 999px;
    background: transparent;
    color: #eeeeee;
}

.thinking-card.expanded .thinking-details {
    width: 100%;
    min-height: 0;
    margin: 10px 0 0;
    padding: 0 11px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.thinking-details[hidden] {
    display: none;
}

.thinking-live-status {
    margin: 0 0 12px;
    color: #a8a8a8;
    font-size: 14px;
    line-height: 1.55;
}

.thinking-narrative {
    width: 100%;
    max-width: 760px;
    color: #d8d8d8;
    font-size: 15px;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.thinking-narrative p {
    margin: 0 0 12px;
}

.thinking-narrative p:last-child {
    margin-bottom: 0;
}

.thinking-summary-waiting {
    color: #8f8f8f;
    font-size: 15px;
    line-height: 1.65;
}

.image-generation-progress {
    width: min(100%, 640px);
}

.image-generation-placeholder {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: min(64vh, 640px);
    overflow: hidden;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #141414;
}

.image-generation-placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 55%;
    transform: translateX(-180%) skewX(-12deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.11), transparent);
    animation: imageGenerationSweep 1.7s ease-in-out infinite;
}

.image-generation-placeholder .material-symbols-rounded {
    color: #555555;
    font-size: 42px;
}

.image-generation-status {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 12px;
    color: #b9b9b9;
    font-size: 15px;
    line-height: 1.5;
}

.image-generation-status .thinking-pulse {
    margin-top: 7px;
    flex: 0 0 auto;
}

.image-generation-status-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.image-generation-status-copy small {
    color: #858585;
    font-size: 13px;
}

@keyframes imageGenerationSweep {
    0% { transform: translateX(-180%) skewX(-12deg); }
    55%, 100% { transform: translateX(300%) skewX(-12deg); }
}

html[data-theme="light"] .thinking-card.expanded .thinking-summary {
    background: transparent;
    color: #111111;
}

html[data-theme="light"] .thinking-card.expanded .thinking-details {
    border: 0;
    background: transparent;
}

html[data-theme="light"] .thinking-summary:hover,
html[data-theme="light"] .thinking-card.expanded .thinking-summary:hover {
    background: #e8e8e8;
    color: #111111;
}

html[data-theme="light"] .thinking-live-status { color: #666666; }
html[data-theme="light"] .thinking-narrative { color: #242424; }
html[data-theme="light"] .thinking-summary-waiting { color: #707070; }
html[data-theme="light"] .image-generation-placeholder { background: #e8e8e8; }
html[data-theme="light"] .image-generation-placeholder::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); }
html[data-theme="light"] .image-generation-placeholder .material-symbols-rounded { color: #aaaaaa; }
html[data-theme="light"] .image-generation-status { color: #333333; }
html[data-theme="light"] .image-generation-status-copy small { color: #777777; }

@keyframes thinkingGlow {
    0%, 100% {
        opacity: 0.35;
        transform: scale(0.85);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

.input-area {
    padding: 18px max(22px, 18vw) 24px;
}

.queued-message-bar {
    width: min(calc(100% - 36px), 680px);
    min-height: 46px;
    margin: 0 auto -10px;
    padding: 8px 14px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    background: #202020;
    border: 1px solid #343434;
    border-bottom: 0;
    border-radius: 18px 18px 0 0;

    position: relative;
    z-index: 0;
}

.queued-message-bar[hidden] {
    display: none !important;
}

.queued-message-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.queued-message-label {
    color: #8f8f8f;
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 auto;
}

.queued-message-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #eeeeee;
    font-size: 13px;
}

.queued-message-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.queued-message-actions button {
    border: 0;
    background: transparent;
    color: #a8a8a8;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
}

.queued-message-actions button:hover {
    background: #303030;
    color: white;
}

.upload-preview {
    display: none;
    width: 100%;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 2px 6px 4px;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.upload-preview.open {
    display: flex;
}

.upload-preview-item {
    position: relative;
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
}

.upload-preview-thumb {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    display: block;
}

.upload-preview-expand {
    width: 100%;
    height: 100%;
    padding: 0;
    display: block;
    border: 0;
    border-radius: 12px;
    background: transparent;
    cursor: zoom-in;
    overflow: hidden;
}

.upload-preview-expand:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.upload-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #4a4a4a;
    border-radius: 50%;
    background: #202020;
    color: #dcdcdc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.upload-preview-remove:hover {
    background: #2a2a2a;
    color: #ffffff;
}

.input-shell {
    background: #171717;
    border: 1px solid #343434;
    border-radius: 30px;
    min-height: 58px;
    display: flex;
    align-items: center;
    padding: 7px 8px 7px 12px;
    position: relative;
z-index: 1;
}

.input-shell input,
.input-shell textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    padding: 12px 8px;
    font-size: 15px;
}

.input-shell textarea {
    min-height: 24px;
    max-height: 150px;
    resize: none;
    line-height: 1.45;
    overflow-y: auto;
    font-family: inherit;
}

.send-btn {
    height: 42px;
    border-radius: 999px;
    border: none;
    background: white;
    color: black;
    padding: 0 18px;
    font-weight: 700;
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.68);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-backdrop.open {
    display: flex;
}

/* Drag images onto the chat: same backdrop and card as Kyro's modals, with a dashed edge */
.image-drop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.68);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    pointer-events: none;
}
.image-drop-overlay.open { display: flex; }
.image-drop-card {
    width: min(440px, 92vw);
    background: #111;
    border: 2px dashed #4a4a4a;
    border-radius: 28px;
    padding: 34px 24px 26px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.55);
    text-align: center;
}
.image-drop-card .material-symbols-rounded { font-size: 42px; color: #f5f5f5; }
.image-drop-card h2 { margin: 10px 0 8px; font-size: 22px; }
.image-drop-card .confirm-modal-text { margin: 0; }

.modal {
    width: min(440px, 92vw);
    background: #111;
    border: 1px solid #303030;
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.55);
}

.modal h2 {
    margin: 0 0 16px;
    font-size: 22px;
}

.desktop-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    background: #ffffff;
    color: #080808;
    font-weight: 700;
    text-decoration: none;
}
.desktop-download-btn:hover { background: #e8e8e8; }
.desktop-download-btn .windows-logo { width: 18px; height: 18px; flex: 0 0 auto; }
.desktop-download-btn .material-symbols-rounded { font-size: 19px; }
.modal.desktop-download-modal { position: relative; width: min(760px, 92vw); max-height: 92vh; overflow-y: auto; text-align: center; padding: 30px 32px 26px; }
.desktop-download-modal .settings-close-btn { position: absolute; top: 13px; right: 13px; }
.desktop-download-logo-wrap { margin: 0 auto 17px; }
.desktop-download-logo-wrap img { display: block; width: 104px; height: auto; margin: 0 auto; object-fit: contain; }
.desktop-download-preview { display: block; width: 100%; max-height: 340px; margin: 0 auto 20px; object-fit: contain; cursor: zoom-in; }
.desktop-download-modal h2 { margin: 0; font-size: 24px; letter-spacing: -.45px; }
.desktop-download-modal .confirm-modal-text { max-width: 520px; margin: 10px auto 22px; line-height: 1.5; }
.desktop-download-modal .modal-actions { display: grid; gap: 9px; margin: 0; }
.desktop-download-modal .modal-actions button { min-height: 38px; border: 0; background: transparent; color: #a8a8a8; font: inherit; cursor: pointer; }
.desktop-download-modal .modal-actions button:hover { color: #ffffff; }
.desktop-download-note { margin: 16px 0 0; color: #838383; font-size: 12px; }
.desktop-top-download-btn { min-height: 38px; padding: 0 13px; border: 1px solid #303030; border-radius: 999px; background: #171717; color: #f5f5f5; display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.desktop-top-download-btn:hover { background: #222222; }
/* "Get desktop app" is for computers only: never on phones or tablets (the script sets hidden; this makes it stick,
   and the media query covers the moment before the script runs on touch-only devices). */
#sidebarDesktopDownload[hidden], #topDesktopDownload[hidden], #desktopAppSettingsNav[hidden], #panel-desktop-app[hidden] { display: none !important; }
@media (hover: none) and (pointer: coarse) { #sidebarDesktopDownload, #topDesktopDownload, #desktopAppSettingsNav { display: none !important; } }
.desktop-top-download-btn .material-symbols-rounded { font-size: 18px; }
.desktop-app-setting-card { padding: 16px; border: 1px solid #303030; border-radius: 16px; background: #151515; }
.desktop-app-setting-card b { display: block; font-size: 15px; }
.desktop-app-setting-card small { display: block; margin-top: 5px; color: #9a9a9a; line-height: 1.45; }

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 18px 0;
}

.setting-row small {
    display: block;
    color: #888;
    margin-top: 4px;
    line-height: 1.4;
}

.toggle {
    width: 50px;
    min-width: 50px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid #444;
    background: #333;
    position: relative;
}

.toggle::before {
    content: "";
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: 0.2s;
}

.toggle.on {
    background: #f5f5f5;
}

.toggle.on::before { background: #111111; }

.toggle.on::before {
    left: 24px;
}

.name-input {
    width: 100%;
    background: #0b0b0b;
    color: white;
    border: 1px solid #343434;
    border-radius: 999px;
    padding: 12px 14px;
    outline: none;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.modal-actions button {
    flex: 1;
    height: 42px;
    border-radius: 999px;
    border: 1px solid #343434;
    background: #181818;
    color: white;
}

.modal-actions .primary {
    background: white;
    color: black;
    border: none;
}

 .input-shell { position: relative; }

.input-shell .input-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c8c8c8;
    background: transparent;
    transition: 0.2s ease;
}

.input-shell .input-icon-btn:hover {
    background: #242424;
    color: white;
}

.input-shell .input-icon-btn.active {
    background: #2f2f2f;
    color: white;
}

.input-shell .input-icon-btn.primary {
    background: white;
    color: black;
}

.input-shell .input-icon-btn.primary:disabled {
    opacity: 0.6;
    cursor: default;
}

.input-shell .plus-menu {
    position: absolute;
    left: 10px;
    bottom: 72px;
    background: #161616;
    border: 1px solid #343434;
    border-radius: 18px;
    min-width: 220px;
    display: none;
    z-index: 1000;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
    padding: 6px;
}

.input-shell .plus-menu.open {
    display: flex;
    flex-direction: column;
}

.input-shell .plus-menu button {
    border: none;
    background: none;
    color: white;
    padding: 11px 12px;
    border-radius: 12px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.input-shell .plus-menu button:hover {
    background: #212121;
}

.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.message.user .message-actions {
    justify-content: flex-start;
}

.message:hover .message-actions {
    opacity: 1;
    pointer-events: auto;
}

.message-action-btn {
    border: none;
    background: transparent;
    color: #a6a6a6;
    padding: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.message-sources-control {
    position: relative;
    display: inline-flex;
}

.sources-button {
    width: auto;
    padding: 0 7px;
    gap: 5px;
}

.sources-button-label {
    font-size: 12px;
}

.message-sources-panel {
    position: absolute;
    left: 0;
    bottom: 36px;
    width: min(330px, calc(100vw - 32px));
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    background: #181818;
    border: 1px solid #343434;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(0,0,0,.38);
    z-index: 40;
}

.message-sources-control.open
.message-sources-panel {
    display: flex;
}

.message-sources-panel a {
    min-height: 40px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    border-radius: 10px;
    color: #dddddd;
    text-decoration: none;
    font-size: 13px;
}

.message-sources-panel a:hover {
    background: #242424;
    color: white;
}

.message-sources-panel
.material-symbols-rounded {
    font-size: 18px;
    color: #8f8f8f;
}

.message-action-btn:hover {
    color: white;
}

.message-action-btn.feedback-selected {
    color: #8fd18f;
}

.message-action-btn.feedback-negative.feedback-selected {
    color: #ff8f8f;
}

.message-model-info {
    position: relative;
    display: inline-flex;
}

.message-model-popover {
    position: absolute;
    right: 0;
    bottom: 34px;
    z-index: 20;
    display: none;
    width: max-content;
    max-width: min(260px, calc(100vw - 32px));
    padding: 8px 10px;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    background: #181818;
    color: #f3f3f3;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
}

.message-model-info.open .message-model-popover {
    display: block;
}

.support-panel {
    width: min(760px, 100%);
    border: 1px solid #3d344d;
    background: #15131d;
    border-radius: 20px;
    padding: 16px;
    color: #f5f5f5;
    line-height: 1.5;
}

.support-panel h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.support-panel p {
    margin: 0 0 12px;
    color: #d7d2df;
}

.support-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.support-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    border-radius: 999px;
    border: 1px solid #4f4362;
    background: #1d1927;
    color: #f5f5f5;
    text-decoration: none;
    padding: 7px 12px;
    font-size: 13px;
}

.support-links a:hover {
    background: #2a2238;
}

.voice-overlay {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(4, 4, 5, 0.98);
    z-index: 10002;
    align-items: center;
    justify-content: center;
}

.voice-overlay.open {
    display: flex;
}

body.voice-active {
    overflow: hidden;
}

.voice-shell {
    position: relative;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
    background: #0b0b0c;
    overflow: hidden;
    display: flex;
}

.voice-topbar {
    position: absolute;
    inset: 0 0 auto 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0;
    z-index: 3;
    pointer-events: none;
}

.voice-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #f5f5f5;
}

.voice-brand > .material-symbols-rounded {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #181818;
    border: 1px solid #303030;
    color: #f5f5f5;
}

.voice-brand strong,
.voice-brand span {
    display: block;
}

.voice-brand strong {
    font-size: 15px;
    line-height: 1.2;
}

.voice-brand span {
    color: #8e8e8e;
    font-size: 12px;
    margin-top: 2px;
}

.voice-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 108px 32px 44px;
    text-align: center;
}

.voice-panel {
    position: absolute;
    inset: 86px auto 18px 18px;
    width: min(340px, 88vw);
    border: 1px solid #2b2b2b;
    border-radius: 16px;
    background: #101010;
    display: none;
    flex-direction: column;
    padding: 14px;
    z-index: 2;
    box-shadow: 0 24px 70px rgba(0,0,0,0.28);
}

.voice-panel.open {
    display: flex;
}

.voice-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.voice-panel h3 {
    margin: 0;
    font-size: 16px;
    color: #f1f1f1;
}

.voice-panel-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #303030;
    background: #171717;
    color: #dcdcdc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.voice-conversation-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.voice-convo-item {
    border: 1px solid #2b2b2b;
    border-radius: 12px;
    padding: 10px 12px;
    background: #161616;
    color: #e6e6e6;
}

.voice-convo-item small {
    color: #8c8c8c;
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.voice-orb-shell {
    width: min(230px, 54vw);
    aspect-ratio: 1;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    margin-bottom: 32px;
    background: #121214;
    border: 1px solid #2a2a2a;
    box-shadow: 0 28px 80px rgba(0,0,0,0.34);
    transform-origin: center;
    transition: transform 0.09s ease-out, box-shadow 0.18s ease-out;
}

.orb-blob {
    position: absolute;
    width: 72%;
    height: 72%;
    border-radius: 50%;
    filter: blur(18px);
    opacity: 0.76;
    mix-blend-mode: screen;
    animation: blobFloat var(--blob-speed, 6s) ease-in-out infinite;
    transition: filter 0.2s ease-out;
}

.orb-blob.b1 { background: radial-gradient(circle, #f5f5f5 0%, transparent 70%); top: -12%; left: -12%; animation-delay: 0s; }
.orb-blob.b2 { background: radial-gradient(circle, #8d8d8d 0%, transparent 70%); bottom: -16%; right: -6%; animation-delay: -2s; }
.orb-blob.b3 { background: radial-gradient(circle, #d7d7d7 0%, transparent 70%); top: 18%; right: -16%; animation-delay: -4s; }
.orb-blob.b4 { background: radial-gradient(circle, #6f6f6f 0%, transparent 70%); bottom: 8%; left: -16%; animation-delay: -1s; }

@keyframes blobFloat {
    0%   { transform: translate(0,0) scale(1); }
    25%  { transform: translate(14%,-10%) scale(1.15); }
    50%  { transform: translate(-6%,12%) scale(0.9); }
    75%  { transform: translate(-14%,-8%) scale(1.1); }
    100% { transform: translate(0,0) scale(1); }
}

.voice-orb-glass {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 26%, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.04) 30%, transparent 55%);
    pointer-events: none;
}

.voice-orb-shell.idle { animation: shellBreathe 3.6s ease-in-out infinite; }
.voice-orb-shell.idle .orb-blob { --blob-speed: 7s; }

@keyframes shellBreathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.voice-orb-shell.processing .orb-blob {
    --blob-speed: 1.3s;
    filter: blur(13px) brightness(1.35);
}

.voice-orb-shell.listening,
.voice-orb-shell.speaking {
    animation: none;
}

.voice-main h2 {
    margin: 0 0 6px;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: 0;
    font-weight: 760;
}

.voice-main p {
    margin: 0;
    color: #bdbdbd;
    font-size: 16px;
    max-width: 480px;
}

.voice-live-transcript {
    width: min(680px, calc(100vw - 32px));
    max-height: min(30vh, 240px);
    margin-top: 24px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    gap: 10px;
}

.voice-live-transcript.open {
    display: flex;
}

.voice-live-line {
    max-width: 86%;
    padding: 10px 13px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    color: #ededed;
    background: #171717;
    border: 1px solid #2a2a2a;
}

.voice-live-line.user {
    align-self: flex-end;
    background: #f5f5f5;
    color: #111111;
    border-color: #f5f5f5;
}

.voice-live-line.ai {
    align-self: flex-start;
}

.voice-bottom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 34px;
}

.voice-round-control {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    color: #111111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 48px rgba(0,0,0,0.32);
}

.voice-round-control .material-symbols-rounded {
    font-size: 28px;
}

.voice-round-control:hover {
    background: #ffffff;
}

.voice-round-control.muted {
    background: #2a2a2a;
    color: #f5f5f5;
}

.voice-round-control.active {
    background: #2a2a2a;
    color: #f5f5f5;
}

.voice-status-text {
    color: #c4c4c4;
    min-width: 140px;
    text-align: center;
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        z-index: 9999;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .chat-window,
    .input-area {
        padding-left: 18px;
        padding-right: 18px;
    }

    .timer-card {
        width: min(100%, 360px);
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding: 16px;
        border-radius: 32px;
    }

    .timer-face {
        width: min(178px, 68vw);
    }

    .timer-controls {
        flex-direction: row;
        justify-content: center;
        min-width: 0;
    }

    .top-actions {
        display: flex;
    }

    .topbar {
        justify-content: flex-start;
    }

    .model-area {
        min-width: 0;
    }

    .model-select {
        min-width: 220px;
    }

    .voice-shell {
        height: 100vh;
        width: 100vw;
        border-radius: 0;
    }

    .voice-topbar {
        height: auto;
        align-items: flex-start;
        padding: 14px;
    }

    .voice-brand span {
        display: none;
    }

    .voice-main {
        padding: 88px 20px 34px;
    }

    .voice-panel {
        inset: 72px 12px 12px;
        width: auto;
        border-radius: 18px;
    }

    .voice-main p {
        max-width: 320px;
    }

    .voice-live-transcript {
        max-height: 28vh;
    }

    .voice-live-line {
        max-width: 92%;
        font-size: 13px;
    }

    .voice-round-control {
        width: 58px;
        height: 58px;
    }
}
.model-selector {
    position: relative;
}

.model-menu-popover {
    position: absolute;
    right: 0;
    bottom: 52px;
    background: #161616;
    border: 0;
    border-radius: 20px;
    min-width: 260px;
    display: none;
    z-index: 1000;
    overflow-y: auto;
    max-height: min(440px, 70vh);
    padding: 6px;
    scrollbar-width: thin;
    scrollbar-color: #454545 transparent;
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
}

.model-menu-popover::-webkit-scrollbar { width: 6px; }
.model-menu-popover::-webkit-scrollbar-track { background: transparent; }
.model-menu-popover::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #454545;
    background-clip: padding-box;
}
.model-menu-popover::-webkit-scrollbar-thumb:hover { background: #666; }

.model-menu-popover.open {
    display: flex;
    flex-direction: column;
}

.model-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 12px;
    border: none;
    border-radius: 12px;
    background: none;
    color: white;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.model-option:hover {
    background: #1b1b1b;
}

.model-option.active {
    background: #242424;
}

.model-option-name {
    font-size: 14px;
    font-weight: 600;
}

.model-option-desc {
    font-size: 12px;
    color: #999;
}

.model-option-disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.model-menu-section-label {
    margin-top: 4px;
    padding: 10px 12px 6px;
    color: #999;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.model-option.default-model .model-option-name::after {
    content: "Default";
    display: inline-flex;
    margin-left: 8px;
    padding: 2px 7px;
    border: 1px solid #454545;
    border-radius: 999px;
    color: #bdbdbd;
    font-size: 10px;
    font-weight: 650;
    vertical-align: 1px;
}

.model-default-menu {
    position: fixed;
    min-width: 190px;
}

.model-default-menu button {
    display: flex;
    align-items: center;
    gap: 9px;
}

.model-default-menu .material-symbols-rounded {
    font-size: 18px;
}

.model-option-locked {
    opacity: 0.46;
    filter: grayscale(1);
}

.model-option-locked:hover {
    background: #21172e;
}

.nemigo-code-box {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.nemigo-code-box .readonly-field {
    flex: 1;
}

.nemigo-copy-btn {
    width: 92px;
    border-radius: 999px;
    border: 1px solid #343434;
    background: #181818;
    color: #f5f5f5;
    font-weight: 600;
}

.nemigo-copy-btn:hover {
    background: #202020;
}

.nemigo-copy-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.context-menu {
    position: absolute;
    display: none;
    flex-direction: column;
    min-width: 160px;
    background: #111;
    border: 1px solid #303030;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.35);
    z-index: 10001;
    overflow: hidden;
}

.context-menu.open {
    display: flex;
}

.context-menu button {
    width: 100%;
    padding: 12px 16px;
    color: #f5f5f5;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
}

.context-menu button:hover {
    background: #1f1f1f;
}
.context-menu button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.context-menu button:disabled:hover { background: none; }

#modelSelectorButton:hover {
    background: #202020 !important; /* Add a subtle background on hover */
}
/* ===== Theme: Light mode overrides ===== */
html[data-theme="light"] { color-scheme: light; }

html[data-theme="light"] html,
html[data-theme="light"] body { background: #ffffff; color: #111111; }
html[data-theme="light"] .app,
html[data-theme="light"] .main { background: #ffffff; }
html[data-theme="light"] .content-area,
html[data-theme="light"] .chat-window { background: #ffffff; }

html[data-theme="light"] .sidebar { background: #f6f6f6; border-right-color: #e2e2e2; }
html[data-theme="light"] .sidebar-logo.full-logo {
    background: transparent;
    padding: 0;
    border-radius: 0;
}
html[data-theme="light"] .user-btn { color: #111111; }
html[data-theme="light"] .user-btn:hover { background: #f0f0f0; }
html[data-theme="light"] .new-chat { color: #111111; }
html[data-theme="light"] .new-chat:hover { background: #f0f0f0; }
html[data-theme="light"] .sidebar-toggle { color: #777777; }
html[data-theme="light"] .sidebar-toggle:hover { background: #f0f0f0; color: #111111; }
html[data-theme="light"] .sidebar-toggle > .sidebar-panel-glyph {
    border-color: #555555;
}
html[data-theme="light"] .sidebar-toggle > .sidebar-panel-glyph::before {
    background: #555555;
}
html[data-theme="light"] .sidebar-toggle:hover > .sidebar-panel-glyph {
    border-color: #111111;
}
html[data-theme="light"] .sidebar-toggle:hover > .sidebar-panel-glyph::before {
    background: #111111;
}
html[data-theme="light"] .history-label { color: #8a8a8a; }
html[data-theme="light"] .chat-item { color: #333333; }
html[data-theme="light"] .chat-item:hover,
html[data-theme="light"] .chat-item.active { background: #ececec; color: #000000; }
html[data-theme="light"] .chat-item-markers { color: #777777; }
html[data-theme="light"] .chat-item:hover .chat-item-markers,
html[data-theme="light"] .chat-item.active .chat-item-markers { color: #555555; }
html[data-theme="light"] .sidebar-footer { border-top-color: #e2e2e2; }
html[data-theme="light"] .avatar { background: #eaeaea; border-color: #d6d6d6; color: #444444; }

html[data-theme="light"] .topbar { border-bottom-color: transparent; }
html[data-theme="light"] .top-btn,
html[data-theme="light"] .icon-pill-btn { border-color: #dcdcdc; background: #ffffff; color: #111111; }
html[data-theme="light"] .top-btn:hover,
html[data-theme="light"] .icon-pill-btn:hover { background: #eeeeee; }
html[data-theme="light"] .credits-pill { background: #ffffff; border-color: #dcdcdc; color: #111111; }
html[data-theme="light"] .sidebar-credits-btn { color: #111111; }
html[data-theme="light"] .sidebar-credits-btn:hover { background: #f0f0f0; }
html[data-theme="light"] .sidebar-credits-btn .material-symbols-rounded,
html[data-theme="light"] .sidebar-credits-btn > .sidebar-line-icon,
html[data-theme="light"] .credits-summary-text { color: #666666; }
html[data-theme="light"] .low-credit-toast { background: rgba(255,255,255,0.98); border-color: #e5c896; color: #111111; box-shadow: 0 18px 48px rgba(0,0,0,0.14); }
html[data-theme="light"] .low-credit-toast.out { border-color: #e5aaaa; }
html[data-theme="light"] .low-credit-toast-message { color: #666666; }
html[data-theme="light"] .low-credit-toast-action { background: #111111; color: #ffffff; }
html[data-theme="light"] .low-credit-toast-action.secondary { background: transparent; color: #222222; border-color: #d0d0d0; }
html[data-theme="light"] .low-credit-toast-close { color: #777777; }
html[data-theme="light"] .low-credit-toast-close:hover { background: #eeeeee; color: #111111; }
html[data-theme="light"] .guest-pill { background: #f5f5f5; border-color: #dcdcdc; color: #333333; }
html[data-theme="light"] .install-pwa-btn { border-color: #dcdcdc; }
html[data-theme="light"] .credits-panel,
html[data-theme="light"] .credits-info-panel { background: rgba(255,255,255,0.98); border-color: #e2e2e2; box-shadow: 0 24px 60px rgba(0,0,0,0.12); }
html[data-theme="light"] .credits-panel h3,
html[data-theme="light"] .credits-info-panel h3 { color: #111111; }
html[data-theme="light"] .credits-panel p,
html[data-theme="light"] .credits-info-panel p { color: #666666; }
html[data-theme="light"] .credits-stat-item { border-color: #e2e2e2; background: #f7f7f7; }
html[data-theme="light"] .credits-stat-item strong { color: #111111; }
html[data-theme="light"] .credits-stat-item span { color: #666666; }
html[data-theme="light"] .credits-section-divider { background: #e2e2e2; }
html[data-theme="light"] .credits-reset-row { background: #f7f7f7; border-color: #e2e2e2; }
html[data-theme="light"] .credits-upgrade-section { background: #f7f7f7; border-color: #e2e2e2; }
html[data-theme="light"] .credits-upgrade-section strong { color: #111111; }
html[data-theme="light"] .credits-upgrade-link { background: #111111; color: #ffffff; }
html[data-theme="light"] .credits-reset-count { color: #111111; }
html[data-theme="light"] .credits-reset-btn { background: #111111; color: #ffffff; }
html[data-theme="light"] .credits-usage-head strong { color: #111111; }
html[data-theme="light"] .credits-usage-track { background: #dedede; }
html[data-theme="light"] .credits-usage-fill { background: #111111; }
html[data-theme="light"] .credits-about-btn,
html[data-theme="light"] .credits-info-back { color: #666666; }
html[data-theme="light"] .credits-about-btn:hover,
html[data-theme="light"] .credits-info-back:hover { background: #eeeeee; color: #111111; }

html[data-theme="light"] .welcome-text { color: #111111; }
html[data-theme="light"] .launch-banner { border-color: #dcdcdc; background: #f5f5f5; color: #444444; }

html[data-theme="light"] .user .bubble { background: #f0f0f0; color: #111111; }
html[data-theme="light"] .message.ai .bubble { color: #111111; }
html[data-theme="light"] .timer-card { background: radial-gradient(circle at 34% 18%, rgba(143, 88, 255, 0.14), transparent 42%), #ffffff; border-color: #ded4f7; box-shadow: 0 22px 60px rgba(54,37,92,0.12); }
html[data-theme="light"] .timer-ring-track { stroke: #ece7f7; }
html[data-theme="light"] .timer-ring-progress { stroke: #7d5cff; }
html[data-theme="light"] .timer-core { background: #ffffff; border-color: #e2e2e2; }
html[data-theme="light"] .timer-time { color: #17121f; }
html[data-theme="light"] .timer-label { color: #746887; }
html[data-theme="light"] .timer-control-btn { background: #f5f5f5; border-color: #dcdcdc; color: #111111; }
html[data-theme="light"] .timer-control-btn:hover { background: #eeeeee; border-color: #cccccc; }
html[data-theme="light"] .timer-ended-row { color: #3f3354; }
html[data-theme="light"] .timer-replay-btn { background: #f5f5f5; border-color: #dcdcdc; color: #111111; }
html[data-theme="light"] .timer-replay-btn:hover { background: #eeeeee; border-color: #cccccc; }
html[data-theme="light"] .markdown-content blockquote { border-left-color: #cfcfcf; color: #555555; }
html[data-theme="light"] .markdown-content code.inline-code { background: #f3f3f3; border-color: #dcdcdc; color: #111111; }
html[data-theme="light"] .markdown-content a { color: #245bcf; }
html[data-theme="light"] .markdown-image { background: #f3f3f3; }
html[data-theme="light"] .markdown-table-wrap { border-color: #dcdcdc; }
html[data-theme="light"] .markdown-table-tools,
html[data-theme="light"] .markdown-output-tools,
html[data-theme="light"] .markdown-output-heading { background: #f3f3f3; border-color: #dcdcdc; }
html[data-theme="light"] .markdown-content th { background: #f3f3f3; color: #111111; }
html[data-theme="light"] .markdown-content th,
html[data-theme="light"] .markdown-content td { border-bottom-color: #dcdcdc; }
html[data-theme="light"] .markdown-output-block { border-color: #dcdcdc; }
html[data-theme="light"] .markdown-copy-btn:hover { background: #e8e8e8; color: #111111; }
html[data-theme="light"] .typing-bubble {
    color: #888888;
    background: transparent;
}
html[data-theme="light"] .typing-dots span {
    background: #888888;
}

html[data-theme="light"] .input-shell { background: #f5f5f5; border-color: #dcdcdc; }
html[data-theme="light"] .upload-preview { background: transparent; border: 0; box-shadow: none; }
html[data-theme="light"] .upload-preview-remove { background: #ffffff; border-color: #dcdcdc; color: #444444; }
html[data-theme="light"] .upload-preview-remove:hover { background: #ededed; color: #111111; }
html[data-theme="light"] .input-shell input,
html[data-theme="light"] .input-shell textarea { color: #111111; }
html[data-theme="light"] .input-shell input::placeholder,
html[data-theme="light"] .input-shell textarea::placeholder { color: #888888; }
html[data-theme="light"] .queued-message-bar {
    background: #e4e4e4;
    border-color: #d2d2d2;
}
html[data-theme="light"] .queued-message-label { color: #666666; }
html[data-theme="light"] .queued-message-text { color: #222222; }
html[data-theme="light"] .queued-message-actions button { color: #555555; }
html[data-theme="light"] .queued-message-actions button:hover {
    background: #d5d5d5;
    color: #111111;
}
html[data-theme="light"] .modal { background: #ffffff; border-color: #dcdcdc; color: #111111; box-shadow: 0 30px 80px rgba(0,0,0,0.18); }
html[data-theme="light"] .image-drop-card { background: #ffffff; border-color: #c8c8c8; color: #111111; box-shadow: 0 30px 80px rgba(0,0,0,0.18); }
html[data-theme="light"] .image-drop-card .material-symbols-rounded { color: #111111; }
html[data-theme="light"] .setting-row small { color: #777777; }
html[data-theme="light"] .toggle { border-color: #cfcfcf; background: #d9d9d9; }
html[data-theme="light"] .toggle.on { background: #111111; }
html[data-theme="light"] .toggle.on::before { background: #ffffff; }
html[data-theme="light"] .name-input { background: #f5f5f5; color: #111111; border-color: #dcdcdc; }
html[data-theme="light"] .modal-actions button { border-color: #dcdcdc; background: #f5f5f5; color: #111111; }

html[data-theme="light"] .input-shell .input-icon-btn { color: #555555; }
html[data-theme="light"] .input-shell .input-icon-btn:hover { background: #e6e6e6; color: #111111; }
html[data-theme="light"] .input-shell .input-icon-btn.active { background: #dcdcdc; color: #111111; }
html[data-theme="light"] .input-shell .plus-menu,
html[data-theme="light"] .model-menu-popover,
html[data-theme="light"] .context-menu { background: #ffffff; border-color: #dcdcdc; box-shadow: 0 18px 40px rgba(0,0,0,0.12); }
html[data-theme="light"] .model-menu-popover { scrollbar-color: #c8c8c8 transparent; }
html[data-theme="light"] .model-menu-popover::-webkit-scrollbar-thumb { background: #c8c8c8; background-clip: padding-box; }
html[data-theme="light"] .model-menu-popover::-webkit-scrollbar-thumb:hover { background: #a8a8a8; background-clip: padding-box; }
html[data-theme="light"] .input-shell .plus-menu button,
html[data-theme="light"] .model-option,
html[data-theme="light"] .context-menu button { color: #111111; border-bottom-color: #ececec; }
html[data-theme="light"] .input-shell .plus-menu button:hover,
html[data-theme="light"] .model-option:hover,
html[data-theme="light"] .context-menu button:hover { background: #f0f0f0; }
html[data-theme="light"] .model-option.active { background: #ececec; }
html[data-theme="light"] .model-option-desc { color: #888888; }
html[data-theme="light"] .model-option.active { background: #dcdcdc; }
html[data-theme="light"] .model-option.default-model .model-option-name::after { border-color: #cccccc; color: #666666; }
html[data-theme="light"] .model-option-locked:hover { background: #f0f0f0; }
html[data-theme="light"] #modelSelectorButton:hover { background: #e6e6e6 !important; }
html[data-theme="light"] .nemigo-copy-btn { background: #f5f5f5; border-color: #dcdcdc; color: #111111; }
html[data-theme="light"] .nemigo-copy-btn:hover { background: #eeeeee; }

html[data-theme="light"] .voice-overlay { background: rgba(255,255,255,0.98); }
html[data-theme="light"] .voice-shell { background: #ffffff; }
html[data-theme="light"] .voice-topbar { background: rgba(255,255,255,0.86); border-bottom-color: #e5e5e5; }
html[data-theme="light"] .voice-brand { color: #111111; }
html[data-theme="light"] .voice-brand > .material-symbols-rounded,
html[data-theme="light"] .voice-panel-close { background: #ffffff; border-color: #dcdcdc; color: #222222; }
html[data-theme="light"] .voice-brand span,
html[data-theme="light"] .voice-main p,
html[data-theme="light"] .voice-status-text { color: #666666; }
html[data-theme="light"] .voice-pill,
html[data-theme="light"] .voice-panel,
html[data-theme="light"] .voice-convo-item { background: rgba(255,255,255,0.86); border-color: #dcdcdc; color: #111111; }
html[data-theme="light"] .voice-orb-shell { background: #f2f2f2; border-color: #dcdcdc; box-shadow: 0 28px 70px rgba(0,0,0,0.12); }
html[data-theme="light"] .voice-round-control { box-shadow: 0 18px 42px rgba(0,0,0,0.16); }
html[data-theme="light"] .voice-panel h3,
html[data-theme="light"] .voice-main h2 { color: #111111; }
html[data-theme="light"] .voice-live-line { background: #f5f5f5; border-color: #dcdcdc; color: #111111; }
html[data-theme="light"] .voice-live-line.user { background: #111111; border-color: #111111; color: #ffffff; }

html[data-theme="light"] .message-action-btn { color: #888888; }
html[data-theme="light"] .message-action-btn:hover { color: #111111; }
html[data-theme="light"] .message-model-popover { background: #ffffff; border-color: #d8d8d8; color: #111111; box-shadow: 0 10px 28px rgba(0,0,0,0.14); }
html[data-theme="light"] .support-panel { background: #f7f5fb; border-color: #ded4f7; color: #111111; }
html[data-theme="light"] .support-panel p { color: #555555; }
html[data-theme="light"] .support-links a { background: #ffffff; border-color: #d9d2ea; color: #211832; }
html[data-theme="light"] .support-links a:hover { background: #eeeeee; }

html[data-theme="light"] .message.ai .bubble { color: #111111; }

.theme-switcher {
    display: flex;
    gap: 6px;
    background: #0b0b0b;
    border: 1px solid #343434;
    border-radius: 999px;
    padding: 4px;
}
.theme-option {
    flex: 1;
    border: none;
    background: transparent;
    color: #a0a0a0;
    padding: 8px 0;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
}
.theme-option:hover { color: #f5f5f5; }
.theme-option.active { background: #ffffff; color: #000000; }

html[data-theme="light"] .theme-switcher { background: #f0f0f0; border-color: #dcdcdc; }
html[data-theme="light"] .theme-option { color: #777777; }
html[data-theme="light"] .theme-option:hover { color: #111111; }
/* Voice overlay stays immersive/dark by design — remove this block if you want it to flip too */

.settings-modal {
    width: min(620px, 94vw);
    position: relative;
    padding-top: 28px;
}

.settings-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #a8a8a8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.settings-close-btn:hover { background: #202020; color: #ffffff; }
.settings-close-btn .material-symbols-rounded { font-size: 22px; }

.settings-shell {
    display: flex;
    gap: 18px;
    min-height: 320px;
}

.settings-nav {
    width: 160px;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 1px solid #242424;
    padding-right: 14px;
    scrollbar-width: none;
}

.settings-nav::-webkit-scrollbar,
.settings-modal::-webkit-scrollbar { display: none; }

.settings-modal { scrollbar-width: none; }

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: transparent;
    color: #a0a0a0;
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    text-align: left;
}

.settings-nav-item:hover { background: #1b1b1b; color: #f5f5f5; }
.settings-nav-item.active { background: #1f1f1f; color: #ffffff; }
.settings-nav-item .material-symbols-rounded { font-size: 19px; }
.settings-nav-item.danger-nav.active { background: #2a1414; color: #ff8080; }

.settings-content { flex: 1; min-width: 0; }
.settings-panel { display: none; }
.settings-panel.active { display: block; }

.settings-label {
    display: block;
    font-size: 12px;
    color: #999;
    margin: 14px 0 6px;
}
.settings-label:first-child { margin-top: 0; }

.readonly-field {
    width: 100%;
    background: #000000;
    color: #d6d6d6;
    border: 1px solid #343434;
    border-radius: 999px;
    padding: 12px 14px;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-id-row {
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
    background: #000000;
    border: 1px solid #343434;
    border-radius: 999px;
}
.user-id-row .readonly-field {
    flex: 1 1 auto;
    width: auto;
    border: 0;
    border-radius: 0;
}
.user-id-copy-btn {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-left: 1px solid #343434;
    border-radius: 0;
    background: transparent;
    color: #888;
}
.user-id-copy-btn:hover { color: #f5f5f5; }
.user-id-copy-btn.copied { color: #8fd18f; }
.user-id-copy-btn .material-symbols-rounded { font-size: 17px; }

.memory-textarea {
    width: 100%;
    min-height: 132px;
    resize: vertical;
    background: #0b0b0b;
    color: #f5f5f5;
    border: 1px solid #343434;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
}
.memory-textarea:focus { border-color: #777777; }

.secondary-action-btn {
    width: 100%;
    height: 44px;
    border-radius: 999px;
    border: 1px solid #343434;
    background: #181818;
    color: #f5f5f5;
    font-weight: 600;
    margin-top: 10px;
}
.secondary-action-btn:hover { background: #202020; }
.pwa-install-btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.pwa-install-btn .material-symbols-rounded { font-size: 19px; }
.pwa-install-btn:disabled { opacity: .5; cursor: default; }

.danger-action-btn {
    width: 100%;
    height: 44px;
    border-radius: 999px;
    border: 1px solid #612727;
    background: #2a1414;
    color: #ff8080;
    font-weight: 600;
    margin-top: 10px;
}
.danger-action-btn:hover { background: #3a1a1a; }
.danger-action-btn:disabled { opacity: 0.45; cursor: default; }

.settings-status { font-size: 12px; color: #8fd18f; margin-top: 8px; min-height: 14px; }
/* Settings > Account status */
.as-card { border: 1px solid #343434; background: #000000; border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.as-top { display: flex; gap: 12px; align-items: flex-start; }
.as-icon { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; background: color-mix(in srgb, var(--as-c) 16%, transparent); color: var(--as-c); }
.as-icon .material-symbols-rounded { font-size: 22px; }
.as-title { font-size: 16px; font-weight: 700; color: #f5f5f5; }
.as-text { color: #a8a8a8; font-size: 13px; line-height: 1.5; margin-top: 3px; }
.as-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.as-step { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: #6f6f6f; text-align: center; line-height: 1.25; }
.as-step i { height: 6px; border-radius: 999px; background: #262626; display: block; }
.as-step.on i { background: var(--as-c); }
.as-step.cur { color: #f5f5f5; font-weight: 700; }
.as-sec { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #777777; font-weight: 700; margin: 2px 0 -4px; }
.as-list { display: flex; flex-direction: column; gap: 8px; }
.as-item { border: 1px solid #262626; border-radius: 14px; padding: 10px 12px; font-size: 13px; line-height: 1.45; color: #d6d6d6; }
.as-item b { display: block; font-size: 13px; color: #f5f5f5; }
.as-item small { color: #888888; display: block; margin-top: 2px; }
.as-item.old { opacity: .6; }
.as-note { font-size: 13px; line-height: 1.5; color: #e8e8e8; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--as-c) 12%, transparent); }
.as-links { display: flex; gap: 8px; flex-wrap: wrap; }
.as-links a { flex: 1 1 160px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 999px; border: 1px solid #343434; background: #181818; color: #f5f5f5; text-decoration: none; font-weight: 600; font-size: 13px; }
.as-links a:hover { background: #202020; }
.as-links a .material-symbols-rounded { font-size: 17px; }
html[data-theme="light"] .as-card { background: #ffffff; border-color: #dcdcdc; }
html[data-theme="light"] .as-title, html[data-theme="light"] .as-item b { color: #111111; }
html[data-theme="light"] .as-text, html[data-theme="light"] .as-item small { color: #666666; }
html[data-theme="light"] .as-step { color: #999999; }
html[data-theme="light"] .as-step i { background: #e6e6e6; }
html[data-theme="light"] .as-step.cur { color: #111111; }
html[data-theme="light"] .as-item { border-color: #e6e6e6; color: #333333; }
html[data-theme="light"] .as-note { color: #222222; }
html[data-theme="light"] .as-links a { background: #f5f5f5; border-color: #dcdcdc; color: #111111; }
html[data-theme="light"] .as-links a:hover { background: #eeeeee; }
/* Settings keeps one size on wide screens: long pages (Account, a long account history) scroll inside it. Phones
   already scroll the whole Settings window. */
@media (min-width: 901px) {
    .settings-shell { height: min(560px, calc(100vh - 140px)); }
    .settings-content { overflow-y: auto; padding-right: 8px; scrollbar-width: thin; scrollbar-color: #343434 transparent; }
    .settings-content::-webkit-scrollbar { width: 6px; }
    .settings-content::-webkit-scrollbar-thumb { background: #343434; border-radius: 999px; }
    html[data-theme="light"] .settings-content { scrollbar-color: #d0d0d0 transparent; }
    html[data-theme="light"] .settings-content::-webkit-scrollbar-thumb { background: #d0d0d0; }
}
/* Sections inside a settings page (Account > Security / Account status, Apps) */
.settings-group { margin-top: 22px; padding-top: 18px; border-top: 1px solid #242424; }
.settings-panel > .settings-group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.settings-group-title { font-size: 18px; font-weight: 700; letter-spacing: -.2px; color: #f5f5f5; margin-bottom: 12px; }
html[data-theme="light"] .settings-group { border-top-color: #e2e2e2; }
html[data-theme="light"] .settings-group-title { color: #111111; }
.settings-group-title.danger-title { color: #ff8080; }
html[data-theme="light"] .settings-group-title.danger-title { color: #d93636; }
/* Settings > Nemigo Security */
.ns-head { display: flex; flex-direction: column; gap: 10px; }
.ns-head small { color: #888888; line-height: 1.45; }
.ns-logo { height: 30px; width: auto; display: block; align-self: flex-start; }
.ns-logo-light { display: none; }
html[data-theme="light"] .ns-logo-dark { display: none; }
html[data-theme="light"] .ns-logo-light { display: block; }
html[data-theme="light"] .ns-head small { color: #777777; }
.ns-list { display: flex; flex-direction: column; gap: 8px; }
.ns-row { display: flex; align-items: center; gap: 12px; border: 1px solid #262626; border-radius: 14px; padding: 10px 12px; }
.ns-row-main { flex: 1; min-width: 0; }
.ns-row-main b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: #f5f5f5; }
.ns-row-main small { display: block; margin-top: 2px; color: #888888; font-size: 12px; line-height: 1.4; }
.ns-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(61,214,140,.14); color: #3dd68c; }
.ns-pill.warn { background: rgba(229,72,77,.14); color: #ff8080; }
.ns-pill.muted { background: #202020; color: #a8a8a8; }
.ns-av { width: 32px; height: 32px; border-radius: 50%; background: #202020; color: #f5f5f5; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; overflow: hidden; }
.ns-av img { width: 100%; height: 100%; object-fit: cover; }
.ns-btn { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid #343434; background: #181818; color: #f5f5f5; font-weight: 600; font-size: 13px; }
.ns-btn:hover { background: #202020; }
.ns-btn.danger { border-color: #612727; background: #2a1414; color: #ff8080; }
.ns-btn.danger:hover { background: #3a1a1a; }
.ns-btn:disabled { opacity: .5; cursor: default; }
.ns-links { display: flex; flex-direction: column; gap: 8px; }
html[data-theme="light"] .ns-row { border-color: #e6e6e6; }
html[data-theme="light"] .ns-row-main b { color: #111111; }
html[data-theme="light"] .ns-row-main small { color: #666666; }
html[data-theme="light"] .ns-av { background: #eeeeee; color: #111111; }
html[data-theme="light"] .ns-pill.muted { background: #eeeeee; color: #555555; }
html[data-theme="light"] .ns-btn { background: #f5f5f5; border-color: #dcdcdc; color: #111111; }
html[data-theme="light"] .ns-btn.danger { background: #fdeaea; border-color: #f2b8b8; color: #c62828; }
.settings-status.error { color: #ff8080; }
/* Settings > Account > Security: two-step verification (built from the Nemigo code box, pill fields and settings buttons) */
.ts-setup { display: flex; flex-direction: column; gap: 10px; }
.ts-setup[hidden], #twoStepActions:empty { display: none; }
.ts-qr { width: 196px; max-width: 100%; align-self: center; padding: 10px; background: #ffffff; border-radius: 18px; line-height: 0; box-sizing: border-box; }
.ts-qr:empty { display: none; }
.ts-qr.ts-qr-msg { width: 100%; padding: 0; background: transparent; color: #888; font-size: 12px; line-height: 1.4; text-align: center; }
.ts-key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; letter-spacing: .04em; word-spacing: .15em; white-space: normal; overflow: visible; line-height: 1.5; border-radius: 18px; user-select: all; }
.ts-code, .nalo2fa-code { text-align: center; font-size: 20px; letter-spacing: .35em; }
.saved-memory-list { display: grid; gap: 8px; margin-top: 4px; }
.saved-memory-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid #2d2d2d; border-radius: 12px; background: #151515; }
.saved-memory-item-text { flex: 1; min-width: 0; color: #dedede; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.saved-memory-delete { flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #a6a6a6; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.saved-memory-delete:hover { background: #2a1414; color: #ff8b8b; }
.saved-memory-empty { margin: 0; color: #999; font-size: 13px; line-height: 1.45; }
.memory-update-toast { position: fixed; z-index: 10150; right: 20px; bottom: 20px; display: flex; align-items: center; gap: 9px; max-width: min(360px, calc(100vw - 32px)); padding: 12px 15px; border: 1px solid #356a48; border-radius: 14px; background: rgba(20, 34, 25, .98); color: #e8f7ec; box-shadow: 0 18px 48px rgba(0,0,0,.35); font-size: 13px; font-weight: 650; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.memory-update-toast.open { opacity: 1; transform: translateY(0); }
.memory-update-toast .material-symbols-rounded { color: #8fd18f; font-size: 19px; }
html[data-theme="light"] .saved-memory-item { border-color: #dedede; background: #f8f8f8; }
html[data-theme="light"] .saved-memory-item-text { color: #222; }
html[data-theme="light"] .saved-memory-delete { color: #666; }
html[data-theme="light"] .saved-memory-delete:hover { background: #fdeaea; color: #c02929; }
html[data-theme="light"] .saved-memory-empty { color: #666; }
html[data-theme="light"] .memory-update-toast { border-color: #98c7a5; background: rgba(247,255,249,.98); color: #173c22; box-shadow: 0 18px 48px rgba(0,0,0,.16); }

.subscription-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #292929;
}
.subscription-summary h3 { margin: 0 0 4px; font-size: 18px; }
.subscription-summary p { margin: 0; color: #999; font-size: 13px; line-height: 1.45; }
.subscription-status-pill {
    flex: none;
    padding: 7px 11px;
    border-radius: 999px;
    background: #202020;
    color: #d7d7d7;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}
.subscription-plan-list { margin-top: 10px; }
.subscription-plan-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #292929;
}
.subscription-plan-row:last-child { border-bottom: 0; }
.subscription-plan-copy { min-width: 0; }
.subscription-plan-title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.subscription-plan-title strong { color: #f5f5f5; font-size: 15px; }
.subscription-plan-title span { color: #aaa; font-size: 13px; font-weight: 650; }
.subscription-plan-copy p { margin: 0; color: #999; font-size: 12px; line-height: 1.45; }
.subscription-plan-action {
    min-width: 100px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid #3a3a3a;
    border-radius: 999px;
    background: #f3f3f3;
    color: #090909;
    font-size: 13px;
    font-weight: 750;
}
.subscription-plan-action:hover { background: #ffffff; }
.subscription-plan-action.secondary { background: #181818; color: #f1f1f1; }
.subscription-plan-action.secondary:hover { background: #222222; }
.subscription-plan-action:disabled { opacity: .45; cursor: default; }
.subscription-meta { display: grid; gap: 7px; margin-top: 14px; color: #a8a8a8; font-size: 12px; }
.subscription-meta-row { display: flex; justify-content: space-between; gap: 14px; }
.subscription-meta-row strong { color: #e8e8e8; font-weight: 650; text-align: right; }
.subscription-manage-btn { margin-top: 14px; }
.subscription-billing-note { margin: 10px 0 0; color: #858585; font-size: 11px; line-height: 1.45; }
.subscription-billing-actions { display: grid; gap: 8px; margin-top: 16px; }
.subscription-billing-actions .secondary-action-btn { margin-top: 0; }
.subscription-support-link {
    min-height: 40px;
    border-radius: 999px;
    color: #a8a8a8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}
.subscription-support-link:hover { background: #1b1b1b; color: #ffffff; }
.subscription-cancel-btn { border-color: #532929; color: #ff8b8b; background: #211313; }
.subscription-cancel-btn:hover { background: #2d1717; }

html[data-theme="light"] .subscription-summary,
html[data-theme="light"] .subscription-plan-row { border-color: #e2e2e2; }
html[data-theme="light"] .subscription-summary p,
html[data-theme="light"] .subscription-plan-copy p,
html[data-theme="light"] .subscription-meta,
html[data-theme="light"] .subscription-billing-note { color: #6f6f6f; }
html[data-theme="light"] .subscription-status-pill { background: #ededed; color: #333333; }
html[data-theme="light"] .subscription-plan-title strong,
html[data-theme="light"] .subscription-meta-row strong { color: #111111; }
html[data-theme="light"] .subscription-plan-title span { color: #666666; }
html[data-theme="light"] .subscription-plan-action { background: #111111; color: #ffffff; border-color: #111111; }
html[data-theme="light"] .subscription-plan-action:hover { background: #000000; }
html[data-theme="light"] .subscription-plan-action.secondary { background: #f5f5f5; color: #111111; border-color: #dcdcdc; }
html[data-theme="light"] .subscription-plan-action.secondary:hover { background: #eeeeee; }
html[data-theme="light"] .upgrade-plan-pill { background: #111111; border-color: #111111; color: #ffffff; }
html[data-theme="light"] .upgrade-plan-pill:hover { background: #000000; }
html[data-theme="light"] .settings-close-btn { color: #777777; }
html[data-theme="light"] .settings-close-btn:hover { background: #eeeeee; color: #111111; }
html[data-theme="light"] .subscription-support-link { color: #666666; }
html[data-theme="light"] .subscription-support-link:hover { background: #eeeeee; color: #111111; }
html[data-theme="light"] .subscription-cancel-btn { background: #fff5f5; border-color: #e3b6b6; color: #a62b2b; }
html[data-theme="light"] .subscription-cancel-btn:hover { background: #ffecec; }

@media (max-width: 560px) {
    .subscription-summary { flex-direction: column; gap: 10px; }
    .subscription-plan-row { grid-template-columns: 1fr; }
    .subscription-plan-action { width: 100%; }
}

.small-modal { width: min(380px, 92vw); }
.confirm-modal-text { color: #bdbdbd; font-size: 14px; line-height: 1.5; margin: 0 0 16px; }

.whatsnew-modal {
    width: min(560px, 92vw);
    position: relative;
    padding: 28px;
}

.whatsnew-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #1c1c1c;
    color: #a0a0a0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsnew-close-btn:hover {
    background: #262626;
    color: #f5f5f5;
}

.whatsnew-content {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 6px;
}

.whatsnew-content h2 {
    margin: 0 0 4px;
    font-size: 24px;
}

.whatsnew-subtitle {
    color: #a0a0a0;
    font-size: 15px;
    margin: 0 0 4px;
}

.whatsnew-content > p {
    color: #bdbdbd;
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 18px;
}

.whatsnew-content h3 {
    font-size: 15px;
    margin: 0 0 8px;
    color: #f5f5f5;
}

.whatsnew-content ul {
    margin: 0 0 18px;
    padding-left: 20px;
    color: #d6d6d6;
    font-size: 14px;
    line-height: 1.7;
}

.whatsnew-footer {
    margin-top: 4px !important;
    color: #f5f5f5 !important;
    font-weight: 600;
    text-align: center;
}

@media (max-width: 640px) {
    .settings-shell { flex-direction: column; }
    .settings-nav {
        flex-direction: row;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #242424;
        padding-right: 0;
        padding-bottom: 10px;
        overflow-x: auto;
    }
    .settings-nav-item { white-space: nowrap; }
}

html[data-theme="light"] .settings-nav { border-right-color: #e2e2e2; }
html[data-theme="light"] .settings-nav-item { color: #777777; }
html[data-theme="light"] .settings-nav-item:hover { background: #f0f0f0; color: #111111; }
html[data-theme="light"] .settings-nav-item.active { background: #ececec; color: #000000; }
html[data-theme="light"] .settings-nav-item.danger-nav.active { background: #fdeaea; color: #c02929; }
html[data-theme="light"] .settings-label { color: #888888; }
html[data-theme="light"] .connection-row { border-color: #e2e2e2; }
html[data-theme="light"] .connection-row p { color: #6f6f6f; }
html[data-theme="light"] .connection-row-head .material-symbols-rounded { color: #777777; }
html[data-theme="light"] .connection-soon-pill { background: #e8e8e8; color: #555555; }
html[data-theme="light"] .readonly-field { background: #f5f5f5; color: #333333; border-color: #dcdcdc; }
html[data-theme="light"] .memory-textarea { background: #f5f5f5; color: #111111; border-color: #dcdcdc; }
html[data-theme="light"] .memory-textarea:focus { border-color: #999999; }
html[data-theme="light"] .secondary-action-btn { background: #f5f5f5; border-color: #dcdcdc; color: #111111; }
html[data-theme="light"] .secondary-action-btn:hover { background: #eeeeee; }
html[data-theme="light"] .danger-action-btn { background: #fdeaea; border-color: #f3b8b8; color: #c02929; }
html[data-theme="light"] .danger-action-btn:hover { background: #fadada; }
html[data-theme="light"] .confirm-modal-text { color: #666666; }
html[data-theme="light"] .whatsnew-close-btn { background: #eeeeee; color: #777777; }
html[data-theme="light"] .whatsnew-close-btn:hover { background: #e2e2e2; color: #111111; }
html[data-theme="light"] .whatsnew-subtitle { color: #666666; }
html[data-theme="light"] .whatsnew-content > p { color: #555555; }
html[data-theme="light"] .whatsnew-content h3 { color: #111111; }
html[data-theme="light"] .whatsnew-content ul { color: #333333; }
html[data-theme="light"] .whatsnew-footer { color: #111111 !important; }
html[data-theme="light"] .welcome-text { color: #111111 !important; }

.premium-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #181818;
    border-color: #343434;
    color: #f5f5f5;
}

.premium-btn:hover {
    background: #202020;
}

html[data-theme="light"] .premium-btn {
    background: #f5f5f5;
    border-color: #dcdcdc;
    color: #111111;
}

html[data-theme="light"] .premium-btn:hover {
    background: #eeeeee;
}

.typewriter-caret::after {
    content: "|";
    display: inline-block;
    margin-left: 2px;
    animation: caretBlink 0.9s step-end infinite;
    color: inherit;
}

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

.sidebar-search-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #a0a0a0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    order: 1;
}

.sidebar-search-btn:hover {
    background: #202020;
    color: #f5f5f5;
}

.sidebar.collapsed .sidebar-search-btn {
    display: none;
}

.chat-search-bar {
    display: none;
    align-items: center;
    gap: 8px;
    margin: 0 14px 10px;
    padding: 8px 12px;
    background: #171717;
    border: 1px solid #343434;
    border-radius: 999px;
    color: #a0a0a0;
}

.chat-search-bar.open {
    display: flex;
}

.chat-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f5f5f5;
    font-size: 13px;
}

.chat-search-bar input::placeholder {
    color: #7d7d7d;
}

.chat-search-bar button {
    border: none;
    background: transparent;
    color: #a0a0a0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.chat-search-bar button:hover {
    color: #f5f5f5;
}

.chat-search-bar .material-symbols-rounded {
    font-size: 17px;
}

.sidebar.collapsed .chat-search-bar {
    display: none;
}

.chat-item.search-hidden {
    display: none;
}

html[data-theme="light"] .sidebar-search-btn { color: #777777; }
html[data-theme="light"] .sidebar-search-btn:hover { background: #f0f0f0; color: #111111; }
html[data-theme="light"] .chat-search-bar { background: #f5f5f5; border-color: #dcdcdc; color: #777777; }
html[data-theme="light"] .chat-search-bar input { color: #111111; }
html[data-theme="light"] .chat-search-bar input::placeholder { color: #999999; }
html[data-theme="light"] .chat-search-bar button { color: #777777; }
html[data-theme="light"] .chat-search-bar button:hover { color: #111111; }

.project-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
    margin: 14px 0;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    background: #171717;
    border: 0;
    color: #e6e6e6;
    cursor: pointer;
}

.project-item:hover {
    background: #1f1f1f;
}

.project-item.active {
    background: #242424;
}

.project-item .material-symbols-rounded {
    font-size: 18px;
    color: #a0a0a0;
}

.project-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.project-item-count {
    font-size: 12px;
    color: #888;
    background: #262626;
    border-radius: 999px;
    padding: 2px 8px;
}

.project-empty {
    color: #888;
    font-size: 13px;
    text-align: center;
    padding: 20px 10px;
}

.library-modal {
    width: min(820px, 94vw);
    max-height: min(760px, 86vh);
    overflow-y: auto;
    border: 0;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: min(580px, 68vh);
    overflow-y: auto;
    min-height: 180px;
    margin: 14px 0 0;
    padding: 2px;
    scrollbar-color: #454545 transparent;
    scrollbar-width: thin;
}

.library-grid::-webkit-scrollbar { width: 6px; }
.library-grid::-webkit-scrollbar-track { background: transparent; }
.library-grid::-webkit-scrollbar-thumb {
    border: 1px solid transparent;
    border-radius: 999px;
    background: #454545;
    background-clip: padding-box;
}
.library-grid::-webkit-scrollbar-thumb:hover {
    background: #666;
    background-clip: padding-box;
}

.library-image-card {
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: #171717;
    color: #f5f5f5;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.library-image-card:hover {
    background: #202020;
    transform: translateY(-2px);
}

.library-image-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #0b0b0b;
}

.library-image-info {
    min-width: 0;
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.library-image-kind {
    color: #999;
    font-size: 11px;
    font-weight: 650;
}

.library-image-chat {
    overflow: hidden;
    color: #e6e6e6;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-empty,
.library-loading {
    grid-column: 1 / -1;
    min-height: 176px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #999;
    font-size: 13px;
    text-align: center;
}

.library-empty .material-symbols-rounded {
    color: #777;
    font-size: 30px;
}

.library-image-card:focus-visible {
    outline: 2px solid #f5f5f5;
    outline-offset: 2px;
}

html[data-theme="light"] .project-item { background: #f5f5f5; color: #111111; }
html[data-theme="light"] .project-item:hover { background: #ececec; }
html[data-theme="light"] .project-item.active { background: #e8e8e8; }
html[data-theme="light"] .project-item .material-symbols-rounded { color: #777777; }
html[data-theme="light"] .project-item-count { background: #e6e6e6; color: #666666; }
html[data-theme="light"] .project-empty { color: #999999; }
html[data-theme="light"] .library-grid { scrollbar-color: #c8c8c8 transparent; }
html[data-theme="light"] .library-grid::-webkit-scrollbar-thumb { background: #c8c8c8; background-clip: padding-box; }
html[data-theme="light"] .library-grid::-webkit-scrollbar-thumb:hover { background: #a8a8a8; background-clip: padding-box; }
html[data-theme="light"] .library-image-card { background: #f5f5f5; color: #111; }
html[data-theme="light"] .library-image-card:hover { background: #ececec; }
html[data-theme="light"] .library-image-card img { background: #e8e8e8; }
html[data-theme="light"] .library-image-chat { color: #333; }
html[data-theme="light"] .library-image-kind,
html[data-theme="light"] .library-empty,
html[data-theme="light"] .library-loading { color: #777; }
html[data-theme="light"] .library-empty .material-symbols-rounded { color: #888; }
html[data-theme="light"] .library-image-card:focus-visible { outline-color: #111; }

.secondary-action-btn.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#projectsModal .modal,
#projectChatsModal .modal {
    border: 0;
}
#projectsModal .modal-actions button,
#projectChatsModal .modal-actions button {
    border: 0;
    border-radius: 999px;
}
#projectsModal .secondary-action-btn { border: 0; }

.chat-list-divider {
    height: 1px;
    background: #3a3a3a;
    margin: 10px 12px 6px;
}

html[data-theme="light"] .chat-list-divider { background: #e2e2e2; }

.mobile-menu-btn,
.mobile-settings-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #f5f5f5;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-menu-btn:hover,
.mobile-settings-btn:hover { background: #202020; }

html[data-theme="light"] .mobile-menu-btn,
html[data-theme="light"] .mobile-settings-btn { color: #111111; }
html[data-theme="light"] .mobile-menu-btn:hover,
html[data-theme="light"] .mobile-settings-btn:hover { background: #f0f0f0; }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9998;
}

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

@media (max-width: 900px) {
    .mobile-menu-btn { display: flex; }
    .mobile-settings-btn { display: none; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 9999;
        width: 85vw;
        max-width: 320px;
        min-width: 0;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 0 0 40px rgba(0,0,0,0.4);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* On mobile the sidebar is either fully open or fully hidden — the
       desktop "collapsed" (icon rail) state doesn't apply */
    .sidebar.collapsed {
        width: 85vw;
        max-width: 320px;
    }
    .sidebar.collapsed .sidebar-header {
        display: flex;
        min-height: 72px;
        padding: 0 18px;
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .sidebar.collapsed .sidebar-logo {
        width: 36px;
        height: 36px;
        max-height: 36px;
    }

    .sidebar.collapsed .sidebar-logo.full-logo {
        display: block;
    }

    .sidebar.collapsed .sidebar-logo.collapsed-logo {
        display: none;
    }

    .sidebar.collapsed .new-chat,
    .sidebar.collapsed .user-btn {
        display: flex;
        width: 100%;
        padding: 0 12px;
        margin: 0;
        justify-content: flex-start;
    }

    .sidebar.collapsed .sidebar-search-btn {
        display: flex;
    }

    .sidebar.collapsed .history-label {
        display: block;
    }

    .sidebar.collapsed .chat-list {
        display: block;
    }

    .sidebar.collapsed .hide-collapsed {
        display: inline !important;
    }

    .sidebar.collapsed .sidebar-toggle {
        display: none;
    }

    .topbar {
        padding: 0 12px;
        gap: 8px;
        justify-content: flex-start;
    }

    #chatTitle {
        display: none;
    }

    .top-actions {
        gap: 6px;
        flex-shrink: 0;
    }

    .upgrade-plan-pill {
        min-height: 36px;
        padding: 0 13px;
        font-size: 12px;
    }

    .topbar > .top-actions:last-of-type {
        margin-left: auto;
    }

    .guest-pill {
        height: 38px;
        max-width: 112px;
        gap: 6px;
        padding: 0 8px;
        font-size: 12px;
        flex-shrink: 1;
        min-width: 0;
    }

    .guest-pill span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .guest-pill button {
        height: 26px;
        padding: 0 8px;
        flex: 0 0 auto;
    }

    .install-pwa-btn {
        width: 38px;
        height: 38px;
        padding: 0;
        flex: 0 0 auto;
    }

    .install-pwa-btn span:last-child {
        display: none;
    }

    .mobile-model-slot {
    display: flex;
    min-width: 0;
    flex: 0 1 auto;
    width: auto;
}

.mobile-model-slot .model-selector {
    width: auto;
    min-width: 0;
    max-width: 150px;
}

.mobile-model-slot #modelSelectorButton {
    width: auto !important;
    height: 38px !important;
    min-width: 0 !important;
    max-width: 150px;
    padding: 0 10px !important;
    gap: 4px;
    background: #171717 !important;
    border: 1px solid #303030 !important;
    justify-content: space-between;
}

#currentModelName {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

  .mobile-model-slot .model-menu-popover {
    position: fixed;
    top: 58px;
    left: 12px;
    right: 12px;
    bottom: auto;
    width: auto;
    min-width: 0;
    max-width: none;
    z-index: 10001;
}

    html[data-theme="light"] .mobile-model-slot #modelSelectorButton {
        background: #ffffff !important;
        border-color: #dcdcdc !important;
        color: #111111;
    }

    .credits-full-text { display: none; }
    .credits-mobile-text { display: inline; }
    .credits-pill {
        min-width: 68px;
        justify-content: center;
        order: 1;
        padding: 0 10px;
    }

    .credits-panel, .credits-info-panel {
        right: -8px;
        left: auto;
        min-width: min(320px, 92vw);
        max-width: 92vw;
    }

    .chat-window {
        padding: 20px 14px 16px;
    }

    .input-area {
        padding: 10px 12px 14px;
    }

    .welcome-text {
        font-size: 24px !important;
    }

    .bubble {
        max-width: 100%;
    }

    .model-selector #modelSelectorButton {
        min-width: 0 !important;
        padding: 0 8px !important;
    }
    #currentModelName {
        max-width: none;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .model-menu-popover {
        right: -10px;
        min-width: min(260px, 90vw);
    }

    .input-shell {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr) 40px;
        grid-template-areas: "plus input send";
        gap: 6px;
        align-items: center;
        padding: 8px;
    }
    .input-shell .composer-submit-control {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .input-shell input,
    .input-shell textarea {
        grid-area: input;
        min-width: 0;
        width: 100%;
        padding: 10px 4px;
    }

    .input-shell #plusButton { grid-area: plus; }
    .input-shell .composer-toolbar-actions { grid-area: send; }

    .input-shell .input-icon-btn {
        width: 40px;
        min-width: 40px;
        height: 40px;
    }

    #currentModelName { max-width: none; }

    .settings-modal, .modal {
        width: 94vw;
        max-height: min(86vh, 720px);
        overflow-y: auto;
    }

    .settings-shell {
        flex-direction: column;
    }
    .settings-nav {
        flex-direction: row;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #242424;
        padding-right: 0;
        padding-bottom: 10px;
        overflow-x: auto;
    }
    .settings-nav-item { white-space: nowrap; }

    .voice-orb-shell {
        width: min(220px, 60vw);
    }
}

@media (max-width: 420px) {
    .topbar {
        padding: 0 10px;
        gap: 6px;
    }

    #chatTitle {
        display: none;
    }

    .input-area {
        padding-left: 8px;
        padding-right: 8px;
    }

    .upload-preview {
        width: 100%;
    }

    .upload-preview-item,
    .upload-preview-thumb {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
    }

    .input-shell {
        grid-template-columns: 38px minmax(0, 1fr) 38px 38px;
        gap: 5px;
        border-radius: 24px;
    }

    .input-shell .input-icon-btn {
        width: 38px;
        min-width: 38px;
        height: 38px;
    }

    .input-shell input,
    .input-shell textarea {
        font-size: 14px;
    }

    .mobile-model-slot #modelSelectorButton {
        max-width: 118px;
        padding: 0 8px !important;
    }

    #currentModelName {
        max-width: 78px;
    }

    .guest-pill {
        max-width: 86px;
        padding: 0 6px;
    }

    .guest-pill button {
        display: none;
    }
}
.mobile-top-new-chat-btn {
    display: none !important;
}

@media (max-width: 900px) {
    .mobile-top-new-chat-btn {
        display: inline-flex !important;
    }
}

@media (max-width: 900px) {
    #sidebar.sidebar,
    #sidebar.sidebar.collapsed {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: none !important;
        height: 100vh !important;
        z-index: 9999 !important;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: none !important;
    }

    #sidebar.sidebar.mobile-open {
        transform: translateX(0);
    }

    #sidebarBackdrop.open {
        display: none;
    }
}

@media (max-width: 900px) {
    #sidebar .sidebar-header {
        justify-content: flex-start !important;
        padding: 18px 16px 10px !important;
        gap: 4px !important;
    }

    #sidebar .sidebar-logo.full-logo {
        display: block !important;
        margin-right: auto !important;
    }

    #sidebar .sidebar-logo.collapsed-logo {
        display: none !important;
    }

    #sidebar .sidebar-search-btn {
        display: flex !important;
        margin-left: 0 !important;
        order: 1;
    }

    #sidebar .sidebar-toggle {
        display: flex !important;
        margin-left: 0 !important;
        order: 2;
    }

    #sidebar .sidebar-actions,
    #sidebar .chat-search-bar,
    #sidebar .chat-list,
    #sidebar .sidebar-footer {
        width: min(420px, 92vw);
        margin-left: auto !important;
        margin-right: auto !important;
    }

    #sidebar .sidebar-actions {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-top: 28px !important;
    }

    #sidebar .history-label {
        width: min(420px, 92vw);
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    #sidebar .chat-list {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

@media (max-width: 900px) {
    #sidebar .chat-list {
        width: min(420px, 92vw) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #sidebar .chat-item {
        justify-content: center !important;
        text-align: center !important;
    }

    #sidebar .chat-item-title {
        text-align: center;
    }

    #sidebar .sidebar-footer {
        width: min(420px, 92vw) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #sidebar .user-btn {
        justify-content: center !important;
        text-align: center !important;
    }
}

@media (max-width: 900px) {
    #sidebar .history-label,
    #sidebar .chat-list-divider {
        width: min(420px, 92vw) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        text-align: center !important;
    }
}

@media (max-width: 900px) {
    #sidebar .history-label,
    #sidebar .chat-list-divider {
        width: 100% !important;
        margin: 14px 0 8px !important;
        padding: 0 !important;
        text-align: center !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    #sidebar .chat-list {
        width: 100% !important;
        padding: 0 24px !important;
    }

    #sidebar .chat-item {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }

    #sidebar .sidebar-footer {
        width: 100% !important;
        padding: 14px 24px !important;
    }

    #sidebar .user-btn {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }
}

@media (max-width: 900px) {
    .credits-panel,
    .credits-info-panel {
        position: absolute !important;
        inset: auto -16px calc(100% + 8px) -16px !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        height: auto !important;
        max-height: min(62vh, 620px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        border-radius: 16px !important;
        z-index: 10050 !important;
        padding: 14px !important;
    }

    .credits-panel.open,
    .credits-info-panel.open {
        display: block !important;
    }
}

.credits-panel-close {
    display: none;
}

@media (max-width: 900px) {
    .credits-panel-close {
        display: flex;
        position: sticky;
        top: 0;
        margin-left: auto;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        border: 0;
        background: #171717;
        color: #f5f5f5;
        align-items: center;
        justify-content: center;
        z-index: 2;
    }

    html[data-theme="light"] .credits-panel-close {
        background: #ffffff;
        color: #111111;
    }
}

/* Mobile sidebar profile visibility fix: keep the profile button reachable on every phone height. */
@media (max-width: 900px) {
    #sidebar.sidebar,
    #sidebar.sidebar.collapsed {
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
    }

    #sidebar .sidebar-header,
    #sidebar .sidebar-actions,
    #sidebar .chat-search-bar,
    #sidebar .history-label {
        flex: 0 0 auto !important;
    }

    #sidebar .sidebar-spacer {
        display: none !important;
    }

    #sidebar .chat-list {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        padding-bottom: 10px !important;
    }

    #sidebar .sidebar-footer {
        flex: 0 0 auto !important;
        margin-top: 0 !important;
        padding: 10px max(16px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right)) !important;
        background: #000000 !important;
        position: relative !important;
        z-index: 2 !important;
    }

    #sidebar .user-btn {
        display: flex !important;
        height: 44px !important;
        min-height: 44px !important;
        width: 100% !important;
        max-width: 420px !important;
        margin: 0 auto !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;
        overflow: hidden !important;
    }

    #sidebar #displayName {
        display: inline-block !important;
        min-width: 0 !important;
        max-width: calc(100vw - 96px) !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html[data-theme="light"] #sidebar .sidebar-footer {
        background: #f6f6f6 !important;
    }
}

/* Mobile keyboard fix: prevent browser input zoom and keep the app fitted to the visible viewport. */
@media (max-width: 900px) {
    html,
    body,
    .app,
    .main {
        height: var(--kyro-app-height, 100dvh) !important;
        max-height: var(--kyro-app-height, 100dvh) !important;
    }

    html,
    body {
        min-height: var(--kyro-app-height, 100dvh) !important;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    .content-area {
        min-height: 0 !important;
    }

    .chat-window {
        min-height: 0 !important;
        flex: 1 1 auto !important;
        padding-bottom: 12px !important;
    }

    .content-area.welcome-mode {
        justify-content: center !important;
    }

    .content-area.welcome-mode .chat-window {
        flex: 0 0 auto !important;
        min-height: auto !important;
        overflow: visible !important;
        padding: 0 14px !important;
    }

    .input-area {
        flex: 0 0 auto !important;
        position: relative !important;
        z-index: 5 !important;
        background: #000000 !important;
        padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
    }

    input,
    select,
    textarea,
    .input-shell input,
    .name-input,
    #messageInput {
        font-size: 16px !important;
    }

    html[data-theme="light"] .input-area {
        background: #ffffff !important;
    }
}
/* Compact composer */
html:not([data-theme="light"]) .app,
html:not([data-theme="light"]) .sidebar,
html:not([data-theme="light"]) .main,
html:not([data-theme="light"]) .content-area,
html:not([data-theme="light"]) .chat-window,
html:not([data-theme="light"]) .input-area,
html:not([data-theme="light"]) .topbar { background: #000000; }

.welcome-text {
    font-size: 26px !important;
    font-weight: 500;
    letter-spacing: 0;
}

.input-area { padding-top: 12px; }
.input-shell {
    width: min(100%, 720px);
    min-height: 54px;
    margin: 0 auto;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: #141414;
}
.input-shell.is-expanded {
    min-height: 86px;
    padding: 10px 10px 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    border-radius: 24px;
}
.input-shell:focus,
.input-shell:focus-within,
.input-shell textarea:focus,
.input-shell input:focus {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}
.input-shell textarea,
.input-shell input {
    flex: none;
    min-width: 0;
    padding: 5px 7px;
    font-weight: 400;
}
.input-shell textarea {
    order: 1;
    flex: 1 1 auto;
    width: auto;
    min-height: 30px;
    max-height: 150px;
    align-self: center;
}
.composer-toolbar {
    display: contents;
}
.composer-toolbar-actions {
    order: 2;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
}
.composer-submit-control {
    position: relative;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
}
.composer-submit-control > .input-icon-btn {
    position: absolute;
    inset: 0;
    width: 100%;
    min-width: 100%;
    height: 100%;
    transition: opacity 0.16s ease, transform 0.2s ease;
}
.input-shell:not(.has-draft) #sendButton {
    opacity: 0;
    transform: translateX(8px) scale(0.85);
    pointer-events: none;
}
.input-shell.has-draft #micButton {
    opacity: 0;
    transform: translateX(-8px) scale(0.85);
    pointer-events: none;
}
.input-shell.has-draft #sendButton {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}
.input-shell #plusButton { order: 0; }
.input-shell.is-expanded textarea {
    order: initial;
    flex: none;
    width: 100%;
    align-self: stretch;
}
.input-shell.is-expanded .composer-toolbar {
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.input-shell.is-expanded .composer-toolbar-actions { order: initial; }
.input-shell.is-expanded #plusButton { order: initial; }
.input-shell .input-icon-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
}
.input-shell #modelSelectorButton {
    height: 34px;
    min-width: 0;
    max-width: 170px;
    padding: 0 8px;
    justify-content: space-between;
    gap: 3px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    font-weight: 500;
}
.input-shell .plus-menu { bottom: 48px; }
.input-shell .model-menu-popover { bottom: 42px; }
.input-shell #sendButton.primary,
.input-shell #sendButton.primary:disabled {
    background: #2a2a2a;
    color: #777777;
}
.input-shell #sendButton .material-symbols-rounded { opacity: 1; }
.input-shell #sendButton.send-ready {
    background: #ffffff;
    color: #000000;
}
.input-shell #sendButton.send-ready .material-symbols-rounded { opacity: 1; }

.message-image-grid {
    width: min(100%, 640px);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin: 10px 0 0;
}

.message-image-grid.multiple {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.message-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    border: 0;
    border-radius: 16px;
    background: transparent;
}

.message.user .message-image-grid {
    width: min(100%, 560px);
    margin-top: 0;
    margin-bottom: 8px;
}

.message-image-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: transparent;
    cursor: zoom-in;
    overflow: hidden;
}

.message-image-button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 76px 24px 24px;
    background: rgba(0, 0, 0, 0.94);
}

.image-viewer.open {
    display: flex;
}

.image-viewer-image {
    display: block;
    max-width: min(1400px, 100%);
    max-height: calc(100dvh - 100px);
    object-fit: contain;
    border-radius: 16px;
}

.image-viewer-toolbar {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-viewer-control {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
}

.image-viewer-control:hover {
    background: rgba(255, 255, 255, 0.1);
}

.image-viewer-control .material-symbols-rounded {
    font-size: 22px;
}

.image-viewer-control:disabled {
    opacity: 0.5;
    cursor: wait;
}

.image-viewer-control[hidden] {
    display: none;
}

@media (max-width: 600px) {
    .image-viewer {
        padding: 68px 12px 16px;
    }

    .image-viewer-image {
        max-height: calc(100dvh - 84px);
        border-radius: 12px;
    }

    .image-viewer-toolbar {
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
    }
}

html[data-theme="light"] .input-shell {
    background: #ededed !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}
html[data-theme="light"] .input-shell #plusButton,
html[data-theme="light"] .input-shell #micButton,
html[data-theme="light"] .input-shell #modelSelectorButton,
html[data-theme="light"] .input-shell #plusButton .material-symbols-rounded,
html[data-theme="light"] .input-shell #micButton .material-symbols-rounded,
html[data-theme="light"] .input-shell #modelSelectorButton .material-symbols-rounded {
    color: #333333 !important;
}
html[data-theme="light"] .input-shell #sendButton.primary:disabled {
    background: #dedede;
    color: #999999;
}
html[data-theme="light"] .input-shell #sendButton.primary:disabled .material-symbols-rounded {
    color: #888888 !important;
}
html[data-theme="light"] .input-shell #sendButton.send-ready {
    background: #111111;
    color: #ffffff !important;
}
html[data-theme="light"] .input-shell #sendButton.send-ready .material-symbols-rounded {
    color: #ffffff !important;
}
html[data-theme="light"] .sidebar-product-link { color: #222; }
html[data-theme="light"] .sidebar-product-link:hover { background: #e9e9e9; color: #000; }
html[data-theme="light"] #sidebar .material-symbols-rounded {
    color: #555555 !important;
}
html[data-theme="light"] #sidebar button:hover .material-symbols-rounded,
html[data-theme="light"] #sidebar .sidebar-product-link:hover .material-symbols-rounded {
    color: #111111 !important;
}

#shareChatButton {
    border-color: transparent !important;
    background: transparent !important;
}
#shareChatButton:hover { background: rgba(255, 255, 255, 0.08) !important; }
html[data-theme="light"] #shareChatButton { border-color: transparent !important; background: transparent !important; }
html[data-theme="light"] #shareChatButton:hover { background: rgba(0, 0, 0, 0.06) !important; }

@media (min-width: 901px) {
    .sidebar.collapsed .sidebar-line-icon {
        width: 20px;
        height: 20px;
        flex-basis: 20px;
    }
    .sidebar.collapsed .user-btn .avatar .sidebar-line-icon {
        width: 18px;
        height: 18px;
        flex-basis: 18px;
    }
    .sidebar.collapsed .sidebar-header {
        position: relative;
        min-height: 56px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .sidebar.collapsed .sidebar-logo.collapsed-logo,
    .sidebar.collapsed .sidebar-toggle {
        position: absolute;
        inset: 10px auto auto 10px;
        width: 36px;
        height: 36px;
        margin: 0;
        transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    }
    .sidebar.collapsed .sidebar-logo.collapsed-logo {
        display: block;
        inset: 18px auto auto 18px;
        width: 20px;
        height: 20px;
        max-height: 20px;
        opacity: 1;
        pointer-events: none;
    }
    .sidebar.collapsed .sidebar-toggle {
        opacity: 0;
        pointer-events: none;
    }
    .sidebar.collapsed:hover .sidebar-logo.collapsed-logo {
        opacity: 0;
    }
    .sidebar.collapsed:hover .sidebar-toggle {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 900px) {
    .welcome-text { font-size: 22px !important; }
    .content-area.welcome-mode .chat-window { transform: translateY(-11px); }
    .content-area.welcome-mode .input-area { transform: translateY(9px); }
    .input-shell {
        display: flex;
        min-height: 54px;
        padding: 8px;
        border-radius: 999px;
    }
    .input-shell.is-expanded {
        min-height: 86px;
        padding: 10px 10px 8px;
        flex-direction: column;
        align-items: stretch;
        border-radius: 24px;
    }
    .input-shell textarea,
    .input-shell input { width: 100%; padding: 5px 7px 7px; }
    .input-shell:not(.is-expanded) textarea { width: auto; min-height: 30px; padding: 5px 7px; }
    .input-shell .input-icon-btn { width: 34px; min-width: 34px; height: 34px; }
    .input-shell #modelSelectorButton { max-width: 150px; padding: 0 6px !important; }
}

.staff-message-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.68);display:flex;align-items:center;justify-content:center;z-index:10090;padding:16px}
.staff-message-card{position:relative;width:min(440px,100%);max-height:86vh;overflow-y:auto;background:#111;border:1px solid #303030;border-radius:28px;padding:26px 24px 24px;color:#f5f5f5;box-shadow:0 30px 80px rgba(0,0,0,.55)}
.staff-message-close{position:absolute;top:12px;right:12px;width:36px;height:36px;border:0;border-radius:999px;background:transparent;color:#a8a8a8;display:inline-flex;align-items:center;justify-content:center}
.staff-message-close:hover{background:#202020;color:#fff}
.staff-message-title{margin:0 40px 0 0;font-size:20px;font-weight:750;line-height:1.3}
.staff-message-text{margin:10px 0 0;color:#bdbdbd;font-size:14px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.staff-message-image{display:block;width:100%;max-height:50vh;object-fit:cover;border-radius:16px;margin-top:16px}
html[data-theme="light"] .staff-message-card{background:#fff;border-color:#dcdcdc;color:#111;box-shadow:0 30px 80px rgba(0,0,0,.18)}
html[data-theme="light"] .staff-message-text{color:#555}
html[data-theme="light"] .staff-message-close{color:#777}
html[data-theme="light"] .staff-message-close:hover{background:#eee;color:#111}
.avatar { overflow: hidden; }
.messages-btn {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: #f5f5f5;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    white-space: nowrap;
}
.projects-btn {
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.messages-btn:hover { background: #202020; }
.messages-btn > .sidebar-line-icon { color: inherit; }
.messages-beta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 17px;
    margin-left: -5px;
    padding: 0 6px;
    border: 1px solid #303030;
    border-radius: 999px;
    background: #1b1b1b;
    color: #a0a0a0;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1;
}
.user-btn .avatar .sidebar-line-icon { width: 16px; height: 16px; flex-basis: 16px; }
.sidebar.collapsed .messages-btn { width: 36px; padding: 0; margin: 0 auto; justify-content: center; }
/* Red unread badge on the Messages link (count kept by the Messages Worker) */
.messages-unread { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e5484d; color: #ffffff; font-size: 11px; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.messages-unread[hidden] { display: none; }
.sidebar.collapsed .messages-btn { position: relative; }
.sidebar.collapsed .messages-unread { position: absolute; top: -3px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; margin: 0; }
html[data-theme="light"] .messages-btn { color: #111111; }
html[data-theme="light"] .messages-btn:hover { background: #f0f0f0; }
html[data-theme="light"] .messages-beta { border-color: #dcdcdc; background: #ececec; color: #777777; }
.settings-avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.settings-avatar { width: 64px; min-width: 64px; height: 64px; }
.settings-avatar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.connection-row { padding: 14px 0; border-bottom: 1px solid #292929; }
.connection-row:last-child { border-bottom: 0; }
.connection-row-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.connection-row-head .material-symbols-rounded { color: #a8a8a8; font-size: 20px; }
.connection-row-head b { flex: 1; font-size: 15px; }
.connection-soon-pill { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: #202020; color: #bdbdbd; }
.connection-row p { margin: 0 0 4px; color: #999; font-size: 12px; line-height: 1.5; }
.connection-row .secondary-action-btn { margin-top: 8px; }
.connection-row .secondary-action-btn:disabled { opacity: .45; cursor: default; }

#settingsModal .settings-modal,
#settingsModal .settings-nav-item,
#settingsModal .settings-close-btn,
#settingsModal .secondary-action-btn,
#settingsModal .danger-action-btn,
#settingsModal .user-id-copy-btn,
#settingsModal .nemigo-copy-btn,
#settingsModal .subscription-plan-action,
#settingsModal .toggle,
#settingsModal .theme-switcher,
#settingsModal .readonly-field,
#settingsModal .user-id-row,
#settingsModal .name-input,
#settingsModal .memory-textarea {
    border: 0;
}

#settingsModal :is(button, input, textarea, a):focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
