/* ============================================================
   chat.css — QRChat Chat Interface
   Dark futuristic theme, neon cyan accents, glassmorphism
   ============================================================ */

/* ── Loading overlay ── */
.chat-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: 100svh;
    height: 100vh;
    height: 100dvh;
    height: 100svh;
    overflow: hidden;
}

body.chat-page {
    overflow: hidden;
}

.chat-page .landing-shell {
    width: min(1180px, calc(100% - 24px));
    padding-top: 10px;
    padding-bottom: 14px;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: 100svh;
    height: 100vh;
    height: 100dvh;
    height: 100svh;
    overflow: hidden;
}

.chat-page .landing-header {
    gap: 12px;
    padding: 4px 0 10px;
    flex-shrink: 0;
}

.landing-brand--chat {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.landing-brand--chat .landing-brand__logo {
    width: min(164px, 34vw);
}

.chat-page-main {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.chat-page-main--centered {
    max-width: 760px;
    align-content: stretch;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.chat-page-main--centered .chat-panel {
    height: auto;
    min-height: 100%;
    overflow: visible;
}

.chat-page-header__actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-inline-start: auto;
}

.settings-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.settings-nav a {
    color: rgba(223, 252, 255, 0.82);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 200ms ease;
}

.settings-nav a:hover {
    color: var(--landing-accent);
}

.chat-panel {
    position: relative;
    overflow: hidden;
}

.chat-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    height: 100%;
    background: linear-gradient(180deg, rgba(10, 24, 43, 0.84), rgba(4, 12, 24, 0.82));
}

.chat-panel__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(123, 255, 236, 0.14);
    background: rgba(7, 17, 31, 0.72);
    backdrop-filter: blur(16px);
    flex-shrink: 0;
}

.chat-panel__toolbar--paused {
    background: rgba(42, 48, 60, 0.92);
}

.chat-panel__toolbar-link,
.chat-panel__toolbar-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(123, 255, 236, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: #dffcff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.chat-panel__toolbar-link:hover,
.chat-panel__toolbar-button:hover {
    border-color: rgba(123, 255, 236, 0.34);
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.12);
    transform: translateY(-1px);
}

.chat-panel__toolbar-main {
    display: grid;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.chat-panel__toolbar-main strong {
    color: #f4ffff;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-panel__toolbar-main span {
    color: rgba(223, 252, 255, 0.56);
    font-size: 0.83rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-intro {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(123, 255, 236, 0.18);
    background: linear-gradient(180deg, rgba(10, 23, 44, 0.92) 0%, rgba(8, 18, 34, 0.88) 100%);
    color: rgba(223, 252, 255, 0.84);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.chat-intro p {
    margin: 0;
    line-height: 1.6;
}

.chat-intro__media {
    margin-bottom: 12px;
}

.chat-intro__media img {
    display: block;
    max-width: 100%;
    max-height: 260px;
    border-radius: 12px;
}

.chat-intro__file {
    margin-bottom: 12px;
}

.chat-intro__file a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #00f0ff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 200ms ease;
}

.chat-intro__file a:hover {
    opacity: 0.7;
}

.chat-intro__file-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.chat-intro__file-size {
    color: rgba(223, 252, 255, 0.52);
    font-size: 0.8rem;
}

.wrapper-shotlink {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 40%, rgba(0, 240, 255, 0.1), transparent 30%),
        linear-gradient(180deg, rgba(3, 7, 18, 0.96) 0%, rgba(2, 7, 16, 0.98) 100%);
    visibility: hidden;
    z-index: 100;
}
.wrapper-shotlink.active { visibility: visible; }

.chat-loader {
    display: grid;
    justify-items: center;
    gap: 22px;
    padding: 32px 24px;
}

.chat-loader__core {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-loader__ring,
.chat-loader__pulse {
    position: absolute;
    border-radius: 50%;
}

.chat-loader__ring--outer {
    inset: 0;
    border: 2px solid rgba(0, 240, 255, 0.16);
    border-top-color: rgba(0, 240, 255, 0.95);
    border-right-color: rgba(78, 204, 163, 0.72);
    box-shadow: 0 0 26px rgba(0, 240, 255, 0.16);
    animation: chat-loader-spin 1.4s linear infinite;
}

.chat-loader__ring--middle {
    inset: 18px;
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-bottom-color: rgba(121, 255, 225, 0.88);
    border-left-color: rgba(0, 240, 255, 0.38);
    animation: chat-loader-spin-reverse 1.8s linear infinite;
}

.chat-loader__ring--inner {
    inset: 38px;
    border: 2px solid rgba(78, 204, 163, 0.2);
    border-top-color: rgba(78, 204, 163, 0.95);
    animation: chat-loader-spin 1s linear infinite;
}

.chat-loader__pulse {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle, #f4ffff 0%, #79ffe1 38%, #00f0ff 100%);
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.55);
    animation: chat-loader-pulse 1.6s ease-in-out infinite;
}

.chat-loader__text {
    font-family: "Orbitron", sans-serif;
    font-size: clamp(0.88rem, 2vw, 1.1rem);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(223, 252, 255, 0.94);
    text-align: center;
    text-shadow: 0 0 18px rgba(0, 240, 255, 0.12);
}

@keyframes chat-loader-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes chat-loader-spin-reverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

@keyframes chat-loader-pulse {
    0%, 100% {
        transform: scale(0.82);
        opacity: 0.88;
    }
    50% {
        transform: scale(1.12);
        opacity: 1;
    }
}

/* ── Chat area ── */
.chat-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    position: relative;
    height: 100%;
}

