/* material.css · P40's glass, copied word for word from the design system
   (RAMTT-HQ/ramtt-design-system at 3a3f5c67, 2026-11-06), because the vendored
   edition of 2026-09-28 has no material yet. No value here is P40's own:
   1. the material tokens and --lift-dock of tokens/tokens.css, light and dark
   2. components/f0-material.css, whole
   3. the floating sidebar of a shell without states, components/57-sidebar-rail.css
   When the vendor is synced past round 33, this file goes. */

/* 1. tokens/tokens.css */
:root {
  --lift-dock: 0 0 0 1px rgb(11 11 11 / 12%), 0 9px 48px rgb(0 0 0 / .08), 0 6px 24px rgb(0 0 0 / .10), 0 1px 1px rgb(0 0 0 / .04);
  /* ── material: glass on the navigation layer (round 33) ── */
  --material-blur: 24px;
  --material-saturate: 170%;
  --material-tint: rgb(255 255 255 / 84%);
  --material-clear: rgb(255 255 255 / 66%);
  --material-solid: var(--raised);
  --material-edge: inset 0 1px 0 rgb(255 255 255 / 90%), inset 0 0 0 1px rgb(255 255 255 / 35%), 0 0 0 1px rgb(11 11 11 / 9%);
  --material-hover: rgb(42 42 8 / 4.3%);
  --material-selected: rgb(42 42 8 / 8.2%);
  --material-selected-hover: rgb(42 42 8 / 10.4%);
  --material-intensity: 0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --lift-dock: 0 0 0 1px rgb(255 255 255 / 12%), 0 4px 40px rgb(0 0 0 / .10), 0 3px 20px rgb(0 0 0 / .125), 0 2px 8px rgb(0 0 0 / .125), 0 1px 1px rgb(0 0 0 / .125);
    /* ── material: glass on the navigation layer (round 33) ── */
    --material-saturate: 150%;
    --material-tint: rgb(26 26 25 / 84%);
    --material-clear: rgb(26 26 25 / 70%);
    --material-edge: inset 0 1px 0 rgb(255 255 255 / 10%), inset 0 0 0 1px rgb(255 255 255 / 4%), 0 0 0 1px rgb(255 255 255 / 12%);
    --material-hover: rgb(240 239 236 / 2.8%);
    --material-selected: rgb(240 239 236 / 5.6%);
    --material-selected-hover: rgb(240 239 236 / 7.9%);
  }
}
:root[data-theme="dark"] {
  --lift-dock: 0 0 0 1px rgb(255 255 255 / 12%), 0 4px 40px rgb(0 0 0 / .10), 0 3px 20px rgb(0 0 0 / .125), 0 2px 8px rgb(0 0 0 / .125), 0 1px 1px rgb(0 0 0 / .125);
  /* ── material: glass on the navigation layer (round 33) ── */
  --material-saturate: 150%;
  --material-tint: rgb(26 26 25 / 84%);
  --material-clear: rgb(26 26 25 / 70%);
  --material-edge: inset 0 1px 0 rgb(255 255 255 / 10%), inset 0 0 0 1px rgb(255 255 255 / 4%), 0 0 0 1px rgb(255 255 255 / 12%);
  --material-hover: rgb(240 239 236 / 2.8%);
  --material-selected: rgb(240 239 236 / 5.6%);
  --material-selected-hover: rgb(240 239 236 / 7.9%);
}

/* 2. components/f0-material.css */
/* f0-material.css · glass on the navigation layer (round 33).

   A surface of the navigation layer that floats over what it leads to can be
   glass: what scrolls under it stays in sight, blurred, with its colour kept.
   Only these take data-material="glass" (audit/lint.mjs holds them to it):
   the Dock (the Focus Dock of a hand among them), the title bar (the page
   header), the floating sidebar (the hidden sidebar's float), the status bar,
   the map's controls (one capsule of glass round the buttons) and the
   phone's tab bar (its pill of places and its round button, each a capsule
   of glass; the card of all places stays solid). Never content: a
   row, a card, a cell, a sheet or a menu you read stays solid.

     <div data-r="dock" data-material="glass">…</div>
     <header data-r="page-header" data-material="glass">…</header>
     <nav data-r="sidebar" data-floating data-material="glass">…</nav>
     <footer data-r="status-bar" data-material="glass">…</footer>
     <div data-r="map">… <div data-part="controls" data-material="glass">…</div></div>
     <div data-r="tab-bar" data-material="glass"><nav data-part="places">…</nav><button data-part="check-in">…</button>…</div>

   The glass is the raised plane at an alpha between --material-clear and
   --material-tint, chosen by --material-intensity (0 Clear, 1 Tinted), which
   a page sets on any element, or data-transparency="clear | tinted | solid",
   which the setting Transparency sets on the root (and a specimen on any
   element). Behind it, blur and saturate.
   Its edge is --material-edge: a lit line along the top, a faint inner edge
   and the ring, with the surface's own lift under it.

   On glass a state is the plane's step as a veil (--material-hover and its
   two siblings), so the glass stays glass under the pointer, and muted ink
   steps up to ink 2, so every word holds 4.5:1 over the worst ground the
   specimens put under it (tests/visual.test.mjs measures it).

   Under prefers-reduced-transparency, prefers-contrast: more, the setting
   Solid, or a browser without backdrop-filter, the glass is the opaque plane
   and everything on it is as it was. */

@property --material-intensity { syntax: '<number>'; inherits: true; initial-value: 0; }

