/* =============================================================================
   glass-surface.css — GlassSurface's stylesheet, and the panel's surfaces
   rebuilt on top of it.
   =============================================================================

   Split in three, and the split is the point:

     1. THE COMPONENT. `.glass-surface` and its two support states, ported from
        the React Bits CSS. The original is written in `light-dark()` for a page
        that could be either; FLINT is dark, committed, so the dark branch is
        inlined and the light one is gone rather than left as dead weight.

     2. THE SURFACES. Every bubble, text box and button re-expressed as a thin
        dark frost. The old rules set `background` and `box-shadow` directly;
        these set `--glass-tint` and `--glass-frost` and let the component's
        one rule paint them, so there is a single definition of what a lit
        surface looks like instead of forty.

   THERE IS NO AMBIENT GROUND, AND THAT IS DELIBERATE. An earlier version put
   a washed-and-gridded field behind `.app` so the displacement had something
   to bend; it was removed on request. The consequence is worth knowing rather
   than rediscovering: over the flat #08090A panel ground, a displacement map
   displaces one colour into itself, so on an in-flow surface the refraction is
   genuinely invisible and what you are seeing is the edge lighting. The
   refraction still does real work in the two places something is actually
   behind the glass — the dialogs, which sit over a blurred panel, and the
   menus, which sit over the conversation. Do not "fix" a surface that looks
   flat by raising its distortion; there is nothing there to distort.

   ORDER IS LOAD-BEARING. This sheet is linked AFTER panel.html's inline
   <style> and after panel-settings-menu.css, and most of what it overrides is
   a plain single-class rule. It wins those on document order at equal
   specificity, which is why `.glass-surface.glass-surface--svg` is doubled: it
   costs one class of specificity and buys ties against `.chat-bubble.assistant`
   and `.rt-tab.on` that a single class would lose.

   TWO THINGS THIS DELIBERATELY DOES NOT MAKE TRANSPARENT. The wheel pills and
   the floating panels (context menu, modals, the orb popup) keep a near-opaque
   ink ground and take only the refraction. panel-wheel.css already says why for
   the pills — they float over the conversation and --s-card at 5% lets the text
   behind read straight through them — and a dialog has the same problem for the
   same reason. Glass is a lighting treatment here, not a licence to see
   through things that need to be read.
   ============================================================================= */

:root {
  /* Space-separated so they compose in rgb(... / alpha). The comma-form
     --bone-rgb / --rim-rgb in panel.html cannot, and both are wanted: those
     are used inside rgba(), these inside rgb() with a slash. */
  --g-bone: 234 238 240;
  --g-warm: 220 228 232;   /* the warmer bone every FLINT surface is mixed from */
  --g-rim:  158 182 196;
  --g-ink:    0   0   0;
  --g-panel: 16  20  22;
  --g-danger: 232 96 92;

  /* THE TINT. Every surface is one of these two, and both are darker than
     anything they sit on except the ground itself — the panel is #08090A, so a
     tint a few points above it lifts a surface just enough to find its edge
     without ever becoming a plate. --g-dark-rim is the same value pulled
     toward rim, and it is what carries the severity ladder now that the ladder
     can no longer step through a bone wash. */
  --g-dark:     17 21 24;   /* was 18 23 26; a step darker, 2026-09-22 */
  --g-dark-rim: 24 33 39;

  /* The catches and the drops. White light along the top edge, black
     beneath; the light theme keeps the light and scales the drops, because
     a .55 black shadow over paper is a stain. */
  --g-lit:    255 255 255;
  --g-litrim: 200 225 235;
  /* The 1px ring every surface carries. The same white as the catch here;
     its own token because on paper the ring has to be a dark hairline while
     the glows stay light. */
  --g-edge:   255 255 255;
  --g-shadow: 0 0 0;
  --g-shadow-k: 1;
}

/* Light (2026-10-22, rewritten with panel.html's block): raised surfaces are
   WHITE plates on an off-white page, the rim-pulled tint is a pale accent
   wash, the ring is an ink hairline, and the drops are soft. Controls and
   fields do not take the white tint — section 7 at the end of this file gives
   them the light theme's grey wash instead, since a white button on a
   near-white page has nothing to show. */
:root[data-theme="light"] {
  --g-bone: 29 32 35;
  --g-warm: 90 100 110;
  --g-rim:  44 101 130;
  --g-ink:  247 247 245;
  --g-panel: 255 255 255;
  --g-danger: 192 44 40;
  --g-dark:     255 255 255;
  --g-dark-rim: 222 236 244;
  --g-lit:    255 255 255;
  --g-litrim: 44 101 130;
  --g-edge:   29 32 35;
  --g-shadow-k: .25;
}

/* ============================================================================
   1. THE COMPONENT
   ============================================================================ */

/* The standalone form, from create(). Elements upgraded in place by mount()
   get the state classes below and none of this — they keep their own layout. */
.glass-surface__wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity var(--dur-3) ease-out;
}

.glass-surface__content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .5rem;
  border-radius: inherit;
  position: relative;
  z-index: 1;
}

/* Defaults every surface inherits and most of them override. Frost is the
   tint's alpha at rest; frost-hi is the same at hover. They are two properties
   rather than one plus a calc() because a calc() reading --glass-frost to
   produce --glass-frost is circular and resolves to the guaranteed-invalid
   value, which silently drops the background entirely. */
.glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .38;
  --glass-frost-hi: .52;
  --glass-saturation: 1.2;
  /* Backdrop blur, distinct from the map's own `blur` prop. Zero here on
     purpose: an in-flow surface sits on the flat panel ground, where a blur
     costs a filter pass and shows nothing. Only the four floating panels —
     the ones with real content behind them — turn it on, and for them it is
     what makes a transparent panel readable at all. */
  --glass-blur: 0px;
}

/* The lit look, and the only place it is defined.

   The original's structure, at FLINT's amplitude and not at React Bits'. Those
   numbers — a 35% white ring and a 15% interior glow — are sized for glass over
   a photograph. Over #08090A a 35% ring is a white outline: it reads as a
   drawn border on every element at once and buries the refraction, which is
   the part that is actually glass. The four shadows are the same four in the
   same order, dropped to 12% and 5%, with the lit ring lifted back out in
   front of them as a separate declaration.

   That first line is not decoration. panel.html's --lit-card is a 1px inset
   highlight around the WHOLE edge, and this is the same statement at this
   file's amplitude. Both were a TOP-edge catch until the ring was asked for:
   a selected row, a focused field and a pressed button now read as OUTLINED
   rather than capped, and the alpha is the only thing left holding this short
   of React Bits' 35% white outline — so it is the number to move if the
   refraction starts to disappear under it, never the geometry.

   With the tint dark and thin, the shadows are now doing nearly all the work.
   A surface a few points above #08090A is almost the ground; what separates it
   is the ring around its edge and the drop beneath it, so those are a
   little stronger here than they were over a bone wash. Take them out and the
   surfaces genuinely disappear. */
