/* ChitChat - iPhone-first, iMessage-style */

:root {
    --bg: #0d0d0f;
    --surface: #1c1c1e;
    --bubble-me: #0a84ff;
    --bubble-them: #2c2c2e;
    --text: #f5f5f7;
    --text-muted: #98989d;
    --border: #38383a;
    --key-bg: #2c2c2e;
    --error: #ff453a;
    --safe-top: env(safe-area-inset-top, 0);
    --safe-bottom: env(safe-area-inset-bottom, 0);
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    height: 100dvh;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    min-height: 100dvh;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
}

#app {
    min-height: 100%;
    min-height: 100dvh;
    height: 100%;
    height: 100dvh;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.toast {
    position: fixed;
    bottom: calc(1rem + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    padding: 0.6rem 1.25rem;
    background: var(--surface);
    color: var(--text);
    border-radius: 12px;
    font-size: 0.9rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast[hidden] {
    display: none;
}

.toast.show {
    animation: toast-in 0.2s ease;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    padding-bottom: max(0.6rem, var(--safe-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 500;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
}

.install-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.install-banner-btn {
    padding: 0.4rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: var(--bubble-me);
    color: #fff;
    font-size: 0.875rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.install-banner-btn:hover,
.install-banner-btn:active {
    opacity: 0.9;
}

.install-banner[hidden] {
    display: none;
}

.install-banner-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.install-banner-dismiss {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--key-bg);
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.install-banner-dismiss:hover,
.install-banner-dismiss:active {
    color: var(--text);
}

.screen {
    display: none;
    flex-direction: column;
    min-height: 100%;
    min-height: 100dvh;
    height: 100%;
    height: 100dvh;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    overflow: hidden;
}

.screen.active {
    display: flex;
}

/* Chat screen: no bottom padding so the input bar sits flush to viewport bottom (PWA/standalone). Form uses safe-area internally. */
#chat-screen.screen {
    padding-bottom: 0;
}

/* ——— Admin screen ——— */
#admin-screen {
    padding: 1rem;
    overflow-y: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.admin-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.admin-logout {
    color: var(--bubble-me);
    text-decoration: none;
    font-size: 0.9rem;
}

.admin-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.admin-section h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--text-muted);
}

.admin-table-wrap {
    background: var(--surface);
    border-radius: 10px;
    padding: 0.75rem;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    color: var(--text-muted);
    font-weight: 600;
}

.admin-empty {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--key-bg);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
}

.admin-btn:hover {
    background: var(--surface);
}

.admin-btn-danger {
    border-color: var(--error);
    color: var(--error);
}

.admin-btn-danger:hover {
    background: rgba(255, 69, 58, 0.15);
}

.admin-user-card {
    margin-bottom: 1.25rem;
    padding: 0.75rem;
    background: var(--key-bg);
    border-radius: 10px;
}

.admin-user-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: var(--text);
}

.admin-user-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.admin-user-fields label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.admin-user-fields select {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
}

/* ——— Lock screen ——— */
#lock-screen {
    justify-content: center;
    align-items: center;
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0));
    touch-action: manipulation;
}

.lock-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 20rem;
    margin: 0 auto;
}

.lock-header {
    text-align: center;
    margin-bottom: 2rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.lock-header p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin: 0;
}

.code-display {
    font-size: 3rem;
    letter-spacing: 0.75rem;
    margin-bottom: 2.5rem;
    min-height: 3.25rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
    width: 100%;
    max-width: 18rem;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    text-align: center;
}

.code-dots-filled {
    color: var(--text);
}

.code-dots-empty {
    color: var(--text-muted);
    opacity: 0.4;
}

/* iMessage-style keypad: rounded keys, iOS-like sizing and feedback */
.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    width: 100%;
    max-width: 16rem;
    margin-left: auto;
    margin-right: auto;
}

.key {
    aspect-ratio: 1;
    border: none;
    border-radius: 50%;
    background: #3a3a3c;
    color: var(--text);
    font-size: 1.75rem;
    font-weight: 300;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: transform 0.08s ease, background 0.1s ease;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.key:hover {
    background: #48484a;
}

.key:active {
    transform: scale(0.92);
    background: #2c2c2e;
}

/* Fixed-height slot so error text never pushes the keypad/dots up */
.lock-error-slot {
    min-height: 3.5rem;
    width: 100%;
    max-width: 18rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lock-error {
    margin: 0;
    text-align: center;
    color: var(--error);
    font-size: 0.875rem;
    white-space: pre-line;
}

#lock-error[hidden] {
    visibility: hidden;
    position: absolute;
}

/* ——— Chat screen ——— */
.chat-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-width: 0;
}

