:root {
    --bg: #e9eef6;
    --panel: #edf2fa;
    --text: #121826;
    --muted: #6b7280;
    --blue: #0587ff;
    --blue-2: #006fe8;
    --red: #f3264f;
    --green: #20c85a;
    --shadow-dark: rgba(112, 128, 155, 0.52);
    --shadow-light: rgba(255, 255, 255, 0.98);
}

* {
    box-sizing: border-box;
}

[hidden],
.hidden {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background:
        radial-gradient(circle at 50% 6%, rgba(255, 255, 255, 0.98) 0%, transparent 34%),
        linear-gradient(145deg, #f7faff 0%, #e9eef6 46%, #d1dbe8 100%);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 18px;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.chat-app {
    width: 100%;
    max-width: 720px;
    height: min(1010px, calc(100vh - 24px));
    min-height: 690px;
    background: #eef3fa;
    border-radius: 28px 28px 0 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: 292px 1fr;
    box-shadow:
        22px 28px 58px rgba(83, 99, 126, 0.46),
        -16px -16px 34px rgba(255, 255, 255, 0.95),
        0 18px 44px rgba(120, 135, 160, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.9);
    position: relative;
}

.access-shell {
    width: min(430px, 100%);
    min-height: calc(100vh - 36px);
    display: grid;
    place-items: center;
}

.left-panel {
    background: rgba(231, 237, 247, 0.88);
    padding: 12px 10px 18px;
    border-right: 1px solid rgba(150, 160, 180, 0.24);
    position: relative;
    box-shadow:
        inset -8px 0 18px rgba(130, 145, 170, 0.12),
        inset 8px 0 18px rgba(255, 255, 255, 0.4);
}

.tabs {
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    border-radius: 22px;
    margin-bottom: 22px;
    background: rgba(225, 232, 244, 0.82);
    box-shadow:
        inset 6px 6px 14px rgba(140, 155, 180, 0.32),
        inset -6px -6px 14px rgba(255, 255, 255, 0.96);
}

.tab {
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 18px;
    color: #4b5563;
    position: relative;
    white-space: nowrap;
}

.tab.active {
    background: #f9fbff;
    color: #111827;
    box-shadow:
        8px 8px 18px rgba(140, 155, 180, 0.32),
        -8px -8px 18px rgba(255, 255, 255, 0.98);
}

.mention-badge {
    position: absolute;
    right: -20px;
    top: -11px;
    background: var(--red);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(243, 38, 79, 0.52);
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chat-item {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 13px;
    min-height: 82px;
    padding: 10px 12px;
    border-radius: 12px;
}

.chat-item.active {
    background: rgba(243, 247, 253, 0.9);
    box-shadow:
        12px 14px 28px rgba(138, 154, 183, 0.38),
        -10px -10px 24px rgba(255, 255, 255, 0.98);
}

.avatar,
.header-avatar,
.ready-avatar {
    display: grid;
    place-items: center;
    color: white;
    font-weight: 800;
    position: relative;
}

.avatar img,
.ready-avatar img,
.active-user-avatar img,
.message-avatar img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    display: block;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 25%, #fff 0 8%, #88d3ff 9% 45%, #2f8cff 100%);
    box-shadow:
        10px 10px 20px rgba(120, 136, 160, 0.38),
        -8px -8px 16px rgba(255, 255, 255, 0.92);
}

.avatar-c { background: radial-gradient(circle at 35% 28%, #eef7ff 0 12%, #39aaff 13% 58%, #006fe8 100%); }
.header-avatar { background: radial-gradient(circle at 35% 25%, #ffe0b6 0 12%, #ffba46 13% 55%, #f56d8e 100%); }

.preview-empty-panel,
.clean-chat-preview {
    margin: 10px 4px;
    padding: 18px;
    border-radius: 22px;
    color: #64748b;
    background: rgba(245, 249, 255, 0.62);
    box-shadow:
        inset 5px 5px 10px rgba(140, 155, 180, 0.14),
        inset -5px -5px 10px rgba(255, 255, 255, 0.82);
}

.preview-empty-panel,
.clean-chat-preview {
    display: grid;
    gap: 6px;
}

.preview-empty-panel strong,
.clean-chat-preview strong {
    color: #263244;
    font-size: 15px;
}

.preview-empty-panel span,
.clean-chat-preview span {
    font-size: 13px;
    line-height: 1.35;
}

.clean-chat-preview {
    align-self: center;
    justify-self: center;
    width: min(320px, 100%);
    text-align: center;
}

.online {
    position: absolute;
    right: 0;
    bottom: 3px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--green);
    border: 2px solid white;
    box-shadow: 0 0 10px rgba(39, 212, 93, 0.6);
}

.chat-name {
    font-size: 21px;
    font-weight: 500;
    line-height: 1.05;
}

.chat-sub,
.header-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

.notify {
    min-width: 30px;
    height: 30px;
    border-radius: 11px;
    background: var(--red);
    color: white;
    display: grid;
    place-items: center;
    font-size: 17px;
    font-weight: 800;
    box-shadow:
        0 13px 24px rgba(243, 38, 79, 0.45),
        0 0 18px rgba(243, 38, 79, 0.45);
}

.notify.blue {
    background: var(--blue);
    box-shadow: 0 12px 24px rgba(5, 135, 255, 0.45);
}

.notify.gray {
    background: #cfd8e6;
    box-shadow:
        inset 4px 4px 8px rgba(120, 136, 160, 0.25),
        inset -4px -4px 8px rgba(255, 255, 255, 0.8);
}

.right-panel {
    background: rgba(238, 243, 250, 0.76);
    padding: 26px 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow:
        inset 10px 0 24px rgba(255, 255, 255, 0.35),
        inset -10px 0 24px rgba(130, 145, 170, 0.08);
}

.chat-header {
    min-height: 84px;
    display: flex;
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid rgba(150, 160, 180, 0.24);
}

.header-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    box-shadow:
        10px 10px 22px rgba(130, 145, 168, 0.35),
        -8px -8px 18px rgba(255, 255, 255, 0.92);
}

.header-title {
    font-size: 20px;
    font-weight: 500;
}

.messages {
    flex: 1;
    padding: 28px 0 18px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    overflow: hidden;
}

.row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.row.right {
    align-items: flex-end;
}

.meta {
    font-size: 18px;
    color: #5d6573;
}

.meta strong {
    color: #111827;
    font-weight: 600;
}

.bubble {
    max-width: 300px;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 20px;
    line-height: 1.12;
}

.bubble.blue {
    color: white;
    background: linear-gradient(145deg, #16a7ff, #006fe8);
    border-bottom-right-radius: 7px;
    box-shadow:
        0 18px 28px rgba(0, 111, 232, 0.42),
        0 4px 10px rgba(12, 120, 224, 0.26);
}

.bubble.white {
    background: rgba(250, 252, 255, 0.92);
    color: #111827;
    border-bottom-left-radius: 7px;
    box-shadow:
        13px 15px 24px rgba(107, 122, 150, 0.34),
        -8px -8px 16px rgba(255, 255, 255, 0.94);
}

.access-card {
    position: relative;
    width: min(370px, 100%);
    min-height: 390px;
    background: rgba(245, 249, 255, 0.82);
    border-radius: 32px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.86);
    box-shadow:
        24px 28px 58px rgba(95, 112, 142, 0.38),
        -18px -18px 38px rgba(255, 255, 255, 0.9),
        0 18px 35px rgba(110, 125, 150, 0.12);
    backdrop-filter: blur(16px);
    z-index: 5;
    transition: 0.35s ease;
}

.brand {
    text-align: center;
    margin-bottom: 22px;
}

.cambachat-icon {
    --icon-size: 66px;
    --bubble-width: calc(var(--icon-size) * 0.54);
    --bubble-height: calc(var(--icon-size) * 0.50);
    --bubble-radius: calc(var(--icon-size) * 0.15);
    --face-color: #0369a1;
    width: var(--icon-size);
    height: var(--icon-size);
    border-radius: calc(var(--icon-size) * 0.34);
    background: linear-gradient(145deg, #18a4ff, #006fe8);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.45),
        0 18px 34px rgba(5, 135, 255, 0.34);
}

.logo {
    margin: 0 auto 14px;
}

.cambachat-bubble {
    position: relative;
    width: var(--bubble-width);
    height: var(--bubble-height);
    border-radius: var(--bubble-radius) var(--bubble-radius) var(--bubble-radius) calc(var(--bubble-radius) * 0.36);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 -2px 4px rgba(14, 165, 233, 0.08);
}

.cambachat-bubble::after {
    content: "";
    position: absolute;
    bottom: calc(var(--icon-size) * -0.03);
    left: calc(var(--icon-size) * 0.08);
    width: calc(var(--icon-size) * 0.07);
    height: calc(var(--icon-size) * 0.07);
    background: inherit;
    transform: rotate(45deg);
}

.cambachat-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--icon-size) * 0.032);
}

.cambachat-eyes {
    display: flex;
    gap: calc(var(--icon-size) * 0.078);
}

.cambachat-eye {
    width: calc(var(--icon-size) * 0.055);
    height: calc(var(--icon-size) * 0.092);
    border-radius: 999px;
    background: var(--face-color);
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1);
}