/* ── Chat header bar (guest view) ── */
.chat-header-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
    background: rgba(6, 15, 28, 0.8);
    backdrop-filter: blur(12px);
    min-height: 44px;
    flex-shrink: 0;
}
.chat-header-bar--paused {
    background: rgba(42, 48, 60, 0.9);
}
.chat-header-bar__name {
    font-size: 0.9rem;
    color: #dffcff;
    font-weight: 600;
    max-width: 26%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-header-bar__edit {
    background: none;
    border: none;
    color: rgba(0, 240, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 200ms ease;
}
.chat-header-bar__edit:hover { color: #00f0ff; }

.chat-header-bar__chat-title {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 0.92rem;
    font-weight: 700;
    color: #f4ffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-header-bar__type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(0, 240, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: #7cf7ff;
    font-size: 0.92rem;
    flex-shrink: 0;
    cursor: help;
}

.chat-header-bar--title-only {
    justify-content: center;
}

/* ── Info-chat bar (master/admin back button) ── */
.chat-area .info-chat {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
    background: rgba(6, 15, 28, 0.8);
    backdrop-filter: blur(12px);
}
.chat-area .info-chat .image a {
    font-size: 18px;
    color: #00f0ff;
    cursor: pointer;
    transition: opacity 200ms ease;
}
.chat-area .info-chat .image a:hover { opacity: 0.7; }
.chat-area .info-chat .text p {
    font-size: 0.9rem;
    color: #dffcff;
    font-weight: 500;
}

/* ── Message area ── */
.chat-box {
    flex: 1;
    min-height: 0;
    padding: 12px 14px 10px;
    overflow-y: auto;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(0, 240, 255, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(78, 204, 163, 0.03) 0%, transparent 50%),
        linear-gradient(180deg, #040a14 0%, #020509 100%);
    scroll-behavior: smooth;
}

/* Thin custom scrollbar */
.chat-box::-webkit-scrollbar { width: 5px; }
.chat-box::-webkit-scrollbar-track { background: transparent; }
.chat-box::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.15);
    border-radius: 3px;
}
.chat-box::-webkit-scrollbar-thumb:hover { background: rgba(0, 240, 255, 0.3); }
.chat-box { scrollbar-width: thin; scrollbar-color: rgba(0, 240, 255, 0.15) transparent; }

/* Welcome / empty message */
.chat-box .message-no {
    padding: 14px 20px;
    color: rgba(223, 252, 255, 0.6);
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 14px;
    text-align: center;
    font-size: 0.9rem;
    margin: 16px 0;
}

/* ── Date separator ── */
.chat-date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 18px 0 12px;
}
.chat-date-separator span {
    background: rgba(6, 15, 28, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.08);
    color: rgba(223, 252, 255, 0.45);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 14px;
    border-radius: 10px;
}

/* ── Message bubbles ── */
.chat-box .chat { margin: 3px 0; }
.chat-box .chat:first-child { margin-top: 8px; }

/* ── Author row: avatar + name + badge ── */
.chat-author-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 4px;
    padding: 0 2px;
}
.outgoing .chat-author-row { flex-direction: row-reverse; }

