/*
 * GPT theme - home view skin.
 * Loaded after the view's own <style>, so every rule here is scoped to
 * body.gpt-theme to win over the base rules without touching them.
 */

/* ---------- Tokens ---------- */

:root {
    --bg-primary: #000000;
    --bg-secondary: #2c2c2c;
    --bg-sidebar: #000000;
    --bg-input: #1b1b1b;
    --bg-hover: #1a1a1a;
    --text-primary: #f3f3f3;
    --text-secondary: #afafaf;
    --text-muted: #8f8f8f;
    --accent-blue: #7ab7ff;
    --accent-color: #ffffff;
    --accent-gradient: linear-gradient(#f3f3f3, #f3f3f3);
    --border-color: #2a2a2a;
    --chip-bg: transparent;
    --chip-border: transparent;

    --gpt-line: #1c1c1c;
    --gpt-popover: #2c2c2c;
    --gpt-popover-line: rgba(255, 255, 255, .12);
    --gpt-popover-hover: rgba(255, 255, 255, .08);
    --gpt-bubble: #1e1e1e;
    --gpt-control: #303030;
    --gpt-outline: #424242;
    --gpt-solid: #ffffff;
    --gpt-on-solid: #0d0d0d;
    --gpt-avatar: #d16f65;
    --gpt-danger: #e02e2a;
    --gpt-shadow: 0 8px 28px rgba(0, 0, 0, .55);
    --gpt-accent: #3a83f7;
    --gpt-track: #3f3f3f;
    --gpt-tint-1: #f28b82;
    --gpt-tint-2: #7ab7ff;
    --gpt-tint-3: #81c995;
    --gpt-tint-4: #fdd663;
    --gpt-font: "Inter", ui-sans-serif, -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
}

[data-theme-version="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --bg-sidebar: #f9f9f9;
    --bg-input: #ffffff;
    --bg-hover: #ececec;
    --text-primary: #0d0d0d;
    --text-secondary: #5d5d5d;
    --text-muted: #8f8f8f;
    --accent-blue: #2964aa;
    --accent-color: #0d0d0d;
    --accent-gradient: linear-gradient(#0d0d0d, #0d0d0d);
    --border-color: #e5e5e5;
    --chip-bg: transparent;
    --chip-border: transparent;

    --gpt-line: #ededed;
    --gpt-popover: #ffffff;
    --gpt-popover-line: rgba(0, 0, 0, .1);
    --gpt-popover-hover: rgba(0, 0, 0, .06);
    --gpt-bubble: #f4f4f4;
    --gpt-control: #f4f4f4;
    --gpt-outline: #d9d9d9;
    --gpt-solid: #0d0d0d;
    --gpt-on-solid: #ffffff;
    --gpt-shadow: 0 8px 28px rgba(0, 0, 0, .14);
    --gpt-accent: #2964aa;
    --gpt-track: #e3e3e3;
    --gpt-tint-1: #d93025;
    --gpt-tint-2: #1a73e8;
    --gpt-tint-3: #188038;
    --gpt-tint-4: #e37400;
}

body.gpt-theme {
    font-family: var(--gpt-font);
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

body.gpt-theme button,
body.gpt-theme input,
body.gpt-theme textarea,
body.gpt-theme select {
    font-family: inherit;
}

/* ---------- Sidebar ---------- */

body.gpt-theme .sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--gpt-line);
}

body.gpt-theme .sidebar-header {
    justify-content: space-between;
    height: 52px;
    padding: 8px 8px 8px 16px;
}

body.gpt-theme .logo {
    min-width: 0;
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.gpt-theme .logo img {
    max-height: 26px !important;
    width: auto;
    display: block;
}

body.gpt-theme .gpt-sidebar-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

body.gpt-theme .sidebar-toggle,
body.gpt-theme .mobile-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    color: var(--text-secondary);
}

body.gpt-theme .sidebar-toggle:hover,
body.gpt-theme .mobile-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body.gpt-theme .sidebar-toggle .material-symbols-outlined,
body.gpt-theme .mobile-toggle .material-symbols-outlined {
    font-size: 20px;
}

/* Rows: new chat, quick links, recents, settings nav */
body.gpt-theme .new-chat-btn,
body.gpt-theme .sidebar-menu-item,
body.gpt-theme .nav-item,
body.gpt-theme .settings-btn {
    width: auto;
    min-height: 36px;
    margin: 0 6px;
    padding: 0 10px;
    gap: 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    transition: none;
}

body.gpt-theme .new-chat-btn {
    margin-top: 2px;
}

body.gpt-theme .new-chat-btn:hover,
body.gpt-theme .sidebar-menu-item:hover,
body.gpt-theme .nav-item:hover,
body.gpt-theme .nav-item.active,
body.gpt-theme .settings-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body.gpt-theme .new-chat-btn .material-symbols-outlined,
body.gpt-theme .sidebar-menu-item .material-symbols-outlined,
body.gpt-theme .settings-btn .material-symbols-outlined {
    font-size: 20px;
}

body.gpt-theme .sidebar-quick-menu {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    border-bottom: 0;
}

body.gpt-theme .sidebar-menu-item.menu-item-disabled,
body.gpt-theme .sidebar-menu-item.menu-item-disabled:hover {
    color: var(--text-muted);
}

body.gpt-theme .pro-badge,
body.gpt-theme .tool-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--gpt-control);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

body.gpt-theme .sidebar-nav {
    padding: 0;
    margin-top: 18px;
}

body.gpt-theme .nav-section {
    padding: 0;
}

body.gpt-theme .nav-section-title {
    padding: 6px 16px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
}

body.gpt-theme .nav-item {
    margin-bottom: 0;
    color: var(--text-primary);
}

body.gpt-theme .nav-item .chat-title {
    margin-right: 0;
}

body.gpt-theme .nav-item:hover .chat-title {
    margin-right: 52px;
}

/* Informative rows ("no chats yet", "sign in to save chats") */
body.gpt-theme .nav-item[style*="cursor: default"] {
    justify-content: flex-start;
    padding: 6px 10px;
    background: transparent;
    font-size: 13px;
    line-height: 18px;
}

body.gpt-theme .nav-item[style*="cursor: default"] .material-symbols-outlined {
    flex-shrink: 0;
    font-size: 18px;
}

body.gpt-theme .action-icon-btn {
    color: var(--text-secondary);
}

body.gpt-theme .action-icon-btn:hover {
    background: var(--gpt-popover-hover);
    color: var(--text-primary);
}

/* Footer: user card */
body.gpt-theme .sidebar-footer {
    padding: 6px;
    border-top: 0;
}

body.gpt-theme .sidebar-footer .settings-btn {
    width: 100%;
    margin: 0;
}

body.gpt-theme .gpt-user-card {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 6px 8px;
    border-radius: 12px;
    cursor: pointer;
    outline: none;
}

body.gpt-theme .gpt-user-card:hover,
body.gpt-theme .gpt-user-card:focus-visible,
body.gpt-theme .settings-menu.show + .gpt-user-card {
    background: var(--bg-hover);
}

