body {
    margin: 0;
    background-color: #11212B;
}

.status-dot {
    display: inline-block;
    border-radius: 50%;
    flex-shrink: 0;
    vertical-align: middle;
}

.status-dot-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    border: 2px solid var(--mud-palette-surface);
    box-sizing: content-box;
}

.status-dot-anchor {
    position: relative;
    display: inline-flex;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(17, 33, 43, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

    #blazor-error-ui .error-ui-card {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        box-sizing: border-box;
        width: calc(100% - 2rem);
        max-width: 26rem;
        padding: 2.5rem 1.75rem 2rem 1.75rem;
        text-align: center;
        border-radius: 24px;
        background: #162A36;
        box-shadow: inset 0 0 0 1px rgba(25, 199, 181, 0.28), 0 18px 48px rgba(0, 0, 0, 0.45);
    }

    #blazor-error-ui .error-ui-logo {
        width: 5rem;
        height: 5rem;
        display: block;
        margin: 0 auto 1.25rem auto;
    }

    #blazor-error-ui .error-ui-title {
        margin: 0 0 0.75rem 0;
        font-family: "Fraunces", Georgia, serif;
        font-size: 1.5rem;
        font-weight: 600;
        color: #F6FFF9;
    }

    #blazor-error-ui .error-ui-text {
        margin: 0 0 1.75rem 0;
        font-size: 0.95rem;
        line-height: 1.5;
        color: rgba(246, 255, 249, 0.72);
    }

    #blazor-error-ui .reload {
        display: inline-block;
        min-width: 10rem;
        padding: 0.75rem 1.75rem;
        border-radius: 999px;
        background: linear-gradient(135deg, #72F27A, #19C7B5);
        color: #11212B;
        font-size: 1rem;
        font-weight: 700;
        text-decoration: none;
        box-shadow: 0 6px 18px rgba(25, 199, 181, 0.32);
    }

        #blazor-error-ui .reload:hover {
            box-shadow: 0 8px 24px rgba(25, 199, 181, 0.45);
        }

    #blazor-error-ui .dismiss {
        position: absolute;
        top: 0.75rem;
        right: 1rem;
        cursor: pointer;
        font-size: 1.1rem;
        line-height: 1;
        padding: 0.5rem;
        color: rgba(246, 255, 249, 0.5);
        background: none;
        border: 0;
        border-radius: 999px;
        font-family: inherit;
    }

        #blazor-error-ui .dismiss:hover {
            color: #F6FFF9;
        }

        #blazor-error-ui .dismiss:focus-visible,
        #blazor-error-ui .reload:focus-visible {
            outline: 2px solid #72F27A;
            outline-offset: 3px;
        }

@media (max-width: 480px) {
    #blazor-error-ui .error-ui-card {
        padding: 2rem 1.25rem 1.75rem 1.25rem;
    }

    #blazor-error-ui .error-ui-logo {
        width: 4rem;
        height: 4rem;
    }
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1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32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress-text,
.loading-progress {
    color: #F6FFF9;
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: rgba(25, 199, 181, 0.15);
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #19C7B5;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-internal-autofill-selected,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    box-shadow: 0 0 0 1000px var(--mud-palette-surface) inset !important;
    -webkit-box-shadow: 0 0 0 1000px var(--mud-palette-surface) inset !important;
    -webkit-text-fill-color: var(--mud-palette-text-primary) !important;
    caret-color: var(--mud-palette-text-primary) !important;
    color: var(--mud-palette-text-primary) !important;
    border-color: inherit !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

/* Mobile responsive - safe area handling for iOS notches/Dynamic Island */
:root {
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

/* Apply safe area padding to app body for PWA/fullscreen mode */
@supports (padding-top: env(safe-area-inset-top)) {
    body {
        padding-top: var(--safe-area-top);
        padding-bottom: var(--safe-area-bottom);
        padding-left: var(--safe-area-left);
        padding-right: var(--safe-area-right);
    }
}

/* Mobile breakpoint utilities */
@media (max-width: 768px) {
    /* Ensure text doesn't get too small on mobile */
    .mud-typography-body2 {
        font-size: 0.875rem;
    }

    /* Text truncation utility */
    .text-truncate {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Touch device specific enhancements */
.active-call-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1400;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

@media (hover: none) and (pointer: coarse) {
    /* Minimum touch target size (44x44px per Apple HIG, 48x48dp per Material) */
    .mud-icon-button {
        min-width: 44px;
        min-height: 44px;
    }

    /* The app owns its own scrolling: no browser pull-to-refresh reloading a chat mid-scroll,
       and no rubber-band on the document behind a full-height view. */
    html,
    body {
        overscroll-behavior: none;
    }

    /* Reaching the end of a message list or chat list must not hand the scroll to the page. */
    .mud-drawer .mud-paper,
    [data-scroll-contain] {
        overscroll-behavior-y: contain;
    }

    /* Swipeable rows and bubbles animate their own transform; let the browser scroll
       vertically without waiting to find out whether the gesture was horizontal. */
    [data-swipe-id] {
        touch-action: pan-y;
    }

    /* Improve tap feedback */
    .mud-button,
    .mud-icon-button,
    .mud-chip,
    .mud-list-item {
        -webkit-tap-highlight-color: rgba(var(--mud-palette-primary-rgb), 0.2);
    }

    /* Disable hover effects that don't work well on touch */
    .mud-button:hover:not(:active),
    .mud-icon-button:hover:not(:active) {
        background-color: inherit;
    }
}

/* "New version ready" strip (AppUpdateBanner): above the app bar (1100) and dialogs (1300). */
.app-update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1400;
    border-radius: 0;
}
