
/* =====================================
   ANTHROPIC - DESIGN SYSTEM
===================================== */

:root {
    color-scheme: dark;
    --background: #090a0d;
    --surface: #111318;
    --surface-light: #1a1d24;
    --border: #292d36;
    --text: #f3f1ec;
    --muted: #969ba6;
    --accent: #d5aa78;
    --accent-bright: #edc18e;
    --success: #58c995;
    --danger: #e76b6b;
}

/* =====================================
   RESET
===================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(ellipse at 50% -18%, #25201b 0, transparent 48%),
        radial-gradient(ellipse at 100% 100%, #111722 0, transparent 38%),
        var(--background);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: 3px;
}

a {
    color: inherit;
    text-decoration: none;
}

.hidden {
    display: none !important;
}

/* =====================================
   HEADER
===================================== */

.header,
.chat-header {
    width: 100%;
    min-height: 82px;
    padding: 20px 7%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ffffff0d;
    background: #090a0db8;
    backdrop-filter: blur(18px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.7px;
}

.logo-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #edc18e, #bb8852);
    color: #17120d;
    border-radius: 12px;
    font-size: 21px;
    font-weight: 800;
}

.security-status,
.chat-security {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: var(--muted);
}

/* =====================================
   STATUS
===================================== */

.status-dot {
    width: 8px;
    height: 8px;
    display: inline-block;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px #58c99555;
}

/* =====================================
   HOME
===================================== */

.home-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hero {
    width: 100%;
    max-width: 720px;
    margin: auto;
    padding: 85px 24px;
    text-align: center;
}

@media (min-width: 601px) and (min-height: 700px) {
    .hero {
        display: flex;
        min-height: calc(100vh - 105px);
        min-height: calc(100dvh - 105px);
        flex-direction: column;
        justify-content: center;
    }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: 1px solid #d5aa7833;
    border-radius: 30px;
    background: #d5aa780a;
    color: #c4b29a;
    font-size: 10px;
    letter-spacing: 1.5px;
}

.hero h1 {
    margin-top: 32px;
    font-size: clamp(40px, 7vw, 68px);
    line-height: 1.08;
    letter-spacing: -3.5px;
    text-wrap: balance;
    font-weight: 650;
}

.hero h1 span {
    color: var(--accent-bright);
}

.hero-description {
    max-width: 450px;
    margin: 22px auto 38px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.8;
}

/* =====================================
   CARDS
===================================== */

.create-card,
.login-panel {
    width: 100%;
    max-width: 440px;
    margin: auto;
    padding: 35px;
    background: linear-gradient(155deg, #171a20 0%, #101216 75%);
    border: 1px solid #ffffff12;
    border-radius: 20px;
    box-shadow: 0 28px 80px #00000052, inset 0 1px 0 #ffffff08;
    text-align: left;
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #d5aa7826, #d5aa780d);
    color: var(--accent);
    border: 1px solid #d5aa7820;
    border-radius: 14px;
    margin-bottom: 22px;
}

.create-card h2,
.login-panel h1 {
    font-size: 21px;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.create-card > p,
.login-panel > p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 25px;
}

/* =====================================
   FORMS
===================================== */

form label {
    display: block;
    margin-bottom: 10px;
    font-size: 12px;
    color: #c5c5cc;
}

form input {
    width: 100%;
    height: 49px;
    padding: 0 15px;
    outline: none;
    border: 1px solid #ffffff16;
    border-radius: 11px;
    background: #0b0d11;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

form input:focus {
    border-color: #d5aa7880;
    background: #0e1015;
    box-shadow: 0 0 0 4px #d5aa7812;
}

form input::placeholder {
    color: #686873;
}

/* =====================================
   BUTTONS
===================================== */

#createButton,
#joinButton,
#sendButton {
    width: 100%;
    height: 49px;
    margin-top: 17px;
    padding: 0 18px;
    background: linear-gradient(135deg, #e4b987, #c99a65);
    color: #17120d;
    border: none;
    border-radius: 11px;
    font-weight: 650;
    box-shadow: 0 7px 20px #d5aa7820;
    transition: 0.2s ease;
}

#createButton:hover,
#joinButton:hover,
#sendButton:hover {
    background: linear-gradient(135deg, #f0c99a, #d5aa78);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px #d5aa7830;
}

#createButton:active,
#joinButton:active,
#sendButton:active {
    transform: translateY(0);
}

#createButton span {
    float: right;
    font-size: 18px;
}

/* =====================================
   RESULT
===================================== */

