:root {
    --color-accent: #e10613;
    /* RGB triplet of --color-accent so translucent tints can follow the configured accent.
       Overridden at runtime by PortalThemeProvider together with --color-accent. */
    --color-accent-rgb: 225, 6, 19;
    --color-shell: #f5f7fb;
    --color-surface: rgba(255, 255, 255, 0.88);
    /* Shared border hierarchy: content cards, inner sections, then interactive controls. */
    --portal-border-card: var(--mud-palette-lines-default);
    --portal-border-section: color-mix(in srgb, var(--mud-palette-lines-inputs) 70%, transparent);
    --portal-border-control: var(--mud-palette-lines-inputs);
    --color-border: var(--portal-border-card);
    --color-text: #1f2a37;
    --color-muted-strong: #5b6572;
    --color-muted: #8b94a3;
    --shadow-soft: 0 24px 50px rgba(31, 42, 55, 0.08);
    --mud-palette-error: #e10613;
    /* Distance from the viewport top to the bottom of the custom app header. The header observer
       in feedback-position.js overwrites this with the measured height so wrapped headers fit. */
    --app-header-height: 6.3rem;
    /* Bottom padding of .main-content that the admin panel's negative margin does not cancel. */
    --main-content-bottom-gap: 2rem;
    /* Vertical padding around the lecture/speaker grid: .admin-panel__content + MudPaper padding. */
    --admin-panel-vertical-chrome: 6rem;
}

/* Explicit card roles keep structural outlines off dialogs, menus and other floating surfaces. */
.portal-content-card.mud-paper {
    border: 1px solid var(--portal-border-card);
}

/* Inner groups share an outline in every route, including nested agenda and Slido sections. */
.mud-paper-outlined {
    border-color: var(--portal-border-section);
}

.mud-expansion-panels > .mud-expand-panel,
.mud-expansion-panels.mud-expansion-panels-borders > .mud-expand-panel {
    border: 1px solid var(--portal-border-section);
}

/* Closed neighboring sections share one separator; expanded sections keep their full outline. */
.mud-expansion-panels > .mud-expand-panel:not(.mud-panel-expanded) + .mud-expand-panel:not(.mud-panel-expanded) {
    border-top-width: 0;
}

@media (max-width: 767px) {
    :root {
        /* Compact header: 2.25rem logos (or the stacked language toggle) plus 0.5rem padding.
           feedback-position.js replaces this fallback with the measured height at runtime. */
        --app-header-height: 3.75rem;
    }
}

@media (max-width: 720px) {
    :root {
        /* .admin-panel__content padding drops to 1rem per side. */
        --admin-panel-vertical-chrome: 5rem;
    }
}

html, body {
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
}

body {
    line-height: 1.5;
    background-color: var(--color-shell);
    background-image:
        radial-gradient(circle at 92% 8%, rgba(var(--color-accent-rgb), 0.07) 0%, rgba(var(--color-accent-rgb), 0.07) 280px, transparent 280px),
        radial-gradient(circle at 8% 88%, rgba(var(--color-accent-rgb), 0.055) 0%, rgba(var(--color-accent-rgb), 0.055) 340px, transparent 340px),
        radial-gradient(circle at 72% 72%, rgba(var(--color-accent-rgb), 0.04) 0%, rgba(var(--color-accent-rgb), 0.04) 200px, transparent 200px);
    background-attachment: fixed;
}

@media (max-width: 600px) {
    body {
        background-image:
            radial-gradient(circle at 92% 8%, rgba(var(--color-accent-rgb), 0.07) 0%, rgba(var(--color-accent-rgb), 0.07) 280px, transparent 280px);
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.validation-message {
    color: var(--color-accent);
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 2px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.validation-errors {
    display: block !important;
}

/* UP-23: operation feedback floats below the visible header without taking up page space. */
#mud-snackbar-container.mud-snackbar-location-top-right {
    top: var(--upload-feedback-top, 7rem);
    right: max(16px, env(safe-area-inset-right));
    width: min(440px, calc(100vw - 32px));
    max-height: calc(100dvh - var(--upload-feedback-top, 7rem) - 16px);
    overflow-y: auto;
}

#mud-snackbar-container .mud-snackbar {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    overflow-wrap: anywhere;
}

/* Messages use plain text so file names are escaped and explicit line breaks remain visible. */
#mud-snackbar-container .mud-snackbar-content-message,
.mud-message-box .mud-dialog-content,
.upload-file-message .mud-dialog-content,
.file-list-message {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Keep all three departure choices on one row, including when their labels wrap. */
.pending-progress-actions {
    align-items: stretch;
}

@media (max-width: 599px) {
    .pending-progress-actions > .mud-button-root {
        flex: 1 1 0;
        min-width: 0;
        padding: 6px;
        font-size: 0.75rem;
        letter-spacing: 0;
        overflow-wrap: anywhere;
    }

    .pending-progress-actions .mud-button-label {
        flex-direction: column;
        gap: 4px;
    }

    .pending-progress-actions .mud-button-icon-start {
        margin: 0;
        margin-inline: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    #mud-snackbar-container .mud-snackbar {
        animation-duration: 1ms !important;
    }
}

.home-admin-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    width: min(100%, 1240px);
    margin: 0 auto;
    padding: 0.75rem clamp(1rem, 3vw, 2rem);
}

.home-admin-bar__user {
    color: var(--color-muted-strong);
    font-weight: 500;
}

/* Selected-event agenda styles are deliberately scoped to avoid affecting other pages. */
.agenda-page {
    width: 100%;
    padding: clamp(1rem, 3vw, 2rem);
}

.agenda-header,
.agenda-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.agenda-header__title,
.agenda-title {
    margin: 0;
    color: var(--color-text);
}

.agenda-search {
    flex: 1 1 20rem;
    max-width: 32rem;
}

.agenda-search .mud-input-control {
    margin: 0;
}

.agenda-search .mud-input-root {
    background: var(--color-surface);
    border-radius: 0.5rem;
}

/* UP-20: every list search uses the same dimensions and MudBlazor input treatment. */
.list-search-field {
    width: 100%;
    max-width: 42rem;
}

.list-search-field .mud-input-control {
    margin: 0;
}

.list-search-field .mud-input-root {
    background: var(--color-surface);
    border-radius: 0.5rem;
}

.agenda-content,
.agenda-list {
    display: grid;
    gap: 1rem;
}

.agenda-group {
    overflow: hidden;
    border: 1px solid var(--portal-border-section);
    border-radius: 0.75rem;
    background: var(--color-surface);
    box-shadow: 0 10px 28px rgba(31, 42, 55, 0.045);
}

.agenda-group__header,
.agenda-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--mud-palette-divider);
    background: rgba(245, 247, 251, 0.72);
}

