/* <valt-sort-sheet>. Opens from the sort trigger, which is in the dock's tier below it, so it grows from its bottom centre. */
/* The width is published, not repeated: screens/network.css places the sheet with calc() off
   --sheet-w, so the plate and its anchor can never drift apart again (they had: the placement
   still said 196 after the plate grew to 300, and the sheet left the trigger by 104 above 448).
   --sheet-max is the height the screen can spare; unset it is none and the plate is its own size. */
valt-sort-sheet { display: block; --sheet-w: 300px; width: var(--sheet-w); max-height: var(--sheet-max, none);
  position: relative; font-family: var(--font); color: var(--text); transform-origin: 50% 100%;
  transition: opacity var(--t-feedback) var(--ease), transform var(--t-move) var(--ease), visibility 0s linear 0s; }
/* Closed means closed: without visibility the four controls stayed tabbable behind the map. */
valt-sort-sheet:not([open]) { opacity: 0; transform: scale(.94) translateY(6px); pointer-events: none; visibility: hidden;
  transition: opacity var(--t-feedback) var(--ease), transform var(--t-move) var(--ease), visibility 0s linear var(--t-move); }

/* The plate: the same glass as the drawer and the hero, at radius 20,
   with a grey lit edge. The edge grey is this sheet's own value, not a token; the plate is --glass-panel so the
   sheet and the list read as one material. The top light arrives from the trigger's corner when the sheet opens. */
/* Teal carried far enough toward the theme's own ink to stay legible on a light plate: --focus by
   day is 2.81 on the tinted row and 3.36 on the footer, both under the bar. The mix darkens by day
   and lightens by night, so one value serves both. */
valt-sort-sheet { --sheet-edge: #5A5A5E; --focus-legible: color-mix(in srgb, var(--focus) 82%, var(--text)); }
[data-theme="day"] valt-sort-sheet { --sheet-edge: #8C8980; }
valt-sort-sheet .sheet { position: relative; background: var(--glass-panel); border: 0; border-radius: 24px;
  display: flex; flex-direction: column; max-height: inherit; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  box-shadow: var(--shadow-sheet);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(130%); backdrop-filter: blur(var(--glass-blur)) saturate(130%); }
/* The outline rides above the plate's contents: drawn on the plate, the sticky heading and footer
   painted over it and the edge stopped at both. */
valt-sort-sheet::before { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: 24px; pointer-events: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sheet-edge) 40%, transparent); }
valt-sort-sheet::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, var(--sheet-edge) 30%, var(--sheet-edge) 70%, transparent 100%); }
/* The light lands: 600ms on --travel because the travel is the information (the house ease-out lands in 79ms). */
valt-sort-sheet[open]::after { animation: sort-sheet-lit 600ms var(--travel) both; }
@keyframes sort-sheet-lit { 0% { transform: translateX(70%); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateX(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  valt-sort-sheet[open]::after { animation: sort-sheet-lit-fade var(--t-feedback) ease-out both; }
  @keyframes sort-sheet-lit-fade { from { opacity: 0; } to { opacity: 1; } }
}
valt-sort-sheet h3 { position: sticky; top: 0; z-index: 1; flex: none;
  background-image: linear-gradient(var(--glass-panel), var(--glass-panel)), linear-gradient(var(--glass-panel), var(--glass-panel));
  margin: 0; padding: 10px 12px 8px; font: 600 11px/12px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); border-bottom: 1px solid var(--border); }
valt-sort-sheet .opt { display: flex; align-items: center; justify-content: space-between; width: 100%; height: var(--tap); flex: none; padding: 0 12px; border: 0; background: transparent;
  cursor: pointer; font: 500 13px/1 var(--font); letter-spacing: -.01em; color: var(--text); border-bottom: 1px solid var(--border); -webkit-appearance: none;
  transition: background var(--t-feedback) var(--ease), color var(--t-feedback) var(--ease); }
valt-sort-sheet .opt:hover { background: var(--glass-cap); }
valt-sort-sheet .opt:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
valt-sort-sheet .opt[aria-pressed="true"] { background: color-mix(in srgb, var(--focus) 16%, transparent); color: var(--text); box-shadow: inset 2px 0 0 var(--focus); }
/* Grouped, a pick is the tint and the check: the 2px teal rule down the row's edge made three marks for
   one choice, and a coloured edge rule on a list item is on impeccable's craft-floor list of tells. */
valt-sort-sheet .set .opt[aria-pressed="true"], valt-sort-sheet .opt[aria-checked="true"], valt-sort-sheet .opt[aria-expanded="true"] {
  background: color-mix(in srgb, var(--focus) 16%, transparent); color: var(--text); box-shadow: none; }
/* The footer is the plate's floor: a rule on top and a short fade above it, so rows running under it
   read as more to scroll to, not as a row half drawn. */
valt-sort-sheet .foot { position: sticky; bottom: 0; z-index: 1; flex: none; border-top: 1px solid var(--border);
  background-image: linear-gradient(var(--glass-panel), var(--glass-panel)), linear-gradient(var(--glass-panel), var(--glass-panel));
  display: flex; align-items: center; justify-content: space-between; padding: 0 12px; height: var(--tap);
  font: 500 12px/14px var(--font); color: var(--text-2); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
valt-sort-sheet .foot::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 28px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--glass-panel)); opacity: 0; transition: opacity var(--t-feedback) var(--ease); }
/* Only while there is more under it (sort-sheet.js #edge). */
valt-sort-sheet .sheet[data-more] .foot::before { opacity: 1; }
valt-sort-sheet .foot .now { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
valt-sort-sheet .foot .now b { font-weight: 600; color: var(--text); }
valt-sort-sheet .clear { height: var(--tap); border: 0; background: transparent; cursor: pointer; color: var(--focus-legible); font: 600 11px/1 var(--font); letter-spacing: .04em; text-transform: uppercase; padding: 0 0 0 12px; -webkit-appearance: none; }
valt-sort-sheet .clear:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--r-chip); }

