/* =========================================================================
   Avengers · Liquid Glass design system                  liquid-glass.css
   -------------------------------------------------------------------------
   Three layers, following Apple's HIG (Materials, macOS Tahoe / iOS 26):

     1. Wallpaper   the body background, a vivid mesh gradient the user picks
     2. Content     readable standard material (.material, .card). Never glass.
     3. Controls    Liquid Glass, floating above content (.glass, sidebar,
                    toolbar groups, composer, popovers, sheets, palette, toasts)

   Glass is for the control and navigation layer only, and sparingly.
   Read README.md before building a page on this file.

   Sections
     0  Tokens (light)          9  Buttons and icon buttons
     1  Dark tokens             10 Segmented control, tabs, switch
     2  Accents                 11 Chips, grades, status, locks
     3  Wallpapers              12 File types, file chips, file rows, meter
     4  Density                 13 Inputs, text areas, composer
     5  Accessibility tokens    14 Sidebar, toolbar
     6  Base and typography     15 Popover, menu, citation, sheet
     7  Glass                   16 Toast, command palette
     8  Content material        17 Progress, spinner, timeline, avatar
                                18 Scroll edge, drop overlay, empty state
                                19 Utilities, keyframes, a11y fallbacks
   v3 (ease of use, touch and phone; see the block at the end of the file)
     20 Grade explanations      25 Bottom sheets and present()
     21 Private pill, privacy   26 Accessibility floors (two-tone focus ring)
     22 Options pill and menu   27 Touch density (pointer: coarse)
     23 Coach marks             28 Phone: iOS type scale, banners, palette,
     24 Files react, iWork         safe areas, tab bar, auto-hide, file rows
        badges, citation pager  29 Dark, contrast, transparency, hidden tab
                                30 Canonical patterns: verdict card, question
                                   bubble, welcome strip
   v4 (the landing screen; see ../../landing-pearl.md)
     31 Landing: hello header, summary tiles, paper card in a pocket, dials,
        two-stop timeline, round buttons, suggestion rows, the dock and the
        ask sheet, the listening wave
   Motion: v3 components use --spring-smooth / --spring-snappy / --spring-bouncy /
   --ease-exit from motion.css when it is loaded, with built-in fallbacks.
   ========================================================================= */


/* Fonts: served from this app (fonts/), latin and latin-extended only; the browser fetches a file only when
   a page uses a character in its range. Both are variable: one file holds every weight (and Newsreader its
   optical sizes, which font-optical-sizing: auto picks for each size). */
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/hanken-grotesk-latin.woff2") format("woff2-variations"), url("fonts/hanken-grotesk-latin.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/hanken-grotesk-latin-ext.woff2") format("woff2-variations"), url("fonts/hanken-grotesk-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("fonts/newsreader-latin.woff2") format("woff2-variations"), url("fonts/newsreader-latin.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("fonts/newsreader-latin-ext.woff2") format("woff2-variations"), url("fonts/newsreader-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* 0  TOKENS (LIGHT) ======================================================= */
:root {
  color-scheme: light;

  /* Type (14 October 2026, after claude.com): headings in a serif, everything else in a grotesque sans.
     Newsreader and Hanken Grotesk are open-licensed (SIL OFL 1.1, fonts/OFL-*.txt) and served from this
     app (fonts/), never from a font service. The system fonts follow, for the moment before they load. */
  --font-text: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Newsreader", ui-serif, "New York", Georgia, "Times New Roman", serif;
  --fw-display: 500;            /* headings: medium, as Claude's are, never bold */
  --ls-display: 0em;            /* a serif needs no tightening at title sizes */
  --ls-display-big: -.012em;    /* a little at the largest sizes */
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Apple text styles (size / line height) */
  --fs-large-title: 34px; --lh-large-title: 41px;
  --fs-title-1: 28px;     --lh-title-1: 34px;
  --fs-title-2: 22px;     --lh-title-2: 28px;
  --fs-title-3: 20px;     --lh-title-3: 25px;
  --fs-headline: 15px;    --lh-headline: 20px;
  --fs-body: 15px;        --lh-body: 22px;
  --fs-callout: 14px;     --lh-callout: 20px;
  --fs-subheadline: 13px; --lh-subheadline: 18px;
  --fs-footnote: 12px;    --lh-footnote: 16px;
  --fs-caption: 11px;     --lh-caption: 14px;

  /* Concentric radii: inner radius = outer radius − padding */
  --r-outer: 28px;   /* window-level panels: sidebar, composer, sheet, palette */
  --r-card: 20px;    /* cards, popovers */
  --r-inner: 14px;   /* rows, wells, file chips */
  --r-small: 10px;   /* inputs, small tiles */
  --r-xs: 6px;
  --r-capsule: 999px;
  --r-button: 10px;  /* buttons, icon buttons, the send key (Ink, 15 October) */
  --r-button-sm: 8px; /* small buttons, chips, the options and privacy pills */
  --r-composer: 20px; /* the ask bar: the send key's 10px plus the bar's 10px padding */

  /* Spacing (4 pt grid) */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-7: 32px; --space-8: 40px;
  --space-9: 56px; --space-10: 80px;

  /* Control metrics */
  --control-h-xs: 24px;
  --control-h-sm: 28px;
  --control-h: 32px;
  --control-h-lg: 40px;
  --row-h: 36px;
  --inset: 12px;            /* floating layer inset from the window edge */
  --sidebar-w: 272px;
  --toolbar-h: 52px;

  /* Motion: quick, spring-like (refined with linear() where supported) */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-smooth: cubic-bezier(.32, .72, 0, 1);
  --ease-spring: cubic-bezier(.34, 1.3, .64, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --dur-1: 150ms;
  --dur-2: 240ms;
  --dur-3: 350ms;
  --dur-spring: 560ms;

  /* Apple system colours (light) */
  --red: #FF3B30;   --orange: #FF9500; --yellow: #FFCC00; --green: #34C759;
  --mint: #00C7BE;  --teal: #30B0C7;   --cyan: #32ADE6;   --blue: #0A66FF;
  --indigo: #5856D6; --purple: #AF52DE; --pink: #FF2D55;  --brown: #A2845E;
  --gray: #8E8E93;

  /* Text-safe inks: ≥ 4.5:1 on content material */
  --red-ink: #C40012;    --orange-ink: #A04600; --yellow-ink: #806200;
  --green-ink: #177A33;  --teal-ink: #08707F;   --blue-ink: #0062DE;
  --indigo-ink: #4A47C9; --purple-ink: #8A3FB8; --pink-ink: #C41A44;
  --gray-ink: #5E5E63;

  /* Fills behind white text: ≥ 4.5:1 with #fff */
  --blue-fill: #0A66FF;   --purple-fill: #9B45C8; --pink-fill: #E0244E;
  --orange-fill: #BF5600; --green-fill: #1F8236;  --indigo-fill: #5856D6;
  --graphite-fill: #636369; --red-fill: #D92B21;

  /* Labels (primary → quaternary) */
  --label-1: rgba(0, 0, 0, .88);
  --label-2: rgba(0, 0, 0, .68);
  --label-3: rgba(0, 0, 0, .58);
  --label-4: rgba(0, 0, 0, .26);   /* decoration only, never body text */
  --on-accent: #FFFFFF;

  /* Fills and separators (Apple systemFill family) */
  --fill-1: rgba(120, 120, 128, .22);
  --fill-2: rgba(120, 120, 128, .16);
  --fill-3: rgba(118, 118, 128, .12);
  --fill-4: rgba(116, 116, 128, .07);
  --separator: rgba(60, 60, 67, .14);
  --separator-strong: rgba(60, 60, 67, .26);

  /* Content material (standard, readable, never glass) */
  --material-bg: rgba(255, 255, 255, .86);
  --material-bg-thick: rgba(255, 255, 255, .95);
  --material-filter: blur(30px) saturate(150%);
  --material-edge: rgba(0, 0, 0, .06);
  --material-shadow: 0 0 0 .5px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px -12px rgba(16, 24, 48, .14);
  --well-bg: rgba(116, 116, 128, .07);
  --chip-surface: rgba(255, 255, 255, .82);

  /* Fields */
  --field-bg: rgba(255, 255, 255, .78);
  --field-border: rgba(60, 60, 67, .18);
  --field-border-hover: rgba(60, 60, 67, .3);

  /* Liquid Glass (regular / strong / clear) */
  --glass-bg: rgba(255, 255, 255, .36);
  --glass-bg-hover: rgba(255, 255, 255, .5);
  --glass-bg-strong: rgba(255, 255, 255, .7);
  --glass-bg-clear: rgba(255, 255, 255, .08);
  --glass-dim: rgba(0, 0, 0, .35);
  --glass-filter: blur(16px) saturate(200%) brightness(1.08);
  --glass-filter-strong: blur(32px) saturate(190%) brightness(1.08);
  --glass-filter-clear: blur(3px) saturate(170%) brightness(1.04);
  --glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, .28) 0%, rgba(255, 255, 255, .05) 40%, rgba(255, 255, 255, 0) 58%);
  --glass-rim-a: rgba(255, 255, 255, 1);     /* top-left: brightest */
  --glass-rim-b: rgba(255, 255, 255, .26);   /* flanks */
  --glass-rim-c: rgba(255, 255, 255, .8);    /* bottom-right: refracted light */
  /* Edge cues that read as thick, curved glass: crisp highlights on the
     top-left and bottom-right inner edges, light gathering around the rim,
     and a brighter band along the bottom. */
  --glass-inner:
    inset 1px 1.5px 1px -.5px rgba(255, 255, 255, .95),
    inset -1px -1.5px 1px -.5px rgba(255, 255, 255, .6),
    inset 0 0 0 .5px rgba(255, 255, 255, .35),
    inset 0 0 16px rgba(255, 255, 255, .26),
    inset 0 -12px 20px -16px rgba(255, 255, 255, .9);
  --glass-shadow:
    0 0 0 .5px rgba(0, 0, 0, .07),
    0 1px 1px rgba(16, 24, 48, .05),
    0 3px 8px -2px rgba(16, 24, 48, .08),
    0 14px 34px -10px rgba(16, 24, 48, .2),
    0 30px 70px -28px rgba(16, 24, 48, .22);
  --glass-shadow-sm:
    0 0 0 .5px rgba(0, 0, 0, .07),
    0 1px 2px rgba(16, 24, 48, .07),
    0 6px 14px -6px rgba(16, 24, 48, .2);
  --spec-color: rgba(255, 255, 255, .55);
  --spec-rim: .95;

  /* Overlays */
  --scrim: rgba(18, 22, 34, .3);
  --focus: color-mix(in srgb, var(--accent) 55%, transparent);   /* soft glow (legacy) */
  /* Two-tone focus ring: a 2px halo in the surface colour + a 2px full-strength ring.
     One of the two always contrasts ≥ 3:1 with whatever sits behind the control. */
  --focus-ring: var(--accent-ink);
  --focus-halo: #FFFFFF;
  --focus-width: 2px;

  /* Safe areas (need viewport-fit=cover in the page's viewport meta) and the
     on-screen keyboard height (set by avengers.js from visualViewport) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --kb: 0px;

  /* Evidence grades (plain names: Checks out, Only one source, Couldn’t check this, Sources differ) */
  --grade-corroborated: var(--green);
  --grade-single: var(--orange);
  --grade-unverified: var(--gray);
  --grade-contradicted: var(--red);
  --grade-confirmed: var(--green);
  --grade-one-source: var(--orange);
  --grade-not-checked: var(--gray);
  --grade-disagree: var(--red);
  /* Grade ink: ≥ 5:1 on its own tinted chip over content material */
  --grade-confirmed-ink: #11612A;
  --grade-one-source-ink: #833700;
  --grade-not-checked-ink: #4A4A50;
  --grade-disagree-ink: #A3000E;

  /* Motion used by the v3 components. motion.css owns the numbers: these follow
     --spring-snappy / --spring-smooth / --spring-bouncy / --ease-exit and
     --dur-smooth / --dur-snappy / --dur-exit when it is loaded (one set of tokens). */
  --av-smooth: var(--spring-smooth, cubic-bezier(.32, .72, 0, 1));
  --av-snappy: var(--spring-snappy, cubic-bezier(.25, 1, .5, 1));
  --av-bouncy: var(--spring-bouncy, var(--ease-bounce));
  --av-exit: var(--ease-exit, cubic-bezier(.3, 0, .8, .15));
  --av-dur-smooth: var(--dur-smooth, 450ms);
  --av-dur-snappy: var(--dur-snappy, 280ms);
  --av-dur-exit: var(--dur-exit, 200ms);

  /* File types (familiar colours) */
  --type-word: #1F63D6;
  --type-excel: #13854A;
  --type-powerpoint: #D24A26;
  --type-pdf: #E0352B;
  --type-image: #A04BDB;
  --type-link: #138FA3;
  --type-text: #6E6E76;
  --type-other: #85858C;
  --type-folder: #3B8CF2;

  /* Segmented thumb */
  --seg-thumb: #FFFFFF;
  --seg-thumb-shadow: 0 0 0 .5px rgba(0, 0, 0, .05), 0 1px 1px rgba(0, 0, 0, .04), 0 3px 8px rgba(0, 0, 0, .12);

  /* Grain on top of the wallpaper (inline SVG, no network) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-opacity: .05;
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    /* Apple-like springs: gentle overshoot, long settle */
    --ease-spring: linear(0, .0118, .0464 2.3%, .1835 4.7%, .4122 7.5%, .6802 10.9%, .8649 14.3%, .9665 17.6%, 1.0181 21%, 1.0367 24.5%, 1.0369 28.6%, 1.0245 34.4%, 1.0066 43.3%, .9997 54%, .9989 70%, 1);
    --ease-bounce: linear(0, .0167, .0662 2.4%, .2612 5.1%, .5612 8.4%, .8445 12%, 1.0302 15.6%, 1.1053 19%, 1.1146 21.6%, 1.0905 25.1%, 1.0381 30.3%, 1.0053 35.3%, .9926 41.1%, .9958 50%, 1.0012 66%, 1);
  }
}


/* 1  DARK TOKENS ========================================================== */
/* Applied for Auto + system dark, and for an explicit data-theme="dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --mark-mix: 32%;   /* the quote highlight: full-strength text on it stays above 4.5:1 on the lighter dark cards */
    --red: #FF453A;   --orange: #FF9F0A; --yellow: #FFD60A; --green: #30D158;
    --mint: #63E6E2;  --teal: #40CBE0;   --cyan: #64D2FF;   --blue: #3D86FF;
    --indigo: #5E5CE6; --purple: #BF5AF2; --pink: #FF375F;  --brown: #AC8E68;
    --gray: #98989D;
    --red-ink: #FF6B63;    --orange-ink: #FFB340; --yellow-ink: #FFD60A;
    --green-ink: #4CD97B;  --teal-ink: #5AD7E8;   --blue-ink: #5AA9FF;
    --indigo-ink: #9593FF; --purple-ink: #D68BFF; --pink-ink: #FF6E8C;
    --gray-ink: #B4B4BA;
    --label-1: rgba(255, 255, 255, .94);
    --label-2: rgba(255, 255, 255, .72);
    --label-3: rgba(255, 255, 255, .56);
    --label-4: rgba(255, 255, 255, .24);
    --fill-1: rgba(120, 120, 128, .40);
    --fill-2: rgba(120, 120, 128, .32);
    --fill-3: rgba(118, 118, 128, .24);
    --fill-4: rgba(118, 118, 128, .16);
    --separator: rgba(255, 255, 255, .11);
    --separator-strong: rgba(255, 255, 255, .2);
    --material-bg: rgba(30, 30, 34, .84);
    --material-bg-thick: rgba(30, 30, 34, .95);
    --material-edge: rgba(255, 255, 255, .07);
    --material-shadow: 0 0 0 .5px rgba(255, 255, 255, .07), 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .55);
    --well-bg: rgba(255, 255, 255, .05);
    --chip-surface: rgba(72, 72, 80, .5);
    --field-bg: rgba(255, 255, 255, .06);
    --field-border: rgba(255, 255, 255, .14);
    --field-border-hover: rgba(255, 255, 255, .24);
    --glass-bg: rgba(40, 40, 46, .44);
    --glass-bg-hover: rgba(58, 58, 66, .5);
    --glass-bg-strong: rgba(34, 34, 40, .74);
    --glass-bg-clear: rgba(255, 255, 255, .03);
    --glass-filter: blur(18px) saturate(170%) brightness(.8);
    --glass-filter-strong: blur(34px) saturate(170%) brightness(.74);
    --glass-filter-clear: blur(4px) saturate(160%) brightness(.94);
    --glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, .08) 0%, rgba(255, 255, 255, .02) 42%, rgba(255, 255, 255, 0) 60%);
    --glass-rim-a: rgba(255, 255, 255, .5);
    --glass-rim-b: rgba(255, 255, 255, .07);
    --glass-rim-c: rgba(255, 255, 255, .24);
    --glass-inner:
      inset 1px 1.5px 1px -.5px rgba(255, 255, 255, .34),
      inset -1px -1.5px 1px -.5px rgba(255, 255, 255, .12),
      inset 0 0 0 .5px rgba(255, 255, 255, .07),
      inset 0 0 16px rgba(255, 255, 255, .05),
      inset 0 -12px 20px -16px rgba(255, 255, 255, .22);
    --glass-shadow:
      0 0 0 .5px rgba(0, 0, 0, .5),
      0 2px 4px rgba(0, 0, 0, .22),
      0 14px 34px -8px rgba(0, 0, 0, .5),
      0 34px 72px -24px rgba(0, 0, 0, .55);
    --glass-shadow-sm:
      0 0 0 .5px rgba(0, 0, 0, .5),
      0 2px 4px rgba(0, 0, 0, .25),
      0 8px 18px -6px rgba(0, 0, 0, .45);
    --spec-color: rgba(255, 255, 255, .13);
    --spec-rim: .7;
    --scrim: rgba(0, 0, 0, .45);
    --type-word: #3D80F0; --type-excel: #22A05E; --type-powerpoint: #E4643F;
    --type-pdf: #EF4B40;  --type-image: #B565EC; --type-link: #1FA8BD;
    --type-text: #8A8A92; --type-other: #8E8E95; --type-folder: #4C9AF5;
    --seg-thumb: rgba(118, 118, 128, .56);
    --seg-thumb-shadow: inset 0 .5px 0 rgba(255, 255, 255, .22), 0 0 0 .5px rgba(0, 0, 0, .2), 0 3px 8px rgba(0, 0, 0, .35);
    --grain-opacity: .07;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --mark-mix: 32%;
  --red: #FF453A;   --orange: #FF9F0A; --yellow: #FFD60A; --green: #30D158;
  --mint: #63E6E2;  --teal: #40CBE0;   --cyan: #64D2FF;   --blue: #3D86FF;
  --indigo: #5E5CE6; --purple: #BF5AF2; --pink: #FF375F;  --brown: #AC8E68;
  --gray: #98989D;
  --red-ink: #FF6B63;    --orange-ink: #FFB340; --yellow-ink: #FFD60A;
  --green-ink: #4CD97B;  --teal-ink: #5AD7E8;   --blue-ink: #5AA9FF;
  --indigo-ink: #9593FF; --purple-ink: #D68BFF; --pink-ink: #FF6E8C;
  --gray-ink: #B4B4BA;
  --label-1: rgba(255, 255, 255, .94);
  --label-2: rgba(255, 255, 255, .72);
  --label-3: rgba(255, 255, 255, .56);
  --label-4: rgba(255, 255, 255, .24);
  --fill-1: rgba(120, 120, 128, .40);
  --fill-2: rgba(120, 120, 128, .32);
  --fill-3: rgba(118, 118, 128, .24);
  --fill-4: rgba(118, 118, 128, .16);
  --separator: rgba(255, 255, 255, .11);
  --separator-strong: rgba(255, 255, 255, .2);
  --material-bg: rgba(30, 30, 34, .84);
  --material-bg-thick: rgba(30, 30, 34, .95);
  --material-edge: rgba(255, 255, 255, .07);
  --material-shadow: 0 0 0 .5px rgba(255, 255, 255, .07), 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .55);
  --well-bg: rgba(255, 255, 255, .05);
  --chip-surface: rgba(72, 72, 80, .5);
  --field-bg: rgba(255, 255, 255, .06);
  --field-border: rgba(255, 255, 255, .14);
  --field-border-hover: rgba(255, 255, 255, .24);
  --glass-bg: rgba(40, 40, 46, .44);
  --glass-bg-hover: rgba(58, 58, 66, .5);
  --glass-bg-strong: rgba(34, 34, 40, .74);
  --glass-bg-clear: rgba(255, 255, 255, .03);
  --glass-filter: blur(18px) saturate(170%) brightness(.8);
  --glass-filter-strong: blur(34px) saturate(170%) brightness(.74);
  --glass-filter-clear: blur(4px) saturate(160%) brightness(.94);
  --glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, .08) 0%, rgba(255, 255, 255, .02) 42%, rgba(255, 255, 255, 0) 60%);
  --glass-rim-a: rgba(255, 255, 255, .5);
  --glass-rim-b: rgba(255, 255, 255, .07);
  --glass-rim-c: rgba(255, 255, 255, .24);
  --glass-inner:
    inset 1px 1.5px 1px -.5px rgba(255, 255, 255, .34),
    inset -1px -1.5px 1px -.5px rgba(255, 255, 255, .12),
    inset 0 0 0 .5px rgba(255, 255, 255, .07),
    inset 0 0 16px rgba(255, 255, 255, .05),
    inset 0 -12px 20px -16px rgba(255, 255, 255, .22);
  --glass-shadow:
    0 0 0 .5px rgba(0, 0, 0, .5),
    0 2px 4px rgba(0, 0, 0, .22),
    0 14px 34px -8px rgba(0, 0, 0, .5),
    0 34px 72px -24px rgba(0, 0, 0, .55);
  --glass-shadow-sm:
    0 0 0 .5px rgba(0, 0, 0, .5),
    0 2px 4px rgba(0, 0, 0, .25),
    0 8px 18px -6px rgba(0, 0, 0, .45);
  --spec-color: rgba(255, 255, 255, .13);
  --spec-rim: .7;
  --scrim: rgba(0, 0, 0, .45);
  --type-word: #3D80F0; --type-excel: #22A05E; --type-powerpoint: #E4643F;
  --type-pdf: #EF4B40;  --type-image: #B565EC; --type-link: #1FA8BD;
  --type-text: #8A8A92; --type-other: #8E8E95; --type-folder: #4C9AF5;
  --seg-thumb: rgba(118, 118, 128, .56);
  --seg-thumb-shadow: inset 0 .5px 0 rgba(255, 255, 255, .22), 0 0 0 .5px rgba(0, 0, 0, .2), 0 3px 8px rgba(0, 0, 0, .35);
  --grain-opacity: .07;
}


/* 2  ACCENTS ============================================================== */
/* --accent: the system colour (indicators, rings, icons)
   --accent-ink: text on content material (≥ 4.5:1)
   --accent-fill: fills that carry white text (≥ 4.5:1) */
:root,
[data-accent="blue"]     { --accent: var(--blue);   --accent-ink: var(--blue-ink);   --accent-fill: var(--blue-fill); }
[data-accent="purple"]   { --accent: var(--purple); --accent-ink: var(--purple-ink); --accent-fill: var(--purple-fill); }
[data-accent="pink"]     { --accent: var(--pink);   --accent-ink: var(--pink-ink);   --accent-fill: var(--pink-fill); }
[data-accent="orange"]   { --accent: var(--orange); --accent-ink: var(--orange-ink); --accent-fill: var(--orange-fill); }
[data-accent="green"]    { --accent: var(--green);  --accent-ink: var(--green-ink);  --accent-fill: var(--green-fill); }
[data-accent="indigo"]   { --accent: var(--indigo); --accent-ink: var(--indigo-ink); --accent-fill: var(--indigo-fill); }
[data-accent="graphite"] { --accent: var(--gray);   --accent-ink: var(--gray-ink);   --accent-fill: var(--graphite-fill); }
:root, [data-accent] {
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-soft-2: color-mix(in srgb, var(--accent) 24%, transparent);
  --focus: color-mix(in srgb, var(--accent) 55%, transparent);
}


/* 3  WALLPAPERS =========================================================== */
/* Pure CSS gradients, no image files. Light versions stay bright enough for
   label text; dark versions go deep. Thumbnails can use var(--wp-<name>) directly.
   Pearl (the default) and Opal: a calm silver-blue ground with a soft "silk fold"
   of light. The fold is two conic gradients whose centre sits off the top-right
   corner, so the bands fan out gently instead of running as parallel stripes, and
   every band is a smooth bell of small alpha steps (no hard edge at 390 or 1440
   wide). Peach and lavender glints stay at low alpha. Aurora, Dune, Lagoon and
   Graphite are the vivid mesh alternatives. */