.cambachat-mouth {
    width: calc(var(--icon-size) * 0.185);
    height: calc(var(--icon-size) * 0.092);
    border-bottom: calc(var(--icon-size) * 0.027) solid var(--face-color);
    border-left: calc(var(--icon-size) * 0.027) solid var(--face-color);
    border-right: calc(var(--icon-size) * 0.027) solid var(--face-color);
    border-radius: 0 0 999px 999px;
}

.brand h1 {
    margin: 0;
    font-size: 35px;
    letter-spacing: -1px;
}

.brand h1 span {
    color: var(--blue);
}

.brand p {
    margin: 8px 0 0;
    color: #5f6b7a;
    line-height: 1.35;
    font-size: 15px;
}

.input-wrap {
    position: relative;
    margin: 16px 0 8px;
}

.access-form {
    display: grid;
    gap: 8px;
}

.access-form label {
    margin-left: 4px;
    color: #4b5563;
    font-size: 13px;
    font-weight: 900;
}

.input-wrap input {
    width: 100%;
    border: 0;
    outline: 0;
    min-height: 58px;
    border-radius: 20px;
    padding: 0 48px 0 18px;
    background: #eef4fb;
    color: #111827;
    font-size: 17px;
    box-shadow:
        inset 6px 6px 12px rgba(140, 155, 180, 0.28),
        inset -6px -6px 12px rgba(255, 255, 255, 0.98);
}

