@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Raleway:wght@700;800;900&display=swap");

:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: #111827;
    --panel-2: #1f2937;
    --line: rgba(255, 255, 255, 0.12);
    --muted: #9ca3af;
    --text: #f9fafb;
    --accent: #facc15;
    --blue: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    height: 100%;
    background: #000;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 56px;
    border-bottom: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(18px);
}

.studio-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 56px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: Raleway, Inter, sans-serif;
    font-weight: 900;
}

.brand-mark {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(250, 204, 21, 0.5);
    border-radius: 6px;
    color: var(--accent);
    background: rgba(250, 204, 21, 0.08);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.home-scroll {
    height: calc(100vh - 100px);
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: none;
}

.hero {
    position: relative;
    display: flex;
    height: 100vh;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 24px;
    text-align: center;
}

.hero iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
    opacity: 0.8;
}

.hero-overlay,
.hero::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.1) 50%, #000 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(920px, 100%);
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    width: 100%;
    margin: 0;
    font-family: Raleway, Inter, sans-serif;
    font-size: 5.3rem;
    font-weight: 900;
    line-height: 0.95;
}

.hero h1,
.hero h2 {
    font-family: Inter, Arial, sans-serif;
    font-size: 3rem;
    font-weight: 600;
    line-height: 1.1;
}

h2 {
    margin: 0 0 18px;
    font-size: 3rem;
    font-weight: 800;
}

h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

p {
    color: #d1d5db;
    line-height: 1.7;
}

.hero-copy {
    width: min(720px, 100%);
    margin: 12px auto 0;
    color: #d1d5db;
    font-size: 0.9rem;
    line-height: 1.625;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 34px;
}

.hero .button-row {
    margin-top: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: 800;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--blue);
    color: white;
}

.btn-yellow {
    background: var(--accent);
    color: #111827;
}

.btn-ghost {
    border-color: rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.02);
    color: white;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.45);
    color: #fecaca;
}

.content-band {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 110px 0;
}

.content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px;
}

.content h2 {
    margin: 0 0 24px;
    color: var(--accent);
    font-size: 1.875rem;
    font-weight: 700;
}

.content-block {
    margin-bottom: 96px;
}

.content-block p,
.text-columns p {
    color: #d1d5db;
    line-height: 1.625;
}

.glass-card {
    border: 1px solid #1f2937;
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.5);
    padding: 32px;
    backdrop-filter: blur(4px);
    transition: box-shadow 0.5s;
}

.glass-card:hover {
    box-shadow: 0 10px 15px -3px rgba(250, 204, 21, 0.1);
}

.accent-link {
    color: var(--accent);
    font-weight: 700;
}

.accent-link:hover {
    text-decoration: underline;
}

.company-shell {
    display: flex;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    flex-direction: column;
}

.company-frame {
    width: 100%;
    border: none;
    flex-shrink: 0;
}

.company-banner {
    height: 40px;
}

.company-header {
    height: 60px;
    z-index: 50;
}

.company-footer {
    width: 100%;
    min-height: 60px;
    border: none;
    background: black;
}

.bounce-arrow {
    position: absolute;
    bottom: 48px;
    left: 50%;
    z-index: 2;
    color: white;
    transform: translateX(-50%);
    animation: bounce 1s infinite;
    pointer-events: none;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateX(-50%) translateY(-25%);
    }

    50% {
        transform: translateX(-50%) translateY(0);
    }
}

.platform-strip {
    display: flex;
    width: 100%;
    height: fit-content;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding: 160px 25px;
    text-align: center;
}

.platform-strip>p:first-child {
    width: 100%;
    color: white;
    font-family: Inter, Arial, sans-serif;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
}

.platform-strip>p:nth-child(2) {
    width: 100%;
    color: #d1d5db;
    font-family: Inter, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.625;
}

.platform-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    text-align: left;
}

.platform-card {
    display: flex;
    min-height: 188px;
    cursor: default;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 24px;
    transition: opacity 0.3s;
}

.platform-card:hover {
    opacity: 0.75;
}

.platform-card span {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 700;
}

.platform-card p {
    color: #d1d5db;
    font-size: 15px;
}

.social-section {
    margin-bottom: 96px;
    text-align: center;
}

.social-section h2 {
    margin-bottom: 24px;
    color: var(--accent);
    font-size: 1.875rem;
    font-weight: 700;
}

.social-section p {
    margin-bottom: 32px;
    color: #d1d5db;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.social-icons a {
    display: flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #1f2937;
    transition: background 0.3s, transform 0.3s;
}

.social-icons a:hover {
    background: #374151;
    transform: scale(1.1);
}

.social-icons svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.content-band.compact {
    padding: 64px 0;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 28px;
    align-items: start;
}

.feature-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.panel,
.auth-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.78);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

.card {
    padding: 24px;
}

.card-icon {
    display: grid;
    width: 36px;
    height: 36px;
    margin-bottom: 16px;
    place-items: center;
    border-radius: 6px;
    background: rgba(37, 99, 235, 0.22);
    color: #93c5fd;
    font-weight: 900;
}

.mock-dashboard {
    overflow: hidden;
    background: #111827;
}

.mock-head,
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.mock-body {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.mock-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 6px;
    background: rgba(31, 41, 55, 0.7);
}

.avatar,
.mini-avatar {
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 999px;
    background: #374151;
    color: white;
    font-weight: 900;
}

.avatar {
    width: 64px;
    height: 64px;
    border: 2px solid #3b82f6;
}

.mini-avatar {
    width: 36px;
    height: 36px;
}

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

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
    font-size: 0.78rem;
    font-weight: 800;
}

.auth-view {
    display: none;
    min-height: calc(100vh - 56px);
    padding: 32px 16px;
    place-items: center;
    background:
        linear-gradient(rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.86)),
        url("https://cdn.ecxogames.ca/ecxogames/files/website/assets/ecxo-interactive-equivalent-apps.png") center / cover;
}

.auth-view.active {
    display: grid;
}

.auth-card {
    width: min(440px, 100%);
    padding: 28px;
    backdrop-filter: blur(18px);
}

.legacy-auth-view {
    min-height: 100vh;
    padding: 0;
    background: url("https://cdn.ecxogames.ca/ecxogames/files/website/backgrounds/montreal-skyview.png") center / cover no-repeat;
}

.legacy-signup-view {
    background-image: url("https://cdn.ecxogames.ca/ecxogames/files/website/backgrounds/coding.png");
}

.legacy-auth-view.active {
    display: block;
}

.legacy-auth-overlay {
    position: relative;
    display: flex;
    width: 100vw;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    padding: 28px 16px;
}

.legacy-signup-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.legacy-back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #2563eb;
    padding: 8px 16px;
    font-weight: 400;
    cursor: pointer;
}

.legacy-auth-overlay h2 {
    margin: 0 0 8px;
    color: white;
    font-size: 0.875rem;
    font-weight: 800;
    text-align: center;
}

.legacy-auth-overlay>p {
    margin: 0 0 24px;
    color: white;
    font-size: 0.875rem;
    font-weight: 400;
    text-align: center;
}

.legacy-forgot {
    border: 0;
    background: transparent;
    color: #dc2626;
    cursor: pointer;
}

.legacy-forgot:hover {
    color: #7f1d1d;
}

.legacy-auth-card {
    width: clamp(300px, 50%, 500px);
    border: 1px solid #fff;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    padding: 32px;
    text-align: center;
    box-shadow: 0 20px 34px rgba(0, 0, 0, 0.9);
}

.legacy-field {
    margin-bottom: 16px;
}

.legacy-field label {
    display: block;
    margin-bottom: 8px;
    color: white;
    font-size: 0.875rem;
    font-weight: 800;
}

