/* Employees table, employee avatar, profile cards, competency cards, folder panels, folder drag-drop. */
/* ── Employee avatar ─────────────────────────────────────────────────── */
.emp-avatar {
    border: 1px solid var(--mud-palette-divider);
}

/* ── Employees table (MudTable) ─────────────────────────────────────── */
.employees-grid table {
    width: auto !important;
}
.employees-grid th {
    padding: 6px 6px !important;
    white-space: nowrap;
    vertical-align: top;
    min-height: 64px;
    height: 64px;
    overflow: hidden;
    background: var(--table-header, color-mix(in srgb, var(--mud-palette-primary) 20%, var(--mud-palette-surface))) !important;
    border-bottom: 1.5px solid var(--mud-palette-primary) !important;
}
.employees-grid td {
    padding: 4px 6px !important;
    white-space: nowrap;
}
/* Allow specific header labels to wrap into two lines. */
.employees-grid .header-wrap {
    white-space: normal;
    display: inline-block;
    line-height: 1.2;
    max-width: 4em;
}
/* Stronger striped banding — uses theme variable for dark-mode compat. */
.employees-grid .mud-table-body tr:nth-child(odd) {
    background-color: var(--mud-palette-table-striped) !important;
}
/* Compact text filter inputs in header cells.
   width/max-width:100% prevents them from expanding the column. */
.employees-grid th .mud-input-control {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}
.employees-grid th .mud-input {
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: 0.75rem !important;
    margin: 0 !important;
}
.employees-grid th .mud-input-underline::before,
.employees-grid th .mud-input-underline::after {
    border: none !important;
}
.employees-grid th .mud-input-slot {
    padding: 2px 0 !important;
    height: 20px !important;
}
.employees-grid th .mud-input-helper-text {
    display: none;
}


html, body {
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--mud-palette-success);
}

.invalid {
    outline: 1px solid var(--mud-palette-error);
}

.validation-message {
    color: var(--mud-palette-error);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, var(--mud-palette-error);
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--mud-palette-error-text);
}

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



/* ── Profile card container ──────────────────────────────────────────────
   CSS Grid masonry: fine-grained rows (1px each) + JS-computed span
   gives tight vertical packing while preserving left-to-right order. */
.profile-cards-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, var(--profile-card-width, 300px));
    gap: 16px;
    align-items: start;
}
/* #58 fix — on narrow phones (<361 px) a fixed 300-px card column overflows
   the viewport. Shrink-wrap to available width (same fix we use on the
   Team Report masonry). Also covers the first-paint window where the
   JS-set `--profile-card-width` var hasn't been applied yet. */
@media (max-width: 360px) {
    .profile-cards-wrap {
        grid-template-columns: minmax(0, 1fr);
    }
}
.profile-card {
    width: 100%;
}
.mud-rating {
    vertical-align: middle;
}
.profile-card .mud-rating {
    pointer-events: none !important;
}
.profile-cards-wrap .profile-card {
    cursor: grab;
}
.profile-cards-wrap .profile-card .row-kebab-host,
.profile-cards-wrap .profile-card .mud-card-content {
    cursor: default;
}

/* ── Competency card container ─────────────────────────────────────────── */
.comp-cards-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, var(--comp-card-width, 260px));
    gap: 12px;
    align-items: start;
    margin-bottom: 8px;
}
/* #58 fix — same rationale as .profile-cards-wrap above. */
@media (max-width: 360px) {
    .comp-cards-wrap {
        grid-template-columns: minmax(0, 1fr);
    }
}
.comp-cards-wrap .comp-card {
    width: 100%;
}

/* Drag handle: floats over the top-left corner of the card. */
.comp-card-drag-handle {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    cursor: grab;
    display: flex;
    align-items: center;
    padding: 2px 3px;
    border-radius: 3px;
    border: 1px solid var(--folder-border-color, var(--mud-palette-divider));
    background: var(--mud-palette-surface);
    transition: opacity 0.15s;
}
.mud-card:hover .comp-card-drag-handle {
    opacity: 1;
    pointer-events: auto;
}
.comp-card-drag-handle:hover {
    background: var(--mud-palette-background);
}

