/* frame.css: the app frame: shell, header, sidebar, profile card, avatar, connection strip, prompts
   Flattened from the Blazor scoped CSS at commit 7af3454 (parent of 2c1b6c0 "Step 1: remove Blazor").
   Selectors and declarations are copied as they were; only ::deep was removed and a root
   class was put in front of selectors whose class names collided between components.
   See README.md in this folder for the prefixes and the dropped rules. */

/* ==== Avatar (was Yap/Components/Avatar.razor.css) ==== */

.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    user-select: none;
}

.avatar-small {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
}

.avatar-medium {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

.avatar-large {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

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

.avatar-initials {
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    /* The avatar div gets box-shadow since border would cut into the gradient */
}

.avatar:has(.avatar-initials) {
    box-shadow: 0 0 0 1px white;
}

/* ==== ChatHeader (was Yap/Components/ChatHeader.razor.css) ==== */

.chat-header {
    background: var(--bg-header);
    color: var(--text-white);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 0 rgba(4,4,5,0.2),0 1.5px 0 rgba(6,6,7,0.05),0 2px 0 rgba(4,4,5,0.05);
}

.chat-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-header .back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.chat-header .back-button:hover {
    background: rgba(79, 84, 92, 0.4);
    color: var(--text-primary);
}

.dm-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.dm-header-title .avatar {
    flex-shrink: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Mailbox button */
.mailbox-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.mailbox-button:hover {
    background: rgba(79, 84, 92, 0.4);
    color: var(--text-primary);
}

.mailbox-button.has-unread {
    color: var(--status-away);
}

.mailbox-button.has-unread:hover {
    color: var(--status-away-hover);
}

.mailbox-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
    line-height: 1.2;
}

.users-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.users-toggle:hover {
    background: rgba(79, 84, 92, 0.4);
    color: var(--text-primary);
}

.users-toggle svg {
    width: 20px;
    height: 20px;
}

/* Desktop: people icon, Mobile: hamburger */
.icon-hamburger {
    display: none;
}

@media (max-width: 768px) {
    .icon-people {
        display: none;
    }

    .icon-hamburger {
        display: block;
    }

    .online-count {
        display: none;
    }
}

.online-count {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Status dropdown container */
.status-dropdown-container {
    position: relative;
}

.status-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--status-online);
    border: none;
    /* Not --text-white: the chip's bg is the status colour, and themes with bright
       status greens need dark text here. Also colours the dot + gear (currentColor). */
    color: var(--status-chip-text);
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 3px;
    cursor: pointer;
    transition: filter 0.2s;
}

.status-button:hover {
    filter: brightness(1.1);
}

.status-button.status-online {
    background: var(--status-online);
}

.status-button.status-away {
    background: var(--status-away);
}

.status-button.status-invisible {
    background: var(--status-invisible);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: var(--glow-status);
}

.status-username {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-gear {
    opacity: 0.7;
    margin-left: -0.125rem;
}

/* Backdrop for closing dropdown */
.dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
}

/* Dropdown menu */
.status-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--bg-darkest);
    border-radius: 4px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.24);
    min-width: 150px;
    padding: 0.375rem;
    z-index: 1000;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: left;
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.dropdown-item:hover:not(:disabled) {
    background: rgba(79, 84, 92, 0.4);
    color: var(--text-white);
}

.dropdown-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dropdown-item.active {
    background: rgba(88, 101, 242, 0.2);
    color: var(--text-white);
}

.dropdown-item.signout {
    color: var(--color-danger);
}

.dropdown-item.signout:hover {
    background: rgba(237, 66, 69, 0.2);
    color: var(--color-danger);
}

.dropdown-divider {
    height: 1px;
    background: var(--bg-sidebar);
    margin: 0.375rem 0;
}

/* Status dots in dropdown */
.chat-header .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* See the note on .user-status-dot below for why `color` is set. */
.chat-header .status-dot.online {
    background: var(--status-online);
    color: var(--status-online);
    box-shadow: var(--glow-status);
}

.chat-header .status-dot.away {
    background: var(--status-away);
    color: var(--status-away);
    box-shadow: var(--glow-status);
}

.chat-header .status-dot.invisible {
    background: var(--status-invisible);
}

/* Checkmark for active items */
.checkmark {
    margin-left: auto;
    color: var(--status-online);
    font-weight: 600;
}

@media (max-width: 600px) {
    .chat-header {
        padding: 0.75rem 1rem;
    }

    .chat-header h3 {
        font-size: 1.25rem;
    }

    .status-username {
        max-width: 80px;
    }
}

/* ==== ChatSidebar (was Yap/Components/ChatSidebar.razor.css) ==== */

/* Desktop: always visible */
.users-sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    padding: 1rem;
    overflow: hidden;
}

