/* ---------------------------------------------------------------------------------------------------------------------------------------------------
   01. 変数・ページ基本設定
--------------------------------------------------------------------------------------------------------------------------------------------------- */

:root{
    --custom-talk-room-header-height: 4.25rem;
    --custom-talk-room-footer-height: 4.5rem;
    --custom-talk-room-app-height: 100dvh;
    --custom-talk-room-viewport-top: 0px;
    --custom-talk-room-keyboard-offset: 0px;
    --custom-talk-room-bg: #BFE3F3;
    --custom-talk-room-my-bubble: #A0E060;
    --custom-talk-room-other-bubble: var(--custom-white);
    --custom-talk-room-text: var(--custom-text-color);
    --custom-talk-room-subtext: var(--custom-gray-dark);
}

body.custom-talk-room-page-active {
    overflow: hidden;
    overscroll-behavior: none;
}

@media (display-mode: standalone) {
    :root{
        --custom-talk-room-footer-height: 6rem;
    }
}

.custom-talk-room-fixed-main {
    position: fixed;
    top: var(--custom-talk-room-viewport-top);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--custom-page-max-width);
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
    height: var(--custom-talk-room-app-height);
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--custom-talk-room-bg);
}

.custom-talk-room-page {
    position: relative;
    top: var(--custom-talk-room-viewport-top);
    width: 100%;
    max-width: var(--custom-page-max-width);
    height: var(--custom-talk-room-app-height);
    min-height: var(--custom-talk-room-app-height);
    margin: 0 auto;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: 'Noto Sans JP', sans-serif;
    background: var(--custom-talk-room-bg);
    font-weight: 500;
}

.custom-talk-room-page,
.custom-talk-room-page * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.custom-talk-room-page-content {
    flex: 1;
    min-height: 0;
    width: 100%;
    margin: 0 auto;
}

/* ---------------------------------------------------------------------------------------------------------------------------------------------------
   02. ヘッダー
--------------------------------------------------------------------------------------------------------------------------------------------------- */

.custom-talk-room-fixed-header {
    position: fixed;
    top: var(--custom-talk-room-viewport-top);
    left: 50%;
    transform: translateX(-50%);
    max-width: var(--custom-page-max-width);
    width: 100%;
    height: var(--custom-talk-room-header-height);
    background: rgba(255, 255, 255, 0.5);
    z-index: 1000;
    box-sizing: border-box;
    padding-inline: 1rem;
}

.custom-talk-room-fixed-header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.custom-talk-room-back-btn {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    position: relative;
    border-radius: 999px;
    text-decoration: none;
}

.custom-talk-room-back-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.8rem;
    height: 0.8rem;
    border-left: 2px solid var(--custom-text-color);
    border-bottom: 2px solid var(--custom-text-color);
    transform: translate(-35%, -50%) rotate(45deg);
}

.custom-talk-room-back-unread-badge {
    position: absolute;
    top: 50%;
    left: 2.15rem;
    transform: translateY(-50%);
    min-width: auto;
    height: auto;
    padding: 0;
    background: transparent;
    color: var(--custom-text-color);
    font-size: 1rem;
    line-height: 1;
    text-align: left;
    white-space: nowrap;
    z-index: 2;
}

.custom-talk-room-back-unread-badge[hidden] {
    display: none !important;
}

.custom-talk-room-header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.custom-talk-room-header-user-info {
    min-width: 0;
}

.custom-talk-room-header-user-name {
    display: block;
    min-width: 0;
    font-size: 1rem;
    color: var(--custom-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-talk-room-header-point {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 9.5rem;
    min-height: 2rem;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    background: transparent;
    color: var(--custom-text-color);
    box-sizing: border-box;
    cursor: pointer;
}

.custom-talk-room-header-point.is-trial {
    border: solid 1px var(--custom-purple);
}

.custom-talk-room-header-point.is-paid {
    border: solid 1px var(--custom-green-vivid);
}

.custom-talk-room-header-point-label,
.custom-talk-room-header-point-value {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1;
}

.custom-talk-room-header-point-label {
    font-size: 0.75rem;
}

.custom-talk-room-header-point-value {
    font-size: 0.875rem;
}

.custom-talk-room-point-guide {
    width: 100%;
    padding-inline: 1.25rem;
}

.custom-talk-room-point-guide table {
    width: 100%;
    margin-top: 0.85rem;
    border-collapse: collapse;
    border: 1px solid var(--custom-gray-light);
    border-radius: 0.75rem;
    overflow: hidden;
}

.custom-talk-room-point-guide th,
.custom-talk-room-point-guide td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--custom-gray-light);
    font-size: 0.875rem;
}

.custom-talk-room-point-guide tr:last-child th,
.custom-talk-room-point-guide tr:last-child td {
    border-bottom: none;
}

