/* ==========================================================================
   fetzn design system
   Tokens, reset, typography and shared utilities. Component styles live in
   the components' scoped .razor.css files.
   ========================================================================== */

/* ---- Font ---------------------------------------------------------------- */
/* Figtree (SIL Open Font License 1.1, wwwroot/fonts/OFL-Figtree.txt), self-hosted: no request to another site. A variable
   font, every weight from 300 to 900 in one file of 20 KB. Latin first (German included, preloaded in index.html, cached
   offline by the service worker); the Latin Extended file only loads for a page that shows such characters (names like
   "Dvořák"). The splash covers the first load; later the fallback shows until the file is there (swap). */
@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url("../fonts/figtree-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url("../fonts/figtree-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Tokens: dark (default) -------------------------------------------- */
/* The inline script in index.html always sets data-theme on <html> ("light" or "dark": the stored
   choice, else the system setting) before this file loads. Dark is the default, light overrides it
   below. Never use prefers-color-scheme in stylesheets: it would ignore the user's choice. */
:root {
    color-scheme: dark;

    --bg: #0A0A0F;
    --surface: #13131A;
    --surface-2: #1C1C26;
    --surface-3: #262632;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.13);
    --text: #F5F5F7;
    --text-muted: #9A9AA8;

    --brand-violet: #7C5CFF;
    --brand-pink: #FF4D8D;
    --brand-orange: #FF8A3D;
    --brand-gradient: linear-gradient(135deg, #7C5CFF 0%, #FF4D8D 55%, #FF8A3D 100%);
    /* Darker variant for gradients that carry white text: every stop is at least 4.5:1 against white
       (the bright gradient is only 2.3-4.4:1). Keep --brand-gradient for decoration and large type. */
    --brand-gradient-strong: linear-gradient(135deg, #6A45FF 0%, #D6246A 55%, #C2410C 100%);
    /* The restaurants' warm gradient (their map pins: keep in sync with pinLooks in js/map/fetzn-map.js) and its darker
       variant for white text and icons (an event's restaurant mark): every stop at least 4.5:1 against white. */
    --restaurant-gradient: linear-gradient(135deg, #FF9A3D 0%, #D6246A 100%);
    --restaurant-gradient-strong: linear-gradient(135deg, #C2410C 0%, #D6246A 100%);
    /* Gradient text on the page background: at least 4.5:1 against --bg in both themes. */
    --brand-gradient-text: var(--brand-gradient);
    /* The brand's pink for small text (the active tab, a card's "Highlight"): at least 4.5:1 against --bg,
       --surface and the bars in both themes. */
    --brand-text: #FF7FAE;
    --brand-glow: 0 10px 30px -10px rgba(255, 77, 141, 0.55);
    /* The glow of a gradient button under the mouse: a little wider and stronger than at rest, per theme. */
    --brand-glow-hover: 0 14px 34px -12px rgba(255, 77, 141, 0.72);
    /* The brand's violet for small text and icons (a text button, a tonal "on" state): at least 4.5:1 against
       --bg, the surfaces and --brand-tonal in both themes. */
    --brand-violet-text: #B3A5FF;
    /* The quiet "on" state of small toggles in a list (a joined "Bin dabei" on the cards): a violet tint with
       --brand-violet-text, no glow. The gradient with its glow stays the one main action of a view. */
    --brand-tonal: color-mix(in srgb, var(--brand-violet) 22%, var(--surface-2));
    --brand-tonal-border: color-mix(in srgb, var(--brand-violet) 45%, transparent);

    --focus: #A493FF;
    --focus-ring: rgba(164, 147, 255, 0.32);
    --live: #34D399;
    --live-text: #4ADE9F;
    --live-soft: rgba(52, 211, 153, 0.13);
    --warning: #FBBF24;
    /* The warning's text and icon color on a surface or its own tint, and that tint (an offline note, a rating's star
       background): like --live-text and --live-soft. */
    --warning-text: #FBBF24;
    --warning-soft: rgba(251, 191, 36, 0.12);
    --danger: #FF6B78;
    --danger-soft: rgba(255, 107, 120, 0.12);
    --danger-ring: rgba(255, 107, 120, 0.28);
    /* The fill of destructive buttons and its hover (white on them 5.6:1 and more, in both themes); --danger stays the
       red of text and icons. */
    --danger-strong: #C81E2E;
    --danger-strong-hover: #B01A28;

    /* Form controls: borders and the switch track reach 3:1 against the surface (WCAG 1.4.11). */
    --input-bg: var(--bg);
    --input-border: rgba(255, 255, 255, 0.38);
    --input-border-hover: rgba(255, 255, 255, 0.54);
    --switch-off: #63637A;

    --glass-strong: rgba(19, 19, 26, 0.86);
    /* Frosted glass. Not used by default (see "App shell"): a backdrop blur over moving content is redone on
       every frame. Kept so a surface can switch it back on. */
    --glass-blur: saturate(180%) blur(20px);
    --scrim: rgba(0, 0, 0, 0.55);

    /* Round buttons floating over imagery or page content (.mt-icon-button): nearly opaque discs instead of a
       backdrop blur, which would be redone on every frame the page scrolls under them. Setting --icon-btn-blur
       to var(--glass-blur) switches the blur back on. */
    --icon-btn-bg: rgba(10, 10, 15, 0.72);
    --icon-btn-bg-hover: rgba(10, 10, 15, 0.84);
    --icon-btn-fg: #FFFFFF;
    --icon-btn-border: rgba(255, 255, 255, 0.14);
    --icon-btn-shadow: none;
    --icon-btn-blur: none;

    /* Raised surfaces (cards, panels) are lit from above: on the dark theme a faint light line along their top edge
       (--edge-light, inset, painted once with the surface) instead of a heavier shadow, which hardly shows on a
       near-black page. The light theme needs none: its surfaces are white on a tinted page. */
    --edge-light: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --shadow-sm: var(--edge-light), 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: var(--edge-light), 0 8px 24px rgba(0, 0, 0, 0.35);
    /* How much of a card's own color (its category's accent) washes over its surface from the cover's corner
       (EventCard). */
    --card-tint: 14%;
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);

    --skeleton: rgba(255, 255, 255, 0.055);
    --skeleton-shine: rgba(255, 255, 255, 0.07);

    /* Floating surfaces over the page or the map (map heads and cards, the toasts): one step above --shadow-md. */
    --shadow-float: var(--edge-light), 0 12px 32px rgba(0, 0, 0, 0.45);
    /* The rest of the elevation ramp: tiny raised parts (a switch's knob), the sheets (lit edge, shadow upwards) and the
       selected thumb of a segmented control. */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-sheet: var(--edge-light), 0 -12px 48px -16px rgba(0, 0, 0, 0.6);
    --thumb-shadow: var(--shadow-sm);

    /* Corners: one ramp. --r-card is the list tiles' (event rows and posters, organizer rows), --r-tile the generated
       avatars' and app-mark tiles' (a share of their size, so every size keeps the same shape), --r-2xl the sheets'. */
    --r-2xl: 28px;
    --r-xl: 24px;
    --r-card: 20px;
    --r-lg: 16px;
    --r-md: 12px;
    --r-sm: 8px;
    --r-xs: 4px;
    --r-pill: 999px;
    --r-tile: 30%;

    /* Spacing: the 2px grid the components use, as tokens (layout spacing uses these; 1-2px optical nudges stay). */
    --s-0-5: 2px;
    --s-1: 4px;
    --s-1-5: 6px;
    --s-2: 8px;
    --s-2-5: 10px;
    --s-3: 12px;
    --s-3-5: 14px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-8: 32px;
    --s-10: 40px;
    --s-12: 48px;
    --s-16: 64px;

    /* The list tiles' shared metrics (EventCard, organizer rows and cards, their skeletons): inner padding and the
       gap between tiles of a list. */
    --card-pad: 12px;
    --card-gap: 12px;

    /* Tap targets and chips: every control is at least --hit tall to tap (a ::before extends smaller ones). Chips
       (the feed's category row, the directory's kinds, the form's choices) are --chip-h, the map's overlay chips
       --chip-h-compact; in rem, so they grow with the browser's text size. */
    --hit: 44px;
    --chip-h: 2.5rem;
    --chip-h-compact: 2rem;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in: cubic-bezier(0.3, 0, 0.8, 0.15);
    /* One spring for every pop: the older name stays an alias of --ease-spring-pop (see "Motion"), so all of them bounce
       alike. */
    --ease-spring: var(--ease-spring-pop);
    --dur-fast: 150ms;
    --dur: 220ms;
    --dur-slow: 320ms;
    /* Entrances: a list's or page's parts rise in at --dur-enter, --stagger apart (only the first few, see
       CardEntrances); pops (an avatar, a badge) at --dur-pop. */
    --dur-enter: 420ms;
    --dur-pop: 480ms;
    --stagger: 40ms;
    /* Overlays: a sheet, a dialog or a banner springs in at --dur-sheet and leaves at --dur-exit (BottomSheet waits as
       long before it removes a closed sheet). */
    --dur-sheet: 520ms;
    --dur-exit: 240ms;

    /* Layers of the fixed parts, bottom to top. Local stacking inside a component (-1 … 5) stays numeric. */
    --z-sticky: 20;
    --z-fab: 25;
    --z-bar: 30;
    --z-fly: 35;
    --z-page-bar: 40;
    --z-sheet: 900;
    --z-toast: 1000;
    --z-banner: 1500;
    --z-splash: 1900;
    --z-alert: 2000;

    /* Type. Figtree (see "Font"), a variable font: the weights are one ramp of five steps and nothing in between, so
       the hierarchy reads the same on every device (regular body text, medium muted meta, semibold labels, chips,
       buttons and pills, bold titles and numbers, heavy page titles and the display). */
    --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-heavy: 800;
    /* Sizes, smallest to largest: tiny labels and counts (2xs), meta (xs, sm), body (base), inputs (input: 16px, the
       size below which iOS zooms into a focused field), tile titles (md), section titles (lg), detail titles (xl),
       page titles (2xl), the 404 code (display). */
    --text-2xs: 0.6875rem;
    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-input: 1rem;
    --text-md: 1.0625rem;
    --text-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
    --text-xl: clamp(1.5rem, 1.25rem + 1.3vw, 2rem);
    --text-2xl: clamp(2rem, 1.55rem + 2.4vw, 2.75rem);
    --text-display: clamp(2.5rem, 1.6rem + 4.2vw, 4rem);
    /* Tracking: page titles (tight), titles (snug), body (normal), uppercase labels (caps). */
    --tracking-tight: -0.035em;
    --tracking-snug: -0.02em;
    --tracking-normal: -0.01em;
    --tracking-caps: 0.06em;

    /* The page column: --content-max wide, at least --gutter from the screen edge. Tab roots use the full column;
       the reading pages narrow it (see "Reading pages" below): "Event anlegen" to one form column, the event details
       (and the admin's preview) to one column on phones and tablets, two from 1024px. */
    --content-max: 720px;
    --reading-max: 720px;
    --details-max: 720px;
    --gutter: 20px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    /* The content edge of every page, and of every full-width bar and fixed control that lines up with it: the
       gutter, the column's centring margin or the safe area (a notch in landscape), whichever is largest - never
       their sum. The 100% resolves where it is used: against the full-width parent, or the viewport for fixed boxes
       (without a classic scrollbar, unlike 100vw). The var()s resolve here on :root, so --gutter and --content-max
       are only ever changed on :root. */
    --page-inset-start: max(var(--gutter), (100% - var(--content-max)) / 2, var(--safe-left));
    --page-inset-end: max(var(--gutter), (100% - var(--content-max)) / 2, var(--safe-right));
    /* The largest bottom inset the browser can report. Browsers change safe-area-inset-bottom while their toolbar
       collapses and comes back (Safari on iPhone: 0 to 34px), so spacing in the page's flow (the footer) uses this
       stable value: the page's height never changes while scrolling (near the end the page would jump by the
       difference when scrolling back up). Chrome 135+ reports it; elsewhere the live inset, on iPhones and iPads at
       least the 34px of the home indicator (see the @supports rule below the light tokens: only iOS, so desktops and
       Android end the page alike in every browser). Parts fixed to the bottom edge (tab bar, FAB, page bars, toasts)
       keep following --safe-bottom. */
    --safe-bottom-max: env(safe-area-max-inset-bottom, env(safe-area-inset-bottom, 0px));
    /* The app shell's bars without the safe areas: the top app bar (AppHeader) and the bottom tab bar
       (TabBar). Colors and the inset logic: section "App shell". */
    --header-h: 56px;
    --header-offset: calc(var(--header-h) + var(--safe-top));
    /* 56px at the default 16px root: the icon slot and the spacing in px, the label's share in rem, so the bar grows
       with the browser's font size instead of the label running into the icon. */
    --tabbar-h: calc(38px + 1.125rem);
    /* The tab bar's distance from the bottom edge: always 0, it is a strip (large screens move the navigation into the
       top bar instead of floating it, see "App shell"). Part of --nav-bottom, which is what everything else uses. */
    --tabbar-float: 0px;
    /* What the bottom navigation takes from the bottom edge above the safe area: the tab bar and its float, or 0 where
       the navigation sits in the top bar (large screens, see "App shell"). Everything that keeps clear of the tab bar
       (the map's controls, the feed's lower fade) uses this, never --tabbar-h itself. */
    --nav-bottom: calc(var(--tabbar-h) + var(--tabbar-float));
    /* What the navigation takes from the top edge on pages without an app bar of their own (the map): 0 while it is
       at the bottom, the app bar's band where it sits at the top (large screens, see "App shell"). */
    --nav-top: 0px;

    /* Height of the fixed bottom UI without the safe area, so the footer, toasts (with --toast-lift)
       and focused fields stay clear of it: the tab bar sets it (see "App shell"), pages with a bar of
       their own (event details, "Event anlegen") set it themselves. */
    --bottom-inset: 0px;

    /* The on-screen keyboard where it covers the page instead of resizing it (iOS; Android resizes the page, see the
       viewport meta in index.html): how much of the bottom edge it hides, and how far the visible part is panned down
       from the top. js/scroll-state.js sets both on <html> while a text field has focus; 0 otherwise. Bottom bars and
       sheets add them (bottom: var(--keyboard-inset)), so their actions stay above the keyboard. */
    --keyboard-inset: 0px;
    --keyboard-top: 0px;
}

/* ---- Tokens: light ------------------------------------------------------- */
:root[data-theme="light"] {
    color-scheme: light;

    --bg: #F6F6F9;
    --surface: #FFFFFF;
    --surface-2: #EEEEF3;
    --surface-3: #E3E3EB;
    --border: rgba(11, 11, 18, 0.08);
    --border-strong: rgba(11, 11, 18, 0.14);
    --text: #0B0B12;
    --text-muted: #5C5C6B;

    --brand-gradient-text: var(--brand-gradient-strong);
    --brand-text: #D6246A;
    --brand-glow: 0 10px 28px -12px rgba(255, 77, 141, 0.6);
    --brand-glow-hover: 0 12px 30px -12px rgba(255, 77, 141, 0.66);
    --brand-violet-text: #5A3BE6;
    --brand-tonal: color-mix(in srgb, var(--brand-violet) 12%, var(--surface));
    --brand-tonal-border: color-mix(in srgb, var(--brand-violet) 32%, transparent);
    --focus: #6D4DFF;
    --focus-ring: rgba(109, 77, 255, 0.2);
    --live: #10B981;
    --live-text: #047857;
    --live-soft: rgba(16, 185, 129, 0.12);
    --warning: #D97706;
    --danger: #C81E2E;
    --danger-soft: rgba(200, 30, 46, 0.08);
    --danger-ring: rgba(200, 30, 46, 0.16);

    --input-border: rgba(11, 11, 18, 0.42);
    --input-border-hover: rgba(11, 11, 18, 0.6);
    --switch-off: #8B8B99;

    --glass-strong: rgba(255, 255, 255, 0.86);
    --scrim: rgba(11, 11, 18, 0.4);

    --icon-btn-bg: rgba(255, 255, 255, 0.88);
    --icon-btn-bg-hover: rgba(255, 255, 255, 0.97);
    --icon-btn-fg: var(--text);
    --icon-btn-border: var(--border-strong);
    --icon-btn-shadow: 0 1px 2px rgba(16, 16, 24, 0.06);

    --edge-light: 0 0 transparent;
    --shadow-sm: 0 1px 2px rgba(16, 16, 24, 0.06);
    --shadow-md: 0 1px 2px rgba(16, 16, 24, 0.04), 0 8px 24px rgba(16, 16, 24, 0.07);
    --card-tint: 8%;
    --shadow-lg: 0 2px 6px rgba(16, 16, 24, 0.05), 0 24px 60px rgba(16, 16, 24, 0.14);
    --shadow-float: 0 2px 6px rgba(16, 16, 24, 0.06), 0 12px 32px rgba(16, 16, 24, 0.12);
    --shadow-xs: 0 1px 3px rgba(16, 16, 24, 0.28);
    --shadow-sheet: 0 -12px 44px -18px rgba(16, 16, 24, 0.28);
    --thumb-shadow: 0 1px 2px rgba(16, 16, 24, 0.1), 0 0 0 1px var(--border-strong);

    --warning-text: #B45309;
    --warning-soft: rgba(217, 119, 6, 0.1);

    --skeleton: rgba(11, 11, 18, 0.06);
    --skeleton-shine: rgba(255, 255, 255, 0.6);
}

/* iOS (the only engine with -webkit-touch-callout): a browser that does not report the largest bottom inset gets the
   home indicator's 34px as its floor (see --safe-bottom-max). */
@supports (-webkit-touch-callout: none) {
    :root {
        --safe-bottom-max: env(safe-area-max-inset-bottom, max(env(safe-area-inset-bottom, 0px), 34px));
    }
}

/* "Increase contrast" in the system settings: card edges, form borders and secondary text a clear step stronger (the
   background doodles go too, see "Pencil sketches"). */
@media (prefers-contrast: more) {
    :root {
        --text-muted: #B8B8C6;
        --border: rgba(255, 255, 255, 0.18);
        --border-strong: rgba(255, 255, 255, 0.32);
        --input-border: rgba(255, 255, 255, 0.6);
    }

    :root[data-theme="light"] {
        --text-muted: #45454F;
        --border: rgba(11, 11, 18, 0.18);
        --border-strong: rgba(11, 11, 18, 0.32);
        --input-border: rgba(11, 11, 18, 0.6);
    }
}

/* Tablets in landscape and laptops (1024px and more): the tab roots use nearly the whole width up to 1200px, so the
   feed's day rail and three columns of tiles fit from about 1280px (the most common laptop width) instead of two wide
   ones with empty margins; the event details keep a narrower column of their own. */
@media (min-width: 1024px) {
    :root {
        --content-max: 1200px;
        --details-max: 1040px;
        --gutter: 32px;
        --header-h: 60px;
    }
}

/* Wide desktops (1440px and more): a wider column, so the card grids get another column instead of wide empty
   margins. The reading pages keep their own width (below). */
@media (min-width: 1440px) {
    :root {
        --content-max: 1280px;
        --gutter: 40px;
    }
}

/* Full HD and larger (1920px and more): the column grows once more, so the feed gets a fourth column and the margins
   stay in proportion on QHD and 4K screens. Not wider: a row of five cards is too long to scan by time. */
@media (min-width: 1920px) {
    :root {
        --content-max: 1520px;
        --gutter: 48px;
    }
}

/* Reading pages: the page itself narrows the column, so its bars (app bar, top bar, bottom bar) line up with its
   content without JS, like the tab bar's :has() rule in "App shell". .mt-create is the <main> of "Event anlegen",
   .mt-topbar the floating top bar of the event details and the preview (in every state: loading, error, loaded),
   .mt-org-profile the <main> of an organizer's profile, which reads like an event's details.
   :root:has() is more specific than the :root of the media queries above, so these win on every width. */
:root:has(.mt-create) {
    --content-max: var(--reading-max);
}

:root:has(.mt-topbar),
:root:has(.mt-org-profile) {
    --content-max: var(--details-max);
}

/* The smallest phones (320-359 px): every pixel of width goes to the content. */
@media (max-width: 359.98px) {
    :root {
        --gutter: 16px;
    }
}

/* Phones in landscape: little height, so both bars get slimmer (the tab bar puts its labels beside the icons,
   which needs some width: a narrow split-screen window keeps the regular bars). A fixed 44px here: the label sits
   beside the icon, not below it. Keep in sync with TabBar. */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 540px) {
    :root {
        --header-h: 48px;
        --tabbar-h: 44px;
    }
}

/* Switching the theme: colors glide for a moment (class set by setTheme in interop.js - never on load and not with
   reduced motion; where the browser can, a circular reveal replaces the glide, see "Motion"; in the lite effects set
   and on touch devices without that reveal the colors switch at once, see "Effects budget"). The switch itself
   animates its own parts. */
html.mt-is-theme-changing,
html.mt-is-theme-changing *:not(.mt-theme-switch, .mt-theme-switch *),
html.mt-is-theme-changing *:not(.mt-theme-switch, .mt-theme-switch *)::before,
html.mt-is-theme-changing *:not(.mt-theme-switch, .mt-theme-switch *)::after {
    transition-property: background-color, border-color, color, fill, stroke, box-shadow, outline-color, text-decoration-color !important;
    transition-duration: 280ms !important;
    transition-timing-function: var(--ease-out) !important;
    transition-delay: 0s !important;
}

/* ---- Reset & base -------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    background: var(--bg);
    overscroll-behavior-y: none;
    /* Keeps the page from shifting sideways when the scroll lock hides a classic scrollbar. */
    scrollbar-gutter: stable;
    /* Keyboard focus never ends up below the sticky header, a page's bottom bar or an on-screen keyboard laid over the
       page (iOS, --keyboard-inset; a bar may ride on it, like the submit bar of "Event anlegen"). Also where a page
       scrolls a field into view itself (focusField in interop.js: the middle of what stays visible). */
    scroll-padding-top: calc(var(--header-offset) + 12px);
    scroll-padding-bottom: calc(var(--bottom-inset) + var(--safe-bottom) + var(--keyboard-inset) + 16px);
}

/* The feed and the Merkliste dock the current day under the app bar (DayGroup's band, about 40px): keyboard focus and
   find-in-page keep clear of it too. Not where the days do not dock (phones in landscape) or stand in a rail beside the
   tiles (DESKTOP-NAV, see "App shell"). */
@media (orientation: portrait) and (max-width: 1023.98px), (orientation: portrait) and (max-height: 599.98px), (min-height: 500.02px) and (max-width: 1023.98px), (min-height: 500.02px) and (max-height: 599.98px) {
    :root:has(.mt-day__head) {
        scroll-padding-top: calc(var(--header-offset) + max(40px, 2.5rem) + 12px);
    }
}

html.mt-is-scroll-locked {
    overflow: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    /* svh, not dvh: the page's height must not change while scrolling (see .mt-app-shell). */
    min-height: 100svh;
    overflow-x: clip;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: var(--fw-bold);
    line-height: 1.15;
    letter-spacing: var(--tracking-snug);
    text-wrap: balance;
}

p {
    margin: 0;
    text-wrap: pretty;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* touch-action: a tap acts at once on every phone, with no wait for a possible double-tap zoom (panning and pinch
   zoom stay). Buttons and form controls get the same below. */
a {
    color: inherit;
    text-decoration: none;
    touch-action: manipulation;
}

label {
    touch-action: manipulation;
}

button {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    cursor: pointer;
    touch-action: manipulation;
}

button:disabled {
    cursor: default;
}

input,
textarea,
select {
    margin: 0;
    font: inherit;
    letter-spacing: inherit;
    color: inherit;
    touch-action: manipulation;
}

fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

legend {
    padding: 0;
}

img {
    display: block;
    max-width: 100%;
}

::selection {
    background: rgba(124, 92, 255, 0.35);
}

/* The keyboard's focus ring. It never reshapes the element: components that need a rounded ring set their own radius;
   a plain text link gets a small one, so the ring does not cut its letters' corners. */
:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

a:not([class]):focus-visible {
    border-radius: var(--r-xs);
}

h1:focus,
[tabindex="-1"]:focus {
    outline: none;
}

.mt-icon {
    display: block;
    flex: none;
}

/* ---- Layout utilities ---------------------------------------------------- */
/* Footer at the bottom of short pages (MainLayout renders it after the page). The clip catches full-bleed
   decoration (100vw also counts a classic scrollbar) that body's clip cannot: body passes its overflow on to
   the viewport. A clip is no scroll container, so sticky and fixed children keep working.
   The minimum is the screen with the browser's toolbars shown (svh), which stays put while scrolling. dvh would
   grow while the toolbar collapses: a page only a little taller than the screen (a few events) would change its
   height under the finger, and the browser would jump when scrolling back up (as with the live safe area, see
   --safe-bottom-max). */
.mt-app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    overflow-x: clip;
    /* Its own stacking context, so a background layer inside it (z-index: -1, the doodles of SketchBackdrop) lies
       above the page color: in the root's context, body would paint its background over it. The overlays (sheets,
       toasts, the splash, the error bar) stay outside the shell and above it. */
    isolation: isolate;
}

/* The page column: full width, its padding puts the content between the page edges (--page-inset-*). Children that
   bleed to the screen edge or position against the column use the same tokens. */
.mt-container {
    width: 100%;
    padding-inline: var(--page-inset-start) var(--page-inset-end);
}

/* Card lists (the feed's days, the Merkliste, the Veranstalter): as many columns as tiles of at least --card-min fit,
   so tablets, foldables and landscape phones get two and wide desktops three or four, with no viewport queries. In
   rem, so larger text means fewer, wider columns. A list may set its own --card-min for other tiles (the organizer
   rows: max(19.5rem, a third of the column), so they never go beyond three). */
.mt-card-grid {
    --card-min: 20rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-min)), 1fr));
    gap: var(--card-gap);
}

