/* style.css — Author: Kiran (auth UI modernised) */
:root {
    --bg-deep: #0b1220;
    --bg-panel: rgba(18, 28, 48, 0.88);
    --bg-input: #0f1a2e;
    --border: rgba(94, 234, 212, 0.18);
    --border-strong: rgba(94, 234, 212, 0.45);
    --accent: #2dd4bf;
    --accent-2: #38bdf8;
    --accent-press: #14b8a6;
    --text: #e8eef8;
    --muted: #8b9bb4;
    --danger: #fb7185;
    --success: #34d399;
    --radius: 14px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ── Auth Page ── */
body.auth-page {
    font-family: 'DM Sans', 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(56, 189, 248, 0.22), transparent 55%),
        radial-gradient(900px 500px at 100% 0%, rgba(45, 212, 191, 0.18), transparent 50%),
        linear-gradient(160deg, #071018 0%, #0b1220 45%, #101a2e 100%);
    padding: 24px 16px;
}

.auth-shell {
    width: 100%;
    max-width: 440px;
}

.auth-container {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 36px 32px 28px;
    width: 100%;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    text-align: left;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.logo-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #042f2e;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 28px rgba(45, 212, 191, 0.28);
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 2px;
}

.tagline {
    color: var(--muted);
    font-size: 0.88rem;
}

.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 22px;
    background: rgba(7, 16, 28, 0.7);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 5px;
}

.tab {
    padding: 11px 12px;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 9px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    background: linear-gradient(135deg, var(--accent), #22d3ee);
    color: #042f2e;
}

.field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 6px 2px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.input-field {
    width: 100%;
    padding: 13px 15px;
    margin-bottom: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field::placeholder {
    color: #61738f;
}

.input-field:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}

.input-field.small {
    width: auto;
    flex: 1;
    margin-bottom: 0;
}

.otp-input {
    letter-spacing: 0.35em;
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
}

.btn-primary {
    width: 100%;
    padding: 13px 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #042f2e;
    border: none;
    border-radius: 11px;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 10px 24px rgba(45, 212, 191, 0.22);
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    background: linear-gradient(135deg, var(--accent-press), #0ea5e9);
}

.btn-primary:disabled,
.btn-primary.is-loading {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    filter: none;
    box-shadow: none;
}

.btn-primary.small {
    width: auto;
    padding: 12px 20px;
    margin-top: 0;
}

.btn-secondary {
    width: 100%;
    padding: 12px 16px;
    margin-top: 10px;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 11px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--border-strong);
    background: rgba(45, 212, 191, 0.08);
}

.btn-secondary:disabled {
    color: #5b6b82;
    border-color: rgba(255, 255, 255, 0.06);
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
}

.auth-link-row {
    text-align: center;
    margin-top: 16px;
}

.auth-link {
    color: var(--accent-2);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
    color: var(--accent);
}

.back-link {
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 14px;
}

.back-link:hover {
    color: var(--accent);
}

.panel-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.panel-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 18px;
}

.message {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.4;
    min-height: 0;
}

.message.error {
    background: rgba(251, 113, 133, 0.14);
    border: 1px solid rgba(251, 113, 133, 0.35);
    color: #fecdd3;
}

.message.success {
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.35);
    color: #a7f3d0;
}

.security-badge {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--muted);
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.security-badge .dot {
    opacity: 0.5;
}

@media (max-width: 480px) {
    .auth-container {
        padding: 28px 20px 22px;
        border-radius: 18px;
    }
}

/* ── Chat Page (WhatsApp-style layout) ── */
body.chat-page {
    font-family: 'DM Sans', 'Segoe UI', sans-serif;
    background:
        radial-gradient(1000px 500px at 0% 0%, rgba(56, 189, 248, 0.12), transparent 50%),
        linear-gradient(160deg, #071018 0%, #0b1220 50%, #101a2e 100%);
    color: #e8eef8;
    min-height: 100vh;
    display: block;
    padding: 0;
}

.app-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    width: min(1200px, 100vw);
    height: 100vh;
    margin: 0 auto;
    background: #0f1724;
    overflow: hidden;
    border-left: 1px solid rgba(94, 234, 212, 0.12);
    border-right: 1px solid rgba(94, 234, 212, 0.12);
}

