/*
 * Split from chat.css.
 * Do not patch-stack random chat styles here.
 * Keep selectors grouped by purpose.
 */

.message-composer {
    position: relative;
    display: grid;
    grid-template-columns: 40px 1fr 40px 42px;
    gap: 8px;
    align-items: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
}

.message-composer textarea {
    width: 100%;
    min-width: 0;
    height: 42px;
    min-height: 42px;
    max-height: 96px;
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    outline: none;
    resize: none;
    color: var(--text);
    background: var(--surface-soft) !important;
    font: inherit;
    line-height: 1.35;
    overflow: hidden;
}

.composer-icon-button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--icon);
    background: var(--surface-soft) !important;
    box-shadow: 0 6px 16px var(--shadow);
    cursor: pointer;
}

.composer-icon-button:hover {
    background: rgba(127, 195, 255, 0.18) !important;
}

.send-button {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: var(--button-gradient) !important;
    box-shadow: 0 8px 22px var(--shadow);
    cursor: pointer;
}

.composer-icon-button i,
.send-button i {
    font-size: 16px;
}

.composer-notice {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.composer-icon-button.is-recording {
    color: #ffffff;
    background: var(--danger) !important;
    animation: voicePulse 1s ease-in-out infinite;
}

.voice-recording-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 18px;
    color: var(--text);
    background: rgba(127, 195, 255, 0.14);
    font-size: 13px;
    font-weight: 800;
}

.recording-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    animation: recordDotPulse 1s ease-in-out infinite;
}

.recording-bars {
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.recording-bars i {
    width: 4px;
    border-radius: 999px;
    background: var(--button-gradient);
    animation: recordingBar 0.8s ease-in-out infinite;
}

.recording-bars i:nth-child(1) {
    height: 8px;
    animation-delay: 0s;
}

.recording-bars i:nth-child(2) {
    height: 16px;
    animation-delay: 0.1s;
}

.recording-bars i:nth-child(3) {
    height: 22px;
    animation-delay: 0.2s;
}

.recording-bars i:nth-child(4) {
    height: 14px;
    animation-delay: 0.3s;
}

.recording-bars i:nth-child(5) {
    height: 10px;
    animation-delay: 0.4s;
}

.voice-recording-panel[hidden] {
    display: none !important;
}

.reply-context-panel {
    display: grid;
    grid-template-columns: 1fr 38px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 20px;
    background: rgba(127, 195, 255, 0.14);
}

.reply-context-panel[hidden] {
    display: none !important;
}

.reply-context-preview {
    min-width: 0;
    border: 0;
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 8px;
    align-items: center;
    color: var(--text);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.reply-context-preview i {
    color: var(--accent);
}

.reply-context-preview span {
    min-width: 0;
}

.reply-context-preview strong,
.reply-context-preview small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reply-context-preview strong {
    font-size: 12px;
    color: var(--accent);
}

.reply-context-preview small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
}

.reply-context-cancel {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--icon);
    background: var(--surface-soft);
    cursor: pointer;
}

.reply-context-panel {
    grid-column: 1 / -1;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 8px;
}

.message-composer:has(.reply-context-panel:not([hidden])) {
    align-items: center;
}

.reply-context-panel + .composer-icon-button,
.reply-context-panel + .composer-icon-button + textarea,
.reply-context-panel + .composer-icon-button + textarea + .composer-icon-button,
.reply-context-panel + .composer-icon-button + textarea + .composer-icon-button + .send-button {
    align-self: center;
}

.message-composer.is-blocked {
    opacity: 0.82;
}

.message-composer.is-blocked textarea {
    cursor: not-allowed;
}

.message-composer.is-blocked button {
    cursor: not-allowed;
    opacity: 0.55;
}

.composer-retry-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(220, 40, 70, 0.55);
    border-radius: 16px;
    color: var(--text);
    background: rgba(220, 40, 70, 0.12);
}

.composer-retry-panel[hidden] {
    display: none;
}

.composer-retry-panel strong,
.composer-retry-panel span {
    display: block;
}

.composer-retry-panel strong {
    font-size: 13px;
    font-weight: 900;
}

.composer-retry-panel span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.composer-retry-panel button {
    min-height: 34px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

#composerRetryButton {
    padding: 0 14px;
    color: #ffffff;
    background: var(--button-gradient);
}

#composerRetryButton:disabled {
    cursor: wait;
    opacity: 0.72;
}

#composerRetryDismissButton {
    width: 34px;
    color: var(--text);
    background: var(--surface-soft);
}