.glass-surface.glass-surface--svg {
  background: rgb(var(--glass-tint) / var(--glass-frost));
  /* Empty var() fallback, not `none`: a surface can legitimately be here with
     no --filter-id — it is under 30px, or its size has not been measured yet —
     and `none saturate(1.2)` is not a valid backdrop-filter, so the whole
     declaration would be dropped and the frost would go with it. An empty
     fallback leaves a plain `saturate(...)`, which is valid and correct. */
  backdrop-filter: var(--filter-id,) saturate(var(--glass-saturation, 1));
  box-shadow:
    inset 0 0 0 1px rgb(var(--g-edge) / calc(.14 * var(--edge-k, 1))),
    0 0 2px 1px rgb(var(--g-lit) / .10) inset,
    0 0 14px 6px rgb(var(--g-lit) / .04) inset,
    0 3px 12px rgb(0 0 0 / calc(.34 * var(--g-shadow-k, 1))),
    0 8px 24px rgb(0 0 0 / calc(.20 * var(--g-shadow-k, 1)));
}

.glass-surface.glass-surface--svg:hover {
  background: rgb(var(--glass-tint) / var(--glass-frost-hi));
}

/* Taken when the displacement filter is unavailable (Safari, Firefox, reduced
   transparency) and by anything under 30px, where refraction is sub-pixel and
   not worth a backdrop snapshot. Plain blurred glass — no border, because
   these are existing elements with existing metrics and a 1px ring would move
   their text even under border-box. */
.glass-surface.glass-surface--fallback {
  background: rgb(var(--glass-tint) / calc(var(--glass-frost) + .03));
  backdrop-filter: blur(12px) saturate(1.6) brightness(1.08);
  -webkit-backdrop-filter: blur(12px) saturate(1.6) brightness(1.08);
  box-shadow:
    inset 0 0 0 1px rgb(var(--g-edge) / calc(0.0675 * var(--edge-k, 1))),
    0 2px 10px rgb(0 0 0 / calc(.30 * var(--g-shadow-k, 1)));
}

.glass-surface.glass-surface--fallback:hover {
  background: rgb(var(--glass-tint) / calc(var(--glass-frost-hi) + .03));
}

/* THE FROST FADE, AND WHY IT IS WRAPPED IN :where().
   =================================================
   This was a plain `transition` on the two state rules above, and it was the
   worst bug in the file: `transition` is a shorthand, the state rules are
   (0,2,0), and this stylesheet loads last — so upgrading an element to glass
   REPLACED whatever motion that element had designed for itself. The send
   wheel is where it showed. panel-wheel.css gives a pill
   `transform 420ms cubic-bezier(.22,1,.28,1)`, the overshoot-and-settle it
   calls "the whole gesture"; glassing the pills silently swapped that for
   `background .16s` and the arc began landing in a single frame. No error, no
   warning, and the transform still animated in DevTools' source view because
   the rule was still there — it had just lost.

   :where() contributes ZERO specificity, so this loses to every element's own
   `transition` no matter what order the sheets load in. An element that has
   designed its own motion keeps it; an element that never had any gets NONE —
   it was a .16s frost fade, removed 2026-10-08 because hover and press
   feedback that eases in reads as a laggy button. That is the correct default for a component that upgrades markup
   it did not write, and it is why nothing else in this file may declare
   `transition` outside a :where(). test-glass-surface.js enforces that. */
:where(.glass-surface) {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  :where(.glass-surface) { transition: none; }
}

/* Set on a surface that sits inside another one. It keeps the paint of the
   state it would otherwise have had and loses only the backdrop, because there
   is nothing behind it to sample — see the note in glass-surface.js. */
.glass-surface.glass-surface--nested {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.glass-surface:focus-visible {
  outline: 2px solid var(--rim);
  outline-offset: 2px;
}

/* No backdrop at all: the surface becomes what its frost says and nothing more,
   which is the honest reading of the request rather than a blur nobody asked
   for. The step up is large because the tint is dark and thin — at .38 over a
   near-black ground, a surface that has also lost its backdrop is a surface
   that is not there. */
@media (prefers-reduced-transparency: reduce) {
  .glass-surface.glass-surface--svg,
  .glass-surface.glass-surface--fallback {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgb(var(--glass-tint) / calc(var(--glass-frost) + .30));
  }
}

/* ============================================================================
   2. THE SURFACES
   ============================================================================ */

/* ---- what used to be bone-filled ----------------------------------------
   The primary action, the user's own turn, and every "this one is selected"
   state. These were solid --bone with ink text on them, and the whole panel
   read selection by INVERSION. They are dark glass now like everything else,
   which means that signal had to be rebuilt: a step up in frost, a brighter
   top catch, and a rim ring around the box. Selection is stated by weight of
   light rather than by flipping the ground.

   Every one of them therefore needs its text flipped too — a `color: var(--ink)`
   inherited from panel.html would be ink on near-black. That is what the
   `color` line below is for, and why .qr-quote and the send arrow get their own
   rules further down; they were both drawn in ink for a bone ground.

   :is() takes the specificity of its heaviest argument — (0,2,0) here — so
   with `.glass-surface` these land at (0,3,0) and clear `.chat-bubble.user`
   and friends outright rather than on document order. */
/* The send tile is blue only when it can act (2026-09-29): .armed when the
   box holds something to send, .busy while a reply streams and it is Stop.
   An empty box leaves it out of this list, so it takes the panel's ordinary
   grey glass (the :not() rule below) and reads as having nothing to do. The
   class is panel-bar.js's (pxBarSyncSend) and lockUI()'s. */
:is(.chat-bubble.user,
    .send.armed, .send.busy,
    .auth-submit,
    .rt-tab.on, .ob-tab.on,
    .px-toggle.on,
    .px-btn--primary,
    .set-opt.on).glass-surface {
  --glass-tint: var(--g-dark-rim);
  --glass-frost: .58;
  --glass-frost-hi: .68;
  --glass-saturation: 1.25;
  color: var(--t-primary);
}

:is(.chat-bubble.user,
    .send.armed, .send.busy,
    .auth-submit,
    .rt-tab.on, .ob-tab.on,
    .px-toggle.on,
    .px-btn--primary,
    .set-opt.on).glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  box-shadow:
    inset 0 0 0 1px rgb(var(--g-edge) / calc(0.153 * var(--edge-k, 1))),
    inset 0 0 0 1px rgb(var(--g-rim) / calc(0.153 * var(--edge-k, 1))),
    inset 0 0 16px 5px rgb(var(--g-rim) / .07),
    0 4px 16px rgb(0 0 0 / calc(.42 * var(--g-shadow-k, 1)));
}

/* The quote carried inside a sent message. It was drawn in ink at 28%/66% for
   a bone bubble; on a dark one that is a spine and a line of text you cannot
   see. Same treatment, inverted — which puts it back in step with .quote-ref,
   the composer-side version of the same object. */
