/**
 * grup-ff.css — Tema dan Gaya Responsif Komunitas Jual Beli FF JagoTopup
 *
 * Sesuai panduan AGENTS.md, mockup 23 September 2026, dan standar aksesibilitas.
 * Bekerja pada Desktop (1440x900), Tablet (820x1024), Android (412x860),
 * iPhone (390x844), lebar minimum 320px, dan orientasi landscape mobile.
 */

:root {
    color-scheme: dark;
    --bg: #0b0c14;
    --panel: #131522;
    --raised: #1a1d2e;
    --line: #2a2d42;
    --text: #edeef6;
    --muted: #aaadc4;
    --orange: #f08519;
    --orange-hover: #ff9933;
    --purple: #a5a8ff;
    --red: #f87171;
    --red-hover: #ef4444;
    --green: #4ade80;
    --green-bg: #14532d;
    --blue-bg: #1e3a8a;
    --focus-ring: #f08519;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select {
    font: inherit;
}

button {
    cursor: pointer;
    color: inherit;
    border: 0;
    background: none;
    padding: 0;
    touch-action: manipulation;
}

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Base App Layout */
.app {
    height: 100%;
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: var(--bg);
}

/* Sidebar (Desktop / Tablet) */
.sidebar {
    background: var(--panel);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    gap: 12px;
    overflow-y: auto;
}

.brand {
    font-size: 22px;
    font-weight: 850;
    letter-spacing: -1px;
    padding: 0 8px;
    line-height: 1.2;
}

.brand em {
    color: var(--orange);
    font-style: normal;
}

.brand small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--muted);
    margin-top: 4px;
}

.side-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin: 20px 8px 4px;
}

.room {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 12px;
    background: #242541;
    border-radius: 12px;
    width: 100%;
    border: 1px solid #3a3d65;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.room:hover {
    background: #2c2e50;
    border-color: #4b4f80;
}

.room strong {
    display: block;
    font-size: 14px;
    color: var(--text);
}

.room small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: #30345f;
    color: #c5c7ff;
    font-size: 13px;
    font-weight: 750;
    user-select: none;
    overflow: hidden;
}

.avatar img,
.avatar img.km-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.avatar.ff {
    background: var(--orange);
    color: #241104;
    border-radius: 14px;
    font-size: 17px;
}

.avatar.seller {
    background: #343957;
    color: #d1d8fc;
}

.avatar.km-room-header-ava {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    background: #1e2638;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar.km-room-header-ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.avatar.km-room-header-ava .ava-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.km-room-header-presence {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 999px;
    margin-left: auto;
    margin-right: 6px;
    flex-shrink: 0;
}

.km-room-header-presence .km-presence-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.km-room-header-presence .km-presence-label {
    font-size: 11px;
    font-weight: 600;
    color: #10b981;
    line-height: 1;
}

