html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.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."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ─────────────────────────────────────────────────────────────────────────
   Sticky Mobile-inspired theming (reference adaptation; colors come from the
   MudTheme in MainLayout, shape/soft cards and the bottom tab bar live here).
   ───────────────────────────────────────────────────────────────────────── */

/* Flex column shell: header + scrollable middle + bottom nav. position:fixed so the shell itself can
   never scroll (on real iOS, a document-level scroll drags position:fixed bars along with it — this is
   the only layout that actually pins them). Sized with 100dvh, NOT inset:0/100vh: on iOS a fixed inset:0
   element fills the toolbar-*retracted* layout viewport, overshooting the visible area and leaving a band
   of empty space below the nav. 100dvh tracks the *visible* (dynamic) viewport, so the footer-bar sits
   exactly on the visible bottom. Only .app-main scrolls, so the header and footer-bar never move. */
html, body {
    margin: 0;
}

/* The fixed app-shell locks the document and scrolls an inner pane (.app-main) instead. Gate that lock on
   the shell actually being present: this stylesheet is also linked by the Inputs console, which uses a
   normal MudLayout (no .app-shell) and MUST keep the document itself scrollable — an unconditional
   overflow:hidden here left it unable to scroll at all. */
html:has(.app-shell),
body:has(.app-shell) {
    height: 100%;
    overflow: hidden;   /* the app scrolls inside .app-main, not the document */
}

.app-shell {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;    /* fallback for engines without dvh */
    height: 100dvh;   /* dynamic viewport height — tracks the iOS toolbar so the nav never overshoots */
    display: flex;
    flex-direction: column;
}

.app-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top);   /* clear the notch / status bar */
    height: calc(56px + env(safe-area-inset-top));
    background: var(--mud-palette-appbar-background);
    color: var(--mud-palette-appbar-text);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    z-index: 1;
}

.app-main {
    flex: 1 1 auto;
    /* Critical: a flex item defaults to min-height:auto, which refuses to shrink below its content — so
       instead of scrolling, .app-main grows past the fixed shell and the overflow is clipped by
       body{overflow:hidden}, leaving content off-screen and unscrollable (seen in Safari/PWA). min-height:0
       lets it shrink to the shell and its own overflow-y actually scroll. */
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Room above content; no bottom clearance needed — the nav is in normal flow, not overlapping. */
.sticky-content {
    padding-top: 16px;
    padding-bottom: 24px;
}

/* Sticky buttons are sentence-case, not SHOUTING. */
.mud-button-root {
    text-transform: none;
    letter-spacing: normal;
}

/* Search-match highlight in transcripts/captures. A warm fill with dark text stays legible in both
   the light and dark themes without needing a theme-specific rule. box-decoration-break: clone keeps
   the rounded corners on each line when a match wraps. */
mark.search-hl {
    background-color: #ffdf6b;
    color: #1f1f1f;
    border-radius: 3px;
    padding: 0 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* Soft, rounded elevated cards (grey page makes white cards pop). Outlined
   papers keep their border and stay flat. */
.mud-paper.mud-elevation-1,
.mud-paper.mud-elevation-2,
.mud-paper.mud-elevation-3 {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06) !important;
}

/* Bottom tab bar ("footer-bar") — a normal flow element at the bottom of the flex column (not fixed),
   so it stays pinned regardless of content height, loading state, or iOS scroll quirks. */
.sticky-bottom-nav {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
    padding-bottom: env(safe-area-inset-bottom);   /* clear the home indicator */
}

.sticky-bottom-nav .sbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 9px 0 7px;
    text-decoration: none;
    color: var(--mud-palette-text-secondary);
    font-size: 11px;
    font-weight: 500;
    transition: color 120ms ease;
}

.sticky-bottom-nav .sbn-item .mud-icon-root {
    font-size: 24px;
}

.sticky-bottom-nav .sbn-item.active {
    color: var(--mud-palette-primary);
}