.chat-bubble.user .qr-quote {
  border-left-color: rgb(var(--g-rim) / .55);
  color: var(--t-secondary);
}
/* The attachment block used to be a row INSIDE this bubble and took a flip
   here for the same reason. It is a sibling in the column now (.chat-media,
   2026-09-17), drawn on the column's own ground in panel.html, so there is
   nothing to flip. A new element inside the user bubble still gets its flip
   in the same commit. */

/* Google's button is not glass at all any more (2026-09-22): it is unenrolled
   in glass-surface.js and drawn flat and white in panel.html, so that it reads
   as Google's and not as one more of ours. */

/* ---- floating panels: the only place the blur is turned on ---------------
   These are the four surfaces with something real behind them, so they are
   also the only ones where transparency has a legibility cost to pay. The blur
   is what pays it: at 20px the text underneath becomes ground rather than
   text, and the panel can stay thin.

   The two are not equally exposed. .modal-box and .pxpop-card sit inside
   overlays that already lay a rgb(var(--g-ink) / .72) scrim over the page, so the
   occluding is done for them and they can be genuinely transparent. .ctx-menu
   and .orb-pop have no scrim at all — they open straight over the
   conversation — so they carry more of their own ground. That is the same
   constraint panel-wheel.css states for the pills, and it has not gone away
   just because the rest of the panel got thinner. */
:is(.modal-box, .pxpop-card, .px-test-box).glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .52;
  --glass-frost-hi: .52;
  --glass-blur: 20px;
  --glass-saturation: 1.15;
}

/* THE FIRST-RUN SHEET — the whole panel, not a dialog on it.
   Thinner frost than any of the dialogs above, and that is the point of the
   screen: it is the only surface in the panel with a ground painted expressly
   for it to bend, so it has to let those washes through rather than frosting
   them into one flat grey. A dialog's .52 over the welcome field looks like a
   dialog the size of the screen.
   The blur is what keeps it a MATERIAL at that thinness — the washes read as
   light diffused through glass rather than as three circles behind a tint. */
/* The drop target shares every number: it is the welcome sheet for a different
   sentence, and two sheets over the same panel with two frosts would read as
   two materials. */
:is(.welcome-sheet, .dropzone-sheet).glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .34;
  --glass-frost-hi: .40;
  --glass-blur: 26px;
  --glass-saturation: 1.22;
}

/* .ctx-menu left this rule on 2026-09-21; it is a bubble now, above. */
.orb-pop.glass-surface,
.px-sb-pop.glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .72;
  --glass-frost-hi: .76;
  --glass-blur: 22px;
  --glass-saturation: 1.15;
}

:is(.modal-box, .pxpop-card, .px-test-box,
    .orb-pop, .px-sb-pop, .welcome-sheet, .dropzone-sheet).glass-surface.glass-surface--svg {
  backdrop-filter:
    blur(var(--glass-blur)) var(--filter-id,) saturate(var(--glass-saturation, 1));
}

/* ---- bubbles -------------------------------------------------------------
   The cards, the activity log, the assessment: the panel's reading surfaces,
   and the thinnest things in the panel. They hold long prose, so they get the
   least ground of anything — enough to find the edge of the bubble and no
   more.

   `.chat-bubble.assistant` IS BACK ON THIS LIST (2026-09-10). It was removed
   when the ordinary reply lost its ground — the argument being that a reply is
   not an object in the column, it is the column — and what that left was one
   conversation rendered in two materials, since the proactive surface kept its
   boxes. Holding that together took a five-name marker list repeated across
   panel.html, glass-surface.js and this file, and a sixth marker nobody added
   to all three shipped flat among the boxed ones with nothing to catch it.

   One selector now covers both speakers. The list is shorter, the three files
   no longer have to agree about five strings, and the failure mode it existed
   to manage is gone rather than guarded. */
:is(.assessment,
    .proj-tile,
    .bib-well,
    .px-xt-well,
    .bib-edit,
    .suggest-chip,
    .set-plan-tier,
    .paywall).glass-surface,
.chat-bubble.assistant.glass-surface,
/* The two menus (2026-09-22): the reply bubble's numbers, by request — see
   TARGETS in glass-surface.js. They float over the conversation with no
   scrim, which is what the .72 frost .orb-pop keeps was for; the fallback's
   own 12px blur is what keeps a .30 frost readable there. */
/* .pin-ghost joins them (2026-09-27): the row carried under the cursor during
   a pin drag is asked to be the same material as the account menu's Learn more
   flyout, which is a .pxsm, so it takes the same numbers rather than a set of
   its own. It is the one surface in this list that MOVES, which is also the one
   thing that makes the refraction worth paying for — see the wheel's note. */
:is(.ctx-menu, .pxsm, .pin-ghost).glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .30;
  --glass-frost-hi: .42;
  --glass-saturation: 1.15;
}

/* ---- the rail's SELECTED row --------------------------------------------
   The row you clicked — the open chat, the open tab, the open thread — is the
   account menu's material now (2026-09-27, by request), so it takes the .pxsm
   numbers directly above rather than a set of its own, exactly as .pin-ghost
   does. Its ground used to be the flat --s-card plate panel.html paints, and
   those two declarations are gone from that file: this sheet loads last and
   would win them on document order anyway, and a losing rule that looks
   correct is the failure this file keeps meeting.

   THE SELECTION IS THE ONLY SURFACE IN THE LIST. Every other row is stripped
   back below — no ground, no lighting, and no backdrop pass — because forty
   lit plates down the rail is a list of buttons rather than a list of
   documents, and because the only thing a selected row has to do is be found
   from the corner of the eye while the rest of the list is read.

   IT IS ALSO WHAT MAKES IT FREE. A backdrop-filter is a snapshot per filtered
   element and the rail can hold forty rows; at most one of them is selected, so
   at most one is paid for — the .px-lens discipline in another place. Two
   caveats worth knowing rather than rediscovering: a row sits on the rail's own
   flat ground, where a displacement map has one colour to displace into itself,
   so the refraction is a rim effect here and the edge lighting is what reads as
   glass; and a thread row is close enough to MIN_REFRACT that it may land on
   the plain fallback instead, which is styled either way.

   HOVER IS DELIBERATELY NOT THIS. A pointer passing over a row and a row the
   column is showing are different events and must not read alike, so hover
   keeps the --s-quiet wash it has always had — restated in the rule below
   because the strip-back out-ranks panel.html's own hover rules. */
:is(.session-head, .session-threads .thread).glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .30;
  --glass-frost-hi: .42;
  --glass-saturation: 1.15;
}

/* A SEARCH RESULT WEARS THE SELECTED ROW'S MATERIAL, number for number
   (2026-10-10). Asked for as "the same style border as the click highlight
   for tabs", and a tab's click highlight is the rule directly above, so this
   restates it rather than approximating it — the four numbers are the same
   four, and tuning the rail's selection now tunes this with it.

   NOT folded into that selector's own :is() list, even though the
   declarations are identical, because the two are not the same thing: a rail
   row is a surface only while it is SELECTED (the strip-back below is what
   makes that true) and one of these is a surface always. Sharing the
   selector would mean the next change to either one silently moved both, in
   a file where that is the documented failure. */