.input-wrap input:focus {
    box-shadow:
        inset 6px 6px 12px rgba(140, 155, 180, 0.25),
        inset -6px -6px 12px rgba(255, 255, 255, 0.98),
        0 0 0 4px rgba(5, 135, 255, 0.12);
}

.input-icon {
    position: absolute;
    right: 17px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 19px;
}

.status {
    min-height: 24px;
    font-size: 14px;
    font-weight: 700;
    margin: 9px 2px 12px;
}

.status.idle {
    color: #64748b;
}

.status.checking {
    color: var(--blue);
}

.status.available {
    color: var(--green);
}

.status.taken,
.status.invalid,
.status.reserved,
.status.error {
    color: var(--red);
}

.btn {
    width: 100%;
    min-height: 58px;
    border: 0;
    border-radius: 20px;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.18s ease;
}

.btn-primary {
    color: white;
    background: linear-gradient(145deg, #18a4ff, #006fe8);
    box-shadow:
        0 18px 32px rgba(5, 135, 255, 0.4),
        8px 8px 18px rgba(110, 125, 150, 0.16);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: #d7e0ec;
    color: #91a0b4;
    box-shadow:
        inset 4px 4px 8px rgba(140, 155, 180, 0.15),
        inset -4px -4px 8px rgba(255, 255, 255, 0.8);
    cursor: not-allowed;
}

.back-btn {
    background: transparent;
    border: 0;
    color: var(--blue);
    font-weight: 800;
    margin-bottom: 10px;
    cursor: pointer;
}

.soft-reset-button {
    width: 100%;
    min-height: 46px;
    margin-top: 10px;
    border: 0;
    border-radius: 18px;
    background: #f8fbff;
    color: #64748b;
    font-weight: 900;
    cursor: pointer;
    box-shadow:
        8px 8px 18px rgba(140, 155, 180, 0.22),
        -8px -8px 18px rgba(255, 255, 255, 0.9);
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.suggestions button {
    border: 0;
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--blue-2);
    background: #f8fbff;
    font-weight: 800;
    cursor: pointer;
    box-shadow:
        7px 7px 15px rgba(140, 155, 180, 0.26),
        -6px -6px 14px rgba(255, 255, 255, 0.95);
}

.pin-title {
    text-align: center;
    font-size: 27px;
    margin: 8px 0 6px;
}

.pin-sub {
    text-align: center;
    color: #64748b;
    margin: 0 0 16px;
    line-height: 1.35;
}

.pin-row {
    margin-bottom: 12px;
}

.pin-row label {
    display: block;
    color: #4b5563;
    font-size: 13px;
    font-weight: 800;
    margin: 0 0 7px 4px;
}

.pin-row input {
    text-align: center;
    letter-spacing: 0.75em;
    font-weight: 900;
    font-size: 23px;
}

.note {
    font-size: 12px;
    color: #64748b;
    text-align: center;
    margin-top: 12px;
    line-height: 1.35;
}

.recaptcha-container {
    min-height: 1px;
    display: grid;
    place-items: center;
    margin-top: 10px;
    overflow: hidden;
}

.chat-ready {
    width: 100%;
    min-height: calc(100vh - 36px);
    display: grid;
    place-items: center;
}

.chat-ready-card {
    width: min(430px, calc(100vw - 34px));
    background: rgba(245, 249, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 32px;
    padding: 32px;
    text-align: center;
    box-shadow:
        28px 28px 60px rgba(105, 120, 145, 0.42),
        -20px -20px 40px rgba(255, 255, 255, 0.98);
}

.ready-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    margin: 0 auto 18px;
    font-size: 30px;
    box-shadow: 0 18px 34px rgba(5, 135, 255, 0.24);
}

.ready-eyebrow {
    margin: 0 0 6px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.chat-ready-card h1 {
    margin: 0 0 10px;
    font-size: 32px;
}

.chat-ready-card p {
    color: #64748b;
    line-height: 1.45;
}

.ready-panel {
    display: grid;
    gap: 6px;
    margin: 22px 0;
    padding: 18px;
    border-radius: 22px;
    background: #eef4fb;
    box-shadow:
        inset 6px 6px 12px rgba(140, 155, 180, 0.22),
        inset -6px -6px 12px rgba(255, 255, 255, 0.9);
}

.ready-panel span {
    color: #64748b;
    font-size: 14px;
}

.chat-body {
    padding: 18px;
    overflow: hidden;
}

.live-chat-shell {
    width: min(1040px, calc(100vw - 36px));
    height: min(760px, calc(100vh - 36px));
    min-height: 620px;
    max-height: calc(100vh - 36px);
    display: grid;
    grid-template-columns: 285px 1fr;
    overflow: hidden;
    border-radius: 32px;
    background: #eef3fa;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        28px 30px 68px rgba(83, 99, 126, 0.42),
        -16px -16px 34px rgba(255, 255, 255, 0.95);
}

.live-sidebar {
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: rgba(231, 237, 247, 0.88);
    border-right: 1px solid rgba(150, 160, 180, 0.22);
    box-shadow:
        inset -8px 0 18px rgba(130, 145, 170, 0.12),
        inset 8px 0 18px rgba(255, 255, 255, 0.4);
}

.live-brand,
.live-user-card,
.live-room {
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-brand {
    padding: 8px 4px 18px;
}

.live-logo {
    --icon-size: 48px;
    margin: 0;
    border-radius: 18px;
}

.live-brand strong,
.live-user-card strong,
.live-room strong {
    display: block;
    font-size: 18px;
}

.live-brand span,
.live-user-card span,
.live-room small {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-top: 3px;
}

.live-room {
    width: 100%;
    min-height: 72px;
    padding: 14px;
    border: 0;
    border-radius: 22px;
    color: #111827;
    text-align: left;
    background: rgba(244, 248, 255, 0.9);
    box-shadow:
        12px 14px 28px rgba(138, 154, 183, 0.34),
        -10px -10px 24px rgba(255, 255, 255, 0.98);
}

.sidebar-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: #111827;
}

.sidebar-section-title strong {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-section-title span {
    min-width: 26px;
    height: 26px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: white;
    background: var(--blue);
    font-weight: 900;
    font-size: 13px;
    box-shadow: 0 10px 18px rgba(5, 135, 255, 0.32);
}

.active-users-panel {
    padding: 14px;
    border-radius: 22px;
    background: rgba(245, 249, 255, 0.58);
    box-shadow:
        inset 5px 5px 10px rgba(140, 155, 180, 0.16),
        inset -5px -5px 10px rgba(255, 255, 255, 0.82);
}

.active-users-list {
    display: grid;
    gap: 10px;
    max-height: 220px;
    overflow: auto;
}

.active-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 7px;
    border-radius: 16px;
    background: rgba(249, 251, 255, 0.58);
    box-shadow:
        5px 5px 12px rgba(140, 155, 180, 0.16),
        -5px -5px 12px rgba(255, 255, 255, 0.70);
}

.active-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: white;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 900;
    box-shadow:
        6px 6px 12px rgba(120, 136, 160, 0.24),
        -5px -5px 10px rgba(255, 255, 255, 0.78);
}

.active-user strong {
    display: block;
    font-size: 14px;
    line-height: 1.05;
}

.active-user span,
.active-user-empty {
    color: #64748b;
    font-size: 12px;
}

.active-user-empty {
    padding: 12px;
    border-radius: 16px;
    text-align: center;
    background: rgba(249, 251, 255, 0.56);
}

.rooms-panel {
    display: grid;
    gap: 10px;
}

.room-list {
    display: grid;
    gap: 8px;
    max-height: 170px;
    overflow-y: auto;
    padding-right: 2px;
}

.room-mini {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 16px;
    padding: 9px 11px;
    text-align: left;
    color: #334155;
    background: rgba(249, 251, 255, 0.58);
    box-shadow:
        5px 5px 12px rgba(140, 155, 180, 0.16),
        -5px -5px 12px rgba(255, 255, 255, 0.70);
}

.room-mini.active {
    color: white;
    background: linear-gradient(145deg, #18a4ff, #006fe8);
    box-shadow: 0 14px 24px rgba(5, 135, 255, 0.28);
}

.room-mini strong,
.room-mini span {
    display: block;
}

.room-mini span {
    margin-top: 2px;
    font-size: 12px;
    opacity: 0.74;
}

.create-room-form,
.contact-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.create-room-form input,
.contact-search-form input {
    min-width: 0;
    min-height: 42px;
    border: 0;
    border-radius: 15px;
    padding: 0 12px;
    background: #eef4fb;
    color: #111827;
    box-shadow:
        inset 5px 5px 10px rgba(140, 155, 180, 0.22),
        inset -5px -5px 10px rgba(255, 255, 255, 0.88);
}

.create-room-form button,
.contact-search-form button {
    min-height: 42px;
    border: 0;
    border-radius: 15px;
    padding: 0 12px;
    color: white;
    background: linear-gradient(145deg, #18a4ff, #006fe8);
    font-weight: 900;
}

.contact-results {
    display: grid;
    gap: 8px;
}

.contact-result,
.chat-mini {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.contact-result {
    width: 100%;
    min-height: 56px;
    border: 0;
    border-radius: 17px;
    padding: 9px 10px;
    text-align: left;
    color: #334155;
    background: rgba(249, 251, 255, 0.64);
    box-shadow:
        5px 5px 12px rgba(140, 155, 180, 0.16),
        -5px -5px 12px rgba(255, 255, 255, 0.70);
}

.mini-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    font-weight: 900;
    overflow: hidden;
    box-shadow:
        6px 6px 12px rgba(120, 136, 160, 0.22),
        -5px -5px 10px rgba(255, 255, 255, 0.76);
}

.mini-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-result span,
.chat-mini span {
    min-width: 0;
}

.contact-result strong,
.contact-result small,
.contact-result em,
.chat-mini strong,
.chat-mini small {
    display: block;
}

.contact-result small,
.chat-mini small {
    margin-top: 2px;
    color: #64748b;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-result em {
    align-self: center;
    padding: 7px 10px;
    border-radius: 999px;
    color: white;
    background: linear-gradient(145deg, #18a4ff, #006fe8);
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}

.room-mini.chat-mini {
    min-height: 58px;
    padding: 9px 10px;
}

.room-mini.chat-mini.active .mini-avatar {
    box-shadow: 0 8px 16px rgba(0, 84, 180, 0.25);
}

.room-mini.chat-mini.active small {
    color: rgba(255, 255, 255, 0.78);
}

.room-dot {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(145deg, #16a7ff, #006fe8);
    box-shadow: 0 14px 24px rgba(5, 135, 255, 0.38);
}

.live-user-card {
    margin-top: auto;
    padding: 14px;
    border-radius: 22px;
    background: rgba(245, 249, 255, 0.72);
    box-shadow:
        inset 5px 5px 10px rgba(140, 155, 180, 0.18),
        inset -5px -5px 10px rgba(255, 255, 255, 0.84);
}

.profile-avatar-control {
    cursor: pointer;
    border-radius: 50%;
    display: inline-grid;
    transition: transform 0.18s ease;
}

.profile-avatar-control:hover {
    transform: translateY(-1px);
}

.live-user-avatar {
    width: 48px;
    height: 48px;
    margin: 0;
    font-size: 20px;
}

.ghost-live-button {
    min-height: 50px;
    border: 0;
    border-radius: 18px;
    background: #f8fbff;
    color: #415064;
    font-weight: 800;
    box-shadow:
        8px 8px 18px rgba(140, 155, 180, 0.28),
        -8px -8px 18px rgba(255, 255, 255, 0.95);
}

.live-chat-panel {
    min-width: 0;
    min-height: 0;
    height: 100%;
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    background: rgba(238, 243, 250, 0.76);
}

.live-chat-header {
    min-height: 92px;
    padding: 20px 26px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid rgba(150, 160, 180, 0.22);
}

.live-chat-header > div:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.header-actions button {
    min-height: 38px;
    border: 0;
    border-radius: 14px;
    padding: 0 14px;
    background: #f8fbff;
    color: #415064;
    font-weight: 900;
    box-shadow:
        7px 7px 15px rgba(140, 155, 180, 0.22),
        -6px -6px 14px rgba(255, 255, 255, 0.88);
}

.live-room-avatar {
    width: 58px;
    height: 58px;
}

.live-chat-header h1 {
    margin: 0;
    font-size: 24px;
}

.live-chat-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 14px;
}

.live-message-list {
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scroll-behavior: smooth;
}

.empty-chat-state {
    margin: auto;
    max-width: 360px;
    text-align: center;
    color: #64748b;
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 28px 26px;
    border-radius: 28px;
    background: rgba(245, 249, 255, 0.72);
    box-shadow:
        14px 16px 30px rgba(140, 155, 180, 0.20),
        -12px -12px 28px rgba(255, 255, 255, 0.84),
        inset 5px 5px 10px rgba(140, 155, 180, 0.10),
        inset -5px -5px 10px rgba(255, 255, 255, 0.72);
}

.empty-chat-logo {
    --icon-size: 62px;
    margin-bottom: 2px;
}

.date-separator {
    align-self: center;
    padding: 7px 14px;
    border-radius: 999px;
    color: #64748b;
    background: rgba(245, 249, 255, 0.78);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow:
        7px 7px 15px rgba(140, 155, 180, 0.18),
        -6px -6px 14px rgba(255, 255, 255, 0.84);
}

.empty-chat-state strong {
    color: #111827;
    font-size: 20px;
}

.live-message-row {
    display: flex;
    align-items: end;
    gap: 10px;
}

.live-message-row.own {
    justify-content: flex-end;
}

.message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: white;
    display: grid;
    place-items: center;
    font-weight: 900;
    flex: 0 0 auto;
    box-shadow:
        8px 8px 16px rgba(120, 136, 160, 0.28),
        -6px -6px 12px rgba(255, 255, 255, 0.84);
}

.message-content {
    max-width: min(440px, 78%);
    display: grid;
    gap: 6px;
}

.live-message-row.own .message-content {
    justify-items: end;
}

.live-message-meta {
    display: flex;
    gap: 8px;
    align-items: baseline;
    color: #64748b;
    font-size: 13px;
}

.live-message-meta strong {
    color: #111827;
}

.live-bubble {
    padding: 13px 16px;
    border-radius: 20px 20px 20px 7px;
    background: rgba(250, 252, 255, 0.94);
    color: #111827;
    font-size: 17px;
    line-height: 1.26;
    overflow-wrap: anywhere;
    word-break: break-word;
    box-shadow:
        13px 15px 24px rgba(107, 122, 150, 0.28),
        -8px -8px 16px rgba(255, 255, 255, 0.92);
}

.message-image {
    display: block;
    width: min(320px, 64vw);
    max-height: 360px;
    object-fit: cover;
    border-radius: 15px;
    cursor: zoom-in;
}

.message-caption {
    display: block;
    margin-top: 9px;
}

.delete-message-button {
    justify-self: end;
    min-height: 28px;
    border: 0;
    border-radius: 999px;
    padding: 0 10px;
    color: #64748b;
    background: rgba(248, 251, 255, 0.74);
    font-size: 12px;
    font-weight: 900;
    opacity: 0;
    transform: translateY(-2px);
    transition: 0.18s ease;
    box-shadow:
        5px 5px 10px rgba(140, 155, 180, 0.16),
        -4px -4px 9px rgba(255, 255, 255, 0.8);
}

.live-message-row:hover .delete-message-button,
.delete-message-button:focus-visible {
    opacity: 1;
    transform: translateY(0);
}

.profile-modal[hidden] {
    display: none;
}

.profile-modal {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: grid;
    place-items: center;
    padding: 20px;
}

.profile-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 20, 33, 0.50);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.profile-panel {
    position: relative;
    z-index: 1;
    width: min(390px, 100%);
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 28px;
    border-radius: 30px;
    background: rgba(238, 243, 250, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow:
        28px 28px 60px rgba(10, 20, 35, 0.28),
        -12px -12px 34px rgba(255, 255, 255, 0.32);
}

.profile-panel .viewer-icon-button {
    position: absolute;
    top: 14px;
    right: 14px;
}

.profile-modal-avatar {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    font-size: 34px;
    font-weight: 900;
    overflow: hidden;
    box-shadow: 0 18px 32px rgba(5, 135, 255, 0.26);
}

.profile-modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-panel h2 {
    margin: 0;
    font-size: 26px;
}

.profile-panel dl {
    width: 100%;
    display: grid;
    gap: 8px;
    margin: 0;
}

.profile-panel dl div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 15px;
    background: rgba(248, 251, 255, 0.72);
}

.profile-panel dt {
    color: #64748b;
    font-weight: 800;
}

.profile-panel dd {
    margin: 0;
    text-align: right;
    font-weight: 900;
}

.profile-panel p {
    margin: 0;
    color: #64748b;
    text-align: center;
    font-size: 13px;
}

.viewer-open {
    overflow: hidden;
}

.has-chat-background {
    background:
        linear-gradient(rgba(233, 238, 246, 0.84), rgba(217, 226, 238, 0.88)),
        var(--chat-custom-bg) center / cover fixed;
}

.image-viewer[hidden] {
    display: none;
}

.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 22px;
}

.image-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 20, 33, 0.62);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.image-viewer-panel {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    max-height: min(820px, 94vh);
    display: grid;
    grid-template-rows: auto minmax(260px, 1fr) auto auto;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 30px;
    background: rgba(238, 243, 250, 0.94);
    box-shadow:
        30px 30px 70px rgba(10, 20, 35, 0.32),
        -12px -12px 34px rgba(255, 255, 255, 0.32);
}

