/* m3.css: the Django tier's design system (M3 / M3 Expressive, monochrome dark).

   THE SOURCE OF TRUTH for every token, the base element rules and every
   page-agnostic component (spec §1.1, §2, §3). Loaded second, after fonts.css
   and before app.css (the shell) and pages/*.css (one file per page).

   Rules this file keeps, and every file after it must keep too:
   - Colour is MONOCHROME (answer 1). Every selected state is the grey step
     #333537 (secondary-container); the one loud fill is ink #E3E3E3 (primary),
     #FFFFFF on hover. The blue #A8C7FA is NOT a role: it is --app-color-accent,
     for links, the focus ring, the text-field focus, unread counts, the undo
     bar's Undo and drop lines, and it never fills a shape. No tonal containers.
   - No literal colour, radius, duration, easing, z-index or type size outside
     a :root token block (test_design.py check 4).
   - ONE state-layer mechanism (§2.5): a component sets --_container (its
     resting fill) and --_state-color (its content colour), and the state rules
     set --_state; background-color is their color-mix. No filter, no opacity
     and no pseudo-element for hover or press.
   - Every forced gallery state is a [data-state] twin of the real pseudo-class
     (§6.2); the :hover half sits inside @media (hover: hover).
   - The 48px target is a UNIFORM transparent border (--_inset) with
     background-clip: padding-box; radius = visible radius + inset; the inline
     margins cancel it (§2.12). Never a one-axis border, never a hit-area
     pseudo-element.
   - Motion is allowlisted: every transition and animation sits in a
     @media (prefers-reduced-motion: no-preference) block right after its
     component (K36). The only exceptions are the scroll-driven fade longhands
     and `animation: m3-appear 0s <delay> forwards`.
   - Anything given a display also restates [hidden] (K42).
   - A morphing radius is a real px value (calc(var(--_h) / 2)), never 50% and
     never 9999px.
   - No text-transform: uppercase, no letter-spacing but 0. */


/* ═══════════════════════════════════════════════════════════════ TOKENS ══ */

/* The component-private state channel. Registered so it does NOT inherit: a
   hovered row must not hand its 8% layer to every icon button inside it (§2.5).
   --_fill, --_icon and --_opsz are the opposite (they reach the glyph inside a
   component) and stay unregistered. */
@property --_state       { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
@property --_container   { syntax: "<color>";      inherits: false; initial-value: transparent; }
@property --_state-color { syntax: "<color>";      inherits: false; initial-value: transparent; }

/* §2.1 Colour roles: M3 names, monochrome 1P values. */
:root {
  color-scheme: dark;

  /* Surfaces: the 1P GM3 dark ladder */
  --md-sys-color-surface: #131314;                    /* the content card, the reading ground */
  --md-sys-color-surface-dim: #131314;
  --md-sys-color-surface-bright: #37393B;
  --md-sys-color-surface-container-lowest: #0E0E0E;
  --md-sys-color-surface-container-low: #1B1B1B;      /* the list/detail reading region */
  --md-sys-color-surface-container: #1E1F20;          /* THE CANVAS: body, rail, band, phone nav bar; cards on the content */
  --md-sys-color-surface-container-high: #282A2C;     /* fields and search on the canvas, the assistant panel, the undo bar, the task card */
  --md-sys-color-surface-container-highest: #333537;  /* the filled text field, segmented-list items on a card */
  --md-sys-color-surface-variant: #444746;
  --md-sys-color-background: #131314;
  --md-sys-color-on-background: #E3E3E3;

  /* Content and lines */
  --md-sys-color-on-surface: #E3E3E3;                 /* ink */
  --md-sys-color-on-surface-variant: #C4C7C5;         /* supporting text, inactive icons */
  --md-sys-color-outline: #8E918F;                    /* important boundaries: radio/switch rings, the pane drag handle */
  --md-sys-color-outline-variant: #444746;            /* dividers, outlined buttons and chips, the card outline */
  --md-sys-color-scrim: #000000;
  --md-sys-color-shadow: #000000;

  /* Accent roles, MONOCHROME (answer 1; D1, D2) */
  --md-sys-color-primary: #E3E3E3;                    /* ink: THE one loud fill (filled button, switch track, progress) */
  --md-sys-color-on-primary: #131314;
  --md-sys-color-primary-container: #333537;          /* the FAB, the contained loading indicator */
  --md-sys-color-on-primary-container: #E3E3E3;
  --md-sys-color-secondary: #C4C7C5;
  --md-sys-color-on-secondary: #131314;
  --md-sys-color-secondary-container: #333537;        /* EVERY selected state: nav indicator, chip, segment, list row. Never a resting fill (D2) */
  --md-sys-color-on-secondary-container: #E3E3E3;
  --md-sys-color-tertiary: #C4C7C5;
  --md-sys-color-on-tertiary: #131314;
  --md-sys-color-tertiary-container: #333537;         /* the M3E menu's selected item */
  --md-sys-color-on-tertiary-container: #E3E3E3;

  /* Error: a TEXT accent here. No error container exists, so none can be filled */
  --md-sys-color-error: #F2B8B5;
  --md-sys-color-on-error: #601410;
}

/* §2.2 App extension tokens (colour). */
:root {
  --app-color-accent: #A8C7FA;              /* 1P primary80. ONLY: links, focus ring, text-field focus, unread count text, the undo bar's Undo, drop-target line */
  --app-color-primary-hover: #FFFFFF;       /* the filled (ink) button's hover step */
  --app-color-on-surface-low: #9A9B9C;      /* Gemini's own on-surface-low: timestamps, empty lines, captions */
  /* The QUIET 1px line on the card, a step below outline-variant: the
     calendar's hour, day and all-day lines and the board's column guides.
     They were drawn in the fixed top's tone; the tops took the card's own
     colour on 2026-10-02, so the lines keep that tone as a colour of their own. */
  --app-color-hairline: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 9%, var(--md-sys-color-surface));
  --app-color-error-wash: rgb(242 184 181 / 0.12);   /* behind .err: red at 12% */
  --app-color-positive: #6DD58C;            /* positive money / delta TEXT (1P tertiary80) */
  --app-color-now: #EA4335;                 /* reserved: the Dashboard now-line */
  --app-color-scrim: rgb(0 0 0 / 0.32);     /* M3's scrim: only a modal (the expanded rail, a dialog) uses it */

  /* Data: discrimination sets (K21). These fill shapes because they ARE data */
  --app-color-weather-temp: #FDD663;
  --app-color-weather-rain: #A8C7FA;
  --app-color-weather-wind: #9A9B9C;
  --app-color-stage-awake: #FF8BCB;
  --app-color-stage-rem: #78D9EC;
  --app-color-stage-light: #8AB4F8;
  --app-color-stage-deep: #C58AF9;
  --app-color-macro-protein: #8AB4F8;
  --app-color-macro-carbs: #81C995;
  --app-color-macro-fat: #FDD663;
  --app-color-effort-1: #444746;            /* i1 stays grey: LIGHT is ~23 h of his day */
  --app-color-effort-2: #FDD663;
  --app-color-effort-3: #FCAD70;
  --app-color-effort-4: #F28B82;
  /* A figure in a note (a ```scene block): the eight colours it may NAME. Each
     is TONE 80 of a Material 3 tonal palette at chroma 36 (HCT, computed with
     Google's material-color-utilities): the tone the dark scheme gives an
     accent role, and TonalSpot's chroma. Blue comes out as the 1P primary80
     and red as M3's dark `error`. They were the page hues (hsl 60/73), which
     ran from tone 65 to 84; he asked for Material Design 3 colours in his
     graphics (2026-10-05). The hue is the page hue's, but green's is the
     app's own green (--app-color-positive): Finance's mint sat 27° from cyan.
     ⚠️ ONE TONE: apps/core/test_design.py holds every one of these to L* 80. */
  --app-color-figure-red: #FFB3AC;
  --app-color-figure-orange: #FFB77B;
  --app-color-figure-yellow: #DFC56D;
  --app-color-figure-green: #98D5A4;
  --app-color-figure-cyan: #80D4D8;
  --app-color-figure-blue: #A6C8FF;
  --app-color-figure-purple: #D1BCFD;
  --app-color-figure-pink: #F6B2E0;

  /* The FAB's Google-gradient glow (§3.3): the monochrome scheme's one
     sanctioned polychrome mark. The glow RULES live in app.css; the colours
     are tokens, so they live here (app.css holds no colour tokens, §1.1). */
  --app-color-glow-1: #4285F4; --app-color-glow-2: #9B72CB; --app-color-glow-3: #D96570;
  --app-color-glow-4: #EA4335; --app-color-glow-5: #FBBC05; --app-color-glow-6: #34A853;
}

/* §2.4 Page hues (K17): hsl(h, 60%, 73%) written as hex, byte for byte the
   values the tier has always used. workspace.js builds "--h-" + page at run
   time. Used as ink and arcs only (Health's trend lines and routes, Knowledge's
   links); a hue never fills a control. ⚠️ AND NOTHING IN THE CHROME HAS A TONE
   OF ITS OWN ANY MORE (his call, 2026-10-02: "the top section / tab should NOT
   have a different color than the background of the page itself. It should
   look and feel seamless!"): the open tab is the card's colour, and a page's
   fixed top and a record's sticky head are the colour of the ground they stand
   on. No wash, neutral or hued, and no rim. */
:root {
  --h-mail: #E39891;
  --h-nutrition: #E3B591;
  --h-news: #E3CF91;
  --h-finance: #91E3C7;
  --h-exercise: #91DFE3;
  --h-contacts: #91C5E3;
  --h-body: #91B1E3;
  --h-calendar: #919FE3;
  --h-tasks: #9591E3;
  --h-knowledge: #AA91E3;
  --h-sleep: #BD91E3;
  --h-chat: #E391CB;
  --h-dashboard: var(--md-sys-color-on-surface-variant);   /* no hue (K18) */
}

/* §2.5 State layers (M3E values). */
:root {
  --md-sys-state-hover-state-layer-opacity: 8%;
  --md-sys-state-focus-state-layer-opacity: 10%;
  --md-sys-state-pressed-state-layer-opacity: 10%;
  --md-sys-state-dragged-state-layer-opacity: 16%;
  --md-sys-state-disabled-content-opacity: 38%;
  --md-sys-state-disabled-container-opacity: 10%;
}

/* §2.6 Elevation. Depth comes from tone first; shadows only on what floats
   (the pane card, the FAB, the assistant panel, the undo bar, the expanded
   rail, menus, the Calendar sheet, a dragged card). */
:root {
  --md-sys-elevation-level0: none;
  --md-sys-elevation-level1: 0 1px 2px rgb(0 0 0 / .30), 0 1px 3px 1px rgb(0 0 0 / .15);
  --md-sys-elevation-level2: 0 1px 2px rgb(0 0 0 / .30), 0 2px 6px 2px rgb(0 0 0 / .15);
  --md-sys-elevation-level3: 0 1px 3px rgb(0 0 0 / .30), 0 4px 8px 3px rgb(0 0 0 / .15);
  --md-sys-elevation-level4: 0 2px 3px rgb(0 0 0 / .30), 0 6px 10px 4px rgb(0 0 0 / .15);
  --md-sys-elevation-level5: 0 4px 4px rgb(0 0 0 / .30), 0 8px 12px 6px rgb(0 0 0 / .15);
  --app-elevation-level3-up: 0 -1px 3px rgb(0 0 0 / .30), 0 -4px 8px 3px rgb(0 0 0 / .15);  /* the pinned undo bar */
  --app-elevation-none: 0 0 0 0 transparent;   /* a shadow-list placeholder: level0 is `none`, which cannot join a list */
  /* The two shadow colours of the formula above, for the components that
     carry the 48px transparent inset: an outer shadow is cast from the BORDER
     box, so those components rebuild levels 1-2 with the spread reduced by
     their inset (the shadow then hugs the visible shape, not the target). */
  --app-shadow-key: rgb(0 0 0 / .30);
  --app-shadow-ambient: rgb(0 0 0 / .15);
}

/* §2.7 Shape. A morphing radius is always a real px value: calc(var(--_h) / 2)
   for "full". Never 50% (an ellipse on a non-square box) and never 9999px (it
   looks frozen for 99.8% of the transition, then snaps). */
:root {
  --md-sys-shape-corner-none: 0px;
  --md-sys-shape-corner-extra-small: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-large-increased: 20px;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-shape-corner-extra-large-increased: 32px;
  --md-sys-shape-corner-extra-extra-large: 48px;
  --md-sys-shape-corner-full: 9999px;   /* STATIC USE ONLY. Never transition to or from it */
  --app-shape-corner-mark: 2px;         /* the 2px parts §3 names: a 4px bar's ends, the sheet handle, the checkbox, the slider handle */
}

/* §2.8 Typography. Google Sans Flex (opsz automatic, wght, ROND), Roboto as
   the per-glyph fallback for Cyrillic and Greek. Emphasized = the heavier
   weight plus ROND 100 (the 1P variable context). Tracking is 0 for every
   role: the face is variable and optically sized. */
:root {
  --md-ref-typeface-brand: "Google Sans Flex", "Roboto", system-ui, sans-serif;
  --md-ref-typeface-plain: "Google Sans Flex", "Roboto", system-ui, sans-serif;
  --app-typeface-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --app-typeface-icon: "Material Symbols Rounded";
  --md-ref-typeface-weight-regular: 400;
  --md-ref-typeface-weight-medium: 500;
  --md-ref-typeface-weight-semibold: 600;
  --md-ref-typeface-weight-bold: 700;      /* exactly one user: Mail's unread mark (K53) */

  /* role:            size / line-height / weight / emphasized weight */
  --md-sys-typescale-display-large-size: 57px;   --md-sys-typescale-display-large-line-height: 64px;   --md-sys-typescale-display-large-weight: 400;   --md-sys-typescale-emphasized-display-large-weight: 500;
  --md-sys-typescale-display-medium-size: 45px;  --md-sys-typescale-display-medium-line-height: 52px;  --md-sys-typescale-display-medium-weight: 400;  --md-sys-typescale-emphasized-display-medium-weight: 500;
  --md-sys-typescale-display-small-size: 36px;   --md-sys-typescale-display-small-line-height: 44px;   --md-sys-typescale-display-small-weight: 400;   --md-sys-typescale-emphasized-display-small-weight: 500;
  --md-sys-typescale-headline-large-size: 32px;  --md-sys-typescale-headline-large-line-height: 40px;  --md-sys-typescale-headline-large-weight: 400;  --md-sys-typescale-emphasized-headline-large-weight: 500;
  --md-sys-typescale-headline-medium-size: 28px; --md-sys-typescale-headline-medium-line-height: 36px; --md-sys-typescale-headline-medium-weight: 400; --md-sys-typescale-emphasized-headline-medium-weight: 500;
  --md-sys-typescale-headline-small-size: 24px;  --md-sys-typescale-headline-small-line-height: 32px;  --md-sys-typescale-headline-small-weight: 400;  --md-sys-typescale-emphasized-headline-small-weight: 500;
  --md-sys-typescale-title-large-size: 22px;     --md-sys-typescale-title-large-line-height: 28px;     --md-sys-typescale-title-large-weight: 400;     --md-sys-typescale-emphasized-title-large-weight: 500;
  --md-sys-typescale-title-medium-size: 16px;    --md-sys-typescale-title-medium-line-height: 24px;    --md-sys-typescale-title-medium-weight: 500;    --md-sys-typescale-emphasized-title-medium-weight: 600;
  --md-sys-typescale-title-small-size: 14px;     --md-sys-typescale-title-small-line-height: 20px;     --md-sys-typescale-title-small-weight: 500;     --md-sys-typescale-emphasized-title-small-weight: 600;
  --md-sys-typescale-body-large-size: 16px;      --md-sys-typescale-body-large-line-height: 24px;      --md-sys-typescale-body-large-weight: 400;      --md-sys-typescale-emphasized-body-large-weight: 500;
  --md-sys-typescale-body-medium-size: 14px;     --md-sys-typescale-body-medium-line-height: 20px;     --md-sys-typescale-body-medium-weight: 400;     --md-sys-typescale-emphasized-body-medium-weight: 500;
  --md-sys-typescale-body-small-size: 12px;      --md-sys-typescale-body-small-line-height: 16px;      --md-sys-typescale-body-small-weight: 400;      --md-sys-typescale-emphasized-body-small-weight: 500;
  --md-sys-typescale-label-large-size: 14px;     --md-sys-typescale-label-large-line-height: 20px;     --md-sys-typescale-label-large-weight: 500;     --md-sys-typescale-emphasized-label-large-weight: 600;
  --md-sys-typescale-label-medium-size: 12px;    --md-sys-typescale-label-medium-line-height: 16px;    --md-sys-typescale-label-medium-weight: 500;    --md-sys-typescale-emphasized-label-medium-weight: 600;
  --md-sys-typescale-label-small-size: 11px;     --md-sys-typescale-label-small-line-height: 16px;     --md-sys-typescale-label-small-weight: 500;     --md-sys-typescale-emphasized-label-small-weight: 600;

  --md-sys-typescale-emphasized-rond: 100;       /* 1P: every emphasized style sets ROND 100 */
  --app-typescale-mono-size: 12.5px;             /* DM's documented off-scale mono tier, kept (a mono face reads a size larger) */
  --app-typescale-mono-line-height: 20px;
}

/* §2.9 Icons: Material Symbols Rounded (FILL 0..1, opsz 20..48; wght pinned).
   A component sets --_icon (a length) and --_opsz (the same number, unitless,
   clamped to 20..48). FILL is a STATE mark: rest 0, selected/active 1 (K35). */
:root {
  --app-icon-size-small: 18px;    /* inside a chip */
  --app-icon-size-medium: 20px;   /* expressive list items, XS/S buttons, menus, tabs */
  --app-icon-size-large: 24px;    /* the M3 standard: icon buttons S/M, nav, fields, search, FAB */
  --app-icon-size-xl: 32px;       /* L buttons */
  --app-icon-size-2xl: 36px;      /* a glyph that is a picture on a card */
  --app-icon-size-3xl: 40px;      /* XL buttons, the empty-pane mark */
}

/* §2.10 Motion. Springs are CSS linear() curves sampled from the M3 spring
   equation (max error 0.1%), cut at the 0.1% settle: Appendix A, verbatim.
   STANDARD is the default scheme (D7). EXPRESSIVE is read ONLY by the noticed
   moments: the rail indicator, labelled toggle / connected group / filter chip
   selection, the assistant panel, the undo bar's rise, pane B entering, and
   the loading indicator (which has its own spring). Which pair for what:
   colour, opacity, shadow, FILL -> fast-effects; a press morph and an icon
   toggle's selection -> default-effects; a labelled selection morph, a list
   item's shape, the switch handle, the radio dot, a field label -> fast-spatial;
   a part-screen surface's size or position -> default-spatial; exits ->
   fast-effects on opacity. */