.legacy-field input {
    width: 100%;
    border: 1px solid #fff;
    border-radius: 4px;
    background: #000;
    color: white;
    padding: 8px 12px;
    line-height: 1.25;
    outline: none;
}

.legacy-field input:focus {
    outline: 1px solid #fff;
}

.legacy-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.legacy-submit {
    border: 1px solid #fff;
    border-radius: 4px;
    background: #000;
    color: white;
    padding: 8px 16px;
    font-weight: 800;
    cursor: pointer;
}

.legacy-submit:disabled {
    opacity: 0.25;
}

.legacy-switch {
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #2563eb;
    padding: 8px 16px;
    font-weight: 400;
    cursor: pointer;
}

.field {
    display: grid;
    gap: 7px;
    margin-bottom: 14px;
}

.field label {
    color: white;
    font-size: 0.84rem;
    font-weight: 800;
}

.input,
.textarea,
.select {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: rgba(2, 6, 23, 0.6);
    color: white;
    padding: 10px 12px;
    outline: none;
}

.textarea {
    min-height: 96px;
    resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.dashboard-view {
    display: none;
    min-height: calc(100vh - 56px);
    background: #111827;
}

.dashboard-view.active {
    display: flex;
}

body[data-page="dashboard"],
body[data-page="dashboard"] .app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #111827;
}

body[data-page="dashboard"] .notice {
    position: absolute;
    z-index: 60;
    width: 100%;
}

body[data-page="dashboard"] .dashboard-view,
body[data-page="dashboard"] .dashboard-view.active {
    min-height: 100vh;
    height: 100vh;
    min-height: 100dvh;
    height: 100dvh;
    background: #111827;
}

body[data-page="dashboard"] .dashboard-main {
    min-height: 100vh;
    height: 100vh;
    min-height: 100dvh;
    height: 100dvh;
    overflow-y: auto;
    padding: 0;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

body[data-page="dashboard"] .dashboard-sidebar {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

body[data-page="dashboard"] .side-nav {
    display: block;
}

body[data-page="dashboard"] .side-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

body[data-page="dashboard"] .side-btn {
    border-radius: 0;
    font-weight: 400;
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

body[data-page="dashboard"] .side-btn.active {
    border-left: 4px solid #3b82f6;
    background: rgba(30, 64, 175, 0.3);
    color: #fff;
}

body[data-page="dashboard"] .side-btn:not(.active) {
    border-left: 4px solid transparent;
}

body[data-page="dashboard"] .side-btn i,
.dashboard-mobile-nav i {
    width: 20px;
    flex: 0 0 20px;
    text-align: center;
}

body[data-page="dashboard"] .avatar {
    overflow: visible;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.2), inset 0 0 28px rgba(0, 0, 0, 0.25);
}

.status-dot {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    border: 2px solid #111827;
    border-radius: 999px;
    background: #9ca3af;
}

.status-dot.online {
    background: #22c55e;
}

.status-dot.offline {
    background: #d1d5db;
}

.status-dot.away {
    background: #eab308;
}

body[data-page="dashboard"] .tab {
    min-height: 100%;
    width: 100%;
}

.dashboard-overview-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
}

body[data-page="dashboard"] .tab > .bg-gray-800,
body[data-page="dashboard"] #dashboardTab section.bg-gray-800 {
    border-radius: 12px;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.24);
}

body[data-page="dashboard"] #dashboardTab > section:first-child > div {
    min-height: 132px;
    border-radius: 12px;
}

body[data-page="dashboard"] #dashboardTab > section:first-child > div:hover {
    filter: brightness(1.05);
}

body[data-page="dashboard"] #dashboardTab > section:first-child .p-2 {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    padding: 0;
}

body[data-page="dashboard"] #statFriends,
body[data-page="dashboard"] #statFollowers,
body[data-page="dashboard"] #statStatus,
body[data-page="dashboard"] #statSubscription {
    line-height: 1.1;
}

.overview-status-menu {
    position: relative;
}

.overview-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(75, 85, 99, 0.7);
    border-radius: 999px;
    background: rgba(55, 65, 81, 0.5);
    color: #d1d5db;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 5px 9px;
}

.overview-status-pill.online {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(20, 83, 45, 0.5);
    color: #86efac;
}

.overview-status-pill.away {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(120, 53, 15, 0.5);
    color: #fcd34d;
}

.overview-status-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 70;
    width: 144px;
    overflow: hidden;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #1f2937;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

.overview-status-dropdown button,
.overview-status-dropdown input {
    width: 100%;
    border: 0;
    background: transparent;
    color: #d1d5db;
    font-size: 0.85rem;
    padding: 9px 10px;
    text-align: left;
}

.overview-status-dropdown button {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.overview-status-dropdown button:hover {
    background: rgba(55, 65, 81, 0.75);
}

.overview-status-dropdown input {
    border-top: 1px solid rgba(55, 65, 81, 0.8);
    color: #fcd34d;
    outline: 0;
}

.status-dot-inline {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #6b7280;
}

.status-dot-inline.online {
    background: #22c55e;
}

.status-dot-inline.offline {
    background: #6b7280;
}

.status-dot-inline.away {
    background: #f59e0b;
}

.overview-friend-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.overview-friend-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    flex: none;
    border: 1px solid rgba(29, 78, 216, 0.5);
    border-radius: 999px;
    background: rgba(30, 58, 138, 0.5);
    color: #60a5fa;
}

.overview-friend-info {
    min-width: 0;
    flex: 1;
}

.overview-friend-info p {
    margin: 0;
    overflow: hidden;
    color: #e5e7eb;
    font-size: 0.9rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-friend-info span {
    display: block;
    overflow: hidden;
    color: #9ca3af;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-mobile-nav {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 55;
    display: none;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid #374151;
    background: #111827;
    box-shadow: 0 -16px 34px rgba(0, 0, 0, 0.28);
    padding: 0 8px env(safe-area-inset-bottom);
}

.dashboard-mobile-nav button {
    display: grid;
    min-height: 70px;
    place-items: center;
    align-content: center;
    gap: 4px;
    border: 0;
    scale: 0.9;
    background: transparent;
    color: #d1d5db;
    font-size: 0.75rem;
    font-weight: 600;
    transition: color 200ms ease, transform 200ms ease;
}

.dashboard-mobile-nav button.active {
    color: #60a5fa;
    transform: scale(1.04);
}

.dashboard-mobile-nav i {
    font-size: 1.35rem;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.dashboard-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar {
    display: flex;
    flex: 0 0 240px;
    width: 240px;
    min-height: calc(100vh - 56px);
    flex-direction: column;
    background: linear-gradient(180deg, #1f2937, #111827);
    border-right: 1px solid var(--line);
}

.profile-block {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.side-nav {
    display: grid;
    gap: 2px;
    padding: 14px 0;
}

.side-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    border: 0;
    border-left: 4px solid transparent;
    background: transparent;
    color: #d1d5db;
    padding: 0 18px;
    text-align: left;
}

.side-btn.active {
    border-left-color: #3b82f6;
    background: rgba(30, 64, 175, 0.32);
    color: white;
}

.side-spacer {
    flex: 1;
}

.dashboard-main {
    flex: 1;
    min-width: 0;
    min-height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 24px;
}

@media (min-width: 861px) {
    body[data-page="dashboard"] .dashboard-view > div {
        width: 100%;
    }

    body[data-page="dashboard"] .dashboard-main {
        width: calc(100% - 15rem) !important;
        max-width: none;
        flex: 1 1 calc(100% - 15rem);
    }

    body[data-page="dashboard"] .tab {
        max-width: none;
    }
}

.tab {
    display: none;
}

.tab.active {
    display: block;
}

.stat-card {
    min-height: 132px;
    padding: 20px;
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.5), rgba(30, 64, 175, 0.16));
}

.stat-card.green {
    border-color: rgba(34, 197, 94, 0.32);
    background: linear-gradient(135deg, rgba(20, 83, 45, 0.5), rgba(22, 101, 52, 0.14));
}

.stat-card.purple {
    border-color: rgba(168, 85, 247, 0.32);
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.44), rgba(107, 33, 168, 0.12));
}