.mt-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mt-tabular {
    font-variant-numeric: tabular-nums;
}

/* ---- App shell (AppHeader, TabBar, CreateEventFab) ----------------------- */
/* The app's two bars, as in a native app: the top app bar (Layout/AppHeader, --header-h) and the tab bar
   (Layout/TabBar) with the four tab roots. On phones, tablets in portrait and short windows the tab bar is a strip
   along the bottom edge (--tabbar-h). On large screens - DESKTOP-NAV, (min-width: 1024px) and (min-height: 600px),
   the same query in TabBar.razor.css, AppHeader.razor.css and the pages that react to it - it is a pill in the middle
   of the top bar's band, and nothing is fixed to the bottom edge. Both bars are opaque surfaces with a hairline toward
   the content instead of frosted glass: a backdrop blur is redone on every frame the content scrolls under a bar, the
   most expensive work of the whole app on a low-end phone, and without a blur text under a translucent bar stays
   readable as a ghost (even at 98% a card's title still showed through). The bars that stand in for them (the detail
   page's top bar and participation bar, the submit bar of "Event anlegen") use the same tokens. --bar-blur:
   var(--bar-blur-glass) switches the glass back on (then with translucent surfaces, e.g. 0.8). At rest the app bar is
   the page color, which is also the status bar's (theme-color in index.html and setTheme in interop.js). */
