/* /public_html/assets/css/dashboard-chat-test.css */

.edq-panel-shell {
    position: relative;
    width: 100%;
}

.edq-panel-shell__toast-host {
    display: contents;
}

.edq-panel-shell__content {
    width: 100%;
    min-width: 0;
}

.edq-panel-shell > .panel-loader-host {
    width: 100%;
    padding-top: var(--dashboard-floating-content-offset, 4.25rem);
}

.edq-panel-shell > .panel-loader-host .ui-panel-loader {
    width: 100%;
}

.edq-panel-shell__mobile-title {
    display: none;
}

.edq-panel-shell[data-edq-panel-shell="chat-test"],
.edq-panel-shell[data-edq-panel-shell="chat-room"] {
    --chat-test-shell-height: auto;
    --chat-test-composer-height: 5.25rem;
    --chat-test-keyboard-gap: 0px;
    --chat-test-visual-offset-top: 0px;
}

.edq-panel-shell[data-edq-panel-shell="chat-test"] > .panel-loader-host,
.edq-panel-shell[data-edq-panel-shell="chat-room"] > .panel-loader-host {
    padding-inline: clamp(0.9rem, 2vw, 1.25rem);
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
}

.edq-panel-shell[data-edq-panel-shell="chat-test"] .edq-panel-shell__content,
.edq-panel-shell[data-edq-panel-shell="chat-room"] .edq-panel-shell__content {
    min-height: var(--chat-test-shell-height, auto);
    height: var(--chat-test-shell-height, auto);
    max-height: var(--chat-test-shell-height, auto);
    padding-top: var(--dashboard-floating-content-offset, 4.25rem);
    padding-inline: 0;
    padding-bottom: 0;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
}

.chat-test-stage {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.72rem;
    min-height: 100%;
    height: 100%;
    padding: 0 clamp(0.9rem, 2vw, 1.25rem) max(0.9rem, env(safe-area-inset-bottom, 0px));
    overflow: hidden;
}

.chat-test-stage--room {
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.58rem;
    padding-top: 0.18rem;
}

.chat-test-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.18rem;
}

.chat-test-header__identity {
    min-width: 0;
}

.chat-test-header__eyebrow {
    margin: 0 0 0.16rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.chat-test-header__title {
    margin: 0;
    font-size: clamp(1.05rem, 2.2vw, 1.24rem);
    line-height: 1.08;
}

.chat-test-header__subtitle {
    margin: 0.16rem 0 0;
    color: var(--color-text-muted);
    font-size: 0.84rem;
    line-height: 1.34;
}

.chat-test-header__tools {
    position: relative;
    flex: 0 0 auto;
}

.chat-test-header__debug-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.7rem;
    min-width: 2.7rem;
    height: 2.7rem;
    min-height: 2.7rem;
    padding: 0;
    border: 1px solid var(--color-border-subtle);
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-surface, #101729) 78%, transparent);
    color: inherit;
    box-shadow: var(--shadow-subtle);
    backdrop-filter: blur(16px) saturate(1.06);
    -webkit-backdrop-filter: blur(16px) saturate(1.06);
}

