/* KaiChat — WhatsApp-style CSS (Fully Responsive) */

/* ---------- Theme Variables ---------- */
/* Default = WhatsApp dark (matches reference UI) */
:root, html.theme-default, html.theme-wa, html.theme-dark {
    --bg-color: #0b141a;
    --panel-bg: #111b21;
    --surface-raised: #182229;
    --text-color: #e9edef;
    --text-muted: #8696a0;
    --text-faint: #5b6770;
    --primary-color: #00a884;
    --primary-focus: #06cf9c;
    --header-bg: #1f2c34;
    --header-text: #e9edef;
    --border-color: #233138;
    --border-subtle: rgba(255,255,255,0.06);
    --focus-ring: rgba(0, 168, 132, 0.45);
    --msg-me-bg: #005c4b;
    --msg-me-border: transparent;
    --msg-other-bg: #1f2c34;
    --msg-other-border: transparent;
    --modal-bg: rgba(0,0,0,0.6);
    --modal-content-bg: #111b21;
    --outer-bg: #000000;
    --unread-badge: #00a884;
    --tick-color: #53bdeb;
    --nav-active: #00a884;
    --nav-inactive: #8696a0;
    --search-bg: #1f2c34;
    --danger-color: #f15c5c;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.35);
    --shadow-lg: 0 6px 20px rgba(0,0,0,0.45);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-pill: 999px;
}

/* Optional light variant kept for settings toggle */
html.theme-light {
    --bg-color: #f7f8fa;
    --panel-bg: #ffffff;
    --surface-raised: #ffffff;
    --text-color: #111b21;
    --text-muted: #667781;
    --text-faint: #9aa3a9;
    --primary-color: #008069;
    --primary-focus: #06cf9c;
    --header-bg: #ffffff;
    --header-text: #111b21;
    --border-color: #e9edef;
    --border-subtle: rgba(0,0,0,0.06);
    --focus-ring: rgba(0, 128, 105, 0.35);
    --msg-me-bg: #d9fdd3;
    --msg-other-bg: #ffffff;
    --modal-content-bg: #ffffff;
    --outer-bg: #2a2a2a;
    --tick-color: #53bdeb;
    --nav-active: #008069;
    --nav-inactive: #8696a0;
    --search-bg: #f0f2f5;
    --danger-color: #e23744;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif; }

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    background-color: var(--outer-bg);
    display: flex;
    justify-content: center;
}

::-webkit-scrollbar { display: none; }

#app {
    width: 100%;
    max-width: 600px;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-lg);
}

/* ---------- Headers ---------- */
header {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 19px;
    flex-shrink: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-subtle);
}
.chat-header { justify-content: space-between; }
.title { flex-grow: 1; text-align: left; font-size: 18px; font-weight: 600; }
.app-title { font-size: 21px; font-weight: 700; flex-grow: 1; letter-spacing: -0.2px; }
.user-badge { font-size: 11.5px; background: rgba(255,255,255,0.1); padding: 5px 10px; border-radius: var(--radius-pill); display: flex; align-items: center; gap: 4px; font-weight: 500; color: var(--header-text); }

.header-icons { display: flex; align-items: center; gap: 6px; }

/* ---------- Search bar ---------- */
.search-bar-wrap { padding: 6px 12px 10px; flex-shrink: 0; }
.search-bar {
    display: flex; align-items: center; gap: 10px;
    background: var(--search-bg); border-radius: var(--radius-pill);
    padding: 10px 16px; color: var(--text-muted); font-size: 14.5px;
}
.search-bar svg { flex-shrink: 0; opacity: 0.8; }

main {
    flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column;
}
.login-main, .settings-main { background: var(--bg-color); padding: 24px 20px; }
.login-main { justify-content: center; gap: 14px; }
.settings-main { justify-content: flex-start; padding-top: 24px; gap: 0; }
.chat-list-main { background: var(--bg-color); padding: 0; }
.contacts-main { background: var(--bg-color); padding: 0; }
.wa-chat-window {
    padding: 14px 4%;
    background-color: var(--bg-color);
}

.hidden { display: none !important; }

#error-msg, #dashboard-msg {
    color: #fff; font-size: 12.5px; text-align: center; background: var(--danger-color); padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