:root {
    --bar-surface: var(--bg);
    --tabbar-surface: #111118;
    --bar-border: rgba(255, 255, 255, 0.08);
    --bar-blur-glass: saturate(170%) blur(16px);
    --bar-blur: none;
    /* Round buttons of the app bar (.mt-bar-button): a quiet disc with a hairline edge. */
    --bar-btn-bg: rgba(255, 255, 255, 0.07);
    --bar-btn-bg-pressed: rgba(255, 255, 255, 0.13);
    --bar-btn-border: rgba(255, 255, 255, 0.09);
    /* Tabs: muted; the active one in the brand's pink (at least 4.5:1 on the bar) on a soft gradient pill. */
    --tab-fg: var(--text-muted);
    --tab-active: var(--brand-text);
    --tab-indicator: linear-gradient(135deg, rgba(124, 92, 255, 0.28), rgba(255, 77, 141, 0.22));
    /* The theme switch's glyph (ThemeSwitch): a soft violet moon in the dark theme, an orange sun in the light one. */
    --theme-glyph: #C9BCFF;
}

:root[data-theme="light"] {
    --tabbar-surface: #FFFFFF;
    --bar-border: rgba(11, 11, 18, 0.09);
    --bar-btn-bg: rgba(11, 11, 18, 0.04);
    --bar-btn-bg-pressed: rgba(11, 11, 18, 0.09);
    --bar-btn-border: rgba(11, 11, 18, 0.08);
    --tab-indicator: linear-gradient(135deg, rgba(109, 77, 255, 0.14), rgba(214, 36, 106, 0.12));
    --theme-glyph: #C2410C;
}

/* "Reduce transparency" in the system settings: solid bars, never a blur (even where it is switched back on). */
@media (prefers-reduced-transparency: reduce) {
    :root,
    :root[data-theme="light"] {
        --tabbar-surface: var(--surface);
        --bar-blur: none;
    }
}

/* DESKTOP-NAV: the navigation is in the top bar (TabBar.razor.css), so nothing takes room at the bottom edge
   (--nav-bottom 0), and a page without an app bar of its own (the map) keeps the top bar's band free for the floating
   pill (--nav-top). */
@media (min-width: 1024px) and (min-height: 600px) {
    :root {
        --nav-bottom: 0px;
        --nav-top: var(--header-offset);
    }
}

/* While the tab bar is shown (tab roots, organizer profiles, 404), what it takes at the bottom (--nav-bottom) is the
   fixed bottom UI: the footer (its last line ends 12px above the bar), toasts (12px above it) and focused fields end
   above it. Decided by the bar's presence alone, no JS; in DESKTOP-NAV that is nothing, so they use the bottom edge.
   Pages with a bar of their own hide the tab bar and set both values themselves (PageBarInset). */
:root:has(.mt-tabbar) {
    --bottom-inset: var(--nav-bottom);
    --toast-lift: var(--nav-bottom);
}

/* Typing on a touch screen (a search field of a tab root): the bottom tab bar steps aside, as in native apps. Android
   resizes the page for the keyboard (see the viewport meta in index.html), and the bar would ride on top of the keyboard
   and take the room of the results. */
@media (pointer: coarse) and (max-width: 1023.98px), (pointer: coarse) and (max-height: 599.98px) {
    :root:has(.mt-input:focus) .mt-tabbar {
        visibility: hidden;
    }
}

/* The feed's floating action button "Event anlegen" (Features/Events/Components/CreateEventFab): 56px, floating
   24px above the fixed bottom UI, with a soft glow in the brand colors. In DESKTOP-NAV the top bar has the button
   instead (AppHeader) and the FAB is hidden. */
:root {
    --fab-size: 56px;
    --fab-gap: 24px;
    --fab-glow: 0 10px 24px -8px rgba(214, 36, 106, 0.7), 0 4px 10px -4px rgba(106, 69, 255, 0.55);
}

:root[data-theme="light"] {
    --fab-glow: 0 10px 22px -8px rgba(214, 36, 106, 0.5), 0 3px 8px -3px rgba(106, 69, 255, 0.4);
}

/* While it is on the page (and shown: everywhere but DESKTOP-NAV), toasts appear above its fixed position (12px clear
   of it, like above a bar) and focused fields scroll clear of it. */
@media (max-width: 1023.98px), (max-height: 599.98px) {
    :root:has(.mt-fab) {
        --toast-lift: calc(var(--bottom-inset) + var(--fab-gap) + var(--fab-size));
        scroll-padding-bottom: calc(var(--bottom-inset) + var(--safe-bottom) + var(--fab-gap) + var(--fab-size) + 16px);
    }
}

/* At the end of the feed the closing card ("Du bist durch", FeedEnd) has its own "Event anlegen": the button gets out
   of the way as the card arrives (CreateEventFab.razor.css), so the page ends like every other one. Only where it
   stays - a short feed without the card (an empty state), or no scroll-driven animations - does the footer keep the
   button's room below its lines on narrower screens (wide screens need none: the centred lines are far from it). */
@media (max-width: 719.98px) {
    :root:has(.mt-fab):not(:has(.mt-feed-done)) .mt-app-footer {
        padding-bottom: calc(12px + var(--bottom-inset) + var(--safe-bottom-max) + var(--fab-size) + var(--fab-gap));
    }

    @supports not ((animation-timeline: view()) and (timeline-scope: --fz-feed-done)) {
        :root:has(.mt-fab) .mt-app-footer {
            padding-bottom: calc(12px + var(--bottom-inset) + var(--safe-bottom-max) + var(--fab-size) + var(--fab-gap));
        }
    }
}

/* The feed's list is endless: while more pages can still load (FeedEnd without its closing card), a footer below it would
   run ahead of the reader, appearing and being pushed away with every page. It shows with the closing card ("Du bist
   durch"); until then the legal links are one tap away on the Profil tab, whose page ends with the footer. Other states
   of the feed (empty, error, the Merkliste filter) have no FeedEnd and keep the footer. */
:root:has(.mt-feed-end):not(:has(.mt-feed-done)) .mt-app-footer {
    display: none;
}

/* The Profil (AccountPage): its actions sit at the very bottom, directly above the footer's lines, as one block with
   them (the owner's wish): the footer starts right below the actions, without its usual distance from a page. */
:root:has(.mt-account) .mt-app-footer {
    margin-top: 0;
    padding-top: var(--s-3);
}

/* The map (Pages/FetznMap, the fourth tab): one fixed screen, the tab bar over its lower edge. The document never
   scrolls (a swipe pans the map) and keeps no gutter for a classic scrollbar beside it. The page lifts the toasts
   above its own floating controls itself (it measures them). */
:root:has(.mt-fzmap) {
    overflow: hidden;
    scrollbar-gutter: auto;
}

/* The feed's closing card (FeedEnd) names a view timeline that the floating button (CreateEventFab), which comes
   before it in the page, steps aside on: timeline-scope makes it visible to the whole shell. (The app bar's title of
   the tab roots follows a class instead, html.mt-is-title-under from js/scroll-state.js, see AppHeader.razor.css.) */
.mt-app-shell {
    timeline-scope: --fz-feed-done;
}

/* Round icon button of the app bar (back, theme): 44px to tap, a quiet 40px disc to see. The focus ring hugs
   the disc. Pressing snaps it in and lets it spring back (press tokens, see "Motion"). */
.mt-bar-button {
    position: relative;
    isolation: isolate;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: var(--r-pill);
    color: var(--text);
    transition: transform var(--press-out) var(--ease-spring-pop);
}

.mt-bar-button::before {
    content: "";
    position: absolute;
    inset: 2px;
    z-index: -1;
    border-radius: inherit;
    background: var(--bar-btn-bg);
    box-shadow: inset 0 0 0 1px var(--bar-btn-border);
    transition: background-color var(--dur) var(--ease-out);
}

@media (hover: hover) {
    .mt-bar-button:hover::before {
        background: var(--bar-btn-bg-pressed);
    }
}

.mt-bar-button:active {
    transform: scale(var(--press-round));
    transition-duration: var(--press-in);
    transition-timing-function: var(--ease-out);
}

.mt-bar-button:active::before {
    background: var(--bar-btn-bg-pressed);
}

.mt-bar-button:focus-visible {
    outline: none;
}

.mt-bar-button:focus-visible::before {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

@media (forced-colors: active) {
    .mt-bar-button::before {
        border: 1px solid ButtonText;
    }
}

/* ---- Page heads ---------------------------------------------------------- */
/* The numbers line of the tab roots' heads (feed: "17 Events · 4 heute", its Merkliste filter, Veranstalter): plain
   muted text, no border or fill, so it never looks like something to tap. With the Merkliste a live-green dot in front
   while one of the saved events runs right now (centered on the first line, also when the line wraps). The pages
   set its distance to what is above it. */
.mt-page-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 var(--s-2);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    line-height: 1.45;
}

/* Its 3px halo (the shadow) lines up with the content edge, like the title and the cards: the dot itself starts 3px
   further in. */
.mt-page-summary__live {
    flex: none;
    align-self: flex-start;
    width: 7px;
    height: 7px;
    margin-top: calc(0.725em - 3.5px);
    margin-left: 3px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 0 3px var(--live-soft);
}

/* The large title of the tab roots and the 404 page (FeedIntro, Veranstalter, Profil, NotFound): one recipe, so they
   all have the same size, weight and tracking; a page sets only its distance to what follows. The lead below it is one
   or two muted lines. */
.mt-page-title {
    font-size: var(--text-2xl);
    font-weight: var(--fw-heavy);
    line-height: 1.04;
    letter-spacing: var(--tracking-tight);
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
    text-wrap: balance;
}

.mt-page-lead {
    max-width: 46ch;
    color: var(--text-muted);
    font-size: var(--text-base);
    line-height: 1.5;
}

/* ---- Shared tile parts ---------------------------------------------------- */
/* A line of short facts ("Bad Reichenhall · 2 Events · ★ 4,5"): the dots between the items are drawn (no text), so
   screen readers hear the items alone. One line by default: where it is too short, the last item gives way with "…"
   (.mt-facts--wrap lets the items wrap instead). The items are inline flex boxes, so an icon sits centred beside its
   text ("★ 4,6"). */
.mt-facts {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    line-height: 1.4;
    white-space: nowrap;
}

.mt-facts > * {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: var(--s-1);
    min-width: 0;
}

.mt-facts > :last-child {
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The last item of a one-line list is a block: text-overflow works in blocks only, a flex box cuts its text hard.
   Weak on purpose (:where, the specificity of one class), so an item with a display of its own keeps it - a status
   (.mt-open-status, later in this file) or a component's own class - and puts its text in a box of its own to end in
   "…" (OrganizerFacts does). */
:where(.mt-facts:not(.mt-facts--wrap)) > :last-child {
    display: block;
}

/* The dot in front of every item but the first: drawn in the item's start padding, centred on its line. So it sits at
   the same height in flex boxes and blocks, has the same room on both sides (the items' gap is for their icons and
   does not reach it) and stays in view when the item's text gives way. */
.mt-facts > * + * {
    position: relative;
    padding-inline-start: calc(2 * var(--s-1-5) + 3px);
}

.mt-facts > * + *::before {
    content: "";
    position: absolute;
    top: calc(50% - 1.5px);
    inset-inline-start: var(--s-1-5);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.55;
}

.mt-facts--wrap {
    flex-wrap: wrap;
    row-gap: var(--s-0-5);
    white-space: normal;
}

.mt-facts--wrap > :last-child {
    overflow: visible;
}

/* Forced colors paint every background in the page's color: the drawn dots keep the text's color. */
@media (forced-colors: active) {
    .mt-facts > * + *::before {
        forced-color-adjust: none;
        background: CanvasText;
    }
}

/* Whether a restaurant is open now: a dot and the status, live green while open, muted while closed.
   <span class="mt-open-status mt-is-open"><span class="mt-open-status__dot" aria-hidden="true"></span>Geöffnet · bis 22:00</span> */
.mt-open-status {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1-5);
    color: var(--text-muted);
}