/* Structural props (unset in the shipped app; see sort-sheet.js). Tokens only. */
valt-sort-sheet .lbl { display: inline-flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; text-align: left; }
valt-sort-sheet .trail { display: inline-flex; align-items: center; gap: 10px; margin-left: 12px; flex: 0 0 auto; }
/* --text-2 on the cap is 4.13 on the tinted row: quiet is not the same as unreadable. */
valt-sort-sheet .tag { font: 600 11px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; padding: 3px 6px; border-radius: var(--r-chip); background: var(--glass-cap); color: color-mix(in srgb, var(--text-2) 60%, var(--text)); }
/* The app's own star icon (it was a ★ glyph in amber), drawn as the hero's and the list's are before
   anything is starred: an outline in the quiet ink. Filled signal means favourited (DESIGN.md), and a
   row heading names the set, it is not a favourite itself. */
valt-sort-sheet .star { display: inline-flex; color: var(--text-2); line-height: 1; }
valt-sort-sheet .read { font: 500 12px/1 var(--font); color: var(--text-2); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
valt-sort-sheet .chk { display: inline-flex; width: 16px; height: 16px; color: var(--focus-legible); visibility: hidden; }
valt-sort-sheet .opt[aria-pressed="true"] .chk, valt-sort-sheet .opt[aria-checked="true"] .chk { visibility: visible; }
valt-sort-sheet .radio { position: relative; width: 18px; height: 18px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid var(--text-2); }
valt-sort-sheet .opt[aria-pressed="true"] .radio { border-color: var(--focus); background: var(--focus); }
valt-sort-sheet .opt[aria-pressed="true"] .radio::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--focus-ink); }
valt-sort-sheet .foot .active { display: inline-flex; align-items: center; gap: 6px; }
valt-sort-sheet .foot .active b { font-weight: 600; color: var(--text); }
valt-sort-sheet .foot .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--focus); }
valt-sort-sheet .apply { display: block; flex: none; width: calc(100% - 24px); margin: 8px 12px 12px; height: var(--tap); border: 0; border-radius: 12px; cursor: pointer;
  background: var(--signal); color: var(--signal-ink); font: 600 15px/1 var(--font); letter-spacing: -.01em; -webkit-appearance: none; transition: transform var(--t-feedback) var(--ease); }