body.gpt-theme .avatar-mini {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    background: var(--gpt-avatar);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
}

body.gpt-theme .user-details {
    flex: 1;
    min-width: 0;
}

body.gpt-theme .user-name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 18px;
}

body.gpt-theme .user-plan {
    margin-top: 0;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
}

body.gpt-theme .gpt-upgrade-pill {
    flex-shrink: 0;
    padding: 6px 12px;
    border: 1px solid var(--gpt-outline);
    border-radius: 999px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

body.gpt-theme .gpt-upgrade-pill:hover {
    background: var(--gpt-control);
}

/* ---------- Popovers ---------- */

body.gpt-theme .settings-menu,
body.gpt-theme .add-menu,
body.gpt-theme .tools-menu,
body.gpt-theme .model-dropdown,
body.gpt-theme .reasoning-menu,
body.gpt-theme .language-dropdown,
body.gpt-theme .sticky-menu-dropdown {
    padding: 6px;
    border: 1px solid var(--gpt-popover-line);
    border-radius: 16px;
    background: var(--gpt-popover);
    box-shadow: var(--gpt-shadow);
}

body.gpt-theme .settings-menu {
    bottom: calc(100% + 6px);
    left: 0;
    width: 100%;
    animation: none;
}

body.gpt-theme .settings-menu-header {
    display: block;
    margin-bottom: 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: transparent;
    text-decoration: none;
}

body.gpt-theme .settings-menu-header:hover {
    background: var(--gpt-popover-hover);
}

body.gpt-theme .user-info-mini {
    gap: 10px;
}

body.gpt-theme .gpt-chevron {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 18px !important;
}

body.gpt-theme .settings-divider {
    height: 1px;
    margin: 6px 10px;
    background: var(--gpt-popover-line);
}

body.gpt-theme .settings-item,
body.gpt-theme .add-menu-item,
body.gpt-theme .tools-menu-item,
body.gpt-theme .model-option,
body.gpt-theme .reasoning-option,
body.gpt-theme .language-dropdown-item,
body.gpt-theme .sticky-menu-item {
    min-height: 36px;
    padding: 8px 10px;
    gap: 10px;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 20px;
    transition: none;
}

body.gpt-theme .settings-item:hover,
body.gpt-theme .add-menu-item:hover,
body.gpt-theme .tools-menu-item:hover,
body.gpt-theme .model-option:hover,
body.gpt-theme .reasoning-option:hover,
body.gpt-theme .language-dropdown-item:hover,
body.gpt-theme .language-dropdown-item.active,
body.gpt-theme .sticky-menu-item:hover {
    background: var(--gpt-popover-hover);
    color: var(--text-primary);
}

body.gpt-theme .tools-menu-item.active,
body.gpt-theme .model-option.active,
body.gpt-theme .reasoning-option.active {
    background: var(--gpt-popover-hover);
    color: var(--text-primary);
    font-weight: 500;
}

body.gpt-theme .settings-item .material-symbols-outlined,
body.gpt-theme .add-menu-item .material-symbols-outlined,
body.gpt-theme .tools-menu-item .material-symbols-outlined,
body.gpt-theme .sticky-menu-item .material-symbols-outlined {
    font-size: 20px;
}

body.gpt-theme .model-dropdown,
body.gpt-theme .reasoning-menu,
body.gpt-theme .add-menu,
body.gpt-theme .tools-menu {
    margin-bottom: 10px;
}

/* Tools inside the "+" menu: a rule above them, a tick on the one in use */
body.gpt-theme .gpt-menu-divider {
    height: 1px;
    margin: 6px 10px;
    background: var(--gpt-popover-line);
}

body.gpt-theme .add-menu .tools-menu-item.active::after {
    content: 'check';
    margin-left: auto;
    padding-left: 12px;
    font-family: 'Material Symbols Outlined';
    font-size: 18px;
    line-height: 1;
    color: var(--text-primary);
}

body.gpt-theme .gpt-auth-short {
    display: none;
}

/* "Install the app": one line under the top bar */
body.gpt-theme .gpt-pwa-bar {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 58px);
    left: 12px;
    right: 12px;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 420px;
    min-height: 48px;
    margin: 0 auto;
    padding: 6px 6px 6px 10px;
    border: 1px solid var(--gpt-popover-line);
    border-radius: 16px;
    background: var(--gpt-popover);
    box-shadow: var(--gpt-shadow);
    animation: gpt-word-in .3s ease-out;
}

body.gpt-theme .gpt-pwa-icon,
body.gpt-theme .gpt-pwa-icon > * {
    flex: none;
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
}

