.itfv3-shell__title {
    margin: 0;
    color: #1d2327;
    opacity: 1;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    min-width: 0;
    word-break: break-word;
}

.itfv3-shell__rename,
.itfv3-shell__archive,
.itfv3-shell__delete,
.itfv3-shell__export-toggle,
.itfv3-shell__actions-toggle,
.itfv3-shell__title-save,
.itfv3-shell__title-cancel,
.itfv3-message__edit,
.itfv3-shell__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}

.itfv3-shell__rename,
.itfv3-shell__archive,
.itfv3-shell__delete,
.itfv3-shell__export-toggle,
.itfv3-shell__actions-toggle,
.itfv3-shell__title-save,
.itfv3-shell__title-cancel {
    min-height: 40px;
    padding: 9px 14px;
    font-size: 14px;
}

.itfv3-shell__rename {
    border: 1px solid #8c8f94;
    background: #ffffff;
    color: #1d2327;
}

.itfv3-shell__rename:hover {
    background: #f6f7f7;
    border-color: #646970;
}

.itfv3-shell__export-dropdown,
.itfv3-shell__actions-dropdown {
    position: relative;
}

.itfv3-shell__export-toggle {
    border: 1px solid #2271b1;
    background: #ffffff;
    color: #2271b1;
    gap: 8px;
}

.itfv3-shell__export-toggle::after {
    content: "▾";
    font-size: 11px;
    line-height: 1;
}

.itfv3-shell__export-toggle:hover {
    background: #eef4fb;
    border-color: #135e96;
    color: #135e96;
}

.itfv3-shell__export-toggle[aria-expanded="true"] {
    background: #e7f1ff;
    border-color: #2271b1;
    color: #135e96;
}

.itfv3-shell__actions-toggle {
    min-width: 40px;
    padding: 0;
    border: 1px solid #8c8f94;
    background: #ffffff;
    color: #1d2327;
    font-size: 22px;
    line-height: 1;
}

.itfv3-shell__actions-toggle:hover {
    background: #f6f7f7;
    border-color: #646970;
}

.itfv3-shell__actions-toggle[aria-expanded="true"] {
    background: #eef4fb;
    border-color: #2271b1;
    color: #2271b1;
}

.itfv3-shell__export-menu[hidden],
.itfv3-shell__actions-menu[hidden] {
    display: none !important;
}

.itfv3-shell__export-menu,
.itfv3-shell__actions-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    min-width: 220px;
    padding: 10px;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.itfv3-shell__export-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.itfv3-shell__export-group-title {
    padding: 2px 4px 6px;
    color: #646970;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.itfv3-shell__export-separator {
    height: 1px;
    margin: 8px 0;
    background: #dcdcde;
}

.itfv3-shell__export-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 0;
    border-radius: 8px;
    background: #ffffff;
    color: #1d2327;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, opacity .15s ease;
}

.itfv3-shell__export-item:hover {
    background: #eef4fb;
    color: #135e96;
}

.itfv3-shell__export-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.itfv3-shell__actions-menu .itfv3-shell__rename,
.itfv3-shell__actions-menu .itfv3-shell__archive,
.itfv3-shell__actions-menu .itfv3-shell__delete {
    justify-content: flex-start;
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    font-size: 13px;
}

.itfv3-shell__archive {
    border: 1px solid #2271b1;
    background: #ffffff;
    color: #2271b1;
}

.itfv3-shell__archive:hover {
    background: #eef4fb;
    border-color: #135e96;
    color: #135e96;
}

.itfv3-shell__delete {
    border: 1px solid #d63638;
    background: #ffffff;
    color: #d63638;
}

.itfv3-shell__delete:hover {
    background: #fcf0f1;
    border-color: #b32d2e;
    color: #b32d2e;
}

.itfv3-shell__title-input {
    flex: 1 1 260px;
    min-width: 180px;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid #8c8f94;
    border-radius: 8px;
    background: #ffffff;
    color: #1d2327;
    font-size: 14px;
    line-height: 1.4;
}

.itfv3-shell__title-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.itfv3-shell__title-save {
    border: 1px solid #2271b1;
    background: #2271b1;
    color: #ffffff;
}

.itfv3-shell__title-save:hover {
    background: #135e96;
    border-color: #135e96;
}

.itfv3-shell__title-cancel,
.itfv3-message__edit {
    border: 1px solid #8c8f94;
    background: #ffffff;
    color: #1d2327;
}

