* {
    box-sizing: border-box;
}

:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #17151c;
    background: #f2eff6;
    --primary: #6b3deb;
    --primary-dark: #5430c2;
    --surface: #ffffff;
    --surface-soft: #f7f4fa;
    --border: #e7e1ed;
    --muted: #746d7d;
    --success: #25a563;
    --danger: #d84c5b;
    --shadow: 0 22px 60px rgba(49, 30, 70, .12);
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
}

button,
input,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

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

.app-body {
    background:
        radial-gradient(circle at top left, rgba(107, 61, 235, .08), transparent 34%),
        #f2eff6;
}

.app-shell {
    width: min(100%, 760px);
    min-height: 100vh;
    margin: 0 auto;
    background: #f8f6fa;
    position: relative;
    padding-bottom: 82px;
    box-shadow: 0 0 0 1px rgba(69, 49, 87, .05);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: max(18px, env(safe-area-inset-top)) 20px 16px;
    color: #fff;
    background:
        linear-gradient(135deg, #6b3deb 0%, #7746ef 60%, #5430c2 100%);
    border-radius: 0 0 28px 28px;
    box-shadow: 0 14px 35px rgba(84, 48, 194, .23);
}

.topbar-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 15px;
    background: rgba(255,255,255,.15);
    font-size: 22px;
    font-weight: 900;
    backdrop-filter: blur(8px);
}

.eyebrow {
    margin: 0 0 3px;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .14em;
    color: var(--primary);
}

.topbar .eyebrow {
    color: rgba(255,255,255,.72);
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.1;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    font-size: 12px;
    color: rgba(255,255,255,.8);
}

.status-dot,
.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ee58e;
    box-shadow: 0 0 0 4px rgba(78,229,142,.14);
}

.icon-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-content: center;
    gap: 4px;
    border: 0;
    border-radius: 13px;
    background: rgba(255,255,255,.14);
    cursor: pointer;
}

.icon-button span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
}

.room-list-main {
    padding: 24px 18px 30px;
}

.welcome-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 2px 4px 18px;
}

.welcome-kicker {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 14px;
}

.welcome-block h2 {
    margin: 0;
    font-size: 27px;
}

.language-pill,
.level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
}

.language-pill {
    padding: 8px 12px;
    color: var(--primary);
    background: #ece5ff;
    font-size: 12px;
}

.notice-card {
    display: flex;
    gap: 13px;
    padding: 16px;
    border: 1px solid #ded4f5;
    border-radius: 18px;
    background: linear-gradient(135deg, #f1ebff, #faf8ff);
}

.notice-icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: var(--primary);
    font-size: 13px;
    font-weight: 900;
}

.notice-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.notice-card p {
    margin: 0;
    color: #6e647b;
    font-size: 12px;
    line-height: 1.55;
}

.rooms-section {
    margin-top: 26px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 13px;
    padding: 0 3px;
}

.section-heading h3 {
    margin: 0;
    font-size: 20px;
}

.section-heading > span {
    color: var(--muted);
    font-size: 12px;
}

.room-grid {
    display: grid;
    gap: 11px;
}

.room-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 7px 20px rgba(57, 42, 71, .05);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.room-card:hover {
    transform: translateY(-2px);
    border-color: #d2c4f5;
    box-shadow: 0 12px 28px rgba(57, 42, 71, .09);
}

.room-icon {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: var(--primary);
    background: #eee8ff;
    font-size: 13px;
    font-weight: 900;
}

.room-copy {
    min-width: 0;
    flex: 1;
}

.room-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.room-title-row h4 {
    margin: 0;
    font-size: 16px;
}

.room-arrow {
    color: #a29aaa;
    font-size: 26px;
    line-height: 1;
}

.room-copy > p {
    margin: 5px 0 11px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.room-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #746c7d;
    font-size: 11px;
}

.room-meta > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.room-meta .online-dot {
    width: 7px;
    height: 7px;
    box-shadow: none;
}

.level-badge {
    padding: 4px 8px;
    background: #f1edf6;
    color: #6f6678;
    font-size: 10px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 18;
    width: min(100%, 760px);
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 8px 16px max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(15px);
}

.bottom-nav a,
.bottom-nav button {
    min-height: 54px;
    display: grid;
    place-items: center;
    gap: 2px;
    border: 0;
    background: transparent;
    color: #938a9d;
    font-size: 11px;
}

.bottom-nav .active {
    color: var(--primary);
    font-weight: 750;
}

.bottom-nav button:disabled {
    opacity: .55;
}

.nav-icon {
    font-size: 20px;
    line-height: 1;
}

.side-menu {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    visibility: hidden;
}

.side-menu.open {
    pointer-events: auto;
    visibility: visible;
}

.side-menu-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 18, 30, .44);
    opacity: 0;
    transition: opacity .2s ease;
}

.side-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(84vw, 340px);
    height: 100%;
    padding: max(28px, env(safe-area-inset-top)) 22px 24px;
    background: #fff;
    transform: translateX(100%);
    transition: transform .24s ease;
    box-shadow: -18px 0 55px rgba(36, 24, 47, .17);
}

.side-menu.open .side-menu-backdrop {
    opacity: 1;
}

.side-menu.open .side-menu-panel {
    transform: translateX(0);
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.avatar {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #fff;
    background: var(--primary);
    font-size: 18px;
    font-weight: 900;
}

.profile-card strong,
.profile-card span {
    display: block;
}

.profile-card span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.menu-links {
    display: grid;
    gap: 7px;
    margin-top: 20px;
}

.menu-links a,
.menu-links button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    text-align: left;
}

.menu-links .active {
    color: var(--primary);
    background: #f1ecff;
    font-weight: 750;
}

.menu-links button:disabled {
    color: #9d96a5;
}

.menu-links small {
    color: #aaa1b3;
}

.logout-form {
    position: absolute;
    right: 22px;
    bottom: max(24px, env(safe-area-inset-bottom));
    left: 22px;
}