body.gpt-theme .gpt-pwa-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.gpt-theme .gpt-pwa-install {
    flex: none;
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: var(--gpt-solid);
    color: var(--gpt-on-solid);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

body.gpt-theme .gpt-pwa-close {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

body.gpt-theme .gpt-pwa-close:hover {
    background: var(--bg-hover);
}

body.gpt-theme .gpt-pwa-close .material-symbols-outlined {
    font-size: 18px;
}

/* ---------- Top bar ---------- */

body.gpt-theme .header {
    min-height: 52px;
    padding: 8px 12px;
}

@media (min-width: 769px) {
    body.gpt-theme .header:not(:has(.guest-auth-actions)) {
        display: none;
    }
}

body.gpt-theme .auth-btn {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
}

body.gpt-theme .login-btn {
    border: 1px solid var(--gpt-solid);
    background: var(--gpt-solid);
    color: var(--gpt-on-solid);
}

body.gpt-theme .register-btn {
    border: 1px solid var(--gpt-outline);
    background: transparent;
    color: var(--text-primary);
}

body.gpt-theme .register-btn:hover {
    background: var(--bg-hover);
}

/* Account controls live in the sidebar user menu and in Settings. */
body.gpt-theme .header-right .upgrade-btn-header,
body.gpt-theme .header-right .language-dropdown-container,
body.gpt-theme .header-right .profile-dropdown-container {
    display: none !important;
}

/* ---------- Empty state ---------- */

body.gpt-theme .chat-area {
    max-width: 816px;
}

body.gpt-theme .greeting {
    margin-bottom: 28px;
}

body.gpt-theme .greeting h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 400;
    line-height: 34px;
    letter-spacing: -.01em;
}

body.gpt-theme .greeting h1 span {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: inherit;
}

body.gpt-theme .suggestions {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    margin: 22px 0 24px;
    padding: 0;
}

/* Starter prompts: plain rows with a colored icon */
body.gpt-theme .suggestion-chip,
body.gpt-theme .mobile-quick-chip {
    gap: 16px;
    min-height: 50px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 24px;
    text-align: left;
    transition: none;
}

body.gpt-theme .suggestion-chip:hover,
body.gpt-theme .mobile-quick-chip:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body.gpt-theme .suggestion-chip .emoji,
body.gpt-theme .mobile-quick-chip .chip-icon {
    flex-shrink: 0;
    font-size: 24px;
}

body.gpt-theme .suggestion-chip:nth-child(4n + 1) .emoji,
body.gpt-theme .mobile-quick-chip:nth-child(4n + 1) .chip-icon { color: var(--gpt-tint-1); }

body.gpt-theme .suggestion-chip:nth-child(4n + 2) .emoji,
body.gpt-theme .mobile-quick-chip:nth-child(4n + 2) .chip-icon { color: var(--gpt-tint-2); }

body.gpt-theme .suggestion-chip:nth-child(4n + 3) .emoji,
body.gpt-theme .mobile-quick-chip:nth-child(4n + 3) .chip-icon { color: var(--gpt-tint-3); }

body.gpt-theme .suggestion-chip:nth-child(4n + 4) .emoji,
body.gpt-theme .mobile-quick-chip:nth-child(4n + 4) .chip-icon { color: var(--gpt-tint-4); }

body.gpt-theme .footer-note {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* ---------- Composer ---------- */

body.gpt-theme .input-wrapper {
    border: 1px solid transparent;
    border-radius: 28px;
    background: var(--bg-input);
}

[data-theme-version="light"] body.gpt-theme .input-wrapper {
    border-color: var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
}

body.gpt-theme .input-field {
    color: var(--text-primary);
    font-size: 16px;
    line-height: 24px;
}

body.gpt-theme .input-field::placeholder {
    color: var(--text-secondary);
}

body.gpt-theme .action-btn,
body.gpt-theme .tools-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    color: var(--text-primary);
}

body.gpt-theme .action-btn:hover,
body.gpt-theme .tools-btn:hover {
    background: var(--gpt-popover-hover);
}

body.gpt-theme .action-btn .material-symbols-outlined {
    font-size: 22px;
}

body.gpt-theme .tools-btn .tools-btn-label {
    display: none;
}

/* Model + effort pill: "<model> <effort> v" */
body.gpt-theme .gpt-model-pill {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    height: 36px;
    padding: 0 8px 0 12px;
    border-radius: 999px;
    font-size: 14px;
    line-height: 20px;
    white-space: nowrap;
    cursor: pointer;
}

body.gpt-theme .gpt-model-pill:hover,
body.gpt-theme .gpt-model-pill:has(.model-dropdown.show),
body.gpt-theme .gpt-model-pill:has(.reasoning-menu.show) {
    background: var(--gpt-control);
}

/* Both popovers hang from the pill, not from each half of it. */
body.gpt-theme .model-selector,
body.gpt-theme .reasoning-selector {
    position: static;
}

body.gpt-theme .model-selector,
body.gpt-theme .reasoning-trigger {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
}

body.gpt-theme .model-selector {
    color: var(--text-primary);
}

body.gpt-theme .reasoning-trigger {
    color: var(--text-secondary);
}

body.gpt-theme .model-selector:hover,
body.gpt-theme .reasoning-trigger:hover {
    background: none;
}

body.gpt-theme .reasoning-trigger:hover {
    color: var(--text-primary);
}

body.gpt-theme #current-model-name {
    display: inline-block;
    max-width: 200px;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
}

body.gpt-theme .gpt-pill-chevron {
    color: var(--text-secondary);
    font-size: 18px;
}

body.gpt-theme .gpt-pill-hint {
    display: none;
    color: var(--text-primary);
}

body.gpt-theme .gpt-model-pill:has(.reasoning-menu.show) .gpt-pill-hint {
    display: inline;
}

body.gpt-theme .gpt-model-pill:has(.reasoning-menu.show) #current-model-name,
body.gpt-theme .gpt-model-pill:has(.reasoning-menu.show) .reasoning-trigger {
    display: none;
}

/* Popovers: below the pill on the empty state, above it once chatting */
body.gpt-theme .gpt-model-pill .model-dropdown,
body.gpt-theme .gpt-model-pill .gpt-effort {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    bottom: auto;
    left: auto;
    z-index: 30;
    margin: 0;
    cursor: default;
}

body.gpt-theme .chat-area:has(.message) .gpt-model-pill .model-dropdown,
body.gpt-theme .chat-area:has(.message) .gpt-model-pill .gpt-effort {
    top: auto;
    bottom: calc(100% + 10px);
}

body.gpt-theme .gpt-model-pill .model-dropdown {
    width: 280px;
    min-width: 0;
    max-height: min(420px, 46vh);
    scrollbar-width: thin;
    scrollbar-color: var(--gpt-outline) transparent;
}

body.gpt-theme .chat-area:has(.message) .gpt-model-pill .model-dropdown {
    max-height: min(420px, 58vh);
}

body.gpt-theme .gpt-dd-title {
    padding: 8px 12px 6px;
    color: var(--text-secondary);
    font-size: 14px;
}

body.gpt-theme .gpt-default-option {
    display: flex;
    flex-direction: column;
    margin-bottom: 2px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
}

body.gpt-theme .gpt-default-option strong {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

body.gpt-theme .gpt-default-option span {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 16px;
}

body.gpt-theme .gpt-default-option:hover,
body.gpt-theme .gpt-default-option.active {
    background: var(--gpt-popover-hover);
}

body.gpt-theme .gpt-model-pill .model-option {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
}

body.gpt-theme .gpt-model-pill .model-option.active {
    background: transparent;
    color: var(--text-primary);
}

body.gpt-theme .gpt-model-pill .model-option.active:hover {
    background: var(--gpt-popover-hover);
}

body.gpt-theme .gpt-model-pill .model-option.active::after {
    content: 'check';
    flex-shrink: 0;
    font-family: 'Material Symbols Outlined';
    font-size: 18px;
    font-weight: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
}

body.gpt-theme .promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--gpt-popover-hover);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
}

body.gpt-theme .promo-badge .material-symbols-outlined {
    font-size: 13px;
}

/* Effort slider. It replaces the plain list of levels only once js/home.js is running,
   so the built-in label and list keep working if the script fails to load. */
body.gpt-theme.gpt-effort-ready .reasoning-menu,
body.gpt-theme.gpt-effort-ready #current-reasoning-label {
    display: none !important;
}

body.gpt-theme .gpt-effort {
    display: none;
    width: 300px;
    padding: 12px 14px 16px;
    border: 1px solid var(--gpt-popover-line);
    border-radius: 20px;
    background: var(--gpt-popover);
    box-shadow: var(--gpt-shadow);
}

body.gpt-theme.gpt-effort-ready .reasoning-menu.show + .gpt-effort {
    display: block;
}

body.gpt-theme .gpt-effort-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

body.gpt-theme .gpt-effort-end {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

body.gpt-theme .gpt-effort-end:hover {
    color: var(--text-primary);
}

body.gpt-theme .gpt-effort-end .material-symbols-outlined {
    font-size: 20px;
}

/* Slider title: also the way into the model list */
body.gpt-theme .gpt-effort-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
    margin-top: -4px;
    padding: 4px 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}

body.gpt-theme .gpt-effort-title:hover,
body.gpt-theme .gpt-effort-title:focus-visible {
    outline: none;
    background: var(--gpt-popover-hover);
}

body.gpt-theme .gpt-effort-title strong {
    color: var(--gpt-accent);
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
}

body.gpt-theme .gpt-effort.is-locked .gpt-effort-title strong {
    color: var(--text-secondary);
}