:root {
  /* STANDARD scheme */
  --md-sys-motion-spring-fast-spatial: linear(0, 0.0014 0.65%, 0.0056 1.3%, 0.0127 2%, 0.0224 2.7%, 0.0352 3.45%, 0.0502 4.2%, 0.0684 5%, 0.0911 5.9%, 0.1301 7.3%, 0.1787 8.9%, 0.3938 15.5%, 0.4927 18.7%, 0.5417 20.4%, 0.5878 22.1%, 0.6296 23.75%, 0.6685 25.4%, 0.7034 27%, 0.7364 28.65%, 0.7667 30.3%, 0.7942 31.95%, 0.8198 33.65%, 0.8436 35.4%, 0.8653 37.2%, 0.885 39.05%, 0.9045 41.15%, 0.9217 43.3%, 0.9368 45.55%, 0.95 47.9%, 0.9615 50.4%, 0.9713 53.05%, 0.9794 55.85%, 0.9862 58.9%, 0.9951 65.4%, 0.9999 73.4%, 1.0015 85.7%, 1);
  --md-sys-motion-spring-fast-spatial-duration: 224ms;
  --md-sys-motion-spring-default-spatial: linear(0, 0.0014 0.65%, 0.0056 1.3%, 0.0127 2%, 0.0224 2.7%, 0.0352 3.45%, 0.0503 4.2%, 0.0685 5%, 0.0912 5.9%, 0.1302 7.3%, 0.1789 8.9%, 0.3941 15.5%, 0.4931 18.7%, 0.5421 20.4%, 0.5882 22.1%, 0.63 23.75%, 0.6689 25.4%, 0.7037 27%, 0.7368 28.65%, 0.767 30.3%, 0.7945 31.95%, 0.8202 33.65%, 0.8439 35.4%, 0.8656 37.2%, 0.8853 39.05%, 0.9048 41.15%, 0.9219 43.3%, 0.937 45.55%, 0.9502 47.9%, 0.9617 50.4%, 0.9714 53.05%, 0.9795 55.85%, 0.9862 58.9%, 0.9951 65.35%, 0.9999 73.4%, 1.0015 85.7%, 1);
  --md-sys-motion-spring-default-spatial-duration: 317ms;
  --md-sys-motion-spring-slow-spatial: linear(0, 0.0014 0.65%, 0.0056 1.3%, 0.0127 2%, 0.0224 2.7%, 0.0352 3.45%, 0.0502 4.2%, 0.0684 5%, 0.0911 5.9%, 0.1301 7.3%, 0.1788 8.9%, 0.3939 15.5%, 0.4928 18.7%, 0.5418 20.4%, 0.5879 22.1%, 0.6298 23.75%, 0.6686 25.4%, 0.7035 27%, 0.7365 28.65%, 0.7668 30.3%, 0.7943 31.95%, 0.8199 33.65%, 0.8437 35.4%, 0.8654 37.2%, 0.8851 39.05%, 0.9046 41.15%, 0.9217 43.3%, 0.9369 45.55%, 0.9501 47.9%, 0.9616 50.4%, 0.9714 53.05%, 0.9795 55.85%, 0.9862 58.9%, 0.9951 65.35%, 0.9999 73.4%, 1.0015 85.7%, 1);
  --md-sys-motion-spring-slow-spatial-duration: 484ms;
  --md-sys-motion-spring-fast-effects: linear(0, 0.0013 0.55%, 0.0048 1.1%, 0.0111 1.7%, 0.0197 2.3%, 0.0311 2.95%, 0.0445 3.6%, 0.0817 5.1%, 0.1162 6.3%, 0.16 7.7%, 0.3647 13.8%, 0.4164 15.4%, 0.4629 16.9%, 0.5115 18.55%, 0.557 20.2%, 0.5982 21.8%, 0.6376 23.45%, 0.6739 25.1%, 0.7072 26.75%, 0.7385 28.45%, 0.7668 30.15%, 0.7932 31.9%, 0.8175 33.7%, 0.8398 35.55%, 0.8606 37.5%, 0.8811 39.7%, 0.8991 41.95%, 0.9155 44.35%, 0.9299 46.85%, 0.9426 49.5%, 0.9537 52.3%, 0.9632 55.3%, 0.9714 58.55%, 0.9834 65.45%, 0.9915 73.75%, 0.996 83.15%, 1);
  --md-sys-motion-spring-fast-effects-duration: 150ms;
  --md-sys-motion-spring-default-effects: linear(0, 0.0012 0.55%, 0.0048 1.1%, 0.0111 1.7%, 0.0196 2.3%, 0.031 2.95%, 0.0445 3.6%, 0.0816 5.1%, 0.116 6.3%, 0.1598 7.7%, 0.3643 13.8%, 0.4161 15.4%, 0.4626 16.9%, 0.5111 18.55%, 0.5566 20.2%, 0.5979 21.8%, 0.6373 23.45%, 0.6736 25.1%, 0.7068 26.75%, 0.7381 28.45%, 0.7665 30.15%, 0.7929 31.9%, 0.8172 33.7%, 0.8395 35.55%, 0.8604 37.5%, 0.8809 39.7%, 0.8989 41.95%, 0.9153 44.35%, 0.9298 46.85%, 0.9425 49.5%, 0.9535 52.3%, 0.9631 55.3%, 0.9713 58.55%, 0.9833 65.45%, 0.9914 73.75%, 0.996 83.15%, 1);
  --md-sys-motion-spring-default-effects-duration: 231ms;
  --md-sys-motion-spring-slow-effects: linear(0, 0.0013 0.55%, 0.0048 1.1%, 0.0111 1.7%, 0.0197 2.3%, 0.0311 2.95%, 0.0445 3.6%, 0.0817 5.1%, 0.1162 6.3%, 0.16 7.7%, 0.3648 13.8%, 0.4165 15.4%, 0.4631 16.9%, 0.5116 18.55%, 0.5572 20.2%, 0.5984 21.8%, 0.6378 23.45%, 0.6741 25.1%, 0.7073 26.75%, 0.7386 28.45%, 0.767 30.15%, 0.7933 31.9%, 0.8176 33.7%, 0.8399 35.55%, 0.8607 37.5%, 0.8812 39.7%, 0.8992 41.95%, 0.9156 44.35%, 0.93 46.85%, 0.9427 49.5%, 0.9537 52.3%, 0.9633 55.3%, 0.9715 58.55%, 0.9834 65.45%, 0.9915 73.75%, 0.996 83.15%, 1);
  --md-sys-motion-spring-slow-effects-duration: 327ms;

  /* EXPRESSIVE scheme: ONLY the noticed moments read these. (The expressive
     effects springs are identical to the standard ones: use those tokens.) */
  --md-sys-motion-expressive-fast-spatial: linear(0, 0.0018 0.6%, 0.0077 1.25%, 0.0173 1.9%, 0.0314 2.6%, 0.0491 3.3%, 0.07 4%, 0.0955 4.75%, 0.1257 5.55%, 0.1805 6.85%, 0.25 8.35%, 0.3213 9.8%, 0.5279 13.9%, 0.5909 15.2%, 0.6467 16.4%, 0.7041 17.7%, 0.7579 19%, 0.8058 20.25%, 0.8499 21.5%, 0.89 22.75%, 0.9247 23.95%, 0.9557 25.15%, 0.9841 26.4%, 1.0088 27.65%, 1.0298 28.9%, 1.0481 30.2%, 1.0633 31.55%, 1.0788 33.4%, 1.0888 35.3%, 1.094 37.35%, 1.0943 39.55%, 1.09 41.9%, 1.081 44.6%, 1.0362 54.35%, 1.0188 58.7%, 1.0064 62.8%, 0.9979 67%, 0.9925 72.05%, 0.991 77.85%, 1);
  --md-sys-motion-expressive-fast-spatial-duration: 360ms;
  --md-sys-motion-expressive-default-spatial: linear(0, 0.0015 0.65%, 0.0062 1.35%, 0.0138 2.05%, 0.0248 2.8%, 0.0386 3.55%, 0.0558 4.35%, 0.0767 5.2%, 0.0998 6.05%, 0.1435 7.5%, 0.1979 9.15%, 0.4302 15.7%, 0.4851 17.3%, 0.5346 18.8%, 0.5864 20.45%, 0.6336 22.05%, 0.6776 23.65%, 0.7172 25.2%, 0.7525 26.7%, 0.786 28.25%, 0.8164 29.8%, 0.8448 31.4%, 0.8702 33%, 0.8935 34.65%, 0.9145 36.35%, 0.9328 38.05%, 0.9494 39.85%, 0.9642 41.75%, 0.9767 43.7%, 0.9873 45.75%, 0.9961 47.9%, 1.0031 50.2%, 1.0121 55.25%, 1.0149 59.55%, 1.0147 64.8%, 1.0052 84.55%, 1);
  --md-sys-motion-expressive-default-spatial-duration: 435ms;
  --md-sys-motion-expressive-slow-spatial: linear(0, 0.0015 0.65%, 0.0062 1.35%, 0.0138 2.05%, 0.0248 2.8%, 0.0386 3.55%, 0.0559 4.35%, 0.0768 5.2%, 0.0999 6.05%, 0.1436 7.5%, 0.1981 9.15%, 0.4306 15.7%, 0.4855 17.3%, 0.535 18.8%, 0.5868 20.45%, 0.634 22.05%, 0.6781 23.65%, 0.7176 25.2%, 0.7529 26.7%, 0.7864 28.25%, 0.8168 29.8%, 0.8452 31.4%, 0.8705 33%, 0.8931 34.6%, 0.9142 36.3%, 0.9325 38%, 0.9492 39.8%, 0.964 41.7%, 0.9766 43.65%, 0.9872 45.7%, 0.996 47.85%, 1.0031 50.15%, 1.0121 55.2%, 1.0149 59.5%, 1.0147 64.75%, 1.0052 84.55%, 1);
  --md-sys-motion-expressive-slow-spatial-duration: 600ms;

  /* Legacy easing + duration: transitions of whole surfaces */
  --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-easing-standard-decelerate: cubic-bezier(0, 0, 0, 1);
  --md-sys-motion-easing-standard-accelerate: cubic-bezier(0.3, 0, 1, 1);
  --md-sys-motion-easing-emphasized: linear(0, 0.0021 1.625%, 0.0082 3.2%, 0.0185 4.75%, 0.0327 6.225%, 0.0506 7.625%, 0.0723 8.95%, 0.098 10.2%, 0.1269 11.35%, 0.158 12.375%, 0.1927 13.325%, 0.2298 14.175%, 0.2704 14.95%, 0.3079 15.55%, 0.3486 16.1%, 0.3789 16.45%, 0.4402 17.075%, 0.4768 17.475%, 0.5121 17.9%, 0.5452 18.35%, 0.5772 18.85%, 0.6074 19.4%, 0.6357 20%, 0.661 20.625%, 0.6901 21.475%, 0.7174 22.425%, 0.7421 23.45%, 0.7655 24.6%, 0.7876 25.875%, 0.8078 27.25%, 0.827 28.775%, 0.8448 30.425%, 0.8649 32.625%, 0.8833 35.05%, 0.9002 37.725%, 0.9155 40.625%, 0.9295 43.8%, 0.9421 47.25%, 0.9533 50.975%, 0.9633 55%, 0.9795 64.025%, 0.9909 74.425%, 0.9977 86.375%, 1);
  --md-sys-motion-easing-emphasized-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
  --md-sys-motion-easing-emphasized-accelerate: cubic-bezier(0.3, 0, 0.8, 0.15);
  --md-sys-motion-duration-short2: 100ms;
  --md-sys-motion-duration-short4: 200ms;
  --md-sys-motion-duration-medium1: 250ms;
  --md-sys-motion-duration-medium2: 300ms;
  --md-sys-motion-duration-medium4: 400ms;
  --md-sys-motion-duration-long2: 500ms;
  --app-motion-thinking: 1300ms;            /* the model wait's bob loop (§4.9) */
  --app-motion-progress: 1750ms;            /* the linear indeterminate loop (Compose, §3.20) */
  --app-motion-wave: 1000ms;                /* the wavy bar's phase: one wavelength per second (§3.20) */
  --app-motion-loading-morph: 4550ms;       /* the loading indicator: 7 morphs x 650ms (§3.19) */
  --app-motion-loading-step: 2600ms;        /* 4 x (650ms, +90deg) */
  --app-motion-loading-spin: 4666ms;        /* +360deg, linear */
  --app-motion-fab-spin: 4500ms;            /* the FAB glow's turn (§3.3) */
}
/* Where linear() is missing, cubic-bezier approximations (overshoot kept). */
@supports not (transition-timing-function: linear(0, 1)) {
  :root {
    --md-sys-motion-spring-fast-spatial: cubic-bezier(0.27, 1.06, 0.18, 1.00);      --md-sys-motion-spring-fast-spatial-duration: 350ms;
    --md-sys-motion-spring-default-spatial: cubic-bezier(0.27, 1.06, 0.18, 1.00);   --md-sys-motion-spring-default-spatial-duration: 500ms;
    --md-sys-motion-spring-slow-spatial: cubic-bezier(0.27, 1.06, 0.18, 1.00);      --md-sys-motion-spring-slow-spatial-duration: 750ms;
    --md-sys-motion-spring-fast-effects: cubic-bezier(0.31, 0.94, 0.34, 1.00);      --md-sys-motion-spring-fast-effects-duration: 150ms;
    --md-sys-motion-spring-default-effects: cubic-bezier(0.34, 0.80, 0.34, 1.00);   --md-sys-motion-spring-default-effects-duration: 200ms;
    --md-sys-motion-spring-slow-effects: cubic-bezier(0.34, 0.88, 0.34, 1.00);      --md-sys-motion-spring-slow-effects-duration: 300ms;
    --md-sys-motion-expressive-fast-spatial: cubic-bezier(0.42, 1.67, 0.21, 0.90);  --md-sys-motion-expressive-fast-spatial-duration: 350ms;
    --md-sys-motion-expressive-default-spatial: cubic-bezier(0.38, 1.21, 0.22, 1.00); --md-sys-motion-expressive-default-spatial-duration: 500ms;
    --md-sys-motion-expressive-slow-spatial: cubic-bezier(0.39, 1.29, 0.35, 0.98);  --md-sys-motion-expressive-slow-spatial-duration: 650ms;
    --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
  }
}

/* §2.11 Z-index ladder. In-component stacking stays as single-digit literals
   (1-9): they are local and mean nothing outside their box. */
:root {
  --app-z-menu: 20;        /* a menu anchored in the page */
  --app-z-drawer: 30;      /* reserved */
  --app-z-assistant: 40;   /* the FAB and its panel */
  --app-z-float: 60;       /* the phone app bar's account button, the Calendar sheet, band dropdowns */
  --app-z-float-2: 70;     /* a picker raised over a floating sheet */
  --app-z-progress: 90;    /* .navbusy */
  --app-z-snackbar: 95;    /* #undo: it reports, so anything that asks may cover it */
  --app-z-scrim: 100;      /* the expanded rail AND its scrim. The ceiling */
}

/* §2.12 Spacing and component sizes (full M3, answer 3). */
:root {
  /* M3 spacing scale (space100 = 8px) */
  --md-sys-spacing-0: 0px;  --md-sys-spacing-25: 2px;  --md-sys-spacing-50: 4px;  --md-sys-spacing-75: 6px;
  --md-sys-spacing-100: 8px; --md-sys-spacing-125: 10px; --md-sys-spacing-150: 12px; --md-sys-spacing-175: 14px;
  --md-sys-spacing-200: 16px; --md-sys-spacing-250: 20px; --md-sys-spacing-300: 24px; --md-sys-spacing-400: 32px;
  --md-sys-spacing-450: 36px; --md-sys-spacing-500: 40px; --md-sys-spacing-600: 48px; --md-sys-spacing-700: 56px;
  --md-sys-spacing-800: 64px; --md-sys-spacing-900: 72px;

  /* Targets and components */
  --app-target: 48px;                 /* the minimum interactive box */
  --app-btn-h-xs: 32px;  --app-btn-h-s: 40px;  --app-btn-h-m: 56px;  --app-btn-h-l: 96px;  --app-btn-h-xl: 136px;
  --app-field-h: 56px;
  --app-search-h: 56px;
  --app-chip-h: 32px;
  --app-list-h-1: 56px;  --app-list-h-2: 72px;  --app-list-h-3: 88px;
  --app-fab: 80px;                    /* the medium FAB at >=721px; 56px at <=720px (C13) */
  --app-badge-h: 16px;   --app-badge-dot: 6px;
  --app-loading: 48px;   --app-loading-inline: 32px;
  --app-progress-h: 4px; --app-progress-wavy-h: 10px;

  /* The frame (§4.1) */
  --app-rail-w: 96px;
  --app-rail-w-expanded: 256px;
  --app-rail-item-h: 56px;      /* M3E's short item (D17) */
  --app-tab-radius: 12px;       /* the tab family's corner: DM's tab 10 scaled by 48/36 (C4). NOT a snap */
  --app-band-h: 64px;
  --app-tab-w: 240px;  --app-tab-h: 48px;  --app-tab-open-h: 56px;  --app-tab-top: 8px;
  --app-navbar-h: 64px;
  --app-frame: 24px;            /* right and bottom margin around the panes at >=721px */
  --app-spacer: 24px;           /* between workspace panes, and between list and detail */
  --app-viewpad: 16px;          /* one card padding, every page, every width (K28) */
  --app-list-w: 360px;          /* 840-1199px; 412px at >=1200px; 280px inside a split pane (§4.7) */
  --app-navbar-offset: 0px;     /* the phone nav bar's share of the bottom edge; set at <=720px */
  --app-fabclear: 96px;         /* scroller end-reserve under the FAB: FAB + 16; 72px at <=720px */
  --app-focus-ring: 3px solid var(--app-color-accent);
  --app-focus-offset: 2px;      /* the ring sits 2px OUTSIDE the visible shape */
  --app-focus-offset-inner: -3px;   /* drawn inside: tabs, list items, fields, anything in a clipping parent */
  --app-form-max: 720px;        /* forms are capped at this measure (§3.7) */
}
@media (max-width: 720px) {
  :root {
    --app-navbar-offset: calc(var(--app-navbar-h) + env(safe-area-inset-bottom, 0px));
    --app-fab: 56px;
    --app-fabclear: 72px;
  }
}

/* §2.13 Breakpoints. A custom property cannot be used in a media query, so
   these are literals, hand-synced (the SAME string) with workspace.js and
   navbar.js:
     (max-width: 720px)                         compact: phone shell (nav bar, app bar, no tabs)
     (max-width: 839px)                         single pane: reading mode (list OR record)
     (min-width: 721px) and (max-width: 839px)  medium
     (min-width: 840px)                         expanded: list + detail, split allowed
     (min-width: 1200px)                        large: list 412px, docked Calendar sheet
     (min-width: 1600px)                        extra-large
   kblive/host.js's phone() stays at 720 by decision.
   (hover: none), (pointer: coarse) reveals every hover-only control (K14, K16). */

/* §2.8 Typography utility classes: one per role plus its emphasized form (30).
   Generated mechanically (f12/gen-type.mjs). For TEMPLATES only, where §5 names
   them; component CSS reads the tokens directly. */
.type-display-large {
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-display-large-size);
  line-height: var(--md-sys-typescale-display-large-line-height);
  font-weight: var(--md-sys-typescale-display-large-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" 0;
}
.type-display-large-em {
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-display-large-size);
  line-height: var(--md-sys-typescale-display-large-line-height);
  font-weight: var(--md-sys-typescale-emphasized-display-large-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}
.type-display-medium {
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-display-medium-size);
  line-height: var(--md-sys-typescale-display-medium-line-height);
  font-weight: var(--md-sys-typescale-display-medium-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" 0;
}
.type-display-medium-em {
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-display-medium-size);
  line-height: var(--md-sys-typescale-display-medium-line-height);
  font-weight: var(--md-sys-typescale-emphasized-display-medium-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}
.type-display-small {
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-display-small-size);
  line-height: var(--md-sys-typescale-display-small-line-height);
  font-weight: var(--md-sys-typescale-display-small-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" 0;
}
.type-display-small-em {
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-display-small-size);
  line-height: var(--md-sys-typescale-display-small-line-height);
  font-weight: var(--md-sys-typescale-emphasized-display-small-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}
.type-headline-large {
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-headline-large-size);
  line-height: var(--md-sys-typescale-headline-large-line-height);
  font-weight: var(--md-sys-typescale-headline-large-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" 0;
}
.type-headline-large-em {
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-headline-large-size);
  line-height: var(--md-sys-typescale-headline-large-line-height);
  font-weight: var(--md-sys-typescale-emphasized-headline-large-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}
.type-headline-medium {
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-headline-medium-size);
  line-height: var(--md-sys-typescale-headline-medium-line-height);
  font-weight: var(--md-sys-typescale-headline-medium-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" 0;
}
.type-headline-medium-em {
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-headline-medium-size);
  line-height: var(--md-sys-typescale-headline-medium-line-height);
  font-weight: var(--md-sys-typescale-emphasized-headline-medium-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}
.type-headline-small {
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-headline-small-size);
  line-height: var(--md-sys-typescale-headline-small-line-height);
  font-weight: var(--md-sys-typescale-headline-small-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" 0;
}
.type-headline-small-em {
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-headline-small-size);
  line-height: var(--md-sys-typescale-headline-small-line-height);
  font-weight: var(--md-sys-typescale-emphasized-headline-small-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}
.type-title-large {
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-title-large-size);
  line-height: var(--md-sys-typescale-title-large-line-height);
  font-weight: var(--md-sys-typescale-title-large-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" 0;
}
.type-title-large-em {
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-title-large-size);
  line-height: var(--md-sys-typescale-title-large-line-height);
  font-weight: var(--md-sys-typescale-emphasized-title-large-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}
.type-title-medium {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-title-medium-size);
  line-height: var(--md-sys-typescale-title-medium-line-height);
  font-weight: var(--md-sys-typescale-title-medium-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" 0;
}
.type-title-medium-em {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-title-medium-size);
  line-height: var(--md-sys-typescale-title-medium-line-height);
  font-weight: var(--md-sys-typescale-emphasized-title-medium-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}
.type-title-small {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-title-small-size);
  line-height: var(--md-sys-typescale-title-small-line-height);
  font-weight: var(--md-sys-typescale-title-small-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" 0;
}
.type-title-small-em {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-title-small-size);
  line-height: var(--md-sys-typescale-title-small-line-height);
  font-weight: var(--md-sys-typescale-emphasized-title-small-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}