.stat-card.amber {
    border-color: rgba(245, 158, 11, 0.35);
    background: linear-gradient(135deg, rgba(146, 64, 14, 0.44), rgba(180, 83, 9, 0.12));
}

.stat-label {
    color: #bfdbfe;
    font-size: 0.86rem;
    font-weight: 800;
}

.stat-number {
    margin-top: 14px;
    color: white;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.1;
}

.panel {
    overflow: hidden;
    margin-top: 18px;
    background: #1f2937;
}

.panel-body {
    padding: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.list {
    display: grid;
    gap: 8px;
}

.list-item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 6px;
    background: rgba(17, 24, 39, 0.72);
    transition: background-color 160ms ease;
}

.list-item:hover {
    background: rgba(55, 65, 81, 0.52);
}

#messagesList > .conversation-item {
    position: relative;
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center;
    min-height: 60px;
    gap: 12px;
    width: 100%;
    padding: 9px 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

#messagesList > .conversation-item:hover {
    border-color: rgba(147, 197, 253, 0.42);
    transform: translateY(-1px);
}

#messagesList > .conversation-item:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.conversation-item > .conversation-avatar {
    position: relative;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.85rem;
}

.conversation-item > .conversation-info {
    display: flex !important;
    flex: 1 1 auto;
    min-width: 0;
    flex-flow: column nowrap !important;
    justify-content: center;
    gap: 3px;
}

.conversation-item > .conversation-info strong {
    overflow: hidden;
    color: #f9fafb;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-context {
    display: block;
    overflow: hidden;
    font-size: 0.74rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.messages-grid {
    display: block;
    flex: 1 1 0;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

body[data-page="dashboard"] .dashboard-main.messages-active {
    overflow: hidden;
}

body[data-page="dashboard"] .dashboard-main.messages-active > div {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    padding: 0 !important;
}

body[data-page="dashboard"] #messagesTab.active {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 0;
    flex-direction: column;
    overflow: hidden;
}

body[data-page="dashboard"] #messagesTab > div {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 0;
    flex-direction: column;
}

.messages-titlebar {
    flex: 0 0 auto;
}

body[data-page="dashboard"] #messagesTab.conversation-open .messages-titlebar {
    display: none !important;
}

.messages-column,
.chat-panel {
    min-width: 0;
    min-height: 0;
}

.messages-column {
    height: 100%;
    padding: 14px;
    overflow-y: auto;
}

.messages-grid.conversation-open .messages-column {
    display: none;
}

.messages-grid.conversation-open .chat-panel {
    display: flex;
}

.conversation-form {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.42);
}

.conversation-form .field {
    margin-bottom: 0;
}

.messages-section {
    margin-top: 18px;
}

.messages-column .messages-section:first-child {
    margin-top: 0;
}

.messages-section h4,
.chat-head h4 {
    margin: 0 0 10px;
    color: white;
    font-size: 1rem;
    font-weight: 800;
}

.chat-panel {
    display: none;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.44);
    flex-direction: column;
    justify-content: space-between;
}

.message-form .btn {
    width: 42px;
    min-width: 42px;
    padding: 0;
    border-radius: 999px;
}

.chat-head {
    display: grid;
    grid-template-columns: 36px 40px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex: 0 0 auto;
}

#activeConversationAvatar {
    width: 40px;
    height: 40px;
}

.chat-back-btn {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: rgba(55, 65, 81, 0.7);
    color: #fff;
}

.chat-settings-btn {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: 8px;
    background: rgba(55, 65, 81, 0.7);
    color: #d1d5db;
}

.chat-settings-label {
    display: none;
}

.chat-settings-btn:hover {
    background: rgba(75, 85, 99, 0.95);
    color: white;
}

.chat-head p {
    margin: 0;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    overscroll-behavior: none;
    padding: 14px;
    min-height: 0;
    flex: 1 1 0;
}

.chat-messages > * {
    flex-shrink: 0;
}

.message-bubble {
    width: fit-content;
    max-width: min(560px, 86%);
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(31, 41, 55, 0.95);
}

.message-bubble.own {
    align-self: flex-end;
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(30, 64, 175, 0.42);
}

.message-bubble strong {
    display: block;
    color: white;
    font-size: 0.82rem;
}

.message-bubble-head {
    display: flex;
    min-height: 24px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.message-delete-btn {
    display: inline-grid;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #9ca3af;
    font-size: 0.72rem;
    opacity: 0.7;
}

.message-delete-btn:hover,
.message-delete-btn:focus-visible {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    opacity: 1;
}

.message-image {
    display: block;
    margin-top: 7px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    background: rgba(3, 7, 18, 0.28);
}

.message-image img {
    display: block;
    width: auto;
    max-width: min(360px, 70vw);
    max-height: 420px;
    object-fit: contain;
}

.message-bubble p {
    margin: 4px 0;
    overflow-wrap: anywhere;
}

.message-bubble > .message-time {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.72rem;
}

.message-typing {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: min(420px, 86%);
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(31, 41, 55, 0.72);
    color: #d1d5db;
    font-size: 0.82rem;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #d1d5db;
    animation: typingPulse 1s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typingPulse {
    0%,
    80%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

.message-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex: 0 0 auto;
}

.message-compose-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
}

.message-form .input {
    min-width: 0;
}

.message-attach-btn {
    display: grid;
    width: 42px;
    min-width: 42px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(55, 65, 81, 0.72);
    color: #bfdbfe;
}

.message-attach-btn:hover,
.message-attach-btn:focus-visible {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(55, 65, 81, 1);
    color: #fff;
}

.message-attachment-preview {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 32px;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border: 1px solid rgba(96, 165, 250, 0.32);
    border-radius: 9px;
    background: rgba(30, 64, 175, 0.16);
}

.message-attachment-preview img {
    width: 44px;
    height: 44px;
    border-radius: 7px;
    object-fit: cover;
}

.message-attachment-preview > span {
    overflow: hidden;
    color: #dbeafe;
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-attachment-preview button {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: rgba(55, 65, 81, 0.75);
    color: #d1d5db;
}

.message-attachment-preview button:hover,
.message-attachment-preview button:focus-visible {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}

.group-settings-section {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(17, 24, 39, 0.48);
}

.group-settings-section h3 {
    margin: 0;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
}

.group-settings-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.group-member-list {
    display: grid;
    gap: 8px;
}

.group-member-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 9px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    background: rgba(2, 6, 23, 0.38);
}

.group-member-row .ecxo-user-photo {
    width: 42px;
    height: 42px;
}

.group-member-copy {
    min-width: 0;
}

.group-member-copy strong,
.group-member-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-member-copy strong {
    color: #fff;
    font-size: 0.88rem;
}

.group-member-copy small {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 0.74rem;
}

.group-member-role {
    color: #bfdbfe !important;
    font-size: 0.72rem;
    font-weight: 800;
}

.mdl .group-member-remove {
    width: auto !important;
    min-height: 34px;
    aspect-ratio: auto !important;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(185, 28, 28, 0.82) !important;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
}

.group-member-search-results:empty {
    display: none;
}

.membership-tab-btn.membership-tier-bronze.active,
.membership-tab-btn.membership-tier-bronze:hover {
    border-left-color: #b45309;
    color: #fbbf24;
}

.membership-tab-btn.membership-tier-silver.active,
.membership-tab-btn.membership-tier-silver:hover {
    border-left-color: #cbd5e1;
    color: #e2e8f0;
}

.membership-tab-btn.membership-tier-gold.active,
.membership-tab-btn.membership-tier-gold:hover {
    border-left-color: #f59e0b;
    color: #fcd34d;
}

.account-message {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px 16px;
    border: 1px solid #166534;
    border-radius: 8px;
    background: rgba(20, 83, 45, 0.3);
    color: #4ade80;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.account-message-icon {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: rgba(22, 101, 52, 0.7);
}

.friends-page {
    width: 100%;
}

.friends-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.friends-header h1 {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: #f3f4f6;
    font-size: clamp(1.5rem, 2vw, 1.875rem);
    font-weight: 800;
}

.friends-header h1 i {
    color: #60a5fa;
}

.friends-header p {
    margin: 4px 0 0;
    color: #9ca3af;
    font-size: 0.875rem;
}

.friends-search-wrap {
    position: relative;
    width: min(420px, 100%);
}

.friends-search-wrap i {
    position: absolute;
    top: 50%;
    left: 14px;
    color: #6b7280;
    transform: translateY(-50%);
}

.friends-search-wrap input {
    width: 100%;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #1f2937;
    color: #e5e7eb;
    padding: 10px 14px 10px 40px;
    outline: 0;
}

.friends-search-wrap input:focus {
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.75);
}