body.gpt-theme #gpt-effort-model {
    max-width: 200px;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.gpt-theme #gpt-effort-model::after {
    content: ' \203A';
}

body.gpt-theme .gpt-effort-track {
    position: relative;
    height: 28px;
    border-radius: 999px;
    background: var(--gpt-track);
}

/* Dot centers line up with the thumb center at each stop. */
body.gpt-theme .gpt-effort-dots {
    position: absolute;
    inset: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

body.gpt-theme .gpt-effort-dots i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
}

body.gpt-theme .gpt-effort-dots i.is-locked {
    opacity: .4;
}

body.gpt-theme #gpt-effort-range {
    position: relative;
    display: block;
    width: 100%;
    height: 28px;
    margin: 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

body.gpt-theme #gpt-effort-range::-webkit-slider-runnable-track {
    height: 28px;
    background: transparent;
}

body.gpt-theme #gpt-effort-range::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
    -webkit-appearance: none;
    appearance: none;
}

body.gpt-theme #gpt-effort-range::-moz-range-track {
    height: 28px;
    background: transparent;
}

body.gpt-theme #gpt-effort-range::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

body.gpt-theme .gpt-effort-upsell {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 18px;
    text-decoration: none;
    white-space: normal;
}

body.gpt-theme .gpt-effort-upsell[hidden] {
    display: none;
}

body.gpt-theme .gpt-effort-upsell .material-symbols-outlined {
    font-size: 16px;
}


body.gpt-theme .active-tool-chip {
    height: 32px;
    margin-right: 0;
    border: 0;
    border-radius: 999px;
    background: var(--gpt-control);
    color: var(--accent-blue);
}

body.gpt-theme .attachment-preview {
    border-color: var(--gpt-popover-line);
    background: var(--gpt-popover-hover);
}

/* Send: solid round button with an up arrow, square while streaming */
body.gpt-theme .action-btn.send-btn {
    background: var(--gpt-solid);
    color: var(--gpt-on-solid);
}

body.gpt-theme .action-btn.send-btn:hover {
    background: var(--gpt-solid);
    opacity: .85;
}

body.gpt-theme .action-btn.send-btn:disabled {
    background: var(--gpt-control);
    color: var(--text-muted);
    opacity: 1;
}

body.gpt-theme #send-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0 !important;
}

body.gpt-theme #send-icon::before {
    content: 'arrow_upward';
    font-size: 20px;
}

body.gpt-theme .action-btn.send-btn.stopping {
    background: var(--gpt-solid);
}

body.gpt-theme .action-btn.send-btn.stopping #send-icon::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: var(--gpt-on-solid);
}

@media (min-width: 769px) {
    body.gpt-theme .input-container {
        margin-bottom: 40px;
    }

    body.gpt-theme .input-wrapper {
        display: grid;
        grid-template-columns: auto auto minmax(0, 1fr) auto;
        grid-template-areas:
            "preview preview preview preview"
            "left chip field right";
        align-items: center;
        gap: 0 4px;
        min-height: 56px;
        padding: 9px 10px;
    }

    body.gpt-theme .input-wrapper.gpt-multiline {
        grid-template-areas:
            "preview preview preview preview"
            "field field field field"
            "left chip . right";
        row-gap: 6px;
        padding: 12px 10px 9px;
    }

    body.gpt-theme .attachment-preview {
        grid-area: preview;
        margin-bottom: 8px;
    }

    body.gpt-theme .input-field {
        grid-area: field;
        padding: 0 8px;
    }

    body.gpt-theme .input-wrapper:not(.gpt-multiline) .input-field {
        overflow: hidden;
    }

    body.gpt-theme .input-wrapper.gpt-multiline .input-field {
        padding: 0 10px;
    }

    body.gpt-theme .input-actions {
        display: contents;
    }

    body.gpt-theme .input-actions-left {
        grid-area: left;
        gap: 2px;
    }

    body.gpt-theme .active-tool-chip {
        grid-area: chip;
    }

    body.gpt-theme .input-actions-right {
        grid-area: right;
        gap: 2px;
    }

    body.gpt-theme .action-btn.send-btn {
        margin-left: 4px;
    }
}

/* ---------- Conversation ---------- */

body.gpt-theme .sticky-header {
    background: var(--bg-primary);
}

body.gpt-theme .sticky-title-pill {
    border: 0;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    color: var(--text-primary);
    font-weight: 500;
}

body.gpt-theme .sticky-title-pill:hover {
    background: var(--bg-hover);
}

body.gpt-theme .message.user .message-content {
    padding: 10px 18px;
    border-radius: 22px;
    background: var(--gpt-bubble);
    color: var(--text-primary);
}

body.gpt-theme .message.assistant .message-content,
body.gpt-theme .message-content p,
body.gpt-theme .message-content li {
    color: var(--text-primary);
}

body.gpt-theme .message.assistant .message-avatar,
body.gpt-theme .assistant-thinking-icon {
    display: none !important;
}

/* "Thinking" / "Searching the web": a band of light sweeping across the text */
body.gpt-theme .assistant-thinking-label,
body.gpt-theme .image-generation-title {
    background: linear-gradient(90deg, var(--text-muted) 0%, var(--text-muted) 30%, var(--text-primary) 50%, var(--text-muted) 70%, var(--text-muted) 100%) repeat-x;
    background-size: 160% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    -webkit-text-fill-color: transparent;
    font-size: 16px !important;
    font-weight: 400 !important;
    letter-spacing: 0;
    animation: gpt-shimmer 2.8s linear infinite;
}

/* The gradient tile is 1.6x the text and repeats, so the band of light crosses the text
   at one steady speed and the loop has no jump. */
@keyframes gpt-shimmer {
    from { background-position: 150% 0; }
    to { background-position: -116.667% 0; }
}

body.gpt-theme .assistant-thinking-dots {
    display: none;
}

/* Under the label: what the model says it will check, its queries, the pages read */
body.gpt-theme .assistant-thinking-note {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 640px;
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 24px;
}

body.gpt-theme .assistant-thinking-note [hidden] {
    display: none !important;
}

body.gpt-theme .message-content .gpt-thought {
    margin: 0;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 24px;
}

body.gpt-theme .gpt-thought .gs-w {
    animation: gpt-word-in .3s ease-out;
}

body.gpt-theme .assistant-thinking-queries,
body.gpt-theme .assistant-thinking-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

body.gpt-theme .gpt-query {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 28px;
    padding: 2px 12px 2px 8px;
    border: 1px solid var(--gpt-popover-line);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 18px;
    animation: gpt-word-in .35s ease-out;
}

body.gpt-theme .gpt-query .material-symbols-outlined {
    flex: none;
    font-size: 16px;
    color: var(--text-muted);
}

/* A page the answer drew on: site icon + name, linking to the page itself */
body.gpt-theme .gpt-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px 0 7px;
    border-radius: 999px;
    background: var(--gpt-bubble);
    color: var(--text-primary) !important;
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none !important;
    transition: background-color .15s ease;
    animation: gpt-word-in .35s ease-out;
}