.itfv3-shell__title-cancel:hover,
.itfv3-message__edit:hover {
    background: #f6f7f7;
    border-color: #646970;
}

.itfv3-shell__rename:disabled,
.itfv3-shell__archive:disabled,
.itfv3-shell__delete:disabled,
.itfv3-shell__export-toggle:disabled,
.itfv3-shell__actions-toggle:disabled,
.itfv3-shell__title-save:disabled,
.itfv3-shell__title-cancel:disabled,
.itfv3-message__edit:disabled,
.itfv3-shell__send:disabled,
.itfv3-shell__textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.itfv3-shell__messages {
    padding: 24px;
    background: #ffffff;
    overflow: auto;
}

.itfv3-shell__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    border: 1px dashed #c3c4c7;
    background: #f6f7f7;
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    color: #50575e;
}

.itfv3-message-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 920px;
}

.itfv3-message {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 78%;
}

.itfv3-message__role {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #646970;
}

.itfv3-message__content {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #dcdcde;
    background: #f6f7f7;
    color: #1d2327;
    line-height: 1.55;
    white-space: normal;
    word-break: break-word;
}

.itfv3-message__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.itfv3-message__edit {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

.itfv3-message--user {
    margin-left: auto;
    align-items: flex-end;
}

.itfv3-message--user .itfv3-message__content {
    background: #2271b1;
    border-color: #2271b1;
    color: #ffffff;
}

.itfv3-message--user .itfv3-message__role {
    color: #2271b1;
}

.itfv3-message--assistant,
.itfv3-message--system {
    margin-right: auto;
    align-items: flex-start;
}

.itfv3-message--assistant .itfv3-message__content,
.itfv3-message--system .itfv3-message__content {
    background: #f6f7f7;
    color: #1d2327;
}

.itfv3-shell__composer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 20px 24px 24px;
    border-top: 1px solid #dcdcde;
    background: #ffffff;
}

.itfv3-shell__textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    padding: 14px 16px;
    border: 1px solid #8c8f94;
    border-radius: 10px;
    background: #ffffff;
    color: #1d2327;
    font-size: 16px;
    line-height: 1.5;
}

.itfv3-shell__textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.itfv3-shell__send {
    min-width: 136px;
    min-height: 48px;
    padding: 10px 18px;
    border: 1px solid #2271b1;
    border-radius: 10px;
    background: #2271b1;
    color: #ffffff;
    font-size: 16px;
    align-self: end;
}

.itfv3-shell__send:hover {
    background: #135e96;
    border-color: #135e96;
}

.itfv3-message--assistant .itfv3-message__content,
.itfv3-message--system .itfv3-message__content {
    padding: 0;
    border: 0;
    background: transparent;
    color: #e6edf3;
}

.itfv3-message--assistant .itfv3-message__content > p,
.itfv3-message--system .itfv3-message__content > p {
    margin: 0 0 12px;
    padding: 14px 16px;
    border: 1px solid #d0d7de;
    border-radius: 14px;
    background: #f6f8fa;
    color: #1f2328;
    line-height: 1.6;
}

.itfv3-message--assistant .itfv3-message__content > p:last-child,
.itfv3-message--system .itfv3-message__content > p:last-child {
    margin-bottom: 0;
}

.itfv3-message__inline-code {
    padding: .15em .4em;
    border: 1px solid rgba(175, 184, 193, .4);
    border-radius: 6px;
    background: rgba(175, 184, 193, .2);
    color: #cf222e;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace;
    font-size: .92em;
}

.itfv3-message__code-block {
    position: relative;
    margin: 10px 0 14px;
    border: 1px solid #30363d;
    border-radius: 16px;
    overflow: hidden;
    background: #0d1117;
    box-shadow: 0 8px 24px rgba(2, 6, 23, .18);
}

.itfv3-message__code-toolbar {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    pointer-events: none;
}

.itfv3-message__code-language {
    display: none;
}

.itfv3-message__copy-code {
    pointer-events: auto;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid rgba(240, 246, 252, .14);
    border-radius: 10px;
    background: rgba(33, 38, 45, .92);
    color: #e6edf3;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.itfv3-message__copy-code:hover {
    background: rgba(48, 54, 61, .98);
    border-color: rgba(240, 246, 252, .24);
    transform: translateY(-1px);
}

.itfv3-message__copy-code:active {
    transform: translateY(0);
}