.custom-talk-room-point-guide th {
    color: var(--custom-text-color);
    font-weight: 500;
    background: rgba(147, 1, 255, 0.08);
}

.custom-talk-room-point-guide td {
    color: var(--custom-purple);
    font-weight: 800;
    text-align: right;
}

/* ---------------------------------------------------------------------------------------------------------------------------------------------------
   03. メッセージ一覧・行レイアウト
--------------------------------------------------------------------------------------------------------------------------------------------------- */

.custom-talk-room-messages {
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    overscroll-behavior-x: none;
    touch-action: pan-y;
    padding-inline: 1.25rem;
    padding-top: calc(var(--custom-talk-room-header-height) + 0.5rem);
    padding-bottom: 1.25rem;
    box-sizing: border-box;
    transform: translateY(var(--custom-talk-room-overdrag-offset, 0px));
    transition: transform 0.18s ease-out;
}

.custom-talk-room-messages.is-overdragging-top {
    transform-origin: top center;
    transition: none;
}

.custom-talk-room-messages.is-overdragging-bottom {
    transform-origin: bottom center;
    transition: none;
}

.custom-talk-room-date-separator {
    display: flex;
    justify-content: center;
    margin: 0.75rem 0 1rem;
}

.custom-talk-room-date-separator span {
    background: rgba(0, 0, 0, 0.18);
    color: var(--custom-white);
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
}

.custom-talk-room-message-row {
    display: flex;
    align-items: flex-start;
    margin-top: 0.625rem;
    gap: 0.5rem;
}

.custom-talk-room-message-row.is-mine {
    justify-content: flex-end;
}

.custom-talk-room-message-row.is-partner {
    justify-content: flex-start;
}

.custom-talk-room-message-avatar {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    border-radius: 50%;
    overflow: hidden;
    background: transparent;
    flex-shrink: 0;
}

.custom-talk-room-message-avatar a {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

.custom-talk-room-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.custom-talk-room-message-body {
    max-width: min(78%, 32rem);
}

.custom-talk-room-message-bubble-row {
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
}

.custom-talk-room-message-row.is-mine .custom-talk-room-message-bubble-row {
    justify-content: flex-end;
}

/* ---------------------------------------------------------------------------------------------------------------------------------------------------
   04. メッセージ吹き出し・メディア・ファイル
--------------------------------------------------------------------------------------------------------------------------------------------------- */

.custom-talk-room-bubble {
    position: relative;
    display: inline-block;
    max-width: 100%;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--custom-talk-room-text);
    word-break: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

/* 相手の吹き出し */
.custom-talk-room-bubble.is-text.is-partner,
.custom-talk-room-bubble.is-file.is-partner {
    background: var(--custom-talk-room-other-bubble);
    border-radius: 0.25rem 1rem 1rem 1rem;
    padding: 0.75rem 0.875rem;
}

.custom-talk-room-bubble.is-text.is-partner::before,
.custom-talk-room-bubble.is-file.is-partner::before {
    content: "";
    position: absolute;
    top: 0.1rem;
    left: -0.42rem;
    width: 0.75rem;
    height: 0.75rem;
    background: var(--custom-talk-room-other-bubble);
    clip-path: polygon(100% 0, 100% 100%, 0 20%);
}

/* 自分の吹き出し */
.custom-talk-room-bubble.is-text.is-mine,
.custom-talk-room-bubble.is-file.is-mine {
    background: var(--custom-talk-room-my-bubble);
    border-radius: 1rem 0.25rem 1rem 1rem;
    padding: 0.75rem 0.875rem;
}

.custom-talk-room-bubble.is-text.is-mine::before,
.custom-talk-room-bubble.is-file.is-mine::before {
    content: "";
    position: absolute;
    top: 0.1rem;
    right: -0.42rem;
    width: 0.75rem;
    height: 0.75rem;
    background: var(--custom-talk-room-my-bubble);
    clip-path: polygon(0 0, 100% 20%, 0 100%);
}

/* 画像メッセージ */
.custom-talk-room-bubble.is-image {
    position: relative;
    border-radius: 1rem;
    overflow: visible;
    background: transparent;
    max-width: 14rem;
    -webkit-touch-callout: none;
}

.custom-talk-room-bubble.is-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 1rem;
    pointer-events: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;    
}

.custom-talk-room-bubble.is-image.is-partner::before {
    content: "";
    position: absolute;
    top: 0.1rem;
    left: -0.35rem;
    width: 0.7rem;
    height: 0.7rem;
    background: var(--custom-talk-room-other-bubble);
    clip-path: polygon(100% 0, 100% 100%, 0 20%);
    z-index: 1;
}