body.gpt-theme a.gpt-source:hover {
    background: var(--gpt-control);
}

body.gpt-theme .gpt-favicon,
body.gpt-theme .message-content img.gpt-favicon {
    flex: none;
    width: 16px;
    height: 16px;
    max-height: none;
    margin: 0;
    border-radius: 4px;
    box-shadow: none;
    cursor: inherit;
    transform: none;
}

body.gpt-theme span.gpt-favicon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-muted);
}

/* "Fuentes: site · site" under an answer */
body.gpt-theme .message-content p.gpt-sources {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 16px 0 0;
    /* hides the separators between the links */
    font-size: 0;
}

body.gpt-theme .message-content p.gpt-sources > * {
    font-size: 13px;
}

body.gpt-theme .message-content p.gpt-sources > .gs-w {
    display: none;
}

body.gpt-theme .message-content .gpt-sources-label {
    margin-right: 4px;
    color: var(--text-secondary);
    font-weight: 500;
}
/* Answer being written: each new word fades in; blocks appear already formatted */
body.gpt-theme .message-content.gpt-live .gs-w,
body.gpt-theme .message-content.gpt-live .code-block-wrapper,
body.gpt-theme .message-content.gpt-live table,
body.gpt-theme .message-content.gpt-live hr,
body.gpt-theme .message-content.gpt-live img {
    animation: gpt-word-in .26s ease-out;
}

@keyframes gpt-word-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    body.gpt-theme .message-content.gpt-live .gs-w,
    body.gpt-theme .message-content.gpt-live .code-block-wrapper,
    body.gpt-theme .message-content.gpt-live table,
    body.gpt-theme .message-content.gpt-live hr,
    body.gpt-theme .message-content.gpt-live img,
    body.gpt-theme .gpt-thought .gs-w,
    body.gpt-theme .gpt-query,
    body.gpt-theme .gpt-source {
        animation: none;
    }
}

body.gpt-theme .assistant-thinking-note[hidden] {
    display: none;
}

/* Image being generated: step name, a field of pulsing dots and an estimated percentage */
body.gpt-theme .image-generation-card {
    width: min(380px, 100%);
    padding: 0;
    border-radius: 0;
    overflow: visible;
    background: none;
    aspect-ratio: auto;
}

body.gpt-theme .image-generation-card::before,
body.gpt-theme .image-generation-card::after {
    content: none;
}

body.gpt-theme .image-generation-title {
    display: inline-block;
    margin-bottom: 16px;
}

body.gpt-theme .image-generation-canvas {
    position: relative;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
}

body.gpt-theme .image-generation-canvas::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--gpt-accent) 0 1.4px, transparent 1.9px);
    background-size: 14px 14px;
    -webkit-mask-image: radial-gradient(circle at 30% 30%, #000 0, transparent 42%), radial-gradient(circle at 75% 78%, #000 0, transparent 38%);
    mask-image: radial-gradient(circle at 30% 30%, #000 0, transparent 42%), radial-gradient(circle at 75% 78%, #000 0, transparent 38%);
    -webkit-mask-size: 200% 200%;
    mask-size: 200% 200%;
    animation: gpt-dots-drift 6s ease-in-out infinite alternate;
}

body.gpt-theme .image-generation-canvas::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--text-muted) 0 1px, transparent 1.5px);
    background-size: 14px 14px;
    opacity: .28;
}

@keyframes gpt-dots-drift {
    0% { -webkit-mask-position: 0% 0%; mask-position: 0% 0%; }
    50% { -webkit-mask-position: 80% 40%; mask-position: 80% 40%; }
    100% { -webkit-mask-position: 30% 100%; mask-position: 30% 100%; }
}

body.gpt-theme .image-generation-percent {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 1;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--gpt-control);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
}

body.gpt-theme .message-content pre {
    border-color: var(--border-color);
    border-radius: 12px;
    background: #171717 !important;
}

body.gpt-theme .jump-to-latest-btn {
    border-color: var(--gpt-popover-line);
    background: var(--gpt-popover);
    color: var(--text-primary);
}

body.gpt-theme .voice-listening-overlay {
    border-color: var(--gpt-popover-line);
    background: var(--gpt-popover);
}

body.gpt-theme .voice-listening-overlay-btn {
    background: var(--gpt-solid);
    color: var(--gpt-on-solid);
}

/* ---------- Dialogs ---------- */

body.gpt-theme .delete-modal-overlay,
body.gpt-theme .search-modal-overlay,
body.gpt-theme .images-modal-overlay {
    background: rgba(0, 0, 0, .6);
    backdrop-filter: none;
}

body.gpt-theme .delete-modal,
body.gpt-theme .search-modal,
body.gpt-theme .images-modal {
    border: 1px solid var(--gpt-popover-line);
    border-radius: 16px;
    background: var(--gpt-popover);
    box-shadow: var(--gpt-shadow);
}

body.gpt-theme .delete-modal-title {
    color: var(--text-primary);
    font-weight: 600;
}

body.gpt-theme .delete-modal-message {
    color: var(--text-secondary);
}

body.gpt-theme .delete-modal-icon {
    background: var(--gpt-popover-hover) !important;
    color: var(--text-primary);
}

body.gpt-theme .delete-modal-btn {
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 500;
}

body.gpt-theme .delete-modal-btn-cancel {
    border: 1px solid var(--gpt-outline);
    background: transparent;
    color: var(--text-primary);
}

body.gpt-theme .delete-modal-btn-confirm {
    background: var(--gpt-danger);
    color: #fff;
}

/* Call-to-action buttons carry inline brand gradients in the markup. */
body.gpt-theme a.delete-modal-btn-confirm,
body.gpt-theme #rename-modal-confirm-btn,
body.gpt-theme .custom-instructions-modal .delete-modal-btn:not(.delete-modal-btn-cancel) {
    background: var(--gpt-solid) !important;
    color: var(--gpt-on-solid) !important;
}

body.gpt-theme .rename-input,
body.gpt-theme .custom-instructions-textarea {
    border-color: var(--gpt-outline);
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text-primary);
    outline: none;
}

body.gpt-theme .search-modal-input,
body.gpt-theme .search-chat-item,
body.gpt-theme .search-chat-new,
body.gpt-theme .images-modal-title {
    color: var(--text-primary);
}

body.gpt-theme .search-modal-input::placeholder,
body.gpt-theme .search-section-label,
body.gpt-theme .search-modal-close {
    color: var(--text-muted);
}

body.gpt-theme .search-chat-item {
    border-radius: 10px;
}

body.gpt-theme .search-chat-item:hover {
    background: var(--gpt-popover-hover);
    color: var(--text-primary);
}

/* ---------- Settings view ---------- */

body.gpt-theme .gpt-settings {
    position: fixed;
    inset: 0;
    /* above the mobile top bar and drawer, which use near-max z-index values */
    z-index: 2147483646;
    display: none;
    background: var(--bg-primary);
    color: var(--text-primary);
}

body.gpt-theme .gpt-settings.open {
    display: flex;
}