.result {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.result > p:first-child {
    color: var(--success);
    font-weight: 600;
    margin-bottom: 14px;
}

.link-container {
    display: flex;
    gap: 8px;
}

.link-container input {
    min-width: 0;
    font-size: 11px;
}

#copyLink {
    padding: 0 15px;
    border: none;
    border-radius: 8px;
    background: var(--surface-light);
    color: var(--text);
}

.share-warning {
    margin-top: 13px;
    font-size: 11px;
    line-height: 1.6;
    color: var(--muted);
}

/* =====================================
   FEATURES
===================================== */

.features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 42px;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 11px;
    color: var(--muted);
}

.feature span {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border: 1px solid #d5aa7828;
    border-radius: 50%;
    background: #d5aa780a;
    font-size: 9px;
}

.feature span {
    color: var(--accent);
}

/* =====================================
   CHAT PAGE
===================================== */

.chat-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.screen-shield {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #090a0d;
    color: var(--muted);
    text-align: center;
}

.screen-shield p {
    max-width: 320px;
    line-height: 1.6;
}

.leave-button {
    background: #211619;
    color: #e7a2a2;
    border: 1px solid #70353b66;
    border-radius: 10px;
    padding: 11px 15px;
    font-size: 12px;
    transition: 0.2s ease;
}

.leave-button:hover {
    background: #351c21;
    border-color: #9b454d;
}