.custom-talk-room-bubble.is-image.is-mine::before {
    content: "";
    position: absolute;
    top: 0.1rem;
    right: -0.35rem;
    width: 0.7rem;
    height: 0.7rem;
    background: var(--custom-talk-room-my-bubble);
    clip-path: polygon(0 0, 100% 20%, 0 100%);
    z-index: 1;
}

/* 動画メッセージ */
.custom-talk-room-bubble.is-video {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    background: transparent;
    max-width: 14rem;
    cursor: pointer;
    -webkit-touch-callout: none;
}

.custom-talk-room-bubble.is-video img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 1rem;
    background: var(--custom-black);
    pointer-events: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

.custom-talk-room-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.custom-talk-room-video-play-icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-top: 0.45rem solid transparent;
    border-bottom: 0.45rem solid transparent;
    border-left: 0.72rem solid rgba(255, 255, 255, 0.96);
    transform: translate(-32%, -50%);
}

.custom-talk-room-bubble.is-video.is-partner::before {
    content: "";
    position: absolute;
    top: 0.1rem;
    left: -0.35rem;
    width: 0.7rem;
    height: 0.7rem;
    background: var(--custom-talk-room-other-bubble);
    clip-path: polygon(100% 0, 100% 100%, 0 20%);
    z-index: 1;
}

.custom-talk-room-bubble.is-video.is-mine::before {
    content: "";
    position: absolute;
    top: 0.1rem;
    right: -0.35rem;
    width: 0.7rem;
    height: 0.7rem;
    background: var(--custom-talk-room-my-bubble);
    clip-path: polygon(0 0, 100% 20%, 0 100%);
    z-index: 1;
}

.custom-talk-room-bubble.is-image.is-partner::before,
.custom-talk-room-bubble.is-image.is-mine::before,
.custom-talk-room-bubble.is-video.is-partner::before,
.custom-talk-room-bubble.is-video.is-mine::before {
    content: none;
}

.custom-talk-room-file-link {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: manipulation;
}

.custom-talk-room-file-link *,
.custom-talk-room-file-link img {
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

.custom-talk-room-file-icon {
    width: 2.75rem;
    min-width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.5rem;
    background: var(--custom-bg-gray);
    border: 1px solid var(--custom-gray-dark);    
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    box-shadow: none;
}

.custom-talk-room-file-icon img {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
    display: block;
}

.custom-talk-room-file-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.custom-talk-room-file-name {
    display: block;
    font-size: 0.875rem;
    line-height: 1.35;
    color: var(--custom-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-talk-room-file-expired-label {
    display: block;
    font-size: 0.75rem;
    color: var(--custom-danger-color);
}

.custom-talk-room-file-expired-label.is-active {
    color: var(--custom-text-color);
}

.custom-talk-room-message-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.125rem;
    flex-shrink: 0;
}

.custom-talk-room-message-status {
    font-size: 0.75rem;
    color: var(--custom-talk-room-subtext);
    white-space: nowrap;
    line-height: 1;
}

.custom-talk-room-message-time {
    font-size: 0.75rem;
    color: var(--custom-talk-room-subtext);
    white-space: nowrap;
    line-height: 1;
    padding-bottom: 0.125rem;
}

.custom-talk-room-message-row.is-partner .custom-talk-room-message-meta {
    align-items: flex-start;
}

.custom-talk-room-message-trial-label {
    color: var(--custom-talk-room-subtext);
    font-size: 0.6875rem;
    line-height: 1;
    white-space: nowrap;
}

.custom-talk-room-message-text {
    display: block;
}

.custom-talk-room-empty {
    text-align: center;
    color: var(--custom-text-color);
    font-size: 1rem;
    padding: 4rem 1rem;
}

/* ---------------------------------------------------------------------------------------------------------------------------------------------------
   05. フッター・入力欄・追加メニュー
--------------------------------------------------------------------------------------------------------------------------------------------------- */

.custom-talk-room-fixed-footer {
    position: fixed;
    left: 50%;
    bottom: var(--custom-talk-room-keyboard-offset);
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--custom-page-max-width);
    min-height: var(--custom-talk-room-footer-height);
    background: var(--custom-white);
    z-index: 1000;
    box-sizing: border-box;
    padding: 0.625rem 0.875rem;
    padding-bottom: 2rem;
}

.custom-talk-room-composer {
    display: flex;
    align-items: flex-end;
    gap: 0.625rem;
    width: 100%;
}

.custom-talk-room-composer-plus {
    border: none;
    border-radius: 999px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    font-size: 0;
    background: var(--custom-gray-light);
    color: var(--custom-gray-dark);
    flex-shrink: 0;
    align-self: flex-end;
    position: relative;
}

.custom-talk-room-composer-plus::before,
.custom-talk-room-composer-plus::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transition: transform 0.18s ease;
}