.agenda-group__title,
.agenda-group-title {
    margin: 0;
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 700;
}

.agenda-group__count,
.agenda-group-count {
    color: var(--color-muted-strong);
    font-size: 0.8rem;
    font-weight: 600;
}

.agenda-session-list,
.agenda-sessions {
    display: grid;
    gap: 0.75rem;
    padding: 0.75rem;
}

.agenda-session,
.agenda-session-card {
    display: grid;
    grid-template-columns: minmax(4.5rem, auto) minmax(0, 1fr);
    gap: 0.875rem;
    padding: 0.875rem;
    border: 1px solid var(--portal-border-section);
    border-left: 3px solid var(--color-accent);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.75);
}

.agenda-session__time,
.agenda-session-time {
    display: flex;
    align-items: flex-start;
    color: var(--color-text);
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
}

.agenda-session__content,
.agenda-session-content,
.agenda-session__details {
    min-width: 0;
}

.agenda-session__title,
.agenda-session-title {
    margin: 0;
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.agenda-session__metadata,
.agenda-session-metadata,
.agenda-lecture__metadata,
.agenda-lecture-metadata,
.agenda-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin-top: 0.35rem;
    color: var(--color-muted-strong);
    font-size: 0.82rem;
}

.agenda-metadata__item,
.agenda-meta,
.agenda-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
}

.agenda-metadata__label,
.agenda-meta-label {
    color: var(--color-muted);
    font-weight: 600;
}

.agenda-lecture-list,
.agenda-lectures {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.agenda-lecture {
    display: grid;
    grid-template-columns: minmax(4rem, auto) minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.45rem;
    background: var(--color-shell);
}

.agenda-lecture-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.45rem;
    background: var(--color-shell);
}

.agenda-lecture__time,
.agenda-lecture-time {
    color: var(--color-muted-strong);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.agenda-lecture__content,
.agenda-lecture-content {
    min-width: 0;
}

.agenda-lecture__title,
.agenda-lecture-title {
    margin: 0;
    color: var(--color-text);
    font-size: 0.92rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.agenda-file-placeholder {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px dashed var(--portal-border-section);
    border-radius: 0.45rem;
    color: var(--color-muted-strong);
    background: rgba(245, 247, 251, 0.65);
    font-size: 0.82rem;
}

/* Required ownership and optional start-file selectors share the same responsive file rows. */
.pending-file-owner-select { flex: 1 1 240px; min-width: 190px; max-width: 360px; }
.start-file-row.start-file-row--owners { grid-template-columns: 20px minmax(140px, 1fr) repeat(2, minmax(210px, 280px)) auto; }
.start-file-row.start-file-row--owners.start-file-row--plain { grid-template-columns: 20px minmax(140px, 1fr) minmax(210px, 280px) auto; }
@media (max-width: 960px) {
    .start-file-row.start-file-row--owners, .start-file-row.start-file-row--owners.start-file-row--plain { grid-template-columns: 20px minmax(0, 1fr) auto; }
    .start-file-row--owners .file-owner-target { grid-column: 2 / -1; grid-row: 2; }
    .start-file-row--owners .start-file-target { grid-column: 2 / -1; grid-row: 3; }
    .start-file-row--owners .start-file-actions { grid-column: 3; grid-row: 1; }
}
.lecture-file-owner-select, .lecture-start-file-select { width: 100%; min-width: 0; }
.uploaded-files-table__identity { min-width: 0; }
.start-file-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) minmax(190px, 240px) auto; align-items: center; gap: 12px; padding: 12px 0; }
.start-file-row--plain { grid-template-columns: 20px minmax(0, 1fr) auto; }
.start-file-row + .start-file-row { border-top: 1px solid var(--mud-palette-divider); }
.start-file-row-details { min-width: 0; }
/* Staff agenda rows stack the publication-consent icon below the file icon, like the speaker agenda. */
.start-file-row-icons { display: flex; flex-direction: column; align-items: center; gap: 0.125rem; }
.start-file-name { overflow-wrap: anywhere; }
@media (max-width: 700px) {
    .start-file-row { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; }
    .start-file-target { grid-column: 2 / -1; grid-row: 2; }
    .start-file-actions { grid-column: 3; grid-row: 1; }
}

.agenda-empty,
.agenda-no-results {
    display: grid;
    justify-items: center;
    gap: 0.4rem;
    padding: clamp(2rem, 8vw, 4rem) 1rem;
    border: 1px dashed var(--portal-border-section);
    border-radius: 0.75rem;
    color: var(--color-muted-strong);
    background: var(--color-surface);
    text-align: center;
}