.cs-res-item.glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .30;
  --glass-frost-hi: .42;
  --glass-saturation: 1.15;
}

/* THE SETTINGS RAIL'S SELECTED SECTION IS THE SELECTED RAIL ROW (2026-10-22,
   by request). Same four numbers, and the same strip-back and hover as the
   rail rows below, restated rather than folded in for the reason above. It
   sits inside .pxpop-card, so it is the nested case: paint and rings, no
   backdrop snapshot. */
.set-nav-item.glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .30;
  --glass-frost-hi: .42;
  --glass-saturation: 1.15;
}
.set-nav-item.glass-surface:not(.on) {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}
.set-nav-item.glass-surface:not(.on):hover { background: var(--s-quiet); }

/* SEARCH RESULTS, MEMORY FILES AND CONNECTIONS ROWS ARE RAIL ROWS (2026-11-13,
   by request): the selected rail row's four numbers, the same strip-back and
   the same hover, restated rather than folded in for the reason above. The one
   that is a surface: Connections' chosen row, or the row with keyboard focus. */
:is(.find-row, .set-mem-file, .set-mgraph-row).glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .30;
  --glass-frost-hi: .42;
  --glass-saturation: 1.15;
}
:is(.find-row, .set-mem-file).glass-surface:not(:focus-visible),
.set-mgraph-row.glass-surface:not([aria-selected="true"]) {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}
:is(.find-row, .set-mem-file).glass-surface:not(:focus-visible):hover,
.set-mgraph-row.glass-surface:not([aria-selected="true"]):hover {
  background: var(--s-quiet);
}

/* A row the answer CITED is the one worth finding in the list, so it gets
   the frost step a hovered rail row gets rather than a colour of its own —
   there is no second hue in this system and a citation is not a warning. */
.cs-res-item[data-cited="1"].glass-surface { --glass-frost: .42; }

/* And one the relevance filter rejected is still listed, still readable, and
   visibly not one of the others. */
.cs-res-item[data-off="1"].glass-surface { --glass-frost: .16; }

:is(.session-head, .session-threads .thread).glass-surface:not(.active-session):not(.active) {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

:is(.session-head, .session-threads .thread).glass-surface:not(.active-session):not(.active):hover {
  background: var(--s-quiet);
}

/* THE RAIL'S TOP ACTIONS ARE RAIL ROWS (2026-11-22, by request): the open
   view's row (.is-current) wears the selected row's material, number for
   number; the rest are stripped flat and keep the quiet hover wash. Restated
   rather than folded into the selector above, for the reason given there. */
.rail-nav.glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .30;
  --glass-frost-hi: .42;
  --glass-saturation: 1.15;
}
.rail-nav.glass-surface:not(.is-current) {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}
.rail-nav.glass-surface:not(.is-current):hover { background: var(--s-quiet); }

/* THE HEADER STATUS BAR IS A RAIL ROW TOO (2026-11-23, by request): the same
   material while its popup is open (aria-expanded), flat otherwise, the same
   quiet wash on hover. */
.px-sb-btn.glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .30;
  --glass-frost-hi: .42;
  --glass-saturation: 1.15;
}
.px-sb-btn.glass-surface:not([aria-expanded="true"]) {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}
.px-sb-btn.glass-surface:not([aria-expanded="true"]):hover { background: var(--s-quiet); }

/* A bubble is not a button and must not brighten when the pointer crosses it.
   `.suggest-chip` is excluded — it is a chip and does respond. */
:is(.assessment,
    .paywall, .ctx-menu, .pxsm, .pin-ghost, .pxpop-card, .modal-box, .orb-pop, .px-sb-pop).glass-surface:hover,
.chat-bubble.assistant.glass-surface:hover {
  background: rgb(var(--glass-tint) / var(--glass-frost));
}

.px-src.glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .26;
  --glass-frost-hi: .40;
}

/* ---- the severity ladder, preserved through the glass --------------------
   Ground and spine step together and hue never changes. The ladder used to
   step through a rim WASH; there is no wash any more, so it steps through
   alpha on a rim-pulled dark instead — same four rungs, same direction, same
   spines (which are panel.html's and untouched). sev-1 additionally keeps a
   rim ring, because at this weight a ground alone no longer separates the top
   rung from the second by enough to see across a scroll. */
.rescard.sev-1.glass-surface { --glass-tint: var(--g-dark-rim); --glass-frost: .62; --glass-frost-hi: .70; }
.rescard.sev-2.glass-surface { --glass-tint: var(--g-dark-rim); --glass-frost: .44; --glass-frost-hi: .52; }
.rescard.sev-3.glass-surface { --glass-tint: var(--g-dark);     --glass-frost: .30; --glass-frost-hi: .40; }
.rescard.sev-4.glass-surface { --glass-tint: var(--g-dark);     --glass-frost: .20; --glass-frost-hi: .30; }

.rescard.sev-1.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  box-shadow:
    inset 0 0 0 1px rgb(var(--g-litrim) / calc(0.135 * var(--edge-k, 1))),
    inset 0 0 0 1px rgb(var(--g-rim) / calc(0.126 * var(--edge-k, 1))),
    inset 0 0 16px 6px rgb(var(--g-rim) / .06),
    0 3px 12px rgb(0 0 0 / calc(.34 * var(--g-shadow-k, 1)));
}

/* A card only lifts on hover when it is actually clickable. */
.rescard.glass-surface:not(.locatable):hover {
  background: rgb(var(--glass-tint) / var(--glass-frost));
}

/* ---- rim-spined standing notices ----------------------------------------
   .page-changed, .usage-note, .quote-ref and .interjection are all
   the same object: a small statement attached to the frame rather than to the
   conversation. They keep their spines; the ground is the rim-pulled dark. */
.page-changed.glass-surface {
  --glass-tint: var(--g-dark-rim);
  --glass-frost: .50;
  --glass-frost-hi: .50;
  --glass-saturation: 1.2;
}

/* The notice left the family (2026-11-20): it is a neutral card now, not a
   spined statement, so it takes the plain dark tint at a popover's frost. */
.notice.glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .72;
  --glass-frost-hi: .72;
}

:is(.usage-note, .memory-note, .quote-ref, .interjection).glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .28;
  --glass-frost-hi: .28;
}

/* The spent state drains the ground with the spine, as the meter's fill does. */
.usage-note.spent.glass-surface { --glass-frost: .44; --glass-frost-hi: .44; }

/* ---- text boxes ----------------------------------------------------------
   The composer and every other input, the chat box included. A field should
   read as a well cut into the surface rather than a panel raised off it, so
   the top catch is dropped and an inner shadow put in its place — the one
   place the component's lighting is inverted on purpose. It carries a little
   MORE ground than a bubble, not less: a well you can see into is the only
   thing separating an empty field from the panel behind it now that neither
   has a wash on it. */