.custom-talk-room-composer-plus::before {
    transform: translate(-50%, -50%);
}

.custom-talk-room-composer-plus::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.custom-talk-room-composer-plus.is-open::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.custom-talk-room-composer-plus.is-open::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.custom-talk-room-composer-send {
    border: none;
    border-radius: 999px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: transparent;
    color: inherit;
    flex-shrink: 0;
    align-self: flex-end;
}

.custom-talk-room-composer-send img {
    width: 1.9rem;
    height: 1.9rem;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.custom-talk-room-composer-input {
    flex: 1;
    min-height: 2.5rem;
    max-height: 7.5rem;
    display: block;
    padding: 0.7rem 1rem;
    border: none;
    outline: none;
    border-radius: 20px;
    background: var(--custom-bg-gray);
    color: var(--custom-text-color);
    font-size: 0.875rem;
    line-height: 1.4;
    box-sizing: border-box;
    resize: none;
    overflow-y: auto;
    font-family: inherit;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.custom-talk-room-composer-input::placeholder {
    color: var(--custom-gray-dark);
}


.custom-talk-room-page.is-monitor-mode .custom-talk-room-composer-plus,
.custom-talk-room-page.is-monitor-mode .custom-talk-room-composer-send,
.custom-talk-room-page.is-monitor-mode .custom-talk-room-composer-menu-item,
.custom-talk-room-page.is-monitor-mode .custom-talk-room-composer-input:disabled {
    cursor: not-allowed;
}

.custom-talk-room-composer-send.is-active {
    background: transparent;
}

.custom-talk-room-composer-menu {
    margin-top: 0.875rem;
    background: var(--custom-white);
    border-radius: 0.85rem;
    overflow: hidden;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.custom-talk-room-composer-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.custom-talk-room-composer-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    width: 100%;
    min-height: 5.2rem;
    border: none;
    border-right: 1px solid var(--custom-gray-light);
    border-bottom: 1px solid var(--custom-gray-light);
    background: var(--custom-white);
    color: var(--custom-text-color);
    font-size: 0.875rem;
    font-family: inherit;
    padding: 0.75rem 0.35rem 0.7rem;
    text-align: center;
    position: relative;
    transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.custom-talk-room-composer-menu-item:nth-child(3n) {
    border-right: none;
}

.custom-talk-room-composer-menu-item:nth-last-child(-n+3) {
    border-bottom: none;
}

.custom-talk-room-composer-menu-item:active {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(0.98);
}

.custom-talk-room-composer-menu-item-icon {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 0;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.custom-talk-room-composer-menu-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.custom-talk-room-composer-menu-item-label {
    min-height: auto;
    font-size: 0.75rem;
    text-align: center;
    white-space: nowrap;
}

.custom-talk-room-composer-menu-item.is-empty {
    opacity: 1;
}

.custom-talk-room-composer-menu-item.is-empty .custom-talk-room-composer-menu-item-icon {
    width: 1.8rem;
    height: 1.8rem;
    background: transparent;
    border: none;
}

.custom-talk-room-composer-menu-item.is-empty .custom-talk-room-composer-menu-item-label {
    visibility: hidden;
}

/* ---------------------------------------------------------------------------------------------------------------------------------------------------
   06. 長押しメニュー・リアクションピッカー
--------------------------------------------------------------------------------------------------------------------------------------------------- */

.custom-talk-room-message-row.is-context-target .custom-talk-room-bubble {
    transform: scale(0.98);
    opacity: 0.9;
}

.custom-talk-room-context-overlay[hidden],
.custom-talk-room-reaction-picker[hidden],
.custom-talk-room-context-menu[hidden],
.custom-talk-room-media-viewer[hidden],
.custom-talk-room-partial-copy-overlay[hidden],
.custom-talk-room-composer-menu[hidden],
.custom-talk-room-reply-draft[hidden] {
    display: none !important;
}

body.custom-talk-room-modal-open {
    overflow: hidden;
}

.custom-talk-room-reaction-picker {
    position: fixed;
    display: grid;
    grid-template-columns: repeat(6, 2.35rem);
    gap: 0.35rem;
    padding: 0.45rem 0.55rem;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 1.25rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1202;
}

.custom-talk-room-reaction-option {
    width: 2.35rem;
    min-width: 2.35rem;
    height: 2.35rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0;
    transition: transform 0.16s ease, background 0.16s ease;
}

.custom-talk-room-reaction-option:active {
    transform: scale(0.92);
    background: rgba(83, 83, 83, 0.06);
}

.custom-talk-room-context-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.custom-talk-room-context-menu {
    position: fixed;
    width: min(88vw, 20rem);
    background: var(--custom-purple);
    border-radius: 0.85rem;
    overflow: hidden;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1201;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.custom-talk-room-context-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    width: 100%;
    min-height: 4.5rem;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    background: transparent;
    color: var(--custom-white);
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 500;
    padding: 0.65rem 0.35rem 0.6rem;
    text-align: center;
    position: relative;
    transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.custom-talk-room-context-action[hidden] {
    display: none !important;
}

.custom-talk-room-context-action-icon {
    width: 1.35rem;
    height: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-talk-room-context-action-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.custom-talk-room-context-action-label {
    font-size: 0.75rem;
    white-space: nowrap;
}

.custom-talk-room-context-action:active {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(0.98);
}

/* ---------------------------------------------------------------------------------------------------------------------------------------------------
   07. メディアビューアー・グリッド表示
--------------------------------------------------------------------------------------------------------------------------------------------------- */

.custom-talk-room-media-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    z-index: 1400;
}

.custom-talk-room-media-viewer,
.custom-talk-room-media-viewer * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.custom-talk-room-media-viewer-inner {
    position: relative;
    width: 100%;
    max-width: var(--custom-page-max-width);
    height: 100dvh;
    margin: 0 auto;
}

.custom-talk-room-media-viewer-backdrop {
    position: absolute;
    inset: 0;
}

.custom-talk-room-media-viewer-header-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 4;
}

.custom-talk-room-media-viewer-grid,
.custom-talk-room-media-viewer-download,
.custom-talk-room-media-viewer-close {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.custom-talk-room-media-viewer-grid[hidden],
.custom-talk-room-media-viewer-download[hidden],
.custom-talk-room-media-viewer-close[hidden] {
    display: none !important;
}

.custom-talk-room-media-viewer-grid img,
.custom-talk-room-media-viewer-download img {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
    display: block;
}

.custom-talk-room-media-viewer-close {
    color: var(--custom-white);
    font-size: 1.5rem;
    line-height: 1;
}

.custom-talk-room-media-viewer-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    touch-action: none;
    overflow: hidden;
}

.custom-talk-room-media-viewer-stage.is-zoomed {
    cursor: grab;
}

.custom-talk-room-media-zoom {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.custom-talk-room-media-zoom-target,
.custom-talk-room-media-viewer-stage .plyr__video-wrapper {
    transform-origin: center center;
    will-change: transform;
}

.custom-talk-room-media-viewer-stage img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.custom-talk-room-media-viewer-stage video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;    
    background: var(--custom-black);
}

.custom-talk-room-media-viewer-stage .plyr {
    --plyr-color-main: var(--custom-purple);
    --plyr-video-background: var(--custom-black);
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    overflow: hidden;
    background: var(--custom-black);
}

.custom-talk-room-media-viewer-stage .plyr__video-wrapper {
    width: 100%;
    height: 100%;
    background: var(--custom-black);
}

.custom-talk-room-media-viewer-stage .plyr__poster {
    background-size: contain;
}

.custom-talk-room-media-viewer-stage .plyr video,
.custom-talk-room-media-viewer-stage .custom-talk-room-plyr-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--custom-black);
}

.custom-talk-room-media-viewer-stage .plyr__controls {
    padding: 3rem 1rem 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.74));
    touch-action: manipulation;
}