/* Profile requirement rows: two-column grid */
.profile-req-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 8px;
    row-gap: 2px;
    max-width: 340px;
}
.profile-req-grid .mud-rating .mud-rating-item .mud-icon-button {
    padding: 0;
    width: auto;
    height: auto;
}
.profile-req-grid .mud-typography {
    margin: 0;
    line-height: 1;
}

/* ── Folder panel border + shadow ────────────────────────────────────────
/* Folder item-count badge: smaller pill using the folder's icon colour. */
.folder-badge {
    margin-right: 8px;
}
.folder-badge .mud-badge {
    min-width: 16px;
    height: 16px;
    font-size: 0.78rem;
    padding: 0 4px;
    background-color: var(--badge-color, var(--mud-palette-text-secondary)) !important;
    border: 1.5px solid color-mix(in srgb, var(--badge-color, var(--mud-palette-text-secondary)) 100%, black 40%) !important;
    box-sizing: content-box;
    color: #fff !important;
}

.folder-panel {
    border-radius: 8px;
    border: 1.5px solid var(--folder-border-color, var(--mud-palette-divider));
    box-shadow: var(--mud-elevation-2);
    overflow: hidden;
    background-color: var(--mud-palette-background-grey, var(--mud-palette-surface));
}
/* When enabled, tint folder background with a very light shade of the folder colour. */
.folder-panel.folder-color-fill {
    background-color: color-mix(in srgb, var(--folder-icon-color, var(--mud-palette-text-secondary)) 8%, var(--mud-palette-background) 92%);
}

/* #51b Pattern A panel — replaces <MudExpansionPanel> inside
   CompetencyFolderPanel.razor / ProfileFolderPanel.razor so the
   kebab stops nesting inside MudBlazor's toggle button. */
.folder-panel-header {
    background: color-mix(in srgb, var(--folder-icon-color, var(--mud-palette-text-secondary)) 12%, var(--mud-palette-surface));
    border-bottom: 1.5px solid transparent;
    transition: border-color 0.3s ease;
    padding: 0;
}
.folder-panel.expanded > .folder-panel-header {
    border-bottom-color: var(--folder-border-color, var(--mud-palette-divider));
}
.folder-panel-header .row-primary {
    padding: 12px 16px;
    min-height: 48px;
}
.folder-panel-body {
    padding: 4px 16px 16px;
}
/* Folder-panel expand/collapse animation: intentionally instant.
   Pattern A's @if-gated body lets us skip the per-render LINQ cost
   (folderComps/children enumerations) on collapsed folders, which
   scales with folder count. Any CSS animation (grid-template-rows,
   max-height transition, measured height) would require always-
   rendering the body so there's a before/after state to interpolate
   — trading a cosmetic slide for O(folders) per-render work.
   The affordance is already well-carried by the chevron icon swap,
   aria-expanded toggle, and header border colour change on expand.
   Closes ROADMAP 🟡 "Folder-panel expand animation revival". */
/* Legacy selectors — may still apply transiently to anything that still
   mounts an expansion panel internally; keep narrow so new Pattern A markup
   is unaffected. */
.folder-panel .mud-expand-panel-header-icon {
    margin-left: 0;
    margin-right: 8px;
}

/* ── Folder drag-and-drop feedback ───────────────────────────────────── */
.folder-children-empty {
    min-height: 24px;
    margin-top: 4px;
}
.folders-on-top {
    margin-bottom: 12px;
}

[data-folder-container] > [data-folder-id] + [data-folder-id] {
    margin-top: 8px;
}

.folder-drag-handle {
    cursor: grab;
    opacity: 0.35;
    display: flex;
    align-items: center;
    padding: 0 2px;
    flex-shrink: 0;
    border: 1px solid var(--folder-border-color, var(--mud-palette-divider));
    border-radius: 4px;
    transition: opacity 0.15s;
}
.mud-expansion-panel-header:hover .folder-drag-handle {
    opacity: 0.65;
}
.folder-drag-handle:hover {
    opacity: 1 !important;
}