#dashboard-msg.success { background: var(--primary-color); }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); padding-left: 2px; }

input, button {
    font-size: 14.5px;
    padding: 13px 14px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, transform 0.06s ease;
    font-family: inherit;
}
input {
    background-color: var(--surface-raised);
    color: var(--text-color);
    border: 1.5px solid var(--border-color);
}
input::placeholder { color: var(--text-faint); }

.actions { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.theme-options { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; border-radius: var(--radius-md); overflow: hidden; }

button {
    background-color: var(--surface-raised);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    border: 1.5px solid var(--border-color);
}
button:active { transform: scale(0.98); }
button.primary { background: var(--primary-color); color: #fff; border: none; box-shadow: var(--shadow-sm); }
button.primary:active { transform: scale(0.98); }
button.secondary { background-color: transparent; border: 1.5px solid var(--border-color); color: var(--text-color); }

.icon-btn {
    padding: 0; display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; color: inherit; border-radius: 50%;
    width: 40px; height: 40px; flex-shrink: 0;
}
header .icon-btn { color: var(--header-text); }
header .icon-btn:hover { background: rgba(255,255,255,0.08); }

/* ---------- Focus states: visible for keyboard/d-pad nav, never a stuck "error ring" ---------- */
.navigable:focus { outline: none; }

/* Buttons & list rows: a soft glow, not a hard outline */
button.navigable:focus,
.chat-list-item.navigable:focus,
.nav-item.navigable:focus {
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.icon-btn.navigable:focus {
    background: rgba(255,255,255,0.1);
    box-shadow: none;
}
/* Inputs: just a clean border highlight, like a normal text field */
input.navigable:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
button.primary.navigable:focus { box-shadow: 0 0 0 3px var(--focus-ring); }

/* ---------- App Logo (login) ---------- */
.brand-row { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 18px; }
.brand-row .brand-icon {
    width: 64px; height: 64px; border-radius: var(--radius-md);
    background: var(--primary-color);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md);
    margin-bottom: 6px;
}
.brand-row .brand-name { font-size: 21px; font-weight: 700; color: var(--text-color); }
.brand-row .brand-sub { font-size: 13px; color: var(--text-muted); }

/* ---------- Chat List (WhatsApp style) ---------- */
ul#friends-list, ul#requests-list { list-style: none; display: flex; flex-direction: column; margin: 0; padding: 0; }

.chat-list-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 0;
    transition: background-color 0.12s ease;
}
.chat-list-item:hover { background: rgba(255,255,255,0.035); }
.chat-list-item:active { background: rgba(255,255,255,0.06); }

.avatar {
    width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0;
    background: #9e9e9e;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600; font-size: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.chat-list-body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-list-row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chat-list-name { font-size: 15.5px; font-weight: 500; color: var(--text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-time { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.chat-list-row2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chat-list-preview { font-size: 13.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-grow: 1; }
.unread-badge {
    background: var(--unread-badge); color: #06241d; font-size: 11.5px; font-weight: 700;
    min-width: 20px; height: 20px; border-radius: var(--radius-pill); display: flex; align-items: center; justify-content: center;
    padding: 0 6px; flex-shrink: 0;
}

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 60px 36px; color: var(--text-muted); text-align: center; flex-grow: 1; }
.empty-state svg { opacity: 0.35; }
.empty-state .empty-title { font-size: 16px; font-weight: 600; color: var(--text-color); }
.empty-state .empty-sub { font-size: 13.5px; line-height: 1.5; }

.section-title { font-size: 12.5px; font-weight: 700; padding: 14px 16px 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }

/* Friend request row */
.request-item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.request-item .chat-list-body { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.request-item .chat-list-name { font-weight: 500; }
.request-item button { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-pill); flex-shrink: 0; }

/* ---------- FAB (new chat) ---------- */
.fab {
    position: absolute; right: 18px; bottom: 84px;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--primary-color); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-lg);
    border: none; cursor: pointer; z-index: 20;
}
.fab:active { transform: scale(0.96); }

/* ---------- Add contact panel ---------- */
.add-contact-panel {
    padding: 12px 16px; background: var(--bg-color);
    border-bottom: 1px solid var(--border-subtle);
    display: flex; gap: 10px; flex-shrink: 0;
}
.add-contact-panel input { flex-grow: 1; min-width: 0; }
.add-contact-panel button { padding: 0 18px; flex-shrink: 0; border-radius: var(--radius-sm); }