:root {
  --wp-pearl:
    radial-gradient(42% 32% at 92% 100%, rgba(243, 221, 210, .5) 0%, rgba(243, 221, 210, 0) 72%),
    radial-gradient(44% 34% at 2% 96%, rgba(206, 201, 236, .5) 0%, rgba(206, 201, 236, 0) 72%),
    conic-gradient(from 180deg at 128% -38%,
      rgba(246, 248, 252, 0) 6deg, rgba(246, 248, 252, .053) 9deg, rgba(246, 248, 252, .18) 12deg, rgba(246, 248, 252, .307) 15deg,
      rgba(246, 248, 252, .36) 18deg, rgba(246, 248, 252, .307) 21deg, rgba(246, 248, 252, .18) 24deg, rgba(246, 248, 252, .053) 27deg,
      rgba(246, 248, 252, 0) 30deg, rgba(246, 248, 252, 0) 32deg, rgba(246, 248, 252, .097) 35.8deg, rgba(246, 248, 252, .33) 39.5deg,
      rgba(246, 248, 252, .563) 43.2deg, rgba(246, 248, 252, .66) 47deg, rgba(246, 248, 252, .563) 50.8deg, rgba(246, 248, 252, .33) 54.5deg,
      rgba(246, 248, 252, .097) 58.2deg, rgba(246, 248, 252, 0) 62deg, rgba(246, 248, 252, 0) 360deg),
    conic-gradient(from 180deg at 128% -38%,
      rgba(159, 176, 208, 0) 23deg, rgba(159, 176, 208, .029) 25.2deg, rgba(159, 176, 208, .1) 27.5deg, rgba(159, 176, 208, .171) 29.8deg,
      rgba(159, 176, 208, .2) 32deg, rgba(159, 176, 208, .171) 34.2deg, rgba(159, 176, 208, .1) 36.5deg, rgba(159, 176, 208, .029) 38.8deg,
      rgba(159, 176, 208, 0) 41deg, rgba(159, 176, 208, 0) 53deg, rgba(159, 176, 208, .05) 56.2deg, rgba(159, 176, 208, .17) 59.5deg,
      rgba(159, 176, 208, .29) 62.8deg, rgba(159, 176, 208, .34) 66deg, rgba(159, 176, 208, .29) 69.2deg, rgba(159, 176, 208, .17) 72.5deg,
      rgba(159, 176, 208, .05) 75.8deg, rgba(159, 176, 208, 0) 79deg, rgba(159, 176, 208, 0) 360deg),
    radial-gradient(70% 60% at 0% 0%, rgba(238, 241, 247, .7) 0%, rgba(238, 241, 247, 0) 72%),
    linear-gradient(165deg, #C7D0E1 0%, #CBD3E2 46%, #D5DBE8 100%);
  --wp-pearl-base: #CBD3E2;
  --wp-opal:
    radial-gradient(60% 40% at 80% 100%, rgba(243, 221, 210, .8) 0%, rgba(243, 221, 210, 0) 72%),
    radial-gradient(58% 42% at 10% 92%, rgba(206, 201, 236, .74) 0%, rgba(206, 201, 236, 0) 72%),
    radial-gradient(40% 26% at 48% 106%, rgba(190, 206, 240, .6) 0%, rgba(190, 206, 240, 0) 72%),
    conic-gradient(from 180deg at 128% -38%,
      rgba(255, 255, 255, 0) 28deg, rgba(255, 255, 255, .088) 32deg, rgba(255, 255, 255, .3) 36deg, rgba(255, 255, 255, .512) 40deg,
      rgba(255, 255, 255, .6) 44deg, rgba(255, 255, 255, .512) 48deg, rgba(255, 255, 255, .3) 52deg, rgba(255, 255, 255, .088) 56deg,
      rgba(255, 255, 255, 0) 60deg, rgba(255, 255, 255, 0) 360deg),
    conic-gradient(from 180deg at 128% -38%,
      rgba(159, 176, 208, 0) 51deg, rgba(159, 176, 208, .029) 54.2deg, rgba(159, 176, 208, .1) 57.5deg, rgba(159, 176, 208, .171) 60.8deg,
      rgba(159, 176, 208, .2) 64deg, rgba(159, 176, 208, .171) 67.2deg, rgba(159, 176, 208, .1) 70.5deg, rgba(159, 176, 208, .029) 73.8deg,
      rgba(159, 176, 208, 0) 77deg, rgba(159, 176, 208, 0) 360deg),
    radial-gradient(80% 50% at 16% 0%, rgba(203, 211, 226, .7) 0%, rgba(203, 211, 226, 0) 72%),
    linear-gradient(172deg, #DDE2EC 0%, #E5E8F1 46%, #EAE7F1 100%);
  --wp-opal-base: #E3E6F0;
  --wp-aurora:
    radial-gradient(56% 60% at 8% 12%, #7FA6FF 0%, rgba(127, 166, 255, 0) 70%),
    radial-gradient(48% 54% at 92% 8%, #D7A2FF 0%, rgba(215, 162, 255, 0) 70%),
    radial-gradient(54% 58% at 86% 92%, #78E0D2 0%, rgba(120, 224, 210, 0) 70%),
    radial-gradient(50% 56% at 10% 94%, #FFB0CF 0%, rgba(255, 176, 207, 0) 70%),
    radial-gradient(60% 50% at 50% 50%, #C4CEFF 0%, rgba(196, 206, 255, 0) 75%),
    linear-gradient(155deg, #DCE4FF 0%, #ECE2FF 48%, #DDF4F1 100%);
  --wp-aurora-base: #E2E6FF;
  --wp-dune:
    radial-gradient(54% 58% at 10% 14%, #FFB877 0%, rgba(255, 184, 119, 0) 70%),
    radial-gradient(50% 54% at 92% 10%, #FF9B9B 0%, rgba(255, 155, 155, 0) 70%),
    radial-gradient(56% 60% at 84% 92%, #FFD583 0%, rgba(255, 213, 131, 0) 70%),
    radial-gradient(50% 56% at 12% 92%, #F0A57E 0%, rgba(240, 165, 126, 0) 70%),
    radial-gradient(60% 50% at 52% 48%, #FFE2C4 0%, rgba(255, 226, 196, 0) 75%),
    linear-gradient(160deg, #FCE9D6 0%, #F9DCCB 50%, #FBEBD0 100%);
  --wp-dune-base: #F9E3D0;
  --wp-lagoon:
    radial-gradient(54% 58% at 8% 12%, #5BD6CB 0%, rgba(91, 214, 203, 0) 70%),
    radial-gradient(50% 56% at 92% 10%, #6DBDFF 0%, rgba(109, 189, 255, 0) 70%),
    radial-gradient(56% 60% at 86% 90%, #93E6B4 0%, rgba(147, 230, 180, 0) 70%),
    radial-gradient(50% 56% at 10% 94%, #87D8F2 0%, rgba(135, 216, 242, 0) 70%),
    radial-gradient(60% 50% at 50% 50%, #CBF1EE 0%, rgba(203, 241, 238, 0) 75%),
    linear-gradient(160deg, #D8F4F1 0%, #D7EBFF 52%, #DDF6E7 100%);
  --wp-lagoon-base: #D8F0F2;
  --wp-graphite:
    radial-gradient(54% 58% at 10% 12%, #C9CDD6 0%, rgba(201, 205, 214, 0) 70%),
    radial-gradient(50% 56% at 92% 10%, #B9C2D6 0%, rgba(185, 194, 214, 0) 70%),
    radial-gradient(56% 60% at 86% 92%, #D2D5DC 0%, rgba(210, 213, 220, 0) 70%),
    radial-gradient(50% 56% at 10% 94%, #BFC3CB 0%, rgba(191, 195, 203, 0) 70%),
    linear-gradient(160deg, #E8E9ED 0%, #DDDFE4 50%, #E6E7EB 100%);
  --wp-graphite-base: #E2E4E8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wp-pearl:
      radial-gradient(42% 32% at 92% 100%, rgba(243, 221, 210, .11) 0%, rgba(243, 221, 210, 0) 72%),
      radial-gradient(44% 34% at 2% 96%, rgba(206, 201, 236, .13) 0%, rgba(206, 201, 236, 0) 72%),
      conic-gradient(from 180deg at 128% -38%,
        rgba(126, 146, 186, 0) 6deg, rgba(126, 146, 186, .021) 9deg, rgba(126, 146, 186, .07) 12deg, rgba(126, 146, 186, .119) 15deg,
        rgba(126, 146, 186, .14) 18deg, rgba(126, 146, 186, .119) 21deg, rgba(126, 146, 186, .07) 24deg, rgba(126, 146, 186, .021) 27deg,
        rgba(126, 146, 186, 0) 30deg, rgba(126, 146, 186, 0) 32deg, rgba(126, 146, 186, .038) 35.8deg, rgba(126, 146, 186, .13) 39.5deg,
        rgba(126, 146, 186, .222) 43.2deg, rgba(126, 146, 186, .26) 47deg, rgba(126, 146, 186, .222) 50.8deg, rgba(126, 146, 186, .13) 54.5deg,
        rgba(126, 146, 186, .038) 58.2deg, rgba(126, 146, 186, 0) 62deg, rgba(126, 146, 186, 0) 360deg),
      conic-gradient(from 180deg at 128% -38%,
        rgba(6, 9, 16, 0) 23deg, rgba(6, 9, 16, .032) 25.2deg, rgba(6, 9, 16, .11) 27.5deg, rgba(6, 9, 16, .188) 29.8deg,
        rgba(6, 9, 16, .22) 32deg, rgba(6, 9, 16, .188) 34.2deg, rgba(6, 9, 16, .11) 36.5deg, rgba(6, 9, 16, .032) 38.8deg,
        rgba(6, 9, 16, 0) 41deg, rgba(6, 9, 16, 0) 53deg, rgba(6, 9, 16, .059) 56.2deg, rgba(6, 9, 16, .2) 59.5deg,
        rgba(6, 9, 16, .341) 62.8deg, rgba(6, 9, 16, .4) 66deg, rgba(6, 9, 16, .341) 69.2deg, rgba(6, 9, 16, .2) 72.5deg,
        rgba(6, 9, 16, .059) 75.8deg, rgba(6, 9, 16, 0) 79deg, rgba(6, 9, 16, 0) 360deg),
      radial-gradient(70% 60% at 0% 0%, rgba(58, 74, 110, .36) 0%, rgba(58, 74, 110, 0) 72%),
      linear-gradient(165deg, #151B2A 0%, #10141F 46%, #131826 100%);
    --wp-pearl-base: #10141F;
    --wp-opal:
      radial-gradient(60% 40% at 80% 100%, rgba(243, 221, 210, .11) 0%, rgba(243, 221, 210, 0) 72%),
      radial-gradient(58% 42% at 10% 92%, rgba(206, 201, 236, .13) 0%, rgba(206, 201, 236, 0) 72%),
      radial-gradient(40% 26% at 48% 106%, rgba(126, 146, 186, .12) 0%, rgba(126, 146, 186, 0) 72%),
      conic-gradient(from 180deg at 128% -38%,
        rgba(150, 160, 200, 0) 28deg, rgba(150, 160, 200, .029) 32deg, rgba(150, 160, 200, .1) 36deg, rgba(150, 160, 200, .171) 40deg,
        rgba(150, 160, 200, .2) 44deg, rgba(150, 160, 200, .171) 48deg, rgba(150, 160, 200, .1) 52deg, rgba(150, 160, 200, .029) 56deg,
        rgba(150, 160, 200, 0) 60deg, rgba(150, 160, 200, 0) 360deg),
      conic-gradient(from 180deg at 128% -38%,
        rgba(6, 6, 14, 0) 51deg, rgba(6, 6, 14, .044) 54.2deg, rgba(6, 6, 14, .15) 57.5deg, rgba(6, 6, 14, .256) 60.8deg,
        rgba(6, 6, 14, .3) 64deg, rgba(6, 6, 14, .256) 67.2deg, rgba(6, 6, 14, .15) 70.5deg, rgba(6, 6, 14, .044) 73.8deg,
        rgba(6, 6, 14, 0) 77deg, rgba(6, 6, 14, 0) 360deg),
      radial-gradient(80% 50% at 16% 0%, rgba(52, 58, 92, .4) 0%, rgba(52, 58, 92, 0) 72%),
      linear-gradient(172deg, #181929 0%, #14131F 46%, #191623 100%);
    --wp-opal-base: #14131F;
    --wp-aurora:
      radial-gradient(56% 60% at 8% 12%, #2944C9 0%, rgba(41, 68, 201, 0) 70%),
      radial-gradient(48% 54% at 92% 8%, #6E2BB8 0%, rgba(110, 43, 184, 0) 70%),
      radial-gradient(54% 58% at 86% 92%, #0D6F78 0%, rgba(13, 111, 120, 0) 70%),
      radial-gradient(50% 56% at 10% 94%, #8F2156 0%, rgba(143, 33, 86, 0) 70%),
      radial-gradient(60% 50% at 50% 50%, #1D2477 0%, rgba(29, 36, 119, 0) 75%),
      linear-gradient(155deg, #0A1030 0%, #150A2C 48%, #051C24 100%);
    --wp-aurora-base: #0C1030;
    --wp-dune:
      radial-gradient(54% 58% at 10% 14%, #8A3A12 0%, rgba(138, 58, 18, 0) 70%),
      radial-gradient(50% 54% at 92% 10%, #7A1C2C 0%, rgba(122, 28, 44, 0) 70%),
      radial-gradient(56% 60% at 84% 92%, #86570E 0%, rgba(134, 87, 14, 0) 70%),
      radial-gradient(50% 56% at 12% 92%, #5C2814 0%, rgba(92, 40, 20, 0) 70%),
      linear-gradient(160deg, #1D100A 0%, #26110D 50%, #1F1608 100%);
    --wp-dune-base: #1F120B;
    --wp-lagoon:
      radial-gradient(54% 58% at 8% 12%, #0B6B73 0%, rgba(11, 107, 115, 0) 70%),
      radial-gradient(50% 56% at 92% 10%, #0E4E92 0%, rgba(14, 78, 146, 0) 70%),
      radial-gradient(56% 60% at 86% 90%, #10604A 0%, rgba(16, 96, 74, 0) 70%),
      radial-gradient(50% 56% at 10% 94%, #0A587A 0%, rgba(10, 88, 122, 0) 70%),
      linear-gradient(160deg, #03161D 0%, #061A2C 52%, #04191A 100%);
    --wp-lagoon-base: #041820;
    --wp-graphite:
      radial-gradient(54% 58% at 10% 12%, #2E3138 0%, rgba(46, 49, 56, 0) 70%),
      radial-gradient(50% 56% at 92% 10%, #252B38 0%, rgba(37, 43, 56, 0) 70%),
      radial-gradient(56% 60% at 86% 92%, #33363D 0%, rgba(51, 54, 61, 0) 70%),
      radial-gradient(50% 56% at 10% 94%, #22252B 0%, rgba(34, 37, 43, 0) 70%),
      linear-gradient(160deg, #101113 0%, #17181B 50%, #121316 100%);
    --wp-graphite-base: #141517;
  }
}
:root[data-theme="dark"] {
  --wp-pearl:
    radial-gradient(42% 32% at 92% 100%, rgba(243, 221, 210, .11) 0%, rgba(243, 221, 210, 0) 72%),
    radial-gradient(44% 34% at 2% 96%, rgba(206, 201, 236, .13) 0%, rgba(206, 201, 236, 0) 72%),
    conic-gradient(from 180deg at 128% -38%,
      rgba(126, 146, 186, 0) 6deg, rgba(126, 146, 186, .021) 9deg, rgba(126, 146, 186, .07) 12deg, rgba(126, 146, 186, .119) 15deg,
      rgba(126, 146, 186, .14) 18deg, rgba(126, 146, 186, .119) 21deg, rgba(126, 146, 186, .07) 24deg, rgba(126, 146, 186, .021) 27deg,
      rgba(126, 146, 186, 0) 30deg, rgba(126, 146, 186, 0) 32deg, rgba(126, 146, 186, .038) 35.8deg, rgba(126, 146, 186, .13) 39.5deg,
      rgba(126, 146, 186, .222) 43.2deg, rgba(126, 146, 186, .26) 47deg, rgba(126, 146, 186, .222) 50.8deg, rgba(126, 146, 186, .13) 54.5deg,
      rgba(126, 146, 186, .038) 58.2deg, rgba(126, 146, 186, 0) 62deg, rgba(126, 146, 186, 0) 360deg),
    conic-gradient(from 180deg at 128% -38%,
      rgba(6, 9, 16, 0) 23deg, rgba(6, 9, 16, .032) 25.2deg, rgba(6, 9, 16, .11) 27.5deg, rgba(6, 9, 16, .188) 29.8deg,
      rgba(6, 9, 16, .22) 32deg, rgba(6, 9, 16, .188) 34.2deg, rgba(6, 9, 16, .11) 36.5deg, rgba(6, 9, 16, .032) 38.8deg,
      rgba(6, 9, 16, 0) 41deg, rgba(6, 9, 16, 0) 53deg, rgba(6, 9, 16, .059) 56.2deg, rgba(6, 9, 16, .2) 59.5deg,
      rgba(6, 9, 16, .341) 62.8deg, rgba(6, 9, 16, .4) 66deg, rgba(6, 9, 16, .341) 69.2deg, rgba(6, 9, 16, .2) 72.5deg,
      rgba(6, 9, 16, .059) 75.8deg, rgba(6, 9, 16, 0) 79deg, rgba(6, 9, 16, 0) 360deg),
    radial-gradient(70% 60% at 0% 0%, rgba(58, 74, 110, .36) 0%, rgba(58, 74, 110, 0) 72%),
    linear-gradient(165deg, #151B2A 0%, #10141F 46%, #131826 100%);
  --wp-pearl-base: #10141F;
  --wp-opal:
    radial-gradient(60% 40% at 80% 100%, rgba(243, 221, 210, .11) 0%, rgba(243, 221, 210, 0) 72%),
    radial-gradient(58% 42% at 10% 92%, rgba(206, 201, 236, .13) 0%, rgba(206, 201, 236, 0) 72%),
    radial-gradient(40% 26% at 48% 106%, rgba(126, 146, 186, .12) 0%, rgba(126, 146, 186, 0) 72%),
    conic-gradient(from 180deg at 128% -38%,
      rgba(150, 160, 200, 0) 28deg, rgba(150, 160, 200, .029) 32deg, rgba(150, 160, 200, .1) 36deg, rgba(150, 160, 200, .171) 40deg,
      rgba(150, 160, 200, .2) 44deg, rgba(150, 160, 200, .171) 48deg, rgba(150, 160, 200, .1) 52deg, rgba(150, 160, 200, .029) 56deg,
      rgba(150, 160, 200, 0) 60deg, rgba(150, 160, 200, 0) 360deg),
    conic-gradient(from 180deg at 128% -38%,
      rgba(6, 6, 14, 0) 51deg, rgba(6, 6, 14, .044) 54.2deg, rgba(6, 6, 14, .15) 57.5deg, rgba(6, 6, 14, .256) 60.8deg,
      rgba(6, 6, 14, .3) 64deg, rgba(6, 6, 14, .256) 67.2deg, rgba(6, 6, 14, .15) 70.5deg, rgba(6, 6, 14, .044) 73.8deg,
      rgba(6, 6, 14, 0) 77deg, rgba(6, 6, 14, 0) 360deg),
    radial-gradient(80% 50% at 16% 0%, rgba(52, 58, 92, .4) 0%, rgba(52, 58, 92, 0) 72%),
    linear-gradient(172deg, #181929 0%, #14131F 46%, #191623 100%);
  --wp-opal-base: #14131F;
  --wp-aurora:
    radial-gradient(56% 60% at 8% 12%, #2944C9 0%, rgba(41, 68, 201, 0) 70%),
    radial-gradient(48% 54% at 92% 8%, #6E2BB8 0%, rgba(110, 43, 184, 0) 70%),
    radial-gradient(54% 58% at 86% 92%, #0D6F78 0%, rgba(13, 111, 120, 0) 70%),
    radial-gradient(50% 56% at 10% 94%, #8F2156 0%, rgba(143, 33, 86, 0) 70%),
    radial-gradient(60% 50% at 50% 50%, #1D2477 0%, rgba(29, 36, 119, 0) 75%),
    linear-gradient(155deg, #0A1030 0%, #150A2C 48%, #051C24 100%);
  --wp-aurora-base: #0C1030;
  --wp-dune:
    radial-gradient(54% 58% at 10% 14%, #8A3A12 0%, rgba(138, 58, 18, 0) 70%),
    radial-gradient(50% 54% at 92% 10%, #7A1C2C 0%, rgba(122, 28, 44, 0) 70%),
    radial-gradient(56% 60% at 84% 92%, #86570E 0%, rgba(134, 87, 14, 0) 70%),
    radial-gradient(50% 56% at 12% 92%, #5C2814 0%, rgba(92, 40, 20, 0) 70%),
    linear-gradient(160deg, #1D100A 0%, #26110D 50%, #1F1608 100%);
  --wp-dune-base: #1F120B;
  --wp-lagoon:
    radial-gradient(54% 58% at 8% 12%, #0B6B73 0%, rgba(11, 107, 115, 0) 70%),
    radial-gradient(50% 56% at 92% 10%, #0E4E92 0%, rgba(14, 78, 146, 0) 70%),
    radial-gradient(56% 60% at 86% 90%, #10604A 0%, rgba(16, 96, 74, 0) 70%),
    radial-gradient(50% 56% at 10% 94%, #0A587A 0%, rgba(10, 88, 122, 0) 70%),
    linear-gradient(160deg, #03161D 0%, #061A2C 52%, #04191A 100%);
  --wp-lagoon-base: #041820;
  --wp-graphite:
    radial-gradient(54% 58% at 10% 12%, #2E3138 0%, rgba(46, 49, 56, 0) 70%),
    radial-gradient(50% 56% at 92% 10%, #252B38 0%, rgba(37, 43, 56, 0) 70%),
    radial-gradient(56% 60% at 86% 92%, #33363D 0%, rgba(51, 54, 61, 0) 70%),
    radial-gradient(50% 56% at 10% 94%, #22252B 0%, rgba(34, 37, 43, 0) 70%),
    linear-gradient(160deg, #101113 0%, #17181B 50%, #121316 100%);
  --wp-graphite-base: #141517;
}
:root,
[data-wallpaper="pearl"]    { --wallpaper: var(--wp-pearl);    --wallpaper-base: var(--wp-pearl-base); }
[data-wallpaper="opal"]     { --wallpaper: var(--wp-opal);     --wallpaper-base: var(--wp-opal-base); }
[data-wallpaper="aurora"]   { --wallpaper: var(--wp-aurora);   --wallpaper-base: var(--wp-aurora-base); }
[data-wallpaper="dune"]     { --wallpaper: var(--wp-dune);     --wallpaper-base: var(--wp-dune-base); }
[data-wallpaper="lagoon"]   { --wallpaper: var(--wp-lagoon);   --wallpaper-base: var(--wp-lagoon-base); }
[data-wallpaper="graphite"] { --wallpaper: var(--wp-graphite); --wallpaper-base: var(--wp-graphite-base); }

/* Pearl and Opal only: ink-navy text and frosted white-blue glass, as in the v4
   references. The stock glass doubles the saturation of whatever is behind it,
   which is right for the vivid wallpapers but turns a silver-blue ground too
   blue, so these two use a gentler filter and a whiter fill. Nothing here touches
   Aurora, Dune, Lagoon or Graphite.
   Text often sits straight on these two wallpapers (page titles, steps, links,
   footers), and a silver ground is darker than white material, so the coloured
   inks are deeper in light and paler in dark: every label and every ink keeps
   4.5:1 or better against the darkest part of the light wallpapers and the
   lightest part of the dark ones (measured at 390 and 1440 wide).
   Specificity is kept at one class (light) and two (dark) on purpose, and the
   block sits before section 5, so dark mode, reduced transparency and increased
   contrast still win exactly as they do on the other wallpapers. */
:root { --ink-navy: #1A2238; }
:root:where([data-wallpaper="pearl"], [data-wallpaper="opal"], :not([data-wallpaper])) {
  --label-1: rgba(26, 34, 56, .96);
  --label-2: rgba(26, 34, 56, .82);
  --label-3: rgba(26, 34, 56, .72);
  --label-4: rgba(26, 34, 56, .3);
  --red-ink: #A3000E;    --orange-ink: #833700; --yellow-ink: #654D00;
  --green-ink: #0F5C27;  --teal-ink: #055663;   --blue-ink: #0047B3;
  --indigo-ink: #3F3CB8; --purple-ink: #702F9A; --pink-ink: #A01235;
  --gray-ink: #4A4A50;
  --separator: rgba(52, 62, 92, .15);
  --separator-strong: rgba(52, 62, 92, .28);
  --glass-bg: rgba(250, 251, 255, .44);
  --glass-bg-hover: rgba(250, 251, 255, .58);
  --glass-bg-strong: rgba(250, 251, 255, .74);
  --glass-filter: blur(20px) saturate(135%) brightness(1.06);
  --glass-filter-strong: blur(34px) saturate(135%) brightness(1.06);
  --glass-filter-clear: blur(3px) saturate(120%) brightness(1.03);
  --material-filter: blur(30px) saturate(125%);
  --scrim: rgba(26, 34, 56, .3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):where([data-wallpaper="pearl"], [data-wallpaper="opal"], :not([data-wallpaper])) {
    --label-3: rgba(255, 255, 255, .6);
    --red-ink: #FF938D;    --blue-ink: #78B8FF;   --indigo-ink: #ABA9FF;
    --purple-ink: #DB9AFF; --pink-ink: #FF8FA6;
    --material-bg: rgba(36, 43, 62, .86);
    --material-bg-thick: rgba(36, 43, 62, .95);
    --chip-surface: rgba(62, 70, 94, .5);
    --glass-bg: rgba(34, 40, 58, .46);
    --glass-bg-hover: rgba(52, 60, 84, .52);
    --glass-bg-strong: rgba(28, 33, 48, .76);
    --glass-filter: blur(20px) saturate(140%) brightness(.84);
    --glass-filter-strong: blur(34px) saturate(140%) brightness(.78);
    --glass-filter-clear: blur(4px) saturate(130%) brightness(.94);
  }
}
:root[data-theme="dark"]:where([data-wallpaper="pearl"], [data-wallpaper="opal"], :not([data-wallpaper])) {
  --label-3: rgba(255, 255, 255, .6);
  --red-ink: #FF938D;    --blue-ink: #78B8FF;   --indigo-ink: #ABA9FF;
  --purple-ink: #DB9AFF; --pink-ink: #FF8FA6;
  --material-bg: rgba(36, 43, 62, .86);
  --material-bg-thick: rgba(36, 43, 62, .95);
  --chip-surface: rgba(62, 70, 94, .5);
  --glass-bg: rgba(34, 40, 58, .46);
  --glass-bg-hover: rgba(52, 60, 84, .52);
  --glass-bg-strong: rgba(28, 33, 48, .76);
  --glass-filter: blur(20px) saturate(140%) brightness(.84);
  --glass-filter-strong: blur(34px) saturate(140%) brightness(.78);
  --glass-filter-clear: blur(4px) saturate(130%) brightness(.94);
}


/* 4  DENSITY ============================================================== */
[data-density="compact"] {
  --control-h-xs: 22px;
  --control-h-sm: 26px;
  --control-h: 28px;
  --control-h-lg: 36px;
  --row-h: 30px;
  --inset: 8px;
  --sidebar-w: 248px;
  --toolbar-h: 44px;
  --space-5: 16px; --space-6: 20px; --space-7: 26px; --space-8: 32px; --space-9: 44px; --space-10: 64px;
}


/* 5  ACCESSIBILITY TOKENS ================================================= */
/* Each preference has a media query and a matching data attribute on <html>
   (data-reduce-transparency, data-increase-contrast, data-reduce-motion) so
   reviewers can preview them in browsers that do not expose the setting. */
@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass-bg: #F2F2F5; --glass-bg-hover: #EAEAEE; --glass-bg-strong: #F7F7F9; --glass-bg-clear: #F2F2F5;
    --glass-filter: none; --glass-filter-strong: none; --glass-filter-clear: none;
    --material-bg: #FFFFFF; --material-bg-thick: #FFFFFF; --chip-surface: #FFFFFF; --field-bg: #FFFFFF;
    --glass-rim-a: rgba(0, 0, 0, .1); --glass-rim-b: rgba(0, 0, 0, .1); --glass-rim-c: rgba(0, 0, 0, .1);
    --spec-color: transparent; --grain-opacity: 0;
  }
}
@media (prefers-reduced-transparency: reduce) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glass-bg: #2A2A2F; --glass-bg-hover: #323238; --glass-bg-strong: #2C2C31; --glass-bg-clear: #2A2A2F;
    --material-bg: #1E1E21; --material-bg-thick: #1E1E21; --chip-surface: #36363C; --field-bg: #26262A;
    --glass-rim-a: rgba(255, 255, 255, .12); --glass-rim-b: rgba(255, 255, 255, .12); --glass-rim-c: rgba(255, 255, 255, .12);
  }
}
:root[data-reduce-transparency] {
  --glass-bg: #F2F2F5; --glass-bg-hover: #EAEAEE; --glass-bg-strong: #F7F7F9; --glass-bg-clear: #F2F2F5;
  --glass-filter: none; --glass-filter-strong: none; --glass-filter-clear: none;
  --material-bg: #FFFFFF; --material-bg-thick: #FFFFFF; --chip-surface: #FFFFFF; --field-bg: #FFFFFF;
  --glass-rim-a: rgba(0, 0, 0, .1); --glass-rim-b: rgba(0, 0, 0, .1); --glass-rim-c: rgba(0, 0, 0, .1);
  --spec-color: transparent; --grain-opacity: 0;
}
@media (prefers-color-scheme: dark) {
  :root[data-reduce-transparency]:not([data-theme="light"]) {
    --glass-bg: #2A2A2F; --glass-bg-hover: #323238; --glass-bg-strong: #2C2C31; --glass-bg-clear: #2A2A2F;
    --material-bg: #1E1E21; --material-bg-thick: #1E1E21; --chip-surface: #36363C; --field-bg: #26262A;
    --glass-rim-a: rgba(255, 255, 255, .12); --glass-rim-b: rgba(255, 255, 255, .12); --glass-rim-c: rgba(255, 255, 255, .12);
  }
}
:root[data-reduce-transparency][data-theme="dark"] {
  --glass-bg: #2A2A2F; --glass-bg-hover: #323238; --glass-bg-strong: #2C2C31; --glass-bg-clear: #2A2A2F;
  --material-bg: #1E1E21; --material-bg-thick: #1E1E21; --chip-surface: #36363C; --field-bg: #26262A;
  --glass-rim-a: rgba(255, 255, 255, .12); --glass-rim-b: rgba(255, 255, 255, .12); --glass-rim-c: rgba(255, 255, 255, .12);
}

@media (prefers-contrast: more) {
  :root {
    --label-1: #000; --label-2: rgba(0, 0, 0, .84); --label-3: rgba(0, 0, 0, .74);
    --separator: rgba(0, 0, 0, .34); --separator-strong: rgba(0, 0, 0, .5);
    --field-border: rgba(0, 0, 0, .55); --field-border-hover: rgba(0, 0, 0, .7);
    --material-bg: rgba(255, 255, 255, .97);
    --glass-bg: rgba(255, 255, 255, .86); --glass-bg-strong: rgba(255, 255, 255, .94);
    --material-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(16, 24, 48, .14);
    --glass-shadow: 0 0 0 1px rgba(0, 0, 0, .55), 0 10px 28px -8px rgba(16, 24, 48, .18);
    --glass-shadow-sm: 0 0 0 1px rgba(0, 0, 0, .55), 0 4px 12px -6px rgba(16, 24, 48, .2);
    --focus: var(--accent);
  }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --label-1: #fff; --label-2: rgba(255, 255, 255, .88); --label-3: rgba(255, 255, 255, .76);
    --separator: rgba(255, 255, 255, .34); --separator-strong: rgba(255, 255, 255, .5);
    --field-border: rgba(255, 255, 255, .55); --field-border-hover: rgba(255, 255, 255, .7);
    --material-bg: rgba(22, 22, 25, .97);
    --glass-bg: rgba(30, 30, 34, .9); --glass-bg-strong: rgba(26, 26, 30, .96);
    --material-shadow: 0 0 0 1px rgba(255, 255, 255, .45), 0 10px 30px -12px rgba(0, 0, 0, .55);
    --glass-shadow: 0 0 0 1px rgba(255, 255, 255, .55), 0 14px 34px -8px rgba(0, 0, 0, .5);
    --glass-shadow-sm: 0 0 0 1px rgba(255, 255, 255, .55), 0 8px 18px -6px rgba(0, 0, 0, .45);
  }
}
:root[data-increase-contrast] {
  --label-1: #000; --label-2: rgba(0, 0, 0, .84); --label-3: rgba(0, 0, 0, .74);
  --separator: rgba(0, 0, 0, .34); --separator-strong: rgba(0, 0, 0, .5);
  --field-border: rgba(0, 0, 0, .55); --field-border-hover: rgba(0, 0, 0, .7);
  --material-bg: rgba(255, 255, 255, .97);
  --glass-bg: rgba(255, 255, 255, .86); --glass-bg-strong: rgba(255, 255, 255, .94);
  --material-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(16, 24, 48, .14);
  --glass-shadow: 0 0 0 1px rgba(0, 0, 0, .55), 0 10px 28px -8px rgba(16, 24, 48, .18);
  --glass-shadow-sm: 0 0 0 1px rgba(0, 0, 0, .55), 0 4px 12px -6px rgba(16, 24, 48, .2);
  --focus: var(--accent);
}
@media (prefers-color-scheme: dark) {
  :root[data-increase-contrast]:not([data-theme="light"]) {
    --label-1: #fff; --label-2: rgba(255, 255, 255, .88); --label-3: rgba(255, 255, 255, .76);
    --separator: rgba(255, 255, 255, .34); --separator-strong: rgba(255, 255, 255, .5);
    --field-border: rgba(255, 255, 255, .55); --field-border-hover: rgba(255, 255, 255, .7);
    --material-bg: rgba(22, 22, 25, .97);
    --glass-bg: rgba(30, 30, 34, .9); --glass-bg-strong: rgba(26, 26, 30, .96);
    --material-shadow: 0 0 0 1px rgba(255, 255, 255, .45), 0 10px 30px -12px rgba(0, 0, 0, .55);
    --glass-shadow: 0 0 0 1px rgba(255, 255, 255, .55), 0 14px 34px -8px rgba(0, 0, 0, .5);
    --glass-shadow-sm: 0 0 0 1px rgba(255, 255, 255, .55), 0 8px 18px -6px rgba(0, 0, 0, .45);
  }
}
:root[data-increase-contrast][data-theme="dark"] {
  --label-1: #fff; --label-2: rgba(255, 255, 255, .88); --label-3: rgba(255, 255, 255, .76);
  --separator: rgba(255, 255, 255, .34); --separator-strong: rgba(255, 255, 255, .5);
  --field-border: rgba(255, 255, 255, .55); --field-border-hover: rgba(255, 255, 255, .7);
  --material-bg: rgba(22, 22, 25, .97);
  --glass-bg: rgba(30, 30, 34, .9); --glass-bg-strong: rgba(26, 26, 30, .96);
  --material-shadow: 0 0 0 1px rgba(255, 255, 255, .45), 0 10px 30px -12px rgba(0, 0, 0, .55);
  --glass-shadow: 0 0 0 1px rgba(255, 255, 255, .55), 0 14px 34px -8px rgba(0, 0, 0, .5);
  --glass-shadow-sm: 0 0 0 1px rgba(255, 255, 255, .55), 0 8px 18px -6px rgba(0, 0, 0, .45);
}


/* 6  BASE AND TYPOGRAPHY ================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--wallpaper-base);
  scroll-padding-top: calc(var(--toolbar-h) + var(--inset) * 2);
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: 0;              /* Hanken Grotesk is spaced for reading as it is */
  color: var(--label-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}
/* The wallpaper: painted on fixed layers behind everything (cheaper than
   background-attachment: fixed, and glass blurs it correctly). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--wallpaper);
  background-color: var(--wallpaper-base);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: var(--grain);
  background-size: 180px 180px;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  pointer-events: none;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { -webkit-tap-highlight-color: transparent; }
img, svg, video { display: block; max-width: 100%; }
svg.icon { display: inline-block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--fill-1) transparent; }

/* Focus: a two-tone ring (surface halo + full-strength accent ring) that hugs the
   control's shape and stays ≥ 3:1 on material, glass and accent buttons. The halo
   is a box-shadow in the outline's 2px offset gap; components that draw their own
   shadow re-add it in section 26. */
:focus { outline: none; }
:focus-visible {
  outline: var(--focus-width) solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--focus-halo);
}

/* Apple text styles */
.t-display     { font-family: var(--font-display); font-size: clamp(40px, 5.4vw, 72px); line-height: 1.04; font-weight: var(--fw-display); letter-spacing: var(--ls-display-big); }
.t-large-title { font-family: var(--font-display); font-size: var(--fs-large-title); line-height: var(--lh-large-title); font-weight: var(--fw-display); letter-spacing: var(--ls-display); }
.t-title-1     { font-family: var(--font-display); font-size: var(--fs-title-1); line-height: var(--lh-title-1); font-weight: var(--fw-display); letter-spacing: var(--ls-display); }
.t-title-2     { font-family: var(--font-display); font-size: var(--fs-title-2); line-height: var(--lh-title-2); font-weight: var(--fw-display); letter-spacing: var(--ls-display); }
.t-title-3     { font-family: var(--font-display); font-size: var(--fs-title-3); line-height: var(--lh-title-3); font-weight: var(--fw-display); letter-spacing: var(--ls-display); }
.t-headline    { font-size: var(--fs-headline); line-height: var(--lh-headline); font-weight: 600; letter-spacing: -.012em; }
.t-body        { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 400; letter-spacing: 0; }
.t-callout     { font-size: var(--fs-callout); line-height: var(--lh-callout); font-weight: 400; letter-spacing: -.01em; }
.t-subheadline { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); font-weight: 400; letter-spacing: -.006em; }
.t-footnote    { font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: 400; letter-spacing: 0; }
.t-caption     { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 500; letter-spacing: .006em; }
.t-eyebrow     { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); font-weight: 600; letter-spacing: 0; color: var(--accent-ink); }
.t-emphasized  { font-weight: 600; }
.t-mono        { font-family: var(--font-mono); font-size: .92em; letter-spacing: 0; }
.t-tabular     { font-variant-numeric: tabular-nums; }

.label-1 { color: var(--label-1); }
.label-2 { color: var(--label-2); }
.label-3 { color: var(--label-3); }
.label-accent { color: var(--accent-ink); }

/* Icons: SF Symbols-style line icons from the inline sprite (avengers.js) */
.icon {
  width: var(--icon-size, 1.25em);
  height: var(--icon-size, 1.25em);
  flex: none;
  vertical-align: -.24em;
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-stroke, 1.7);
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}
.icon--fill { fill: currentColor; stroke: none; }
i[data-icon] { display: inline-block; width: var(--icon-size, 1.25em); height: var(--icon-size, 1.25em); }


/* 7  LIQUID GLASS ========================================================= */
/* Recipe: translucent fill + backdrop blur/saturation + gradient rim light
   (brighter top-left) + inner top highlight + soft shadow + a specular
   highlight that follows the pointer via --mx / --my (set by avengers.js).
   ::before = rim light, ::after = specular. Do not use those pseudo-elements
   on glass elements for anything else. Never nest glass inside glass. */
:is(.glass, .btn--glass, .icon-btn--glass, .chip--glass, .segmented--glass, .tabs--glass,
    .sidebar, .toolbar-group, .composer, .popover, .sheet, .toast, .palette, .drop-overlay__card) {
  --_bg: var(--glass-bg);
  --_filter: var(--glass-filter);
  --_rim-a: var(--glass-rim-a);
  --_rim-b: var(--glass-rim-b);
  --_rim-c: var(--glass-rim-c);
  --_shadow: var(--glass-shadow);
  background-color: var(--_bg);
  background-image: var(--glass-sheen);
  -webkit-backdrop-filter: var(--_filter);
  backdrop-filter: var(--_filter);
  box-shadow: var(--glass-inner), var(--_shadow);
  color: var(--label-1);
  isolation: isolate;
}
:where(.glass) { position: relative; border-radius: var(--r-card); }
:where(.btn--glass, .icon-btn--glass, .chip--glass, .segmented--glass, .tabs--glass, .toolbar-group, .composer, .toast, .drop-overlay__card) { position: relative; }

/* Rim light: a 1px gradient ring, brightest top-left, catching the pointer */
:is(.glass, .btn--glass, .icon-btn--glass, .chip--glass, .segmented--glass, .tabs--glass,
    .sidebar, .toolbar-group, .composer, .popover, .sheet, .toast, .palette, .drop-overlay__card)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: var(--rim-width, 1px);
  background:
    radial-gradient(var(--spec-size, 160px) circle at var(--mx, 30%) var(--my, -40%),
      rgba(255, 255, 255, calc(var(--spec, 0) * var(--spec-rim))) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(var(--rim-angle, 140deg), var(--_rim-a) 0%, var(--_rim-b) 28%, var(--_rim-b) 62%, var(--_rim-c) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
/* Specular: a soft light under the pointer, behind the content */
:is(.glass, .btn--glass, .icon-btn--glass, .chip--glass, .segmented--glass, .tabs--glass,
    .sidebar, .toolbar-group, .composer, .popover, .sheet, .toast, .palette, .drop-overlay__card)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(var(--spec-size, 200px) circle at var(--mx, 30%) var(--my, -40%), var(--spec-color), rgba(255, 255, 255, 0) 65%);
  opacity: max(var(--spec, 0), var(--press, 0));
  transition: opacity var(--dur-3) var(--ease-out);
  pointer-events: none;
}

/* Variants */
.glass--strong { --_bg: var(--glass-bg-strong); --_filter: var(--glass-filter-strong); }
.glass--clear  { --_bg: var(--glass-bg-clear); --_filter: var(--glass-filter-clear); --_shadow: var(--glass-shadow-sm); }
/* Clear glass over bright, busy content: add the ~35% dimming layer, white labels */
.glass--dim {
  --_bg: var(--glass-dim);
  --label-1: rgba(255, 255, 255, .96);
  --label-2: rgba(255, 255, 255, .8);
  --label-3: rgba(255, 255, 255, .66);
  --fill-3: rgba(255, 255, 255, .16);
  --fill-2: rgba(255, 255, 255, .22);
  color: var(--label-1);
}
/* Tinted (prominent) glass: the accent colour carried by the material */
.glass--tinted {
  --_bg: color-mix(in srgb, var(--tint, var(--accent-fill)) 92%, transparent);
  --_rim-a: rgba(255, 255, 255, .7);
  --_rim-b: rgba(255, 255, 255, .14);
  --_rim-c: rgba(255, 255, 255, .4);
  --label-1: #fff;
  --label-2: rgba(255, 255, 255, .86);
  --label-3: rgba(255, 255, 255, .74);
  color: #fff;
}
.glass--interactive { cursor: pointer; transition: transform var(--dur-spring) var(--ease-spring), background-color var(--dur-2) var(--ease-out); }
.glass--interactive:hover { --_bg: var(--glass-bg-hover); }
.glass--interactive:active { --press: 1; transform: scale(1.03); transition-duration: 160ms; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass-bg: rgba(250, 250, 252, .9); --glass-bg-strong: rgba(250, 250, 252, .96); --glass-bg-clear: rgba(250, 250, 252, .7); }
}


/* 8  CONTENT MATERIAL ===================================================== */
/* Standard material for the content layer: opaque enough to read, softly
   tinted by the wallpaper. Verdicts, evidence, tables, documents. */
.material {
  background-color: var(--material-bg);
  border-radius: var(--r-card);
  box-shadow: var(--material-shadow);
  color: var(--label-1);
}
.material--thick { background-color: var(--material-bg-thick); }
.material--blur { -webkit-backdrop-filter: var(--material-filter); backdrop-filter: var(--material-filter); }

.card {
  background-color: var(--material-bg);
  border-radius: var(--r-card);
  box-shadow: var(--material-shadow);
  color: var(--label-1);
  padding: var(--space-5);
}
.card--lg { border-radius: var(--r-outer); padding: var(--space-7); }
.card--flush { padding: 0; overflow: hidden; }
.card__header { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.card__title { font-size: var(--fs-headline); line-height: var(--lh-headline); font-weight: 600; }
.card__subtitle { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); color: var(--label-2); }
.card__actions { margin-left: auto; display: flex; gap: var(--space-1); }

/* Inset well inside material (concentric: card 20 − padding 6 = 14) */
.well {
  background: var(--well-bg);
  border-radius: var(--r-inner);
  padding: var(--space-3) var(--space-4);
}

/* Grouped list (Settings style) */
.list {
  background: var(--well-bg);
  border-radius: var(--r-inner);
  overflow: hidden;
}
.list__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
}
.list__row + .list__row::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--space-4);
  right: 0;
  height: .5px;
  background: var(--separator-strong);
}
.list__label { flex: 1; min-width: 0; }
.list__label small { display: block; font-size: max(13px, var(--fs-footnote)); line-height: 18px; color: var(--label-2); }

.divider { height: .5px; border: 0; margin: var(--space-3) 0; background: var(--separator-strong); }
.divider--vertical { width: .5px; height: 20px; margin: 0 var(--space-1); background: var(--separator-strong); align-self: center; }


/* 9  BUTTONS ============================================================== */
.btn {
  --btn-h: var(--control-h);
  --btn-px: 14px;
  --btn-bg: transparent;
  --btn-fg: var(--label-1);
  --btn-line: var(--separator-strong);
  --btn-shade: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--btn-h);
  min-width: var(--btn-h);
  padding: 0 var(--btn-px);
  border: 1px solid var(--btn-line);
  border-radius: var(--r-button);
  background-color: var(--btn-bg);
  background-image: linear-gradient(var(--btn-shade), var(--btn-shade));
  color: var(--btn-fg);
  font-family: var(--font-text);
  font-size: var(--fs-callout);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -.01em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition:
    background-color var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out),
    opacity var(--dur-1) var(--ease-out);
}
/* Pressing darkens, it does not shrink or bounce */
.btn:hover { --btn-bg: var(--fill-4); text-decoration: none; }
.btn:active { --btn-shade: rgba(0, 0, 0, .06); transition-duration: 80ms; }
.btn .icon { --icon-size: 17px; margin-inline: -2px; }
.btn > .kbd { margin-left: 2px; margin-right: -4px; }
.btn--xs { --btn-h: var(--control-h-xs); --btn-px: 10px; font-size: var(--fs-footnote); gap: 4px; border-radius: var(--r-button-sm); }
.btn--xs .icon { --icon-size: 13px; }
.btn--sm { --btn-h: var(--control-h-sm); --btn-px: 12px; font-size: var(--fs-subheadline); gap: 5px; border-radius: var(--r-button-sm); }
.btn--sm .icon { --icon-size: 15px; }
.btn--lg { --btn-h: var(--control-h-lg); --btn-px: 20px; font-size: var(--fs-body); font-weight: 600; gap: 8px; }
.btn--lg .icon { --icon-size: 19px; }
.btn--block { width: 100%; }

/* Glass button: floating controls on the wallpaper or over content */
.btn--glass { --btn-bg: var(--_bg); --btn-fg: var(--label-1); --btn-line: transparent; }
.btn--glass:hover { --_bg: var(--glass-bg-hover); }
.btn--glass:active { --press: 1; }

/* Prominent: the one main action, solid signal blue, flat (white text ≥ 4.5:1). Hover deepens it and lifts it
   a little; pressing deepens it more. No gloss, no rim, no glow at rest. */
.btn--prominent {
  --btn-bg: var(--accent-fill);
  --btn-fg: var(--on-accent);
  --btn-line: transparent;
  font-weight: 600;
}
.btn--prominent:hover { --btn-bg: var(--accent-fill); --btn-shade: rgba(0, 0, 0, .1); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent-fill) 80%, transparent); }
.btn--prominent:active { --btn-shade: rgba(0, 0, 0, .2); box-shadow: none; }

/* Plain: text-only, underlined, for tertiary actions */
.btn--plain { --btn-bg: transparent; --btn-fg: var(--accent-ink); --btn-line: transparent; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.btn--plain:hover { --btn-bg: transparent; text-decoration: underline; text-decoration-color: currentColor; }

/* Destructive */
.btn--destructive { --btn-bg: transparent; --btn-fg: var(--red-ink); --btn-line: color-mix(in srgb, var(--red) 40%, transparent); }
.btn--destructive:hover { --btn-bg: color-mix(in srgb, var(--red) 8%, transparent); }
.btn--destructive.btn--prominent { --btn-bg: var(--red-fill); --btn-fg: #fff; --btn-line: transparent; }

.btn:disabled, .btn[aria-disabled="true"], .icon-btn:disabled, .icon-btn[aria-disabled="true"] {
  opacity: .42;
  cursor: default;
  pointer-events: none;
  filter: saturate(.6);
}

/* Icon buttons: 10px rounded squares (Ink, 15 October). aria-label is required. */
.icon-btn {
  --ib: var(--control-h);
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--ib);
  height: var(--ib);
  flex: none;
  padding: 0;
  border: 0;
  border-radius: var(--r-button);
  background-color: transparent;
  color: var(--label-2);
  cursor: pointer;
  transition:
    background-color var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out);
}
.icon-btn .icon { --icon-size: 18px; }
.icon-btn:hover { background-color: var(--fill-3); color: var(--label-1); }
.icon-btn:active { background-color: var(--fill-2); transition-duration: 80ms; }
.icon-btn--xs { --ib: 22px; border-radius: var(--r-xs); } .icon-btn--xs .icon { --icon-size: 13px; --icon-stroke: 2; }
.icon-btn--sm { --ib: var(--control-h-sm); border-radius: var(--r-button-sm); } .icon-btn--sm .icon { --icon-size: 16px; }
.icon-btn--lg { --ib: var(--control-h-lg); border-radius: 12px; } .icon-btn--lg .icon { --icon-size: 20px; }
.icon-btn--filled { background-color: var(--fill-3); color: var(--label-1); }
.icon-btn--filled:hover { background-color: var(--fill-2); }
.icon-btn--glass { background-color: var(--_bg); color: var(--label-1); }
.icon-btn--glass:hover { --_bg: var(--glass-bg-hover); }
.icon-btn--glass:active { --press: 1; }
.icon-btn--prominent {
  background-color: var(--accent-fill);
  color: var(--on-accent);
}
.icon-btn--prominent:hover { background-color: var(--accent-fill); background-image: linear-gradient(rgba(0, 0, 0, .1), rgba(0, 0, 0, .1)); color: var(--on-accent); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent-fill) 80%, transparent); }
.icon-btn--prominent:active { background-color: var(--accent-fill); background-image: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .2)); box-shadow: none; }
.icon-btn[aria-pressed="true"], .icon-btn.is-active { background-color: var(--accent-soft); color: var(--accent-ink); }

/* Badge dot / count on an icon button */
.icon-btn__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red-fill);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 0 0 2px var(--material-bg-thick);
}


/* 10  SEGMENTED CONTROL, TABS, SWITCH ===================================== */
/* JS ([data-segmented] / [data-tabs]) adds the sliding thumb and keyboard
   support. The thumb briefly swells into a glass lens while it moves. */
.segmented, .tabs {
  --seg-h: var(--control-h);
  --seg-pad: 3px;
  position: relative;
  display: inline-flex;
  align-items: stretch;
  height: var(--seg-h);
  padding: var(--seg-pad);
  border-radius: var(--r-button);
  background-color: var(--fill-3);
  isolation: isolate;
  max-width: 100%;
}
.segmented > button, .tabs > button,
.segmented > [role="radio"], .tabs > [role="tab"] {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 14px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--label-2);
  font-family: var(--font-text);
  font-size: var(--fs-subheadline);
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color var(--dur-2) var(--ease-out);
}
.segmented > button .icon, .tabs > button .icon { --icon-size: 15px; }
@media (max-width: 520px) { .segmented--block > button .icon { display: none; } .segmented > button, .tabs > button { padding: 0 10px; } }
.segmented > button:hover, .tabs > button:hover { color: var(--label-1); }
.segmented > [aria-checked="true"], .tabs > [aria-selected="true"] { color: var(--label-1); }
.segmented > button:focus-visible, .tabs > button:focus-visible { outline-offset: -1px; }
.segmented__thumb {
  position: absolute;
  z-index: 0;
  top: var(--seg-pad);
  bottom: var(--seg-pad);
  left: 0;
  width: var(--thumb-w, 0px);
  transform: translateX(var(--thumb-x, 0px));
  border-radius: calc(var(--r-button) - var(--seg-pad));
  background-color: var(--seg-thumb);
  box-shadow: var(--seg-thumb-shadow);
  pointer-events: none;
  transition:
    transform var(--dur-spring) var(--ease-spring),
    width var(--dur-spring) var(--ease-spring),
    scale var(--dur-3) var(--ease-spring),
    background-color var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out);
}
.segmented:not(.is-ready) .segmented__thumb, .tabs:not(.is-ready) .segmented__thumb { transition: none; }
.is-moving > .segmented__thumb { scale: 1; }   /* it slides; it no longer swells into a lens (Ink, 15 October) */
.segmented--sm { --seg-h: var(--control-h-sm); --seg-pad: 2px; }
.segmented--sm > button { padding: 0 11px; font-size: var(--fs-footnote); }
.segmented--lg { --seg-h: var(--control-h-lg); --seg-pad: 4px; }
.segmented--lg > button { padding: 0 18px; font-size: var(--fs-callout); }
.segmented--block { display: flex; width: 100%; }
.segmented--accent > [aria-checked="true"] { color: var(--on-accent); }
.segmented--accent > .segmented__thumb { background-color: var(--accent-fill); box-shadow: none; }
.segmented--glass, .tabs--glass { background-color: var(--_bg); }
.tabs > button { padding: 0 16px; }

/* Switch: <input type="checkbox" class="switch" role="switch">.
   Ink, 15 October (decision 0030): a rounded-rectangle track with a square knob, not Apple's capsule. Off is a
   grey outline with a grey knob; on is solid signal blue with a white knob. The knob slides; it does not stretch,
   swell or turn to glass when pressed. */
.switch {
  --sw-w: 40px;
  --sw-h: 24px;
  --sw-pad: 3px;
  --knob: calc(var(--sw-h) - 2 * var(--sw-pad));
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  display: inline-block;
  flex: none;
  width: var(--sw-w);
  height: var(--sw-h);
  margin: 0;
  border-radius: 7px;
  background-color: transparent;
  box-shadow: inset 0 0 0 1.5px var(--separator-strong);
  cursor: pointer;
  vertical-align: middle;
  transition: background-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.switch::before {
  content: "";
  position: absolute;
  top: var(--sw-pad);
  left: var(--sw-pad);
  width: var(--knob);
  height: var(--knob);
  border-radius: 4px;
  background-color: var(--label-3);
  transition:
    transform var(--dur-2) var(--ease-out),
    background-color var(--dur-2) var(--ease-out);
}
.switch:hover { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--label-1) 34%, transparent); }
.switch:checked, .switch:checked:hover { background-color: var(--accent-fill); box-shadow: none; }
.switch:checked::before { background-color: #fff; transform: translateX(calc(var(--sw-w) - var(--knob) - 2 * var(--sw-pad))); }
.switch:active::before { background-color: var(--label-2); }
.switch:checked:active::before { background-color: rgba(255, 255, 255, .85); }
.switch:disabled { opacity: .45; cursor: default; }
.switch--sm { --sw-w: 34px; --sw-h: 20px; --sw-pad: 3px; border-radius: 6px; }
.switch--sm::before { border-radius: 3px; }
.switch:focus-visible { outline-offset: 2px; }


/* 11  CHIPS, GRADES, STATUS, LOCKS ======================================== */
.chip {
  --chip-h: 28px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--chip-h);
  max-width: 100%;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-button-sm);
  background-color: var(--fill-3);
  color: var(--label-1);
  font-family: var(--font-text);
  font-size: var(--fs-subheadline);
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition:
    transform var(--dur-spring) var(--ease-spring),
    background-color var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out);
}
.chip > span:not(.chip__dot) { overflow: hidden; text-overflow: ellipsis; }
.chip .icon { --icon-size: 15px; margin-left: -2px; color: var(--label-2); }
button.chip, a.chip { cursor: pointer; }
button.chip:not(.chip--glass), a.chip:not(.chip--glass) { background-color: transparent; box-shadow: inset 0 0 0 1px var(--separator-strong); }
button.chip:hover, a.chip:hover { background-color: var(--fill-4); text-decoration: none; }
button.chip:active, a.chip:active { background-color: var(--fill-3); transition-duration: 80ms; }
.chip[aria-pressed="true"], .chip.is-selected, .chip--accent, button.chip[aria-pressed="true"], button.chip.is-selected {
  background-color: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
.chip[aria-pressed="true"] .icon, .chip.is-selected .icon, .chip--accent .icon { color: var(--accent-ink); }
.chip--outline { background-color: transparent; box-shadow: inset 0 0 0 1px var(--separator-strong); }
.chip--glass { background-color: var(--_bg); }
.chip--sm { --chip-h: 24px; padding: 0 10px; font-size: var(--fs-footnote); gap: 5px; }
.chip--sm .icon { --icon-size: 13px; }
.chip--lg { --chip-h: 34px; padding: 0 14px; font-size: var(--fs-callout); }
.chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--accent)); flex: none; }
.chip__remove {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: -6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fill-2);
  color: var(--label-2);
  cursor: pointer;
  flex: none;
}
.chip__remove .icon { --icon-size: 10px; --icon-stroke: 2.6; margin: 0; color: inherit; }
.chip__remove:hover { background: var(--fill-1); color: var(--label-1); }
/* Memory chip: how the user likes answers (editable) */
.chip--memory { background-color: var(--chip-surface); box-shadow: inset 0 0 0 .5px var(--separator-strong); }
.chip--memory .icon { color: var(--accent-ink); }   /* the ink keeps the remove cross at 3:1 or better on the chip, light and dark */

/* Evidence grades */
.grade {
  --_c: var(--gray);
  --_ink: var(--gray-ink);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px 0 7px;
  border-radius: var(--r-capsule);
  background-color: color-mix(in srgb, var(--_c) 15%, transparent);
  color: var(--_ink);
  font-size: var(--fs-footnote);
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
}
.grade .icon { --icon-size: 13px; --icon-stroke: 2.1; }
/* New keys first; the v2 keys are aliases and look identical */
.grade:is([data-grade="confirmed"], [data-grade="corroborated"])     { --_c: var(--grade-confirmed);   --_ink: var(--grade-confirmed-ink); }
.grade:is([data-grade="one-source"], [data-grade="single"])          { --_c: var(--grade-one-source);  --_ink: var(--grade-one-source-ink); }
.grade:is([data-grade="not-checked"], [data-grade="unverified"])     { --_c: var(--grade-not-checked); --_ink: var(--grade-not-checked-ink); }
.grade:is([data-grade="disagree"], [data-grade="contradicted"])      { --_c: var(--grade-disagree);    --_ink: var(--grade-disagree-ink); }
.grade--sm { height: 20px; padding: 0 8px 0 6px; font-size: var(--fs-caption); }
/* A grade chip is a button: tap for a one-line explanation */
.grade--button {
  position: relative;
  border: 0;
  font-family: var(--font-text);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform var(--av-dur-snappy) var(--av-snappy), background-color var(--dur-1) var(--ease-out);
}
.grade--button:hover { background-color: color-mix(in srgb, var(--_c) 24%, transparent); }
.grade--button:active { transform: scale(.94); transition-duration: 110ms; }
.grade--button[aria-expanded="true"] { background-color: color-mix(in srgb, var(--_c) 26%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--_c) 55%, transparent); }
.grade--dot { padding: 0 9px 0 8px; }
.grade--dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--_c); }

/* Status pills: ready / progress / attention / error / neutral */
.status {
  --_c: var(--gray);
  --_ink: var(--gray-ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px 0 8px;
  border-radius: var(--r-capsule);
  background-color: color-mix(in srgb, var(--_c) 13%, transparent);
  color: var(--_ink);
  font-size: var(--fs-footnote);
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--_c); flex: none; }
.status[data-tone="ready"]     { --_c: var(--green);  --_ink: var(--green-ink); }
.status[data-tone="progress"]  { --_c: var(--accent); --_ink: var(--accent-ink); }
.status[data-tone="attention"] { --_c: var(--orange); --_ink: var(--orange-ink); }
.status[data-tone="error"]     { --_c: var(--red);    --_ink: var(--red-ink); }
.status[data-tone="info"]      { --_c: var(--gray);   --_ink: var(--gray-ink); }
.status[data-tone="progress"]::before { animation: av-pulse 1.2s var(--ease-in-out) infinite; }
.status--plain { background: transparent; padding: 0; height: auto; }

/* Confidential lock toggle (aria-pressed="true" = locked). Contains both
   icons; CSS shows the right one. */
.lock-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--label-3);
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), transform var(--dur-spring) var(--ease-spring);
}
.lock-toggle .icon { --icon-size: 15px; grid-area: 1 / 1; transition: opacity var(--dur-1), transform var(--dur-spring) var(--ease-bounce); }
.lock-toggle:hover { background: var(--fill-3); color: var(--label-1); }
.lock-toggle:active { transform: scale(.88); }
.lock-toggle .icon-locked { opacity: 0; transform: scale(.6); }
.lock-toggle[aria-pressed="true"] { color: var(--label-1); }
.lock-toggle[aria-pressed="true"] .icon-locked { opacity: 1; transform: none; }
.lock-toggle[aria-pressed="true"] .icon-unlocked { opacity: 0; transform: scale(.6); }
.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px 0 6px;
  border-radius: var(--r-capsule);
  background: var(--fill-3);
  color: var(--label-2);
  font-size: var(--fs-caption);
  line-height: 1;
  font-weight: 600;
}
.lock-badge .icon { --icon-size: 12px; --icon-stroke: 2; }

/* Keyboard key */
.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--fill-3);
  box-shadow: inset 0 -1px 0 var(--separator-strong);
  color: var(--label-2);
  font-family: var(--font-text);
  font-size: var(--fs-caption);
  line-height: 1;
  font-weight: 600;
  letter-spacing: .02em;
}


/* 12  FILE TYPES, FILE CHIPS, FILE ROWS, CONTEXT METER ==================== */
.type-badge {
  --tb: var(--type-other);
  --size: 32px;
  display: inline-grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  flex: none;
  border-radius: calc(var(--size) * .26);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tb) 74%, #fff) 0%, var(--tb) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .34), inset 0 0 0 .5px rgba(0, 0, 0, .14), 0 1px 2px rgba(0, 0, 0, .1);
  color: #fff;
  font-family: var(--font-rounded);
  font-size: calc(var(--size) * .42);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.02em;
  user-select: none;
}
.type-badge .icon { --icon-size: calc(var(--size) * .58); --icon-stroke: 2; }
.type-badge[data-type="word"]       { --tb: var(--type-word); }
.type-badge[data-type="excel"]      { --tb: var(--type-excel); }
.type-badge[data-type="powerpoint"] { --tb: var(--type-powerpoint); }
.type-badge[data-type="pdf"]        { --tb: var(--type-pdf); font-size: calc(var(--size) * .27); letter-spacing: 0; }
.type-badge[data-type="image"]      { --tb: var(--type-image); }
.type-badge[data-type="link"]       { --tb: var(--type-link); }
.type-badge[data-type="text"]       { --tb: var(--type-text); }
.type-badge[data-type="other"]      { --tb: var(--type-other); }
.type-badge[data-type="folder"]     { --tb: var(--type-folder); }
.type-badge--xs { --size: 18px; }
.type-badge--sm { --size: 24px; }
.type-badge--lg { --size: 40px; }
.type-badge--xl { --size: 56px; }
.type-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--type-other)); flex: none; }

/* File chip: badge, name, live status line, lock, remove, progress inside */
.file-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 248px;
  max-width: 100%;
  min-height: 48px;
  padding: 7px 6px 7px 8px;
  border-radius: var(--r-inner);
  background-color: var(--chip-surface);
  box-shadow: inset 0 0 0 .5px var(--separator), 0 1px 2px rgba(0, 0, 0, .05);
  color: var(--label-1);
  overflow: hidden;
  isolation: isolate;
  vertical-align: top;
  transition: box-shadow var(--dur-2) var(--ease-out), transform var(--dur-spring) var(--ease-spring), opacity var(--dur-2) var(--ease-out);
  animation: av-chip-in var(--dur-spring) var(--ease-spring) both;
}
.file-chip .type-badge { --size: 32px; }
.file-chip__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.file-chip__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-subheadline);
  line-height: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.file-chip__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-footnote);
  line-height: 15px;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
}
.file-chip__actions { display: flex; align-items: center; gap: 0; margin-left: auto; }
.file-chip__progress {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 3px;
  height: 3px;
  border-radius: 2px;
  background: var(--fill-2);
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease-out);
}
.file-chip__progress::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent);
  transform: translateX(calc(var(--p, 0) * 1% - 100%));
  transition: transform 160ms linear;
}
.file-chip[data-state="uploading"] .file-chip__progress,
.file-chip[data-state="reading"] .file-chip__progress,
.file-chip[data-state="queued"] .file-chip__progress { opacity: 1; }
.file-chip[data-state="reading"] .file-chip__progress::after {
  width: 40%;
  transform: none;
  animation: av-indeterminate 1.1s var(--ease-in-out) infinite;
}
.file-chip[data-state="reading"] .file-chip__meta { color: var(--accent-ink); }
.file-chip[data-state="attention"] { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--orange) 55%, transparent), 0 1px 2px rgba(0, 0, 0, .05); }
.file-chip[data-state="attention"] .file-chip__meta { color: var(--orange-ink); font-weight: 500; }
.file-chip[data-state="uploading"] .type-badge, .file-chip[data-state="queued"] .type-badge { filter: saturate(.5); opacity: .75; }
.file-chip.is-leaving { animation: av-chip-out 220ms var(--ease-out) both; }
.file-chip.is-flash { animation: av-flash 900ms var(--ease-out); }
.file-chip--compact { width: auto; min-height: 36px; padding: 4px 4px 4px 5px; gap: 8px; border-radius: var(--r-small); }
.file-chip--compact .type-badge { --size: 26px; }
.file-chip--compact .file-chip__meta { display: none; }
.file-chip__fix { color: var(--orange-ink); }
.file-chip__fix:hover { color: var(--orange-ink); background: color-mix(in srgb, var(--orange) 14%, transparent); }

.file-tray { display: flex; flex-wrap: wrap; gap: 8px; }
.file-tray:empty { display: none; }

/* File rows: lists and tables built from intake.rows() */
.file-table { display: flex; flex-direction: column; gap: 2px; }
.file-table__head {
  display: grid;
  grid-template-columns: var(--file-cols, 36px minmax(180px, 1.6fr) minmax(150px, 1.4fr) 138px 118px 50px 34px);
  align-items: center;
  gap: 12px;
  padding: 0 10px 6px;
  font-size: var(--fs-footnote);
  line-height: var(--lh-footnote);
  font-weight: 600;
  color: var(--label-2);
  border-bottom: .5px solid var(--separator-strong);
  margin-bottom: 4px;
}
.file-row {
  position: relative;
  display: grid;
  grid-template-columns: var(--file-cols, 36px minmax(180px, 1.6fr) minmax(150px, 1.4fr) 138px 118px 50px 34px);
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 7px 10px;
  border-radius: var(--r-small);
  color: var(--label-1);
  transition: background-color var(--dur-1) var(--ease-out);
  animation: av-row-in var(--dur-3) var(--ease-out) both;
}
.file-row:hover { background-color: var(--fill-4); }
.file-row.is-selected, .file-row[aria-selected="true"] { background-color: var(--accent-soft); }
.file-row .type-badge { --size: 32px; }
.file-row__main { min-width: 0; }
.file-row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-callout); line-height: 19px; font-weight: 600; letter-spacing: -.01em; }
.file-row__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-footnote); line-height: 16px; color: var(--label-2); }
.file-row__read { min-width: 0; font-size: var(--fs-subheadline); line-height: 18px; color: var(--label-2); }
.file-row__read b { font-weight: 600; color: var(--label-1); }
.file-row__fix { display: block; margin-top: 2px; font-size: max(13px, var(--fs-footnote)); line-height: 17px; color: var(--orange-ink); }
.file-row__note { display: block; margin-top: 2px; font-size: max(13px, var(--fs-footnote)); line-height: 17px; color: var(--gray-ink); }
.file-row__progress { display: block; margin-top: 6px; }
.file-row.is-leaving { animation: av-chip-out 200ms var(--ease-out) both; }
.file-row.is-flash { animation: av-flash 900ms var(--ease-out); }
.file-row[data-state="attention"] .file-row__read { color: var(--label-1); }

/* Context meter: a storage-style bar split by file type */
.meter { display: grid; gap: 8px; }
.meter__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.meter__title { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); font-weight: 600; }
.meter__value { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); color: var(--label-2); font-variant-numeric: tabular-nums; }
.meter__bar {
  display: flex;
  gap: 2px;
  height: 8px;
  border-radius: var(--r-capsule);
  background: var(--fill-3);
  overflow: hidden;
}
.meter__seg {
  flex: 0 0 var(--w, 0%);
  background: var(--c, var(--accent));
  border-radius: 2px;
  transition: flex-basis var(--dur-spring) var(--ease-spring);
}
.meter__seg:first-child { border-radius: var(--r-capsule) 2px 2px var(--r-capsule); }
.meter__legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-2); }
.meter__legend span { display: inline-flex; align-items: center; gap: 6px; }
.meter__note { font-size: max(13px, var(--fs-footnote)); line-height: 18px; color: var(--label-2); }


/* 13  INPUTS, TEXT AREAS, COMPOSER ======================================== */
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.field__label { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); font-weight: 600; color: var(--label-2); }
.field__hint { font-size: max(13px, var(--fs-footnote)); line-height: 18px; color: var(--label-2); }
.field__error { font-size: max(13px, var(--fs-footnote)); line-height: 18px; color: var(--red-ink); font-weight: 500; }

.input, .textarea, .select {
  width: 100%;
  border: 0;
  background-color: var(--field-bg);
  color: var(--label-1);
  font-family: var(--font-text);
  box-shadow: inset 0 0 0 1px var(--field-border);
  transition: box-shadow var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out);
  outline: none;
}
.input {
  --in-h: var(--control-h);
  height: var(--in-h);
  padding: 0 12px;
  border-radius: var(--r-small);
  font-size: var(--fs-callout);
  line-height: 1.2;
}
.input::placeholder, .textarea::placeholder { color: var(--label-3); opacity: 1; }
.input:hover, .textarea:hover, .select:hover { box-shadow: inset 0 0 0 1px var(--field-border-hover); }
.input:focus, .textarea:focus, .select:focus { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 2px var(--focus-halo), 0 0 0 4px var(--focus-ring); }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible { outline: none; }
.input[aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--red), 0 0 0 3.5px color-mix(in srgb, var(--red) 30%, transparent); }
.input--capsule { border-radius: var(--r-capsule); padding: 0 16px; }
.input--lg { --in-h: 44px; font-size: var(--fs-body); padding: 0 14px; border-radius: var(--r-inner); }
.input--sm { --in-h: var(--control-h-sm); font-size: var(--fs-subheadline); }
.select {
  -webkit-appearance: none;
  appearance: none;
  height: var(--control-h);
  padding: 0 34px 0 12px;
  border-radius: var(--r-small);
  font-size: var(--fs-callout);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9.5l4-4 4 4M8 14.5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
}
.search-field { position: relative; display: flex; align-items: center; min-width: 0; }
.search-field > .icon { position: absolute; left: 11px; --icon-size: 16px; color: var(--label-3); pointer-events: none; }
.search-field .input { padding-left: 34px; border-radius: var(--r-capsule); }
.search-field .kbd { position: absolute; right: 8px; }

.textarea {
  display: block;
  min-height: 88px;
  max-height: 50vh;
  padding: 12px 14px;
  border-radius: var(--r-inner);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  resize: none;
  overflow-y: auto;
  field-sizing: content;
}
/* Large question box: auto-grows (field-sizing, with a JS fallback) */
.textarea--lg {
  min-height: 128px;
  padding: 18px 20px;
  border-radius: var(--r-card);
  font-family: var(--font-text);
  font-size: var(--fs-title-3);
  line-height: 28px;
  letter-spacing: -.012em;
}
.textarea--bare { background: transparent; box-shadow: none; padding: 8px 10px; min-height: 44px; }
.textarea--bare:hover, .textarea--bare:focus { box-shadow: none; }

/* Composer: the floating glass input. Padding 10 → chips 28 − 10 = 18. */
.composer {
  --composer-pad: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--composer-pad);
  border-radius: var(--r-composer);
  --_bg: var(--glass-bg-strong);
  --_filter: var(--glass-filter-strong);
}
.composer .file-chip { border-radius: calc(var(--r-composer) - var(--composer-pad)); }
.composer .file-chip .type-badge { border-radius: 50%; }
.composer__tray { display: flex; flex-wrap: wrap; gap: 6px; }
.composer__tray:empty { display: none; }
.composer__tray > .file-chip { flex: 1 1 228px; width: auto; max-width: 100%; }
.composer__tray > .file-chip--compact { flex: 0 1 auto; }
.composer__input {
  display: block;
  width: 100%;
  min-height: 44px;
  max-height: 240px;
  padding: 10px 10px 6px;
  border: 0;
  background: transparent;
  color: var(--label-1);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  resize: none;
  outline: none;
  field-sizing: content;
}
.composer__input::placeholder { color: var(--label-3); }
.composer__bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.composer__bar .spacer { flex: 1; }
.composer__bar > .btn-send:last-child { margin-left: auto; }
.composer:has(.composer__input:focus-visible), .composer:has(.composer__input:focus) { --_shadow: 0 0 0 2px var(--focus-halo), 0 0 0 4px var(--focus-ring), var(--glass-shadow); }
.btn-send {
  --ib: 36px;
  border-radius: var(--r-button);
}
.btn-send .icon { --icon-size: 18px; --icon-stroke: 2.2; }


/* 14  SIDEBAR AND TOOLBAR ================================================= */
/* Floating glass sidebar, inset from the window edge (outer radius 28,
   padding 14 → rows 14). */
.sidebar {
  position: fixed;
  z-index: 30;
  top: var(--inset);
  bottom: var(--inset);
  left: var(--inset);
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px;
  border-radius: var(--r-outer);
  overflow: hidden;
  transition: transform var(--dur-spring) var(--ease-spring), opacity var(--dur-2) var(--ease-out);
}
.sidebar--static { position: relative; top: auto; bottom: auto; left: auto; height: 100%; }
.sidebar__header { display: flex; align-items: center; gap: 10px; padding: 2px 4px 12px; }
.sidebar__scroll {
  flex: 1;
  min-height: 0;
  margin: 0 -14px;
  padding: 0 14px 8px;
  overflow-y: auto;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 20px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 20px), transparent 100%);
}
.sidebar__section { display: flex; flex-direction: column; gap: 1px; padding-top: 10px; }
.sidebar__section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 4px;
  font-size: var(--fs-footnote);
  line-height: var(--lh-footnote);
  font-weight: 600;
  color: var(--label-3);
}
.sidebar__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--row-h);
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-inner);
  background: transparent;
  color: var(--label-1);
  font-size: var(--fs-callout);
  line-height: 18px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  transition: background-color var(--dur-1) var(--ease-out);
}
.sidebar__item > span:not(.sidebar__count) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__item .icon { --icon-size: 17px; color: var(--accent); }
.sidebar__item:hover { background-color: var(--fill-4); text-decoration: none; }
.sidebar__item[aria-current="page"], .sidebar__item[aria-current="true"], .sidebar__item.is-selected { background-color: var(--fill-2); }
.sidebar__count { margin-left: auto; font-size: var(--fs-footnote); color: var(--label-3); font-variant-numeric: tabular-nums; }
.sidebar__footer { padding-top: 10px; border-top: .5px solid var(--separator); display: flex; align-items: center; gap: 10px; }
@media (max-width: 760px) {
  .sidebar:not(.sidebar--static) { transform: translateX(calc(-100% - var(--inset) * 2)); }
  .sidebar.is-open { transform: none; }
}
.with-sidebar { padding-left: calc(var(--sidebar-w) + var(--inset) * 2); }
@media (max-width: 760px) { .with-sidebar { padding-left: 0; } }

/* Toolbar: a layout row of glass capsule groups (the row itself is not glass) */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--toolbar-h);
}
.toolbar--floating {
  position: fixed;
  z-index: 40;
  top: var(--inset);
  left: var(--inset);
  right: var(--inset);
  pointer-events: none;
}
.toolbar--floating > * { pointer-events: auto; }
.toolbar__title { padding: 0 8px; font-size: var(--fs-headline); line-height: var(--lh-headline); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar__subtitle { display: block; font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: 400; color: var(--label-2); }
.toolbar__spacer { flex: 1; }
.toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: calc(var(--control-h) + 8px);
  padding: 4px;
  border-radius: calc(var(--r-button) + 4px);   /* hugs the 10px buttons inside (Ink, 15 October) */
}
.toolbar-group > .btn { --btn-bg: transparent; }
.toolbar-group > .btn:hover { --btn-bg: var(--fill-3); }
.toolbar-group > .segmented, .toolbar-group > .tabs { background-color: transparent; }
.toolbar-group .divider--vertical { height: 18px; }