/* Avatar circle */
.chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #0a1628;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* Author name */
.chat-author-name {
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Admin badge */
.chat-admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.25);
    color: #00f0ff;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Grouped messages (same author, no avatar) — indent to align with bubble */
.chat.incoming.chat--grouped { padding-left: 36px; }
.chat.outgoing.chat--grouped { padding-right: 36px; }
.chat--grouped { margin-top: 1px; }

/* ── 16-color palette for participants ── */
/* Avatar: colored background, dark text */
.chat-avatar[data-color="0"]  { background-color: #f44336; }
.chat-avatar[data-color="1"]  { background-color: #e91e63; }
.chat-avatar[data-color="2"]  { background-color: #9c27b0; }
.chat-avatar[data-color="3"]  { background-color: #673ab7; }
.chat-avatar[data-color="4"]  { background-color: #3f51b5; }
.chat-avatar[data-color="5"]  { background-color: #2196f3; }
.chat-avatar[data-color="6"]  { background-color: #00bcd4; }
.chat-avatar[data-color="7"]  { background-color: #009688; }
.chat-avatar[data-color="8"]  { background-color: #4caf50; }
.chat-avatar[data-color="9"]  { background-color: #8bc34a; }
.chat-avatar[data-color="10"] { background-color: #ff9800; }
.chat-avatar[data-color="11"] { background-color: #ff5722; }
.chat-avatar[data-color="12"] { background-color: #e040fb; }
.chat-avatar[data-color="13"] { background-color: #7c4dff; }
.chat-avatar[data-color="14"] { background-color: #18ffff; }
.chat-avatar[data-color="15"] { background-color: #ffd740; }
.chat-avatar[data-color] { color: #0a1628; }

/* Author name: colored text only, transparent background */
.chat-author-name[data-color="0"]  { color: #f44336; }
.chat-author-name[data-color="1"]  { color: #e91e63; }
.chat-author-name[data-color="2"]  { color: #9c27b0; }
.chat-author-name[data-color="3"]  { color: #673ab7; }
.chat-author-name[data-color="4"]  { color: #3f51b5; }
.chat-author-name[data-color="5"]  { color: #2196f3; }
.chat-author-name[data-color="6"]  { color: #00bcd4; }
.chat-author-name[data-color="7"]  { color: #009688; }
.chat-author-name[data-color="8"]  { color: #4caf50; }
.chat-author-name[data-color="9"]  { color: #8bc34a; }
.chat-author-name[data-color="10"] { color: #ff9800; }
.chat-author-name[data-color="11"] { color: #ff5722; }
.chat-author-name[data-color="12"] { color: #e040fb; }
.chat-author-name[data-color="13"] { color: #7c4dff; }
.chat-author-name[data-color="14"] { color: #18ffff; }
.chat-author-name[data-color="15"] { color: #ffd740; }

/* Own messages always cyan */
.outgoing .chat-author-name { color: rgba(0, 240, 255, 0.65) !important; }

/* Color-coded left border on incoming bubbles */
.chat.incoming[data-color="0"]  .details p { border-left: 3px solid #f44336; }
.chat.incoming[data-color="1"]  .details p { border-left: 3px solid #e91e63; }
.chat.incoming[data-color="2"]  .details p { border-left: 3px solid #9c27b0; }
.chat.incoming[data-color="3"]  .details p { border-left: 3px solid #673ab7; }
.chat.incoming[data-color="4"]  .details p { border-left: 3px solid #3f51b5; }
.chat.incoming[data-color="5"]  .details p { border-left: 3px solid #2196f3; }
.chat.incoming[data-color="6"]  .details p { border-left: 3px solid #00bcd4; }
.chat.incoming[data-color="7"]  .details p { border-left: 3px solid #009688; }
.chat.incoming[data-color="8"]  .details p { border-left: 3px solid #4caf50; }
.chat.incoming[data-color="9"]  .details p { border-left: 3px solid #8bc34a; }
.chat.incoming[data-color="10"] .details p { border-left: 3px solid #ff9800; }
.chat.incoming[data-color="11"] .details p { border-left: 3px solid #ff5722; }
.chat.incoming[data-color="12"] .details p { border-left: 3px solid #e040fb; }
.chat.incoming[data-color="13"] .details p { border-left: 3px solid #7c4dff; }
.chat.incoming[data-color="14"] .details p { border-left: 3px solid #18ffff; }
.chat.incoming[data-color="15"] .details p { border-left: 3px solid #ffd740; }

/* Mobile: smaller avatars */
@media (max-width: 480px) {
    .chat-avatar { width: 24px; height: 24px; font-size: 0.65rem; }
    .chat.incoming.chat--grouped { padding-left: 32px; }
    .chat.outgoing.chat--grouped { padding-right: 32px; }
}

/* Bubble layout */
.chat-box .chat.outgoing { max-width: min(80%, 440px); }
.chat-box .chat.incoming { max-width: min(80%, 440px); margin-inline-start: auto; }

/* Outgoing bubble (my messages — left) */
.outgoing .details p {
    padding: 10px 14px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: 16px 4px 16px 16px;
    color: #dffcff;
    font-size: 0.9rem;
    line-height: 1.45;
    word-wrap: break-word;
    transition: box-shadow 200ms ease;
}
.outgoing .details p:hover {
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.08);
}

/* Incoming bubble (their messages — right) */
.incoming .details p {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px 16px 16px 16px;
    color: #dffcff;
    font-size: 0.9rem;
    line-height: 1.45;
    word-wrap: break-word;
    transition: box-shadow 200ms ease;
}
.incoming .details p:hover {
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.04);
}

/* Timestamp */
.chat > span[data-time] {
    font-size: 10px;
    color: rgba(223, 252, 255, 0.3);
    padding: 3px 6px 0;
    display: block;
}
.outgoing > span[data-time] { text-align: right; }
.incoming > span[data-time] { text-align: left; }

/* New message animation — applied via JS class only */
@keyframes msgSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chat-box .chat.is-new { animation: msgSlideIn 250ms ease both; }

/* ── Typing area ── */
.chat-area .typing-area {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: rgba(6, 15, 28, 0.85);
    border-top: 1px solid rgba(0, 240, 255, 0.1);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}

.typing-area input.input-field {
    flex: 1;
    height: 42px;
    padding: 0 12px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 12px;
    color: #dffcff;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}
.typing-area input.input-field::placeholder { color: rgba(255, 255, 255, 0.2); }
.typing-area input.input-field:focus {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.08);
}

.chat-char-counter {
    display: block;
    text-align: right;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    padding: 2px 12px 0;
    pointer-events: none;
}

.typing-area button {
    width: 42px;
    height: 42px;
    border: none;
    outline: none;
    background: transparent;
    color: #00f0ff;
    font-size: 18px;
    cursor: pointer;
    transition: color 200ms ease, transform 100ms ease;
    border-radius: 10px;
    flex-shrink: 0;
}
.typing-area button:hover { color: #4ecca3; }
.typing-area button:active { transform: scale(0.92); }

/* ── Smiley / emoji trigger ── */
.smail {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    cursor: pointer;
    color: rgba(223, 252, 255, 0.4);
    font-size: 20px;
    flex-shrink: 0;
    transition: color 200ms ease;
}
.smail:hover { color: #00f0ff; }

/* ── Emoji Picker ── */
.emoji-picker {
    display: none;
    background: rgba(6, 15, 28, 0.95);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 4px;
    backdrop-filter: blur(12px);
}
.emoji-picker.active { display: block; }

.emoji-tabs {
    display: flex;
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
    padding: 5px;
    gap: 2px;
}
.emoji-tab {
    flex: 1;
    text-align: center;
    font-size: 20px;
    padding: 5px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 150ms ease;
}
.emoji-tab:hover, .emoji-tab.active { background: rgba(0, 240, 255, 0.08); }

.emoji-content {
    display: flex;
    flex-wrap: wrap;
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.emoji-content::-webkit-scrollbar { width: 5px; }
.emoji-content::-webkit-scrollbar-thumb { background: rgba(0, 240, 255, 0.15); border-radius: 3px; }

.emoji-item {
    font-size: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: background 150ms ease;
}
.emoji-item:hover { background: rgba(0, 240, 255, 0.1); }

/* ── Attach button and menu ── */
.attach-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    cursor: pointer;
    color: rgba(0, 240, 255, 0.5);
    font-size: 18px;
    flex-shrink: 0;
    transition: color 200ms ease;
}
.attach-btn:hover { color: #00f0ff; }

.attach-menu {
    display: none;
    background: rgba(6, 15, 28, 0.95);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 4px;
    backdrop-filter: blur(12px);
}
.attach-menu.active { display: block; }

.attach-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    color: #dffcff;
    font-size: 0.9rem;
    transition: background 150ms ease;
}
.attach-option:hover { background: rgba(0, 240, 255, 0.06); }
.attach-option i { font-size: 18px; color: #00f0ff; width: 24px; text-align: center; }

/* ── File preview bar ── */
.file-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(6, 15, 28, 0.9);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 4px;
}
.file-preview-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}
.file-preview-info img, .file-preview-info video {
    width: 40px; height: 40px; object-fit: cover; border-radius: 6px;
}
.file-preview-info i { font-size: 22px; color: #00f0ff; }
.file-preview-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.file-preview-title,
.file-preview-subtitle {
    color: rgba(223, 252, 255, 0.7);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-preview-title {
    font-weight: 600;
}
.file-preview-subtitle {
    font-size: 11px;
    color: rgba(223, 252, 255, 0.48);
}
.file-preview-bar--image .file-preview-info img {
    width: auto;
    height: auto;
    max-width: 80px;
    max-height: 80px;
    border-radius: 8px;
}
.file-preview-cancel {
    color: rgba(223, 252, 255, 0.4);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    transition: color 200ms ease;
}
.file-preview-cancel:hover { color: #ff6b6b; }

/* ── Chat attachments ── */
.chat-attachment { margin-bottom: 4px; }
.chat-attachment img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    cursor: pointer;
    display: block;
}
.chat-attachment video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    display: block;
}
.chat-attachment.file-download a {
    color: #00f0ff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    transition: opacity 200ms ease;
}
.chat-attachment.file-download a:hover { opacity: 0.7; }

/* ── Camera overlay ── */
.camera-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    flex-direction: column;
}
.camera-overlay.active { display: flex; }
.camera-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}
.camera-header button {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
}
.camera-preview {
    width: 100%;
    height: calc(100% - 100px);
    object-fit: cover;
}
.camera-preview.front-camera { transform: scaleX(-1); }
.camera-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    background: #000;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}
.camera-capture {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: transparent;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.camera-capture:active { background: rgba(255, 255, 255, 0.3); }
.camera-result {
    position: absolute;
    inset: 0;
    flex-direction: column;
    background: #000;
    z-index: 11;
}
.camera-result-img {
    width: 100%;
    height: calc(100% - 80px);
    object-fit: contain;
}
.camera-result-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    height: 80px;
    align-items: center;
    background: #000;
}
.camera-result-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.camera-retake { background: #444; color: #fff; }
.camera-send { background: #00f0ff; color: #0a1628; font-weight: 600; }

/* ── Signup CTA link ── */
.link-signup {
    margin: 6px 10px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    width: auto;
    align-self: stretch;
    height: 40px;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.2);
    font-weight: 600;
    font-size: 0.8rem;
    color: #00f0ff;
    cursor: pointer;
    transition: background 200ms ease, box-shadow 200ms ease;
    text-decoration: none;
}
.link-signup:hover {
    background: rgba(0, 240, 255, 0.15);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.1);
}

.chat-auth-nav {
    margin-inline-start: auto;
    justify-content: flex-end;
}

.chat-auth-nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(123, 255, 236, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: #dffcff;
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.chat-auth-nav__link:hover {
    transform: translateY(-1px);
    border-color: rgba(123, 255, 236, 0.34);
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.12);
}

.chat-auth-nav__link--solid {
    background: linear-gradient(135deg, #79ffe1 0%, #00f0ff 100%);
    color: #04111f;
    border-color: transparent;
}

.chat-auth-nav__link--ghost {
    background: rgba(255, 255, 255, 0.02);
}

.landing-footer--compact {
    padding: 10px 0 0;
    justify-items: center;
    text-align: center;
}

.landing-footer__links--compact {
    justify-content: center;
    gap: 8px 16px;
}

/* ── Desktop split-pane layout (master-chat) ── */
.chat-sidebar { display: none; }

@media screen and (max-width: 920px) {
    .chat-page-header__actions {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .settings-nav {
        gap: 12px;
        justify-content: flex-end;
    }

    .chat-panel__toolbar {
        flex-wrap: wrap;
    }

    .chat-panel__toolbar-link,
    .chat-panel__toolbar-button {
        width: 100%;
        justify-content: center;
    }
}

@media screen and (max-width: 759px) {
    .chat-page .landing-shell {
        width: min(100%, calc(100% - 16px));
        padding-top: 6px;
        padding-bottom: 8px;
    }

    .chat-page .landing-header {
        padding: 2px 0 6px;
    }

    .landing-brand--chat .landing-brand__logo {
        width: min(136px, 40vw);
    }

    .chat-page-main {
        gap: 10px;
    }

    .chat-page-main.chat-page-main--centered {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .chat-page-header__actions {
        display: grid;
        width: 100%;
        margin-inline-start: 0;
        justify-content: stretch;
    }

    .landing-header__panel .settings-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        width: 100%;
    }

    .chat-panel {
        border-radius: 24px;
    }

    .chat-panel__toolbar {
        padding: 12px;
    }

    .chat-panel__toolbar-main {
        width: 100%;
    }

    .chat-panel__toolbar-main strong,
    .chat-panel__toolbar-main span {
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
        overflow-wrap: anywhere;
    }

    .chat-box {
        padding: 10px 10px 8px;
    }

    .chat-box .chat.outgoing,
    .chat-box .chat.incoming {
        max-width: min(92%, 440px);
    }

    .chat-area .typing-area {
        gap: 4px;
        padding: 6px;
    }

    .typing-area input.input-field {
        min-width: 0;
        height: 38px;
        padding-inline: 10px;
        font-size: 0.86rem;
    }

    .typing-area button,
    .smail,
    .attach-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .chat-header-bar {
        padding: 8px 10px;
        min-height: 38px;
    }

    .chat-header-bar__name {
        font-size: 0.84rem;
        max-width: 32%;
    }

    .chat-header-bar__chat-title {
        font-size: 0.84rem;
    }

    .chat-header-bar__type {
        width: 30px;
        height: 30px;
        font-size: 0.82rem;
    }

    .link-signup {
        margin: 4px 8px 8px;
        height: 36px;
        font-size: 0.76rem;
    }

    .chat-auth-nav {
        width: 100%;
    }

    .chat-auth-nav__link {
        flex: 1;
    }
}

@media screen and (min-width: 900px) {
    .desktop-layout { max-width: 1100px; }

    .desktop-layout .main {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 0;
    }

    .desktop-layout .chat-sidebar {
        display: flex;
        flex-direction: column;
        width: 320px;
        min-width: 320px;
        border: 1px solid rgba(0, 240, 255, 0.1);
        border-right: none;
        border-radius: 14px 0 0 14px;
        background: rgba(6, 15, 28, 0.85);
        backdrop-filter: blur(12px);
        overflow-y: auto;
        max-height: calc(100vh - 120px);
    }

    .desktop-layout .chat-sidebar .sidebar-header {
        padding: 14px 18px;
        font-size: 0.9rem;
        font-weight: 700;
        color: #00f0ff;
        border-bottom: 1px solid rgba(0, 240, 255, 0.1);
        position: sticky;
        top: 0;
        background: rgba(6, 15, 28, 0.95);
        backdrop-filter: blur(12px);
        z-index: 1;
    }

    .desktop-layout .chat-sidebar .sidebar-links {
        padding: 8px;
        font-size: 13px;
        flex: 1;
        overflow-y: auto;
    }

    .desktop-layout .chat-sidebar .sidebar-footer {
        padding: 10px;
        border-top: 1px solid rgba(0, 240, 255, 0.1);
    }

    .sidebar-create-btn {
        display: block;
        text-align: center;
        padding: 10px;
        background: #00f0ff;
        color: #0a1628;
        font-size: 0.85rem;
        font-weight: 700;
        border-radius: 10px;
        transition: opacity 200ms ease;
        text-decoration: none;
    }
    .sidebar-create-btn:hover { opacity: 0.85; }

    .desktop-layout .chat-sidebar .link { margin-bottom: 2px; }

    .desktop-layout .chat-sidebar .link-box {
        padding: 10px 12px;
        border-radius: 10px;
        border: none;
        transition: background 150ms ease;
    }
    .desktop-layout .chat-sidebar .link-box:hover {
        background: rgba(0, 240, 255, 0.05);
    }

    .desktop-layout .chat-area {
        flex: 1;
        border: 1px solid rgba(0, 240, 255, 0.1);
        border-radius: 0 14px 14px 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .desktop-layout .chat-area .chat-box {
        border: none;
        border-radius: 0;
        flex: 1;
        min-height: 0;
    }

    .desktop-layout .info-chat { display: none; }
}

/* ── Name modal overlay ── */
.name-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.name-modal {
    width: min(380px, 100%);
    max-height: min(calc(100dvh - 32px), 100%);
    padding: 32px 28px;
    border-radius: 22px;
    border: 1px solid rgba(0, 240, 255, 0.2);
    background: linear-gradient(180deg, rgba(5, 14, 31, 0.96) 0%, rgba(3, 9, 20, 0.99) 100%);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5), 0 0 24px rgba(0, 240, 255, 0.12);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    overflow-y: auto;
}
.name-modal__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #dffcff;
    margin: 0;
}
.name-modal__input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(0, 240, 255, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #dffcff;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 200ms ease, box-shadow 200ms ease;
    box-sizing: border-box;
}
.name-modal__input::placeholder { color: rgba(255, 255, 255, 0.28); }
.name-modal__input:focus {
    border-color: #00f0ff;
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.12);
}
.name-modal__btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: opacity 200ms ease;
}
.name-modal__btn--primary { background: #00f0ff; color: #0a1628; }
.name-modal__btn--primary:hover { opacity: 0.9; }
.name-modal__btn--ghost { background: transparent; color: rgba(223, 252, 255, 0.55); padding: 8px; }
.name-modal__btn--ghost:hover { color: #00f0ff; }

/* ── Chat toast notification ── */
.chat-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 2000;
    padding: 14px 28px;
    border-radius: 14px;
    background: rgba(6, 15, 28, 0.95);
    border: 1px solid rgba(255, 165, 0, 0.35);
    color: #ffbe55;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 165, 0, 0.1);
    backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 300ms ease, transform 300ms ease;
    pointer-events: none;
    text-align: center;
    max-width: 90vw;
}
.chat-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   Reactions
   ============================================================ */
.chat-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    padding: 0 4px;
}
.chat-reaction {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.7);
    font-size: 0.78rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    -webkit-user-select: none;
    user-select: none;
}
.chat-reaction:hover {
    border-color: rgba(0,240,255,0.25);
    background: rgba(0,240,255,0.06);
}
.chat-reaction--active {
    border-color: rgba(0,240,255,0.4);
    background: rgba(0,240,255,0.1);
    color: #00f0ff;
}
.chat-reaction span {
    font-size: 0.72rem;
}

/* Reaction popup */
.chat-reaction-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: rgba(10,10,35,0.92);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(0,240,255,0.2);
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    z-index: 100;
    animation: reactionPopIn 0.15s ease-out;
    white-space: nowrap;
}
@keyframes reactionPopIn {
    from { opacity: 0; transform: translateX(-50%) scale(0.85); }
    to { opacity: 1; transform: translateX(-50%) scale(1); }
}
.chat-reaction-popup__emoji {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s, transform 0.15s;
}
.chat-reaction-popup__emoji:hover {
    background: rgba(0,240,255,0.12);
    transform: scale(1.2);
}
.chat-reaction-popup__reply {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    border-radius: 50%;
    border-right: 1px solid rgba(255,255,255,0.1);
    margin-right: 4px;
    padding-right: 6px;
    transition: color 0.15s;
}
.chat-reaction-popup__reply:hover {
    color: #00f0ff;
}

/* ============================================================
   Reply preview (above input)
   ============================================================ */
.chat-reply-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0,240,255,0.04);
    border-left: 3px solid #00f0ff;
    border-radius: 0 8px 8px 0;
    margin: 0 12px 6px;
}
.chat-reply-preview__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.chat-reply-preview__author {
    font-size: 0.75rem;
    font-weight: 600;
    color: #00f0ff;
}
.chat-reply-preview__text {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-reply-preview__close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.chat-reply-preview__close:hover {
    color: #ff4757;
}

/* ============================================================
   Reply quote in message
   ============================================================ */
.chat-reply-quote {
    padding: 6px 10px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.04);
    border-left: 2px solid rgba(0,240,255,0.4);
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.chat-reply-quote:hover {
    background: rgba(0,240,255,0.06);
}
.chat-reply-quote__author {
    font-size: 0.72rem;
    font-weight: 600;
    color: #00f0ff;
}
.chat-reply-quote__text {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Message highlight on scroll-to */
.chat--highlighted {
    animation: chatHighlight 2s ease-out;
}
@keyframes chatHighlight {
    0%, 20% { background: rgba(0,240,255,0.08); }
    100% { background: transparent; }
}

/* ============================================================
   Mentions
   ============================================================ */
.chat-mention {
    color: #00f0ff;
    font-weight: 600;
}

/* ============================================================
   Master-chat layout: sidebar + chat pane
   ============================================================ */
.chat-panel--master { padding: 0; overflow: hidden; }
.chat-panel--master .chat-panel__toolbar { padding: 12px 16px; }

.mc-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

/* Sidebar */
.mc-sidebar {
    width: 280px;
    min-width: 280px;
    border-right: 1px solid rgba(0,240,255,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mc-sidebar__list {
    flex: 1;
    overflow-y: auto;
}
.mc-sidebar__loading, .mc-sidebar__empty {
    padding: 2rem 1rem;
    text-align: center;
    color: rgba(255,255,255,0.35);
    font-size: 0.88rem;
}

/* Conversation item */
.mc-conv {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.mc-conv:hover {
    background: rgba(0,240,255,0.04);
    transform: translateX(2px);
}
.mc-conv--active {
    background: linear-gradient(90deg, rgba(0,240,255,0.16), rgba(0,240,255,0.06));
    border-left-color: #00f0ff;
    box-shadow: inset 0 0 0 1px rgba(0,240,255,0.18), inset 0 0 24px rgba(0,240,255,0.08);
}
.mc-conv--active::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #79ffe1;
    box-shadow: 0 0 0 4px rgba(121,255,225,0.12), 0 0 12px rgba(121,255,225,0.45);
    transform: translateY(-50%);
}
.mc-conv--unread .mc-conv__preview {
    color: rgba(255,255,255,0.72);
}
.mc-conv--active .mc-conv__name {
    color: #b7fbff;
    text-shadow: 0 0 10px rgba(0,240,255,0.18);
}
.mc-conv--active .mc-conv__avatar {
    background: linear-gradient(135deg, rgba(0,240,255,0.35), rgba(0,173,239,0.3));
    box-shadow: 0 0 0 1px rgba(0,240,255,0.18), 0 0 16px rgba(0,240,255,0.15);
}
.mc-conv--active .mc-conv__date {
    color: rgba(183,251,255,0.9);
}
.mc-conv--active .mc-conv__preview {
    color: rgba(255,255,255,0.9);
}

.mc-conv__avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
    color: #fff; flex-shrink: 0;
    background: rgba(0,240,255,0.15);
}
.mc-conv__body { flex: 1; min-width: 0; }
.mc-conv__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mc-conv__title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mc-conv__name { font-size: 0.88rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-conv__meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mc-conv__date { font-size: 0.7rem; color: rgba(255,255,255,0.35); white-space: nowrap; flex-shrink: 0; }
.mc-conv__preview { font-size: 0.78rem; color: rgba(255,255,255,0.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.mc-conv__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: linear-gradient(135deg, #79ffe1, #00f0ff);
    color: #04111f;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

/* Chat pane */
.mc-chat-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mc-chat-pane,
.mc-chat-pane .chat-area,
.mc-chat-pane .chat-box {
    min-height: 0;
}
.mc-chat-pane { overflow: hidden; }
.mc-chat-pane .chat-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.mc-chat-pane .chat-box {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Mobile: list-only or chat-only */
@media (max-width: 768px) {
    .chat-page-main {
        min-height: 0;
        overflow: hidden;
    }

    .chat-panel--master {
        height: 100%;
        min-height: 0;
    }

    .mc-layout {
        flex-direction: column;
        height: auto;
        min-height: 0;
    }

    .mc-sidebar {
        width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid rgba(0,240,255,0.1);
    }

    .mc-layout--list-only .mc-chat-pane { display: none; }
    .mc-layout--list-only .mc-sidebar { flex: 1; }
    .mc-layout--chat-only .mc-sidebar { display: none; }
    .mc-layout--chat-only .mc-chat-pane {
        display: flex;
        flex: 1;
        min-height: 0;
    }

    .mc-chat-pane .chat-area {
        height: 100%;
    }

    .mc-chat-pane .chat-box {
        padding-bottom: 10px;
    }

    .chat-area .typing-area {
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    }
}

@media (min-width: 769px) {
    .mc-layout--list-only .mc-chat-pane { display: flex; align-items: center; justify-content: center; }
    .mc-layout--list-only .mc-chat-pane .chat-area { display: none; }
    .mc-layout--list-only .mc-chat-pane::after {
        content: attr(data-empty-text);
        color: rgba(255,255,255,0.25);
        font-size: 0.95rem;
    }
    .mc-back-btn { display: none; }
}