.side-note {
    margin: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.side-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.side-bottom {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding: 16px 8px 0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.side-bottom strong {
    display: block;
    font-size: 13px;
    color: var(--text);
}

.side-bottom small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

/* Room View (Chat Column) */
.room-view {
    min-width: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

/* Header */
.header {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 18px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    z-index: 10;
    flex-shrink: 0;
    box-sizing: border-box;
    min-height: 58px;
}

.header-title {
    flex: 1;
    min-width: 0;
    text-align: left;
    padding: 4px;
    border-radius: 8px;
}

.header-title:hover {
    background: var(--raised);
}

.header h1 {
    font-size: 17px;
    margin: 0;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header p {
    font-size: 12px;
    margin: 2px 0 0;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon {
    font-size: 20px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    color: var(--text);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.icon:hover {
    background: var(--raised);
}

.icon-mod {
    background: #3b2816;
    color: var(--orange);
    border: 1px solid #634320;
    font-size: 13px;
    font-weight: 700;
    padding: 0 12px;
    min-width: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.icon-mod:hover {
    background: #4a341d;
}

/* Pin Bar (Rules) */
.pin {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 7px 18px;
    border-bottom: 1px solid #2c2c3e;
    background: #1b1c2c;
    width: 100%;
    font-size: 11.5px;
    color: var(--muted);
    transition: background-color 0.15s ease;
    flex-shrink: 0;
    box-sizing: border-box;
    max-height: 38px;
}

.pin:hover {
    background: #23253b;
}

.pin strong {
    color: #dddff4;
    margin-right: 8px;
}

.pin .pin-copy {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pin span:last-child {
    font-size: 16px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Timeline */
.timeline {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 20px;
    scrollbar-width: thin;
    scrollbar-color: #34374b transparent;
    background-color: #0e101b;
    background-image: radial-gradient(#ffffff07 1px, transparent 1px);
    background-size: 22px 22px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.load-more-wrap {
    text-align: center;
    margin-bottom: 16px;
}

.load-more-btn {
    background: #1f2235;
    color: #c5c7ff;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid #333650;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.load-more-btn:hover {
    background: #262a42;
    border-color: #44486d;
}

.date {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    margin: 0 0 16px;
}

.date span {
    background: #202335;
    padding: 5px 13px;
    border-radius: 6px;
}

.notice {
    text-align: center;
    max-width: 480px;
    margin: 0 auto 20px;
    font-size: 11px;
    color: var(--muted);
    line-height: 1.6;
    background: #151726;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #23273e;
}

/* Jump to Latest Floating Button */
.jump-latest-wrap {
    position: absolute;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    text-align: center;
}

.jump-latest-btn {
    background: var(--orange);
    color: #271403;
    font-size: 12px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 24px;
    border: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.jump-latest-btn:hover {
    filter: brightness(1.1);
    transform: scale(1.03);
}

/* Message Bubble */
.message {
    display: flex;
    gap: 8px;
    margin: 0 0 10px;
    align-items: flex-start;
}

.message > .avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
    margin-top: 2px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bubble {
    background: #1f2234;
    padding: 8px 12px 6px;
    border-radius: 3px 13px 13px 13px;
    width: fit-content;
    max-width: min(85%, 480px);
    min-width: 0;
    box-shadow: 0 1px 2px #00000030;
    box-sizing: border-box;
}

.name {
    font-size: 12px;
    font-weight: 700;
    color: #b8bbff;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 20px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.name:hover {
    color: #ffffff;
    text-decoration: underline;
}

.badge {
    background: #343759;
    color: #d4d6ff;
    font-size: 9px;
    border-radius: 4px;
    padding: 1px 5px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge-admin {
    background: #6b3e0c;
    color: #ffd699;
}

.bubble p {
    margin: 2px 0 4px;
    font-size: 13.5px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.42;
}

.meta {
    display: flex;
    align-items: center;
    color: var(--muted);
    font-size: 10px;
    user-select: none;
    margin-top: 2px;
}

.bubble-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
    padding-top: 0;
}

.bubble-footer .time {
    color: var(--muted);
    font-size: 10px;
    user-select: none;
    margin-left: auto;
    flex-shrink: 0;
    line-height: 1.2;
}

.actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 0;
    padding-top: 0;
}

.actions .act,
.meta button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: background-color 0.15s ease, color 0.15s ease;
    touch-action: manipulation;
}

.meta button {
    min-height: 44px;
    min-width: 44px;
}

.actions .act:hover,
.meta button:hover {
    background: #2c2f46;
    color: var(--text);
}

.actions .act-danger {
    color: #e57373;
}

.actions .act-danger:hover {
    background: rgba(229, 115, 115, 0.15);
    color: #ff8a80;
}

.own {
    justify-content: flex-end;
}

.own .bubble {
    background: #0f4a2d;
    border-radius: 13px 3px 13px 13px;
}

/* Moderator bubble: Deep indigo (NO red outline/glow), even when own */
.bubble.bubble-moderator,
.own .bubble.bubble-moderator {
    background: #1e2456 !important;
    border: none !important;
    box-shadow: 0 1px 2px #00000030 !important;
    outline: none !important;
}

/* Palette c1-c6 for other members (stable dark accessible colors) */
.bubble.bubble-theme-c1 { background: #1f2438; }
.bubble.bubble-theme-c2 { background: #252238; }
.bubble.bubble-theme-c3 { background: #1c2836; }
.bubble.bubble-theme-c4 { background: #28232c; }
.bubble.bubble-theme-c5 { background: #20272b; }
.bubble.bubble-theme-c6 { background: #2a2430; }

.tombstone .bubble {
    background: #161724;
    border: 1px dashed #2f3248;
    color: #7b7f9b;
    font-style: italic;
    font-size: 12px;
    padding: 8px 12px;
}

/* WhatsApp-Style Photo Album */
.album-bubble {
    padding: 6px;
    max-width: 380px;
    width: 100%;
}

.album-bubble .meta {
    padding: 2px 6px 0;
}

.album-bubble p {
    padding: 0 6px;
}

.album-bubble .bubble-footer {
    padding: 0 6px 2px;
}

.album {
    display: grid;
    gap: 4px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 4px;
}

/* 1 foto: 1 kolom penuh */
.album.album-1 {
    grid-template-columns: 1fr;
}
.album.album-1 .tile,
.album.album-1 .photo-tile {
    aspect-ratio: 16 / 10;
    max-height: 320px;
}

/* 2 foto: 2 kolom seimbang */
.album.album-2 {
    grid-template-columns: 1fr 1fr;
}
.album.album-2 .tile,
.album.album-2 .photo-tile {
    aspect-ratio: 1;
}

/* 3 foto: layout WhatsApp seimbang (kiri 1 tall span 2 baris, kanan 2 stacked) */
.album.album-3 {
    grid-template-columns: 1fr 1fr;
}
.album.album-3 .tile:first-child,
.album.album-3 .photo-tile:first-child {
    grid-row: span 2;
    min-height: 200px;
    aspect-ratio: auto;
}
.album.album-3 .tile:not(:first-child),
.album.album-3 .photo-tile:not(:first-child) {
    min-height: 98px;
    aspect-ratio: auto;
}

/* 4 foto: grid 2x2 */
.album.album-4 {
    grid-template-columns: 1fr 1fr;
}
.album.album-4 .tile,
.album.album-4 .photo-tile {
    aspect-ratio: 1;
}

.tile,
.photo-tile {
    position: relative;
    padding: 0;
    display: block;
    overflow: hidden;
    background: #10121e;
    border-radius: 4px;
    cursor: pointer;
    border: none;
}

.tile img,
.photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.tile:hover img {
    transform: scale(1.02);
}

.caption {
    padding: 4px 6px 0;
}

/* Quoted Reply */
.quote {
    border-left: 3px solid var(--purple);
    border-radius: 4px;
    background: #00000030;
    padding: 6px 10px;
    font-size: 12px;
    margin-bottom: 7px;
    color: #d0d2e7;
}

.quote strong {
    display: block;
    font-size: 11px;
    color: #bfc2ff;
    margin-bottom: 2px;
}

/* Composer Wrap */
.composer-wrap {
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding: 10px 18px max(10px, env(safe-area-inset-bottom));
    flex-shrink: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 20;
}

.composer {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.composer textarea {
    flex: 1;
    min-width: 0;
    resize: none;
    overflow: hidden;
    height: 46px;
    max-height: 120px;
    background: #222537;
    border: 1px solid #33374d;
    border-radius: 12px;
    padding: 11px 13px;
    color: var(--text);
    font-size: 16px;
    line-height: 1.4;
    transition: border-color 0.15s ease;
}

.composer textarea:focus {
    border-color: var(--orange);
}

.composer textarea::placeholder {
    color: #aeb1c7;
}

.send {
    background: var(--orange);
    color: #271403;
    font-size: 20px;
    border-radius: 12px;
    font-weight: 700;
}

.send:hover {
    filter: brightness(1.1);
}

.hint {
    font-size: 10px;
    color: var(--muted);
    margin: 7px 0 0;
    text-align: center;
}

/* Reply Draft */
.reply-draft {
    display: none;
    border-left: 3px solid var(--orange);
    padding: 8px 12px;
    background: var(--raised);
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 8px;
    position: relative;
}

.reply-draft strong {
    display: block;
    color: var(--orange);
    margin-bottom: 2px;
}

.reply-draft-close {
    position: absolute;
    right: 8px;
    top: 6px;
    font-size: 16px;
    min-width: 32px;
    min-height: 32px;
    display: grid;
    place-items: center;
    border-radius: 4px;
    color: var(--muted);
}

.reply-draft-close:hover {
    background: #2f344f;
    color: var(--text);
}

/* Attachment Preview */
.attachment-preview {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.att-item {
    position: relative;
    width: 58px;
    height: 58px;
    flex-shrink: 0;
}

.att-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.att-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--red);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.att-remove:hover {
    background: var(--red-hover);
}

/* Upload Feedback Banner & Transport Progress */
.upload-feedback {
    display: none;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.45;
    color: #fca5a5;
    box-sizing: border-box;
    width: 100%;
}

.upload-feedback.is-progress {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

.upload-feedback-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.upload-feedback-icon {
    font-size: 14px;
    line-height: 1.2;
    flex-shrink: 0;
}

.upload-feedback-message {
    flex: 1;
    word-break: break-word;
    white-space: pre-wrap;
    min-width: 0;
}

.upload-feedback-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-retry-upload {
    background: var(--primary, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.3;
    transition: background 0.15s ease;
}

.btn-retry-upload:hover {
    filter: brightness(1.1);
}

.upload-feedback-close {
    background: transparent;
    border: none;
    color: var(--muted, #94a3b8);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    border-radius: 4px;
}

.upload-feedback-close:hover {
    color: #fff;
}

/* Guest & Profile Setup Banner */
.guest-box, .profile-notice-box {
    display: none;
    text-align: center;
    padding: 8px 0;
}

.guest-box .primary, .profile-notice-box .primary {
    width: auto;
    margin: 0 auto;
    padding: 10px 24px;
}

.profile-notice-text {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

/* Modal Dialogs */
.modal {
    border: 1px solid #373b52;
    border-radius: 20px;
    color: var(--text);
    background: var(--panel);
    padding: 24px;
    width: min(440px, calc(100% - 24px));
    max-height: 85vh;
    max-height: 85dvh;
    overflow-y: auto;
    position: fixed;
    inset: 0;
    margin: auto;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.8);
}

.modal-wide {
    width: min(720px, calc(100% - 24px));
}

.modal::backdrop {
    background: #040610cc;
    backdrop-filter: blur(4px);
}

.close {
    position: absolute;
    right: 14px;
    top: 14px;
    font-size: 22px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
    display: grid;
    place-items: center;
}

.close:hover {
    background: var(--raised);
}

.modal h2 {
    font-size: 19px;
    margin: 8px 0 6px;
    font-weight: 700;
}

.modal p, .modal li {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.modal ol {
    padding-left: 20px;
    margin: 12px 0;
}

.modal li {
    margin-bottom: 8px;
}

.modal .avatar {
    width: 64px;
    height: 64px;
    font-size: 22px;
    margin: 0 auto;
}

.primary {
    background: var(--orange);
    color: #271403;
    font-weight: 700;
    border-radius: 10px;
    padding: 12px 18px;
    width: 100%;
    margin-top: 14px;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: filter 0.15s ease, background-color 0.15s ease;
}

.primary:hover {
    filter: brightness(1.1);
}

.secondary {
    border: 1px solid var(--line);
    padding: 10px 14px;
    border-radius: 10px;
    width: 100%;
    margin-top: 8px;
    background: var(--raised);
    color: var(--text);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.secondary:hover {
    background: #23273e;
    border-color: #3b3f5e;
}

.btn-danger {
    background: #7f1d1d;
    color: #fee2e2;
    border: 1px solid #991b1b;
}

.btn-danger:hover {
    background: #991b1b;
}

.detail {
    border-top: 1px solid var(--line);
    padding: 12px 0;
    margin-top: 14px;
    font-size: 12px;
    color: var(--muted);
}

.detail strong {
    display: block;
    color: var(--text);
    margin-top: 3px;
    font-size: 13px;
}

.form-group {
    margin-top: 14px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #c5c7ff;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    background: #222537;
    border: 1px solid #33374d;
    border-radius: 10px;
    padding: 11px 13px;
    color: var(--text);
    font-size: 14px;
    min-height: 44px;
    transition: border-color 0.15s ease;
}

.form-input:focus {
    border-color: var(--orange);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    line-height: 1.4;
}

.checkbox-label input {
    margin-top: 2px;
    min-width: 18px;
    min-height: 18px;
    accent-color: var(--orange);
}

.form-error {
    color: var(--red);
    font-size: 12px;
    margin-top: 6px;
    display: none;
}

.form-error:not(:empty) {
    display: block;
}

.report-option {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: var(--raised);
    border-radius: 8px;
    margin-top: 8px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.report-option:hover {
    border-color: #3b3f5e;
    background: #21253a;
}

.report-option input {
    accent-color: var(--orange);
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

/* Moderator Panel Inside Modal */
.mod-table-wrap {
    overflow-x: auto;
    margin-top: 14px;
    max-height: 60vh;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.mod-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

.mod-table th {
    background: #181a2b;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    color: #c5c7ff;
    position: sticky;
    top: 0;
    z-index: 2;
}

.mod-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #1e2236;
    vertical-align: top;
}

.mod-table tr:hover td {
    background: #181a28;
}

.badge-open {
    background: #78350f;
    color: #fef3c7;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.badge-closed {
    background: #1e293b;
    color: #94a3b8;
    padding: 2px 6px;
    border-radius: 4px;
}

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

.mod-btn {
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #25283f;
    border: 1px solid #373b5c;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    color: var(--text);
    transition: background-color 0.15s ease;
}

.mod-btn:hover {
    background: #313554;
}

.mod-btn-danger {
    background: #451a1a;
    border-color: #632323;
    color: #fca5a5;
}

.mod-btn-danger:hover {
    background: #5c2222;
}

.mod-btn-success {
    background: #143e26;
    border-color: #1e5937;
    color: #86efac;
}

.mod-btn-success:hover {
    background: #1c5434;
}

.mod-photo-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
    cursor: pointer;
}

/* Responsive Moderator Modal (Mobile Bottom Sheet / Desktop Centered) */
@media (max-width: 640px) {
    #modal-moderator.modal {
        width: 100%;
        max-width: 100%;
        height: 92vh;
        height: 92dvh;
        max-height: 92dvh;
        top: auto;
        bottom: 0;
        inset: auto 0 0 0;
        margin: 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        padding: 20px 16px 24px;
        box-sizing: border-box;
    }
    #modal-moderator .mod-table-wrap {
        max-height: calc(92dvh - 180px);
    }
}

/* =========================================================
   FULLSCREEN PHOTO VIEWER (WHATSAPP-STYLE MEDIA LIGHTBOX)
   ========================================================= */
dialog.viewer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    max-height: none;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: #05070c;
    color: #ffffff;
    z-index: 9999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

dialog.viewer::backdrop {
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

dialog.viewer:not([open]) {
    display: none !important;
}

/* Header (Top Floating Bar) */
.viewer-head {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: max(14px, env(safe-area-inset-top, 0px));
    padding-bottom: 12px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    background: linear-gradient(180deg, rgba(5, 7, 12, 0.95) 0%, rgba(5, 7, 12, 0.7) 70%, transparent 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-sizing: border-box;
    pointer-events: auto;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.viewer.ui-hidden .viewer-head {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

.viewer-head-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.viewer-btn-back {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    box-sizing: border-box;
    padding: 0;
}

.viewer-btn-back:hover,
.viewer-btn-back:active {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(0.96);
}

.viewer-author-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    justify-content: center;
}

.viewer-author-name {
    font-size: 15px;
    font-weight: 700;
    color: #f1f3fd;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}

.viewer-subtitle {
    font-size: 12px;
    color: #9da3ba;
    line-height: 1.2;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.viewer-head-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.viewer-counter-pill {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f1f3fd;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 9999px;
    letter-spacing: 0.3px;
    user-select: none;
}

.viewer-btn-action {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.1s ease;
    box-sizing: border-box;
    padding: 0;
}

.viewer-btn-action:hover,
.viewer-btn-action:active {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    transform: scale(0.96);
}

.viewer-btn-action.btn-desktop-close {
    display: none;
}

@media (min-width: 769px) {
    .viewer-btn-action.btn-desktop-close {
        display: flex;
    }
}

/* Main Media Canvas */
.viewer-media-viewport {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    user-select: none;
}

.viewer-img-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    cursor: grab;
}

.viewer-img-container.is-zoomed {
    cursor: grab;
}

.viewer-img-container.is-dragging {
    cursor: grabbing;
}

.viewer-img-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: center center;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.2s ease;
    will-change: transform;
}

/* Loading & Error States in Photo Viewer */
.viewer-loading-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.22);
    border-top-color: #ff7a00;
    border-radius: 50%;
    animation: viewerSpin 0.75s linear infinite;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

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

.viewer-error-state {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    pointer-events: auto;
}

.viewer-error-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(18, 22, 32, 0.92);
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-radius: 9999px;
    padding: 8px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #f87171;
    font-size: 0.82rem;
    font-weight: 500;
}

.viewer-error-text {
    color: #f1f5f9;
}

.viewer-btn-retry {
    background: #ff7a00;
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.viewer-btn-retry:hover {
    background: #ea580c;
}

.viewer-btn-retry:active {
    transform: scale(0.96);
}

/* Floating Navigation Arrows */
.viewer-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(14, 18, 28, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    padding: 0;
}

.viewer-nav-btn:hover {
    background: rgba(255, 122, 0, 0.85);
    border-color: rgba(255, 122, 0, 0.9);
    transform: translateY(-50%) scale(1.08);
}

.viewer-nav-prev {
    left: 20px;
}

.viewer-nav-next {
    right: 20px;
}

@media (max-width: 768px) {
    .viewer-nav-btn {
        width: 42px;
        height: 42px;
        background: rgba(14, 18, 28, 0.45);
        opacity: 0.7;
    }
    .viewer-nav-prev {
        left: 10px;
    }
    .viewer-nav-next {
        right: 10px;
    }
}

.viewer.ui-hidden .viewer-nav-btn {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(0.85);
}

/* Bottom Controls & Filmstrip */
.viewer-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    background: linear-gradient(0deg, rgba(5, 7, 12, 0.96) 0%, rgba(5, 7, 12, 0.7) 65%, transparent 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-sizing: border-box;
    pointer-events: auto;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.viewer.ui-hidden .viewer-footer {
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
}

/* Caption bar */
.viewer-caption-wrap {
    max-width: min(92%, 640px);
    width: 100%;
    text-align: center;
}

.viewer-caption-text {
    margin: 0;
    font-size: 13.5px;
    color: #e4e7f6;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Filmstrip (WhatsApp Style mini thumbnail row) */
.viewer-filmstrip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    padding: 4px 6px;
    scrollbar-width: none;
    box-sizing: border-box;
}

.viewer-filmstrip::-webkit-scrollbar {
    display: none;
}

.viewer-filmstrip:empty {
    display: none;
}

.viewer-thumb {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.55;
    background: #141824;
    transition: all 0.2s cubic-bezier(0.2, 0, 0.2, 1);
    box-sizing: border-box;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.viewer-thumb:hover {
    opacity: 0.85;
}

.viewer-thumb.active {
    opacity: 1;
    border-color: #ff7a00;
    transform: scale(1.1);
    box-shadow: 0 0 14px rgba(255, 122, 0, 0.6);
}

.viewer-thumb img {
    width: 48px;
    height: 48px;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    pointer-events: none;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #edeef6;
    color: #171926;
    padding: 12px 20px;
    border-radius: 12px;
    z-index: 100;
    max-width: min(90%, 460px);
    font-size: 13px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    font-weight: 600;
    text-align: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast:empty {
    display: none;
}

/* Responsive Breakpoints */
@media (min-width: 1600px) {
    .app {
        border-left: 1px solid var(--line);
        border-right: 1px solid var(--line);
        max-width: 1600px;
        margin: 0 auto;
    }
}

/* Tablet Portrait & Small Desktop (<= 1024px) */
@media (max-width: 1024px) {
    .app {
        grid-template-columns: 200px minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    .sidebar {
        padding: 16px 10px;
    }
    .sidebar .side-note {
        display: none;
    }
    .brand {
        font-size: 18px;
        padding: 0 4px;
    }
    .room {
        padding: 8px 10px;
        gap: 8px;
    }
    .room strong {
        font-size: 13px;
    }
    .header {
        padding: 12px 16px;
    }
    .timeline {
        padding: 16px 14px;
    }
    .bubble {
        max-width: min(420px, calc(100% - 44px));
    }
    .album-bubble {
        max-width: min(340px, calc(100% - 44px));
    }
    .composer-wrap {
        padding: 10px 14px max(10px, env(safe-area-inset-bottom));
    }
}

/* Mobile Devices (<= 768px: iPhone 14, Android 390px, 360px) */
@media (max-width: 768px) {
    .app {
        display: block;
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        height: 100%;
        min-height: 0;
        flex: 1;
        margin: 0;
    }
    .sidebar {
        display: none !important;
    }
    .room-view {
        width: 100%;
        height: 100%;
        min-height: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .header {
        padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
        gap: 8px;
        min-height: 56px;
        max-height: 62px;
        flex-shrink: 0;
        box-sizing: border-box;
    }
    .header h1 {
        font-size: 14.5px;
    }
    .header p {
        font-size: 11px;
    }
    .km-room-header-presence {
        padding: 2px 7px;
        margin-right: 2px;
        gap: 4px;
    }
    .km-room-header-presence .km-presence-label {
        font-size: 10.5px;
    }
    .pin {
        padding: 6px max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px));
        font-size: 11px;
        max-height: 34px;
        flex-shrink: 0;
    }
    .timeline {
        padding: 12px max(10px, env(safe-area-inset-right, 0px)) 20px max(10px, env(safe-area-inset-left, 0px));
        width: 100%;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        box-sizing: border-box;
    }
    .message {
        max-width: 100%;
        width: 100%;
        gap: 7px;
        margin: 0 0 8px;
    }
    .message > .avatar {
        width: 34px;
        height: 34px;
        font-size: 11px;
        margin-top: 1px;
    }
    .bubble {
        width: fit-content;
        max-width: min(85%, calc(100% - 42px));
        padding: 7px 11px 5px;
    }
    .album-bubble {
        max-width: min(88%, 340px);
        width: 100%;
    }
    .album.album-4 {
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }
    .bubble p {
        font-size: 13px;
        margin: 1px 0 3px;
    }
    .actions {
        margin-top: 1px;
        gap: 4px;
    }
    .actions .act,
    .meta button {
        padding: 3px 6px;
        min-height: 36px;
        min-width: 36px;
        font-size: 10.5px;
    }
    .composer-wrap {
        width: 100%;
        padding: 8px max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
        position: relative;
        z-index: 20;
        flex-shrink: 0;
        box-sizing: border-box;
        background: var(--panel);
        border-top: 1px solid var(--line);
    }
    .composer {
        display: flex;
        gap: 8px;
        width: 100%;
        align-items: flex-end;
    }
    .composer #btn-add-photos {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.14);
        color: #edeef6;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
        transition: all 0.15s ease;
    }
    .composer #btn-add-photos:hover,
    .composer #btn-add-photos:active {
        background: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }
    .composer textarea {
        flex: 1;
        min-width: 0;
        font-size: 16px;
        padding: 10px 12px;
        height: 42px;
        min-height: 42px;
        max-height: 100px;
        box-sizing: border-box;
    }
    .composer .send {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        border-radius: 12px;
        font-size: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .guest-box {
        margin-top: 0;
        padding: 2px 0;
    }
    .guest-box .primary {
        min-height: 42px;
        padding: 8px 16px;
        font-size: 13.5px;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
        font-weight: 600;
        text-decoration: none;
    }
    .profile-notice-box {
        padding: 8px 10px;
        gap: 6px;
    }
    .profile-notice-box .primary {
        min-height: 38px;
        padding: 6px 14px;
        font-size: 12.5px;
    }
    .hint {
        font-size: 9.5px;
        margin-top: 3px;
    }
    .modal {
        padding: 20px;
        border-radius: 16px;
        width: calc(100% - 20px);
    }
}

/* Small Mobile (<= 360px) */
@media (max-width: 360px) {
    .header {
        padding: 6px 8px;
        gap: 6px;
    }
    .header h1 {
        font-size: 13.5px;
    }
    .km-room-header-presence .km-presence-label {
        display: none;
    }
    .timeline {
        padding: 8px 6px;
    }
    .composer textarea {
        font-size: 16px;
        padding: 7px 9px;
    }
    .send, .icon {
        min-width: 42px;
        min-height: 42px;
        width: 42px;
        height: 42px;
    }
}

/* Mobile Landscape */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 6px 14px;
    }
    .pin {
        display: none;
    }
    .timeline {
        padding: 8px 14px;
    }
    .composer-wrap {
        padding: 6px 14px;
    }
    .modal {
        max-height: 94vh;
        max-height: 94dvh;
        padding: 16px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Official Blue Checkmark Badge */
.km-official-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-left: 0;
    flex-shrink: 0;
    line-height: 1;
}

.km-official-badge svg,
.km-official-badge img,
.km-official-badge-icon {
    display: block;
    flex-shrink: 0;
}

.km-author-wrap {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
    max-width: 100%;
}

.km-crown {
    display: inline-block;
    font-size: 11px;
    line-height: 1;
    margin: 0 1px;
    vertical-align: middle;
    background: none !important;
    border: none !important;
}

.km-author-level {
    font-size: 11px;
    color: var(--muted, #8b92b2);
    font-weight: 500;
    margin-left: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    display: inline;
}

#chat-app.is-guest .message > .avatar,
#chat-app.is-guest .name {
    cursor: default !important;
}

#chat-app.is-guest .name:hover {
    text-decoration: none !important;
    color: #b8bbff !important;
}

/* Mention Autocomplete Popup */
.km-mention-popup {
    position: absolute;
    bottom: calc(100% - 6px);
    left: 18px;
    right: 18px;
    max-height: 220px;
    background: #1b1e2e;
    border: 1px solid #343956;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
    overflow-y: auto;
    z-index: 50;
    display: none;
    flex-direction: column;
    padding: 4px;
}

.km-mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    user-select: none;
}

.km-mention-item:hover,
.km-mention-item.active {
    background: #282d46;
}

.km-mention-ava {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #343957;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.km-mention-ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.km-mention-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.km-mention-name {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.km-mention-username {
    font-size: 11px;
    color: #94a3b8;
}

/* Mention Pill di Bubble Pesan */
.km-mention-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    margin: 0 2px;
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(37, 99, 235, 0.45);
    border-radius: 6px;
    color: #60a5fa;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    user-select: none;
    vertical-align: baseline;
}

.km-mention-pill:hover,
.km-mention-pill:focus-visible {
    background: rgba(37, 99, 235, 0.4);
    border-color: #3b82f6;
    color: #bfdbfe;
    outline: none;
}

/* Pulsing Highlight untuk Deep Link #msg-{id} */
@keyframes kmMessagePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.8);
        outline: 2px solid #3b82f6;
    }
    50% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
        outline: 2px solid #60a5fa;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
        outline: 2px solid transparent;
    }
}

.km-message-highlight {
    animation: kmMessagePulse 1.2s ease-in-out 2;
    border-radius: 12px;
}

/* Bot Showcase Call-to-Action (CTA) & Links */
.km-chat-link {
    color: #60a5fa !important;
    text-decoration: underline !important;
    word-break: break-all;
    transition: color 0.15s ease;
}
.km-chat-link:hover {
    color: #93c5fd !important;
}

.km-bot-cta-wrap {
    margin-top: 8px;
    margin-bottom: 3px;
    display: flex;
    width: 100%;
}

.km-bot-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 9px;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.km-bot-cta-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
    color: #ffffff !important;
}

.km-bot-cta-btn:active {
    transform: translateY(0);
}

@media (max-width: 640px) {
    .km-bot-cta-btn {
        font-size: 12px;
        padding: 7px 12px;
        min-height: 38px;
    }
}