.image-viewer-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.image-viewer-header div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.image-viewer-header strong {
    color: #111827;
    font-size: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-viewer-header span {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.viewer-icon-button {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 16px;
    color: #111827;
    background: #f8fbff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow:
        8px 8px 18px rgba(140, 155, 180, 0.28),
        -8px -8px 18px rgba(255, 255, 255, 0.9);
}

.image-viewer-stage {
    min-height: 260px;
    overflow: auto;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(245, 249, 255, 0.82), rgba(221, 231, 243, 0.74));
    box-shadow:
        inset 8px 8px 18px rgba(140, 155, 180, 0.22),
        inset -8px -8px 18px rgba(255, 255, 255, 0.86);
}

.image-viewer-stage img {
    max-width: min(92%, 820px);
    max-height: 58vh;
    object-fit: contain;
    border-radius: 18px;
    transform-origin: center;
    transition: transform 0.18s ease, filter 0.18s ease;
    box-shadow: 0 24px 44px rgba(26, 42, 68, 0.22);
}

.image-viewer-actions,
.viewer-edit-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.viewer-action-button {
    min-height: 42px;
    border: 0;
    border-radius: 15px;
    padding: 0 14px;
    color: #1f2937;
    background: #f8fbff;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    box-shadow:
        7px 7px 15px rgba(140, 155, 180, 0.25),
        -6px -6px 14px rgba(255, 255, 255, 0.92);
}

.viewer-action-button.primary {
    color: white;
    background: linear-gradient(145deg, #18a4ff, #006fe8);
    box-shadow: 0 14px 26px rgba(5, 135, 255, 0.28);
}

.live-bubble.own {
    border-radius: 20px 20px 7px 20px;
    color: white;
    background: linear-gradient(145deg, #16a7ff, #006fe8);
    box-shadow:
        0 18px 28px rgba(0, 111, 232, 0.34),
        0 4px 10px rgba(12, 120, 224, 0.2);
}

.live-composer {
    position: relative;
    z-index: 3;
    min-height: 96px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 18px 24px 22px;
    border-top: 1px solid rgba(150, 160, 180, 0.18);
    background: rgba(238, 243, 250, 0.96);
    box-shadow: 0 -12px 24px rgba(140, 155, 180, 0.12);
}

.composer-field {
    position: relative;
}

.attach-button {
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 20px;
    color: var(--blue);
    background: #f8fbff;
    font-size: 26px;
    font-weight: 900;
    cursor: pointer;
    box-shadow:
        8px 8px 18px rgba(140, 155, 180, 0.28),
        -8px -8px 18px rgba(255, 255, 255, 0.95);
}

.attach-button.has-image {
    color: white;
    background: linear-gradient(145deg, #18a4ff, #006fe8);
    box-shadow: 0 14px 26px rgba(5, 135, 255, 0.30);
}

.selected-image-name {
    grid-column: 2 / 3;
    margin-top: -6px;
    padding-left: 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-composer input {
    width: 100%;
    min-height: 56px;
    border: 0;
    outline: 0;
    border-radius: 20px;
    padding: 0 74px 0 18px;
    background: #eef4fb;
    color: #111827;
    font-size: 16px;
    box-shadow:
        inset 6px 6px 12px rgba(140, 155, 180, 0.24),
        inset -6px -6px 12px rgba(255, 255, 255, 0.96);
}

.composer-field span {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
}

.composer-field span.is-warn {
    color: var(--red);
}

.send-button {
    min-width: 104px;
    min-height: 56px;
    border: 0;
    border-radius: 20px;
    color: white;
    font-weight: 900;
    background: linear-gradient(145deg, #18a4ff, #006fe8);
    box-shadow: 0 14px 26px rgba(5, 135, 255, 0.36);
}

.new-messages-button {
    position: absolute;
    left: 50%;
    bottom: 92px;
    transform: translateX(-50%);
    z-index: 2;
    min-height: 38px;
    border: 0;
    border-radius: 999px;
    padding: 0 16px;
    color: white;
    background: linear-gradient(145deg, #18a4ff, #006fe8);
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 14px 26px rgba(5, 135, 255, 0.36);
}

.send-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pwa-install-button {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 70;
    min-height: 48px;
    border: 0;
    border-radius: 18px;
    padding: 0 18px;
    color: white;
    background: linear-gradient(145deg, #18a4ff, #006fe8);
    font-size: 14px;
    font-weight: 900;
    box-shadow:
        0 18px 30px rgba(5, 135, 255, 0.36),
        8px 8px 18px rgba(110, 125, 150, 0.16);
}

.pwa-install-button[hidden] {
    display: none;
}

@media (max-width: 560px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        padding: 0;
    }

    .chat-app {
        min-height: 100vh;
        height: 100vh;
        border-radius: 0;
        grid-template-columns: 1fr;
    }

    .left-panel {
        display: none;
    }

    .right-panel {
        padding: 18px;
    }

    .chat-header {
        min-height: 64px;
    }

    .messages {
        padding-top: 28px;
    }

    .bubble {
        font-size: 16px;
        max-width: 82%;
    }

    .access-card {
        width: min(390px, calc(100vw - 28px));
        min-height: 410px;
        padding: 24px;
    }

    .chat-body {
        padding: 0;
        min-height: 100dvh;
        align-items: stretch;
        justify-content: stretch;
        overflow: hidden;
    }

    .live-chat-shell {
        width: 100%;
        max-width: 100%;
        height: 100dvh;
        min-height: 0;
        max-height: none;
        border-radius: 0;
        grid-template-columns: 1fr;
        border: 0;
        box-shadow: none;
    }

    .live-sidebar {
        display: none;
    }

    .rooms-open .live-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 45;
        width: min(310px, 88vw);
        display: flex;
        border-radius: 0 28px 28px 0;
        box-shadow: 24px 0 54px rgba(13, 20, 33, 0.24);
    }

    .live-chat-header {
        min-height: 74px;
        padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
        gap: 10px;
    }

    .live-room-avatar {
        width: 48px;
        height: 48px;
    }

    .live-chat-header h1 {
        font-size: 20px;
    }

    .live-chat-header p {
        font-size: 12px;
    }

    .header-actions {
        flex: 0 0 auto;
        gap: 6px;
        margin-left: 0;
    }

    #profileOpenHeaderBtn {
        display: none;
    }

    .header-actions button {
        min-height: 36px;
        padding: 0 9px;
        font-size: 12px;
    }

    .live-message-list {
        padding: 16px 12px;
        gap: 14px;
    }

    .message-content {
        max-width: calc(100% - 50px);
    }

    .live-bubble {
        font-size: 15px;
        padding: 11px 13px;
    }

    .delete-message-button {
        opacity: 1;
        transform: none;
    }

    .message-image {
        width: min(100%, 292px);
        max-height: 340px;
    }

    .image-viewer {
        padding: 10px;
    }

    .image-viewer-panel {
        max-height: 96vh;
        border-radius: 24px;
        padding: 14px;
        grid-template-rows: auto minmax(220px, 1fr) auto auto;
    }

    .image-viewer-stage img {
        max-width: 92%;
        max-height: 50vh;
    }

    .viewer-action-button {
        flex: 1 1 auto;
        min-width: 88px;
    }

    .live-composer {
        min-height: auto;
        grid-template-columns: 46px minmax(0, 1fr) 72px;
        gap: 8px;
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    }

    .attach-button {
        width: 46px;
        height: 46px;
        border-radius: 16px;
    }

    .selected-image-name {
        grid-column: 2 / -1;
        margin-top: -2px;
    }

    .live-composer input {
        min-height: 46px;
        border-radius: 17px;
        padding: 0 14px;
        font-size: 15px;
    }

    .composer-field span {
        display: none;
    }

    .send-button {
        grid-column: auto;
        width: 72px;
        min-width: 72px;
        min-height: 46px;
        border-radius: 16px;
        font-size: 13px;
    }

    .new-messages-button {
        bottom: 74px;
    }

    .pwa-install-button {
        left: 14px;
        right: 14px;
        bottom: 14px;
    }
}