.type-body-large {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
  font-weight: var(--md-sys-typescale-body-large-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" 0;
}
.type-body-large-em {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
  font-weight: var(--md-sys-typescale-emphasized-body-large-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}
.type-body-medium {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
  font-weight: var(--md-sys-typescale-body-medium-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" 0;
}
.type-body-medium-em {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
  font-weight: var(--md-sys-typescale-emphasized-body-medium-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}
.type-body-small {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line-height);
  font-weight: var(--md-sys-typescale-body-small-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" 0;
}
.type-body-small-em {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line-height);
  font-weight: var(--md-sys-typescale-emphasized-body-small-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}
.type-label-large {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-label-large-size);
  line-height: var(--md-sys-typescale-label-large-line-height);
  font-weight: var(--md-sys-typescale-label-large-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" 0;
}
.type-label-large-em {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-label-large-size);
  line-height: var(--md-sys-typescale-label-large-line-height);
  font-weight: var(--md-sys-typescale-emphasized-label-large-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}
.type-label-medium {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  font-weight: var(--md-sys-typescale-label-medium-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" 0;
}
.type-label-medium-em {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  font-weight: var(--md-sys-typescale-emphasized-label-medium-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}
.type-label-small {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
  font-weight: var(--md-sys-typescale-label-small-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" 0;
}
.type-label-small-em {
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
  font-weight: var(--md-sys-typescale-emphasized-label-small-weight);
  letter-spacing: 0;
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}


/* ═══════════════════════════════════════════════════════════ BASE RULES ══ */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
  font-weight: var(--md-ref-typeface-weight-regular);
  color: var(--md-sys-color-on-surface);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }

/* Links weigh nothing (:where), so every component that can be an <a> sets
   its own colour and text-decoration and wins. A text link is accent blue and
   underlines on hover only; a text BUTTON never underlines (K39). */
:where(a) { color: var(--app-color-accent); text-decoration: none; text-underline-offset: 2px; }
:where(a:hover) { text-decoration: underline; }

code, kbd, pre, samp {
  font-family: var(--app-typeface-mono);
  font-size: var(--app-typescale-mono-size);
  line-height: var(--app-typescale-mono-line-height);
}
p code, li code { font-size: 0.9em; }        /* inline code follows its sentence (DM) */
.num, time, .tabular { font-variant-numeric: tabular-nums; }
::selection { background: color-mix(in srgb, var(--md-sys-color-on-surface) 24%, transparent); }   /* neutral: a hue never fills a shape */
strong, b { font-weight: var(--md-ref-typeface-weight-semibold); }   /* strong is 600; 700 is reserved for a state (K53) */

/* A label whose weight changes with selection (chips, connected-group
   segments): <span class="m3-label" data-label="Inbox">Inbox</span>. The
   hidden ::after carries the emphasized width, so selecting never reflows the
   row (D18). visibility: hidden keeps the copy out of the a11y tree. */
.m3-label { display: inline-flex; flex-direction: column; align-items: center; }   /* the lighter text centred in the reserved width */
.m3-label[hidden] { display: none; }
.m3-label::after {
  content: attr(data-label); height: 0; overflow: hidden; visibility: hidden; pointer-events: none; user-select: none;
  font-weight: var(--_label-em, var(--md-sys-typescale-emphasized-label-large-weight));
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}

/* §2.9 The glyph. Every glyph element sets its COMPLETE variation list, so a
   component's ROND never reaches the icon font (font-variation-settings
   inherits and replaces the whole list). */
.ico {
  font-family: var(--app-typeface-icon);
  font-weight: normal; font-style: normal;
  font-size: var(--_icon, var(--app-icon-size-large));
  line-height: 1;
  letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" var(--_fill, 0), "opsz" var(--_opsz, 24);
  user-select: none;
  flex: none;
}
.ico[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .ico {
    transition: font-variation-settings var(--md-sys-motion-spring-fast-effects-duration) var(--md-sys-motion-spring-fast-effects);
  }
}

/* §2.14 The focus indicator: 3px accent at a 2px outer offset (the ring
   follows border-radius). Exactly one ring on screen. A text field marks
   focus with its active indicator instead (§3.7). Components with the 48px
   inset move the ring to calc(2px - inset), so it is 2px outside the VISIBLE
   shape at every size. */
:focus-visible { outline: var(--app-focus-ring); outline-offset: var(--app-focus-offset); }
:focus:not(:focus-visible) { outline: none; }
[data-state="focus"] { outline: var(--app-focus-ring); }   /* the gallery's forced focus (§6.2); each component's own offset applies */

/* Visually hidden, still read. (.head:not(.head--shown) takes these rules in app.css.) */
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* The shared component reset: the glyph channel restarts in every
   interactive component, so a selected row fills its OWN leading icon but
   never the icon buttons inside it (§2.5). Listed once, here. */
:is(.m3-btn, .btn, .m3-icon-btn, .m3-chip, .m3-list-item, .m3-card, .m3-menu__item, .m3-search,
    .m3-textfield, .fieldgrid__row) { --_fill: 0; }


/* ═══════════════════════════════════════════════════════════ COMPONENTS ══ */

/* ── §3.1 Buttons: .m3-btn ─────────────────────────────────────────────────
   <button class="m3-btn m3-btn--<variant> [m3-btn--<size>] [m3-btn--square]">
   Default size S (40 visual, 48 box); default variant OUTLINED (the settled
   default, DM L2589). The one loud action is filled ink. Legacy aliases ride
   the same selector lists: .btn = outlined S, .btn--primary = filled,
   .btn--quiet = text, .btn--small = S, .btn--danger = text + error ink.
   Private knobs: --_h visual height, --_inset the 48px target border, --_pad,
   --_gap, --_r the VISIBLE radius (round / square / pressed / selected), --_ow
   outline width, --_label, --_oc outline colour, --_elev outer shadow. */
.m3-btn, .btn {
  --_h: var(--app-btn-h-s);
  --_inset: 4px;
  --_pad: 16px;
  --_gap: 8px;
  --_r-round: calc(var(--_h) / 2);
  --_r-sq: var(--md-sys-shape-corner-medium);
  --_r-press: var(--md-sys-shape-corner-small);
  --_r: var(--_r-round);
  --_ow: 1px;
  --_icon: var(--app-icon-size-medium);
  --_opsz: 20;
  --_fs: var(--md-sys-typescale-label-large-size);
  --_lh: var(--md-sys-typescale-label-large-line-height);
  --_fw: var(--md-sys-typescale-label-large-weight);
  --_fw-em: var(--md-sys-typescale-emphasized-label-large-weight);
  --_weight: var(--_fw);
  --_rond: 0;
  --_container: transparent;
  --_label: var(--md-sys-color-on-surface-variant);
  --_state-color: var(--_label);
  --_oc: var(--md-sys-color-outline-variant);
  --_elev: var(--app-elevation-none);
  /* levels 1-2, cast from the visible shape rather than the 48px box */
  --_elev-1: 0 1px 2px calc(0px - var(--_inset)) var(--app-shadow-key), 0 1px 3px calc(1px - var(--_inset)) var(--app-shadow-ambient);
  --_elev-2: 0 1px 2px calc(0px - var(--_inset)) var(--app-shadow-key), 0 2px 6px calc(2px - var(--_inset)) var(--app-shadow-ambient);

  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--_gap);
  height: calc(var(--_h) + 2 * var(--_inset));
  min-width: var(--app-target);
  margin-block: 0;
  margin-inline: calc(-1 * var(--_inset));
  padding: 0 var(--_pad);
  border: var(--_inset) solid transparent;
  background-clip: padding-box;
  border-radius: calc(var(--_r) + var(--_inset));
  background-color: color-mix(in srgb, var(--_state-color) var(--_state), var(--_container));
  box-shadow: var(--_elev), inset 0 0 0 var(--_ow) var(--_oc);
  color: var(--_label);
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--_fs);
  line-height: var(--_lh);
  font-weight: var(--_weight);
  font-variation-settings: "ROND" var(--_rond);
  letter-spacing: 0;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline-offset: calc(var(--app-focus-offset) - var(--_inset));
}
:is(.m3-btn, .btn)[hidden] { display: none; }
:is(.m3-btn, .btn):hover { text-decoration: none; }

/* Sizes (S is the base; .btn--small is S: nothing smaller, answer 3) */
.m3-btn--xs {
  --_h: var(--app-btn-h-xs); --_inset: 8px; --_pad: 12px;
  --_r-sq: var(--md-sys-shape-corner-medium); --_r-press: var(--md-sys-shape-corner-small);
}
.m3-btn--m {
  --_h: var(--app-btn-h-m); --_inset: 0px; --_pad: 24px; --_gap: 8px;
  --_r-sq: var(--md-sys-shape-corner-large); --_r-press: var(--md-sys-shape-corner-medium);
  --_icon: var(--app-icon-size-large); --_opsz: 24;
  --_fs: var(--md-sys-typescale-title-medium-size); --_lh: var(--md-sys-typescale-title-medium-line-height);
  --_fw: var(--md-sys-typescale-title-medium-weight); --_fw-em: var(--md-sys-typescale-emphasized-title-medium-weight);
}
.m3-btn--l {
  --_h: var(--app-btn-h-l); --_inset: 0px; --_pad: 48px; --_gap: 12px; --_ow: 2px;
  --_r-sq: var(--md-sys-shape-corner-extra-large); --_r-press: var(--md-sys-shape-corner-large);
  --_icon: var(--app-icon-size-xl); --_opsz: 32;
  --_fs: var(--md-sys-typescale-headline-small-size); --_lh: var(--md-sys-typescale-headline-small-line-height);
  --_fw: var(--md-sys-typescale-headline-small-weight); --_fw-em: var(--md-sys-typescale-emphasized-headline-small-weight);
  font-family: var(--md-ref-typeface-brand);
}
.m3-btn--xl {
  --_h: var(--app-btn-h-xl); --_inset: 0px; --_pad: 64px; --_gap: 16px; --_ow: 3px;
  --_r-sq: var(--md-sys-shape-corner-extra-large); --_r-press: var(--md-sys-shape-corner-large);
  --_icon: var(--app-icon-size-3xl); --_opsz: 40;
  --_fs: var(--md-sys-typescale-headline-large-size); --_lh: var(--md-sys-typescale-headline-large-line-height);
  --_fw: var(--md-sys-typescale-headline-large-weight); --_fw-em: var(--md-sys-typescale-emphasized-headline-large-weight);
  font-family: var(--md-ref-typeface-brand);
}
.m3-btn--square { --_r: var(--_r-sq); }

/* Variants (monochrome). The label colour is the state-layer colour. */
.m3-btn--filled, .btn--primary {
  --_container: var(--md-sys-color-primary);
  --_label: var(--md-sys-color-on-primary);
  --_oc: transparent;
  --_weight: var(--_fw-em);                         /* the one loud action: emphasized label */
  --_rond: var(--md-sys-typescale-emphasized-rond);
}
.m3-btn--tonal {                                    /* gallery only; #282A2C, never the selected #333537 (D2) */
  --_container: var(--md-sys-color-surface-container-high);
  --_label: var(--md-sys-color-on-surface);
  --_oc: transparent;
}
.m3-btn--text, .btn--quiet, .btn--danger {
  --_label: var(--md-sys-color-primary);
  --_oc: transparent;
}
.m3-btn--elevated {
  --_container: var(--md-sys-color-surface-container-low);
  --_label: var(--md-sys-color-primary);
  --_oc: transparent;
  --_elev: var(--_elev-1);
}
.m3-btn--error, .btn--danger { --_label: var(--md-sys-color-error); }

/* Toggles ([aria-pressed]). Unselected filled rests one rung above the canvas
   (#282A2C); SELECTED is the grey step whatever the variant (answer 1), with
   the emphasized label (width reserved by .m3-label) and a filled icon. The
   shape swaps: round -> the size's square value, square -> round. */
:is(.m3-btn--filled, .btn--primary)[aria-pressed] {
  --_container: var(--md-sys-color-surface-container-high);
  --_label: var(--md-sys-color-on-surface-variant);
  --_weight: var(--_fw);
  --_rond: 0;
}
:is(.m3-btn, .btn)[aria-pressed="true"] {
  --_container: var(--md-sys-color-secondary-container);
  --_label: var(--md-sys-color-on-secondary-container);
  --_oc: transparent;
  --_elev: var(--app-elevation-none);
  --_weight: var(--_fw-em);
  --_rond: var(--md-sys-typescale-emphasized-rond);
  --_label-em: var(--_fw-em);
  --_fill: 1;
  --_r: var(--_r-sq);
}
:is(.m3-btn, .btn).m3-btn--square[aria-pressed="true"] { --_r: var(--_r-round); }

/* States (§2.5, §6.2). Pressed always wins the shape. */
:is(.m3-btn, .btn)[data-state="hover"] { --_state: var(--md-sys-state-hover-state-layer-opacity); }
@media (hover: hover) {
  :is(.m3-btn, .btn):hover { --_state: var(--md-sys-state-hover-state-layer-opacity); }
}
:is(.m3-btn, .btn):is(:focus-visible, [data-state="focus"]) { --_state: var(--md-sys-state-focus-state-layer-opacity); }
:is(.m3-btn, .btn):is(:active, [data-state="pressed"]):not(:disabled, [aria-disabled="true"]) {
  --_state: var(--md-sys-state-pressed-state-layer-opacity);
  --_r: var(--_r-press);
}
/* The filled (ink) button steps to #FFFFFF instead of taking a layer. */
:is(.m3-btn--filled, .btn--primary):not([aria-pressed], :disabled, [aria-disabled="true"]):is([data-state="hover"], [data-state="pressed"], :active) {
  --_container: var(--app-color-primary-hover); --_state: 0%;
}
:is(.m3-btn--filled, .btn--primary):not([aria-pressed], :disabled, [aria-disabled="true"])[data-state="hover"] { --_elev: var(--_elev-1); }
.m3-btn--elevated:not(:disabled, [aria-disabled="true"])[data-state="hover"] { --_elev: var(--_elev-2); }
@media (hover: hover) {
  :is(.m3-btn--filled, .btn--primary):not([aria-pressed], :disabled, [aria-disabled="true"]):hover {
    --_container: var(--app-color-primary-hover); --_state: 0%; --_elev: var(--_elev-1);
  }
  .m3-btn--elevated:not(:disabled, [aria-disabled="true"]):hover { --_elev: var(--_elev-2); }
}

/* Disabled: never reacts; cursor default, never not-allowed (K41). */
:is(.m3-btn, .btn):is(:disabled, [aria-disabled="true"]) {
  --_state: 0%;
  --_label: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 38%, transparent);
  --_oc: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);
  --_elev: var(--app-elevation-none);
  cursor: default;
}
:is(.m3-btn--filled, .btn--primary, .m3-btn--tonal, .m3-btn--elevated):is(:disabled, [aria-disabled="true"]) {
  --_container: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);
  --_oc: transparent;
}
:is(.m3-btn--text, .btn--quiet, .btn--danger):is(:disabled, [aria-disabled="true"]) { --_oc: transparent; }

/* Motion: the press morph on default-effects (no bounce); a labelled
   toggle's selection morph on EXPRESSIVE fast-spatial (a noticed moment);
   colour and shadow on fast-effects; padding (the group squish, §3.5) on
   fast-spatial. No scale on press. */
@media (prefers-reduced-motion: no-preference) {
  .m3-btn, .btn {
    transition-property: border-radius, background-color, color, box-shadow, padding-inline-start, padding-inline-end;
    transition-duration:
      var(--md-sys-motion-spring-default-effects-duration), var(--md-sys-motion-spring-fast-effects-duration),
      var(--md-sys-motion-spring-fast-effects-duration), var(--md-sys-motion-spring-fast-effects-duration),
      var(--md-sys-motion-spring-fast-spatial-duration), var(--md-sys-motion-spring-fast-spatial-duration);
    transition-timing-function:
      var(--md-sys-motion-spring-default-effects), var(--md-sys-motion-spring-fast-effects),
      var(--md-sys-motion-spring-fast-effects), var(--md-sys-motion-spring-fast-effects),
      var(--md-sys-motion-spring-fast-spatial), var(--md-sys-motion-spring-fast-spatial);
  }
  :is(.m3-btn, .btn)[aria-pressed] {
    transition-duration:
      var(--md-sys-motion-expressive-fast-spatial-duration), var(--md-sys-motion-spring-fast-effects-duration),
      var(--md-sys-motion-spring-fast-effects-duration), var(--md-sys-motion-spring-fast-effects-duration),
      var(--md-sys-motion-spring-fast-spatial-duration), var(--md-sys-motion-spring-fast-spatial-duration);
    transition-timing-function:
      var(--md-sys-motion-expressive-fast-spatial), var(--md-sys-motion-spring-fast-effects),
      var(--md-sys-motion-spring-fast-effects), var(--md-sys-motion-spring-fast-effects),
      var(--md-sys-motion-spring-fast-spatial), var(--md-sys-motion-spring-fast-spatial);
  }
}

/* ── §3.2 Icon buttons: .m3-icon-btn ───────────────────────────────────────
   <button class="m3-icon-btn [--filled|--tonal|--outlined] [--xs|--m|--l|--xl]
   [--narrow|--wide] [--square]" aria-label="…" title="…"><span class="ico">…</span>
   Every icon-only action. Default S: 40 visual in a 48 box. Rests at FILL 0;
   FILL 1 marks only a selected toggle (K35). The tier's own icon-button
   classes (.band__split, .tab__close, .msgact, .kb__tool, …) take these rules
   in their owners' files, or the templates add .m3-icon-btn (§5). */
.m3-icon-btn {
  --_h: var(--app-btn-h-s);
  --_w: var(--app-btn-h-s);
  --_inset: 4px;
  --_r-round: calc(var(--_h) / 2);
  --_r-sq: var(--md-sys-shape-corner-medium);
  --_r-press: var(--md-sys-shape-corner-small);
  --_r: var(--_r-round);
  --_ow: 1px;
  --_icon: var(--app-icon-size-large);
  --_opsz: 24;
  --_container: transparent;
  --_label: var(--md-sys-color-on-surface-variant);
  --_state-color: var(--_label);
  --_oc: transparent;

  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: calc(var(--_w) + 2 * var(--_inset));
  height: calc(var(--_h) + 2 * var(--_inset));
  margin-block: 0;
  margin-inline: calc(-1 * var(--_inset));
  padding: 0;
  border: var(--_inset) solid transparent;
  background-clip: padding-box;
  border-radius: calc(var(--_r) + var(--_inset));
  background-color: color-mix(in srgb, var(--_state-color) var(--_state), var(--_container));
  box-shadow: inset 0 0 0 var(--_ow) var(--_oc);
  color: var(--_label);
  font: inherit;
  line-height: 1;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline-offset: calc(var(--app-focus-offset) - var(--_inset));
}
.m3-icon-btn[hidden] { display: none; }
.m3-icon-btn:hover { text-decoration: none; }

/* Sizes. The inset is UNIFORM: max((48 - w) / 2, (48 - h) / 2, 0) (§2.12). */
.m3-icon-btn--xs {
  --_h: var(--app-btn-h-xs); --_w: var(--app-btn-h-xs); --_inset: 8px;
  --_icon: var(--app-icon-size-medium); --_opsz: 20;
}
.m3-icon-btn--m {
  --_h: var(--app-btn-h-m); --_w: var(--app-btn-h-m); --_inset: 0px;
  --_r-sq: var(--md-sys-shape-corner-large); --_r-press: var(--md-sys-shape-corner-medium);
}
.m3-icon-btn--l {
  --_h: var(--app-btn-h-l); --_w: var(--app-btn-h-l); --_inset: 0px; --_ow: 2px;
  --_r-sq: var(--md-sys-shape-corner-extra-large); --_r-press: var(--md-sys-shape-corner-large);
  --_icon: var(--app-icon-size-xl); --_opsz: 32;
}
.m3-icon-btn--xl {
  --_h: var(--app-btn-h-xl); --_w: var(--app-btn-h-xl); --_inset: 0px; --_ow: 3px;
  --_r-sq: var(--md-sys-shape-corner-extra-large); --_r-press: var(--md-sys-shape-corner-large);
  --_icon: var(--app-icon-size-3xl); --_opsz: 40;
}
/* Widths: narrow / wide, per size */
.m3-icon-btn--narrow { --_w: 32px; --_inset: 8px; }
.m3-icon-btn--wide { --_w: 52px; --_inset: 4px; }
.m3-icon-btn--xs.m3-icon-btn--narrow { --_w: 28px; --_inset: 10px; }
.m3-icon-btn--xs.m3-icon-btn--wide { --_w: 40px; --_inset: 8px; }
.m3-icon-btn--m.m3-icon-btn--narrow { --_w: 48px; --_inset: 0px; }
.m3-icon-btn--m.m3-icon-btn--wide { --_w: 72px; --_inset: 0px; }
.m3-icon-btn--l.m3-icon-btn--narrow { --_w: 64px; --_inset: 0px; }
.m3-icon-btn--l.m3-icon-btn--wide { --_w: 128px; --_inset: 0px; }
.m3-icon-btn--xl.m3-icon-btn--narrow { --_w: 104px; --_inset: 0px; }
.m3-icon-btn--xl.m3-icon-btn--wide { --_w: 184px; --_inset: 0px; }
.m3-icon-btn--square { --_r: var(--_r-sq); }

/* Styles */
.m3-icon-btn--filled { --_container: var(--md-sys-color-primary); --_label: var(--md-sys-color-on-primary); }
.m3-icon-btn--tonal { --_container: var(--md-sys-color-surface-container-high); --_label: var(--md-sys-color-on-surface); }
.m3-icon-btn--outlined { --_oc: var(--md-sys-color-outline-variant); }

/* Toggles. Standard selected: two properties change (ink + FILL 1). Filled and
   tonal rest at #282A2C; every selected container is the grey step #333537;
   an outlined toggle loses its outline when selected. */
.m3-icon-btn[aria-pressed="true"] {
  --_label: var(--md-sys-color-on-surface);
  --_fill: 1;
  --_r: var(--_r-sq);
}
.m3-icon-btn--square[aria-pressed="true"] { --_r: var(--_r-round); }
:is(.m3-icon-btn--filled, .m3-icon-btn--tonal)[aria-pressed] {
  --_container: var(--md-sys-color-surface-container-high);
  --_label: var(--md-sys-color-on-surface-variant);
}
.m3-icon-btn:is(.m3-icon-btn--filled, .m3-icon-btn--tonal, .m3-icon-btn--outlined)[aria-pressed="true"] {
  --_container: var(--md-sys-color-secondary-container);
  --_label: var(--md-sys-color-on-secondary-container);
  --_oc: transparent;
}

/* States: the icon colour at 8 / 10 / 10%. */
.m3-icon-btn[data-state="hover"] { --_state: var(--md-sys-state-hover-state-layer-opacity); }
@media (hover: hover) {
  .m3-icon-btn:hover { --_state: var(--md-sys-state-hover-state-layer-opacity); }
}
.m3-icon-btn:is(:focus-visible, [data-state="focus"]) { --_state: var(--md-sys-state-focus-state-layer-opacity); }
.m3-icon-btn:is(:active, [data-state="pressed"]):not(:disabled, [aria-disabled="true"]) {
  --_state: var(--md-sys-state-pressed-state-layer-opacity);
  --_r: var(--_r-press);
}
.m3-icon-btn--filled:not([aria-pressed], :disabled, [aria-disabled="true"]):is([data-state="hover"], [data-state="pressed"], :active) {
  --_container: var(--app-color-primary-hover); --_state: 0%;
}
@media (hover: hover) {
  .m3-icon-btn--filled:not([aria-pressed], :disabled, [aria-disabled="true"]):hover {
    --_container: var(--app-color-primary-hover); --_state: 0%;
  }
}
.m3-icon-btn:is(:disabled, [aria-disabled="true"]) {
  --_state: 0%;
  --_label: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
  cursor: default;
}
.m3-icon-btn:is(.m3-icon-btn--filled, .m3-icon-btn--tonal):is(:disabled, [aria-disabled="true"]) {
  --_container: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);
}
.m3-icon-btn--outlined:is(:disabled, [aria-disabled="true"]) {
  --_oc: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);
}

/* Motion: the radius on default-effects for the press AND for a toggle's
   selection (Compose: "intentional here to prevent any bounce"); colour on
   fast-effects; FILL rides .ico's own transition. */
@media (prefers-reduced-motion: no-preference) {
  .m3-icon-btn {
    transition-property: border-radius, background-color, color, box-shadow;
    transition-duration:
      var(--md-sys-motion-spring-default-effects-duration), var(--md-sys-motion-spring-fast-effects-duration),
      var(--md-sys-motion-spring-fast-effects-duration), var(--md-sys-motion-spring-fast-effects-duration);
    transition-timing-function:
      var(--md-sys-motion-spring-default-effects), var(--md-sys-motion-spring-fast-effects),
      var(--md-sys-motion-spring-fast-effects), var(--md-sys-motion-spring-fast-effects);
  }
}

/* ── §3.5 Button groups: .m3-btn-group ─────────────────────────────────────
   Standard group: an action row with the M3E neighbour squish (the pressed
   button widens by ~15% and takes it from its neighbours' padding, so the
   group's width does not change). Visible gaps XS 18, S 12, M/L/XL 8 (the
   48px inset is cancelled by the buttons' own margins). */
.m3-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.m3-btn-group[hidden] { display: none; }
.m3-btn-group--xs { gap: 18px; }
.m3-btn-group--m, .m3-btn-group--l, .m3-btn-group--xl { gap: 8px; }

/* Connected group (.m3-btn-group--connected): the M3E replacement for the
   segmented button, a SINGLE-SELECT view switcher. role="group" +
   aria-label on the group; aria-pressed on each child, never aria-checked.
   Unselected #282A2C (one rung above the canvas, one below selected);
   selected the grey step with the emphasized label (in .m3-label) and FILL 1.
   Outer corners full; inner 8 at rest, 4 pressed; the selected child goes
   full on all four corners. */
.m3-btn-group--connected { display: inline-flex; gap: 2px; }
.m3-btn-group--connected > :is(.m3-btn, .btn) {
  --_container: var(--md-sys-color-surface-container-high);
  --_label: var(--md-sys-color-on-surface-variant);
  --_oc: transparent;
  --_elev: var(--app-elevation-none);
  --_weight: var(--_fw);
  --_rond: 0;
  --_pad: 16px;
  --_ri: var(--md-sys-shape-corner-small);
  --_ri-press: var(--md-sys-shape-corner-extra-small);
  --_rs: var(--_ri);
  --_re: var(--_ri);
  border-start-start-radius: calc(var(--_rs) + var(--_inset));
  border-end-start-radius: calc(var(--_rs) + var(--_inset));
  border-start-end-radius: calc(var(--_re) + var(--_inset));
  border-end-end-radius: calc(var(--_re) + var(--_inset));
}
.m3-btn-group--connected.m3-btn-group--xs > :is(.m3-btn, .btn) {
  --_h: var(--app-btn-h-xs); --_inset: 8px; --_pad: 12px;
  --_ri: var(--md-sys-shape-corner-extra-small);
}
.m3-btn-group--connected > :first-child { --_rs: var(--_r-round); }
.m3-btn-group--connected > :last-child { --_re: var(--_r-round); }
.m3-btn-group--connected > :is(.m3-btn, .btn):is(:active, [data-state="pressed"]) { --_ri: var(--_ri-press); }
.m3-btn-group--connected > [aria-pressed="true"] {
  --_container: var(--md-sys-color-secondary-container);
  --_label: var(--md-sys-color-on-secondary-container);
  --_weight: var(--_fw-em);
  --_rond: var(--md-sys-typescale-emphasized-rond);
  --_fill: 1;
  --_rs: var(--_r-round);
  --_re: var(--_r-round);
}
.m3-btn-group--connected > :is(:disabled, [aria-disabled="true"]) {
  --_container: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);
}

/* The squish. Everything is inside no-preference: under reduced motion a
   width that jumps is worse than no squish. A middle item grows G/2 on each
   side and each neighbour gives G/2; an edge item grows G on its inner side
   and its one neighbour gives all of it. G never exceeds a neighbour's
   padding (the M3E compression limit). Not ported: Compose's 75% release hold. */
@media (prefers-reduced-motion: no-preference) {
  .m3-btn-group { --_grow: 12px; }                     /* S: ~15% of an 80px button */
  .m3-btn-group--xs { --_grow: 8px; }
  .m3-btn-group--m, .m3-btn-group--l, .m3-btn-group--xl { --_grow: 16px; }
  .m3-btn-group > :is(.m3-btn, .btn):active { padding-inline: calc(var(--_pad) + var(--_grow) / 2); }
  .m3-btn-group > :is(.m3-btn, .btn):has(+ :is(.m3-btn, .btn):active) { padding-inline-end: calc(var(--_pad) - var(--_grow) / 2); }
  .m3-btn-group > :is(.m3-btn, .btn):active + :is(.m3-btn, .btn) { padding-inline-start: calc(var(--_pad) - var(--_grow) / 2); }
  .m3-btn-group > :is(.m3-btn, .btn):first-child:active { padding-inline: var(--_pad) calc(var(--_pad) + var(--_grow)); }
  .m3-btn-group > :is(.m3-btn, .btn):last-child:active { padding-inline: calc(var(--_pad) + var(--_grow)) var(--_pad); }
  .m3-btn-group > :is(.m3-btn, .btn):first-child:active + :is(.m3-btn, .btn) { padding-inline-start: calc(var(--_pad) - var(--_grow)); }
  .m3-btn-group > :is(.m3-btn, .btn):has(+ :is(.m3-btn, .btn):last-child:active) { padding-inline-end: calc(var(--_pad) - var(--_grow)); }

  /* Connected: the selection's inner corners and the squish on EXPRESSIVE
     fast-spatial (a noticed moment); the press itself on default-effects. */
  .m3-btn-group--connected > :is(.m3-btn, .btn) {
    transition-property: border-radius, background-color, color, padding-inline-start, padding-inline-end;
    transition-duration:
      var(--md-sys-motion-expressive-fast-spatial-duration), var(--md-sys-motion-spring-fast-effects-duration),
      var(--md-sys-motion-spring-fast-effects-duration), var(--md-sys-motion-expressive-fast-spatial-duration),
      var(--md-sys-motion-expressive-fast-spatial-duration);
    transition-timing-function:
      var(--md-sys-motion-expressive-fast-spatial), var(--md-sys-motion-spring-fast-effects),
      var(--md-sys-motion-spring-fast-effects), var(--md-sys-motion-expressive-fast-spatial),
      var(--md-sys-motion-expressive-fast-spatial);
  }
  .m3-btn-group--connected > :is(.m3-btn, .btn):active {
    transition-duration:
      var(--md-sys-motion-spring-default-effects-duration), var(--md-sys-motion-spring-fast-effects-duration),
      var(--md-sys-motion-spring-fast-effects-duration), var(--md-sys-motion-expressive-fast-spatial-duration),
      var(--md-sys-motion-expressive-fast-spatial-duration);
    transition-timing-function:
      var(--md-sys-motion-spring-default-effects), var(--md-sys-motion-spring-fast-effects),
      var(--md-sys-motion-spring-fast-effects), var(--md-sys-motion-expressive-fast-spatial),
      var(--md-sys-motion-expressive-fast-spatial);
  }
}