.friends-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid #374151;
}

.friends-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0 16px;
}

.friends-tabs button:hover,
.friends-tabs button.active {
    color: #60a5fa;
}

.friends-tabs button.active {
    border-bottom-color: #60a5fa;
}

.friends-refresh-bottom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: 0;
    border-top: 1px solid #374151;
    background: rgba(55, 65, 81, 0.5);
    color: #93c5fd;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 800;
    padding: 13px;
}

.friends-refresh-bottom:hover {
    background: rgba(55, 65, 81, 0.9);
}

.friends-tab-badge {
    display: inline-grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 999px;
    background: #2563eb;
    color: white;
    font-size: 0.72rem;
}

.friends-success {
    margin-bottom: 16px;
    border: 1px solid rgba(22, 163, 74, 0.45);
    border-radius: 8px;
    background: rgba(20, 83, 45, 0.3);
    color: #86efac;
    padding: 12px 14px;
}

.friends-panel {
    overflow: hidden;
    border: 1px solid #374151;
    border-radius: 12px;
    background: #1f2937;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.friends-view {
    display: none;
}

.friends-view.active {
    display: block;
}

.friends-panel-head {
    padding: 20px;
    border-bottom: 1px solid #374151;
    background: rgba(31, 41, 55, 0.8);
}

.friends-panel-head h3 {
    margin: 0;
    color: #f3f4f6;
    font-size: 1rem;
    font-weight: 800;
}

.friends-panel-head p {
    margin: 4px 0 0;
    color: #9ca3af;
    font-size: 0.75rem;
}

.friends-list {
    min-height: 190px;
}

.friends-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(55, 65, 81, 0.7);
    transition: background 180ms ease;
}

.friends-row:last-child {
    border-bottom: 0;
}

.friends-row:hover {
    background: rgba(55, 65, 81, 0.5);
}

.friends-avatar {
    position: relative;
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    overflow: visible;
    border-radius: 999px;
    background: linear-gradient(135deg, #7c3aed, #581c87);
    color: white;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.24);
}

.friends-avatar-image {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    overflow: hidden;
    border-radius: inherit;
}

.friends-avatar.search {
    background: linear-gradient(135deg, #16a34a, #14532d);
}

.friends-avatar.request {
    background: linear-gradient(135deg, #ca8a04, #713f12);
}

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

.friends-status-dot {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 12px;
    height: 12px;
    border: 2px solid #1f2937;
    border-radius: 999px;
    background: #6b7280;
}

.friends-status-dot.online {
    background: #22c55e;
}

.friends-status-dot.offline {
    background: #ef4444;
}

.friends-status-dot.away {
    background: #eab308;
}

.friends-info {
    min-width: 0;
    flex: 1;
}

.friends-info strong {
    display: block;
    overflow: hidden;
    color: #e5e7eb;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friends-info p {
    margin: 2px 0 0;
    overflow: hidden;
    color: #9ca3af;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friends-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.friends-actions button,
.friends-actions a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 140px;
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 7px 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    transition: background 180ms ease, opacity 180ms ease;
}

.friends-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.friends-action-blue {
    background: #2563eb;
}

.friends-action-blue:hover:not(:disabled) {
    background: #1e3a8a;
}

.friends-action-green {
    background: #15803d;
}

.friends-action-green:hover:not(:disabled) {
    background: #16a34a;
}

.friends-action-red {
    background: #b91c1c;
}

.friends-action-red:hover:not(:disabled) {
    background: #dc2626;
}

.friends-action-gray {
    background: #4b5563;
}

.friends-action-gray:hover:not(:disabled) {
    background: #6b7280;
}

.friends-empty {
    display: grid;
    min-height: 220px;
    place-items: center;
    padding: 40px;
    text-align: center;
    color: #9ca3af;
}

.friends-empty i,
.friends-loading i {
    display: block;
    margin-bottom: 16px;
    color: #6b7280;
    font-size: 3rem;
    opacity: 0.55;
}

.friends-empty p {
    margin: 0;
}

.friends-empty small {
    display: block;
    margin-top: 8px;
    color: #9ca3af;
}

.friends-loading {
    display: grid;
    min-height: 220px;
    place-items: center;
    padding: 40px;
    text-align: center;
    color: #9ca3af;
}

.friends-spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto 16px;
    border: 4px solid #3b82f6;
    border-top-color: transparent;
    border-radius: 999px;
    animation: typingPulse 1s ease-in-out infinite;
}

/* Public user profile */
body[data-page="profile"] {
    width: 100%;
    height: 100dvh;
    background: #111827;
}

.profile-page {
    width: 100%;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: none;
    background: #111827;
    color: #f9fafb;
    -webkit-overflow-scrolling: touch;
}

.profile-state {
    display: grid;
    min-height: 100dvh;
    place-items: center;
    align-content: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
    color: #9ca3af;
}

.profile-state i {
    color: #4b5563;
    font-size: 4rem;
}

.profile-state h1,
.profile-state p {
    margin: 0;
}

.profile-state a {
    border-radius: 8px;
    background: #facc15;
    color: #111827;
    padding: 11px 18px;
    font-weight: 800;
}

.profile-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #374151;
    border-top-color: #facc15;
    border-radius: 999px;
    animation: profileSpin 0.8s linear infinite;
}

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

.profile-shell {
    min-height: 100%;
    padding-bottom: calc(48px + env(safe-area-inset-bottom));
}

.profile-banner {
    position: relative;
    width: 100%;
    height: clamp(190px, 28vw, 300px);
    overflow: hidden;
    background: linear-gradient(115deg, #172554, #581c87 55%, #111827);
}

.profile-banner > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-banner-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #111827 0, rgba(17, 24, 39, 0.12) 70%);
}