.sidebar {
    display: flex;
    flex-direction: column;
    background: #111b2b;
    border-right: 1px solid rgba(94, 234, 212, 0.12);
    min-height: 0;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #0c1522;
    border-bottom: 1px solid rgba(94, 234, 212, 0.1);
}

.avatar,
.peer-avatar,
.chat-item-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.85rem;
    color: #042f2e;
    background: linear-gradient(135deg, #2dd4bf, #38bdf8);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.avatar.has-image,
.peer-avatar.has-image,
.chat-item-avatar.has-image {
    color: transparent;
    background: #0c1522;
    padding: 0;
}

.avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 50%;
    display: block;
}

.sidebar-profile-meta {
    flex: 1;
    min-width: 0;
}

.sidebar-name {
    font-weight: 700;
    font-size: 0.98rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-handle {
    color: #8b9bb4;
    font-size: 0.8rem;
}

.sidebar-actions {
    display: flex;
    gap: 6px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(94, 234, 212, 0.15);
    background: transparent;
    color: #c7d2e5;
    display: grid;
    place-items: center;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.icon-btn:hover {
    background: rgba(45, 212, 191, 0.1);
    color: #2dd4bf;
}

.sidebar-search,
.new-chat-box {
    padding: 10px 12px 0;
}

.new-chat-box {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-bottom: 8px;
}

.new-chat-box .input-field,
.sidebar-search .input-field {
    margin-bottom: 0;
    background: #0b1220;
}

.chat-list-header {
    padding: 12px 16px 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8b9bb4;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 4px 8px 12px;
}

.chat-list-empty {
    color: #6b7c95;
    font-size: 0.85rem;
    padding: 20px 12px;
    text-align: center;
    line-height: 1.45;
}

.chat-item {
    width: 100%;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 10px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    margin-bottom: 2px;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.chat-item.active {
    background: rgba(45, 212, 191, 0.12);
}

.chat-item-body {
    flex: 1;
    min-width: 0;
}

.chat-item-top,
.chat-item-bottom {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.chat-item-name {
    font-weight: 650;
    font-size: 0.94rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    color: #6b7c95;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.chat-item-preview {
    color: #8b9bb4;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.presence-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4b5568;
    flex-shrink: 0;
}

.presence-dot.online {
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.chat-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background:
        linear-gradient(rgba(11, 18, 32, 0.92), rgba(11, 18, 32, 0.92)),
        repeating-linear-gradient(
            -12deg,
            transparent,
            transparent 12px,
            rgba(45, 212, 191, 0.015) 12px,
            rgba(45, 212, 191, 0.015) 13px
        );
}

.chat-empty {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 24px;
}

.chat-empty-card {
    text-align: center;
    max-width: 360px;
}

.chat-empty-card .logo-mark {
    margin: 0 auto 14px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: #042f2e;
    background: linear-gradient(135deg, #2dd4bf, #38bdf8);
}

.chat-empty-card h2 {
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 8px;
}

.chat-empty-card p {
    color: #8b9bb4;
    line-height: 1.5;
}

.chat-container {
    width: 100%;
    height: 100%;
    background: transparent;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: none;
}

.chat-header {
    background: #111b2b;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(94, 234, 212, 0.1);
    color: #e8eef8;
    font-size: 1rem;
}

.peer-meta {
    flex: 1;
    min-width: 0;
}

.peer-name {
    font-weight: 700;
}

.peer-status {
    color: #8b9bb4;
    font-size: 0.78rem;
    text-transform: lowercase;
}

.header-right {
    margin-left: auto;
}

.status-dot {
    font-size: 0.75rem;
    color: #8b9bb4;
}

.status-dot.ok {
    color: #34d399;
}

.mobile-back {
    display: none;
}

.key-panel {
    background: #0c1522;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(94, 234, 212, 0.1);
}

.key-panel h3 {
    color: #2dd4bf;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.key-panel p {
    color: #8b9bb4;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.key-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.fingerprint-box {
    margin-top: 10px;
    background: #0b1220;
    border: 1px solid rgba(45, 212, 191, 0.35);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.78rem;
    color: #99f6e4;
    word-break: break-all;
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.system-msg {
    text-align: center;
    color: #6b7c95;
    font-size: 0.78rem;
    padding: 6px;
}

.typing-indicator {
    padding: 0 18px 6px;
    color: #8b9bb4;
    font-size: 0.8rem;
}

.message-bubble {
    max-width: 68%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.92rem;
    line-height: 1.45;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.message-bubble.sent {
    background: linear-gradient(135deg, #2dd4bf, #22d3ee);
    color: #042f2e;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}

.message-bubble.received {
    background: #182338;
    color: #e8eef8;
    align-self: flex-start;
    border-bottom-left-radius: 3px;
}

.message-bubble .sender {
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 3px;
    opacity: 0.7;
}

.message-bubble .time {
    font-size: 0.68rem;
    opacity: 0.65;
    margin-top: 4px;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    align-items: center;
}

.msg-status.read {
    color: #0369a1;
}

.input-area {
    padding: 12px 14px;
    background: #111b2b;
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid rgba(94, 234, 212, 0.1);
}

.input-area .input-field {
    flex: 1;
    margin-bottom: 0;
    background: #0b1220;
}

.btn-send {
    padding: 12px 18px;
    background: linear-gradient(135deg, #2dd4bf, #38bdf8);
    color: #042f2e;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.btn-send:hover {
    filter: brightness(1.05);
}

.btn-send:disabled {
    background: #243044;
    color: #6b7c95;
    cursor: not-allowed;
}

/* ── Loaders & Skeletons ── */
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    background: rgba(7, 16, 24, 0.82);
    backdrop-filter: blur(8px);
    transition: opacity 0.25s ease;
}

.app-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.app-loader-card {
    text-align: center;
    color: #c7d2e5;
}

.app-loader-card p {
    margin-top: 14px;
    font-size: 0.92rem;
    color: #8b9bb4;
}

.spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid rgba(45, 212, 191, 0.2);
    border-top-color: #2dd4bf;
    animation: spin 0.75s linear infinite;
    margin: 0 auto;
}

.spinner.lg {
    width: 42px;
    height: 42px;
    border-width: 4px;
}

.inline-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(45, 212, 191, 0.2);
    border-top-color: #2dd4bf;
    animation: spin 0.75s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.04) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.04) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-line {
    height: 10px;
    margin-bottom: 8px;
}

.skeleton-line:last-child {
    margin-bottom: 0;
}

.skeleton-bubble {
    height: 38px;
    border-radius: 12px;
    min-width: 120px;
}

.w-35 { width: 35%; }
.w-40 { width: 40%; }
.w-45 { width: 45%; }
.w-50 { width: 50%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-65 { width: 65%; }
.w-70 { width: 70%; }

.skeleton-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(94, 234, 212, 0.1);
}

.skeleton-lines {
    flex: 1;
}

.chat-list-skeleton {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
}

.chat-item-skeleton {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px;
}

.chat-list-header {
    display: flex;
    align-items: center;
}

.messages-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.messages-wrap .messages-area {
    flex: 1;
}

.messages-skeleton {
    position: absolute;
    inset: 0;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: inherit;
    z-index: 2;
}

.msg-skel {
    display: flex;
}

.msg-skel.left {
    justify-content: flex-start;
}

.msg-skel.right {
    justify-content: flex-end;
}

.chat-panel-loader {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    background: rgba(11, 18, 32, 0.72);
    backdrop-filter: blur(2px);
    color: #8b9bb4;
    font-size: 0.88rem;
    text-align: center;
    padding: 20px;
}

/* hidden must win over display:grid/flex */
.app-loader[hidden],
.chat-panel-loader[hidden],
.messages-skeleton[hidden],
.chat-list-skeleton[hidden],
.skeleton-block[hidden],
.inline-spinner[hidden],
.chat-list-empty[hidden] {
    display: none !important;
}

.btn-send.is-loading,
.btn-primary.small.is-loading {
    opacity: 0.7;
    cursor: wait;
}

.chat-error-state {
    margin: auto;
    max-width: 360px;
    text-align: center;
    padding: 28px 18px;
}

.chat-error-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fecdd3;
}

.chat-error-msg {
    color: #8b9bb4;
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 16px;
}

.chat-error-state .btn-secondary {
    width: auto;
    display: inline-block;
    padding: 10px 18px;
}

/* ── Profile page ── */
.profile-shell {
    max-width: 520px;
}

.profile-container {
    max-width: 520px;
}

.profile-hero {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 16px;
    margin-bottom: 22px;
    border-radius: 16px;
    background: rgba(7, 16, 28, 0.65);
    border: 1px solid var(--border);
}

.profile-avatar-lg {
    width: 88px;
    height: 88px;
    min-width: 88px;
    min-height: 88px;
    font-size: 1.35rem;
    border-radius: 50%;
    border: 2px solid rgba(45, 212, 191, 0.35);
}

.profile-hero-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.profile-hero-handle {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.profile-hero-bio {
    color: #a8b7cf;
    font-size: 0.88rem;
    line-height: 1.4;
}

.profile-section {
    margin-bottom: 22px;
    padding-top: 4px;
}

.profile-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.profile-textarea {
    resize: vertical;
    min-height: 84px;
    line-height: 1.45;
}

.field-hint {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
    margin: -6px 0 14px;
}

.field-hint code {
    color: #99f6e4;
    font-size: 0.74rem;
    word-break: break-all;
}

.field-hint.error-hint {
    color: #fecdd3;
}

.btn-danger {
    width: 100%;
    padding: 13px 16px;
    margin-top: 4px;
    border: 1px solid rgba(251, 113, 133, 0.45);
    border-radius: 11px;
    background: rgba(251, 113, 133, 0.12);
    color: #fecdd3;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-danger:hover {
    background: rgba(251, 113, 133, 0.2);
}

.btn-danger:disabled,
.btn-danger.is-loading {
    opacity: 0.65;
    cursor: not-allowed;
}

.danger-section {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(251, 113, 133, 0.22);
    background: rgba(251, 113, 133, 0.05);
}

.profile-skeleton {
    margin-bottom: 8px;
}

.profile-skeleton[hidden],
#profile-content[hidden] {
    display: none !important;
}

.skeleton-hero {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 22px;
}

.skeleton-avatar-lg {
    width: 88px;
    height: 88px;
    min-width: 88px;
    border-radius: 50%;
}

.sk-title {
    margin: 18px 0 12px;
    height: 12px;
}

.skeleton-field {
    height: 46px;
    width: 100%;
    border-radius: 11px;
    margin-bottom: 12px;
}

.skeleton-field.tall {
    height: 84px;
}

.skeleton-btn {
    height: 46px;
    width: 100%;
    border-radius: 11px;
    margin: 8px 0 10px;
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(7, 16, 24, 0.72);
    backdrop-filter: blur(6px);
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal-card {
    width: min(400px, 100%);
    background: #121c2e;
    border: 1px solid rgba(94, 234, 212, 0.18);
    border-radius: 18px;
    padding: 24px 22px 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.modal-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.modal-text {
    color: #8b9bb4;
    font-size: 0.92rem;
    line-height: 1.45;
    margin-bottom: 20px;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.modal-actions.single {
    grid-template-columns: 1fr;
}

.modal-btn {
    margin-top: 0;
    width: 100%;
}

.modal-actions .btn-secondary {
    margin-top: 0;
}

.modal-actions .btn-danger {
    margin-top: 0;
    border-radius: 11px;
}

@media (max-width: 860px) {
    .app-layout {
        grid-template-columns: 1fr;
        width: 100vw;
    }

    .chat-main {
        display: none;
    }

    body.chat-open .sidebar {
        display: none;
    }

    body.chat-open .chat-main {
        display: flex;
    }

    .mobile-back {
        display: grid;
    }
}