/* ── §3.6 Chips: .m3-chip ──────────────────────────────────────────────────
   <button class="m3-chip m3-chip--assist|--filter|--input" [aria-pressed]>
   [<span class="ico">…</span>]Label[<span class="ico m3-chip__trail">…</span>]
   or <span class="m3-chip m3-chip--label"> for a non-interactive label.
   32 visual in a 48 box. The M3E chip shape set: 12 at rest, 8 pressed, a
   selected filter goes full (16). */
.m3-chip {
  --_h: var(--app-chip-h);
  --_inset: 8px;
  --_r: var(--md-sys-shape-corner-medium);
  --_r-press: var(--md-sys-shape-corner-small);
  --_icon: var(--app-icon-size-small);
  --_opsz: 20;
  --_pad-s: 16px;
  --_pad-e: 16px;
  --_container: transparent;
  --_label: var(--md-sys-color-on-surface);
  --_state-color: var(--_label);
  --_oc: var(--md-sys-color-outline-variant);

  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: calc(var(--_h) + 2 * var(--_inset));
  margin-block: 0;
  margin-inline: calc(-1 * var(--_inset));
  padding-block: 0;
  padding-inline: var(--_pad-s) var(--_pad-e);
  border: var(--_inset) solid transparent;
  background-clip: padding-box;
  border-radius: calc(var(--_r) + var(--_inset));
  background-color: color-mix(in srgb, var(--_state-color) var(--_state), var(--_container));
  box-shadow: inset 0 0 0 1px var(--_oc);
  color: var(--_label);
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-label-large-size);
  line-height: var(--md-sys-typescale-label-large-line-height);
  font-weight: var(--md-sys-typescale-label-large-weight);
  font-variation-settings: "ROND" 0;
  letter-spacing: 0;
  white-space: nowrap;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline-offset: calc(var(--app-focus-offset) - var(--_inset));
}
.m3-chip[hidden] { display: none; }
.m3-chip:hover { text-decoration: none; }
.m3-chip > .ico { color: var(--md-sys-color-on-surface-variant); }
.m3-chip:has(> .ico:not(.m3-chip__trail)) { --_pad-s: 8px; }
.m3-chip:has(> .m3-chip__trail) { --_pad-e: 8px; }

.m3-chip--filter, .m3-chip--input { --_label: var(--md-sys-color-on-surface-variant); }
.m3-chip--filter[aria-pressed="true"] {
  --_container: var(--md-sys-color-secondary-container);
  --_label: var(--md-sys-color-on-secondary-container);
  --_oc: transparent;
  --_r: calc(var(--_h) / 2);
  --_pad-s: 8px;
  --_fill: 1;
  font-weight: var(--md-sys-typescale-emphasized-label-large-weight);
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
}
.m3-chip--filter[aria-pressed="true"]::before {      /* the leading check of a selected filter */
  content: "check";
  font-family: var(--app-typeface-icon);
  font-size: var(--app-icon-size-small);
  font-weight: normal;
  line-height: 1;
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 1, "opsz" 20;
}
.m3-chip--filter[aria-pressed="true"] > .ico:not(.m3-chip__trail) { display: none; }   /* the check replaces a leading icon */

/* The label chip: data, not a control. 24 tall, no target, no states. On
   #131314 it is #282A2C; on a #1E1F20 or #1B1B1B ground it steps to #333537. */
.m3-chip--label {
  --_h: 24px;
  --_inset: 0px;
  --_r: var(--md-sys-shape-corner-small);
  --_pad-s: 8px;
  --_pad-e: 8px;
  --_container: var(--md-sys-color-surface-container-high);
  --_label: var(--md-sys-color-on-surface-variant);
  --_oc: transparent;
  gap: 4px;
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  font-weight: var(--md-sys-typescale-label-medium-weight);
  cursor: default;
  user-select: text;
}
:is(.m3-card, .panel, .m3-sheet, .m3-list--segmented > *, .rows > *) .m3-chip--label {
  --_container: var(--md-sys-color-surface-container-highest);
}

/* States */
.m3-chip:not(.m3-chip--label)[data-state="hover"] { --_state: var(--md-sys-state-hover-state-layer-opacity); }
@media (hover: hover) {
  .m3-chip:not(.m3-chip--label):hover { --_state: var(--md-sys-state-hover-state-layer-opacity); }
}
.m3-chip:not(.m3-chip--label):is(:focus-visible, [data-state="focus"]) { --_state: var(--md-sys-state-focus-state-layer-opacity); }
.m3-chip:not(.m3-chip--label):is(:active, [data-state="pressed"]):not(:disabled, [aria-disabled="true"]) {
  --_state: var(--md-sys-state-pressed-state-layer-opacity);
  --_r: var(--_r-press);
}
.m3-chip:is(:disabled, [aria-disabled="true"]) {
  --_state: 0%;
  --_label: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
  --_oc: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);
  cursor: default;
}
.m3-chip:is(:disabled, [aria-disabled="true"]) > .ico { color: inherit; }

/* Groups: a wrapping group, or a sideways-scrolling row whose inline ends are
   padded by the inset so the end chips' targets stay inside it. Rows touch
   target-to-target (the visible row gap is the two insets, 16px). */
.m3-chip-group { display: flex; flex-wrap: wrap; gap: 0 8px; }
.m3-chip-group[hidden] { display: none; }
.m3-chip-row {
  position: relative;    /* the containing block of its chips' .sr-only text: an absolute box whose block sits OUTSIDE a scroller escapes its clip, and Mail's account names widened the split pane's body by ~160px */
  display: flex; flex-wrap: nowrap; gap: 8px;
  overflow-x: auto; overflow-y: hidden;
  padding-inline: 8px;
  scrollbar-width: none;
}
.m3-chip-row::-webkit-scrollbar { display: none; }
.m3-chip-row[hidden] { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .m3-chip {
    transition-property: border-radius, background-color, color, box-shadow;
    transition-duration:
      var(--md-sys-motion-spring-fast-spatial-duration), var(--md-sys-motion-spring-fast-effects-duration),
      var(--md-sys-motion-spring-fast-effects-duration), var(--md-sys-motion-spring-fast-effects-duration);
    transition-timing-function:
      var(--md-sys-motion-spring-fast-spatial), var(--md-sys-motion-spring-fast-effects),
      var(--md-sys-motion-spring-fast-effects), var(--md-sys-motion-spring-fast-effects);
  }
  .m3-chip--filter {                                  /* the selected morph: a noticed moment */
    transition-duration:
      var(--md-sys-motion-expressive-fast-spatial-duration), var(--md-sys-motion-spring-fast-effects-duration),
      var(--md-sys-motion-spring-fast-effects-duration), var(--md-sys-motion-spring-fast-effects-duration);
    transition-timing-function:
      var(--md-sys-motion-expressive-fast-spatial), var(--md-sys-motion-spring-fast-effects),
      var(--md-sys-motion-spring-fast-effects), var(--md-sys-motion-spring-fast-effects);
  }
}

/* ── §3.7 Text fields: .m3-textfield (FILLED; the one field style) ─────────
   <label class="m3-textfield"><span class="m3-textfield__label">Title</span>
   <input class="m3-textfield__input" …></label> [<p class="m3-textfield__support">]
   The legacy <label class="fieldgrid__row"><span>Label</span><input|select|textarea>
   is the SAME component (its first span is the label, its control the input).
   56px; #333537; top corners 4; a bottom active indicator 1 -> 2px; the label
   rests inside while a field WITH a placeholder is empty and unfocused, and
   floats otherwise (D11). The field shows no focus ring: its accent
   indicator is the focus mark (§2.14). Every field is body-large (K30). */
:is(.m3-textfield, label.fieldgrid__row) {
  --_container: var(--md-sys-color-surface-container-highest);
  --_state-color: var(--md-sys-color-on-surface);
  --_ind-w: 1px;
  --_ind-c: var(--md-sys-color-on-surface-variant);
  --_lab: var(--md-sys-color-on-surface-variant);
  --_ink: var(--md-sys-color-on-surface);
  --_caret: var(--app-color-accent);

  position: relative;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: [lead] auto [main] minmax(0, 1fr) [trail] auto [end];
  grid-template-rows: 16px auto;
  align-content: center;
  min-width: 0;
  min-height: var(--app-field-h);
  margin: 0;
  padding: 8px 16px;
  border: 0;
  border-start-start-radius: var(--md-sys-shape-corner-extra-small);
  border-start-end-radius: var(--md-sys-shape-corner-extra-small);
  border-end-start-radius: var(--md-sys-shape-corner-none);
  border-end-end-radius: var(--md-sys-shape-corner-none);
  background-color: color-mix(in srgb, var(--_state-color) var(--_state), var(--_container));
  box-shadow: inset 0 calc(-1 * var(--_ind-w)) 0 var(--_ind-c);
  color: var(--_ink);
  cursor: text;
}
:is(.m3-textfield, label.fieldgrid__row)[hidden] { display: none; }
:is(.m3-textfield, label.fieldgrid__row):not(:has(> .m3-textfield__label, > span:first-child:not(.ico))) { grid-template-rows: auto; }

/* The label (body-small, floated) */
:is(.m3-textfield > .m3-textfield__label, label.fieldgrid__row > span:first-child:not(.ico)) {
  grid-column: main / trail;
  grid-row: 1;
  align-self: start;     /* its own line height, not the 16px row's: a RESTING label (24px line) was clipped to 16 and lost its descenders ("Flaq") */
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--_lab);
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line-height);
  font-weight: var(--md-sys-typescale-body-small-weight);
  letter-spacing: 0;
}
/* The control (body-large) */
:is(.m3-textfield, label.fieldgrid__row) > :is(input, select, textarea) {
  grid-column: main / trail;
  grid-row: 2;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: none;
  color: var(--_ink);
  caret-color: var(--_caret);
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
  font-weight: var(--md-sys-typescale-body-large-weight);
  letter-spacing: 0;
}
:is(.m3-textfield, label.fieldgrid__row):not(:has(> .m3-textfield__label, > span:first-child:not(.ico))) > :is(input, select, textarea) { grid-row: 1; }
:is(.m3-textfield, label.fieldgrid__row) > :is(input, select, textarea):focus-visible { outline: none; }  /* the indicator is the mark */
:is(.m3-textfield, label.fieldgrid__row) > :is(input, textarea)::placeholder { color: var(--md-sys-color-on-surface-variant); opacity: 1; }

/* Leading / trailing icons: 24px on-surface-variant; text starts at 52px. */
:is(.m3-textfield__lead, .m3-textfield__trail) {
  --_icon: var(--app-icon-size-large); --_opsz: 24;
  grid-row: 1 / -1;
  align-self: center;
  color: var(--md-sys-color-on-surface-variant);
}
.m3-textfield__lead { grid-column: lead / main; margin-inline: -4px 16px; }
.m3-textfield__trail { grid-column: trail / end; margin-inline: 16px -4px; }

/* The resting label (D11): a field whose input has a placeholder, empty and
   unfocused, rests its label inside at body-large and hides the placeholder
   until focus. A field with no placeholder, and every select, stays floated.
   ⚠️ THE LABEL LOOKS AT ITS OWN LATER SIBLING — never "a field that :has() the
   input, then its label". That spelling ended in `> span:first-child` under a
   parent `:has()`, and with it Chromium answered EVERY span put into the
   document — the Knowledge editor writes them by the hundred — with 23 ms of
   work: a caret moved one line in a long note cost a sixth of a second
   (measured 2026-10-11: this one rule 23.7 ms, this spelling 3.9, no `:has()`
   in the document at all 1.7). The same field, since a label always stands
   before its input here (test_design pins both halves of that). */
:is(.m3-textfield, label.fieldgrid__row):not(:focus-within, [data-state="focus"])
  > :is(.m3-textfield__label, span:first-child:not(.ico)):has(~ :is(input, textarea):placeholder-shown) {
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
  translate: 0 8px;                      /* the 24px line centred in the 56px field */
}
:is(.m3-textfield, label.fieldgrid__row):not(:focus-within, [data-state="focus"]) > :is(input, textarea)::placeholder { color: transparent; }

/* States */
:is(.m3-textfield, label.fieldgrid__row)[data-state="hover"] {
  --_state: var(--md-sys-state-hover-state-layer-opacity);
  --_ind-c: var(--md-sys-color-on-surface);
}
@media (hover: hover) {
  :is(.m3-textfield, label.fieldgrid__row):hover {
    --_state: var(--md-sys-state-hover-state-layer-opacity);
    --_ind-c: var(--md-sys-color-on-surface);
  }
}
:is(.m3-textfield, label.fieldgrid__row):is(:focus-within, [data-state="focus"]) {
  --_state: 0%;
  --_ind-w: 2px;
  --_ind-c: var(--app-color-accent);
  --_lab: var(--app-color-accent);
  outline: none;                         /* the field's mark is its indicator, never the ring */
}
:is(.m3-textfield, label.fieldgrid__row):is(.is-error, :has([aria-invalid="true"])) {
  --_ind-c: var(--md-sys-color-error);
  --_lab: var(--md-sys-color-error);
  --_caret: var(--md-sys-color-error);
}
:is(.m3-textfield, label.fieldgrid__row):is(.is-disabled, :has(> :disabled)) {
  --_state: 0%;
  --_container: color-mix(in srgb, var(--md-sys-color-on-surface) 4%, transparent);
  --_ind-w: 1px;
  --_ind-c: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
  --_lab: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
  --_ink: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
  cursor: default;
}

/* Select: the native control, restyled; its popup is dark via color-scheme (D10). */
:is(.m3-textfield, label.fieldgrid__row) > select {
  appearance: none;
  padding-inline-end: 40px;
  cursor: pointer;
}
:is(.m3-textfield, label.fieldgrid__row):has(> select)::after {
  content: "arrow_drop_down";
  position: absolute;
  inset-inline-end: 12px;
  top: 16px;
  font-family: var(--app-typeface-icon);
  font-size: var(--app-icon-size-large);
  font-weight: normal;
  line-height: 1;
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "opsz" 24;
  color: var(--md-sys-color-on-surface-variant);
  pointer-events: none;
}
/* Textarea: grows with its text from 120px. */
:is(.m3-textfield, label.fieldgrid__row) > textarea {
  min-height: 120px;
  resize: vertical;
  field-sizing: content;
}

.m3-textfield__support {
  margin: 0;
  padding: 4px 16px 0;
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line-height);
}
:is(.m3-textfield.is-error + .m3-textfield__support, .m3-textfield__support.is-error) { color: var(--md-sys-color-error); }

@media (prefers-reduced-motion: no-preference) {
  :is(.m3-textfield, label.fieldgrid__row) {
    transition-property: box-shadow, background-color, color;
    transition-duration:
      var(--md-sys-motion-spring-fast-spatial-duration), var(--md-sys-motion-spring-fast-effects-duration),
      var(--md-sys-motion-spring-fast-effects-duration);
    transition-timing-function:
      var(--md-sys-motion-spring-fast-spatial), var(--md-sys-motion-spring-fast-effects),
      var(--md-sys-motion-spring-fast-effects);
  }
  :is(.m3-textfield > .m3-textfield__label, label.fieldgrid__row > span:first-child:not(.ico)) {   /* M3: the label float is FastSpatial */
    transition-property: font-size, line-height, translate, color;
    transition-duration:
      var(--md-sys-motion-spring-fast-spatial-duration), var(--md-sys-motion-spring-fast-spatial-duration),
      var(--md-sys-motion-spring-fast-spatial-duration), var(--md-sys-motion-spring-fast-effects-duration);
    transition-timing-function:
      var(--md-sys-motion-spring-fast-spatial), var(--md-sys-motion-spring-fast-spatial),
      var(--md-sys-motion-spring-fast-spatial), var(--md-sys-motion-spring-fast-effects);
  }
}

/* Layout helpers. .fieldgrid lays fields out in as many 240px+ columns as fit;
   a tall row (a textarea) and a group of list entries take the whole row.
   Forms are capped at a readable measure. */
.fieldgrid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  max-inline-size: var(--app-form-max);
  min-width: 0;          /* auto-fill counts its columns against the 720 cap, so its min-content is 720: never let that push a grid or flex parent wider than the window */
}
.fieldgrid[hidden] { display: none; }
.fieldgrid__row--tall { grid-column: 1 / -1; }
/* A list field (Contacts' emails, phones): a caption over one bare field per
   entry, value and label side by side. Not itself a field. */
div.fieldgrid__row { display: grid; gap: 8px; grid-column: 1 / -1; min-width: 0; }
div.fieldgrid__row[hidden] { display: none; }
div.fieldgrid__row > span:first-child {
  padding-inline: 16px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line-height);
}
.entry { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 8px; }
.entry[hidden] { display: none; }
/* A bare field: the filled container on the control itself (no label row). */
:is(.entry > input, .m3-field-bare) {
  --_container: var(--md-sys-color-surface-container-highest);
  --_state-color: var(--md-sys-color-on-surface);
  --_ind-w: 1px;
  --_ind-c: var(--md-sys-color-on-surface-variant);
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: var(--app-field-h);
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-start-start-radius: var(--md-sys-shape-corner-extra-small);
  border-start-end-radius: var(--md-sys-shape-corner-extra-small);
  border-end-start-radius: var(--md-sys-shape-corner-none);
  border-end-end-radius: var(--md-sys-shape-corner-none);
  background-color: color-mix(in srgb, var(--_state-color) var(--_state), var(--_container));
  box-shadow: inset 0 calc(-1 * var(--_ind-w)) 0 var(--_ind-c);
  color: var(--md-sys-color-on-surface);
  caret-color: var(--app-color-accent);
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
  font-weight: var(--md-sys-typescale-body-large-weight);
  outline: none;
}
:is(.entry > input, .m3-field-bare)::placeholder { color: var(--md-sys-color-on-surface-variant); opacity: 1; }
:is(.entry > input, .m3-field-bare)[data-state="hover"] {
  --_state: var(--md-sys-state-hover-state-layer-opacity); --_ind-c: var(--md-sys-color-on-surface);
}
@media (hover: hover) {
  :is(.entry > input, .m3-field-bare):hover {
    --_state: var(--md-sys-state-hover-state-layer-opacity); --_ind-c: var(--md-sys-color-on-surface);
  }
}
:is(.entry > input, .m3-field-bare):is(:focus, [data-state="focus"]) {
  --_state: 0%; --_ind-w: 2px; --_ind-c: var(--app-color-accent);
}
@media (prefers-reduced-motion: no-preference) {
  :is(.entry > input, .m3-field-bare) {
    transition-property: box-shadow, background-color;
    transition-duration: var(--md-sys-motion-spring-fast-spatial-duration), var(--md-sys-motion-spring-fast-effects-duration);
    transition-timing-function: var(--md-sys-motion-spring-fast-spatial), var(--md-sys-motion-spring-fast-effects);
  }
}

/* ── §3.8 Search bar: .m3-search (alias .split__search) ────────────────────
   <div class="m3-search" role="search"><span class="ico">search</span>
   <input type="search" placeholder="Search …"></div>. 56px, a full pill
   (28), #282A2C on the #131314 card, no elevation. The placeholder must say
   "Search". The ring shows on :focus-within. */
:is(.m3-search, .split__search) {
  --_container: var(--md-sys-color-surface-container-high);
  --_state-color: var(--md-sys-color-on-surface);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
  height: var(--app-search-h);
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background-color: color-mix(in srgb, var(--_state-color) var(--_state), var(--_container));
  color: var(--md-sys-color-on-surface);
  cursor: text;
}
:is(.m3-search, .split__search)[hidden] { display: none; }
:is(.m3-search, .split__search) > .ico { --_icon: var(--app-icon-size-large); --_opsz: 24; color: var(--md-sys-color-on-surface); }
:is(.m3-search, .split__search) input {
  flex: 1;
  width: 0;              /* no intrinsic width (an input's is ~20 characters): the bar may be as narrow as a 360px phone needs */
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  outline: none;
  color: var(--md-sys-color-on-surface);
  caret-color: var(--app-color-accent);
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
  font-weight: var(--md-sys-typescale-body-large-weight);
  letter-spacing: 0;
}
:is(.m3-search, .split__search) input::placeholder { color: var(--md-sys-color-on-surface-variant); opacity: 1; }
:is(.m3-search, .split__search) input:focus-visible { outline: none; }   /* the bar carries the ring */
:is(.m3-search, .split__search) input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; appearance: none; }
:is(.m3-search, .split__search)[data-state="hover"] { --_state: var(--md-sys-state-hover-state-layer-opacity); }
@media (hover: hover) {
  :is(.m3-search, .split__search):hover { --_state: var(--md-sys-state-hover-state-layer-opacity); }
}
:is(.m3-search, .split__search):is(:focus-within, [data-state="focus"]) {
  outline: var(--app-focus-ring);
  outline-offset: var(--app-focus-offset-inner);   /* §2.14: drawn inside — the bar sits flush with the clipping pane body */
}

/* Composers (the assistant panel's and Chat's): the search geometry without
   the leading icon, padded 0 8 0 24 around the input plus a trailing filled
   S icon button (Send, arrow_upward). .fab__composer / .chat__composer take
   these rules in their owners' files; .m3-composer is the component.
   --on-high: on a #282A2C ground the pill steps to #333537. */
.m3-composer {
  --_container: var(--md-sys-color-surface-container-high);
  --_state-color: var(--md-sys-color-on-surface);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: var(--app-search-h);
  margin: 0;
  padding: 0 8px 0 24px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background-color: color-mix(in srgb, var(--_state-color) var(--_state), var(--_container));
  color: var(--md-sys-color-on-surface);
}
.m3-composer[hidden] { display: none; }
.m3-composer--on-high { --_container: var(--md-sys-color-surface-container-highest); }
.m3-composer > :is(input, textarea) {
  flex: 1;
  width: 0;
  min-width: 0;
  margin: 0;
  padding: 16px 0;
  border: 0;
  background: none;
  outline: none;
  resize: none;
  color: var(--md-sys-color-on-surface);
  caret-color: var(--app-color-accent);
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
  letter-spacing: 0;
}
.m3-composer > :is(input, textarea)::placeholder { color: var(--md-sys-color-on-surface-variant); opacity: 1; }
.m3-composer > :is(input, textarea):focus-visible { outline: none; }
/* The ring follows the INPUT, not :focus-within: with Send focused the button
   rings itself, and two rings would show (§2.14: exactly one). */