.chat-container {
    width: 100%;
    max-width: 1000px;
    margin: auto;
    padding: 45px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-panel {
    margin: auto;
}

.login-panel h1 {
    font-size: 24px;
}

/* =====================================
   CONVERSATION
===================================== */

.conversation-panel {
    width: 100%;
    max-width: 860px;
    min-height: 620px;
    max-height: 780px;
    height: min(700px, calc(100dvh - 190px));
    margin: auto;
    background: linear-gradient(155deg, #14171d, #0f1116 72%);
    border: 1px solid #ffffff12;
    border-radius: 20px;
    box-shadow: 0 28px 90px #00000055, inset 0 1px 0 #ffffff07;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.conversation-info {
    min-height: 68px;
    padding: 15px 24px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-bottom: 1px solid #ffffff0d;
    color: var(--muted);
    font-size: 11px;
}

.conversation-info > div:first-child {
    display: flex;
    align-items: center;
    gap: 9px;
}

.chat-notice {
    margin: 8px 20px 0;
    color: #ffb6bd;
    font-size: 12px;
}

/* =====================================
   MESSAGES
===================================== */

.messages-area {
    flex: 1;
    min-height: 350px;
    max-height: 490px;
    overflow-y: auto;
    padding: 28px clamp(18px, 5vw, 48px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background:
        radial-gradient(ellipse at 50% 0%, #ffffff04, transparent 65%),
        transparent;
}

.empty-message {
    margin: auto;
    text-align: center;
    color: var(--muted);
}

.empty-icon {
    font-size: 35px;
    color: var(--accent);
    margin-bottom: 15px;
}

.empty-message h2 {
    color: var(--text);
    font-size: 17px;
    margin-bottom: 9px;
}

.empty-message p {
    font-size: 12px;
}

/* =====================================
   MESSAGE BUBBLES
===================================== */

.message {
    position: relative;
    max-width: 58%;
    width: fit-content;
    margin-right: 28px;
    padding: 7px 10px 5px;
    background: #252a30;
    border: 1px solid #ffffff0d;
    border-radius: 4px 14px 14px 14px;
    box-shadow: 0 3px 9px #00000018;
    transition: outline-color 0.2s, transform 0.2s;
    overflow-wrap: anywhere;
}

.message.own {
    align-self: flex-end;
    margin-right: 0;
    margin-left: 28px;
    background: #3f7771;
    border-color: #4d8881;
    border-radius: 14px 4px 14px 14px;
}

.message.own .message-time {
    color: #bfe3de;
}

.message-content {
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.message > a {
    display: block;
    line-height: 0;
}

.message > a > img,
.message > a > video,
.message > a > audio {
    display: block;
    max-width: 100%;
    border-radius: 11px;
}

.message.sticker-message {
    padding: 6px 9px;
}

.reply-button {
    display: block;
    margin: 0 0 7px auto;
    padding: 2px 0;
    background: transparent;
    color: #b7a58d;
    border: none;
    font-size: 10px;
    opacity: 0;
    transition: opacity 120ms ease;
}

.message:hover .reply-button,
.reply-button:focus-visible {
    opacity: 1;
}

.reply-button:hover {
    color: var(--accent-bright);
}

.message-actions {
    position: absolute;
    z-index: 3;
    right: -24px;
    bottom: 0;
}

.message-actions-trigger {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #d5c9b9;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 120ms ease, background 120ms ease;
}

.message:hover .message-actions-trigger,
.message-actions-trigger:focus-visible,
.message-actions-trigger[aria-expanded="true"] {
    opacity: 1;
}

.message-actions-trigger:hover,
.message-actions-trigger:focus-visible,
.message-actions-trigger[aria-expanded="true"] {
    background: #ffffff12;
    color: var(--accent-bright);
    opacity: 1;
}

.message-actions-menu {
    position: absolute;
    z-index: 2;
    top: auto;
    bottom: 30px;
    right: 0;
    min-width: 130px;
    padding: 5px;
    background: #24262c;
    border: 1px solid #ffffff1a;
    border-radius: 9px;
    box-shadow: 0 8px 24px #00000055;
}

.message-actions-menu[hidden] {
    display: none;
}

.message-actions-item {
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    text-align: left;
    font-size: 12px;
    cursor: pointer;
}

.message-actions-item:hover,
.message-actions-item:focus-visible {
    background: #ffffff0d;
}

.message-actions-item.delete-button {
    color: #e7a2a2;
}

.message-actions-item.delete-button:hover {
    background: #9b454d26;
    color: #f2a9af;
}

.reply-quote {
    width: 100%;
    margin-bottom: 6px;
    padding: 6px 8px;
    text-align: left;
    background: #08090c55;
    border: none;
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
}

.reply-quote strong,
.reply-quote span {
    display: block;
}

.reply-quote strong {
    margin-bottom: 3px;
    color: var(--accent);
    font-size: 10px;
}

.reply-quote span {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 11px;
}

.message-highlight {
    outline: 2px solid var(--accent-bright);
    outline-offset: 4px;
    transform: scale(1.015);
}

.reply-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 20px;
    padding: 12px 14px;
    background: linear-gradient(110deg, #25221f, #191b20);
    border: 1px solid #d5aa7820;
    border-left: 3px solid var(--accent);
    border-radius: 10px;
}

.reply-preview-text {
    min-width: 0;
}

.reply-preview-text strong,
.reply-preview-text span {
    display: block;
}

.reply-preview-text strong {
    color: var(--accent);
    font-size: 10px;
}

.reply-preview-text span {
    max-width: 500px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 11px;
}

.reply-preview button {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    color: var(--muted);
    border: none;
    font-size: 18px;
}

.message-time {
    display: block;
    margin-top: 7px;
    font-size: 10px;
    color: var(--muted);
    text-align: right;
}

.typing-indicator {
    min-height: 24px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px clamp(18px, 5vw, 48px) 0;
    color: var(--muted);
    font-size: 12px;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.typing-dots i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #009688;
    animation: typing-bounce 1.1s infinite ease-in-out;
}

.typing-dots i:nth-child(2) {
    animation-delay: 140ms;
}

.typing-dots i:nth-child(3) {
    animation-delay: 280ms;
}

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.55;
    }
    30% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

/* =====================================
   MESSAGE FORM
===================================== */

.message-form {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid #ffffff0d;
    background: #0d0f13a8;
}

.message-form #sendButton {
    display: none;
}

.message-composer {
    flex: 1;
    min-width: 0;
    height: 54px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 7px 5px 5px;
    background: #f7f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 28px;
    box-shadow: 0 4px 18px #00000018;
}

.message-composer input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #20242a;
    box-shadow: none;
}

.message-composer input[type="text"]::placeholder {
    color: #7e8794;
}

.message-composer input[type="text"]:focus {
    outline: none;
    box-shadow: none;
}

.attachment-button,
.camera-button {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #637084;
    cursor: pointer;
}

.attachment-button:hover,
.camera-button:hover {
    background: #e9edf2;
}

.attachment-button svg,
.camera-button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sticker-control {
    position: relative;
    flex-shrink: 0;
}

.sticker-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #637084;
    cursor: pointer;
}

.sticker-button:hover,
.sticker-button[aria-expanded="true"] {
    background: #e9edf2;
}

.sticker-button svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sticker-picker {
    position: absolute;
    z-index: 5;
    left: 0;
    bottom: calc(100% + 12px);
    width: min(280px, calc(100vw - 32px));
    padding: 14px;
    background: #1b1e25;
    border: 1px solid #ffffff18;
    border-radius: 14px;
    box-shadow: 0 12px 32px #00000066;
}

.sticker-picker > strong {
    display: block;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 12px;
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.sticker-grid button {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    padding: 4px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-size: 28px;
    cursor: pointer;
    transition: background 120ms ease, transform 120ms ease;
}

.sticker-grid button:hover,
.sticker-grid button:focus-visible {
    background: #ffffff10;
    transform: scale(1.08);
}

.sticker-message {
    padding: 2px 6px 5px;
    font-size: 52px;
    line-height: 1.1;
    text-align: center;
    filter: drop-shadow(0 3px 4px #00000055);
}

.vault-button {
    display: none;
}

.vault-button:hover {
    background: #252932;
}

.voice-button {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #009688;
    color: #fff;
    box-shadow: 0 5px 16px #00968855;
    cursor: pointer;
}

.voice-button:hover {
    background: #00a296;
}

.voice-button svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.voice-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.voice-preview {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 20px 12px;
    padding: 10px;
    background: #171a20;
    border: 1px solid #ffffff12;
    border-radius: 12px;
}

.voice-preview audio {
    flex: 1 1 180px;
    min-width: 0;
    height: 40px;
}

.voice-preview button {
    width: auto;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid #ffffff16;
    border-radius: 9px;
    font-size: 11px;
}

.voice-preview button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.voice-preview-send {
    background: #3a3027;
    color: var(--accent-bright);
}

.voice-preview-cancel {
    background: #211619;
    color: #e7a2a2;
}

.voice-button.recording {
    border-color: #a9525e;
    background: #51272f;
    color: #ffd6da;
    animation: voice-pulse 1s infinite;
}

@keyframes voice-pulse {
    50% {
        box-shadow: 0 0 0 5px #a9525e22;
    }
}

.voice-message {
    width: 220px;
    height: 38px;
}

.voice-link {
    display: block;
    text-decoration: none;
}

.video-message {
    display: block;
    width: 220px;
    max-height: 220px;
    border-radius: 8px;
}

.vault-modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
    background: #050609cc;
    backdrop-filter: blur(8px);
}

.vault-card {
    position: relative;
    width: min(520px, 100%);
    max-height: 82vh;
    overflow-y: auto;
    padding: 28px;
    text-align: center;
    background: linear-gradient(155deg, #181b22, #101217);
    border: 1px solid #d5aa7824;
    border-radius: 18px;
    box-shadow: 0 28px 80px #00000080;
}

.vault-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #ffffff09;
    color: var(--muted);
    font-size: 20px;
}

.vault-icon {
    margin-bottom: 10px;
    font-size: 38px;
}

.vault-icon.small {
    margin: 0;
    font-size: 22px;
}

.vault-card h2 {
    margin-bottom: 8px;
    font-size: 20px;
}

.vault-card p {
    color: var(--muted);
    font-size: 12px;
}

.vault-active-description {
    margin: -5px 0 16px;
}

#vaultPinForm {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 18px;
}

#vaultPin {
    text-align: center;
    letter-spacing: 12px;
}