:is(.composer, .px-tray, .px-topic, .set-input, .modal-input,
    .auth-input, .find-box, .bib-filter, .pxm-search, .pxm-lib-search).glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .46;
  --glass-frost-hi: .46;
  --glass-saturation: 1.2;
}

:is(.composer, .px-tray, .px-topic, .set-input, .modal-input,
    .auth-input, .find-box, .bib-filter, .pxm-search, .pxm-lib-search).glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  box-shadow:
    inset 0 0 0 1px rgb(var(--g-edge) / calc(0.045 * var(--edge-k, 1))),
    inset 0 2px 8px rgb(0 0 0 / calc(.55 * var(--g-shadow-k, 1)));
}

/* The focus ring the old rules carried, restated on top of the well. Both
   :focus and :focus-visible, because panel.html used :focus for the composer
   and :focus-visible for the settings inputs and neither should regress. */
:is(.composer, .px-topic, .set-input, .modal-input,
    .auth-input, .find-box, .bib-filter, .pxm-search, .pxm-lib-search).glass-surface:is(:focus, :focus-visible, :focus-within) {
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgb(var(--g-edge) / calc(0.045 * var(--edge-k, 1))),
    inset 0 2px 8px rgb(0 0 0 / calc(.55 * var(--g-shadow-k, 1))),
    /* A signal, not an edge, so --edge-k doesn't dim it: at .48 x .55 it
       measured 2.8:1 (audit F-014). At .7 it reads at a glance. */
    0 0 0 1px rgb(var(--g-rim) / .7);
}

/* ---- buttons -------------------------------------------------------------
   Everything not already claimed above.

   Darker than the surfaces around them, and it is the FROST that does it, not
   the tint. The tint is a few points above the #08090A ground, so lowering its
   alpha walks a button toward the ground rather than away from it: .26 lands
   at about rgb(10 12 14) against the .40 that landed at rgb(12 15 16). There
   is very little room below — the ground is eight levels off black — so this
   is close to as dark as a button can go and still be a button.

   The hover step is left where it was, which widens the gap from .16 to .24 of
   frost. That is deliberate: a darker resting state has less of its own light
   to lose, so the pointer has to give it more. Selected states and the send
   button are NOT darkened — see the note above them; they are the panel's only
   remaining hierarchy now that nothing is bone-filled, and dimming them to
   match the idle ones would flatten it. */
:is(.rt-tab, .ob-tab, .ob-open, .px-toggle,
    .check-anyway, .px-btn, px-select, .auth-cta, .goto-tab, .mn-open,
    .set-opt, .pw-upgrade,
    /* The usage wall's two controls and the spent band's offer (panel-limit.js).
       Beside .pw-upgrade because they are the same kind of thing — the button on
       a refusal — and naming them here is what keeps them on the panel's button
       material rather than on whatever the generic rule leaves them with. */
    .lim-go, .lim-off, .un-upgrade,
    .px-test-row, .mic-btn, .vg-set).glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .26;
  --glass-frost-hi: .56;
  --glass-saturation: 1.25;
}

.rescard .source.glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .24;
  --glass-frost-hi: .54;
}

/* ---- indicators ----------------------------------------------------------
   The thread count beside a session name. Same material as the buttons above
   and a step quieter, because it is a READING rather than a control: nothing
   happens when you press it, so a resting frost as heavy as a button's would
   offer it as something to press, and the hover step is small for the same
   reason — the row underneath is what should answer the pointer, and the pill
   only has to come with it rather than light up on its own.

   Seventeen pixels tall, so it takes the fallback and never the displacement
   map. Nothing is lost: it sits on the flat rail ground, where refraction
   displaces one colour into itself, and the top catch and the ring are what
   make every other in-flow surface here read as glass anyway. */
.session-count.glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .22;
  --glass-frost-hi: .30;
  --glass-saturation: 1.25;
}

/* Menu rows are rows, not raised pills: no drop shadow under something that is
   already inside a panel, or the menu reads as a stack of floating slabs. */
.px-test-row.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  --glass-frost: 0;
  --glass-frost-hi: .16;
  box-shadow: none;
}

/* ---- the send wheel ------------------------------------------------------
   The same dark glass as every other pill, and the only place in the panel
   where the refraction is the point rather than a rim. The arc opens over the
   conversation, so there is real content under these — and it is content that
   MOVES relative to them, which is what makes them read as liquid rather than
   as frosted.

   panel-wheel.css set these at rgb(var(--g-panel) / .94), near-opaque, because "these
   float over the conversation and --s-card at 5% would let the text behind
   read straight through them". That constraint is met a different way now:
   .wheel-scrim.open lays blur(8px) and up to 28% ink over everything beneath
   the arc, so what a pill refracts is already soft. The pills therefore carry
   no --glass-blur of their own — the scrim has done it, and a second blur
   would be paying twice for one look while doubling the per-frame cost of the
   most expensive thing on screen. */
:is(.wheel-pill, .wheel-sub-pill).glass-surface {
  --glass-tint: var(--g-dark);
  /* A shade thicker than an ordinary button (.40), and this is the one place
     the panel trades transparency back for legibility: these open ON TOP of
     live text rather than over panel ground, so the label and the sentence
     underneath are competing for the same pixels. .50 is where the label wins
     and the sentence is still plainly visible through it. */
  --glass-frost: .50;
  --glass-frost-hi: .62;
  --glass-saturation: 1.3;
  --glass-blur: 0px;
}

/* "A shade lighter, and only that", per panel-wheel.css — the outer ring has
   to read as being in front where a spoke passes near an inner label. It was a
   different background; it is a step in frost now, which is the same statement
   in the system the rest of the panel is speaking. */
.wheel-sub-pill.glass-surface { --glass-frost: .62; --glass-frost-hi: .72; }

/* GONE FROM HERE: the .px-fluid swap. The wheel's stronger distortion used to
   be a second filter this file selected with `--filter-id-motion` under a
   class panel-wheel.js raised for the length of the travel. There is one
   filter now and its amplitude is a number, ramped by PXGlass.motion() — so
   there is nothing left for CSS to switch between, and no reduced-motion rule
   to override it either (glass-surface.js checks the query itself, which is
   the only place that still can). See the motion section in that file. */

/* THE SELECTION. It is the one thing on the arc that has to be readable at a
   glance, from the corner of the eye, while six neighbours are mid-swing —
   the whole wheel is a dial and this is the number it is pointing at.

   It used to be a solid bone slab with ink text, which was unmissable and is
   gone with the rest of the bone. What replaces it is three statements that
   agree: a ground twice the weight of an unselected pill, a rim ring INSIDE
   the edge, and a hairline of the same rim OUTSIDE it, so the pill reads as
   ringed rather than merely paler. panel-wheel.css's `font-weight: 500`
   survives all of this and is the fourth.

   Later in the file than the shared .on rule and at the same specificity, so
   it wins on document order. */
.wheel-pill.on.glass-surface {
  --glass-tint: var(--g-dark-rim);
  --glass-frost: .74;
  --glass-frost-hi: .80;
  color: var(--bone);
}