.m3-composer:is(:has(> :is(input, textarea):focus), [data-state="focus"]) { outline: var(--app-focus-ring); outline-offset: var(--app-focus-offset); }

@media (prefers-reduced-motion: no-preference) {
  :is(.m3-search, .split__search, .m3-composer) {
    transition: background-color var(--md-sys-motion-spring-fast-effects-duration) var(--md-sys-motion-spring-fast-effects);
  }
}

/* ── §3.9 Cards: .m3-card ──────────────────────────────────────────────────
   Filled (the default) #1E1F20 on the #131314 content, 12 (M3's value for all
   three card types), padding 16. --xl: the expressive figure/collection card,
   28, padding 20/22 (a box's padding clears its own corner, K29). Panels,
   cards on the content, list items, the band and the rail carry no shadow. */
.m3-card, .panel {
  --_container: var(--md-sys-color-surface-container);
  --_state-color: var(--md-sys-color-on-surface);
  box-sizing: border-box;
  display: block;
  min-width: 0;
  padding: 16px;
  border-radius: var(--md-sys-shape-corner-medium);
  background-color: color-mix(in srgb, var(--_state-color) var(--_state), var(--_container));
  box-shadow: var(--app-elevation-none);
  color: var(--md-sys-color-on-surface);
}
:is(.m3-card, .panel)[hidden] { display: none; }
.m3-card--xl { border-radius: var(--md-sys-shape-corner-extra-large); padding: 20px 22px; }
.m3-card--outlined {
  --_container: var(--md-sys-color-surface);
  box-shadow: inset 0 0 0 1px var(--md-sys-color-outline-variant);
}
.m3-card--elevated {
  --_container: var(--md-sys-color-surface-container-low);
  box-shadow: var(--md-sys-elevation-level1);
}
/* The legacy panel: a filled card, 16/20, stacked with a 16px gap. */
.panel { padding: 16px 20px; margin: 0 0 16px; }

/* An interactive card */
:is(a, button).m3-card {
  width: 100%;
  border: 0;
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
:is(a, button).m3-card[data-state="hover"] { --_state: var(--md-sys-state-hover-state-layer-opacity); }
@media (hover: hover) {
  :is(a, button).m3-card:hover { --_state: var(--md-sys-state-hover-state-layer-opacity); }
}
:is(a, button).m3-card:is(:focus-visible, [data-state="focus"]) { --_state: var(--md-sys-state-focus-state-layer-opacity); }
:is(a, button).m3-card:is(:active, [data-state="pressed"]) { --_state: var(--md-sys-state-pressed-state-layer-opacity); }
.m3-card[data-state="dragged"], .m3-card.is-dragged {
  --_state: var(--md-sys-state-dragged-state-layer-opacity);
  box-shadow: var(--md-sys-elevation-level3);
}

/* Head, title, note (and the legacy .panel__head / .panel__note) */
:is(.m3-card__head, .panel__head) {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
  min-width: 0;
}
:is(.m3-card__head, .panel__head)[hidden] { display: none; }
:is(.m3-card__title, .panel__head h2, .m3-card__head h2) {
  margin: 0;
  min-width: 0;
  color: var(--md-sys-color-on-surface);
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-title-medium-size);
  line-height: var(--md-sys-typescale-title-medium-line-height);
  font-weight: var(--md-sys-typescale-title-medium-weight);
  letter-spacing: 0;
}
:is(.m3-card__note, .panel__note) {
  margin: 0 0 12px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  font-weight: var(--md-sys-typescale-label-medium-weight);
  font-variant-numeric: tabular-nums;
}
:is(.m3-card__head, .panel__head) :is(.m3-card__note, .panel__note) { margin: 0 0 0 auto; }
.panel__head :is(.btn, .m3-btn) { margin-inline-start: auto; align-self: center; }

@media (prefers-reduced-motion: no-preference) {
  .m3-card, .panel {
    transition-property: background-color, box-shadow;
    transition-duration: var(--md-sys-motion-spring-fast-effects-duration), var(--md-sys-motion-spring-fast-effects-duration);
    transition-timing-function: var(--md-sys-motion-spring-fast-effects), var(--md-sys-motion-spring-fast-effects);
  }
}

/* ── §3.10 Lists: .m3-list, .m3-list-item (M3E expressive lists) ───────────
   STANDARD (.m3-list): items transparent on their ground; a state paints the
   shape. For FEEDS (Mail, Contacts, News, conversations, the Knowledge tree,
   transactions, widget rows).
   SEGMENTED (.m3-list--segmented): each item its own tile, 2px apart. For
   settings-like and record blocks (Account, contact fields, health diaries).
   Item: [lead] [text: overline / headline / support] [trail]. One line 56,
   --two 72, --three 88. Shape: rest 4, hover 12, focus / pressed / selected 16.
   Selected (aria-current="true", .is-on, .is-current) is the grey step with
   an emphasized headline and a filled leading icon. */
.m3-list, .rows {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}
:is(.m3-list, .rows)[hidden] { display: none; }
.m3-list > li { display: block; min-width: 0; }

.m3-list-item {
  --_container: transparent;
  --_state-color: var(--md-sys-color-on-surface);
  --_r: var(--md-sys-shape-corner-extra-small);
  --_head: var(--md-sys-color-on-surface);
  --_sup: var(--md-sys-color-on-surface-variant);
  --_head-w: var(--md-sys-typescale-body-large-weight);
  --_head-rond: 0;
  --_lines: 1;
  --_icon: var(--app-icon-size-medium);
  --_opsz: 20;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: [lead] auto [text] minmax(0, 1fr) [trail] auto [end];
  align-items: center;
  min-width: 0;
  min-height: var(--app-list-h-1);
  margin: 0;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--_r);
  background-color: color-mix(in srgb, var(--_state-color) var(--_state), var(--_container));
  color: var(--_head);
  font-family: var(--md-ref-typeface-plain);
  text-align: start;
  text-decoration: none;
}
.m3-list-item[hidden] { display: none; }
.m3-list-item--two { min-height: var(--app-list-h-2); --_lines: 1; }
.m3-list-item--three { min-height: var(--app-list-h-3); --_lines: 2; align-items: start; }

/* The parts. Columns collapse when a part is absent (the gaps are margins). */
.m3-list-item__lead {
  grid-column: lead / text;
  margin-inline-end: 12px;
  color: var(--md-sys-color-on-surface-variant);
  display: inline-grid;
  place-items: center;
}
.m3-list-item__text { grid-column: text / trail; display: grid; min-width: 0; }
:is(.m3-list-item__trail, .m3-list-item__trail-text) { grid-column: trail / end; margin-inline-start: 12px; }
.m3-list-item__headline {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--_head);
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
  font-weight: var(--_head-w);
  font-variation-settings: "ROND" var(--_head-rond);
}
.m3-list-item__support {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--_lines);
  line-clamp: var(--_lines);
  overflow: hidden;
  color: var(--_sup);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
  font-weight: var(--md-sys-typescale-body-medium-weight);
}
.m3-list-item__overline {
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
  font-weight: var(--md-sys-typescale-label-small-weight);
}
.m3-list-item__trail-text {
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
  font-weight: var(--md-sys-typescale-label-small-weight);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
:is(.m3-list-item--two, .m3-list-item--three) > .m3-list-item__trail-text { align-self: start; }
.m3-list-item__image {
  width: 56px; height: 56px;
  border-radius: var(--md-sys-shape-corner-small);
  object-fit: cover;
}

/* Avatar: 40, full, #333537, the initial in title-medium. --lg 72. */
.m3-avatar {
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px; height: 40px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-title-medium-size);
  line-height: var(--md-sys-typescale-title-medium-line-height);
  font-weight: var(--md-sys-typescale-title-medium-weight);
  overflow: hidden;
  user-select: none;
}
.m3-avatar[hidden] { display: none; }
.m3-avatar--lg {
  width: 72px; height: 72px;
  font-size: var(--md-sys-typescale-headline-small-size);
  line-height: var(--md-sys-typescale-headline-small-line-height);
}
.m3-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Interactive items */
:is(a, button).m3-list-item {
  width: 100%;
  font: inherit;
  color: var(--_head);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline-offset: var(--app-focus-offset-inner);
}
:is(a, button).m3-list-item[data-state="hover"] { --_state: var(--md-sys-state-hover-state-layer-opacity); --_r: var(--md-sys-shape-corner-medium); }
@media (hover: hover) {
  :is(a, button).m3-list-item:hover { --_state: var(--md-sys-state-hover-state-layer-opacity); --_r: var(--md-sys-shape-corner-medium); }
}
:is(a, button).m3-list-item:is(:focus-visible, [data-state="focus"]) { --_state: var(--md-sys-state-focus-state-layer-opacity); --_r: var(--md-sys-shape-corner-large); }
:is(a, button).m3-list-item:is(:active, [data-state="pressed"]) { --_state: var(--md-sys-state-pressed-state-layer-opacity); --_r: var(--md-sys-shape-corner-large); }
.m3-list-item:is([aria-current="true"], .is-on, .is-current) {
  --_container: var(--md-sys-color-secondary-container);
  --_state-color: var(--md-sys-color-on-secondary-container);
  --_r: var(--md-sys-shape-corner-large);
  --_head: var(--md-sys-color-on-secondary-container);
  --_sup: var(--md-sys-color-on-secondary-container);
  --_head-w: var(--md-sys-typescale-emphasized-body-large-weight);
  --_head-rond: var(--md-sys-typescale-emphasized-rond);
  --_fill: 1;
}
.m3-list-item:is([aria-current="true"], .is-on, .is-current) > .m3-list-item__lead { color: var(--md-sys-color-on-secondary-container); }
/* A SELECTED interactive item keeps its 16 under the pointer: the hover rule
   above weighs (0,2,1) and beat the plain selected rule (0,2,0), so the corner
   dropped to 12 on hover. Same weight, written later. */
:is(a, button).m3-list-item:is([aria-current="true"], .is-on, .is-current) { --_r: var(--md-sys-shape-corner-large); }
.m3-list-item:is(:disabled, [aria-disabled="true"]) {
  --_state: 0%;
  --_head: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
  --_sup: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
  cursor: default;
}

/* Segmented: tiles 2px apart. #1E1F20 on a #131314 / #1B1B1B ground, #282A2C
   inside a card. Corners: single 16; first 16 16 4 4; middle 4; last 4 4 16 16. */
:is(.m3-list--segmented, .rows) { gap: 2px; padding: 0; }
:is(.m3-list--segmented, .rows) > :is(li, .m3-list-item, .row) {
  --_rt: var(--md-sys-shape-corner-extra-small);
  --_rb: var(--md-sys-shape-corner-extra-small);
}
:is(.m3-list--segmented, .rows) > :first-child { --_rt: var(--md-sys-shape-corner-large); }
:is(.m3-list--segmented, .rows) > :last-child,
:is(.m3-list--segmented, .rows) > :has(+ .row--empty:last-child) { --_rb: var(--md-sys-shape-corner-large); }   /* a trailing empty line is not a tile */
:is(.m3-list--segmented, .rows) .m3-list-item,
:is(.m3-list--segmented, .rows) > .row {
  --_container: var(--md-sys-color-surface-container);
  --_rt-own: var(--_rt, var(--md-sys-shape-corner-extra-small));
  --_rb-own: var(--_rb, var(--md-sys-shape-corner-extra-small));
  border-start-start-radius: var(--_rt-own);
  border-start-end-radius: var(--_rt-own);
  border-end-start-radius: var(--_rb-own);
  border-end-end-radius: var(--_rb-own);
}
:is(.m3-card, .panel) :is(.m3-list--segmented, .rows) :is(.m3-list-item, .row) { --_container: var(--md-sys-color-surface-container-high); }
/* An interactive segmented item morphs all round: hover 12; focus, pressed, selected 16. */
:is(.m3-list--segmented, .rows) :is(a, button).m3-list-item[data-state="hover"] { --_rt-own: var(--md-sys-shape-corner-medium); --_rb-own: var(--md-sys-shape-corner-medium); }
@media (hover: hover) {
  :is(.m3-list--segmented, .rows) :is(a, button).m3-list-item:hover { --_rt-own: var(--md-sys-shape-corner-medium); --_rb-own: var(--md-sys-shape-corner-medium); }
}
:is(.m3-list--segmented, .rows) :is(a, button).m3-list-item:is(:focus-visible, :active, [data-state="focus"], [data-state="pressed"]),
:is(.m3-list--segmented, .rows) .m3-list-item:is([aria-current="true"], .is-on, .is-current) {
  --_rt-own: var(--md-sys-shape-corner-large); --_rb-own: var(--md-sys-shape-corner-large);
}
/* Selected beats the tile colour (this rule outweighs both tile rules above). */
:is(.m3-list--segmented, .rows) .m3-list-item:is([aria-current="true"], .is-on, .is-current):is(*, .m3-list-item) {
  --_container: var(--md-sys-color-secondary-container);
}

/* The legacy row (.rows > .row): a non-interactive segmented item. .row .ico
   is the leading icon, .row__main b the headline, em the supporting line,
   .row__note a trailing FIGURE (label-large, tabular, A43). */
.row {
  --_state-color: var(--md-sys-color-on-surface);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: var(--app-list-h-1);
  margin: 0;
  padding: 10px 16px;
  background-color: color-mix(in srgb, var(--_state-color) var(--_state), var(--_container, transparent));
  color: var(--md-sys-color-on-surface);
}
.row[hidden] { display: none; }
.row:has(.row__main em) { min-height: var(--app-list-h-2); }
.row > .ico, .row__main + .ico { --_icon: var(--app-icon-size-medium); --_opsz: 20; color: var(--md-sys-color-on-surface-variant); }
.row__main { display: grid; gap: 0; flex: 1 1 12ch; margin-inline-end: auto; min-width: 0; }
.row__main b {
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  color: var(--md-sys-color-on-surface);
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
  font-weight: var(--md-sys-typescale-body-large-weight);
}
.row__main em {
  font-style: normal;
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
}
.row__note {
  flex: 0 1 auto;
  min-width: 0;
  max-inline-size: 45%;
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-label-large-size);
  line-height: var(--md-sys-typescale-label-large-line-height);
  font-weight: var(--md-sys-typescale-label-large-weight);
  font-variant-numeric: tabular-nums;
  text-align: end;
  white-space: normal;
}
/* The trailing part GIVES WAY to the headline: a PROSE note (Account's "the
   only one — add another…") wraps inside at most 45% of the row instead of
   crushing .row__main to a one-word column. A short FIGURE ("350 kcal") still
   reads on one line: it is far narrower than its 45%, and below 720px a row
   that cannot hold its parts moves the trailing ones to a second line before
   anything shrinks (flex lines are filled at their natural widths). */
.row > :is(.m3-btn, .btn) { flex-shrink: 0; }       /* a button in a row never compresses below its label */
@media (max-width: 720px) {
  /* At phone width a trailing part that does not fit drops under the text
     (at the row's start, where a wrapped button sits too) and reads as a line
     of its own rather than a narrow right-aligned column. */
  .row { flex-wrap: wrap; row-gap: 4px; }
  .row__note { max-inline-size: 100%; text-align: start; }
}
.row__warn {
  color: var(--md-sys-color-error);
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line-height);
}

@media (prefers-reduced-motion: no-preference) {
  .m3-list-item {
    transition-property: border-radius, background-color, color;
    transition-duration:
      var(--md-sys-motion-spring-fast-spatial-duration), var(--md-sys-motion-spring-default-effects-duration),
      var(--md-sys-motion-spring-default-effects-duration);
    transition-timing-function:
      var(--md-sys-motion-spring-fast-spatial), var(--md-sys-motion-spring-default-effects),
      var(--md-sys-motion-spring-default-effects);
  }
  .m3-list-item:is([aria-current="true"], .is-on, .is-current) {     /* the selected morph: expressive */
    transition-duration:
      var(--md-sys-motion-expressive-fast-spatial-duration), var(--md-sys-motion-spring-default-effects-duration),
      var(--md-sys-motion-spring-default-effects-duration);
    transition-timing-function:
      var(--md-sys-motion-expressive-fast-spatial), var(--md-sys-motion-spring-default-effects),
      var(--md-sys-motion-spring-default-effects);
  }
}

/* ── §3.11 Dialogs and sheets ──────────────────────────────────────────────
   A pop-up is the last resort (K3). The dialog is used only by the login card;
   the sheet only by the Calendar detail, NON-modal (no scrim). */
.m3-dialog {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(560px, 100% - 48px);
  min-width: min(280px, 100%);
  margin: 0;
  padding: 24px;
  border: 0;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background: var(--md-sys-color-surface-container-high);
  box-shadow: var(--md-sys-elevation-level3);
  color: var(--md-sys-color-on-surface);
}
.m3-dialog[hidden] { display: none; }
.m3-dialog__headline {
  margin: 0;
  color: var(--md-sys-color-on-surface);
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-headline-small-size);
  line-height: var(--md-sys-typescale-headline-small-line-height);
  font-weight: var(--md-sys-typescale-headline-small-weight);
}
.m3-dialog__body {
  margin: 16px 0 0;
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
}
.m3-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}
.m3-scrim {
  position: fixed;
  inset: 0;
  background: var(--app-color-scrim);
}
.m3-scrim[hidden] { display: none; }

.m3-sheet {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  overflow: auto;
}
.m3-sheet[hidden] { display: none; }
.m3-sheet--side { width: min(360px, 100%); box-shadow: var(--app-elevation-none); }
.m3-sheet--float { width: 100%; max-width: 400px; box-shadow: var(--md-sys-elevation-level1); }
.m3-sheet--bottom {
  position: relative;
  width: 100%;
  max-height: 70dvh;
  padding-top: 48px;
  border-start-start-radius: var(--md-sys-shape-corner-extra-large);
  border-start-end-radius: var(--md-sys-shape-corner-extra-large);
  border-end-start-radius: var(--md-sys-shape-corner-none);
  border-end-end-radius: var(--md-sys-shape-corner-none);
  box-shadow: var(--md-sys-elevation-level1);
}
.m3-sheet--bottom::before {                 /* the drag-handle mark: visual only; the sheet closes by its button */
  content: "";
  position: absolute;
  top: 22px;
  left: 50%;
  width: 32px;
  height: 4px;
  translate: -50% 0;
  border-radius: var(--app-shape-corner-mark);
  background: var(--md-sys-color-on-surface-variant);
}
@media (prefers-reduced-motion: no-preference) {
  .m3-sheet {
    transition-property: translate, opacity, display;
    transition-duration: var(--md-sys-motion-spring-default-spatial-duration), var(--md-sys-motion-spring-fast-effects-duration), var(--md-sys-motion-spring-fast-effects-duration);
    transition-timing-function: var(--md-sys-motion-spring-default-spatial), var(--md-sys-motion-spring-fast-effects), linear;
    transition-behavior: allow-discrete;
  }
  .m3-sheet[hidden] { opacity: 0; }       /* exits: opacity only, on fast-effects */
  @starting-style {
    .m3-sheet--bottom { translate: 0 100%; opacity: 0; }
    .m3-sheet--float { translate: 0 16px; opacity: 0; }
  }
}

/* ── §3.12 Menus: .m3-menu (the M3E vertical menu; gallery only this pass) ── */
.m3-menu {
  --_origin: top left;          /* the corner nearest the anchor */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width: 112px;
  max-width: 280px;
  margin: 0;
  padding: 4px;
  list-style: none;
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-container-low);
  box-shadow: var(--md-sys-elevation-level2);
  color: var(--md-sys-color-on-surface);
  z-index: var(--app-z-menu);
  transform-origin: var(--_origin);
}
.m3-menu[hidden] { display: none; }
.m3-menu__item {
  --_container: transparent;
  --_state-color: var(--md-sys-color-on-surface);
  --_r: var(--md-sys-shape-corner-extra-small);
  --_rt: var(--_r);
  --_rb: var(--_r);
  --_icon: var(--app-icon-size-medium);
  --_opsz: 20;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: var(--app-target);
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-start-start-radius: var(--_rt);
  border-start-end-radius: var(--_rt);
  border-end-start-radius: var(--_rb);
  border-end-end-radius: var(--_rb);
  background-color: color-mix(in srgb, var(--_state-color) var(--_state), var(--_container));
  color: var(--md-sys-color-on-surface);
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-label-large-size);
  line-height: var(--md-sys-typescale-label-large-line-height);
  font-weight: var(--md-sys-typescale-label-large-weight);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  outline-offset: var(--app-focus-offset-inner);
}
.m3-menu__item[hidden] { display: none; }
.m3-menu__item > .ico { color: var(--md-sys-color-on-surface-variant); }
.m3-menu__support {
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
  font-weight: var(--md-sys-typescale-body-medium-weight);
}
.m3-menu > :first-child, .m3-menu > li:first-child > .m3-menu__item { --_rt: var(--md-sys-shape-corner-medium); }
.m3-menu > :last-child, .m3-menu > li:last-child > .m3-menu__item { --_rb: var(--md-sys-shape-corner-medium); }
.m3-menu__item[data-state="hover"] { --_state: var(--md-sys-state-hover-state-layer-opacity); }
@media (hover: hover) {
  .m3-menu__item:hover { --_state: var(--md-sys-state-hover-state-layer-opacity); }
}
.m3-menu__item:is(:focus-visible, [data-state="focus"]) { --_state: var(--md-sys-state-focus-state-layer-opacity); }
.m3-menu__item:is(:active, [data-state="pressed"]) { --_state: var(--md-sys-state-pressed-state-layer-opacity); }
.m3-menu__item:is([aria-selected="true"], [aria-current="true"], .is-on) {
  --_container: var(--md-sys-color-tertiary-container);
  --_rt: var(--md-sys-shape-corner-medium);
  --_rb: var(--md-sys-shape-corner-medium);
  --_fill: 1;
  color: var(--md-sys-color-on-tertiary-container);
}
.m3-menu__item:is([aria-selected="true"], [aria-current="true"], .is-on)::before {
  content: "check";
  font-family: var(--app-typeface-icon);
  font-size: var(--app-icon-size-medium);
  font-weight: normal;
  line-height: 1;
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 1, "opsz" 20;
}
.m3-menu__item:is(:disabled, [aria-disabled="true"]) {
  --_state: 0%;
  color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
  cursor: default;
}
.m3-menu__item:is(:disabled, [aria-disabled="true"]) > .ico { color: inherit; }
.m3-menu__divider {
  height: 1px;
  margin: 2px 12px;
  border: 0;
  background: var(--md-sys-color-outline-variant);
}
@media (prefers-reduced-motion: no-preference) {
  .m3-menu {
    transition-property: scale, opacity, display;
    transition-duration: var(--md-sys-motion-spring-fast-spatial-duration), var(--md-sys-motion-spring-fast-effects-duration), var(--md-sys-motion-spring-fast-effects-duration);
    transition-timing-function: var(--md-sys-motion-spring-fast-spatial), var(--md-sys-motion-spring-fast-effects), linear;
    transition-behavior: allow-discrete;
  }
  .m3-menu[hidden] { opacity: 0; }
  @starting-style {
    .m3-menu { scale: .8; opacity: 0; }
  }
  .m3-menu__item {
    transition: background-color var(--md-sys-motion-spring-fast-effects-duration) var(--md-sys-motion-spring-fast-effects);
  }
}

/* ── §3.15 Switch: <input type="checkbox" role="switch" class="m3-switch"> ──
   Track 52x32 in a 68x48 box (uniform 8px inset). The handle is ::before,
   positioned from the track (the padding box): 16px at x 16 off, 24px at x 36
   on, 28px pressed; its 40px state layer is a spread shadow. The registered
   --_state does not inherit, so the layer's state is set on ::before itself. */