.custom-talk-room-media-viewer-stage .plyr__control,
.custom-talk-room-media-viewer-stage .plyr input[type="range"] {
    touch-action: manipulation;
}

.custom-talk-room-media-viewer-stage .plyr__control--overlaid {
    background: var(--custom-purple);
}

.custom-talk-room-media-viewer-stage .plyr__control--overlaid:hover {
    background: var(--custom-purple);
}

.custom-talk-room-media-grid-view[hidden] {
    display: none !important;
}

.custom-talk-room-media-grid-view {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: rgba(0, 0, 0, 0.92);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.custom-talk-room-media-grid-view-inner {
    width: 100%;
    max-width: var(--custom-page-max-width);
    min-height: 100%;
    margin: 0 auto;
    padding: 5rem 1rem 1.5rem;
    box-sizing: border-box;
}

.custom-talk-room-media-grid-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.custom-talk-room-media-grid-item {
    position: relative;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 0.75rem;
    overflow: hidden;
}

.custom-talk-room-media-grid-item.is-active {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.custom-talk-room-media-grid-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.custom-talk-room-media-grid-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.custom-talk-room-media-grid-item.is-video .custom-talk-room-media-grid-thumb::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-top: 0.45rem solid transparent;
    border-bottom: 0.45rem solid transparent;
    border-left: 0.7rem solid rgba(255, 255, 255, 0.95);
    transform: translate(-35%, -50%);
    pointer-events: none;
}

.custom-talk-room-media-grid-video-thumb {
    width: 100%;
    height: 100%;
    background: var(--custom-black);
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-talk-room-media-grid-video-thumb.is-loading::before {
    content: "";
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: custom-talk-room-media-grid-spin 0.8s linear infinite;
}

.custom-talk-room-media-grid-video-fallback {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

@keyframes custom-talk-room-media-grid-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.custom-talk-room-media-wipe-track {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--custom-black);
    pointer-events: none;
}

.custom-talk-room-media-wipe-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--custom-black);
    transition: transform 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}