.header-other-avatar {
    width: 48px;
    height: 48px;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 50%;
    background: var(--key-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.header-status {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.header-status.is-online {
    color: #34c759;
}

.header-other-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
}

.header-btn-back {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-btn-back:hover,
.header-btn-back:active {
    background: var(--key-bg);
    opacity: 0.9;
}

.header-btn-profile {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--key-bg);
    color: var(--text-muted);
}

.header-profile-icon {
    width: 16px;
    height: 16px;
}

.header-btn-profile:hover,
.header-btn-profile:active {
    color: var(--text);
    opacity: 0.95;
}

.lang-toggle {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--key-bg);
}

.lang-btn {
    padding: 0.4rem 0.65rem;
    border: none;
    background: transparent;
    font-size: 1.15rem;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s, transform 0.1s;
}

.lang-btn:active {
    transform: scale(0.97);
}

.lang-btn.active {
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--border);
}

.lang-btn:first-child {
    border-radius: 10px 0 0 10px;
}

.lang-btn:last-child {
    border-radius: 0 10px 10px 0;
}

/* ——— Messages ——— */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.msg-time-divider {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
}

.msg-swipe-wrap {
    position: relative;
    overflow: visible;
    width: 100%;
    display: flex;
    margin-bottom: 0.15rem;
}

.msg-swipe-wrap:last-child {
    margin-bottom: 0;
}

.msg-swipe-wrap.msg-me {
    justify-content: flex-end;
}

.msg-swipe-wrap.msg-me .msg {
    transition: transform 0.2s ease;
}

.messages-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0.75rem 1rem 0.5rem;
    position: relative;
}

.privacy-overlay {
    position: absolute;
    inset: 0;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    z-index: 5;
}

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

.privacy-overlay-text {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    text-align: center;
}

.privacy-code-display {
    font-size: 1.5rem;
    letter-spacing: 0.35em;
    color: var(--text);
}

.privacy-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-width: 200px;
}

.privacy-keypad .key {
    padding: 0.5rem;
    font-size: 1.1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--key-bg);
    color: var(--text);
    cursor: pointer;
}

.privacy-keypad .key-empty {
    visibility: hidden;
}

.privacy-keypad .key-back {
    font-size: 1.25rem;
}

.privacy-overlay .error {
    margin: 0;
    font-size: 0.8rem;
}

.profile-field-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-field-checkbox .profile-checkbox {
    width: auto;
}

.profile-field-checkbox span {
    margin-bottom: 0;
}

.messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.25rem 0 0.5rem 0;
}

.msg {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    max-width: 85%;
    min-width: 0;
}

.msg.them {
    align-self: flex-start;
}

.msg.me {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-body {
    min-width: 0;
}

.msg-footer .msg-lang-row {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.msg-footer .msg-lang-btn {
    padding: 0.1rem 0.28rem;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.6rem;
    cursor: pointer;
}

.msg-footer .msg-lang-btn:hover {
    color: var(--text);
}

.msg-footer .msg-lang-btn.active {
    background: var(--key-bg);
    color: var(--text);
}

.msg-footer .msg-reactions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.12rem;
}

.msg-footer .msg-reaction {
    padding: 0.04rem 0.2rem;
    font-size: 0.7rem;
    border-radius: 6px;
    background: var(--key-bg);
    border: none;
    cursor: pointer;
}

.msg-reply-bar {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    padding-left: 0.25rem;
    border-left: 2px solid var(--bubble-me);
}

.msg-bubble {
    padding: 0.5rem 0.75rem;
    border-radius: 18px;
    font-size: 1rem;
    line-height: 1.35;
    word-break: break-word;
    white-space: pre-wrap;
}

.msg.them .msg-bubble {
    background: var(--bubble-them);
    border-bottom-left-radius: 4px;
}

.msg.me .msg-bubble {
    background: var(--bubble-me);
    border-bottom-right-radius: 4px;
}

.msg-bubble--converting {
    position: relative;
}

.msg-bubble--converting::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.15) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: msg-converting 1.2s ease-in-out infinite;
    pointer-events: none;
}

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

.msg-footer {
    display: flex;
    align-items: center;
    gap: 0.28rem;
    margin-top: 0.12rem;
    padding: 0 0.2rem;
    flex-wrap: wrap;
}