.mt-open-status__dot {
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

.mt-open-status.mt-is-open {
    color: var(--live-text);
}

.mt-open-status.mt-is-open .mt-open-status__dot {
    background: var(--live);
    opacity: 1;
    box-shadow: 0 0 0 3px var(--live-soft);
}

/* Forced colors: the dot in the text's color, open or closed (the words say which). */
@media (forced-colors: active) {
    .mt-open-status .mt-open-status__dot,
    .mt-open-status.mt-is-open .mt-open-status__dot {
        forced-color-adjust: none;
        background: CanvasText;
        box-shadow: none;
    }
}

/* A small calendar leaf in an event category's color (--accent and --accent-ink from AccentTheme, which picks the ink
   per color so day and month are readable on every accent: white on dark ones, ink on light ones like amber). In rem
   with a minimum height, so it grows with the browser's text size. */
.mt-date-tile {
    display: grid;
    flex: none;
    place-items: center;
    align-content: center;
    width: 2.75rem;
    min-height: 2.875rem;
    padding-block: 6px;
    border-radius: var(--r-md);
    background:
        radial-gradient(120% 90% at 88% 6%, rgba(255, 255, 255, 0.22) 0%, transparent 55%),
        var(--accent, var(--brand-violet));
    color: var(--accent-ink, #FFFFFF);
    line-height: 1;
}

.mt-date-tile__day {
    font-size: 1.125rem;
    font-weight: var(--fw-heavy);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.mt-date-tile__month {
    margin-top: 3px;
    font-size: var(--text-2xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Badges of an organizer's tier and kind and of a highlight (directory, profile, map previews, event posters): one
   shape, four tones. The partner seal and the highlight carry the brand's strong gradient (white text 4.5:1 on every
   stop); a member is a quiet violet outline; a restaurant a neutral tint. Decorative where the same words are said to
   screen readers elsewhere (the tiles add them as hidden text). */
.mt-badge {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 4px;
    min-height: 1.5rem;
    padding: 0 9px;
    border-radius: var(--r-pill);
    font-size: var(--text-2xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.01em;
    line-height: 1.2;
    white-space: nowrap;
}

.mt-badge > .mt-icon {
    margin-left: -2px;
}

.mt-badge--partner,
.mt-badge--highlight {
    background: var(--brand-gradient-strong);
    color: #FFFFFF;
}

.mt-badge--member {
    background: var(--brand-tonal);
    color: var(--brand-violet-text);
    box-shadow: inset 0 0 0 1px var(--brand-tonal-border);
}

.mt-badge--restaurant {
    background: var(--surface-2);
    color: var(--text-muted);
}

/* A restaurant's mark where it has to stand out (over an event tile's picture, beside "Highlight"): the restaurants' warm
   gradient, white. */
.mt-badge--restaurant-strong {
    background: var(--restaurant-gradient-strong);
    color: #FFFFFF;
}

@media (forced-colors: active) {
    .mt-badge {
        border: 1px solid CanvasText;
    }
}

/* ---- Buttons ------------------------------------------------------------- */
/* One family, always pill shaped, three heights: --sm 44px (compact rows, inline retries), the default 48px and
   --lg 52px (the main action of a bottom bar or a sheet). The brand gradient (--primary) marks the one main
   action of a view; --secondary is for alternatives, --ghost for quiet actions, --danger for destructive
   confirmations. Pressing shrinks every button a little and lets it spring back, like every other tappable surface
   of the app (press tokens, see "Motion").
   A label stays on one line wherever it fits; only where it would run past the button (the smallest screens, large
   text, a narrow dialog) it wraps, balanced and centered, and the button grows. The min-heights keep the three
   heights for every one-line label; the 6px above and below only count for a wrapped one. */
.mt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    max-width: 100%;
    min-height: 48px;
    padding: var(--s-1-5) var(--s-5);
    border-radius: var(--r-pill);
    font-size: var(--text-base);
    font-weight: var(--fw-semibold);
    line-height: 1.25;
    letter-spacing: var(--tracking-normal);
    text-align: center;
    white-space: normal;
    text-wrap: balance;
    -webkit-user-select: none;
    user-select: none;
    transition: transform var(--press-out) var(--ease-spring-pop), background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}

.mt-btn:active:not(:disabled):not([aria-disabled="true"]) {
    transform: scale(var(--press-wide));
    transition-duration: var(--press-in);
    transition-timing-function: var(--ease-out);
}

.mt-btn:disabled {
    opacity: 0.5;
}

/* Busy: the button stays focusable (aria-disabled), shows a spinner and ignores taps. */
.mt-btn[aria-disabled="true"] {
    cursor: progress;
}

.mt-btn--primary {
    background: var(--brand-gradient-strong);
    color: #FFFFFF;
    box-shadow: var(--brand-glow);
}

.mt-btn--secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border-strong);
}

.mt-btn--ghost {
    color: var(--text);
    padding: var(--s-1-5) var(--s-3);
}

/* White on this red is 5.6:1 in both themes. */
.mt-btn--danger {
    background: var(--danger-strong);
    color: #FFFFFF;
}

/* Only with mouse/trackpad: on touch devices :hover would stick after the tap. */
@media (hover: hover) {
    .mt-btn--primary:hover:not(:disabled) {
        box-shadow: var(--brand-glow-hover);
    }

    .mt-btn--secondary:hover:not(:disabled) {
        background: var(--surface-3);
    }

    .mt-btn--ghost:hover:not(:disabled) {
        background: var(--surface-2);
    }

    .mt-btn--danger:hover:not(:disabled) {
        background: var(--danger-strong-hover);
    }
}

.mt-btn--sm {
    min-height: 44px;
    padding: var(--s-1-5) var(--s-4);
    font-size: var(--text-sm);
}

/* The main action of a bar or a sheet: a step larger and bold. A wrapped label's lines stay 1.25rem apart, the height
   the page bars reserve for two of them (PageBarInset). */
.mt-btn--lg {
    min-height: 52px;
    padding: var(--s-1-5) var(--s-6);
    font-size: var(--text-md);
    font-weight: var(--fw-bold);
    line-height: 1.25rem;
}

/* High contrast mode drops fills and gradients: an edge keeps every button a button (the ghost one too). */
@media (forced-colors: active) {
    .mt-btn {
        border: 1px solid ButtonText;
    }
}

.mt-btn--block {
    width: 100%;
}

/* The actions of a sheet or confirmation: full width and stacked, the main action first (on top) and the way back
   below it, nearest the thumb; side by side on large screens where both halves hold their labels on one line, the
   main action on the right. Same order in every sheet of the app. */
.mt-action-stack {
    display: grid;
    gap: var(--s-2-5);
}

.mt-action-stack > .mt-btn {
    width: 100%;
}

/* The sheet's footer (BottomSheet) is the query container: the halves need 26rem of footer width, room for the
   longest label ("Weiter bearbeiten" on a --lg button) plus the gap. In rem, so larger text stacks them again. In
   practice the docked sheet (520px) and the dialog of large screens (480px) go side by side. */
.mt-sheet__footer {
    container: sheet-actions / inline-size;
}

@media (min-width: 640px) and (min-height: 560px) {
    @container sheet-actions (min-width: 26rem) {
        .mt-action-stack {
            grid-auto-columns: minmax(0, 1fr);
            grid-auto-flow: column;
        }

        .mt-action-stack > :first-child {
            order: 1;
        }
    }
}

/* Round button floating over imagery and page content (back, share, the heart): a nearly opaque disc, readable
   on both without a backdrop blur (--icon-btn-blur is off, see the tokens). */
.mt-icon-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--r-pill);
    color: var(--icon-btn-fg);
    background: var(--icon-btn-bg);
    border: 1px solid var(--icon-btn-border);
    box-shadow: var(--icon-btn-shadow);
    -webkit-backdrop-filter: var(--icon-btn-blur);
    backdrop-filter: var(--icon-btn-blur);
    transition: transform var(--press-out) var(--ease-spring-pop), background-color var(--dur) var(--ease-out);
}

@media (hover: hover) {
    .mt-icon-button:hover {
        background: var(--icon-btn-bg-hover);
    }
}

.mt-icon-button:active {
    transform: scale(var(--press-round));
    transition-duration: var(--press-in);
    transition-timing-function: var(--ease-out);
}

/* Busy indicator inside buttons (inherits the text color). */
.mt-spinner {
    display: inline-block;
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: fz-spin 0.75s linear infinite;
}

/* ---- Forms --------------------------------------------------------------- */
/* Labels above the control, 16px text (--text-input: no zoom on iOS), hint and error below. The same scale as
   everywhere: inputs, segmented controls and option cards are 48px tall with --r-lg corners, choice chips are the
   feed's filter chips (--chip-h, 44px hit area), errors show inline under their field with an exclamation mark. */
.mt-field {
    display: grid;
    align-content: start;
    gap: var(--s-2);
    min-width: 0;
}

.mt-field__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-3);
}

.mt-field__label {
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--tracking-normal);
}

/* A legend is not a grid item of its fieldset: space it explicitly, like the gap of a field. */
legend.mt-field__label {
    margin-bottom: var(--s-2);
}

.mt-field__optional {
    margin-left: var(--s-1);
    color: var(--text-muted);
    font-weight: var(--fw-medium);
}

.mt-field__counter {
    flex: none;
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    font-variant-numeric: tabular-nums;
}

.mt-field__counter.mt-is-full {
    color: var(--danger);
}

.mt-field__hint {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.mt-field__error {
    display: flex;
    align-items: flex-start;
    gap: var(--s-1-5);
    color: var(--danger);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    line-height: 1.4;
    animation: fz-fade-up var(--dur) var(--ease-out) both;
}

/* The info icon turned upside down is an exclamation mark (see .mt-icon--alert). */
.mt-field__error .mt-icon {
    margin-top: 1px;
    rotate: 180deg;
}

/* Turns the "info" icon into an exclamation mark: errors and warnings say "!", hints say "i". */
.mt-icon--alert {
    rotate: 180deg;
}

.mt-input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 0 var(--s-4);
    border-radius: var(--r-lg);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    font-size: var(--text-input);
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}

.mt-input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

@media (hover: hover) {
    .mt-input:hover:not(:focus) {
        border-color: var(--input-border-hover);
    }
}

/* Focus: the border in the focus color and a soft ring around it. The transparent outline is invisible until high
   contrast mode paints it (that mode drops the ring and forces the border's color). */
.mt-input:focus,
.mt-input:focus-visible {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: var(--focus);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.mt-input[aria-invalid="true"] {
    border-color: var(--danger);
}

.mt-input[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 4px var(--danger-ring);
}

/* A text area grows with its text where the browser can (field-sizing), up to most of the screen, instead of
   scrolling inside the page; touch screens have no handle to resize it. */
textarea.mt-input {
    min-height: 132px;
    max-height: 60svh;
    padding: var(--s-3-5) var(--s-4);
    resize: vertical;
    line-height: 1.55;
    field-sizing: content;
}

textarea.mt-input--short {
    min-height: 88px;
}

/* Native date/time pickers: same height as text inputs, value left aligned (iOS centers it and
   collapses empty fields). */
.mt-input[type="date"],
.mt-input[type="time"] {
    padding-right: var(--s-3);
}

.mt-input::-webkit-date-and-time-value {
    min-height: 1.4em;
    text-align: left;
}

.mt-input::-webkit-calendar-picker-indicator {
    opacity: 0.7;
    cursor: pointer;
}

/* Radio/checkbox choices styled as chips or segments: the native input stays focusable and
   announces its state, the following .mt-choice__body carries the look. */
.mt-choices {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}

.mt-choice {
    position: relative;
    display: inline-flex;
    min-width: 0;
}

/* The input covers the chip and reaches beyond it vertically where the chip is lower than --hit: a 44px hit area
   around the 40px chip. */
.mt-choice__input {
    position: absolute;
    inset: min(0px, (var(--chip-h) - var(--hit)) / 2) 0;
    width: 100%;
    height: auto;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

/* A choice chip is the feed's filter chip (CategoryFilter): --chip-h tall in rem (it grows with the text), a pill with
   a hairline, the label in semibold, a category's icon in its own color (--accent from AccentTheme). Its edge is the
   form controls' (--input-border, 3:1 like the inputs above it), a step stronger than the quieter filter row's. */
.mt-choice__body {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1-5);
    min-height: var(--chip-h);
    padding: 0 var(--s-4);
    border-radius: var(--r-pill);
    border: 1px solid var(--input-border);
    background: transparent;
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--tracking-normal);
    white-space: nowrap;
    pointer-events: none;
    transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), transform var(--press-out) var(--ease-spring-pop);
}

/* With an icon the chip starts a little tighter, so icon and text look centered. */
.mt-choice__body:has(.mt-choice__icon) {
    padding: 0 var(--s-3-5) 0 var(--s-3);
}

.mt-choice__icon {
    display: inline-flex;
    color: var(--accent, var(--text-muted));
}

@media (hover: hover) {
    .mt-choice__input:hover:not(:checked) + .mt-choice__body {
        background: var(--surface-2);
        border-color: var(--input-border-hover);
    }
}

/* Chips and segments press like buttons (press tokens, see "Motion"). The short duration only lasts while pressed:
   the selection that follows the tap glides in with the regular ones. */
.mt-choice__input:active + .mt-choice__body {
    transform: scale(var(--press-wide));
    transition-duration: var(--press-in);
    transition-timing-function: var(--ease-out);
}

/* Selected: filled with the text color, like the active filter chip of the feed (the page's strongest contrast in both
   themes); the icon takes the chip's ink. */
.mt-choice__input:checked + .mt-choice__body {
    background: var(--text);
    color: var(--bg);
    border-color: transparent;
}

.mt-choice__input:checked + .mt-choice__body .mt-choice__icon {
    color: inherit;
}

.mt-choice__input:focus-visible + .mt-choice__body {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.mt-choices.mt-is-invalid .mt-choice__body {
    border-color: var(--danger);
}

/* Segmented control (one of a few options): 48px tall like an input, the selected segment a raised thumb. Two kinds of
   segment: radio choices (.mt-choice inside, a form's value) and plain buttons (.mt-segmented__option with
   .mt-is-selected, a choice that applies at once, e.g. the location filter's radius). Each segment's hit area also
   covers the track's padding, so the whole height takes the tap. */
.mt-segmented {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: var(--s-1);
    padding: var(--s-1);
    border-radius: var(--r-lg);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
}

.mt-segmented .mt-choice__input {
    inset: -5px 0;
}

.mt-segmented .mt-choice__body,
.mt-segmented__option {
    justify-content: center;
    width: 100%;
    min-height: 38px;
    padding: 0 var(--s-2-5);
    border: 0;
    border-radius: var(--r-md);
    background: transparent;
    color: var(--text-muted);
    font-size: var(--text-base);
    font-weight: var(--fw-semibold);
}

.mt-segmented__option {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 0;
    white-space: nowrap;
    transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), transform var(--press-out) var(--ease-spring-pop);
}

.mt-segmented__option::before {
    content: "";
    position: absolute;
    inset: -5px 0;
}

@media (hover: hover) {
    .mt-segmented__option:hover:not(.mt-is-selected):not([aria-disabled="true"]) {
        color: var(--text);
    }
}

.mt-segmented__option:active:not([aria-disabled="true"]) {
    transform: scale(var(--press-wide));
    transition-duration: var(--press-in);
    transition-timing-function: var(--ease-out);
}

.mt-segmented__option[aria-disabled="true"] {
    cursor: progress;
}

.mt-segmented .mt-choice__input:checked + .mt-choice__body,
.mt-segmented__option.mt-is-selected {
    background: var(--surface-3);
    color: var(--text);
    box-shadow: var(--thumb-shadow);
}

