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

#blazor-error-ui {
    background: #b71c1c;
    color: #fff;
    bottom: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.25);
    display: none;
    left: 0;
    padding: 0.85rem 3rem 0.85rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.95rem;
}

#blazor-error-ui a {
    color: #fff;
    text-decoration: underline;
    margin-left: 0.75rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.85rem;
    text-decoration: none;
    font-weight: 600;
}

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

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* Drag-and-drop attachment zone — visual feedback when the user hovers
   over the area with a file. The .pwa-dropzone-active class is toggled
   from js/dropzone-interop.js. */
.pwa-dropzone {
    border: 2px dashed transparent;
    border-radius: 8px;
    transition: border-color 0.15s ease-out, background-color 0.15s ease-out;
}

.pwa-dropzone-active {
    border-color: var(--mud-palette-primary, #003399);
    background: rgba(0, 51, 153, 0.05);
}

/* Print-only block on TicketDetail. Hidden in screen view; the print
   media query below hides the app shell + tabs and shows this block
   so users can "Save as PDF" from the browser print dialog for paper
   handover during operations. */
.pwa-print-only {
    display: none;
}

@media print {
    /* Show the print summary, hide everything else app-related. */
    .pwa-print-only {
        display: block !important;
    }

    /* Drawers, app bars, action buttons — kill them all. The MudTabs
       on TicketDetail also gets .pwa-no-print to stay hidden. */
    .mud-appbar,
    .mud-drawer,
    .mud-overlay,
    .pwa-no-print,
    .pwa-dropzone {
        display: none !important;
    }

    body, html {
        background: #fff !important;
        color: #000 !important;
    }

    .pwa-print-only h1 { font-size: 18pt; margin: 0 0 4pt 0; }
    .pwa-print-only h2 { font-size: 14pt; margin: 0 0 12pt 0; font-weight: normal; }
    .pwa-print-only h3 { font-size: 12pt; margin: 14pt 0 4pt 0; border-bottom: 1px solid #ccc; padding-bottom: 2pt; }
    .pwa-print-only table { border-collapse: collapse; width: 100%; margin-bottom: 12pt; }
    .pwa-print-only th { text-align: left; padding: 3pt 8pt 3pt 0; font-weight: 600; width: 100pt; vertical-align: top; }
    .pwa-print-only td { padding: 3pt 0; }
}

/* Settings page masonry — replaces the MudGrid 2-column flex layout
 * so that cards with very different heights (Passkey is tiny, Sync-Log
 * has a big table) don't leave fat empty gaps under the short ones. */
.settings-masonry {
    column-count: 1;
    column-gap: 24px;
}
@media (min-width: 960px) {
    .settings-masonry { column-count: 2; }
}
.settings-masonry > .settings-cell {
    break-inside: avoid;
    margin-bottom: 24px;
    /* Without `display: inline-block` Chrome/Safari sometimes split a
     * card across columns even with break-inside: avoid. */
    display: inline-block;
    width: 100%;
}

/* Bug-report FAB — stacked above the main "+" Quick-Create FAB so the
 * two don't overlap. Small variant + a bit of nudge to keep the visual
 * weight balanced under the larger primary FAB. */
.bugreport-fab {
    position: fixed !important;
    bottom: 88px;
    right: 28px;
    z-index: 1200;
}
@media print {
    .bugreport-fab { display: none !important; }
}

/* App bar — Dense mode already drops MudAppBar height from 64px to 48px
 * on every viewport. On phones (≤600px) the title font and the four
 * trailing icon buttons (bell, dark mode, logout + offline chip) still
 * crowd the bar, so shrink them further. Reported via in-app bug from
 * b.ernst (2026-05-19): "HeadBanner ist zu groß auf dem Smartphone". */
@media (max-width: 600px) {
    .pwa-appbar .pwa-appbar-title {
        font-size: 1rem;
        line-height: 1.25;
    }
    .pwa-appbar .mud-icon-button {
        padding: 6px;
    }
    .pwa-appbar .mud-icon-button .mud-icon-root {
        font-size: 1.25rem;
    }

    /* Ticket detail page title — on phones the Typo.h5 title used to
     * get squeezed between the back-arrow + #uid on the left and the
     * trailing star/bell/qr/menu icons on the right, wrapping to 5+
     * very short lines. Force it onto its own row at full width and
     * drop the font a notch so long titles read normally. Reported by
     * b.ernst 2026-05-20 via in-app feedback (screenshot of ticket #1016). */
    .pwa-detail-title {
        flex: 1 0 100% !important;
        font-size: 1.25rem !important;
        line-height: 1.3 !important;
        word-break: break-word;
    }
}