.chat-test-header__debug-toggle.is-open {
    border-color: color-mix(in srgb, var(--color-primary, #2563eb) 34%, var(--color-border-subtle));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #2563eb) 14%, transparent);
}

.chat-test-header__debug-toggle i {
    font-size: 1.05rem;
}

.chat-test-thread-frame {
    position: relative;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    border-radius: 1.4rem;
    background:
        linear-gradient(
            to bottom,
            color-mix(in srgb, var(--color-bg, #081120) 18%, transparent) 0%,
            color-mix(in srgb, var(--color-bg, #081120) 42%, transparent) 100%
        );
}

.chat-test-thread {
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
    min-height: 100%;
    height: 100%;
    overflow-x: clip;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.18rem 0.12rem 0.34rem;
    scrollbar-gutter: stable both-edges;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chat-test-thread::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.chat-test-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.15rem 0 0.04rem;
}

.chat-test-divider span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.8rem;
    padding: 0.34rem 0.76rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-surface-elevated, var(--color-surface, #101729)) 92%, transparent);
    border: 1px solid var(--color-border-subtle);
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.chat-test-message {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    max-width: min(32rem, calc(100% - 2.2rem));
}

.chat-test-message--incoming {
    align-self: flex-start;
}

.chat-test-message--outgoing {
    align-self: flex-end;
}

.chat-test-message--system {
    align-self: stretch;
    max-width: none;
}

.chat-test-message__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding-inline: 0.3rem;
    color: var(--color-text-muted);
    font-size: 0.76rem;
    line-height: 1.2;
}

.chat-test-message__author {
    font-weight: 800;
}

.chat-test-message__bubble {
    border-radius: 1.35rem;
    padding: 0.86rem 0.96rem;
    border: 1px solid var(--color-border-subtle);
    box-shadow: var(--shadow-subtle);
    overflow-wrap: anywhere;
}

.chat-test-message__bubble p {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.48;
}

.chat-test-message--incoming .chat-test-message__bubble,
.chat-test-message--system .chat-test-message__bubble {
    background: color-mix(in srgb, var(--color-surface, #101729) 94%, transparent);
}

.chat-test-message--outgoing .chat-test-message__bubble {
    background: color-mix(in srgb, var(--color-primary, #2563eb) 18%, var(--color-surface, #101729));
    border-color: color-mix(in srgb, var(--color-primary, #2563eb) 28%, var(--color-border-subtle));
}

.chat-test-debug-inline {
    display: flex;
    flex-direction: column;
    gap: 0.62rem;
}

.chat-test-debug-inline__title {
    font-size: 0.88rem;
    font-weight: 800;
}

.chat-test-debug-inline__text {
    color: var(--color-text-muted);
    font-size: 0.84rem;
    line-height: 1.44;
}

.chat-test-runtime {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
}

.chat-test-runtime--inline {
    margin-top: 0.05rem;
}

.chat-test-runtime-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    min-height: 1.86rem;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--color-border-subtle);
    background: color-mix(in srgb, var(--color-surface-elevated, var(--color-surface, #101729)) 90%, transparent);
    font-size: 0.72rem;
    line-height: 1.2;
}

.chat-test-runtime-chip strong {
    font-weight: 800;
}

.chat-test-debug-menu {
    position: absolute;
    top: 0.7rem;
    right: 0.75rem;
    z-index: 4;
    display: grid;
    gap: 0.46rem;
    width: min(15rem, calc(100% - 1.4rem));
    padding: 0.72rem;
    border-radius: 1.2rem;
    border: 1px solid color-mix(in srgb, var(--color-primary, #2563eb) 22%, var(--color-border-subtle));
    background: color-mix(in srgb, var(--color-surface, #101729) 90%, transparent);
    box-shadow: 0 16px 36px rgba(8, 17, 32, 0.32);
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
}

.chat-test-mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.24rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--color-border-subtle);
    background: color-mix(in srgb, var(--color-surface, #101729) 88%, transparent);
    color: inherit;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: var(--shadow-subtle);
}

.chat-test-mini-btn--menu {
    justify-content: flex-start;
}

.chat-test-jump {
    position: absolute;
    right: 0.5rem;
    bottom: 0.55rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.55rem;
    min-width: 2.55rem;
    height: 2.55rem;
    min-height: 2.55rem;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--color-primary, #2563eb) 24%, var(--color-border-subtle));
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-surface, #101729) 82%, transparent);
    color: inherit;
    box-shadow: 0 10px 26px rgba(8, 17, 32, 0.32);
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
}

.chat-test-jump i {
    font-size: 1rem;
}

.chat-test-composer-dock {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem;
    min-height: 0;
    padding-top: 0.15rem;
}

.chat-test-composer__plus,
.chat-test-composer__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    min-width: 3rem;
    height: 3rem;
    min-height: 3rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--color-border-subtle);
    color: inherit;
    box-shadow: var(--shadow-subtle);
}

.chat-test-composer__plus {
    align-self: end;
    flex: 0 0 auto;
    margin-bottom: 0.30rem;
    background: color-mix(in srgb, var(--color-surface, #101729) 84%, transparent);
    backdrop-filter: blur(16px) saturate(1.06);
    -webkit-backdrop-filter: blur(16px) saturate(1.06);
}

.chat-test-composer__send {
    flex: 0 0 auto;
    align-self: end;
    width: 2.45rem;
    min-width: 2.45rem;
    height: 2.45rem;
    min-height: 2.45rem;
    margin-bottom: 0.02rem;
    border-color: color-mix(in srgb, var(--color-primary, #2563eb) 44%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary, #2563eb) 92%, white 8%), color-mix(in srgb, var(--color-primary, #2563eb) 78%, black 4%));
    color: #fff;
}

.chat-test-composer__plus i,
.chat-test-composer__send i {
    font-size: 1.05rem;
}

.chat-test-composer__field {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.42rem;
    padding: 0.34rem 0.34rem 0.30rem 0.78rem;
    border-radius: 1.35rem;
    border: 1px solid var(--color-border-subtle);
    background: color-mix(in srgb, var(--color-surface, #101729) 92%, transparent);
    box-shadow: var(--shadow-subtle);
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
}

.chat-test-composer__input-shell {
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    align-self: stretch;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
}

.chat-test-composer__textarea {
    width: 100%;
    min-width: 0;
    min-height: 1.45em;
    max-height: 8.25rem;
    resize: none;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--color-text, inherit);
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: 16px;
    line-height: 1.45;
    overflow-y: auto;
    scrollbar-width: thin;
    overscroll-behavior-y: contain;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
}

.chat-test-composer__textarea::placeholder {
    color: color-mix(in srgb, var(--color-text-muted) 78%, transparent);
}

.chat-test-composer__field:focus-within {
    border-color: color-mix(in srgb, var(--color-primary, #2563eb) 38%, var(--color-border-subtle));
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--color-primary, #2563eb) 12%, transparent),
        var(--shadow-subtle);
}

.chat-test-header__debug-toggle:focus-visible,
.chat-test-mini-btn:focus-visible,
.chat-test-jump:focus-visible,
.chat-test-composer__plus:focus-visible,
.chat-test-composer__send:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--color-primary, #2563eb) 20%, transparent);
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .edq-panel-shell__mobile-title {
        display: block;
        position: fixed;
        top: var(--dashboard-floating-top-offset);
        left: 50%;
        transform: translateX(-50%);
        width: min(18rem, calc(100vw - 8.5rem));
        margin: 0;
        text-align: center;
        font-size: 1.06rem;
        font-weight: 800;
        line-height: 1.12;
        pointer-events: none;
    }

    .edq-panel-shell[data-edq-panel-shell="chat-test"] .edq-panel-shell__content,
.edq-panel-shell[data-edq-panel-shell="chat-room"] .edq-panel-shell__content {
        padding-top: calc(var(--dashboard-floating-content-offset, 4.25rem) - 0.1rem);
    }

    .chat-test-stage {
        gap: 0.66rem;
        padding-inline: 0.75rem;
        padding-bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
    }

    .chat-test-message {
        max-width: calc(100% - 1.95rem);
    }

    .chat-test-thread {
        padding-inline: 0;
    }

    .chat-test-runtime-chip {
        font-size: 0.7rem;
    }
}



@media (max-width: 767px) {
    .edq-panel-shell[data-edq-panel-shell="chat-room"] .edq-panel-shell__content {
        padding-top: 0;
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-stage--room {
        padding-top: 0;
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-thread-frame {
        margin-top: 0;
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-thread {
        padding-top: calc(var(--dashboard-floating-content-offset, 4.25rem) - 0.28rem);
    }
}

@media (max-width: 560px) {
    .chat-test-header__subtitle {
        font-size: 0.81rem;
    }

    .chat-test-message__bubble {
        padding: 0.82rem 0.88rem;
    }

    .chat-test-debug-menu {
        width: min(14.5rem, calc(100% - 1rem));
        right: 0.5rem;
        top: 0.55rem;
        padding: 0.62rem;
    }

    .chat-test-mini-btn--menu {
        min-height: 2.18rem;
    }
}


.chat-test-composer-dock {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
    touch-action: none;
}

.chat-test-composer__textarea {
    touch-action: pan-y;
}

.chat-test-composer__textarea[data-overflowing="1"] {
    touch-action: pan-y;
}

.chat-test-composer__plus,
.chat-test-composer__send,
.chat-test-header__debug-toggle,
.chat-test-jump,
.chat-test-mini-btn {
    touch-action: manipulation;
}


.chat-test-debug-menu[hidden] {
    display: none !important;
}

.chat-test-header__identity {
    touch-action: none;
}


.chat-test-debug-menu[hidden],
.chat-test-jump[hidden] {
    display: none !important;
}

.chat-test-header,
.chat-test-header__identity,
.chat-test-header__tools,
.edq-panel-shell[data-edq-panel-shell="chat-test"] .panel-header-common,
.edq-panel-shell[data-edq-panel-shell="chat-room"] .panel-header-common,
.edq-panel-shell[data-edq-panel-shell="chat-test"] .panel-header-row,
.edq-panel-shell[data-edq-panel-shell="chat-room"] .panel-header-row,
.edq-panel-shell[data-edq-panel-shell="chat-test"] .panel-header-common *,
.edq-panel-shell[data-edq-panel-shell="chat-room"] .panel-header-common * {
    overscroll-behavior: none;
    touch-action: none;
}

.chat-test-thread,
.chat-test-thread * {
    touch-action: pan-y;
}


/* Chat room polish v1.2 */
.edq-panel-shell[data-edq-panel-shell="chat-room"] .edq-panel-shell__content {
    padding-top: 0;
}

.edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-stage--room {
    gap: 0.42rem;
    padding-top: 0;
    padding-bottom: max(0.28rem, calc(env(safe-area-inset-bottom, 0px) * 0.3));
}

.edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-thread {
    justify-content: flex-end;
    padding-top: 0.4rem;
    padding-bottom: 0.22rem;
    scrollbar-gutter: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-thread::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-jump {
    left: 50%;
    right: auto;
    bottom: 0.42rem;
    width: 2.2rem;
    min-width: 2.2rem;
    height: 2.2rem;
    min-height: 2.2rem;
    transform: translateX(-50%);
}

.edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-jump i {
    font-size: 0.9rem;
}

.edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-composer-dock {
    padding-top: 0;
}

.edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-composer__field {
    padding-top: 0.30rem;
    padding-right: 0.34rem;
    padding-bottom: 0.30rem;
    padding-left: 0.78rem;
    overflow: hidden;
}

@media (max-width: 767px) {
    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-stage--room {
        overflow: visible;
        padding-bottom: max(0.18rem, calc(env(safe-area-inset-bottom, 0px) * 0.18));
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-thread-frame {
        overflow: visible;
        border-radius: 0;
        background: transparent;
        margin-top: calc((var(--app-header-safe-height, 4.25rem) + 0.75rem) * -1);
        padding-top: 0;
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-thread {
        justify-content: flex-end;
        padding-top: calc(var(--app-header-safe-height, 4.25rem) + 0.9rem);
    }
}

/* Chat room polish v1.7 */
@media (max-width: 767px) {
    .edq-panel-shell[data-edq-panel-shell="chat-room"] .edq-panel-shell__content {
        overflow: visible;
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-stage {
        isolation: auto;
        overflow: visible;
    }
}


/* Chat room compact spacer fix */
.edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-thread-frame {
    display: flex;
    flex-direction: column;
}

.edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-thread {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    justify-content: flex-start;
}

.edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-thread[data-compact="1"]::before {
    content: '';
    display: block;
    flex: 1 0 auto;
    min-height: 0;
}

/* Chat room gap fix v6.3: extend the scroll layer under navbar AND composer,
   but keep the last message just above the composer */
@media (max-width: 767px) {
    .edq-panel-shell[data-edq-panel-shell="chat-room"] {
        --chat-room-navbar-overlap: calc(var(--app-header-safe-height, 4.25rem) + 0.75rem);
        --chat-room-composer-underlap: calc(
            var(--chat-test-composer-height, 5.25rem)
            + env(safe-area-inset-bottom, 0px)
            + 0.35rem
        );
        --chat-room-message-stop-space: calc(
            var(--chat-test-composer-height, 5.25rem)
            - 1.5rem
        );
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-thread-frame {
        margin-top: 0 !important;
        min-height: 0;
        height: 100%;
        overflow: visible;
        border-radius: 0;
        background: transparent;
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-thread {
        flex: 0 0 auto;
        min-height: calc(
            100%
            + var(--chat-room-navbar-overlap)
            + var(--chat-room-composer-underlap)
        );
        height: calc(
            100%
            + var(--chat-room-navbar-overlap)
            + var(--chat-room-composer-underlap)
        );
        margin-top: calc(var(--chat-room-navbar-overlap) * -1);
        padding-bottom: calc(
            var(--chat-room-composer-underlap)
            + var(--chat-room-message-stop-space)
        );
        box-sizing: border-box;
    }
}

@media (max-width: 767px) {
    .edq-panel-shell[data-edq-panel-shell="chat-room"][data-keyboard-open="0"] .chat-test-composer-dock {
        transform: translateY(-10px);
    }
}

/* Chat media V1 safe */
.chat-test-composer-dock {
    align-items: end;
}

.chat-test-composer__plus {
    flex: 0 0 auto;
    align-self: end;
    margin-bottom: 0.38rem;
}

.chat-test-composer__textarea {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.chat-test-attachments {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 0 0.45rem;
    padding: 0;
}

.chat-test-attachments[data-has-items="1"] {
    display: flex;
}

.chat-test-attachments__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.chat-test-attachment {
    position: relative;
    display: flex;
    align-items: stretch;
    min-width: 0;
    max-width: min(100%, 19rem);
    border: 1px solid var(--color-border-subtle);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--color-surface, #101729) 92%, transparent);
    box-shadow: var(--shadow-subtle);
    overflow: hidden;
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
}

.chat-test-attachment--image {
    width: min(9.75rem, 42vw);
    max-width: min(9.75rem, 42vw);
    flex-direction: column;
}

.chat-test-attachment__thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: color-mix(in srgb, var(--color-bg, #081120) 75%, black 6%);
    overflow: hidden;
}

.chat-test-attachment__thumb img,
.chat-test-attachment__thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-test-attachment__body {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.72rem;
    padding: 0.78rem 0.9rem;
}

.chat-test-attachment--image .chat-test-attachment__body {
    padding: 0.65rem 0.72rem 0.78rem;
}

.chat-test-attachment__icon {
    flex: 0 0 auto;
    width: 2.1rem;
    min-width: 2.1rem;
    height: 2.1rem;
    min-height: 2.1rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border-subtle);
    background: color-mix(in srgb, var(--color-surface-elevated, var(--color-surface, #101729)) 90%, transparent);
    font-size: 1rem;
}

.chat-test-attachment__meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
}

.chat-test-attachment__name {
    min-width: 0;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-test-attachment__info {
    color: var(--color-text-muted);
    font-size: 0.74rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-test-attachment__remove {
    position: absolute;
    top: 0.38rem;
    right: 0.38rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    min-height: 2rem;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--color-border-subtle) 82%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-surface, #101729) 78%, transparent);
    color: inherit;
    box-shadow: var(--shadow-subtle);
    backdrop-filter: blur(12px) saturate(1.08);
    -webkit-backdrop-filter: blur(12px) saturate(1.08);
}

.chat-test-attachment__remove i {
    font-size: 0.92rem;
}

.chat-test-attachments__hint {
    color: var(--color-text-muted);
    font-size: 0.76rem;
    line-height: 1.3;
    padding-inline: 0.15rem;
}

.chat-test-media-input {
    display: none !important;
}

@media (max-width: 560px) {
    .chat-test-attachment {
        max-width: 100%;
    }

    .chat-test-attachment--image {
        width: min(8.75rem, 44vw);
        max-width: min(8.75rem, 44vw);
    }

    .chat-test-attachment__body {
        padding: 0.72rem 0.8rem;
    }
}


.chat-test-message__attachments {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.65rem;
}


.chat-test-message__standalone-attachments {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-test-message--incoming .chat-test-message__standalone-attachments,
.chat-test-message--system .chat-test-message__standalone-attachments {
    align-items: flex-start;
}

.chat-test-message--outgoing .chat-test-message__standalone-attachments {
    align-items: flex-end;
}

.chat-test-message__standalone-attachments .chat-test-message-attachment-link {
    display: block;
    width: auto;
    max-width: 100%;
}

.chat-test-message__standalone-attachments .chat-test-attachment {
    max-width: min(100%, 19rem);
}

.chat-test-message__standalone-attachments .chat-test-attachment--image {
    width: min(12.5rem, 54vw);
    max-width: min(12.5rem, 54vw);
}

.chat-test-message__standalone-attachments + .chat-test-message__bubble {
    margin-top: 0.6rem;
}

.chat-test-message-attachment-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.chat-test-message__attachments .chat-test-attachment {
    max-width: min(100%, 15.5rem);
    background: color-mix(in srgb, var(--color-surface, #101729) 90%, transparent);
}

.chat-test-message__attachments .chat-test-attachment--image {
    width: min(12.5rem, 54vw);
    max-width: min(12.5rem, 54vw);
}

.chat-test-message__attachments .chat-test-attachment__body {
    padding: 0.68rem 0.78rem;
}

.chat-test-message--outgoing .chat-test-message__attachments .chat-test-attachment {
    border-color: color-mix(in srgb, var(--color-primary, #2563eb) 26%, var(--color-border-subtle));
}

@media (max-width: 560px) {
    .chat-test-message__attachments .chat-test-attachment--image,
    .chat-test-message__standalone-attachments .chat-test-attachment--image {
        width: min(11rem, 56vw);
        max-width: min(11rem, 56vw);
    }
}


.chat-test-message-attachment-link {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    color: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.chat-test-message-attachment-link:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--color-primary, #2563eb) 20%, transparent);
    outline-offset: 2px;
    border-radius: 1rem;
}

.chat-test-viewer[hidden] {
    display: none !important;
}

.chat-test-viewer {
    position: fixed;
    inset: 0;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: calc(var(--app-header-safe-height, var(--dashboard-floating-content-offset, 4.25rem)) + 0.75rem);
    padding-right: clamp(0.75rem, 2vw, 1rem);
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom, 0px) + 0.4rem);
    padding-left: clamp(0.75rem, 2vw, 1rem);
}

.chat-test-viewer__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(5, 10, 22, 0.76);
    backdrop-filter: blur(18px) saturate(1.04);
    -webkit-backdrop-filter: blur(18px) saturate(1.04);
}

.chat-test-viewer__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 44rem);
    max-height: min(
        100%,
        calc(100dvh - var(--app-header-safe-height, var(--dashboard-floating-content-offset, 4.25rem)) - 1.85rem - env(safe-area-inset-bottom, 0px))
    );
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border-subtle);
    border-radius: 1.25rem;
    background: color-mix(in srgb, var(--color-surface, #101729) 94%, transparent);
    box-shadow: 0 22px 54px rgba(8, 17, 32, 0.42);
    overflow: hidden;
    backdrop-filter: blur(22px) saturate(1.08);
    -webkit-backdrop-filter: blur(22px) saturate(1.08);
}

.chat-test-viewer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    border-bottom: 1px solid var(--color-border-subtle);
}

.chat-test-viewer__meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
}

.chat-test-viewer__name {
    min-width: 0;
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-test-viewer__info {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    line-height: 1.2;
}

.chat-test-viewer__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
}

.chat-test-viewer__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.45rem;
    min-width: 2.45rem;
    height: 2.45rem;
    min-height: 2.45rem;
    padding: 0;
    border: 1px solid var(--color-border-subtle);
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-surface-elevated, var(--color-surface, #101729)) 90%, transparent);
    color: inherit;
    box-shadow: var(--shadow-subtle);
}

.chat-test-viewer__action i {
    font-size: 0.98rem;
}

.chat-test-viewer__body {
    min-height: 0;
    padding: 0.9rem;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--color-bg, #081120) 72%, black 5%);
}

.chat-test-viewer__image,
.chat-test-viewer__video {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: min(78vh, calc(100dvh - 8rem));
    border-radius: 0.95rem;
    object-fit: contain;
    box-shadow: 0 16px 32px rgba(8, 17, 32, 0.36);
}

.chat-test-viewer__document-shell {
    width: min(100%, 72rem);
    height: min(78vh, calc(100dvh - 8rem));
    border-radius: 0.95rem;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--color-border-subtle) 82%, transparent);
    background: color-mix(in srgb, var(--color-surface, #101729) 94%, black 6%);
    box-shadow: 0 16px 32px rgba(8, 17, 32, 0.36);
}

.chat-test-viewer__document-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.chat-test-viewer__body--pdfjs {
    display: block;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0.9rem;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.chat-test-viewer__pdfjs {
    width: min(100%, 46rem);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.chat-test-viewer__pdfjs-page {
    position: relative;
    width: 100%;
    padding: 0.45rem;
    border: 1px solid color-mix(in srgb, var(--color-border-subtle) 82%, transparent);
    border-radius: 0.95rem;
    background: color-mix(in srgb, var(--color-surface, #101729) 92%, black 8%);
    box-shadow: 0 16px 32px rgba(8, 17, 32, 0.28);
}

.chat-test-viewer__pdfjs-page-badge {
    position: sticky;
    top: 0;
    z-index: 1;
    width: fit-content;
    margin: 0 0 0.45rem auto;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-surface, #101729) 82%, rgba(8, 17, 32, 0.3));
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
    backdrop-filter: blur(10px) saturate(1.04);
    -webkit-backdrop-filter: blur(10px) saturate(1.04);
}

.chat-test-viewer__pdfjs-canvas {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 0.7rem;
    background: #fff;
}

.chat-test-viewer__status {
    color: var(--color-text-muted);
    font-size: 0.92rem;
    line-height: 1.4;
    text-align: center;
    padding: 1.6rem;
}

.chat-test-viewer__status--error {
    color: color-mix(in srgb, #ffb4b4 88%, white 12%);
}

@media (max-width: 767px) {
    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-viewer {
        padding-top: calc(var(--app-header-safe-height, 4.25rem) + 0.55rem);
        padding-right: 0.75rem;
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px) + 0.35rem);
        padding-left: 0.75rem;
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-viewer__dialog {
        width: 100%;
        max-height: calc(100dvh - var(--app-header-safe-height, 4.25rem) - 1.3rem - env(safe-area-inset-bottom, 0px));
        border-radius: 1.1rem;
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-viewer__body {
        padding: 0.75rem;
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-viewer__body--pdfjs {
        padding: 0.7rem;
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-viewer__pdfjs {
        width: 100%;
        gap: 0.75rem;
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-viewer__pdfjs-page {
        padding: 0.35rem;
        border-radius: 0.85rem;
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-viewer__pdfjs-page-badge {
        margin-bottom: 0.35rem;
        font-size: 0.68rem;
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-viewer__image,
    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-viewer__video {
        max-height: calc(100dvh - var(--app-header-safe-height, 4.25rem) - 8rem - env(safe-area-inset-bottom, 0px));
    }

    .edq-panel-shell[data-edq-panel-shell="chat-room"] .chat-test-viewer__document-shell {
        width: 100%;
        height: calc(100dvh - var(--app-header-safe-height, 4.25rem) - 8rem - env(safe-area-inset-bottom, 0px));
        border-radius: 0.85rem;
    }
}