.logout-button {
    width: 100%;
    border: 1px solid #ead5d8;
    border-radius: 12px;
    padding: 13px;
    color: var(--danger);
    background: #fff5f6;
    font-weight: 750;
}

/* Chat screen */
.chat-page {
    overflow: hidden;
}

.chat-shell {
    width: min(100%, 760px);
    height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background:
        radial-gradient(circle at 20% 10%, rgba(107,61,235,.05), transparent 32%),
        #eeeaf1;
    box-shadow: 0 0 0 1px rgba(69,49,87,.05);
}

.chat-header {
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 74px;
    padding: max(10px, env(safe-area-inset-top)) 14px 10px;
    border-bottom: 1px solid rgba(80,59,96,.08);
    background: #fff;
}

.back-button {
    width: 36px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--primary);
    font-size: 34px;
    line-height: 1;
}

.chat-room-avatar {
    flex: 0 0 auto;
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: var(--primary);
    font-size: 12px;
    font-weight: 900;
}

.chat-room-title {
    min-width: 0;
    flex: 1;
}

.chat-room-title h1 {
    margin: 0;
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-room-title p {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.chat-room-title .online-dot {
    width: 6px;
    height: 6px;
    box-shadow: none;
}

.more-button {
    width: 38px;
    height: 38px;
    background: transparent;
}

.more-button span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #82798b;
}

.message-stage {
    overflow-y: auto;
    padding: 18px 14px 24px;
    overscroll-behavior: contain;
}

.room-intro {
    width: min(92%, 430px);
    margin: 4px auto 24px;
    padding: 20px;
    border: 1px solid rgba(107,61,235,.15);
    border-radius: 20px;
    background: rgba(255,255,255,.82);
    text-align: center;
    box-shadow: 0 9px 28px rgba(63,47,75,.06);
}

.room-intro-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 10px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: var(--primary);
    font-weight: 900;
}

.room-intro h2 {
    margin: 0;
    font-size: 17px;
}

.room-intro p {
    margin: 7px 0 12px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.room-intro > span {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--primary);
    background: #eee8ff;
    font-size: 10px;
    font-weight: 800;
}

.date-separator {
    display: flex;
    justify-content: center;
    margin: 14px 0;
}

.date-separator span {
    padding: 6px 10px;
    border-radius: 999px;
    color: #746b7d;
    background: rgba(255,255,255,.8);
    font-size: 10px;
    box-shadow: 0 3px 10px rgba(58,42,69,.05);
}

.message-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 12px 0;
}

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

.message-avatar {
    flex: 0 0 auto;
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: #9688a2;
    font-size: 9px;
    font-weight: 850;
}

.message-column {
    max-width: min(82%, 560px);
}

.message-sender {
    margin: 0 0 4px 7px;
    color: #786f81;
    font-size: 10px;
    font-weight: 750;
}

.message-bubble {
    position: relative;
    padding: 10px 12px 20px;
    border-radius: 7px 17px 17px 17px;
    background: #fff;
    box-shadow: 0 5px 17px rgba(54,40,65,.07);
    font-size: 13px;
    line-height: 1.58;
}

.outgoing .message-bubble {
    border-radius: 17px 7px 17px 17px;
    background: #e7dcff;
}

.message-bubble time {
    position: absolute;
    right: 9px;
    bottom: 5px;
    color: #948b9d;
    font-size: 9px;
}

.translatable-word {
    display: inline;
    border-radius: 4px;
    cursor: pointer;
}

.translatable-word:hover,
.translatable-word.active {
    color: var(--primary);
    background: #f0eaff;
}

.preview-note {
    width: min(92%, 470px);
    margin: 24px auto 0;
    padding: 11px 13px;
    border-radius: 13px;
    color: #746b7d;
    background: rgba(255,255,255,.72);
    text-align: center;
    font-size: 11px;
    line-height: 1.5;
}

.composer-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 9px 10px max(9px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(14px);
}

.composer-action,
.send-button {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
}

.composer-action {
    color: #9c93a5;
    background: #f0edf3;
    font-size: 25px;
}

.send-button {
    color: #fff;
    background: var(--primary);
    font-size: 17px;
    cursor: pointer;
}

.composer-input-wrap {
    min-width: 0;
    flex: 1;
    position: relative;
}

.composer-input-wrap textarea {
    width: 100%;
    min-height: 42px;
    max-height: 118px;
    resize: none;
    display: block;
    padding: 11px 48px 10px 13px;
    border: 1px solid #ddd6e4;
    border-radius: 15px;
    outline: none;
    background: #faf9fb;
    line-height: 1.4;
}

.composer-input-wrap textarea:focus {
    border-color: #c7b4f5;
    box-shadow: 0 0 0 3px rgba(107,61,235,.09);
}

.english-indicator {
    position: absolute;
    right: 11px;
    bottom: 11px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 900;
}

.word-popover {
    position: fixed;
    z-index: 40;
    width: min(240px, calc(100vw - 30px));
    padding: 12px 14px;
    border: 1px solid #ded5e6;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
}

.word-popover strong,
.word-popover span {
    display: block;
}

.word-popover strong {
    margin-bottom: 5px;
    color: var(--primary);
}

.word-popover span {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 82px;
    z-index: 60;
    width: min(calc(100vw - 30px), 420px);
    transform: translateX(-50%);
    padding: 12px 14px;
    border-radius: 13px;
    color: #fff;
    background: #302b35;
    text-align: center;
    font-size: 12px;
    box-shadow: var(--shadow);
}

@media (min-width: 720px) {
    .room-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .room-card {
        min-height: 142px;
    }
}

/* Real messaging states */
[hidden] {
    display: none !important;
}

.messages-list {
    min-height: 1px;
}

.message-loading,
.message-empty,
.connection-banner {
    width: min(92%, 470px);
    margin: 16px auto;
    padding: 12px 14px;
    border-radius: 14px;
    text-align: center;
    font-size: 11px;
    line-height: 1.5;
}

.message-loading {
    color: #756c7e;
    background: rgba(255,255,255,.72);
}

.message-empty {
    color: #756c7e;
    background: rgba(255,255,255,.72);
}