.msg.me .msg-footer {
    justify-content: flex-end;
}

.msg-footer .msg-time {
    font-size: 0.6rem;
    color: var(--text-muted);
}

.msg-receipt {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-left: 0;
}

.msg.me .msg-footer .msg-receipt {
    margin-right: 0;
}

.msg-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.msg-action-btn {
    padding: 0.15rem 0.35rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
}

.msg-action-btn:hover,
.msg-action-btn:active {
    background: var(--key-bg);
    color: var(--text);
}

.msg-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-top: 0.15rem;
}

.msg-reaction {
    padding: 0.1rem 0.35rem;
    border-radius: 10px;
    font-size: 0.8rem;
    cursor: pointer;
    background: var(--key-bg);
    border: none;
}

.msg-reaction:hover {
    transform: scale(1.1);
}

.reaction-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    display: flex;
    gap: 0.25rem;
    padding: 0.35rem;
    background: var(--surface);
    color: var(--text);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10;
}

.reaction-picker button {
    padding: 0.25rem;
    border: none;
    background: transparent;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 6px;
}

.reaction-picker button:active {
    background: var(--key-bg);
}

.reaction-picker-reply,
.reaction-picker-remove {
    font-size: 0.8rem !important;
    padding: 0.35rem 0.5rem !important;
    color: var(--text) !important;
}

.reaction-picker-remove {
    color: var(--error);
}

.typing-indicator {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

.typing-dots::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: typing 1.2s ease-in-out infinite;
}

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.9); }
    30% { opacity: 1; transform: scale(1); }
}

/* ——— Input ——— */
.reply-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1rem;
    background: var(--key-bg);
    border-top: 1px solid var(--border);
}

.reply-preview[hidden] {
    display: none !important;
}

.reply-preview-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.reply-preview-text {
    flex: 1;
    min-width: 0;
    font-size: 0.8rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reply-preview-cancel {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.reply-preview-cancel:active {
    color: var(--text);
}

/* Messaging bar: anchored to viewport bottom; safe-area keeps input above home indicator when saved to home screen */
.chat-form {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    padding-bottom: max(0.5rem, var(--safe-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* iOS: 16px+ font avoids zoom on focus; appearance none for consistent look */
.message-input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--key-bg);
    color: var(--text);
    font-size: 16px; /* avoid iOS zoom on focus */
    -webkit-appearance: none;
    appearance: none;
}

.message-input::placeholder {
    color: var(--text-muted);
}

.message-input:focus {
    outline: none;
    border-color: var(--bubble-me);
}

.btn-send {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bubble-me);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-send:active {
    opacity: 0.9;
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ——— Modal ——— */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: var(--safe-bottom);
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: 16px 16px 0 0;
    padding: 1.5rem;
    width: 100%;
    max-width: 24rem;
}

.modal-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
}

.profile-ui-lang-row {
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.profile-ui-lang-row .profile-avatars-label {
    margin: 0;
}

.profile-ui-lang-btns {
    display: inline-flex;
    gap: 0.25rem;
}

.profile-ui-lang-btn {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--key-bg);
    font-size: 1.1rem;
    cursor: pointer;
}

.profile-ui-lang-btn:hover {
    background: var(--border);
}

.profile-ui-lang-btn.active {
    border-color: var(--bubble-me);
    background: rgba(0, 0, 0, 0.08);
}

.profile-time-display {
    margin: 0.35rem 0 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.profile-field {
    display: block;
    margin-bottom: 1rem;
}

.profile-field span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.profile-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--key-bg);
    color: var(--text);
    font-size: 1rem;
}

.profile-avatars-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
}

.profile-save {
    width: 100%;
    margin-top: 1rem;
    padding: 0.65rem;
    border: none;
    border-radius: 10px;
    background: var(--bubble-me);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.profile-save:active {
    opacity: 0.9;
}

.avatar-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.avatar-opt {
    width: 52px;
    height: 52px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--key-bg);
    font-size: 1.5rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.avatar-opt:hover,
.avatar-opt:focus {
    border-color: var(--bubble-me);
}

.avatar-opt.selected {
    border-color: var(--bubble-me);
    background: rgba(10, 132, 255, 0.2);
}

.profile-context {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.profile-context-label {
    margin: 0 0 0.35rem 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.profile-context-label-you {
    margin-top: 0.85rem;
}

.profile-context-person {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-context-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--key-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}