/* ---------- Bottom Nav ---------- */
nav.bottom-nav {
    display: flex; justify-content: space-around; align-items: center;
    background: var(--header-bg);
    border-top: 1px solid var(--border-subtle);
    padding: 9px 0 12px;
    flex-shrink: 0;
}
nav.bottom-nav .nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: transparent; border: none; color: var(--nav-inactive);
    font-size: 11.5px; font-weight: 500; padding: 4px 18px; border-radius: var(--radius-sm);
    cursor: pointer;
}
nav.bottom-nav .nav-item.active { color: var(--nav-active); }
nav.bottom-nav .nav-item svg { display: block; }

/* ---------- Settings ---------- */
.settings-main h3 { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; padding-left: 2px; }
.theme-btn {
    text-align: left; border-radius: 0; border: none;
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border-subtle);
    padding: 14px 16px;
    position: relative;
}
.theme-options .theme-btn:first-child { border-top-left-radius: var(--radius-md); border-top-right-radius: var(--radius-md); }
.theme-options .theme-btn:last-child { border-bottom-left-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); border-bottom: none; }
.theme-btn.active { color: var(--primary-color); font-weight: 600; }
.theme-btn.active::after {
    content: "✓"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    font-weight: 700;
}

/* ---------- Footer / Chat input ---------- */
footer { display: flex; padding: 10px 10px; background-color: var(--bg-color); flex-shrink: 0; gap: 8px; align-items: center; }
footer input { flex-grow: 1; min-width: 0; padding: 11px 14px; border-radius: var(--radius-pill); border: 1.5px solid var(--border-color); background: var(--surface-raised); }
footer .icon-btn { width: 40px; height: 40px; flex-shrink: 0; color: var(--text-muted); }

ul#messages { list-style: none; display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; }
ul#messages:focus { outline: none; }
.msg {
    max-width: 78%;
    padding: 8px 10px 8px 12px;
    border-radius: var(--radius-md);
    font-size: 14.5px;
    word-wrap: break-word;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    line-height: 1.35;
    margin-bottom: 6px;
}
.msg .sender { font-size: 12px; font-weight: 700; margin-bottom: 3px; color: var(--primary-focus); }
.msg .content { line-height: 1.4; padding-right: 4px; }
.msg .msg-bottom { display: flex; justify-content: flex-end; align-items: center; gap: 5px; margin-top: 4px; float: none; }
.msg .timestamp { font-size: 11px; color: var(--text-muted); }
.msg-other { align-self: flex-start; background-color: var(--msg-other-bg); border-bottom-left-radius: 4px; }
.msg-me { align-self: flex-end; background-color: var(--msg-me-bg); border-bottom-right-radius: 4px; }
.msg-me .sender { display: none; }
.msg-me .timestamp { color: rgba(255,255,255,0.6); }

.del-btn {
    background: transparent; border: none; color: var(--text-muted);
    padding: 2px; box-shadow: none; opacity: 0.7;
    display: inline-flex; align-items: center; justify-content: center;
}
.del-btn:hover { opacity: 1; color: var(--danger-color); }
.tick-icon { display: inline-flex; align-items: center; }

.date-indicator {
    align-self: center; background-color: var(--surface-raised); color: var(--text-muted);
    font-size: 11px; font-weight: 600; padding: 6px 14px; border-radius: var(--radius-sm); margin: 4px 0 14px; text-transform: uppercase;
    letter-spacing: 0.4px; box-shadow: var(--shadow-sm);
}