/* 15  POPOVER, MENU, CITATION, SHEET ====================================== */
.popover {
  position: fixed;
  z-index: 80;
  top: 0;
  left: 0;
  width: var(--pop-w, 360px);
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 6px;
  border-radius: var(--r-card);
  --_bg: var(--glass-bg-strong);
  --_filter: var(--glass-filter-strong);
  transform-origin: var(--pop-ox, 50%) var(--pop-oy, 0%);
  animation: av-pop-in var(--dur-spring) var(--ease-spring) both;
  outline: none;
}
.popover.is-leaving { animation: av-pop-out 160ms var(--ease-out) both; }
.popover__header { display: flex; align-items: flex-start; gap: 10px; padding: 8px 8px 10px; }
.popover__header .type-badge { --size: 28px; }
.popover__heading { min-width: 0; flex: 1; }
.popover__title { font-size: var(--fs-callout); line-height: 19px; font-weight: 600; overflow-wrap: anywhere; }
.popover__subtitle { margin-top: 2px; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-2); }
.popover__well {
  padding: 12px 14px;
  border-radius: var(--r-inner);
  background-color: var(--material-bg-thick);
  box-shadow: inset 0 0 0 .5px var(--material-edge);
  color: var(--label-1);
}
.popover__body { padding: 0 8px 8px; font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); color: var(--label-2); }
.popover__footer { display: flex; align-items: center; gap: 6px; padding: 8px 2px 2px 6px; }
.popover__footer .spacer { flex: 1; }