.wheel-pill.on.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  box-shadow:
    inset 0 0 0 1px rgb(var(--g-edge) / calc(0.189 * var(--edge-k, 1))),
    inset 0 0 0 1px rgb(var(--g-rim) / calc(0.261 * var(--edge-k, 1))),
    0 0 0 1px rgb(var(--g-rim) / calc(0.09 * var(--edge-k, 1))),
    0 6px 20px rgb(0 0 0 / calc(.55 * var(--g-shadow-k, 1)));
}

/* Only a pill you can actually see refracts. panel-wheel.js raises .px-lens on
   the pills inside the arc window and drops it on the rest — and on all of
   them while the wheel is shut, which is nearly all the time.

   (0,3,0) against the component's own (0,2,0) backdrop rule, so it no longer
   depends on document order the way it did when it had the .px-fluid swap to
   out-rank as well. It still sits last, because a rule that turns something
   off reads better after everything that turns it on.

   Amplitude does not stand in for this and must not be asked to: PXGlass
   drives ONE shared filter for every pill of a given size, so a pill outside
   the window is still bending its backdrop at whatever the dial is doing. The
   class is what stops it paying for the snapshot. */
.wheel-pill.glass-surface--svg:not(.px-lens) {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* .current marks the choice already in force on the outer ring, which usually
   coincides with .on. It inverted to ink on top of the bone selection; on dark
   glass it is bone like the rest, and .on above is what separates the two. */
.wheel-sub-pill.on.current.glass-surface { color: var(--bone); }

/* A disabled control does not catch light. */
.glass-surface:disabled {
  box-shadow: inset 0 0 0 1px rgb(var(--g-edge) / calc(0.027 * var(--edge-k, 1))) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* `.check-anyway.secondary` is the panel's one deliberately unlit button — the
   quieter of a pair — and glassing it would make the pair read as equals. */
.check-anyway.secondary.glass-surface {
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* The send arrow was ink, for a bone circle. The circle is dark glass now, so
   the arrow is bone — and it is the mark that carries the button, since a
   thin dark disc on a dark ground is mostly its own rim. */
.send.glass-surface svg { stroke: var(--bone); }

/* The orb button stays a mark rather than a surface: it is 9px of rim on a
   28px hit area and frosting it would give the mark a plate to sit on. */
.session-orb.glass-surface {
  --glass-frost: .22;
  --glass-frost-hi: .40;
}

/* ============================================================================
   3. ONE MATERIAL — THE SIGN-IN SHEET'S (2026-09-22)
   ============================================================================
   Every surface wears the first-run sheet's texture: `--g-dark` at .34 (.40
   under the pointer), saturation 1.22, and the 26px backdrop blur that only
   the floating panels used to turn on. The per-kind frosts above all still
   stand in the source; these two blocks out-rank them, so reverting the commit
   that added them brings every one back exactly. Geometry is NOT unified —
   each preset's map is sized to its element (see the fold note on `sheet`),
   and a sheet's band on a pill would fold; the look is the stylesheet's, the
   bend is the preset's, and that split is the file's oldest rule.

   Excepted is state, not kind: the primary action, the user's turn and every
   selected pill keep their step in frost, because that step is how the panel
   says "this one" now that nothing is bone-filled.

   What this cannot give a button is the LIQUID of the sign-in screen. That
   comes from .welcome-field — two washes painted behind the sheet for the
   glass to bend — and the rest of the panel has no wash behind it, by an
   earlier request. Over flat ground refraction displaces one colour into
   itself; what shows is the blur, the tint and the edge light. */
.glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback):not(
    .chat-bubble.user, .send.armed, .send.busy, .auth-submit,
    .rt-tab.on, .ob-tab.on, .px-toggle.on, .set-opt.on,
    .px-btn--primary,
    .wheel-pill.on, .wheel-sub-pill.on) {
  --glass-tint: var(--g-dark);
  /* Tuned by hand on 2026-09-22 from the sheet's .34/.40/1.22/26px: a .20
     frost with NO hover step, no saturation lift, and a 12px blur. These four
     numbers and --g-dark are the whole look of the panel now. */
  --glass-frost: 0.3;
  --glass-frost-hi: 0.3;
  --glass-saturation: 1;
  --glass-blur: 13px;
}

/* The excepted states, thinned by the same step as everything else — they are
   still the panel's only hierarchy, so they move WITH the material rather than
   being left at .58 over a .28 field. */
:is(.chat-bubble.user, .send.armed, .send.busy, .auth-submit,
    .rt-tab.on, .ob-tab.on, .px-toggle.on, .set-opt.on,
    .px-btn--primary).glass-surface.glass-surface {
  --glass-frost: .52;
  --glass-frost-hi: .62;
}

/* The blur itself, on every surface and not only the floating panels. The
   wheel's pills are excepted so .px-lens keeps deciding which of them pay for
   a backdrop at all; a nested surface's !important none still wins. The
   fallback (anything under 30px) had a fixed 12px blur and a brightness lift
   of its own; it takes the sheet's numbers too, or the small controls would
   be the one place the material changed. */
/* BLUR FIRST, THEN BEND (2026-09-29). The chain was displacement then blur,
   and that left a band of SHARP text just inside every edge while the middle
   blurred — measured on a dialog over a page of text, top and bottom edges
   worst. The displacement is strongest in the edge band and there it pulls
   from outside the element's own backdrop, which the blur after it does not
   reach the same way. Blurred first, the map bends an already-blurred image:
   the edge reads as blurred as the centre, and it still refracts, because a
   blur keeps the large shapes the map is there to bend. The floating-panel
   rule above takes the same order; the base rule has no blur to order. */
.glass-surface.glass-surface.glass-surface--svg:not(.wheel-pill, .wheel-sub-pill) {
  backdrop-filter:
    blur(var(--glass-blur)) var(--filter-id,) saturate(var(--glass-saturation, 1));
}
.glass-surface.glass-surface.glass-surface--fallback:not(.wheel-pill, .wheel-sub-pill) {
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation, 1));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation, 1));
}

/* 4. THE SCRIM, ON EVERYTHING — tried on 2026-09-22 and removed the same day:
   an ink .72 layer under every surface's frost made the panel solid cards
   with a lit edge. The overlays' own scrims (.pxpop, .modal-overlay,
   .px-test-menu) went with it, so a dialog now sits on the same ground as a
   menu: the page itself, through 26px of blur. */

/* ============================================================================
   5. THE WELCOME SHEET HAS NO EDGE (2026-10-20, by request)
   ============================================================================
   It is the whole panel, so its edge is the panel's edge, and both things that
   drew one are off: the lit ring and inner glow traced the border as a 1px
   frame, and the `sheet` map bent the app along the left and right as a dark
   refraction band. Without the map nothing on the sheet bends — that glass only
   ever bent in its border band — so what is left is the material: section 3's
   tint, frost and 13px blur.

   It stays enrolled in TARGETS for that material and for one more reason:
   being a glass surface is what marks the borrowed sign-in controls as
   --nested, so they keep taking no backdrop of their own. The drop target
   keeps its map and its motion. Same specificity as section 3's chain and
   later, so this wins it. */