valt-sort-sheet .apply:active { transform: scale(.98); }
valt-sort-sheet .apply:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Groups, stacking filters, the search field and the row that is only a promise (sort-sheet.js kinds). */
valt-sort-sheet .grp { flex: none; padding: 12px 12px 6px; font: 600 11px/12px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
valt-sort-sheet h3 + .grp { padding-top: 8px; }
/* Grouped (sort-sheet.js sets): the group heading is the header. It holds the top of the plate while its
   own rows scroll under it, and the space above it, not a rule, is what ends the group before it. */
valt-sort-sheet .set { flex: none; }
valt-sort-sheet .set .grp { position: sticky; top: 0; z-index: 1; padding: 20px 12px 8px;
  background-image: linear-gradient(var(--glass-panel), var(--glass-panel)), linear-gradient(var(--glass-panel), var(--glass-panel)); }
valt-sort-sheet .set:first-child .grp { padding-top: 12px; }
valt-sort-sheet .set > :last-child { border-bottom: 0; }
/* Reset is a button, so it is set as one: sentence case, the rows' size. Small caps is the headings'. */
valt-sort-sheet .sheet:has(.set) .clear { min-width: var(--tap); font: 600 13px/1 var(--font); letter-spacing: -.01em; text-transform: none; }
/* The field under its row: the same height as a row, the plate's own cap as its well. */
valt-sort-sheet .q { flex: none; padding: 6px 12px 8px; border-bottom: 1px solid var(--border); }
valt-sort-sheet .qin { display: block; width: 100%; height: var(--tap); box-sizing: border-box; padding: 0 10px; border: 0; border-radius: var(--r-control);
  background: var(--glass-cap); color: var(--text); font: 500 14px/1 var(--font); letter-spacing: -.01em; -webkit-appearance: none; appearance: none; outline: 0; caret-color: var(--focus); }
valt-sort-sheet .qin::placeholder { color: var(--text-2); }
valt-sort-sheet .qin:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
valt-sort-sheet .qin::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* The control deck (layout 'deck', sort-sheet.js). The same plate and inks; the rows become controls. Selection is the sheet's own teal tint
   with a teal ring, on a segment and on a chip alike, so "one of four" and "any of six" differ by shape
   (a track of segments, a grid of tiles with counts) and not by colour. Every control is 44 tall or more.
   The wide card: the orders one track, the filters two even columns with the count at the right edge. */
valt-sort-sheet .deck .find { display: flex; align-items: center; gap: 10px; flex: none; height: var(--tap); margin: 16px 16px 4px; padding: 0 0 0 12px;
  border-radius: 12px; background: var(--glass-cap); color: var(--text-2); transition: box-shadow var(--t-feedback) var(--ease); }
valt-sort-sheet .deck .find > svg { flex: none; }
valt-sort-sheet .deck .find:focus-within { box-shadow: inset 0 0 0 2px var(--focus); }
valt-sort-sheet .deck .qin { flex: 1 1 auto; min-width: 0; height: var(--tap); padding: 0; border-radius: 0; background: transparent; font: 500 15px/1 var(--font); }
valt-sort-sheet .deck .qin:focus-visible { box-shadow: none; }
valt-sort-sheet .deck .qx { flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0; border: 0; background: transparent; color: var(--text-2); cursor: pointer; -webkit-appearance: none; }
valt-sort-sheet .deck .qx[hidden] { display: none; }
valt-sort-sheet .deck .qx:focus-visible { outline: 2px solid var(--focus); outline-offset: -6px; border-radius: 10px; }

valt-sort-sheet .deck .set .grp { position: static; padding: 18px 18px 10px; background: none; }
valt-sort-sheet .deck .opt { border-bottom: 0; }
/* One track, each order an even share of it but never narrower than its word: Recommended, A to Z,
   By country (2026-09-23). Equal thirds at 375 would cut the longest word. */
valt-sort-sheet .deck .segs { display: flex; gap: 4px; margin: 0 16px; padding: 4px; border-radius: 14px; background: var(--glass-cap); }
valt-sort-sheet .deck .segs .seg { flex: 1 1 0; }
valt-sort-sheet .deck .seg { justify-content: center; height: var(--tap); padding: 0 8px; border-radius: 10px; background: transparent; text-align: center; white-space: nowrap; font-size: 14px; }
valt-sort-sheet .deck .seg[aria-checked="true"], valt-sort-sheet .deck .chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--focus) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--focus) 55%, transparent); color: var(--text); }
valt-sort-sheet .deck .seg[aria-checked="true"] { font-weight: 600; }
valt-sort-sheet .deck .starts { display: flex; align-items: center; gap: 8px; min-height: 16px; margin: 0; padding: 10px 18px 0; font: 500 12px/16px var(--font); color: var(--text-2); letter-spacing: -.01em; }
valt-sort-sheet .deck .starts .fl { flex: none; width: 18px; height: 18px; border-radius: 50%; overflow: hidden; display: inline-grid; box-shadow: inset 0 0 0 1px var(--border); }
valt-sort-sheet .deck .starts .fl svg { width: 100%; height: 100%; }
valt-sort-sheet .deck .starts b { font-weight: 600; color: var(--text); }
valt-sort-sheet .deck .chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 18px; }
valt-sort-sheet .deck .chip { min-width: 0; justify-content: flex-start; gap: 7px; height: 52px; padding: 0 14px; border-radius: 14px; background: var(--glass-cap); font-size: 15px; }
valt-sort-sheet .deck .chip .c-l { flex: 1 1 auto; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
valt-sort-sheet .deck .chip .n { font: 600 15px/1 var(--font); color: var(--text-2); font-variant-numeric: tabular-nums; }
valt-sort-sheet .deck .chip[aria-pressed="true"] .n { color: var(--text); }
valt-sort-sheet .deck .chip .star { display: inline-flex; }
/* Hover only where there is a pointer to hover: iOS keeps :hover on the last thing tapped, which would
   paint over the teal of the segment just picked. */
valt-sort-sheet .deck .foot { padding: 0 18px; height: 52px; font-size: 13px; }
@media (hover: hover) {
  valt-sort-sheet .deck .seg:not([aria-checked="true"]):hover,
  valt-sort-sheet .deck .chip:not([aria-pressed="true"]):hover { background: color-mix(in srgb, var(--text) 12%, transparent); }
}

