/* Composer reply context */

#chat-view .reply-bar {
    --reply-accent: #a98cff;
    position: relative;
    z-index: 28;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto 34px;
    width: min(calc(100% - 24px), var(--chat-stream-max, 960px));
    min-height: 62px;
    align-self: center;
    align-items: center;
    gap: 9px;
    box-sizing: border-box;
    margin: 5px auto 0;
    padding: 7px 8px 7px 9px;
    overflow: hidden;
    border: 1px solid rgba(183, 160, 255, 0.15) !important;
    border-radius: 18px !important;
    background:
        linear-gradient(132deg, rgba(174, 144, 255, 0.09), transparent 43%),
        rgba(9, 12, 24, 0.72) !important;
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.075) !important;
    -webkit-backdrop-filter: blur(30px) saturate(155%) !important;
    backdrop-filter: blur(30px) saturate(155%) !important;
    animation: replyComposerIn 430ms var(--spring, cubic-bezier(0.16, 1, 0.3, 1)) both !important;
    transform-origin: 50% 100%;
}

#chat-view .reply-bar::before {
    content: "";
    position: absolute;
    z-index: 3;
    top: 11px;
    bottom: 11px;
    left: 0;
    width: 3px;
    border-radius: 0 999px 999px 0;
    background: linear-gradient(180deg, #d2c1ff, var(--reply-accent) 48%, #6b51d5);
    box-shadow: 0 0 12px rgba(169, 140, 255, 0.52);
}

#chat-view .reply-bar::after {
    content: "";
    position: absolute;
    z-index: 0;
    right: 12%;
    bottom: -1px;
    left: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(181, 157, 255, 0.42), transparent);
    pointer-events: none;
}

#chat-view .reply-bar-aurora {
    position: absolute;
    z-index: 0;
    top: -48px;
    left: -20px;
    width: 180px;
    height: 125px;
    border-radius: 50%;
    background: rgba(143, 105, 238, 0.14);
    filter: blur(36px);
    pointer-events: none;
}

@keyframes replyComposerIn {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.975);
        filter: blur(5px);
    }
    60% { opacity: 1; }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

#chat-view .reply-bar.is-leaving {
    animation: replyComposerOut 150ms ease both !important;
    pointer-events: none;
}

@keyframes replyComposerOut {
    to {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
        filter: blur(3px);
    }
}

#chat-view .reply-symbol {
    position: relative;
    z-index: 1;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(221, 209, 255, 0.17);
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(172, 140, 255, 0.95), rgba(99, 74, 200, 0.94));
    color: #fff;
    box-shadow:
        0 8px 18px rgba(73, 49, 162, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    font-size: 0.7rem;
    isolation: isolate;
}

#chat-view .reply-symbol-ring {
    position: absolute;
    inset: 4px;
    z-index: -1;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
}

#chat-view .reply-refresh .reply-symbol-ring {
    animation: replySymbolPulse 360ms ease;
}

@keyframes replySymbolPulse {
    45% { opacity: 0.35; transform: scale(0.78); }
}

#chat-view .reply-target {
    position: relative;
    z-index: 1;
    display: grid;
    min-width: 0;
    gap: 4px;
    margin: 0;
    padding: 2px 4px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
    -webkit-tap-highlight-color: transparent;
}

#chat-view .reply-target:hover {
    background: rgba(255, 255, 255, 0.028);
}

#chat-view .reply-target:active {
    transform: scale(0.992);
}

#chat-view .reply-target:focus-visible {
    outline: 2px solid rgba(175, 148, 255, 0.38);
    outline-offset: 2px;
}

#chat-view .reply-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

#chat-view .reply-eyebrow {
    flex: 0 0 auto;
    color: rgba(189, 169, 249, 0.62);
    font-size: 0.51rem;
    font-weight: 730;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

#chat-view .reply-name {
    min-width: 0;
    overflow: hidden;
    color: rgba(241, 236, 255, 0.93);
    font-size: 0.69rem;
    font-weight: 710;
    letter-spacing: -0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#chat-view .reply-type {
    display: inline-flex;
    min-height: 18px;
    flex: 0 0 auto;
    align-items: center;
    padding: 0 6px;
    border: 1px solid rgba(181, 156, 249, 0.13);
    border-radius: 999px;
    background: rgba(151, 121, 229, 0.08);
    color: rgba(199, 181, 249, 0.68);
    font-size: 0.49rem;
    font-weight: 680;
}

#chat-view .reply-preview-line {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
}

#chat-view .reply-preview-icon {
    display: inline-grid;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    place-items: center;
    border-radius: 6px;
    background: rgba(158, 129, 238, 0.08);
    color: rgba(181, 158, 246, 0.7);
    font-size: 0.49rem;
}