:root[data-theme="light"] .mt-segmented .mt-choice__input:checked + .mt-choice__body,
:root[data-theme="light"] .mt-segmented__option.mt-is-selected {
    background: var(--surface);
}

.mt-segmented .mt-choice {
    display: flex;
}

/* Windows high contrast drops fills and shadows: the selected chip or segment in the system's highlight colors (listed
   explicitly for the segments, whose own rules are more specific), the chips with a visible edge, and a focused field
   with an outline in the highlight color. */
@media (forced-colors: active) {
    .mt-choice__body {
        border-color: ButtonText;
    }

    .mt-choice__input:checked + .mt-choice__body,
    .mt-segmented .mt-choice__input:checked + .mt-choice__body,
    .mt-segmented__option.mt-is-selected {
        forced-color-adjust: none;
        background: Highlight;
        color: HighlightText;
        border-color: Highlight;
    }

    .mt-input:focus-visible {
        outline-color: Highlight;
    }
}

/* Inline notice (an offline hint, a part of the page that failed to load, the form's summary of server errors, why the
   location could not be used): icon and text on a soft surface, --danger for errors, --warning for a hint that something
   did not work as asked. */
.mt-notice {
    display: flex;
    align-items: flex-start;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-lg);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.45;
}

.mt-notice > .mt-icon {
    margin-top: 1px;
}

.mt-notice--danger {
    background: var(--danger-soft);
    color: var(--danger);
}

/* The warning's tint over the surface (two layers: the tint is translucent), a hairline of it, the text at full strength;
   an icon in the warning's text color. */
.mt-notice--warning {
    background: linear-gradient(var(--warning-soft), var(--warning-soft)), var(--surface-2);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 30%, transparent);
    color: var(--text);
    font-weight: var(--fw-medium);
}

.mt-notice--warning > .mt-icon {
    color: var(--warning-text);
}

/* ---- Dish categories of restaurants (MenuTagView: directory, profile, map) -- */
/* A small chip in the category's color (--tag, the restaurant's choice) on a faint tint of it; a dot in the pure color
   leads. Its text mixes the color into the text color (--tag-mix, usually 55%). A very light color in the light theme or
   a very dark one in the dark theme would fall below 4.5:1 that way: for such a color the chip's style (MenuTagStyle)
   brings a smaller share for that theme (--tag-mix-light, --tag-mix-dark), so the text stays legible whatever the
   color. MenuTagContrastTests holds both to the same numbers. */
.mt-menu-tag {
    --tag: var(--text-muted);
    --tag-mix: var(--tag-mix-dark, 55%);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 22px;
    padding: 0 9px 0 7px;
    border-radius: var(--r-pill);
    border: 1px solid color-mix(in srgb, var(--tag) 38%, transparent);
    background: color-mix(in srgb, var(--tag) 13%, transparent);
    color: color-mix(in srgb, var(--tag) var(--tag-mix), var(--text));
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    line-height: 1;
    white-space: nowrap;
}

:root[data-theme="light"] .mt-menu-tag {
    --tag-mix: var(--tag-mix-light, 55%);
}

.mt-menu-tag::before {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tag);
}

.mt-menu-tag--more::before {
    display: none;
}

/* ---- Skeletons ----------------------------------------------------------- */
/* A single bone shimmers. */
.mt-skeleton {
    display: block;
    border-radius: var(--r-sm);
    background-color: var(--skeleton);
    background-image: linear-gradient(100deg, transparent 20%, var(--skeleton-shine) 50%, transparent 80%);
    background-size: 200% 100%;
    background-repeat: no-repeat;
    animation: fz-shimmer 1.4s ease-in-out infinite;
}

/* A loading view of many bones (a skeleton's container) fades in and then breathes as one piece: one opacity layer
   on the compositor, instead of a shimmer that repaints every bone on every frame. Its bones stay flat. The rhythm
   of the feed's skeleton, so loading views breathe in step. A busy indicator: it loops until the content is there
   (with reduced motion slower, see "Motion preferences"). */
.mt-skeleton-group {
    animation:
        fz-fade-in var(--dur-slow) var(--ease-out) backwards,
        fz-breathe 1.4s ease-in-out var(--dur-slow) infinite alternate;
}

.mt-skeleton-group .mt-skeleton {
    background-image: none;
    animation: none;
}

/* ---- Shared keyframes (prefixed, referenced from scoped CSS) ------------- */
@keyframes fz-shimmer {
    from { background-position: 150% 0; }
    to { background-position: -50% 0; }
}

@keyframes fz-fade-up {
    from { opacity: 0; transform: translate3d(0, 10px, 0); }
    to { opacity: 1; transform: none; }
}

@keyframes fz-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Placeholders that wait (skeletons, the feed's summary line): the whole block breathes, played alternate. Opacity
   only, so it runs on the compositor instead of repainting every bone like a shimmer. */
@keyframes fz-breathe {
    from { opacity: 1; }
    to { opacity: 0.6; }
}

@keyframes fz-bump {
    0% { transform: scale(1); }
    35% { transform: scale(1.22); }
    100% { transform: scale(1); }
}

/* A gentler bump for things that are large already (the category chip that just became active). */
@keyframes fz-bump-sm {
    50% { transform: scale(1.06); }
}

/* A changed number or word rolls in like a counter: from below when it rises (play it with a little spring), from
   above when it falls. */
@keyframes fz-roll-up {
    from { opacity: 0; transform: translate3d(0, 0.6em, 0) scale(0.92); }
    to { opacity: 1; transform: none; }
}

@keyframes fz-roll-down {
    from { opacity: 0; transform: translate3d(0, -0.6em, 0) scale(0.92); }
    to { opacity: 1; transform: none; }
}

/* The icon of a tab that just became active: in from a little smaller, over the top, settled. */
@keyframes fz-tab-pop {
    0% { transform: scale(0.86); }
    60% { transform: scale(1.08); }
    to { transform: none; }
}

/* A light passing over a highlight, played on an element as wide as the surface: it starts and ends beside it (where
   the element's own transform keeps it at rest). */
@keyframes fz-glint {
    from { transform: translateX(-110%); }
    to { transform: translateX(110%); }
}

@keyframes fz-pulse-ring {
    0% { transform: scale(1); opacity: 0.55; }
    80%, 100% { transform: scale(2.6); opacity: 0; }
}

@keyframes fz-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@keyframes fz-float {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(4%, -5%, 0) scale(1.06); }
}

@keyframes fz-spin {
    to { transform: rotate(360deg); }
}

@keyframes fz-pop-in {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 1; transform: none; }
}

/* Spring curves: a damped spring sampled into linear(), a close cubic-bezier where linear() is missing.
   --ease-spring-soft settles with a hint of overshoot (sheets, bars, anything large that moves in);
   --ease-spring-pop bounces a little more (toasts, badges, small things that pop). */