body.gpt-theme .gpt-settings-nav {
    flex: 0 0 270px;
    display: flex;
    flex-direction: column;
    padding: 10px 6px;
    border-right: 1px solid var(--gpt-line);
    overflow-y: auto;
}

body.gpt-theme .gpt-settings-back,
body.gpt-theme .gpt-settings-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 20px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

body.gpt-theme .gpt-settings-back {
    margin-bottom: 8px;
    font-weight: 500;
}

body.gpt-theme .gpt-settings-back:hover,
body.gpt-theme .gpt-settings-link:hover,
body.gpt-theme .gpt-settings-link.active {
    background: var(--bg-hover);
}

body.gpt-theme .gpt-settings-link[hidden] {
    display: none;
}

body.gpt-theme .gpt-settings-nav .material-symbols-outlined {
    font-size: 20px;
}

body.gpt-theme .gpt-settings-nav .gpt-ext {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 16px;
}

body.gpt-theme .gpt-settings-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    height: 36px;
    margin-bottom: 12px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--bg-hover);
    color: var(--text-secondary);
}

body.gpt-theme .gpt-settings-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
}

body.gpt-theme .gpt-settings-search input::placeholder {
    color: var(--text-secondary);
}

body.gpt-theme .gpt-settings-group {
    padding: 8px 10px 6px;
    color: var(--text-muted);
    font-size: 14px;
}

body.gpt-theme .gpt-settings-main {
    flex: 1;
    min-width: 0;
    padding: 28px 24px 48px;
    overflow-y: auto;
}

body.gpt-theme .gpt-settings-panel {
    display: none;
    max-width: 768px;
    margin: 0 auto;
}

body.gpt-theme .gpt-settings-panel.active {
    display: block;
}

body.gpt-theme .gpt-settings-panel h1 {
    margin: 0 0 24px;
    font-size: 22px;
    font-weight: 500;
    line-height: 28px;
}

body.gpt-theme .gpt-settings-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

body.gpt-theme .gpt-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
}

body.gpt-theme .gpt-settings-row + .gpt-settings-row {
    border-top: 1px solid var(--border-color);
}

body.gpt-theme .gpt-settings-row-stack {
    flex-direction: column;
    align-items: stretch;
}

body.gpt-theme .gpt-settings-text {
    min-width: 0;
}

body.gpt-theme .gpt-row-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    overflow-wrap: anywhere;
}

body.gpt-theme .gpt-row-desc {
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 18px;
    overflow-wrap: anywhere;
}

body.gpt-theme .gpt-select,
body.gpt-theme .gpt-btn {
    flex-shrink: 0;
    height: 36px;
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
}

body.gpt-theme .gpt-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0 36px 0 14px;
    border: 0;
    outline: none;
    background: var(--gpt-control) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
}

body.gpt-theme .gpt-select option {
    background: var(--gpt-popover);
    color: var(--text-primary);
}

body.gpt-theme .gpt-btn {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--gpt-outline);
    background: transparent;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

body.gpt-theme .gpt-btn:hover {
    background: var(--bg-hover);
}

body.gpt-theme .gpt-btn-primary {
    border-color: var(--gpt-solid);
    background: var(--gpt-solid);
    color: var(--gpt-on-solid);
}

body.gpt-theme .gpt-btn-primary:hover {
    background: var(--gpt-solid);
    opacity: .85;
}

body.gpt-theme .gpt-textarea {
    width: 100%;
    min-height: 160px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 22px;
    resize: vertical;
}

body.gpt-theme .gpt-textarea:focus {
    border-color: var(--gpt-outline);
}

body.gpt-theme .gpt-settings-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* ---------- Settings: forms ---------- */

body.gpt-theme .gpt-settings-card + .gpt-settings-card {
    margin-top: 16px;
}

body.gpt-theme form.gpt-settings-card {
    display: block;
    margin-bottom: 0;
}

body.gpt-theme .gpt-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

body.gpt-theme .gpt-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

body.gpt-theme .gpt-field-wide {
    grid-column: 1 / -1;
}

body.gpt-theme .gpt-field > span {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 18px;
}

body.gpt-theme .gpt-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    outline: none;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
}

body.gpt-theme .gpt-input:focus {
    border-color: var(--gpt-outline);
}

body.gpt-theme select.gpt-input option {
    background: var(--gpt-popover);
    color: var(--text-primary);
}

body.gpt-theme .gpt-select {
    max-width: min(320px, 100%);
    text-overflow: ellipsis;
}

body.gpt-theme .gpt-form-status {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 18px;
}

body.gpt-theme .gpt-form-status.is-error {
    color: var(--gpt-danger);
}

body.gpt-theme .gpt-btn:disabled {
    opacity: .5;
    cursor: default;
}

body.gpt-theme .gpt-btn-danger {
    border-color: var(--gpt-danger);
    background: var(--gpt-danger);
    color: #fff;
}

body.gpt-theme .gpt-btn-danger:hover {
    background: var(--gpt-danger);
    opacity: .85;
}

body.gpt-theme .gpt-check {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

body.gpt-theme .gpt-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--gpt-danger);
}

body.gpt-theme .gpt-switch {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 24px;
    cursor: pointer;
}

body.gpt-theme .gpt-switch input {
    position: absolute;
    opacity: 0;
}

body.gpt-theme .gpt-switch span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--gpt-track);
    transition: background .15s ease;
}

body.gpt-theme .gpt-switch span::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
    transition: transform .15s ease;
}

body.gpt-theme .gpt-switch input:checked + span {
    background: var(--gpt-accent);
}

body.gpt-theme .gpt-switch input:checked + span::after {
    transform: translateX(16px);
}

body.gpt-theme .gpt-switch input:focus-visible + span {
    outline: 2px solid var(--gpt-accent);
    outline-offset: 2px;
}

body.gpt-theme .gpt-avatar-pick {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    cursor: pointer;
}

body.gpt-theme .gpt-avatar-pick img,
body.gpt-theme .gpt-avatar-pick .avatar-mini {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    font-size: 14px;
}

body.gpt-theme .gpt-avatar-pick .gpt-btn {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.gpt-theme .gpt-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

body.gpt-theme .gpt-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 12px;
    border-radius: 12px;
    background: var(--bg-hover);
}

body.gpt-theme .gpt-stat strong {
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
    overflow-wrap: anywhere;
}

body.gpt-theme .gpt-stat span {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 16px;
}

@media (max-width: 768px) {
    body.gpt-theme .gpt-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    body.gpt-theme .gpt-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.gpt-theme .gpt-settings-group {
        display: none;
    }
}

/* ---------- Effort slider: filled track and the "max" state ---------- */

body.gpt-theme .gpt-effort-track::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    /* ends under the thumb: 28px thumb travelling over (100% - 28px) */
    width: calc(28px + (100% - 28px) * var(--gpt-effort-p, 0));
    border-radius: 999px;
    background: var(--gpt-accent);
}

body.gpt-theme .gpt-effort.is-locked .gpt-effort-track::before {
    background: var(--gpt-outline);
}

body.gpt-theme .gpt-effort-dots {
    z-index: 1;
}