.excerpt { margin: 0; font-size: var(--fs-callout); line-height: 21px; color: var(--label-1); }
.excerpt::before { content: "\201C"; }
.excerpt::after { content: "\201D"; }
.excerpt mark, mark.hl {
  padding: 0 2px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--yellow) var(--mark-mix, 42%), transparent);
  color: inherit;
}
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: 500; color: var(--label-2); }
.crumbs .icon { --icon-size: 10px; --icon-stroke: 2.4; color: var(--label-3); }

/* Inline citation trigger */
.cite {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px 0 5px;
  margin: 0 1px;
  border: 0;
  border-radius: var(--r-capsule);
  background: var(--accent-soft);
  color: var(--accent-ink);
  /* Small text on a tinted chip: deepen the ink slightly in light mode to clear 4.5:1. */
  color: color-mix(in srgb, var(--accent-ink) 86%, #000);
  font-family: var(--font-text);
  font-size: var(--fs-footnote);
  line-height: 1;
  font-weight: 600;
  vertical-align: 1px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease-out), transform var(--dur-spring) var(--ease-spring);
}
.cite:hover { background: var(--accent-soft-2); }
.cite:active { transform: scale(.94); }
.cite[aria-expanded="true"] { background: var(--accent-fill); color: var(--on-accent); }
.cite .type-dot { width: 7px; height: 7px; }
.cite--num { min-width: 20px; padding: 0 6px; justify-content: center; }