/* ---------------------------------------------------------------------------------------------------------------------------------------------------
   08. 部分コピー表示
--------------------------------------------------------------------------------------------------------------------------------------------------- */

.custom-talk-room-partial-copy-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1300;
}

.custom-talk-room-partial-copy-stage {
    width: 100%;
    max-width: var(--custom-page-max-width);
    height: 100dvh;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.custom-talk-room-partial-copy-message-wrap {
    width: 100%;
    padding-inline: 1.25rem;
    box-sizing: border-box;
    pointer-events: none;
}

.custom-talk-room-partial-copy-message-wrap .custom-talk-room-message-row {
    margin-top: 0;
    pointer-events: auto;
}

.custom-talk-room-partial-copy-message-wrap .custom-talk-room-message-avatar,
.custom-talk-room-partial-copy-message-wrap .custom-talk-room-reply-preview {
    display: none !important;
}

.custom-talk-room-partial-copy-message-wrap .custom-talk-room-message-body,
.custom-talk-room-partial-copy-message-wrap .custom-talk-room-bubble,
.custom-talk-room-partial-copy-message-wrap .custom-talk-room-message-meta {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.custom-talk-room-partial-copy-message-wrap .custom-talk-room-message-text {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    -webkit-touch-callout: default;
    cursor: text;
}

/* ---------------------------------------------------------------------------------------------------------------------------------------------------
   09. リプライ下書き・リプライプレビュー
--------------------------------------------------------------------------------------------------------------------------------------------------- */

.custom-talk-room-reply-draft {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.625rem;
}

.custom-talk-room-reply-draft-avatar {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.custom-talk-room-reply-draft-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.custom-talk-room-reply-draft-main {
    min-width: 0;
    flex: 1;
}

.custom-talk-room-reply-draft-sender {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--custom-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-talk-room-reply-draft-text {
    font-size: 0.75rem;
    color: var(--custom-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-talk-room-reply-draft-preview {
    width: 2.4rem;
    min-width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.5rem;
    overflow: hidden;
    flex-shrink: 0;
}

.custom-talk-room-reply-draft-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.custom-talk-room-reply-draft-preview.is-file-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--custom-bg-gray);
    border: 1px solid var(--custom-gray-dark);    
}

.custom-talk-room-reply-draft-preview.is-file-preview img {
    width: 1.2rem;
    height: 1.2rem;
    object-fit: contain;
}

.custom-talk-room-reply-draft-cancel {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 999px;
    background: var(--custom-gray-light);
    color: var(--custom-gray-dark);
    font-size: 1rem;
    flex-shrink: 0;
}

.custom-talk-room-reply-preview {
    margin-bottom: 0.5rem;
    box-sizing: border-box;
    cursor: pointer;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.custom-talk-room-reply-preview:active {
    opacity: 0.75;
}

.custom-talk-room-reply-preview-avatar {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.custom-talk-room-reply-preview-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.custom-talk-room-reply-preview-content {
    min-width: 0;
    flex: 1;
}

.custom-talk-room-reply-preview-sender {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--custom-text-color);
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-talk-room-reply-preview-text {
    font-size: 0.75rem;
    color: var(--custom-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------------------------------------------------------------------------------------------------------------------------------------------------
   10. メッセージリアクション
--------------------------------------------------------------------------------------------------------------------------------------------------- */

.custom-talk-room-message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.custom-talk-room-message-row.is-mine .custom-talk-room-message-reactions {
    justify-content: flex-end;
}

.custom-talk-room-message-row.is-partner .custom-talk-room-message-reactions {
    justify-content: flex-start;
}

.custom-talk-room-message-reaction {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    min-height: 1.7rem;
    padding: 0.12rem 0.45rem 0.12rem 0.35rem;
    border-radius: 999px;
    background: var(--custom-white);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.custom-talk-room-message-reaction.is-reacted {
    border: 1px solid rgba(6, 199, 85, 0.35);
    background: rgba(6, 199, 85, 0.12);
}

.custom-talk-room-message-reaction-emoji {
    font-size: 0.875rem;
    line-height: 1;
}

.custom-talk-room-message-reaction-count {
    font-size: 0.75rem;
    line-height: 1;
    color: var(--custom-text-color);
}

.custom-talk-room-message-row.is-reply-target .custom-talk-room-bubble {
    box-shadow: 0 0 0 0.2rem rgba(6, 199, 85, 0.18);
}

/* ---------------------------------------------------------------------------------------------------------------------------------------------------
   11. 送信取り消し・送信中・再送UI
--------------------------------------------------------------------------------------------------------------------------------------------------- */

.custom-talk-room-unsent-row {
    display: flex;
    justify-content: center;
    margin: 0.75rem 0;
}

.custom-talk-room-unsent-row span {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--custom-gray-dark);
    background: rgba(255, 255, 255, 0.78);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    text-align: center;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.custom-talk-room-message-row.is-client-pending .custom-talk-room-bubble {
    position: relative;
}

.custom-talk-room-message-row.is-client-pending.is-failed .custom-talk-room-bubble {
    box-shadow: 0 0 0 1px rgba(211, 47, 47, 0.2);
}

.custom-talk-room-bubble.is-pending {
    overflow: hidden;
}

.custom-talk-room-upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(83, 83, 83, 0.42);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.75rem;
    box-sizing: border-box;
    z-index: 2;
}

.custom-talk-room-upload-overlay.is-failed {
    background: rgba(211, 47, 47, 0.45);
}

.custom-talk-room-upload-overlay-text {
    color: var(--custom-white);
    font-size: 0.75rem;
    line-height: 1.35;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.custom-talk-room-upload-spinner {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-top-color: rgba(255, 255, 255, 0.96);
    animation: custom-talk-room-upload-spin 0.8s linear infinite;
    flex-shrink: 0;
}

.custom-talk-room-upload-progress-bar {
    width: min(9rem, 78%);
    height: 0.3rem;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    overflow: hidden;
}

.custom-talk-room-upload-progress-bar-inner {
    display: block;
    height: 100%;
    width: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 999px;
    transition: width 0.12s linear;
}

.custom-talk-room-pending-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.38rem;
    font-size: 0.75rem;
    line-height: 1.3;
    color: var(--custom-text-color);
}

.custom-talk-room-pending-status.is-failed {
    color: var(--custom-danger-color);
}

.custom-talk-room-pending-status-text {
    display: inline-block;
}

.custom-talk-room-pending-retry {
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--custom-danger-color);
    font-size: 0.75rem;
    line-height: 1;
    padding: 0.38rem 0.75rem;
}

.custom-talk-room-pending-video-thumb {
    width: 100%;
    border-radius: 1rem;
    overflow: hidden;
}

.custom-talk-room-pending-video-thumb img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.custom-talk-room-pending-video-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.custom-talk-room-file-link.is-static {
    cursor: default;
}

@keyframes custom-talk-room-upload-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ---------------------------------------------------------------------------------------------------------------------------------------------------
   12. テキストリンク・OGPカード
--------------------------------------------------------------------------------------------------------------------------------------------------- */

.custom-talk-room-message-text a {
    color: var(--custom-purple);
    text-decoration: none;
    word-break: break-all;
}

.custom-talk-room-message-text a:active {
    opacity: 0.72;
}

.custom-talk-room-ogp-card {
    margin-top: 0.55rem;
    width: min(100%, 19rem);
    border-radius: 1rem;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, 0.1)
}

.custom-talk-room-message-row.is-mine .custom-talk-room-ogp-card {
    background: var(--custom-talk-room-my-bubble);
}

.custom-talk-room-message-row.is-partner .custom-talk-room-ogp-card {
    background: var(--custom-talk-room-other-bubble);
}

.custom-talk-room-ogp-card a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.custom-talk-room-ogp-thumb {
    width: 100%;
    aspect-ratio: 1.9 / 1;
    background: var(--custom-gray-light);
    overflow: hidden;
}

.custom-talk-room-ogp-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.custom-talk-room-ogp-body {
    padding: 0.8rem 0.9rem 0.85rem;
}

.custom-talk-room-ogp-title {
    font-size: 1rem;
    line-height: 1.125rem;
    font-weight: 700;
    color: var(--custom-text-color);
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}

.custom-talk-room-ogp-desc {
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--custom-text-color);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}

.custom-talk-room-ogp-host {
    display: none;
}

.custom-talk-room-bubble.is-text .custom-talk-room-ogp-card:active {
    opacity: 0.82;
}

/* ---------------------------------------------------------------------------------------------------------------------------------------------------
   13. 最下部スクロールボタン
--------------------------------------------------------------------------------------------------------------------------------------------------- */

.custom-talk-room-scroll-bottom-btn {
    position: fixed;
    bottom: 6.5rem; /* JS 適用前の初期値 */
    right: 1.25rem;
    width: 3.125rem;
    height: 3.125rem;
    padding: 0.25rem 0.25rem;
    border: none;
    border-radius: 9999px;
    background: var(--custom-gray-dark);
    color: var(--custom-white);
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1200;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

@media screen and (min-width: 800px) {
  .custom-talk-room-scroll-bottom-btn {
    right: calc((100vw - var(--custom-page-max-width)) / 2 + 1.25rem);
  }
}

.custom-talk-room-scroll-bottom-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ---------------------------------------------------------------------------------------------------------------------------------------------------
   14. ファイルビューアー・PDFビューアー
--------------------------------------------------------------------------------------------------------------------------------------------------- */

.custom-talk-room-file-viewer[hidden] {
    display: none !important;
}

.custom-talk-room-file-viewer {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--custom-white);
}

.custom-talk-room-file-viewer,
.custom-talk-room-file-viewer * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.custom-talk-room-file-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: var(--custom-white);
}

.custom-talk-room-file-viewer-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    background: var(--custom-white);
}

.custom-talk-room-file-viewer-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3.25rem;
    padding: calc(env(safe-area-inset-top, 0rem) + 0.5rem) 0.75rem 0.5rem;
    border-bottom: 0.0625rem solid rgba(0, 0, 0, 0.08);
    background: var(--custom-white);
}

.custom-talk-room-file-viewer-back,
.custom-talk-room-file-viewer-share {
    appearance: none;
    border: 0;
    border-radius: 62.4375rem;
    padding: 0.5rem 0.75rem;
    background: var(--custom-gray-dark);
    color: var(--custom-white);
    font-size: 0.875rem;
    white-space: nowrap;
}

.custom-talk-room-file-viewer-share {
    background: var(--custom-purple);
}

.custom-talk-room-file-viewer-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 700;
    color: var(--custom-text-color);
    text-align: center;
}

.custom-talk-room-file-viewer-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.custom-talk-room-file-viewer-stage {
    flex: 1;
    min-height: 0;
    position: relative;
    background: var(--custom-bg-gray);
}

.custom-talk-room-file-viewer-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--custom-white);
}