.itfv3-message__pre {
    margin: 0;
    padding: 18px 18px 16px;
    overflow: auto;
    background: #0d1117;
}

.itfv3-message__code {
    display: block;
    padding-top: 24px;
    color: #e6edf3;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre;
    tab-size: 4;
}

.itfv3-message--assistant,
.itfv3-message--system {
    max-width: min(920px, 100%);
}

.itfv3-message--assistant .itfv3-message__actions,
.itfv3-message--system .itfv3-message__actions {
    margin-top: 2px;
}

@media (max-width: 782px) {
    .itfv3-message {
        max-width: 100%;
    }

    .itfv3-message__pre {
        padding: 14px 14px 12px;
    }

    .itfv3-message__code {
        font-size: 12px;
        padding-top: 28px;
    }

    .itfv3-message__copy-code {
        min-height: 28px;
        padding: 5px 9px;
        font-size: 11px;
    }
}

.itfv3-message--assistant .itfv3-message__content,
.itfv3-message--system .itfv3-message__content {
    color: #1f2328;
}

.itfv3-message--assistant .itfv3-message__content > p,
.itfv3-message--system .itfv3-message__content > p,
.itfv3-message--assistant .itfv3-message__content > ul,
.itfv3-message--assistant .itfv3-message__content > ol,
.itfv3-message--system .itfv3-message__content > ul,
.itfv3-message--system .itfv3-message__content > ol {
    color: #1f2328;
    background: #f6f8fa;
}

.itfv3-message__code-block,
.itfv3-message__pre {
    background: #0d1117;
}

.itfv3-message__code,
.itfv3-message__code * {
    color: #e6edf3;
}

.itfv3-message__content a {
    color: #0969da;
}

.itfv3-message__code .itfv3-code__comment {
    color: #8b949e;
}

.itfv3-message__code .itfv3-code__keyword {
    color: #ff7b72;
}

.itfv3-message__code .itfv3-code__string {
    color: #a5d6ff;
}

.itfv3-message__code .itfv3-code__number {
    color: #79c0ff;
}

.itfv3-message__code .itfv3-code__variable {
    color: #79c0ff;
}

.itfv3-message__code .itfv3-code__constant {
    color: #d2a8ff;
}

.itfv3-message__code .itfv3-code__attr {
    color: #79c0ff;
}

.itfv3-message__code .itfv3-code__meta {
    color: #ffa657;
}

/* ITFV3_CHAT_DARK_THEME_SAFE_START */
.itfv3-shell {
    --itfv3-bg: #0b1220;
    --itfv3-panel: #111827;
    --itfv3-panel-2: #0f172a;
    --itfv3-panel-3: #162033;
    --itfv3-border: #23324a;
    --itfv3-border-2: #334155;
    --itfv3-text: #e5e7eb;
    --itfv3-text-soft: #94a3b8;
    --itfv3-accent: #38bdf8;
    --itfv3-accent-2: #0ea5e9;
    --itfv3-danger: #ef4444;
    --itfv3-success: #22c55e;
    background: linear-gradient(180deg, #08111f 0%, #0b1220 100%);
    color: var(--itfv3-text);
    border: 1px solid var(--itfv3-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.itfv3-shell__sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    border-right: 1px solid var(--itfv3-border);
    color: var(--itfv3-text);
}

.itfv3-shell__main {
    background: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
    color: var(--itfv3-text);
}

.itfv3-shell__brand,
.itfv3-shell__title,
.itfv3-prompts__title,
.itfv3-modal__title,
.itfv3-shell__stat-label,
.itfv3-shell__sort-label span,
.itfv3-prompts__field > span,
.itfv3-shell__export-group-title {
    color: var(--itfv3-text);
}

.itfv3-shell__lab-link,
.itfv3-shell__new-chat,
.itfv3-prompts__new,
.itfv3-shell__rename,
.itfv3-shell__archive,
.itfv3-shell__delete,
.itfv3-shell__export-toggle,
.itfv3-shell__title-save,
.itfv3-shell__title-cancel,
.itfv3-prompts__save,
.itfv3-prompts__cancel,
.itfv3-prompts__add-category,
.itfv3-modal__close,
.itfv3-shell__send {
    background: var(--itfv3-panel-3);
    color: var(--itfv3-text);
    border: 1px solid var(--itfv3-border);
    border-radius: 12px;
    transition: background .2s ease, border-color .2s ease, transform .2s ease, color .2s ease;
}

.itfv3-shell__lab-link:hover,
.itfv3-shell__new-chat:hover,
.itfv3-prompts__new:hover,
.itfv3-shell__rename:hover,
.itfv3-shell__archive:hover,
.itfv3-shell__delete:hover,
.itfv3-shell__export-toggle:hover,
.itfv3-shell__title-save:hover,
.itfv3-shell__title-cancel:hover,
.itfv3-prompts__save:hover,
.itfv3-prompts__cancel:hover,
.itfv3-prompts__add-category:hover,
.itfv3-modal__close:hover,
.itfv3-shell__send:hover {
    background: #1d2940;
    border-color: var(--itfv3-accent);
    color: #f8fafc;
    transform: translateY(-1px);
}

.itfv3-shell__delete:hover {
    border-color: #f87171;
    color: #fecaca;
}

.itfv3-shell__stat {
    background: var(--itfv3-panel-2);
    color: var(--itfv3-text);
    border: 1px solid var(--itfv3-border);
    border-radius: 14px;
}

.itfv3-shell__stat:hover {
    border-color: var(--itfv3-accent);
    background: #132033;
}

.itfv3-shell__stat.is-active {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.18) 0%, rgba(14, 165, 233, 0.12) 100%);
    border-color: var(--itfv3-accent);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.12);
}