/* what a glass surface reads, set once on the root: the glass, its veils, its muted ink */
:root {
  --material-ink-3: var(--ink-2);
  --material-pill: transparent;
}
[data-transparency="clear"] { --material-intensity: 0; }
[data-transparency="tinted"] { --material-intensity: 1; }

/* ── the glass ── */
[data-r="dock"][data-material="glass"],
[data-r="page-header"][data-material="glass"],
[data-r="status-bar"][data-material="glass"],
[data-r="shell"][data-sidebar-states] > [data-part="nav"] > [data-r="sidebar"][data-floating][data-material="glass"],
[data-r="sidebar"][data-floating][data-material="glass"],
[data-r="map"] > [data-part="controls"][data-material="glass"],
[data-r="tab-bar"][data-material="glass"] > :is([data-part="places"], [data-part="check-in"]) {
  --material-fill: color-mix(in srgb, var(--material-tint) calc(var(--material-intensity) * 100%), var(--material-clear));
  --plane-hover: var(--material-hover); --plane-selected: var(--material-selected); --plane-selected-hover: var(--material-selected-hover);
  --ink-3: var(--material-ink-3);
  background-color: var(--material-fill);
  -webkit-backdrop-filter: blur(var(--material-blur)) saturate(var(--material-saturate));
  backdrop-filter: blur(var(--material-blur)) saturate(var(--material-saturate));
}
/* a control at rest on the glass lets the glass through: a lifted pill keeps its ring */
:is([data-r="dock"], [data-r="page-header"], [data-r="status-bar"], [data-r="sidebar"], [data-r="map"] > [data-part="controls"])[data-material="glass"] { --pill-rest: var(--material-pill); }

/* each surface keeps its own lift under the glass's edge */
[data-r="dock"][data-material="glass"] { box-shadow: var(--material-edge), var(--dock-shadow); }
[data-r="shell"][data-sidebar-states] > [data-part="nav"] > [data-r="sidebar"][data-floating][data-material="glass"],
[data-r="sidebar"][data-floating][data-material="glass"] { box-shadow: var(--material-edge), var(--e3); }
/* the map's controls: one capsule of glass, 4 round the buttons, so a button's circle shares its centre with the capsule's end */
[data-r="map"] > [data-part="controls"][data-material="glass"] { gap: 0; padding: 4px; border-radius: var(--r-press); box-shadow: var(--material-edge), var(--e2); }
/* the buttons in it are the glass: no ring and no lift of their own */
[data-r="map"] > [data-part="controls"][data-material="glass"] { --ring: 0; --ring-hover: 0; --e1: 0 0 0 0 transparent; }

/* the phone's tab bar: its two capsules are the glass, each with the bar's own lift under the edge;
   the place you are in stays a lifted pill on it, as a pill on the Dock does */
[data-r="tab-bar"][data-material="glass"] > :is([data-part="places"], [data-part="check-in"]) { box-shadow: var(--material-edge), var(--lift-dock); }

/* the title bar stays at the top of what scrolls, and what scrolls goes under it */
[data-r="page-header"][data-material="glass"] { position: sticky; top: 0; z-index: 2; }
[data-r="page-header"][data-material="glass"] > [data-part="bar"]:first-child { border-bottom-color: var(--line-3); }
/* the status bar stays at the foot of what scrolls, with a hairline over it */
[data-r="status-bar"][data-material="glass"] { position: sticky; bottom: 0; z-index: 2; margin-right: 0; box-shadow: inset 0 var(--px) 0 var(--line-3); }

/* ── the opaque plane: reduced transparency, more contrast, the setting Solid, no backdrop-filter ──
   The glass reads its fill, its veils and its ink from the root, so the root
   alone turns it into the raised plane, whatever the surface. */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :root {
    --material-tint: var(--material-solid); --material-clear: var(--material-solid); --material-blur: 0px; --material-saturate: 100%;
    --material-hover: var(--raised-hover); --material-selected: var(--raised-selected); --material-selected-hover: var(--raised-selected-hover);
    --material-ink-3: var(--ink-3); --material-pill: var(--raised);
  }
}
[data-transparency="solid"] {
  --material-tint: var(--material-solid); --material-clear: var(--material-solid); --material-blur: 0px; --material-saturate: 100%;
  --material-hover: var(--raised-hover); --material-selected: var(--raised-selected); --material-selected-hover: var(--raised-selected-hover);
  --material-ink-3: var(--ink-3); --material-pill: var(--raised);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --material-tint: var(--material-solid); --material-clear: var(--material-solid);
    --material-hover: var(--raised-hover); --material-selected: var(--raised-selected); --material-selected-hover: var(--raised-selected-hover);
    --material-ink-3: var(--ink-3); --material-pill: var(--raised);
  }
}

/* 3. components/57-sidebar-rail.css */
[data-r="shell"]:not([data-sidebar-states]) > [data-r="sidebar"][data-floating] {
  --plane: var(--raised); --plane-hover: var(--raised-hover); --plane-selected: var(--raised-selected); --plane-selected-hover: var(--raised-selected-hover);
  --ring: var(--ring-raised); --ring-hover: var(--ring-raised-hover); --pill-rest: var(--raised);
  position: absolute; z-index: 3; top: 8px; bottom: 8px; left: 0; height: auto;
  border-radius: 0 var(--r-contain) var(--r-contain) 0;
  background: var(--raised);
  box-shadow: 0 0 0 var(--px) rgb(var(--ring-rgb) / var(--ring)), var(--e3);
}