body.gpt-theme #gpt-effort-range {
    z-index: 2;
}

body.gpt-theme .gpt-effort.is-max .gpt-effort-track::before {
    background: linear-gradient(90deg, #7c3aed, #a855f7, #d8b4fe, #a855f7, #7c3aed);
    background-size: 200% 100%;
    box-shadow: 0 0 14px rgba(168, 85, 247, .55);
    animation: gpt-max-flow 2.2s linear infinite;
}

body.gpt-theme .gpt-effort.is-max .gpt-effort-title strong,
body.gpt-theme .gpt-model-pill.is-max #gpt-effort-current {
    background: linear-gradient(90deg, #a855f7, #e9d5ff, #a855f7, #7c3aed, #a855f7);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: gpt-max-flow 2.2s linear infinite;
}

body.gpt-theme .gpt-effort.is-max #gpt-effort-range::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(168, 85, 247, .45), 0 1px 4px rgba(0, 0, 0, .4);
}

body.gpt-theme .gpt-effort.is-max #gpt-effort-range::-moz-range-thumb {
    box-shadow: 0 0 0 3px rgba(168, 85, 247, .45), 0 1px 4px rgba(0, 0, 0, .4);
}

[data-theme-version="light"] body.gpt-theme .gpt-effort.is-max .gpt-effort-title strong,
[data-theme-version="light"] body.gpt-theme .gpt-model-pill.is-max #gpt-effort-current {
    background-image: linear-gradient(90deg, #7c3aed, #c084fc, #7c3aed, #6d28d9, #7c3aed);
}

@keyframes gpt-max-flow {
    from { background-position: 200% 0; }
    to { background-position: 0 0; }
}


/* ---------- Light mode: undo the base theme's hard-coded light colors ---------- */

[data-theme-version="light"] body.gpt-theme,
[data-theme-version="light"] body.gpt-theme .main-content,
[data-theme-version="light"] body.gpt-theme .chat-area {
    background: var(--bg-primary) !important;
}