.m3-switch {
  --_inset: 8px;
  --_track: var(--md-sys-color-surface-container-highest);
  --_tw: 2px;
  --_tc: var(--md-sys-color-outline);
  --_hd: 16px;
  --_hx: 16px;
  --_hc: var(--md-sys-color-outline);
  --_layer: var(--md-sys-color-on-surface);
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  box-sizing: border-box;
  display: inline-block;
  flex: none;
  width: calc(52px + 2 * var(--_inset));
  height: calc(32px + 2 * var(--_inset));
  margin-block: 0;
  margin-inline: calc(-1 * var(--_inset));
  padding: 0;
  border: var(--_inset) solid transparent;
  background-clip: padding-box;
  border-radius: calc(var(--md-sys-shape-corner-large) + var(--_inset));
  background-color: var(--_track);
  box-shadow: inset 0 0 0 var(--_tw) var(--_tc);
  vertical-align: middle;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline-offset: calc(var(--app-focus-offset) - var(--_inset));
}
.m3-switch[hidden] { display: none; }
.m3-switch::before {
  content: "";
  position: absolute;
  left: calc(var(--_hx) - var(--_hd) / 2);
  top: calc(16px - var(--_hd) / 2);
  width: var(--_hd);
  height: var(--_hd);
  border-radius: calc(var(--_hd) / 2);
  background: var(--_hc);
  box-shadow: 0 0 0 calc((40px - var(--_hd)) / 2) color-mix(in srgb, var(--_layer) var(--_state), transparent);
}
.m3-switch:checked {
  --_track: var(--md-sys-color-primary);
  --_tw: 0px;
  --_hd: 24px;
  --_hx: 36px;
  --_hc: var(--md-sys-color-on-primary);
  --_layer: var(--md-sys-color-primary);
}
.m3-switch:not(:checked):is([data-state="hover"], [data-state="focus"], [data-state="pressed"], :focus-visible, :active) { --_hc: var(--md-sys-color-on-surface-variant); }
.m3-switch[data-state="hover"]::before { --_state: var(--md-sys-state-hover-state-layer-opacity); }
@media (hover: hover) {
  .m3-switch:not(:checked):hover { --_hc: var(--md-sys-color-on-surface-variant); }
  .m3-switch:hover::before { --_state: var(--md-sys-state-hover-state-layer-opacity); }
}
.m3-switch:is(:focus-visible, [data-state="focus"])::before { --_state: var(--md-sys-state-focus-state-layer-opacity); }
.m3-switch:is(:active, [data-state="pressed"]) { --_hd: 28px; }
.m3-switch:is(:active, [data-state="pressed"])::before { --_state: var(--md-sys-state-pressed-state-layer-opacity); }
.m3-switch:disabled {
  --_track: color-mix(in srgb, var(--md-sys-color-surface-container-highest) 12%, transparent);
  --_tc: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent);
  --_hc: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
  cursor: default;
}
.m3-switch:disabled:checked {
  --_track: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent);
  --_hc: var(--md-sys-color-surface);
}
.m3-switch:disabled::before { --_state: 0%; }
@media (prefers-reduced-motion: no-preference) {
  .m3-switch {
    transition-property: background-color, box-shadow;
    transition-duration: var(--md-sys-motion-spring-fast-effects-duration), var(--md-sys-motion-spring-fast-effects-duration);
    transition-timing-function: var(--md-sys-motion-spring-fast-effects), var(--md-sys-motion-spring-fast-effects);
  }
  .m3-switch::before {
    transition-property: left, top, width, height, border-radius, background-color, box-shadow;
    transition-duration:
      var(--md-sys-motion-spring-fast-spatial-duration), var(--md-sys-motion-spring-fast-spatial-duration),
      var(--md-sys-motion-spring-fast-spatial-duration), var(--md-sys-motion-spring-fast-spatial-duration),
      var(--md-sys-motion-spring-fast-spatial-duration), var(--md-sys-motion-spring-fast-effects-duration),
      var(--md-sys-motion-spring-fast-effects-duration);
    transition-timing-function:
      var(--md-sys-motion-spring-fast-spatial), var(--md-sys-motion-spring-fast-spatial),
      var(--md-sys-motion-spring-fast-spatial), var(--md-sys-motion-spring-fast-spatial),
      var(--md-sys-motion-spring-fast-spatial), var(--md-sys-motion-spring-fast-effects),
      var(--md-sys-motion-spring-fast-effects);
  }
}

/* ── §3.16 Checkbox / §3.17 Radio ──────────────────────────────────────────
   The wrapping <label> (min-height 48) is the target. The control keeps its
   18 / 20px layout box: a uniform transparent border makes its element box
   40x40 for the circular state layer (a radial background clipped to the
   border box) and negative margins on all four sides give the room back.
   Radios never print "checked" into markup (§1.7); :checked is a selector. */
:is(.m3-checkbox, .m3-radio) {
  --_box: transparent;
  --_ring: var(--md-sys-color-on-surface-variant);
  --_rw: 2px;
  --_state-color: var(--md-sys-color-on-surface);
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  box-sizing: border-box;
  display: inline-block;
  flex: none;
  width: calc(var(--_size) + 2 * var(--_inset));
  height: calc(var(--_size) + 2 * var(--_inset));
  margin: calc(-1 * var(--_inset));
  padding: 0;
  border: var(--_inset) solid transparent;
  background-color: var(--_box);
  background-image:
    radial-gradient(circle closest-side, color-mix(in srgb, var(--_state-color) var(--_state), transparent) calc(100% - 1px), transparent 100%),
    none;
  background-clip: border-box, padding-box;
  background-origin: border-box, padding-box;
  box-shadow: inset 0 0 0 var(--_rw) var(--_ring);
  vertical-align: middle;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline-offset: calc(var(--app-focus-offset) - var(--_inset));
}
:is(.m3-checkbox, .m3-radio)[hidden] { display: none; }
.m3-checkbox { --_size: 18px; --_inset: 11px; border-radius: calc(var(--app-shape-corner-mark) + var(--_inset)); }
.m3-radio { --_size: 20px; --_inset: 10px; --_dot: 0; border-radius: calc(var(--_size) / 2 + var(--_inset)); }

.m3-checkbox::after {
  content: "check";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--app-typeface-icon);
  font-size: var(--app-icon-size-small);
  font-weight: normal;
  line-height: 1;
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 1, "opsz" 20;
  color: var(--md-sys-color-on-primary);
  opacity: 0;
}
.m3-checkbox:checked { --_box: var(--md-sys-color-primary); --_rw: 0px; --_state-color: var(--md-sys-color-primary); }
.m3-checkbox:checked::after { opacity: 1; }

.m3-radio::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--_ring);
  scale: var(--_dot);
}
.m3-radio:checked { --_ring: var(--md-sys-color-primary); --_dot: 1; --_state-color: var(--md-sys-color-primary); }

:is(.m3-checkbox, .m3-radio)[data-state="hover"] { --_state: var(--md-sys-state-hover-state-layer-opacity); }
@media (hover: hover) {
  :is(.m3-checkbox, .m3-radio):hover { --_state: var(--md-sys-state-hover-state-layer-opacity); }
  :is(.m3-checkbox, .m3-radio):not(:checked):hover { --_ring: var(--md-sys-color-on-surface); }
}
:is(.m3-checkbox, .m3-radio):is(:focus-visible, [data-state="focus"]) { --_state: var(--md-sys-state-focus-state-layer-opacity); }
:is(.m3-checkbox, .m3-radio):is(:active, [data-state="pressed"]) { --_state: var(--md-sys-state-pressed-state-layer-opacity); }
:is(.m3-checkbox, .m3-radio):not(:checked):is([data-state="hover"], [data-state="focus"], [data-state="pressed"], :focus-visible, :active) { --_ring: var(--md-sys-color-on-surface); }
:is(.m3-checkbox, .m3-radio):disabled {
  --_state: 0%;
  --_ring: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
  cursor: default;
}
.m3-checkbox:disabled:checked { --_box: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent); }
.m3-checkbox:disabled:checked::after { color: var(--md-sys-color-surface); }

/* The label that wraps a checkbox, radio or switch: the 48px target. */
.m3-choice {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-height: var(--app-target);
  cursor: pointer;
  color: var(--md-sys-color-on-surface);
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
}
.m3-choice[hidden] { display: none; }
.m3-choice:has(> :is(.m3-checkbox, .m3-radio)) { padding-inline: 11px 0; }   /* the inset's room, so the layer never clips */

@media (prefers-reduced-motion: no-preference) {
  :is(.m3-checkbox, .m3-radio) {
    transition-property: background-color, box-shadow;
    transition-duration: var(--md-sys-motion-spring-default-effects-duration), var(--md-sys-motion-spring-default-effects-duration);
    transition-timing-function: var(--md-sys-motion-spring-default-effects), var(--md-sys-motion-spring-default-effects);
  }
  .m3-checkbox::after {
    transition: opacity var(--md-sys-motion-spring-fast-effects-duration) var(--md-sys-motion-spring-fast-effects);
  }
  .m3-radio::after {
    transition-property: scale, background-color;
    transition-duration: var(--md-sys-motion-spring-fast-spatial-duration), var(--md-sys-motion-spring-default-effects-duration);
    transition-timing-function: var(--md-sys-motion-spring-fast-spatial), var(--md-sys-motion-spring-default-effects);
  }
}

/* ── §3.18 Slider: <input type="range" class="m3-slider" style="--_v: 40%"> ──
   Gallery only. Track 16 (outer radius 8), active ink, inactive #333537, a
   6px gap each side of a 4x44 handle (2px wide while pressed), a 4px stop
   dot at the end. --_v is the value as a percentage (set by the server). */
.m3-slider {
  --_v: 50%;
  --_active: var(--md-sys-color-primary);
  --_inactive: var(--md-sys-color-secondary-container);
  --_hw: 4px;
  --_track-bg:
    radial-gradient(circle at calc(100% - 8px) 50%, var(--_active) 1.5px, transparent 2px),
    linear-gradient(to right, var(--_active) 0 calc(var(--_v) - 8px), transparent 0 calc(var(--_v) + 8px), var(--_inactive) 0);
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.m3-slider[hidden] { display: none; }
.m3-slider:is(:active, [data-state="pressed"]) { --_hw: 2px; }
.m3-slider:disabled {
  --_active: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
  --_inactive: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent);
  cursor: default;
}
.m3-slider::-webkit-slider-runnable-track {
  height: 16px;
  border-radius: var(--md-sys-shape-corner-small);
  background: var(--_track-bg);
}
.m3-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--_hw);
  height: 44px;
  margin-top: -14px;
  border: 0;
  border-radius: var(--app-shape-corner-mark);
  background: var(--_active);
}
/* No ::-moz-range-* rules: Chromium drops them at parse time (the CSSOM probe
   would count them as dropped rules) and Firefox is not a target; there the
   gallery's slider keeps the native look. */

/* ── §3.19 The M3E loading indicator: .m3-loading ──────────────────────────
   <span class="m3-loading [--inline] [--contained]" role="progressbar"
   aria-label="Loading"></span>. The label is always exactly "Loading".
   Every wait under ~5s with no measurable progress. NOT the model wait (the
   three full stops, K51) and never a spinner. Built from
   research/shape-motion-assets/md-loading-indicator.css (Compose's
   LoadingIndicator: SoftBurst > Cookie9 > Pentagon > Pill > Sunny > Cookie4 >
   Oval, one morph per 650ms, +90deg a morph, +360deg per 4666ms linear).
   The polygons are copied verbatim (verified output). The spring is
   regenerated (f12/gen-loading.mjs) to run the first 297ms of each 650ms step
   and then HOLD, which is Compose's visibilityThreshold 0.1. Under reduced
   motion the shape is one still SoftBurst. Shown after a 300ms delay, so a
   fast answer never flashes a shape. */
