/* ── Global reset ────────────────────────────────────── */

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

#app {
    height: 100%;
}

/* ── Accessibility (skip navigation) ────────────────── */

.skip-nav {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 1800;
    padding: 0.75rem 1.5rem;
    background: var(--mud-palette-primary, #1b6ec2);
    color: var(--mud-palette-white, #fff);
    font-weight: bold;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}

    .skip-nav:focus {
        position: fixed;
        left: 0;
        top: 0;
        width: auto;
        height: auto;
        overflow: visible;
    }

h1:focus {
    outline: none;
}

/* ── Blazor error UI ────────────────────────────────── */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

    #blazor-error-ui .reload {
        color: inherit;
    }

/* ── Inline code styling ────────────────────────────── */

code {
    color: var(--mud-palette-tertiary, #9c1d5a);
}

/* ── Modal dialog sidebar disabled state ────────── */
.starter-rail.disabled,
.starter-appbar.disabled {
    pointer-events: none;
    opacity: 0.4;
}

/* ── Icon count styling ────────────────────────────── */

.icon-count {
    position: absolute;
    font-size: 0.7rem;
}

/* ── Outlined expansion panels — full border per panel, spaced apart. ── */

.outlined-panels .mud-expand-panel {
    border: 1px solid var(--mud-palette-lines-default, #e8e8e8);
    border-radius: 4px;
}

/* ── Scrollable card content area — applies to any card whose
   body needs to overflow vertically while keeping the card height fixed. ── */

.card-scroll-area {
    max-height: 106px;
    overflow-y: auto;
}

.outlined-panels .mud-expand-panel:not(:last-child) {
    margin-bottom: 16px;
}

/* ── Expanded child row (MudDataGrid ChildRowRenderer) ── */

/* Shared gray fill: expanded child row strip + the parent row whose child is expanded. */
.child-row,
tr:has(+ tr.child-row) > td {
    background-color: var(--mud-palette-background-gray, #f5f5f5);
}

.child-row-cell {
    padding: 8px 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default, #e8e8e8);
}

.child-row-grid {
    background-color: var(--mud-palette-surface, #fff);
    border: 1px solid var(--mud-palette-lines-default, #e8e8e8);
    border-radius: 4px;
}


/* ── Comments ───────────────────────────────────────────── */

:root {
    /* Mention */
    --mention-self-bg:    #0052CC;
    --mention-self-text:  #FFFFFF;
    --mention-other-bg:   #DFE1E6;
    --mention-other-text: #172B4D;
    
    /* Avatar */
    --avatar-color-0: #b91c1c; /* Red    */
    --avatar-color-1: #92400e; /* Amber  */
    --avatar-color-2: #166534; /* Green  */
    --avatar-color-3: #0f766e; /* Teal   */
    --avatar-color-4: #1e40af; /* Blue   */
    --avatar-color-5: #6b21a8; /* Purple */
    --avatar-color-6: #9d174d; /* Pink   */
}

/* ── Editor container — only what MudBlazor utilities can't express ───── */
.comment-reply-body,
.comment-editor-container {
    min-width: 0;
    position: relative;
}

    .comment-editor-container .mud-input-control textarea {
        min-height: 80px;
        max-height: 200px;
        resize: vertical;
    }

/* ── Mention dropdown ────────────────────────────────── */
.comment-mention-list {
    position: absolute;
    top: var(--mention-top, 0);
    left: var(--mention-left, 0);
    z-index: 3001;
    max-height: 200px;
    max-width: 250px;
    overflow-y: auto;
}

/* ── Mention highlight ─────────────────────────────── */

.mention {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    line-height: 1.2;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
}

.mention-self {
    background-color: var(--mention-self-bg);
    color: var(--mention-self-text);
}

.mention-other {
    background-color: var(--mention-other-bg);
    color: var(--mention-other-text);
}

/* ── Avatar color ────────────────────────────────── */
.avatar-color-0 { background-color: var(--avatar-color-0) !important; color: #fff !important; } /* Red    */
.avatar-color-1 { background-color: var(--avatar-color-1) !important; color: #fff !important; } /* Amber  */
.avatar-color-2 { background-color: var(--avatar-color-2) !important; color: #fff !important; } /* Green  */
.avatar-color-3 { background-color: var(--avatar-color-3) !important; color: #fff !important; } /* Teal   */
.avatar-color-4 { background-color: var(--avatar-color-4) !important; color: #fff !important; } /* Blue   */
.avatar-color-5 { background-color: var(--avatar-color-5) !important; color: #fff !important; } /* Purple */
.avatar-color-6 { background-color: var(--avatar-color-6) !important; color: #fff !important; } /* Pink   */

/* ── Status urgency chip overrides ─────────────────── */

:root {
    --urgency-error-bg:   #f87171; /* Red 400    — ~6.0:1 with fg, AA Normal */
    --urgency-warning-bg: #facc15; /* Yellow 400 — ~10.9:1 with fg, AAA */
    --urgency-info-bg:    #60a5fa; /* Blue 400   — ~6.3:1 with fg, AAA */
    --urgency-chip-fg:    #1f1f1f; /* Dark text used by all three */
    --urgency-bar-min-width: 360px; /* Floor so the popover stays consistent with 1, 2, or 3 chips */
}

.urgency-bar { min-width: var(--urgency-bar-min-width); }
.urgency-description-text { overflow-wrap: anywhere; }

.urgency-error-chip   { background-color: var(--urgency-error-bg)   !important; color: var(--urgency-chip-fg) !important; border-color: var(--urgency-error-bg)   !important; }
.urgency-warning-chip { background-color: var(--urgency-warning-bg) !important; color: var(--urgency-chip-fg) !important; border-color: var(--urgency-warning-bg) !important; }
.urgency-info-chip    { background-color: var(--urgency-info-bg)    !important; color: var(--urgency-chip-fg) !important; border-color: var(--urgency-info-bg)    !important; }