/* ---------- Chat header (1:1) ---------- */
.wa-header { padding: 10px 14px; }
.header-left { display: flex; align-items: center; gap: 10px; flex-grow: 1; min-width: 0; }
.profile-pic { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; font-size: 16px; }
.profile-pic img { width: 100%; height: 100%; object-fit: cover; }
.header-info { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.header-info .title { font-size: 16px; text-align: left; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-info .status { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.header-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

/* ---------- Empty / misc ---------- */
.no-messages-hint { text-align: center; color: var(--text-muted); font-size: 13px; padding: 30px 20px; }

/* ══════════════════════════════════════════════════════════════════
   WORLD CHAT STYLES
   ══════════════════════════════════════════════════════════════════ */

/* World chat item in friends list — pinned, distinct look */
a.world-item {
    text-decoration: none;
    color: inherit;
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(90deg, rgba(0,168,132,0.06) 0%, transparent 100%);
}
a.world-item:hover { background: rgba(0,168,132,0.1); }

.world-avatar-icon {
    width: 50px; height: 50px; border-radius: 50%;
    background: linear-gradient(135deg, #1a6b52, #00a884);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(0,168,132,0.3);
}

.world-badge {
    font-size: 11px; font-weight: 700; padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: var(--surface-raised);
    color: var(--text-muted);
    flex-shrink: 0;
}
.world-badge-live {
    background: rgba(0,200,130,0.18);
    color: #00c882;
    animation: pulse-live 2s infinite;
}
@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Online users strip inside world chat */
.online-users-bar {
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border-subtle);
    padding: 6px 12px;
    overflow-x: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
    scrollbar-width: none;
}
.online-users-bar::-webkit-scrollbar { display: none; }
#online-users-list {
    display: flex; gap: 6px; align-items: center;
    font-size: 12px; color: var(--text-muted);
}
.online-pill {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(0,200,130,0.12);
    color: #00c882;
    font-size: 11.5px; font-weight: 600;
    padding: 3px 9px; border-radius: var(--radius-pill);
}
.online-pill::before {
    content: '●'; font-size: 8px; color: #00c882;
}

/* World chat message with avatar for "other" side */
.msg-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff;
    flex-shrink: 0; position: absolute; left: -32px; bottom: 0;
}
.msg-other { position: relative; margin-left: 36px; }

/* World page avatar is 40px round */
.world-page .avatar.world-avatar-icon { width: 40px; height: 40px; font-size: 18px; }

/* Friends section title (shown only when friends exist) */
.friends-section-label { }

/* ══════════════════════════════════════════════════════════════════
   KaiOS SOFT-KEY BAR
   ══════════════════════════════════════════════════════════════════ */

.kai-softbar {
    display: none; /* hidden on large screens */
    justify-content: space-between;
    align-items: center;
    background: var(--header-bg);
    border-top: 1px solid var(--border-subtle);
    padding: 5px 8px;
    flex-shrink: 0;
    height: 28px;
    z-index: 50;
}
.kai-sk {
    font-size: 11px; font-weight: 600;
    color: var(--primary-color);
    min-width: 48px; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    user-select: none;
    text-transform: uppercase; letter-spacing: 0.3px;
}
.kai-lsk-label { text-align: left; }
.kai-csk-label { text-align: center; color: var(--text-color); }
.kai-rsk-label { text-align: right; }

/* ══════════════════════════════════════════════════════════════════
   KaiOS / SMALL SCREEN RESPONSIVE (240×320 QVGA)
   ══════════════════════════════════════════════════════════════════ */

@media (max-width: 320px) {

    /* Show KaiOS soft-key bar */
    .kai-softbar { display: flex !important; }

    /* Hide regular bottom nav — soft keys replace it on KaiOS */
    nav.bottom-nav { display: none !important; }

    /* Hide FAB, use contacts soft key */
    .fab { display: none !important; }

    /* App fills the tiny screen, no outer gutter */
    body { background: var(--bg-color); }
    #app { max-width: 100%; box-shadow: none; }

    /* Header — tighter */
    header { padding: 8px 10px; font-size: 16px; }
    .app-title { font-size: 17px; }
    .user-badge { font-size: 10px; padding: 3px 7px; }
    .icon-btn { width: 34px; height: 34px; }

    /* Search bar — smaller */
    .search-bar-wrap { padding: 4px 10px 6px; }
    .search-bar { padding: 7px 12px; font-size: 13px; }

    /* World chat item */
    .world-avatar-icon { width: 42px; height: 42px; font-size: 18px; }
    .chat-list-item { padding: 9px 10px; gap: 10px; }
    .avatar { width: 42px; height: 42px; font-size: 15px; }
    .chat-list-name { font-size: 14px; }
    .chat-list-preview { font-size: 12px; }
    .world-badge { font-size: 10px; padding: 2px 6px; }

    /* Online users bar — more compact */
    .online-users-bar { padding: 4px 8px; }
    .online-pill { font-size: 10px; padding: 2px 7px; }

    /* Messages */
    .msg { font-size: 13.5px; padding: 6px 8px; max-width: 88%; }
    .msg .sender { font-size: 11px; }
    .msg .timestamp { font-size: 10px; }
    .wa-chat-window { padding: 8px 3%; }

    /* Footer / input */
    .wa-footer { padding: 6px 6px; gap: 5px; }
    .wa-input-wrapper { padding: 2px 4px; }
    .wa-input-wrapper input { font-size: 13.5px; padding: 7px 4px; }
    .wa-send-btn { width: 38px; height: 38px; }

    /* Login form */
    .login-main { padding: 16px 14px; gap: 10px; }
    .brand-row .brand-name { font-size: 18px; }
    .brand-row .brand-icon { width: 52px; height: 52px; }
    input { padding: 11px 12px; font-size: 14px; }
    .actions { gap: 8px; }

    /* Settings */
    .settings-main { padding: 16px 14px; }
    .theme-btn { padding: 12px 14px; font-size: 14px; }

    /* Contacts add panel */
    .add-contact-panel { padding: 8px 10px; gap: 7px; }
    .add-contact-panel button { padding: 0 12px; }

    /* Section titles */
    .section-title { padding: 10px 10px 5px; font-size: 11px; }

    /* Request items */
    .request-item { padding: 8px 10px; }
    .request-item button { padding: 6px 12px; font-size: 12px; }

    /* Emoji modal — compact grid */
    #emoji-modal { height: 170px; }
    .emoji-grid { grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 8px; }
    .emoji-btn { font-size: 20px; padding: 5px; }
    .emoji-header { padding: 8px 12px; font-size: 12px; }

    /* Focused item larger hit area for d-pad */
    .navigable:focus {
        outline: 2px solid var(--primary-color) !important;
        outline-offset: 1px;
    }
    button.navigable:focus,
    .chat-list-item.navigable:focus,
    a.world-item.navigable:focus {
        box-shadow: 0 0 0 2px var(--primary-color);
        outline: none !important;
    }

    /* Date indicator */
    .date-indicator { font-size: 10px; padding: 4px 10px; }

    /* Header info on chat pages */
    .wa-header { padding: 7px 10px; }
    .header-info .title { font-size: 14px; }
    .header-info .status { font-size: 11px; }
    .profile-pic { width: 34px; height: 34px; font-size: 13px; }
}

/* Very wide KaiOS-style (landscape or slightly larger 360px) */
@media (max-width: 360px) and (min-width: 321px) {
    .kai-softbar { display: flex !important; }
    nav.bottom-nav { padding: 6px 0 8px; }
    nav.bottom-nav .nav-item { font-size: 10.5px; padding: 3px 12px; }
}

/* ── Register mode toggle ──────────────────────────────────── */
.mode-toggle-link {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}
.mode-toggle-link span {
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* ── Friend request action buttons ────────────────────────── */
.request-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.req-accept-btn {
    font-size: 12px !important;
    padding: 6px 12px !important;
    border-radius: var(--radius-pill) !important;
    flex-shrink: 0;
}
.req-reject-btn {
    font-size: 12px !important;
    padding: 6px 12px !important;
    border-radius: var(--radius-pill) !important;
    flex-shrink: 0;
    background: transparent !important;
    border: 1.5px solid var(--border-color) !important;
    color: var(--text-muted) !important;
}
.request-item .chat-list-body {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
}

/* ── World Chat Risky Message Warning ─────────────────────── */
.risky-warning {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    padding: 3px 8px 3px 6px;
    background: rgba(231, 76, 60, 0.13);
    border: 1px solid rgba(231, 76, 60, 0.35);
    border-radius: 4px;
    color: #e74c3c;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1.3;
    max-width: 100%;
}
.risky-warning svg {
    flex-shrink: 0;
    opacity: 0.9;
}
.risky-warning span {
    white-space: nowrap;
}
/* Slight dim on the censored content text */
.msg .content:has(+ .risky-warning),
.msg.has-risky .content {
    opacity: 0.88;
}