.m3-loading {
  --_size: var(--app-loading);
  --_loading-color: var(--md-sys-color-primary);
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: var(--_size);
  block-size: var(--_size);
  border-radius: var(--md-sys-shape-corner-full);
  opacity: 0;
  animation: m3-appear 0s 300ms forwards;
}
.m3-loading[hidden] { display: none; }
.m3-loading::before {
  content: "";
  inline-size: 68.53%;
  block-size: 68.53%;
  background: var(--_loading-color, var(--md-sys-color-primary));
  clip-path: polygon(50% 0.82%, 52.54% 1.5%, 54.83% 4.02%, 56.79% 7.16%, 58.51% 9.94%, 60.15% 12.14%, 61.97% 13.17%, 64.05% 13.39%, 66.67% 12.55%, 69.72% 11.3%, 73.16% 9.88%, 76.47% 9.24%, 78.9% 10.22%, 80.56% 12.26%, 80.94% 15.64%, 80.67% 19.33%, 80.43% 22.6%, 80.46% 25.33%, 81.33% 27.24%, 82.89% 28.64%, 85.5% 29.5%, 88.7% 30.28%, 92.32% 31.16%, 95.37% 32.58%, 96.77% 34.8%, 96.91% 37.43%, 95.22% 40.39%, 92.84% 43.21%, 90.73% 45.72%, 89.14% 47.95%, 88.73% 50%, 89.16% 52.05%, 90.77% 54.28%, 92.9% 56.79%, 95.31% 59.63%, 96.95% 62.58%, 96.77% 65.2%, 95.34% 67.4%, 92.24% 68.81%, 88.65% 69.69%, 85.46% 70.48%, 82.87% 71.35%, 81.33% 72.76%, 80.47% 74.68%, 80.46% 77.43%, 80.71% 80.71%, 81% 84.43%, 80.59% 87.77%, 78.9% 89.78%, 76.45% 90.73%, 73.12% 90.04%, 69.69% 88.65%, 66.66% 87.41%, 64.05% 86.59%, 61.97% 86.83%, 60.15% 87.88%, 58.52% 90.09%, 56.79% 92.9%, 54.84% 96.07%, 52.54% 98.54%, 50% 99.18%, 47.46% 98.5%, 45.17% 95.98%, 43.21% 92.84%, 41.49% 90.06%, 39.85% 87.86%, 38.03% 86.83%, 35.95% 86.61%, 33.33% 87.45%, 30.28% 88.7%, 26.84% 90.12%, 23.53% 90.76%, 21.1% 89.78%, 19.44% 87.74%, 19.06% 84.36%, 19.33% 80.67%, 19.57% 77.4%, 19.54% 74.67%, 18.67% 72.76%, 17.11% 71.36%, 14.5% 70.5%, 11.3% 69.72%, 7.68% 68.84%, 4.63% 67.42%, 3.23% 65.2%, 3.09% 62.57%, 4.78% 59.61%, 7.16% 56.79%, 9.27% 54.28%, 10.86% 52.05%, 11.27% 50%, 10.84% 47.95%, 9.23% 45.72%, 7.1% 43.21%, 4.69% 40.37%, 3.05% 37.42%, 3.23% 34.8%, 4.66% 32.6%, 7.76% 31.19%, 11.35% 30.31%, 14.54% 29.52%, 17.13% 28.65%, 18.67% 27.24%, 19.53% 25.32%, 19.54% 22.57%, 19.29% 19.29%, 19% 15.57%, 19.41% 12.23%, 21.1% 10.22%, 23.55% 9.27%, 26.88% 9.96%, 30.31% 11.35%, 33.34% 12.59%, 35.95% 13.41%, 38.03% 13.17%, 39.85% 12.12%, 41.48% 9.91%, 43.21% 7.1%, 45.16% 3.93%, 47.46% 1.46%);
}
.m3-loading--inline { --_size: var(--app-loading-inline); }
.m3-loading--contained {
  --_loading-color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
}
@media (prefers-reduced-motion: no-preference) {
  .m3-loading::before {
    animation:
      m3-loading-morph var(--app-motion-loading-morph) linear infinite,
      m3-loading-step var(--app-motion-loading-step) linear infinite,
      m3-loading-spin var(--app-motion-loading-spin) linear infinite;
  }
}
@keyframes m3-appear { to { opacity: 1; } }
@keyframes m3-loading-morph {
  0% { clip-path: polygon(50% 0.82%, 52.54% 1.5%, 54.83% 4.02%, 56.79% 7.16%, 58.51% 9.94%, 60.15% 12.14%, 61.97% 13.17%, 64.05% 13.39%, 66.67% 12.55%, 69.72% 11.3%, 73.16% 9.88%, 76.47% 9.24%, 78.9% 10.22%, 80.56% 12.26%, 80.94% 15.64%, 80.67% 19.33%, 80.43% 22.6%, 80.46% 25.33%, 81.33% 27.24%, 82.89% 28.64%, 85.5% 29.5%, 88.7% 30.28%, 92.32% 31.16%, 95.37% 32.58%, 96.77% 34.8%, 96.91% 37.43%, 95.22% 40.39%, 92.84% 43.21%, 90.73% 45.72%, 89.14% 47.95%, 88.73% 50%, 89.16% 52.05%, 90.77% 54.28%, 92.9% 56.79%, 95.31% 59.63%, 96.95% 62.58%, 96.77% 65.2%, 95.34% 67.4%, 92.24% 68.81%, 88.65% 69.69%, 85.46% 70.48%, 82.87% 71.35%, 81.33% 72.76%, 80.47% 74.68%, 80.46% 77.43%, 80.71% 80.71%, 81% 84.43%, 80.59% 87.77%, 78.9% 89.78%, 76.45% 90.73%, 73.12% 90.04%, 69.69% 88.65%, 66.66% 87.41%, 64.05% 86.59%, 61.97% 86.83%, 60.15% 87.88%, 58.52% 90.09%, 56.79% 92.9%, 54.84% 96.07%, 52.54% 98.54%, 50% 99.18%, 47.46% 98.5%, 45.17% 95.98%, 43.21% 92.84%, 41.49% 90.06%, 39.85% 87.86%, 38.03% 86.83%, 35.95% 86.61%, 33.33% 87.45%, 30.28% 88.7%, 26.84% 90.12%, 23.53% 90.76%, 21.1% 89.78%, 19.44% 87.74%, 19.06% 84.36%, 19.33% 80.67%, 19.57% 77.4%, 19.54% 74.67%, 18.67% 72.76%, 17.11% 71.36%, 14.5% 70.5%, 11.3% 69.72%, 7.68% 68.84%, 4.63% 67.42%, 3.23% 65.2%, 3.09% 62.57%, 4.78% 59.61%, 7.16% 56.79%, 9.27% 54.28%, 10.86% 52.05%, 11.27% 50%, 10.84% 47.95%, 9.23% 45.72%, 7.1% 43.21%, 4.69% 40.37%, 3.05% 37.42%, 3.23% 34.8%, 4.66% 32.6%, 7.76% 31.19%, 11.35% 30.31%, 14.54% 29.52%, 17.13% 28.65%, 18.67% 27.24%, 19.53% 25.32%, 19.54% 22.57%, 19.29% 19.29%, 19% 15.57%, 19.41% 12.23%, 21.1% 10.22%, 23.55% 9.27%, 26.88% 9.96%, 30.31% 11.35%, 33.34% 12.59%, 35.95% 13.41%, 38.03% 13.17%, 39.85% 12.12%, 41.48% 9.91%, 43.21% 7.1%, 45.16% 3.93%, 47.46% 1.46%); animation-timing-function: linear(0, 0.0071 1.3253%, 0.0286 2.742%, 0.0648 4.2501%, 0.1152 5.8496%, 0.1677 7.2663%, 0.2354 8.9115%, 0.5542 15.995%, 0.6305 17.7773%, 0.6987 19.4682%, 0.7699 21.3876%, 0.8326 23.2613%, 0.8868 25.0893%, 0.934 26.9173%, 0.9788 28.9738%, 1.0152 31.0303%, 1.0448 33.1782%, 1.067 35.3718%, 1.0825 37.6568%, 1.0918 40.1246%, 1.0948 42.7752%, 1.0916 45.7%, 1 45.7%, 1); }
  14.2857% { clip-path: polygon(50% 1.42%, 52.54% 1.63%, 55.02% 2.27%, 57.39% 3.34%, 59.6% 4.84%, 61.65% 6.52%, 63.73% 7.75%, 65.89% 8.6%, 68.2% 9.12%, 70.75% 9.28%, 73.45% 9.38%, 76.02% 9.93%, 78.41% 10.9%, 80.58% 12.24%, 82.49% 13.92%, 84.09% 15.91%, 85.36% 18.16%, 86.24% 20.66%, 86.73% 23.31%, 87.42% 25.7%, 88.42% 27.82%, 89.73% 29.76%, 91.42% 31.56%, 93.48% 33.31%, 95.24% 35.3%, 96.59% 37.52%, 97.53% 39.9%, 98.06% 42.39%, 98.16% 44.94%, 97.83% 47.49%, 97.05% 50%, 95.81% 52.4%, 94.64% 54.69%, 93.91% 56.95%, 93.55% 59.26%, 93.56% 61.67%, 93.97% 64.29%, 94.19% 66.96%, 93.95% 69.57%, 93.28% 72.05%, 92.2% 74.37%, 90.76% 76.47%, 88.97% 78.31%, 86.86% 79.85%, 84.45% 81.02%, 81.96% 81.96%, 79.84% 83.14%, 78.01% 84.59%, 76.4% 86.33%, 74.98% 88.47%, 73.54% 90.77%, 71.77% 92.72%, 69.73% 94.31%, 67.47% 95.52%, 65.05% 96.33%, 62.52% 96.72%, 59.92% 96.68%, 57.31% 96.18%, 54.76% 95.27%, 52.34% 94.69%, 50% 94.51%, 47.66% 94.69%, 45.24% 95.27%, 42.69% 96.18%, 40.08% 96.68%, 37.48% 96.72%, 34.95% 96.33%, 32.53% 95.52%, 30.27% 94.31%, 28.23% 92.72%, 26.46% 90.77%, 25.02% 88.47%, 23.6% 86.33%, 21.99% 84.59%, 20.16% 83.14%, 18.04% 81.96%, 15.55% 81.02%, 13.14% 79.85%, 11.03% 78.31%, 9.24% 76.47%, 7.8% 74.37%, 6.72% 72.05%, 6.05% 69.57%, 5.81% 66.96%, 6.03% 64.29%, 6.44% 61.67%, 6.45% 59.26%, 6.09% 56.95%, 5.36% 54.69%, 4.19% 52.4%, 2.95% 50%, 2.17% 47.49%, 1.84% 44.94%, 1.94% 42.39%, 2.47% 39.9%, 3.41% 37.52%, 4.76% 35.3%, 6.52% 33.31%, 8.58% 31.56%, 10.27% 29.76%, 11.58% 27.82%, 12.58% 25.7%, 13.27% 23.31%, 13.76% 20.66%, 14.64% 18.16%, 15.91% 15.91%, 17.51% 13.92%, 19.42% 12.24%, 21.59% 10.9%, 23.98% 9.93%, 26.55% 9.38%, 29.25% 9.28%, 31.8% 9.12%, 34.11% 8.6%, 36.27% 7.75%, 38.35% 6.52%, 40.4% 4.84%, 42.61% 3.34%, 44.98% 2.27%, 47.46% 1.63%); animation-timing-function: linear(0, 0.0071 1.3253%, 0.0286 2.742%, 0.0648 4.2501%, 0.1152 5.8496%, 0.1677 7.2663%, 0.2354 8.9115%, 0.5542 15.995%, 0.6305 17.7773%, 0.6987 19.4682%, 0.7699 21.3876%, 0.8326 23.2613%, 0.8868 25.0893%, 0.934 26.9173%, 0.9788 28.9738%, 1.0152 31.0303%, 1.0448 33.1782%, 1.067 35.3718%, 1.0825 37.6568%, 1.0918 40.1246%, 1.0948 42.7752%, 1.0916 45.7%, 1 45.7%, 1); }
  28.5714% { clip-path: polygon(50% 4.28%, 52.39% 4.45%, 54.73% 4.97%, 57% 5.82%, 59.14% 7%, 61.15% 8.4%, 63.07% 9.77%, 64.94% 11.08%, 66.76% 12.36%, 68.54% 13.62%, 70.29% 14.86%, 72.03% 16.08%, 73.76% 17.3%, 75.49% 18.53%, 77.23% 19.76%, 79% 21%, 80.8% 22.27%, 82.64% 23.57%, 84.53% 24.91%, 86.5% 26.3%, 88.55% 27.74%, 90.7% 29.26%, 92.91% 30.89%, 94.82% 32.79%, 96.35% 34.94%, 97.49% 37.27%, 98.24% 39.75%, 98.57% 42.31%, 98.49% 44.9%, 97.98% 47.49%, 97.15% 50%, 96.34% 52.43%, 95.55% 54.79%, 94.78% 57.09%, 94.03% 59.36%, 93.28% 61.6%, 92.54% 63.82%, 91.79% 66.04%, 91.05% 68.28%, 90.3% 70.53%, 89.53% 72.82%, 88.75% 75.16%, 87.95% 77.57%, 87.12% 80.06%, 86.25% 82.64%, 85.33% 85.33%, 84.08% 87.85%, 82.45% 90.07%, 80.49% 91.97%, 78.26% 93.52%, 75.8% 94.68%, 73.14% 95.42%, 70.35% 95.71%, 67.55% 95.72%, 64.85% 95.72%, 62.25% 95.72%, 59.72% 95.72%, 57.24% 95.72%, 54.8% 95.72%, 52.4% 95.72%, 50% 95.72%, 47.6% 95.72%, 45.2% 95.72%, 42.76% 95.72%, 40.28% 95.72%, 37.75% 95.72%, 35.15% 95.72%, 32.45% 95.72%, 29.65% 95.71%, 26.86% 95.42%, 24.2% 94.68%, 21.74% 93.52%, 19.51% 91.97%, 17.55% 90.07%, 15.92% 87.85%, 14.67% 85.33%, 13.75% 82.64%, 12.88% 80.06%, 12.05% 77.57%, 11.25% 75.16%, 10.47% 72.82%, 9.7% 70.53%, 8.95% 68.28%, 8.21% 66.04%, 7.46% 63.82%, 6.72% 61.6%, 5.97% 59.36%, 5.22% 57.09%, 4.45% 54.79%, 3.66% 52.43%, 2.85% 50%, 2.02% 47.49%, 1.51% 44.9%, 1.43% 42.31%, 1.76% 39.75%, 2.51% 37.27%, 3.65% 34.94%, 5.18% 32.79%, 7.09% 30.89%, 9.3% 29.26%, 11.45% 27.74%, 13.5% 26.3%, 15.47% 24.91%, 17.36% 23.57%, 19.2% 22.27%, 21% 21%, 22.77% 19.76%, 24.51% 18.53%, 26.24% 17.3%, 27.97% 16.08%, 29.71% 14.86%, 31.46% 13.62%, 33.24% 12.36%, 35.06% 11.08%, 36.93% 9.77%, 38.85% 8.4%, 40.86% 7%, 43% 5.82%, 45.27% 4.97%, 47.61% 4.45%); animation-timing-function: linear(0, 0.0071 1.3253%, 0.0286 2.742%, 0.0648 4.2501%, 0.1152 5.8496%, 0.1677 7.2663%, 0.2354 8.9115%, 0.5542 15.995%, 0.6305 17.7773%, 0.6987 19.4682%, 0.7699 21.3876%, 0.8326 23.2613%, 0.8868 25.0893%, 0.934 26.9173%, 0.9788 28.9738%, 1.0152 31.0303%, 1.0448 33.1782%, 1.067 35.3718%, 1.0825 37.6568%, 1.0918 40.1246%, 1.0948 42.7752%, 1.0916 45.7%, 1 45.7%, 1); }
  42.8571% { clip-path: polygon(50% 0.63%, 52.61% 0.26%, 55.25% 0.05%, 57.91% 0.07%, 60.55% 0.35%, 63.22% 0.65%, 65.88% 1.11%, 68.52% 1.75%, 71.12% 2.55%, 73.68% 3.53%, 76.17% 4.67%, 78.59% 5.97%, 80.93% 7.43%, 83.17% 9.04%, 85.3% 10.79%, 87.32% 12.68%, 89.21% 14.7%, 90.96% 16.83%, 92.57% 19.07%, 94.03% 21.41%, 95.33% 23.83%, 96.47% 26.32%, 97.45% 28.88%, 98.25% 31.48%, 98.89% 34.12%, 99.35% 36.78%, 99.65% 39.45%, 99.93% 42.09%, 99.95% 44.75%, 99.74% 47.39%, 99.37% 50%, 98.85% 52.56%, 98.19% 55.06%, 97.39% 57.51%, 96.45% 59.87%, 95.39% 62.16%, 94.22% 64.37%, 92.93% 66.48%, 91.54% 68.5%, 90.06% 70.41%, 88.49% 72.22%, 86.85% 73.93%, 85.2% 75.58%, 83.58% 77.2%, 81.98% 78.8%, 80.39% 80.39%, 78.8% 81.98%, 77.2% 83.58%, 75.58% 85.2%, 73.93% 86.85%, 72.22% 88.49%, 70.41% 90.06%, 68.5% 91.54%, 66.48% 92.93%, 64.37% 94.22%, 62.16% 95.39%, 59.87% 96.45%, 57.51% 97.39%, 55.06% 98.19%, 52.56% 98.85%, 50% 99.37%, 47.39% 99.74%, 44.75% 99.95%, 42.09% 99.93%, 39.45% 99.65%, 36.78% 99.35%, 34.12% 98.89%, 31.48% 98.25%, 28.88% 97.45%, 26.32% 96.47%, 23.83% 95.33%, 21.41% 94.03%, 19.07% 92.57%, 16.83% 90.96%, 14.7% 89.21%, 12.68% 87.32%, 10.79% 85.3%, 9.04% 83.17%, 7.43% 80.93%, 5.97% 78.59%, 4.67% 76.17%, 3.53% 73.68%, 2.55% 71.12%, 1.75% 68.52%, 1.11% 65.88%, 0.65% 63.22%, 0.35% 60.55%, 0.07% 57.91%, 0.05% 55.25%, 0.26% 52.61%, 0.63% 50%, 1.15% 47.44%, 1.81% 44.94%, 2.61% 42.49%, 3.55% 40.13%, 4.61% 37.84%, 5.78% 35.63%, 7.07% 33.52%, 8.46% 31.5%, 9.94% 29.59%, 11.51% 27.78%, 13.15% 26.07%, 14.8% 24.42%, 16.42% 22.8%, 18.02% 21.2%, 19.61% 19.61%, 21.2% 18.02%, 22.8% 16.42%, 24.42% 14.8%, 26.07% 13.15%, 27.78% 11.51%, 29.59% 9.94%, 31.5% 8.46%, 33.52% 7.07%, 35.63% 5.78%, 37.84% 4.61%, 40.13% 3.55%, 42.49% 2.61%, 44.94% 1.81%, 47.44% 1.15%); animation-timing-function: linear(0, 0.0071 1.3253%, 0.0286 2.742%, 0.0648 4.2501%, 0.1152 5.8496%, 0.1677 7.2663%, 0.2354 8.9115%, 0.5542 15.995%, 0.6305 17.7773%, 0.6987 19.4682%, 0.7699 21.3876%, 0.8326 23.2613%, 0.8868 25.0893%, 0.934 26.9173%, 0.9788 28.9738%, 1.0152 31.0303%, 1.0448 33.1782%, 1.067 35.3718%, 1.0825 37.6568%, 1.0918 40.1246%, 1.0948 42.7752%, 1.0916 45.7%, 1 45.7%, 1); }
  57.1429% { clip-path: polygon(50% 0.63%, 52.57% 0.95%, 55.02% 2.21%, 57.27% 4.11%, 59.37% 5.9%, 61.36% 7.6%, 63.25% 9.21%, 65.09% 10.69%, 67.09% 11.6%, 69.38% 11.96%, 71.85% 12.15%, 74.44% 12.36%, 77.19% 12.58%, 80.11% 12.81%, 82.89% 13.47%, 85.07% 14.93%, 86.64% 17.01%, 87.45% 19.67%, 87.69% 22.62%, 87.91% 25.38%, 88.12% 27.99%, 88.32% 30.48%, 88.6% 32.81%, 89.41% 34.87%, 90.83% 36.73%, 92.44% 38.63%, 94.14% 40.62%, 95.93% 42.73%, 97.84% 44.97%, 99.25% 47.42%, 99.69% 50%, 99.25% 52.58%, 97.84% 55.03%, 95.93% 57.27%, 94.14% 59.38%, 92.44% 61.37%, 90.83% 63.27%, 89.41% 65.13%, 88.6% 67.19%, 88.32% 69.52%, 88.12% 72.01%, 87.91% 74.62%, 87.69% 77.38%, 87.45% 80.33%, 86.64% 82.99%, 85.07% 85.07%, 82.89% 86.53%, 80.11% 87.19%, 77.19% 87.42%, 74.44% 87.64%, 71.85% 87.85%, 69.38% 88.04%, 67.09% 88.4%, 65.09% 89.31%, 63.25% 90.79%, 61.36% 92.4%, 59.37% 94.1%, 57.27% 95.89%, 55.02% 97.79%, 52.57% 99.05%, 50% 99.37%, 47.44% 98.83%, 45.03% 97.32%, 42.81% 95.43%, 40.72% 93.65%, 38.75% 91.97%, 36.88% 90.38%, 35.02% 89.02%, 32.97% 88.25%, 30.64% 88%, 28.18% 87.8%, 25.59% 87.59%, 22.85% 87.38%, 19.93% 87.13%, 17.3% 86.32%, 15.24% 84.76%, 13.79% 82.6%, 13.13% 79.86%, 12.89% 76.96%, 12.68% 74.24%, 12.47% 71.67%, 12.28% 69.22%, 11.96% 66.94%, 11.09% 64.94%, 9.66% 63.11%, 8.06% 61.24%, 6.39% 59.27%, 4.61% 57.19%, 2.72% 54.97%, 1.36% 52.55%, 0.93% 50%, 1.36% 47.45%, 2.72% 45.03%, 4.61% 42.81%, 6.39% 40.73%, 8.06% 38.76%, 9.66% 36.89%, 11.09% 35.06%, 11.96% 33.06%, 12.28% 30.78%, 12.47% 28.33%, 12.68% 25.76%, 12.89% 23.04%, 13.13% 20.14%, 13.79% 17.4%, 15.24% 15.24%, 17.3% 13.68%, 19.93% 12.87%, 22.85% 12.62%, 25.59% 12.41%, 28.18% 12.2%, 30.64% 12%, 32.97% 11.75%, 35.02% 10.98%, 36.88% 9.62%, 38.75% 8.03%, 40.72% 6.35%, 42.81% 4.57%, 45.03% 2.68%, 47.44% 1.17%); animation-timing-function: linear(0, 0.0071 1.3253%, 0.0286 2.742%, 0.0648 4.2501%, 0.1152 5.8496%, 0.1677 7.2663%, 0.2354 8.9115%, 0.5542 15.995%, 0.6305 17.7773%, 0.6987 19.4682%, 0.7699 21.3876%, 0.8326 23.2613%, 0.8868 25.0893%, 0.934 26.9173%, 0.9788 28.9738%, 1.0152 31.0303%, 1.0448 33.1782%, 1.067 35.3718%, 1.0825 37.6568%, 1.0918 40.1246%, 1.0948 42.7752%, 1.0916 45.7%, 1 45.7%, 1); }
  71.4286% { clip-path: polygon(50% 11.57%, 52.02% 11.47%, 54.08% 11.16%, 56.24% 10.59%, 58.57% 9.69%, 61.09% 8.6%, 63.81% 7.49%, 66.62% 6.7%, 69.47% 6.28%, 72.3% 6.23%, 75.09% 6.55%, 77.79% 7.21%, 80.37% 8.2%, 82.8% 9.5%, 85.05% 11.07%, 87.11% 12.89%, 88.93% 14.95%, 90.5% 17.2%, 91.8% 19.63%, 92.79% 22.21%, 93.45% 24.91%, 93.77% 27.7%, 93.72% 30.53%, 93.3% 33.38%, 92.51% 36.19%, 91.41% 38.91%, 90.32% 41.43%, 89.42% 43.76%, 88.85% 45.92%, 88.54% 47.98%, 88.45% 50%, 88.55% 52.02%, 88.86% 54.08%, 89.43% 56.25%, 90.34% 58.57%, 91.43% 61.1%, 92.54% 63.82%, 93.32% 66.63%, 93.74% 69.47%, 93.78% 72.31%, 93.46% 75.09%, 92.8% 77.79%, 91.8% 80.37%, 90.51% 82.8%, 88.93% 85.06%, 87.11% 87.11%, 85.05% 88.93%, 82.8% 90.5%, 80.36% 91.79%, 77.78% 92.78%, 75.08% 93.44%, 72.29% 93.75%, 69.46% 93.7%, 66.61% 93.28%, 63.8% 92.49%, 61.09% 91.38%, 58.56% 90.29%, 56.24% 89.4%, 54.08% 88.83%, 52.02% 88.53%, 50% 88.43%, 47.98% 88.53%, 45.92% 88.85%, 43.76% 89.42%, 41.43% 90.33%, 38.9% 91.42%, 36.18% 92.52%, 33.38% 93.31%, 30.53% 93.72%, 27.7% 93.77%, 24.92% 93.45%, 22.22% 92.78%, 19.64% 91.79%, 17.21% 90.49%, 14.96% 88.92%, 12.91% 87.09%, 11.09% 85.04%, 9.52% 82.78%, 8.23% 80.35%, 7.24% 77.77%, 6.58% 75.07%, 6.26% 72.28%, 6.31% 69.45%, 6.73% 66.61%, 7.53% 63.8%, 8.63% 61.09%, 9.72% 58.56%, 10.62% 56.24%, 11.18% 54.08%, 11.49% 52.02%, 11.59% 50%, 11.49% 47.98%, 11.17% 45.92%, 10.6% 43.76%, 9.7% 41.43%, 8.61% 38.91%, 7.5% 36.19%, 6.71% 33.38%, 6.29% 30.54%, 6.25% 27.71%, 6.57% 24.92%, 7.23% 22.23%, 8.22% 19.65%, 9.51% 17.22%, 11.09% 14.96%, 12.91% 12.91%, 14.96% 11.09%, 17.22% 9.51%, 19.65% 8.22%, 22.23% 7.23%, 24.92% 6.57%, 27.71% 6.25%, 30.54% 6.3%, 33.38% 6.71%, 36.19% 7.5%, 38.91% 8.6%, 41.43% 9.69%, 43.76% 10.59%, 45.92% 11.16%, 47.98% 11.47%); animation-timing-function: linear(0, 0.0071 1.3253%, 0.0286 2.742%, 0.0648 4.2501%, 0.1152 5.8496%, 0.1677 7.2663%, 0.2354 8.9115%, 0.5542 15.995%, 0.6305 17.7773%, 0.6987 19.4682%, 0.7699 21.3876%, 0.8326 23.2613%, 0.8868 25.0893%, 0.934 26.9173%, 0.9788 28.9738%, 1.0152 31.0303%, 1.0448 33.1782%, 1.067 35.3718%, 1.0825 37.6568%, 1.0918 40.1246%, 1.0948 42.7752%, 1.0916 45.7%, 1 45.7%, 1); }
  85.7143% { clip-path: polygon(50% 5.96%, 52.36% 5.03%, 54.82% 4.16%, 57.38% 3.39%, 60.05% 2.71%, 62.82% 2.16%, 65.67% 1.76%, 68.6% 1.54%, 71.58% 1.53%, 74.59% 1.75%, 77.58% 2.23%, 80.52% 3%, 83.37% 4.07%, 86.07% 5.46%, 88.58% 7.16%, 90.85% 9.15%, 92.84% 11.42%, 94.54% 13.93%, 95.93% 16.63%, 97% 19.48%, 97.77% 22.42%, 98.25% 25.41%, 98.47% 28.42%, 98.46% 31.4%, 98.24% 34.33%, 97.84% 37.18%, 97.29% 39.95%, 96.61% 42.62%, 95.84% 45.18%, 94.97% 47.64%, 94.04% 50%, 93.04% 52.26%, 92% 54.41%, 90.93% 56.48%, 89.82% 58.46%, 88.68% 60.36%, 87.52% 62.19%, 86.33% 63.95%, 85.13% 65.64%, 83.91% 67.28%, 82.67% 68.86%, 81.41% 70.4%, 80.13% 71.89%, 78.82% 73.34%, 77.5% 74.76%, 76.14% 76.14%, 74.76% 77.5%, 73.34% 78.82%, 71.89% 80.13%, 70.4% 81.41%, 68.86% 82.67%, 67.28% 83.91%, 65.64% 85.13%, 63.95% 86.33%, 62.19% 87.52%, 60.36% 88.68%, 58.46% 89.82%, 56.48% 90.93%, 54.41% 92%, 52.26% 93.04%, 50% 94.04%, 47.64% 94.97%, 45.18% 95.84%, 42.62% 96.61%, 39.95% 97.29%, 37.18% 97.84%, 34.33% 98.24%, 31.4% 98.46%, 28.42% 98.47%, 25.41% 98.25%, 22.42% 97.77%, 19.48% 97%, 16.63% 95.93%, 13.93% 94.54%, 11.42% 92.84%, 9.15% 90.85%, 7.16% 88.58%, 5.46% 86.07%, 4.07% 83.37%, 3% 80.52%, 2.23% 77.58%, 1.75% 74.59%, 1.53% 71.58%, 1.54% 68.6%, 1.76% 65.67%, 2.16% 62.82%, 2.71% 60.05%, 3.39% 57.38%, 4.16% 54.82%, 5.03% 52.36%, 5.96% 50%, 6.96% 47.74%, 8% 45.59%, 9.07% 43.52%, 10.18% 41.54%, 11.32% 39.64%, 12.48% 37.81%, 13.67% 36.05%, 14.87% 34.36%, 16.09% 32.72%, 17.33% 31.14%, 18.59% 29.6%, 19.87% 28.11%, 21.18% 26.66%, 22.5% 25.24%, 23.86% 23.86%, 25.24% 22.5%, 26.66% 21.18%, 28.11% 19.87%, 29.6% 18.59%, 31.14% 17.33%, 32.72% 16.09%, 34.36% 14.87%, 36.05% 13.67%, 37.81% 12.48%, 39.64% 11.32%, 41.54% 10.18%, 43.52% 9.07%, 45.59% 8%, 47.74% 6.96%); animation-timing-function: linear(0, 0.0071 1.3253%, 0.0286 2.742%, 0.0648 4.2501%, 0.1152 5.8496%, 0.1677 7.2663%, 0.2354 8.9115%, 0.5542 15.995%, 0.6305 17.7773%, 0.6987 19.4682%, 0.7699 21.3876%, 0.8326 23.2613%, 0.8868 25.0893%, 0.934 26.9173%, 0.9788 28.9738%, 1.0152 31.0303%, 1.0448 33.1782%, 1.067 35.3718%, 1.0825 37.6568%, 1.0918 40.1246%, 1.0948 42.7752%, 1.0916 45.7%, 1 45.7%, 1); }
  100% { clip-path: polygon(50% 0.82%, 52.54% 1.5%, 54.83% 4.02%, 56.79% 7.16%, 58.51% 9.94%, 60.15% 12.14%, 61.97% 13.17%, 64.05% 13.39%, 66.67% 12.55%, 69.72% 11.3%, 73.16% 9.88%, 76.47% 9.24%, 78.9% 10.22%, 80.56% 12.26%, 80.94% 15.64%, 80.67% 19.33%, 80.43% 22.6%, 80.46% 25.33%, 81.33% 27.24%, 82.89% 28.64%, 85.5% 29.5%, 88.7% 30.28%, 92.32% 31.16%, 95.37% 32.58%, 96.77% 34.8%, 96.91% 37.43%, 95.22% 40.39%, 92.84% 43.21%, 90.73% 45.72%, 89.14% 47.95%, 88.73% 50%, 89.16% 52.05%, 90.77% 54.28%, 92.9% 56.79%, 95.31% 59.63%, 96.95% 62.58%, 96.77% 65.2%, 95.34% 67.4%, 92.24% 68.81%, 88.65% 69.69%, 85.46% 70.48%, 82.87% 71.35%, 81.33% 72.76%, 80.47% 74.68%, 80.46% 77.43%, 80.71% 80.71%, 81% 84.43%, 80.59% 87.77%, 78.9% 89.78%, 76.45% 90.73%, 73.12% 90.04%, 69.69% 88.65%, 66.66% 87.41%, 64.05% 86.59%, 61.97% 86.83%, 60.15% 87.88%, 58.52% 90.09%, 56.79% 92.9%, 54.84% 96.07%, 52.54% 98.54%, 50% 99.18%, 47.46% 98.5%, 45.17% 95.98%, 43.21% 92.84%, 41.49% 90.06%, 39.85% 87.86%, 38.03% 86.83%, 35.95% 86.61%, 33.33% 87.45%, 30.28% 88.7%, 26.84% 90.12%, 23.53% 90.76%, 21.1% 89.78%, 19.44% 87.74%, 19.06% 84.36%, 19.33% 80.67%, 19.57% 77.4%, 19.54% 74.67%, 18.67% 72.76%, 17.11% 71.36%, 14.5% 70.5%, 11.3% 69.72%, 7.68% 68.84%, 4.63% 67.42%, 3.23% 65.2%, 3.09% 62.57%, 4.78% 59.61%, 7.16% 56.79%, 9.27% 54.28%, 10.86% 52.05%, 11.27% 50%, 10.84% 47.95%, 9.23% 45.72%, 7.1% 43.21%, 4.69% 40.37%, 3.05% 37.42%, 3.23% 34.8%, 4.66% 32.6%, 7.76% 31.19%, 11.35% 30.31%, 14.54% 29.52%, 17.13% 28.65%, 18.67% 27.24%, 19.53% 25.32%, 19.54% 22.57%, 19.29% 19.29%, 19% 15.57%, 19.41% 12.23%, 21.1% 10.22%, 23.55% 9.27%, 26.88% 9.96%, 30.31% 11.35%, 33.34% 12.59%, 35.95% 13.41%, 38.03% 13.17%, 39.85% 12.12%, 41.48% 9.91%, 43.21% 7.1%, 45.16% 3.93%, 47.46% 1.46%); }
}
@keyframes m3-loading-step {
  0% { rotate: 0deg; animation-timing-function: linear(0, 0.0071 1.3253%, 0.0286 2.742%, 0.0648 4.2501%, 0.1152 5.8496%, 0.1677 7.2663%, 0.2354 8.9115%, 0.5542 15.995%, 0.6305 17.7773%, 0.6987 19.4682%, 0.7699 21.3876%, 0.8326 23.2613%, 0.8868 25.0893%, 0.934 26.9173%, 0.9788 28.9738%, 1.0152 31.0303%, 1.0448 33.1782%, 1.067 35.3718%, 1.0825 37.6568%, 1.0918 40.1246%, 1.0948 42.7752%, 1.0916 45.7%, 1 45.7%, 1); }
  25% { rotate: 90deg; animation-timing-function: linear(0, 0.0071 1.3253%, 0.0286 2.742%, 0.0648 4.2501%, 0.1152 5.8496%, 0.1677 7.2663%, 0.2354 8.9115%, 0.5542 15.995%, 0.6305 17.7773%, 0.6987 19.4682%, 0.7699 21.3876%, 0.8326 23.2613%, 0.8868 25.0893%, 0.934 26.9173%, 0.9788 28.9738%, 1.0152 31.0303%, 1.0448 33.1782%, 1.067 35.3718%, 1.0825 37.6568%, 1.0918 40.1246%, 1.0948 42.7752%, 1.0916 45.7%, 1 45.7%, 1); }
  50% { rotate: 180deg; animation-timing-function: linear(0, 0.0071 1.3253%, 0.0286 2.742%, 0.0648 4.2501%, 0.1152 5.8496%, 0.1677 7.2663%, 0.2354 8.9115%, 0.5542 15.995%, 0.6305 17.7773%, 0.6987 19.4682%, 0.7699 21.3876%, 0.8326 23.2613%, 0.8868 25.0893%, 0.934 26.9173%, 0.9788 28.9738%, 1.0152 31.0303%, 1.0448 33.1782%, 1.067 35.3718%, 1.0825 37.6568%, 1.0918 40.1246%, 1.0948 42.7752%, 1.0916 45.7%, 1 45.7%, 1); }
  75% { rotate: 270deg; animation-timing-function: linear(0, 0.0071 1.3253%, 0.0286 2.742%, 0.0648 4.2501%, 0.1152 5.8496%, 0.1677 7.2663%, 0.2354 8.9115%, 0.5542 15.995%, 0.6305 17.7773%, 0.6987 19.4682%, 0.7699 21.3876%, 0.8326 23.2613%, 0.8868 25.0893%, 0.934 26.9173%, 0.9788 28.9738%, 1.0152 31.0303%, 1.0448 33.1782%, 1.067 35.3718%, 1.0825 37.6568%, 1.0918 40.1246%, 1.0948 42.7752%, 1.0916 45.7%, 1 45.7%, 1); }
  100% { rotate: 360deg; }
}
@keyframes m3-loading-spin { to { transform: rotate(360deg); } }