/* Menu inside a popover (macOS: highlight is the accent) */
.menu { display: flex; flex-direction: column; gap: 1px; }
.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-inner);
  background: transparent;
  color: var(--label-1);
  font-size: var(--fs-callout);
  text-align: left;
  cursor: pointer;
}
.menu__item .icon { --icon-size: 16px; color: var(--label-2); }
.menu__item:hover, .menu__item:focus-visible { background: var(--accent-fill); color: var(--on-accent); outline: none; }
.menu__item:hover .icon, .menu__item:focus-visible .icon { color: var(--on-accent); }
.menu__item[aria-checked="true"]::after { content: ""; margin-left: auto; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--check-mask) center / contain no-repeat; mask: var(--check-mask) center / contain no-repeat; }
.menu__label { padding: 6px 10px 2px; font-size: var(--fs-footnote); font-weight: 600; color: var(--label-3); }
.menu__sep { height: .5px; margin: 4px 10px; background: var(--separator-strong); }
:root { --check-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4.2 4.2L18.5 7.8'/%3E%3C/svg%3E"); }

/* Sheet: a <dialog class="sheet-dialog"> containing .sheet-backdrop + .sheet */
.sheet-dialog, .palette-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  background: transparent;
  color: var(--label-1);
  overflow: hidden;
}
.sheet-dialog[open] { display: grid; place-items: center; }
/* clip, not hidden: focus inside an off-screen sheet must never scroll the dialog itself */
.sheet-dialog, .palette-dialog { overflow: clip; }
.sheet-dialog::backdrop, .palette-dialog::backdrop { background: transparent; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out);
}
.is-open > .sheet-backdrop { opacity: 1; }
.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(var(--sheet-w, 560px), 100%);
  max-height: min(820px, calc(100dvh - 48px));
  border-radius: var(--r-outer);
  --_bg: var(--glass-bg-strong);
  --_filter: var(--glass-filter-strong);
  opacity: 0;
  transform: translateY(18px) scale(.94);
  transition: transform var(--dur-spring) var(--ease-spring), opacity var(--dur-2) var(--ease-out);
}
.is-open > .sheet { opacity: 1; transform: none; }
.is-closing > .sheet { transition-duration: 200ms; transition-timing-function: var(--ease-out); }
.sheet--lg { --sheet-w: 760px; }
.sheet--sm { --sheet-w: 420px; }
.sheet__header { display: flex; align-items: flex-start; gap: 12px; padding: 22px 18px 10px 24px; }
.sheet__heading { flex: 1; min-width: 0; }
.sheet__title { font-family: var(--font-display); font-size: var(--fs-title-2); line-height: var(--lh-title-2); font-weight: var(--fw-display); letter-spacing: var(--ls-display); }
.sheet__subtitle { margin-top: 4px; font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); color: var(--label-2); }
.sheet__body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 24px 12px; }
.sheet__footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 18px 18px 24px; }
.sheet__footer .spacer { flex: 1; }
.sheet__section + .sheet__section { margin-top: 22px; }
.sheet__section-title { margin-bottom: 8px; font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); font-weight: 600; color: var(--label-2); }

/* Swatches (personalise) */
.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch { position: relative; display: inline-grid; place-items: center; gap: 6px; cursor: pointer; font-size: var(--fs-caption); color: var(--label-2); }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.swatch__dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform var(--dur-spring) var(--ease-bounce), box-shadow var(--dur-2) var(--ease-out);
}
.swatch:hover .swatch__dot { transform: scale(1.08); }
.swatch input:checked + .swatch__dot { box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .18), inset 0 0 0 8px var(--swatch), inset 0 0 0 26px #fff; }
.swatch input:focus-visible + .swatch__dot { outline: 3px solid var(--focus); outline-offset: 2px; }
.wallpaper-swatch { position: relative; display: grid; gap: 6px; cursor: pointer; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-2); text-align: center; }
.wallpaper-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.wallpaper-swatch__thumb {
  width: 92px;
  height: 60px;
  border-radius: var(--r-small);
  background: var(--swatch);
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .14), 0 1px 2px rgba(0, 0, 0, .08);
  transition: box-shadow var(--dur-2) var(--ease-out), transform var(--dur-spring) var(--ease-spring);
}
/* Six wallpapers in one even row (two rows of three on phones), never five and one */
.swatches--wallpaper { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.swatches--wallpaper .wallpaper-swatch__thumb { width: 100%; height: auto; aspect-ratio: 23 / 15; }
@media (max-width: 560px) { .swatches--wallpaper { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
/* Two controls side by side in a sheet (Appearance and Density); stacked on phones so neither is clipped */
.sheet__section--pair { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 560px) { .sheet__section--pair { grid-template-columns: minmax(0, 1fr); } }
.wallpaper-swatch:hover .wallpaper-swatch__thumb { transform: translateY(-1px); }
.wallpaper-swatch input:checked + .wallpaper-swatch__thumb { box-shadow: 0 0 0 2px var(--material-bg-thick), 0 0 0 4.5px var(--accent); }
.wallpaper-swatch input:checked ~ span { color: var(--label-1); font-weight: 600; }
.wallpaper-swatch input:focus-visible + .wallpaper-swatch__thumb { outline: 3px solid var(--focus); outline-offset: 5px; }


/* 16  TOAST, COMMAND PALETTE ============================================== */
.toast-region {
  position: fixed;
  z-index: 95;
  left: 50%;
  bottom: calc(var(--inset) * 2);
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  max-width: min(600px, calc(100vw - 32px));
  padding: 6px 6px 6px 16px;
  border-radius: var(--r-capsule);
  --_bg: var(--glass-bg-strong);
  --_filter: var(--glass-filter-strong);
  font-size: var(--fs-callout);
  line-height: 19px;
  font-weight: 500;
  pointer-events: auto;
  animation: av-toast-in var(--dur-spring) var(--ease-spring) both;
}
.toast:not(:has(.toast__action, .toast__close)) { padding-right: 18px; }
.toast > .icon { --icon-size: 19px; color: var(--accent); }
.toast[data-tone="success"] > .icon { color: var(--green); }
.toast[data-tone="warning"] > .icon { color: var(--orange); }
.toast[data-tone="error"] > .icon { color: var(--red); }
.toast__text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.toast__text small { display: block; font-size: max(13px, var(--fs-footnote)); line-height: 18px; font-weight: 400; color: var(--label-2); }
.toast__action { margin-left: 4px; }
/* A second voice after a message: the toast's `tail`, and the few places that are not toasts. Quieter than
   the fact it follows, and aria-hidden in the markup: it is seen, never read out. */
.voice-tail { font-weight: 400; color: var(--label-2); }
.toast.is-leaving { animation: av-toast-out 220ms var(--ease-out) both; }
.toast--multiline { border-radius: var(--r-card); padding-top: 10px; padding-bottom: 10px; align-items: flex-start; }

.palette-dialog[open] { display: flex; justify-content: center; align-items: flex-start; padding-top: min(16vh, 140px); }
.palette {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: min(520px, calc(100dvh - 120px));
  padding: 8px;
  border-radius: var(--r-outer);
  --_bg: var(--glass-bg-strong);
  --_filter: var(--glass-filter-strong);
  opacity: 0;
  transform: translateY(-8px) scale(.97);
  transition: transform var(--dur-spring) var(--ease-spring), opacity var(--dur-2) var(--ease-out);
}
.is-open > .palette { opacity: 1; transform: none; }
.palette__search { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 14px 0 16px; }
.palette__search > .icon { --icon-size: 21px; color: var(--label-2); }
.palette__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--label-1);
  font-family: var(--font-text);
  font-size: var(--fs-title-3);
  letter-spacing: -.012em;
  outline: none;
}
.palette__input::placeholder { color: var(--label-3); }
.palette__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 2px 0 0;
  padding: 6px 0 2px;
  border-top: .5px solid var(--separator-strong);
  list-style: none;
}
.palette__group { padding: 10px 12px 4px; font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: 600; color: var(--label-3); }
.palette__item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px 0 8px;
  border-radius: calc(var(--r-outer) - 8px);
  color: var(--label-1);
  font-size: var(--fs-callout);
  cursor: pointer;
  user-select: none;
}
.palette__tile {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--fill-3);
  color: var(--label-1);
  flex: none;
}
.palette__tile .icon { --icon-size: 16px; }
.palette__tile .chip__dot { width: 14px; height: 14px; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .2); }
.palette__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette__text small { margin-left: 8px; color: var(--label-2); font-size: max(13px, var(--fs-footnote)); }
.palette__hint { display: flex; gap: 3px; }
.palette__item[aria-selected="true"] { background: var(--accent-fill); color: var(--on-accent); }
.palette__item[aria-selected="true"] .palette__tile { background: rgba(255, 255, 255, .22); color: #fff; }
.palette__item[aria-selected="true"] .palette__text small { color: rgba(255, 255, 255, .78); }
.palette__item[aria-selected="true"] .kbd { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }
.palette__empty { padding: 28px 12px; text-align: center; color: var(--label-2); font-size: var(--fs-callout); }
.palette__footer { display: flex; gap: 16px; padding: 8px 12px 4px; border-top: .5px solid var(--separator-strong); font-size: var(--fs-footnote); color: var(--label-2); }
.palette__footer span { display: inline-flex; align-items: center; gap: 5px; }


/* 17  PROGRESS, SPINNER, TIMELINE, AVATAR ================================= */
.progress {
  position: relative;
  height: 6px;
  border-radius: var(--r-capsule);
  background: var(--fill-2);
  overflow: hidden;
}
.progress__bar {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent);
  transform: translateX(calc(var(--value, 0) * 100% - 100%));
  transition: transform var(--dur-3) var(--ease-out);
}
.progress--sm { height: 4px; }
.progress--lg { height: 8px; }
.progress--indeterminate .progress__bar { width: 38%; transform: none; animation: av-indeterminate 1.3s var(--ease-in-out) infinite; }

/* Activity indicator: 8 spokes, Apple style */
.spinner {
  --sp: 18px;
  display: inline-block;
  width: var(--sp);
  height: var(--sp);
  flex: none;
  background: currentColor;
  color: var(--label-2);
  vertical-align: middle;
  -webkit-mask: var(--spinner-mask) center / contain no-repeat;
  mask: var(--spinner-mask) center / contain no-repeat;
  animation: av-spin 0.9s steps(8) infinite;
}
.spinner--sm { --sp: 14px; }
.spinner--lg { --sp: 28px; }
:root {
  --spinner-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 2.8v4.4'/%3E%3Cpath d='M18.5 5.5l-3.1 3.1' stroke-opacity='.18'/%3E%3Cpath d='M21.2 12h-4.4' stroke-opacity='.26'/%3E%3Cpath d='M18.5 18.5l-3.1-3.1' stroke-opacity='.34'/%3E%3Cpath d='M12 21.2v-4.4' stroke-opacity='.44'/%3E%3Cpath d='M5.5 18.5l3.1-3.1' stroke-opacity='.56'/%3E%3Cpath d='M2.8 12h4.4' stroke-opacity='.7'/%3E%3Cpath d='M5.5 5.5l3.1 3.1' stroke-opacity='.85'/%3E%3C/svg%3E");
  --excl-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 6.5v7' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='18' r='1.7'/%3E%3C/svg%3E");
}

/* Placeholder while something loads: grey shapes where the content will be,
   with a slow sheen. A.skeleton(kind, n) writes them; .skeleton--line,
   --title, --chip, --card and --tile set the shape. Under reduce motion,
   or with the page hidden, the sheen stops and the shapes stay. */
.skeleton {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--fill-3);
  min-height: 12px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, var(--fill-4) 42%, rgba(255, 255, 255, .22) 50%, var(--fill-4) 58%, transparent 80%);
  transform: translateX(-100%);
  animation: av-skeleton 1.6s var(--ease-in-out) infinite;
}
.skeleton--line { height: 12px; width: var(--w, 100%); }
.skeleton--title { height: 20px; width: var(--w, 60%); border-radius: 10px; }
.skeleton--chip { display: inline-block; height: 26px; width: var(--w, 96px); border-radius: 999px; }
.skeleton--card { height: var(--h, 96px); border-radius: var(--r-lg, 18px); }
.skeleton--tile { height: var(--h, 120px); border-radius: var(--r-lg, 18px); }
.skeleton-group { display: flex; flex-direction: column; gap: 10px; }
.skeleton-group--row { flex-direction: row; flex-wrap: wrap; }
@keyframes av-skeleton { to { transform: translateX(100%); } }

/* A button at work: A.busy(button) puts a spinner where its icon was, keeps
   its width, says what is happening to a screen reader and stops a second
   press. The label can change while it works ("Checking…"). */
.btn.is-busy, button.is-busy { pointer-events: none; cursor: progress; }
.btn.is-busy > .icon:first-child, .btn.is-busy > svg:first-child { display: none; }
.btn.is-busy .spinner { color: currentColor; margin-inline-end: 6px; }
.btn--icon.is-busy .spinner, .btn--round.is-busy .spinner { margin: 0; }

/* Timeline: pending / running / done / attention */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 2px 12px;
  padding-bottom: 16px;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 10.25px;
  top: 26px;
  bottom: 4px;
  width: 1.5px;
  border-radius: 1px;
  background: var(--separator-strong);
  transition: background-color var(--dur-3) var(--ease-out);
}
.timeline__item[data-status="done"]:not(:last-child)::before { background: color-mix(in srgb, var(--green) 55%, transparent); }
.timeline__node {
  position: relative;
  grid-row: span 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--label-4);
  transition: background-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), transform var(--dur-spring) var(--ease-bounce);
}
.timeline__node::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.timeline__title { font-size: var(--fs-callout); line-height: 22px; font-weight: 600; color: var(--label-3); transition: color var(--dur-2) var(--ease-out); }
.timeline__detail { grid-column: 2; font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); color: var(--label-2); font-variant-numeric: tabular-nums; }
.timeline__time { grid-column: 3; grid-row: 1; font-size: var(--fs-footnote); line-height: 22px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.timeline__item[data-status="running"] .timeline__title,
.timeline__item[data-status="done"] .timeline__title,
.timeline__item[data-status="attention"] .timeline__title { color: var(--label-1); }
.timeline__item[data-status="pending"] .timeline__detail { color: var(--label-3); }
.timeline__item[data-status="running"] .timeline__node { box-shadow: inset 0 0 0 2px var(--accent-soft-2); }
.timeline__item[data-status="running"] .timeline__node::after {
  inset: 0;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: av-spin .8s linear infinite;
}
.timeline__item[data-status="running"] .timeline__node::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: av-pulse 1.2s var(--ease-in-out) infinite;
}
.timeline__item[data-status="done"] .timeline__node { background: var(--green-fill); box-shadow: none; transform: scale(1); }
.timeline__item[data-status="done"] .timeline__node::after {
  inset: 5px;
  border-radius: 0;
  background: #fff;
  -webkit-mask: var(--check-mask) center / contain no-repeat;
  mask: var(--check-mask) center / contain no-repeat;
  animation: av-pop-in 420ms var(--ease-bounce) both;
}
.timeline__item[data-status="attention"] .timeline__node { background: var(--orange-fill); box-shadow: none; }
.timeline__item[data-status="attention"] .timeline__node::after {
  inset: 4px;
  border-radius: 0;
  background: #fff;
  -webkit-mask: var(--excl-mask) center / contain no-repeat;
  mask: var(--excl-mask) center / contain no-repeat;
}
.timeline__item[data-status="attention"] .timeline__detail { color: var(--orange-ink); }
.timeline--compact .timeline__item { padding-bottom: 10px; }

/* Avatar: Apple contacts-style gradient with initials */
.avatar {
  --size: 32px;
  --av: #9AA0AC;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  flex: none;
  border-radius: 50%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--av) 70%, #fff) 0%, var(--av) 100%);
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .3);
  color: #fff;
  font-family: var(--font-rounded);
  font-size: calc(var(--size) * .4);
  line-height: 1;
  font-weight: 600;
  letter-spacing: .01em;
  user-select: none;
}
.avatar--accent { --av: var(--accent-fill); }
.avatar--xs { --size: 20px; }
.avatar--sm { --size: 24px; }
.avatar--lg { --size: 44px; }
.avatar--xl { --size: 64px; }
.avatar__status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 30%;
  height: 30%;
  min-width: 8px;
  min-height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px var(--material-bg-thick);
}
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar + .avatar { margin-left: calc(var(--size) * -.28); box-shadow: 0 0 0 2px var(--material-bg-thick); }


/* 18  SCROLL EDGE, DROP OVERLAY, EMPTY STATE ============================== */
/* Scroll-edge effect: content passing under a floating bar blurs and fades.
   Place .scroll-edge inside a positioned scroll area (or use --fixed). */
.scroll-edge {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  height: var(--edge-h, 72px);
  pointer-events: none;
}
.scroll-edge--top { top: 0; }
.scroll-edge--bottom { bottom: 0; }
.scroll-edge--fixed { position: fixed; }
.scroll-edge--sticky { position: sticky; margin-bottom: calc(var(--edge-h, 72px) * -1); }
.scroll-edge::before, .scroll-edge::after { content: ""; position: absolute; inset: 0; }
.scroll-edge--top::before {
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 20%, transparent 100%);
}
.scroll-edge--top::after {
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 60%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 60%);
  background: linear-gradient(to bottom, var(--edge-tint, color-mix(in srgb, var(--wallpaper-base) 55%, transparent)) 0%, transparent 100%);
}
.scroll-edge--bottom::before {
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  -webkit-mask-image: linear-gradient(to top, #000 20%, transparent 100%);
  mask-image: linear-gradient(to top, #000 20%, transparent 100%);
}
.scroll-edge--bottom::after {
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 60%);
  mask-image: linear-gradient(to top, #000 0%, transparent 60%);
  background: linear-gradient(to top, var(--edge-tint, color-mix(in srgb, var(--wallpaper-base) 55%, transparent)) 0%, transparent 100%);
}
/* Alternative for nested scroll lists: fade the content itself */
.scroll-fade {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top, 24px), #000 calc(100% - var(--fade-bottom, 24px)), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top, 24px), #000 calc(100% - var(--fade-bottom, 24px)), transparent 100%);
}

/* Full-window drop overlay (built by avengers.js). The blur sits on
   ::before so the centred glass card can still sample the page. */
.drop-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease-out), visibility 0s linear var(--dur-2);
}
.drop-overlay.is-active { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity var(--dur-2) var(--ease-out); }
.drop-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--accent) 10%, var(--scrim));
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  backdrop-filter: blur(6px) saturate(140%);
}
.drop-overlay::after {
  content: "";
  position: absolute;
  inset: var(--inset);
  border-radius: var(--r-outer);
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--accent) 85%, transparent), inset 0 0 40px color-mix(in srgb, var(--accent) 25%, transparent);
  transform: scale(1.015);
  transition: transform var(--dur-spring) var(--ease-spring);
}
.drop-overlay.is-active::after { transform: none; }
.drop-overlay * { pointer-events: none; }
.drop-overlay__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(440px, 100%);
  padding: 30px 36px 26px;
  border-radius: var(--r-outer);
  --_bg: var(--glass-bg-strong);
  --_filter: var(--glass-filter-strong);
  text-align: center;
  transform: scale(.9) translateY(10px);
  transition: transform var(--dur-spring) var(--ease-bounce);
}
.drop-overlay.is-active .drop-overlay__card { transform: none; }
.drop-overlay__stack { position: relative; width: 132px; height: 70px; margin-bottom: 12px; }
.drop-overlay__stack .type-badge {
  --size: 56px;
  position: absolute;
  left: 38px;
  top: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .34), 0 6px 18px -4px rgba(0, 0, 0, .3);
  transition: transform var(--dur-spring) var(--ease-bounce);
}
.drop-overlay__stack .type-badge:nth-child(1) { transform: translateX(-34px) rotate(-12deg); }
.drop-overlay__stack .type-badge:nth-child(2) { transform: translateX(34px) rotate(12deg); }
.drop-overlay__stack .type-badge:nth-child(3) { transform: translateY(-6px); z-index: 1; }
.drop-overlay:not(.is-active) .drop-overlay__stack .type-badge { transform: none; }
.drop-overlay__title { font-family: var(--font-display); font-size: var(--fs-title-2); line-height: var(--lh-title-2); font-weight: var(--fw-display); letter-spacing: var(--ls-display); }
.drop-overlay__hint { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); color: var(--label-2); }

/* Inline drop zone (material); .is-dragover while files hover it */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 200px;
  padding: 28px;
  border-radius: var(--r-card);
  background: var(--well-bg);
  box-shadow: inset 0 0 0 1.5px var(--separator-strong);
  text-align: center;
  transition: background-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), transform var(--dur-spring) var(--ease-spring);
}
.dropzone__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); }
.dropzone__icon .icon { --icon-size: 26px; }
.dropzone__title { font-size: var(--fs-headline); line-height: var(--lh-headline); font-weight: 600; }
.dropzone__hint { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); color: var(--label-2); max-width: 46ch; }
.dropzone__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.dropzone.is-drag-active { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 50%, transparent); }
.dropzone.is-dragover { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); transform: scale(1.01); }

/* Empty state */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 24px;
  text-align: center;
}
.empty__icon { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 6px; border-radius: 50%; background: var(--fill-3); color: var(--label-2); }
.empty__icon .icon { --icon-size: 28px; --icon-stroke: 1.5; }
.empty__title { font-family: var(--font-display); font-size: var(--fs-title-3); line-height: var(--lh-title-3); font-weight: var(--fw-display); }
.empty__body { max-width: 40ch; font-size: var(--fs-callout); line-height: var(--lh-callout); color: var(--label-2); }
.empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }


/* 19  UTILITIES, KEYFRAMES, A11Y FALLBACKS ================================ */
/* Visually hidden, still read by screen readers (never display:none) */
.sr-only, .visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.stack { display: flex; flex-direction: column; gap: var(--gap, var(--space-3)); }
.row { display: flex; align-items: center; gap: var(--gap, var(--space-2)); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--space-2)); }
.spacer { flex: 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.footer-note { font-size: max(13px, var(--fs-footnote)); line-height: 18px; color: var(--label-2); }

@keyframes av-spin { to { transform: rotate(360deg); } }
@keyframes av-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
@keyframes av-indeterminate { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
@keyframes av-pop-in { from { opacity: 0; transform: scale(.86); } }
@keyframes av-pop-out { to { opacity: 0; transform: scale(.95); } }
@keyframes av-toast-in { from { opacity: 0; transform: translateY(16px) scale(.9); } }
@keyframes av-toast-out { to { opacity: 0; transform: translateY(8px) scale(.96); } }
@keyframes av-chip-in { from { opacity: 0; transform: translateY(6px) scale(.88); } }
@keyframes av-chip-out { to { opacity: 0; transform: scale(.86); } }
@keyframes av-row-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes av-flash {
  0%, 100% { box-shadow: inset 0 0 0 .5px var(--separator), 0 1px 2px rgba(0, 0, 0, .05); }
  25%, 60% { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px var(--accent-soft); }
}
@keyframes av-fade-up { from { opacity: 0; transform: translateY(8px); } }
.av-enter { animation: av-fade-up var(--dur-3) var(--ease-out) both; }

/* View transitions (Avengers.morph): a quick, soft cross-fade */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 280ms; animation-timing-function: var(--ease-out); }

/* Reduced transparency: glass becomes solid, nothing is blurred */
@media (prefers-reduced-transparency: reduce) {
  :is(.glass, .btn--glass, .icon-btn--glass, .chip--glass, .segmented--glass, .tabs--glass, .sidebar, .toolbar-group, .composer, .popover, .sheet, .toast, .palette, .drop-overlay__card) { background-image: none; }
  :is(.glass, .btn--glass, .icon-btn--glass, .chip--glass, .segmented--glass, .tabs--glass, .sidebar, .toolbar-group, .composer, .popover, .sheet, .toast, .palette, .drop-overlay__card)::after { display: none; }
  .glass--clear.glass--dim { --_bg: #3A3A3F; }
  .scroll-edge::before, .scroll-edge::after, .drop-overlay::before { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
:root[data-reduce-transparency] :is(.glass, .btn--glass, .icon-btn--glass, .chip--glass, .segmented--glass, .tabs--glass, .sidebar, .toolbar-group, .composer, .popover, .sheet, .toast, .palette, .drop-overlay__card) { background-image: none; }
:root[data-reduce-transparency] :is(.glass, .btn--glass, .icon-btn--glass, .chip--glass, .segmented--glass, .tabs--glass, .sidebar, .toolbar-group, .composer, .popover, .sheet, .toast, .palette, .drop-overlay__card)::after { display: none; }
:root[data-reduce-transparency] .glass--clear.glass--dim { --_bg: #3A3A3F; }
:root[data-reduce-transparency] .scroll-edge::before,
:root[data-reduce-transparency] .scroll-edge::after,
:root[data-reduce-transparency] .drop-overlay::before { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Increased contrast: solid edges instead of soft rims, stronger chips */
@media (prefers-contrast: more) {
  :is(.glass, .btn--glass, .icon-btn--glass, .chip--glass, .segmented--glass, .tabs--glass, .sidebar, .toolbar-group, .composer, .popover, .sheet, .toast, .palette, .drop-overlay__card)::before { background: none; }
  .file-chip, .chip, .segmented, .tabs, .status, .grade { box-shadow: inset 0 0 0 1px var(--separator-strong); }
  .segmented__thumb { box-shadow: 0 0 0 1px var(--separator-strong); }
  :focus-visible { outline-width: 3.5px; }
}
:root[data-increase-contrast] :is(.glass, .btn--glass, .icon-btn--glass, .chip--glass, .segmented--glass, .tabs--glass, .sidebar, .toolbar-group, .composer, .popover, .sheet, .toast, .palette, .drop-overlay__card)::before { background: none; }
:root[data-increase-contrast] :is(.file-chip, .chip, .segmented, .tabs, .status, .grade) { box-shadow: inset 0 0 0 1px var(--separator-strong); }
:root[data-increase-contrast] .segmented__thumb { box-shadow: 0 0 0 1px var(--separator-strong); }
:root[data-increase-contrast] :focus-visible { outline-width: 3.5px; }

/* Reduced motion: nothing slides, springs or pulses (spinners still turn). Changes
   become short opacity and colour cross-fades (180ms) instead of hard cuts. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-property: opacity, color, background-color, border-color, fill !important;
    transition-duration: 180ms !important;
    transition-timing-function: ease-out !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .spinner { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
  .timeline__item[data-status="running"] .timeline__node::after { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
:root[data-reduce-motion] *, :root[data-reduce-motion] *::before, :root[data-reduce-motion] *::after {
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
  transition-property: opacity, color, background-color, border-color, fill !important;
  transition-duration: 180ms !important;
  transition-timing-function: ease-out !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}
:root[data-reduce-motion] .spinner,
:root[data-reduce-motion] .timeline__item[data-status="running"] .timeline__node::after { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }

@media print {
  body::before, body::after { display: none; }
  :is(.glass, .sidebar, .toolbar-group, .composer, .popover, .sheet, .toast, .palette) { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; box-shadow: 0 0 0 1px #ccc; }
}

/* Citation chips keep the plain accent ink in dark mode, where deepening would lower contrast. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cite { color: var(--accent-ink); }
}
:root[data-theme="dark"] .cite { color: var(--accent-ink); }


/* =========================================================================
   v3 · EASE OF USE, TOUCH AND PHONE
   -------------------------------------------------------------------------
   20 Grade explanations and highlights    25 Bottom sheets and present()
   21 Private pill, privacy capsule/sheet   26 Accessibility floors
   22 Options pill and menu                 27 Touch density (pointer: coarse)
   23 Coach marks                           28 Phone: iOS type scale, banners,
   24 Files react, iWork badges, menus,        full-screen palette, safe areas,
      citation pager, link form                tab bar, auto-hide
                                            29 Dark, contrast, hidden tab
   ========================================================================= */

/* 20  GRADE EXPLANATIONS AND HIGHLIGHTS =================================== */
.popover--grade { --pop-w: 300px; }
.grade-explain { padding: 8px 8px 6px; }
.grade-explain__head .grade { height: 26px; padding: 0 11px 0 9px; font-size: var(--fs-subheadline); }
.grade-explain__head .grade .icon { --icon-size: 15px; }
.grade-explain__text { margin-top: 10px; font-size: var(--fs-callout); line-height: var(--lh-callout); color: var(--label-1); }
.grade-explain__note { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: max(13px, var(--fs-footnote)); line-height: 18px; color: var(--label-2); }
/* Points that carry a grade: mark them data-grade-item="confirmed" inside [data-grade-scope] */
[data-grade-item] { transition: opacity var(--av-dur-snappy) var(--av-snappy); }
.is-grade-dimmed { opacity: .38; }
.is-grade-match {
  --_gc: var(--accent);
  border-radius: var(--r-small);
  background-color: color-mix(in srgb, var(--_gc) 8%, transparent);
  box-shadow: inset 3px 0 0 var(--_gc);
}
[data-grade-focus="confirmed"] .is-grade-match   { --_gc: var(--grade-confirmed); }
[data-grade-focus="one-source"] .is-grade-match  { --_gc: var(--grade-one-source); }
[data-grade-focus="not-checked"] .is-grade-match { --_gc: var(--grade-not-checked); }
[data-grade-focus="disagree"] .is-grade-match    { --_gc: var(--grade-disagree); }


/* 21  PRIVATE PILL, PRIVACY CAPSULE AND SHEET ============================= */
/* Private (filled) / Can be quoted (outline). Replaces the v2 lock icon; it keeps
   the .lock-toggle class for old selectors, so everything is reset here. */
.private-pill {
  position: relative;
  display: inline-flex;
  place-items: initial;          /* clears .lock-toggle's grid centring; must come before align-items */
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  flex: none;
  width: auto;
  height: 22px;
  min-width: 0;
  max-width: 100%;
  padding: 0 9px 0 7px;
  border: 0;
  border-radius: var(--r-capsule);
  background: var(--fill-2);
  color: var(--label-1);
  font-family: var(--font-text);
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -.003em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out), transform var(--av-dur-snappy) var(--av-snappy);
}
.private-pill .icon { --icon-size: 12px; --icon-stroke: 2.1; flex: none; grid-area: auto; opacity: 1; transform: none; }
.private-pill__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.private-pill:hover { background: var(--fill-1); color: var(--label-1); }
.private-pill:active { transform: scale(.95); }
.private-pill[aria-pressed="false"], .private-pill--quotable {
  background: transparent;
  color: var(--label-2);
  box-shadow: inset 0 0 0 1px var(--separator-strong);
}
.private-pill[aria-pressed="false"]:hover { background: var(--fill-4); color: var(--label-1); }
.private-pill.is-changing .icon { animation: av-pill-icon var(--av-dur-smooth) var(--av-bouncy) both; }
.private-pill--demo { cursor: default; pointer-events: none; }
/* In file chips the pill leads the second line, so the name keeps its width */
.file-chip__sub { display: flex; align-items: center; gap: 6px; min-width: 0; }
.file-chip__sub .file-chip__meta { flex: 1; min-width: 0; }
.file-chip .private-pill { height: 18px; padding: 0 7px 0 5px; gap: 3px; font-size: 11px; }
.file-chip .private-pill .icon { --icon-size: 11px; }
.file-row > .private-pill { justify-self: start; }
@keyframes av-pill-icon { from { opacity: 0; transform: scale(.4) rotate(-24deg); } }

/* Privacy capsule: "Private to your firm · never put into web searches" */
.privacy-capsule {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 12px 0 4px;
  border: 0;
  border-radius: var(--r-button-sm);
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--label-1);
  font-family: var(--font-text);
  font-size: 13px;
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out), transform var(--av-dur-snappy) var(--av-snappy);
}
.privacy-capsule__icon { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 6px; background: var(--green-fill); color: #fff; }
.privacy-capsule__icon .icon { --icon-size: 13px; --icon-stroke: 2; }
.privacy-capsule__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.privacy-capsule:hover { background: color-mix(in srgb, var(--green) 18%, transparent); }
.privacy-capsule:active { background: color-mix(in srgb, var(--green) 24%, transparent); }

.sheet--privacy { --sheet-w: 500px; }
.privacy-sheet { display: grid; gap: 14px; }
.privacy-sheet__row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; align-items: start; }
.privacy-sheet__row > .private-pill { margin-top: 1px; justify-self: start; }
.privacy-sheet__row p { font-size: var(--fs-callout); line-height: var(--lh-callout); color: var(--label-1); }
.privacy-sheet__switch { margin-top: 2px; }
.privacy-sheet__switch .list__label { font-weight: 600; }
.privacy-sheet__switch .list__label small { font-weight: 400; }
.privacy-sheet__confirm {
  padding: 12px 14px;
  border-radius: var(--r-inner);
  background: color-mix(in srgb, var(--orange) 11%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--orange) 36%, transparent);
  animation: av-fade-up var(--av-dur-snappy) var(--av-smooth) both;
}
.privacy-sheet__confirm p { font-size: var(--fs-callout); line-height: var(--lh-callout); color: var(--label-1); }
.privacy-sheet__confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
/* After the two explanations: the link to the product's own page about where client files go (only when the
   product names one in AvengersData.copy.where). It lines up with the explanations' text, and opens a new tab. */
.privacy-sheet__where { margin-left: 140px; font-size: var(--fs-callout); line-height: var(--lh-callout); }
.privacy-sheet__where a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; border-radius: 6px; }
.privacy-sheet__where .icon { --icon-size: 14px; }
@media (pointer: coarse) {
  .privacy-sheet__where a { position: relative; }
  .privacy-sheet__where a::after { content: ""; position: absolute; left: -8px; right: -8px; top: 50%; height: 44px; transform: translateY(-50%); }
}
@media (max-width: 520px) { .privacy-sheet__row { grid-template-columns: minmax(0, 1fr); gap: 6px; } .privacy-sheet__where { margin-left: 0; } }
/* The names the switch keeps out (only when the page's privacy store knows them): a lead line, one chip each */
.privacy-sheet__names { display: grid; gap: 8px; justify-items: start; }
.privacy-sheet__names[hidden] { display: none; }
.kept-names__lead { margin: 0; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-2); }
.kept-names { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.kept-names .chip { max-width: 100%; cursor: default; }
.kept-names .chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* "Let Avengers quote this file in reports?" */
.sheet--confirm .confirm-text { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--label-1); }
.sheet--confirm .sheet__subtitle { overflow-wrap: anywhere; }


/* 22  OPTIONS PILL AND MENU =============================================== */
/* One quiet capsule under the question: "For Product Owner · Let Avengers decide ▾" */
.options-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  height: 30px;
  padding: 0 10px 0 12px;
  border: 0;
  border-radius: var(--r-button-sm);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--separator-strong);
  color: var(--label-1);
  font-family: var(--font-text);
  font-size: var(--fs-subheadline);
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), transform var(--av-dur-snappy) var(--av-snappy);
}
.options-pill:hover { background: var(--fill-4); }
.options-pill:active { background: var(--fill-3); }
.options-pill[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.options-pill__role { flex: none; font-weight: 600; }
.options-pill__dot { flex: none; color: var(--label-3); }
.options-pill__depth { display: inline-grid; min-width: 0; color: var(--label-2); }
.options-pill[aria-expanded="true"] .options-pill__depth { color: inherit; }
.options-pill__swap { grid-area: 1 / 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; transition: opacity 150ms var(--ease-out); }
.options-pill__swap.is-out, .options-pill__swap.is-in { opacity: 0; }
.options-pill__chev { --icon-size: 14px; --icon-stroke: 2.3; flex: none; color: var(--label-2); transition: transform var(--av-dur-snappy) var(--av-snappy); }
.options-pill[aria-expanded="true"] .options-pill__chev { transform: rotate(180deg); color: inherit; }

.popover--options { --pop-w: 360px; padding: 8px; }
.options-menu { display: grid; gap: 4px; }
.options-menu__section + .options-menu__section { padding-top: 6px; border-top: .5px solid var(--separator-strong); }
.options-menu__title { padding: 6px 10px 4px; font-size: max(13px, var(--fs-footnote)); line-height: 18px; font-weight: 600; color: var(--label-2); }
.options-menu__list { display: grid; gap: 1px; }
.options-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--r-inner);
  background: transparent;
  color: var(--label-1);
  font-family: var(--font-text);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out);
}
.options-menu__item:hover { background: var(--fill-4); }
.options-menu__item[aria-checked="true"] { background: var(--accent-soft); }
.options-menu__text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.options-menu__label { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; font-size: var(--fs-callout); line-height: 19px; font-weight: 600; }
.options-menu__time { font-size: 13px; font-weight: 500; color: var(--label-2); font-variant-numeric: tabular-nums; }
.options-menu__desc { font-size: 13px; line-height: 17px; color: var(--label-2); }
.options-menu__check { --icon-size: 16px; --icon-stroke: 2.4; flex: none; color: var(--accent-ink); opacity: 0; transform: scale(.6); transition: opacity var(--dur-1) var(--ease-out), transform var(--av-dur-snappy) var(--av-bouncy); }
.options-menu__item[aria-checked="true"] .options-menu__check { opacity: 1; transform: none; }
.options-menu__foot { display: flex; align-items: center; gap: 6px; margin-top: 2px; padding: 9px 10px 3px; border-top: .5px solid var(--separator-strong); font-size: 13px; line-height: 18px; color: var(--label-2); }
.options-menu__foot .icon { color: var(--green-ink); }
.options-menu__done { display: none; margin-top: 6px; }
.popover-content .options-menu__done { display: inline-flex; }


/* 23  COACH MARKS ========================================================= */
/* Floating glass cards with a soft spotlight (an SVG mask with a blurred hole) */
.coach { position: fixed; inset: 0; z-index: 92; pointer-events: none; }
.coach__scrim { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity var(--av-dur-snappy) var(--ease-out); }
.coach.is-open .coach__scrim { opacity: 1; }
.coach__fill { fill: var(--coach-scrim, rgba(12, 16, 30, .34)); }
.coach__hole { opacity: 0; transition: opacity 320ms var(--ease-out); }
.coach__hole.is-on { opacity: 1; }
.coach__card {
  position: fixed;
  left: 0;
  top: 0;
  width: min(340px, calc(100vw - 24px));
  padding: 16px 16px 12px;
  border-radius: var(--r-card);
  --_bg: var(--glass-bg-strong);
  --_filter: var(--glass-filter-strong);
  pointer-events: auto;
  opacity: 0;
  transform: translate3d(var(--coach-x, 0px), var(--coach-y, 0px), 0);
  transition: transform var(--av-dur-smooth) var(--av-smooth), opacity var(--av-dur-snappy) var(--ease-out);
}
.coach.is-open .coach__card { opacity: 1; }
.coach__card.is-placing { transition: none; }
.coach.is-leaving .coach__scrim, .coach.is-leaving .coach__card { opacity: 0; transition: opacity var(--av-dur-exit) var(--av-exit); }
.coach__inner { transition: opacity 120ms var(--ease-out); }
.coach__inner.is-swapping { opacity: 0; }
.coach__step { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--label-2); font-variant-numeric: tabular-nums; }
.coach__dots { display: inline-flex; gap: 4px; }
.coach__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--label-4); transition: background-color var(--dur-2) var(--ease-out), transform var(--av-dur-snappy) var(--av-bouncy); }
.coach__dots i.on { background: var(--accent); transform: scale(1.25); }
.coach__title { margin-top: 8px; font-family: var(--font-display); font-size: var(--fs-title-3); line-height: var(--lh-title-3); font-weight: var(--fw-display); letter-spacing: var(--ls-display); }
.coach__body { margin-top: 6px; font-size: var(--fs-callout); line-height: var(--lh-callout); color: var(--label-1); }
.coach__actions { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.coach__actions .spacer { flex: 1; }
@media (max-width: 760px) { .coach__card { width: calc(100vw - 24px); } }


/* 24  FILES REACT, IWORK BADGES, MENUS, CITATION PAGER, LINK FORM ========= */
.type-badge:is([data-type="keynote"], [data-type="numbers"], [data-type="pages"]) { --tb: var(--type-other); }

.file-chip__fix--info { color: var(--gray-ink); }
.file-chip__fix--info:hover { color: var(--label-1); background: var(--fill-3); }
.file-chip[data-notice] .file-chip__meta { color: var(--gray-ink); }
.explain__state { font-weight: 600; }
.explain__state--blocking { color: var(--orange-ink); }
.explain__state--info { color: var(--gray-ink); }
.explain__text { font-size: var(--fs-callout); line-height: var(--lh-callout); color: var(--label-1); }
.explain__fix { margin-top: 8px; }

/* While a run reads an item: a 2px accent leading edge, a shine on its name, a live meta line */
@property --av-shine { syntax: "<percentage>"; inherits: false; initial-value: -30%; }
@keyframes av-shine { from { --av-shine: -30%; } to { --av-shine: 130%; } }
.file-chip.is-being-read { box-shadow: inset 2px 0 0 var(--accent), inset 0 0 0 .5px var(--separator), 0 1px 2px rgba(0, 0, 0, .05); }
.file-row.is-being-read { box-shadow: inset 2px 0 0 var(--accent); background-color: var(--fill-4); }
.is-being-read :is(.file-chip__name, .file-row__name) {
  background-image: linear-gradient(100deg, var(--label-1) calc(var(--av-shine) - 20%), var(--accent-ink) var(--av-shine), var(--label-1) calc(var(--av-shine) + 20%));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: av-shine 1.8s linear infinite;
}
.file-chip.is-being-read .file-chip__meta, .file-row__activity { color: var(--accent-ink); font-variant-numeric: tabular-nums; }
/* Done: a small check pops on the badge, then fades */
:root { --check-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E"); }
.file-chip.is-just-read::after, .file-row.is-just-read::after {
  content: "";
  position: absolute;
  left: 30px;
  bottom: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green-fill) var(--check-white) center / 11px no-repeat;
  box-shadow: 0 0 0 2px var(--material-bg-thick);
  animation: av-check-pop 1.4s var(--ease-out) both;
  pointer-events: none;
}
.file-row.is-just-read::after { left: 32px; }
@keyframes av-check-pop { 0% { opacity: 0; transform: scale(.4); } 16% { opacity: 1; transform: scale(1.14); } 30% { transform: scale(1); } 78% { opacity: 1; } 100% { opacity: 0; } }

/* Menus and action sheets */
.menu__message { padding: 0 10px 6px; font-size: 13px; line-height: 18px; color: var(--label-2); }
.menu__item--destructive { color: var(--red-ink); }
.menu__item--destructive .icon { color: var(--red-ink); }
.menu__item--destructive:hover, .menu__item--destructive:focus-visible { background: var(--red-fill); }

/* Citation card: pager between sources, context passage (phones) */
.cite-card.is-leaving { opacity: 0; transform: translateX(var(--leave-x, 0px)); transition: opacity 130ms var(--av-exit), transform 130ms var(--av-exit); }
.cite-card.is-entering { animation: av-cite-in 260ms var(--av-smooth) both; }
@keyframes av-cite-in { from { opacity: 0; transform: translateX(var(--enter-x, 0px)); } }
.cite-pager { display: inline-flex; align-items: center; gap: 2px; }
.cite-pager__count { padding: 0 2px; font-size: 13px; font-weight: 500; color: var(--label-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Citation footer in two tidy rows: how well it is backed up, then paging and "Show in the file" */
.cite-card .popover__footer { flex-wrap: wrap; row-gap: 6px; }
.cite-card .popover__footer > .spacer { flex: 0 0 100%; height: 0; }
.cite-card .popover__footer > .t-footnote { white-space: nowrap; }
.cite-card .popover__footer > .btn { margin-left: auto; }
@media (max-width: 759px), (pointer: coarse) { .cite-pager { gap: 8px; } }
.cite-context { margin-top: 12px; padding: 0 8px 4px; }
.cite-context__label { margin-bottom: 4px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--label-2); }
.excerpt--context { color: var(--label-2); }
.excerpt--context mark { color: var(--label-1); }   /* the highlighted sentence is the evidence: full-strength text on the highlight */
.excerpt--context::before, .excerpt--context::after { content: none; }
.popover .cite-context { display: none; }   /* desktop: the excerpt is enough; phones drag up for the page */

.link-form { display: grid; gap: 8px; padding: 8px 8px 2px; }
.note-form textarea.input { --in-h: auto; min-height: 128px; padding: 10px 14px; line-height: 1.45; resize: vertical; font-family: inherit; }


/* 25  BOTTOM SHEETS AND present() ========================================= */
/* On phones avengers.js adds .is-bottom to every sheet dialog: a floating glass
   sheet with a grab handle, medium and large detents, drag, rubber-banding and
   swipe-down dismiss. --sheet-y (the drag offset) and --sheet-dim (backdrop)
   are set by avengers.js. Popovers and menus are presented here too. */
.sheet__grabber { display: none; }
.sheet-dialog.is-bottom[open] {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  padding: 0 max(8px, var(--safe-right)) var(--kb) max(8px, var(--safe-left));
}
.sheet-dialog.is-bottom > .sheet {
  width: 100%;
  max-width: 640px;
  margin: 0 auto max(8px, var(--safe-bottom));
  max-height: calc(100dvh - var(--safe-top) - 18px - var(--kb));
  border-radius: 30px;
  opacity: 1;
  transform: translate3d(0, calc(100% + 40px), 0);
  transition: transform var(--av-dur-smooth) var(--av-smooth);
}
.sheet-dialog.is-bottom.is-open > .sheet { transform: translate3d(0, var(--sheet-y, 0px), 0); }
.sheet-dialog.is-bottom.is-closing > .sheet { transform: translate3d(0, calc(100% + 40px), 0); transition: transform 260ms var(--av-exit); }
.sheet-dialog.is-bottom > .sheet.is-dragging { transition: none; }
.sheet-dialog.is-bottom > .sheet.is-tall { height: calc(100dvh - var(--safe-top) - 18px - var(--kb)); }
.sheet-dialog.is-bottom > .sheet-backdrop { transition: opacity var(--av-dur-snappy) var(--ease-out); }
.sheet-dialog.is-bottom.is-open > .sheet-backdrop { opacity: var(--sheet-dim, 1); }
.sheet-dialog.is-bottom:has(> .sheet.is-dragging) > .sheet-backdrop { transition: none; }
.sheet-dialog.is-bottom .sheet__grabber {
  position: relative;
  z-index: 3;
  display: block;
  flex: none;
  height: 20px;
  margin-bottom: -8px;
  touch-action: none;
  cursor: grab;
}
.sheet-dialog.is-bottom .sheet__grabber::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  width: 38px;
  height: 5px;
  margin-left: -19px;
  border-radius: 3px;
  background: var(--label-4);
}
.sheet-dialog.is-bottom .sheet__header { padding: 14px 14px 8px 20px; touch-action: none; }
.sheet-dialog.is-bottom .sheet__body { padding: 6px 20px 12px; overscroll-behavior: contain; }
.sheet-dialog.is-bottom .sheet.is-medium .sheet__body { overflow: hidden; touch-action: none; }
.sheet-dialog.is-bottom .sheet__footer { flex-wrap: wrap; padding: 10px 16px 16px; }
/* Confirm sheets on phones: stacked, full-width buttons, the safe (prominent) choice first */
.sheet-dialog.is-bottom .sheet--confirm .sheet__footer { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
.sheet-dialog.is-bottom .sheet--confirm .sheet__footer .spacer { display: none; }
.sheet-dialog.is-bottom .sheet--confirm .sheet__footer .btn { --btn-h: 50px; width: 100%; font-size: 17px; }
/* Presented popovers */
.sheet--present .present__body { padding: 10px 10px 12px; }
.popover-content .popover__footer { padding-bottom: 2px; }
.sheet--menu .menu__item { min-height: 50px; font-size: 17px; }
.sheet--menu .menu__item .icon { --icon-size: 20px; }
.sheet--menu .menu__label { padding: 4px 10px 8px; text-align: center; font-size: 13px; }
.sheet--menu .present__cancel { padding: 0 10px 12px; }
.present__cancel .btn { --btn-h: 50px; font-size: 17px; font-weight: 600; }


/* 26  ACCESSIBILITY FLOORS ================================================ */
/* Re-add the focus halo on components that draw their own shadow */
:is(.glass, .btn--glass, .icon-btn--glass, .chip--glass, .segmented--glass, .tabs--glass,
    .sidebar, .toolbar-group, .composer, .popover, .sheet, .toast, .palette, .drop-overlay__card):focus-visible {
  box-shadow: 0 0 0 2px var(--focus-halo), var(--glass-inner), var(--_shadow);
}
.btn--prominent:focus-visible {
  box-shadow: 0 0 0 2px var(--focus-halo);
}
.icon-btn--prominent:focus-visible {
  box-shadow: 0 0 0 2px var(--focus-halo);
}
:is(.chip--outline, .private-pill[aria-pressed="false"]):focus-visible { box-shadow: 0 0 0 2px var(--focus-halo), inset 0 0 0 1px var(--separator-strong); }
.chip--memory:focus-visible { box-shadow: 0 0 0 2px var(--focus-halo), inset 0 0 0 .5px var(--separator-strong); }
.file-chip:focus-visible { box-shadow: 0 0 0 2px var(--focus-halo), inset 0 0 0 .5px var(--separator); }
/* Inside segmented controls and tabs the ring sits inside the segment */
.segmented > button:focus-visible, .tabs > button:focus-visible { outline-offset: -2px; box-shadow: inset 0 0 0 4px var(--focus-halo); }
.options-menu__item:focus-visible, .menu__item:focus-visible, .palette__item:focus-visible { outline-offset: -2px; }
.swatch input:focus-visible + .swatch__dot,
.wallpaper-swatch input:focus-visible + .wallpaper-swatch__thumb { outline: var(--focus-width) solid var(--focus-ring); }
/* The selected citation chip stays readable in dark mode (white on the accent fill) */
:root .cite[aria-expanded="true"] { background: var(--accent-fill); color: var(--on-accent); }


/* 27  TOUCH DENSITY (pointer: coarse) ===================================== */
/* Applied automatically on touch screens: 36-44px controls, Send 44px, 17px
   fields (no zoom on focus, no zoom lock), and invisible 44pt hit areas. */
@media (pointer: coarse) {
  :root, [data-density="compact"] {
    --control-h-xs: 32px;
    --control-h-sm: 36px;
    --control-h: 40px;
    --control-h-lg: 44px;
    --row-h: 44px;
  }
  .btn-send { --ib: 44px; }
  .btn-send .icon { --icon-size: 20px; }
  .icon-btn--xs { --ib: 32px; }
  .icon-btn--xs .icon { --icon-size: 15px; }
  .chip { --chip-h: 36px; }
  .chip--sm { --chip-h: 32px; }
  .chip--lg { --chip-h: 40px; }
  .lock-toggle:not(.private-pill) { width: 36px; height: 36px; }
  .private-pill { height: 28px; padding: 0 11px 0 9px; font-size: 13px; }
  .private-pill .icon { --icon-size: 13px; }
  .file-chip .private-pill { height: 24px; padding: 0 9px 0 7px; font-size: 12px; }
  .file-chip .private-pill .icon { --icon-size: 12px; }
  .grade { height: 26px; }
  .cite { position: relative; height: 26px; padding: 0 9px 0 7px; }
  .chip__remove { position: relative; }
  .menu__item { min-height: 44px; }
  .sidebar__item { min-height: 44px; }
  .switch, .switch--sm { --sw-w: 46px; --sw-h: 28px; --sw-pad: 3px; border-radius: 8px; }
  .switch--sm::before { border-radius: 4px; }
  .file-chip { min-height: 56px; }
  .options-pill, .privacy-capsule { position: relative; height: 36px; }
  .thinking__summary, .thinking__notify { position: relative; }
  .file-chip .private-pill { z-index: 1; }
  .select { height: 44px; }
  .options-menu__item { min-height: 52px; }
  .palette__item { min-height: 50px; }
  .input, .select, .textarea:not(.textarea--lg), .composer__input, .palette__input,
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select, textarea:not(.textarea--lg) { font-size: max(17px, 1em); }
  .input { --in-h: 44px; }
  :is(.cite, .grade--button, .chip--sm:not(.chip--glass), .chip__remove, .icon-btn--xs:not(.icon-btn--glass),
      .icon-btn--sm:not(.icon-btn--glass), .lock-toggle, .private-pill, .tag,
      .btn:not(.btn--glass):not(.btn--lg), .segmented--sm > button, .icon-btn:not(.icon-btn--glass):not(.btn-send),
      .options-pill, .privacy-capsule, .thinking__summary, .thinking__notify)::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(100%, 44px);
    height: max(100%, 44px);
    transform: translate(-50%, -50%);
  }
}


/* 28  PHONE: iOS TYPE SCALE, BANNERS, FULL-SCREEN PALETTE, SAFE AREAS ===== */
.palette__cancel { display: none; margin-right: -8px; }
/* Safe-area helpers (pages need <meta name="viewport" content="…, viewport-fit=cover">) */
.safe-top { padding-top: var(--safe-top); }
.safe-bottom { padding-bottom: var(--safe-bottom); }
.safe-x { padding-left: var(--safe-left); padding-right: var(--safe-right); }
.safe-area { padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left); }
.dock-bottom { position: fixed; z-index: 40; left: max(var(--inset), var(--safe-left)); right: max(var(--inset), var(--safe-right)); bottom: calc(var(--inset) + max(var(--safe-bottom), var(--kb))); }
.toolbar--floating { top: calc(var(--inset) + var(--safe-top)); left: calc(var(--inset) + var(--safe-left)); right: calc(var(--inset) + var(--safe-right)); }
.sidebar:not(.sidebar--static) { top: calc(var(--inset) + var(--safe-top)); bottom: calc(var(--inset) + var(--safe-bottom)); left: calc(var(--inset) + var(--safe-left)); }
.toast-region { bottom: calc(var(--inset) * 2 + var(--safe-bottom)); }