:root {
    --ease-spring-soft: cubic-bezier(0.32, 0.72, 0, 1);
    --ease-spring-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@supports (animation-timing-function: linear(0, 1)) {
    :root {
        --ease-spring-soft: linear(0, 0.057 4.5%, 0.188 9.1%, 0.344 13.6%, 0.498 18.2%, 0.635 22.7%, 0.749 27.3%, 0.837 31.8%, 0.903 36.4%, 0.949 40.9%, 0.98 45.5%, 0.999 50%, 1.009 54.5%, 1.015 63.6%, 1.012 72.7%, 1.008 81.8%, 1.004 90.9%, 1);
        --ease-spring-pop: linear(0, 0.066 4.5%, 0.215 9.1%, 0.393 13.6%, 0.566 18.2%, 0.715 22.7%, 0.833 27.3%, 0.92 31.8%, 0.978 36.4%, 1.013 40.9%, 1.032 45.5%, 1.038 50%, 1.032 59.1%, 1.019 68.2%, 1.008 77.3%, 1.001 86.4%, 1);
    }
}

/* Scroll reveal: an element rises in while it scrolls into view. Run on a view timeline by the components that
   use it (DayGroup for a day's tiles, OrganizerRow, OrganizerStageCard, FormSection), each in @supports
   (animation-timeline: view()) and only without reduced motion: the global rule at the end cannot shorten a
   scroll-linked animation. Eases out, so the element is nearly there early. */
@keyframes fz-reveal {
    from {
        opacity: 0;
        transform: translate3d(0, 28px, 0) scale(0.97);
        animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    }
    to { opacity: 1; transform: none; }
}

/* ---- Motion -------------------------------------------------------------- */
/* Calm and short (200-600 ms, --ease-out), transform and opacity only, so it runs on the compositor. Every
   animation ends in the visible state: without support or with reduced motion the content is simply there.
   Decorative loops are finite (a few rounds, then rest), so a page can go idle; only busy indicators (spinner,
   skeleton) loop until their content is there. Each page brings its own entrance (its intro rises in); there
   is no shell-wide fade on top: it would turn the whole page into one more layer on every navigation and
   rasterize it twice. */

/* Press feedback, the same on every tappable surface: it snaps in (--press-in, --ease-out) and springs back
   (--press-out, --ease-spring-pop). A transition runs with the values of the state it goes to, so the element's
   base transition is the release (transform var(--press-out) var(--ease-spring-pop), next to its other properties)
   and its :active state sets the scale, transition-duration: var(--press-in) and
   transition-timing-function: var(--ease-out). Round buttons press to --press-round; buttons, pills, chips and the
   FAB to --press-wide; cards and list rows to --press-card. */
:root {
    --press-round: 0.92;
    --press-wide: 0.97;
    --press-card: 0.985;
    --press-in: 90ms;
    --press-out: 420ms;
}

/* Cover morph (View Transitions): tapping a card in a list, its cover grows into the event's hero; going back, the
   hero shrinks into the card. interop.js names the tapped card's cover and sets mt-is-morphing for the transition.
   The root takes no part (no page-wide crossfade, the page swaps at once and plays its own entrance), only the
   cover moves: the hero box, so the hero's own settle plays inside the moving box. Both snapshots fill it like the
   image does; the old one (the card's thumb) gives way quickly. */
:root.mt-is-morphing {
    view-transition-name: none;
}

:root.mt-is-morphing .mt-details__hero {
    view-transition-name: fz-cover;
}

::view-transition-group(fz-cover) {
    animation-duration: 460ms;
    animation-timing-function: var(--ease-spring-soft);
}

::view-transition-old(fz-cover),
::view-transition-new(fz-cover) {
    height: 100%;
    object-fit: cover;
}

::view-transition-old(fz-cover) {
    animation-duration: 200ms;
}

/* Theme switch: the new theme spreads in a circle from the switch (interop.js animates the clip-path of the new
   snapshot and sets mt-is-theme-revealing meanwhile): two snapshots and one clipped texture instead of a color glide
   that repaints the whole page on every frame. No crossfade of the root. The switch itself carries its own name
   (fz-theme-switch, set inline on the clicked one only): its old picture is hidden and its new one is live, so its
   own sun-and-moon animation plays once, not doubled under the reveal. */
:root.mt-is-theme-revealing::view-transition-old(root),
:root.mt-is-theme-revealing::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

::view-transition-old(fz-theme-switch) {
    display: none;
}

::view-transition-new(fz-theme-switch) {
    animation: none;
}

/* Saving an event from the feed: a copy of the heart flies to the filter row's Merkliste chip (flyToFavorites in
   interop.js appends it to the page, moves it there and sets html.mt-is-flying for the flight). Above the tab bar, below
   the sheets, never in the way of a tap. */
.mt-fly {
    position: fixed;
    left: 0;
    top: 0;
    z-index: var(--z-fly);
    pointer-events: none;
    color: var(--brand-text);
}

.mt-fly__heart {
    display: block;
}

/* ---- Pencil sketches (Sketch, SketchNote) -------------------------------- */
/* Hand-drawn graphite doodles from Shared/Components/SketchSet.cs for subtle decoration: underlines,
   arrows, little motifs, hatching behind info texts. Inline SVG strokes in currentColor; the inks are
   translucent, so crossing strokes darken like real graphite. */
:root {
    --sketch-ink: rgba(208, 208, 226, 0.4);
    --sketch-ink-strong: rgba(226, 226, 240, 0.7);
    --sketch-ink-brand: rgba(176, 160, 255, 0.62);
    /* Handwritten notes: at least 4.5:1 on --bg and every surface. */
    --sketch-text: #A6A6B8;
    --sketch-text-brand: #B3A5FF;
    /* Pencil weight at a doodle's natural size (it scales with the drawing). A doodle shown at another size keeps
       the pencil's weight by dividing it by its scale: --sketch-stroke: calc(1.5px / <scale>) on the doodle or its
       layer (the backdrop's rails step --bd-scale and divide by it), so the same pencil draws on a 320px phone and
       beside a wide screen's column. Not vector-effect: non-scaling-stroke with Draw: the draw-on's dashes are
       measured along pathLength="1". */
    --sketch-stroke: 1.5px;
    --sketch-ease: cubic-bezier(0.45, 0.05, 0.3, 1);
    /* Handwriting that ships with the system, no downloads: Noteworthy (macOS, iOS), Ink Free (Windows 10+),
       Segoe Print (older Windows), Bradley Hand (macOS), else the system's cursive (Android: Dancing Script). */
    --font-hand: "Noteworthy", "Ink Free", "Segoe Print", "Bradley Hand", cursive;
    /* Notes that carry information: the same handwriting where there is one, else the UI font (set in
       italics by SketchNote) instead of a connected script that is hard to read. */
    --font-hand-legible: "Noteworthy", "Ink Free", "Segoe Print", "Bradley Hand", var(--font);
    /* Background doodles (.mt-scatter behind page heads, .mt-backdrop in the margins of wide screens): an opaque ink,
       made faint by the layer's opacity (the rails a little stronger: they are never under text). Group opacity:
       crossing strokes never darken, so text over a stroke keeps a known contrast: --text-muted 5.4:1 (7.1:1 on
       --bg), more over the brand ink. The foreground inks above would drop it to 2.5:1. 0.14 is the most the layer
       may take for that. Doodles placed where no text ever runs (the margin rails, beside the feed's headline and the
       day headers) may be stronger: --sketch-bg-free-alpha, still well below the content. */
    --sketch-bg-ink: #D0D0E2;
    --sketch-bg-ink-brand: #B3A5FF;
    --sketch-bg-alpha: 0.14;
    --sketch-bg-free-alpha: 0.3;
    --sketch-bg-rail-alpha: var(--sketch-bg-free-alpha);
}

:root[data-theme="light"] {
    --sketch-ink: rgba(46, 46, 64, 0.44);
    --sketch-ink-strong: rgba(36, 36, 52, 0.7);
    --sketch-ink-brand: rgba(109, 77, 255, 0.55);
    --sketch-text: #57576C;
    --sketch-text-brand: #5A3BE6;
    /* --text-muted over a stroke 4.9:1 (6.1:1 on --bg), more over the brand ink; 0.12 is the most for AA. */
    --sketch-bg-ink: #2E2E40;
    --sketch-bg-ink-brand: #6D4DFF;
    --sketch-bg-alpha: 0.12;
    --sketch-bg-free-alpha: 0.24;
}

/* Sizing: natural size (the viewBox) unless the Sketch gets Width/Height; CSS can set a width with
   height: auto. Strokes may overshoot the viewBox a little, so nothing is clipped. */
.mt-sketch {
    display: block;
    flex: none;
    overflow: visible;
    color: var(--sketch-ink);
    fill: none;
    stroke: currentColor;
    stroke-width: var(--sketch-stroke);
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

/* Second pass over a line: lighter and thinner. */
.mt-sketch .mt-sk-2 {
    stroke-width: calc(var(--sketch-stroke) * 0.66);
    stroke-opacity: 0.62;
}

.mt-sketch .mt-sk-hatch {
    stroke-width: calc(var(--sketch-stroke) * 0.62);
    stroke-opacity: 0.6;
}

/* Dots are zero-length strokes: the round caps make them. */
.mt-sketch .mt-sk-dot {
    stroke-width: calc(var(--sketch-stroke) * 1.9);
}

.mt-sketch .mt-sk-dot.mt-sk-sm {
    stroke-width: calc(var(--sketch-stroke) * 1.35);
}

.mt-sketch--strong {
    color: var(--sketch-ink-strong);
}

.mt-sketch--brand {
    color: var(--sketch-ink-brand);
}

/* Draw-on (Sketch Draw): each path is drawn from its own start (--sk-t) for its own duration (--sk-l), so the
   strokes follow each other like a hand drawing them. --sketch-delay shifts the whole doodle, --sketch-pace
   scales its timing (0.5 = twice as fast). The resting state is the drawn doodle: with reduced motion (or
   without animations) it is simply there. */
.mt-sketch--draw path {
    animation: fz-sketch-draw calc(var(--sk-l, 600ms) * var(--sketch-pace, 1)) var(--sketch-ease) calc(var(--sketch-delay, 0ms) + var(--sk-t, 0ms) * var(--sketch-pace, 1)) backwards;
}

.mt-sketch--draw .mt-sk-dot {
    animation-name: fz-fade-in;
}

/* A slow, tiny sway for a doodle on its own (transform only, so it stays on the compositor). A few sways, then
   it rests where it started: an endless loop would keep the page from ever going idle. */
.mt-sketch--float {
    animation: fz-sketch-float 7s ease-in-out 3;
}

/* Bob: the background doodles' barely-there hover - a few px up and a few degrees of tilt and back, slow and each on
   its own clock (--bob-dur, --bob-delay, --bob-tilt from the caller), so a set never moves in step. Transform only, on
   the compositor: no layout, no paint. A few rounds (about half a minute), then it rests where it started, like every
   other decorative loop: an endless one keeps the compositor drawing a frame for every refresh of the screen for as
   long as the page is open, which costs battery for nothing while someone reads. It plays again whenever its page is
   opened. It adds to the doodle's Rotate (the separate rotate property) and to a centering translate. Reduced motion
   stops it (the global rule), lite effects too (see "Effects budget"). Not together with the twinkle: both animate the
   transform. */
.mt-sketch--bob {
    transform-origin: 50% 60%;
    animation: fz-sketch-bob var(--bob-dur, 9s) ease-in-out var(--bob-delay, 0s) 4;
}

/* Twinkle: a sparkle flickers a few times once it is drawn, then rests. Transform and opacity on the outer <svg>, so
   it runs on the compositor (an SVG child would animate on the main thread); it adds to the doodle's own Rotate
   (the separate rotate property). For faint background doodles only: at full ink it would be loud. */
.mt-sketch--twinkle {
    transform-origin: 50% 50%;
    animation: fz-sketch-twinkle 2.4s ease-in-out calc(var(--sketch-delay, 0ms) + 1200ms) 3 backwards;
}

/* Background doodles behind a page head (the tab roots' intros, the feed's end card, the 404): a faint layer that
   fills its parent, behind the parent's content and never in the way of a tap. The parent is positioned and isolated
   (position: relative; isolation: isolate), so the layer lies above the page color. The doodles inside are placed
   absolutely by the page and draw in the layer's ink; the layer's opacity makes them faint as one piece. */
.mt-scatter {
    position: absolute;
    inset: 0;
    z-index: -1;
    color: var(--sketch-bg-ink);
    opacity: var(--sketch-bg-alpha);
    pointer-events: none;
}

.mt-scatter .mt-sketch {
    position: absolute;
    color: inherit;
}

/* The wide screens' margin rails (SketchBackdrop) set the ink and their opacity on the rail. */
.mt-backdrop .mt-sketch {
    color: inherit;
}

.mt-scatter .mt-sketch--brand,
.mt-backdrop .mt-sketch--brand {
    color: var(--sketch-bg-ink-brand);
}

/* Inside a faint layer the lighter second pass would all but vanish. */
.mt-scatter .mt-sk-2,
.mt-backdrop .mt-sk-2 {
    stroke-opacity: 0.75;
}

/* More contrast asked for, or paper: the background decoration goes (high contrast mode hides every doodle). */
@media (prefers-contrast: more), print {
    .mt-scatter,
    .mt-backdrop {
        display: none;
    }
}

/* High contrast mode: the doodles would turn into full-strength lines that only add noise. */
@media (forced-colors: active) {
    .mt-sketch {
        display: none;
    }
}

/* pathLength="1": the dash covers the whole path. The gap is longer than the path and the start offset a
   hair over 1, so a stroke that is not drawn yet leaves no round-cap dot at its start. */
@keyframes fz-sketch-draw {
    from { stroke-dasharray: 1 2; stroke-dashoffset: 1.01; }
    to { stroke-dasharray: 1 2; stroke-dashoffset: 0; }
}

@keyframes fz-sketch-float {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    50% { transform: translate3d(0, -3px, 0) rotate(-2.5deg); }
}

@keyframes fz-sketch-bob {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    30% { transform: translate3d(1px, -4px, 0) rotate(var(--bob-tilt, -3deg)); }
    65% { transform: translate3d(-1px, 2px, 0) rotate(calc(var(--bob-tilt, -3deg) * -0.6)); }
}

/* A light beam of a head's glow (Veranstalter: the stage lights) swings a few degrees around its top and back; the
   beam's own angle comes from its rotate, which this adds to (transform only, on the compositor). */
@keyframes fz-beam-sway {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(var(--beam-swing, 6deg)); }
}

/* A soft halo (Profil: around the profile picture) swells a little and settles again (transform and opacity only). */
@keyframes fz-halo-breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.06); opacity: 0.8; }
}

/* The detail page's hero icon (EventCover): springs in once, then hovers for a few rounds. */
@keyframes fz-cover-icon-in {
    from { opacity: 0; scale: 0.6; }
    to { opacity: 1; scale: 1; }
}

@keyframes fz-cover-icon-hover {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    30% { transform: translate3d(0, -7px, 0) rotate(-4deg); }
    65% { transform: translate3d(0, 3px, 0) rotate(2.5deg); }
}

@keyframes fz-sketch-twinkle {
    0%, 100% { transform: none; opacity: 1; }
    35% { transform: scale(0.72) rotate(16deg); opacity: 0.45; }
    60% { transform: scale(1.1) rotate(6deg); opacity: 1; }
}

/* The margin rails drift a little against the scroll for depth (SketchBackdrop runs it on scroll(root) with an
   absolute range, so the endless feed's growing height never makes it jump). One drift element per rail: a
   transform on the backdrop itself would make it the containing block of its fixed rails. */
@keyframes fz-backdrop-drift {
    to { transform: translate3d(0, var(--bd-drift, -48px), 0); }
}

/* ---- Aurora (startup splash, the test mode's PIN prompt) ----------------- */
/* Three soft lights in the brand colors drifting slowly behind the content, like stage lights in haze. Plain radial
   gradients moved by transform (no blur filter): they run on the compositor while the main thread starts the runtime.
   Several stops approximate a soft falloff, so a light never ends in a visible ring. They loop, as the splash is a busy
   indicator; the PIN prompt limits them to a few rounds, the lite effects set to a fade-in (see "Effects budget"). The
   parent is positioned and isolated (isolation: isolate): the lights lie below its content. */
.mt-aurora {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    --aurora-size: clamp(440px, 125vmin, 900px);
    --aurora-a: rgba(124, 92, 255, 0.36);
    --aurora-b: rgba(255, 77, 141, 0.26);
    --aurora-c: rgba(255, 138, 61, 0.18);
}

:root[data-theme="light"] .mt-aurora {
    --aurora-a: rgba(124, 92, 255, 0.2);
    --aurora-b: rgba(255, 77, 141, 0.15);
    --aurora-c: rgba(255, 138, 61, 0.13);
}

.mt-aurora > span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--aurora-size);
    aspect-ratio: 1;
    translate: -50% -50%;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--aurora-color), color-mix(in srgb, var(--aurora-color) 40%, transparent) 52%, transparent);
    will-change: transform;
    animation: fz-aurora-a 13s ease-in-out infinite alternate, fz-fade-in 1.4s var(--ease-out) backwards;
}

.mt-aurora > span:nth-child(1) {
    --aurora-color: var(--aurora-a);
}

.mt-aurora > span:nth-child(2) {
    --aurora-color: var(--aurora-b);
    animation-name: fz-aurora-b, fz-fade-in;
    animation-duration: 17s, 1.4s;
}

.mt-aurora > span:nth-child(3) {
    --aurora-color: var(--aurora-c);
    animation-name: fz-aurora-c, fz-fade-in;
    animation-duration: 11s, 1.4s;
}

@keyframes fz-aurora-a {
    from { transform: translate3d(-28%, -22%, 0) scale(1); }
    to { transform: translate3d(16%, -6%, 0) scale(1.2); }
}

@keyframes fz-aurora-b {
    from { transform: translate3d(24%, 20%, 0) scale(1.1); }
    to { transform: translate3d(-14%, 2%, 0) scale(0.9); }
}

@keyframes fz-aurora-c {
    from { transform: translate3d(-4%, 34%, 0) scale(0.8); }
    to { transform: translate3d(12%, -28%, 0) scale(1.05); }
}

/* ---- Startup splash (index.html, until the app renders) ------------------ */
/* Over everything, on the page color (the app bar's at rest and the status bar's, see theme-color): the aurora, a fine
   dot grid, and in the middle the app icon as a speaker. Beat waves go out from it, its glow and the icon pulse with the
   beat ("boom-boom"), a light sweeps over it, three sparks circle it, and a ring around it fills with the loading
   progress. Below, the wordmark rises letter by letter and a line of party talk changes every moment. Transform and
   opacity only, except the ring. The loops are busy indicators and go with the splash: once the app has rendered,
   the splash zooms through the icon and fades (.mt-is-leaving, set by the script in index.html), then it is removed. With
   reduced motion: the logo, the ring and the first line, still. */
.mt-splash {
    position: fixed;
    inset: 0;
    /* Above the app, which renders underneath while the splash leaves; below the error bar. */
    z-index: var(--z-splash);
    isolation: isolate;
    display: grid;
    place-items: center;
    padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    --splash-dot: rgba(255, 255, 255, 0.075);
    --splash-track: rgba(255, 255, 255, 0.09);
    --splash-glow: radial-gradient(closest-side, rgba(255, 77, 141, 0.42), rgba(124, 92, 255, 0.18) 55%, transparent);
}

:root[data-theme="light"] .mt-splash {
    --splash-dot: rgba(11, 11, 18, 0.085);
    --splash-track: rgba(11, 11, 18, 0.08);
    --splash-glow: radial-gradient(closest-side, rgba(255, 77, 141, 0.26), rgba(124, 92, 255, 0.12) 55%, transparent);
}

/* A fine dot grid that settles in from slightly larger, fading out towards the edges. */
.mt-splash__grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(circle, var(--splash-dot) 1.1px, transparent 1.6px);
    background-position: center;
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 45%, #000, rgba(0, 0, 0, 0.4) 55%, transparent);
    mask-image: radial-gradient(ellipse 70% 55% at 50% 45%, #000, rgba(0, 0, 0, 0.4) 55%, transparent);
    animation: fz-splash-grid 1.6s var(--ease-out) backwards;
}

.mt-splash__stage {
    display: grid;
    justify-items: center;
}

/* The icon and everything around it share one grid cell, centered on each other. */
.mt-splash__emblem {
    display: grid;
    place-items: center;
    width: 200px;
    height: 200px;
    margin-bottom: 6px;
}

.mt-splash__emblem > *,
.mt-splash__waves > *,
.mt-splash__sparks > * {
    grid-area: 1 / 1;
}

.mt-splash__waves,
.mt-splash__sparks {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}