.welcome-sheet.glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  box-shadow: none;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation, 1));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation, 1));
}

/* ============================================================================
   7. THE LIGHT THEME'S OWN MATERIAL (2026-10-22, by request)
   ============================================================================
   The token swap above is enough for the reading surfaces: a white plate with
   an ink hairline and a soft drop is what a card is on paper. It is not
   enough for four things whose dark-theme look depends on being darker or
   lighter than ink, and those are restated here rather than bent through
   tokens nobody else needs.

   Specificity: every rule here carries :root[data-theme] (0,2,0), the doubled
   .glass-surface and the state :is(), so it clears section 3's (0,5,0)
   flattening as well as the per-kind rules, and this section is last. */

/* Controls are a grey WASH, not a plate. Raising frost on a white tint over a
   near-white page moves nothing, so the button rests at a light slate and the
   pointer deepens it — the way every light UI answers a hover. */
:root[data-theme="light"] :is(.rt-tab, .ob-tab, .ob-open, .px-toggle,
    .check-anyway, .px-btn, px-select, .auth-cta, .goto-tab,
    .set-opt, .pw-upgrade,
    .lim-go, .lim-off, .un-upgrade,
    .px-test-row, .mic-btn, .vg-set, .rescard .source, .session-count,
    .wheel-pill, .wheel-sub-pill, .send).glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  --glass-tint: var(--g-warm);
  --glass-frost: .07;
  --glass-frost-hi: .14;
  box-shadow: inset 0 0 0 1px rgb(var(--g-edge) / 0.0315);
}

/* Fields are a white well with a hairline, not a shaded pit: the inner
   shadow that cuts a field into ink reads as grime on paper. */
:root[data-theme="light"] :is(.composer, .px-tray, .px-topic, .set-input, .modal-input,
    .auth-input, .find-box, .bib-filter, .pxm-search, .pxm-lib-search).glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  --glass-frost: .92;
  --glass-frost-hi: .92;
  box-shadow:
    inset 0 0 0 1px rgb(var(--g-edge) / 0.063),
    0 1px 2px rgb(var(--g-shadow) / .04);
}
:root[data-theme="light"] :is(.composer, .px-topic, .set-input, .modal-input,
    .auth-input, .find-box, .bib-filter, .pxm-search, .pxm-lib-search).glass-surface:is(:focus, :focus-visible, :focus-within) {
  box-shadow:
    inset 0 0 0 1px rgb(var(--g-rim) / 0.248),
    0 0 0 3px rgb(var(--g-rim) / .12);
}

/* Anything that floats is an opaque white plate. Translucency over the
   conversation was paid for in dark by a blur that turns text into ground; on
   paper the same blur leaves a grey haze, so the menus and dialogs carry their
   own ground instead, and they stop bending the page behind them — the
   displacement map darkens its backdrop, which on ink is invisible and on
   paper is a smudge the size of the dialog. */
:root[data-theme="light"] :is(.modal-box, .pxpop-card, .px-test-box, .orb-pop, .px-sb-pop,
    .ctx-menu, .pxsm, .pin-ghost).glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  --glass-tint: var(--g-dark);
  --glass-frost: 1;
  --glass-frost-hi: 1;
}
:root[data-theme="light"] :is(.modal-box, .pxpop-card, .px-test-box, .orb-pop, .px-sb-pop,
    .ctx-menu, .pxsm, .pin-ghost).glass-surface.glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  backdrop-filter: blur(var(--glass-blur, 0px)) saturate(var(--glass-saturation, 1));
  -webkit-backdrop-filter: blur(var(--glass-blur, 0px)) saturate(var(--glass-saturation, 1));
  box-shadow:
    inset 0 0 0 1px rgb(var(--g-edge) / 0.045),
    0 4px 12px rgb(var(--g-shadow) / .06),
    0 16px 40px rgb(var(--g-shadow) / .10);
}

/* The first-run sheet and the drop target are the whole panel: a near-solid
   page over the blurred app, not a grey haze across it. */
:root[data-theme="light"] :is(.welcome-sheet, .dropzone-sheet).glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  --glass-tint: var(--g-ink);
  --glass-frost: .82;
  --glass-frost-hi: .82;
}

/* The selected states — the user's turn, the armed send, an .on tab — are the
   pale accent wash with an accent hairline: found by colour, as a selection
   is on paper, rather than by a glow. */
:root[data-theme="light"] :is(.chat-bubble.user, .send.armed, .send.busy, .auth-submit,
    .rt-tab.on, .ob-tab.on, .px-toggle.on, .set-opt.on,
    .px-btn--primary).glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  --glass-tint: var(--g-dark-rim);
  --glass-frost: .9;
  --glass-frost-hi: 1;
}
:root[data-theme="light"] :is(.chat-bubble.user, .send.armed, .send.busy, .auth-submit,
    .rt-tab.on, .ob-tab.on, .px-toggle.on, .set-opt.on,
    .px-btn--primary).glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  box-shadow:
    inset 0 0 0 1px rgb(var(--g-rim) / 0.099),
    0 1px 2px rgb(var(--g-shadow) / .05);
}

/* Destructive controls keep the shared glass/filter chain and use one red
   treatment in both themes. Sign-out and disconnect are not delete controls. */
:is(.px-delete, .all-trash, .set-mem-delete, .px-btn--danger) {
  color: rgb(var(--g-danger));
}
/* .px-btn.px-btn--danger, doubled: a danger button is also a .px-btn, and this has
   to tie section 7's grey wash for controls and win on being later. */
:root[data-theme] :is(.px-delete, .all-trash, .set-mem-delete, .px-btn.px-btn--danger).glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  --glass-tint: var(--g-danger);
  --glass-frost: .12;
  --glass-frost-hi: .2;
  color: rgb(var(--g-danger));
  box-shadow:
    inset 0 0 0 1px rgb(var(--g-danger) / 0.153),
    inset 0 1px 0 rgb(var(--g-lit) / .16),
    0 2px 8px rgb(var(--g-shadow) / calc(.14 * var(--g-shadow-k, 1)));
}
:is(.px-delete, .all-trash, .set-mem-delete).glass-surface svg { stroke: currentColor; }
:root[data-theme] :is(.px-delete, .set-mem-delete, .px-btn.px-btn--danger).glass-surface.glass-surface:disabled {
  opacity: .5; cursor: not-allowed;
}

/* ============================================================================
   8. ONE BUTTON (2026-11-05)
   ============================================================================
   .px-btn and px-select, on one asset with three variants: the default, primary
   (the lists above: a rim-pulled tint and a rim ring, never a bone fill) and
   danger (the rule above). Section 3 flattened every surface's hover step, which
   suits a bubble and leaves a button not answering the pointer, so the step comes
   back here for these two: the menu's and the rail's .42 under the pointer, a
   further step while pressed. Light has its own .14 from section 7, so only its
   press is added. */