/* Hide on scroll down, return on scroll up (Avengers.autoHide) */
.autohide { transition: transform var(--av-dur-smooth) var(--av-smooth), opacity var(--av-dur-snappy) var(--ease-out); }
.autohide--bottom.is-scroll-hidden { transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none; }
.autohide--top.is-scroll-hidden { transform: translateY(calc(-100% - 24px)); opacity: 0; pointer-events: none; }

/* Floating glass tab bar for phones:
   <nav class="tabbar" aria-label="Main"><div class="tabbar__group glass">
     <a class="tabbar__item" href="#" aria-current="page"><i data-icon="house"></i><span>Home</span></a> …
   </div><button class="tabbar__search glass" aria-label="Search"><i data-icon="search"></i></button></nav> */
.tabbar {
  position: fixed;
  z-index: 45;
  left: 50%;
  bottom: calc(max(var(--safe-bottom), 8px) + 6px);
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  pointer-events: none;
}
.tabbar > * { pointer-events: auto; }
.tabbar__group { display: flex; align-items: stretch; height: 62px; padding: 4px; border-radius: var(--r-capsule); }
.tabbar__item {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-width: 72px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-capsule);
  background: transparent;
  color: var(--label-2);
  font-family: var(--font-text);
  font-size: 12px;
  line-height: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out), transform var(--av-dur-snappy) var(--av-snappy);
}
.tabbar__item:hover { text-decoration: none; color: var(--label-1); }
.tabbar__item:active { transform: scale(.94); }
.tabbar__item .icon { --icon-size: 24px; }
.tabbar__item[aria-current="page"], .tabbar__item[aria-selected="true"] { background: var(--fill-3); color: var(--accent-ink); }
.tabbar__search { display: grid; place-items: center; width: 62px; height: 62px; padding: 0; border: 0; border-radius: 50%; color: var(--label-1); cursor: pointer; }
.tabbar__search .icon { --icon-size: 24px; }

@media (max-width: 760px) {
  /* iOS text styles */
  :root {
    --fs-headline: 17px;    --lh-headline: 22px;
    --fs-body: 17px;        --lh-body: 22px;
    --fs-callout: 16px;     --lh-callout: 21px;
    --fs-subheadline: 15px; --lh-subheadline: 20px;
    --fs-footnote: 13px;    --lh-footnote: 18px;
    --fs-caption: 12px;     --lh-caption: 16px;
  }
  .excerpt { font-size: 16px; line-height: 22px; }
  .tabbar__item { font-size: 13px; line-height: 15px; }   /* nothing on a phone is set smaller than 13px */

  /* Toasts become top banners; swipe up or sideways to dismiss
     (html body … outranks page-level placement of the region) */
  html body .toast-region {
    top: calc(var(--safe-top) + 8px);
    bottom: auto;
    left: max(8px, var(--safe-left));
    right: max(8px, var(--safe-right));
    translate: none;
    width: auto;
    max-width: none;
    flex-direction: column-reverse;
  }
  .toast {
    width: 100%;
    max-width: none;
    min-height: 54px;
    border-radius: 26px;
    touch-action: none;
    animation-name: av-banner-in;
    translate: var(--drag-x, 0px) var(--drag-y, 0px);
    transition: translate var(--av-dur-snappy) var(--av-smooth), opacity 200ms var(--ease-out);
  }
  .toast.is-dragging { transition: none; }
  .toast-region > .toast { animation-name: av-banner-in; }
  .toast-region > .toast.is-leaving { animation-name: av-banner-out; }
  .toast.is-swiped { translate: var(--swipe-x, 0px) var(--swipe-y, -140%); opacity: 0; transition: translate 240ms var(--av-exit), opacity 240ms var(--av-exit); }
  .toast--multiline { border-radius: 22px; }

  /* The command palette becomes a full-screen search, field at the top, no key hints */
  .palette-dialog[open] { padding: 0; align-items: stretch; }
  .palette {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    padding: calc(var(--safe-top) + 8px) max(10px, var(--safe-right)) calc(var(--safe-bottom) + 8px) max(10px, var(--safe-left));
    transform: translateY(18px);
  }
  .palette__search { height: 48px; padding: 0 6px 0 14px; border-radius: var(--r-capsule); background: var(--fill-3); }
  .palette__search > .icon { --icon-size: 19px; }
  .palette__search > .kbd, .palette__hint, .palette__footer { display: none; }
  .palette__cancel { display: inline-flex; }
  .palette__input { font-family: var(--font-text); font-size: 17px; }
  .palette__list { margin-top: 8px; border-top: 0; }
  .palette__item { border-radius: 14px; }

  .coach__title { font-size: 20px; }

  /* Default file rows fold: name, what I read, status, privacy; the Use switch on the right */
  .file-table__head { display: none; }
  .file-row { grid-template-columns: 32px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 6px; align-items: center; padding-block: 10px; }
  .file-row > :nth-child(1) { grid-column: 1; grid-row: 1 / span 4; align-self: start; }
  .file-row > .file-row__main { grid-column: 2; grid-row: 1; }
  .file-row > :nth-child(7) { grid-column: 3; grid-row: 1; }
  .file-row > .file-row__read { grid-column: 2 / -1; grid-row: 2; }
  .file-row > :nth-child(4) { grid-column: 2; grid-row: 3; justify-self: start; }
  .file-row > :nth-child(5) { grid-column: 2; grid-row: 4; justify-self: start; }
  .file-row > :nth-child(6) { grid-column: 3; grid-row: 3 / span 2; }
}
@keyframes av-banner-in { from { opacity: 0; transform: translateY(-28px) scale(.96); } }
@keyframes av-banner-out { to { opacity: 0; transform: translateY(-18px) scale(.97); } }


/* 29  DARK, CONTRAST, TRANSPARENCY, HIDDEN TAB ============================ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --focus-halo: #1C1C1E;
    --grade-confirmed-ink: #5BE08A;
    --grade-one-source-ink: #FFB547;
    --grade-not-checked-ink: #C6C6CC;
    --grade-disagree-ink: #FF7D75;
    --coach-scrim: rgba(0, 0, 0, .52);
  }
}
:root[data-theme="dark"] {
  --focus-halo: #1C1C1E;
  --grade-confirmed-ink: #5BE08A;
  --grade-one-source-ink: #FFB547;
  --grade-not-checked-ink: #C6C6CC;
  --grade-disagree-ink: #FF7D75;
  --coach-scrim: rgba(0, 0, 0, .52);
}
@media (prefers-contrast: more) {
  :root { --focus-width: 3px; }
  .private-pill[aria-pressed="false"], .options-pill, .privacy-capsule, .grade--button { box-shadow: inset 0 0 0 1px var(--label-2); }
  .private-pill[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--label-1); }
  .coach__fill { fill: rgba(0, 0, 0, .55); }
}
:root[data-increase-contrast] { --focus-width: 3px; }
:root[data-increase-contrast] :is(.private-pill[aria-pressed="false"], .options-pill, .privacy-capsule, .grade--button) { box-shadow: inset 0 0 0 1px var(--label-2); }
:root[data-increase-contrast] .private-pill[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--label-1); }
@media (prefers-reduced-transparency: reduce) {
  .coach__hole { filter: none; }
  .privacy-capsule { background: color-mix(in srgb, var(--green) 14%, var(--material-bg-thick)); }
}
/* Reduced motion: bottom sheets still follow the finger (direct manipulation, not
   animation) and appear with a short cross-fade instead of a slide */
@media (prefers-reduced-motion: reduce) {
  .sheet-dialog.is-bottom > .sheet { opacity: 0; }
  .sheet-dialog.is-bottom.is-open > .sheet { opacity: 1; transform: translate3d(0, var(--sheet-y, 0px), 0) !important; }
}
:root[data-reduce-motion] .sheet-dialog.is-bottom > .sheet { opacity: 0; }
:root[data-reduce-motion] .sheet-dialog.is-bottom.is-open > .sheet { opacity: 1; transform: translate3d(0, var(--sheet-y, 0px), 0) !important; }
/* Loops pause while the tab is hidden (avengers.js sets data-page-hidden) */
:root[data-page-hidden] :is(.spinner, .progress--indeterminate .progress__bar, .is-being-read .file-chip__name, .is-being-read .file-row__name),
:root[data-page-hidden] .file-chip__progress::after,
:root[data-page-hidden] .status[data-tone="progress"]::before,
:root[data-page-hidden] .timeline__node::before,
:root[data-page-hidden] .timeline__node::after { animation-play-state: paused !important; }


/* 30  CANONICAL PATTERNS: VERDICT CARD, QUESTION BUBBLE, WELCOME STRIP ===== */
/* One verdict card for every concept (title 28, trust bar, reasons that light up
   when a grade chip is tapped). Pages that still style their own .verdict are not
   affected: these patterns use their own class names.
   <article class="material verdict-card" data-grade-scope>
     <div class="verdict-card__eyebrow" data-reveal="eyebrow">…</div>
     <h2 class="verdict-card__title" data-reveal="title">Buy and integrate, don’t build.</h2>
     <p class="verdict-card__body" data-reveal="body">… <button class="cite">…</button></p>
     ${Avengers.trustBar(…)}
     <ol class="verdict-card__reasons" role="list" data-reveal="body">
       <li class="verdict-card__reason" data-grade-item="confirmed">${Avengers.grade('confirmed')}<div>…</div></li>
     </ol>
     <div class="verdict-card__sources" data-reveal="sources">…</div>
     <div class="verdict-card__actions" data-reveal="actions">…</div>
   </article> */
.verdict-card { position: relative; display: grid; gap: 14px; padding: 22px 24px 20px; }
.verdict-card__eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--label-2); }
.verdict-card__eyebrow .icon { --icon-size: 16px; color: var(--accent-ink); }
.verdict-card__eyebrow > [aria-hidden="true"] { color: var(--label-3); font-weight: 400; }
/* Phones: the line wraps, so each middle dot travels with the words after it and is clipped away when
   those words start a new line (the same treatment as .tile__sub--parts): no dot is left hanging. */