/* The host pattern (pure CSS, for htmx swaps): an element with
   .m3-loading-host that gets htmx's .htmx-request dims its children and shows
   the shape centred (in the first 320px of a tall host). Used by
   .split__detail (each row's open control carries hx-indicator="#<detail-id>"),
   workspace pane B, .route__slot and #cal-grid. */
.m3-loading-host { position: relative; }
/* ⚠️ THE DIM NAMES THE CHILDREN (`.is-waiting`, put on them by shell.js as the
   request is sent) — it is not "any child of a host htmx has marked". A rule
   that hangs `> *` off a class makes Chromium restyle the host's WHOLE SUBTREE
   whenever that class comes or goes, and htmx puts `.htmx-request` on a record
   at every press: with a long note open that was 4,267 elements, before the
   request had left (2026-10-11). The shape below is the host's own `::after`,
   which costs nothing. test_design check 13 refuses the old spelling. */
.m3-loading-host > .is-waiting { opacity: .38; }
.m3-loading-host.htmx-request::after {
  content: "";
  position: absolute;
  left: 50%;
  top: min(50%, 160px);
  width: 32.9px;
  height: 32.9px;
  translate: -50% -50%;
  background: var(--md-sys-color-primary);
  clip-path: polygon(50% 0.82%, 52.54% 1.5%, 54.83% 4.02%, 56.79% 7.16%, 58.51% 9.94%, 60.15% 12.14%, 61.97% 13.17%, 64.05% 13.39%, 66.67% 12.55%, 69.72% 11.3%, 73.16% 9.88%, 76.47% 9.24%, 78.9% 10.22%, 80.56% 12.26%, 80.94% 15.64%, 80.67% 19.33%, 80.43% 22.6%, 80.46% 25.33%, 81.33% 27.24%, 82.89% 28.64%, 85.5% 29.5%, 88.7% 30.28%, 92.32% 31.16%, 95.37% 32.58%, 96.77% 34.8%, 96.91% 37.43%, 95.22% 40.39%, 92.84% 43.21%, 90.73% 45.72%, 89.14% 47.95%, 88.73% 50%, 89.16% 52.05%, 90.77% 54.28%, 92.9% 56.79%, 95.31% 59.63%, 96.95% 62.58%, 96.77% 65.2%, 95.34% 67.4%, 92.24% 68.81%, 88.65% 69.69%, 85.46% 70.48%, 82.87% 71.35%, 81.33% 72.76%, 80.47% 74.68%, 80.46% 77.43%, 80.71% 80.71%, 81% 84.43%, 80.59% 87.77%, 78.9% 89.78%, 76.45% 90.73%, 73.12% 90.04%, 69.69% 88.65%, 66.66% 87.41%, 64.05% 86.59%, 61.97% 86.83%, 60.15% 87.88%, 58.52% 90.09%, 56.79% 92.9%, 54.84% 96.07%, 52.54% 98.54%, 50% 99.18%, 47.46% 98.5%, 45.17% 95.98%, 43.21% 92.84%, 41.49% 90.06%, 39.85% 87.86%, 38.03% 86.83%, 35.95% 86.61%, 33.33% 87.45%, 30.28% 88.7%, 26.84% 90.12%, 23.53% 90.76%, 21.1% 89.78%, 19.44% 87.74%, 19.06% 84.36%, 19.33% 80.67%, 19.57% 77.4%, 19.54% 74.67%, 18.67% 72.76%, 17.11% 71.36%, 14.5% 70.5%, 11.3% 69.72%, 7.68% 68.84%, 4.63% 67.42%, 3.23% 65.2%, 3.09% 62.57%, 4.78% 59.61%, 7.16% 56.79%, 9.27% 54.28%, 10.86% 52.05%, 11.27% 50%, 10.84% 47.95%, 9.23% 45.72%, 7.1% 43.21%, 4.69% 40.37%, 3.05% 37.42%, 3.23% 34.8%, 4.66% 32.6%, 7.76% 31.19%, 11.35% 30.31%, 14.54% 29.52%, 17.13% 28.65%, 18.67% 27.24%, 19.53% 25.32%, 19.54% 22.57%, 19.29% 19.29%, 19% 15.57%, 19.41% 12.23%, 21.1% 10.22%, 23.55% 9.27%, 26.88% 9.96%, 30.31% 11.35%, 33.34% 12.59%, 35.95% 13.41%, 38.03% 13.17%, 39.85% 12.12%, 41.48% 9.91%, 43.21% 7.1%, 45.16% 3.93%, 47.46% 1.46%);
  opacity: 0;
  pointer-events: none;
  animation: m3-appear 0s 300ms forwards;
}
@media (prefers-reduced-motion: no-preference) {
  .m3-loading-host.htmx-request::after {
    animation:
      m3-appear 0s 300ms forwards,
      m3-loading-morph var(--app-motion-loading-morph) linear infinite,
      m3-loading-step var(--app-motion-loading-step) linear infinite,
      m3-loading-spin var(--app-motion-loading-spin) linear infinite;
  }
}

/* ── §3.20 Progress indicators: .m3-progress ───────────────────────────────
   LINEAR DETERMINATE: .m3-progress > .m3-progress__bar[style="width: N%"]
   (.meter > .meter__fill is an alias, so the test-pinned inline widths stay).
   Track 4 (#333537), bar ink, a 4px gap in the GROUND colour after the bar
   (the bar's outline, clipped top and bottom by the track; the host sets
   --_ground to the colour under the meter), and a 4px stop dot at the end.
   .meter--warn does NOT change the fill: a fill is not a warning colour; the
   value text beside it turns error (§5.1). */
.m3-progress, .meter {
  --_track: var(--md-sys-color-secondary-container);
  --_bar: var(--md-sys-color-primary);
  position: relative;
  box-sizing: border-box;
  display: block;
  min-width: 0;
  height: var(--app-progress-h);
  border-radius: var(--app-shape-corner-mark);
  overflow: hidden;
  background: var(--_track);
}
:is(.m3-progress, .meter)[hidden] { display: none; }
.meter { flex: 1 1 auto; }
:is(.m3-progress__bar, .meter__fill) {
  display: block;
  height: 100%;
  border-radius: var(--app-shape-corner-mark);
  background: var(--_bar);
  outline: 4px solid var(--_ground, var(--md-sys-color-surface-container));
}
:is(.m3-progress:not(.m3-progress--indeterminate, .m3-progress--wavy), .meter)::after {   /* the stop dot */
  content: "";
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  width: 4px;
  height: 4px;
  border-radius: var(--app-shape-corner-mark);
  background: var(--_bar);
}

/* LINEAR INDETERMINATE (.m3-progress--indeterminate; .navbusy reuses it):
   Compose's M3E timing, two segments in a 1750ms loop. Segment 1's head
   0->100% over 0-1000ms, its tail over 250-1250ms; segment 2's head over
   650-1500ms, its tail over 900-1750ms; every edge on emphasized-accelerate.
   The four edges are registered properties animated on the element; the
   track (::before) and the bar (::after) are masked by hard-stop gradients
   built from them, with a 4px hole on each side of each segment. A stop
   placed before an earlier one is clamped to it, so a zero-width segment
   draws nothing. */
@property --_s1h { syntax: "<percentage>"; inherits: true; initial-value: 0%; }   /* segment 1 head */
@property --_s1t { syntax: "<percentage>"; inherits: true; initial-value: 0%; }   /* segment 1 tail */
@property --_s2h { syntax: "<percentage>"; inherits: true; initial-value: 0%; }
@property --_s2t { syntax: "<percentage>"; inherits: true; initial-value: 0%; }
@keyframes m3-lp-s1h { 0% { --_s1h: 0%; animation-timing-function: var(--md-sys-motion-easing-emphasized-accelerate); } 57.143%, 100% { --_s1h: 100%; } }
@keyframes m3-lp-s1t { 0%, 14.286% { --_s1t: 0%; animation-timing-function: var(--md-sys-motion-easing-emphasized-accelerate); } 71.429%, 100% { --_s1t: 100%; } }
@keyframes m3-lp-s2h { 0%, 37.143% { --_s2h: 0%; animation-timing-function: var(--md-sys-motion-easing-emphasized-accelerate); } 85.714%, 100% { --_s2h: 100%; } }
@keyframes m3-lp-s2t { 0%, 51.429% { --_s2t: 0%; animation-timing-function: var(--md-sys-motion-easing-emphasized-accelerate); } 100% { --_s2t: 100%; } }

.m3-progress--indeterminate {
  position: relative;
  display: block;
  height: var(--app-progress-h);
  overflow: hidden;
  background: none;
}
.m3-progress--indeterminate[hidden] { display: none; }
.m3-progress--indeterminate::before, .m3-progress--indeterminate::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--app-shape-corner-mark);
}
.m3-progress--indeterminate::before {                 /* the track, with a hole (segment + 4px each side) under each segment */
  background: var(--md-sys-color-secondary-container);
  mask-image: linear-gradient(to right,
    black calc(var(--_s2t) - 4px), transparent 0 calc(var(--_s2h) + 4px),
    black 0 calc(var(--_s1t) - 4px), transparent 0 calc(var(--_s1h) + 4px), black 0);
}
.m3-progress--indeterminate::after {                  /* the two segments; segment 2 trails segment 1 */
  background: var(--md-sys-color-primary);
  mask-image: linear-gradient(to right,
    transparent var(--_s2t), black 0 var(--_s2h), transparent 0 var(--_s1t), black 0 var(--_s1h), transparent 0);
}
@media (prefers-reduced-motion: no-preference) {
  .m3-progress--indeterminate {
    animation:
      m3-lp-s1h var(--app-motion-progress) infinite, m3-lp-s1t var(--app-motion-progress) infinite,
      m3-lp-s2h var(--app-motion-progress) infinite, m3-lp-s2t var(--app-motion-progress) infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .m3-progress--indeterminate::before { display: none; }
  .m3-progress--indeterminate::after { mask-image: none; opacity: .38; }       /* a still, full bar */
}

/* LINEAR WAVY INDETERMINATE (.m3-progress--wavy; the bank refresh): the same
   two segments on the same four edges, drawn as a wave (wavelength 20,
   amplitude 3, stroke 4) over the flat 4px track with its holes. The wave is
   the sine mask INTERSECTED with the segment gradient. */
.m3-progress--wavy {
  position: relative;
  display: block;
  height: var(--app-progress-wavy-h);
  overflow: hidden;
  background: none;
}
.m3-progress--wavy[hidden] { display: none; }
.m3-progress--wavy::before {
  content: "";
  position: absolute;
  inset: 3px 0;
  border-radius: var(--app-shape-corner-mark);
  background: var(--md-sys-color-secondary-container);
  mask-image: linear-gradient(to right,
    black calc(var(--_s2t) - 4px), transparent 0 calc(var(--_s2h) + 4px),
    black 0 calc(var(--_s1t) - 4px), transparent 0 calc(var(--_s1h) + 4px), black 0);
}
.m3-progress--wavy::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--md-sys-color-primary);
  mask-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10'%3E%3Cpath d='M0 5Q5 -1 10 5T20 5' fill='none' stroke='black' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E"),
    linear-gradient(to right, transparent var(--_s2t), black 0 var(--_s2h), transparent 0 var(--_s1t), black 0 var(--_s1h), transparent 0);
  mask-size: 20px 10px, 100% 100%;
  mask-repeat: repeat-x, no-repeat;
  mask-position: 0 50%, 0 0;
  mask-composite: intersect;
}
@media (prefers-reduced-motion: no-preference) {
  .m3-progress--wavy {
    animation:
      m3-lp-s1h var(--app-motion-progress) infinite, m3-lp-s1t var(--app-motion-progress) infinite,
      m3-lp-s2h var(--app-motion-progress) infinite, m3-lp-s2t var(--app-motion-progress) infinite;
  }
  .m3-progress--wavy::after { animation: m3-wave var(--app-motion-wave) linear infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .m3-progress--wavy::before { display: none; }
  .m3-progress--wavy::after {                         /* the still wave at full width */
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10'%3E%3Cpath d='M0 5Q5 -1 10 5T20 5' fill='none' stroke='black' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
    mask-size: 20px 10px;
    mask-repeat: repeat-x;
    mask-position: 0 50%;
  }
}
@keyframes m3-wave { to { mask-position: -20px 50%, 0 0; } }

/* ── §3.21 Empty states ────────────────────────────────────────────────────
   ONE muted line, no icon, no card (K15). An empty state is a claim: draw it
   only once something has answered. */
.empty, .people__empty, .pane__empty, .column__empty, .row--empty, .spine__empty, .convos__empty, .picker__none {
  --_container: transparent;
  margin: 0;
  padding: 16px;
  background: none;
  color: var(--app-color-on-surface-low);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
  font-weight: var(--md-sys-typescale-body-medium-weight);
  min-height: 0;
}
/* The one empty-pane component: an empty workspace pane, Knowledge's welcome. */
.pane__blank {
  box-sizing: border-box;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  height: 100%;
  padding: 24px;
  text-align: center;
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
}
.pane__blank[hidden] { display: none; }
.pane__blank > .ico { --_icon: var(--app-icon-size-3xl); --_opsz: 40; color: var(--md-sys-color-on-surface-variant); }
.pane__blank p { margin: 0; }
.pane__blank__detail, .pane__blank small {
  color: var(--app-color-on-surface-low);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
}

/* ── §3.22 Badges: a neutral count, a grey pill (D9). Not an alert. ──────── */
.m3-badge {
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: var(--app-badge-h);
  height: var(--app-badge-h);
  padding: 0 4px;
  border-radius: var(--md-sys-shape-corner-small);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
  font-weight: var(--md-sys-typescale-label-small-weight);
  font-variant-numeric: tabular-nums;
}
.m3-badge[hidden] { display: none; }
.m3-badge--dot {
  min-width: var(--app-badge-dot);
  width: var(--app-badge-dot);
  height: var(--app-badge-dot);
  padding: 0;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-on-surface-variant);
  font-size: 0;
}

/* ── §3.24 An inline glyph after text (.field__ext, the News report mark,
   .fab__hand): 20px, on-surface-variant, baseline-shifted. open_in_new is the
   ONE "leads somewhere" mark (K4). */
.m3-inline-icon, .field__ext {
  --_icon: var(--app-icon-size-medium);
  --_opsz: 20;
  color: var(--md-sys-color-on-surface-variant);
  vertical-align: -4px;
  margin-inline-start: 4px;
}

/* ── §3.25 Dividers. No full-height rule between columns (DM). ──────────── */
hr.m3-divider, .m3-divider {
  display: block;
  height: 1px;
  margin: 8px 0;
  border: 0;
  background: var(--md-sys-color-outline-variant);
}
.m3-divider[hidden] { display: none; }
.m3-divider--inset { margin-inline: 16px; }

/* ── §3.26 The error banner: .err (and .formerr, .notice--bad, .kbr__error,
   .login__error). Red is a TEXT accent: a 12% wash, red text, no red fill and
   no red border (answer 1). role="alert" stays in the markup. */
.err, .formerr, .notice--bad, .kbr__error, .login__error {
  box-sizing: border-box;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 0;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--app-color-error-wash);
  color: var(--md-sys-color-error);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
  font-weight: var(--md-sys-typescale-body-medium-weight);
}
:is(.err, .formerr, .notice--bad, .kbr__error, .login__error)[hidden] { display: none; }
:is(.err, .formerr, .notice--bad, .kbr__error, .login__error)::before {
  content: "error";
  flex: none;
  font-family: var(--app-typeface-icon);
  font-size: var(--app-icon-size-medium);
  line-height: var(--app-icon-size-medium);
  font-weight: normal;
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "opsz" 20;
}

/* ── §3.27 Notices: .notice (default info; data-icon picks another glyph) ── */
.notice {
  box-sizing: border-box;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
}
.notice[hidden] { display: none; }
.notice::before {
  content: "info";
  flex: none;
  color: var(--md-sys-color-on-surface-variant);
  font-family: var(--app-typeface-icon);
  font-size: var(--app-icon-size-medium);
  line-height: var(--app-icon-size-medium);
  font-weight: normal;
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "opsz" 20;
}
.notice[data-icon]::before { content: attr(data-icon); }
/* .notice.notice--bad is the error banner (§3.26), whatever .notice says. */
.notice.notice--bad { background: var(--app-color-error-wash); color: var(--md-sys-color-error); }
.notice.notice--bad::before { content: "error"; color: inherit; }
.notice__actions { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-block: -12px; }
.notice__actions[hidden] { display: none; }

/* ── §3.28 Record parts: the tier's shared detail markup ───────────────────
   .card-detail sits in the reading region (no fill of its own). */
.card-detail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-detail[hidden] { display: none; }
.card-detail__head { display: flex; align-items: center; gap: 16px; min-width: 0; margin: 0; }
.card-detail__head[hidden] { display: none; }
.card-detail__head h2 {
  margin: 0;
  min-width: 0;
  color: var(--md-sys-color-on-surface);
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-headline-small-size);
  line-height: var(--md-sys-typescale-headline-small-line-height);
  font-weight: var(--md-sys-typescale-emphasized-headline-small-weight);
  font-variation-settings: "ROND" var(--md-sys-typescale-emphasized-rond);
  overflow-wrap: anywhere;
}
.card-detail__head--stacked { flex-direction: column; align-items: flex-start; gap: 4px; }
.card-detail__sub {
  margin: 0;
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
}
/* The actions: a standard button group (§3.5) that wraps. */
.card-detail__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; padding: 0; }
.card-detail__actions[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .card-detail__actions { --_grow: 12px; }
  .card-detail__actions > :is(.m3-btn, .btn):active { padding-inline: calc(var(--_pad) + var(--_grow) / 2); }
  .card-detail__actions > :is(.m3-btn, .btn):has(+ :is(.m3-btn, .btn):active) { padding-inline-end: calc(var(--_pad) - var(--_grow) / 2); }
  .card-detail__actions > :is(.m3-btn, .btn):active + :is(.m3-btn, .btn) { padding-inline-start: calc(var(--_pad) - var(--_grow) / 2); }
  .card-detail__actions > :is(.m3-btn, .btn):first-child:active { padding-inline: var(--_pad) calc(var(--_pad) + var(--_grow)); }
  .card-detail__actions > :is(.m3-btn, .btn):last-child:active { padding-inline: calc(var(--_pad) + var(--_grow)) var(--_pad); }
  .card-detail__actions > :is(.m3-btn, .btn):first-child:active + :is(.m3-btn, .btn) { padding-inline-start: calc(var(--_pad) - var(--_grow)); }
  .card-detail__actions > :is(.m3-btn, .btn):has(+ :is(.m3-btn, .btn):last-child:active) { padding-inline-end: calc(var(--_pad) - var(--_grow)); }
}
/* The foot: its text is test-pinned on several pages; no hairline. */
.card-detail__foot {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  color: var(--app-color-on-surface-low);
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line-height);
}

/* .field: a read-only property section. */
.field { display: grid; gap: 4px; margin: 0; min-width: 0; }
.field[hidden] { display: none; }
.field h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-title-small-size);
  line-height: var(--md-sys-typescale-title-small-line-height);
  font-weight: var(--md-sys-typescale-title-small-weight);
  letter-spacing: 0;
  text-transform: none;
}
.field h3 > .ico { --_icon: var(--app-icon-size-medium); --_opsz: 20; }
.field__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: var(--app-target);
  margin: 0;
  color: var(--md-sys-color-on-surface);
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
  overflow-wrap: anywhere;
}
.field__row[hidden] { display: none; }
.field__row a { color: var(--app-color-accent); text-decoration: none; }
.field__row a:hover { text-decoration: underline; }
/* .field__tag is a label chip (§3.6). */
.field__tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--md-sys-shape-corner-small);
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  font-weight: var(--md-sys-typescale-label-medium-weight);
}
.field__tag[hidden] { display: none; }


/* ═══════════════════════════════════════════════════════ GALLERY LAYOUT ══ */
/* /gallery (spec §6): every component in every state, for visual checks.
   Forced states are the [data-state] twins written into each component. */
.gallery {
  display: grid;
  gap: 48px;
  padding: 24px;
  min-width: 0;
}
.gallery__section { display: grid; gap: 16px; min-width: 0; }
.gallery__section > h2 {
  margin: 0;
  color: var(--md-sys-color-on-surface);
  font-family: var(--md-ref-typeface-brand);
  font-size: var(--md-sys-typescale-title-large-size);
  line-height: var(--md-sys-typescale-title-large-line-height);
  font-weight: var(--md-sys-typescale-title-large-weight);
}
.gallery__section > h3 {
  margin: 8px 0 0;
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-title-small-size);
  line-height: var(--md-sys-typescale-title-small-line-height);
  font-weight: var(--md-sys-typescale-title-small-weight);
}
.gallery__row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; min-width: 0; }
.gallery__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; min-width: 0; }
.gallery__row[hidden], .gallery__grid[hidden], .gallery__section[hidden] { display: none; }
.gallery__cap {                                 /* a caption under a specimen */
  display: block;
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
  font-weight: var(--md-sys-typescale-label-small-weight);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.gallery__item { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.gallery__swatch {
  width: 96px;
  height: 56px;
  border-radius: var(--md-sys-shape-corner-small);
  box-shadow: inset 0 0 0 1px var(--md-sys-color-outline-variant);
}
.gallery__shape {
  display: grid;
  place-items: center;
  width: 96px;
  height: 64px;
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-label-small-size);
}
.gallery__elev {
  display: grid;
  place-items: center;
  width: 120px;
  height: 80px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-label-small-size);
}
.gallery__ground {                              /* a #131314 plate, for what must be seen on the content ground */
  padding: 24px;
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface);
}
.gallery__scrollbox {                           /* the 240px box the 20-item list scrolls in */
  height: 240px;
  overflow-y: auto;
  scrollbar-width: none;
  max-width: 420px;
}
.gallery__scrollbox::-webkit-scrollbar { display: none; }
.gallery__type-line { margin: 0; overflow-wrap: anywhere; }