:root:not([data-theme="light"]) :is(.px-btn, px-select):not(.px-btn--primary, .px-btn--danger, :disabled).glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback):hover {
  --glass-frost-hi: .42;
}
:root:not([data-theme="light"]) :is(.px-btn, px-select):not(.px-btn--primary, .px-btn--danger, :disabled).glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback):active {
  --glass-frost-hi: .52;
}
:root[data-theme="light"] :is(.px-btn, px-select):not(.px-btn--primary, .px-btn--danger, :disabled).glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback):active {
  --glass-frost-hi: .2;
}
.px-btn--primary:not(:disabled).glass-surface.glass-surface:active { --glass-frost-hi: .72; }
:root[data-theme] .px-btn.px-btn--danger:not(:disabled).glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback):active { --glass-frost-hi: .3; }
/* A toggle that is on (the memory file's Edit and Preview) rests where the pointer
   would bring it. */
:root:not([data-theme="light"]) .px-btn[aria-pressed="true"].glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) { --glass-frost: .42; }
:root[data-theme="light"] .px-btn[aria-pressed="true"].glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) { --glass-frost: .14; }

/* A DISABLED BUTTON IS QUIET, NOT GONE. An opacity on the whole button took 9px type
   to 2:1, under .glass-surface:disabled's .06 ring, and three off buttons read as
   empty space. So the ink steps down instead and the box keeps a thin edge. Every
   variant drops to the default's ground, or a disabled primary still reads as the
   main action. Danger keeps its own rule at the end of section 7. */
:root .px-btn.px-btn:not(.px-btn--danger):disabled.glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  --glass-tint: var(--g-dark);
  --glass-frost: .3;
  --glass-frost-hi: .3;
  color: var(--t-meta);
  box-shadow: inset 0 0 0 1px rgb(var(--g-edge) / calc(0.054 * var(--edge-k, 1))) !important;
}
:root[data-theme="light"] .px-btn.px-btn:not(.px-btn--danger):disabled.glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  --glass-tint: var(--g-warm);
  --glass-frost: .03;
  --glass-frost-hi: .03;
  box-shadow: inset 0 0 0 1px rgb(var(--g-edge) / 0.0315) !important;
}
/* ============================================================================
   THE PROMPT BAR AND THE AI'S REPLY WEAR THE SELECTED ROW'S MATERIAL
   (2026-11-22, by request)
   ============================================================================
   Same four numbers as the rail's selected row (tint, frost .30/.42,
   saturation 1.15) and the same lit edge: the base glass box-shadow, restated
   so the composer's inset well does not replace it. Dark theme only; the light
   theme's plates carry their own. The focus ring is left to its own rule: the
   shadow here is not taken while the FIELD is focused.
   THE REPLY KEEPS IT WHATEVER HAS FOCUS (2026-11-30). The :not(:focus-within)
   was the bar's and reached the bubble through the shared :is(): click the
   thought line's chevron (a tabindex head) or a reply's link and the bubble
   dropped to the base .035 ring, the flat box in the waiting state. A bubble
   has no focus ring of its own to make room for. */
:root:not([data-theme="light"]) :is(.composer, .px-tray, .chat-bubble.assistant).glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .30;
  --glass-frost-hi: .42;
  --glass-saturation: 1.15;
}
:root:not([data-theme="light"]) :is(.composer, .px-tray).glass-surface:is(.glass-surface--svg, .glass-surface--fallback):not(:focus, :focus-visible, :focus-within),
:root:not([data-theme="light"]) .chat-bubble.assistant.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  box-shadow:
    inset 0 0 0 1px rgb(var(--g-edge) / calc(.14 * var(--edge-k, 1))),
    0 0 2px 1px rgb(var(--g-lit) / .10) inset,
    0 0 14px 6px rgb(var(--g-lit) / .04) inset,
    0 3px 12px rgb(0 0 0 / calc(.34 * var(--g-shadow-k, 1))),
    0 8px 24px rgb(0 0 0 / calc(.20 * var(--g-shadow-k, 1)));
}

/* ============================================================================
   BUTTONS WEAR IT TOO (2026-11-22, by request)
   ============================================================================
   Check sources and every control of its kind: the same material and lit edge
   as the selected row, the prompt bar and the AI's reply. Not the primary,
   danger, selected (.on) or disabled states: those keep their own steps, since
   they are how the panel says "this one". Dark theme only. */
:root:not([data-theme="light"]) :is(.px-btn, .check-anyway, .goto-tab, .mn-open, .vg-set,
    .auth-cta, .lim-go, .lim-off, .un-upgrade, .pw-upgrade, .rt-tab, .ob-tab, .ob-open,
    .px-toggle, .set-opt, .all-trash, .set-mem-delete):not(
    .px-btn--primary, .px-btn--danger, .on, :disabled).glass-surface.glass-surface.glass-surface {
  --glass-tint: var(--g-dark);
  --glass-frost: .30;
  --glass-frost-hi: .42;
  --glass-saturation: 1.15;
}
:root:not([data-theme="light"]) :is(.px-btn, .check-anyway, .goto-tab, .mn-open, .vg-set,
    .auth-cta, .lim-go, .lim-off, .un-upgrade, .pw-upgrade, .rt-tab, .ob-tab, .ob-open,
    .px-toggle, .set-opt, .all-trash, .set-mem-delete):not(
    .px-btn--primary, .px-btn--danger, .on, :disabled).glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  box-shadow:
    inset 0 0 0 1px rgb(var(--g-edge) / calc(.14 * var(--edge-k, 1))),
    0 0 2px 1px rgb(var(--g-lit) / .10) inset,
    0 0 14px 6px rgb(var(--g-lit) / .04) inset,
    0 3px 12px rgb(0 0 0 / calc(.34 * var(--g-shadow-k, 1))),
    0 8px 24px rgb(0 0 0 / calc(.20 * var(--g-shadow-k, 1)));
}

/* ============================================================================
   JUMP TO THE LATEST (panel-jump.js)
   ============================================================================
   The round button above the prompt bar: the panel's glass, with the buttons'
   lit edge and shadow, and frosted at the selected states' .52 rather than the
   field's .30, because it sits over moving text and has to read as solid.
   Four classes and the :is(), after section 3, so it wins that chain. */
.px-jump.glass-surface.glass-surface.glass-surface:is(.glass-surface--svg, .glass-surface--fallback) {
  --glass-tint: var(--g-dark);
  --glass-frost: .52;
  --glass-frost-hi: .64;
  --glass-saturation: 1.15;
  border: none;
  box-shadow:
    inset 0 0 0 1px rgb(var(--g-edge) / calc(.16 * var(--edge-k, 1))),
    0 0 2px 1px rgb(var(--g-lit) / .10) inset,
    0 0 14px 6px rgb(var(--g-lit) / .05) inset,
    0 3px 12px rgb(0 0 0 / calc(.34 * var(--g-shadow-k, 1))),
    0 8px 24px rgb(0 0 0 / calc(.20 * var(--g-shadow-k, 1)));
}