@media (max-width: 759px) {
  .verdict-card__eyebrow { --dot-w: 1.5em; margin-left: calc(8px - var(--dot-w)); clip-path: inset(-14px -14px -14px calc(var(--dot-w) - 8.5px)); }
  .verdict-card__eyebrow > :first-child { margin-left: calc(var(--dot-w) - 8px); }
  .verdict-card__eyebrow > span[aria-hidden="true"] { display: none; }
  .verdict-card__eyebrow > span[aria-hidden="true"] + span { position: relative; margin-left: -8px; padding-left: var(--dot-w); }
  .verdict-card__eyebrow > span[aria-hidden="true"] + span::before { content: "\00B7"; position: absolute; left: 0; width: var(--dot-w); text-align: center; color: var(--label-3); font-weight: 400; }
}
.verdict-card__title { margin-top: -4px; font-family: var(--font-display); font-size: var(--fs-title-1); line-height: var(--lh-title-1); font-weight: var(--fw-display); letter-spacing: var(--ls-display); text-wrap: balance; }
.verdict-card__body { font-size: var(--fs-body); line-height: calc(var(--lh-body) + 1px); color: var(--label-1); text-wrap: pretty; }
.verdict-card__body .cite { vertical-align: 1px; }
.verdict-card__section-title { margin-bottom: 6px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--label-2); }
.verdict-card__reasons { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.verdict-card__reason { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 10px 12px; margin: 0 -12px; border-radius: var(--r-small); }
.verdict-card__reason > .grade { justify-self: start; }
.verdict-card__reason b { display: block; font-size: var(--fs-callout); line-height: var(--lh-callout); font-weight: 600; }
.verdict-card__reason p { margin: 0; font-size: var(--fs-callout); line-height: var(--lh-callout); color: var(--label-2); }
.verdict-card__reason + .verdict-card__reason::before { content: ""; position: absolute; top: -1px; left: 12px; right: 12px; height: .5px; background: var(--separator); }
.verdict-card__reason.is-grade-match::before, .verdict-card__reason.is-grade-match + .verdict-card__reason::before { opacity: 0; }
/* The Sources line wraps on phones and in narrow cards. Each part starts where the line starts on any row, and the
   middle dot travels with the words after it: it is clipped away when those words begin a new row, so no dot is
   left hanging at the end of a row (the same treatment as the card's top line). The hairline is drawn by ::after so
   it stays level with the text. Markup: <b>Sources</b><span>…</span><span aria-hidden="true">·</span><span>…</span> */
.verdict-card__sources { --dot-w: 18px; position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: calc(6px - var(--dot-w)); padding-top: 12px; clip-path: inset(-20px -20px -20px calc(var(--dot-w) - 12.5px)); font-size: 13px; line-height: 18px; color: var(--label-2); }
.verdict-card__sources::after { content: ""; position: absolute; top: 0; left: calc(var(--dot-w) - 6px); right: 0; border-top: .5px solid var(--separator); }
.verdict-card__sources > * { margin-left: calc(var(--dot-w) - 6px); }
.verdict-card__sources > b { color: var(--label-1); font-weight: 600; }
.verdict-card__sources > span[aria-hidden="true"] { display: none; }
.verdict-card__sources > span[aria-hidden="true"] + * { position: relative; margin-left: -6px; padding-left: var(--dot-w); }
.verdict-card__sources > span[aria-hidden="true"] + *::before { content: "\00B7"; position: absolute; left: 0; top: 0; width: var(--dot-w); text-align: center; color: var(--label-3); font-weight: 400; }
.verdict-card__actions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (pointer: coarse) { .verdict-card__actions { gap: 8px; } }   /* two rows of 36px buttons keep a full 44px each */
@media (min-width: 761px) {
  .verdict-card__reason { grid-template-columns: 148px minmax(0, 1fr); column-gap: 14px; align-items: start; }
  .verdict-card__reason > .grade { margin-top: 1px; }
}
@media (max-width: 760px) { .verdict-card { padding: 18px 18px 16px; } }

/* The question, as the person asked it (the composer text morphs into this) */
.q-bubble {
  justify-self: end;
  width: fit-content;
  max-width: min(560px, 88%);
  margin-left: auto;
  padding: 11px 16px;
  border-radius: 20px 20px 6px 20px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 18px -8px color-mix(in srgb, var(--accent-fill) 60%, transparent);
  overflow-wrap: anywhere;
}

/* Welcome (first visit; "Show the welcome" in the palette brings it back).
   Three glass capsules light up in turn: add .is-playing to .welcome-beats to play
   (350ms spring, 120ms apart); remove and re-add it to replay.
   <ol class="welcome-beats" role="list" aria-label="How it works">
     <li class="welcome-beats__beat glass" style="--i:0"><span class="welcome-beats__icon"><i data-icon="chat"></i></span>Ask</li>
     <li class="welcome-beats__link" style="--i:0" aria-hidden="true"></li>
     <li class="welcome-beats__beat glass" style="--i:1">…Add files</li> … </ol> */
.welcome { display: grid; justify-items: start; gap: 22px; }
.welcome__title { max-width: 18ch; font-family: var(--font-display); font-size: clamp(34px, 4.6vw, 56px); line-height: 1.06; font-weight: var(--fw-display); letter-spacing: var(--ls-display-big); text-wrap: balance; }
.welcome__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.welcome__trust { display: flex; align-items: center; gap: 8px; max-width: 60ch; font-size: max(13px, var(--fs-subheadline)); line-height: var(--lh-subheadline); color: var(--label-2); }
.welcome__trust .icon { --icon-size: 16px; flex: none; color: var(--green-ink); }
.welcome-beats { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 0; margin: 0; padding: 0; list-style: none; }
.welcome-beats__beat {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 20px 0 8px;
  border-radius: var(--r-capsule);
  font-size: var(--fs-headline);
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
}
.welcome-beats__icon { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--accent-ink); background: var(--fill-3); isolation: isolate; }
.welcome-beats__icon .icon { --icon-size: 19px; }
/* The light: an accent ring and glow that switches on (opacity and scale only) */
.welcome-beats__icon::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 16px 1px color-mix(in srgb, var(--accent) 45%, transparent);
  opacity: 0; transform: scale(.6);
}
.welcome-beats__link { width: 28px; height: 2px; margin: 0 6px; border-radius: 1px; background: var(--label-4); transform-origin: left center; }
.welcome-beats.is-lit .welcome-beats__icon::before { opacity: 1; transform: none; }
.welcome-beats.is-playing .welcome-beats__beat { animation: av-beat-in 350ms var(--av-bouncy) calc(var(--i, 0) * 120ms) both; }
.welcome-beats.is-playing .welcome-beats__icon::before { animation: av-beat-light 350ms var(--av-bouncy) calc(var(--i, 0) * 120ms + 300ms) both; }
.welcome-beats.is-playing .welcome-beats__link { animation: av-beat-link 300ms var(--av-smooth) calc(var(--i, 0) * 120ms + 180ms) both; }
@keyframes av-beat-in { from { opacity: 0; transform: translateY(10px) scale(.92); } }
@keyframes av-beat-light { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes av-beat-link { from { transform: scaleX(0); } }
@media (max-width: 760px) {
  .welcome-beats { flex-direction: column; align-items: flex-start; }
  .welcome-beats__link { width: 2px; height: 14px; margin: 0 0 0 33px; transform-origin: center top; }
  .welcome-beats.is-playing .welcome-beats__link { animation-name: av-beat-link-v; }
  .welcome__actions .btn { flex: 1 1 auto; }
}
@keyframes av-beat-link-v { from { transform: scaleY(0); } }
@media (prefers-reduced-motion: reduce) {
  .welcome-beats.is-playing :is(.welcome-beats__beat, .welcome-beats__link) { animation: av-fade 180ms var(--ease-out) calc(var(--i, 0) * 120ms) both !important; }
  .welcome-beats.is-playing .welcome-beats__icon::before { animation: av-fade 180ms var(--ease-out) calc(var(--i, 0) * 120ms + 120ms) both !important; }
}
:root[data-reduce-motion] .welcome-beats.is-playing :is(.welcome-beats__beat, .welcome-beats__link) { animation: av-fade 180ms var(--ease-out) calc(var(--i, 0) * 120ms) both !important; }
:root[data-reduce-motion] .welcome-beats.is-playing .welcome-beats__icon::before { animation: av-fade 180ms var(--ease-out) calc(var(--i, 0) * 120ms + 120ms) both !important; }
@keyframes av-fade { from { opacity: 0; } }


/* =========================================================================
   v4 · The landing screen ("Today" and the first-time landing)
   -------------------------------------------------------------------------
   One screen in two forms: a summary of what came back (returning people) and
   the same screen explaining itself (first visit). Source of truth:
   ../../landing-pearl.md. The pieces below are reusable and page-independent;
   01-conversation.html places them (immersive layout, scrims, the menu).
   Glass: tiles, the dock and the ask sheet. Everything inside them (paper
   cards, rows, dials, round buttons) is a plain surface, never nested glass.
   ========================================================================= */

/* 31  LANDING ============================================================= */
:root {
  --soft-ink: color-mix(in srgb, var(--label-1) 62%, transparent);   /* the lighter second line of a large title (3:1 or better, large text only) */
  --tile-radius: 28px;
  --tile-shadow: 0 0 0 .5px rgba(26, 34, 56, .05), 0 1px 1px rgba(26, 34, 56, .03), 0 14px 30px -20px rgba(26, 34, 56, .34);
  --paper-bg: linear-gradient(180deg, #FFFFFF 0%, #F5F7FB 100%);
  --paper-ink: #1A2238;
  --paper-ink-2: rgba(26, 34, 56, .74);
  --paper-shadow: 0 0 0 .5px rgba(26, 34, 56, .05), 0 1px 1px rgba(26, 34, 56, .05), 0 10px 18px -10px rgba(26, 34, 56, .36);
  --pocket-lip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23DDE4F1' stop-opacity='.97'/%3E%3Cstop offset='1' stop-color='%23EEF1F8' stop-opacity='.9'/%3E%3C/linearGradient%3E%3Cpath d='M0 3C13 3 13 12 26 12H74C87 12 87 3 100 3' fill='none' stroke='%231A2238' stroke-opacity='.07' stroke-width='5' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M0 4C13 4 13 13 26 13H74C87 13 87 4 100 4V40H0Z' fill='url(%23g)'/%3E%3Cpath d='M0 4C13 4 13 13 26 13H74C87 13 87 4 100 4' fill='none' stroke='%23fff' stroke-width='1.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  --round-bg: rgba(255, 255, 255, .84);
  --round-bg-hover: #FFFFFF;
  --round-shadow: inset 0 1px 0 #FFFFFF, 0 0 0 .5px rgba(26, 34, 56, .06), 0 1px 2px rgba(26, 34, 56, .06), 0 8px 16px -10px rgba(26, 34, 56, .32);
  --row-bg: rgba(255, 255, 255, .42);
  --row-bg-hover: rgba(255, 255, 255, .62);
  --row-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 .5px rgba(255, 255, 255, .6), 0 1px 2px rgba(26, 34, 56, .05);
  --dial-track: rgba(26, 34, 56, .13);
  --dial-face: rgba(255, 255, 255, .62);
  --dial-shadow: inset 0 1px 0 #FFFFFF, inset 0 0 0 .5px rgba(255, 255, 255, .7), 0 6px 12px -8px rgba(26, 34, 56, .3);
  --tag-bg: #262F4A;
  --tag-ink: #FFFFFF;
  --ask-bg: rgba(248, 250, 255, .6);
  --ask-shadow: 0 0 0 .5px rgba(26, 34, 56, .06), 0 2px 4px rgba(26, 34, 56, .04), 0 22px 44px -26px rgba(26, 34, 56, .42);
  --ask-veil: color-mix(in srgb, var(--wallpaper-base) 56%, transparent);
  /* Faint glints inside the tiles (peach, lavender, steel blue), always low alpha */
  --glint-peach: rgba(243, 221, 210, .46);
  --glint-lavender: rgba(206, 201, 236, .5);
  --glint-steel: rgba(176, 194, 232, .5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --soft-ink: color-mix(in srgb, var(--label-1) 64%, transparent);
    --tile-shadow: 0 0 0 .5px rgba(0, 0, 0, .45), 0 1px 2px rgba(0, 0, 0, .2), 0 16px 30px -18px rgba(0, 0, 0, .7);
    --paper-bg: linear-gradient(180deg, #4A5574 0%, #3D4763 100%);
    --paper-ink: rgba(255, 255, 255, .96);
    --paper-ink-2: rgba(255, 255, 255, .76);
    --paper-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 0 0 .5px rgba(255, 255, 255, .1), 0 10px 18px -10px rgba(0, 0, 0, .7);
    --pocket-lip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23262D42' stop-opacity='.97'/%3E%3Cstop offset='1' stop-color='%231F2535' stop-opacity='.92'/%3E%3C/linearGradient%3E%3Cpath d='M0 3C13 3 13 12 26 12H74C87 12 87 3 100 3' fill='none' stroke='%23000' stroke-opacity='.22' stroke-width='5' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M0 4C13 4 13 13 26 13H74C87 13 87 4 100 4V40H0Z' fill='url(%23g)'/%3E%3Cpath d='M0 4C13 4 13 13 26 13H74C87 13 87 4 100 4' fill='none' stroke='%23fff' stroke-opacity='.32' stroke-width='1.2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --round-bg: rgba(255, 255, 255, .12);
    --round-bg-hover: rgba(255, 255, 255, .2);
    --round-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), inset 0 0 0 .5px rgba(255, 255, 255, .1), 0 8px 16px -10px rgba(0, 0, 0, .7);
    --row-bg: rgba(255, 255, 255, .07);
    --row-bg-hover: rgba(255, 255, 255, .12);
    --row-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 0 0 .5px rgba(255, 255, 255, .07);
    --dial-track: rgba(255, 255, 255, .16);
    --dial-face: rgba(255, 255, 255, .08);
    --dial-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 0 0 .5px rgba(255, 255, 255, .08), 0 6px 12px -8px rgba(0, 0, 0, .7);
    --tag-bg: rgba(255, 255, 255, .92);
    --tag-ink: #1A2238;
    --ask-bg: rgba(30, 36, 54, .66);
    --ask-shadow: 0 0 0 .5px rgba(0, 0, 0, .5), 0 2px 4px rgba(0, 0, 0, .2), 0 22px 44px -26px rgba(0, 0, 0, .8);
    --ask-veil: color-mix(in srgb, var(--wallpaper-base) 58%, transparent);
    --glint-peach: rgba(243, 221, 210, .1);
    --glint-lavender: rgba(206, 201, 236, .12);
    --glint-steel: rgba(126, 146, 186, .16);
  }
}
:root[data-theme="dark"] {
  --soft-ink: color-mix(in srgb, var(--label-1) 64%, transparent);
  --tile-shadow: 0 0 0 .5px rgba(0, 0, 0, .45), 0 1px 2px rgba(0, 0, 0, .2), 0 16px 30px -18px rgba(0, 0, 0, .7);
  --paper-bg: linear-gradient(180deg, #4A5574 0%, #3D4763 100%);
  --paper-ink: rgba(255, 255, 255, .96);
  --paper-ink-2: rgba(255, 255, 255, .76);
  --paper-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 0 0 .5px rgba(255, 255, 255, .1), 0 10px 18px -10px rgba(0, 0, 0, .7);
  --pocket-lip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23262D42' stop-opacity='.97'/%3E%3Cstop offset='1' stop-color='%231F2535' stop-opacity='.92'/%3E%3C/linearGradient%3E%3Cpath d='M0 3C13 3 13 12 26 12H74C87 12 87 3 100 3' fill='none' stroke='%23000' stroke-opacity='.22' stroke-width='5' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M0 4C13 4 13 13 26 13H74C87 13 87 4 100 4V40H0Z' fill='url(%23g)'/%3E%3Cpath d='M0 4C13 4 13 13 26 13H74C87 13 87 4 100 4' fill='none' stroke='%23fff' stroke-opacity='.32' stroke-width='1.2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  --round-bg: rgba(255, 255, 255, .12);
  --round-bg-hover: rgba(255, 255, 255, .2);
  --round-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), inset 0 0 0 .5px rgba(255, 255, 255, .1), 0 8px 16px -10px rgba(0, 0, 0, .7);
  --row-bg: rgba(255, 255, 255, .07);
  --row-bg-hover: rgba(255, 255, 255, .12);
  --row-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 0 0 .5px rgba(255, 255, 255, .07);
  --dial-track: rgba(255, 255, 255, .16);
  --dial-face: rgba(255, 255, 255, .08);
  --dial-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 0 0 .5px rgba(255, 255, 255, .08), 0 6px 12px -8px rgba(0, 0, 0, .7);
  --tag-bg: rgba(255, 255, 255, .92);
  --tag-ink: #1A2238;
  --ask-bg: rgba(30, 36, 54, .66);
  --ask-shadow: 0 0 0 .5px rgba(0, 0, 0, .5), 0 2px 4px rgba(0, 0, 0, .2), 0 22px 44px -26px rgba(0, 0, 0, .8);
  --ask-veil: color-mix(in srgb, var(--wallpaper-base) 58%, transparent);
  --glint-peach: rgba(243, 221, 210, .1);
  --glint-lavender: rgba(206, 201, 236, .12);
  --glint-steel: rgba(126, 146, 186, .16);
}

/* ---- Hello header: "Hello, (avatar) Abdul" and a lighter second line ---- */
.hello { margin: 0; font-family: var(--font-display); font-size: 40px; line-height: 46px; font-weight: var(--fw-display); letter-spacing: var(--ls-display-big); color: var(--label-1); }
.hello__line { display: block; }
.hello__line:has(.avatar) { display: flex; flex-wrap: wrap; align-items: center; column-gap: .22em; }
.hello .avatar { --size: 40px; letter-spacing: 0; }
.hello__soft { font-weight: 400; letter-spacing: -.022em; color: var(--soft-ink); }
.hello__lede { margin: 2px 0 0; max-width: 34ch; font-family: var(--font-display); font-size: 24px; line-height: 30px; font-weight: 400; letter-spacing: var(--ls-display); color: var(--label-2); text-wrap: balance; }

/* ---- Summary tiles: <button class="tile glass"> (or <li> when it only explains) ---- */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.tile {
  --_filter: var(--glass-filter-strong);
  --_shadow: var(--tile-shadow);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  min-height: var(--tile-h, 216px);
  margin: 0;
  padding: 18px 18px 0;
  border: 0;
  border-radius: var(--tile-radius);
  overflow: hidden;
  color: var(--label-1);
  font-family: var(--font-text);
  text-align: left;
}
/* Each tile carries one faint glint, so the six never look stamped from one mould */
.tile { background-image: var(--glass-sheen), var(--tile-glint, none); }
.tiles > .tile:nth-child(3n + 1) { --tile-glint: radial-gradient(90% 75% at 104% 104%, var(--glint-peach) 0%, transparent 70%); }
.tiles > .tile:nth-child(3n + 2) { --tile-glint: radial-gradient(80% 80% at -6% 62%, var(--glint-lavender) 0%, transparent 70%); }
.tiles > .tile:nth-child(3n) { --tile-glint: radial-gradient(90% 85% at 102% -8%, var(--glint-steel) 0%, transparent 70%); }
button.tile { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform var(--av-dur-snappy) var(--av-snappy); }
button.tile:hover { --_bg: var(--glass-bg-hover); }
button.tile:active { --press: 1; transform: scale(.975); transition-duration: var(--dur-press, 100ms); }
.tile__title { display: block; padding-right: 36px; font-family: var(--font-display); font-size: 16px; line-height: 21px; font-weight: var(--fw-display); letter-spacing: var(--ls-display); text-wrap: balance; }
.tile__head { display: block; padding-bottom: 12px; }
.tile__sub { display: block; margin-top: 2px; font-size: 13px; line-height: 18px; font-weight: 400; letter-spacing: -.004em; color: var(--label-2); }
.tile__sub--parts { display: flex; flex-wrap: wrap; margin-left: -.85em; clip-path: inset(0 0 0 calc(.85em - 1px)); }   /* parts with a middle dot between them; the clip hides a dot that would start a wrapped line */
.tile__sub--parts > span { position: relative; min-width: 0; padding-left: .85em; }
.tile__sub--parts > span::before { content: "\00B7"; position: absolute; left: 0; width: .85em; text-align: center; }
.tile__badge { position: absolute; z-index: 1; top: 14px; right: 14px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--round-bg); box-shadow: var(--round-shadow); color: var(--label-1); }
.tile__badge .icon { --icon-size: 15px; --icon-stroke: 1.8; }
.tile__badge .avatar { --size: 28px; font-size: 12px; }
.tile__body { display: block; margin-top: auto; padding: 0 0 18px; }
.tile--wide { grid-column: span 2; }

/* A paper card peeking out of a pocket at the bottom of a tile.
   The card is in the flow, so a longer line makes the pocket (and its row of tiles) taller
   instead of slipping behind the lip: --pocket-h is the least it stands, room for two lines. */
.pocket { --lip-h: 40px; position: relative; display: flex; flex: none; min-height: var(--pocket-h, 104px); margin: auto -18px 0; padding: 0 18px; }
.pocket::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--lip-h); background: var(--pocket-lip) center / 100% 100% no-repeat; pointer-events: none; }
.paper {
  position: relative;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: -16px;
  padding: 11px 14px calc(var(--lip-h) + 14px);      /* the words end just above the lip's highest point */
  border-radius: 16px;
  background: var(--paper-bg);
  box-shadow: var(--paper-shadow);
  color: var(--paper-ink);
  transition: transform var(--av-dur-snappy) var(--av-snappy);
}
.paper__note { display: flex; align-items: center; gap: 6px; min-height: 16px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--paper-ink-2); }
.paper__dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--gray); }
.paper__dot[data-tone="green"] { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }
.paper__dot[data-tone="amber"] { background: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 20%, transparent); }
.paper__dot[data-tone="busy"] { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.paper__text { display: block; margin-top: 3px; font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: -.006em; overflow-wrap: break-word; }
.paper__text--plain { font-weight: 400; color: var(--paper-ink-2); }
.paper__bar { display: flex; gap: 3px; height: 4px; margin-top: 8px; }
.paper__bar i { flex: var(--w, 1) 1 0; border-radius: 2px; background: var(--c, var(--gray)); }
button.tile:hover .paper, .tile.is-raised .paper { transform: translateY(-4px); }
button.tile:active .paper { transform: translateY(-1px); }

/* Two dials (a ring with a number, a caption under it) */
.dials { display: flex; align-items: flex-start; gap: 14px; }
.dial { display: grid; justify-items: center; gap: 6px; min-width: 64px; }
.dial__disc { position: relative; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--dial-face); box-shadow: var(--dial-shadow); }
.dial__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; overflow: visible; }
.dial__ring circle { fill: none; stroke-width: 3.2; }
.dial__track { stroke: var(--dial-track); }
.dial__arc { stroke: var(--dial-c, var(--label-1)); stroke-linecap: round; stroke-dasharray: calc(var(--p, 0) * 100) 100; }
.dial__value { font-family: var(--font-display); font-size: 20px; line-height: 1; font-weight: var(--fw-display); letter-spacing: var(--ls-display); font-variant-numeric: tabular-nums; }
.dial__value .icon { --icon-size: 20px; display: block; }
.dial__label { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--label-2); white-space: nowrap; }
.dial--warn { --dial-c: var(--orange); }
.dial--quiet .dial__value { color: var(--label-2); }

/* A two-stop timeline (what happened, what comes next) */
.stops { position: relative; display: grid; gap: 10px; padding-left: 22px; }
.stops::before { content: ""; position: absolute; left: 4.5px; top: 15px; bottom: 28px; width: 1px; background: var(--label-4); }
.stop { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: start; }
.stop::before { content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--label-2); }
.stop--next::before { background: var(--label-1); box-shadow: none; }
.stop__main { grid-column: 1; font-family: var(--font-display); font-size: 17px; line-height: 21px; font-weight: var(--fw-display); letter-spacing: var(--ls-display); font-variant-numeric: tabular-nums; }
.stop__sub { grid-column: 1; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--label-2); }
.stop__tag { grid-column: 2; grid-row: 1 / span 2; align-self: start; margin-top: 1px; padding: 2px 7px; border-radius: 7px; background: var(--fill-2); color: var(--label-2); font-size: 12px; line-height: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- Round buttons: the + and the microphone ---- */
.round-btn, .composer.ask .composer__add, .composer.ask .ask__mic {
  --ib: var(--ask-btn, 48px);
  display: inline-grid;
  place-items: center;
  width: var(--ib);
  height: var(--ib);
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--round-bg);
  box-shadow: var(--round-shadow);
  color: var(--label-1);
  cursor: pointer;
  transition: transform var(--av-dur-snappy) var(--av-snappy), background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
:is(.round-btn, .composer.ask .composer__add, .composer.ask .ask__mic) .icon { --icon-size: 22px; --icon-stroke: 1.8; }
:is(.round-btn, .composer.ask .composer__add, .composer.ask .ask__mic):hover { background: var(--round-bg-hover); color: var(--label-1); }
:is(.round-btn, .composer.ask .composer__add, .composer.ask .ask__mic):active { background: var(--round-bg-hover); filter: brightness(.95); transition-duration: var(--dur-press, 100ms); }
:is(.round-btn, .composer.ask .composer__add, .composer.ask .ask__mic):focus-visible { box-shadow: 0 0 0 2px var(--focus-halo), var(--round-shadow); }
/* Listening: the one dark control */
:is(.round-btn, .composer.ask .ask__mic)[aria-pressed="true"] { background: var(--tag-bg); color: var(--tag-ink); }
.composer:not(.ask) .ask__mic { display: none; }

/* ---- Suggestion rows: a round icon, a label, a chevron ---- */
.ask-rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ask-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center;
  column-gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 16px 10px 10px;
  border: 0;
  border-radius: 28px;
  background: var(--row-bg);
  box-shadow: var(--row-shadow);
  color: var(--label-1);
  font-family: var(--font-text);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-1) var(--ease-out), transform var(--av-dur-snappy) var(--av-snappy);
}
.ask-row:hover { background: var(--row-bg-hover); }
.ask-row:active { transform: scale(.985); transition-duration: var(--dur-press, 100ms); }
.ask-row:focus-visible { box-shadow: 0 0 0 2px var(--focus-halo), var(--row-shadow); }
.ask-row__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--round-bg); box-shadow: var(--round-shadow); color: var(--label-1); }
.ask-row__icon .icon { --icon-size: 18px; --icon-stroke: 1.8; }
.ask-row__label { display: block; font-size: 16px; line-height: 21px; font-weight: 600; letter-spacing: -.014em; text-wrap: balance; }
.ask-row__desc { display: block; margin-top: 1px; font-size: 13px; line-height: 18px; font-weight: 400; letter-spacing: 0; color: var(--label-2); text-wrap: pretty; }
.ask-row > .icon { --icon-size: 14px; --icon-stroke: 2.2; color: var(--label-3); }

/* ---- The dock and the ask sheet: one glass surface in two sizes ----
   <div class="composer ask">            the resting dock: [+] [field] [microphone]
   <div class="composer ask is-open">    the ask sheet: greeting, three rows, options, then the same row
   The bottom row never moves between the two, so the sheet can grow out of the dock.
   Parts, in this order: .ask__top (greeting and rows), the file tray, the field,
   .composer__bar with .composer__add, .composer__meta (the quiet options row),
   .btn-send and .ask__mic. .has-text or .is-busy swaps the microphone for Send. */
.composer.ask {
  --ask-btn: 48px;
  --ask-pad: 12px;
  --ask-radius: 22px;   /* the 48px send key's 12px plus the bar's padding (Ink, 15 October) */
  --_bg: var(--ask-bg);
  --_shadow: var(--ask-shadow);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "top top top" "tray tray tray" "meta meta meta" "add input end";
  align-items: end;
  gap: 0 8px;
  padding: var(--ask-pad);
  border-radius: var(--ask-radius);
}
.composer.ask .composer__bar { display: contents; }
.composer.ask .composer__bar > .spacer, .composer.ask .composer__starters { display: none; }
.composer.ask .composer__add { grid-area: add; }
.composer.ask .composer__input { grid-area: input; align-self: center; min-height: var(--ask-btn); max-height: 132px; padding: 12px 6px; font-size: 16px; line-height: 24px; letter-spacing: -.012em; }
.composer.ask .composer__input::placeholder { color: var(--label-2); }
.composer.ask .composer__input:focus-visible { box-shadow: none; }      /* the ring belongs to the dock (rest) or is redrawn on the field (open) */
.composer.ask .btn-send, .composer.ask .ask__mic { grid-area: end; }
.composer.ask .btn-send { --ib: var(--ask-btn); border-radius: 12px; }
.composer.ask .btn-send .icon { --icon-size: 22px; }
.composer.ask:not(.has-text):not(.is-busy) .btn-send { display: none; }
.composer.ask:is(.has-text, .is-busy) .ask__mic { display: none; }
.ask__top { display: none; }                       /* only the open sheet shows it; a composer that is not .ask never does */
.composer.ask .composer__meta { display: none; }
.composer.ask.is-open .ask__top { display: block; grid-area: top; margin: calc(var(--ask-pad) * -1) calc(var(--ask-pad) * -1) 0; border-radius: var(--ask-radius) var(--ask-radius) 0 0; overflow: hidden; overflow: clip; }
.composer.ask.is-open .composer__meta { grid-area: meta; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; padding: 0 16px 10px; }
.composer.ask .composer__options { position: static; display: flex; min-width: 0; opacity: 1; transform: none; pointer-events: auto; }
.composer.ask .options-pill { background: var(--row-bg); box-shadow: none; }
.composer.ask .options-pill:hover { background: var(--row-bg-hover); }
.composer.ask .options-pill[aria-expanded="true"] { background: var(--accent-soft); }
/* At rest the focus ring goes round the whole dock; open, it sits on the field, not round the sheet */
.composer.ask:has(.composer__input:focus) { --_shadow: 0 0 0 2px var(--focus-halo), 0 0 0 4px var(--focus-ring), var(--ask-shadow); }
.composer.ask.is-open:has(.composer__input:focus) { --_shadow: var(--ask-shadow); }
.composer.ask.is-open .composer__input { border-radius: calc(var(--ask-btn) / 2); padding-inline: 14px; }
.composer.ask.is-open .composer__input:focus-visible { box-shadow: 0 0 0 2px var(--focus-halo), 0 0 0 4px var(--focus-ring); }
.ask__inner { display: block; padding: 28px 28px 18px; }
.ask__grabber { display: none; width: 38px; height: 5px; margin: -14px auto 14px; border-radius: 3px; background: var(--label-4); }
.ask__title { margin: 0 0 18px; font-family: var(--font-display); font-size: 32px; line-height: 38px; font-weight: 500; letter-spacing: var(--ls-display-big); color: var(--label-1); text-wrap: balance; }
.ask__trust { display: flex; align-items: flex-start; gap: 8px; margin: 14px 4px 0; font-size: 13px; line-height: 18px; color: var(--label-2); }
.ask__trust .icon { --icon-size: 16px; flex: none; margin-top: 1px; color: var(--green-ink); }
.ask__trust[hidden] { display: none; }

/* Listening (the microphone): a small wave in place of the placeholder */
.ask__listen { grid-area: input; align-self: center; display: none; align-items: center; gap: 10px; min-width: 0; padding: 0 6px; font-size: 16px; line-height: 24px; color: var(--label-1); pointer-events: none; }
.composer.ask.is-open .ask__listen { padding-inline: 14px; }
.composer.ask.is-listening .ask__listen { display: flex; }
.composer.ask.is-listening .composer__input { opacity: 0; }
.wave { display: inline-flex; align-items: center; gap: 3px; height: 22px; flex: none; }
.wave i { display: block; width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform: scaleY(.3); }
.wave i:nth-child(2) { transform: scaleY(.7); }
.wave i:nth-child(3) { transform: scaleY(1); }
.wave i:nth-child(4) { transform: scaleY(.55); }
.wave i:nth-child(5) { transform: scaleY(.8); }

/* The veil behind the open sheet (tap it to put the sheet away) */
.ask-veil { position: fixed; inset: 0; background: var(--ask-veil); -webkit-backdrop-filter: blur(8px) saturate(120%); backdrop-filter: blur(8px) saturate(120%); opacity: 0; pointer-events: none; transition: opacity var(--dur-2) var(--ease-out); }
.ask-veil.is-on { opacity: 1; pointer-events: auto; }      /* while it fades out it lets taps through to the dock */
.ask-veil[hidden] { display: none; }

@media (max-width: 760px) {
  .hello { font-size: 28px; line-height: 34px; letter-spacing: -.022em; }
  .hello .avatar { --size: 32px; font-size: 13px; }
  .hello__lede { margin-top: 3px; max-width: none; font-size: 20px; line-height: 25px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile { min-height: var(--tile-h, 170px); padding: 14px 14px 0; }
  .tile__title { padding-right: 30px; font-size: 15px; line-height: 20px; }
  .tile__badge { top: 12px; right: 12px; width: 26px; height: 26px; }
  .tile__badge .avatar { --size: 26px; font-size: 13px; }
  .tile__head { padding-bottom: 8px; }
  .tile__body { padding: 0 0 12px; }
  .pocket { --pocket-h: 94px; --lip-h: 30px; margin: auto -14px 0; padding: 0 12px; }
  .paper { padding: 9px 11px calc(var(--lip-h) + 15px); border-radius: 14px; }
  .paper__note, .dial__label, .stop__sub, .stop__tag { font-size: 13px; }
  .paper__note { line-height: 17px; }
  .paper__text { margin-top: 2px; line-height: 17px; }
  /* A tile that runs the full width on phones: words on the left, its pocket on the right */
  .tile--split-sm { grid-column: 1 / -1; flex-direction: row; align-items: stretch; gap: 10px; min-height: var(--tile-h-split, 98px); }
  .tile--split-sm .tile__head { flex: 1 1 0; min-width: 0; padding-bottom: 14px; }
  .tile--split-sm .tile__title { padding-right: 0; }
  .tile--split-sm .tile__badge { display: none; }
  .tile--split-sm .pocket { flex: 0 0 50%; min-height: 0; margin: 0 -14px 0 0; padding-left: 0; }
  .dials { gap: 10px; }
  .dial__disc { width: 52px; height: 52px; }
  .dial__value { font-size: 18px; }
  .dial__label { line-height: 17px; }
  .stops { gap: 8px; }
  .composer.ask { --ask-btn: 44px; --ask-pad: 10px; --ask-radius: 32px; gap: 0 6px; }
  .composer.ask .composer__input { font-size: 17px; padding: 10px 4px; }
  .composer.ask.is-open .composer__input { padding-inline: 12px; }
  .composer.ask.is-open .composer__meta { padding-inline: 8px; }
  .ask__inner { padding: 22px 18px 12px; }
  .ask__grabber { display: block; }
  .ask__title { margin-bottom: 14px; font-size: 28px; line-height: 33px; }
  .ask-rows { gap: 6px; }
  .ask-row { padding-right: 14px; }
  .ask__trust { margin-top: 12px; }
  .ask__listen { font-size: 17px; }
}
@media (pointer: coarse) {
  .ask__grabber { display: block; }
}
@media (prefers-reduced-transparency: reduce) {
  .ask-veil { -webkit-backdrop-filter: none; backdrop-filter: none; background: color-mix(in srgb, var(--wallpaper-base) 84%, transparent); }
}
:root[data-reduce-transparency] .ask-veil { -webkit-backdrop-filter: none; backdrop-filter: none; background: color-mix(in srgb, var(--wallpaper-base) 84%, transparent); }
@media (prefers-contrast: more) {
  .ask-row, .paper, .tile__badge { box-shadow: inset 0 0 0 1px var(--separator-strong); }
}
:root[data-increase-contrast] :is(.ask-row, .paper, .tile__badge) { box-shadow: inset 0 0 0 1px var(--separator-strong); }

:root[data-reduce-motion] .skeleton::after,
:root[data-page-hidden] .skeleton::after { animation: none; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; opacity: 0; } }