/* Mobile: slide-in overlay */
@media (max-width: 768px) {
    .users-sidebar {
        position: fixed;
        right: 0;
        top: 41px;
        height: calc(100vh - 41px);
        transform: translateX(100%);
        transition: transform 0.2s ease;
        z-index: 99;
    }

    .users-sidebar.sidebar-open {
        transform: translateX(0);
    }
}

/* Sidebar sections */
.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section h4 {
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}

/* Rooms list */
.rooms-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.room-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 1rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.15s;
}

.room-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.room-item.active {
    background: var(--bg-secondary);
    color: var(--text-white);
}

.room-icon {
    font-size: 1.25rem;
    margin-right: 0.5rem;
    color: var(--text-placeholder);
    font-weight: 500;
}

.room-item.active .room-icon,
.room-item:hover .room-icon {
    color: var(--text-primary);
}

.room-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-settings {
    background: transparent;
    border: none;
    color: var(--text-placeholder);
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    border-radius: 3px;
    opacity: 0;
    transition: all 0.15s;
    display: flex;
    align-items: center;
}

.room-item:hover .room-settings,
.room-item:focus-within .room-settings {   /* the gear shows for keyboard focus too */
    opacity: 1;
}

.room-settings-spacer,
.room-item:hover .room-settings-spacer {
    visibility: hidden;
}

.room-settings:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.room-item.add-room {
    color: var(--color-success);
}

.room-item.add-room:hover {
    background: rgba(59, 165, 92, 0.1);
}

.room-item.add-room .room-icon {
    color: var(--color-success);
}

/* Users list */
.users-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 1rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.15s;
}

.user-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.user-item.current-user {
    color: var(--text-white);
    cursor: default;
}

.user-item.current-user:hover {
    background: transparent;
}

.user-item.active-dm {
    background: var(--bg-secondary);
    color: var(--text-white);
}

/* The rows are divs with role=link (frame.js): the keyboard ring is drawn here, inside the row's radius. */
.room-item:focus-visible,
.user-item:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
}

.users-sidebar .user-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* User status dot */
.user-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* `color` is set alongside `background` purely so --glow-status can be written once
   as `0 0 6px currentColor` and pick up whichever state colour the dot is showing.
   The dots hold no text, so the colour has no other effect. */
.user-status-dot.online {
    background: var(--status-online);
    color: var(--status-online);
    box-shadow: var(--glow-status);
}

.user-status-dot.away {
    background: var(--status-away);
    color: var(--status-away);
    box-shadow: var(--glow-status);
}

.user-status-dot.invisible {
    background: var(--status-invisible);
}

/* Admin badge */
.users-sidebar .admin-badge {
    margin-left: 0.25rem;
    opacity: 0.8;
}

/* Bot badge */
.users-sidebar .bot-badge {
    margin-left: 0.25rem;
    opacity: 0.8;
}

/* Unread dot: the quiet marker a MUTED room or DM gets instead of a count.
   Muting hides the number and the notification, never the fact that something arrived. */
.unread-dot {
    width: 8px;
    height: 8px;
    background: var(--text-primary);
    border-radius: 50%;
    margin-left: 0.25rem;
    flex-shrink: 0;
}

.room-item.has-unread {
    color: var(--text-primary);
}

/* Unread badge: the count an unmuted room or DM gets */
.unread-badge {
    background: var(--color-danger);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Crossed bell on muted channels. Sits before the unread dot/badge; the two coexist by
   design (bell = you muted it, dot = something still arrived). DM rows show it for any
   effective mute; room rows only for a per-room Individual choice — see ShowsRoomMuteBell. */
.mute-bell {
    display: flex;
    align-items: center;
    margin-left: 0.25rem;
    color: var(--text-placeholder);
    flex-shrink: 0;
}

/* Mobile-only "view profile" info button */
.profile-info-btn {
    background: transparent;
    border: none;
    color: var(--text-placeholder);
    cursor: pointer;
    padding: 2px;
    margin-left: 4px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    transition: color 0.15s, background 0.15s, transform 0.15s;
}

.profile-info-btn:hover,
.profile-info-btn:active {
    color: var(--text-primary);
    background: var(--bg-hover);
    transform: scale(1.2);
}

/* Profile popout container (the card itself lives in UserProfileCard) */
.profile-popup {
    position: fixed;
    z-index: 200;
    width: 280px;
    pointer-events: none; /* desktop: tooltip-like, never steals clicks/hover */
    animation: profilePopIn 0.12s ease-out;
}

.profile-popup.is-mobile {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%);
    width: min(320px, calc(100vw - 32px));
    pointer-events: auto;
    animation: profilePopInMobile 0.14s ease-out;
}