#chat-view .reply-bar .reply-text {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    margin: 0;
    color: rgba(200, 194, 216, 0.58);
    font-size: 0.62rem;
    font-weight: 500;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#chat-view .reply-jump-cue {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    color: rgba(190, 178, 222, 0.34);
    font-size: 0.49rem;
    font-weight: 620;
    transition: color 150ms ease, transform 150ms ease;
}

#chat-view .reply-target:hover .reply-jump-cue {
    color: rgba(202, 185, 250, 0.68);
    transform: translateY(-1px);
}

#chat-view .reply-shortcut {
    position: relative;
    z-index: 1;
    display: inline-flex;
    height: 23px;
    align-items: center;
    padding: 0 7px;
    border: 1px solid rgba(255, 255, 255, 0.065);
    border-bottom-color: rgba(255, 255, 255, 0.11);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.025);
    color: rgba(208, 202, 220, 0.36);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
    font-family: inherit;
    font-size: 0.48rem;
    font-weight: 650;
}

#chat-view .reply-close {
    position: relative;
    z-index: 1;
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.055) !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.018) !important;
    color: rgba(211, 205, 224, 0.44);
    box-shadow: none !important;
    font-size: 0.59rem;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

#chat-view .reply-close:hover {
    border-color: rgba(244, 133, 159, 0.15) !important;
    background: rgba(224, 91, 123, 0.075) !important;
    color: rgba(255, 184, 201, 0.82);
}

#chat-view .reply-close:active {
    transform: scale(0.9);
}

#chat-view .reply-bar[data-reply-type="image"] { --reply-accent: #69b8ff; }
#chat-view .reply-bar[data-reply-type="voice"],
#chat-view .reply-bar[data-reply-type="audio"] { --reply-accent: #63d5bc; }
#chat-view .reply-bar[data-reply-type="file"] { --reply-accent: #e0ad61; }
#chat-view .reply-bar[data-reply-type="deleted"] { --reply-accent: #e57b91; }

#chat-view .reply-bar[data-reply-type="voice"] .reply-preview-icon,
#chat-view .reply-bar[data-reply-type="audio"] .reply-preview-icon {
    background: rgba(75, 195, 166, 0.09);
    color: rgba(105, 221, 193, 0.78);
}

[data-theme="light"] #chat-view .reply-bar {
    border-color: rgba(108, 78, 190, 0.12) !important;
    background:
        linear-gradient(132deg, rgba(143, 104, 231, 0.1), transparent 45%),
        rgba(250, 249, 253, 0.88) !important;
    box-shadow:
        0 12px 28px rgba(70, 50, 112, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;
}

[data-theme="light"] #chat-view .reply-name {
    color: rgba(41, 32, 61, 0.9);
}

[data-theme="light"] #chat-view .reply-eyebrow,
[data-theme="light"] #chat-view .reply-type {
    color: rgba(91, 63, 166, 0.66);
}

[data-theme="light"] #chat-view .reply-type {
    border-color: rgba(102, 73, 180, 0.11);
    background: rgba(117, 82, 205, 0.06);
}

[data-theme="light"] #chat-view .reply-bar .reply-text {
    color: rgba(65, 53, 84, 0.58);
}

[data-theme="light"] #chat-view .reply-preview-icon {
    background: rgba(111, 78, 197, 0.07);
    color: rgba(91, 62, 174, 0.68);
}

[data-theme="light"] #chat-view .reply-shortcut,
[data-theme="light"] #chat-view .reply-close {
    border-color: rgba(69, 55, 95, 0.09) !important;
    background: rgba(70, 53, 103, 0.035) !important;
    color: rgba(64, 51, 86, 0.46);
}

@media (max-width: 768px) {
    #chat-view .reply-bar {
        grid-template-columns: 39px minmax(0, 1fr) 32px;
        min-height: 57px;
        gap: 7px;
        width: calc(100% - 16px);
        margin-top: 4px;
        padding: 6px 7px 6px 8px;
        border-radius: 16px !important;
    }

    #chat-view .reply-symbol {
        width: 37px;
        height: 37px;
        border-radius: 12px;
    }

    #chat-view .reply-symbol-ring {
        border-radius: 9px;
    }

    #chat-view .reply-shortcut,
    #chat-view .reply-jump-cue {
        display: none;
    }

    #chat-view .reply-name {
        font-size: 0.66rem;
    }

    #chat-view .reply-bar .reply-text {
        font-size: 0.59rem;
    }

    #chat-view .reply-close {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 380px) {
    #chat-view .reply-type {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    #chat-view .reply-bar,
    #chat-view .reply-bar * {
        animation-duration: 1ms !important;
        transition-duration: 1ms !important;
    }
}