.message-empty strong,
.message-empty span {
    display: block;
}

.message-empty strong {
    margin-bottom: 3px;
    color: #3a3340;
    font-size: 12px;
}

.connection-banner {
    position: sticky;
    top: 0;
    z-index: 5;
    margin-top: 0;
    color: #7b5a16;
    background: #fff4cf;
    box-shadow: 0 5px 16px rgba(72,52,16,.08);
}

.message-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.message-bubble.censored-message::before {
    content: "•";
    position: absolute;
    top: 5px;
    right: 8px;
    color: #ad8f31;
    font-size: 10px;
}

.send-button:disabled,
.composer-action:disabled {
    cursor: default;
    opacity: .48;
}

.composer-input-wrap textarea:disabled {
    cursor: wait;
    opacity: .72;
}

.send-button.sending {
    animation: send-pulse .8s ease-in-out infinite alternate;
}

.toast.error {
    background: #9d3542;
}

.toast.success {
    background: #267d51;
}

@keyframes send-pulse {
    from { transform: scale(.94); opacity: .7; }
    to { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .send-button.sending {
        animation: none;
    }
}

/* Step 7: word translation and reporting */
.message-meta-row {
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 3px 3px 7px;
}

.message-meta-row .message-sender {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-options-button {
    flex: 0 0 auto;
    min-width: 28px;
    min-height: 24px;
    padding: 0 5px 3px;
    border: 0;
    border-radius: 8px;
    color: #8d8396;
    background: transparent;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .05em;
    cursor: pointer;
}

.message-options-button:hover,
.message-options-button:focus-visible {
    color: var(--primary);
    background: #eee8ff;
    outline: none;
}

.message-options-button:disabled {
    color: var(--success);
    cursor: default;
    opacity: .8;
}

.message-reported .message-bubble {
    box-shadow: 0 0 0 1px rgba(37, 165, 99, .12), 0 5px 17px rgba(54,40,65,.07);
}

.translatable-word:focus-visible {
    color: var(--primary);
    background: #f0eaff;
    outline: 2px solid rgba(107, 61, 235, .24);
    outline-offset: 2px;
}

.word-popover {
    width: min(260px, calc(100vw - 30px));
}

.word-translation {
    color: #2d2732;
    font-size: 13px;
    font-weight: 720;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.word-translation.loading {
    color: var(--muted);
    font-weight: 550;
}

.word-translation.error {
    color: var(--danger);
    font-weight: 600;
}

.word-popover small {
    display: block;
    margin-top: 7px;
    color: #8a8192;
    font-size: 9px;
    line-height: 1.4;
}

.message-actions-menu {
    position: fixed;
    z-index: 45;
    width: min(210px, calc(100vw - 30px));
    padding: 6px;
    border: 1px solid #ded5e6;
    border-radius: 13px;
    background: #fff;
    box-shadow: var(--shadow);
}

.message-actions-menu button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 12px;
    border: 0;
    border-radius: 9px;
    color: #a73342;
    background: transparent;
    text-align: left;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.message-actions-menu button:hover,
.message-actions-menu button:focus-visible {
    background: #fff0f2;
    outline: none;
}

.report-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 18px 12px max(18px, env(safe-area-inset-bottom));
    background: rgba(24, 18, 29, .48);
    backdrop-filter: blur(3px);
}

.report-sheet {
    width: min(100%, 520px);
    max-height: min(86vh, 720px);
    overflow-y: auto;
    padding: 20px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(31, 22, 38, .3);
}

.report-sheet-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.report-sheet-heading > div > span {
    color: var(--primary);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.report-sheet-heading h2 {
    margin: 4px 0 0;
    font-size: 21px;
}

.report-close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 11px;
    color: #756d7d;
    background: #f1eef4;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}

.report-help {
    margin: 12px 0 18px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}

.report-sheet form {
    display: grid;
    gap: 15px;
}

.report-sheet label {
    display: grid;
    gap: 7px;
    color: #413948;
    font-size: 12px;
    font-weight: 750;
}

.report-sheet label > span {
    color: #948b9d;
    font-size: 10px;
    font-weight: 500;
}

.report-sheet select,
.report-sheet textarea {
    width: 100%;
    border: 1px solid #ddd6e4;
    border-radius: 13px;
    padding: 12px 13px;
    outline: none;
    color: #26212b;
    background: #faf9fb;
    font: inherit;
    font-weight: 500;
}

.report-sheet textarea {
    min-height: 92px;
    resize: vertical;
    line-height: 1.45;
}

.report-sheet select:focus,
.report-sheet textarea:focus {
    border-color: #c7b4f5;
    box-shadow: 0 0 0 3px rgba(107,61,235,.09);
}

.report-actions {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 9px;
    margin-top: 3px;
}

.report-actions button {
    min-height: 44px;
    padding: 11px 13px;
    border: 0;
    border-radius: 13px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.report-actions .secondary-button {
    color: #605768;
    background: #f0edf3;
}

.report-actions .danger-button {
    color: #fff;
    background: var(--danger);
}

.report-actions button:disabled {
    cursor: wait;
    opacity: .65;
}

body.report-open {
    overflow: hidden;
}

@media (min-width: 620px) {
    .report-overlay {
        align-items: center;
    }
}

/* Step 9: profiles, presence and member safety */
.avatar-theme-violet { background: linear-gradient(135deg, #6b3deb, #8d67f5) !important; color: #fff !important; }
.avatar-theme-indigo { background: linear-gradient(135deg, #3848c9, #6775ef) !important; color: #fff !important; }
.avatar-theme-ocean { background: linear-gradient(135deg, #087ea4, #31b8d5) !important; color: #fff !important; }
.avatar-theme-mint { background: linear-gradient(135deg, #168a67, #40c69a) !important; color: #fff !important; }
.avatar-theme-sunset { background: linear-gradient(135deg, #e36b2c, #f4a04c) !important; color: #fff !important; }
.avatar-theme-rose { background: linear-gradient(135deg, #c93f70, #eb78a1) !important; color: #fff !important; }
.avatar-theme-slate { background: linear-gradient(135deg, #414a59, #778293) !important; color: #fff !important; }
.avatar-theme-gold { background: linear-gradient(135deg, #b47a0c, #e8b73f) !important; color: #fff !important; }

.chat-room-title.room-presence-trigger {
    min-width: 0;
    flex: 1;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.message-avatar {
    text-decoration: none;
}

.message-sender {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
}

.message-sender small {
    padding: 2px 5px;
    border-radius: 999px;
    color: #6b3deb;
    background: #eee8ff;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .04em;
}

.message-actions-menu a,
.message-actions-menu button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border: 0;
    color: #2b2631;
    background: transparent;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.message-actions-menu a:hover,
.message-actions-menu a:focus-visible,
.message-actions-menu button:hover,
.message-actions-menu button:focus-visible {
    background: #f4effc;
    outline: none;
}

.presence-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    background: rgba(22, 17, 29, .42);
    backdrop-filter: blur(5px);
}

.presence-sheet {
    width: min(100%, 520px);
    max-height: min(72vh, 620px);
    overflow: auto;
    padding: 20px;
    border-radius: 24px 24px 18px 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(23, 16, 35, .24);
}

.presence-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.presence-heading span {
    color: #6b3deb;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
}

.presence-heading h2 {
    margin: 4px 0 0;
    font-size: 23px;
}

.presence-heading button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    color: #635b6d;
    background: #f4f0f7;
    font-size: 24px;
    cursor: pointer;
}

.presence-help,
.presence-loading,
.presence-empty {
    color: #7b7284;
    font-size: 12px;
    line-height: 1.5;
}

.presence-help { margin: 10px 0 16px; }
.presence-loading,
.presence-empty { padding: 24px 8px; text-align: center; }

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

.presence-user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid #eee8f2;
    border-radius: 15px;
    background: #fff;
}

.presence-user-row > span:nth-child(2) {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 2px;
}

.presence-user-row strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.presence-user-row small {
    color: #81788b;
    font-size: 10px;
}

.presence-avatar,
.mini-avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    font-size: 12px;
    font-weight: 900;
}

.profile-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(107, 61, 235, .11), transparent 30%),
        #f3f0f6;
}

.profile-shell {
    width: min(100%, 720px);
    min-height: 100vh;
    margin: 0 auto;
    background: #f8f6fa;
    box-shadow: 0 0 0 1px rgba(70, 50, 88, .05);
}

.profile-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 12px;
    padding: max(15px, env(safe-area-inset-top)) 18px 15px;
    color: #fff;
    background: linear-gradient(135deg, #6b3deb, #5730c7);
    box-shadow: 0 12px 32px rgba(84, 48, 194, .2);
}

.profile-topbar > div { text-align: center; }
.profile-topbar span { font-size: 9px; font-weight: 900; letter-spacing: .14em; opacity: .7; }
.profile-topbar h1 { margin: 2px 0 0; font-size: 18px; }
.profile-back {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(255,255,255,.13);
    font-size: 30px;
    line-height: 1;
}

.profile-content {
    display: grid;
    gap: 14px;
    padding: 20px 16px 40px;
}

.public-profile-card,
.profile-settings-card,
.blocked-members-card,
.member-actions-card,
.profile-empty-card {
    border: 1px solid #e8e1ed;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(56, 39, 72, .06);
}

.public-profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.profile-avatar {
    flex: 0 0 auto;
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    font-size: 25px;
    font-weight: 950;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}

.profile-main-copy { min-width: 0; flex: 1; }
.profile-name-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.profile-name-row h2 { margin: 0; overflow-wrap: anywhere; font-size: 23px; }
.profile-level {
    padding: 5px 8px;
    border-radius: 999px;
    color: #6236da;
    background: #eee8ff;
    font-size: 10px;
    font-weight: 900;
}
.profile-presence { margin: 7px 0 4px; color: #625a6b; font-size: 12px; }
.profile-presence .online-dot { margin-right: 6px; width: 7px; height: 7px; box-shadow: none; }
.profile-joined { color: #948c9c; font-size: 10px; }

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    overflow: hidden;
    border: 1px solid #e8e1ed;
    border-radius: 18px;
    background: #e8e1ed;
}
.profile-stats div { display: grid; gap: 3px; padding: 15px 6px; background: #fff; text-align: center; }
.profile-stats strong { font-size: 20px; }
.profile-stats span { color: #81788a; font-size: 9px; }
.profile-private-note,
.profile-safety-note { margin: 0; color: #7e7588; font-size: 11px; line-height: 1.55; text-align: center; }

.profile-settings-card,
.blocked-members-card { padding: 20px; }
.profile-section-heading > span { color: #6b3deb; font-size: 9px; font-weight: 900; letter-spacing: .13em; }
.profile-section-heading h3 { margin: 4px 0 16px; font-size: 18px; }
.privacy-heading { margin-top: 24px; }

.avatar-picker { margin: 0; padding: 0; border: 0; }
.avatar-picker legend { margin-bottom: 10px; color: #6f6678; font-size: 11px; font-weight: 700; }
.avatar-picker { display: flex; flex-wrap: wrap; gap: 9px; }
.avatar-choice { position: relative; cursor: pointer; }
.avatar-choice input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-preview {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 3px solid transparent;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 900;
    transition: transform .15s ease, box-shadow .15s ease;
}
.avatar-choice input:checked + .avatar-preview {
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px #6b3deb;
    transform: scale(.92);
}

.profile-select-field { display: grid; gap: 7px; margin-top: 22px; }
.profile-select-field > span { font-size: 12px; font-weight: 800; }
.profile-select-field select {
    width: 100%;
    min-height: 46px;
    padding: 0 13px;
    border: 1px solid #ddd5e4;
    border-radius: 13px;
    color: #26212b;
    background: #fff;
}
.profile-select-field small { color: #89808f; font-size: 10px; }

.privacy-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 0;
    border-top: 1px solid #eee8f1;
}
.privacy-toggle > span { display: grid; gap: 3px; }
.privacy-toggle strong { font-size: 12px; }
.privacy-toggle small { color: #857c8d; font-size: 10px; line-height: 1.4; }
.privacy-toggle input { width: 21px; height: 21px; accent-color: #6b3deb; }
.profile-save-button,
.primary-link-button {
    width: 100%;
    min-height: 48px;
    display: grid;
    place-items: center;
    margin-top: 18px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #6b3deb, #7a4df0);
    font-weight: 850;
    cursor: pointer;
}

.blocked-empty { margin: 0; color: #857d8d; font-size: 12px; }
.blocked-list { display: grid; gap: 9px; }
.blocked-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.blocked-row > a { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.blocked-row > a > span:last-child { min-width: 0; display: grid; gap: 2px; }
.blocked-row strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.blocked-row small { color: #8a8290; font-size: 9px; }
.blocked-row button {
    padding: 8px 10px;
    border: 1px solid #ddd4e5;
    border-radius: 10px;
    color: #5e5368;
    background: #fff;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.member-actions-card { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
.member-actions-card form { display: contents; }
.secondary-profile-action,
.block-profile-action,
.unblock-profile-action {
    min-height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}
.secondary-profile-action { border: 1px solid #ded6e5; background: #fff; }
.block-profile-action { border: 0; color: #fff; background: #d64b5a; }
.unblock-profile-action { border: 0; color: #fff; background: #6b3deb; }

.profile-alert { padding: 12px 14px; border-radius: 14px; font-size: 12px; line-height: 1.45; }
.profile-alert.success { color: #17613c; border: 1px solid #bfe7d0; background: #eaf9f0; }
.profile-alert.error { color: #862d38; border: 1px solid #f0c5cb; background: #fff0f2; }
.profile-empty-card { padding: 42px 24px; text-align: center; }
.profile-empty-icon { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 18px; color: #fff; background: #6b3deb; font-size: 24px; font-weight: 900; }
.profile-empty-card h2 { margin: 0 0 7px; }
.profile-empty-card p { margin: 0; color: #7f7687; font-size: 12px; }

@media (min-width: 720px) {
    .presence-overlay { align-items: center; }
    .presence-sheet { border-radius: 24px; }
}

/* Step 10: unread messages, notification preferences and paged history */
.room-title-actions {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.room-unread-badge {
    min-width: 23px;
    height: 23px;
    display: inline-grid;
    place-items: center;
    padding: 0 7px;
    border-radius: 999px;
    color: #fff;
    background: var(--primary);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 5px 13px rgba(107, 61, 235, .24);
}

.history-loader {
    display: block;
    min-height: 36px;
    margin: 0 auto 14px;
    padding: 8px 14px;
    border: 1px solid #ddd4e6;
    border-radius: 999px;
    color: #675d70;
    background: rgba(255, 255, 255, .88);
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(54, 40, 65, .05);
}

.history-loader:disabled {
    cursor: wait;
    opacity: .65;
}

.new-messages-button {
    position: sticky;
    left: 50%;
    bottom: 2px;
    z-index: 8;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 14px auto 0;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: #3d3545;
    font-size: 11px;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(44, 35, 51, .24);
}

.notification-heading {
    margin-top: 24px;
}

.privacy-toggle em {
    display: block;
    margin-top: 2px;
    color: #857c8d;
    font-size: 9px;
    font-style: normal;
    line-height: 1.35;
}

.privacy-toggle em.granted {
    color: #238454;
}

.privacy-toggle em.denied {
    color: #b23d4b;
}

.privacy-toggle em.pending {
    color: #8a6c25;
}

/* Step 11: Premium membership and pre-send AI English suggestions */
.ai-assist-button {
    width: 42px;
    height: 48px;
    display: grid;
    place-content: center;
    gap: 0;
    flex: 0 0 auto;
    border: 1px solid #d8cef2;
    border-radius: 14px;
    color: #6b3deb;
    background: #f2edff;
    cursor: pointer;
    transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
}
.ai-assist-button span { font-size: 19px; line-height: 1; }
.ai-assist-button small { font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.ai-assist-button.locked { color: #7f7589; border-color: #e0d9e5; background: #f3f0f5; }
.ai-assist-button.reviewing { animation: aiPulse 1.1s ease-in-out infinite; }
.ai-assist-button:disabled { cursor: not-allowed; opacity: .55; }
.ai-assist-button:not(:disabled):active { transform: scale(.94); }

body.ai-open { overflow: hidden; }
.ai-overlay {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    background: rgba(25, 18, 31, .48);
    backdrop-filter: blur(5px);
}
.ai-sheet {
    width: min(100%, 620px);
    max-height: min(86vh, 780px);
    overflow: auto;
    padding: 20px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 25px 25px 18px 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(32, 20, 43, .28);
}
.ai-sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.ai-sheet-heading span { color: #6b3deb; font-size: 9px; font-weight: 950; letter-spacing: .13em; }
.ai-sheet-heading h2 { margin: 4px 0 0; font-size: 22px; }
.ai-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 12px;
    color: #63596c;
    background: #f2eef5;
    font-size: 23px;
    cursor: pointer;
}
.ai-loading,
.ai-upgrade { min-height: 240px; display: grid; place-items: center; align-content: center; gap: 9px; padding: 24px 8px; text-align: center; }
.ai-loading strong,
.ai-upgrade h3 { margin: 0; font-size: 17px; }
.ai-loading small,
.ai-upgrade p { margin: 0; max-width: 390px; color: #7e7587; font-size: 11px; line-height: 1.55; }
.ai-spinner {
    width: 38px;
    height: 38px;
    border: 4px solid #e8e0fa;
    border-top-color: #6b3deb;
    border-radius: 50%;
    animation: aiSpin .85s linear infinite;
}
.ai-premium-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, #6b3deb, #9b70ff);
    font-size: 25px;
    box-shadow: 0 12px 28px rgba(107, 61, 235, .28);
}
.ai-upgrade .primary-link-button { width: auto; min-width: 180px; padding: 0 18px; }
.ai-result { display: grid; gap: 12px; margin-top: 18px; }
.ai-copy-block,
.ai-explanation,
.ai-alternative { padding: 14px; border-radius: 16px; }
.ai-copy-block { border: 1px solid #e8e1ed; background: #faf8fb; }
.ai-copy-block.suggestion { border-color: #d9ccfa; background: linear-gradient(135deg, #f1ebff, #faf8ff); }
.ai-copy-block span { color: #776e80; font-size: 9px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.ai-copy-block p,
.ai-explanation p,
.ai-alternative p { margin: 6px 0 0; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-explanation { color: #51475b; background: #f4f1f6; }
.ai-explanation strong,
.ai-alternative strong { font-size: 11px; }
.ai-alternative { border: 1px dashed #d7ccef; background: #fff; }
.ai-quota-note { color: #83798b; font-size: 9px; text-align: center; }
.ai-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ai-actions button { min-height: 46px; border-radius: 13px; font-size: 11px; font-weight: 900; cursor: pointer; }
.ai-actions .secondary-button { border: 1px solid #ddd4e5; color: #5f5667; background: #fff; }
.ai-actions .primary-button { border: 0; color: #fff; background: linear-gradient(135deg, #6b3deb, #7a4df0); }
.ai-message-badge {
    display: inline-flex;
    align-items: center;
    margin: 5px 0 0 6px;
    padding: 2px 6px;
    border-radius: 999px;
    color: #6b3deb;
    background: #eee7ff;
    font-size: 7px;
    font-weight: 950;
    letter-spacing: .04em;
    vertical-align: middle;
}

.membership-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    border: 1px solid #e3dbea;
    border-radius: 19px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(50, 36, 61, .06);
}
.membership-card.premium { color: #fff; border-color: transparent; background: linear-gradient(135deg, #5930cf, #7d50ef 62%, #946cff); }
.membership-card .membership-mark {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 14px;
    color: #fff;
    background: #6b3deb;
    font-size: 20px;
}
.membership-card.premium .membership-mark { color: #6b3deb; background: #fff; }
.membership-copy { min-width: 0; flex: 1; }
.membership-copy > span { font-size: 8px; font-weight: 950; letter-spacing: .13em; opacity: .78; }
.membership-copy h3 { margin: 4px 0 5px; font-size: 18px; }
.membership-copy p { margin: 0; color: #736a7b; font-size: 10px; line-height: 1.5; }
.membership-card.premium .membership-copy p { color: rgba(255,255,255,.86); }
.membership-copy small { display: block; margin-top: 7px; color: #958b9e; font-size: 9px; }
.membership-quota { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.membership-quota span { padding: 7px 9px; border-radius: 10px; background: rgba(255,255,255,.14); font-size: 9px; }
.membership-quota strong { font-size: 12px; }
.ai-preference-heading { margin-top: 24px; }

@keyframes aiSpin { to { transform: rotate(360deg); } }
@keyframes aiPulse { 50% { transform: scale(.94); box-shadow: 0 0 0 6px rgba(107,61,235,.10); } }

@media (min-width: 720px) {
    .ai-overlay { align-items: center; }
    .ai-sheet { border-radius: 25px; }
}
.ai-privacy-note { display: block; color: #938a9a; font-size: 8px; line-height: 1.45; text-align: center; }

/* Step 12: User center, legal pages and data copy requests */
.user-center-page { background: #f5f2f7; }
.user-center-shell,
.legal-shell { width: min(100%, 760px); min-height: 100vh; margin: 0 auto; background: #f8f6fa; box-shadow: 0 0 0 1px rgba(70,49,88,.04); }
.user-center-content,
.legal-content { display: grid; gap: 15px; padding: 18px 15px 96px; }
.header-text-link { align-self: center; color: #6b3deb; font-size: 10px; font-weight: 850; }
.user-center-hero,
.legal-title-card { display: flex; align-items: center; gap: 15px; padding: 20px; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #5d34d4, #7548e9 62%, #9267f5); box-shadow: 0 18px 40px rgba(89,48,207,.2); }
.user-center-hero-icon { width: 52px; height: 52px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 17px; background: rgba(255,255,255,.16); font-size: 24px; font-weight: 900; }
.user-center-hero span,
.legal-title-card > span { font-size: 8px; font-weight: 950; letter-spacing: .13em; opacity: .76; }
.user-center-hero h2,
.legal-title-card h1 { margin: 4px 0 5px; font-size: 20px; }
.user-center-hero p,
.legal-title-card p { margin: 0; color: rgba(255,255,255,.82); font-size: 10px; line-height: 1.5; }
.activity-filters { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.activity-filters::-webkit-scrollbar { display: none; }
.activity-filters a { flex: 0 0 auto; padding: 9px 13px; border: 1px solid #e5deea; border-radius: 999px; color: #756c7d; background: #fff; font-size: 9px; font-weight: 850; }
.activity-filters a.active { color: #fff; border-color: #6b3deb; background: #6b3deb; box-shadow: 0 8px 18px rgba(107,61,235,.18); }
.activity-feed-card,
.reports-user-card,
.data-scope-card,
.active-export-card,
.data-request-card,
.export-history-card,
.privacy-links-card,
.legal-document-card,
.profile-hub-card { padding: 18px; border: 1px solid #e6dfea; border-radius: 20px; background: #fff; box-shadow: 0 10px 30px rgba(50,36,61,.05); }
.user-center-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.user-center-section-heading span { color: #6b3deb; font-size: 8px; font-weight: 950; letter-spacing: .12em; }
.user-center-section-heading h3 { margin: 4px 0 0; font-size: 16px; }
.user-center-section-heading > a { color: #6b3deb; font-size: 9px; font-weight: 850; }
.user-activity-list,
.user-report-list,
.export-history-list { display: grid; gap: 10px; }
.user-activity-item { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: start; gap: 11px; padding: 13px; border: 1px solid #eee8f1; border-radius: 16px; background: #fcfbfd; }
.user-activity-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #6b3deb; background: #efe9ff; font-size: 15px; font-weight: 900; }
.user-activity-item.type-report .user-activity-icon { color: #a05a16; background: #fff2df; }
.user-activity-item.type-ai .user-activity-icon { color: #fff; background: linear-gradient(135deg,#6b3deb,#9568f8); }
.user-activity-item.type-membership .user-activity-icon { color: #17724a; background: #e8f8ef; }
.user-activity-copy { min-width: 0; }
.user-activity-copy header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.user-activity-copy strong { font-size: 11px; }
.user-activity-copy time { color: #9a929f; font-size: 8px; white-space: nowrap; }
.user-activity-copy p { margin: 5px 0 3px; color: #494150; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.user-activity-copy small { display: block; color: #8b8291; font-size: 8px; line-height: 1.45; overflow-wrap: anywhere; }
.user-status-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 5px 8px; border-radius: 999px; color: #665d6d; background: #eeeaf0; font-size: 7px; font-weight: 900; text-transform: uppercase; white-space: nowrap; }
.user-status-pill.status-ready,
.user-status-pill.status-success,
.user-status-pill.status-resolved,
.user-status-pill.status-active,
.user-status-pill.status-visible,
.user-status-pill.status-allowed { color: #1a7147; background: #e6f7ee; }
.user-status-pill.status-pending,
.user-status-pill.status-open,
.user-status-pill.status-reviewing,
.user-status-pill.status-processing,
.user-status-pill.status-auto_actioned { color: #8a5718; background: #fff0d9; }
.user-status-pill.status-rejected,
.user-status-pill.status-failed,
.user-status-pill.status-deleted,
.user-status-pill.status-expired { color: #9b3541; background: #fdecef; }
.user-status-pill.status-censored,
.user-status-pill.status-hidden { color: #7f5616; background: #fff3df; }
.user-center-empty { min-height: 210px; display: grid; place-items: center; align-content: center; gap: 7px; text-align: center; }
.user-center-empty > div { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; color: #6b3deb; background: #eee8ff; font-size: 21px; font-weight: 900; }
.user-center-empty h3 { margin: 3px 0 0; font-size: 15px; }
.user-center-empty p { max-width: 340px; margin: 0; color: #877e8e; font-size: 10px; line-height: 1.5; }
.user-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding-top: 13px; border-top: 1px solid #eee9f1; }
.user-pagination a { color: #6b3deb; font-size: 9px; font-weight: 850; }
.user-pagination span { color: #8a8290; font-size: 9px; }
.safety-info-card { padding: 14px 16px; border: 1px solid #efdcbf; border-radius: 17px; color: #6f4b20; background: #fff8ec; }
.safety-info-card strong { font-size: 11px; }
.safety-info-card p { margin: 5px 0 0; font-size: 9px; line-height: 1.55; }
.user-report-item { padding: 15px; border: 1px solid #e9e2ed; border-radius: 17px; background: #fcfbfd; }
.user-report-item > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.user-report-item header span:first-child { color: #8f8795; font-size: 7px; font-weight: 900; letter-spacing: .08em; }
.user-report-item h3 { margin: 4px 0 0; font-size: 13px; }
.reported-message-preview { margin-top: 11px; padding: 12px; border-left: 3px solid #6b3deb; border-radius: 11px; background: #f4f0fb; }
.reported-message-preview strong { color: #644f83; font-size: 9px; }
.reported-message-preview p { margin: 5px 0 0; color: #453d4d; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.report-user-note,
.report-resolution { margin: 10px 0 0; color: #655d6c; font-size: 9px; line-height: 1.5; }
.report-resolution { padding: 10px; border-radius: 11px; color: #236040; background: #eaf8f0; }
.user-report-item footer { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 11px; color: #958d9b; font-size: 8px; }

.profile-hub-card { margin-top: 0; }
.profile-hub-links { display: grid; gap: 8px; }
.profile-hub-links a { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; border: 1px solid #ebe5ef; border-radius: 15px; color: #453d4d; background: #fcfbfd; }
.profile-hub-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #6b3deb; background: #eee8ff; font-size: 15px; font-weight: 900; }
.profile-hub-links a > span:nth-child(2) { display: grid; gap: 2px; }
.profile-hub-links strong { font-size: 11px; }
.profile-hub-links small { color: #8a8190; font-size: 8px; line-height: 1.35; }
.profile-hub-links b { color: #a49baa; font-size: 20px; font-weight: 500; }

.legal-page { background: #f4f1f7; }
.legal-content { padding-bottom: 36px; }
.legal-title-card { display: block; }
.legal-title-card h1 { font-size: 23px; }
.legal-document-card { padding: 22px; }
.legal-prose section { display: grid; gap: 0; }
.legal-prose h2 { margin: 23px 0 7px; color: #312938; font-size: 15px; }
.legal-prose h2:first-of-type { margin-top: 17px; }
.legal-prose p { margin: 0 0 10px; color: #5f5667; font-size: 11px; line-height: 1.72; }
.legal-prose strong { color: #3f3548; }
.legal-link-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.legal-link-grid a { display: grid; gap: 3px; padding: 14px; border: 1px solid #e3dce8; border-radius: 15px; color: #4f4658; background: #fff; }
.legal-link-grid strong { font-size: 10px; }
.legal-link-grid span { color: #8f8696; font-size: 8px; }
.legal-back-link { display: block; padding: 12px; color: #6b3deb; text-align: center; font-size: 10px; font-weight: 850; }

.data-scope-card h3,
.privacy-links-card h3 { margin: 0 0 12px; font-size: 15px; }
.data-scope-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.data-scope-grid span { padding: 10px; border-radius: 12px; color: #5d5266; background: #f4f0f7; font-size: 9px; line-height: 1.4; }
.data-scope-card > p { margin: 12px 0 0; color: #867d8c; font-size: 9px; line-height: 1.55; }
.active-export-card { border-left: 4px solid #8b7d95; }
.active-export-card.status-ready { border-left-color: #2a9a67; }
.active-export-card.status-pending,
.active-export-card.status-processing { border-left-color: #d08b2f; }
.active-export-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.active-export-heading > div > span,
.data-request-card > div > span { color: #6b3deb; font-size: 8px; font-weight: 950; letter-spacing: .12em; }
.active-export-heading h3,
.data-request-card h3 { margin: 4px 0 0; font-size: 17px; }
.export-meta-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 15px 0; }
.export-meta-list div { padding: 10px; border-radius: 12px; background: #f5f2f7; }
.export-meta-list dt { color: #8b8291; font-size: 7px; font-weight: 850; }
.export-meta-list dd { margin: 4px 0 0; color: #433b4b; font-size: 9px; font-weight: 750; }
.export-admin-note,
.export-wait-note { padding: 11px; border-radius: 12px; color: #615768; background: #f5f1f7; font-size: 9px; line-height: 1.5; }
.export-download-button { margin-top: 12px; }
.export-security-note { display: block; margin-top: 8px; color: #8c8392; font-size: 8px; line-height: 1.45; text-align: center; }
.data-request-card { display: grid; gap: 14px; }
.data-request-card > div > p { margin: 5px 0 0; color: #83798a; font-size: 9px; line-height: 1.5; }
.data-request-card label { display: grid; gap: 6px; color: #5b5263; font-size: 9px; font-weight: 800; }
.data-request-card textarea { width: 100%; resize: vertical; border: 1px solid #ddd5e3; border-radius: 13px; padding: 12px; color: #3f3746; background: #fcfbfd; font: inherit; font-size: 11px; outline: none; }
.data-request-card textarea:focus { border-color: #8b62eb; box-shadow: 0 0 0 3px rgba(107,61,235,.1); }
.data-confirm-row { display: flex !important; grid-template-columns: none; align-items: flex-start; gap: 9px; font-weight: 500 !important; line-height: 1.45; }
.data-confirm-row input { margin-top: 2px; accent-color: #6b3deb; }
.export-history-list article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid #ebe5ef; border-radius: 13px; background: #fcfbfd; }
.export-history-list article > div { display: grid; gap: 3px; }
.export-history-list strong { font-size: 10px; }
.export-history-list article > div > span { color: #918997; font-size: 8px; }
.privacy-links-card { display: grid; gap: 7px; }
.privacy-links-card h3 { margin-bottom: 4px; }
.privacy-links-card a { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid #eee9f1; color: #514858; font-size: 10px; }
.privacy-links-card a:last-child { border-bottom: 0; }
.privacy-links-card a span { color: #9a919f; font-size: 18px; }

@media (max-width: 560px) {
    .user-activity-item { grid-template-columns: 38px minmax(0,1fr); }
    .user-activity-icon { width: 38px; height: 38px; }
    .user-activity-item > .user-status-pill { grid-column: 2; justify-self: start; }
    .user-activity-copy header { align-items: flex-start; }
    .user-activity-copy time { margin-top: 2px; }
    .legal-link-grid,
    .data-scope-grid { grid-template-columns: 1fr; }
    .export-meta-list { grid-template-columns: 1fr; }
    .user-center-hero { align-items: flex-start; }
    .user-center-hero h2 { font-size: 18px; }
}

/* Step 13: Dynamic room icon and locked room states */
.room-card.is-locked {
    cursor: not-allowed;
    opacity: .72;
    background: #f7f6f9;
    border-color: #e5e2e9;
    box-shadow: none;
    pointer-events: none;
}
.room-card.is-locked .room-icon { filter: grayscale(.35); }
.room-card.is-locked .online-dot { background: #a8a3ad; box-shadow: none; }
.room-card.is-locked .room-arrow { font-size: 13px; }
.locked-badge { background: #ece9ef !important; color: #716a78 !important; }


/* Step 15: featured community member styling */
.official-member-badge {
    --highlight-color: #6b3deb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    padding: 2px 7px;
    border: 1px solid color-mix(in srgb, var(--highlight-color) 30%, white);
    border-radius: 999px;
    color: #fff;
    background: var(--highlight-color);
    box-shadow: 0 3px 9px color-mix(in srgb, var(--highlight-color) 22%, transparent);
    font-size: 7px;
    font-weight: 950;
    letter-spacing: .09em;
    line-height: 1;
    vertical-align: middle;
}

.featured-member-message .message-bubble {
    border: 1px solid color-mix(in srgb, var(--highlight-color) 35%, white);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--highlight-color) 10%, white),
        color-mix(in srgb, var(--highlight-color) 4%, white));
    box-shadow: 0 7px 22px color-mix(in srgb, var(--highlight-color) 14%, transparent);
}

.featured-member-message.outgoing .message-bubble {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--highlight-color) 18%, white),
        color-mix(in srgb, var(--highlight-color) 9%, white));
}

.featured-member-message .message-sender {
    color: color-mix(in srgb, var(--highlight-color) 86%, #18131f);
    font-weight: 900;
}

.featured-member-avatar {
    outline: 2px solid color-mix(in srgb, var(--highlight-color) 55%, white);
    outline-offset: 2px;
    box-shadow: 0 5px 14px color-mix(in srgb, var(--highlight-color) 22%, transparent);
}

.bubble-featured-badge {
    margin: 0 7px 4px 0;
    transform: translateY(-1px);
}

.featured-presence-user {
    border-color: color-mix(in srgb, var(--highlight-color) 30%, white);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--highlight-color) 7%, white), #fff);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--highlight-color) 9%, transparent);
}

.featured-presence-user strong {
    color: color-mix(in srgb, var(--highlight-color) 82%, #1e1726);
}

.featured-member-profile {
    border: 1px solid color-mix(in srgb, var(--highlight-color) 33%, white);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--highlight-color) 9%, white), #fff 64%);
    box-shadow: 0 12px 34px color-mix(in srgb, var(--highlight-color) 12%, transparent);
}

@supports not (color: color-mix(in srgb, #000 50%, #fff)) {
    .featured-member-message .message-bubble,
    .featured-presence-user,
    .featured-member-profile { border-color: #cfc0f8; background: #f7f3ff; }
}