.itfv3-shell__stat-count,
.itfv3-shell__search-meta {
    color: var(--itfv3-accent);
}

.itfv3-shell__search-field,
.itfv3-shell__sort,
.itfv3-prompts__toolbar,
.itfv3-prompts__form,
.itfv3-prompts__list,
.itfv3-shell__history,
.itfv3-shell__topbar,
.itfv3-shell__messages,
.itfv3-shell__composer,
.itfv3-modal__dialog,
.itfv3-shell__export-menu {
    background: var(--itfv3-panel);
    color: var(--itfv3-text);
    border: 1px solid var(--itfv3-border);
    box-shadow: none;
}

.itfv3-shell__search-input,
.itfv3-shell__sort-select,
.itfv3-prompts__search,
.itfv3-prompts__sort,
.itfv3-prompts__input,
.itfv3-prompts__textarea,
.itfv3-prompts__select,
.itfv3-shell__title-input,
.itfv3-shell__textarea,
.itfv3-edit-form input,
.itfv3-edit-form textarea,
.itfv3-edit-form select {
    background: #0b1220;
    color: var(--itfv3-text);
    border: 1px solid var(--itfv3-border-2);
    border-radius: 12px;
}

.itfv3-shell__search-input::placeholder,
.itfv3-prompts__search::placeholder,
.itfv3-prompts__input::placeholder,
.itfv3-prompts__textarea::placeholder,
.itfv3-shell__title-input::placeholder,
.itfv3-shell__textarea::placeholder {
    color: var(--itfv3-text-soft);
}

.itfv3-shell__search-input:focus,
.itfv3-shell__sort-select:focus,
.itfv3-prompts__search:focus,
.itfv3-prompts__sort:focus,
.itfv3-prompts__input:focus,
.itfv3-prompts__textarea:focus,
.itfv3-prompts__select:focus,
.itfv3-shell__title-input:focus,
.itfv3-shell__textarea:focus,
.itfv3-edit-form input:focus,
.itfv3-edit-form textarea:focus,
.itfv3-edit-form select:focus {
    outline: none;
    border-color: var(--itfv3-accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

.itfv3-shell__search-clear {
    background: transparent;
    color: var(--itfv3-text-soft);
    border: 0;
}

.itfv3-shell__search-clear:hover {
    color: var(--itfv3-text);
}

.itfv3-shell__history p,
.itfv3-prompts__list p,
.itfv3-shell__empty p,
.itfv3-shell__sort-label,
.itfv3-prompts__header,
.itfv3-prompts__toolbar,
.itfv3-modal__header,
.itfv3-shell__topbar,
.itfv3-shell__composer,
.itfv3-shell__title-form,
.itfv3-prompts__actions,
.itfv3-prompts__category-grid {
    color: var(--itfv3-text-soft);
}

.itfv3-shell__messages {
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.08), transparent 28%),
        linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
}

.itfv3-shell__empty {
    background: transparent;
    color: var(--itfv3-text-soft);
}

.itfv3-shell__composer {
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
}