/* Beat waves, one after the other, in the three brand colors. */
.mt-splash__waves > i {
    width: 112px;
    height: 112px;
    border: 1.5px solid var(--wave);
    border-radius: 50%;
    opacity: 0;
    animation: fz-splash-wave 2.4s cubic-bezier(0.2, 0.7, 0.3, 1) calc(900ms + var(--d) * 800ms) infinite;
}

.mt-splash__waves > i:nth-child(1) {
    --d: 0;
    --wave: rgba(124, 92, 255, 0.6);
}

.mt-splash__waves > i:nth-child(2) {
    --d: 1;
    --wave: rgba(255, 77, 141, 0.55);
}

.mt-splash__waves > i:nth-child(3) {
    --d: 2;
    --wave: rgba(255, 138, 61, 0.5);
}

.mt-splash__glow {
    width: 168px;
    height: 168px;
    border-radius: 50%;
    background: var(--splash-glow);
    animation: fz-fade-in 900ms var(--ease-out) 200ms backwards, fz-splash-glow 1.2s ease-in-out 1s infinite;
}

/* The progress ring: a faint track, the brand colors on top up to the loading progress. A conic mask cuts the
   progress, a radial one the 3px ring. The registered --splash-progress lets each new value glide in. */
@property --splash-progress {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 0%;
}

.mt-splash__track,
.mt-splash__ring {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    animation: fz-fade-in 500ms var(--ease-out) 300ms backwards;
}

.mt-splash__track {
    border: 3px solid var(--splash-track);
}

.mt-splash__ring {
    --splash-progress: var(--blazor-load-percentage, 0%);
    background: conic-gradient(var(--brand-violet), var(--brand-pink) 50%, var(--brand-orange));
    -webkit-mask: conic-gradient(#000 var(--splash-progress), transparent 0), radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
    -webkit-mask-composite: source-in;
    mask: conic-gradient(#000 var(--splash-progress), transparent 0), radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
    mask-composite: intersect;
    transition: --splash-progress 450ms var(--ease-out);
}

/* Three sparks on their own orbits, speeds and directions. */
.mt-splash__sparks {
    animation: fz-fade-in 700ms var(--ease-out) 900ms backwards;
}

.mt-splash__sparks > i {
    position: relative;
    width: var(--orbit);
    height: var(--orbit);
    animation: fz-spin var(--period) linear infinite;
}

.mt-splash__sparks > i::before {
    content: "";
    position: absolute;
    top: calc(var(--spark) / -2);
    left: calc(50% - var(--spark) / 2);
    width: var(--spark);
    height: var(--spark);
    border-radius: 50%;
    background: var(--spark-color);
    box-shadow: 0 0 10px 1px var(--spark-color);
}

.mt-splash__sparks > i:nth-child(1) {
    --orbit: 152px;
    --period: 3.4s;
    --spark: 7px;
    --spark-color: #A493FF;
}

.mt-splash__sparks > i:nth-child(2) {
    --orbit: 176px;
    --period: 5.2s;
    --spark: 5px;
    --spark-color: #FF7FAE;
    rotate: 140deg;
    animation-direction: reverse;
}

.mt-splash__sparks > i:nth-child(3) {
    --orbit: 140px;
    --period: 4.4s;
    --spark: 4px;
    --spark-color: #FFB27A;
    rotate: 250deg;
}

/* ---- Logo ("Doodle-Knall", docs/brand) ----------------------------------- */
/* The mark is a party popper whose glowing opening shoots one marker stroke that draws the Watzmann ridge, the way the
   app's doodles draw it (LogoMark, docs/brand/README.md). Drawn inline: by BrandLogo (the compact drawing beside the
   wordmark), the tab bar (the small one) and on the logo tile (the splash, the map's head and download ring, the place
   pin, the PIN prompt). Its gradients take these tokens as stop colors: on the page the theme's variant (deeper in the
   light theme, for contrast on white, where the opening also gets a pink lip and the summit cross turns violet); on the
   tile, which is dark in both themes, always the bright one. */
:root,
.mt-logo-tile {
    --logo-violet: var(--brand-violet);
    --logo-pink: var(--brand-pink);
    --logo-orange: var(--brand-orange);
    /* The opening glows: light in its middle, warm at its edge. The stroke starts in a lighter orange, as if still hot. */
    --logo-glow: #FFF6EE;
    --logo-glow-edge: #FFB27A;
    --logo-spark: #FF9A55;
    --logo-cross: #F5F5F7;
    --logo-lip: transparent;
    /* The light paper band around the popper (white, this opaque). */
    --logo-band: 0.3;
}

:root[data-theme="light"] {
    --logo-violet: #6A47F5;
    --logo-pink: #E62D73;
    --logo-orange: #E0600F;
    --logo-glow: #FFEBDC;
    --logo-glow-edge: #FF9A52;
    --logo-spark: #E0600F;
    --logo-cross: #6A47F5;
    --logo-lip: #E62D73;
    --logo-band: 0.32;
}

:root {
    /* The tile (the app icon's, docs/brand/mark.svg): violet-black, a little lighter at the top, with a violet glow in
       its top left and a faint orange one in its bottom right corner, a fine light rim, in the icons' smooth-corner
       shape. CSS gradients and a mask: the tile is a box behind the mark, not part of its drawing. */
    --logo-tile: radial-gradient(62% 62% at 20% 8%, rgba(124, 92, 255, 0.34), rgba(124, 92, 255, 0)), radial-gradient(58% 58% at 94% 94%, rgba(255, 138, 61, 0.18), rgba(255, 138, 61, 0)), linear-gradient(161deg, #1D1A2B, #0E0D14);
    --logo-rim: linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.08));
    --logo-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M22 0H42C58.5 0 64 5.5 64 22V42C64 58.5 58.5 64 42 64H22C5.5 64 0 58.5 0 42V22C0 5.5 5.5 0 22 0Z'/%3E%3C/svg%3E");
}

/* The logo tile behind whatever the element holds (the mark, the PIN prompt's lock), the mark centered on it: the tile
   and its 1px rim are two pseudo-elements in the tile's shape below the content, so a part of the mark that moves is
   never clipped by the mask. The rim is the shape less the same shape 1px smaller all round, as the icons draw it. A
   logo: keeps its colors in high contrast mode. */
.mt-logo-tile {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    forced-color-adjust: none;
}

.mt-logo-tile::before,
.mt-logo-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.mt-logo-tile::before {
    background: var(--logo-tile);
    -webkit-mask: var(--logo-shape) center / 100% 100% no-repeat;
    mask: var(--logo-shape) center / 100% 100% no-repeat;
}

.mt-logo-tile::after {
    background: var(--logo-rim);
    -webkit-mask: var(--logo-shape) center / 100% 100% no-repeat, var(--logo-shape) center / calc(100% - 2px) calc(100% - 2px) no-repeat;
    -webkit-mask-composite: xor;
    mask: var(--logo-shape) center / 100% 100% no-repeat, var(--logo-shape) center / calc(100% - 2px) calc(100% - 2px) no-repeat;
    mask-composite: exclude;
}

/* The mark on the tile as on the app icon (docs/brand/mark.svg): 76% of the tile wide, centered. Not clipped to its box,
   so a part can pop out of it. */
.mt-logo-tile > svg {
    display: block;
    width: 76%;
    height: auto;
    overflow: visible;
}

/* The app icon at 88px, the full mark on the logo tile: it springs in with a twist, then beats. The span also carries a
   soft shadow that lifts the dark tile off the page (its radius only shapes that shadow, close to the icon's corner). */
.mt-splash__mark {
    display: grid;
    width: 88px;
    height: 88px;
    border-radius: var(--r-tile);
    box-shadow: 0 18px 40px -16px rgba(124, 92, 255, 0.65);
    animation: fz-splash-mark-in 820ms var(--ease-spring) 80ms backwards, fz-splash-beat 1.2s ease-in-out 1s infinite;
}

:root[data-theme="light"] .mt-splash__mark {
    box-shadow: 0 18px 36px -16px rgba(20, 19, 28, 0.55);
}

/* While the tile turns in, the popper rises from its tip, the stroke draws the ridge out of the opening, then the
   summit cross, the bang strokes and the square pop. */
.mt-splash__popper,
.mt-splash__pop {
    transform-box: fill-box;
    transform-origin: center;
}

.mt-splash__popper {
    transform-origin: 5% 96%;
    animation: fz-logo-popper 560ms var(--ease-spring-pop) 300ms backwards;
}

.mt-splash__stroke {
    stroke-dasharray: 1 2;
    animation: fz-logo-draw 640ms var(--ease-out) 560ms backwards;
}

.mt-splash__pop {
    animation: fz-pop-in 380ms var(--ease-spring-pop) calc(1040ms + var(--i) * 60ms) backwards;
}

/* A soft light sweeping over the tile now and then, clipped to its shape. */
.mt-splash__shine {
    position: absolute;
    inset: 0;
    -webkit-mask: var(--logo-shape) center / 100% 100% no-repeat;
    mask: var(--logo-shape) center / 100% 100% no-repeat;
    pointer-events: none;
}

.mt-splash__shine::before {
    content: "";
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: 0;
    width: 45%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
    transform: translateX(-160%) skewX(-18deg);
    animation: fz-splash-shine 2.8s cubic-bezier(0.4, 0, 0.2, 1) 1.1s infinite;
}

/* Clipped to its box, so the letters rise out of the baseline. */
.mt-splash__word {
    display: block;
    overflow: hidden;
    fill: var(--text);
}

.mt-splash__word path {
    transform-box: fill-box;
    animation: fz-splash-letter 640ms var(--ease-spring-soft) calc(460ms + var(--i) * 80ms) backwards;
}

/* The lines take turns in one grid cell: each rises in, stays and leaves upwards. */
.mt-splash__caption {
    display: grid;
    justify-items: center;
    margin-top: var(--s-3-5);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.mt-splash__caption > span {
    grid-area: 1 / 1;
    opacity: 0;
    animation: fz-splash-caption 6.4s var(--ease-out) calc(900ms + var(--i) * 1.6s) infinite;
}

/* The app cannot start (index.html): a browser too old for it (.NET's WebAssembly runtime needs Safari 16.4 or a current
   Chrome, Edge or Firefox), or the start failed. The logo stays, the busy indicators stop and a short notice replaces
   the line of party talk, centered below the logo. */
.mt-splash__notice {
    display: grid;
    justify-items: center;
    gap: 6px;
    max-width: 22rem;
    margin-top: 18px;
    padding-inline: var(--gutter);
    text-align: center;
    animation: fz-fade-up var(--dur-slow) var(--ease-out) both;
}

.mt-splash__notice[hidden] {
    display: none;
}

.mt-splash__notice-title {
    font-size: var(--text-md);
    font-weight: var(--fw-bold);
    letter-spacing: var(--tracking-snug);
    text-wrap: balance;
}

.mt-splash__notice-text {
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.mt-splash__notice-action {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 8px;
    padding: 0 var(--s-5);
    border-radius: var(--r-pill);
    background: var(--brand-gradient-strong);
    color: #FFFFFF;
    font-size: var(--text-base);
    font-weight: var(--fw-semibold);
}

.mt-splash {
    grid-template-rows: auto;
    align-content: center;
}

.mt-splash.mt-is-stuck .mt-splash__caption,
.mt-splash.mt-is-stuck .mt-splash__waves,
.mt-splash.mt-is-stuck .mt-splash__sparks,
.mt-splash.mt-is-stuck .mt-splash__shine {
    display: none;
}

.mt-splash.mt-is-stuck *,
.mt-splash.mt-is-stuck *::before,
.mt-splash.mt-is-stuck *::after {
    animation-iteration-count: 1;
}

/* Leaving: the stage zooms towards the viewer (accelerating, like flying through the icon) while the splash fades. */
.mt-splash.mt-is-leaving {
    pointer-events: none;
    animation: fz-fade-out 520ms var(--ease-out) 140ms forwards;
}

.mt-splash.mt-is-leaving .mt-splash__stage {
    animation: fz-splash-through 560ms var(--ease-in) forwards;
}

/* A warm start (the app was opened before and comes from the service worker's cache, see index.html): no intro to
   wait for, the splash only gets out of the way, quickly. The script removes it after the same time. */
.mt-splash.mt-is-leaving.mt-is-quick {
    animation: fz-fade-out var(--dur-exit) var(--ease-out) forwards;
}

.mt-splash.mt-is-leaving.mt-is-quick .mt-splash__stage {
    animation: fz-splash-through var(--dur-exit) var(--ease-in) forwards;
}

@keyframes fz-splash-grid {
    from { opacity: 0; transform: scale(1.15); }
    to { opacity: 1; transform: none; }
}

@keyframes fz-splash-wave {
    0% { opacity: 0.9; transform: scale(0.85); }
    100% { opacity: 0; transform: scale(1.9); }
}

@keyframes fz-splash-glow {
    0%, 40%, 100% { opacity: 0.6; transform: scale(0.94); }
    9% { opacity: 1; transform: scale(1.08); }
    18% { opacity: 0.7; transform: scale(0.98); }
    27% { opacity: 0.9; transform: scale(1.04); }
}

@keyframes fz-splash-mark-in {
    from { opacity: 0; transform: scale(0.35) rotate(-24deg); }
    to { opacity: 1; transform: none; }
}

/* Two kicks, then rest: "boom-boom". */
@keyframes fz-splash-beat {
    0%, 40%, 100% { transform: none; }
    9% { transform: scale(1.07); }
    18% { transform: none; }
    27% { transform: scale(1.04); }
}

/* The logo's popper rising from its tip (the splash and BrandLogo's intro). Played with a spring, so it settles with a
   little overshoot. */
@keyframes fz-logo-popper {
    from { opacity: 0; transform: scale(0.4) rotate(-18deg); }
    to { opacity: 1; transform: none; }
}

/* The logo's marker stroke drawing the ridge out of the opening: the stroke has a path length of 1 and the dash array
   "1 2", so at 1.05 it is all gap and at 0 all line (also when the animation is off). */
@keyframes fz-logo-draw {
    from { stroke-dashoffset: 1.05; }
    to { stroke-dashoffset: 0; }
}

@keyframes fz-splash-shine {
    0% { transform: translateX(-160%) skewX(-18deg); }
    32%, 100% { transform: translateX(330%) skewX(-18deg); }
}

@keyframes fz-splash-letter {
    from { transform: translateY(115%); }
    to { transform: none; }
}

@keyframes fz-splash-caption {
    0% { opacity: 0; transform: translate3d(0, 10px, 0); }
    5%, 21% { opacity: 1; transform: none; }
    25%, 100% { opacity: 0; transform: translate3d(0, -10px, 0); }
}

@keyframes fz-splash-through {
    to { opacity: 0; transform: scale(1.35); }
}

@keyframes fz-fade-out {
    to { opacity: 0; }
}

/* Reduced motion: the global rule below stops every animation at its end; the lines would all end hidden. */
@media (prefers-reduced-motion: reduce) {
    .mt-splash__caption > span {
        animation: none;
    }

    .mt-splash__caption > span:first-child {
        opacity: 1;
    }
}

/* High contrast mode: the logo stays, the decoration goes. */
@media (forced-colors: active) {
    .mt-aurora,
    .mt-splash__grid,
    .mt-splash__waves,
    .mt-splash__glow,
    .mt-splash__sparks,
    .mt-splash__shine {
        display: none;
    }
}

/* ---- Toast surface (ToastHost, the error bar, the update banner) --------- */
/* One recipe for the three notes that float over the page: the toasts (ToastHost), the error bar Blazor shows
   (#blazor-error-ui, index.html) and the update banner (#pwa-update, js/pwa.js). A solid dark "snackbar" in both themes
   (light text, 13:1 and more) with a hairline and the floating elevation; no backdrop blur, it is opaque anyway. Each
   is .mt-toast with a kind (--info, --success, --error): a tinted disc with its icon, the message (it wraps), an optional
   gradient action and the close button (.mt-close-button). Where they are: above the page's bottom bar or the tab bar
   (--toast-lift) and above an on-screen keyboard, centered, at most 440px wide; at the top while a sheet is open. */
:root {
    --toast-bg: #262632;
    --toast-fg: #F5F5F7;
    --toast-muted: #A9A9B8;
    --toast-border: rgba(255, 255, 255, 0.1);
    --toast-hover: rgba(255, 255, 255, 0.08);
    /* The kinds' icon colors and the tints of their discs (on the dark surface in both themes). */
    --toast-accent-info: #B9A9FF;
    --toast-tint-info: rgba(164, 147, 255, 0.16);
    --toast-accent-success: #4ADE9F;
    --toast-tint-success: rgba(74, 222, 159, 0.15);
    --toast-accent-error: #FF8A95;
    --toast-tint-error: rgba(255, 107, 120, 0.17);
}

:root[data-theme="light"] {
    --toast-bg: #1C1C26;
    --toast-border: rgba(255, 255, 255, 0.04);
}

.mt-toast {
    display: flex;
    align-items: center;
    gap: var(--s-2-5);
    width: fit-content;
    max-width: 100%;
    min-height: 52px;
    padding: var(--s-1) var(--s-1) var(--s-1) var(--s-2-5);
    border-radius: var(--r-lg);
    border: 1px solid var(--toast-border);
    background: var(--toast-bg);
    color: var(--toast-fg);
    box-shadow: var(--shadow-float);
    font-size: var(--text-base);
    font-weight: var(--fw-semibold);
    line-height: 1.35;
}

.mt-toast--info {
    --toast-accent: var(--toast-accent-info);
    --toast-tint: var(--toast-tint-info);
}

.mt-toast--success {
    --toast-accent: var(--toast-accent-success);
    --toast-tint: var(--toast-tint-success);
}

.mt-toast--error {
    --toast-accent: var(--toast-accent-error);
    --toast-tint: var(--toast-tint-error);
}

.mt-toast__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--toast-tint);
    color: var(--toast-accent);
}

.mt-toast__message {
    flex: 1;
    min-width: 0;
    padding: var(--s-1-5) 0;
    text-wrap: pretty;
}

/* The one action of a note ("Neu laden", "Aktualisieren"): a small gradient pill, 44px to tap. */
.mt-toast__action {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: none;
    min-height: 36px;
    padding: 0 var(--s-3-5);
    border-radius: var(--r-pill);
    background: var(--brand-gradient-strong);
    color: #FFFFFF;
    font-size: var(--text-sm);
    font-weight: var(--fw-bold);
    white-space: nowrap;
    transition: transform var(--press-out) var(--ease-spring-pop);
}

.mt-toast__action::before {
    content: "";
    position: absolute;
    inset: -4px 0;
}

.mt-toast__action:active:not(:disabled) {
    transform: scale(var(--press-wide));
    transition-duration: var(--press-in);
    transition-timing-function: var(--ease-out);
}

.mt-toast__action:disabled {
    opacity: 0.6;
}

/* On the toast surface the close button has no disc at rest, a faint one under the mouse. */
.mt-toast .mt-close-button {
    --close-disc: transparent;
    --close-disc-hover: var(--toast-hover);
    --close-fg: var(--toast-muted);
    --close-fg-hover: var(--toast-fg);
}

/* ---- Close button (sheets, toasts, the error bar, the update banner) ------ */
/* 44px to tap, a 32px disc to see (in the surface's tint: --close-disc), the "x" in the muted color; the focus ring hugs
   the disc. Pressing snaps it in and lets it spring back (press tokens, see "Motion"). */
.mt-close-button {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: var(--r-pill);
    color: var(--close-fg, var(--text-muted));
    transition: color var(--dur) var(--ease-out), transform var(--press-out) var(--ease-spring-pop);
}

.mt-close-button::before {
    content: "";
    position: absolute;
    inset: 6px;
    z-index: -1;
    border-radius: 50%;
    background: var(--close-disc, var(--surface-2));
    transition: background-color var(--dur) var(--ease-out);
}

@media (hover: hover) {
    .mt-close-button:hover {
        color: var(--close-fg-hover, var(--text));
    }

    .mt-close-button:hover::before {
        background: var(--close-disc-hover, var(--surface-3));
    }
}

.mt-close-button:active {
    transform: scale(var(--press-round));
    transition-duration: var(--press-in);
    transition-timing-function: var(--ease-out);
}

.mt-close-button:focus-visible {
    outline: none;
}

.mt-close-button:focus-visible::before {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* ---- Unhandled error bar (Blazor shows #blazor-error-ui) ----------------- */
/* Where the toasts are, above everything else (the error is about the whole app). Blazor shows the box itself
   (display: block); the toast inside is centered in it. */
#blazor-error-ui {
    display: none;
    position: fixed;
    left: max(12px, var(--safe-left));
    right: max(12px, var(--safe-right));
    bottom: calc(12px + var(--safe-bottom) + var(--toast-lift, 0px) + var(--keyboard-inset));
    z-index: var(--z-alert);
    max-width: 440px;
    margin: 0 auto;
    animation: fz-fade-up var(--dur-slow) var(--ease-out) backwards;
}

#blazor-error-ui > .mt-toast {
    margin-inline: auto;
}

.blazor-error-boundary {
    padding: var(--s-4) var(--s-5);
    border-radius: var(--r-lg);
    background: var(--danger-soft);
    color: var(--danger);
    font-weight: var(--fw-semibold);
}

.blazor-error-boundary::after {
    content: "Da ist was schiefgelaufen.";
}

/* ---- Service worker update banner (wwwroot/js/pwa.js) -------------------- */
/* A toast where the toasts land (the toasts move above it while it is there: js/pwa.js sets --update-banner-h, see
   ToastHost.razor.css), at the top while a sheet is open, so it never covers the app bar or a sheet's actions. It
   springs in once and stays until it is used or closed. Its words reach screen readers through a status line of its
   own (#pwa-update-status in index.html). */
#pwa-update {
    position: fixed;
    left: max(12px, var(--safe-left));
    right: max(12px, var(--safe-right));
    bottom: calc(12px + var(--safe-bottom) + var(--toast-lift, 0px) + var(--keyboard-inset));
    z-index: var(--z-banner);
    width: fit-content;
    max-width: 440px;
    margin-inline: auto;
    opacity: 0;
    translate: 0 16px;
    transition: opacity var(--dur-slow) var(--ease-out), translate var(--dur-sheet) var(--ease-spring-pop);
}