[data-theme-version="light"] body.gpt-theme .suggestion-chip {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

[data-theme-version="light"] body.gpt-theme .suggestion-chip:hover {
    background: var(--bg-hover) !important;
}

[data-theme-version="light"] body.gpt-theme .suggestion-chip {
    color: var(--text-secondary) !important;
}

[data-theme-version="light"] body.gpt-theme .suggestion-chip:nth-child(4n + 1) .emoji { color: var(--gpt-tint-1) !important; }
[data-theme-version="light"] body.gpt-theme .suggestion-chip:nth-child(4n + 2) .emoji { color: var(--gpt-tint-2) !important; }
[data-theme-version="light"] body.gpt-theme .suggestion-chip:nth-child(4n + 3) .emoji { color: var(--gpt-tint-3) !important; }
[data-theme-version="light"] body.gpt-theme .suggestion-chip:nth-child(4n + 4) .emoji { color: var(--gpt-tint-4) !important; }

[data-theme-version="light"] body.gpt-theme .settings-menu,
[data-theme-version="light"] body.gpt-theme .add-menu,
[data-theme-version="light"] body.gpt-theme .tools-menu,
[data-theme-version="light"] body.gpt-theme .model-dropdown,
[data-theme-version="light"] body.gpt-theme .language-dropdown,
[data-theme-version="light"] body.gpt-theme .sticky-menu-dropdown,
[data-theme-version="light"] body.gpt-theme .search-modal {
    border-color: var(--gpt-popover-line) !important;
    background: var(--gpt-popover) !important;
    box-shadow: var(--gpt-shadow) !important;
}

[data-theme-version="light"] body.gpt-theme .settings-menu-header {
    background: transparent !important;
}

[data-theme-version="light"] body.gpt-theme .message.user .message-content {
    border: 0 !important;
    background: var(--gpt-bubble) !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
}

[data-theme-version="light"] body.gpt-theme .message-content pre {
    background: #f9f9f9 !important;
}

[data-theme-version="light"] body.gpt-theme .sticky-header {
    background: var(--bg-primary) !important;
}

[data-theme-version="light"] body.gpt-theme .sticky-title-pill {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* ---------- Mobile ---------- */

@media (max-width: 768px) {
    body.gpt-theme .main-content {
        background: var(--bg-primary) !important;
    }

    body.gpt-theme .sidebar {
        width: min(300px, 86vw);
    }

    body.gpt-theme .header {
        padding: 8px 10px !important;
    }

    body.gpt-theme .mobile-toggle {
        width: 36px !important;
        height: 36px !important;
        border-radius: 10px !important;
        color: var(--text-primary) !important;
        justify-content: center !important;
    }

    body.gpt-theme .mobile-logo-text {
        margin-left: 4px;
        color: var(--text-primary);
        font-size: 18px;
        font-weight: 600;
    }

    body.gpt-theme .mobile-logo-text img {
        max-height: 24px;
        width: auto;
        display: block;
    }

    body.gpt-theme .new-chat-mobile-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: var(--text-primary);
    }

    /* Signed out: the bar keeps the menu and one access button, nothing else */
    body.gpt-theme .header:has(.guest-auth-actions) .new-chat-mobile-btn,
    body.gpt-theme .guest-auth-actions .register-btn,
    body.gpt-theme .gpt-auth-full {
        display: none !important;
    }

    body.gpt-theme .gpt-auth-short {
        display: inline;
    }

    body.gpt-theme .guest-auth-actions .login-btn {
        height: 36px !important;
        padding: 0 18px !important;
        border: 0 !important;
        border-radius: 999px !important;
        background: var(--gpt-solid) !important;
        color: var(--gpt-on-solid) !important;
        font-size: 14px !important;
        font-weight: 500 !important;
    }

    /* Messages keep a margin from the screen edges */
    body.gpt-theme .messages-container .message {
        box-sizing: border-box;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* The tool in use shows as its icon next to "+"; a tap turns it off */
    body.gpt-theme .active-tool-chip.show {
        display: inline-flex !important;
        flex: none;
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
    }

    body.gpt-theme .greeting {
        align-items: center !important;
        margin-top: 22vh !important;
        margin-bottom: 20px !important;
        text-align: center !important;
    }

    body.gpt-theme .greeting h1,
    body.gpt-theme .greeting h1 span {
        background: none !important;
        -webkit-text-fill-color: currentColor !important;
        color: var(--text-primary) !important;
        font-size: 24px !important;
        font-weight: 400 !important;
        text-align: center !important;
    }

    body.gpt-theme .mobile-quick-chips {
        align-items: stretch !important;
        align-self: stretch;
        gap: 0 !important;
        margin-top: 8px !important;
        padding: 0 6px !important;
    }

    body.gpt-theme .mobile-quick-chip {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        min-height: 48px;
        padding: 6px 12px !important;
        border: 0 !important;
        border-radius: 12px !important;
        background: transparent !important;
        color: var(--text-secondary) !important;
        font-size: 16px !important;
    }

    body.gpt-theme .mobile-quick-chip .chip-text {
        color: var(--text-secondary) !important;
        font-size: 16px !important;
    }

    body.gpt-theme .input-wrapper {
        border: 1px solid var(--border-color) !important;
        border-radius: 28px !important;
        background: var(--bg-input) !important;
    }

    body.gpt-theme .input-field {
        color: var(--text-primary) !important;
    }

    body.gpt-theme #add-btn {
        background: transparent !important;
        color: var(--text-primary) !important;
    }

    body.gpt-theme .tools-btn {
        background: transparent !important;
        color: var(--text-primary) !important;
    }

    /* Pill popovers span the composer and always open upwards */
    body.gpt-theme .gpt-model-pill {
        position: static;
        flex: 0 1 auto;
        gap: 4px;
        padding: 0 4px 0 8px;
    }

    body.gpt-theme .model-selector {
        padding: 0 !important;
        color: var(--text-primary) !important;
        font-size: 14px !important;
    }

    body.gpt-theme .reasoning-trigger {
        padding: 0 !important;
        color: var(--text-secondary) !important;
        font-size: 14px !important;
    }

    body.gpt-theme #current-model-name {
        max-width: 38vw !important;
        font-size: 14px !important;
        letter-spacing: 0 !important;
    }

    body.gpt-theme .gpt-model-pill .model-dropdown,
    body.gpt-theme .gpt-model-pill .gpt-effort {
        top: auto !important;
        right: 0 !important;
        bottom: calc(100% + 10px) !important;
        left: 0 !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    body.gpt-theme .gpt-model-pill .model-dropdown {
        max-height: min(420px, 55vh) !important;
        padding: 6px !important;
        border-radius: 16px !important;
    }

    body.gpt-theme .gpt-model-pill .model-option {
        min-height: 40px !important;
        padding: 8px 12px !important;
        font-size: 15px !important;
    }

    body.gpt-theme .input-actions-left {
        gap: 0 !important;
        flex-shrink: 0;
    }

    body.gpt-theme .input-actions-right {
        flex: 1;
        min-width: 0;
        justify-content: flex-end;
        gap: 2px !important;
    }

    body.gpt-theme .input-actions-right .action-btn {
        flex-shrink: 0;
    }

    body.gpt-theme .action-btn.send-btn {
        width: 36px !important;
        height: 36px !important;
        background: var(--gpt-solid) !important;
        color: var(--gpt-on-solid) !important;
        justify-content: center !important;
    }

    body.gpt-theme .action-btn.send-btn:disabled {
        background: var(--gpt-control) !important;
        color: var(--text-muted) !important;
    }

    body.gpt-theme .message.user .message-content {
        background: var(--gpt-bubble) !important;
        color: var(--text-primary) !important;
    }

    body.gpt-theme .message.assistant .message-content {
        color: var(--text-primary) !important;
    }

    body.gpt-theme .gpt-settings {
        flex-direction: column;
    }

    body.gpt-theme .gpt-settings-nav {
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        gap: 4px;
        padding: 8px;
        border-right: 0;
        border-bottom: 1px solid var(--gpt-line);
        overflow-x: auto;
        overflow-y: hidden;
    }

    body.gpt-theme .gpt-settings-back,
    body.gpt-theme .gpt-settings-link {
        width: auto;
        margin: 0;
        white-space: nowrap;
    }

    body.gpt-theme .gpt-settings-back {
        font-size: 0;
        gap: 0;
    }

    body.gpt-theme .gpt-settings-search,
    body.gpt-theme .gpt-settings-group,
    body.gpt-theme .gpt-settings-nav .gpt-ext {
        display: none;
    }

    body.gpt-theme .gpt-settings-main {
        padding: 20px 14px 40px;
    }

    body.gpt-theme .gpt-settings-row {
        flex-wrap: wrap;
    }
}

/* No rating / copy actions while an image is still being generated */
body.gpt-theme .message.is-image-generating .message-actions {
    display: none;
}

/* ---------- Delete chat confirmation ---------- */

body.gpt-theme .delete-modal.gpt-confirm {
    position: relative;
    width: min(440px, calc(100vw - 32px));
    min-width: 0;
    max-width: none;
    padding: 22px 24px 20px;
    border-radius: 20px;
    text-align: left;
}

body.gpt-theme .gpt-confirm .delete-modal-title {
    margin: 0 32px 8px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 26px;
    text-align: left;
}

body.gpt-theme .gpt-confirm .delete-modal-message {
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 24px;
    text-align: left;
    overflow-wrap: anywhere;
}

body.gpt-theme .gpt-confirm .delete-modal-buttons {
    justify-content: flex-end;
    gap: 10px;
}

body.gpt-theme .gpt-confirm .delete-modal-btn {
    flex: 0 0 auto;
    height: 40px;
    padding: 0 16px;
    font-size: 15px;
}

body.gpt-theme .gpt-confirm .delete-modal-btn-confirm {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: rgba(224, 46, 42, .2);
    color: #ff6b66;
}

body.gpt-theme .gpt-confirm .delete-modal-btn-confirm:hover {
    background: rgba(224, 46, 42, .3);
}

[data-theme-version="light"] body.gpt-theme .gpt-confirm .delete-modal-btn-confirm {
    background: rgba(224, 46, 42, .1);
    color: #c62320;
}

body.gpt-theme .gpt-confirm .delete-modal-btn:disabled {
    opacity: .6;
    cursor: default;
}

body.gpt-theme .gpt-confirm-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

body.gpt-theme .gpt-confirm-close:hover {
    background: var(--gpt-popover-hover);
    color: var(--text-primary);
}

body.gpt-theme .gpt-confirm-close .material-symbols-outlined {
    font-size: 18px;
}
body.gpt-theme .gpt-confirm .delete-modal-id {
    display: none;
}

/* Phones: no floating chat-title pill over the conversation */
@media (max-width: 768px) {
    body.gpt-theme .sticky-header {
        display: none !important;
    }
}

/* Settings · Usage: plan limits (5 hours and week) as "% remaining", and what each model uses */
body.gpt-theme .gpt-usage-section {
    margin-bottom: 36px;
}

body.gpt-theme .gpt-usage-section h2 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
    line-height: 24px;
}

body.gpt-theme .gpt-usage-section > p {
    max-width: 520px;
    margin: 0 0 14px;
    color: var(--text-primary, inherit);
    font-size: 14px;
    line-height: 20px;
}

body.gpt-theme .gpt-usage-section > p a {
    color: #6ea8ff;
    text-decoration: none;
}

body.gpt-theme .gpt-usage-section > p a:hover {
    text-decoration: underline;
}

body.gpt-theme .gpt-usage-card {
    padding: 6px 16px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, .12));
    border-radius: 14px;
}

body.gpt-theme .gpt-usage-row {
    padding: 14px 0 16px;
}

body.gpt-theme .gpt-usage-row strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

body.gpt-theme .gpt-usage-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

body.gpt-theme .gpt-usage-meta b {
    font-weight: 400;
}

body.gpt-theme .gpt-usage-bar {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(127, 127, 127, .28);
}

body.gpt-theme .gpt-usage-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent-color, #ffffff);
    transition: width .3s ease;
}