.custom-talk-room-file-viewer-unavailable {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.875rem;
    min-height: 100%;
    padding: 2rem 1.25rem calc(env(safe-area-inset-bottom, 0rem) + 2rem);
    text-align: center;
    color: var(--custom-text-color);
}

.custom-talk-room-file-viewer-unavailable-title {
    font-size: 1rem;
    font-weight: 700;
}

.custom-talk-room-file-viewer-unavailable-name {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--custom-text-color);
    font-size: 0.875rem;
}

.custom-talk-room-file-viewer-unavailable-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.625rem;
}

.custom-talk-room-pdf-viewer {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-sizing: border-box;
    padding: 0.875rem 0.5rem calc(env(safe-area-inset-bottom, 0rem) + 1.5rem);
    background: var(--custom-bg-gray);
}

.custom-talk-room-pdf-viewer-status {
    position: sticky;
    top: 0.5rem;
    z-index: 2;
    width: fit-content;
    max-width: calc(100% - 1.5rem);
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5625rem 0.75rem;
    border-radius: 62.4375rem;
    background: rgba(83, 83, 83, 0.82);
    color: var(--custom-white);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 0.5rem 1.125rem rgba(0, 0, 0, 0.18);
}

.custom-talk-room-pdf-viewer-spinner {
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    border: 0.125rem solid rgba(255, 255, 255, 0.32);
    border-top-color: rgba(255, 255, 255, 0.95);
    animation: custom-talk-room-pdf-viewer-spin 0.8s linear infinite;
    flex-shrink: 0;
}