#pwa-update.mt-is-visible {
    opacity: 1;
    translate: none;
}

:root.mt-is-scroll-locked #pwa-update {
    top: calc(12px + var(--safe-top) + var(--keyboard-top));
    bottom: auto;
    translate: 0 -16px;
}

:root.mt-is-scroll-locked #pwa-update.mt-is-visible {
    translate: none;
}

/* Windows high contrast: the notes keep a visible edge. */
@media (forced-colors: active) {
    .mt-toast {
        border-color: CanvasText;
    }
}

/* ---- Effects budget (data-fx) -------------------------------------------- */
/* Low-end phones and data saver get the lite set: the inline script in index.html sets data-fx="lite" on <html>
   before this file loads (data saver, a 2G connection, 2 GB of memory or less, at most 4 cores with at most 4 GB, or
   prefers-reduced-data; or the device was slow to start the app last time, which the same script measures on starts
   from the cache; the localStorage key "fetzn.fx" overrides it with "lite" or "full"), else data-fx="full". A phone
   running low on battery (20% or less, not charging) switches to lite as well, as soon as the browser tells. Lite
   switches off decoration only, each part in the file that defines it with a :root[data-fx="lite"] rule: draw-ons,
   twinkles, drifts, floating glows, list staggers, sparks, the glint, rolling text, the image fade, the aurora's drift,
   the splash's loops around the logo, the logo's intro (splash, app bar). The motion that explains a state stays
   (sheets, toasts, press feedback, the FAB, the tab indicator, a page's entrance, the splash's beat and progress ring).
   animation: none always leaves the final, visible state. */

/* The aurora only fades in and then stands still, each light where its drift would start (a 2D transform: no
   layer of its own). No will-change: three screen-sized layers while the runtime starts are the cost saved here.
   Per light, so these rules outrank the lights' own and the PIN prompt's round count. */
:root[data-fx="lite"] .mt-aurora > span:nth-child(1),
:root[data-fx="lite"] .mt-aurora > span:nth-child(2),
:root[data-fx="lite"] .mt-aurora > span:nth-child(3) {
    will-change: auto;
    animation: fz-fade-in 1.4s var(--ease-out) backwards;
}

:root[data-fx="lite"] .mt-aurora > span:nth-child(1) {
    transform: translate(-28%, -22%);
}

:root[data-fx="lite"] .mt-aurora > span:nth-child(2) {
    transform: translate(24%, 20%) scale(1.1);
}

:root[data-fx="lite"] .mt-aurora > span:nth-child(3) {
    transform: translate(-4%, 34%) scale(0.8);
}

/* The splash's logo is simply there: its parts are SVG paths, which the main thread animates while it starts the
   runtime. The tile still springs in and beats and the ring fills (they say the app is loading); the loops around it
   (waves, sparks, the light sweep) go, the glow rests, and the first line of party talk stays (as with reduced motion):
   the weakest devices start the runtime slowest, and every loop competes with it for the few cores they have. */
:root[data-fx="lite"] .mt-splash__popper,
:root[data-fx="lite"] .mt-splash__stroke,
:root[data-fx="lite"] .mt-splash__pop,
:root[data-fx="lite"] .mt-splash__caption > span {
    animation: none;
}

:root[data-fx="lite"] .mt-splash__waves,
:root[data-fx="lite"] .mt-splash__sparks,
:root[data-fx="lite"] .mt-splash__shine {
    display: none;
}

:root[data-fx="lite"] .mt-splash__glow {
    animation: fz-fade-in 900ms var(--ease-out) 200ms backwards;
}

:root[data-fx="lite"] .mt-splash__caption > span:first-child {
    opacity: 1;
}

/* The doodles are simply there, wherever they are placed: no stroke-by-stroke draw-on (it repaints the doodle on every
   frame), no sway, no bob, no twinkle. This also rests the drinks' moving parts (their paths are drawn on as well). */
:root[data-fx="lite"] .mt-sketch--draw path,
:root[data-fx="lite"] .mt-sketch--float,
:root[data-fx="lite"] .mt-sketch--bob,
:root[data-fx="lite"] .mt-sketch--twinkle {
    animation: none;
}

/* Switching the theme changes the colors at once instead of gliding (setTheme in interop.js sets the class for two
   frames, in lite mode and on touch devices without view transitions): the glide repaints the whole page on every
   frame. With the class set, also the controls that would otherwise glide their own colors (buttons, chips, inputs)
   switch at once. The switch keeps its own animation. */
:root.mt-is-theme-instant,
:root.mt-is-theme-instant *:not(.mt-theme-switch, .mt-theme-switch *),
:root.mt-is-theme-instant *:not(.mt-theme-switch, .mt-theme-switch *)::before,
:root.mt-is-theme-instant *:not(.mt-theme-switch, .mt-theme-switch *)::after {
    transition-duration: 0s !important;
}

/* ---- Motion preferences -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Busy indicators are the exception: frozen, a spinner or a skeleton would look like the app hangs. They keep a
       slow breathe, opacity only, without any movement, until their content is there. */
    .mt-spinner,
    .mt-skeleton-group,
    .mt-loader__dot {
        animation-name: fz-breathe !important;
        animation-duration: 1.6s !important;
        animation-timing-function: ease-in-out !important;
        animation-iteration-count: infinite !important;
        animation-direction: alternate !important;
    }
}