.itfv3-shell__send {
    background: linear-gradient(180deg, var(--itfv3-accent) 0%, var(--itfv3-accent-2) 100%);
    color: #07111d;
    border-color: transparent;
    font-weight: 700;
}

.itfv3-shell__send:hover {
    background: linear-gradient(180deg, #67d3fb 0%, #38bdf8 100%);
    color: #04101a;
}

.itfv3-shell__send:disabled,
.itfv3-shell__rename:disabled,
.itfv3-shell__archive:disabled,
.itfv3-shell__delete:disabled,
.itfv3-shell__export-toggle:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.itfv3-shell__export-menu {
    border-radius: 14px;
}

.itfv3-shell__export-item {
    background: transparent;
    color: var(--itfv3-text);
    border-radius: 10px;
}

.itfv3-shell__export-item:hover {
    background: #162033;
    color: #f8fafc;
}

.itfv3-shell__export-separator {
    background: var(--itfv3-border);
}

.itfv3-modal__backdrop {
    background: rgba(2, 6, 23, 0.72);
}

.itfv3-modal__dialog {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    border-radius: 18px;
}

.itfv3-shell a {
    color: var(--itfv3-accent);
}

.itfv3-shell a:hover {
    color: #7dd3fc;
}

.itfv3-shell pre,
.itfv3-shell code {
    background: #09111e;
    color: #dbeafe;
    border-color: var(--itfv3-border);
}

.itfv3-shell__history::-webkit-scrollbar,
.itfv3-shell__messages::-webkit-scrollbar,
.itfv3-prompts__list::-webkit-scrollbar,
.itfv3-prompts__textarea::-webkit-scrollbar,
.itfv3-shell__textarea::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.itfv3-shell__history::-webkit-scrollbar-thumb,
.itfv3-shell__messages::-webkit-scrollbar-thumb,
.itfv3-prompts__list::-webkit-scrollbar-thumb,
.itfv3-prompts__textarea::-webkit-scrollbar-thumb,
.itfv3-shell__textarea::-webkit-scrollbar-thumb {
    background: #243247;
    border-radius: 999px;
}

.itfv3-shell__history::-webkit-scrollbar-track,
.itfv3-shell__messages::-webkit-scrollbar-track,
.itfv3-prompts__list::-webkit-scrollbar-track,
.itfv3-prompts__textarea::-webkit-scrollbar-track,
.itfv3-shell__textarea::-webkit-scrollbar-track {
    background: #0b1220;
}

@media (max-width: 980px) {
    .itfv3-shell {
        border-radius: 14px;
    }

    .itfv3-shell__sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--itfv3-border);
    }
}
/* ITFV3_CHAT_DARK_THEME_SAFE_END */

/* ITFV3_CHAT_STICKY_COMPOSER_PHASE1_START */
.itfv3-shell__main {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.itfv3-shell__topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(11, 18, 32, 0.96);
    backdrop-filter: blur(10px);
}

.itfv3-shell__messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-bottom: 132px;
}

.itfv3-shell__composer {
    position: sticky;
    bottom: 0;
    z-index: 35;
    margin-top: auto;
    background: rgba(15, 23, 42, 0.96);
    border-top: 1px solid var(--itfv3-border, #23324a);
    backdrop-filter: blur(10px);
}

.itfv3-shell__textarea {
    min-height: 88px;
    max-height: 30vh;
}

@media (max-width: 980px) {
    .itfv3-shell__topbar {
        padding: 10px 12px;
    }

    .itfv3-shell__title {
        font-size: 20px;
        line-height: 1.1;
    }

    .itfv3-shell__rename,
    .itfv3-shell__archive,
    .itfv3-shell__delete,
    .itfv3-shell__export-toggle {
        min-height: 42px;
        padding: 10px 14px;
    }

    .itfv3-shell__messages {
        min-height: 42dvh;
        padding: 12px 12px 128px;
    }

    .itfv3-shell__composer {
        padding: 10px 12px;
    }

    .itfv3-shell__textarea {
        min-height: 74px;
        max-height: 22dvh;
    }
}

@media (max-width: 640px) {
    .itfv3-shell__topbar {
        padding: 8px 10px;
    }

    .itfv3-shell__topbar-main,
    .itfv3-shell__topbar-actions {
        gap: 8px;
    }

    .itfv3-shell__title {
        font-size: 18px;
    }

    .itfv3-shell__messages {
        min-height: 46dvh;
        padding: 10px 10px 122px;
    }

    .itfv3-shell__composer {
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    }

    .itfv3-shell__textarea {
        min-height: 68px;
        max-height: 20dvh;
    }
}
/* ITFV3_CHAT_STICKY_COMPOSER_PHASE1_END */

/* ITFV3_LONG_MESSAGES_COLLAPSE_CSS_START */
.itfv3-long-message {
    position: relative;
}

.itfv3-long-message.is-collapsed {
    max-height: var(--itfv3-long-message-max, 360px);
    overflow: hidden;
    padding-bottom: 64px;
}

.itfv3-long-message.is-collapsed::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 110px;
    background: linear-gradient(180deg, rgba(11, 18, 32, 0) 0%, rgba(11, 18, 32, 0.96) 80%);
    pointer-events: none;
}