.custom-talk-room-pdf-viewer-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    box-sizing: border-box;
}

.custom-talk-room-pdf-viewer-page {
    position: relative;
    max-width: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--custom-white);
    box-shadow: 0 0.5rem 1.375rem rgba(83, 83, 83, 0.16);
}

.custom-talk-room-pdf-viewer-page canvas {
    display: block;
    max-width: 100%;
    height: auto !important;
    background: var(--custom-white);
}

.custom-talk-room-pdf-viewer-page-label {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 1;
    padding: 0.25rem 0.4375rem;
    border-radius: 62.4375rem;
    background: rgba(83, 83, 83, 0.58);
    color: var(--custom-white);
    font-size: 0.75rem;
    line-height: 1;
    pointer-events: none;
}

.custom-talk-room-file-viewer-unavailable-note {
    max-width: 22rem;
    color: var(--custom-gray-dark);
    font-size: 0.875rem;
    line-height: 1.6;
}

@keyframes custom-talk-room-pdf-viewer-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.custom-talk-room-back-btn,
.custom-talk-room-context-action,
.custom-talk-room-reaction-option,
.custom-talk-room-scroll-bottom-btn,
.custom-talk-room-composer-plus,
.custom-talk-room-composer-send,
.custom-talk-room-reply-draft-cancel {
    touch-action: manipulation;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