.profile-home-link,
.profile-image-edit {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    z-index: 2;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    background: rgba(0,0,0,.55);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.profile-home-link { left: 18px; }
.profile-image-edit { right: 18px; }

.profile-content {
    position: relative;
    z-index: 3;
    width: min(1024px, calc(100% - 32px));
    margin: -78px auto 0;
}

.profile-identity {
    display: flex;
    align-items: flex-end;
    gap: 22px;
    min-height: 170px;
    margin-bottom: 32px;
}

.profile-avatar-wrap {
    position: relative;
    flex: 0 0 auto;
}

.profile-avatar {
    display: grid;
    width: 156px;
    height: 156px;
    place-items: center;
    overflow: hidden;
    border: 5px solid #111827;
    border-radius: 999px;
    background: #374151;
    color: #6b7280;
    font-size: 3.4rem;
    box-shadow: 0 18px 38px rgba(0,0,0,.38);
}

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

.profile-avatar-edit {
    position: absolute;
    inset: 5px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(0,0,0,.58);
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 180ms ease;
}

.profile-avatar-wrap:hover .profile-avatar-edit { opacity: 1; }

.profile-status-dot {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 4;
    width: 25px;
    height: 25px;
    border: 5px solid #111827;
    border-radius: 999px;
    padding: 0;
}

.profile-status-dot.online,
.profile-presence i.online,
.profile-status-menu span.online { background: #22c55e; }
.profile-status-dot.away,
.profile-presence i.away,
.profile-status-menu span.away { background: #eab308; }
.profile-status-dot.busy,
.profile-presence i.busy,
.profile-status-menu span.busy { background: #ef4444; }
.profile-status-dot.offline,
.profile-presence i.offline,
.profile-status-menu span.offline { background: #6b7280; }

.profile-status-menu {
    position: absolute;
    bottom: 0;
    left: calc(100% + 10px);
    z-index: 8;
    width: 140px;
    border: 1px solid #374151;
    border-radius: 10px;
    background: #1f2937;
    padding: 6px;
    box-shadow: 0 20px 38px rgba(0,0,0,.4);
}

.profile-status-menu button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #d1d5db;
    padding: 9px;
    text-align: left;
}

.profile-status-menu button:hover { background: #374151; }
.profile-status-menu span { width: 9px; height: 9px; border-radius: 99px; }

.profile-name-block {
    min-width: 0;
    flex: 1;
    padding-bottom: 10px;
}

.profile-name-block h1 {
    margin: 0;
    overflow-wrap: anywhere;
    color: #fff;
    font-size: clamp(2rem, 4vw, 2.6rem);
    line-height: 1.05;
}

.profile-name-block > p {
    margin: 5px 0;
    color: #9ca3af;
    font-size: 1.05rem;
}

.profile-presence {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #9ca3af;
    font-size: .82rem;
}

.profile-presence i { width: 8px; height: 8px; border-radius: 99px; }
.profile-presence b {
    margin-left: 5px;
    border: 1px solid rgba(250,204,21,.3);
    border-radius: 99px;
    background: rgba(250,204,21,.12);
    color: #facc15;
    padding: 2px 8px;
    font-size: .7rem;
}

.profile-actions {
    display: flex;
    gap: 10px;
    padding-bottom: 12px;
}

.profile-action {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #fff;
    padding: 9px 16px;
    font-weight: 750;
    white-space: nowrap;
}

.profile-action.blue { background: #2563eb; }
.profile-action.green { background: #15803d; }
.profile-action.red { background: #991b1b; }
.profile-action.purple { background: #7e22ce; }
.profile-action.gray { border-color: #4b5563; background: #374151; }
.profile-action:disabled { opacity: .55; cursor: not-allowed; }

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(245px, 1fr);
    gap: 24px;
}

.profile-main-column,
.profile-stats {
    display: grid;
    align-content: start;
    gap: 20px;
}

.profile-card,
.profile-stat {
    border: 1px solid rgba(75,85,99,.72);
    border-radius: 16px;
    background: rgba(31,41,55,.76);
    box-shadow: 0 18px 36px rgba(0,0,0,.2);
}

.profile-card { padding: 22px; }

.profile-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-left: 4px solid;
    padding-left: 11px;
}

.profile-card-head.yellow { border-color: #eab308; }
.profile-card-head.blue { border-color: #3b82f6; }
.profile-card-head h2 { margin: 0; color: #fff; font-size: 1.1rem; }

.profile-edit-button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #9ca3af;
}
.profile-edit-button:hover { background: #374151; color: #fff; }

.profile-bio {
    margin: 0;
    color: #d1d5db;
    line-height: 1.65;
    white-space: pre-wrap;
}
.profile-bio.empty { color: #6b7280; font-style: italic; }

.profile-editor { display: grid; gap: 8px; }
.profile-editor textarea {
    min-height: 130px;
    resize: vertical;
    border: 1px solid #4b5563;
    border-radius: 9px;
    background: rgba(17,24,39,.75);
    color: #f3f4f6;
    padding: 12px;
}
.profile-editor small { color: #9ca3af; text-align: right; }
.profile-editor > div,
.profile-social-editor-actions { display: flex; justify-content: flex-end; gap: 9px; }
.profile-editor button,
.profile-social-editor-actions button {
    border: 0;
    border-radius: 8px;
    background: #374151;
    color: #fff;
    padding: 8px 13px;
}
.profile-editor button[type="submit"],
.profile-social-editor-actions button[type="submit"] { background: #2563eb; }

.profile-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
}
.profile-socials a {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 12px;
    background: rgba(55,65,81,.7);
    color: #d1d5db;
    font-size: 1.4rem;
}
.profile-socials a:hover { background: #4b5563; color: #fff; transform: translateY(-2px); }
.profile-socials p { margin: 0; color: #6b7280; font-style: italic; }

.profile-social-editor { display: grid; gap: 10px; }
.profile-social-editor label {
    display: grid;
    grid-template-columns: 25px 80px minmax(0,1fr);
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    text-transform: capitalize;
}
.profile-social-editor input {
    min-width: 0;
    border: 1px solid #4b5563;
    border-radius: 8px;
    background: rgba(17,24,39,.75);
    color: #fff;
    padding: 9px 10px;
}

.profile-stat {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 14px;
    width: 100%;
    border-color: rgba(75,85,99,.72);
    color: #6b7280;
    padding: 17px;
    text-align: left;
}
.profile-stat:hover { border-color: #3b82f6; background: #1f2937; }
.profile-stat > i:first-child {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 999px;
    background: rgba(59,130,246,.1);
    font-size: 1.15rem;
}
.profile-stat > i.blue { color: #60a5fa; }
.profile-stat > i.purple { color: #c084fc; background: rgba(168,85,247,.1); }
.profile-stat > i.green { color: #4ade80; background: rgba(34,197,94,.1); }
.profile-stat span { display: grid; }
.profile-stat small { color: #9ca3af; font-weight: 600; }
.profile-stat strong { color: #fff; font-size: 1.55rem; }

.profile-list-dialog {
    width: min(440px, calc(100% - 28px));
    max-height: min(650px, 80dvh);
    overflow: hidden;
    border: 1px solid #4b5563;
    border-radius: 16px;
    background: #1f2937;
    color: #fff;
    padding: 0;
    box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
.profile-list-dialog::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(4px); }
.profile-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #374151;
    padding: 17px 20px;
}
.profile-dialog-head h2 { margin: 0; font-size: 1.15rem; }
.profile-dialog-head button { border: 0; background: transparent; color: #9ca3af; padding: 8px; }
.profile-dialog-list { max-height: 60dvh; overflow-y: auto; overscroll-behavior: none; padding: 8px; }
.profile-list-user {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 11px;
    border-radius: 10px;
    padding: 10px;
}
.profile-list-user:hover { background: #374151; }
.profile-list-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    overflow: hidden;
    border-radius: 999px;
    background: #4b5563;
}
.profile-list-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-list-user > span:nth-child(2) { display: grid; min-width: 0; }
.profile-list-user strong,
.profile-list-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-list-user small { color: #9ca3af; }
.profile-list-empty { padding: 30px; color: #9ca3af; text-align: center; }

.membership-page {
    display: flex;
    height: 100%;
    gap: 20px;
    flex-direction: column;
}

.membership-main-view {
    display: flex;
    position: relative;
    gap: 20px;
    height: 100%;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.membership-payment-view {
    display: flex;
    position: relative;
    gap: 20px;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.membership-main-view.hidden,
.membership-payment-view.hidden {
    display: none;
}

.membership-summary-panel {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
}

.membership-kicker {
    color: #60a5fa;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.membership-summary-copy h1 {
    margin: 4px 0;
    color: #f9fafb;
    font-size: 1.65rem;
    font-weight: 800;
}

.membership-summary-copy p {
    margin: 0;
    color: #9ca3af;
}

.membership-current {
    display: inline-grid;
    gap: 2px;
    min-width: 170px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.65);
    padding: 12px 14px;
    text-align: right;
}

.membership-current span {
    color: #9ca3af;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.membership-current strong {
    color: white;
    font-size: 1.1rem;
}

.membership-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

.membership-card {
    display: grid;
    gap: 16px;
    align-content: start;
    height: fit-content;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #1f2937;
    padding: 18px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.membership-card.active {
    transform: translateY(-2px);
}

.membership-card.bronze.active {
    border-color: #b45309;
    box-shadow: 0 0 34px rgba(180, 83, 9, 0.15);
}

.membership-card.silver.active {
    border-color: #cbd5e1;
    box-shadow: 0 0 34px rgba(203, 213, 225, 0.12);
}

.membership-card.gold.active {
    border-color: #f59e0b;
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.18);
}

.membership-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.membership-card-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
    color: white;
}

.membership-card.bronze .membership-card-icon,
.membership-card.bronze button {
    background: #b45309;
}

.membership-card.silver .membership-card-icon,
.membership-card.silver button {
    background: #64748b;
}

.membership-card.gold .membership-card-icon,
.membership-card.gold button {
    background: #f59e0b;
    color: #111827;
}

.membership-card h2 {
    margin: 0;
    color: #f9fafb;
    font-size: 1.1rem;
    font-weight: 900;
}

.membership-card p {
    margin: 0;
    color: #d1d5db;
}

.membership-card strong {
    color: white;
    font-size: 0.95rem;
}

.membership-card button {
    align-self: end;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: 900;
    padding: 11px 14px;
}

.membership-card.active button {
    opacity: 0.78;
}

.membership-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    justify-self: start;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #1f2937;
    color: #d1d5db;
    cursor: pointer;
    font-weight: 800;
    padding: 10px 14px;
    position: absolute;
    top: 10px;
    left: 10px;
}

.membership-back-button:hover {
    border-color: #4b5563;
    background: #263244;
    color: #f9fafb;
}

.membership-terminal {
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow: hidden;
    width: min(100%, 760px);
    justify-self: center;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #1f2937;
    padding: 20px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.membership-terminal-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 24px;
    align-items: end;
}

.membership-terminal-heading span {
    color: #facc15;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.membership-terminal-heading h2 {
    margin: 6px 0;
    color: #f9fafb;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 900;
}

.membership-terminal-heading p,
.payment-terminal-message,
.payment-message {
    margin: 0;
    color: #d1d5db;
}

.membership-terminal-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 18px;
    padding: 0 0 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.membership-terminal-summary span {
    color: #9ca3af;
    text-transform: none;
}

.membership-terminal-summary strong {
    color: #fff;
    text-align: right;
}

.payment-stepper {
    display: grid;
    grid-template-columns: 32px 1fr 32px;
    align-items: center;
    gap: 10px;
}

.payment-step-dot {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    color: #9ca3af;
    font-weight: 900;
}

.payment-step-dot.is-active,
.payment-step-dot.is-complete {
    border-color: #facc15;
    background: #facc15;
    color: #111827;
}

.payment-step-line {
    height: 1px;
    background: rgba(255, 255, 255, 0.18);
}

.membership-payment-loader {
    display: grid;
    min-height: 330px;
    place-items: center;
}

.membership-payment-loader[hidden],
.membership-payment-form[hidden],
.payment-terminal-actions button[hidden] {
    display: none;
}

.payment-loader-dot {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(255, 255, 255, 0.16);
    border-top-color: #fff;
    border-radius: 999px;
    animation: paymentSpin 0.8s linear infinite;
}

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

.membership-payment-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 330px;
}

.membership-payment-step {
    display: none;
    min-height: 230px;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

.membership-payment-step.is-active {
    display: flex;
}

.membership-payment-step h3 {
    margin: 0;
    color: #f9fafb;
    font-size: 1.35rem;
    font-weight: 900;
}

.membership-payment-step p {
    margin: 4px 0 0;
    color: #d1d5db;
}

.stripe-box {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: #050505;
    padding: 16px;
}

.payment-card-fields,
.payment-card-fields label,
.payment-postal-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.payment-card-fields {
    gap: 14px;
}

.payment-card-fields label span,
.payment-postal-field span {
    color: #d1d5db;
    font-size: 0.9rem;
    font-weight: 800;
}

.payment-postal-field input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: #050505;
    color: #fff;
    font: inherit;
    outline: none;
    padding: 15px 16px;
}

.payment-postal-field input:focus {
    border-color: #facc15;
}

.payment-card-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.payment-terminal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.payment-terminal-actions button {
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    padding: 14px 18px;
}

.payment-terminal-actions #paymentStepNext,
.payment-terminal-actions #paymentSubmit {
    border-color: #facc15;
    background: #facc15;
    color: #111827;
}

.payment-terminal-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.payment-terminal-message[data-tone="ok"] {
    color: #86efac;
}

.payment-terminal-message[data-tone="warn"] {
    color: #fde68a;
}

.payment-terminal-message[data-tone="error"],
.payment-message {
    color: #f87171;
}

.membership-stripe-brand {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 700;
}

.membership-stripe-brand img {
    height: 16px;
    opacity: 0.82;
}

.account-panel {
    overflow: hidden;
    border: 1px solid #374151;
    border-radius: 12px;
    background: #1f2937;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.account-panel.danger {
    border-color: rgba(153, 27, 27, 0.5);
}

.account-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 20px;
    border-bottom: 1px solid #374151;
    background: rgba(31, 41, 55, 0.8);
}

.account-panel-head h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #f3f4f6;
    font-size: 1.125rem;
    font-weight: 800;
}

.account-panel.danger .account-panel-head h2 {
    color: #f87171;
}

.account-badge {
    flex: none;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 700;
}

.account-badge.blue {
    border: 1px solid rgba(29, 78, 216, 0.5);
    background: rgba(30, 58, 138, 0.5);
    color: #93c5fd;
}

.account-badge.purple {
    border: 1px solid rgba(126, 34, 206, 0.5);
    background: rgba(88, 28, 135, 0.5);
    color: #d8b4fe;
}

.account-panel-body {
    padding: 20px;
}

.account-avatar-block {
    display: grid;
    justify-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.account-avatar-block p,
.account-help,
.account-count {
    margin: 0;
    color: #9ca3af;
    font-size: 0.75rem;
}

.account-avatar-wrap {
    position: relative;
}

.account-avatar-preview {
    display: grid;
    width: 128px;
    height: 128px;
    place-items: center;
    overflow: hidden;
    border: 4px solid #374151;
    border-radius: 999px;
    background: #111827;
    color: #4b5563;
    font-size: 2.25rem;
}

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

.account-avatar-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    cursor: pointer;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 180ms ease;
}

.account-avatar-wrap:hover .account-avatar-overlay,
.account-avatar-overlay:focus-visible {
    opacity: 1;
}

.account-form {
    display: grid;
    gap: 8px;
    margin-bottom: 24px;
}

.account-form:last-child {
    margin-bottom: 0;
}

.account-form label {
    color: #d1d5db;
    font-size: 0.875rem;
    font-weight: 700;
}

.account-form input,
.account-form textarea {
    width: 100%;
    border: 1px solid #4b5563;
    border-radius: 8px;
    background: #374151;
    color: #e5e7eb;
    padding: 10px 12px;
    outline: 0;
}

.account-form textarea {
    resize: none;
}

.account-form input:focus,
.account-form textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.45);
}

.account-input-row {
    display: flex;
}

.account-input-row input {
    min-width: 0;
    flex: 1;
    border-radius: 8px 0 0 8px;
}

.account-input-row button,
.account-wide-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    color: white;
    font-weight: 700;
    padding: 10px 16px;
    transition: background 180ms ease;
}

.account-input-row button {
    border-radius: 0 8px 8px 0;
}

.account-input-row.blue button,
.account-wide-btn.blue {
    background: #2563eb;
}

.account-input-row.blue button:hover,
.account-wide-btn.blue:hover {
    background: #1d4ed8;
}

.account-input-row.purple button,
.account-wide-btn.purple {
    background: #9333ea;
}

.account-input-row.purple button:hover,
.account-wide-btn.purple:hover {
    background: #7e22ce;
}

.account-wide-btn {
    width: 100%;
    border-radius: 8px;
}

.account-count {
    text-align: right;
}

.account-profile-link {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #374151;
}

.account-profile-link a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border-radius: 8px;
    background: #374151;
    color: white;
    font-weight: 700;
    padding: 10px 16px;
    transition: background 180ms ease;
}

.account-profile-link a:hover {
    background: #4b5563;
}

.account-hidden-password {
    margin-top: 4px;
}

.account-verification-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
}

.account-verification-row p {
    margin: 0;
    font-size: 0.75rem;
}

.account-verification-row p.verified {
    color: #4ade80;
}

.account-verification-row p.unverified {
    color: #f87171;
}

.account-verification-row button {
    border: 0;
    background: transparent;
    color: #60a5fa;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0;
}

.account-verification-row button:hover {
    text-decoration: underline;
}

.account-danger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.account-danger-row span {
    display: grid;
    gap: 4px;
}

.account-danger-row strong {
    color: #e5e7eb;
    font-weight: 700;
}

.account-danger-row small {
    color: #9ca3af;
}

.account-danger-row button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    border: 1px solid rgba(153, 27, 27, 0.5);
    border-radius: 8px;
    background: #374151;
    color: #f87171;
    font-weight: 700;
    padding: 10px 16px;
    transition: color 180ms ease, background 180ms ease;
}

.account-danger-row button:hover {
    background: #7f1d1d;
    color: #fecaca;
}

.account-mobile-logout {
    display: none;
}

@media (max-width: 640px) {
    .membership-grid {
        grid-template-columns: 1fr;
    }

    .membership-terminal-top,
    .payment-card-fields-row {
        grid-template-columns: 1fr;
    }

    .membership-summary-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .account-panel-head,
    .account-verification-row,
    .account-danger-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .account-input-row {
        display: grid;
    }

    .account-input-row input,
    .account-input-row button {
        width: 100%;
        border-radius: 8px;
    }

    .account-input-row button {
        margin-top: 8px;
    }
}

.toast-wrap {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 80;
    display: grid;
    gap: 8px;
    width: min(360px, calc(100vw - 32px));
}

.toast {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    background: rgba(17, 24, 39, 0.96);
    padding: 12px 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.success {
    border-left-color: var(--success);
}

.notice {
    display: none;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(250, 204, 21, 0.35);
    background: rgba(250, 204, 21, 0.12);
    color: #fef3c7;
    font-weight: 700;
}

.notice.active {
    display: block;
}

.muted {
    color: var(--muted);
}

.accent {
    color: var(--accent);
}

.hidden {
    display: none !important;
}

body[data-page="dashboard"] #messagesTab {
    position: relative;
    isolation: isolate;
}

body .mdl.ecxo-conversation-tab-page {
    position: absolute !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    transform: none !important;
}

.mdl.ecxo-conversation-tab-page .w1nd0w {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.mdl.ecxo-conversation-tab-page .h34d3r {
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 10px;
    align-items: center;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
    flex: 0 0 auto;
}

.mdl.ecxo-conversation-tab-page .h34d3r h2 {
    grid-column: 2;
    grid-row: 1;
    overflow: hidden;
    font-size: 1.05rem;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdl.ecxo-conversation-tab-page .ecxo-modal-back {
    display: grid !important;
    grid-column: 1;
    grid-row: 1;
    width: 40px !important;
    height: 40px !important;
    aspect-ratio: 1 !important;
    place-items: center;
    border-radius: 8px;
    background: rgba(55, 65, 81, 0.7) !important;
    color: #fff;
}

.mdl.ecxo-conversation-tab-page .ecxo-modal-primary-action {
    display: grid !important;
    grid-column: 3;
    grid-row: 1;
    width: 40px !important;
    height: 40px !important;
    aspect-ratio: 1 !important;
    place-items: center;
    border-radius: 8px;
    background: #2563eb !important;
    color: #fff;
}

.mdl.ecxo-conversation-tab-page .ecxo-modal-primary-action:hover,
.mdl.ecxo-conversation-tab-page .ecxo-modal-primary-action:focus-visible {
    background: #1d4ed8 !important;
}

.mdl.ecxo-conversation-tab-page .ecxo-modal-back:disabled,
.mdl.ecxo-conversation-tab-page .ecxo-modal-primary-action:disabled {
    cursor: wait;
    opacity: 0.55;
}

.mdl.ecxo-conversation-tab-page .c0nt3nt {
    height: auto !important;
    min-height: 0;
    padding: 14px;
    flex: 1 1 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

.mdl.ecxo-conversation-tab-page .btnc0nt41n3r {
    flex: 0 0 auto;
}

.mdl.ecxo-conversation-tab-page .butt0n {
    width: calc(100% - 24px) !important;
    height: auto !important;
    min-height: 44px;
    aspect-ratio: auto !important;
}

@media (max-width: 860px) {

    body[data-page="dashboard"] {
        --dashboard-mobile-nav-height: calc(71px + env(safe-area-inset-bottom));
    }

    body[data-page="dashboard"] .dashboard-view > div:first-child {
        position: absolute;
        inset: 0 0 var(--dashboard-mobile-nav-height);
        min-height: 0;
        height: auto;
        overflow: hidden;
    }

    body[data-page="dashboard"] .dashboard-sidebar {
        display: none !important;
    }

    body[data-page="dashboard"] .dashboard-main {
        min-height: 0;
        height: 100%;
        max-height: none;
        overflow-x: hidden;
        overflow-y: scroll;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        padding-bottom: 0;
    }

    body[data-page="dashboard"] .tab.active {
        flex: 0 0 auto;
        min-height: 100%;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .account-mobile-logout {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        margin-top: 24px;
        border: 1px solid rgba(239, 68, 68, 0.45);
        border-radius: 10px;
        background: rgba(127, 29, 29, 0.55);
        color: #fecaca;
        padding: 13px 18px;
        font-weight: 700;
    }

    .account-mobile-logout:hover {
        background: #991b1b;
        color: #fff;
    }

    body[data-page="dashboard"] #dashboardTab > section:first-child {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body[data-page="dashboard"] #statFriends,
    body[data-page="dashboard"] #statFollowers,
    body[data-page="dashboard"] #statStatus,
    body[data-page="dashboard"] #statSubscription {
        font-size: 1.6rem;
        overflow-wrap: anywhere;
    }

    .dashboard-mobile-nav {
        position: absolute;
        display: grid;
        min-height: var(--dashboard-mobile-nav-height);
        height: auto;
    }

    .messages-grid {
        display: block;
        flex: 1;
        min-height: 0;
        padding: 0 !important;
    }

    .messages-titlebar {
        gap: 10px;
        padding: 14px !important;
    }

    .messages-titlebar h3 {
        min-width: 0;
        font-size: 1.05rem;
    }

    .messages-titlebar .dashboard-actions {
        flex: 0 0 auto;
        flex-wrap: nowrap;
        gap: 7px;
    }

    .messages-titlebar .dashboard-actions button {
        position: relative;
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        padding: 0 !important;
        border-radius: 9px;
    }

    .messages-titlebar .dashboard-actions button i {
        margin: 0 !important;
    }

    .message-action-label {
        position: absolute !important;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    body[data-page="dashboard"] #messagesTab.active {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        max-height: 100%;
        overflow: hidden;
    }

    body[data-page="dashboard"] #messagesTab > div {
        min-height: 0;
    }

    body[data-page="dashboard"] #messagesTab .messages-shell {
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .chat-panel {
        display: none;
        height: 100%;
        min-height: 0;
        border: 0;
        border-radius: 0;
    }

    .messages-column {
        height: 100%;
        padding: 14px;
        overflow-y: auto;
    }

    .conversation-item {
        min-height: 60px;
        gap: 10px;
        padding: 9px 10px;
    }

    .conversation-item .conversation-avatar {
        width: 40px;
        height: 40px;
    }

    .chat-head {
        grid-template-columns: 36px 40px minmax(0, 1fr) auto;
        gap: 9px;
        flex: 0 0 auto;
        padding: 10px;
    }

    .chat-back-btn {
        display: grid;
    }

    .chat-messages {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        padding: 12px 10px;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }

    .message-form {
        display: flex;
        flex-direction: column;
        flex: 0 0 auto;
        gap: 8px;
        padding: 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        background: rgba(17, 24, 39, 0.96);
    }

    .message-form .input {
        height: 44px;
        font-size: 16px;
    }

    .message-form .btn {
        width: 44px;
        min-width: 44px;
        height: 44px;
    }

    .message-compose-row {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 8px;
    }

    .message-attach-btn {
        width: 44px;
        min-width: 44px;
        height: 44px;
    }

    .message-bubble {
        max-width: 92%;
    }

    .message-image img {
        max-width: 100%;
        max-height: 52dvh;
    }

    .chat-head > div:not(.mini-avatar) {
        min-width: 0;
    }

    .chat-head h4,
    .chat-head p {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .chat-head h4 {
        margin-bottom: 3px;
    }

    .chat-settings-btn {
        width: auto;
        min-width: 40px;
        height: 36px;
        padding: 0 10px;
    }

    .chat-settings-label {
        display: inline;
        font-size: 0.74rem;
        font-weight: 800;
    }

    .message-bubble,
    .message-typing {
        max-width: 92%;
    }

    .group-member-row {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 7px 10px;
    }

    .group-member-row .ecxo-user-photo {
        width: 40px;
        height: 40px;
        grid-row: 1 / span 2;
    }

    .group-member-role {
        grid-column: 2;
        grid-row: 2;
    }

    .mdl .group-member-remove {
        grid-column: 1 / -1;
        grid-row: auto;
        width: 100% !important;
        min-height: 40px;
        margin-top: 3px;
        justify-content: center;
    }

    .mdl .group-member-remove span {
        display: inline;
    }

    .friends-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        width: 100%;
        margin-bottom: 16px;
    }

    .friends-search-wrap {
        width: 100% !important;
        max-width: none;
        min-width: 0;
    }

    #friendSearchInput {
        display: block;
        width: 100% !important;
        max-width: none;
        min-width: 0;
    }

    .friends-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-bottom: 16px;
    }

    .friends-tabs button {
        justify-content: center;
        gap: 5px;
        min-width: 0;
        padding: 0 4px;
        font-size: clamp(0.66rem, 3vw, 0.78rem) !important;
        white-space: nowrap;
    }

    .friends-tab-badge {
        flex: 0 0 18px;
        width: 18px;
        height: 18px;
    }

    .friends-panel-head {
        padding: 15px;
    }

    .friends-row {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 10px 12px;
        align-items: center;
        padding: 14px;
    }

    .friends-actions {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
        width: 100%;
    }

    .friends-actions:has(> :nth-child(2):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .friends-actions button,
    .friends-actions a {
        width: 100%;
        max-width: none;
        justify-content: center;
        padding: 8px 4px;
        font-size: 0.7rem !important;
    }

    .friends-empty,
    .friends-loading {
        min-height: 180px;
        padding: 28px 14px;
    }

    .profile-content {
        width: min(100% - 24px, 680px);
        margin-top: -60px;
    }

    .profile-identity {
        display: grid;
        justify-items: center;
        gap: 12px;
        margin-bottom: 24px;
        text-align: center;
    }

    .profile-avatar {
        width: 126px;
        height: 126px;
    }

    .profile-name-block {
        width: 100%;
        padding: 0;
    }

    .profile-name-block h1 {
        font-size: 2rem;
    }

    .profile-presence {
        justify-content: center;
    }

    .profile-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        padding: 0;
    }

    .profile-action {
        width: 100%;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-stats {
        grid-row: 1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .profile-stat {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 6px;
        padding: 12px 6px;
        text-align: center;
    }

    .profile-stat > i:first-child {
        width: 40px;
        height: 40px;
    }

    .profile-stat > i:last-child {
        display: none;
    }

    .profile-stat strong {
        font-size: 1.25rem;
    }

    .profile-card {
        padding: 17px;
    }

    .profile-social-editor label {
        grid-template-columns: 22px minmax(0, 1fr);
    }

    .profile-social-editor label span {
        display: none;
    }

    .profile-status-menu {
        right: 0;
        bottom: auto;
        left: auto;
        top: calc(100% + 8px);
    }

    h1 {
        font-size: 2.35rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .hero h1,
    .hero h2 {
        font-size: 1.5rem;
    }

    .platform-strip {
        padding: 96px 25px;
    }

    .platform-strip>p:first-child {
        font-size: 32px;
    }

    .platform-grid {
        grid-template-columns: 1fr;
    }

    .split,
    .feature-grid,
    .stats-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-view.active {
        display: block;
    }

    .sidebar {
        position: sticky;
        top: 56px;
        z-index: 20;
        width: 100%;
        min-height: 0;
        flex: none;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .profile-block {
        grid-template-columns: 44px 1fr;
        justify-items: start;
        text-align: left;
        padding: 12px 16px;
    }

    .profile-block .avatar {
        width: 44px;
        height: 44px;
    }

    .side-nav {
        grid-template-columns: repeat(5, 1fr);
        padding: 0;
    }

    .side-btn {
        justify-content: center;
        min-height: 54px;
        border-left: 0;
        border-bottom: 3px solid transparent;
        padding: 0 6px;
        font-size: 0.82rem;
    }

    .side-btn.active {
        border-bottom-color: #3b82f6;
    }

    .membership-tab-btn.membership-tier-bronze.active {
        border-bottom-color: #b45309;
    }

    .membership-tab-btn.membership-tier-silver.active {
        border-bottom-color: #cbd5e1;
    }

    .membership-tab-btn.membership-tier-gold.active {
        border-bottom-color: #f59e0b;
    }

    .side-spacer,
    .sidebar-actions {
        display: none;
    }

    .dashboard-main {
        min-height: auto;
        padding: 16px;
    }

    .nav-actions {
        gap: 6px;
    }

    .nav-actions .btn {
        padding: 9px 10px;
        font-size: 0.82rem;
    }
}