#vaultUnlockButton {
    margin: 0;
    width: auto;
    white-space: nowrap;
}

.vault-secondary {
    width: auto;
    margin: 12px auto 0;
    padding: 8px 12px;
    border: 1px solid #ffffff12;
    border-radius: 8px;
    background: #1b1e25;
    color: var(--text);
    font-size: 11px;
}

.vault-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    text-align: left;
}

.vault-topbar > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vault-topbar h2 {
    margin: 0;
}

.vault-topbar .vault-secondary {
    margin: 0;
}

.vault-files {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-height: 120px;
    margin-bottom: 14px;
}

.vault-media {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    background: #090a0d;
}

.vault-empty {
    grid-column: 1 / -1;
    align-self: center;
}

.vault-upload-button {
    display: flex;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px dashed #d5aa7866;
    border-radius: 10px;
    background: #d5aa780b;
    color: var(--accent);
    font-size: 12px;
    cursor: pointer;
    border-color: #d5aa7840;
}

/* =====================================
   IMAGE PREVIEW
===================================== */

.image-preview {
    padding: 15px 20px;
    border-top: 1px solid #ffffff0d;
}

.image-preview img {
    max-width: 130px;
    max-height: 130px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.image-preview button {
    margin-top: 10px;
    padding: 8px 12px;
    background: #291719;
    color: #ed9999;
    border: none;
    border-radius: 6px;
    font-size: 11px;
}

.chat-disclaimer {
    padding: 0 15px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 10px;
}

/* =====================================
   END SCREEN
===================================== */

.ended-panel {
    margin: auto;
    max-width: 440px;
    padding: 35px;
    text-align: center;
}

.ended-icon {
    font-size: 45px;
    margin-bottom: 20px;
}

.ended-panel h1 {
    font-size: 25px;
    margin-bottom: 13px;
}

.ended-panel p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.back-home {
    display: inline-block;
    margin-top: 25px;
    padding: 13px 22px;
    background: linear-gradient(135deg, #e4b987, #c99a65);
    color: #17120d;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 650;
}

/* =====================================
   ERRORS
===================================== */

.error-message {
    color: var(--danger);
    font-size: 12px;
    margin-top: 13px;
}

/* =====================================
   FOOTER
===================================== */

.footer {
    width: 100%;
    padding: 23px;
    border-top: 1px solid #ffffff0d;
    text-align: center;
}

.footer p:first-child {
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 7px;
}

.footer p:last-child {
    font-size: 10px;
    color: var(--muted);
}

/* =====================================
   SCROLLBAR
===================================== */

.messages-area::-webkit-scrollbar {
    width: 5px;
}

.messages-area::-webkit-scrollbar-thumb {
    background: #414550;
    border-radius: 10px;
}

@media (hover: none) {
    .reply-button {
        opacity: 1;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* =====================================
   RESPONSIVE
===================================== */

@media (max-width: 600px) {
    html.chat-document,
    html.chat-document body {
        height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
    }

    .chat-page {
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    html,
    body {
        min-width: 320px;
        overflow-x: hidden;
    }

    .header,
    .chat-header {
        padding: 16px 18px;
        min-height: 70px;
    }

    form input,
    .message-form input[type="text"] {
        font-size: 16px;
    }

    .logo {
        font-size: 17px;
    }

    .security-status,
    .chat-security {
        display: none;
    }

    .hero {
        min-height: calc(100dvh - 70px);
        padding: 48px 18px 36px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .hero h1 {
        margin-top: 24px;
        font-size: clamp(34px, 11vw, 46px);
        letter-spacing: -2px;
    }

    .hero-description {
        margin: 18px auto 28px;
        font-size: 14px;
    }

    .create-card,
    .login-panel {
        padding: 25px 20px;
    }

    .features {
        gap: 17px;
        flex-direction: column;
        align-items: center;
    }

    .chat-container {
        flex: 1;
        min-height: 0;
        margin: 0 auto;
        padding: 10px;
        justify-content: flex-start;
        overflow: hidden;
    }

    .conversation-panel {
        flex: 1;
        min-height: 0;
        height: 100%;
        max-height: none;
        margin: 0 auto;
        border-radius: 12px;
    }

    .messages-area {
        min-height: 0;
        max-height: none;
        padding: 14px;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }

    .message {
        max-width: 72%;
    }

    .message-form {
        display: flex;
        gap: 8px;
        padding: 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .message-composer {
        height: 50px;
    }

    .message-form #messageInput {
        width: 100%;
        min-width: 0;
        height: 42px;
    }

    .reply-preview {
        margin: 0 12px;
    }

    .conversation-info {
        min-height: 54px;
    }

    .message-form #sendButton {
        display: none;
    }

    .message-form .voice-button {
        width: 50px;
        height: 50px;
    }

    .leave-button {
        padding: 9px 10px;
        font-size: 10px;
    }

}

@media (max-width: 380px) {
    .header,
    .chat-header {
        padding-inline: 12px;
    }

    .logo {
        gap: 8px;
        font-size: 16px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .hero {
        padding-inline: 12px;
    }

    .create-card,
    .login-panel {
        padding: 22px 16px;
    }

    .attachment-button {
        width: 40px;
        height: 40px;
    }

    .message-form {
        grid-template-columns: repeat(4, 38px) minmax(58px, 1fr);
    }

    .message-form #sendButton {
        min-width: 58px;
        font-size: 10px;
    }

    .vault-button,
    .attachment-button,
    .sticker-button,
    .voice-button {
        width: 38px;
        height: 40px;
    }

    .conversation-info {
        padding-inline: 12px;
    }

    .message-form #sendButton {
        min-width: 58px;
        padding-inline: 8px;
    }
}

@media (max-height: 560px) and (orientation: landscape) {
    .header,
    .chat-header {
        min-height: 58px;
        padding-block: 10px;
    }

    .hero {
        min-height: auto;
        padding-block: 24px;
    }

    .hero-badge,
    .hero-description,
    .features,
    .footer {
        display: none;
    }

    .chat-container {
        padding-block: 6px;
    }

    .conversation-panel {
        height: calc(100dvh - 64px);
    }

    .messages-area {
        min-height: 90px;
    }

    .chat-disclaimer {
        display: none;
    }
}