.folder-dnd-ghost > .mud-expansion-panels {
    opacity: 0.3;
    filter: blur(1px);
    pointer-events: none;
}

.folder-dnd-drag {
    opacity: 0.92;
    cursor: grabbing !important;
}
.folder-dnd-drag > .mud-expansion-panels {
    box-shadow: var(--mud-elevation-8) !important;
}

/* ── Folder drop-chip: "Drop here" target for nesting folders ────────── */
.folder-drop-chip {
    display: none;
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 12px;
    border: 1.5px dashed var(--mud-palette-divider);
    color: var(--mud-palette-text-secondary);
    background: color-mix(in srgb, var(--mud-palette-text-primary) 4%, transparent);
    white-space: nowrap;
    cursor: default;
    user-select: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.folder-drop-chip.drop-active {
    display: inline-block;
}
.folder-drop-chip.drop-hover {
    background: var(--mud-palette-primary);
    border-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    border-style: solid;
}

/* Smaller badge on multi-rule profile chips */
.small-rule-badge .mud-badge {
    font-size: 0.58rem !important;
    min-width: 14px !important;
    height: 14px !important;
    padding: 0 3px !important;
    line-height: 14px !important;
}

/* ── Employees — mobile name-card layout (desktop keeps the MudTable) ── */
@media (max-width: 959.98px) {
    /* Sticky filter area (search bar + warning strip). Pins just below the
       MudBlazor appbar so the search bar, filter icon, and warning badges stay
       on-screen while the employee cards scroll underneath. */
    .emp-sticky-filters {
        position: sticky;
        top: var(--mud-appbar-height, 48px);
        z-index: 10;
        background: var(--mud-palette-background);
        padding-bottom: 6px;
        margin-bottom: 4px;
        box-shadow: 0 2px 4px -2px rgba(0, 0, 0, 0.08);
    }

    /* Search row: MudTextField with trailing filter-icon button. */
    .emp-search-mobile {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 0 4px;
    }
    .emp-search-mobile > .mud-input-control {
        flex: 1;
    }

    /* Bottom-sheet filter surface: backdrop + 80 %-height card anchored to bottom. */
    .emp-filter-sheet-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 200;
        display: flex;
        align-items: flex-end;
        justify-content: center;
    }
    .emp-filter-sheet {
        background: var(--mud-palette-surface);
        border-radius: 16px 16px 0 0;
        width: 100%;
        max-height: calc(var(--dvh, 1vh) * 90);
        display: flex;
        flex-direction: column;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
        animation: emp-filter-sheet-slide 0.22s ease-out;
    }
    @keyframes emp-filter-sheet-slide {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .emp-filter-sheet-handle {
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: var(--mud-palette-action-disabled);
        margin: 8px auto 0;
        flex-shrink: 0;
    }
    .emp-filter-sheet-header {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 16px 6px;
        border-bottom: 1px solid var(--mud-palette-divider);
        flex-shrink: 0;
    }
    .emp-filter-sheet-body {
        flex: 1;
        overflow-y: auto;
        padding: 12px 16px;
        -webkit-overflow-scrolling: touch;
    }
    .emp-filter-sheet-tree {
        border: 1px solid var(--mud-palette-divider);
        border-radius: 6px;
        padding: 6px 8px;
        max-height: 180px;
        overflow-y: auto;
        background: var(--mud-palette-background);
    }
    .emp-filter-sheet-footer {
        display: flex;
        gap: 8px;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0));
        border-top: 1px solid var(--mud-palette-divider);
        flex-shrink: 0;
    }

    /* Warning-chip strip: wraps onto multiple rows instead of horizontal
       scrolling, so every chip is visible without a sideways gesture. */
    .emp-toolbar-mobile {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding: 2px 0 4px;
        align-items: center;
    }

    .emp-cards-mobile {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding-bottom: 16px;
    }
    .emp-card {
        border: 1px solid var(--mud-palette-divider);
        border-radius: 10px;
        padding: 10px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }
    .emp-card-inactive { opacity: 0.55; }
    .emp-card-top {
        display: flex;
        align-items: flex-start;
        gap: 10px;
    }
    .emp-card-text {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .emp-card-name {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
    }
    .emp-card-name-text {
        font-size: 0.9rem;
        font-weight: 700;
        color: var(--mud-palette-text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }
    .emp-card-badge {
        font-size: 0.62rem;
        line-height: 1.6;
        border-radius: 3px;
        padding: 0 4px;
        font-weight: 500;
        flex-shrink: 0;
    }
    .emp-card-badge-left {
        color: var(--mud-palette-error);
        border: 1px solid var(--mud-palette-error);
    }
    .emp-card-badge-you {
        color: var(--mud-palette-success);
        border: 1px solid var(--mud-palette-success);
    }
    .emp-card-sub {
        font-size: 0.78rem;
        color: var(--mud-palette-text-secondary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
        gap: 4px;
        min-width: 0;
    }
    .emp-card-job { color: var(--mud-palette-text-primary); opacity: 0.75; }
    .emp-card-id {
        font-size: 0.7rem;
        color: var(--mud-palette-text-disabled);
        font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
        margin-top: 2px;
    }
    .emp-card-actions {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
        margin-top: 2px;
    }
    .emp-card-profiles {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin-top: 8px;
    }

    /* ── Competencies mobile: folder accordions + tinted stacked cards ── */
    .comp-sticky-filters {
        position: sticky;
        top: var(--mud-appbar-height, 48px);
        z-index: 10;
        background: var(--mud-palette-background);
        padding: 8px 0 6px;
        margin-bottom: 8px;
        box-shadow: 0 2px 4px -2px rgba(0, 0, 0, 0.08);
    }
    .comp-search-mobile {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    /* Let the search bar shrink so the fold-cycle icon button to its right
       stays fully visible on narrow screens. */
    .comp-search-mobile > .mud-input-control {
        flex: 1 1 0;
        min-width: 0;
    }

    .comp-folder {
        border: 1px solid var(--mud-palette-divider);
        border-radius: 10px;
        margin-bottom: 10px;
        overflow: hidden;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }
    .comp-folder-header {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
        cursor: pointer;
        min-height: 44px;
    }
    /* Pattern A variant (see app.css) — padding moves onto the inner
       .row-primary button so the click area matches the visual row. */
    .comp-folder-header.row-with-kebab { padding: 0; cursor: default; }
    .comp-folder-header.row-with-kebab .row-primary {
        padding: 10px 12px;
        min-height: 44px;
    }
    .comp-folder.open .comp-folder-header {
        border-bottom: 1px solid var(--mud-palette-divider);
    }
    .comp-folder-name {
        flex: 1;
        font-size: 0.92rem;
        font-weight: 600;
        color: var(--mud-palette-text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }
    .comp-folder-count {
        flex-shrink: 0;
        background: rgba(100, 116, 139, 0.12);
        border-radius: 10px;
        padding: 2px 10px;
        font-size: 0.72rem;
        font-weight: 600;
        color: var(--mud-palette-text-primary);
    }
    .comp-folder-expand-all {
        flex-shrink: 0;
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 4px;
        background: transparent;
        color: var(--mud-palette-primary);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .comp-folder-body {
        padding: 10px 10px 6px;
    }
    .comp-folder-empty {
        padding: 12px;
        text-align: center;
        color: var(--mud-palette-text-secondary);
        font-size: 0.8rem;
        font-style: italic;
    }

    .comp-card-mobile {
        border: 1px solid var(--mud-palette-divider);
        border-radius: 8px;
        padding: 8px 10px;
        margin-bottom: 8px;
    }
    .comp-card-mobile-header {
        display: flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        min-height: 36px;
    }
    /* Pattern A variant (see app.css). */
    .comp-card-mobile-header.row-with-kebab { cursor: default; }
    .comp-card-mobile-header.row-with-kebab .row-primary { min-height: 36px; }
    .comp-card-mobile-name {
        flex: 1;
        font-size: 0.86rem;
        font-weight: 600;
        color: var(--mud-palette-text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }
    .comp-card-mobile-desc {
        margin-top: 6px;
        padding: 4px 8px;
        background: rgba(255, 255, 255, 0.5);
        border-radius: 4px;
        font-size: 0.75rem;
        color: var(--mud-palette-warning);
        font-style: italic;
    }
    .comp-card-mobile-levels {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-top: 8px;
    }
    .comp-level-row {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        padding: 5px 8px;
        background: color-mix(in srgb, var(--mud-palette-surface) 70%, transparent);
        border: 1px solid var(--mud-palette-divider);
        border-radius: 6px;
    }
    .comp-level-num {
        flex-shrink: 0;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        color: white;
        font-size: 0.72rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .comp-level-text {
        flex: 1;
        font-size: 0.78rem;
        color: var(--mud-palette-text-primary);
        line-height: 1.4;
    }

    /* ── Profiles mobile: same folder accordion, profile-specific card body ── */
    .prof-card-mobile {
        border: 1px solid var(--mud-palette-divider);
        border-radius: 8px;
        padding: 8px 10px;
        margin-bottom: 8px;
    }
    .prof-card-mobile-header {
        display: flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        min-height: 36px;
    }
    /* Pattern A variant (see app.css). */
    .prof-card-mobile-header.row-with-kebab { cursor: default; }
    .prof-card-mobile-header.row-with-kebab .row-primary { min-height: 36px; }
    .prof-card-mobile-name {
        flex: 1;
        font-size: 0.86rem;
        font-weight: 600;
        color: var(--mud-palette-text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }
    .prof-card-mobile-reqs {
        margin-top: 8px;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .prof-card-mobile-reqs-label {
        font-size: 0.7rem;
        color: var(--mud-palette-text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-bottom: 2px;
        padding: 0 2px;
    }
    .prof-card-mobile-reqs-empty {
        padding: 4px 2px;
        font-size: 0.78rem;
        color: var(--mud-palette-text-secondary);
        font-style: italic;
    }
    /* Requirement row — competency-folder colour stripe on the left edge. */
    .prof-req-row {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 4px 8px;
        background: color-mix(in srgb, var(--mud-palette-surface) 70%, transparent);
        border: 1px solid var(--mud-palette-divider);
        border-left: 3px solid var(--mud-palette-primary); /* overridden per row via inline style */
        border-radius: 4px;
    }
    .prof-req-name {
        flex: 1;
        font-size: 0.78rem;
        color: var(--mud-palette-text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }
    /* Compact 16 px stars so the 5-star row fits on the right edge. */
    .prof-req-stars {
        flex-shrink: 0;
    }
    .prof-req-stars .mud-rating-item .mud-icon-root {
        font-size: 16px !important;
    }
    .prof-req-stars .mud-rating-item {
        padding: 0 !important;
    }

    /* ── Profile Rules mobile: intent-statement cards ── */
    .rule-sticky-filters {
        position: sticky;
        top: var(--mud-appbar-height, 48px);
        z-index: 10;
        background: var(--mud-palette-background);
        padding: 8px 0 6px;
        margin-bottom: 8px;
        box-shadow: 0 2px 4px -2px rgba(0, 0, 0, 0.08);
    }
    .rule-search-mobile {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .rule-search-mobile > .mud-input-control {
        flex: 1 1 0;
        min-width: 0;
    }
    .rule-cards-mobile {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding-bottom: 16px;
    }
    .rule-card-mobile {
        border: 1px solid var(--mud-palette-divider);
        border-radius: 10px;
        padding: 10px 12px;
        margin-bottom: 10px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }
    .rule-card-mobile-hit {
        outline: 2px solid var(--mud-palette-primary);
        outline-offset: -2px;
    }
    .rule-card-mobile-top {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        min-height: 28px;
    }
    .rule-card-mobile-autobadge {
        flex-shrink: 0;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        border: 1px solid;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .rule-card-mobile-name {
        flex: 1;
        min-width: 0;
        font-size: 0.9rem;
        font-weight: 700;
        color: var(--mud-palette-text-primary);
        line-height: 1.3;
    }
    .rule-card-mobile-clauses {
        margin-top: 8px;
        padding-left: 36px; /* align under the profile name after the 28 + 8 autobadge col */
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    .rule-clause-mobile {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 5px 8px;
        border-radius: 6px;
        background: color-mix(in srgb, var(--mud-palette-text-primary) 4%, transparent);
        border: 1px solid var(--mud-palette-divider);
        font-size: 0.78rem;
        color: var(--mud-palette-text-primary);
    }
    .rule-clause-mobile-any {
        background: transparent;
        border-style: dashed;
        color: var(--mud-palette-text-secondary);
        font-style: italic;
    }
    .rule-clause-mobile-name {
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .rule-clause-mobile-subs {
        flex-shrink: 0;
        font-size: 0.66rem;
        padding: 2px 6px;
        border-radius: 3px;
        background: color-mix(in srgb, var(--mud-palette-info) 15%, var(--mud-palette-surface));
        color: var(--mud-palette-info);
    }
    .rule-card-mobile-meta {
        margin-top: 8px;
        padding-left: 36px;
        font-size: 0.7rem;
        color: var(--mud-palette-text-disabled);
        font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        align-items: center;
    }
    .rule-meta-dot {
        opacity: 0.5;
    }

    /* ── Campaigns mobile: timeline cards ── */
    .camp-cards-mobile {
        display: flex;
        flex-direction: column;
        padding-bottom: 16px;
    }
    .camp-card {
        border: 1px solid var(--mud-palette-divider);
        border-radius: 12px;
        margin-bottom: 12px;
        overflow: hidden;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
        --status-color: var(--mud-palette-text-secondary);
    }
    .camp-card-top {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px 8px;
        border-left: 4px solid var(--status-color);
        background: color-mix(in srgb, var(--status-color) 6%, var(--mud-palette-surface));
    }
    .camp-card-text {
        flex: 1;
        min-width: 0;
    }
    .camp-card-name {
        font-size: 1rem;
        font-weight: 700;
        color: var(--mud-palette-text-primary);
        line-height: 1.25;
        word-break: break-word;
    }
    .camp-card-status-chip {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin-top: 4px;
        padding: 2px 8px;
        border-radius: 12px;
        font-size: 0.7rem;
        font-weight: 600;
        background: var(--status-color);
        color: white;
    }
    .camp-card-actions {
        display: flex;
        align-items: center;
        gap: 2px;
        flex-shrink: 0;
    }
    /* Timeline strip */
    .camp-timeline {
        padding: 6px 14px 8px;
        background: color-mix(in srgb, var(--status-color) 3%, var(--mud-palette-surface));
    }
    .timeline-track {
        position: relative;
        height: 6px;
        border-radius: 3px;
        background: color-mix(in srgb, var(--status-color) 20%, var(--mud-palette-surface));
        margin: 6px 0 4px;
    }
    .timeline-fill {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        background: var(--status-color);
        border-radius: 3px;
        transition: width 0.3s ease;
    }
    .timeline-marker {
        position: absolute;
        top: -3px;
        width: 12px;
        height: 12px;
        background: var(--mud-palette-surface);
        border: 2px solid var(--status-color);
        border-radius: 50%;
        transform: translateX(-6px);
        box-shadow: 0 0 0 2px var(--mud-palette-surface);
    }
    .timeline-labels {
        display: flex;
        justify-content: space-between;
        font-size: 0.66rem;
        color: var(--mud-palette-text-secondary);
        font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    }
    .timeline-labels .today {
        color: var(--status-color);
        font-weight: 700;
    }
    /* Stats row */
    .camp-stats {
        display: flex;
        gap: 14px;
        flex-wrap: wrap;
        padding: 8px 14px 10px;
        border-bottom: 1px dashed color-mix(in srgb, var(--status-color) 25%, var(--mud-palette-divider));
        background: color-mix(in srgb, var(--status-color) 2%, var(--mud-palette-surface));
    }
    .camp-stats .stat {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 0.75rem;
        color: var(--mud-palette-text-primary);
    }
    .camp-stats .stat .n {
        font-weight: 700;
        font-size: 0.82rem;
    }
    .camp-stats .stat.warn {
        color: var(--mud-palette-warning);
    }
    .camp-stats .stat.urgent {
        color: var(--mud-palette-error);
        font-weight: 600;
    }
    /* Expand/collapse footer button */
    .camp-expand-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        padding: 8px;
        background: transparent;
        border: none;
        cursor: pointer;
        color: var(--mud-palette-text-secondary);
        font-size: 0.78rem;
        font-weight: 500;
    }
    .camp-expand-toggle:active {
        background: rgba(0, 0, 0, 0.03);
    }
    /* Participant list inside a card */
    .camp-participants {
        padding: 4px 12px 12px;
        background: color-mix(in srgb, var(--status-color) 3%, var(--mud-palette-surface));
        border-top: 1px solid color-mix(in srgb, var(--status-color) 15%, var(--mud-palette-divider));
    }
    .camp-participants-top {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 0 6px;
    }
    .camp-participants-title {
        flex: 1;
        font-size: 0.72rem;
        font-weight: 600;
        color: var(--mud-palette-text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }
    .add-btn {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: transparent;
        border: 1px solid var(--mud-palette-primary);
        color: var(--mud-palette-primary);
        border-radius: 4px;
        padding: 4px 10px;
        font-size: 0.7rem;
        font-weight: 600;
        cursor: pointer;
    }
    .show-all-btn {
        width: 100%;
        padding: 8px;
        margin-top: 4px;
        background: transparent;
        border: 1px dashed var(--mud-palette-divider);
        border-radius: 6px;
        color: var(--mud-palette-primary);
        font-size: 0.78rem;
        font-weight: 600;
        cursor: pointer;
    }
    .p-row {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 7px 10px;
        margin-bottom: 6px;
        background: var(--mud-palette-surface);
        border: 1px solid var(--mud-palette-divider);
        border-radius: 8px;
        font-size: 0.75rem;
    }
    .p-row.p-inactive {
        opacity: 0.55;
    }
    .p-row .p-avatar {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        background: linear-gradient(135deg, #a5f3fc, #38bdf8);
        flex-shrink: 0;
        box-shadow: 0 0 0 1px var(--mud-palette-divider);
    }
    .p-row .p-text {
        flex: 1;
        min-width: 0;
    }
    .p-row .p-name {
        font-weight: 600;
        color: var(--mud-palette-text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .p-row .p-sub {
        font-size: 0.68rem;
        color: var(--mud-palette-text-secondary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .p-row .left-badge {
        font-size: 0.6rem;
        color: var(--mud-palette-error);
        border: 1px solid var(--mud-palette-error);
        border-radius: 3px;
        padding: 0 4px;
        margin-left: 4px;
    }

    /* ── Activity Log mobile: feed-style timeline ── */
    .log-sticky-filters {
        position: sticky;
        top: var(--mud-appbar-height, 48px);
        z-index: 10;
        background: var(--mud-palette-background);
        padding: 8px 0 6px;
        margin-bottom: 4px;
        box-shadow: 0 2px 4px -2px rgba(0, 0, 0, 0.08);
    }
    .log-search-row {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 6px;
    }
    .log-search-row > .mud-input-control {
        flex: 1 1 0;
        min-width: 0;
    }
    .log-quick-chips {
        display: flex;
        gap: 6px;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        align-items: center;
    }
    .log-quick-chips::-webkit-scrollbar { display: none; }
    .log-chip {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        background: transparent;
        border: 1px solid var(--mud-palette-divider);
        color: var(--mud-palette-text-primary);
        border-radius: 12px;
        padding: 3px 10px;
        font-size: 0.7rem;
        white-space: nowrap;
        flex-shrink: 0;
        cursor: pointer;
    }
    .log-chip.active {
        background: var(--mud-palette-primary);
        color: white;
        border-color: var(--mud-palette-primary);
    }
    .log-chip-mine.active {
        background: color-mix(in srgb, var(--mud-palette-success) 15%, var(--mud-palette-surface));
        color: var(--mud-palette-success-darken);
        border-color: var(--mud-palette-success);
    }
    /* Icon-only variant — square-ish, no text, tap zone still comfortable. */
    .log-chip-icon-only {
        padding: 3px 8px;
        min-width: 30px;
        justify-content: center;
    }
    .log-chip-divider {
        width: 1px;
        height: 16px;
        background: var(--mud-palette-divider);
        flex-shrink: 0;
    }

    /* Feed */
    .log-feed-mobile {
        display: flex;
        flex-direction: column;
        padding-bottom: 16px;
    }
    .log-day-header {
        padding: 14px 2px 6px;
        font-size: 0.68rem;
        font-weight: 700;
        color: var(--mud-palette-text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.08em;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .log-day-header::after {
        content: "";
        flex: 1;
        border-bottom: 1px dashed var(--mud-palette-divider);
    }

    .log-card {
        border: 1px solid var(--mud-palette-divider);
        border-left: 4px solid var(--action-color, var(--mud-palette-text-secondary));
        border-radius: 8px;
        margin-bottom: 6px;
        overflow: hidden;
        background: color-mix(in srgb, var(--action-color, var(--mud-palette-text-secondary)) 3%, var(--mud-palette-surface));
    }
    .log-head {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 9px 10px;
        cursor: pointer;
        min-height: 44px;
        width: 100%;  /* so it fills the parent when rendered as <button> */
    }
    .log-avatar {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        flex-shrink: 0;
    }
    .log-avatar-inactive { opacity: 0.5; }
    .log-line1 {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .log-line1-top {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 0.75rem;
        min-width: 0;
    }
    .log-user {
        font-weight: 600;
        color: var(--mud-palette-text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }
    .log-action-chip {
        flex-shrink: 0;
        padding: 1px 6px;
        border-radius: 3px;
        font-size: 0.62rem;
        font-weight: 600;
        background: var(--action-color);
        color: white;
    }
    .log-time {
        flex-shrink: 0;
        font-size: 0.62rem;
        color: var(--mud-palette-text-disabled);
        font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    }
    .log-line2 {
        font-size: 0.7rem;
        color: var(--mud-palette-text-secondary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .log-entity-badge {
        display: inline-block;
        padding: 0 5px;
        font-size: 0.62rem;
        color: var(--action-color);
        font-weight: 600;
        border: 1px solid color-mix(in srgb, var(--action-color) 40%, var(--mud-palette-surface));
        border-radius: 3px;
        background: color-mix(in srgb, var(--action-color) 8%, var(--mud-palette-surface));
        margin-right: 4px;
    }
    .log-entity-id {
        font-size: 0.65rem;
        color: var(--mud-palette-text-disabled);
        margin-right: 4px;
        font-family: ui-monospace, monospace;
    }
    .log-summary {
        color: var(--mud-palette-text-primary);
    }
    .log-chevron {
        color: var(--mud-palette-text-disabled);
        transition: transform 0.2s;
    }
    .log-card.open .log-chevron {
        transform: rotate(180deg);
    }
    .log-left-badge {
        font-size: 0.58rem;
        color: var(--mud-palette-error);
        border: 1px solid var(--mud-palette-error);
        border-radius: 3px;
        padding: 0 3px;
        margin-left: 2px;
    }
    .log-body {
        padding: 8px 10px 12px;
        border-top: 1px solid color-mix(in srgb, var(--action-color) 15%, var(--mud-palette-divider));
    }

    .log-showmore-btn {
        width: 100%;
        padding: 10px;
        margin-top: 8px;
        background: transparent;
        border: 1px dashed var(--mud-palette-divider);
        border-radius: 8px;
        color: var(--mud-palette-primary);
        font-size: 0.82rem;
        font-weight: 600;
        cursor: pointer;
    }
    .log-showmore-btn:active {
        background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
    }
}