.profile-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0, 0, 0, 0.5);
    animation: profileBackdropIn 0.12s ease-out;
}

@keyframes profilePopIn {
    from { opacity: 0; transform: translateY(4px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes profilePopInMobile {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes profileBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==== ChatLayout (was Yap/Components/Layout/ChatLayout.razor.css) ==== */
/* Frame part. The timeline part of this file is in timeline.css. */

.chat-container {
    height: 100vh; /* fallback for older browsers */
    height: 100svh; /* small viewport height - consistent on mobile */
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
    /* Establishes the stacking context the scene layers live in. Without it their
       z-index: -1 escapes to an ancestor and the scene disappears behind the page.
       overflow: hidden alone does NOT create one. */
    isolation: isolate;
}

/* ==========================================================================
   Themed background scene - see docs/themes-2.0.md

   z-index: -1 inside .chat-container's stacking context paints these ABOVE the
   container's own --bg-primary background (which stays as the fallback while
   images load) but BELOW every in-flow child. That is why the header, sidebar
   and message list need no z-index of their own and no component was touched.

   position: fixed, not background-attachment: fixed - the latter repaints on
   every scroll and misbehaves on iOS Safari. These composite once.

   The five backgrounds are one element rather than five divs; the shorthand
   lists below are positionally matched, so a layer a theme leaves as `none`
   still holds its slot and the others stay aligned. Listed top-first, which is
   the reverse of the source theme's paint order.
   ========================================================================== */
.theme-scene {
    position: fixed;
    inset: 0;
    z-index: -1;
    /* Sits behind content but still spans gaps in the shell, where it would
       otherwise swallow clicks meant for the container. */
    pointer-events: none;

    background-image:
        var(--scene-footer),
        var(--scene-footertile),
        var(--scene-header),
        var(--scene-headertile),
        var(--scene-canvastile);
    background-repeat:
        no-repeat,
        repeat-x,
        no-repeat,
        repeat-x,
        repeat;
    background-position:
        right bottom,
        right bottom,
        left top,
        left top,
        left top;
    /* The header and footer strips are taller than many viewports, so a scene theme
       scales every layer by one shared factor here. Sharing the factor is what keeps
       the teahouse standing on the garden's ground line. */
    background-size: var(--scene-sizes);
}

/* Separate element rather than a ::after on .theme-scene: when scene crossfading
   arrives there will be two .theme-scene elements at varying opacity, and a scrim
   attached to them would fade along with the artwork. */
.theme-scrim {
    position: fixed;
    inset: 0;
    z-index: -1; /* same layer as the scene; later in the DOM, so it paints over */
    pointer-events: none;
    background: var(--canvas-scrim);
}

.header-line {
    width: 100%;
    height: 3px;
    display: block;
    flex-shrink: 0;
    image-rendering: auto;
    object-fit: fill;
}

.chat-main {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-width: 0; /* Allow flex item to shrink below content size */
}

.messages-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-canvas-panel);
    position: relative;
    min-width: 0; /* Allow flex item to shrink below content size */
    overflow: hidden;
}

/* (.messages, .messages-flow, scroll dismiss, .messages-spacer, scrollbar, .system-message,
    .loading-more, .loading-spinner, @keyframes spin, .history-start: moved to timeline.css) */

/* Backdrop for mobile sidebar */
.sidebar-backdrop {
    display: none;
}

@media (max-width: 768px) {
    .sidebar-backdrop.show {
        display: block;
        position: fixed;
        top: 41px;
        left: 0;
        right: 0;
        bottom: 0;
        background: transparent;
        z-index: 98;
    }

    .chat-main {
        width: 100%;
    }
}

/* Error boundary content */
.error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
    color: var(--text-primary);
}

.error-content h3 {
    color: var(--color-danger);
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.error-content p {
    color: var(--text-muted);
    margin: 0 0 1.5rem 0;
    font-size: 0.875rem;
    max-width: 400px;
}

.error-retry-button,
.error-reload-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0 0.25rem;
    transition: background-color 0.15s ease;
}

.error-retry-button {
    background: var(--accent-primary);
    color: white;
}

.error-retry-button:hover {
    background: var(--accent-hover);
}

.error-reload-button {
    background: var(--bg-input);
    color: var(--text-primary);
}

.error-reload-button:hover {
    background: var(--bg-muted);
}

/* ==== ReconnectModal (was Yap/Components/Layout/ReconnectModal.razor.css) ==== */
/* Dropped (Blazor reconnect modal only): #components-reconnect-modal and its state classes,
   the .components-*-visible / .reconnect-dots hide rule, #components-reconnect-modal button,
   #components-seconds-to-next-attempt. The banner position (fixed, top, z-index 10000, slide)
   lived on #components-reconnect-modal, so the new strip needs its own positioning. */

/* =============================================================================
   RECONNECTION BANNER STYLES (.NET 10)
   =============================================================================
   Discord-style top banner for connection status. Non-blocking UI that
   allows users to still see the chat content behind it.
   ============================================================================= */

/* =============================================================================
   BANNER STYLING
   ============================================================================= */

/* Banner content container - Discord-style yellow/orange warning */
.reconnect-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    /* Discord-style warning yellow/orange - uses status-away color */
    background: linear-gradient(135deg, var(--status-away) 0%, #f57731 100%);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    /* Subtle shadow for depth */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* =============================================================================
   ANIMATED DOTS
   ============================================================================= */

/* Container for the loading dots */
.reconnect-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Individual dot styling */
.reconnect-dots .dot {
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
    animation: reconnect-dot-pulse 1.4s ease-in-out infinite both;
}

/* Stagger the animation for each dot */
.reconnect-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.reconnect-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.reconnect-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Dot pulse animation */
@keyframes reconnect-dot-pulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==== PushPermissionPrompt (was Yap/Components/PushPermissionPrompt.razor.css) ==== */

.push-prompt-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: pushPromptFadeIn 0.3s ease-out;
}

.push-prompt-overlay.hiding {
    animation: pushPromptFadeOut 0.3s ease-in forwards;
}

.push-prompt-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 380px;
    width: 100%;
    padding: 2.5rem 2rem 2rem;
    background: var(--bg-header);
    border-radius: 12px;
}