.agenda-empty__title,
.agenda-no-results__title,
.agenda-empty-title {
    margin: 0;
    color: var(--color-text);
    font-size: 1.05rem;
    font-weight: 700;
}

.agenda-empty__message,
.agenda-no-results__message,
.agenda-empty-message {
    max-width: 38rem;
    margin: 0;
}

@media (max-width: 720px) {
    .agenda-page {
        padding: 8px;
    }

    .agenda-header,
    .agenda-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .agenda-search {
        max-width: none;
        width: 100%;
    }

    .agenda-session,
    .agenda-session-card,
    .agenda-lecture {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .agenda-lecture-card {
        gap: 0.45rem;
    }

    .agenda-session__time,
    .agenda-session-time,
    .agenda-lecture__time,
    .agenda-lecture-time {
        color: var(--color-accent);
    }

    .agenda-group__header,
    .agenda-group-header {
        align-items: flex-start;
    }
}

/* Keep category tables aligned regardless of file names or start-file availability. */
.lecture-upload-category {
    --file-consent-column: 2.75rem;
    --file-owner-column: 13rem;
    --file-size-column: 7rem;
    --file-date-column: 12rem;
    --file-start-column: 0rem;
    --file-publication-column: 5;
    --file-actions-column: 8rem;
}

.lecture-upload-category:has(.uploaded-files-table__start-drop-column) {
    --file-start-column: 13rem;
    --file-publication-column: 6;
}

.uploaded-files-table .mud-table-root,
.content-types-table .mud-table-root {
    width: 100%;
    table-layout: fixed;
}

/* MudTable renders NoRecordsContent as a single cell with colspan="1000", which adds ~994 phantom
   grid columns. Under the fixed layout those share the leftover width with the auto-width description
   column, squeezing it to a few pixels so its header wraps letter by letter. Auto layout gives the
   empty phantom columns zero width, so the header keeps its normal proportions. */
.content-types-table .mud-table-root:has(.mud-table-empty-row) {
    table-layout: auto;
}

.uploaded-files-table__consent-column {
    width: var(--file-consent-column, 2.75rem);
}

.uploaded-files-table__size-column {
    width: var(--file-size-column, 7rem);
}

/* The publication-consent icon has its own unlabelled leftmost column on desktop. Stacked rows
   (MudTable Breakpoint.Sm, <= 960px) would render that cell as a bare line, so they hide it and show
   the icon next to the file size instead. */
.uploaded-files-table .uploaded-files-table__stacked-consent {
    display: none;
}

@media (max-width: 960px) {
    .uploaded-files-table.mud-sm-table .uploaded-files-table__consent-cell {
        display: none;
    }

    .uploaded-files-table.mud-sm-table .uploaded-files-table__stacked-consent {
        display: inline;
    }
}

.uploaded-files-table__owner-column {
    width: var(--file-owner-column, 13rem);
}

.uploaded-files-table__start-drop-column {
    width: 13rem;
}

.uploaded-files-table__date-column {
    width: var(--file-date-column, 12rem);
}

.uploaded-files-table__start-column {
    width: 7rem;
}

.uploaded-files-table__actions-column,
.content-types-table__actions-column {
    width: var(--file-actions-column, 8rem);
}

.uploaded-files-table .uploaded-files-table__name,
.content-types-table .mud-table-cell {
    overflow-wrap: anywhere;
}

/* Responsive row labels must not collapse when the value contains a long file name. */
.uploaded-files-table .mud-table-cell::before,
.content-types-table .mud-table-cell::before {
    flex-shrink: 0;
    max-width: 50%;
    overflow-wrap: normal;
}

/* Equal label space keeps the two staff selectors aligned in mobile table rows. */
.uploaded-files-table .mud-table-cell:has(.lecture-file-owner-select, .lecture-start-file-select)::before {
    flex-basis: 5.5rem;
}

.content-types-table__name-column {
    width: 28%;
}

.content-types-table__extensions-column {
    width: 14%;
}

.content-types-table__size-column {
    width: 12%;
}

.content-types-table__count-column {
    width: 10%;
}

/* Distinguish file ownership while retaining the localized text labels. */
.content-types-table .mud-chip.content-type-kind--lecture {
    color: #1565c0;
    background-color: #edf4fc;
    border-color: #a9c9ed;
}

.content-types-table .mud-chip.content-type-kind--speaker {
    color: #7b1fa2;
    background-color: #f5eef9;
    border-color: #d4b5e2;
}

.table-row-actions {
    width: 100%;
    flex-wrap: nowrap;
}

.table-row-actions .mud-tooltip-root {
    flex: 0 0 auto;
}

/* --- Clickable file drop zones --- */

.file-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* --- File drop zone and preview list --- */

.file-drop-zone {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 1px dashed var(--portal-border-control);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.file-drop-zone:hover,
.file-drop-zone:focus-within {
    border-color: var(--mud-palette-primary);
    background-color: rgba(var(--color-accent-rgb), 0.04);
}

.file-preview-list {
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    background-color: var(--mud-palette-background-grey);
}

.file-preview-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
}

.file-preview-size {
    white-space: nowrap;
    font-size: 0.75rem;
}

.file-list-message-content {
    white-space: normal;
    min-width: 0;
}

.file-message-paragraph {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.file-message-list {
    margin: 8px 0;
    padding: 0 0 0 1.25rem !important;
}

.file-message-item {
    display: list-item !important;
    list-style: disc outside;
    padding: 2px 0 !important;
    white-space: normal;
    overflow-wrap: anywhere;
}

.file-message-item .mud-list-item-text {
    margin: 0;
}

.upload-queue-list {
    max-height: none;
    overflow-y: visible;
}

.archive-preparation-bytes {
    font-variant-numeric: tabular-nums;
}

.archive-preparation-file {
    min-height: 1.5em;
    overflow-wrap: anywhere;
}

.upload-queue-item {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.upload-queue-file {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Match the saved-file row's body text instead of the smaller generic preview text. */
.lecture-upload-category .upload-queue-file:has(.pending-file-owner-select) > :is(.file-preview-name, .file-preview-size) {
    font-family: var(--mud-typography-body2-family);
    font-size: var(--mud-typography-body2-size);
    font-weight: var(--mud-typography-body2-weight);
    line-height: var(--mud-typography-body2-lineheight);
    letter-spacing: var(--mud-typography-body2-letterspacing);
    color: var(--mud-palette-text-primary) !important;
}

/* Staff pending files use the same column widths and cell insets as the saved-file table. */
@media (min-width: 961px) {
    .lecture-upload-category .upload-queue:has(.pending-file-owner-select) .upload-queue-list {
        margin-inline: -12px;
    }

    .lecture-upload-category .upload-queue:has(.pending-file-owner-select) .upload-queue-item {
        padding-inline: 0;
    }

    .lecture-upload-category .upload-queue-file:has(.pending-file-owner-select) {
        display: grid;
        grid-template-columns: var(--file-consent-column) minmax(0, 1fr) var(--file-owner-column)
            var(--file-size-column) var(--file-date-column) var(--file-start-column) var(--file-actions-column);
        gap: 0;
    }

    .lecture-upload-category .upload-queue-file:has(.pending-file-owner-select) > .file-preview-name {
        grid-column: 2;
        grid-row: 1;
        padding-inline: 16px;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .lecture-upload-category .upload-queue-file > .mud-select:has(.pending-file-owner-select) {
        grid-column: 3;
        grid-row: 1;
        min-width: 0;
        padding-inline: 16px 24px;
    }

    .lecture-upload-category .pending-file-owner-select {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .lecture-upload-category .upload-queue-file:has(.pending-file-owner-select) > .file-preview-size {
        grid-column: 4;
        grid-row: 1;
        padding-inline: 16px;
    }

    .lecture-upload-category .upload-queue-file:has(.pending-file-owner-select) > .upload-queue-publication {
        grid-column: var(--file-publication-column);
        grid-row: 1;
        min-width: 0;
        padding-inline: 16px 24px;
    }

    .lecture-upload-category .upload-queue-file:has(.pending-file-owner-select) > .mud-tooltip-root {
        grid-column: 7;
        grid-row: 1;
        justify-self: end;
        margin-inline: 16px;
        /* Leave one equal-sized download-button slot empty, as in the saved-file actions. */
        transform: translateX(-100%);
    }

    .lecture-upload-category .upload-queue:has(.pending-file-owner-select) .upload-queue-status {
        margin-inline: calc(var(--file-consent-column) + 16px) 16px;
    }
}

@media (max-width: 960px) {
    .lecture-upload-category .upload-queue-file:has(.pending-file-owner-select) {
        flex-wrap: wrap;
    }

    .lecture-upload-category .upload-queue-file:has(.pending-file-owner-select) > .file-preview-name {
        flex-basis: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .lecture-upload-category .upload-queue-file > .mud-select:has(.pending-file-owner-select) {
        flex: 1 1 100%;
        min-width: 0;
    }

    .lecture-upload-category .pending-file-owner-select {
        min-width: 0;
        max-width: none;
    }
}

.upload-queue-item > .upload-cancel {
    align-self: flex-start;
    margin-bottom: 0 !important;
}

.upload-queue-item > .upload-transfer-progress {
    margin-bottom: 0 !important;
    font-variant-numeric: tabular-nums;
}

/* --- Event selection cards --- */

@keyframes file-blink {
    0% { background-color: rgba(var(--color-accent-rgb), 0.18); }
    100% { background-color: var(--mud-palette-background-grey); }
}

.file-preview-item.file-preview-blink {
    animation: file-blink 2s ease-out forwards;
}

.event-card {
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    border: 2px solid transparent;
    border-left: 3px solid transparent;
}

.event-card:hover {
    box-shadow: 0 8px 24px rgba(31, 42, 55, 0.12);
    background-color: rgba(var(--color-accent-rgb), 0.03);
    border-left-color: var(--color-accent);
}

.event-card--selected {
    cursor: pointer;
    border: 2px solid var(--mud-palette-primary);
    border-left: 3px solid var(--mud-palette-primary);
}

.event-card--selected:hover {
    box-shadow: 0 8px 24px rgba(31, 42, 55, 0.12);
    background-color: rgba(var(--color-accent-rgb), 0.05);
    border-color: var(--mud-palette-primary-darken, #c20511);
}

/* --- Admin Panel & Employee Panel shared layout --- */

.admin-panel {
    margin-top: calc(-1 * clamp(1.5rem, 3vw, 2.5rem));
    margin-left: calc(50% - 50vw);
    width: 100vw;
}

.admin-panel__layout {
    --mud-drawer-width-left: clamp(12rem, 15vw, 15rem);
    display: flex;
    /* Stretch the drawer to the page height without forcing the page beyond the viewport:
       the app header and .main-content's bottom padding are the only chrome above/below. */
    min-height: calc(100dvh - var(--app-header-height) - var(--main-content-bottom-gap));
}

.admin-panel__content {
    flex: 1;
    min-width: 0;
    padding: 1.5rem clamp(1rem, 2vw, 2rem);
}

/* --- Navigation drawer --- */

.admin-panel__drawer {
    background: #fff;
    border-right: 1px solid var(--portal-border-card);
    box-shadow: 8px 0 24px rgba(31, 42, 55, 0.06);
}

/* Fit the drawer to its navigation content so it ends right below the sign-out link,
   and never stretch past the space between the app header and the viewport bottom.
   Overrides MudBlazor's .mud-drawer-mini { height: 100% } from the earlier stylesheet. */
.admin-panel__drawer.mud-drawer {
    height: auto;
    max-height: calc(100dvh - var(--app-header-height));
}

.admin-panel__drawer-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--mud-palette-divider);
    color: #1f2a37;
}

.admin-panel__drawer-toggle {
    color: #1f2a37;
}

.admin-panel__drawer-toggle:hover {
    background: var(--color-accent, #e10613);
    color: #fff;
}

.admin-panel__drawer-toggle:hover .mud-icon-root {
    color: #fff;
}

.admin-panel__drawer-title {
    color: #1f2a37;
    font-weight: 700;
}

.admin-panel__drawer-meta {
    display: block;
    padding: 0.75rem 1rem 0.5rem;
    color: #5b6572;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.admin-panel__selected-event {
    padding: 0 1rem 0.75rem;
}

.admin-panel__selected-event .mud-chip {
    max-width: 100%;
    height: auto;
}

.admin-panel__selected-event .mud-chip .mud-chip-content {
    white-space: normal;
    word-break: break-word;
}

.admin-panel__nav-link {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    color: #1f2a37;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 160ms ease, color 160ms ease;
}

.admin-panel__nav-link-icon {
    display: inline-flex;
    margin-right: 0.75rem;
}

.admin-panel__drawer .admin-panel__nav-link:hover,
.admin-panel__drawer .admin-panel__nav-link:focus-visible {
    background: #1f2a37;
    color: #fff;
    outline: none;
}

.admin-panel__drawer .admin-panel__nav-link:hover .mud-icon-root,
.admin-panel__drawer .admin-panel__nav-link:focus-visible .mud-icon-root {
    color: #fff;
}

.admin-panel__drawer .admin-panel__nav-link.mud-nav-link-active {
    background: var(--color-accent, #e10613);
    color: #fff;
}

.admin-panel__drawer .admin-panel__nav-link.mud-nav-link-active .mud-icon-root {
    color: #fff;
}

.admin-panel__drawer .admin-panel__nav-link.mud-nav-link-active:hover,
.admin-panel__drawer .admin-panel__nav-link.mud-nav-link-active:focus-visible {
    background: #1f2a37;
}

/* --- Disabled (event-required) nav links --- */

/* Tooltip targets follow the icon width, including the always-visible drawer toggle. */
.admin-panel__drawer .admin-panel__icon-tooltip {
    display: inline-flex;
}

.admin-panel__drawer .admin-panel__nav-link--disabled,
.admin-panel__drawer .admin-panel__nav-link--disabled:hover,
.admin-panel__drawer .admin-panel__nav-link--disabled:focus-visible {
    background: transparent;
    color: #9aa4af;
    cursor: not-allowed;
    outline: none;
}

.admin-panel__drawer .admin-panel__nav-link--disabled .mud-icon-root {
    color: #9aa4af;
}

/* --- Closed / mini drawer state --- */

.mud-drawer--closed.mud-drawer-mini .admin-panel__drawer-header {
    justify-content: center;
    padding-inline: 0.25rem;
}

.mud-drawer--closed.mud-drawer-mini .admin-panel__drawer-title,
.mud-drawer--closed.mud-drawer-mini .admin-panel__drawer-meta,
.mud-drawer--closed.mud-drawer-mini .admin-panel__selected-event,
.mud-drawer--closed.mud-drawer-mini .admin-panel__nav-link-text {
    display: none;
}

.mud-drawer--closed.mud-drawer-mini .admin-panel__nav-link {
    justify-content: center;
    padding-inline: 0;
}

.mud-drawer--closed.mud-drawer-mini .admin-panel__nav-link-icon {
    margin-right: 0;
}

@media (max-width: 720px) {
    .admin-panel__content {
        padding: 8px;
    }
}

/* --- Shared dialog overlay --- */

.dialog-fixed-center {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    padding: 1.5rem;
}

.dialog--sm {
    min-width: 320px;
    max-width: 480px;
}

.dialog--md {
    min-width: 360px;
    max-width: 560px;
}

.dialog--lg {
    min-width: 360px;
    max-width: 720px;
}

.dialog--scrollable {
    max-height: 80vh;
    overflow-y: auto;
}

/* The shared email-composition dialog is 30% wider than MudBlazor's Small width
   (600px) so the HTML editor's toolbar and content fit comfortably. */
.mud-dialog.email-dialog--wide {
    max-width: 780px;
}

/* --- Shared monospace code block --- */

.monospace-code {
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.8rem;
    max-height: 50vh;
    overflow-y: auto;
}

/* --- Main layout content container --- */

.main-content {
    width: min(100%, 1240px);
    margin: 0 auto;
    padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2rem) 2rem;
}

/* --- Layout shell: keeps the footer at the bottom of short pages --- */

.portal-shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

/* The body takes the remaining height; on long pages it simply grows and the footer follows it. */
.portal-shell__body {
    flex: 1 0 auto;
}

/* --- Portal footer with the global legal links (hidden on admin pages) --- */

/* A thin strip in the header's colors (set inline from the branding settings). */
.portal-footer {
    background: var(--footer-background, #e10613);
    color: #fff;
    box-shadow: 0 -8px 20px rgba(14, 20, 28, 0.1);
    padding: 0.3rem 1rem;
    font-size: 0.75rem;
    line-height: 1.4;
}

.portal-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 0.5rem;
}

.portal-footer__link {
    cursor: pointer;
    font-size: inherit;
    line-height: inherit;
}

.portal-footer__link:hover {
    /* The accent can equal the header background, so hover only underlines. */
    text-decoration: underline;
}

/* A middle dot separates neighboring links in the configured font color. */
.portal-footer__link + .portal-footer__link::before {
    content: "\00B7";
    display: inline-block;
    margin-right: 0.5rem;
    text-decoration: none;
    opacity: 0.7;
}

/* Long legal texts scroll inside the dialog instead of growing past the viewport. */
.legal-text-dialog__content {
    max-height: 65vh;
    overflow-y: auto;
    overflow-wrap: anywhere;
}

/* Links in footer legal texts must stand out from the surrounding text. */
.legal-text-dialog__content a {
    color: var(--mud-palette-primary);
    text-decoration: underline;
}

/*
 * Footer entry editor: MudTabs stretches the tab strip to the full width, which pushes the dynamic-tabs
 * "+" button to the far right. Size the strip to its tabs so "+" follows the last tab; min-width: 0 still
 * lets the strip shrink and scroll when the tabs no longer fit.
 */
.footer-entry-tabs .mud-tabs-tabbar-content {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
}

/* --- Lecture list selection checkboxes --- */

/* Resizable headers wrap their labels while reserving space for filter and sort controls. */
.lecture-list .sortable-column-header {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

.lecture-list .column-options {
    flex-shrink: 0;
}

/* Keep checkbox labels readable in the normal text color while using the primary accent
   only for the interactive checkbox icon. */
.lecture-list .mud-data-grid .mud-checkbox,
.upload-targets .mud-data-grid .mud-checkbox {
    color: var(--color-text);
}

.lecture-list .mud-data-grid .mud-checkbox > .mud-icon-button,
.upload-targets .mud-data-grid .mud-checkbox > .mud-icon-button {
    color: var(--mud-palette-primary);
}

/* Horizontal scrolling makes MudDataGrid expand this inner container to the complete column
   width. Keep the scroll viewport at the visible grid width so both scrollbars remain visible.
   The container flexes to fill the grid root so only the rows scroll, never toolbar or pager. */
.lecture-list .mud-table-container {
    width: 100% !important;
    overflow: auto !important;
    flex: 1 1 auto;
    min-height: 0;
    scrollbar-gutter: stable;
    order: 3;
}

/* Let native column resizing grow the table inside the fixed-width scroll viewport. */
.lecture-list .mud-table-root {
    width: max-content;
    min-width: 100%;
}

/* Keep the native pager above the column headers so paging controls are visible immediately.
   The grid root owns the viewport-dependent height; MudBlazor's own Height parameter would
   instead constrain only .mud-table-container and leave toolbar and pager overflowing the page. */
.lecture-list .mud-data-grid {
    display: flex;
    flex-direction: column;
    max-height: max(22rem, calc(100dvh - var(--app-header-height) - var(--main-content-bottom-gap) - var(--admin-panel-vertical-chrome)));
}

.lecture-list .mud-table-toolbar {
    order: 1;
    /* Reserve the toolbar's natural height: only .mud-table-container may shrink, otherwise the
       search field and action buttons collapse and overflow on top of the grid rows. */
    flex: 0 0 auto;
}

.lecture-list .mud-table-pagination {
    order: 2;
    /* Same as the toolbar: keep the pager at its natural height so it never overlaps the rows. */
    flex: 0 0 auto;
}

.lecture-list .mud-table-pagination-toolbar {
    border-top: 1px solid var(--mud-palette-table-lines);
    border-bottom: 1px solid var(--mud-palette-table-lines);
}

/* --- Event grid pager (custom page-size selector and navigation with "All") --- */

/* Grid host: anchors the paging overlay above the toolbar, rows and pager of one grid. */
.lecture-list__grid-host {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Center the spinner and status text inside MudBlazor's overlay content container. */
.lecture-list__grid-overlay .mud-overlay-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

/* Pager navigation keeps the same right-aligned line as the page size selector and info text. */
.lecture-list .event-grid-pager__actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding-right: 0.5rem;
}

/* EventGridPager renders its own page-size selector in front of MudDataGridPager (whose selector is
   off). The wrapper takes over the pager row layout and borders so caption, selector, page info and
   navigation read as one right-aligned line, like the native pager. */
.lecture-list .event-grid-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    min-height: 52px;
    border-top: 1px solid var(--mud-palette-table-lines);
    border-bottom: 1px solid var(--mud-palette-table-lines);
}

.lecture-list .event-grid-pager .mud-table-pagination-select {
    flex: 0 0 auto;
    width: auto;
}

.lecture-list .event-grid-pager .mud-table-pagination-toolbar {
    flex: 0 0 auto;
    width: auto;
    border: none;
    padding-left: 0;
    padding-inline-start: 0;
}

.lecture-list .event-grid-pager .mud-table-pagination-spacer {
    display: none;
}

/* --- Lecture list toolbar --- */

.lecture-list .mud-table-toolbar {
    align-items: flex-start;
    gap: 0.5rem;
    height: auto;
    padding: 0.75rem 0.5rem 1rem;
}

.lecture-list__toolbar-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.lecture-list__toolbar-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.5rem;
}

.lecture-list__record-count {
    color: var(--color-muted-strong);
    border-color: var(--color-border);
    background: var(--color-surface);
}

/* Selection counter: filled primary chip so it stands out from the neutral record count. */
.lecture-list__selection-count {
    flex: 0 0 auto;
    font-weight: 600;
}

.lecture-list__toolbar-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.lecture-list__search {
    flex: 1 1 28rem;
    max-width: 42rem;
    min-width: 18rem;
}

.lecture-list__search .mud-input-control {
    margin: 0;
}

.lecture-list__toolbar-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 0.5rem;
}

.lecture-list__toolbar-actions .mud-button-root {
    min-height: 2.5rem;
    white-space: nowrap;
}

@media (max-width: 960px) {
    .lecture-list__toolbar-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .lecture-list__search {
        flex-basis: auto;
        max-width: none;
        min-width: 0;
        width: 100%;
    }

    .lecture-list__toolbar-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .lecture-list__toolbar-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .lecture-list__toolbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .lecture-list__toolbar-actions .mud-button-root {
        width: 100%;
    }
}

/* Restrict switch toggling to the switch control itself, not the label text. */
.mud-switch { pointer-events: none; }
.mud-switch .mud-switch-span { pointer-events: auto; }

/* Restrict checkbox toggling to the checkbox control itself, not the label text. */
.mud-checkbox { pointer-events: none; }
.mud-checkbox > .mud-icon-button { pointer-events: auto; }

/* Keep the three HTML-editor format selectors readable instead of compressing their labels. */
.template-html-editor .rz-html-editor-toolbar > .rz-dropdown {
    flex: 0 0 10rem;
    width: 10rem !important;
    min-width: 10rem;
    margin-inline: 0.125rem;
}

/* MudBlazor resets list padding globally. Restore space for outside markers so
   Radzen's scrollable editor does not clip bullets and ordered-list numbers. */
.template-html-editor .rz-html-editor-content ul,
.template-html-editor .rz-html-editor-content ol {
    padding-inline-start: 1.5rem;
}

/* E-mail send results: speaker, address and status stay on one line so the (often long) lecture name
   takes the remaining width instead of wrapping word by word. Narrow screens scroll the table sideways. */
.email-send-results .email-send-results__nowrap {
    white-space: nowrap;
}

.email-send-results .email-send-results__lecture {
    min-width: 16rem;
    width: 100%;
}

/* MudBlazor also resets links to plain text color without underline. Restore the usual link look
   inside the editor so authors can see which text they turned into a link. */
.template-html-editor .rz-html-editor-content a {
    color: var(--mud-palette-primary);
    text-decoration: underline;
}

/* Rendered rich-text upload-category descriptions: restore list indentation (see above)
   and keep editor paragraphs as compact as the former single-line caption. */
.content-type-description ul,
.content-type-description ol {
    padding-inline-start: 1.5rem;
}

.content-type-description p {
    margin: 0;
}

/* Match the date and sessions headings inside the adjacent pa-4 agenda group. */
.speaker-overview .speaker-person-uploads-panel > .mud-expand-panel-header {
    padding-inline-start: 16px;
}

.speaker-person-uploads-heading {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Customizable speaker-overview title mirrors the default MudText h4 heading. */
.speaker-overview-custom-title {
    font-size: 2.125rem;
    line-height: 1.235;
    font-weight: 400;
    letter-spacing: 0.00735em;
    margin-bottom: 0.35em;
}

/* Warning accents identify pending work; lecture titles and details remain neutral and readable. */
.pending-progress-list .mud-alert-message {
    width: 100%;
    min-width: 0;
}

.pending-progress-item {
    padding-block: 14px;
    color: var(--mud-palette-text-secondary);
}

.pending-progress-item + .pending-progress-item {
    border-top: 1px solid var(--mud-palette-divider);
}

.pending-progress-title {
    color: var(--mud-palette-text-primary);
    overflow-wrap: anywhere;
}

.pending-progress-details {
    flex: 1 1 220px;
    min-width: 0;
}

.pending-progress-resume {
    flex-shrink: 0;
}

/* Mobile: reclaim horizontal room inside the agenda and upload modules. MudBlazor's default
   24px expander gutters and the pa-4/pa-6/pa-8 card utilities otherwise leave almost no
   content width on small phones. Everything here is mobile-only, so desktop is unaffected. */
@media (max-width: 720px) {
    /* Trim the shared page chrome before the module-specific spacing below. */
    .main-content {
        padding: 1rem 8px;
    }

    /* Speaker overview and other top-level .mt-12 containers waste 48px of height. */
    .main-content > .mud-container.mt-12 {
        margin-top: 1rem !important;
    }

    /* Reduce the nested expander gutters (session -> lecture -> Slido -> question panels). */
    .agenda-group .agenda-session-panel > .mud-expand-panel-header.mud-expand-panel-header-gutters,
    .agenda-group .agenda-session-panel > .mud-expand-panel-content.mud-expand-panel-gutters,
    .agenda-group .agenda-lecture-panel > .mud-expand-panel-header.mud-expand-panel-header-gutters,
    .agenda-group .agenda-lecture-panel > .mud-expand-panel-content.mud-expand-panel-gutters,
    .agenda-group .agenda-slido-panel > .mud-expand-panel-header.mud-expand-panel-header-gutters,
    .agenda-group .agenda-slido-panel > .mud-expand-panel-content.mud-expand-panel-gutters,
    .speaker-overview .speaker-person-uploads-panel > .mud-expand-panel-header.mud-expand-panel-header-gutters,
    .speaker-overview .speaker-person-uploads-panel > .mud-expand-panel-content.mud-expand-panel-gutters,
    .lecture-question-panel > .mud-expand-panel-header.mud-expand-panel-header-gutters,
    .lecture-question-panel > .mud-expand-panel-content.mud-expand-panel-gutters {
        padding-left: 6px;
        padding-right: 6px;
    }

    /* Trim the oversized card padding utilities inside these modules. */
    .agenda-group.portal-content-card {
        padding: 12px !important;
    }

    .agenda-group .agenda-files .mud-paper,
    .agenda-group .agenda-questions .mud-paper {
        padding: 8px !important;
    }

    .speaker-overview .portal-content-card,
    .lecture-upload-module .portal-content-card {
        padding: 12px !important;
    }

    /* Speaker agenda only: AgendaDisplay is shared with the admin/employee agenda, so every rule
       below is scoped to .speaker-overview to leave the Admin Panel untouched. The stacked day card,
       session and lecture expanders and file-category cards each add padding; trim them so the
       uploaded-file rows keep usable width. */
    .speaker-overview .agenda-group {
        padding: 8px !important;
        box-shadow: none;
    }

    /* MudExpansionPanel wraps its content in a MudCollapse, so the content gutter is three levels
       below the panel; a direct-child selector would leave the default 24px gutter in place. */
    .speaker-overview .agenda-group .agenda-session-panel > .mud-expand-panel-header.mud-expand-panel-header-gutters,
    .speaker-overview .agenda-group .agenda-session-panel > .mud-collapse-container > .mud-collapse-wrapper > .mud-collapse-wrapper-inner > .mud-expand-panel-content.mud-expand-panel-gutters,
    .speaker-overview .agenda-group .agenda-lecture-panel > .mud-expand-panel-header.mud-expand-panel-header-gutters,
    .speaker-overview .agenda-group .agenda-lecture-panel > .mud-collapse-container > .mud-collapse-wrapper > .mud-collapse-wrapper-inner > .mud-expand-panel-content.mud-expand-panel-gutters {
        padding-left: 4px;
        padding-right: 4px;
    }

    /* File categories become a plain heading plus list instead of another bordered card. */
    .speaker-overview .agenda-group .agenda-files .mud-paper {
        padding: 4px 0 !important;
        border: none;
        box-shadow: none;
    }

    .speaker-overview .agenda-group .agenda-files {
        margin-inline: 0;
        padding-inline: 0;
    }

    /* Let titles wrap: the session time drops below its title, lecture chips and time wrap too. */
    .speaker-overview .agenda-session-title__time {
        display: block;
        margin-left: 0 !important;
    }

    .speaker-overview .agenda-lecture-title-row__main {
        flex-wrap: wrap;
        gap: 0.25rem 0.5rem;
    }

    .speaker-overview .agenda-lecture-title-row__main > .mud-typography-subtitle1 {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .speaker-overview .agenda-lecture-title-row__main > .lecture-pending-status,
    .speaker-overview .agenda-lecture-title-row__time {
        margin-left: 0 !important;
    }

    /* Landing page and speaker page chrome: smaller card padding and titles on phones. */
    .home-admin-bar {
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }

    .home-admin-bar__user {
        flex-basis: 100%;
        text-align: end;
    }

    .home-page .portal-content-card,
    .speaker-overview-status .portal-content-card {
        padding: 16px !important;
    }

    .home-page .mud-typography-h4,
    .speaker-overview .mud-typography-h4,
    .speaker-overview-custom-title {
        font-size: 1.5rem;
    }
}

/* Speaker agenda on phones (tablets keep everything): the file-row icon and its icon-only actions are
   removed in AgendaDisplay.razor.css, and the publication-consent icon is replaced by a colored text
   line there. The upload button and Slido answer icons stay as on desktop. Scoped to
   .speaker-overview so the shared admin agenda is unaffected. */
@media (max-width: 600px) {
    .speaker-overview .agenda-group .publication-consent-icon {
        display: none;
    }
}

/* Speaker upload screen: the phone-only variants of the start-file toggle, the download/delete
   actions and the publication-consent status. They are only rendered in speaker mode (LectureUploadModule, !IsAdminMode), so the admin
   upload screen is unaffected. Tablets and desktop keep the compact icon controls. */
.uploaded-files-table__phone-only {
    display: none;
}

/* Publication consent as text in its own row cell above the start-file switch and the action buttons;
   only shown on phones, where the consent icon is hidden. Hidden cells take no table column, so the
   desktop columns stay aligned with the colgroup. */
.uploaded-files-table .uploaded-files-table__phone-consent-cell,
.uploaded-files-table .uploaded-files-table__publication {
    display: none;
}

@media (max-width: 600px) {
    .uploaded-files-table .uploaded-files-table__phone-consent-cell {
        display: flex;
    }

    /* The colored text names the consent itself, so the empty responsive label is dropped. */
    .uploaded-files-table .uploaded-files-table__phone-consent-cell::before {
        display: none;
    }

    .uploaded-files-table .uploaded-files-table__publication {
        display: block;
        font-weight: 600;
    }

    .uploaded-files-table .uploaded-files-table__publication--allowed {
        color: var(--mud-palette-success);
    }

    .uploaded-files-table .uploaded-files-table__publication--denied {
        color: var(--mud-palette-error);
    }

    .uploaded-files-table .uploaded-files-table__publication--undecided {
        color: var(--mud-palette-text-secondary);
    }

    .uploaded-files-table .uploaded-files-table__desktop-only {
        display: none !important;
    }

    .uploaded-files-table .uploaded-files-table__phone-only {
        display: flex;
        width: 100%;
    }

    /* The switch carries its own "Start file" label, so drop the duplicate responsive cell label. */
    .uploaded-files-table .uploaded-files-table__start-cell:has(.uploaded-files-table__start-switch)::before {
        display: none;
    }

    .uploaded-files-table .uploaded-files-table__start-switch {
        margin: 0;
    }

    /* Two equally wide buttons with a comfortable (44px+) touch target. */
    .uploaded-files-table .uploaded-files-table__phone-actions {
        gap: 0.5rem;
    }

    .uploaded-files-table .uploaded-files-table__phone-actions .mud-button-root {
        flex: 1 1 0;
        min-height: 44px;
    }
}