.itfv3-long-message__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 14px;
    margin: 14px auto 0;
    border: 1px solid #334155;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.96);
    color: #e5e7eb;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.itfv3-long-message__toggle:hover {
    border-color: #38bdf8;
    color: #f8fafc;
    background: rgba(22, 32, 51, 0.98);
}

.itfv3-long-message.is-collapsed .itfv3-long-message__toggle {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    margin: 0;
}

@media (max-width: 640px) {
    .itfv3-long-message.is-collapsed {
        max-height: var(--itfv3-long-message-max-mobile, 260px);
        padding-bottom: 60px;
    }

    .itfv3-long-message__toggle {
        min-height: 36px;
        padding: 8px 12px;
        font-size: 12px;
    }
}
/* ITFV3_LONG_MESSAGES_COLLAPSE_CSS_END */
/* ITFV3_ENGINE_BAR_V1_START */
.itfv3-shell__engine-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 14px 24px 16px;
    border-top: 1px solid rgba(74, 106, 170, 0.22);
    border-bottom: 1px solid rgba(74, 106, 170, 0.22);
    background: rgba(7, 20, 48, 0.78);
}

.itfv3-shell__engine-provider-group,
.itfv3-shell__engine-model-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.itfv3-shell__engine-label {
    margin: 0;
    color: #dbe7ff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.itfv3-shell__engine-tabs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.itfv3-shell__engine-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid rgba(74, 106, 170, 0.45);
    border-radius: 10px;
    background: rgba(15, 31, 68, 0.88);
    color: #dbe7ff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}

.itfv3-shell__engine-tab:hover {
    background: rgba(22, 47, 96, 0.96);
    border-color: rgba(90, 144, 255, 0.7);
    color: #ffffff;
}

.itfv3-shell__engine-tab.is-active {
    border-color: #2ea8ff;
    background: linear-gradient(180deg, rgba(35, 117, 201, 0.96), rgba(26, 88, 160, 0.96));
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.itfv3-shell__engine-tab:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.itfv3-shell__engine-model-label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin: 0;
}

.itfv3-shell__engine-model-select {
    min-width: 320px;
    max-width: min(520px, 70vw);
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid rgba(74, 106, 170, 0.45);
    border-radius: 10px;
    background: rgba(12, 24, 53, 0.92);
    color: #f4f8ff;
    font-size: 14px;
    line-height: 1.35;
}

.itfv3-shell__engine-model-select:focus {
    outline: none;
    border-color: #2ea8ff;
    box-shadow: 0 0 0 1px #2ea8ff;
}

.itfv3-shell__engine-model-select:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.itfv3-shell__engine-badge,
.itfv3-shell__engine-readonly {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.itfv3-shell__engine-badge {
    border: 1px solid rgba(46, 168, 255, 0.38);
    background: rgba(28, 57, 112, 0.55);
    color: #bfe4ff;
}

.itfv3-shell__engine-readonly {
    border: 1px solid rgba(180, 194, 220, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: #d6deef;
}

@media (max-width: 980px) {
    .itfv3-shell__engine-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .itfv3-shell__engine-provider-group,
    .itfv3-shell__engine-model-group {
        width: 100%;
    }

    .itfv3-shell__engine-model-label {
        width: 100%;
    }

    .itfv3-shell__engine-model-select {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .itfv3-shell__engine-bar {
        padding: 12px 16px 14px;
        gap: 12px;
    }

    .itfv3-shell__engine-tabs {
        width: 100%;
    }

    .itfv3-shell__engine-tab {
        flex: 1 1 0;
    }

    .itfv3-shell__engine-model-group {
        gap: 10px;
    }
}
/* ITFV3_ENGINE_BAR_V1_END */