.push-prompt-icon {
    color: var(--accent-primary);
    margin-bottom: 1.25rem;
}

.push-prompt-heading {
    color: var(--text-white);
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
}

.push-prompt-body {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
    margin: 0 0 1.75rem;
}

.push-prompt-enable {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.push-prompt-enable:hover:not(:disabled) {
    background: var(--accent-hover);
}

.push-prompt-enable:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.push-prompt-later {
    background: none;
    border: none;
    color: var(--text-placeholder);
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0.75rem 0.5rem 0.25rem;
    transition: color 0.15s ease;
}

.push-prompt-later:hover {
    color: var(--text-muted);
}

@keyframes pushPromptFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pushPromptFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ==== PwaInstallBanner (was Yap/Components/PwaInstallBanner.razor.css) ==== */

.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--bg-header);
    border-top: 1px solid var(--bg-muted);
    padding: 0.75rem 1rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    animation: slideUp 1.0s ease-out;
}

.pwa-install-banner.hiding {
    animation: slideDown 0.3s ease-in forwards;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 600px;
    margin: 0 auto;
}

.pwa-banner-illustration {
    width: 40px;
    height: 60px;
    flex-shrink: 0;
}

.pwa-banner-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.pwa-banner-text strong {
    color: var(--text-white);
    font-size: 0.9375rem;
}

.pwa-banner-text span {
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.3;
}

.pwa-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.4375rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.pwa-install-btn:hover {
    background: var(--accent-hover);
}

.pwa-dismiss-btn {
    background: none;
    border: none;
    color: var(--text-placeholder);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.125rem 0;
    text-align: center;
    transition: color 0.15s ease;
}

.pwa-dismiss-btn:hover {
    color: var(--text-muted);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

/* ==== UserProfileCard (was Yap/Components/UserProfileCard.razor.css) ==== */

.profile-card {
    width: 100%;
    background: var(--bg-darkest);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    color: var(--text-primary);
}

/* Gradient banner — matches the user's avatar color identity */
.profile-card-banner {
    height: 56px;
    width: 100%;
}

/* Avatar overlaps the banner, Discord-style, with a ring in the card color */
.profile-card-avatar {
    margin: -40px 0 0 16px;
    width: fit-content;
}

.profile-card-avatar .avatar {
    box-shadow: 0 0 0 5px var(--bg-darkest);
}

.profile-card-body {
    padding: 8px 16px 16px;
}

.profile-card-identity {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 6px;
}

.profile-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.profile-card-badge {
    font-size: 0.85rem;
    line-height: 1;
}

.profile-card-username {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Presence line */
.profile-card-statusline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.profile-card-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.profile-card-status-dot.online { background: var(--status-online); color: var(--status-online); box-shadow: var(--glow-status); }
.profile-card-status-dot.away { background: var(--status-away); color: var(--status-away); box-shadow: var(--glow-status); }
.profile-card-status-dot.offline { background: var(--status-invisible); }

.profile-card-divider {
    height: 1px;
    background: var(--border-dark);
    margin: 12px 0;
}

.profile-card-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-card-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.profile-card-bio {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-secondary);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.profile-card-empty {
    margin: 0;
    font-size: 0.8125rem;
    font-style: italic;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
