/* Main Chat and the four Study Helper composers share one quiet surface. */
:root {
    --logicum-composer-surface: #383633;
}

body.light-mode {
    --logicum-composer-surface: var(--input-bg, #faf7f1);
}

body #chatView .chat-main-area .chat-input-area,
body.study-chat-ui-active .study-chat-composer.chat-input-area,
body.study-chat-ui-active .study-chat-composer.chat-input-area:hover,
body.study-chat-ui-active .study-chat-composer.chat-input-area:focus-within {
    box-sizing: border-box !important;
    width: 100% !important;
    height: auto !important;
    min-height: 120px !important;
    max-height: none !important;
    padding: 10px 12px 8px !important;
    border: 1px solid transparent !important;
    border-radius: 20px !important;
    corner-shape: round !important;
    background: var(--logicum-composer-surface) !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: none !important;
    transform: none !important;
}

body.study-chat-ui-active .study-chat-composer.chat-input-area {
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) 38px 40px !important;
    grid-template-rows: auto 40px !important;
    align-items: stretch !important;
    column-gap: 8px !important;
    row-gap: 2px !important;
    gap: 2px 8px !important;
    aspect-ratio: auto !important;
    transition: background-color 160ms ease !important;
}

body.study-chat-ui-active .study-chat-composer.chat-input-area :is(#quizTopicInput, #noteTopicInput, #interrogTopicInput, #newMmPromptInput).study-chat-input {
    box-sizing: border-box !important;
    display: block !important;
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    align-self: stretch !important;
    width: 100% !important;
    height: var(--logicum-chat-input-height, 56px) !important;
    min-width: 0 !important;
    min-height: 56px !important;
    max-height: 180px !important;
    margin: 0 !important;
    padding: 4px 8px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: var(--text-primary) !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    resize: none !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
}

body.study-chat-ui-active .study-chat-composer.chat-input-area :is(#quizTopicInput, #noteTopicInput, #interrogTopicInput, #newMmPromptInput).study-chat-input.logicum-input-scrollable {
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
}

body.study-chat-ui-active .study-chat-composer.chat-input-area :is(.study-chat-upload-btn, .study-chat-voice, .study-chat-send) {
    grid-row: 2 !important;
    align-self: center !important;
    justify-self: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    corner-shape: round !important;
    box-shadow: none !important;
}

body.study-chat-ui-active .study-chat-composer.chat-input-area .study-chat-upload-btn {
    grid-column: 1 !important;
    background: transparent !important;
}

body.study-chat-ui-active .study-chat-composer.chat-input-area .study-chat-upload-btn:hover {
    background: rgba(255, 255, 255, .12) !important;
}

body.light-mode.study-chat-ui-active .study-chat-composer.chat-input-area .study-chat-upload-btn:hover {
    background: rgba(0, 0, 0, .075) !important;
}

body.study-chat-ui-active .study-chat-composer.chat-input-area .study-chat-upload-btn svg {
    width: 22px !important;
    height: 22px !important;
}

body.study-chat-ui-active .study-chat-composer.chat-input-area .study-chat-voice {
    grid-column: 3 !important;
}

body.study-chat-ui-active .study-chat-composer.chat-input-area .study-chat-send {
    grid-column: 4 !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
}

@media (prefers-reduced-motion: reduce) {
    body.study-chat-ui-active .study-chat-composer.chat-input-area {
        transition: none !important;
    }
}
