/* playground.css — draft-fidelity styling for the Wave-5 view-model playground.
   Adopts the draft repo's D4 design language (tokens + component shapes for the
   top bar, file tree, editor/prose, and command palette) so the REAL headless
   view-models render the way the canonical UX (agent-native-workspace-draft)
   looks — not a bespoke dev theme. The view-model JSON inspector is preserved as
   a toggleable drawer (`◧`/"View-models" in the top bar), so "see the real
   structured output" stays one click away without dominating the app view.

   Tokens/values mirror agent-native-workspace-draft/styles.css §1–2 (D4). */

/* ---------- 0. Brand faces ----------
   The three brand faces are served from this repo, not from the Google Fonts
   CDN. Loading them over the network made the app's time-to-interactive depend
   on reaching that host: where it is unreachable — a filtered corporate network,
   an offline machine, a region that blocks it — the render-blocking stylesheet
   did not fail fast but stalled for roughly 13 seconds before giving up, and
   then fell back to system faces anyway. The app itself is ready in ~145ms.

   These are the same woff2 subsets and unicode-ranges the CDN serves, so which
   file a browser actually fetches is unchanged; only the origin moved.

   Committed subsets and licensing: playground/fonts/README.md. */

@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/newsreader-vietnamese-italic.woff2?v=0c22099d') format('woff2');
  unicode-range:
    U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
    U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/newsreader-latin-ext-italic.woff2?v=bb24f664') 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: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/newsreader-latin-italic.woff2?v=5dfcd10d') 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: 400 700;
  font-display: swap;
  src: url('/fonts/newsreader-vietnamese.woff2?v=6d0543f0') format('woff2');
  unicode-range:
    U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
    U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/newsreader-latin-ext.woff2?v=45683de0') 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: 400 700;
  font-display: swap;
  src: url('/fonts/newsreader-latin.woff2?v=6e4f2958') 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: 'Schibsted Grotesk';
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url('/fonts/schibsted-grotesk-latin-ext-italic.woff2?v=30f8012b') 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: 'Schibsted Grotesk';
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url('/fonts/schibsted-grotesk-latin-italic.woff2?v=4c72510c') 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: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/fonts/schibsted-grotesk-latin-ext.woff2?v=ee9eeb23') 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: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/fonts/schibsted-grotesk-latin.woff2?v=4c8b93f4') 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: 'Spline Sans Mono';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/spline-sans-mono-latin-ext-italic.woff2?v=f71cfdf4') 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: 'Spline Sans Mono';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/spline-sans-mono-latin-italic.woff2?v=ae4c102d') 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: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/spline-sans-mono-latin-ext.woff2?v=0ca9a398') 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: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/spline-sans-mono-latin.woff2?v=46b7dcaf') 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;
}

/* ---------- 1. Core tokens (D4 §4) ---------- */
:root {
  --space-0: 0px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --radius-0: 0px;
  --radius-1: 3px;
  --radius-2: 6px;
  --radius-3: 10px;
  /* The rung between a panel's corner and a pill. It exists for one shape
     the scale could not express: a composer that rests as a pill and grows
     into a box, where --radius-3 reads square at that height and a pill
     reads like a lozenge. */
  --radius-4: 16px;
  --radius-pill: 999px;
  --border-thin: 1px;
  --border-emphasis: 2px;
  --dur-quick: 120ms;
  --dur-standard: 200ms;
  --dur-deliberate: 360ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --font-ui: 'Schibsted Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-prose: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: 'Spline Sans Mono', 'Cascadia Code', Consolas, ui-monospace, monospace;
  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-15: 15px;
  --fs-16: 16.5px;
  --fs-18: 18px;
  --fs-22: 22px;
  --fs-28: 28px;
  --fs-34: 34px;
  --fs-36: 36px;
  --chrome-pad: var(--space-3);
  --row-pad: 7px;
  /* The floating card's place: 360px wide, 48px under the top bar, 24px from
     the right edge and 48px above the bottom. The floating agent and any panel
     that opens in the same rectangle read these. */
  --float-card-w: 360px;
  --float-card-top: calc(56px + var(--space-7));
  --float-card-bottom: var(--space-7);
  --float-card-right: var(--space-5);
  /* Stacking layers. The top bar, the docked panels and drawers that tuck
     under it so its border draws over their top edge, and the sidebar while it
     peeks: the topmost surface on the left, over a parked or full-screen
     agent, the first-launch callout and the park animation, under menus and
     dialogs. */
  --z-under-topbar: 59;
  --z-topbar: 60;
  --z-peek: 140;
}

/* ---------- 2. Theme tokens (default dark; light via [data-theme]) ---------- */
/* Evergreen dark — same derivation with a warm green-black base; status
   colors keep their dark variants, --color-agent stays the agent register. */
html,
html[data-theme='dark'] {
  color-scheme: dark;
  --color-bg: #0e1311;
  --color-surface-readable: #131a17;
  --color-surface-substrate: #191e1c;
  --color-surface-substrate-2: #222724;
  --color-surface-hover: #15221c;
  --color-surface-overlay: #1c231f;
  /* The ground shared by the three panel bodies (homepage panels, file tree,
     agent panel) and the hairline that edges them. Dark does not tint panels
     as a family — it holds the substrate value two of the three already paint,
     so the slot resolves in both themes and a surface reaching for it here
     lands on the neutral evergreen dark rather than a fallback. */
  --color-surface-panel: #191e1c;
  --color-border-panel: #294535;
  /* Chrome is OPAQUE by design: a translucent bar's rendered color depends on
     whatever happens to sit behind it, so the same element reads as different
     colors on different routes. This value is the old translucent paint as it
     rendered over the app's own surfaces, frozen solid. */
  --color-chrome: #0f1412;
  /* The navigation sidebar's ground. Dark keeps it on the deeper chrome step;
     light puts it on the reading surface's white. One token rather than a
     per-theme background rule, because the sidebar's sticky footer has to
     paint the same ground over the rows scrolling under it, and a theme rule
     on the footer would outrank its hover. */
  --color-surface-nav: #0f1412;
  --color-text-default: #e8efe9;
  --color-text-muted: #abb1ad;
  --color-text-faint: #868c88;
  --color-text-invert: #0e1311;
  /* Dark linework is green-tinted rather than neutral grey: every hairline
     (panel outlines, dividers) carries the brand hue
     while the surfaces themselves stay the neutral evergreen darks. */
  --color-border-default: #294535;
  --color-border-strong: #45705a;
  --color-accent: #5fb98a;
  --color-accent-strong: #78c39b;
  --color-accent-soft: #17251e;
  --color-accent-soft-2: #1f362a;
  --color-success: #5fd08e;
  --color-success-soft: #14261c;
  --color-success-soft-2: #1c3a29;
  --color-warn: #e9bb62;
  --color-warn-dot: #e9b14a;
  --color-warn-soft: #2a2113;
  --color-warn-soft-2: #3b2f1a;
  --color-danger: #f0918a;
  --color-danger-soft: #2e1a18;
  --color-danger-soft-2: #43221f;
  --color-agent: #51b7ec;
  --color-agent-soft: #012638;
  --color-agent-soft-2: #023248;
  --color-agent-strong: #86cbf3;
  /* The two translucent tiers of the register. They are alpha over whatever
     they sit on rather than opaque mixes, because both land on surfaces that
     are themselves variable — a wash behind inline code inside a message, a
     hairline down the side of a nested run — and an opaque tint picked for one
     ground shows as a patch on the next. */
  --color-agent-wash: rgba(81, 183, 236, 0.13);
  --color-agent-edge: rgba(81, 183, 236, 0.45);
  /* The mark's own blue — the one agent value that does not change with the
     theme. The logo wears it on every ground, so it is pinned identically in both
     blocks. */
  --color-agent-mark: #51b7ec;
  /* A creation's score, in five bands on Steam's thresholds (0–39, 40–69,
     70–79, 80–94, 95 up), worn by the rating mark beside the percentage. Dark
     builds them from the status colours; light pins its own, because light
     warn is an amber-brown that does not read as yellow. Pinned in both, like
     warn: they do not track a custom accent. Light yellow sits near 2:1 on
     white, under the 3:1 a glyph wants — accepted only because the number is
     printed beside it. */
  --color-rating-1: var(--color-danger);
  --color-rating-2: color-mix(in oklch, var(--color-danger) 50%, var(--color-warn));
  --color-rating-3: var(--color-warn);
  --color-rating-4: color-mix(in oklch, var(--color-warn) 50%, var(--color-success));
  --color-rating-5: var(--color-success);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.32), 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.42), 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 4px 12px rgba(0, 0, 0, 0.5), 0 24px 64px rgba(0, 0, 0, 0.6);
  /* A barely-there lift for a dialog asked in place, where the surface behind
     should stay readable: one soft layer at ~6% ink, no far shadow. */
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.06);
  --scrim: rgba(3, 6, 14, 0.55);
  --code-bg: #171c1a;
  --btn-accent-bg: #2e7d5b;
  --btn-accent-text: #ffffff;
}
/* "Evergreen" is the default light palette: the four base colors
   (#ffffff / #ffffff / #20312a / #2e7d5b) resolved through the draft's
   custom-theme color-mix derivation. --color-agent (agent register) and
   --color-warn (attention/conflict) are PINNED — they don't track the accent. */
html[data-theme='light'] {
  color-scheme: light;
  --color-bg: #ffffff;
  --color-surface-readable: #ffffff;
  --color-surface-substrate: #ecece8;
  --color-surface-substrate-2: #e4e4e0;
  --color-surface-hover: #e5ebe4;
  --color-surface-overlay: #f6f7f6;
  /* The light step of the green ladder, and the hairline that edges it. Light
     is where these earn their name: one tint unifies the three panel bodies
     that the dark theme leaves on their separate neutral grounds. */
  --color-surface-panel: #cfe0d2;
  /* A real value, not a self-reference: `var(--color-border-panel)` here was a
     custom-property cycle, which is invalid at computed-value time — every
     light-theme consumer silently fell back to currentColor. */
  --color-border-panel: #8fb29a;
  /* Opaque for the same reason as the dark theme's chrome: an element's color
     must not change with the route behind it. */
  --color-chrome: #ffffff;
  --color-surface-nav: #ffffff;
  --color-text-default: #20312a;
  --color-text-muted: #5c6862;
  --color-text-faint: #818a84;
  --color-text-invert: #f7f6f2;
  --color-border-default: #dddeda;
  --color-border-strong: #c3c7c2;
  --color-accent: #2e7d5b;
  --color-accent-strong: #246448;
  --color-accent-soft: #e1e9e1;
  --color-accent-soft-2: #cdddd2;
  --color-success: #136b39;
  --color-success-soft: #cfe6d7;
  --color-success-soft-2: #a9d2ba;
  --color-warn: #8a5a00;
  --color-warn-dot: #b87d0a;
  --color-warn-soft: #f7dfb2;
  --color-warn-soft-2: #e9c67e;
  --color-danger: #b4271f;
  --color-danger-soft: #fad5cf;
  --color-danger-soft-2: #f0b1a7;
  /* Deeper than the dark theme's instance, and deeper than the #019fdc this
     replaced: that value sat at 3.00:1 on white, under the 4.5:1 body text
     needs and under the 3:1 a glyph or hairline needs as well. This one is
     3.4:1 — enough for the marks and small semibold labels that carry the
     register, which is why blue still never takes running prose. */
  --color-agent: #1a93d4;
  --color-agent-soft: #e4f2fb;
  --color-agent-soft-2: #cce6f7;
  --color-agent-strong: #015a7f;
  /* Same two translucent tiers as the dark block, mixed from this theme's own
     instance so a wash or a hairline carries the blue the surface around it is
     already using. */
  --color-agent-wash: rgba(26, 147, 212, 0.1);
  --color-agent-edge: rgba(26, 147, 212, 0.4);
  /* The mark's own blue — the one agent value that does not change with the
     theme. The logo wears it on every ground, so it is pinned identically in both
     blocks. */
  --color-agent-mark: #51b7ec;
  /* The score bands, pinned to their own light values: see the dark block. */
  --color-rating-1: #d8321f;
  --color-rating-2: #ee7c12;
  --color-rating-3: #e6b400;
  --color-rating-4: #82ad1f;
  --color-rating-5: #2a9150;
  --shadow-1: 0 1px 2px rgba(19, 29, 54, 0.04), 0 2px 8px rgba(19, 29, 54, 0.06);
  --shadow-2: 0 2px 6px rgba(19, 29, 54, 0.06), 0 8px 24px rgba(19, 29, 54, 0.1);
  --shadow-3: 0 4px 12px rgba(19, 29, 54, 0.1), 0 24px 64px rgba(19, 29, 54, 0.18);
  --shadow-soft: 0 2px 8px rgba(19, 29, 54, 0.06);
  --scrim: rgba(19, 29, 54, 0.32);
  --code-bg: #eeeeea;
  --btn-accent-bg: #2e7d5b;
  --btn-accent-text: #ffffff;
}

* {
  box-sizing: border-box;
}
/* Slim themed scrollbars, everywhere anything scrolls: pill thumb on a
   transparent track, accent under the cursor. WebKit pseudo-elements only —
   the standard scrollbar-width/color properties are deliberately NOT set,
   because Chromium disables ::-webkit-scrollbar styling when either is, which
   would discard the pill and the hover accent. Firefox keeps its native bar. */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}
::-webkit-scrollbar-corner {
  background: transparent;
}
img,
svg {
  display: block;
} /* draft parity — kills inline-SVG baseline gap */
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--color-bg);
  color: var(--color-text-default);
  font-family: var(--font-ui);
  font-size: var(--fs-14);
  -webkit-font-smoothing: antialiased;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.app {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  min-height: 0;
}

/* ---------- 2a. The `hidden` attribute ----------
   An author `display` outranks the browser's own rule for `[hidden]`, so a class
   that sets one would keep showing after the renderer hides it. This is
   Tailwind's preflight rule: the attribute wins for every element, and no rule
   below needs its own. `guard:hidden` keeps it here and keeps any rule from
   giving a `[hidden]` selector a `display`. */
[hidden]:where(:not([hidden='until-found'])) {
  display: none !important;
}

/* ---------- 2b. Component canon ----------
   One declaration site per component family, shared by every surface that uses
   it. A surface adds only what is genuinely its own, in its own section further
   down, so a family cannot fork into two full copies that then drift apart.

   This block sits ABOVE the surface sections deliberately: everything below can
   still override it, which is what makes "canon here, delta there" work. Put a
   new shared body here rather than next to the surface you happen to be editing
   — a second copy beside a surface is how every duplicate collapsed below began.

   Which family a component belongs to, the variants each family has and the
   ladders they obey are in docs/architecture/component-standards.md. Live
   specimens in both themes are in playground/reference/components.html, an
   index of one page per component type drawn with these same class names.

   Every family's declaration site starts with a comment opening `Fnn <family>`
   — here for the shared ones, beside their surface for the rest. That opening
   is the map from family to selectors, so it is kept at the start of the
   comment and every one of the families has at least one. */

/* F01 empty state, centered variant — the box for "this whole pane is empty".
   The icon, title and copy inside it stay with their surface; only the box is
   shared. Whether the box also STRETCHES to fill its parent is a fact about the
   parent rather than about the empty state, so no flex is set here: the two
   surfaces that need it set it themselves. */
.chat-empty,
.feed-empty,
.dsc-end,
.dsc-empty,
.srf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-7) var(--space-5);
  color: var(--color-text-faint);
  font-size: var(--fs-13);
  text-align: center;
}

/* F01 empty state, the variant that can be acted on. An empty surface used to
   be one line of faint text in a DASHED box with no action at all — dashed
   being reserved for real drop targets, so it was spending the one border that
   means "put something here" on a surface where nothing can be dropped.

   This is the boxed callout with the parts F01 already names — icon, title,
   copy — plus the action row that makes it useful. The geometry comes from the
   canon container above; only the box and the actions are declared here.

   Accent DOES appear in this family now. F01 used to forbid it on the grounds
   that an empty state is where there is nothing to act on, which stopped being
   true the moment these carried a real primary action. */
.srf-empty {
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
}
.srf-empty-icon {
  display: grid;
  color: var(--color-text-muted);
}
.srf-empty-title {
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--color-text-muted);
}
.srf-empty-copy {
  font-size: var(--fs-13);
  color: var(--color-text-faint);
  max-width: 44ch;
}
.srf-empty-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}
/* F04 default size, secondary emphasis. Written here rather than borrowed from
   the dialog button because a dialog button is a dialog's, and the padding
   comes from F04's table rather than from a 17th recipe. */
.srf-empty-act {
  padding: var(--row-pad) var(--space-4);
  border-radius: var(--radius-2);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
  border: var(--border-thin) solid var(--color-border-default);
  background: transparent;
  color: var(--color-text-default);
}
.srf-empty-act:hover {
  border-color: var(--color-border-strong);
}
.srf-empty-act--primary {
  background: var(--btn-accent-bg);
  border-color: transparent;
  color: var(--btn-accent-text);
}
.srf-empty-act--primary:hover {
  opacity: 0.9;
}
/* Filtered to nothing is NOT the same surface as empty. The container holds
   things; a query is hiding them. So it gets a slim strip with the one action
   that undoes the query, rather than the centred panel's icon, headline and
   invitation to create something — which would be answering a question the
   reader did not ask. */
.srf-empty--slim {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  text-align: left;
}
.srf-empty--slim .srf-empty-title {
  font-weight: 400;
}

/* F07 badge, soft-tone variant — the thumb a post's author gave the creation,
   wherever a post is shown. Two tones and no third: a post whose author rated
   nothing renders no badge at all rather than a neutral one, because "this
   shows you what the thing does" is not a lukewarm recommendation and must not
   read as one.

   Read-only in both places. A reader cannot set a thumb by pressing it, which
   is what keeps it a badge rather than a chip. */
.dsc-verdict {
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--fs-11);
  font-weight: 600;
}
.dsc-verdict.is-up {
  background: var(--color-success-soft);
  color: var(--color-success);
}
.dsc-verdict.is-down {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

/* F07 badge, label variant, neutral — "Snapshot" on a page captured from a
   website, "Snapshot · edited" once it no longer matches the capture. It leads
   the page's controls in the top bar. Neutral because it classifies without
   judging: a snapshot is neither good nor bad news. The substrate tint alone
   would vanish against the bar, so it takes the default hairline as its edge.
   Never interactive. */
.html-page-badge {
  flex: none;
  padding: 2px var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  background: var(--color-surface-substrate);
  color: var(--color-text-muted);
  font-size: var(--fs-11);
  font-weight: 600;
  white-space: nowrap;
}

/* F21 activity signal — the one visual language for "the machine is working",
   drawn in the mark's layering: green, blue, green. Four families, built by
   playground/src/signals.js; the stylesheet owns colour and motion so the
   signals follow the theme and freeze under reduced motion like everything
   else. Durations are literal on purpose: the app's timing tokens cap at
   360ms and these are 2.6–3s cycles, not transitions.

   The breath is a SPOT ("the agent is doing something") — inline beside a
   label, on the worked-on thing, ~14–44px only. The wave is a STRIP ("this
   place is being prepared") — a pane or panel first load, a route
   transition, a long import. The orbit is large loading, where the breath
   would read as static. The pulse dot is the fallback for a slot too small
   for the breath. Activity colours only the indicator, never the chrome
   around it. */
.srf-signal-human {
  stroke: var(--color-accent);
}
.srf-signal-machine {
  stroke: var(--color-agent);
}
/* The breath: restoration ripples outward from the core, all three rings hold
   lit together, then the fade travels back inward (outer first) to a 0.35
   floor so the rested state stays visible. 2.6s — the slower 3.4s cycle was
   tried and ruled out. */
.srf-breath {
  display: inline-block;
  flex: none;
  vertical-align: middle;
}
.srf-breath-r1 {
  animation: srf-breath-inner 2.6s linear infinite;
}
.srf-breath-r2 {
  animation: srf-breath-mid 2.6s linear infinite;
}
.srf-breath-r3 {
  animation: srf-breath-outer 2.6s linear infinite;
}
@keyframes srf-breath-inner {
  0% {
    opacity: 0.35;
  }
  8% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  83% {
    opacity: 0.35;
  }
  100% {
    opacity: 0.35;
  }
}
@keyframes srf-breath-mid {
  0% {
    opacity: 0.35;
  }
  10% {
    opacity: 0.35;
  }
  18% {
    opacity: 1;
  }
  65% {
    opacity: 1;
  }
  73% {
    opacity: 0.35;
  }
  100% {
    opacity: 0.35;
  }
}
@keyframes srf-breath-outer {
  0% {
    opacity: 0.35;
  }
  20% {
    opacity: 0.35;
  }
  28% {
    opacity: 1;
  }
  55% {
    opacity: 1;
  }
  63% {
    opacity: 0.35;
  }
  100% {
    opacity: 0.35;
  }
}
/* The uniform orbit: three tri-line arcs with rounded travelling ends, all
   rotating together clockwise. Counter-rotation and the infinity flow were
   tried and ruled out. */
.srf-orbit {
  display: inline-block;
  flex: none;
}
.srf-orbit circle {
  transform-origin: 30px 30px;
  animation: srf-orbit-spin 3s linear infinite;
}
@keyframes srf-orbit-spin {
  to {
    transform: rotate(360deg);
  }
}
/* The loading wave: the strip clips, the two-period tri-line inside slides
   one period per cycle, so the loop is seamless. The strip takes the width
   its host gives it. */
.srf-loading-wave {
  overflow: hidden;
  width: 100%;
  max-width: 320px;
  height: 40px;
  border-radius: var(--radius-2);
}
.srf-loading-wave-line {
  display: block;
  width: 200%;
  height: 100%;
  animation: srf-loading-wave-slide 2.6s linear infinite;
}
@keyframes srf-loading-wave-slide {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
/* The pulse dot: the tiny-slot fallback, an agent-blue dot breathing in
   opacity on the same cycle as the breath's floor. */
.srf-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-agent);
  flex: none;
  animation: srf-pulse 2.6s linear infinite;
}
@keyframes srf-pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  30%,
  70% {
    opacity: 1;
  }
}
/* The still dots: the breath's slot when the machine is NOT working. Warn for
   needs-you (blocked on the person — the stillness itself signals the stop),
   danger for failed. Same 8px as the pulse dot, and never animated. */
.srf-still-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.srf-still-dot--warn {
  background: var(--color-warn-dot);
}
.srf-still-dot--danger {
  background: var(--color-danger);
}
/* First-time placeholders pair a signal with a label. Inline: the breath
   beside the words. Centred: the wave strip over the words, for a place
   being prepared. The boot splash in index.html wears the same classes with
   the orbit, so there is one loading language to keep in tune. */
.srf-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--fs-13);
}
.srf-loading--center {
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-7) var(--space-5);
}
.srf-boot {
  min-height: 100vh;
}
/* Reduced motion freezes everything to its lit state: the breath to all rings
   lit, the orbit to full static rings, the wave to the still tri-line, the
   dot to solid. */
@media (prefers-reduced-motion: reduce) {
  .srf-breath-r1,
  .srf-breath-r2,
  .srf-breath-r3,
  .srf-orbit circle,
  .srf-loading-wave-line,
  .srf-pulse-dot {
    animation: none;
    opacity: 1;
  }
  .srf-orbit circle {
    stroke-dasharray: none;
  }
}

/* F03 key/value data row — one label and its value in a vertical list of facts
   about a single object (a package manifest, a skill's fields). A record, not a
   list item: nothing here is selectable. The key and value spans keep their own
   rules per surface, because how a value wraps depends on how long it gets. */
.mp-manifest-row,
.skills-field-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 3px 0;
  font-size: var(--fs-12);
}

/* F22 pager dots — show position in a set, and let the reader jump to a member
   of it. A 6px mark inside a 16px target, so the hit area clears the pointer
   minimum without the marks crowding each other.

   The marks are NOT the accent. Accent means "you can act on this"; a position
   indicator states where you are, and painting it accent would promise an
   action the set does not offer.

   FIVE marks, and five whenever the set has at least that many. The row does not
   grow in from the ends: past five members it stops growing and starts sliding.
   The window is centred on the active mark and then pulled back inside the set,
   so the active mark rides the middle through the body of the set and walks to
   the end of the row at either end, where there is nothing left to centre
   against.

   A mark at the edge of the window is 4px ONLY when more of the set lies past
   it. That is what makes the size mean something rather than mark a fixed offset
   — a small mark says "it continues this way", so the row stays honest at the
   start and the end, where one side continues and the other does not. Which
   marks are in the window, and which carry the small size, is decided by the
   renderer; this block only paints the three states.

   Borderless, so no press-dip: a bare mark that shifted under the pointer would
   read as jitter rather than as a press. */
.dsc-dot {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.dsc-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-border-strong);
  transition:
    background var(--dur-quick) var(--ease-out),
    width var(--dur-quick) var(--ease-out),
    height var(--dur-quick) var(--ease-out);
}
.dsc-dot.is-edge::before {
  width: 4px;
  height: 4px;
}
.dsc-dot:hover::before {
  background: var(--color-text-muted);
}
.dsc-dot.is-on::before {
  background: var(--color-text-default);
}

/* F23 text link — a word in chrome that goes somewhere, drawn as a link rather
   than as a control. No fill, no border, no padding box: it costs the row it
   sits in no vertical space, which is why chrome reaches for it where a button
   would force the bar taller.

   Accent AND underlined at rest, both. Colour alone is not an affordance — a
   reader who cannot separate the accent from the ink has only the underline to
   tell them the word is a link, and every one of these sits among text that is
   not. A surface that has another reason to withhold the resting underline says
   so with its own rationale.

   Borderless and unfilled, so the family is deliberately absent from the
   `srf-press-dip` block: there is no raised object here to dip. `text-align`
   is set because these are `<button>` elements, which centre their text — the
   element is a button only because the destination is in-app and there is no
   href to hang on an anchor. */
.ctx-link {
  padding: 0;
  border: 0;
  background: none;
  font-size: var(--fs-12);
  font-weight: 400;
  text-align: left;
  color: var(--color-accent);
  text-decoration: underline;
  cursor: pointer;
}
.ctx-link:hover {
  color: var(--color-accent-strong);
}
/* The ring the rest of the app draws. It is the accent rather than the agent
   blue on purpose: the agent register marks what the machine owns, and where
   the keyboard is sitting is the reader's own business. */
.ctx-link:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}

/* F28 embed frame — the one frame every embed in a note is drawn in: an HTML
   page (.embed-page), a live site or a provider's player (.embed-web-live), and
   the card a site that cannot be shown live gets instead (.embed-web). Built by
   embed-frame.js. Note transclusions keep their own look (.embed-transclusion);
   this family covers what is framed, not what is quoted.

   A header row on the substrate — a 16px icon, the name, one F23 action at the
   right — over a body. The name gives way first: it ellipsizes, with the whole
   of it on hover, while the action never truncates. Below 420px of frame width
   an action with a short form ("Open in browser ↗" → "Open ↗") shows it; the
   accessible name stays the long one. The body is flush for a frame, so the
   page or site meets the hairline with nothing between; a card or a message
   takes the padded body.

   Heights are set where each body is built and apply at once — a page that
   reports several heights as it builds would wobble the note if each were
   eased. Nothing here is pressed but the action, which is F23 and answers a
   press with nothing; a card's Try live is F04 compact in the press block's
   open bucket. */
.embed-frame {
  margin: 0.6em 0;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  overflow: hidden;
  background: var(--color-surface-readable);
  font-family: var(--font-ui);
  container-type: inline-size;
}
.embed-frame-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-readable);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.embed-frame-icon {
  display: grid;
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}
.embed-frame-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.embed-frame-action {
  flex: none;
  white-space: nowrap;
}
.embed-frame-action-short {
  display: none;
}
@container (max-width: 419px) {
  .embed-frame-action-long {
    display: none;
  }
  .embed-frame-action-short {
    display: inline;
  }
}
.embed-frame-body {
  position: relative;
}
/* The ground a live frame sits on until it has loaded, so the wave over it
   reads as a place being prepared rather than a blank box. */
.embed-frame-body.is-loading {
  background: var(--color-surface-substrate);
}
.embed-frame-body--padded {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
}
.embed-frame-message {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.embed-frame-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.embed-frame-loading .srf-loading {
  font-size: var(--fs-12);
}
/* The card's parts: the site's title, two lines at most; its address on one;
   and the line saying why it is not live, with Try live at its right when the
   check could not say. With no title the address takes the title's line, at
   the body weight. */
.embed-card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--color-text-default);
}
.embed-card-title.is-address {
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 400;
}
.embed-card-address {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.embed-card-foot {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.embed-card-reason {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
/* F04 compact, secondary emphasis. */
.embed-card-try {
  flex: none;
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
}
.embed-card-try:hover {
  border-color: var(--color-border-strong);
}
.embed-card-try:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------- A3 — workspace re-levelling: the folder page and what it lists ----------
   One contiguous region for every rule the workspace re-levelling adds to the
   canon, in the order the design reference lists them. Each slice appends here
   rather than opening a region of its own, so the region stays reviewable as
   one piece and each property family keeps a single order. Starts at this
   comment; ends at the "end of A3" marker below. */

/* F23 content kind of the workspace surface — the folder page's body under the
   editor's own top bar. The bar is `.editor-topbar` exactly as a document uses
   it: the path trail (`.doc-crumbs`) at its left, the page's controls at its
   right. Only the body is new, and it is the pane's scroller. */
.editor-pane > .folder-page {
  overflow: auto;
  min-height: 0;
}
.folder-page {
  padding: var(--space-5);
  min-width: 0;
}
/* The run of empty bar between the trail and the controls at its right. */
.folder-pane .folder-bar-grow {
  flex: 1 1 auto;
}
/* On the page, the search's scope and mode chips sit on the listing's own
   left edge rather than the sidebar's inset they were drawn for, with a step
   of air before the results. */
.folder-page .tree-search-scope {
  margin-left: 0;
}
.folder-page .tree-search-modes {
  padding-left: 0;
  padding-bottom: var(--space-3);
}
/* F15 page title: the UI face, never the prose face — folder names are
   filesystem names, and a slug like notes_2024-v2 reads wrong in Newsreader.
   One line; the full path is always in the trail above. The agent page's
   title is the same heading: an item's name is a file's name too. */
.folder-page-title,
.agentpg-title {
  margin: 0;
  font-size: var(--fs-22);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text-default);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-page-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
/* The folder's own description under its title — the line its row shows in
   the parent, at body size, before the counts. */
.folder-page-desc {
  margin: var(--space-1) 0 0;
  font-size: var(--fs-13);
  line-height: 1.45;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}
/* The description pencil on a folder row or tile — the workspace card's
   bare-glyph pencil — shown where the pointer or the keyboard is, so a long
   listing is not a column of pencils. The page header's own stays visible. */
.folder-desc-pencil {
  opacity: 0;
}
.folder-row:hover .folder-desc-pencil,
.folder-row:focus-within .folder-desc-pencil,
.folder-tile:hover .folder-desc-pencil,
.folder-tile:focus-within .folder-desc-pencil,
.folder-desc-pencil:focus-visible {
  opacity: 1;
}
/* The tile is one fixed height: the pencil's hit target hangs over the top
   line rather than making it taller and pushing the second line out. */
.folder-tile-top .folder-desc-pencil {
  margin-block: calc(var(--space-1) * -1);
  margin-left: auto;
}
/* The card's description editor, opened under a row or in a tile. Doubled
   with the card's own class, which is declared later in the sheet. */
.pcard-desc-edit.folder-desc-edit {
  margin: 0 0 var(--space-2);
  padding: 0 var(--space-2);
}
.folder-grid > .pcard-desc-edit.folder-desc-edit {
  grid-column: 1 / -1;
  padding: 0;
}
.pcard-desc-edit.folder-page-desc-edit {
  margin: var(--space-2) 0 0;
  max-width: 640px;
}
/* "4 folders · 11 files" / "Empty". */
.folder-page-meta {
  margin: var(--space-1) 0 var(--space-4);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}

/* F23 breadcrumb trail, its first step — "Workspaces", the way to the container
   root. Told apart from the path it heads: accent and 600 in both themes, and
   no underline even on hover (the rest of the trail underlines on hover). It is
   the one step allowed above the workspace clamp. */
.doc-crumbs .crumb-link.crumb-root {
  color: var(--color-accent);
  font-weight: 600;
}
.doc-crumbs .crumb-link.crumb-root:hover {
  color: var(--color-accent-strong);
  text-decoration: none;
}

/* F02 selectable list row, default density — the folder page's rows view. */
.folder-rows {
  display: flex;
  flex-direction: column;
}
.folder-rows-head,
.folder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  align-items: center;
  column-gap: var(--space-4);
}
/* Sticky inside the pane's own scroller, so at 300 rows the columns stay
   named. The ground is the pane's, so rows slide under an opaque header. */
.folder-rows-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: var(--space-1) var(--space-2);
  background: var(--color-surface-readable);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
/* A sortable column header. Toggle bucket: it paints its own new state, the
   arrow and the ink. `aria-sort` on the active one. Folders stay above files
   under every sort. */
.folder-sort {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) 0;
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-text-faint);
}
.folder-sort:hover,
.folder-sort[aria-sort='ascending'],
.folder-sort[aria-sort='descending'] {
  color: var(--color-text-default);
}
.folder-sort--end {
  justify-self: end;
}
/* The row owns padding, radius and every state. Open bucket: it joins the
   press block's "open: tints" list. */
.folder-row {
  padding: var(--row-pad) var(--space-2);
  border-radius: var(--radius-2);
  border-bottom: var(--border-thin) solid var(--color-border-default);
  color: var(--color-text-default);
  cursor: pointer;
}
.folder-row:hover {
  background: var(--color-surface-hover);
}
.folder-row:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: -2px;
}
/* Files dragged in from the computer land in that folder: the same accent
   ring the tree's folder rows and the cards use. */
.folder-row.is-drop-target {
  background: var(--color-surface-hover);
  box-shadow: inset 0 0 0 1.5px var(--color-accent);
}
.folder-row-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  font-size: var(--fs-13);
}
.folder-row-glyph {
  flex: none;
  display: inline-flex;
  color: var(--color-text-faint);
}
.folder-row.is-folder .folder-row-glyph {
  color: var(--color-accent);
}
.folder-row-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-row.is-folder .folder-row-label {
  font-weight: 600;
}
/* A folder's description rides after its name on the same line and gives
   way first: a basis of 0 means it takes only what the name leaves, so a
   90-character name shows no description at all rather than a clipped name. */
.folder-row-desc {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.folder-row-desc::before {
  content: '—';
  margin-right: var(--space-2);
  color: var(--color-text-faint);
}
.folder-row-when {
  justify-self: end;
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* F13 bare input — renaming in place. The name becomes the field; what is
   wrong with a name sits under the row. */
.folder-row-rename {
  flex: 1;
  min-width: 0;
  padding: 2px var(--space-2);
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-13);
}
.folder-row-rename:focus {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.folder-rename-error {
  padding: var(--space-1) var(--space-2) 0 32px;
  font-size: var(--fs-12);
  color: var(--color-danger);
}
.folder-rename-error:empty {
  display: none;
}

/* F05 icon button pair — the grid/rows toggle. Two `.icon-btn`s side by side,
   each with `aria-pressed`, the pressed one wearing `.is-on`. Toggle bucket: it
   must not kick, so the press block's bare-glyph rule skips anything carrying
   `aria-pressed`. Absent on the Workspaces page rather than disabled there. */
.folder-view-toggle {
  display: flex;
  gap: 1px;
}

/* F10 card, light variant — the folder page's grid view. Drive's grid:
   "Folders" then "Files" under F15 group labels, compact tiles of one fixed
   height, no thumbnails, because nothing produces a preview. */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
  gap: var(--space-3);
}
.folder-group {
  grid-column: 1 / -1;
  margin-top: var(--space-2);
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--color-text-faint);
}
.folder-group:first-child {
  margin-top: 0;
}
/* Hairline, readable ground, no shadow — quieter than the lifted workspace
   cards on the Workspaces page. Open bucket: joins "open: tints". */
.folder-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  height: 56px;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  background: var(--color-surface-readable);
  cursor: pointer;
  transition: border-color var(--dur-quick) var(--ease-out);
}
.folder-tile:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-hover);
}
.folder-tile:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
.folder-tile.is-drop-target {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
.folder-tile-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.folder-tile-glyph {
  flex: none;
  display: inline-flex;
  color: var(--color-text-faint);
}
.folder-tile.is-folder .folder-tile-glyph {
  color: var(--color-accent);
}
.folder-tile-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-13);
  color: var(--color-text-default);
}
.folder-tile.is-folder .folder-tile-label {
  font-weight: 600;
}
/* The second line: the description cascade for a workspace, an item count for a
   plain folder, the last-touched date for a file. Indented to the label. */
.folder-tile-sub {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 24px;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.folder-tile-sub.is-meta {
  color: var(--color-text-faint);
}

/* F10 card, content variant — the workspace card, `.workspace-card` promoted one
   level. Front: the name, the description pencil and the flip, and no mark: a
   user-chosen icon per workspace comes later. Back: the whole description
   scrolls, and the strip (files · last touched) is pinned below
   it so the numbers never scroll out of the one-height card. No delete on the
   back — rename and delete live on the card's context menu. */
.workspace-card.is-workspace .pcard-details {
  flex: 1 1 auto;
}
.workspace-card.is-workspace .pcard-back > .stat-strip {
  flex: none;
}

/* The New control: F04 primary (.home-new-workspace-btn, which already recesses
   in the press block) plus a leading plus glyph. The same class on the folder
   page's bar and on the Workspaces page's New workspace. Press: Open, drawn as
   the filled-accent recess. On the bar it sits at the right of the grid/rows
   toggle; its menu is the shipped .ctx-menu. */
.new-control {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding-left: var(--space-3);
}
.new-control > .icon {
  display: flex;
}
.editor-topbar > .new-control {
  margin-left: var(--space-2);
}

/* The tree's folder row, split in two. The chevron is its own F05 compact
   button (24px) holding aria-expanded — Toggle bucket, nothing on press — and
   on hover it only brightens, with no ground of its own. The rest of the row
   is the link to the folder's page: a click there navigates and opens the
   folder, never shuts it (Open bucket, via the row's own hover ground). The
   row's own padding and gap make room for the chevron's hit target, in the
   tree's section below. */
.tree-folder-row > .t-chevron-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-faint);
  cursor: pointer;
  transition: color var(--dur-quick) var(--ease-out);
}
.tree-folder-row > .t-chevron-btn:hover {
  color: var(--color-text-default);
}
.tree-folder-row > .t-chevron-btn > .t-chevron {
  display: inline-flex;
}
.tree-folder-row > .t-name-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  overflow: hidden;
}
/* The folder page you are on: F02 selected — accent-soft ground, accent ink,
   no weight change (folder rows are already 600). */
.tree-folder-row.is-current {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

/* F25 Segmented control — the one declaration. A track of two to four
   segments answering one question, at most one checked; every member is built
   by playground/src/ui-segmented.js, which owns the radio-group semantics, the
   arrow keys and the single tab stop. Members: the tree search's scope
   (.tree-search-scope), the PDF sidebar's Bookmarks | Pages (.pdf-sidebar-seg,
   --fill), the new-file dialog's format (.srf-dialog-formats, --lg) and every
   settings picker — theme, file visibility, document properties,
   Models' Default type (--lg) — an installed agent's Updates (.agentpg-updates, --vertical) and an
   HTML page's Rendered | Source | Mirror (.html-page-modes) — and an agent's
   Starts as (.agentpg-starts-seg, --lg) — and the model menu's Anthropic row,
   Key | Subscription (.fmenu-billing, default).
   A member's own class places the track and nothing else. The track is a grey
   atom; the checked answer is one white thumb, raised, that slides between
   segments as the answer changes. Toggle bucket — the thumb is the answer, so
   the press block lists none of them. */
.seg {
  position: relative;
  display: inline-flex;
  /* Sized to its labels even as a grid item, which stretches by default. */
  justify-self: start;
  max-width: 100%;
  /* The thumb sits 1px in from the track's edge. */
  padding: 1px;
  gap: 2px;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate);
}
.seg-btn {
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  min-width: 0;
  padding: 1px var(--space-2);
  border: none;
  border-radius: var(--radius-1);
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: var(--fs-11);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--dur-quick) var(--ease-out),
    color var(--dur-quick) var(--ease-out);
}
.seg-btn:hover {
  color: var(--color-text-default);
}
.seg-btn[aria-checked='true'] {
  color: var(--color-text-default);
  font-weight: 600;
}
/* The checked answer: a small white surface behind its segment, placed and
   slid by the renderer from the segment's laid-out box. Its radius is the
   track's less the 1px it sits in by, so the two corners are concentric; the
   inset hairline carries it in the dark theme, where the surface sits close to
   the track. Hidden until the renderer has measured it. */
.seg-thumb {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  border-radius: calc(var(--radius-2) - 1px);
  background: var(--color-surface-readable);
  box-shadow:
    var(--shadow-1),
    inset 0 0 0 var(--border-thin) var(--color-border-default);
  pointer-events: none;
}
/* Placed, shown and slid by ui-segmented.js through an animation that holds
   its end (180ms on --ease-out, none under reduced motion), so its place never
   becomes markup. */
.seg-btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: default;
}
/* Fill: the segments share the track's width — a track that is the width of
   the panel it heads, where a short track would leave the panel ragged. */
.seg--fill {
  display: flex;
  justify-self: stretch;
}
.seg--fill > .seg-btn {
  flex: 1 1 0;
}
/* Page scale: a form control in the settings page or a dialog, set at the
   size of the text and buttons around it rather than at panel-chrome size. */
.seg--lg > .seg-btn {
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-13);
}
/* Form: the same track drawn from radio inputs and labels, so a form posts the
   choice with no script (the website's account page). The checked label wears
   the thumb's surface itself, since there is no script to slide one. */
.seg--form > .seg-opt {
  position: relative;
  display: flex;
}
.seg-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.seg--form .seg-btn {
  display: flex;
  align-items: center;
}
.seg-input:checked + .seg-btn {
  color: var(--color-text-default);
  font-weight: 600;
  background: var(--color-surface-readable);
  box-shadow:
    var(--shadow-1),
    inset 0 0 0 var(--border-thin) var(--color-border-default);
}
.seg-input:focus-visible + .seg-btn {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
/* Vertical: the segments stacked, each the track's width and read from its
   left edge — for answers too long to sit side by side in a narrow margin,
   such as an installed agent's Updates. A track that cannot be changed right
   now is `aria-disabled` and takes no pointer. */
.seg--vertical {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-self: stretch;
}
.seg--vertical > .seg-btn {
  padding: var(--space-1) var(--space-2);
  text-align: left;
}
.seg[aria-disabled='true'] {
  pointer-events: none;
}

/* The tree search's scope: on its own row above the mode chips, sized to its
   labels and left-aligned — a different shape from the chips below it on
   purpose: it answers where, they answer what. */
.tree-search-head {
  display: flex;
  flex-direction: column;
}
.tree-search-scope {
  align-self: flex-start;
  max-width: calc(100% - 2 * var(--space-3));
  margin: var(--space-2) var(--space-3) 0;
}

/* ---------- end of A3 ---------- */

/* ---------- 3. Top bar (draft §250–545) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  background: var(--color-chrome);
  backdrop-filter: blur(14px);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 56px;
  padding: 0 var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  /* The horizontal lockup's gap is 6px beside the mark, tighter than the
     bar's default name gap: one hairline step above the scale's smallest
     stop. */
  gap: calc(var(--space-1) + 2px);
  padding: 4px 6px;
  border-radius: var(--radius-2);
  cursor: pointer;
  transition: background-color var(--dur-quick) var(--ease-out);
}
.brand:hover {
  background: var(--color-surface-hover);
}
/* The mark on a transparent tile: no fill, no radius — the bands are the
   shape. The human bands take the accent (the light bar restates the accent
   for its green ground, so the mark stays legible there too); the machine
   band takes the mark's own blue, the same on every ground. */
/* The slot keeps the bar's 22px line; the mark inside is cropped to the half
   circle and sized by its own attributes — 16px tall, as wide as the shape. */
.brand-mark {
  height: 22px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--color-accent);
}
.brand-mark .srf-mark {
  display: block;
}
.srf-mark-human {
  fill: currentColor;
  stroke: currentColor;
}
.srf-mark-machine {
  fill: var(--color-agent-mark);
  stroke: var(--color-agent-mark);
}
/* The wordmark: all ink, bold, its cap-height a little under the mark's. Dark runs one
   step lighter (650) to counter light-on-dark halation; the variable font
   carries the intermediate weight. */
.brand-name {
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: var(--fs-18);
  line-height: 1;
}
html[data-theme='dark'] .brand-name,
html:not([data-theme='light']) .brand-name {
  font-weight: 650;
}
.brand-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
}
/* paused — a conflict needs resolving */
/* Sync & GitHub dialog title with the mark inline before the text. */
.gh-dialog-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* The active-pause line: "Paused until 16:20 · Resume now". */
/* A borderless text action, sized to sit inside the sentence it ends rather
   than to be a button next to it — the sentence is the thing being read. */

/* Detach — an F04 danger control: transparent fill, danger text, the default
   hairline. Not a filled red button and no typed confirmation, because nothing
   is destroyed: the files stay as they are on both sides and reconnecting
   undoes it. The weight of the control matches the weight of the act. */

/* AW18 slice 04 — GitHub account connection (inside the shared srf-dialog card). */
.gh-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin: var(--space-2) 0;
  padding: var(--space-1) var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
}
.gh-account-status {
  font-size: var(--fs-13, var(--fs-12));
  color: var(--color-text-default);
  overflow-wrap: anywhere;
}
.gh-helper-warn {
  font-size: var(--fs-12);
  color: var(--color-warn);
  overflow-wrap: anywhere;
}
.gh-helper-warn:empty {
  display: none;
}
.gh-device {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  margin: var(--space-2) 0;
}
.gh-device-code {
  font-family: var(--font-mono);
  font-size: var(--fs-22);
  letter-spacing: 0.12em;
  padding: var(--space-1) var(--space-2);
  background: var(--color-surface-substrate);
  border-radius: var(--radius-2);
  color: var(--color-text-default);
}
.gh-device-link {
  font-size: var(--fs-12);
  color: var(--color-accent, var(--color-text-muted));
}
.gh-pat-input {
  width: 100%;
  box-sizing: border-box;
  margin: var(--space-1) 0;
  padding: var(--space-1) var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
}
.gh-pat-note {
  min-height: 1.2em;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.gh-publish {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: var(--space-2) 0;
}
.gh-publish:empty {
  margin: 0;
}
/* The outcome of publishing or linking a repo — held outside .gh-publish, which
   that same success empties. It takes room only once it carries a line, so an
   attempt that has not happened yet costs the dialog no space. */
.gh-outcome:not(:empty) {
  margin: var(--space-2) 0;
}
.gh-publish-title {
  font-size: var(--fs-13, var(--fs-12));
  color: var(--color-text-default);
}
.gh-publish-name {
  box-sizing: border-box;
  width: 100%;
  padding: var(--space-1) var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate);
  color: var(--color-text-default);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
}
.gh-publish-priv {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  cursor: pointer;
}
.gh-publish-or {
  margin-top: var(--space-1);
  padding-top: var(--space-2);
  border-top: var(--border-thin) solid var(--color-border-default);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.topbar-spacer {
  flex: 1;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
  font-size: var(--fs-15);
  transition:
    background-color var(--dur-quick) var(--ease-out),
    color var(--dur-quick) var(--ease-out);
}
.icon-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.icon-btn.is-on {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
/* The control a popover hangs from, while the popover is open. */
.icon-btn.is-open {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
/* account avatar — a hairline ring in default ink around the account's photo,
   its initials or, signed out, a person glyph. No fill: the face fills on hover
   only when it is not a photo, and a photo answers with the pointer alone. */
.avatar {
  width: 26px;
  height: 26px;
  box-sizing: border-box;
  border: var(--border-thin) solid var(--color-text-default);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--color-text-default);
  flex: none;
  letter-spacing: 0.02em;
}
.avatar-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-left: var(--space-1);
}
.avatar-btn:hover .avatar:not(img) {
  background: var(--color-surface-hover);
}

/* ---------- 4. Shell body: sidebar | surface ----------
   The row under the top bar. The navigation sidebar (an F09 docked panel) is
   --tree-w wide and the surface takes the rest; collapsed, the nav rail takes
   its place and --tree-w is the rail's 40px. The sidebar is on every route, so
   this row — not the workspace grid — owns its collapse, its resize handle and
   its peek over the rail. */
.shell-body {
  display: flex;
  min-height: 0;
  position: relative;
}
.shell-body > .main {
  flex: 1 1 auto;
  min-width: 0;
  /* The surface is a size container so its content reflows by the width it
     actually has, which the sidebar beside it changes: a viewport query would
     count the sidebar's width as the surface's. */
  container-type: inline-size;
  container-name: main;
}
.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-w, 0px);
  min-height: 0;
  position: relative;
}
.nav-sidebar {
  flex: none;
  width: var(--tree-w, 256px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* The sidebar itself never scrolls: the group stays put and the tree below
     it scrolls inside its own region, so a long tree can never push the
     surface rows off the top. */
  overflow: hidden;
  background: var(--color-surface-nav);
  border-right: var(--border-thin) solid var(--color-border-default);
  /* A clip at rest too, so collapsing has one to animate from. */
  clip-path: inset(0 0 0 0);
}
/* Collapsed, the sidebar leaves the row and stays mounted over the rail, at
   its open width and clipped to the rail's: the peek widens the clip, so its
   labels grow out beside glyphs that do not move, and the page under it never
   reflows. While it peeks it is an F09 docked surface — fixed to the window's
   edge, on the docked sidebar's and the rail's own ground, so it never slides
   out a step lighter than the rail it grows from, with a hairline and
   --shadow-2 to set it over the page — and the clip runs past its edge to let
   the shadow out. */
.shell-body.tree-collapsed .nav-sidebar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--column-start, 0px);
  z-index: 32;
  width: var(--tree-w-open, 256px);
  background: var(--color-surface-nav);
  clip-path: inset(0 calc(100% - 40px) 0 0);
  visibility: hidden;
  /* Closing, it keeps its peek layer until the clip has shut, as it keeps its
     visibility, so nothing it covered shows through the closing edge. */
  transition:
    clip-path var(--dur-quick) var(--ease-out),
    visibility 0s linear var(--dur-quick),
    z-index 0s linear var(--dur-quick);
}
.shell-body.tree-collapsed.is-peeking .nav-sidebar {
  z-index: var(--z-peek);
  visibility: visible;
  clip-path: inset(0 -24px 0 0);
  box-shadow: var(--shadow-2);
  transition: clip-path var(--dur-quick) var(--ease-out);
}
/* The sidebar the rail mirrors while a build page's column holds the
   assistant: there only to peek, so gone whenever the column is open. */
.shell-body:not(.tree-collapsed) .nav-sidebar.is-peek-only {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .shell-body.tree-collapsed .nav-sidebar,
  .shell-body.tree-collapsed.is-peeking .nav-sidebar {
    transition: none;
  }
}

/* The nav rail: the collapsed sidebar, an F09 docked strip on the sidebar's
   ground with a hairline on its open edge. Each slot is placed by
   nav-rail.js at the y and height of its sidebar row, and each button at that
   row icon's x, so the peek opens over it with nothing moving. */
.nav-rail {
  display: none;
}
.shell-body.tree-collapsed > .nav-rail {
  display: block;
  position: relative;
  flex: none;
  width: 40px;
  background: var(--color-surface-nav);
  border-right: var(--border-thin) solid var(--color-border-default);
}
.nav-rail-slot {
  position: absolute;
  left: 0;
  width: 40px;
}
/* F05 icon button, the sidebar row's own 15px glyph in muted ink. 33 by 26,
   so its fill sits an equal 3px inside the rail's 39px (40 less the hairline)
   and the 32px slot on every side, and neighbouring fills sit 6px apart. The
   page on screen wears the F02 selected recipe: the accent-soft fill with
   accent ink. */
.nav-rail-btn {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 33px;
  height: 26px;
  border: 0;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.nav-rail-btn svg {
  width: 15px;
  height: 15px;
}
.nav-rail-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.nav-rail-btn.is-current {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
.nav-rail-btn:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: -2px;
}
/* The sidebar opens and closes on the curve the agent panel slides on, so the
   two side panels move alike. Armed only while a toggle is in flight
   (setTreeCollapsed adds the class, and drops it when the curve is done): left
   on permanently it would also catch the resize drag, where the column has to
   track the pointer rather than chase it. The handle rides the same curve, or
   it would jump to the new edge while the column was still travelling. */
.shell-body.is-tree-animating .nav-sidebar {
  transition: width var(--dur-deliberate) var(--ease-out);
}
.shell-body.is-tree-animating .pane-resize.is-tree {
  transition: left var(--dur-deliberate) var(--ease-out);
}

/* ---- the sidebar's own families ----
   Section headings (one component, below), rows (F02, default density — read,
   not scanned), the fold chevron (F05 compact), the count badge (F07 count).
   The tree inside it keeps its own dense rows. */
/* Flush to the sidebar's edges: the top-level rows run its full width, so the
   sidebar's own edges close their boxes (see the row rules below). */
.nav-group,
.nav-section {
  padding: var(--space-1) 0;
}
/* Discover heads the panel flush under the top bar, whose own bottom border is
   the line above it. Below it the top-level rows — Discover, the surface rows,
   Workspaces — stack as one joined list with no gap between any two of them. */
.nav-subnav--top {
  padding-top: 0;
}
.nav-section--workspace,
.nav-group {
  padding-top: 0;
  padding-bottom: 0;
}
.nav-fold {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-2);
  color: var(--color-text-faint);
  flex: none;
  transition: color var(--dur-quick) var(--ease-out);
}
/* No hover fill. The chevron sits inside a row that paints its own, and a
   second 24px square over the top of it read as two overlapping highlights.
   The row is the hit target that responds; the chevron only brightens. */
.nav-row:hover > .nav-fold {
  color: var(--color-text-default);
}
/* One glyph for both states, turned rather than swapped — a swap has no
   in-between, and the fold it labels animates. */
.nav-fold-chev {
  display: flex;
  transition: transform var(--dur-deliberate) var(--ease-out);
}
.nav-section.is-folded .nav-fold-chev,
.nav-subnav.is-folded .nav-fold-chev {
  transform: rotate(-90deg);
}
/* The foldable body of a section. Height animates through a collapsing grid
   track, which needs no measured pixel height and so survives a list whose
   length nobody knows until it is built. */
.fold-region {
  display: grid;
  grid-template-rows: 1fr;
  /* Inherited rather than visible, so an open fold stays hidden with the
     collapsed sidebar it sits in until that sidebar peeks. */
  visibility: inherit;
  transition:
    grid-template-rows var(--dur-deliberate) var(--ease-out),
    opacity var(--dur-deliberate) var(--ease-out),
    visibility 0s linear 0s;
}
.fold-region > * {
  min-height: 0;
  overflow: hidden;
}
/* Hidden outright once it has finished travelling, not merely clipped to
   nothing: a clipped row still has a box of its own, so it stayed in the tab
   order and under the pointer while reading as gone. The delay lets the fold
   animate first; opening drops it, so the rows are back the moment they move. */
/* Folded as the sidebar collapses: at once, so the rail measured on these rows
   has its glyphs in place rather than sliding there. */
.nav-subnav.is-folding-now > .fold-region,
.nav-subnav.is-folding-now .nav-fold-chev {
  transition: none;
}
.nav-section.is-folded > .fold-region,
.nav-subnav.is-folded > .fold-region {
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition-delay: 0s, 0s, var(--dur-deliberate);
}
.nav-group-rows {
  display: flex;
  flex-direction: column;
}

/* The rows arrive one after another when a part opens.

   The growing height was already doing this by itself — the region is clipped
   until it reaches a row — but a fixed duration spread over the list means the
   cadence changes with its length: three workspaces land a beat apart, eight
   library kinds land in a blur. A per-row delay is the same beat whatever the
   list holds, so every part of the panel opens at one pace.

   Armed by a class the fold puts on, not by the rows being built: the sidebar
   is rebuilt on every repaint, so an animation keyed to creation would replay
   each time the reader changed surface with a group open. `--fold-i` is the
   row's place in its list, set where the row is built. */
@keyframes nav-row-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.nav-section.is-unfolding > .fold-region .nav-row,
.nav-subnav.is-unfolding > .fold-region .nav-row {
  animation: nav-row-reveal 160ms var(--ease-out) both;
  /* Less however far the reveal had already got when these rows were built. A
     repaint mid-reveal (the Library's roster settling, say) hands the rows back
     rebuilt: without the offset each one would start its wait again and the
     rows already on screen would blink. Negative for a row whose moment has
     passed, which lands it already shown. */
  animation-delay: calc(var(--fold-i, 0) * 60ms - var(--fold-elapsed, 0ms));
}
/* The global reduced-motion rule collapses the duration but not the delay, so a
   reader who asked for less motion would still wait out the stagger. */
@media (prefers-reduced-motion: reduce) {
  .nav-section.is-unfolding > .fold-region .nav-row,
  .nav-subnav.is-unfolding > .fold-region .nav-row {
    animation-delay: 0s !important;
  }
}
/* F02 selectable list row, default density — a sidebar row, read rather than
   scanned. The row paints every state; what is inside it is content. The file
   tree's rows below are the dense size.

   Flat and square: no row carries a fill at rest or when current. The current
   page is said once, in the accent and the emphasis weight. */
.nav-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--row-pad) var(--space-2);
  border-radius: var(--radius-0);
  color: var(--color-text-muted);
  font-size: var(--fs-13);
  font-weight: 400;
  text-align: left;
  transition:
    background-color var(--dur-quick) var(--ease-out),
    color var(--dur-quick) var(--ease-out);
}
.nav-row:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.nav-row.is-active {
  background: transparent;
  color: var(--color-accent);
  font-weight: 600;
}
/* The top-level rows — Discover, the surfaces and Workspaces — are boxed, and the boxes stack as one joined list.

   Every line between two rows is drawn exactly once, as the lower row's top
   border. Two borders overlapped onto one line (a box's bottom under the next
   box's top) land on different device pixels on a scaled display, since one is
   rounded from a bottom edge and the other from a top edge; wherever the two
   disagreed the line smeared across two pixels and read as thicker than its
   neighbours. So each row carries a border on all four sides, transparent
   except where it is the line: the label never moves when a side changes
   colour, and no two lines ever share a place.

   The sides stay transparent: flush to the sidebar, the left edge is the
   window's and the right is the sidebar's own border. */
.nav-group-rows > .nav-row,
.nav-subnav > .nav-row--sub,
.nav-section--workspace > .nav-row--head {
  position: relative;
  border: var(--border-thin) solid transparent;
  border-top-color: var(--color-border-default);
}
/* A row with nothing boxed under it closes the list itself: Workspaces, the
   last surface row, and a surface whose tabs have unfolded beneath it. */
.nav-section--workspace > .nav-row--head,
.nav-group-rows > .nav-row:last-child,
.nav-group-rows > .nav-subnav:last-child.is-folded > .nav-row--sub,
.nav-subnav:not(.is-folded) > .nav-row--sub {
  border-bottom-color: var(--color-border-default);
}
/* Discover sits flush under the top bar, whose bottom border already draws the
   line above it; a second grey line there would read as one thick one. Current,
   its accent top still closes its box. */
.nav-subnav--top > .nav-row--sub:not(.is-active) {
  border-top-color: transparent;
}
/* The current page's box closes on all four sides in the accent. Its bottom
   is drawn the same way every other line is — as the top of the row under it —
   so the four sides round alike; only a row that closes the list draws its own. */
.nav-group-rows > .nav-row.is-active,
.nav-subnav > .nav-row--sub.is-active,
.nav-section--workspace > .nav-row--head.is-active {
  border-top-color: var(--color-accent);
  border-left-color: var(--color-accent);
  border-right-color: var(--color-accent);
}
.nav-section--workspace > .nav-row--head.is-active,
.nav-group-rows > .nav-row.is-active:last-child,
.nav-group-rows > .nav-subnav:last-child.is-folded > .nav-row--sub.is-active,
.nav-subnav:not(.is-folded) > .nav-row--sub.is-active {
  border-bottom-color: var(--color-accent);
}
/* The row directly under the current page: its top line is that box's bottom.
   A surface whose tabs are open is not followed by a row, so it is left out.
   Discover, folded, is followed by the first surface row; the last surface row
   by Workspaces. */
.nav-group-rows > .nav-row.is-active + .nav-row,
.nav-group-rows > .nav-row.is-active + .nav-subnav > .nav-row--sub,
.nav-group-rows > .nav-subnav.is-folded:has(> .nav-row--sub.is-active) + .nav-row,
.nav-group-rows
  > .nav-subnav.is-folded:has(> .nav-row--sub.is-active)
  + .nav-subnav
  > .nav-row--sub,
.nav-subnav--top.is-folded:has(> .nav-row--sub.is-active)
  + .nav-group
  .nav-group-rows
  > .nav-subnav:first-child
  > .nav-row--sub,
.nav-group:has(
    > .fold-region .nav-group-rows > .nav-row.is-active:last-child,
    > .fold-region .nav-group-rows > .nav-subnav.is-folded:last-child > .nav-row--sub.is-active
  )
  + .nav-section--workspace
  > .nav-row--head {
  border-top-color: var(--color-accent);
}
/* Workspaces follows the surface rows and draws the line between them, so the
   last surface row leaves its own bottom off. Drawn twice, the two would sit
   on adjacent pixels and read as one thick line. */
.nav-group:has(+ .nav-section--workspace) .nav-group-rows > .nav-row:last-child,
.nav-group:has(+ .nav-section--workspace)
  .nav-group-rows
  > .nav-subnav:last-child.is-folded
  > .nav-row--sub {
  border-bottom-color: transparent;
}
.nav-row-icon {
  display: inline-flex;
  flex: none;
  color: var(--color-text-faint);
}
/* The top-level glyphs sit on the nav rail's centre line (19.5px, half the
   rail less its hairline), so when the sidebar peeks over the rail they land
   exactly on its glyphs. */
.nav-subnav--top .nav-row-icon,
.nav-group .nav-row-icon,
.nav-section--workspace > .nav-row--head .nav-row-icon {
  margin-left: 3px;
}
.nav-row:hover .nav-row-icon,
.nav-row.is-active .nav-row-icon {
  color: inherit;
}
.nav-row-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-row-count {
  min-width: 16px;
  height: 16px;
  padding: 0 var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--color-text-default);
  color: var(--color-surface-readable);
  font-size: var(--fs-11);
  font-weight: 600;
  display: grid;
  place-items: center;
  flex: none;
}
/* A section heading — Discover, Workspace or the open workspace, and Surfaces —
   is one component, so the three line up: the same left edge, the same type, the same
   icon slot and the same chevron position. The label side is the row's whole
   left edge and the chevron sits at its right, so the two gestures — go there,
   fold this — never share a hit target. The row paints the states; what is
   inside it is content. */
.nav-row--head {
  padding: 0;
  gap: 0;
}
.nav-row-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--row-pad) var(--space-2);
  border-radius: var(--radius-2);
  color: inherit;
  font: inherit;
  text-align: left;
}
.nav-row-open--static {
  cursor: default;
}
.nav-row--head > .nav-fold {
  margin-right: var(--space-1);
}
/* The sidebar's own toggle, beside the Discover heading's chevron; inside a
   workspace the Files column's, beside the Workspaces heading's. */
.nav-row--head > :is(.nav-sidebar-toggle, .nav-files-toggle) {
  flex: none;
  width: 24px;
  height: 24px;
  color: var(--color-text-faint);
}
.nav-row--head > :is(.nav-sidebar-toggle, .nav-files-toggle) svg {
  width: 15px;
  height: 15px;
}
.nav-row:hover > :is(.nav-sidebar-toggle, .nav-files-toggle) {
  color: var(--color-text-default);
}
.nav-workspace-list {
  display: flex;
  flex-direction: column;
  padding-left: var(--space-4);
}
/* A surface row that folds open into that surface's own tabs. The wrapper
   carries the fold state so the chevron and the list read it from one place,
   exactly as a section does — it is a section in every way but the heading. */
.nav-subnav {
  display: flex;
  flex-direction: column;
}
/* The row itself is the same component every other surface row is; only the
   padding moves onto the navigating half, so the chevron beside it is a
   separate hit target rather than part of the row's own hit area. */
.nav-row--sub {
  padding: 0;
  gap: 0;
}
.nav-row--sub > .nav-fold {
  margin-right: var(--space-1);
}
.nav-subnav.is-folded .nav-fold-chev {
  transform: rotate(-90deg);
}
.nav-subnav.is-folded > .fold-region {
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition-delay: 0s, 0s, var(--dur-deliberate);
}
/* The tabs under it, indented to the label they hang from — the same offset
   the workspace list uses under Workspace, for the same reason: an indent is
   what says these rows belong to the row above rather than beside it. */
.nav-tab-list {
  display: flex;
  flex-direction: column;
  padding-left: var(--space-4);
}
/* An open list stands a step clear of the boxes above and below it, so its
   first and last rows do not read as touching a line. Only while open: a
   folded list keeps its box, and the space would show as a gap between two
   rows that are meant to share a line. */
.nav-subnav:not(.is-folded) .nav-tab-list,
.nav-section:not(.is-folded) .nav-workspace-list {
  padding-top: var(--space-1);
  padding-bottom: var(--space-1);
}
/* Nested rows carry no box and a lighter ink than the surface row above them:
   a tab is a place inside somewhere you already are, and the same ink would
   read as two peers. The weight stays the rows' own, so the current one is
   marked by the same step up as a current surface. */
.nav-row--tab,
.nav-row--workspace {
  color: var(--color-text-faint);
}
/* F09 docked strip: the Files column, inside a workspace, beside the sidebar
   or its rail. The sidebar's ground and hairline, so the two read as one
   chrome; its head is a 32px row like the sidebar's, over the tree. Shut, its
   width travels to nothing on the sidebar's curve; at 900px and below it
   floats over the page from the rail's edge, an F09 floating surface. */
.files-column {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  width: var(--files-w, 256px);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--color-surface-nav);
  border-right: var(--border-thin) solid var(--color-border-default);
  /* Size container so the head folds its actions by the width the column
     actually has: it is drag-resizable, so a viewport query cannot see it. */
  container-type: inline-size;
  container-name: tree;
}
.files-column.is-shut {
  border-right-width: 0;
}
.shell-body.is-files-animating .files-column {
  transition: width var(--dur-deliberate) var(--ease-out);
}
.files-column.is-floating {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--column-start, 0px) + var(--tree-w, 40px));
  z-index: 31;
  width: var(--files-w-open, 256px);
  background: var(--color-surface-readable);
  box-shadow: var(--shadow-3);
}
.files-column.is-floating.is-shut {
  visibility: hidden;
}
@media (prefers-reduced-motion: reduce) {
  .shell-body.is-files-animating .files-column {
    transition: none;
  }
}
.files-column-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-1);
  /* The column's own width at rest, so shutting clips it rather than
     squeezing the head's contents as the width travels. */
  min-width: var(--files-w-open, 256px);
  height: 33px;
  padding: 0 var(--space-2) 0 0;
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.files-column-name {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  height: 100%;
  padding: 0 var(--space-2) 0 var(--space-3);
  color: var(--color-text-default);
  font-size: var(--fs-13);
  font-weight: 600;
  text-align: left;
  transition: color var(--dur-quick) var(--ease-out);
}
.files-column-name:hover {
  color: var(--color-accent);
}
.files-column-name.is-active {
  color: var(--color-accent);
}
.files-column-icon {
  display: inline-flex;
  flex: none;
  color: var(--color-text-faint);
}
.files-column-name.is-active .files-column-icon,
.files-column-name:hover .files-column-icon {
  color: inherit;
}
.files-column-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.files-column-head .tree-controls {
  flex: none;
}
.files-column-hide {
  flex: none;
}
.pane-resize.is-files {
  right: 0;
  transform: translateX(50%);
}
.files-column.is-shut > .pane-resize.is-files {
  display: none;
}
/* The tree in the column: the pane keeps being the scroll container, filling
   the column's remaining height, but the column is the ground, so the pane
   gives up its own. Its sticky foot must paint that ground itself, and the
   pane's edge padding folds into the column's. */
.files-column .tree-pane {
  flex: 1 1 auto;
  min-width: var(--files-w-open, 256px);
  border-right: 0;
  background: transparent;
  padding: 0;
  min-height: 0;
}
.files-column .tree-foot {
  bottom: 0;
  margin: auto 0 0;
  background: var(--color-surface-nav);
}
.files-column.is-floating .tree-foot {
  background: var(--color-surface-readable);
}
/* The tree's rows follow the sidebar's nested rows: faint ink at the body
   weight, square, and no fill on the current one — the accent and the
   emphasis weight say it, as they do for a current tab. Folder and file read
   apart by their glyphs. Scoped by the pane so each rule outranks the tree's
   own state rules without depending on where they sit in the file. A skill
   page's Files card shares the look. */
.files-column .tree-pane .tree-item,
.files-column .tree-pane .tree-folder-row,
.agentpg-files .tree-pane .tree-item,
.agentpg-files .tree-pane .tree-folder-row {
  border-radius: var(--radius-0);
  color: var(--color-text-faint);
  font-weight: 400;
}
.files-column .tree-pane .tree-item:hover,
.files-column .tree-pane .tree-folder-row:hover,
.agentpg-files .tree-pane .tree-item:hover,
.agentpg-files .tree-pane .tree-folder-row:hover {
  color: var(--color-text-default);
}
.files-column .tree-pane .tree-item.is-active,
.files-column .tree-pane .tree-folder-row.is-current,
.agentpg-files .tree-pane .tree-item.is-active {
  background: transparent;
  color: var(--color-accent);
  font-weight: 600;
}
.files-column .tree-pane .tree-item .t-icon,
.files-column .tree-pane .tree-folder-row .t-icon,
.agentpg-files .tree-pane .tree-item .t-icon,
.agentpg-files .tree-pane .tree-folder-row .t-icon {
  color: var(--color-text-faint);
}
.files-column .tree-pane .tree-item.is-active .t-icon,
.files-column .tree-pane .tree-folder-row.is-current .t-icon,
.agentpg-files .tree-pane .tree-item.is-active .t-icon {
  color: var(--color-accent);
}
.files-column .tree-foot:hover {
  background: var(--color-surface-hover);
}
/* A skill page's Files card holds the same tree, rooted at the skill's folder:
   the card is its ground, so the pane gives up its own ground, edge and padding
   and is only as wide as the card. The rows take the Files column's look above. */
.agentpg-files .tree-pane {
  border-right: 0;
  background: transparent;
  padding: 0;
  overflow: visible;
}
/* pane-resize — absolutely-positioned drag slider at a column boundary; does not
   occupy a grid track. Hairline is invisible at rest, brightens on hover/drag. */
.pane-resize {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 9px;
  z-index: 90;
  cursor: col-resize;
  background: transparent;
}
.pane-resize.is-tree {
  left: calc(var(--column-start, 0px) + var(--tree-w, 256px));
  transform: translateX(-50%);
}
.pane-resize.is-rail {
  /* Positioned from the docked panel's own edge, not from the column's: the
     panel is fixed to the window at --rail-w-open wide, so the handle is fixed
     at the same width from the window's edge. Measured from the column it moved
     by the column's scrollbar, a few pixels off the rail's edge. */
  position: fixed;
  right: var(--rail-w-open, 360px);
  transform: translateX(50%);
  /* Starts below the docked panel's grip, which reaches 4.5px past the panel's
     edge under this handle's half-width; a handle over the grip takes the press
     meant to lift the panel out of the rail. */
  top: calc(56px + var(--space-3) + 38px + var(--space-3));
}
.pane-resize::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: transparent;
  transition: background-color var(--dur-quick) var(--ease-out);
}
.pane-resize:hover::after {
  background: var(--color-accent);
}
body.is-resizing {
  cursor: col-resize;
  user-select: none;
}
body.is-resizing .pane-resize::after {
  background: var(--color-accent);
}
/* Moving or sizing the agent object: no text selection under the pointer, and
   none of the pane resizers lit — the gesture is not theirs. */
body.is-object-drag {
  user-select: none;
}
.main.pane-will-collapse .pane-resize::after {
  background: var(--color-danger);
}
/* compact toggle buttons sitting in the editor top bar */
.editor-topbar .icon-btn {
  width: 28px;
  height: 28px;
  font-size: 14px;
}
@media (max-width: 880px) {
  .pane-resize {
    display: none;
  }
}
.tree-pane {
  background: var(--color-surface-readable);
  border-right: var(--border-thin) solid var(--color-border-default);
  padding: var(--space-3);
  /* Column layout so the footer's margin-top:auto parks it at the pane's
     bottom edge when the tree is short; sticky keeps it there when the tree
     scrolls past it. */
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* Never a horizontal scrollbar: rows truncate with ellipsis and the head
     folds its actions into an overflow menu below the container threshold, so
     sideways scrolling would only ever reveal clipped chrome. */
  overflow-x: hidden;
  /* Size container so the head can fold by pane width (the pane is
     drag-resizable, so a viewport media query cannot see it). */
  container-type: inline-size;
  container-name: tree;
}
/* The pane is only the rows now. The search, the create/import/trash controls
   and the chips that scope a search sit on (and under) the workspace heading
   above it — outside this scroller, so they stay put with no pinning at all.
   What is kept below is the ground they used to paint, which the footer still
   needs for exactly the reason the head did.
   They stick as ONE box because the chip row appears and disappears with the
   search field: pinning each separately would need the head's height as a
   constant, and that height changes with the controls the surface offers.
   Negative margins pull the box over the pane's own padding, so rows passing
   beneath are covered instead of showing through the gap.

   The ground is INHERITED rather than named: this is the pane's own top edge,
   not a card floating on it, and the pane re-derives the surface tokens to
   different values inside itself on the light theme. Inheriting keeps the two
   the same colour in both themes without a second declaration to keep in
   step. */
/* The folder page's search — the same collapse-to-an-icon gesture as the
   Workspaces page's filter, so learning one teaches the other. Named for the
   file tree it searches. */
.tree-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: none;
}
/* Open, the field takes a reading width in the page's top bar and gives it
   back before the path trail does. The toggle leaves the layout entirely — the
   field is the control now. */
.tree-search.is-open {
  flex: 0 1 280px;
  min-width: 120px;
}
.tree-search.is-open .tree-search-toggle {
  display: none;
}
.tree-search-field {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
}
.tree-search-field:focus-within {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.tree-search-icon {
  color: var(--color-text-muted);
  flex: none;
}
.tree-search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  font-size: var(--fs-13);
  color: var(--color-text-default);
  padding: var(--row-pad) 0;
}
.tree-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border: none;
  border-radius: var(--radius-1);
  background: transparent;
  color: var(--color-text-faint);
  cursor: pointer;
  flex: none;
}
.tree-search-clear:hover {
  color: var(--color-text-default);
}
.tree-search-note {
  color: var(--color-text-faint);
  font-size: var(--fs-13);
  padding: var(--space-3) var(--space-2);
}
/* A link rather than a button: the way out of an over-narrow search, not an
   action competing with the tree. */
.tree-search-note-clear {
  margin-left: var(--space-2);
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: underline;
}
/* The matched characters inside a row's name. Marked by weight and colour
   rather than a background block, which at row density reads as a selection. */
.t-name-mark {
  background: transparent;
  color: var(--color-accent);
  font-weight: 600;
}
/* A file matched only by what is written inside it — the count is the only
   thing on the row explaining why it survived the filter. */
.tree-hit-count {
  flex: none;
  margin-left: auto;
  padding: 0 var(--space-1);
  border-radius: var(--radius-1);
  background: var(--color-surface-substrate);
  color: var(--color-text-faint);
  font-size: var(--fs-11);
  font-variant-numeric: tabular-nums;
}
/* A governed row says so. Same family and same slot as the hit count above —
   the row badge — so a row carrying both reads as one line rather than as two
   competing decorations. Read-only and no-access are worded differently rather
   than sharing a glyph: they are different promises, and one mark for both
   undersells the second. */
/* Icon-only, and one colour for every level: the glyph carries the whole
   distinction. Hidden does not take --color-warn — a folder somebody
   deliberately closed is a settled state, not an unresolved one, and painting
   it as attention-needed says the opposite of what it means. */
.tree-access-badge {
  flex: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  color: var(--color-text-faint);
}
/* Inherited marks recede so the declaring row is the only solid one in its
   subtree — that row is where the restriction is undone. */
.tree-access-badge.is-inherited {
  opacity: 0.5;
}

/* Label badge, warn tone — "Marker", with the full reason in its title. */
.tree-marker-badge {
  flex: none;
  padding: 0 var(--space-2);
  border: var(--border-thin) solid var(--color-warn-soft-2);
  border-radius: var(--radius-pill);
  background: var(--color-warn-soft);
  color: var(--color-warn);
  font-size: var(--fs-11);
  font-weight: 600;
  line-height: 16px;
}

/* The access dialog. Warn, not danger: tightening a folder over an exemption is
   something to look at before committing, not a failure. */
.tree-access-current {
  margin: 0 0 var(--space-2);
}
.tree-access-note {
  margin: 0 0 var(--space-2);
  color: var(--color-text-faint);
  font-size: var(--fs-12);
}
.tree-access-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.tree-access-option {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  cursor: pointer;
}
.tree-access-option-text {
  display: flex;
  flex-direction: column;
}
.tree-access-option-hint {
  color: var(--color-text-faint);
  font-size: var(--fs-12);
}
.tree-access-warning:not(:empty) {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-2);
  background: var(--color-warn-soft);
}
.tree-access-warning-icon {
  flex: none;
  color: var(--color-warn);
}
.tree-access-warning-copy {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: var(--fs-12);
}
.tree-access-warning-list {
  flex-basis: 100%;
  margin: 0;
  padding-left: var(--space-4);
  color: var(--color-text-faint);
  font-size: var(--fs-12);
}
.tree-access-clear {
  display: flex;
  flex-basis: 100%;
  gap: var(--space-2);
  align-items: center;
  font-size: var(--fs-12);
  cursor: pointer;
}
.tree-access-view-btn {
  margin-top: var(--space-3);
}

/* The mode chips (F06 toggle chip), on a bare control strip. Below the field
   rather than beside it — the open field takes the whole head row and the
   chips would have to shrink out of legibility to share that width. */
.tree-search-modes {
  display: flex;
  /* The pane is drag-resizable, so four chips cannot be assumed to fit on one
     line. Wrapping keeps every label readable; shrinking them to fit would cost
     exactly the word that says what the mode does. */
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3) var(--space-2);
  flex: none;
}
.tree-search-mode {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-pill);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-substrate);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
}
.tree-search-mode:hover {
  border-color: var(--color-accent);
  color: var(--color-text-default);
}
.tree-search-mode.is-active {
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  border-color: var(--color-accent);
}
/* Body-mode results — the list that stands in for the tree when the query is
   about what is written inside files rather than what they are called. */
.tree-results {
  display: flex;
  flex-direction: column;
}
/* The file header (F02 selectable list row, dense). It collapses the file
   rather than opening it: the excerpts under it are what the reader came for,
   and they pick which one to jump to. */
.tree-result-file {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-2);
  color: var(--color-text-default);
  font-size: var(--fs-13);
  text-align: left;
  cursor: pointer;
}
.tree-result-file:hover {
  background: var(--color-surface-hover);
}
.tree-result-twisty,
.tree-result-file .t-icon {
  flex: none;
  color: var(--color-text-faint);
}
/* Name over folders, stacked. The count stays on the row beside them, so the
   header reads as one object two lines tall rather than two rows. */
.tree-result-headline {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
/* Shrinkable, never `flex: none`: a name that cannot shrink takes its full
   content width and overflows the row instead of ellipsizing. */
.tree-result-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Where the file sits, as a fact about the result rather than as structure —
   so it recedes, and gives up its width first when the row is tight. Truncates
   the ordinary way: the RTL trick that would ellipsize the START of the path
   reorders the separators around it, which turns a truncated path into a wrong
   one rather than a shortened one. */
.tree-result-crumb {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-faint);
  font-size: var(--fs-11);
  line-height: 1.3;
}
/* One matched line (F02 selectable list row, dense). Indented under its file
   and set a step down in size, so the list reads as files carrying excerpts
   rather than as one flat run of rows. */
.tree-result-snippet {
  display: block;
  width: 100%;
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-5);
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color var(--dur-quick) var(--ease-out);
}
.tree-result-snippet:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
/* The excerpts are capped per file; this says what the cap hid rather than
   leaving the reader to check the list against the count. */
.tree-result-more {
  padding: 0 var(--space-2) var(--space-2) var(--space-5);
  color: var(--color-text-faint);
  font-size: var(--fs-11);
}
.tree {
  font-size: var(--fs-13);
}
.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
  cursor: pointer;
  text-align: left;
  transition: background-color var(--dur-quick) var(--ease-out);
}
.tree-item:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.tree-item.is-active {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-weight: 600;
}
.tree-item .t-icon {
  flex: none;
  color: var(--color-text-faint);
  font-size: 12px;
}
.tree-item.is-active .t-icon {
  color: var(--color-accent);
}
.tree-item .t-name {
  flex: 1;
  min-width: 0;
  display: flex;
  overflow: hidden;
}
/* The workspace heading's control cluster: New file, New folder and the ⋯
   menu, pushed to the row's right edge. */
.tree-controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: none;
  min-width: 0;
}
.tree-ctl-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-2);
  color: var(--color-accent);
  flex: none;
}
/* The header glyphs read heavier than the body of the tree on purpose: they
   are the pane's only chrome, drawn at the icon set's grid but a step thicker
   so they survive being small — and in the accent so the row reads as the
   pane's own controls, not greyed-out chrome. The span wrapper flexes so the
   SVG centres in the hit box instead of sitting on the text baseline. */
.tree-ctl-btn .icon {
  display: flex;
}
.tree-ctl-btn svg {
  stroke-width: 2;
}
/* The slatted trash reads cluttered at the full header stroke; one step
   lighter keeps its inner lines legible without filling in. */
.tree-ctl-btn--trash svg {
  stroke-width: 1.75;
}
.tree-ctl-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-accent-strong);
}
/* The action buttons sit snug, matching the tight spacing of the same pair on
   nested folder rows (.tree-folder-row .tree-actions). */
.tree-ctl-btn + .tree-ctl-btn {
  margin-left: -7px;
}
/* The auto margin rides the FIRST action, so the cluster sits at the row's
   right edge. Doubled class beats the sibling tightener above on specificity. */
.tree-ctl-btn.tree-ctl-first-action {
  margin-left: auto;
}
/* The ⋯ menu is always on the row — Import, Trash and Enrich workspace
   live in it. Below this width the two creating glyphs fold into it as well,
   and it takes over the gap that opened before them, so the row never has to
   choose between the workspace's name and the controls that act on it. */
@container tree (max-width: 200px) {
  .tree-ctl-btn.is-foldable {
    display: none;
  }
  .tree-ctl-more {
    display: grid;
    margin-left: auto;
  }
}
/* Narrower still, the run pill is the last thing that can clip, so it hides;
   a run is still reachable from the overflow menu's Enrich workspace…. */
@container tree (max-width: 186px) {
  .tree-enrich {
    display: none;
  }
}
/* nested folders + per-row hover actions (draft parity) */
.tree-row {
  display: flex;
  align-items: center;
  border-radius: var(--radius-2);
}
.tree-row > .tree-item {
  flex: 1;
  min-width: 0;
}
.tree-folder-row {
  display: flex;
  align-items: center;
  /* The chevron is a 24px button at the row's left edge, so the row gives it
     the room rather than padding around it. */
  gap: 2px;
  padding: var(--space-1) var(--space-2) var(--space-1) 0;
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
/* Drag-to-move: a folder row (or the tree head = the tree's root) that a
   dragged file is hovering over — matches the composer's drop affordance
   language without inventing new chrome.

   The pane itself joins the same rule as the fallback destination: files
   dragged in from the OS may be dropped anywhere in the tree, and only a folder
   row overrides where they land. It reads as the ring moving out to the whole
   pane, which is exactly what the destination did. */
.tree-folder-row.is-drop-target,
.nav-row--head.is-drop-target,
.tree-pane.is-drop-target {
  background: var(--color-surface-hover);
  box-shadow: inset 0 0 0 1.5px var(--color-accent);
}
.tree-folder-row:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.tree-folder-row .t-name-link > .t-icon {
  flex: none;
  color: var(--color-accent);
  display: inline-flex;
}
.tree-folder-row .t-name-link > .t-name {
  flex: 1;
  min-width: 0;
  display: flex;
  overflow: hidden;
}
/* Issue #606: middle-truncation — the start ellipsizes, the tail stays pinned so
   the distinguishing suffix survives the shared-prefix names in real vaults. */
.t-name-start {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.t-name-end {
  flex: none;
  white-space: nowrap;
}
.tree-children {
  margin-left: 13px;
  border-left: var(--border-thin) solid var(--color-border-default);
  padding-left: 4px;
}
/* Past the third level the step narrows from 18px to 6px, keeping its guide.
   At the full step a folder eight deep in the default 256px sidebar kept 16px
   of its name; at 6px it keeps 64px, its tail and a letter or two of its
   start. The guides are kept because they are what traces a deep row back to
   its parent — dropping them bought 8px more and lost that. Letting the row
   scroll sideways kept whole names, but showed none of them without a scroll
   and dropped the pinned tail off the pane's edge. */
.tree-children .tree-children .tree-children .tree-children {
  margin-left: 1px;
}
.tree-actions {
  display: flex;
  gap: 1px;
  flex: none;
  opacity: 0;
  transition: opacity var(--dur-quick) var(--ease-out);
}
.tree-row:hover .tree-actions,
.tree-folder-row:hover .tree-actions,
.tree-act:focus-visible {
  opacity: 1;
}
.tree-act {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-1);
  color: var(--color-text-faint);
  flex: none;
}
/* The span wrapper flexes so the SVG centres in the hover box instead of
   riding the text baseline, which visibly offset the folder-row pair. */
.tree-act .icon {
  display: flex;
}
.tree-act:hover {
  background: var(--color-surface-substrate-2);
  color: var(--color-text-default);
}
/* Folder-row new-file / new-folder buttons: snugger together, slightly larger
   icons than the file-row rename/delete actions. */
.tree-folder-row .tree-actions {
  gap: 0;
}
.tree-folder-row .tree-act {
  width: 20px;
  height: 20px;
}
/* Issue #604: inline file/folder create + rename rows (replace native prompt). */
.tree-inline {
  margin: 1px 0;
}
.tree-inline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-2);
  background: var(--color-accent-soft);
}
.tree-inline-row > .t-icon {
  flex: none;
  color: var(--color-accent);
}
.tree-inline-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: var(--fs-13);
  color: var(--color-text-default);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-accent);
  border-radius: var(--radius-1);
  padding: 2px 6px;
  outline: none;
}
.tree-inline-input:focus {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.tree-inline-error {
  color: var(--color-danger);
  font-size: var(--fs-12);
  padding: 3px 8px 1px;
}
.tree-inline-error:empty {
  display: none;
}
/* F12 overlay, menu variant — the generic right-click context menu. */
.ctx-menu {
  position: fixed;
  /* Above .srf-dialog-backdrop (300), because a menu opened from inside a
     dialog has to be above the dialog that opened it — the event sheet's
     destination chip is one, and at 200 its menu opened behind the backdrop,
     invisible and unclickable. Still below the image lightbox (400), which is
     the one surface that legitimately covers everything. */
  z-index: 310;
  min-width: 200px;
  padding: var(--space-1);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
  gap: 1px;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top left;
  transition:
    opacity var(--dur-quick) var(--ease-out),
    transform var(--dur-quick) var(--ease-out);
}
.ctx-menu.is-open {
  opacity: 1;
  transform: none;
}
/* On its way out. The base rule above already describes where it goes and how
   long it takes, so dropping .is-open animates it back with nothing more said
   here; this only takes the departing menu out of the way of the pointer. */
.ctx-menu.is-closing {
  pointer-events: none;
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-2);
  font-size: var(--fs-13);
  color: var(--color-text-default);
  text-align: left;
  width: 100%;
}
.ctx-item:hover {
  background: var(--color-surface-hover);
}
/* Holds the icon column open on an iconless row, so labels align. */
.ctx-item-icon-blank {
  width: 14px;
  flex: none;
}
.ctx-item svg {
  color: var(--color-text-faint);
  flex: none;
}
.ctx-item.is-danger,
.ctx-item.is-danger svg {
  color: var(--color-danger);
}
.ctx-item.is-danger:hover {
  background: color-mix(in srgb, var(--color-danger) 12%, transparent);
}
.ctx-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--color-border-default);
}
/* A row that folds open in place (the agent's "+" menu: what the message can
   see). Its lines sit indented under the label, with no glyphs: the label
   muted, the value in default ink. A line that acts is an ordinary row with a
   chevron; a plain one only states. */
.ctx-disclose-label {
  flex: 1;
}
.ctx-disclose-chev,
.ctx-line-go {
  display: flex;
  flex: none;
  color: var(--color-text-faint);
}
.ctx-line {
  display: flex;
  align-items: center;
  gap: 0.25em;
  max-width: 320px;
  padding: var(--space-1) 10px var(--space-1) calc(10px + 14px + 10px);
  font-size: var(--fs-12);
  color: var(--color-text-default);
}
.ctx-line-k {
  color: var(--color-text-muted);
}
.ctx-line-v {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-group-title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-faint);
  margin: var(--space-4) 0 var(--space-2);
  padding: 0 4px;
}
.nav-note {
  color: var(--color-text-faint);
  font-size: var(--fs-11);
  padding: 3px 4px;
  line-height: 1.5;
}
.nav-note code {
  font-family: var(--font-mono);
  color: var(--color-text-muted);
}

/* ---------- 5. Editor / prose (draft §1110–1254) ---------- */
.editor-pane {
  display: grid;
  /* topbar / notices strip (E1/E4/E6 banners; usually empty) / content */
  grid-template-rows: auto auto 1fr;
  min-height: 0;
  background: var(--color-surface-readable);
}
/* The editor area: one pane, or two side by side, each its tab strip above
   the content its active tab names. A route container, not a component.

   It starts directly under the pinned top bar, with no band reserved above it. */
.editor-area {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  background: var(--color-surface-readable);
}
.editor-area.is-split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.editor-split-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
}
.editor-split-pane + .editor-split-pane {
  border-left: var(--border-thin) solid var(--color-border-default);
}
.editor-split-body {
  display: grid;
  min-height: 0;
  min-width: 0;
}
.editor-split-body > .editor-pane {
  min-height: 0;
}
.editor-pane--empty {
  grid-template-rows: 1fr;
  align-content: center;
}
/* The other pane's note, drawn read-only: a press anywhere moves focus there,
   so the whole body reads as one target. */
.editor-split-pane:not(.is-focused) .editor-split-body {
  cursor: default;
}
.editor-pane--static .editor-topbar {
  min-height: 51px;
}
.editor-pane--static .prose {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-8);
}

/* Full screen, in the app: a workflow's card (`.wfpg-sheet`, placed with the
   workflow page's rules) covers the main area,
   and the chrome steps out of the page while it does, so the main area is the
   whole window: the top bar, the sidebar or its rail, the Files column, the tab
   strip, and on a build page the left column's switcher strip and the
   assistant. Keyed to the
   surface being in the page rather than to a flag of its own, so a full-screen
   surface that leaves the page takes the chrome's absence with it. The agent's
   tab is drawn above the page, so it stays on top and reachable. */
.app:has(.wfpg-sheet.is-full) {
  grid-template-rows: minmax(0, 1fr);
}
.app:has(.wfpg-sheet.is-full) > .topbar,
.app:has(.wfpg-sheet.is-full) .nav-sidebar,
.app:has(.wfpg-sheet.is-full) .pane-resize,
.app:has(.wfpg-sheet.is-full) .nav-rail,
.app:has(.wfpg-sheet.is-full) .files-column,
.app:has(.wfpg-sheet.is-full) .editor-tabstrip,
.app:has(.wfpg-sheet.is-full) .build-rail,
.app:has(.wfpg-sheet.is-full) .build-assist {
  display: none;
}

/* The editor's tab strip — a domain one-off (component standards, Not
   components): one strip per pane, a tab per open file or folder
   page. The active tab carries an underline: the accent in the focused pane,
   the strong border in the other, so the pane being typed into is the one
   that is lit. Its close × is an F05 compact icon button; "+" and Split right
   are F05 compact as well. */
.editor-tabstrip {
  display: flex;
  align-items: stretch;
  min-width: 0;
  height: 36px;
  background: var(--color-surface-readable);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.editor-tabs {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.editor-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 1 auto;
  min-width: 96px;
  max-width: 220px;
  padding: 0 var(--space-1) 0 var(--space-3);
  border-right: var(--border-thin) solid var(--color-border-default);
  color: var(--color-text-muted);
  font-size: var(--fs-13);
  cursor: pointer;
  user-select: none;
}
/* The workspace's own page when it is the only tab has no ×, so the room the
   × keeps on the right goes back to the label's side. */
.editor-tab.is-floor {
  padding-right: var(--space-3);
}
.editor-tab:hover {
  color: var(--color-text-default);
  background: var(--color-surface-hover);
}
.editor-tab.is-active {
  color: var(--color-text-default);
  background: var(--color-surface-readable);
}
.editor-tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--color-border-strong);
}
.editor-split-pane.is-focused .editor-tab.is-active::after {
  background: var(--color-accent);
}
.editor-tab:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}
.editor-tab-icon {
  flex: none;
  color: var(--color-text-faint);
}
/* A page's tab showing its Source wears the code glyph, one step up from the
   file glyph so the twin it is told apart from reads at a glance. */
.editor-tab-icon.is-source {
  color: var(--color-text-muted);
}
.editor-tab-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.editor-tab .editor-tab-close,
.editor-tabstrip .editor-tabstrip-btn {
  flex: none;
  width: 24px;
  height: 24px;
  align-self: center;
}
.editor-tabstrip .editor-tabstrip-btn {
  margin: 0 var(--space-1);
}
.editor-tabstrip-grow {
  flex: 1 1 auto;
}
/* Dragging a tab: the tab dims where it is, the strip it would land in takes
   the accent tint, and a line stands in the gap the drop goes into — Library's
   tab-reorder pattern, on this strip's geometry. The line is drawn by
   ::before on both sides because ::after is the active tab's underline; it is
   centred on the hairline between two tabs, and kept inside the strip's
   scrolling run at either end. */
.editor-tab.is-dragging {
  opacity: 0.45;
}
.editor-tabstrip.is-drop-target {
  background: var(--color-accent-soft);
}
.editor-tab.is-drop-before::before,
.editor-tab.is-drop-after::before {
  content: '';
  position: absolute;
  top: var(--space-1);
  bottom: var(--space-1);
  z-index: 2;
  width: var(--border-emphasis);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
}
.editor-tab.is-drop-before::before {
  left: calc((var(--border-emphasis) + var(--border-thin)) / -2);
}
.editor-tab.is-drop-after::before {
  right: calc((var(--border-thin) - var(--border-emphasis)) / 2);
}
.editor-tab:first-child.is-drop-before::before {
  left: 0;
}
.editor-tab:last-child.is-drop-after::before {
  right: 0;
}
/* Where a dragged tab splits the editor: exactly the pane a split makes —
   the right half, below the strip (the strip's own 36px) — so the preview is
   the result. Shown only while a tab is being dragged, so it never sits over
   the document otherwise. */
.editor-split-zone {
  display: none;
  position: absolute;
  top: 36px;
  right: 0;
  bottom: 0;
  width: 50%;
  z-index: 5;
}
body.is-dragging-tab .editor-split-zone {
  display: block;
}
.editor-split-zone.is-over {
  background: var(--color-accent-soft);
  box-shadow: inset 2px 0 0 var(--color-accent);
}
.editor-topbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px var(--space-5);
  border-bottom: var(--border-thin) solid var(--color-border-default);
  color: var(--color-text-faint);
  /* A grid item's automatic minimum is its min-content width, so without this
     the bar refuses to go below the sum of everything in it and overflows the
     pane instead of narrowing. Widening the tree left a 120px pane still
     holding a 538px bar, with the file name somewhere off the right of the
     window — and because nothing inside the bar ever felt the squeeze, the
     breadcrumb had no reason to fold either. The bar tracks the pane now, and
     the trail inside it does the folding. */
  min-width: 0;
}
.editor-topbar .path {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
/* Issue #610: clickable breadcrumb path. Inherits the mono/size/colour of .path;
   folder segments are buttons that navigate to the folder's _index. */
/* One line, always. A wrapping trail grew the top bar taller the deeper the
   file was — worst on a narrow pane, where a five-folder path stacked into five
   rows and pushed the document down while the rest of the bar sat empty. The
   trail shrinks instead, and buildDocCrumbs folds its middle steps away when
   the room runs out. */
.doc-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1px;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
}
.doc-crumbs .crumb-sep {
  color: var(--color-text-faint);
  opacity: 0.6;
  flex: none;
}
.doc-crumbs .crumb {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0 2px;
  border-radius: var(--radius-1);
  line-height: 1.5;
  white-space: nowrap;
  flex: none;
}
/* The file is the one step allowed to give ground before the folds start, so a
   single very long filename clips rather than shoving the folders out. */
.doc-crumbs .crumb-current {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-crumbs .crumb-link {
  cursor: pointer;
}
.doc-crumbs .crumb-link:hover {
  color: var(--color-accent);
  background: var(--color-surface-hover);
  text-decoration: underline;
}
.doc-crumbs .crumb-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}
.doc-crumbs .crumb-current {
  color: var(--color-text-default);
  font-weight: 600;
}
/* Unsaved-changes dot: edits autosave (no manual Save button), so the dot is the
   only header save affordance — a brief "saving" pulse. Hidden until the buffer
   is dirty (JS toggles .is-visible), so a freshly-loaded doc shows nothing and
   the static render harness baseline is unchanged. */
.editor-dirty-dot {
  display: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  flex: none;
}
.editor-dirty-dot.is-visible {
  display: inline-block;
}
/* The inferred language of a code/plain-text file, named at the far right of
   its topbar. Quiet by design: it reports what the file is being read as, and
   is the only chrome that distinguishes this pane from a note's. */
.editor-lang-badge {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  flex: none;
}
/* The code pane's syntax colours, from the theme's own tokens so they read in
   both: markup's tags in the accent, attribute names and punctuation muted,
   strings and attribute values in success, comments and the doctype faint,
   keywords and a stylesheet's properties in the agent blue, numbers and units
   in warn. Anything unclassed is the default ink. */
.editor-code-host .tok-tagName {
  color: var(--color-accent);
}
.editor-code-host .tok-attributeName,
.editor-code-host .tok-punctuation {
  color: var(--color-text-muted);
}
.editor-code-host .tok-attributeValue,
.editor-code-host .tok-string {
  color: var(--color-success);
}
.editor-code-host .tok-comment,
.editor-code-host .tok-meta {
  color: var(--color-text-faint);
}
.editor-code-host .tok-keyword,
.editor-code-host .tok-propertyName {
  color: var(--color-agent);
}
.editor-code-host .tok-number {
  color: var(--color-warn);
}
/* A code file is monospaced and uses the full pane width — the prose column's
   720px measure and reading font are tuned for sentences, not for lines of
   YAML that must not be re-wrapped into ambiguity.

   The host carries `prose cm-host editor-code-host` together, and both of the
   rules this overrides — `.prose` and `.cm-host .cm-scroller` — are declared
   LATER in this file at equal specificity, so a single-class selector here
   loses the cascade and the pane renders in the reading font while claiming
   monospace. Qualifying each selector with the class it shares the element
   with wins on specificity instead of on ordering, which is the part a later
   edit cannot accidentally undo. */
.prose.editor-code-host {
  max-width: none;
  font-family: var(--font-mono);
  font-size: var(--fs-13);
}
.cm-host.editor-code-host .cm-scroller {
  font-family: var(--font-mono);
  line-height: 1.55;
}
.cm-host.editor-code-host .cm-content {
  font-size: var(--fs-13);
  max-width: none;
}
/* Unsaved-changes dot on the active file-tree row (hidden until dirty). */
.tree-dirty-dot {
  display: none;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex: none;
}
.tree-dirty-dot.is-visible {
  display: inline-block;
}
.editor-scroll {
  overflow: auto;
  min-height: 0;
  padding: var(--space-6) 0;
  flex: 1 1 auto;
}
/* AW9/05 — outline panel: docks beside the document (not an overlay), toggled
   from the editor rail. */
.editor-content-row {
  display: flex;
  min-height: 0;
  height: 100%;
}
.outline-panel {
  flex: 0 0 220px;
  overflow-y: auto;
  padding: var(--space-4) var(--space-3);
  border-right: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-readable);
}
.outline-panel-title {
  font-size: var(--fs-11);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.outline-list {
  display: flex;
  flex-direction: column;
}
.outline-row {
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: var(--fs-13);
  padding: 4px 6px;
  border-radius: var(--radius-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.outline-row:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.outline-row.is-active {
  color: var(--color-accent);
  font-weight: 600;
  background: var(--color-accent-soft);
}
.outline-level-1 {
  padding-left: 6px;
  font-weight: 600;
}
.outline-level-2 {
  padding-left: 18px;
}
.outline-level-3 {
  padding-left: 30px;
}
.outline-level-4 {
  padding-left: 42px;
}
.outline-level-5 {
  padding-left: 54px;
}
.outline-level-6 {
  padding-left: 66px;
}
.outline-empty {
  color: var(--color-text-faint);
  font-size: var(--fs-12);
  font-style: italic;
  padding: 4px 6px;
}
/* AG5/04: inline editor call surface — the invoke popover (right-click "Ask
   AI…" / Mod-Shift-A on a selection). Reuses the ctx-menu surface/shadow/
   open-transition treatment (same chrome, agent-branded accent). */
.inline-agent-popover {
  position: fixed;
  z-index: 200;
  /* Wide enough that the placeholder example never wraps mid-quote. */
  width: 380px;
  padding: var(--space-3);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-agent);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top left;
  transition:
    opacity var(--dur-quick) var(--ease-out),
    transform var(--dur-quick) var(--ease-out);
}
.inline-agent-popover.is-open {
  opacity: 1;
  transform: none;
}
.inline-agent-context {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.inline-agent-selcount {
  color: var(--color-agent);
  font-weight: 600;
}
.inline-agent-sep {
  color: var(--color-text-faint);
}
.inline-agent-path {
  font-family: var(--font-mono);
  color: var(--color-text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inline-agent-input {
  width: 100%;
  resize: vertical;
  font: inherit;
  font-size: var(--fs-13);
  color: var(--color-text-default);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: 6px 8px;
  outline: none;
}
.inline-agent-input:focus {
  outline: 1.5px solid var(--color-agent);
  outline-offset: -1px;
}
.inline-agent-status {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  padding: 4px 0;
}
.inline-agent-error {
  font-size: var(--fs-13);
  color: var(--color-danger);
}
.inline-agent-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}
.inline-agent-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: var(--fs-12);
  font-weight: 600;
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  cursor: pointer;
  background: var(--color-surface-substrate);
  color: var(--color-text-default);
}
.inline-agent-btn:hover {
  background: var(--color-surface-hover);
}
.inline-agent-ask,
.inline-agent-apply {
  border-color: var(--color-agent);
  background: var(--color-agent);
  color: var(--btn-accent-text);
}
.inline-agent-ask:hover,
.inline-agent-apply:hover {
  background: var(--color-agent-strong);
}
.inline-diff {
  max-height: 240px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  line-height: 1.5;
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  padding: 6px 0;
}
.inline-diff-row {
  padding: 1px 8px;
  white-space: pre-wrap;
}
.inline-diff-row.is-added {
  color: var(--color-success);
  background: color-mix(in srgb, var(--color-success) 12%, transparent);
}
.inline-diff-row.is-removed {
  color: var(--color-danger);
  background: color-mix(in srgb, var(--color-danger) 10%, transparent);
  text-decoration: line-through;
}
.inline-diff-row.is-same {
  color: var(--color-text-faint);
}
/* Left-anchored prose: the readable column starts from the editor's left edge
   (not centered) so when the file tree collapses or is dragged narrower, the
   text moves left with the pane instead of staying centered. max-width still
   caps line length for readability. */
.prose {
  max-width: 720px;
  margin: 0;
  padding: 0 var(--space-6);
  font-family: var(--font-prose);
  font-size: var(--fs-16);
  line-height: 1.66;
  color: var(--color-text-default);
}
.prose .lp-block {
  border-radius: var(--radius-2);
  padding: 1px 8px;
  margin: 0 -8px;
}
/* An empty source line preserved as vertical space in Reading view (one per
   blank line beyond the first between two blocks). The <br> gives it one
   line-height; it carries no content and is not a selection/edit target. */
.prose .lp-blank-line {
  user-select: none;
}
.prose .lp-clickable {
  cursor: text;
}
/* entry 8: no background tint on block hover — the text cursor already signals
   that a block is editable, and the fill was visually noisy. */
/* In-place edit (Obsidian live-preview): the block stays formatted while its
   markdown symbols show as muted markers; pre-wrap preserves newlines so the
   contenteditable's innerText round-trips back to the raw source. */
.prose .lp-edit {
  white-space: pre-wrap;
  outline: none;
  background: var(--color-accent-soft);
  box-shadow: inset 2px 0 0 var(--color-accent);
  border-radius: var(--radius-2);
  padding: 4px 10px;
  caret-color: var(--color-accent);
}
.prose .lp-edit .md-marker {
  color: var(--color-text-faint);
  opacity: 0.55;
  font-weight: 400;
}
/* Issue #526: editable empty-state for a zero-content note. The placeholder is a
   CSS ::before on the empty contenteditable, so it shows a "start writing" cue +
   caret (reads as a working editor, not a failed render) and never becomes part of
   the saved content. It disappears as soon as the user types. */
.prose .lp-empty-state {
  min-height: 1.6em;
  color: var(--color-text-default);
}
.prose .lp-empty-state:empty::before {
  content: attr(data-placeholder);
  color: var(--color-text-faint);
  font-style: italic;
  pointer-events: none;
}
.prose .lp-edit .rv-h1 {
  font-size: var(--fs-28);
  font-weight: 600;
}
.prose .lp-edit .rv-h2 {
  font-size: var(--fs-22);
  font-weight: 600;
}
.prose .lp-edit .rv-h3 {
  font-size: var(--fs-18);
  font-weight: 600;
}
.prose .lp-edit .rv-h4,
.prose .lp-edit .rv-h5,
.prose .lp-edit .rv-h6 {
  font-weight: 600;
}
.prose .lp-edit .rv-h1 .md-marker,
.prose .lp-edit .rv-h2 .md-marker,
.prose .lp-edit .rv-h3 .md-marker {
  font-weight: 600;
}
.prose .lp-edit .rv-code {
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.prose .lp-edit .rv-bullet {
  color: var(--color-accent);
  opacity: 0.85;
}
/* entry 3 (#538): CodeMirror live-preview editor (edit mode). The host #lp-prose
   keeps its readable column; CM fills it and inherits the prose type. View mode is
   unchanged (formatted blocks). */
.prose.cm-host {
  padding: 0;
}
.cm-host .cm-editor {
  background: transparent;
}
.cm-host .cm-editor.cm-focused {
  outline: none;
}
.cm-host .cm-scroller {
  font-family: var(--font-prose);
  line-height: 1.66;
}
/* AW9/05 — heading-section fold gutter: a slim, quiet strip to the left of
   the content column (matches the app's existing understated chrome). */
.cm-host .cm-gutters {
  background: transparent;
  border: none;
  color: var(--color-text-faint);
}
.cm-host .cm-foldGutter {
  width: 14px;
}
.cm-host .cm-gutterElement {
  cursor: pointer;
}
.cm-host .cm-foldPlaceholder {
  background: var(--color-surface-substrate);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-1);
  color: var(--color-text-faint);
  padding: 0 var(--space-2);
  margin: 0 2px;
}
.cm-host .cm-content {
  padding: 0 var(--space-6);
  max-width: 720px;
  font-size: var(--fs-16);
  color: var(--color-text-default);
  caret-color: var(--color-accent);
}
.cm-host .cm-line {
  padding: 0;
}
/* Drawn cursor + selection: CM's drawSelection ships light-only defaults (a
   black 1.2px caret, lavender selection fill) and the editor root is never
   flagged dark, so on the dark theme the caret was near-invisible and selected
   text sat white-on-lavender. Theme both with the app tokens (they switch by
   [data-theme], so one block covers both modes); the selectors out-rank CM's
   runtime-injected base theme, same as the autocomplete tooltip below. The
   agent page's instructions editor is a second CodeMirror outside .cm-host and
   needs the same treatment. */
.cm-host .cm-editor .cm-cursor,
.cm-host .cm-editor .cm-dropCursor,
.agentpg-body .cm-editor .cm-cursor,
.agentpg-body .cm-editor .cm-dropCursor {
  border-left-color: var(--color-accent);
}
.cm-host .cm-editor .cm-selectionBackground,
.cm-host
  .cm-editor.cm-focused
  > .cm-scroller
  > .cm-selectionLayer
  .cm-selectionBackground.cm-selectionBackground,
.agentpg-body .cm-editor .cm-selectionBackground,
.agentpg-body
  .cm-editor.cm-focused
  > .cm-scroller
  > .cm-selectionLayer
  .cm-selectionBackground.cm-selectionBackground {
  background: var(--color-accent-soft-2);
}
/* heading lines (Decoration.line classes) — match the view-mode sizes */
.cm-host .cm-line.cm-h1 {
  font-size: var(--fs-28);
  font-weight: 600;
  line-height: 1.25;
}
.cm-host .cm-line.cm-h2 {
  font-size: var(--fs-22);
  font-weight: 600;
  line-height: 1.3;
}
.cm-host .cm-line.cm-h3 {
  font-size: var(--fs-18);
  font-weight: 600;
}
.cm-host .cm-line.cm-h4,
.cm-host .cm-line.cm-h5,
.cm-host .cm-line.cm-h6 {
  font-weight: 600;
}
/* Frontmatter revealed under the caret is YAML being edited, not prose. The
   closing `---` reads as a setext heading underline to the markdown parser, so
   the heading weight has to be undone on these lines and their spans — the
   syntax highlighter styles straight from the parse tree. */
.cm-host .cm-line.cm-frontmatter-raw,
.cm-host .cm-line.cm-frontmatter-raw span {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 400;
  font-style: normal;
  color: var(--color-text-muted);
}
/* inline formatting marks */
.cm-host .cm-strong {
  font-weight: 600;
}
.cm-host .cm-em {
  font-style: italic;
}
.cm-host .cm-strike {
  text-decoration: line-through;
  color: var(--color-text-muted);
}
.cm-host .cm-inline-code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--code-bg);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-1);
  padding: 1px 5px;
}
/* AW7 slice 03: interactive tasks + inline-link + list/quote parity in Live
   Preview, mirroring the Reading-view weights (.task-check, .prose li, blockquote). */
.cm-host .cm-task-checkbox {
  width: 15px;
  height: 15px;
  margin: 0 0.4em 0 0;
  transform: translateY(2px);
  accent-color: var(--color-accent);
  cursor: pointer;
  vertical-align: baseline;
}
.cm-host .cm-line.cm-task-done {
  color: var(--color-text-faint);
  text-decoration: line-through;
}
.cm-host .cm-md-link,
.prose .md-link {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid var(--color-accent-soft-2);
  cursor: pointer;
}
.cm-host .cm-md-link:hover,
.prose .md-link:hover {
  border-bottom-color: var(--color-accent);
}
/* Reading-view strikethrough — same weight as Live Preview's cm-strike. */
.prose .md-strike {
  text-decoration: line-through;
  color: var(--color-text-muted);
}
/* Reading-view plain blockquote — the same visual weight Live Preview gives
   quoted lines (cm-blockquote), markers stripped. */
.prose .md-quote-block {
  border-left: 3px solid var(--color-border-strong);
  padding-left: var(--space-3);
  margin: 0;
  color: var(--color-text-muted);
}
.cm-host .cm-list-mark {
  color: var(--color-text-muted);
}
.cm-host .cm-line.cm-blockquote {
  border-left: 3px solid var(--color-border-strong);
  padding-left: var(--space-3);
  color: var(--color-text-muted);
}
.cm-host .cm-quote-mark {
  color: var(--color-text-faint);
}
/* AW9/02 — inline constructs: highlight / comment / tag, shared between
   Reading view (.md-highlight / .tag-chip, string-rendered) and Live Preview
   (.cm-highlight / .cm-tag marks + .tag-chip widget). */
.md-highlight,
.cm-highlight {
  background: var(--color-warn-dot);
  color: var(--color-text-invert);
  border-radius: 2px;
  padding: 0 2px;
}
.cm-host .cm-comment-dim {
  opacity: 0.4;
}
.cm-host .cm-comment-active {
  color: var(--color-text-muted);
}
.tag-chip,
.cm-host .cm-tag {
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-size: 0.9em;
  text-decoration: none;
  cursor: pointer;
}
.tag-chip:hover,
.cm-host .cm-tag:hover {
  background: var(--color-accent-soft-2);
}

/* The hover beside a picker option (the agent page's `[[` picker): where the
   item lives, then what it does. CM draws it as its own tooltip beside the
   list, so it takes the same floating surface. */
.cm-tooltip.cm-tooltip-autocomplete .cm-tooltip.cm-completionInfo {
  max-width: 18em;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-2);
  color: var(--color-text-default);
  font-size: var(--fs-12);
  line-height: 1.5;
}
.agentpg-pick-where {
  color: var(--color-text-muted);
}
/* A source that groups its options (the agent page's `[[` picker) heads each
   group with an F15 group label. */
.cm-tooltip.cm-tooltip-autocomplete completion-section {
  display: block;
  padding: var(--space-2) 10px var(--space-1);
  border-bottom: none;
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--color-text-faint);
  opacity: 1;
}

/* AW9/03 — embeds & images: shared by Reading view (.lp-block > .embed-*) and
   the Live-Preview block widget (.cm-block-widget > .embed-*). */
.embed-image {
  margin: 0.6em 0;
}
.embed-image img {
  max-width: 100%;
  border-radius: var(--radius-2);
  display: block;
}
.embed-image.is-broken {
  border: var(--border-thin) dashed var(--color-border-strong);
  border-radius: var(--radius-2);
  color: var(--color-text-faint);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-13);
}
.embed-transclusion {
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate);
  padding: var(--space-2) var(--space-4);
  margin: 0.6em 0;
}
.embed-transclusion-header {
  margin-bottom: var(--space-1);
}
.embed-transclusion-header .embed-source-link {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  border-bottom-color: var(--color-border-strong);
}
.embed-transclusion-body > :first-child {
  margin-top: 0;
}
.embed-transclusion-body > :last-child {
  margin-bottom: 0;
}
.embed-broken {
  color: var(--color-danger);
  border: var(--border-thin) dashed var(--color-danger);
  border-radius: var(--radius-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-13);
  margin: 0.6em 0;
}
/* An HTML page embedded in a note, inside the F28 embed frame: the page's own
   frame flush in the body, at the height set where it is built — the page's
   reported height, a fixed one, or the note's `|<height>` — and anything
   taller scrolls inside it. */
.embed-page-frame {
  display: block;
}
/* A website shown live, inside the F28 embed frame: the site's frame flush in
   the body, at the embed's height or a provider's shape, set where it is
   built. */
.embed-web-frame {
  display: block;
  width: 100%;
  border: 0;
}
/* A portrait provider frame (a YouTube Short): a phone's width, centred, so
   its height stays within 40rem however wide the column is. */
.embed-web-frame.is-portrait {
  width: min(100%, 22.5rem);
  margin: 0 auto;
}

/* An embed's line in Live Preview while the caret is elsewhere: folded away,
   leaving the frame drawn beneath it. The caret arriving unfolds it, so the
   source shows above the frame that stays where it was. */
.cm-line.cm-embed-source.is-folded {
  height: 0;
  padding: 0;
  overflow: hidden;
}

/* AW9/04 — Live-Preview table editing. Always the editable grid (Obsidian
   parity — a table never reverts to raw pipes on cursor-enter); every edit
   dispatches into the source pipes (editor.js commit path). */
.cm-table-edit {
  margin: 0.6em 0;
  overflow-x: auto;
}
.cm-editable-table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-14);
}
.cm-editable-table th,
.cm-editable-table td {
  border: var(--border-thin) solid var(--color-border-default);
  padding: var(--space-1) var(--space-2);
  text-align: left;
  vertical-align: top;
  position: relative;
}
.cm-editable-table thead th {
  background: var(--color-surface-substrate);
  font-weight: 600;
}
.cm-table-cell-input {
  display: inline-block;
  min-width: 24px;
  min-height: 1.2em;
  outline: none;
}
.cm-table-cell-input:focus {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.cm-table-col-remove,
.cm-table-col-add {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  line-height: 14px;
  border: none;
  background: transparent;
  color: var(--color-text-faint);
  cursor: pointer;
  border-radius: var(--radius-1);
  font-size: var(--fs-12);
  padding: 0;
}
.cm-table-col-remove:hover,
.cm-table-col-add:hover {
  background: var(--color-surface-hover);
  color: var(--color-danger);
}
.cm-table-addcol {
  width: 28px;
  background: transparent;
  border: none;
}
.cm-table-rowctrl {
  width: 24px;
  text-align: center;
  border: none;
  background: transparent;
  padding: 0;
}
.cm-table-row-remove {
  border: none;
  background: transparent;
  color: var(--color-text-faint);
  cursor: pointer;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-1);
  font-size: var(--fs-12);
}
.cm-table-row-remove:hover {
  background: var(--color-surface-hover);
  color: var(--color-danger);
}
.cm-table-addrow-tr td {
  border: none;
  padding-top: var(--space-1);
}
.cm-table-row-add {
  border: var(--border-thin) dashed var(--color-border-default);
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  padding: 2px 10px;
  border-radius: var(--radius-2);
  cursor: pointer;
}
.cm-table-row-add:hover {
  color: var(--color-accent);
  border-color: var(--color-accent-soft-2);
}
/* block widgets (fenced code, frontmatter properties) rendered when the cursor is
   elsewhere; reuse the existing .properties-strip / pre / fenced-slot styles. */
.cm-host .cm-block-widget {
  padding: var(--space-2) 0;
}
.cm-host .cm-block-widget pre {
  background: var(--code-bg);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  padding: var(--space-3) var(--space-4);
  overflow: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  line-height: 1.5;
  margin: 0;
}
/* defensive fallback when the CM bundle is missing */
.cm-fallback {
  width: 100%;
  min-height: 60vh;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  line-height: 1.6;
  color: var(--color-text-default);
  padding: 0 var(--space-6);
}
/* view-mode empty-note hint */
.lp-empty-view {
  color: var(--color-text-faint);
  font-style: italic;
}
/* Issue #630: end-of-document landing. Hidden by default so it never inflates
   the scroll height it is measured against; revealed (with a quiet fade) only
   when the document is shorter than the viewport — see renderEndOfDoc(). */
.editor-eod {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  max-width: 720px;
  margin: var(--space-7) auto var(--space-6);
  padding: var(--space-5) var(--space-6) 0;
  border-top: var(--border-thin) solid var(--color-border-default);
  opacity: 0;
  transition: opacity var(--dur-standard) var(--ease-out);
}
.editor-eod.is-visible {
  display: flex;
  opacity: 1;
}
.editor-eod-mark {
  color: var(--color-text-faint);
  font-size: var(--fs-16);
  letter-spacing: 0.3em;
}
.editor-eod-meta {
  color: var(--color-text-faint);
  font-size: var(--fs-12);
  font-family: var(--font-mono);
}
/* the book/pen edit-view toggle sits at the far right of the editor topbar */
.editor-mode-toggle.is-on,
.editor-mode-toggle[aria-pressed='true'] {
  color: var(--color-accent);
}
/* AW8 slice 03: transient image-paste/drop notice (e.g. "needs the real app"). */
.editor-paste-notice {
  position: sticky;
  bottom: var(--space-4);
  left: 0;
  margin: var(--space-3) auto 0;
  max-width: 480px;
  background: var(--color-surface-substrate);
  color: var(--color-text-muted);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: 8px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-12);
  text-align: center;
  box-shadow: var(--shadow-2);
}
.prose h1 {
  font-size: var(--fs-28);
  font-weight: 600;
  margin: 0.3em 0 0.2em;
}
.prose h2 {
  font-size: var(--fs-22);
  font-weight: 600;
  margin: 0.7em 0 0.2em;
}
.prose p {
  margin: 0.55em 0;
}
.prose ul {
  margin: 0.55em 0;
  padding-left: 1.4em;
}
.prose li {
  margin: 0.25em 0;
}
.prose strong {
  font-weight: 600;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--code-bg);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-1);
  padding: 1px 5px;
}
.prose pre {
  background: var(--code-bg);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  padding: var(--space-3) var(--space-4);
  overflow: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  line-height: 1.5;
}
.wikilink {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid var(--color-accent-soft-2);
}
a.wikilink {
  cursor: pointer;
}
a.wikilink:hover {
  border-bottom-color: var(--color-accent);
}
.wikilink.broken {
  color: var(--color-danger);
  border-bottom-style: dotted;
}
/* A link to a PLACE in the app rather than a file. Same family as a file
   wikilink — it is the same thing to a reader, somewhere to click through to —
   distinguished only by a dashed underline, because "this leaves the document"
   is the one fact worth carrying and a second colour would read as a second
   kind of link. */
.wikilink--surface {
  border-bottom-style: dashed;
}

/* AW9/01 — Obsidian callouts (`> [!type]`). Shared by Reading view
   (.lp-block > .callout) and the Live-Preview block widget (.cm-block-widget
   > .callout) — one visual treatment, one DOM builder (buildCalloutDom). Each
   `.callout-color-*` variant maps to an existing D4 status/accent token
   rather than a new bespoke hue per callout type. */
.callout {
  border: var(--border-thin) solid var(--color-border-default);
  border-left-width: var(--border-emphasis);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate);
  padding: var(--space-2) var(--space-4);
  margin: 0.55em 0;
}
.callout-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.callout-icon {
  display: inline-flex;
  flex: 0 0 auto;
}
.callout-title {
  font-weight: 600;
  flex: 1 1 auto;
}
.callout-fold-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: var(--radius-1);
  transition: transform var(--dur-quick) var(--ease-out);
}
.callout-fold-toggle:hover {
  color: var(--color-text-default);
}
.callout.is-collapsed .callout-fold-toggle {
  transform: rotate(-90deg);
}
.callout-body {
  margin-top: var(--space-1);
}
.callout.is-collapsed .callout-body {
  display: none;
}
.callout-text > :first-child {
  margin-top: 0;
}
.callout-text > :last-child {
  margin-bottom: 0;
}
.callout .callout {
  margin: 0.5em 0;
} /* nested callout spacing */
.callout-color-accent {
  border-left-color: var(--color-accent);
}
.callout-color-accent .callout-icon,
.callout-color-accent .callout-title {
  color: var(--color-accent);
}
.callout-color-success {
  border-left-color: var(--color-success);
}
.callout-color-success .callout-icon,
.callout-color-success .callout-title {
  color: var(--color-success);
}
.callout-color-warn {
  border-left-color: var(--color-warn);
}
.callout-color-warn .callout-icon,
.callout-color-warn .callout-title {
  color: var(--color-warn);
}
.callout-color-danger {
  border-left-color: var(--color-danger);
}
.callout-color-danger .callout-icon,
.callout-color-danger .callout-title {
  color: var(--color-danger);
}
.callout-color-muted {
  border-left-color: var(--color-border-strong);
}
.callout-color-muted .callout-icon,
.callout-color-muted .callout-title {
  color: var(--color-text-muted);
}

/* AG5/08 — citation hover preview popover (editor.js wireWikilinks). Fixed
   position, computed from the hovered link's bounding rect. */
.wikilink-preview {
  position: fixed;
  z-index: 60;
  max-width: 320px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  box-shadow: var(--shadow-2);
  font-size: var(--fs-12);
  line-height: 1.45;
  pointer-events: none;
}
.wikilink-preview-title {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}
.wikilink-preview-body {
  color: var(--color-text-faint);
}
/* Issue #509: frontmatter properties — the document's metadata at the top of the
   editor, in place of the raw `---` YAML block. One property per row: a fixed
   key column and a value column, separated by a hairline rule, so keys line up
   and long values wrap inside their own column instead of pushing the next
   property onto a new line mid-key. */
.properties-strip {
  display: flex;
  flex-direction: column;
  margin: 0 0 var(--space-4);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  overflow: hidden;
}
/* The fold control. The chevron sits in a gutter INSIDE the properties box at
   its top-left, and holds that exact position whether the box is open or
   folded — pressing it never moves it out from under the pointer. Folded, the
   box shrinks to a single strip carrying the same chevron and the word
   "Properties", so the control still reads as belonging to the metadata rather
   than to the first line of body text underneath it. */
.properties-foldable {
  position: relative;
  padding-left: var(--space-5);
}
.properties-fold {
  position: absolute;
  left: var(--space-1);
  top: var(--space-1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 20px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text-faint);
  cursor: pointer;
}
.properties-fold:hover {
  color: var(--color-text-default);
}
.properties-fold:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
  border-radius: var(--radius-1);
}
.properties-fold-icon {
  transition: transform 120ms ease;
}
.properties-foldable.is-collapsed .properties-fold-icon {
  transform: rotate(-90deg);
}
/* The folded strip's own label — the only thing left in the box when the rows
   are away. Same padding as a property row, so the chevron beside it lands on
   the same baseline it had when the box was open. */
.properties-fold-name {
  display: none;
  padding: 5px var(--space-3);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.properties-foldable.is-collapsed .properties-fold-name {
  display: block;
}
.properties-foldable.is-collapsed > .property-row,
.properties-foldable.is-collapsed > .properties-raw-flag,
.properties-foldable.is-collapsed > .properties-raw-src {
  display: none;
}
.property-row {
  display: grid;
  grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--space-3);
  padding: 5px var(--space-3);
  font-size: var(--fs-12);
}
.property-row + .property-row {
  border-top: var(--border-thin) solid var(--color-border-default);
}
.property-key {
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  text-transform: lowercase;
  /* The key names the row; it is never worth two lines. Overlong keys clip and
     carry the full text as a tooltip. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-value {
  color: var(--color-text-default);
  overflow-wrap: anywhere;
}
/* A property with no value yet — the placeholder keeps the cell readable and,
   in Reading view, clickable. */
.property-value.is-empty {
  color: var(--color-text-faint);
  font-style: italic;
}
/* AW10/02 — editable property rows, in Reading view and in Live Preview's
   widget alike. Rows rendered read-only (a transcluded note's properties) omit
   .is-editable and so get none of this. */
.property-row.is-editable .property-value {
  cursor: text;
  border-radius: var(--radius-1);
  padding: 0 3px;
  margin: 0 -3px;
}
.property-row.is-editable .property-value:hover,
.property-row.is-editable .property-value:focus-visible {
  background: var(--color-surface-overlay);
  outline: none;
}
.property-value-input,
.property-key-input {
  font: inherit;
  color: var(--color-text-default);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-accent-soft-2);
  border-radius: var(--radius-1);
  padding: 0 2px;
  min-width: 3em;
  width: 100%;
  outline: none;
}
/* Same focus treatment as the tree's inline rename input, rather than the
   browser's default ring — which renders as a heavy black box against the
   editor surface. */
.property-value-input:focus,
.property-key-input:focus {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.property-key-input {
  font-family: var(--font-mono);
  text-transform: lowercase;
}
.property-delete {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-text-faint);
  font-size: var(--fs-12);
  line-height: 1;
  padding: 0 0 0 2px;
  opacity: 0.35;
}
.property-row:hover .property-delete,
.property-delete:focus-visible {
  opacity: 1;
}
.property-delete:hover {
  color: var(--color-danger);
}
.property-add-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-text-faint);
  font-size: var(--fs-12);
  font-family: var(--font-mono);
  padding: 0;
  text-align: left;
  grid-column: 1 / -1;
}
.property-add-btn:hover {
  color: var(--color-accent);
}
.fenced-slot {
  display: block;
  margin: 0.5em 0;
  border: var(--border-thin) dashed var(--color-border-strong);
  border-radius: var(--radius-3);
  padding: var(--space-3);
  background: var(--color-surface-substrate);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
}

/* AW12/04 — srfice-query live block */
.srf-query-block {
  display: block;
  margin: 0.5em 0;
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-3);
  padding: var(--space-3);
  background: var(--color-surface-substrate);
}
.srf-query-error-note {
  color: var(--color-danger);
  font-size: var(--fs-12);
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
}
.srf-query-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.srf-query-label {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.srf-query-refreshed {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.srf-query-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.srf-query-empty {
  color: var(--color-text-faint);
  font-size: var(--fs-13);
  font-style: italic;
}

/* SR-Q3 — "showing first N" label on a capped srfice-query result set */
.srf-query-capped {
  list-style: none;
  margin-top: 4px;
  color: var(--color-text-faint);
  font-size: var(--fs-12, var(--fs-13));
  font-style: italic;
}

/* AW12/01+02 — provenance trail affordance + panel */
.provenance-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  vertical-align: super;
}
.provenance-panel {
  position: fixed;
  z-index: 200;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-3);
  padding: var(--space-3);
  max-width: 420px;
  max-height: 60vh;
  overflow-y: auto;
}
.provenance-panel-title {
  font-weight: 600;
  font-size: var(--fs-13);
  margin-bottom: var(--space-2);
}
.provenance-record {
  border-top: var(--border-thin) solid var(--color-border-default);
  padding: var(--space-2) 0;
  font-size: var(--fs-12);
}
.provenance-record:first-child {
  border-top: none;
}
.provenance-record-meta {
  color: var(--color-text-faint);
}
.provenance-record-rationale {
  margin: 4px 0;
}
.provenance-revert-btn {
  margin-top: 4px;
  font-size: var(--fs-12);
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-2);
  background: transparent;
  padding: 2px 8px;
  cursor: pointer;
}
.provenance-revert-btn:hover {
  background: var(--color-surface-substrate);
}
.provenance-revert-error {
  color: var(--color-danger);
  font-size: var(--fs-12);
  margin-top: 4px;
}

/* AW12/03 — visibly-flagged invalid citation */
.wikilink-invalid-citation {
  text-decoration: line-through;
  color: var(--color-text-faint);
  cursor: help;
}

/* D3 / A-X2 — a citation whose target was renamed away or deleted after the
   message was written. Builds on .wikilink.broken (dotted danger underline)
   with a wavy underline + help cursor to read as "stale", not just unresolved. */
.wikilink-stale-citation {
  text-decoration: underline wavy var(--color-danger);
  text-underline-offset: 2px;
  cursor: help;
}

/* ---------- 6. Search, as the agent object's body ---------- */
/* This was the command palette's own overlay: a scrim over the page and a box
   floating in it, with a field of its own at the top. All of that is the
   object's now — its frame is the box, its composer is the field, and a stable
   object the reader put somewhere has nothing to dim the page for. What is left
   here is the renderer: sections, rows, the empty state and the key strip.

   The node keeps its own class so the rules below stay one block, but it draws
   no chrome: it is a body inside a surface that has already been drawn. */
.palette {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: transparent;
  border: 0;
  border-radius: 0 0 var(--radius-3) var(--radius-3);
  overflow: hidden;
}
/* The list fits its content and scrolls past the object's own cap, rather than
   carrying a viewport fraction of its own: two height rules on one surface
   would be two answers to the same question. */
.plist {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-2);
}
.psection {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  padding: var(--space-2) var(--space-2) 4px;
}
.prow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  padding: 7px var(--space-2);
  border-radius: var(--radius-2);
  cursor: pointer;
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  border-left: 2px solid transparent;
}
.prow-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.prow .title {
  color: var(--color-text-default);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prow .sub {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Issue #686: path sub-labels middle-truncate — the start ellipsizes, the tail
   (filename + immediate parent) stays pinned, mirroring the tree rows (#606). */
.prow .sub--path {
  display: flex;
  min-width: 0;
}
.prow .sub-path-start {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.prow .sub-path-end {
  flex: none;
  white-space: nowrap;
}
/* Issue #275: relevance score chip + matched-snippet preview for content hits. */
.prow .score {
  margin-left: auto;
  flex: none;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-accent);
}
.prow .score + .badge {
  margin-left: 8px;
}
.prow .snippet {
  font-size: var(--fs-11);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prow .badge {
  margin-left: auto;
  flex: none;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-faint);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-1);
  padding: 1px 6px;
}
.prow .score ~ .badge {
  margin-left: 8px;
}
.prow.sel {
  background: var(--color-accent-soft);
  border-left-color: var(--color-accent);
}
/* Issue #276: explicit no-results state. */
.pempty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: var(--space-3) var(--space-2);
}
.pempty-msg {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
/* The one line out of a search that found nothing. Agent blue because it leads
   to the agent, and a line rather than a button because it does not dispatch
   anything: it flips the object to its other body with the typed text still in
   the field, and what happens next is the reader's. */
.pempty-fallback {
  display: block;
  width: 100%;
  font-size: var(--fs-13);
  color: var(--color-agent);
  font-weight: 600;
  text-align: left;
  padding: 0 var(--space-2) var(--space-3);
}
.pempty-fallback:hover {
  text-decoration: underline;
}
.palette .hint {
  flex: none;
  display: flex;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-4);
  border-top: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-substrate);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  border-radius: 0 0 var(--radius-3) var(--radius-3);
}
.kbd {
  font-family: var(--font-mono);
  border: var(--border-thin) solid var(--color-border-default);
  border-bottom-width: 2px;
  border-radius: var(--radius-1);
  padding: 0 5px;
}

/* ---------- 7. View-model inspector drawer (playground-specific) ---------- */
.insp-drawer {
  position: fixed;
  top: 56px;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 92vw;
  z-index: var(--z-under-topbar);
  background: var(--color-surface-readable);
  border-left: var(--border-thin) solid var(--color-border-default);
  box-shadow: var(--shadow-3);
  transform: translateX(100%);
  transition: transform var(--dur-standard) var(--ease-out);
  display: flex;
  flex-direction: column;
}
.insp-drawer.open {
  transform: none;
}
.insp-drawer-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.insp-drawer-head .title {
  font-weight: 600;
  font-size: var(--fs-13);
  flex: 1;
}
.insp-drawer-head .sub {
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
.insp-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: var(--space-2) var(--space-4);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.insp-tabs button {
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-11);
  color: var(--color-text-muted);
  border: var(--border-thin) solid var(--color-border-default);
}
.insp-tabs button:hover {
  background: var(--color-surface-hover);
}
.insp-tabs button.on {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-soft-2);
  color: var(--color-accent);
}
.insp {
  padding: var(--space-3) var(--space-4);
  overflow: auto;
}
.insp .sec-title {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-muted);
  margin: var(--space-3) 0 4px;
}
.insp pre {
  background: var(--code-bg);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: var(--space-2);
  overflow: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  line-height: 1.5;
  color: var(--color-success);
  white-space: pre-wrap;
  word-break: break-word;
}
.note {
  color: var(--color-text-faint);
  font-size: var(--fs-12);
  margin: 6px 0;
}

/* ---------- 8. P6/02 route control (homepage ⇆ folder-surface) ---------- */
/* The route button sits in the top bar between the brand and the pill.
   It navigates between the two built surfaces; no unbuilt routes are present. */
.route-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  margin-left: var(--space-1);
  border-radius: var(--radius-2);
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-accent);
  border: var(--border-thin) solid var(--color-accent-soft-2);
  background: var(--color-accent-soft);
  transition:
    background-color var(--dur-quick) var(--ease-out),
    border-color var(--dur-quick) var(--ease-out);
}
.route-btn:hover {
  background: var(--color-accent-soft-2);
  border-color: var(--color-accent);
}

/* ---------- 9. P6/02 homepage route pane (draft-fidelity) ---------- */
/* The homepage ground is a field of faint dots that answers the pointer. It is
   a canvas inside `.homepage-pane`, drawn by playground/src/home/dot-field.js,
   so it scrolls with the cards and sits under them. */

/* Main grid variant for the homepage route — no sidebar, full width. It is the
   scroll container; the dot field lives in the pane, so it scrolls with the
   content. */
.main--homepage {
  display: block;
  overflow: auto;
  min-height: 0;
  background-color: var(--color-bg);
}

.homepage-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 57px);
  background: transparent;
  gap: var(--space-6);
  padding: var(--space-8) var(--space-5) var(--space-7);
  position: relative;
}
/* The dot field fills the pane under everything in it. */
.homepage-pane > .dot-field {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 0;
}
.homepage-pane > :not(.dot-field) {
  position: relative;
  z-index: 1;
}

/* ---------- The header ----------
   The surface head every surface wears — "Workspaces", how many and in what
   order — on the left, and Find workspace with the one New menu on the right,
   in a centred column narrower than the grid: a launcher's head is a quiet
   strip over the cards, and at this width the count sits under the title. */
.home-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  max-width: 780px;
}
.home-head .surface-head {
  margin-bottom: 0;
}

/* The popover the chips open. Anchored above its chip, because the capture bar
   it hangs off sits at the bottom of the panel. */
.hpanel-pick-pop {
  position: absolute;
  bottom: calc(100% + var(--space-1));
  left: 0;
  z-index: 40;
  width: 216px;
  padding: var(--space-2);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-3);
  font-size: var(--fs-12);
}
.hpanel-pick-pop--narrow {
  width: 168px;
}
.hpanel-pick-group {
  padding: 2px var(--space-2) var(--space-1);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}
.hpanel-pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
  padding: 2px var(--space-1) var(--space-1);
}
.hpanel-pick-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: none;
  background: transparent;
  border: none;
  border-radius: var(--radius-1);
  color: var(--color-text-faint);
  cursor: pointer;
}
.hpanel-pick-step:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
.hpanel-pick-month {
  flex: 1 1 auto;
  text-align: center;
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-text-default);
}
.hpanel-pick-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  padding: 0 2px;
}
.hpanel-pick-dow {
  padding: 2px 0;
  font-size: 9px;
  color: var(--color-text-faint);
  text-align: center;
}
.hpanel-pick-day {
  padding: 3px 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-1);
  font-family: var(--font-ui);
  font-size: var(--fs-11);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-default);
  cursor: pointer;
}
.hpanel-pick-day:hover {
  background: var(--color-accent-soft);
}
.hpanel-pick-day.is-outside {
  color: var(--color-text-faint);
  opacity: 0.55;
}
.hpanel-pick-day.is-today {
  font-weight: 600;
  color: var(--color-accent);
}
/* The picked day is the one filled solid — the only state that has to survive
   sitting next to both "today" and a hover. */
.hpanel-pick-day.is-picked {
  background: var(--color-accent);
  color: var(--color-surface-readable);
}
.hpanel-pick-sep {
  height: 1px;
  margin: var(--space-2) 4px;
  background: var(--color-border-default);
}
.hpanel-pick-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 4px var(--space-2);
  background: transparent;
  border: none;
  border-radius: var(--radius-1);
  font-family: var(--font-ui);
  font-size: var(--fs-12);
  color: var(--color-text-default);
  text-align: left;
  cursor: pointer;
}
.hpanel-pick-row:hover {
  background: var(--color-accent-soft);
}
.hpanel-pick-row.is-on {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
.hpanel-pick-tick {
  margin-left: auto;
  color: var(--color-accent);
}

.hsheet-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0 var(--space-1);
}
.hsheet-time {
  background: transparent;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-1);
  font: inherit;
  font-size: var(--fs-12);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-default);
  padding: 1px var(--space-1);
}

/* agentInputSlot — centered agent-input pill */
/* Narrower than the workspace grid below it, so the surface has a focal point
   rather than three stacked full-width bands. */
/* Issue #575: the homepage agent input is an editable field, not a static
   placeholder span. The placeholder is a CSS ::before on the empty field. */
/* Issue #597: agent-history affordance on the homepage composer — opens the
   chat panel's archived-sessions view without sending a message. */
/* "+" overflow trigger on the homepage box — opens the menu to stage a file /
   skill / upload onto the first message. Shares the quiet outline treatment of
   the history button. */
/* Staged attachment/skill chips above the box, and the model-picker row below
   it — both align to the box's column. */

/* Issue #626: agent present-but-disabled (no key/model). The box reads as
   unavailable rather than an inviting field that swallows every keystroke. */

/* Resume banner — reopen the most recently archived home conversation. Shown
   in the grid (non-conversation) mode, just under the agent box. */

/* Conversation mode: the full-screen chat panel covers the home route, so the
   grid pane behind it is intentionally empty. */

.home-workspaces {
  width: 100%;
  max-width: 1560px;
  margin-top: var(--space-2);
}
/* The homepage's primary action, filled rather than outlined. Shared with the
   empty state's "Create a workspace", which is the same gesture. */
/* F04 primary — the surface's one loud button. The accent-bg/text pair is
   theme-invariant, so the button reads identically in both themes; hover is
   the same brightness lift the other primaries use. */
.home-new-workspace-btn {
  flex: none;
  padding: var(--row-pad) var(--space-4);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid transparent;
  background: var(--btn-accent-bg);
  color: var(--btn-accent-text);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
}
.home-new-workspace-btn:hover {
  filter: brightness(1.06);
}
/* The header's action row. */
.home-new-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
/* Find workspace — F13's wrapper field: the box owns the border, the input
   inside is bare. */
.home-workspace-search-field {
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: var(--space-2);
  width: 240px;
  padding: 0 var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
}
.home-workspace-search-field:focus-within {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.home-workspace-search-icon {
  color: var(--color-text-muted);
  flex: none;
}
.home-workspace-search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  font-size: var(--fs-13);
  color: var(--color-text-default);
  padding: var(--row-pad) 0;
}

.home-workspaces-note {
  color: var(--color-text-faint);
  font-size: var(--fs-13);
  padding: var(--space-3) 0;
}
/* Sits on the no-matches note as a link rather than a button: the way out of
   an over-narrow search, not an action competing with the grid. */
.home-workspaces-note-clear {
  margin-left: var(--space-2);
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: underline;
}
/* Fresh-workspace empty state — replaces the synthesized whole-root workspace
   card with an explainer plus the two real starting actions. */
.home-empty-state {
  max-width: 420px;
  margin: var(--space-4) auto 0;
  padding: var(--space-4);
  border: var(--border-thin) dashed var(--color-border-default);
  border-radius: var(--radius-2);
  text-align: center;
}
.home-empty-title {
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--color-text-default);
}
.home-empty-body {
  margin-top: var(--space-1);
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.home-empty-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
/* F04 button, ghost emphasis, default size — NOT the F23 text link its old
   name claimed. It is the third control in the action strip above, beside the
   two filled ways in, and pressing it starts a note rather than going
   somewhere; its padding, size and weight already matched F04's default rung
   exactly. What it had borrowed from a link was the accent and a hover
   underline, and what it was missing was the box its two siblings wear. Ghost
   because one filled button in a box this small is enough to say where the
   ordinary path starts.

   Transparent fill and transparent border at rest, so it reads as no raised
   object and stays out of the `srf-press-dip` block; the border is carried as
   transparent rather than dropped so it lines up with the filled siblings
   instead of sitting a pixel taller under the pointer. */
.home-empty-note-btn {
  padding: var(--row-pad) var(--space-4);
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
}
.home-empty-note-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
/* Whole-root card badge: marks the implicit workspace-root card so it never
   reads as a duplicate workspace named after the workspace. */
.pcard-root-badge {
  margin-left: var(--space-1);
  padding: 1px 7px;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  white-space: nowrap;
  flex: none;
}

/* ---------- 10. P6/03 chat panel (D4 draft §1693–1932) ---------- */
/* Persistent, collapsible right-side pane.  When .is-open, slides in from the
   right (translateX 0); when collapsed, off-screen (translateX calc(100% + 24px)).
   The main grid shrinks its editor column to make room. */

/* When the chat panel is open, the main grid's right column widens
   to the panel's (resizable) width via --rail-w — set on :root by applyPaneVars
   in app.js — so the editor reflows beside it instead of being overlaid. */

/* Chat panel — fixed right-side pane, slides in/out */
.chat-panel {
  position: fixed;
  top: 56px; /* flush under the full-height topbar (entry 3) */
  right: 0;
  bottom: 0;
  width: var(--rail-w-open, 360px);
  /* Sit below the top bar in the stacking order so the bar (z 60) is never
     overlapped by the panel. */
  z-index: 55;
  background: var(--color-surface-readable);
  /* The panel's outer edge carries the agent register: this is the machine's
     chrome, and the border is the only part of it the page sees from outside.
     Only the left edge is drawn — the other three sit flush against the top
     bar and the viewport's own edges, where a hairline reads as a rendering
     artifact rather than as the frame of an object. */
  border-left: var(--border-thin) solid var(--color-agent);
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  transform: translateX(calc(100% + 24px));
  transition: transform var(--dur-deliberate) var(--ease-out);
}
.chat-panel.is-open {
  transform: translateX(0);
}
/* Full screen: the panel takes the main area's place, from the sidebar's edge
   to the window's, under the top bar. The sidebar and the bar stay where they
   are — collapsing the sidebar hands all but the nav rail's 40px over, since
   --tree-w is the rail's width then. A build page's switcher stays too
   (--column-start is its width there).
   It keeps the rail's layout and the rail's left edge, because it is the same
   column grown to the page's width rather than an object over it. An open
   Files column stays beside it too, so a note can be dragged from it into the
   conversation. */
.chat-panel.is-full {
  left: calc(var(--column-start, 0px) + var(--tree-w, 0px) + var(--files-w, 0px));
  width: auto;
}
/* On a build page with its page hidden the assistant is the whole window and the
   rail is all that stands at the left, so --tree-w (the assistant column's width in
   split) is not something the panel clears. */
body:has(.shell-body.is-page-hidden) .chat-panel.is-full {
  left: calc(var(--column-start, 0px) + var(--files-w, 0px));
}

/* ---------------------------------------------------------------------------
   The agent object: the same panel node, floating or parked on an edge.

   Three placements share one element. Docked is the rail above. Floating lifts
   it out as an object over the page, and tucked parks that object on a window
   edge as a slim tab. JS writes left/top/width/height inline from the stored
   anchor, because only a running window knows what those resolve to.
   --------------------------------------------------------------------------- */

/* The rail draws its blue edge on the left alone, because its other three sides
   sit against the top bar and the viewport, where a hairline reads as a
   rendering artifact. A floating object has four visible sides, so it wears the
   whole frame. It sits above the top bar and the rail, on the layer the
   palette's overlay used to have: it is what replaced it. */
.chat-panel.is-floating {
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: var(--float-card-w);
  height: auto;
  /* JS draws a height on every open object. This cap is the room below the
     bar, whose landing --fo-top carries from the measured top bar, so the card
     fits and a taller one scrolls its thread. */
  max-height: calc(100vh - var(--fo-top, 80px) - var(--space-5));
  min-width: min(360px, calc(100vw - var(--space-6)));
  max-width: min(720px, calc(100vw - var(--space-6)));
  z-index: 120;
  border: var(--border-thin) solid var(--color-agent);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-3);
  /* Visible, not hidden: the drag handle hangs outside the frame. The corners
     stay clean because the tab strip and the composer round themselves. */
  overflow: visible;
  /* An object is where it was put, so it does not slide in from an edge the way
     the rail does. */
  transform: none;
  transition: none;
}
/* The rail hides itself by sliding off the edge, and the `transform: none`
   above cancels that. Without this rule a closed object is not off-screen but
   sitting where it was last left — nothing to see, and solid to the pointer, so
   it swallowed clicks on whatever it covered. An object that has been closed is
   not on the page at all. */
.chat-panel.is-floating:not(.is-open) {
  display: none;
}

/* The composer is last, as docked, with the agent rule on its top edge (the
   base rule). Floating, the object is a rounded box, so what sits at its foot
   takes the bottom corners: the composer, or the run's foot line under it. */
.chat-panel.is-floating .chat-composer {
  border-radius: 0 0 var(--radius-3) var(--radius-3);
}
.chat-panel.is-floating .chat-composer:has(~ .chat-run-foot) {
  border-radius: 0;
}
.chat-panel.is-floating .chat-run-foot {
  border-radius: 0 0 var(--radius-3) var(--radius-3);
}

/* The mode pair at the head of the composer row: the two things this box can be
   asked for, side by side in one hairline box. The active half sits on a
   stepped ground and the inactive one goes faint — a toggle answers by changing
   state, so neither half dips or tints on press. */
.fo-modes {
  display: inline-flex;
  gap: 2px;
  flex: none;
  padding: 2px;
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
}
.fo-mode {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
}
.fo-mode .srf-mark {
  width: 16px;
  height: 16px;
}
.fo-mode--agent {
  color: var(--color-accent);
}
.fo-modes .fo-mode.is-on {
  background: var(--color-surface-hover);
}
.fo-modes .fo-mode:not(.is-on) {
  color: var(--color-text-faint);
}
/* The mark is two inks of its own, so going inactive has to reach inside it —
   left alone it would keep its colour while everything around it went faint. */
.fo-modes .fo-mode--agent:not(.is-on) .srf-mark-human,
.fo-modes .fo-mode--agent:not(.is-on) .srf-mark-machine {
  fill: var(--color-text-faint);
  stroke: var(--color-text-faint);
}

/* The "+": one control for every way of adding context to the next message.
   It opens a menu, so its ground steps a tier and nothing moves. */
.fo-add {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
}
.fo-add:hover,
.fo-add[aria-expanded='true'] {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}

/* Controls in the bar take the app's accent ring, never the register and never
   a shadow — a shadow ring vanishes under forced colours. */
.fo-mode:focus-visible,
.fo-add:focus-visible,
.fo-tab-btn:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}

/* The drag handle: a slim tab grown from the edge that faces the page, level
   with the bar. Six filled circles is the handle shape desktop windows draw, so
   it reads as one without a label. Its own edge is the ordinary hairline rather
   than the frame's blue — the frame is colour enough, and the handle says
   "machine" through its dots alone. Open on the side that meets the object, so
   the two read as one piece. */
.fo-grip {
  position: absolute;
  top: var(--space-3);
  right: calc(-1 * (18px + var(--border-thin)));
  width: 18px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-left: 0;
  border-radius: 0 var(--radius-2) var(--radius-2) 0;
  color: var(--color-agent);
  cursor: grab;
  box-shadow: var(--shadow-1);
}
.fo-grip:hover {
  background: var(--color-surface-hover);
}
html:not([data-theme='light']) .fo-grip {
  background: var(--color-surface-substrate);
}
/* The exclusion form scores (0,1,1) just as a named theme does, so the resting
   override above outranks the hover and follows it — restated here, the hover
   carries the prefix too and answers the pointer in both themes. */
html:not([data-theme='light']) .fo-grip:hover {
  background: var(--color-surface-hover);
}

/* Docked, the same handle grows from the rail's page-facing edge — its left —
   level with the head. Pulling it lifts the panel off the rail. */
.chat-panel.fo-docked .fo-grip--dock {
  position: absolute;
  top: var(--space-3);
  left: calc(-1 * (18px + var(--border-thin)));
  right: auto;
  border: var(--border-thin) solid var(--color-border-default);
  border-right: 0;
  border-radius: var(--radius-2) 0 0 var(--radius-2);
}

/* The frame's edges and corners are the resize handles: invisible hit zones
   with the matching cursor, the way the rail's own width handle is invisible.
   The top edge and its two corners lift the object's top and leave its foot
   where it is, so the field stays under the pointer's hand. */
.fo-resize {
  position: absolute;
  z-index: 2;
}
.fo-resize--e {
  top: 0;
  bottom: 0;
  right: -3px;
  width: 6px;
  cursor: ew-resize;
}
.fo-resize--w {
  top: 0;
  bottom: 0;
  left: -3px;
  width: 6px;
  cursor: ew-resize;
}
.fo-resize--s {
  left: 0;
  right: 0;
  bottom: -3px;
  height: 6px;
  cursor: ns-resize;
}
.fo-resize--n {
  left: 0;
  right: 0;
  top: -3px;
  height: 6px;
  cursor: ns-resize;
}
.fo-resize--ne {
  right: -3px;
  top: -3px;
  width: 12px;
  height: 12px;
  cursor: nesw-resize;
}
.fo-resize--nw {
  left: -3px;
  top: -3px;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
}
.fo-resize--se {
  right: -3px;
  bottom: -3px;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
}
.fo-resize--sw {
  left: -3px;
  bottom: -3px;
  width: 12px;
  height: 12px;
  cursor: nesw-resize;
}
/* Too narrow to drag to anywhere, and nowhere to put the handle: the frame's
   own edges stay the resize affordance. */
@media (max-width: 520px) {
  .chat-panel.is-floating .fo-grip {
    display: none;
  }
}

/* While it is being dragged: lifted one more step, and the grab shown on the
   handle the pointer is holding. */
.chat-panel.is-floating.is-dragging {
  box-shadow:
    var(--shadow-3),
    0 0 0 var(--border-emphasis) var(--color-agent-edge);
}
.chat-panel.is-floating.is-dragging .fo-grip {
  cursor: grabbing;
}

/* The two places a dragged object can be dropped, each shown only once the
   pointer is near the edge it belongs to. Dashed on the wash is this app's one
   reserved treatment for a real drop target, so neither may linger. */
.fo-drop-rail {
  position: fixed;
  top: 56px;
  right: 0;
  bottom: 0;
  width: var(--rail-w-open, 360px);
  z-index: 119;
  border-left: var(--border-emphasis) dashed var(--color-agent);
  background: var(--color-agent-wash);
  pointer-events: none;
}
.fo-drop-tuck {
  position: fixed;
  z-index: 119;
  width: 32px;
  height: 76px;
  border: var(--border-emphasis) dashed var(--color-agent);
  background: var(--color-agent-wash);
  pointer-events: none;
}
.fo-drop-tuck.fo-edge-left {
  border-left: 0;
  border-radius: 0 var(--radius-3) var(--radius-3) 0;
}
.fo-drop-tuck.fo-edge-right {
  border-right: 0;
  border-radius: var(--radius-3) 0 0 var(--radius-3);
}
/* In the top bar the tab stands free of any edge, so its outline is closed. */
.fo-drop-tuck.fo-edge-top {
  width: 76px;
  height: 32px;
  border-radius: var(--radius-3);
}
/* The top bar's zone for the tab: two muted limit lines, drawn only while a
   drag is in progress. JS places them and sizes them to the bar. */
.fo-zone-line {
  position: fixed;
  z-index: 119;
  width: 0;
  border-left: var(--border-emphasis) dashed var(--color-text-faint);
  pointer-events: none;
}

/* ---- Tucked: the tab ----------------------------------------------------
   The object parked at an edge. Everything above it is still built and still
   in the DOM — hidden, not discarded — which is what makes tucking parking
   rather than closing: the thread, a streaming reply, the composer's text and
   the scroll position all survive it.

   It holds the two ways back in, and says what the agent is doing through the
   colour of its frame alone. No status dot: a dot beside a coloured frame
   states the same thing twice. The edge side drops its border and its radius,
   so the tab reads as the object showing through the edge, not as a button. */
/* The parked tab's width on the right edge, for whatever must clear it: its
   button, its padding either side and its one border. */
:root {
  --parked-tab-w: calc(24px + 2 * var(--space-1) - var(--border-thin) + var(--border-emphasis));
}
.chat-panel.is-tucked {
  width: auto;
  height: auto;
  min-width: 0;
  max-width: none;
  max-height: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  /* The frame is --border-emphasis, and each framed side gives back the
     thickness it gained over --border-thin, so the tab stays 33 by 62. The edge
     side has no border and keeps its full padding. */
  padding: calc(var(--space-1) - var(--border-thin));
  border-width: var(--border-emphasis);
  overflow: visible;
  cursor: pointer;
}
.chat-panel.is-tucked > :not(.fo-tab-signal):not(.fo-tab-btn) {
  display: none;
}
.chat-panel.is-tucked.fo-edge-right {
  border-right: 0;
  padding-right: var(--space-1);
  border-radius: var(--radius-3) 0 0 var(--radius-3);
}
.chat-panel.is-tucked.fo-edge-left {
  border-left: 0;
  padding-left: var(--space-1);
  border-radius: 0 var(--radius-3) var(--radius-3) 0;
}
/* In the top bar the tab lies on its side and sits inside the bar, clear of
   every edge, so it keeps its whole frame. */
.chat-panel.is-tucked.fo-edge-top {
  flex-direction: row;
  border-radius: var(--radius-3);
}
/* Parked, the tab sits flat against its edge, so it takes the lowest lift. The
   floating object's deep shadow is sized for a 460px panel; on a tab this small
   it spills across the cards beside it. While carried it is lifted again, and
   the dragging rule above supplies that. */
.chat-panel.is-tucked:not(.is-dragging) {
  box-shadow: var(--shadow-1);
}
/* Carried by the pointer it is off every edge, so it wears its whole frame. */
.chat-panel.is-tucked.is-dragging {
  border-width: var(--border-emphasis);
  border-style: solid;
  padding: calc(var(--space-1) - var(--border-thin));
  /* The second side's frame takes the width from the padding, so the carried tab
     is still the parked tab's width. */
  padding-inline: calc((var(--parked-tab-w) - 24px - 2 * var(--border-emphasis)) / 2);
  border-radius: var(--radius-3);
  cursor: grabbing;
}
/* The breath's seat between the two icons, there only while work is running. It is
   laid over the middle of the tab rather than set in the column, so the tab keeps
   its 33 by 62 whether or not work is running. */
.fo-tab-signal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 14px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  pointer-events: none;
}
/* Compact and borderless. Pressing one opens the object, so its ground steps a
   tier and nothing moves. The agent button carries the mark as the top bar
   draws it: the human layers in the accent, the machine layer in its own blue. */
.fo-tab-btn {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
  flex: none;
}
.fo-tab-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.fo-tab-btn--agent {
  color: var(--color-accent);
}
.fo-tab-btn .srf-mark {
  width: 16px;
  height: 16px;
}
/* The frame carries the state. Idle and running are both the object's own blue
   — running adds the breath and changes nothing else, because an activity state
   colours the indicator, not the furniture. A pause waiting on the person takes
   the warn edge; a failed turn takes danger. */
.chat-panel.is-tucked[data-state='needs-input'] {
  border-color: var(--color-warn-dot);
}
.chat-panel.is-tucked[data-state='failed'] {
  border-color: var(--color-danger);
}
/* The tab is exempt from the floating object's width bounds; stated after them
   so it wins. */
.chat-panel.is-floating.is-tucked {
  min-width: 0;
  max-width: none;
}
/* The picture of the panel that shrinks into its tab when it is parked. Pinned
   to the box the panel had, whatever placement it was copied from, and gone
   from the pointer and the tab order — the panel itself is already the tab. */
.chat-panel.chat-park-ghost {
  position: fixed;
  right: auto;
  bottom: auto;
  min-width: 0;
  max-width: none;
  min-height: 0;
  max-height: none;
  margin: 0;
  z-index: 130;
  transform: none;
  transform-origin: center;
  transition: none;
  pointer-events: none;
}

/* ---- Search mode ---------------------------------------------------------
   The object's other body. It sits above the composer exactly where the thread
   does, so switching modes changes what is above the field and nothing else. */

/* The list anchors to the bottom: the composer is at the foot of a
   full-height rail, and the first result belongs directly above it rather than
   at the far end of the rail from the field that produced it. Growing upward is
   how a result list behaves when its field is at the bottom.

   The anchoring is the first child's auto top margin, not `justify-content:
   flex-end`. In a scrolling box flex-end pushes overflow past the scroll
   origin, where no scrolling reaches it, so a long list lost its first rows.
   An auto margin takes only the free space, and there is none once the list
   overflows: a short list still sits on the field, a long one starts at its
   first row. */
.chat-panel .plist {
  display: flex;
  flex-direction: column;
}
.chat-panel .plist > :first-child {
  margin-top: auto;
}

/* Search mode drops the dart, the "+", the shield and the model: it never
   calls the model, so there is nothing to send and no next message to stage
   anything onto. The mode pair is all its foot holds. */

/* ---- First launch --------------------------------------------------------
   One callout beside the tab, said once. F12 overlay in the app's own dress,
   because the app is the one speaking; it goes on its × or on the first open,
   and never returns.

   It is transparent to the pointer, and that is structural rather than
   cosmetic. The box is fixed, 240px wide, and hangs beside a tab parked on the
   page's edge — which is the strip every surface puts its toolbar in. Wherever
   it is put it stands in front of something live, and while it could take a
   press it swallowed them: the library's sort and the inspector's tabs both
   became unclickable for as long as the note was up, which on a first launch
   is until the reader presses something.
   Moving the box only chooses which control loses. A note explains, so it
   yields the press to whatever it is explaining over, and only its × — the one
   part that does something — takes one back. */
.fo-callout {
  position: fixed;
  pointer-events: none;
  z-index: 121;
  width: 240px;
  padding: var(--space-3);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-3);
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--color-text-default);
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}
.fo-callout .kbd {
  font-size: var(--fs-11);
}
.fo-callout-body {
  flex: 1;
  min-width: 0;
}
.fo-callout-close {
  width: 24px;
  height: 24px;
  /* The exception to the note's transparency: dismissing is a real action, so
     this is the one part of the box that answers a press. */
  pointer-events: auto;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius-2);
  color: var(--color-text-faint);
  margin: -4px -4px 0 0;
}
.fo-callout-close:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}

/* Full-screen home conversation — the SAME panel node, but filling the home
   route below the top bar instead of sliding in as a side drawer. The inner
   thread/composer are width-capped and centered for readability. */
/* Full-screen home conversation — the SAME panel node, but filling the home
   route below the top bar instead of sliding in as a side drawer. The inner
   thread/composer are width-capped and centered for readability. */
/* An empty conversation must not push the composer below a full screen of
   void: the empty state keeps a bounded height, so the composer sits right
   under the invitation copy. */

/* "Workspaces" button in the full-screen conversation header (top-left) —
   leaves the conversation (archiving it) and returns to the workspace grid. */

/* "Continue in <workspace>" control under an agent reply that carried an
   srfice-continue directive — hands the conversation off to that workspace's panel. */
.chat-continue-row {
  margin-top: var(--space-2);
  display: flex;
}
.chat-continue-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-accent);
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-accent);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
}
.chat-continue-btn:hover {
  background: var(--color-accent);
  color: var(--color-surface-readable);
}
.chat-continue-icon {
  flex: none;
}

/* Chat panel header — title and controls, and nothing else. No mark, and no
   divider under it in any sub-view: the panel's horizontal rules are the tab
   strip's and the composer's, both in the register blue, and a third neutral
   hairline here competes with them. */
.chat-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--color-chrome);
  backdrop-filter: blur(10px);
  flex: none;
}
.chat-head-title {
  font-weight: 600;
  font-size: var(--fs-13);
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
/* Chat thread body — scrollable list of turns */
/* The gap here is the wide one: it separates a turn from the next. Everything
   inside a turn sits closer than this, and a run of tool lines closer still,
   so the thread reads as a handful of exchanges rather than as one long
   ribbon of evenly-spaced blocks. */
.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-4) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
/* Box shared with the other centered empty states (component canon); the thread
   is a flex column, so this one also takes the space left over above the
   composer. */
.chat-empty {
  flex: 1;
}
.chat-empty-icon {
  font-size: 28px;
  color: var(--color-agent);
  opacity: 0.5;
}

/* One turn: what the person said, or what the machine did and then said. */
/* The turn's own rhythm is the narrow gap, declared between siblings rather
   than as a container `gap` so a run of tool lines can close ranks to a
   hairline inside its own stack without loosening anything else. */
.chat-turn {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  min-width: 0;
}
.chat-turn > * + * {
  margin-top: var(--space-2);
}
.chat-turn--user {
  align-items: flex-end;
}
.chat-turn--agent,
.chat-turn--system {
  align-items: flex-start;
}
.chat-bubble {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-3);
  font-size: var(--fs-13);
  line-height: 1.55;
  max-width: 90%;
  /* A message can carry a token with no break opportunity in it — a deep
     slash-separated path, a long URL, a hash. The panel is narrow enough that
     such a token is routinely wider than the bubble, and the default
     `normal` lets it run past the edge instead of breaking: the text is
     clipped and the thread scrolls sideways. `anywhere` rather than
     `break-word` because it also lets the bubble's min-content width shrink
     below the longest token, which is what stops the overflow reaching the
     flex parent. Code blocks are unaffected — they are `pre`, so they do not
     wrap at all and keep scrolling inside their own box. */
  overflow-wrap: anywhere;
}
/* The person's own words: their colour as ink inside their colour as a
   hairline, and no fill at all. A filled block reads as a label applied to the
   text; an outline reads as the text's own edge, which is what a quotation of
   something the reader wrote should be. The clipped bottom-right corner is the
   tail that points the message back at its author. */
.chat-turn--user .chat-bubble {
  background: transparent;
  color: var(--color-accent);
  border: var(--border-thin) solid var(--color-accent);
  border-bottom-right-radius: var(--radius-1);
  /* User messages are plain text — preserve the newlines the sender typed
     (Shift+Enter) instead of collapsing them, matching ChatGPT/Claude. */
  white-space: pre-wrap;
}
/* Jump to the latest: a bare arrow centred over the thread's bottom edge,
   shown only while the thread is scrolled up. Hover draws a 28px circle round
   it — hairline, white, the first shadow — so it reads as a button only when
   the pointer asks. Its `bottom` is set where the panel is built. */
.chat-jump-latest {
  position: absolute;
  left: 50%;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  padding: 0;
  border: var(--border-thin) solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-muted);
  transition:
    border-color var(--dur-quick) var(--ease-out),
    background-color var(--dur-quick) var(--ease-out);
}
.chat-jump-latest:hover {
  border-color: var(--color-border-default);
  background: var(--color-surface-readable);
  box-shadow: var(--shadow-1);
  color: var(--color-text-default);
}
/* agent register — a report on the plain substrate, not a decorated speech
   balloon: default text color, hairline agent-blue left rule as the voice
   marker. The agent blue stays reserved for the panel icon, links, and
   inline-code accents so a long multi-section answer reads as prose, not a
   saturated slab. */
.chat-turn--agent .chat-bubble:not(.chat-bubble--error) {
  background: transparent;
  color: var(--color-text-default);
  border: none;
  border-radius: 0;
  /* No rail, no inset, no name and no mark. The reply is the only prose in
     the panel the machine writes, so nothing has to mark it as the machine's;
     everything the turn emits beside it already wears the register, which is
     what leaves the prose free to be read as prose. */
  padding-left: 0;
  padding-right: 0;
  max-width: 100%;
}
/* The register enters the reply in exactly two places — what the sentence
   leans on, and a literal lifted out of the workspace. */
.chat-turn--agent .chat-bubble--md strong {
  color: var(--color-agent);
}
.chat-turn--agent .chat-bubble--md code {
  color: var(--color-agent);
  background: var(--color-agent-wash);
  font-weight: 600;
}
.chat-turn--system .chat-bubble {
  background: color-mix(in srgb, var(--color-warn) 10%, transparent);
  color: var(--color-warn);
  border: var(--border-thin) solid var(--color-warn-dot);
  border-radius: var(--radius-2);
  font-size: var(--fs-12);
  font-family: var(--font-mono);
}
/* "Conversation compacted": a plain rule across the thread with the words on
   it. Not a control — it does not expand, and the summary it stands for is
   the agent's alone. In the agent register, because the compaction is what the
   machine did to its own context. */
.chat-compacted {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-3) 0;
  font-size: var(--fs-12);
  color: var(--color-agent);
}
.chat-compacted::before,
.chat-compacted::after {
  content: '';
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--color-agent) 55%, transparent);
}
.chat-compacted.is-pending {
  color: var(--color-text-muted);
}
/* What the agent no longer sees: everything above a compaction divider, still
   there to read, dimmed. */
.chat-thread > :has(~ .chat-compacted) {
  opacity: 0.55;
}
/* AG5/05 — an `error` content-block segment, or a renderStoredMessage()
   render-failure fallback. Never a blank bubble. */
.chat-bubble--error {
  background: color-mix(in srgb, var(--color-danger) 10%, transparent);
  color: var(--color-danger);
  border: var(--border-thin) solid var(--color-danger);
  border-radius: var(--radius-2);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.chat-bubble-error-icon {
  flex: none;
}
/* entry 1: markdown-rendered agent prose. Tight, document-like spacing inside the
   bubble so headings/lists/paragraphs read naturally without ballooning the chat. */
.chat-bubble--md > :first-child {
  margin-top: 0;
}
.chat-bubble--md > :last-child {
  margin-bottom: 0;
}
.chat-bubble--md .md-p {
  margin: 0 0 var(--space-2);
}
.chat-bubble--md .md-h {
  margin: var(--space-2) 0 var(--space-1);
  line-height: 1.3;
  font-weight: 600;
}
.chat-bubble--md h1.md-h {
  font-size: var(--fs-15);
}
.chat-bubble--md h2.md-h {
  font-size: var(--fs-14);
}
.chat-bubble--md h3.md-h,
.chat-bubble--md h4.md-h,
.chat-bubble--md h5.md-h,
.chat-bubble--md h6.md-h {
  font-size: var(--fs-13);
}
.chat-bubble--md .md-ul,
.chat-bubble--md .md-ol {
  margin: 0 0 var(--space-2);
  padding-left: 1.3em;
}
/* A list nested inside a list item hugs its parent item. */
.chat-bubble--md li > .md-ul,
.chat-bubble--md li > .md-ol {
  margin: 2px 0 0;
}
.chat-bubble--md li {
  margin: 2px 0;
}
.chat-bubble--md code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 0 3px;
  border-radius: var(--radius-1);
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.chat-bubble--md .md-pre {
  margin: 0 0 var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-2);
  background: color-mix(in srgb, currentColor 8%, transparent);
  overflow-x: auto;
}
/* A table in a reply keeps the width its cells need and its wrap scrolls
   sideways, the way GitHub draws one in a narrow column. Left to the bubble's
   `overflow-wrap: anywhere`, the columns would shrink below their own words and
   split them mid-word to fit the panel. Never narrower than the bubble, so a
   small table reads as it does in a note. */
.chat-bubble--md .rv-table {
  width: max-content;
  min-width: 100%;
}
/* A fenced block is a listing, not a reference lifted into a sentence — it
   takes the reply's own ink rather than the register the inline form wears. */
.chat-bubble--md .md-pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-weight: inherit;
}
.chat-bubble--md .md-quote {
  margin: 0 0 var(--space-2);
  padding-left: var(--space-2);
  border-left: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  opacity: 0.9;
}
.chat-bubble--md .md-hr {
  border: none;
  border-top: var(--border-thin) solid color-mix(in srgb, currentColor 25%, transparent);
  margin: var(--space-2) 0;
}
.chat-ts {
  font-size: 10px;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  padding: 0 2px;
}

/* AG5/08 — a reply being regenerated, dimmed until the fresh one replaces it
   (data-model trim happens inside SRFICE.chatPanel.regenerateLastTurn once the
   new reply resolves — this class is a pure display cue). */
.chat-turn--regenerating {
  opacity: 0.45;
}

/* F24 trace line — every line a turn emits that is not prose: one tool call, the
   head over a folded run of them, or the head of a delegated subagent run.
   Shared by the live stream (rendered at 'running' and updated in place as
   each call resolves) and the finalized transcript, so a settled turn is
   identical to what streamed.

   No container: no border, no background, no radius, no status glyph. That a
   call ran is implied by its being written down at all, and a box drawn around
   every one of them turns a working turn into a stack of receipts. What is
   left is a line of text, and the only thing it varies is its colour. */
/* 11px at 500, not 10px at 600 with a faded argument: with the weight and the
   opacity gone the line has nothing left to lean on, and flattening the
   opacity makes a trace LOUDER rather than quieter. The extra pixel and the
   half-step of weight are what keep a uniform mono line scannable — the light
   instance of the register sits at 3.4:1, which is past what a line of text
   this size needs but not by much. */
.chat-trace-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  font-weight: 500;
  line-height: 1.65;
  min-width: 0;
  max-width: 100%;
  /* The machine emitted it. One colour, one weight, full opacity — the tool's
     name and what it was pointed at are the same kind of fact, and rendering
     one of them quieter than the other says they are not. */
  color: var(--color-agent);
}
.chat-trace-name {
  flex: none;
}
/* The argument is the only elastic part: a real path routinely outruns a
   360px panel, and it ellipsises rather than pushing what follows out of the
   line or widening the thread into a sideways scroll. */
.chat-trace-arg {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
/* What became of the call, and where its effect landed — held out of the
   ellipsis so a long path can never truncate away the word that says the call
   failed. */
.chat-trace-note {
  flex: none;
}
/* A failed builder call's reason takes a row of its own under the call, and
   wraps rather than pushing the line out of the column. */
.chat-trace-line--why {
  flex-wrap: wrap;
}
.chat-trace-line--why .chat-trace-why {
  flex: 1 1 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
/* Authorship and outcome are separate axes. Blue says the machine emitted the
   line; danger says the call did not do what it was asked — failed, blocked
   or refused alike — which is a statement about what happened rather than
   about who did it, so it wins over the register on the line it describes.
   The line always says the word too: colour is never the only carrier. */
.chat-trace-line--fail {
  color: var(--color-danger);
}
/* A call that cites the workspace rule it followed carries that rule on a
   second line beneath it: `↳ AGENTS.md · no open plan behind`. It is the same
   trace line wrapping, not a new object — same face, size and colour, no box —
   so a failed call's rule turns danger with it. The line wraps only here: an
   ordinary line would wrap its path instead of ellipsising it. To keep that
   from happening on a cited line, the argument starts from nothing and grows
   to its own width, which fits it on the first row whatever its length. */
.chat-trace-line--cited {
  flex-wrap: wrap;
  row-gap: 0;
}
.chat-trace-line--cited > .chat-trace-arg {
  flex: 1 1 0;
  max-width: max-content;
}
.chat-trace-cause {
  display: flex;
  align-items: baseline;
  gap: inherit;
  flex-basis: 100%;
  min-width: 0;
}
.chat-trace-cause-mark {
  flex: none;
}
/* The cited file is a path like any argument: it ellipsises. It may take half
   the line at most, so the rule itself is never squeezed out. */
.chat-trace-cause-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 50%;
}
/* The rule is the reason, so it wraps rather than truncating. */
.chat-trace-cause-rule {
  flex: 1 1 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
/* A folded run's head carries the rules its calls cite. Opened, the calls
   show them themselves, and the head stops repeating them. */
.chat-trace-group.is-open > .chat-trace-head > .chat-trace-cause {
  display: none;
}

/* A group: a head line over the calls it holds. A run of consecutive calls
   and a delegated subagent run are the same object — a turn that made twenty
   calls should read as one act, not as twenty, and the head is what says
   which act it was. */
.chat-trace-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-self: stretch;
  min-width: 0;
  max-width: 100%;
}
.chat-trace-head {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.chat-trace-head:disabled {
  cursor: default;
}
/* The one affordance a head has that a plain call line does not. It cannot be
   a glyph or a second weight without breaking the uniform line, so it is a
   hover state — which leaves the resting trace identical whether or not a
   given head happens to open. */
.chat-trace-head:not(:disabled):hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* A lone call is not a run: its group keeps the line and drops the head, so
   one call reads as itself rather than as "Called 1 tool" over a fold that
   hides nothing. The nest loses its rule with it — there is no nesting when
   nothing is nested. */
.chat-trace-group[data-kind='tools'][data-count='1'] > .chat-trace-head {
  display: none;
}
.chat-trace-group[data-kind='tools'][data-count='1'] > .chat-trace-nest {
  padding-left: 0;
  border-left: 0;
  margin-left: 0;
}
.chat-trace-nest {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 11px;
  border-left: var(--border-thin) solid var(--color-agent-edge);
  margin-left: 3px;
  min-width: 0;
}

/* The turn's foot: one row under every agent turn, in one box, through every
   state the turn passes. The breath beside a mono label while the machine
   works ("thinking", "grep notes", …); a still warn dot while it waits on the
   person; a still danger dot when the turn failed; and, once the turn is over,
   the breath stilled beside how long it took and a control that copies the
   reply. Every state is this row at this size, so a turn ending swaps what the
   slot holds and moves nothing else. */
.chat-turn-foot {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  padding: 2px 2px;
  align-self: flex-start;
}
.chat-bubble--needs-input .chat-turn-foot {
  margin-bottom: var(--space-2);
}
/* Finished: the breath holds every ring lit instead of cycling. The same
   frozen state the reduced-motion rule already stops it at, which is why a
   settled turn costs no second geometry — the rings do not move or resize,
   they simply stop breathing. */
.chat-turn-foot--done .srf-breath-r1,
.chat-turn-foot--done .srf-breath-r2,
.chat-turn-foot--done .srf-breath-r3 {
  animation: none;
  opacity: 1;
}
/* The runtime is the one figure the row prints; what answered and what it
   cost ride its hover, so the thread carries no column of prices. The help
   cursor is the only thing saying there is more to read. */
.chat-turn-foot-runtime[title] {
  cursor: help;
}
/* The turn's controls, all of them, in this row — copying the reply, and on a
   live session's last turn re-asking it. They rest visible rather than waiting
   for a hover: at this weight a glyph in the row's own faint ink is quieter
   than the runtime beside it, and a control nobody can see until they guess to
   point at it is one most readers never find. Hovering takes the register, the
   machine's own colour on the machine's own reply. Borderless, so there is no
   ground to dip and the press lands on the mark instead — they are in the
   `srf-press-kick` block rather than the dip one. */
.chat-turn-foot-btn {
  display: grid;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  cursor: pointer;
  transition: color var(--dur-quick) var(--ease-out);
}
.chat-turn-foot-btn:hover {
  color: var(--color-agent);
}
.chat-turn-foot-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.chat-turn-foot-copy.is-copied {
  color: var(--color-accent);
}
/* Save as note is the one foot control that does NOT rest visible. It is on
   every reply of every thread, and a thread lined with it reads as a column of
   buttons nobody asked for. So it waits: it shows while the reader is on the
   turn — pointing at it, or tabbed into it — in the same glyph and register as
   the copy control beside it. Opacity rather than display, so showing it moves
   nothing in the row; last in the row, so while hidden it leaves no gap. On a
   touch screen, where nothing hovers, a tap on the reply focuses it (the turn
   is focusable, out of the tab order) and it shows until focus leaves. The
   focused turn draws no ring: the glyph appearing is the answer to the tap. */
.chat-turn-foot-save {
  opacity: 0;
  transition:
    opacity var(--dur-quick) var(--ease-out),
    color var(--dur-quick) var(--ease-out);
}
.chat-turn:hover .chat-turn-foot-save,
.chat-turn:focus-within .chat-turn-foot-save {
  opacity: 1;
}
.chat-turn[tabindex='-1']:focus {
  outline: none;
}

/* Attachment chips on user messages */
.chat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-self: flex-end;
}
.chat-attach-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-muted);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-1);
  padding: 1px 6px;
  background: var(--color-surface-substrate);
}
/* AG4/05 reported the server's final per-attachment disposition (native /
   extracted-text / text-pinned / filename-only / skipped: no access /
   skipped: not found / rejected: invalid path) as plain text. AG5/07 adds the
   severity-coloured treatment: 'ok' (the model received the file), 'warn'
   (received, no usable content), 'refused' (never reached the model). */
.chat-attach-chip-disposition {
  color: var(--color-text-faint);
}
.chat-attach-chip--warn {
  border-color: var(--color-warn-dot);
}
.chat-attach-chip-disposition--warn {
  color: var(--color-warn);
}
.chat-attach-chip--refused {
  border-color: var(--color-danger);
}
.chat-attach-chip-disposition--refused {
  color: var(--color-danger);
}
.chat-attach-chip-disposition--ok {
  color: var(--color-success);
}

/* Staged attachments: a row of tiles at the top of the composer's box. It
   never wraps, so it scrolls sideways; the edge that has more fades over 64px
   and carries a bare chevron (staged-row.js sets `at-start` / `at-end` on the
   edges that have none). */
.chat-staged-wrap {
  position: relative;
  padding: var(--space-2) var(--space-3) 0;
}
.chat-staged-row {
  display: flex;
  gap: var(--space-1);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 64px,
    #000 calc(100% - 64px),
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 64px,
    #000 calc(100% - 64px),
    transparent
  );
}
.chat-staged-row::-webkit-scrollbar {
  display: none;
}
.chat-staged-wrap.at-start .chat-staged-row {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 64px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 64px), transparent);
}
.chat-staged-wrap.at-end .chat-staged-row {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 64px);
  mask-image: linear-gradient(to right, transparent, #000 64px);
}
.chat-staged-wrap.at-start.at-end .chat-staged-row {
  -webkit-mask-image: none;
  mask-image: none;
}
/* The edge's chevron: no border and no fill, 2px in from the box's inner
   edge, centred on the tiles (the wrapper's top padding is half the offset). */
.chat-staged-arrow {
  position: absolute;
  z-index: 1;
  top: calc(50% + var(--space-2) / 2);
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  translate: 0 -50%;
  background: transparent;
  color: var(--color-text-muted);
}
.chat-staged-arrow:hover {
  color: var(--color-text-default);
}
.chat-staged-arrow--prev {
  left: 2px;
}
.chat-staged-arrow--next {
  right: 2px;
}
.chat-staged-wrap.at-start .chat-staged-arrow--prev,
.chat-staged-wrap.at-end .chat-staged-arrow--next {
  display: none;
}
/* A tile: glyph, name, ×. A small attached thing rather than a pill — the
   controls' radius, white, a hairline, default ink; the name cut at 200px. */
.chat-staged-chip {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-1);
  max-width: 200px;
  padding: 3px var(--space-1) 3px var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font-size: var(--fs-12);
  font-weight: 400;
  line-height: 16px;
  white-space: nowrap;
}
.chat-staged-chip > .icon {
  display: flex;
  flex: none;
  color: var(--color-text-muted);
}
.chat-staged-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-staged-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: var(--radius-1);
  color: var(--color-text-faint);
  flex: none;
}
.chat-staged-chip-remove:hover {
  color: var(--color-text-default);
  background: var(--color-surface-hover);
}
/* Image attachments — pasted/attached images render as a capped thumbnail
   (mainstream-chat treatment), never as a full-size <img> in the layout.
   Click opens the lightbox. */
.chat-msg-image {
  display: block;
  align-self: flex-end;
  margin-top: 2px;
}
.chat-msg-image img {
  display: block;
  max-width: min(320px, 100%);
  max-height: 240px;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  cursor: zoom-in;
}
/* A staged image in the tile row: a square thumb with the remove × overlaid
   in its corner. */
.chat-staged-thumb {
  position: relative;
  display: inline-flex;
  flex: none;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  overflow: hidden;
}
.chat-staged-thumb img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: cover;
  cursor: zoom-in;
}
.chat-staged-thumb .chat-staged-chip-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0.9;
}
.chat-staged-thumb .chat-staged-chip-remove:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.75);
}
/* Full-size image view: dark scrim, image scaled to fit the viewport.
   Scrim click / ✕ / Esc close (wired in chat.js openImageLightbox). */
.chat-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
  cursor: zoom-out;
}
.chat-image-lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-3);
  cursor: default;
}
.chat-image-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
}
.chat-image-lightbox-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* The image viewer a post's image opens (F11 Dialog over F12 Overlay): black at
   94% in both themes, controls dark glass, above every layer of the page; its ink is
   white as a literal rgba, since the viewer is dark in both themes. The
   picture is placed by script, so the stage only holds it and takes the drags. */
.iv {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.94);
  color: rgba(255, 255, 255, 1);
}
.iv-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: default;
}
.iv.is-zoomed .iv-stage {
  cursor: grab;
}
.iv-img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}
.iv-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  color: rgba(255, 255, 255, 1);
  background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  cursor: pointer;
}
.iv-btn:hover {
  background: rgba(40, 40, 40, 0.75);
}
.iv-close {
  top: var(--space-4);
  right: var(--space-4);
}
.iv-nav {
  top: 50%;
  transform: translateY(-50%);
}
.iv-nav--prev {
  left: var(--space-4);
}
.iv-nav--next {
  right: var(--space-4);
}
.iv-count {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  font-size: var(--fs-14);
  background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.iv-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  pointer-events: none;
}
.iv-foot > * {
  pointer-events: auto;
}
.iv-toggle {
  position: static;
}
.iv-alt {
  max-width: min(640px, calc(100% - var(--space-6)));
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-3);
  font-size: var(--fs-14);
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

/* The preloaded-skills tile, turned off for this conversation, reads muted. */
.chat-staged-chip.is-off {
  color: var(--color-text-muted);
}

/* F17 inline notice, neutral severity, caption scale — the turn-end
   correction under a reply that claimed a memory save its turn never made.
   Rendered BENEATH the bubble as presentational metadata; the message text is
   never altered, because it is persisted and re-sent as history. */
.chat-msg-save-marker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  align-self: flex-start;
  padding: var(--space-1) var(--space-2);
  background: var(--color-surface-substrate-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
  font-size: var(--fs-11);
}

/* F17 inline notice, banner placement, neutral severity — announces an
   off-the-record conversation at the top of the thread. Neutral rather than
   warn: this is a state the user chose, not a hazard. */
.chat-offrecord-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface-substrate-2);
  border-bottom: var(--border-thin) solid var(--color-border-default);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
}

/* Composer area */
.chat-composer {
  flex: none;
  /* The panel's lower rule — the register blue, matching the tab strip above.
     The field's own edge inside it is the one place green survives in this
     chrome, because the field is where the human writes. */
  border-top: var(--border-thin) solid var(--color-agent);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-readable);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: background var(--dur-quick) var(--ease-out);
  /* Positioning context for the context meter, which is absolutely placed on
     this element's top edge. */
  position: relative;
}
/* AG5/07: drag a file-tree row onto the composer to stage it. */
.chat-composer.is-dragover {
  background: var(--color-accent-soft);
  outline: var(--border-thin) dashed var(--color-accent);
  outline-offset: -2px;
}
/* The box holds everything the next message is, as a column: the staged
   tiles, the field, then the foot of tools (the mode pair, "+", the shield,
   and on the right the model and Send). It is the composer's full width.

   Its edge is a 2px gradient running green at the left to blue at the right:
   the human writes into it and the machine answers out of it, and the field is
   the one element in the panel that belongs to both. It is painted as two
   backgrounds rather than as a nested element — an opaque fill clipped to the
   padding box over the gradient clipped to the border box — so the border-box
   radius (--radius-3, 10px) and the 2px width give the inner surface its 8px
   radius without a wrapper node to keep in sync. */
.chat-composer-box {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  --composer-fill: var(--color-surface-readable);
  background:
    linear-gradient(var(--composer-fill), var(--composer-fill)) padding-box,
    linear-gradient(
        100deg,
        var(--color-accent) 0%,
        var(--color-accent) 26%,
        var(--color-agent) 74%,
        var(--color-agent) 100%
      )
      border-box;
  border: 2px solid transparent;
  border-radius: var(--radius-3);
  transition: box-shadow var(--dur-quick) var(--ease-out);
}
/* The gradient edge IS the focus affordance — the input's own outline is
   suppressed below — so focus is stated by a halo around the whole field
   rather than by a ring inside it. The halo is green because focus is the
   human about to act, and green is already the end of the edge it sits under. */
.chat-composer-box:focus-within {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 22%, transparent);
}
/* Typed text is real content — default color. Only placeholder copy (the
   :empty::before prompt, the static-harness prompt fallback, and the disabled
   state) wears the faint placeholder tone. */
.chat-composer-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  /* A contenteditable with no focus rule falls back to the browser's default
     ring, which draws square corners in a hard ink INSIDE the field's rounded
     edge. The field states focus as a halo on its wrapper instead, so the
     default is suppressed rather than left to fight the shape around it. */
  outline: none;
  padding: var(--space-2) var(--space-3) var(--space-1);
  color: var(--color-text-default);
  font-family: var(--font-ui);
  font-size: var(--fs-13);
  line-height: 1.5;
}
.chat-composer-input.is-placeholder {
  color: var(--color-text-faint);
}
.chat-composer-input:empty::before {
  content: attr(data-placeholder);
  color: var(--color-text-faint);
  pointer-events: none;
}
/* Send — borderless, icon only, at the right end of the box's foot. */
.chat-composer-send {
  width: 28px;
  height: 24px;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-accent);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex: none;
  transition:
    background-color var(--dur-quick) var(--ease-out),
    color var(--dur-quick) var(--ease-out);
}
.chat-composer-send:hover {
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  color: var(--color-accent-strong);
}
/* The attach/skill/plus glyphs had their only hover inside the light theme's
   green composer band, which no longer exists. Restated here on the app's own
   hover step so the affordance survives the move to white — and so it exists
   in dark, where the band-scoped rule never reached it. */
.chat-composer-attach:hover {
  background: var(--color-surface-hover);
}
/* Issue #626: agent present-but-disabled — the composer is honestly inert
   (the box border stays SOLID in every state — owner call). */
.chat-composer.is-agent-disabled {
  background: var(--color-surface-substrate);
}
/* The inert state drops the field's well so the box reads as part of the flat
   band, but keeps its edge: only the padding-box fill is swapped, because
   `background: transparent` here would erase the gradient border too and leave
   the field with no edge at all. */
.chat-composer.is-agent-disabled .chat-composer-box {
  --composer-fill: var(--color-surface-substrate);
}
.chat-composer-input.is-disabled {
  background: transparent;
  cursor: default;
}
.chat-composer-input.is-disabled:empty::before {
  content: attr(data-placeholder);
  color: var(--color-text-faint);
  pointer-events: none;
}
.chat-composer-send.is-disabled,
.chat-composer-send:disabled {
  background: transparent;
  color: var(--color-text-faint);
  cursor: not-allowed;
}
.chat-composer-hint {
  font-size: 10px;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  line-height: 1.4;
}
/* The box's foot: 24px tools, the mode pair leading, a spacer, then the
   model and Send. */
.chat-composer-tools {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-1) var(--space-1);
}
.chat-composer-tools-gap {
  flex: 1;
}
/* The mode pair sits at the foot's 24px: its inset 1px, each mode 22px. */
.chat-composer-tools .fo-modes {
  padding: 1px;
  margin-right: var(--space-1);
}
.chat-composer-tools .fo-mode {
  width: 22px;
  height: 22px;
}
/* Off the record: F05 compact, a shield. On, it wears the selected recipe. It
   shows only while the conversation is new and empty. */
.chat-offrecord-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
}
.chat-offrecord-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.chat-offrecord-btn[aria-pressed='true'] {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
/* The model, as a quiet text button: muted, no edge, a step of ground on
   hover. The menu it opens names the provider. */
.chat-model-text {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  height: 24px;
  padding: 0 var(--space-1) 0 var(--space-2);
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  white-space: nowrap;
}
.chat-model-text:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.chat-model-text .icon {
  display: flex;
}
.chat-offrecord-btn:focus-visible,
.chat-model-text:focus-visible,
.chat-jump-latest:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}

/* ---- Context meter: how full the thread's context window is ----
   The meter IS the line between the thread and the composer, not a row inside
   the composer: it sits on the composer's top edge and replaces the border
   there, so it costs no vertical space and its fill fraction maps to the
   panel's full width. */
.chat-composer.has-context-bar {
  border-top: none;
}
.chat-context-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-substrate-2);
  overflow: hidden;
  cursor: pointer;
  z-index: 1;
}
/* The gradient is painted across the FULL width and then revealed by the fill,
   rather than stretched to it — so a given fraction always wears the same
   colour, and the tip's colour is what reads as urgency. */
.chat-context-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  /* Accent, then warn, then danger: room, then attention, then urgency. And a
     tonal ramp, not only a hue ramp: the low end mixes toward the track
     (lighter weight), the high end toward the ink token (heavier). Because the
     ink token is dark in light and light in dark, that reads as heavier in
     both. The warn stop is pulled a little toward the track as well — the dark
     theme's amber is brighter than its mixed danger, and unmixed it would make
     the middle of the bar heavier than its end. Without the ramp a nearly-empty
     and a nearly-full bar would be indistinguishable in greyscale and to a
     red-green colourblind reader. */
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-accent) 82%, var(--color-surface-substrate-2)),
    color-mix(in srgb, var(--color-warn) 88%, var(--color-surface-substrate-2)),
    color-mix(in srgb, var(--color-danger) 80%, var(--color-text-default))
  );
}
/* Everything past the fill is masked back to the track colour. */
.chat-context-bar::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: var(--fill, 0%);
  background: var(--color-surface-substrate-2);
}
.chat-context-bar:focus-visible {
  outline: 2px solid var(--color-agent);
  outline-offset: 1px;
}
/* Mounted on the document body, never inside the composer: anchored in the
   panel it is clipped by the panel's overflow, and inside the composer it
   inherits the composer's own token set. The model picker had exactly this
   bug and was fixed the same way. */
/* ---- Context stats popover: what filled the window, and what it cost ----
   The canonical content-overlay treatment, not the local deviation the model
   menu carries. It takes the DEFAULT border rather than the agent-blue one:
   that variant marks an overlay the agent raises unbidden, and the user opened this
   one by clicking. Body-mounted for the same two reasons the hover figure is. */
/* Both overlays sit on the model picker's layer, above the floating agent
   object (120) they open from — at 60 they opened behind it, which is where
   the floating panel's meter was unreadable. */
.ctx-pop {
  position: fixed;
  z-index: 200;
  width: 296px;
  max-width: calc(100vw - var(--space-4));
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-3);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  color: var(--color-text-default);
}
.ctx-pop-headline {
  font-size: var(--fs-15);
  font-weight: 600;
  line-height: 1.25;
}
.ctx-pop-model {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  margin-top: var(--space-1);
}
.ctx-pop-group {
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-1);
}
.ctx-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-1) 0;
  font-size: var(--fs-12);
}
.ctx-row-label {
  color: var(--color-text-muted);
}
.ctx-row-value {
  color: var(--color-text-default);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
/* F04 button, ghost emphasis, compact size: Compact now. It commits — the
   thread gains its compaction — so it sits in the press block's commit
   bucket. Left-aligned under the rows it acts on rather than stretched. */
.ctx-compact-btn {
  align-self: flex-start;
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
}
.ctx-compact-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.ctx-compact-btn:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
.ctx-sep {
  height: 1px;
  background: var(--color-border-default);
}
/* F23 text link — the way from the context popover to the plan-usage surface.
   Nothing here is its own; the family's declaration in the component canon is
   the whole of it. */

.chat-context-tip {
  position: fixed;
  z-index: 200;
  transform: translateX(-50%);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-3);
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-default);
  white-space: nowrap;
  pointer-events: none;
}
/* Issue #647: cascading provider -> models picker. */
.chat-model-menu {
  position: relative;
  max-width: 70%;
}
.chat-model-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-muted);
  background: var(--color-surface-substrate);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-1);
  padding: 2px 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--dur-quick) var(--ease-out);
}
.chat-model-btn:hover {
  border-color: var(--color-border-strong);
}
.chat-model-btn:focus-visible {
  outline: 2px solid var(--color-agent);
  outline-offset: 1px;
}
/* Issue #645: agent-mentioned workspace paths rendered as links. */
.chat-bubble .path-link {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}
/* A file a chat names that lives in another Srfice home: the path, where it is, and
   the button that opens that home. The page-notice family at inline size; the button
   is the shared secondary one (commit bucket). */
.path-elsewhere {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  max-width: 100%;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate-2);
  color: var(--color-text-muted);
  font-size: var(--fs-13);
  line-height: 1.45;
  vertical-align: baseline;
}
.path-elsewhere-name {
  overflow-wrap: anywhere;
}
.path-elsewhere-note {
  min-width: 0;
  overflow-wrap: anywhere;
}
.path-elsewhere-open {
  flex: none;
  font-size: var(--fs-13);
}
/* Hidden OS file input behind the composer's external-attachment "+". */
.chat-composer-file-input {
  display: none;
}

/* ---------- Agent sessions: tab strip, + new-session, History view ---------- */
/* The panel's own tools: the history toggle, full screen and minimize. One
   icon-button dress for all three, so the row reads as one set. */
.chat-hist-btn,
.chat-full-btn,
.chat-min-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-2);
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
  transition:
    background-color var(--dur-quick) var(--ease-out),
    color var(--dur-quick) var(--ease-out);
}
.chat-hist-btn:hover,
.chat-full-btn:hover,
.chat-min-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.chat-hist-btn.is-on {
  background: var(--color-surface-hover);
  color: var(--color-agent);
}

/* Tab strip of open sessions (switchable chips, each with an archive ×). */
/* An agent's run tab. Before anything is sent its body is what the agent is
   and how to start it: the problems notice, the description, who published
   it, a paused line, and the starters (compact, as on its page) or its form.
   It wears exactly a session's surfaces: the composer keeps its own band, and
   the body and the foot paint nothing, so they sit on the panel's surface as a
   session's thread does — white in the light theme, where the panel is. */
/* Starters, an agent's in its empty run tab and an Edit skill session's under
   its opening line: F04 outlined compact buttons (the `.lib-saved-btn` look)
   in a wrapping row. */
.agentpg-starters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.chat-edit-skill-starters {
  padding: 0 var(--space-4) var(--space-3);
}
/* Above a thread that has started, the same problems notice, while they stop
   the agent running. */
.chat-run-notice {
  flex: none;
  padding: var(--space-3) var(--space-4) 0;
}
.chat-run-notice .agentpg-notice {
  margin: 0;
}
.chat-run {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-4);
  font-size: var(--fs-13);
  color: var(--color-text-default);
}
.chat-run .agentpg-notice {
  margin: 0;
}
.chat-run .agentpg-problem-list {
  margin: 0;
}
.chat-run-desc {
  margin: 0;
}
.chat-run-by,
.chat-run-paused {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
/* Waiting for you: each run waiting on the person as the thread's own
   needs-input bubble, filling the body's width — what started it, what
   it wants, and Deny, Open and Allow once. */
.chat-run-waiting {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.chat-run-waiting .skills-section-title {
  margin: 0;
}
.chat-run-wait {
  max-width: 100%;
}
.chat-run-wait .ni-desc {
  margin-bottom: var(--space-2);
}
/* The trigger fires a waiting run held up, and what carrying a stopped run on
   costs, both quiet beside the answers they qualify. */
.chat-run-wait-skipped {
  margin-bottom: var(--space-2);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.chat-run-wait-cost {
  flex: 1 1 100%;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
/* The foot line: a trial's F23 link to what it would change, then Edit agent
   (F04 compact) at the right. Edit agent is outlined, and filled — the tab's
   main button — when a problem stops the agent running. */
.chat-run-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  flex: none;
  padding: var(--space-2) var(--space-4);
  border-top: var(--border-thin) solid var(--color-border-default);
}
.chat-run-edit.is-main {
  background: var(--btn-accent-bg);
  border-color: transparent;
  color: var(--btn-accent-text);
}
.chat-run-edit.is-main:hover {
  background: var(--btn-accent-bg);
  border-color: transparent;
  color: var(--btn-accent-text);
  filter: brightness(1.05);
}
/* The trial results viewer, inside the results F11 dialog. A property value
   wraps at its words here: broken anywhere, a narrow column reads one letter
   a line. */
.agentrun-results {
  min-height: 240px;
}
.agentrun-results :is(.property-value, .skres-change-val) {
  overflow-wrap: break-word;
}
/* Session number strip: unboxed positional numbers divided by vertical
   separators, sitting directly on the header/body divider line. */
/* The session strip is the panel's top line: there is no header above it, so
   it carries the history and close controls at its right end, and tabs give up
   width (ellipsizing their names) before the strip scrolls. */
.chat-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: var(--space-2) var(--space-2) 0 var(--space-3);
  /* The panel's upper rule, in the register blue — it and the composer's
     lower rule bracket the thread as the machine's chrome. Drawn inside the
     strip, because the strip scrolls sideways and nothing may overhang it: the
     active tab's white covers it, so the rule breaks beneath that tab. */
  box-shadow: inset 0 calc(-1 * var(--border-thin)) 0 var(--color-agent);
  overflow-x: auto;
  flex: none;
}
.chat-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 1 auto;
  min-width: 56px;
  max-width: 160px;
  padding: 4px 8px;
  border-radius: var(--radius-2) var(--radius-2) 0 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--dur-quick) var(--ease-out),
    color var(--dur-quick) var(--ease-out);
}
.chat-tab > :first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Separators between the tabs: a short centred line, not the tab's left
   border, which would follow the rounded corner and curl at the top. None
   beside the active tab. */
.chat-tab + .chat-tab::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  height: 14px;
  margin-top: -7px;
  border-left: var(--border-thin) solid var(--color-border-default);
}
.chat-tab.is-active::before,
.chat-tab.is-active + .chat-tab::before {
  display: none;
}
/* An agent's thread leads its tab with the agent's kind icon. */
.chat-tab-agent {
  flex: none;
  color: var(--color-agent);
}
.chat-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A trial's tab carries the neutral F07 trial badge after the agent's name,
   and keeps it whole while the name ellipsizes. */
.chat-tab-trial {
  flex: none;
}
.chat-tab:hover {
  background: color-mix(in srgb, var(--color-text-default) 5%, transparent);
  color: var(--color-text-default);
}
/* The active session is joined to the panel's body: white, with the panel's
   blue rule on its top and both sides and none below. Inactive tabs have no
   fill. */
.chat-tab.is-active {
  position: relative;
  border: var(--border-thin) solid var(--color-agent);
  border-bottom: 0;
  background: var(--color-surface-readable);
  color: var(--color-text-default);
}
/* Drag-reorder: the dragged tab dims, and a line stands in the gap it will
   land in, centred on the hairline between two tabs. It is drawn by ::after
   because ::before is the separator, and the strip takes no tint. */
.chat-tab.is-dragging {
  opacity: 0.45;
}
.chat-tab.is-drop-before::after,
.chat-tab.is-drop-after::after {
  content: '';
  position: absolute;
  top: var(--space-1);
  bottom: var(--space-1);
  z-index: 2;
  width: var(--border-emphasis);
  border-radius: var(--radius-pill);
  background: var(--color-agent);
}
.chat-tab.is-drop-before::after {
  left: calc((var(--border-emphasis) + var(--border-thin)) / -2);
}
.chat-tab.is-drop-after::after {
  right: calc((var(--border-thin) - var(--border-emphasis)) / 2);
}
.chat-tab-close {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-1);
  color: var(--color-text-faint);
  flex: none;
}
.chat-tab-close:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}

/* "+" new-session — after the last session number in the strip. Bare glyph
   (no box); hidden entirely at the session cap (not rendered). */
.chat-new-session {
  width: 26px;
  border-radius: var(--radius-1);
  display: grid;
  place-items: center;
  flex: none;
  align-self: center;
  padding: 3px 0;
  margin-left: var(--space-1);
  color: var(--color-text-muted);
  cursor: pointer;
  transition:
    background-color var(--dur-quick) var(--ease-out),
    color var(--dur-quick) var(--ease-out);
}
.chat-new-session:hover {
  background: color-mix(in srgb, var(--color-text-default) 5%, transparent);
  color: var(--color-text-default);
}
.chat-new-session:focus-visible {
  outline: 2px solid var(--color-agent);
  outline-offset: 1px;
}

/* Search's head stands where the session strip does and draws the same upper
   rule, so the panel keeps its bracket in both modes; it names the mode
   instead of listing sessions, which search does not have. */
.chat-search-head {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-2) var(--space-1) var(--space-3);
  border-bottom: var(--border-thin) solid var(--color-agent);
  flex: none;
}
.chat-search-head .chat-tabs-tools {
  padding-bottom: 0;
}
.chat-search-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  color: var(--color-text-default);
  font-size: var(--fs-13);
  font-weight: 600;
}
.chat-search-title svg {
  flex: none;
  color: var(--color-text-muted);
}
/* The history toggle, full screen and minimize, at the strip's right end. */
.chat-tabs-tools {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: none;
  margin-left: auto;
  padding-left: var(--space-2);
  padding-bottom: var(--space-1);
}

/* History sub-view — list of archived sessions. */
.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
/* User-voice guidance on a knowledge-tool surface — UI font, not the mono
   run-output register. */
.chat-history-hint {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-bottom: var(--space-1);
}
.chat-history-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate);
}
.chat-history-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.chat-history-title {
  font-size: var(--fs-13);
  color: var(--color-text-default);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-history-ts {
  font-size: 10px;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
}
.chat-history-reopen {
  font-size: var(--fs-12);
  color: var(--color-agent);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-1);
  border: var(--border-thin) solid var(--color-border-default);
  cursor: pointer;
  flex: none;
}
.chat-history-reopen:hover {
  background: var(--color-surface-hover);
}
.chat-history-del {
  display: grid;
  place-items: center;
  width: 26px;
  height: 24px;
  border-radius: var(--radius-1);
  color: var(--color-text-faint);
  flex: none;
  cursor: pointer;
}
.chat-history-del:hover {
  background: var(--color-surface-hover);
  color: var(--color-danger, var(--color-text-default));
}

/* ---------- 11. Memory page: facets and headings ---------- */

/* The placeholder a facet shows when it has no entries. */
.memory-filter-empty {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  padding: var(--space-2) 0;
}

/* Type facets: here a chip is a toggle. */
.memory-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-ui);
  font-size: var(--fs-11);
  color: var(--color-text-muted);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  padding: 2px var(--space-2);
  cursor: pointer;
}
.memory-filter:hover {
  border-color: var(--color-accent);
  color: var(--color-text-default);
}
.memory-filter.is-on {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  color: var(--color-text-default);
}
.memory-filter-count {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
.memory-filter.is-on .memory-filter-count {
  color: var(--color-accent);
}

/* Two headings, deliberately different weights: the tier heading is the rarer
   and more structural of the two, so it reads as the quieter divider and the
   type heading as the label on the group beneath it. */
.memory-tier-head {
  font-size: var(--fs-11);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-top: var(--space-3);
  padding-bottom: var(--space-1);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.memory-tier-head:first-child {
  margin-top: 0;
}
.memory-group-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-top: var(--space-2);
  margin-bottom: var(--space-1);
}
.memory-group-label {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-text-default);
}
.memory-group-count {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}

/* ===========================================================================
   MEMORY SURFACE
   The whole page over the store: a fixed-height row that opens in place onto
   a record, under two headings (`.memory-tier-head`, `.memory-group-head`)
   and the facet chips (`.memory-filter`).
   =========================================================================== */

/* F17 inline notice, banner placement, warn severity — shown while memory is
   paused. It states the second half deliberately: a control called Pause
   invites "you have stopped knowing things about me", and retrieval is
   untouched. */
.memory-surface-paused {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-warn-soft);
  border-bottom: var(--border-thin) solid var(--color-warn-soft-2);
  color: var(--color-warn);
  font-size: var(--fs-12);
}
.memory-surface-paused > button {
  margin-left: auto;
}

/* F18 toolbar — the store-wide controls, above the meter and above the list
   toolbar. Store-wide state sits above the store-wide meter; the toolbar below
   is about filtering the list, and nothing store-wide belongs among its
   facets. */
.memory-surface-strip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: var(--space-1) var(--space-3);
  background: var(--color-surface-readable);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.memory-surface-strip-spacer {
  flex: 1;
}

/* The profile budget, at the top because it is the one number in memory with a
   hard constraint and no other surface. */
.memory-surface-budget {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-width: 42rem;
  margin-bottom: var(--space-4);
}
.memory-surface-budget-note {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.memory-surface-budget-note.is-over {
  color: var(--color-warn);
}
/* Pinned, unlike the toolbars on Skills, Activity and Marketplace. This is the
   one surface whose whole job is finding one fact in a long list — closer to
   the file tree, which pins its own header for the same reason, than to a card
   grid you take in at a glance. The budget meter above it scrolls away freely:
   it is read once on arrival, and the search is not.

   The background is opaque and matches the page, because rows scroll UNDER
   this bar; a translucent one would show them through it. */
.memory-surface-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  margin-bottom: var(--space-1);
  background: var(--color-bg);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.memory-surface-facets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  flex: 1 1 auto;
}

.memory-surface-list {
  display: flex;
  flex-direction: column;
  max-width: 52rem;
}
/* One entry. The row owns padding, radius and every state; the head is the
   click target and the record is its sibling, so an expanded row is one
   highlighted object rather than two stacked ones. */
.memory-row {
  border-radius: var(--radius-2);
  border-left: var(--border-emphasis) solid transparent;
}
.memory-row:hover {
  background: var(--color-surface-hover);
}
/* An open row takes the SUBSTRATE fill, not hover's. Sharing one surface meant
   a hovered collapsed row looked identical to an open one, so the list appeared
   to open a row under the cursor and close it again as the pointer moved. */
.memory-row.is-expanded {
  background: var(--color-surface-substrate);
}
.memory-row.is-selected {
  background: var(--color-accent-soft);
}
/* Colour is the TIER, not the kind: a profile entry is in front of the agent on
   every turn and a recalled one is looked up, which is the distinction worth a
   hue. The kind is carried by the glyph. */
.memory-row--profile {
  border-left-color: var(--color-accent);
}
.memory-row--superseded {
  border-left-color: var(--color-border-default);
  opacity: 0.65;
}
/* Authorship, on its own edge OUTSIDE the tier rail above. The two are
   different facts about the same row and the rail is already spoken for —
   green there means the profile tier, so an agent-written profile entry would
   be painted the human's colour by a stripe that was answering another
   question. Drawn as a box-shadow rather than a second border so the row keeps
   one border box and one radius: an inset shadow at the very left edge sits
   just inside the tier rail without moving the text a pixel.

   Until now authorship was expressed as the ABSENCE of a label — the meta line
   names the author only when a PERSON wrote the entry — which states the
   common case by saying nothing and the interesting one by exception. The edge
   states both, positively. */
.memory-row[data-authored='agent'] {
  box-shadow: inset var(--border-emphasis) 0 0 0 var(--color-agent);
}
.memory-row[data-authored='human'] {
  box-shadow: inset var(--border-emphasis) 0 0 0 var(--color-accent);
}

.memory-row-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--row-pad) var(--space-2);
  cursor: pointer;
}
.memory-row-head:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: -2px;
  border-radius: var(--radius-2);
}
.memory-row-icon {
  flex: none;
  margin-top: 1px;
  color: var(--color-text-faint);
}
/* Every collapsed row is the same height: a list whose items are all one
   sentence reads as a list, and a list whose items are different heights reads
   as a pile — which is the complaint about the activity feed this surface is
   not inheriting.

   The fixed height is on the COLUMN, not on the body. Reserving two lines
   inside the body itself would open a blank line between a one-line fact and
   its own date, which is most rows; reserving it on the column keeps the
   sentence and its meta together and puts the slack underneath, where it reads
   as breathing room rather than as a gap. Two body lines (38px) plus the meta
   line and its offset. */
.memory-row-main {
  flex: 1 1 auto;
  min-width: 0;
  height: 62px;
}
.memory-row-body {
  font-size: var(--fs-13);
  line-height: 1.45;
  color: var(--color-text-default);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 38px;
}
.memory-row.is-expanded .memory-row-main {
  height: auto;
}
.memory-row.is-expanded .memory-row-body {
  /* Open, the row is no longer part of a scannable column and the whole
     sentence is the point. */
  display: block;
  max-height: none;
}
.memory-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
/* Where the reader's query landed. A filter bar over a visible list must not
   return a row you cannot see your query in — and this body is clamped to two
   lines, so a match can easily be in the half that is cut off. Accent-soft
   rather than the usual yellow: this is the app's own emphasis colour, and a
   highlight has to survive both themes. */
.memory-row-hit {
  background: var(--color-accent-soft);
  color: inherit;
  border-radius: var(--radius-1);
  padding: 0 1px;
}

.memory-row-facts {
  color: var(--color-text-muted);
}
.memory-row-stale {
  color: var(--color-warn);
}
.memory-row-locked {
  color: var(--color-text-faint);
}
.memory-row-chev {
  flex: none;
  /* Optical, not spacing: centres a 14px glyph on the body's first line. */
  margin-top: 2px;
  color: var(--color-text-faint);
}

/* Both ends of a supersede chain, labelled with the sentence rather than the
   id — a bare ULID is exactly what makes the raw file unreadable. */
.memory-chain-link {
  font-family: inherit;
  font-size: inherit;
  text-align: left;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-accent);
  border-bottom: var(--border-thin) solid transparent;
  cursor: pointer;
}
.memory-chain-link:hover {
  border-bottom-color: var(--color-accent);
}

/* The record behind a row: labelled fields first, because the raw file is a
   wall of HLC stamps. Indented to the body's left edge so the fields read as
   belonging to the sentence above them. */
.memory-record {
  /* Left inset lands the fields on the body's left edge: the row's own
     padding, the 14px kind glyph, and the gap after it. */
  padding: var(--space-1) var(--space-2) var(--space-3) calc(var(--space-2) + 14px + var(--space-2));
  display: flex;
  flex-direction: column;
}
.memory-record-row {
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
  padding: var(--space-1) 0;
  font-size: var(--fs-12);
}
.memory-record-label {
  flex: none;
  width: 6.5rem;
  color: var(--color-text-muted);
}
.memory-record-value {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--color-text-default);
  overflow-wrap: anywhere;
}
.memory-record-path {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-muted);
}
.memory-record-note {
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  padding-bottom: var(--space-1);
}
.memory-record-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* The actual markdown, one disclosure away — what you go looking for when
   something seems wrong. */
.memory-raw {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: var(--space-2);
}
.memory-raw-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  align-self: flex-start;
  padding: var(--space-1) 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  cursor: pointer;
}
.memory-raw-toggle:hover {
  color: var(--color-text-default);
}
.memory-raw-body {
  margin: 0;
  padding: var(--space-2);
  max-height: 22rem;
  overflow: auto;
  background: var(--code-bg);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  line-height: 1.5;
  color: var(--color-text-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* A workspace that has saved nothing. The surface stays reachable rather than
   vanishing from the switcher, so this is where the two tiers get explained —
   arriving here is the one moment anybody will read that. */
.memory-surface-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-7) var(--space-4);
  text-align: center;
}
.memory-surface-empty-icon {
  color: var(--color-text-faint);
}
.memory-surface-empty-title {
  font-size: var(--fs-15);
  font-weight: 600;
  color: var(--color-text-default);
}
.memory-surface-empty-copy {
  max-width: 46ch;
  margin: 0;
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* ===========================================================================
   SHARED SURFACE CHROME
   Navigation lives in the sidebar (§4); the top bar carries the brand (= Home),
   the sidebar toggle and the account menu. Surfaces below render ONLY real
   view-model output beneath a clean product header.
   =========================================================================== */
.main--surface {
  display: block;
  overflow: auto;
  /* The scrollbar's lane is reserved whether or not the page scrolls, so a tab
     whose list overflows and one that fits centre their pane at the same x.
     With classic (non-overlay) scrollbars the pane would otherwise re-centre
     by half the bar's width on every switch between them. */
  scrollbar-gutter: stable;
  min-height: 0;
  /* Eases in step with the agent panel's own slide (same duration/curve), so
     the surface and the drawer move as one gesture. */
  transition: padding-right var(--dur-deliberate) var(--ease-out);
}
/* The agent panel is a fixed right-side drawer. Opened over a single-pane
   surface it would otherwise cover the right edge of the content, so the
   surface insets by exactly the panel's width: the feed narrows and re-centers
   in what's left instead of sliding under the panel. */
.main--surface.chat-open {
  padding-right: var(--rail-w-open, 360px);
}
.surface-pane {
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
}
/* A page's tab bar held at the top of the surface's scroll area while the page
   scrolls under it, at full size. Its ground is the page's own (the body's),
   so at rest it is invisible and only the hairline says it is stuck. Above the
   cards' stacking; menus and hovercards sit higher still. */
.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--color-bg);
}
.sticky-bar.is-stuck {
  box-shadow: 0 1px 0 var(--color-border-default);
}
/* Rides just above the bar, so it leaves the scroller exactly when the bar is
   pinned to the scroller's top edge. Two pixels up, not one: a sentinel that
   only touches the edge still counts as in view. */
.sticky-bar-sentinel {
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 1px;
  pointer-events: none;
}
/* Centre-aligned, not baseline: the icon, the title and the count sub all
   share one vertical centre line, so the small sub does not sit low against
   the display-size title beside it. */
.surface-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.surface-head-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-22);
  font-weight: 600;
  color: var(--color-text-default);
}
.surface-head-icon {
  color: var(--color-accent);
}
.surface-head-sub {
  color: var(--color-text-muted);
  font-size: var(--fs-13);
}
/* A creation's page: the description sits on its own line under the title, in
   the body ink, and the meta line follows closely. */
.surface-head--creation {
  margin-bottom: var(--space-2);
  row-gap: var(--space-2);
}
.surface-head--creation .surface-head-sub {
  flex-basis: 100%;
  font-size: var(--fs-14);
  color: var(--color-text-default);
}

/* ---------- S4 Onboarding ---------- */
.onb-step {
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.onb-step-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.onb-step-num {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--btn-accent-text);
  font-size: var(--fs-12);
  font-weight: 600;
}
.onb-step-title {
  font-weight: 600;
  font-size: var(--fs-15);
  color: var(--color-text-default);
}
.onb-welcome-card {
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  padding: var(--space-4);
  max-width: 420px;
}
.onb-welcome-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-accent);
}
.onb-welcome-name {
  font-weight: 600;
  font-size: var(--fs-15);
  color: var(--color-text-default);
}
.onb-welcome-path {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  margin: var(--space-2) 0 var(--space-3);
}
.onb-affordances {
  display: flex;
  gap: var(--space-2);
}
.onb-aff {
  padding: var(--row-pad) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-substrate);
  color: var(--color-text-default);
  font-size: var(--fs-12);
  font-weight: 600;
}
.onb-aff:hover {
  border-color: var(--color-accent);
}
.onb-aff--danger {
  color: var(--color-danger);
}
.onb-aff--danger:hover {
  border-color: var(--color-danger);
}
.onb-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
}
.onb-cat {
  text-align: left;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: var(--space-3);
  cursor: pointer;
  transition:
    border-color var(--dur-quick),
    background var(--dur-quick);
}
.onb-cat:hover {
  border-color: var(--color-accent);
}
.onb-cat.is-selected {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}
.onb-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.onb-cat-label {
  font-weight: 600;
  font-size: var(--fs-13);
  color: var(--color-text-default);
}
.onb-cat-check {
  color: var(--color-accent);
}
.onb-cat-desc {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  line-height: 1.4;
}
.onb-selected-note {
  margin-top: var(--space-3);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.onb-empty {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}

/* ---------- F3 Settings ---------- */

/* The Settings pane: a list column (the sidebar's row family, with a glyph on
   each row) and the open page beside it. The pane runs edge to edge so the
   column's ground and hairline reach the window's edges. */
.surface-pane[data-route='settings'] {
  display: flex;
  flex-direction: column;
  max-width: none;
  min-height: 100%;
  padding: 0;
}
.surface-pane[data-route='settings'] .settings-panel-container {
  flex: 1;
  gap: 0;
}
.settings-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  flex: 1;
  min-height: 100%;
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-self: stretch;
  padding: var(--space-5) var(--space-3);
  background: var(--color-surface-nav);
  border-right: var(--border-thin) solid var(--color-border-default);
}
.settings-nav-title {
  padding: 0 var(--space-2);
  font-size: var(--fs-18);
  font-weight: 600;
  color: var(--color-text-default);
}
.settings-nav-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* A group label in sentence case. The Settings list differs from the sidebar's row on purpose. */
.settings-nav-group {
  padding: var(--space-4) var(--space-3) var(--space-1);
  font-size: var(--fs-13);
  font-weight: 400;
  color: var(--color-text-muted);
}
.settings-nav-rows > .settings-nav-group:first-child {
  padding-top: 0;
}
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-14);
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition:
    background-color var(--dur-quick) var(--ease-out),
    color var(--dur-quick) var(--ease-out);
}
.settings-nav-icon {
  display: inline-flex;
  flex: none;
  color: var(--color-text-muted);
}
.settings-nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-nav-item:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
/* The current page: the accent's soft ground and its ink, the weight unchanged. */
.settings-nav-item.is-active,
.settings-nav-item.is-active:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
.settings-nav-item.is-active .settings-nav-icon {
  color: inherit;
}
/* The page: a column of cards, centred, with room above. */
.settings-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  max-width: 760px;
  min-width: 0;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
  box-sizing: border-box;
}
.settings-content-title {
  margin: 0;
  font-weight: 600;
  font-size: var(--fs-22);
  color: var(--color-text-default);
}
/* The card holding a page's rows is the account card, across the page. */
.settings-content .sp-sec {
  max-width: none;
}
/* The account pages take the same page and card spacing as every other page: the title,
   then the cards, with the gap `.settings-content` puts between its children. Each card
   group a module mounts is a column of its own cards. */
.settings-content .sp-acc-host,
.settings-content .sp-acc,
.settings-content .sp-acc-cards,
.settings-content .sp-acc-cards > div {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.settings-content .sp-acc {
  max-width: none;
  margin-top: 0;
}
.settings-content .sp-acc-cards > div[hidden] {
  display: none;
}
/* A card's heading block sits directly above its first row, which brings its own
   top padding. */
.settings-content .sp-sec > .sp-sec-h {
  margin-bottom: 0;
}
.settings-content .sp-model-body > .sp-sec-p {
  margin-bottom: 0;
}
.settings-signin {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.settings-signin .sp-set-name {
  margin: 0;
}
.settings-signin .sp-sec-acts {
  margin-top: 0;
}
/* A setting row: the name over its help on the left, the control on the right.
   Doubled so it outranks `.sp-kv`, which the account card declares further down. */
.sp-kv.sp-kv--setting {
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  margin: 0 calc(var(--space-5) * -1);
  font-size: var(--fs-14);
}
.sp-kv.sp-kv--setting:first-child {
  border-top: 0;
}
.sp-sec > .sp-kv.sp-kv--setting:first-child {
  margin-top: calc(var(--space-4) * -1);
}
.sp-sec > .sp-kv.sp-kv--setting:last-child {
  margin-bottom: calc(var(--space-4) * -1);
}
.sp-set-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
.sp-set-name {
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--color-text-default);
}
.sp-set-help {
  max-width: 56ch;
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.sp-set-ctl {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
}
.sp-set-problem {
  font-size: var(--fs-12);
  color: var(--color-danger);
}
.settings-content-empty {
  color: var(--color-text-muted);
  font-size: var(--fs-14);
}

/* ==========================================================================
   Settings — the REAL panel (settings-panel.js, active under `srfice serve`).
   The fixture fallback above styles the static-harness placeholder; this block
   styles the live panel: breadcrumb, live search, per-scope switcher, effective
   value, managed badge, open-as-file, and the notifications mute grid.
   ========================================================================== */

.settings-panel-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.settings-loading {
  color: var(--color-text-muted);
  font-size: var(--fs-14);
  padding: var(--space-5) var(--space-1);
}

/* ---- Live search ---- */
.settings-search {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.settings-search-field {
  display: flex;
  align-items: center;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  padding: 2px var(--space-3) 2px 0;
  transition:
    border-color var(--dur-quick) var(--ease-out),
    box-shadow var(--dur-quick) var(--ease-out);
}
.settings-search-field:focus-within {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.settings-search-glyph {
  display: inline-flex;
  flex: none;
  padding-left: var(--space-2);
  color: var(--color-text-faint);
}
.settings-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-13);
  font-family: var(--font-ui);
  padding: var(--space-2) var(--space-1);
}
.settings-search-input::placeholder {
  color: var(--color-text-faint);
}
.settings-search-input:focus {
  outline: none;
}
.settings-search-clear {
  display: inline-flex;
  flex: none;
  padding: var(--space-1);
  border: 0;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-faint);
  cursor: pointer;
}
.settings-search-clear[hidden] {
  display: none;
}
.settings-search-clear:hover {
  color: var(--color-text-default);
}
/* The letters a search matched: the logo's green, solid, with the primary button's
   ink in light and the inverted ink in dark. Daniel's call over a soft mark. */
.settings-hit {
  border-radius: var(--radius-1);
  background: var(--color-accent);
  color: var(--color-text-invert);
}
html[data-theme='light'] .settings-hit {
  color: var(--btn-accent-text);
}
/* The row the search opened a page for: the accent's soft ground, fading away. */
@keyframes settings-row-mark {
  from {
    background-color: var(--color-accent-soft);
  }
  to {
    background-color: transparent;
  }
}
.sp-kv.sp-kv--setting.is-marked,
.sp-home-host.is-marked {
  animation: settings-row-mark 1.6s var(--ease-out) forwards;
}
.sp-set-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  vertical-align: middle;
}
.sp-set-reset {
  margin-left: var(--space-2);
  vertical-align: baseline;
}

.settings-switcher-key {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
.settings-switcher-status {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.settings-switcher-status.is-ok {
  color: var(--color-success);
}
.settings-switcher-status.is-err {
  color: var(--color-danger);
}
.settings-switcher-status.is-pending {
  color: var(--color-text-muted);
}
/* One key and the segmented choice that sets it, on one row: a typed
   setting's control in place of the free-text editor. Wraps on a narrow pane
   rather than squeezing the track. */
.settings-switcher-choice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
/* What the value saved at this scope does, in one line under its file — the
   section's own description says what the setting is for, this says what the
   chosen answer means. Body text, not a hint: it is the reason to pick one. */
.settings-switcher-explanation {
  margin: 0;
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--color-text-default);
}

/* Finding notes: the row's help becomes the coverage line, warn-toned only when
   the default has fallen back to searching directly, and the button under it
   starts the run that improves the coverage. The button is F04 Button,
   secondary emphasis at the compact size: it starts a run, it is not what the
   page is for. */
.sp-set-help.is-fallback {
  color: var(--color-warn);
}
.settings-retrieval-enrich-btn {
  align-self: flex-start;
  margin-top: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-2);
  border: 1px solid var(--color-border-default);
  background: transparent;
  color: var(--color-text-default);
  font-family: var(--font-ui);
  font-size: var(--fs-12);
  cursor: pointer;
  transition: background var(--dur-quick) var(--ease-out);
}
.settings-retrieval-enrich-btn:hover {
  background: var(--color-surface-hover);
}
.settings-retrieval-enrich-btn[hidden] {
  display: none;
}

/* A row that does something: its button, the glyph after the label, and the line
   under the help that says what the last run did. */
.sp-set-ctl .sp-sbtn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
}
.sp-set-note {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.sp-set-note.is-success {
  color: var(--color-success);
}
.sp-set-note.is-danger {
  color: var(--color-danger);
}

.sp-pbtn:disabled,
.sp-sbtn:disabled {
  cursor: default;
  opacity: 0.6;
}

/* ---- Models: Default type ---- */
/* F15 group label over the section's explained-choice rows (a provider's name
   and an F25 --lg track), with the one explanation line under the last row.
   Toggle bucket: the track answers with its own new state, so no press rule. */
.settings-group-label {
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--color-text-faint);
}
.sp-model-body {
  display: block;
}
/* Settings → Models: the providers are the account card's row, `.sp-acc-row`,
   carrying the card's hairlines instead of a border of its own, and running
   edge to edge like a setting row. */
.sp-model-list {
  margin: 0 calc(var(--space-5) * -1);
}
.sp-model-body > .sp-model-list:last-child {
  margin-bottom: calc(var(--space-4) * -1);
}
.sp-acc-row.sp-model-row {
  border: 0;
  border-top: var(--border-thin) solid var(--color-border-default);
  border-radius: 0;
  padding: var(--space-4) var(--space-5);
  justify-content: space-between;
}
.sp-model-row .sp-acc-who {
  flex: 1;
}
.sp-model-states {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-1);
}
/* A label badge: what is set up, tinted with the one hue that says it is ready. */
.sp-model-badge {
  padding: 2px var(--space-2);
  border: var(--border-thin) solid var(--color-success-soft-2);
  border-radius: var(--radius-pill);
  background: var(--color-success-soft);
  color: var(--color-success);
  font-size: var(--fs-11);
  font-weight: 600;
  white-space: nowrap;
}
.sp-model-found,
.sp-model-none {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
/* The key field: monospace, so a pasted key reads character by character. */
.srf-dialog-input.sp-model-key {
  font-family: var(--font-mono);
}
.sp-model-body > .sp-kv--setting {
  margin-left: calc(var(--space-5) * -1);
  margin-right: calc(var(--space-5) * -1);
}
/* The pay-with card holds only its row, which takes the card's padding as its own. */
.sp-model-body > .sp-kv--setting:only-child {
  margin-top: calc(var(--space-4) * -1);
  margin-bottom: calc(var(--space-4) * -1);
  border-top: 0;
}

/* Settings → Library → Allowed without asking: each grant is the account card's
   row, `.sp-acc-row`, carrying the card's hairlines instead of a border of its
   own and running edge to edge like a setting row. Ask again is `.sp-sbtn`, so
   it takes that button's Commit press. */
.sp-allowed-list {
  margin: 0 calc(var(--space-5) * -1);
}
.sp-allowed-body > .sp-allowed-list:last-child {
  margin-bottom: calc(var(--space-4) * -1);
}
.sp-acc-row.sp-allowed-row {
  border: 0;
  border-top: var(--border-thin) solid var(--color-border-default);
  border-radius: 0;
  padding: var(--space-4) var(--space-5);
  justify-content: space-between;
}
.sp-allowed-row .sp-acc-who {
  flex: 1;
}
.sp-allowed-glyph {
  display: grid;
  flex: none;
  color: var(--color-text-muted);
}

/* ---------- MP1/MP2/MP3 Marketplace ---------- */
/* The one filter row: F18 toolbar. Three F04 secondary menu buttons on the left,
   a spacer, and the author's actions as F04 secondary on the right, all in
   Library's compact toolbar look. */
.mp-filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.mp-filterbar-gap {
  flex: 1;
}
/* A menu button names its axis in the regular weight and the value in force in
   bold, so the row says what is narrowing the list without a filled pill. */
.mp-filterbar .mp-sort {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-weight: 400;
}
.mp-filterbar .mp-sort b {
  font-weight: 600;
  color: var(--color-text-default);
}
.mp-sort {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-12);
  cursor: pointer;
}
.mp-sort:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}
/* Pushed to the far end of the filter row — an action, not a filter. */
.mp-refresh {
  margin-left: auto;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-12);
  cursor: pointer;
}
.mp-refresh:hover:not(:disabled) {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}
.mp-refresh:disabled {
  opacity: 0.6;
  cursor: default;
}
/* --- Marketplace search field (F13 wrapper field) + preview dropdown (F12) ---
   The wrapper owns the border and radius and the input inside is transparent,
   because the element that receives focus is not the element that draws the
   boundary. The ring is an `outline`: a box-shadow ring computes to `none`
   under forced-colors, which would leave keyboard users with no indicator at
   all. */
.mp-searchwrap {
  position: relative;
  margin-bottom: var(--space-3);
}
.mp-searchbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: var(--row-pad) var(--space-3);
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-faint);
}
.mp-searchbar:focus-within {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.mp-searchbar-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-13);
  outline: none;
}
.mp-searchbar-input::placeholder {
  color: var(--color-text-faint);
}
/* The dropdown under Discover's search box (the one picker, typed form; F12 dress).
   It hangs from the box's right edge, 340px wide, over the page: the mount takes no
   room and sits above the first-launch tip, so the tip never draws over a row. The
   picker's rows are toggles in the press block, which fits: a row answers a press by
   going where it says, and has no press rule of its own. */
.srch-dd-mount {
  position: absolute;
  right: 0;
  top: 100%;
  width: 340px;
  max-width: calc(100vw - 2 * var(--space-4));
  margin-top: var(--space-1);
  z-index: 400;
}
.cm-menu.cm-menu--search {
  position: static;
  width: 100%;
  max-width: none;
}
/* The first-launch tip sits in a stacking layer the page's own panels cannot rise
   above, so while a dropdown is open the tip steps aside rather than drawing over its rows. */
body:has([data-picker='search']) .fo-callout {
  visibility: hidden;
}
.srch-dd-words {
  font-weight: 600;
}
.srch-dd-mount .prf-avatar,
.srch-dd-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  font-size: var(--fs-11);
}
.fmenu-key {
  flex: none;
  margin-left: auto;
  padding: 0 var(--space-1);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-1);
  color: var(--color-text-faint);
  font-size: var(--fs-11);
  line-height: 16px;
}

/* The author scope, drawn in the search bar. F06 Chip, Token variant — a span
   carrying a value with a remove control, at the family's own metrics rather
   than the raw ones `.chat-scope-chip` drifted to. Pill shape because it is a
   value and not an action: what it displays is the `@author/` prefix that is
   still sitting in the field, so removing it removes the prefix. */
.mp-authorchip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex: none;
  max-width: 40%;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font-size: var(--fs-11);
  font-weight: 600;
}
.mp-authorchip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-authorchip-clear {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: var(--fs-12);
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}
.mp-authorchip-clear:hover {
  opacity: 1;
}

/* The author directory. F02 Selectable list row: one row per publisher, the
   count beside the handle because that is what makes a row worth choosing. */
.mp-authorlist {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}
.mp-authorrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--row-pad) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  cursor: pointer;
}
.mp-authorrow:hover {
  border-color: var(--color-accent);
}
.mp-authorrow-body {
  flex: 1;
  min-width: 0;
}
.mp-authorrow-handle {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
.mp-authorrow-meta {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
/* F07 Badge, Label variant — tinted fill, matching text, tonal border. */
.mp-authorrow-verified {
  padding: 2px var(--space-2);
  border: var(--border-thin) solid var(--color-success-soft-2);
  border-radius: var(--radius-pill);
  background: var(--color-success-soft);
  color: var(--color-success);
  font-size: var(--fs-11);
  font-weight: 600;
  white-space: nowrap;
}

/* --- Marketplace pager (F04 compact, welded into one group) ---
   Numbered and jumpable rather than previous/next, because a pager that cannot
   jump defeats the reason paging was chosen. */
.mp-pagerbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}
.mp-pager {
  display: inline-flex;
  align-items: stretch;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  overflow: hidden;
  background: var(--color-surface-substrate);
}
.mp-pager-btn {
  height: 24px;
  min-width: 26px;
  padding: 0 var(--space-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-right: var(--border-thin) solid var(--color-border-default);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--fs-12);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.mp-pager-btn:last-child {
  border-right: 0;
}
.mp-pager-btn:hover:not(:disabled):not(.is-gap) {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.mp-pager-btn.is-current {
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font-weight: 600;
}
/* A gap stands for the pages between its neighbours and is not navigable —
   clicking it could only guess which one was meant. */
.mp-pager-btn.is-gap {
  color: var(--color-text-faint);
  cursor: default;
}
.mp-pager-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.mp-pager-count {
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}
.mp-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-3);
}
.mp-card {
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  padding: var(--space-4);
  cursor: pointer;
  transition:
    border-color var(--dur-quick),
    transform var(--dur-quick);
}
.mp-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-1px);
}
.mp-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.mp-card-namewrap {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: var(--space-2);
}
/* A long name stays on one line and ends in an ellipsis (the whole id is the
   name's tooltip); the publisher handle and the trust chip beside it never
   shrink, so they stay on the name's line and whole. */
.mp-card-name {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  font-weight: 600;
  font-size: var(--fs-14);
  color: var(--color-text-default);
}
.mp-card-name .creation-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-card-name .creation-handle,
.mp-card-namewrap .mp-verified,
.mp-card-namewrap .mp-established {
  flex: none;
  white-space: nowrap;
}
/* On the creation page the publisher sits after the name on the title line,
   at the line's own baseline. */
.surface-head-title .creation-handle {
  align-self: baseline;
  margin-left: 0;
  font-size: var(--fs-15);
}
.mp-verified {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--color-success);
  background: rgba(95, 208, 142, 0.14);
  border-radius: var(--radius-pill);
  padding: 1px var(--space-2);
}
/* Catalog membership — the Established chip. Same label family and metrics as
   the publisher chip above, in the accent register: adoption and publisher
   are different claims, and the tinted fill keeps this below a filled badge
   in emphasis. Non-catalog items render nothing in its place. */
.mp-established {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  color: var(--color-accent-strong);
  background: var(--color-accent-soft);
  border-radius: var(--radius-pill);
  padding: 1px var(--space-2);
}
.mp-card-ver {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
.mp-card-desc {
  font-size: var(--fs-13);
  color: var(--color-text-default);
  margin: var(--space-2) 0 var(--space-3);
  line-height: 1.45;
}
.mp-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
/* Issue #586: per-bundle monogram avatar, tinted by a stable hash of the bundle
   id (set as --glyph-h inline). Gives each browse card a scannable visual anchor,
   matching the icon the detail page already shows. */
.mp-card-glyph {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  background: hsl(var(--glyph-h) 40% 22%);
  color: hsl(var(--glyph-h) 62% 78%);
  border: var(--border-thin) solid hsl(var(--glyph-h) 35% 34%);
}
html[data-theme='light'] .mp-card-glyph {
  background: hsl(var(--glyph-h) 58% 92%);
  color: hsl(var(--glyph-h) 50% 32%);
  border-color: hsl(var(--glyph-h) 45% 80%);
}
.mp-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
}
.mp-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-1) var(--space-2);
  margin-bottom: var(--space-3);
  border: none;
  background: transparent;
  color: var(--color-accent-strong);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
}
.mp-back:hover {
  text-decoration: underline;
}
.mp-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: var(--space-5);
  align-items: start;
}
.mp-detail-main {
  min-width: 0;
}
.mp-longdesc {
  font-size: var(--fs-14);
  color: var(--color-text-default);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}
.mp-manifest {
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
/* .mp-manifest-row is the shared key/value data row (component canon). */
.mp-manifest-key {
  color: var(--color-text-faint);
}
.mp-manifest-val {
  font-family: var(--font-mono);
  color: var(--color-text-default);
}
.mp-caps-label {
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mp-cap,
.mp-policy-class {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-substrate-2);
  color: var(--color-text-muted);
}
.mp-cap--danger {
  background: rgba(240, 145, 138, 0.16);
  color: var(--color-danger);
}
.mp-cap--none {
  background: transparent;
  border: var(--border-thin) dashed var(--color-border-strong);
  color: var(--color-text-faint);
}
.mp-ai-flag {
  font-size: var(--fs-11);
  color: var(--color-warn);
  background: rgba(233, 177, 98, 0.12);
  border-radius: var(--radius-1);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}
/* The topic line on an item's page. F06 topic pill, TOKEN variant: a topic here
   is a fact about the item, not a control, so it is a span; it wears the same
   accent outline as the pill on a card. */
.mp-topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.mp-topic {
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: var(--border-thin) solid var(--color-accent);
  color: var(--color-accent);
  font-size: var(--fs-11);
  line-height: 1.3;
}
/* The meta line under a creation's description: version, then installs. */
.mp-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.mp-meta-sep {
  color: var(--color-text-faint);
}
.mp-meta-installs {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
/* The warning glyph on the title row: F05 compact, bare until hovered or open,
   then it gains the warn tint and its hairline. */
.mp-risk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-warn);
  cursor: pointer;
}
.mp-risk-btn:hover,
.mp-risk-btn.is-open {
  border-color: var(--color-warn-soft-2);
  background: var(--color-warn-soft);
}
/* F12 content popover: the warning's sentence at a reading width. */
.mp-risk-pop {
  width: 320px;
  padding: var(--space-3);
  font-size: var(--fs-13);
  line-height: 1.45;
  color: var(--color-text-default);
}

.mp-posts {
  margin-bottom: var(--space-3);
}
/* F17 inline notice, warn severity, on the tuned tokens rather than a computed
   tint — the read-and-send combination is the one highlighted warning here. */
.mp-access-warn {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-warn-soft-2);
  background: var(--color-warn-soft);
  color: var(--color-warn);
  font-size: var(--fs-12);
  line-height: 1.45;
}
/* The sheet's contents: groups of short glyph rows. A group's label is F15; a
   row is a 16px glyph and one line of text; About is plain label and value rows. */
.mp-detail-group {
  margin-bottom: var(--space-5);
}
.mp-detail-group-title {
  margin-bottom: var(--space-1);
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--color-text-faint);
}
.mp-detail-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--row-pad) 0;
  font-size: var(--fs-13);
  line-height: 1.4;
  color: var(--color-text-default);
}
.mp-detail-row > .icon {
  display: inline-flex;
  flex: none;
  margin-top: 1px;
  color: var(--color-text-muted);
}
.mp-detail-row.is-warn > .icon {
  color: var(--color-warn);
}
.mp-detail-row.is-quiet {
  color: var(--color-text-muted);
}
.mp-about-row {
  display: flex;
  gap: var(--space-3);
  padding: var(--row-pad) 0;
  font-size: var(--fs-13);
}
.mp-about-key {
  flex: 0 0 96px;
  color: var(--color-text-muted);
}
.mp-about-val {
  color: var(--color-text-default);
}
.mp-detail-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--fs-12);
  line-height: 1.45;
  color: var(--color-text-faint);
}
.mp-detail-note > .icon {
  display: inline-flex;
  flex: none;
  margin-top: 1px;
}
/* The Creation details tab strip: the lane strip's own tab family under the
   topics, not sticky, with room below before the page's content. */
.mp-detail-tabs {
  margin-bottom: var(--space-4);
}
/* The example task — the two halves kept apart, because what you say and what
   it does are two claims and prose runs them together. */
.mp-example {
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
}
.mp-example-label {
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mp-example-line {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-2);
  font-size: var(--fs-12);
}
.mp-example-who {
  flex: 0 0 56px;
  color: var(--color-text-faint);
}
.mp-example-text {
  flex: 1 1 auto;
  color: var(--color-text-default);
  line-height: 1.45;
}

/* How the posts read overall — the one line the volume floor governs. */
.mp-posts-summary {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
/* The verdict filter takes the shared chip rail; only its spacing differs,
   because it sits inside a section rather than above a whole lane. */
.mp-posts-filter {
  margin-bottom: var(--space-3);
}
.mp-review-why {
  margin: var(--space-1) 0;
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
  line-height: 1.4;
}

.mp-section-title {
  font-weight: 600;
  font-size: var(--fs-14);
  color: var(--color-text-default);
  margin: var(--space-4) 0 var(--space-2);
}
/* Below-threshold reviews state — boxed-callout empty state (solid border:
   dashed is reserved for drop targets). */
.mp-reviews-gated {
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: var(--space-4);
  line-height: 1.5;
}
.mp-reviews-gated-title {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-text-muted);
}
.mp-reviews-gated-copy {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.mp-review {
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
}
.mp-review-head {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-11);
  margin-bottom: var(--space-1);
}
.mp-review-author {
  font-weight: 600;
  color: var(--color-text-default);
  font-family: var(--font-mono);
}
.mp-review-date {
  color: var(--color-text-faint);
}
.mp-review-body {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  line-height: 1.45;
}
/* A neutral inline notice on an item's page, stated in prose and never as a
   marker on rows: why an item carries no Established chip, and why a record
   this build cannot read shows none of the rows other items show. */
.mp-adoption-note {
  margin: var(--space-3) 0;
  padding: var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate-2);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  line-height: 1.4;
}
.mp-detail-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
/* At the app's narrow breakpoint the side column stacks under the page instead
   of keeping a fixed 260px track the page cannot fit beside. */
@media (max-width: 700px) {
  .mp-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* The rating lives inside the creation page's action card, which draws the box. */
.mp-ratings-box {
  min-width: 0;
}
.mp-ratings-pct {
  font-size: var(--fs-18);
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-default);
}
.mp-ratings-sub {
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
/* Below-floor rating state — same emphasis ladder as the reviews callout. */
.mp-ratings-empty-title {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-text-muted);
}
/* F27 vote control — the two thumbs a creation is rated with, on its own page and
   (as the composer's rows) beside a post. Lucide `thumbs-up`, and the same glyph
   turned over for down; the thumbs' own rules (`.vote.cm-thumbvote`) are with the
   composer's. Both are toggles: pressing the one you hold takes the rating back.
   Press bucket: toggle — the state flip is the answer. */
.vote-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.vote {
  display: inline-flex;
  flex: none;
}
.vote-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius-1);
  cursor: pointer;
}
.vote-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}
.vote-btn[disabled] {
  cursor: default;
}
.vote-score {
  min-width: 0;
}
.vote-score-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.vote-note {
  margin-top: var(--space-2);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
/* F26 rating mark — the dome in one ink, coloured by the score's band, before
   the score wherever one is printed: a browse card, the hover card and the
   ratings box. An 18px icon box, about 10px of mark, since the dome is twice
   as wide as it is tall. Below the floor there is no score to colour by and
   the mark is grey. Not a control: it never presses. */
.rating-mark {
  display: inline-flex;
  flex: none;
}
.rating-mark .srf-mark {
  display: block;
}
.rating-mark--band-1 {
  color: var(--color-rating-1);
}
.rating-mark--band-2 {
  color: var(--color-rating-2);
}
.rating-mark--band-3 {
  color: var(--color-rating-3);
}
.rating-mark--band-4 {
  color: var(--color-rating-4);
}
.rating-mark--band-5 {
  color: var(--color-rating-5);
}
.rating-mark--none {
  color: var(--color-border-strong);
}
.dsc-panel-rating {
  margin-left: var(--space-2);
}
.mp-fork-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  justify-content: center;
  padding: var(--row-pad) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-accent);
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
}
.mp-fork-btn:hover {
  background: var(--color-accent-soft-2);
}
.mp-fork-note {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  background: var(--color-surface-substrate);
  border: var(--border-thin) dashed var(--color-border-strong);
  border-radius: var(--radius-2);
  padding: var(--space-3);
  line-height: 1.5;
}

/* ---------- Discover: the post lanes ---------- */

/* The lane switch is the Library's tab family — a lane is a different page of
   one surface, where the kind pills below are a filter over the page you are
   already on. The two are different jobs and must not look alike; the class is
   named for the surface that declared it first, not for the only one using it. */
.dsc-lanes {
  gap: var(--space-5);
  margin-bottom: var(--space-4);
}
/* No rule under the strip at rest: the pinned bar's hairline
   (`.sticky-bar.is-stuck`) is the only line. The tabs carry the pixel the rule
   used to take, so the strip keeps its 33px and the current tab's underline
   sits on its bottom edge. */
.dsc-lanes .lib-tab {
  padding-bottom: calc(var(--row-pad) + var(--border-thin));
}

/* Discover's delta on the badge above: its tiles and rows stack in a column, so
   the marker has to stop stretching to the column's width. Not in the canon —
   the Featured card's foot is a centred flex row, and a shared alignment there
   would move a chip on a surface this change does not otherwise touch. */
.dsc-verdict {
  align-self: flex-start;
}

/* Control strip, not a toolbar: no surface of its own, no boundary — the chips
   sit directly on the page the way a feed's chip rail does.

   It scrolls sideways and never wraps. Eleven chips plus All do not fit one row
   on a narrow window, and a row that wrapped would push the first tile below
   the fold on exactly the windows with least room to spare. So the rail gives
   up width instead of height, which is what every feed with a chip rail does. */
.dsc-chiprail {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-2);
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-1);
  scrollbar-width: none;
}
.dsc-chiprail::-webkit-scrollbar {
  display: none;
}

/* F06 chip, toggle variant — a filter switched on and off. Pill, because it
   carries a value rather than committing an action. */
.dsc-chip {
  flex: 0 0 auto;
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  background: var(--color-surface-substrate);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color var(--dur-quick),
    border-color var(--dur-quick);
}
.dsc-chip:hover {
  border-color: var(--color-accent);
  color: var(--color-text-default);
}
.dsc-chip.is-active {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}
.dsc-chip:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}

/* Three columns at the page's usual width, down to one, at an 8px gap. Every tile
   is a 1:1 square, so a grid of mixed posts is a grid of one size. */
.dsc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-2);
}

/* The slot exists so the Featured card's save control can sit OVER the tile. */
.dsc-post-slot,
.dsc-follow-slot {
  position: relative;
  display: flex;
  min-width: 0;
}

/* F10 card, content variant — a bounded summary of one post, clickable. A div with
   an open button laid over it, so the author, the topics and the cube are real
   controls: everything else lets a press through to the button. */
.dsc-post {
  position: relative;
  flex: 1 1 auto;
  aspect-ratio: 1 / 1;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition:
    border-color var(--dur-quick),
    box-shadow var(--dur-quick);
}
.dsc-post:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-2);
}
.dsc-post:has(> .dsc-post-open:focus-visible) {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
.dsc-post-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: none;
  cursor: pointer;
}
.dsc-post-open:focus-visible {
  outline: none;
}

/* The cover is the picture frame of a post shown small. In the grid it fills the
   square, and the picture shows whole over a blurred copy of itself. */
.dsc-post-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background: var(--color-surface-substrate-2);
}
.dsc-post-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dsc-post .dsc-post-cover {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  height: 100%;
}
.dsc-post .dsc-post-img {
  position: absolute;
  inset: 0;
  object-fit: contain;
}
.dsc-post .dsc-media-wash {
  filter: blur(12px) saturate(1.05);
  opacity: 1;
}

/* A post with several images, or a clip, signs it top right: white with a soft
   shadow, over any picture. */
.dsc-post-sign {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 2;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 1);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

/* The title's panel over the picture's foot, inset 8px. Until the glass draws it,
   this is the plain fallback: a light blur over the picture, a faint tint, a rim
   and white ink. */
.dsc-post-panel {
  position: absolute;
  left: var(--space-2);
  right: var(--space-2);
  bottom: var(--space-2);
  z-index: 2;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-4);
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(2.5px) saturate(1.35);
  backdrop-filter: blur(2.5px) saturate(1.35);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.32),
    inset 1.5px 1.5px 1px -0.5px rgba(255, 255, 255, 0.85),
    inset -1px -1px 1px -0.5px rgba(255, 255, 255, 0.4),
    0 6px 18px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}
.dsc-post-panel .dsc-post-why {
  color: rgba(255, 255, 255, 1);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* The glass, in one selector so the phone grid can switch it off: where the
   browser draws an SVG filter as a backdrop filter (Chromium), glass-lens.js sets
   --glass-filter to the panel's displacement map; elsewhere the plain blur above
   stays. The tint is 4 to 5%; the ink and the dimming layer follow the picture
   under the panel (glass-ink.js sets data-ink and data-dim). */
.dsc-post-panel {
  -webkit-backdrop-filter: var(--glass-filter, blur(2.5px) saturate(1.35));
  backdrop-filter: var(--glass-filter, blur(2.5px) saturate(1.35));
}
.dsc-post-panel[data-ink='dark'] {
  background: rgba(0, 0, 0, 0.05);
}
.dsc-post-panel[data-ink='dark'] .dsc-post-why {
  color: rgba(0, 0, 0, 0.86);
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.45);
}
.dsc-post-panel[data-dim='dark'] {
  background: rgba(0, 0, 0, 0.22);
}
.dsc-post-panel[data-dim='light'] {
  background: rgba(255, 255, 255, 0.32);
}
/* Asked for no transparency, or in forced colours: no bend, and the dimming
   layer always, so the title reads without the picture's help. */
@media (prefers-reduced-transparency: reduce), (forced-colors: active) {
  .dsc-post-panel {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .dsc-post-panel[data-ink='dark'] {
    background: rgba(255, 255, 255, 0.32);
  }
  .dsc-post-panel:not([data-ink='dark']) {
    background: rgba(0, 0, 0, 0.22);
  }
}

/* A text tile laid out like a card: head, words centred in what is left, and the
   cube alone at the foot. Only its controls take a press. */
.dsc-post-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  pointer-events: none;
}
.dsc-post-face button,
.dsc-post-face a {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
.dsc-post-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  min-width: 0;
}
.dsc-post-head .dsc-id {
  width: 100%;
  min-width: 0;
}
.dsc-post-head .dsc-id-left {
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
}
.dsc-topic-row {
  display: flex;
  gap: var(--space-1);
  min-width: 0;
  overflow: hidden;
}
.dsc-topic-row .dsc-topic-pill {
  flex: 0 0 auto;
  margin-inline-start: 0;
  vertical-align: baseline;
}
.dsc-post-words {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-2);
}
.dsc-post-foot {
  display: flex;
  justify-content: flex-end;
  min-height: 24px;
}
.dsc-post-cube {
  flex: none;
}
/* The creations the cube opens, rising from just above it inside the tile; the post
   page's container with its own anchor. Its height is capped from script so the
   author line stays clear, and it scrolls past that. */
.dsc-post .dsc-post-creations {
  left: var(--space-2);
  right: var(--space-2);
  top: auto;
  bottom: calc(var(--space-3) + var(--space-5) + var(--space-1));
  z-index: 3;
  overflow-y: auto;
  align-content: flex-start;
}

.dsc-post-why {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--fs-14);
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text-default);
}
.dsc-post-words .dsc-post-why {
  text-align: center;
  font-size: var(--fs-16);
}
.dsc-post-lede {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--font-prose);
  font-size: var(--fs-14);
  line-height: 1.5;
  text-align: center;
  color: var(--color-text-muted);
}
.dsc-post-author {
  font-weight: 600;
  color: var(--color-text-default);
}

/* On a phone the grid is three columns of square tiles edge to edge with a 2px
   gap, as a photo grid is. A picture tile is the picture alone: no glass, no
   title (the glass is off, so the lens is never drawn), and only the corner sign
   says what a tap opens. A text tile shows its title alone, centred, in the
   corner-to-corner square. The post button floats at the foot, so the grid keeps
   room under its last row. */
@media (max-width: 700px) {
  .dsc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    margin-inline: calc(-1 * var(--space-5));
    padding-bottom: calc(var(--space-5) * 3 + var(--space-4));
  }
  /* The grid runs to the window's edge, so the page gives up its scrollbar lane (the
     slim bar's track would otherwise paint an 8px strip down the right of the tiles). */
  .main--surface:has(.dsc-grid) {
    scrollbar-gutter: auto;
    scrollbar-width: none;
  }
  .dsc-post {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .dsc-post-panel,
  .dsc-post-face .dsc-post-head,
  .dsc-post-face .dsc-post-lede:not(.is-alone),
  .dsc-post-face .dsc-post-foot {
    display: none;
  }
  .dsc-post.is-text {
    box-shadow: inset 0 0 0 var(--border-thin) var(--color-border-default);
  }
  .dsc-post-face {
    justify-content: center;
    padding: var(--space-2);
  }
  .dsc-post-words {
    flex: 0 1 auto;
  }
  .dsc-post-words .dsc-post-why,
  .dsc-post-words .dsc-post-lede.is-alone {
    -webkit-line-clamp: 5;
    font-family: var(--font-ui);
    font-size: var(--fs-13);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text-default);
  }
  .dsc-post-sign {
    top: var(--space-1);
    right: var(--space-1);
  }
  .dsc-post-sign svg {
    width: 16px;
    height: 16px;
  }
}

/* The Featured card's Save sits over the open button, and under the sign a picture
   tile has top right. */
.dsc-post-slot.is-featured .dsc-post-save {
  z-index: 3;
}
.dsc-post-slot.is-featured:has(.dsc-post.is-media) .dsc-post-save {
  top: calc(var(--space-2) + var(--space-5) + var(--space-1));
}
/* Featured's curator badge and verdict chip: over a picture's top left, and in the
   head of a text tile. Never a press target. */
.dsc-post-extras-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  pointer-events: none;
}
.dsc-post > .dsc-post-extras {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 2;
}
/* F07 badge, token variant — says a curator wrote this, which is the one thing
   about a post's provenance a reader cannot infer from the post. */
.dsc-post-curator {
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font-size: var(--fs-11);
  font-weight: 600;
}
/* F05 icon button, 24px square — over the tile's top corner, a sibling of the
   tile rather than a child, for the same reason the slot exists. */
.dsc-post-save {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: var(--radius-1);
  background: var(--color-surface-overlay);
  color: var(--color-text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--dur-quick);
}
.dsc-post-slot:hover .dsc-post-save,
.dsc-follow-slot:hover .dsc-post-save,
.dsc-post-save:focus-visible,
/* A kept post shows its mark whether or not the tile is hovered. The one state
   worth seeing at a glance would otherwise be the one state that hides. */
.dsc-post-save.is-on {
  opacity: 1;
}
.dsc-post-save.is-on {
  color: var(--color-accent);
}
.dsc-post-save:hover {
  color: var(--color-text-default);
}
.dsc-post-save:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}

/* Following is a column of rows, not a grid of one column: these are posts by
   people and about things the reader already chose, so the lane is for reading
   rather than for scanning past. The body is shown here and withheld on a tile
   for that reason alone. */
.dsc-followfeed {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 720px;
}
.dsc-follow {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-4);
  text-align: left;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  cursor: pointer;
  transition: border-color var(--dur-quick);
}
.dsc-follow:hover {
  border-color: var(--color-accent);
}
.dsc-follow:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
.dsc-follow-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  flex: 1 1 auto;
}
.dsc-follow-why {
  margin: 0;
  font-size: var(--fs-15);
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text-default);
}
.dsc-follow-body {
  margin: 0;
  font-family: var(--font-prose);
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--color-text-muted);
}
/* The cover rides beside the row rather than above it, and keeps the same 16:9
   the grid uses so one post is the same picture in both lanes. */
.dsc-follow .dsc-post-cover {
  flex: 0 0 auto;
  width: 176px;
  border-radius: var(--radius-2);
}
/* On a phone the row stacks: the text takes the whole row and the picture sits
   under it at full width, still 16:9, because beside the text it would leave the
   words a column barely over 100px wide. */
@media (max-width: 600px) {
  .dsc-follow {
    flex-direction: column;
    align-items: stretch;
  }
  .dsc-follow .dsc-post-cover {
    width: 100%;
  }
}

/* A Following card is a plain box, because its row holds buttons and a button
   cannot hold a button. The open button is laid over the whole card and the
   card's own controls sit above it; everything else lets a press through to it,
   so pressing anywhere else opens the post. The row sits --space-3 under the
   text, and the "..." is at the right end of the name line. */
.dsc-follow--post {
  position: relative;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
}
.dsc-follow-open {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: none;
  cursor: pointer;
}
.dsc-follow--post:has(.dsc-follow-open:focus-visible) {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
.dsc-follow--post > .dsc-follow-top,
.dsc-follow--post > .dsc-acts {
  position: relative;
  pointer-events: none;
}
.dsc-follow--post button,
.dsc-follow--post a {
  pointer-events: auto;
}
.dsc-follow-top {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  min-width: 0;
}
.dsc-follow--post .dsc-acts {
  padding-top: 0;
}
/* The "..." sits on the name line without making it taller than its text. */
.dsc-follow--post .prf-row-meta .prf-audience,
.dsc-follow--post .prf-row-meta .prf-more {
  align-self: center;
  width: 24px;
  height: 24px;
  margin-block: calc(var(--space-2) * -1);
}
@media (max-width: 600px) {
  .dsc-follow-top {
    flex-direction: column;
    align-items: stretch;
  }
}

/* The foot of a lane that has more to load. The button is not the way the feed
   normally advances — it loads on scroll — but a browser that never fires the
   observer would otherwise end at one batch with no way to say so. */
.dsc-sentinel {
  display: flex;
  justify-content: center;
  padding: var(--space-6) 0;
}
.dsc-more {
  padding: var(--row-pad) var(--space-4);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
}
.dsc-more:hover {
  border-color: var(--color-accent);
  color: var(--color-text-default);
}

/* The end of the lane, and a lane a filter emptied. Both are the shared
   centered empty state; only the words inside them are local. */
.dsc-end-title,
.dsc-empty-title {
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--color-text-muted);
}
.dsc-end-copy,
.dsc-empty-copy {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}

/* ---------- The stream a post is read in ----------
   Opening a post from the grid does not open a page about that post: it opens
   a stream that starts at it, and every entry is the same container — identity
   line, caption, body, media, actions — so reading on is scrolling rather than
   a click, a back, and another click. Clicking one entry is what leaves for
   that post's own page, where its replies are.

   ---------- The lane one post occupies ----------
   A fixed 560px column, centred, rather than the full width of the pane. The
   media frame is a fixed 16:9 and takes its height from this width, so a
   full-width post on a wide screen paints an image taller than the viewport and
   turns a scrolling feed into a slideshow — which is the thing the fixed ratio
   was chosen to avoid.

   It replaces the container query this stream used to be: the entries answered
   to the stream's own width because the reply rail beside them had to fold when
   the agent panel took 360px away. The replies are a page of their own now, so
   there is nothing left to fold and nothing left for the entries to answer to.
 */
.dsc-stream,
.dsc-postpage {
  width: min(var(--dsc-post-col), 100%);
  margin-inline: auto;
  --dsc-post-col: 640px;
}
.dsc-stream > *,
.dsc-postpage > * {
  max-width: var(--dsc-post-col);
}
.dsc-streamlist {
  max-width: none;
}
/* A narrow gutter between posts, with the hairline running down the middle of
   it. Narrow on purpose — the old 32px gap made a feed of six posts read as six
   separate pages — but not nothing: the gutter is what keeps the rule clear of
   the rounded hover fill above and below it. */
.dsc-streamlist {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ---------- The post container ---------- not a card; a block between rules ---
   A stream of bordered cards reads as a list of things to choose between, and
   at feed length it is mostly borders. So a post is a plain block, and a single
   muted hairline in the gutter between two of them says where one person
   stopped writing and the next started — one line per boundary rather than two
   borders facing each other.

   The hover fill is what a card's border used to do: it draws the extent of the
   thing the click will open. Without it the target is invisible, which on a
   surface where the whole block is clickable is worse than having no card at
   all. It is inset from the hairline and rounded, so the highlight reads as the
   post rather than as a band across the column. */
.dsc-post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-3);
  background: transparent;
  transition: background var(--dur-quick) var(--ease-out);
}
/* The hairline between two posts, drawn in the gutter rather than on either
   post, so the rounded hover fill never has to meet it. */
.dsc-post-card + .dsc-post-card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  /* Half the gutter above this post's own edge, which is its middle. */
  top: calc(var(--space-2) / -2);
  border-top: var(--border-thin) solid var(--color-border-default);
}
/* Only in the stream. On the post's own page there is nowhere for a click to
   go, so it offers neither a pointer nor a highlight promising one. */
.dsc-post-card.is-openable {
  cursor: pointer;
}
.dsc-post-card.is-openable:hover {
  background: var(--color-surface-hover);
}

/* ---------- Identity line ----------
   Green left (the human), blue right (the machine). The one place in the app
   where the two registers are peers, which the register's own charter names as
   the composition it otherwise rejects; the asymmetry is restored by SCALE
   rather than by colour — this row is --fs-12 against a --fs-22 caption and a
   16:9 image. The reasoning is in discover-post-card.js, where the next reader
   will be when they wonder. */
.dsc-id {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--fs-12);
  line-height: 1.4;
}
.dsc-id-left {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-width: 0;
  flex: 1;
}
/* Green is the human's colour, and this is the human. The selector carries the
   parent deliberately: profileByline's own reset declares `color: inherit` so
   every caller can colour it, and that reset is declared LATER in this sheet
   than this block is — at equal specificity the later rule wins, so a plain
   `.dsc-id-author` lost to it and the author has been rendering in the body ink
   rather than in green. Naming the row it sits in is what outweighs the reset. */
.dsc-id .dsc-id-author {
  font-weight: 600;
  color: var(--color-text-default);
}
.dsc-id .dsc-id-author:hover {
  text-decoration: underline;
}
.dsc-id-sep,
.dsc-id-date {
  color: var(--color-text-faint);
}
/* F07 badge, label variant — tinted, says a curator wrote this. */
.dsc-id-curator {
  padding: 0 var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft-2);
  color: var(--color-accent);
  font-size: var(--fs-11);
  font-weight: 600;
}
/* ---------- Caption ----------
   What the post says, at the size that makes it the thing being read. Clamped
   to two lines: a caption is a lead, and a third line is the body's job. */
.dsc-caption {
  margin: 0;
  font-size: var(--fs-22);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text-default);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Body ----------
   The prose face, smaller than the caption, three lines and then an ellipsis:
   in a stream the body is a taste of the writing rather than the writing, and
   a body allowed its full length would push the picture off the screen. */
.dsc-body {
  margin: 0;
  font-family: var(--font-prose);
  font-size: var(--fs-15);
  line-height: 1.55;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* On the post's own page the cap rises: the reader arrived to read this one. */
.dsc-body--page {
  -webkit-line-clamp: 20;
}

/* ---------- The media frame ---------- carousel; F22 marks at its foot -------
   Takes the first image's own shape, from 2:1 to 3:4, so nothing moves when the
   bytes land. Wider than 2:1 fits inside on the wash; taller than 3:4 fills the
   width and is cut from the top at the height cap (see `.is-cut`). */
.dsc-media {
  position: relative;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  box-sizing: border-box;
  background: var(--color-surface-substrate-2);
  /* Set from the record by media-carousel.js — the attachment's own
     shape, clamped to what the feed can carry. The fallback is the old fixed
     frame, for a record whose size did not survive whatever produced it. */
  aspect-ratio: 1 / var(--media-ratio, 0.5625);
  /* And never taller than what is left of the window once the rest of the post
     has taken its share. A post taller than the screen cannot be read without
     scrolling. The subtrahend is the post's own chrome: identity line, caption, body,
     action row, padding and the surface's own header room. */
  max-height: calc(100vh - 320px);
  overflow: hidden;
}
/* `contain`, not `cover`. The frame already matches a single attachment exactly,
   so there is nothing to crop; it is the two cases where they DISAGREE that the
   choice decides — a carousel member shaped unlike the first, and an attachment
   the height cap has shortened. Cropping either one hides part of a picture
   somebody chose to post, and the reader has no way to know it happened. */
.dsc-media-img,
.dsc-media-video {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* The wash behind it — the same image, covering the frame, blurred past
   legibility and dimmed. It fills what a contained image leaves over without
   inventing a colour for it, and the blur is heavy enough that nobody reads it
   as a second picture. Scaled up because a blur samples past its own edges and
   would otherwise leave a soft rim inside the frame. */
.dsc-media-wash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.12);
  filter: blur(24px) saturate(1.15);
  opacity: 0.6;
}
/* A picture taller than 3:4 fills the frame's width and is cut from the top where
   the height cap falls, then fades into the page over its last 96px so the cut
   reads as a cut. The wash has nothing to fill, so it is not drawn. */
.dsc-media.is-cut .dsc-media-img,
.dsc-media.is-cut .dsc-media-video {
  object-fit: cover;
  object-position: top;
}
.dsc-media.is-cut .dsc-media-wash {
  display: none;
}
.dsc-media.is-cut::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 96px;
  background: linear-gradient(to bottom, transparent, var(--color-bg));
  pointer-events: none;
}
/* Floating, anchored and transient → surface-overlay and --shadow-2. 32px is
   the default control height; these are the one place a control sits ON an
   image, so they take the round. Drawn only past one image. */
.dsc-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  background: var(--color-surface-overlay);
  color: var(--color-text-default);
  box-shadow: var(--shadow-2);
  cursor: pointer;
}
.dsc-arrow:hover {
  background: var(--color-surface-hover);
}
.dsc-arrow--prev {
  left: var(--space-2);
}
.dsc-arrow--next {
  right: var(--space-2);
}
/* The marks themselves are F22 and declared in the component canon; what is
   local to the carousel is where the row sits, and the ground it sits on.

   The ground is not decoration. F22 says the active mark is --color-text-default
   and an inactive one --color-border-strong, which is the right ladder on a
   surface — and exactly backwards over a photograph: on a dark image the dark
   active mark disappears while the pale inactive ones stay bright, so the row
   says the reader is everywhere except where they are. So the row rides the same
   overlay ground the arrows two rules up already use to sit on an image, and the
   family's three states keep their meaning without the family knowing anything
   about images. */
.dsc-dots {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: var(--space-2);
  display: flex;
  justify-content: center;
  gap: var(--space-1);
  padding: 0 var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--color-surface-overlay);
  box-shadow: var(--shadow-2);
}

/* ---------- Discover: the Featured lane ----------
   One pick centred at full size, its neighbours peeking either side smaller and
   dimmed. Every card sits in the same grid cell and is placed by its distance
   from the centre (`data-offset`), so stepping moves the cards rather than
   rebuilding them and the stage is as tall as its tallest card. Cards past the
   neighbours are parked off to the side, invisible and out of reach. */
.dsc-featured {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6) 0 var(--space-5);
  overflow: hidden;
}
.dsc-featured-stage {
  display: grid;
  justify-items: center;
  width: 100%;
  outline: none;
  touch-action: pan-y;
}
.dsc-featured-stage:focus-visible .dsc-featured-slide[data-offset='0'] {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: var(--space-1);
  border-radius: var(--radius-3);
}
.dsc-featured-slide {
  grid-area: 1 / 1;
  width: min(600px, 62%);
  transition:
    transform var(--dur-deliberate) var(--ease-out),
    opacity var(--dur-deliberate) var(--ease-out);
}
.dsc-featured-slide[data-offset='0'] {
  z-index: 2;
}
.dsc-featured-slide[data-offset='-1'],
.dsc-featured-slide[data-offset='1'] {
  z-index: 1;
  opacity: 0.45;
  cursor: pointer;
}
.dsc-featured-slide[data-offset='-1'] {
  transform: translateX(-78%) scale(0.86);
}
.dsc-featured-slide[data-offset='1'] {
  transform: translateX(78%) scale(0.86);
}
.dsc-featured-slide[data-offset='-2'],
.dsc-featured-slide[data-offset='2'] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.dsc-featured-slide[data-offset='-2'] {
  transform: translateX(-156%) scale(0.72);
}
.dsc-featured-slide[data-offset='2'] {
  transform: translateX(156%) scale(0.72);
}
/* The picks form a ring, so a step can carry a card from one side to the
   other — with three or four picks, from a place you can see. Sliding there
   would sweep it across the centre card, so for that step it fades out where
   it was, moves while it cannot be seen, and fades back in at its new place. */
.dsc-featured-slide.is-crossing {
  transition: transform 0s linear calc(var(--dur-deliberate) / 2);
  animation: dsc-featured-cross var(--dur-deliberate) var(--ease-in-out);
}
@keyframes dsc-featured-cross {
  50% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dsc-featured-slide,
  .dsc-featured-slide.is-crossing {
    transition: none;
    animation: none;
  }
}
/* The controls sit under the cards rather than on them: the arrows are the
   media carousel's own, set into the row beside the F22 dots, and the row needs
   no overlay ground because it rests on the page rather than on a picture. */
.dsc-featured-controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.dsc-featured-controls .dsc-arrow {
  position: static;
  transform: none;
}
.dsc-featured-controls .dsc-dots {
  position: static;
  transform: none;
  background: none;
  box-shadow: none;
}

/* The pointer at the very top of the discovery feed: what the curators picked,
   and the way to it. On the readable surface with a thin accent border, so it reads
   with the post cards under it rather than as a banner. */
.dsc-featured-pointer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  border: var(--border-thin) solid var(--color-accent);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  font-size: var(--fs-13);
  color: var(--color-text-default);
}
.dsc-featured-pointer-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--color-accent);
  cursor: pointer;
}
.dsc-featured-pointer-link:hover {
  text-decoration: underline;
}

/* ---------- What a post refers to ---------- chips, tags, and the card ------
   A post names creations in its text and tags others on itself, and both open
   the same card. Three families, each by its job:

   The CHIP is an inline link in running text, so it is set in the UI face at
   the prose's own size, carries the agent register (a creation is the machine
   side), and is told apart from the words around it by a wash rather than an
   underline — an underline in a paragraph reads as emphasis. It opens a page,
   so it sits in the press block's open bucket.

   The TAG GLYPH is a toggle: it shows or hides the post's tagged creations and
   its expanded state is the answer, so it is not in the press block. On a
   picture it is a small round button on the readable ground, so it reads over
   any image; under the text it is a bare 24px glyph like the action row's.

   The CARD floats over the page, positioned by script against the chip, so it
   is a surface over content: readable ground, a hairline, --radius-3 and
   --shadow-2. Its inner parts keep the names they had as the panel the card
   replaced, because they are the same parts. */
.dsc-ref {
  display: inline;
  padding: 1px var(--space-1);
  border: 0;
  border-radius: var(--radius-1);
  background: var(--color-agent-wash);
  color: var(--color-agent-strong);
  font-family: var(--font-ui);
  font-size: 0.9em;
  font-weight: 600;
  line-height: inherit;
  cursor: pointer;
}
.dsc-ref:hover {
  text-decoration: underline;
}
.dsc-ref:focus-visible,
.dsc-tag-chip:focus-visible,
.dsc-tag-toggle:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
/* Under the text: the glyph alone, and the chips beside it once opened. */
.dsc-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}
/* On a picture: pinned to its lower-left corner, above the carousel's arrows. */
.dsc-tags--media {
  position: absolute;
  left: var(--space-2);
  bottom: var(--space-2);
  right: var(--space-2);
  z-index: 2;
  pointer-events: none;
}
.dsc-tags--media > * {
  pointer-events: auto;
}
.dsc-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.dsc-tag-toggle {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-2);
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
}
.dsc-tag-toggle:hover,
.dsc-tag-toggle[aria-expanded='true'] {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.dsc-tags--media .dsc-tag-toggle {
  width: 28px;
  height: 28px;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
}
.dsc-tags--media .dsc-tag-toggle[aria-expanded='true'] {
  border-color: var(--color-border-strong);
}
.dsc-tag-chip {
  display: inline-flex;
  align-items: baseline;
  max-width: 100%;
  padding: 3px var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
}
.dsc-tag-chip:hover {
  border-color: var(--color-border-strong);
}
.dsc-tag-chip-label {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dsc-hovercard {
  position: fixed;
  z-index: 90;
  width: 300px;
  max-width: calc(100vw - var(--space-4));
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-2);
}
.dsc-hovercard .dsc-panel-body {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}
.dsc-hovercard-head {
  margin: 0;
  min-width: 0;
}
/* The card's name is the way on to the creation's page, so it underlines under
   the pointer; at rest it is a heading. */
.dsc-hovercard-name {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: var(--color-text-default);
  cursor: pointer;
}
.dsc-hovercard-name:hover .dsc-hovercard-title {
  text-decoration: underline;
}
.dsc-hovercard-title {
  font-size: var(--fs-15);
  font-weight: 600;
}
.dsc-hovercard .creation-name {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1);
  flex-wrap: wrap;
}
.dsc-panel-qual,
.dsc-panel-cat {
  font-size: var(--fs-12);
  line-height: 1.6;
  color: var(--color-text-muted);
}
.dsc-panel-kind {
  color: var(--color-agent);
  font-weight: 600;
}
.dsc-panel-qual .dsc-panel-author {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--color-accent);
  cursor: pointer;
}
.dsc-panel-qual .dsc-panel-author:hover {
  color: var(--color-accent-strong);
  text-decoration: underline;
}
.dsc-panel-topic {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.dsc-panel-topic:hover {
  color: var(--color-text-default);
  text-decoration: underline;
}
.dsc-panel-desc {
  margin: 0;
  font-size: var(--fs-13);
  line-height: 1.55;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dsc-panel-foot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-top: var(--border-thin) solid var(--color-border-default);
}
.dsc-panel-ver {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
/* Save to library — bordered, so it presses. Deliberately not the post's
   bookmark and deliberately not installing: a post, the item it is about and a
   copy of that item on a shelf are three different objects. The mark carries no
   outer box of its own; the button already has a border.

   The mark is Lucide's bookmark at 16px, centred in the 32px box. */
.dsc-panel-tolib {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.dsc-panel-tolib:hover {
  border-color: var(--color-border-strong);
  color: var(--color-accent);
}

/* ---------- The action row ---------- F18 toolbar of F05 icon buttons -------
   24px compact, 16px glyphs. Like, replies and repost on the left; keeping the
   post and the overflow on the right. */
.dsc-acts {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-1);
}
/* Reactions at the left, the tag button and Save at the right. Each action is
   its glyph box and its count, and the next action's box starts --space-4 after
   it, so the eye sees 20px from one action's end to the next glyph whatever the
   counts are. Share is appended to the left group. */
.dsc-acts-left,
.dsc-acts-right {
  display: flex;
  align-items: center;
}
.dsc-acts-left {
  gap: var(--space-4);
}
.dsc-acts-right {
  gap: var(--space-2);
  margin-left: auto;
}
/* A glyph that is only a count's partner: the same 24px box a button has. */
.dsc-act-box {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
}
.dsc-act {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-2);
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
}
.dsc-act:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
/* Share opens a menu, so it answers a press by tinting and not moving (open),
   and keeps the tint while its menu is up. */
.dsc-act-share.is-open {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
/* Inert, and saying so. Nothing records a like or a repost, so both are drawn
   at the faint ink with no hover and no press — a control that looked live and
   did nothing would be the defect this spelling-out avoids. They are not in the
   press-dip registry for the same reason. */
.dsc-act[disabled] {
  color: var(--color-text-faint);
  cursor: default;
}
.dsc-act[disabled]:hover {
  background: none;
  color: var(--color-text-faint);
}
/* A count beside its glyph: the same type for like, comment and repost. An
   empty count takes no room. */
.dsc-act-count {
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
.dsc-act-count:empty {
  display: none;
}
/* ---------- Like, repost and follow ---------- F05 compact toggles, F04 compact -----
   Toggles answer with the state change and nothing else (rule 9), so none of
   these is in the press block. Liked is the heart filled in the accent, not red:
   red is danger. Reposted is the repeat glyph heavier, with a dot under it,
   because colour alone barely shows. */
.dsc-act-group {
  display: inline-flex;
  align-items: center;
}
.dsc-act-group .dsc-act-count.is-on {
  color: var(--color-accent);
}
.dsc-act--toggle {
  position: relative;
}
.dsc-act--toggle.is-on,
.dsc-act-count.is-on {
  color: var(--color-accent);
}
.dsc-act--like.is-on svg {
  fill: currentColor;
}
.dsc-act--repost.is-on svg {
  stroke-width: 2;
}
.dsc-act--repost.is-on::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--color-accent);
}
.sp-prf-head .prf-who {
  flex: 1;
}
.soc-follow {
  flex: none;
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-2);
  font-family: inherit;
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
}
.soc-follow-text {
  display: none;
}
.soc-follow-off {
  display: inline;
}
.soc-follow.is-on .soc-follow-off {
  display: none;
}
.soc-follow.is-on .soc-follow-on {
  display: inline;
}
/* A profile's Follow is the page's one accent; followed, it is white and reads
   "Unfollow" under the pointer. */
.soc-follow--profile {
  background: var(--btn-accent-bg);
  color: var(--btn-accent-text);
}
.soc-follow--profile.is-on {
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  border-color: var(--color-border-default);
}
.soc-follow--profile.is-on:hover .soc-follow-on {
  display: none;
}
.soc-follow--profile.is-on:hover .soc-follow-undo {
  display: inline;
}
/* A creation's Follow is white, because Install is that page's one accent;
   followed, it is "Following" in the accent's ink and outline, with no fill. */
.soc-follow--creation {
  width: 100%;
  margin-top: var(--space-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  border-color: var(--color-border-default);
}
.soc-follow--creation.is-on {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* Save is the tile's own control, which floats over a cover and appears on
   hover. In this row it is one glyph among several and there is nothing to
   hover, so the surface undoes the two things that were about the tile and
   leaves the rest of the family alone. */
.dsc-acts .dsc-post-save {
  position: static;
  opacity: 1;
  border-radius: var(--radius-2);
  background: none;
}
.dsc-acts .dsc-post-save:hover {
  background: var(--color-surface-hover);
}

/* The same control where it sits in the FLOW rather than over a cover — a
   profile's posts and the Saved Posts list. Permanently visible and labelled:
   on a tile it appears on hover because it overlaps the card, and in a row
   there is nothing to hover, so a control that stayed at zero opacity would be
   enabled and invisible, which is the same failure as a dead one. F04 button,
   compact secondary. */
.dsc-post-save--labelled {
  position: static;
  gap: var(--space-2);
  width: auto;
  height: 24px;
  padding: 0 var(--space-3);
  font-size: var(--fs-12);
  font-weight: 600;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  opacity: 1;
}
.dsc-post-save--labelled:hover {
  border-color: var(--color-accent);
}

/* ---------- One post's own page ----------
   The post whole, with the conversation under it. One column at the stream's
   own width: a thread reads down, and a reply set beside the post it answers
   was what this redesign took out of the stream. */
.dsc-postpage {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ---------- The conversation under a post ----------
   No heading over it: the count beside the comment glyph on the post already
   said how many there are, and a second statement of it pushed the first
   comment a third of a screen further down. */
.dsc-comments {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* The composer — F13 wrapper field. The wrapper owns the border, the radius
   and the focus ring; the textarea inside is transparent and borderless, which
   is what lets Cancel and Comment sit INSIDE the same outline rather than
   under it as a second row of chrome.

   It rests as a pill on the same hairline as every other field and grows into
   a box, so its resting state reads as a prompt and its open state as a place
   to write. */
.dsc-composer {
  display: flex;
  flex-direction: column;
  /* Centred at rest, top-aligned once it opens. A single line of prompt in a
     box taller than one line has to sit in the middle of it; a min-height on
     the FIELD would instead leave the slack under the text, which reads as a
     prompt that has slipped. */
  justify-content: center;
  min-height: 42px;
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  cursor: text;
  transition:
    background var(--dur-standard) var(--ease-out),
    border-color var(--dur-standard) var(--ease-out),
    border-radius var(--dur-standard) var(--ease-out);
}
/* Hover keeps the white ground and answers on the hairline and the prompt: the
   edge darkens a step, and the placeholder darkens to the default ink, because
   the thing that has to stay readable is the sentence, not the box. */
.dsc-composer:hover {
  border-color: var(--color-border-strong);
}
.dsc-composer:hover .dsc-composer-field::placeholder {
  color: var(--color-text-default);
}
/* An outline rather than a border swap or a shadow: only an outline survives
   forced-colors, where the other two leave a keyboard user with no indicator. */
.dsc-composer:focus-within {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.dsc-composer--open {
  justify-content: flex-start;
  border-radius: var(--radius-4);
  padding-bottom: var(--space-2);
}
.dsc-composer-field {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-13);
  line-height: 1.5;
  resize: none;
  overflow: hidden;
}
.dsc-composer-field:focus {
  outline: none;
}
.dsc-composer-field::placeholder {
  color: var(--color-text-faint);
}
.dsc-composer--open .dsc-composer-field {
  min-height: 52px;
}
/* Inside the field's own outline, at its foot. */
.dsc-composer-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
/* F04 buttons, compact: ghost to walk away, primary to commit. */
.dsc-composer-cancel,
.dsc-composer-send {
  padding: var(--space-1) var(--space-3);
  font: inherit;
  font-size: var(--fs-12);
  font-weight: 600;
  border-radius: var(--radius-2);
  cursor: pointer;
}
.dsc-composer-cancel {
  color: var(--color-text-muted);
  background: none;
  border: var(--border-thin) solid transparent;
}
.dsc-composer-cancel:hover {
  color: var(--color-text-default);
}
.dsc-composer-send {
  color: var(--btn-accent-text);
  background: var(--btn-accent-bg);
  border: var(--border-thin) solid transparent;
}

/* A larger break under the composer than between comments, so the conversation
   reads as a block rather than as one more entry in the list. */
.dsc-commentlist {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-5);
  min-width: 0;
}

/* One comment. No container: a comment is writing with a name on it, and a card
   around each one turns a conversation into a list of receipts. The left column
   is a rail — the person's mark, and under it the line down to whatever
   answered them. */
.dsc-comment,
.dsc-comment--collapsed {
  /* The three numbers the whole connector is derived from, so moving the mark
     moves every piece of line with it. The branch is how far LEFT of a reply
     the trunk runs; it is shorter than the gutter, which is what puts the trunk
     near the replies rather than under the parent's mark. */
  --comment-mark: 24px;
  --comment-elbow: 8px;
  /* The horizontal run, and BOTH horizontals are exactly it. The turn and the
     branch are the same gesture at two scales otherwise: derived separately,
     one came out 11px and the other 6px, which reads as a wonky bracket. One
     number fixes where the trunk sits — mark/2 + a tick right of the drop —
     and the branch is the same tick out the other side. */
  --comment-tick: 8px;
}
.dsc-comment {
  display: grid;
  grid-template-columns: var(--comment-mark) 1fr;
  column-gap: var(--space-2);
  align-items: stretch;
  min-width: 0;
}
.dsc-comment-rail {
  position: relative;
}
.dsc-comment-mark {
  width: var(--comment-mark);
  height: var(--comment-mark);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--color-text-invert);
}
.dsc-comment-main {
  min-width: 0;
}
.dsc-comment-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  min-height: var(--comment-mark);
}
/* Qualified by the byline family it is a member of, and that is not cosmetic:
   `.prf-byline` sets `font: inherit` and `color: inherit` and is declared later
   in this file, so at equal specificity it wins and the name renders as plain
   body ink. A byline that is green here and default elsewhere has to say so
   louder than the family it belongs to. */
.prf-byline.dsc-comment-author {
  padding: 0;
  border: 0;
  background: none;
  font-size: var(--fs-12);
  font-weight: 700;
  color: var(--color-accent);
  cursor: pointer;
}
.prf-byline.dsc-comment-author:hover {
  color: var(--color-accent-strong);
}
.dsc-comment-time {
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
.dsc-comment-body {
  margin-top: 2px;
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--color-text-default);
}
/* A web address in a post's words, a reply, a comment or a profile's description:
   the text's own size and weight, always underlined. */
.post-link {
  color: var(--color-accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
/* The handle an answer opens on, where the cap flattened it onto its parent and
   the indent stopped saying who is being answered. */
.dsc-comment-at {
  font-weight: 600;
  color: var(--color-accent);
}

/* Replies need no indent of their own: they sit in the parent's content column,
   which already begins --comment-branch to the right of the trunk. */
.dsc-replylist {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-3);
  min-width: 0;
}

/* ---- the connector ----
   Four straight pieces: a drop from under the mark, a 90° turn toward the
   replies, the trunk, and a branch to each reply.

   Every piece is a 1px BOX on a whole pixel. A border on an element centred in
   the rail lands on a half pixel and renders wider and softer than a box beside
   it, so the drop and the trunk came out visibly different weights while both
   were nominally --border-thin. One technique, one weight.

   Nothing touches a mark at either end — the drop starts below one and the
   branch stops short of one — so the line approaches a person without running
   into them. */
.dsc-comment[data-answered='true'] > .dsc-comment-main {
  position: relative;
}
.dsc-comment[data-answered='true'] > .dsc-comment-rail::after {
  content: '';
  position: absolute;
  left: calc(var(--comment-mark) / 2 - 1px);
  top: calc(var(--comment-mark) + var(--space-1));
  width: var(--border-thin);
  height: var(--comment-elbow);
  background: var(--color-accent);
}
.dsc-comment[data-answered='true'] > .dsc-comment-main::before {
  content: '';
  position: absolute;
  left: calc(var(--comment-mark) / 2 - var(--comment-mark) - var(--space-2));
  top: calc(var(--comment-mark) + var(--space-1) + var(--comment-elbow));
  width: var(--comment-tick);
  height: var(--border-thin);
  background: var(--color-accent);
}
.dsc-comment[data-answered='true'] > .dsc-comment-main::after {
  content: '';
  position: absolute;
  left: calc(
    var(--comment-mark) / 2 - var(--comment-mark) - var(--space-2) + var(--comment-tick) -
      var(--border-thin)
  );
  top: calc(var(--comment-mark) + var(--space-1) + var(--comment-elbow));
  bottom: 0;
  width: var(--border-thin);
  background: var(--color-accent);
}
.dsc-replylist > .dsc-comment {
  position: relative;
}
.dsc-replylist > .dsc-comment::before {
  content: '';
  position: absolute;
  left: calc(var(--comment-mark) / 2 - var(--comment-mark) - var(--space-2) + var(--comment-tick));
  top: calc(var(--comment-mark) / 2);
  width: var(--comment-tick);
  height: var(--border-thin);
  background: var(--color-accent);
}

/* A muted person's comment, in its place and closed, standing for its whole
   branch. Indented into the text column so it sits among the comments rather
   than beside them. F17 inline notice: a statement ABOUT the list. */
.dsc-comment--collapsed {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-left: calc(var(--comment-mark) + var(--space-2));
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.dsc-comment-collapsed-copy {
  flex: 1 1 auto;
}
.dsc-comment-show {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.dsc-comment-show:hover {
  color: var(--color-accent-strong);
}

/* The head of the stream: what topic is being read, and the way out of it into
   the whole of that topic. The control is the topic chip's own recipe, because it
   is a topic chip — the one that happens to be a way in rather than a filter. */
.dsc-morehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.dsc-more-title {
  margin: 0;
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--color-text-default);
}
.dsc-more-all {
  flex: 0 0 auto;
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface-substrate);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color var(--dur-quick),
    color var(--dur-quick);
}
.dsc-more-all:hover {
  border-color: var(--color-accent);
  color: var(--color-text-default);
}

/* The pane footer: the current workspace's name, doubling as the workspace
   picker. Pinned to the pane's bottom edge the way the head-stack pins to its
   top — negative margins pull it over the pane's own padding, and the ground
   is inherited so the light theme's panel tint carries through. */
.tree-foot {
  position: sticky;
  bottom: calc(-1 * var(--space-3));
  z-index: 5;
  margin: var(--space-3) calc(-1 * var(--space-3)) calc(-1 * var(--space-3));
  margin-top: auto;
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: inherit;
  border: none;
  border-top: var(--border-thin) solid var(--color-border-default);
  color: var(--color-text-default);
  font-size: var(--fs-12);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  flex: none;
}
.tree-foot:hover {
  background: var(--color-surface-hover);
}
.tree-foot-icon {
  display: flex;
  color: var(--color-accent);
  flex: none;
}
.tree-foot-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-foot-chev {
  display: flex;
  color: var(--color-text-faint);
  flex: none;
}
/* The workspace's enrichment run rides the picker: it is the only row in the
   pane that is about the workspace rather than about a file in it. Its own click
   opens the run and stops there; the rest of the row still switches workspace. */
.tree-foot .tree-enrich {
  flex: none;
}

/* Activity's toolbar is one row: the filter glyph, the applied filter's chip,
   and at the right end the count and the bulk actions. */
.notif-actionbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.notif-actionbar-end {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}
.feed-count {
  margin-right: var(--space-1);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
/* F04 secondary, and F04 danger for Clear all: white, a hairline, the row's
   own padding. Empty cleared is the danger one in the Cleared view. */
.notif-actionbar-end .feed-mark-read,
.notif-actionbar-end .feed-clear-all,
.notif-actionbar-end .feed-empty-cleared {
  padding: var(--row-pad) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font-size: var(--fs-13);
  line-height: 1.2;
}
.notif-actionbar-end .feed-mark-read:hover:not(:disabled) {
  border-color: var(--color-border-strong);
}
.notif-actionbar-end .feed-clear-all,
.notif-actionbar-end .feed-empty-cleared {
  color: var(--color-danger);
}
.notif-actionbar-end .feed-clear-all:hover:not(:disabled),
.notif-actionbar-end .feed-empty-cleared:hover:not(:disabled) {
  border-color: var(--color-danger);
  color: var(--color-danger);
}
/* F04 button, compact + secondary — the notification row-level actions. */
.notif-action {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-substrate);
  color: var(--color-text-default);
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
}
.notif-action:hover {
  border-color: var(--color-accent);
}
/* Clear all files EVERYTHING, read or not — the one action here worth a
   danger register. F04 danger: transparent fill, danger ink, neutral hairline. */
.notif-action--danger {
  background: transparent;
  color: var(--color-danger);
}
.notif-action--danger:hover {
  border-color: var(--color-danger);
}
.notif-filter-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.notif-filter-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
/* The activity-feed link: a quiet text control whose hover slides the arrow
   forward and sweeps an accent underline in under the label, left to right on
   entry and back out the way it came on exit. */
.notif-feed-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-1);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
}
.notif-feed-link:hover {
  color: var(--color-text-default);
}
.notif-feed-link-label {
  position: relative;
  padding-bottom: 2px;
}
.notif-feed-link-label::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform var(--dur-standard) var(--ease-out);
}
.notif-feed-link:hover .notif-feed-link-label::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}
.notif-feed-link-arrow {
  display: flex;
  transform: translateX(-3px);
  transition: transform var(--dur-standard) var(--ease-out);
}
.notif-feed-link:hover .notif-feed-link-arrow {
  transform: translateX(0);
}
.notif-feed-link:active .notif-feed-link-arrow {
  transform: translateX(0) scale(0.9);
}
/* The shared filter menu (Notifications + Activity): an F12 overlay of
   checkbox or check-marked rows that stays open across toggles, with one
   flyout level for the workspace picker. */
.fmenu {
  position: fixed;
  z-index: 260;
  min-width: 180px;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-3);
  padding: var(--space-1);
  overflow-y: auto;
}
.fmenu-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--row-pad) var(--space-2);
  border: none;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-13);
  text-align: left;
  cursor: pointer;
}
.fmenu-row:hover {
  background: var(--color-surface-hover);
}
/* A row with a control at its right end (the model menu's Anthropic row and
   its Key | Subscription toggle): the row button and the control are siblings
   in one wrapper, since a control cannot sit inside a button. The wrapper
   carries the hover ground so it spans both. The control overhangs the row's
   padding by 2px top and bottom, which keeps the row the menu's one height. */
.fmenu-rowwrap {
  display: flex;
  align-items: center;
  border-radius: var(--radius-2);
}
.fmenu-rowwrap:hover {
  background: var(--color-surface-hover);
}
.fmenu-rowwrap > .fmenu-row {
  flex: 1;
  width: auto;
  min-width: 0;
}
.fmenu-billing {
  flex: none;
  margin-inline: var(--space-2);
  margin-block: -2px;
}
/* A row that removes something: Delete agent, Uninstall. */
.fmenu-row.is-danger {
  color: var(--color-danger);
}
.fmenu-row.is-danger:hover {
  background: var(--color-danger-soft);
}
/* A row that cannot be pressed yet: faded, and no hover ground. */
.fmenu-row:disabled,
.fmenu-row:disabled:hover {
  opacity: 0.5;
  background: transparent;
  cursor: default;
}
.fmenu-sep {
  height: 1px;
  background: var(--color-border-default);
  margin: var(--space-1) 0;
}
/* F14 checkbox, in menu-row scale. */
.fmenu-box {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-1);
  flex: none;
}
.fmenu-box.is-checked {
  background: var(--btn-accent-bg);
  border-color: var(--btn-accent-bg);
  color: var(--btn-accent-text);
}
.fmenu-box .icon,
.fmenu-slot .icon,
.fmenu-caret {
  display: flex;
}
/* Holds the checkbox column open on rows that carry a plain check or nothing,
   so every label starts at the same x. */
.fmenu-slot {
  display: grid;
  place-items: center;
  width: 16px;
  flex: none;
  color: var(--color-accent);
}
/* A row's own glyph (Share's) in the slot, muted like the Share menu's rows. */
.fmenu-slot--glyph {
  color: var(--color-text-muted);
}
.fmenu-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fmenu-count,
.fmenu-hint {
  color: var(--color-text-faint);
  font-size: var(--fs-12);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.fmenu-caret {
  color: var(--color-text-faint);
  flex: none;
}
/* An accordion group in a menu (the model menu's providers): its name at 600,
   its chevron in the slot column turning down while it is open. It flips
   what the menu shows, so it answers with nothing on press. */
.fmenu-row--accordion .fmenu-label {
  font-weight: 600;
}
.fmenu-acc {
  color: var(--color-text-muted);
}
.fmenu-acc .icon {
  transition: rotate var(--dur-quick) var(--ease-out);
}
.fmenu-row--accordion.is-open .fmenu-acc .icon {
  rotate: 90deg;
}
/* A row under an open group: the check stays in the slot column, the label
   starts past it. */
.fmenu-row--indent .fmenu-label {
  padding-left: calc(16px + var(--space-2));
}
/* A group's small label inside the menu — the provider over its models in the
   agent model menu. Not a row: it takes no press and no hover. */
.fmenu-head {
  padding: var(--space-2) var(--space-2) var(--space-1);
  color: var(--color-text-faint);
  font-size: var(--fs-11);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The applied filter as a green chip (F06) sized to its text; its × clears
   it, and there is one at a time. Accent-strong ink: the base accent misses
   4.5:1 on its own soft fill at this size. */
.notif-filter-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}
.notif-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  width: auto;
  padding: 2px var(--space-1) 2px var(--space-2);
  border-radius: var(--radius-pill);
  border: var(--border-thin) solid var(--color-accent-soft-2);
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font-size: var(--fs-11);
  font-weight: 600;
  line-height: 16px;
  cursor: pointer;
}
.notif-filter-pill > span {
  flex: none;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-filter-pill:hover {
  border-color: var(--color-accent);
}
.notif-filter-pill-x {
  display: flex;
  flex: none;
}
.notif-drawer {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
/* F10 card — a bordered record with a 3px semantic left edge carrying its
   severity, used by the notification drawer. */
.notif-item {
  position: relative;
  display: flex;
  gap: var(--space-3);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-left-width: 3px;
  border-left-color: var(--color-border-default);
  border-radius: var(--radius-2);
  padding: var(--space-3) var(--space-4);
}
.notif-item--orange {
  border-left-color: var(--color-warn-dot);
}
.notif-item--red {
  border-left-color: var(--color-danger);
}
.notif-item--running {
  border-left-color: var(--color-accent);
}
.notif-item.is-unread {
  background: var(--color-surface-readable);
}
.notif-item-icon {
  color: var(--color-text-muted);
  margin-top: 2px;
}
.notif-item-body {
  flex: 1;
  min-width: 0;
}
.notif-item-titlerow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}
.notif-item-title {
  font-weight: 600;
  font-size: var(--fs-13);
  color: var(--color-text-default);
}
.notif-item-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-faint);
  white-space: nowrap;
}
.notif-item-preview {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  margin-top: 2px;
}
.notif-item-meta {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.notif-item-proj {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-accent-strong);
  background: var(--color-accent-soft);
  border-radius: var(--radius-1);
  padding: 1px 6px;
}
.notif-item-status {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-faint);
  background: var(--color-surface-substrate-2);
  border-radius: var(--radius-1);
  padding: 1px 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
/* Status dot inside the chip — same palette as the row's severity border. */
.notif-item-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-faint);
  flex: none;
}
.notif-item-status[data-status='completed'] .notif-item-status-dot {
  background: var(--color-success);
}
.notif-item-status[data-status='running'] .notif-item-status-dot {
  background: var(--color-accent);
}
.notif-item-status[data-status='pending'] .notif-item-status-dot,
.notif-item-status[data-status='rejected'] .notif-item-status-dot {
  background: var(--color-warn-dot);
}
.notif-item-status[data-status='failed'] .notif-item-status-dot {
  background: var(--color-danger);
}
/* Issue #627: coalesced-fire count chip ("×5") next to a notification title. */
.notif-item-count {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  flex: none;
}
.notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  align-self: center;
  flex: none;
}
.notif-empty {
  color: var(--color-text-faint);
  font-size: var(--fs-13);
  padding: var(--space-6);
  text-align: center;
}
/* Issue #687: activity-feed first-run empty state — the same register as the
   other empty states' (icon, heading, two warm explanatory lines). Its box, padding
   and all, is the shared centered empty state in the component canon. It does
   not stretch: the feed scrolls, so an empty state that filled the viewport
   would just be a tall blank, and that is a fact about the feed rather than
   about the component. */
.feed-empty-icon {
  color: var(--color-accent);
  opacity: 0.5;
}
.feed-empty-title {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-muted);
}
.feed-empty-copy {
  max-width: 44ch;
  margin: 0;
  color: var(--color-text-faint);
  line-height: 1.5;
}
/* Per-row dismiss on a notification, revealed on hover like the feed's. */
.notif-item-dismiss {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  color: var(--color-text-faint);
  background: transparent;
  border: none;
  border-radius: var(--radius-1);
  padding: 2px 4px;
  cursor: pointer;
  opacity: 0;
}
.notif-item:hover .notif-item-dismiss,
.notif-item-dismiss:focus-visible {
  opacity: 1;
}

/* A filed notification (archived or dismissed) surfaced by "Show filed" —
   dimmed the way a cleared activity row is, with its way back always visible
   rather than hover-revealed, since restoring it is the only reason the row is
   on screen at all. */
.notif-item[data-readstate='archived'],
.notif-item[data-readstate='dismissed'] {
  opacity: 0.55;
}
.notif-item-restore {
  font-size: var(--fs-12);
  opacity: 1;
}

/* Activity clear controls — clearing hides a row, it never deletes one. */
.feed-clearbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.feed-clear-all,
.feed-mark-read,
.feed-show-cleared,
.feed-empty-cleared {
  font: inherit;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: 3px 10px;
  cursor: pointer;
}
.feed-clear-all:hover:not(:disabled),
.feed-mark-read:hover:not(:disabled),
.feed-show-cleared:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text-default);
}
.feed-clear-all:disabled,
.feed-mark-read:disabled {
  opacity: 0.45;
  cursor: default;
}
.feed-show-cleared.is-active {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
/* The same chip carrying system state rather than a view filter. Declared here,
   beside the accent rule it replaces, because the two are alternatives and
   reading one without the other invites using `is-active` for both: accent is
   the app's affirmative "on, and good", so a paused chip wearing it announces
   one state in two contradictory colours. */
.feed-show-cleared--warn {
  border-color: var(--color-warn-soft-2);
  color: var(--color-warn);
}
.feed-show-cleared--warn:hover {
  border-color: var(--color-warn);
  color: var(--color-warn);
}
/* The button family's danger emphasis, at the chip's size: the one Activity
   control that deletes, so it wears the danger ink and edge while it rests,
   not only on hover. It opens a confirm rather than acting, which is why it
   tints (open) and does not dip. */
.feed-empty-cleared {
  color: var(--color-danger);
  border-color: color-mix(in srgb, var(--color-danger) 55%, transparent);
}
.feed-empty-cleared:hover:not(:disabled) {
  border-color: var(--color-danger);
}
.feed-empty-cleared:disabled {
  opacity: 0.45;
  cursor: default;
}
.feed-cleared-note {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  margin-right: auto;
}
.feed-item-clear {
  font: inherit;
  font-size: var(--fs-12);
  display: inline-flex;
  align-items: center;
  color: var(--color-text-faint);
  background: transparent;
  border: none;
  border-radius: var(--radius-1);
  padding: 2px 6px;
  cursor: pointer;
  /* Revealed on hover so the feed reads as a log, not a row of buttons —
     the same restraint the tree-row actions use. */
  opacity: 0;
}
.feed-item:hover .feed-item-clear,
.feed-item-clear:focus-visible {
  opacity: 1;
}
.feed-item.is-cleared {
  opacity: 0.55;
}
.feed-item.is-cleared .feed-item-clear {
  opacity: 1;
}

/* Day sections. The feed is a log, so the day headers are quiet dividers that
   let the reader skim by date — not cards competing with the rows inside them. */
.feed-day {
  margin-bottom: var(--space-3);
}
.feed-day-head {
  font: inherit;
  font-size: var(--fs-12);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  padding: var(--space-2) 0;
  cursor: pointer;
  text-align: left;
}
.feed-day-head:hover {
  color: var(--color-text-default);
}
.feed-day-chevron {
  color: var(--color-text-faint);
  flex: none;
}
.feed-day-label {
  font-weight: 500;
}
.feed-day-count {
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  margin-left: auto;
}
/* One card per day: square, a hairline, white, the first shadow, the rows
   flush inside it and parted by hairlines. Scoped to the day's own rows — the
   shared row rule also draws the Social view. */
.feed-day-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: 0;
  background: var(--color-surface-readable);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
/* A row is one line: kind glyph, name, the time, the unread dot in a slot kept
   on a read row too, the chevron. Severity stays as its coloured left edge. */
.feed-day-rows > .feed-item {
  align-items: center;
  margin: 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  box-shadow: none;
  padding-top: var(--row-pad);
  padding-bottom: var(--row-pad);
}
.feed-day-rows > .feed-item + .feed-item {
  border-top: var(--border-thin) solid var(--color-border-default);
}
/* A closed row is 32px, the first one too (the rows after it count their top
   hairline inside the 32); an opened row and a burst grow with their detail. */
.feed-day-rows > .feed-item:not(.is-expanded) {
  box-sizing: border-box;
  height: 32px;
  min-height: 0;
}
.feed-day-rows > .feed-item .notif-item-icon {
  margin-top: 0;
}
.feed-day-rows > .feed-item .notif-item-titlerow {
  align-items: center;
}
.feed-day-rows > .feed-item .notif-item-title {
  font-weight: 400;
}
.feed-day-rows > .feed-item:not(.is-unread) .notif-item-title {
  color: var(--color-text-muted);
}
.feed-day-rows > .feed-item:not(.is-expanded) .notif-item-preview,
.feed-day-rows > .feed-item:not(.is-expanded) .notif-item-meta {
  display: none;
}
.notif-unread-dot.is-empty {
  visibility: hidden;
}
/* Expanded in place: the glyph, ×, dot and chevron stay on the name's line;
   under the name come the path, the tags, the facts and the actions. */
.feed-day-rows > .feed-item.is-expanded {
  align-items: flex-start;
}
.feed-day-rows > .feed-item.is-expanded > .notif-item-icon,
.feed-day-rows > .feed-item.is-expanded > .feed-item-clear,
.feed-day-rows > .feed-item.is-expanded > .notif-unread-dot,
.feed-day-rows > .feed-item.is-expanded > .feed-item-chevron {
  align-self: flex-start;
  margin-top: 4px;
}
.feed-day-rows > .feed-item.is-expanded .notif-item-preview {
  margin-top: var(--space-1);
}
/* Its tags are all white with a hairline and muted ink; only the status dot
   keeps its colour. */
.feed-day-rows > .feed-item .notif-item-proj,
.feed-day-rows > .feed-item .notif-item-status,
.feed-day-rows > .feed-item .notif-item-member {
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-readable);
  color: var(--color-text-muted);
}
/* The bell's popover: an F12 surface holding Activity's own rows, unread only.
   The popover is the card, so the day card's own edge and shadow go; the rows
   keep their severity edge, glyph, name, time and dot. */
.fmenu.notif-pop {
  padding: 0;
  width: 380px;
  overflow: hidden;
}
.notif-pop-head {
  box-sizing: border-box;
  height: 41px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.notif-pop-title {
  flex: 1;
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
.notif-pop-count {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
/* F04 ghost, compact: no fill and no edge until it is pointed at. */
.notif-pop-markread {
  font: inherit;
  font-size: var(--fs-12);
  line-height: 14px;
  padding: var(--space-1) var(--space-3);
  color: var(--color-text-muted);
  background: transparent;
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-2);
  cursor: pointer;
}
.notif-pop-markread:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.notif-pop .feed-day-rows {
  border: 0;
  box-shadow: none;
  height: 224px;
  max-height: none;
  overflow-y: auto;
}
/* Each row is a button: it reads as the page's row, not as a native button. */
.notif-pop .feed-day-rows > .feed-item {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.notif-pop .feed-day-rows > .feed-item:hover {
  background: var(--color-surface-hover);
}
.notif-pop .feed-day-rows > .feed-item:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}
/* One line a row, as on the page: a long name ends in an ellipsis. */
.notif-pop .notif-item-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-pop .notif-item-titlerow {
  min-width: 0;
}
.notif-pop-foot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 36px;
  padding: 0 var(--space-3);
  box-sizing: border-box;
  border: 0;
  border-top: var(--border-thin) solid var(--color-border-default);
  background: transparent;
  font: inherit;
  font-size: var(--fs-13);
  color: var(--color-text-default);
  text-align: left;
  cursor: pointer;
}
.notif-pop-foot:hover {
  background: var(--color-surface-hover);
}
.notif-pop-foot:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}
.notif-pop-foot > span {
  flex: 1;
}
.notif-pop-foot > svg {
  color: var(--color-text-muted);
}
.notif-pop-empty {
  box-sizing: border-box;
  height: 224px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-3);
  text-align: center;
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
/* Activity's own tabs under the head (F12 popover, the tab strip family): inset
   to the popover's padding, with a hairline under them. A tab's count is a real
   element, laid over room the tab always keeps for it, so a count arriving or
   clearing never changes the tab's width. */
.notif-pop-tabs {
  padding: 0 var(--space-4);
  border-bottom: var(--border-thin) solid var(--color-border-default);
  gap: var(--space-5);
}
.notif-pop-tabs .lib-tab--counted {
  padding-right: calc(3ch + var(--space-1));
}
.notif-pop-tabs .lib-tab-count {
  position: absolute;
  inset-block: 0;
  right: 0;
  display: flex;
  align-items: center;
  min-width: 3ch;
  font-size: var(--fs-12);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}
/* The way into a day the collapse rule truncated. Sized like the load-more
   below it, because they answer the same question in two scopes. */
.feed-day-more,
.feed-load-more {
  font: inherit;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: var(--space-1) var(--space-3);
  cursor: pointer;
}
.feed-day-more:hover,
.feed-load-more:hover:not(:disabled) {
  border-color: var(--color-border-strong);
  color: var(--color-text-default);
}
.feed-load-more:disabled {
  opacity: 0.45;
  cursor: default;
}
/* The end of the feed says which end it is: more history to fetch, or none
   left. A list that simply stopped read as a workspace whose history stopped. */
.feed-tail {
  display: flex;
  justify-content: center;
  padding: var(--space-3) 0;
}
.feed-tail-note {
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
/* Two tail notes are two separate claims — the run-card history and the live
   file-event bound. Stacked so they never read as one sentence. */
.feed-tail--stacked {
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.notif-item-member {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-faint);
  background: var(--color-surface-substrate-2);
  border-radius: var(--radius-1);
  padding: 1px 6px;
}
.notif-item-cost {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-accent-strong);
}
.notif-item.is-selected {
  border-color: var(--color-accent);
  border-left-color: var(--color-accent);
  background: var(--color-accent-soft);
}

/* Library — a card grid under a strip of kind tabs, sibling to the marketplace
   bundle grid it borrows its card anatomy from. */
/* F18 toolbar: the kind strip on the left, the filter field and the shelf on
   the right, on one line so the three read as one header. */
.lib-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: calc(var(--space-4) + var(--border-thin));
}
/* The kind strip runs the toolbar's full height, so the line under the current
   kind lands on the toolbar's bottom edge; the controls carry the space
   between the row and the edge instead. The toolbar has no rule of its own at
   rest, and the space the old rule took stays, so the list does not move. */
.lib-toolbar > .lib-kind-tabs {
  align-self: stretch;
}
.lib-toolbar > .lib-kind-tabs > .lib-tab {
  align-self: stretch;
}
/* 2px, not more: the toolbar is the tabs' own height, as Discover's lane bar
   is, so the two pages' tab bars measure the same. */
.lib-toolbar > .lib-toolbar-controls {
  padding-block: 2px;
}
/* The kind strip. Text, not pills: the collection cards below it are where a
   reader is going next, and two pill rows stacked would compete for that. */
.lib-tabs {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  min-width: 0;
}
.lib-tab {
  /* The colour of the line under the current tab: green where a person's own
     material lives, the agent blue where the machine's does. A strip whose
     tabs hold the machine's things sets it per tab below. */
  --tab-ink: var(--color-accent);
  position: relative;
  border: none;
  background: transparent;
  padding: var(--row-pad) 0;
  font-size: var(--fs-14);
  font-weight: 400;
  color: var(--color-text-muted);
  /* A tab is a thing you click, and the pointer says so. The grab hand it used
     to carry advertised the secondary gesture over the primary one, and every
     surface reusing this family inherited the promise whether or not its tabs
     could actually be dragged. */
  cursor: pointer;
  transition: color var(--dur-quick);
}
.lib-tab:hover {
  color: var(--color-text-default);
}
.lib-tab.is-current {
  font-weight: 600;
  color: var(--color-text-default);
  box-shadow: inset 0 calc(-1 * var(--border-emphasis)) 0 var(--tab-ink);
}
/* A hidden semibold copy of the label, under the visible one. It has no
   height, so it changes nothing but the tab's width, which it holds at the
   semibold label's: choosing a tab then never widens it, and no tab after it
   on the strip moves. `data-label` carries the label alone, never a count
   drawn beside it. */
.lib-tab::after {
  content: attr(data-label);
  display: block;
  height: 0;
  visibility: hidden;
  overflow: hidden;
  font-weight: 600;
  pointer-events: none;
  user-select: none;
}
/* The Library holds installed items, all of them the machine's. */
.lib-kind-tabs .lib-tab,
.prf-tabs .lib-tab[data-tab='published'] {
  --tab-ink: var(--color-agent);
}
.lib-tab:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-1);
}
.lib-tab.is-dragging {
  opacity: 0.4;
}
/* Where the dragged tab will land: a line in the gap it is going into, on
   whichever side of a tab the pointer is over.

   The outline this replaces marked the tab UNDERNEATH the pointer, which is a
   different claim — it names a tab rather than a position, so it cannot say
   which side of that tab the drop lands on, and reads as "swap with this one".
   A drop marker on the file tree's folder rows is the right shape there, where
   the target really is the row; between tabs the target is the gap. */
.lib-tab.is-drop-before::before,
.lib-tab.is-drop-after::before {
  content: '';
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: var(--border-emphasis);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
}
/* Centred in the gap rather than against the tab, so the line reads as being
   between two tabs instead of belonging to one of them. Both sides draw on
   `::before`, since `::after` holds the tab's width. */
.lib-tab.is-drop-before::before {
  left: calc(var(--space-4) / -2);
}
.lib-tab.is-drop-after::before {
  right: calc(var(--space-4) / -2);
}
/* Below the toolbar: what this list holds, and how it is ordered. */
.lib-listbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
/* The count follows the chips; the fitting code sets its left margin so it
   sits on the bar's centre until the chips reach it. */
.lib-listbar-count {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  flex: 0 0 auto;
  white-space: nowrap;
}
/* The right end: a tab's own action, then the sort. An F18 toolbar group. The
   collection chips and the count come first, and the bar's own gap is the least
   they leave before it. */
.lib-listbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  flex-shrink: 0;
}
/* F04 secondary, compact — the same recipe as the shelf button beside it. */
.lib-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-12);
  cursor: pointer;
}
.lib-sort-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}
.lib-sort-btn:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
/* F06 chips, single-select — the saved shelf's kinds. Pills rather than tabs
   because a saved collection holds every kind at once, so there is no per-kind
   arrangement for a tab strip to promise. */
.lib-pills {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.lib-pill {
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  cursor: pointer;
}
.lib-pill:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.lib-pill.is-on {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}
.lib-pill:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
/* A tab's collections as one line of F06 toggle chips, at the left of the bar.
   The chip that is on is a filter, so it wears `.lib-pill.is-on`. The row takes
   its chips' width and shrinks only when the bar runs out of room, where the
   fitting code hides what no longer fits; the padding and the equal negative
   margin leave room for a focus ring the clip would otherwise cut off. */
.lib-coll-chips {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  padding: 2px;
  margin: -2px;
}
.lib-coll-chip,
.lib-coll-more,
.lib-coll-add {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
  white-space: nowrap;
}
/* The collection chips are a size up from the shelf's filter pills, which share
   `.lib-pill`: 32px tall (the padding and a 14px line inside the hairline), in
   the default ink at rest so a tab's collections read as places, not filters
   in passing. The add button is the same 32px with its glyph and label. The
   on state is the pill's own. */
.lib-pill.lib-coll-chip,
.lib-pill.lib-coll-more {
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-13);
  line-height: 14px;
}
.lib-pill.lib-coll-chip:not(.is-on),
.lib-pill.lib-coll-more {
  color: var(--color-text-default);
}
.lib-pill.lib-coll-add {
  justify-content: center;
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-13);
  line-height: 14px;
  border-color: transparent;
}
/* New collection is a ghost in a pill row: bare at rest, the hairline and the
   hover surface on hover. It keeps the row's pill radius rather than F04
   ghost's `--radius-2`, so the hover shape matches the chips around it. */
.lib-pill.lib-coll-add:hover,
.lib-pill.lib-coll-add:focus-visible {
  border-color: var(--color-border-default);
}
/* The fitting code cuts the next chip short when its name is worth 40px or more:
   the name ends in an ellipsis and the chip gives way to the room it was set. */
.lib-coll-chip.is-cut {
  flex-shrink: 1;
  min-width: 0;
}
.lib-coll-chip.is-cut .lib-coll-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
/* The compact form, for a row whose chips do not all fit: New collection is the
   bare 32px circle again (its title and aria-label name it). */
.lib-coll-chips.is-compact .lib-pill.lib-coll-add {
  width: 32px;
  height: 32px;
  padding: 0;
}
.lib-coll-chips.is-compact .lib-coll-add-label {
  display: none;
}
.lib-coll-chip svg,
.lib-coll-add svg {
  width: 14px;
  height: 14px;
}
.lib-coll-chip-n {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}
.lib-coll-chip.is-on .lib-coll-chip-n {
  color: inherit;
  opacity: 0.75;
}
/* What the chip that is on is: its description, a dot, and the way to edit it,
   pulled up under the count, which carries the bar's own margin. */
.lib-coll-caption {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: calc(-1 * var(--space-2)) 0 var(--space-4);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
/* The dialog that makes one. F11 dialog at the configuring width, since it
   asks three questions rather than one. */
.lib-coll-dialog {
  max-width: 520px;
}
.lib-coll-field-label {
  display: block;
  font-size: var(--fs-11);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-1);
}
/* F13 bare input. */
.lib-coll-field {
  width: 100%;
  padding: var(--row-pad) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font-size: var(--fs-13);
  font-family: inherit;
  line-height: 1.2;
  margin-bottom: var(--space-3);
}
.lib-coll-field:focus-visible {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.lib-coll-icons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}
/* F05 icon button, in a picker. */
.lib-coll-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.lib-coll-pick:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.lib-coll-pick.is-chosen {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}
.lib-coll-pick:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
/* What the view-model refused, shown where the reader still is. */
.lib-coll-problem {
  font-size: var(--fs-12);
  color: var(--color-danger);
  margin-bottom: var(--space-2);
}
/* The install sheet's destination step: where this item will land once it is
   installed. One line, between what it is asking for and the button that
   grants it, because that is where a reader has already decided. */
.mp-consent-dest {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}
.mp-consent-dest-label {
  font-size: var(--fs-11);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
}
/* F04 secondary, compact — the same recipe as the Library's own sort button. */
.mp-consent-dest-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-12);
  cursor: pointer;
}
.mp-consent-dest-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}
.mp-consent-dest-btn:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
/* The right half of the toolbar: the filter field and the way to the saved
   shelf, which are both about narrowing what the list shows. */
.lib-toolbar-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
/* F04 secondary, compact — the one control that leaves this list for the other
   one, so it reads as an action rather than as a filter value. */
.lib-saved-btn,
.agentpg-starter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-12);
  cursor: pointer;
}
.lib-saved-btn:hover,
.agentpg-starter:not(:disabled):hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}
.lib-saved-btn:focus-visible,
.agentpg-starter:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
.skills-filter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
}
.skills-filter:focus-within {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.skills-filter-icon {
  flex: none;
  color: var(--color-text-faint);
}
.skills-filter-input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-13);
  font-family: inherit;
  width: 15rem;
  max-width: 100%;
}
.lib-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}
.lib-card {
  position: relative;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  padding: var(--space-4);
  box-shadow: var(--shadow-1);
  transition:
    border-color var(--dur-quick),
    box-shadow var(--dur-quick),
    transform var(--dur-quick);
}
.lib-card:hover,
.lib-card:has(.lib-card-open:focus-visible) {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
/* Keyboard focus keeps the lift and the accent edge above, and adds the ring on
   top. The card draws it rather than the button, because the button covers the
   whole card via a stretched ::after and suppresses its own outline.

   Without this the card had no focus indication a high-contrast user could see:
   measured under forced-colors: active, the accent border is forced to the same
   system colour in both states, which leaves the 1px lift as the entire cue. */
.lib-card:has(.lib-card-open:focus-visible) {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
.lib-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
/* The card's primary action. A stretched ::after makes the whole card its hit
   area without wrapping the card in a second interactive element, so the edit
   button beside it stays a sibling control rather than a nested one. */
.lib-card-open {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.lib-card-open::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.lib-card-open:focus-visible {
  outline: none;
}
.lib-card-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--fs-13);
  color: var(--color-text-default);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lib-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
}
/* Every glyph control on a card's action row shares one treatment: the ⋯ that
   opens the item's menu (`.lib-card-menu`), the heart and the collection picker
   that act on the arrangement, and the Save an uninstalled row carries instead.
   They are named separately because they are separate jobs, so a test or a
   stylesheet reaching for one gets that one. This list is the shared
   implementation: a 13px glyph in a 2px pad, not the 24px compact icon button. */
.lib-card-act {
  /* Above the stretched card hit area, so it is reachable rather than covered. */
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  border: none;
  background: transparent;
  color: var(--color-text-faint);
  padding: 2px;
  border-radius: var(--radius-1);
  cursor: pointer;
  transition:
    opacity var(--dur-quick),
    color var(--dur-quick);
}
/* Recede until the card is hovered or focused — but only where hovering is
   possible. On a touch screen there is no hover, so a hidden control would be
   unreachable; there it simply stays visible. */
@media (hover: hover) {
  .lib-card-act {
    opacity: 0;
  }
  .lib-card:hover .lib-card-act,
  .lib-card:focus-within .lib-card-act {
    opacity: 1;
  }
}
.lib-card-act:hover,
.lib-card-act:focus-visible {
  opacity: 1;
  color: var(--color-accent-strong);
  background: var(--color-surface-substrate-2);
}
/* A card's ⋯ stays shown while its menu is open, whether it opened from the ⋯,
   a right-click or the keyboard, so the menu has the control it hangs from. It
   is the hover ground held, and (0,2,0) beats the media block's hidden rest. */
.lib-card-act.is-open {
  opacity: 1;
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
/* A collection membership is a STATE, not a housekeeping control, so a card
   that is in one keeps its mark when the pointer leaves. The rest of the
   family still recedes; only the marked ones stay. */
.lib-card-heart.is-on,
.lib-card-collect.is-on {
  opacity: 1;
  color: var(--color-accent-strong);
}
@media (hover: hover) {
  .lib-card-heart.is-on,
  .lib-card-collect.is-on {
    opacity: 1;
  }
}
.lib-card-heart.is-on:hover {
  color: var(--color-danger);
}
/* A favourited item reads as favourited from across the card. The heart FILLS
   rather than only changing colour: an outline heart in an accent tint is a
   colour difference a reader has to compare two cards to notice, and the
   filled-versus-outline pair is what the shape means everywhere else. */
.lib-card-heart.is-on svg path {
  fill: currentColor;
}
/* Focus takes the canonical ring on top of the reveal above. It was falling back
   to the browser's default outline, which does survive forced-colors but is the
   one control here not wearing the app's ring. */
.lib-card-act:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
/* An agent card's Edit agent: the toolbar's F04 compact outlined button at
   card size, first on the bottom line, above the stretched hit area so a press
   on it opens the build page and never the run panel. A workflow card's Edit
   workflow is the same button in the same place, and a skill's Edit skill
   wears the agent's class. */
.lib-card-edit-agent,
.lib-card-edit-workflow {
  position: relative;
  z-index: 1;
  transition: opacity var(--dur-quick) var(--ease-out);
}
/* Edit shows where the card's hover actions do: on hover or focus, its space
   kept at rest so nothing on the line moves. Where nothing can hover it stays. */
@media (hover: hover) {
  .lib-card .lib-card-edit-agent,
  .lib-card .lib-card-edit-workflow {
    opacity: 0;
  }
  .lib-card:hover .lib-card-edit-agent,
  .lib-card:focus-within .lib-card-edit-agent,
  .lib-card:hover .lib-card-edit-workflow,
  .lib-card:focus-within .lib-card-edit-workflow {
    opacity: 1;
  }
}
/* Deterministic per-skill monogram, tinted by a stable hash of the name
   (set as --glyph-h inline) — the same anchor the marketplace cards use. */
.lib-card-glyph {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  background: hsl(var(--glyph-h) 40% 22%);
  color: hsl(var(--glyph-h) 62% 78%);
  border: var(--border-thin) solid hsl(var(--glyph-h) 35% 34%);
}
html[data-theme='light'] .lib-card-glyph {
  background: hsl(var(--glyph-h) 58% 92%);
  color: hsl(var(--glyph-h) 50% 32%);
  border-color: hsl(var(--glyph-h) 45% 80%);
}
.lib-card-desc {
  font-size: var(--fs-13);
  color: var(--color-text-default);
  margin: var(--space-2) 0 var(--space-3);
  line-height: 1.45;
  /* Two lines keeps every card the same height so the grid stays a grid. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* An agent with no description yet: the line keeps its place, quieter than one written. */
.lib-card-desc--muted {
  color: var(--color-text-faint);
}
.lib-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}
/* F06 topic pill: an accent outline and accent ink, no fill, on the card and
   on the item's page alike. */
.lib-tag {
  font-size: var(--fs-11);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: var(--border-thin) solid var(--color-accent);
  color: var(--color-accent);
  line-height: 1.3;
}
/* "+N" opens the rest in a popover: the same pill as a button, above the
   card's stretched hit area, tinted on hover and while its popover is open. */
.lib-tag--more {
  position: relative;
  z-index: 1;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}
.lib-tag--more:hover,
.lib-tag--more.is-open {
  background: var(--color-accent-soft);
}
.lib-tag--more:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
/* F12 popover of the topics the card leaves out, in the same pills. */
.fmenu.lib-tags-pop {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  min-width: 0;
  max-width: 240px;
  padding: var(--space-2);
}
.lib-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
/* F06 token chip. Only inside the example block, whose rows are several kinds
   at once — under a kind's own heading the row would be repeating it. */
.lib-card-kind {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--color-surface-substrate-2);
  color: var(--color-text-faint);
  font-size: var(--fs-11);
}
.lib-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}
.lib-badge--scope {
  background: var(--color-surface-substrate-2);
  color: var(--color-text-faint);
}
.lib-badge--warn {
  background: rgba(233, 177, 98, 0.16);
  color: var(--color-warn);
}
.lib-badge--muted {
  background: transparent;
  border: var(--border-thin) dashed var(--color-border-strong);
  color: var(--color-text-faint);
}
/* The example block. It is a group like any other and is deliberately not
   tinted or dimmed: the notice above its rows is the marking, and a second
   treatment on the rows themselves would mark one thing twice. The rule it
   gets is separation — it follows the real groups and should read as the end
   of the list rather than as another kind in it. */
.lib-group--example {
  margin-top: var(--space-2);
  padding-top: var(--space-5);
  border-top: var(--border-thin) solid var(--color-border-default);
}
/* F01 inline hint — one line standing in for a list's rows while the set is
   being read, or when reading it failed. Not an empty state: the surface does
   not know yet whether anything is there, so it offers no action.

   Solid, not dashed. Dashed is reserved for genuine drop targets, and a line
   saying "Loading what is installed…" is the furthest thing from somewhere to
   drop a file. The actioned empty surfaces this used to be shared with now use
   the .srf-empty family. */
.lib-empty {
  font-size: var(--fs-13);
  color: var(--color-text-faint);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: var(--space-4);
}
/* F23 breadcrumb trail at the head of every Library page — "Agents › Weekly
   Review", "Saved › Reading list", "Skills › tidy › 29 Sep, 17:11". The shipped
   path-trail classes draw the steps; this sets only where the trail sits and
   its size. Its links are bare text, so
   they answer a press with nothing and stay out of the press block. */
.lib-crumbs {
  margin-bottom: var(--space-3);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
/* Inside the run page's bar the trail shares a row with the run's badges, so
   the bar's own gap spaces it and it gives ground before they do. */
.skrun-page-bar > .lib-crumbs {
  margin-bottom: 0;
}
/* Detail page — same two-column split as the marketplace bundle detail. */
.skills-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: var(--space-5);
  align-items: start;
}
.skills-detail-main {
  min-width: 0;
}
.skills-divergence {
  border-radius: var(--radius-2);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--fs-12);
  line-height: 1.5;
}
.skills-divergence-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  margin-bottom: var(--space-1);
}
.skills-divergence--warn {
  background: rgba(233, 177, 98, 0.12);
  border: var(--border-thin) solid var(--color-warn);
  color: var(--color-warn);
}
.skills-divergence--warn .skills-divergence-body {
  color: var(--color-text-default);
}
.skills-divergence--muted {
  background: var(--color-surface-substrate);
  border: var(--border-thin) dashed var(--color-border-strong);
  color: var(--color-text-muted);
}
.skills-divergence--clean {
  background: var(--color-surface-substrate);
  border: var(--border-thin) solid var(--color-border-default);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
}
.skills-longdesc {
  font-size: var(--fs-14);
  color: var(--color-text-default);
  line-height: 1.6;
  margin-bottom: var(--space-4);
  white-space: pre-wrap;
}
/* The skill's instruction body, read from the file when the detail opens.
   Capped so a long skill scrolls inside its own block instead of pushing the
   sidebar's actions off-screen. */
.skills-body {
  font-size: var(--fs-13);
  color: var(--color-text-default);
  line-height: 1.6;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: var(--space-3) var(--space-4);
  max-height: 26rem;
  overflow: auto;
}
.skills-body > :first-child {
  margin-top: 0;
}
.skills-body > :last-child {
  margin-bottom: 0;
}
.skills-body pre {
  overflow-x: auto;
}
.skills-body-pending {
  color: var(--color-text-faint);
  font-size: var(--fs-12);
}
.skills-section-title {
  font-weight: 600;
  font-size: var(--fs-14);
  color: var(--color-text-default);
  margin: var(--space-4) 0 var(--space-2);
}
.skills-caps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.skills-cap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-substrate-2);
  color: var(--color-text-muted);
}
.skills-cap--none {
  background: transparent;
  border: var(--border-thin) dashed var(--color-border-strong);
  color: var(--color-text-faint);
}
.skills-overrides {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.skills-override {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--color-surface-substrate);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: var(--space-2) var(--space-3);
}
.skills-override-scope {
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
.skills-override-path {
  align-self: flex-start;
  border: none;
  background: transparent;
  padding: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--color-accent-strong);
  cursor: pointer;
}
.skills-override-path:hover {
  text-decoration: underline;
}
.skills-detail-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.skills-fields {
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: var(--space-3);
}
/* .skills-field-row is the shared key/value data row (component canon); the two
   spans below differ from the marketplace manifest's because a skill's values
   are long enough to need wrapping and right alignment. */
.skills-field-key {
  color: var(--color-text-faint);
  flex: none;
}
.skills-field-val {
  font-family: var(--font-mono);
  color: var(--color-text-default);
  overflow-wrap: anywhere;
  text-align: right;
}
.skills-side-label {
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}
/* ---------- The agent's build page (library/build/agent/<id>) ----------
   An agent's own page, laid on the skill page's two-column split
   (.skills-detail-grid) with the Library trail (.lib-crumbs), the skill page's
   section headings and F03 margin panels. What is new here is only what an
   agent has and a skill page does not: the shell's kind tile and status, the
   instructions in a read-only editor with reference chips, and the notices
   around them. */
.agentpg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  min-width: 0;
}
/* An agent's or a workflow's title wraps rather than clips. It keeps room for
   a few words; at a narrow width the status and the actions after it move to
   a line of their own before the title gives up any more. */
.agentpg-head > .agentpg-title {
  flex: 1 1 10em;
  white-space: normal;
  overflow-wrap: break-word;
}
/* The kind tile beside the title: the item's kind, drawn the way a card's
   glyph sits on its tile. */
.agentpg-kind-tile {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-2);
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
}
/* F07 label badge beside the title: the shell's one status line. Problems in
   warn, a pause neutral, the next run accent. */
.agentpg-status {
  flex: none;
  padding: 0 var(--space-2);
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--fs-11);
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}
.agentpg-status--problems {
  background: var(--color-warn-soft);
  border-color: var(--color-warn-soft-2);
  color: var(--color-warn);
}
.agentpg-status--paused {
  background: var(--color-surface-substrate-2);
  border-color: var(--color-border-default);
  color: var(--color-text-muted);
}
.agentpg-status--next {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-soft-2);
  color: var(--color-accent-strong);
}
.agentpg-desc {
  margin: var(--space-3) 0 0;
  font-size: var(--fs-14);
  line-height: 1.5;
  color: var(--color-text-default);
}
.agentpg-meta {
  margin: var(--space-1) 0 0;
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
/* The meta line is a flex row, where a bare text node's edge spaces collapse;
   its separators keep theirs. */
.agentpg-meta-sep {
  white-space: pre;
}
/* Every topic of the item, under its description, in the card's pills. */
.agentpg-topics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
}
/* The notices above the grid: the grid's own width, and --space-4 above the cards
   rather than the pane's larger gap. Nothing, and no gap, when there are none. */
.home-notices {
  width: 100%;
  max-width: 1560px;
  margin-bottom: calc(var(--space-4) - var(--space-6));
}
.home-notices:empty {
  display: none;
}
.home-notices > .page-notice:last-child {
  margin-bottom: 0;
}
/* A one-line page notice with a quiet dismiss button (Workspaces page). */
.page-notice {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate-2);
  color: var(--color-text-muted);
  font-size: var(--fs-14);
  line-height: 1.45;
}
.page-notice > .icon {
  flex: none;
}
.page-notice-text {
  flex: 1;
  min-width: 0;
}
.page-notice-action {
  flex: none;
  color: var(--color-text-muted);
  font-size: var(--fs-13);
  padding: var(--space-1) var(--space-2);
}
.page-notice-action:hover {
  color: var(--color-text-default);
}
/* The note's second quiet button, before Got it: it opens what the note only
   summarises (the open bucket: it answers a press without moving), and it is the
   quiet button's own press as it sits beside it. Smaller and muted, underlined on
   hover. */
.page-notice-more {
  font-size: var(--fs-12);
}
.page-notice-more:hover {
  text-decoration: underline;
}
/* The loose-items note's one button, beside the quiet one: the secondary button at
   the note's own size. Commit bucket, as every .sp-sbtn. */
.page-notice-lead {
  flex: none;
  font-size: var(--fs-13);
}
/* Move into a workspace: the tick-all row, the bordered scrolling list of loose items
   (about ten rows tall), the workspace to move to, and the success line a batch leaves. */
.loose-move {
  max-width: 460px;
}
.loose-move-all {
  font-weight: 600;
}
.loose-move-list {
  display: flex;
  flex-direction: column;
  max-height: 264px;
  overflow-y: auto;
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
}
.loose-move-row {
  width: 100%;
  min-width: 0;
}
.loose-move-glyph {
  flex: none;
  color: var(--color-text-muted);
}
.loose-move-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.loose-move-count {
  flex: none;
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.loose-move-to {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.loose-move-to .srf-dialog-input {
  flex: 1;
  min-width: 0;
}
.loose-move-done {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-12);
  color: var(--color-success);
}
/* F17 inline notice: the held-back update in neutral, the problems in warn. */
.agentpg-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate-2);
  border: var(--border-thin) solid var(--color-border-default);
  color: var(--color-text-muted);
  font-size: var(--fs-13);
  line-height: 1.45;
}
.agentpg-notice > .icon {
  flex: none;
  margin-top: 2px;
}
.agentpg-notice--warn {
  background: var(--color-warn-soft);
  border-color: var(--color-warn-soft-2);
  color: var(--color-warn);
}
/* F10 card, content variant — the held-update line at the top of an installed
   agent's body: who released which version, with Keep mine (F04 ghost, Commit)
   and Update (F04 secondary; Open on an edited copy, where it asks first, and
   Commit on an unedited one). The readable ground on a shadow, so it reads as
   something to decide rather than a notice to read past. It opens nothing
   itself, so it does not lift on hover. */
.agentpg-held {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: var(--space-2) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  background: var(--color-surface-readable);
  box-shadow: var(--shadow-1);
  color: var(--color-text-default);
  font-size: var(--fs-13);
  line-height: 1.45;
}
.agentpg-held-text {
  flex: 1 1 280px;
  min-width: 0;
}
/* The one quiet line the first edit to an installed agent shows, over the
   meta line, until the reader leaves the page. Muted text, nothing to press. */
.agentpg-first-edit {
  margin: var(--space-1) 0 0;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
/* Why an installed agent's Updates cannot be switched: under its track. */
.agentpg-updates-note {
  margin-top: var(--space-2);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.agentpg-problems-head {
  font-weight: 600;
}
.agentpg-problem-list {
  margin: var(--space-1) 0 0;
  padding-left: var(--space-4);
}
.agentpg-problem-line {
  margin-left: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  opacity: 0.8;
}
/* The instructions: the editor's own face in a white card — the Library
   card's ground, hairline and shadow, deepening on hover. It does not lift:
   the card itself is not clickable. It is a page: a fixed 640px box whose
   text scrolls inside it. */
.agentpg-body {
  display: flex;
  flex-direction: column;
  height: 640px;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  background: var(--color-surface-readable);
  box-shadow: var(--shadow-1);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-14);
  line-height: 1.6;
  transition: box-shadow var(--dur-quick) var(--ease-out);
}
.agentpg-body:hover {
  box-shadow: var(--shadow-2);
}
.agentpg-body .cm-editor {
  background: transparent;
}
.agentpg-body > .cm-editor {
  flex: 1 1 auto;
  min-height: 0;
}
.agentpg-body .cm-scroller,
.agentpg-body > .agentpg-body-read,
.agentpg-body > .skills-body-pending {
  overflow: auto;
}
.agentpg-body .cm-editor.cm-focused {
  outline: none;
}
.agentpg-body .cm-content {
  padding: 0;
  caret-color: var(--color-accent);
}
/* Live Preview mounts in the note editor's host, for its heading, list and
   quote lines; the instructions keep their own box, measure and size. */
.agentpg-body.cm-host .cm-content {
  max-width: none;
  font-size: inherit;
}
/* The agent page's grid: what stands over the instructions takes a row of its
   own, so the instructions' card and the margin's first slot start on one line
   whatever is stacked above the card. The rows sit flush; the title keeps its
   own spacing to the card. */
.agentpg-grid {
  grid-template-areas:
    'top .'
    'main side';
  row-gap: 0;
}
.agentpg-main-top {
  grid-area: top;
  min-width: 0;
}
.agentpg-grid > .agentpg-main {
  grid-area: main;
}
.agentpg-grid > .agentpg-margin {
  grid-area: side;
}
.agentpg-body-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.agentpg-body-head .skills-section-title {
  flex: 1 1 auto;
  min-width: 0;
}
/* A skill page names the file its main card shows: the folder it sits in,
   quiet and monospaced, then the file's own name. */
.agentpg-file-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.agentpg-file-folder {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 400;
  color: var(--color-text-muted);
}
/* The mode toggle rides the card's top-right corner, and the text keeps clear
   of it rather than running underneath. */
.agentpg-body-card {
  position: relative;
}
.agentpg-body-card > .agentpg-body-mode {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  z-index: 1;
}
.agentpg-body-card > .agentpg-body {
  padding-right: calc(var(--space-1) + 32px + var(--space-2));
}
/* A skill's script in the plain code editor: monospace at the code size, with
   faint line numbers on the card's own ground and no rule between them and the
   text. It has no mode toggle, so the text runs the card's full width. */
.agentpg-body-card > .agentpg-body.agentpg-code {
  padding-right: 0;
}
.agentpg-code .cm-editor,
.agentpg-code-text {
  font-family: var(--font-mono);
  font-size: var(--fs-13);
}
/* Over the instructions' prose face, which the body's scroller sets. */
.agentpg-body.agentpg-code .cm-scroller {
  font-family: var(--font-mono);
  line-height: 1.6;
}
.agentpg-code .cm-gutters {
  background: transparent;
  border-right: 0;
  color: var(--color-text-faint);
}
.agentpg-code-text {
  margin: 0;
  white-space: pre-wrap;
}
/* Reading view: the note's rendered face, inside the instructions' box — at
   Live Preview's measure and size, so flipping moves no text sideways. */
.agentpg-body-read.prose {
  max-width: none;
  padding: 0;
  font-size: inherit;
}
/* The note editor's prose face, so the instructions read as they do when the
   file is opened as a note. */
.agentpg-body .cm-scroller,
.agentpg-body-text {
  font-family: var(--font-prose);
  line-height: 1.66;
}
.agentpg-body-text {
  white-space: pre-wrap;
}
/* A reference chip is the editor's rendered wikilink (.wikilink, and
   .wikilink.broken for one that points at nothing) with its kind named first,
   so a skill and a note of the same name read as different things. */
.agentpg-chip {
  white-space: nowrap;
}
.agentpg-chip-kind {
  margin-right: var(--space-1);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
.agentpg-chip.broken .agentpg-chip-kind {
  color: inherit;
  opacity: 0.8;
}
/* The header is one F09 embedded card: the title block, then the run card
   out to the right card's right edge, a hairline between them. The title
   column adds the card's padding to 420px, so the text keeps its 420px. Not
   an .agentpg-card: a popover places itself against the nearest one. */
.agentpg-shell {
  display: grid;
  grid-template-columns:
    calc(420px + 2 * var(--space-4) + 2 * var(--border-thin))
    minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  margin-bottom: var(--space-4);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  background: var(--color-surface-readable);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
/* A draft, and a workflow, have no run card: the title block is the card. */
.agentpg-shell:not(:has(> .agentpg-runcard)) {
  grid-template-columns: minmax(0, 1fr);
}
/* A skill's header: the title side and the run side are equal halves, the
   hairline between them at the card's centre. */
.agentpg-shell.is-skill {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.agentpg-shell > .agentpg-runcard {
  display: flex;
  flex-direction: column;
  border: 0;
  border-left: var(--border-thin) solid var(--color-border-default);
  border-radius: 0;
  box-shadow: none;
}
/* The run card's foot holds its line when the title block is the taller half. */
.agentpg-shell > .agentpg-runcard > .agentpg-runfoot {
  margin-top: auto;
}
.agentpg-titleblock {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--space-3) var(--space-4) 0;
}
.agentpg-titleblock:not(:has(> .agentpg-meta)) {
  padding-bottom: var(--space-3);
}
.agentpg-titleblock .agentpg-desc {
  text-wrap: pretty;
}
/* Who made it and when is the title side's foot: a hairline over a row the
   run card's foot's height, so one hairline runs the card's full width. */
.agentpg-titleblock > .agentpg-meta {
  display: flex;
  align-items: center;
  margin: auto calc(-1 * var(--space-4)) 0;
  padding: 0 var(--space-4);
  min-height: calc(32px + var(--border-thin));
  border-top: var(--border-thin) solid var(--color-border-default);
}
.agentpg-titleblock > :has(+ .agentpg-meta) {
  margin-bottom: var(--space-3);
}
/* The ⋯ menu ends the title row. */
.agentpg-titleblock .agentpg-head > :last-child {
  margin-left: auto;
}
/* F09 embedded card, in the instructions' recipe: the run card and the card
   of what the agent can use. */
.agentpg-card {
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  background: var(--color-surface-readable);
  box-shadow: var(--shadow-1);
}
/* The right card is pinned while the page scrolls, and never taller than the
   window: past that it scrolls inside, so its foot is always reachable. */
.agentpg-grid > .agentpg-margin.agentpg-card {
  position: sticky;
  top: var(--space-4);
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  gap: 0;
}

/* F15 section: a group label, an F05 compact + when it can grow, F02 rows. */
.agentpg-sec {
  padding: var(--space-2) 0;
}
.agentpg-sec + .agentpg-sec {
  border-top: var(--border-thin) solid var(--color-border-default);
}
.agentpg-sec-head {
  display: flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 2px;
  padding: 0 var(--space-2) 0 var(--space-3);
}
.agentpg-sec-label {
  flex: 1;
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}
.agentpg-sec-add {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.agentpg-sec-add:hover,
.agentpg-sec-add.is-open,
.agentpg-desc-edit:hover,
.agentpg-desc-add:hover,
.agentpg-col-more:hover,
.agentpg-col-more.is-open {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.agentpg-sec-add .icon {
  display: flex;
}
.agentpg-sec-caption {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-12);
  line-height: 1.45;
  color: var(--color-text-faint);
}
.agentpg-sec-caption > .agentpg-row-lead {
  height: 18px;
  color: var(--color-text-faint);
}
.agentpg-sec-note {
  padding: 0 var(--space-3) var(--space-1) calc(var(--space-3) + 16px + var(--space-2));
  font-size: var(--fs-12);
  line-height: 1.45;
  color: var(--color-text-faint);
}
/* An Updates track in a section sits under its label, at the rows' inset. */
.agentpg-updates > .seg,
.agentpg-updates > .agentpg-updates-note {
  margin-left: var(--space-3);
  margin-right: var(--space-3);
}

/* F02 row, one height: a 16px leading slot, the name, a muted value, and a
   chevron when it opens something. A row that can be taken out shows its ×
   on hover, in the chevron's place. */
.agentpg-row,
.agentpg-row-hit {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-13);
  line-height: 1.35;
  text-align: left;
}
.agentpg-row {
  width: 100%;
  min-height: 32px;
  padding: var(--row-pad) var(--space-3);
  transition: background-color var(--dur-quick) var(--ease-out);
}
.agentpg-row-hit {
  flex: 1 1 auto;
  align-self: stretch;
  padding: 0;
  cursor: pointer;
}
/* A row runs edge to edge in its card, so its focus ring is drawn inside it. */
.agentpg-row:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: -2px;
}
button.agentpg-row {
  cursor: pointer;
}
button.agentpg-row:hover:not(:disabled),
.agentpg-row.is-removable:hover,
.agentpg-row.is-open,
.agentpg-row:has(> .agentpg-row-hit.is-open) {
  background: var(--color-surface-hover);
}
.agentpg-row-lead {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}
.agentpg-row-lead .icon {
  display: flex;
}
.agentpg-row-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Beside a value, the name keeps its width and the value gives way. */
.agentpg-row-name:has(+ .agentpg-row-val) {
  flex-shrink: 0;
  max-width: 60%;
}
.agentpg-row-sub {
  color: var(--color-text-faint);
}
.agentpg-row-val {
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-muted);
}
.agentpg-row-chev {
  display: flex;
  flex: none;
  color: var(--color-text-faint);
  transition: rotate var(--dur-quick) var(--ease-out);
}
.agentpg-row:hover .agentpg-row-chev {
  color: var(--color-text-default);
}
.agentpg-prov.is-expanded .agentpg-row-chev {
  rotate: 90deg;
}
.agentpg-row-x {
  display: grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-faint);
  cursor: pointer;
  opacity: 0;
}
.agentpg-row-x:hover {
  color: var(--color-text-default);
}
.agentpg-row.is-removable:hover .agentpg-row-x,
.agentpg-row-x:focus-visible {
  opacity: 1;
}
.agentpg-row.is-removable:hover .agentpg-row-chev {
  display: none;
}
/* The × keeps the chevron's place: without one it overlays nothing. */
.agentpg-row.is-removable:not(:has(.agentpg-row-chev)) .agentpg-row-x {
  margin-left: auto;
}
/* An added tool under its provider: indented past the leading slot, smaller. */
.agentpg-row--sub {
  min-height: 28px;
  padding-left: calc(var(--space-3) + 16px + var(--space-2));
  font-size: var(--fs-12);
}
.agentpg-row--sub .agentpg-row-val {
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
/* F14 checkbox row: the box in the leading slot. */
.agentpg-row--check .agentpg-row-name {
  white-space: normal;
}
.agentpg-row--check:disabled {
  cursor: default;
  opacity: 0.6;
}
.agentpg-row--check:hover:not(:disabled) .fmenu-box {
  border-color: var(--color-accent);
}
.agentpg-row--minor {
  min-height: 28px;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.agentpg-row--minor .fmenu-box {
  width: 14px;
  height: 14px;
}
/* A provider's standing grant: always there, under its provider. */
.agentpg-row--grant,
.agentpg-row-wrap.agentpg-row--grant > .agentpg-row {
  padding-left: calc(var(--space-3) + 16px + var(--space-2));
}
.agentpg-row-wrap.agentpg-row--grant {
  padding-left: 0;
}

/* The run card: the start row, the section columns, the foot. */
.agentpg-start-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.agentpg-start-row > .agentpg-model {
  margin-left: auto;
}
/* Start agent: F04 primary at default size, in the builder's primary recipe. */
.agentpg-start {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--row-pad) var(--space-4);
  font-size: var(--fs-13);
  line-height: 1.35;
}
.agentpg-start .icon {
  display: flex;
}
.agentpg-start-as {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.agentpg-cols {
  display: grid;
  grid-template-columns: repeat(var(--agentpg-cols, 2), minmax(0, 1fr));
}
.agentpg-cols > .agentpg-col {
  min-width: 0;
  padding: var(--space-2) 0 var(--space-1);
}
.agentpg-cols > .agentpg-col + .agentpg-col {
  border-top: 0;
  border-left: var(--border-thin) solid var(--color-border-default);
}
/* Two rows, always: the card keeps one height whatever it holds. */
.agentpg-col .agentpg-sec-body {
  min-height: 64px;
}
.agentpg-col-empty {
  padding: var(--row-pad) var(--space-3);
  font-size: var(--fs-13);
  line-height: 1.35;
  color: var(--color-text-faint);
}
/* "+N more": F04 ghost, compact, in the column's head before the +. */
.agentpg-col-more {
  margin-right: var(--space-1);
  padding: 2px var(--space-2);
  border: 0;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--fs-12);
  cursor: pointer;
}
.agentpg-runfoot {
  display: flex;
  align-items: center;
  border-top: var(--border-thin) solid var(--color-border-default);
}
.agentpg-runfoot > .agentpg-row {
  width: auto;
}
.agentpg-runfoot > .agentpg-row--minor {
  margin-left: auto;
}

/* The notice of where the file and the instructions disagree: F17 warn, one
   line per disagreement with its F23 fix right after the sentence. */
.agentpg-mismatches {
  margin: var(--space-3) 0 0;
}
.agentpg-mismatch-text {
  min-width: 0;
}
.agentpg-mismatch {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: var(--space-3);
  padding-top: var(--space-1);
  color: var(--color-text-default);
}
.agentpg-mismatch-fix {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent-strong);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.agentpg-mismatch-fix:hover {
  text-decoration: underline;
}

/* Popovers over the page: the shared F12 menu surface holding a list, an
   editor or a choice. */
.agentpg-pop--menu {
  width: 248px;
}
.agentpg-pop--list {
  width: 296px;
  max-height: min(480px, calc(100vh - 32px));
  overflow-y: auto;
}
.agentpg-pop--start {
  width: 288px;
}
.agentpg-pop--about {
  width: 280px;
  padding: var(--space-2) var(--space-3);
}
.agentpg-pop--editor {
  width: 340px;
  padding: var(--space-1) var(--space-3) var(--space-3);
}
.agentpg-pop--editor .fmenu-head {
  padding-left: 0;
}
.agentpg-pop--editor .agentpg-sched-editor {
  margin: 0;
}
.agentpg-pop--card {
  width: 380px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 0;
}
/* A field's card inside a popover: the popover is the card, so the card's
   own edge and shadow go. */
.agentpg-pop--card .agentpg-field-card {
  border: 0;
  box-shadow: none;
  background: transparent;
}
.agentpg-pop .fmenu-slot .icon {
  color: var(--color-text-muted);
}
.agentpg-pop-two {
  align-items: flex-start;
}
.agentpg-pop-two > .fmenu-slot {
  padding-top: 1px;
}
.agentpg-pop-two-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.agentpg-pop-two-sub {
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  white-space: normal;
}
/* F13 wrapper field at menu scale: the search over a popover's list. */
.agentpg-pop-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  margin: var(--space-1) var(--space-1) var(--space-2);
  padding: 0 var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-faint);
}
.agentpg-pop-search:focus-within {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.agentpg-pop-search .icon {
  display: flex;
}
.agentpg-pop-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-13);
  outline: none;
}
.agentpg-pop-back {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: 0;
  border-radius: var(--radius-2);
  background: none;
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
}
.agentpg-pop-back:hover {
  background: var(--color-surface-hover);
}
.agentpg-pop-back .icon {
  display: flex;
  color: var(--color-text-muted);
}
.agentpg-pop-empty {
  padding: var(--row-pad) var(--space-2);
  font-size: var(--fs-13);
  color: var(--color-text-faint);
}
.agentpg-pop-title {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
.agentpg-pop-text,
.agentpg-pop-meta {
  margin: var(--space-1) 0 0;
  font-size: var(--fs-12);
  line-height: 1.45;
  color: var(--color-text-default);
}
.agentpg-pop-meta {
  color: var(--color-text-faint);
}
/* A row with a control at its end, not a press of its own. */
.agentpg-addrow {
  cursor: default;
}
.agentpg-addrow:hover {
  background: transparent;
}
.agentpg-addrow.is-added .fmenu-label {
  color: var(--color-text-muted);
}
/* F05 compact, hairline: a tool's + in Add tools. Pressed, it shows a tick on
   the accent fill for a moment, then its row folds away. */
.agentpg-addbtn {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.agentpg-addbtn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}
.agentpg-addrow.is-added .agentpg-addbtn {
  border-color: transparent;
  background: var(--btn-accent-bg);
  color: var(--btn-accent-text);
}
.agentpg-addbtn .icon,
.agentpg-pop-x .icon {
  display: flex;
}
/* F05 bare glyph: a folder's × in its menu. */
.agentpg-pop-x {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-faint);
  cursor: pointer;
}
.agentpg-pop-x:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
/* A trigger's Remove: a danger text button at the left of Cancel and Save. */
.agentpg-sched-remove {
  margin-right: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-danger);
  font: inherit;
  font-size: var(--fs-13);
  cursor: pointer;
}
.agentpg-sched-remove:hover {
  text-decoration: underline;
}
/* The form a `start: form` agent is run from, in the ask box's place: per
   input its label, its control (the launcher's F13 field, F06 chips or F14
   checkbox), its help line and the message that blocks it; then Try it and
   Run, the dialog's own F04 buttons. */
.agentpg-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.agentpg-form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
/* The dialog's sublabel pulls itself up into its dialog's row gap; a field's
   own gap is already tight, so here it keeps its place above the control. */
.agentpg-form-field > .srf-dialog-sublabel {
  margin-bottom: 0;
}
.agentpg-form-help,
.agentpg-form-required {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.agentpg-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}
/* The form on the build page, always editable: Starts as (the F25 track), the
   line saying Chat keeps the fields, then one F02 row per field — label,
   "· required", its type, › — of which one at a time opens into its card, and
   the dashed F04 "+ Add a field". Rows and the card's chevron are Toggle:
   they expand in place, and the expanded state is the answer. */
.agentpg-formed {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.agentpg-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
/* F02 selectable list row, default density. */
.agentpg-field-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--row-pad) var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font-size: var(--fs-13);
  text-align: left;
}
.agentpg-field-row:hover {
  background: var(--color-surface-hover);
}
.agentpg-field-row:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: -2px;
}
.agentpg-field-row-label {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}
.agentpg-field-row-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agentpg-field-row-req,
.agentpg-field-row-type {
  flex: none;
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  white-space: nowrap;
}
.agentpg-field-row-chev {
  flex: none;
  color: var(--color-text-faint);
}
/* The open field: a white card on the page, its parts stacked. */
.agentpg-field-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-3);
  background: var(--color-surface-readable);
  box-shadow: var(--shadow-1);
}
.agentpg-field-card-top,
.agentpg-field-card-foot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.agentpg-field-card-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
/* F05 icon button, compact: the chevron that closes the card. */
.agentpg-field-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
}
.agentpg-field-close:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.agentpg-field-close:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
.agentpg-field-pair {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--space-3);
}
.agentpg-field-part {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
.agentpg-field-part > .srf-dialog-sublabel {
  margin-bottom: 0;
}
.agentpg-field-part > .srf-dialog-input {
  width: 100%;
}
.agentpg-field-card > .skrun-check {
  align-self: flex-start;
}
.agentpg-field-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
/* F04 compact, danger ghost: Remove field. Disabled on a form's last field. */
.agentpg-field-remove {
  flex: none;
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-2);
  color: var(--color-danger);
  font-size: var(--fs-12);
}
.agentpg-field-remove:hover:not(:disabled) {
  background: var(--color-danger-soft);
}
.agentpg-field-remove:disabled {
  opacity: 0.55;
  cursor: default;
}
/* F04 default size, dashed: + Add a field — dashed because it puts something
   in the list. */
.agentpg-field-add {
  width: 100%;
  padding: var(--row-pad) var(--space-4);
  border: var(--border-thin) dashed var(--color-border-default);
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
  font-size: var(--fs-13);
}
.agentpg-field-add:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text-default);
}
/* The margin: one F03 panel per slot, only the slots the file gives it, each
   a white card like the instructions beside it. */
.agentpg-slot {
  background: var(--color-surface-readable);
  border-color: var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--dur-quick) var(--ease-out);
}
.agentpg-slot:hover {
  box-shadow: var(--shadow-2);
}
.agentpg-slot-val {
  color: var(--color-text-default);
  text-align: right;
}
.agentpg-slot-line {
  padding: 3px 0;
  font-size: var(--fs-12);
  line-height: 1.45;
  color: var(--color-text-default);
  overflow-wrap: anywhere;
}
.agentpg-slot-note {
  margin-top: var(--space-2);
  font-size: var(--fs-12);
  line-height: 1.45;
  color: var(--color-text-faint);
}
/* A chip whose caret is inside it shows its raw link, in the chip's colour, so
   it can be edited as a link in a note is. */
.agentpg-chip-raw {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
/* F12 content popover a broken chip opens: why it points at nothing, and the
   two things to do about it. */
.agentpg-ref-pop {
  position: fixed;
  z-index: 310;
  max-width: 320px;
  padding: var(--space-3);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-3);
}
.agentpg-ref-pop-text {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-12);
  line-height: 1.45;
  color: var(--color-text-default);
}
.agentpg-ref-pop-actions {
  display: flex;
  gap: var(--space-2);
}
/* F04 compact: ghost for Change and Edit link, secondary for Remove link. */
.agentpg-btn {
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--fs-12);
  cursor: pointer;
}
.agentpg-btn:hover {
  color: var(--color-text-default);
  background: var(--color-surface-hover);
}
/* The model an agent runs on, at the end of the run card's start row: an F04
   compact ghost button that opens its menu, its chevron after the label. It
   reads a value, so it never wraps. */
.agentpg-model {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
}
/* --- The agent's build page: the agent's own page at the full width of the
   surface. The assistant that edits it is in the app's left column, below. */
.builder {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}
/* F09 docked panel — the build page's assistant, in the left column in the
   sidebar's place: the column's width and collapse, the reading ground, and the
   panel's own thread, trace lines and composer inside it. */
.build-assist {
  flex: none;
  width: var(--tree-w, 360px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--color-surface-readable);
  border-right: var(--border-thin) solid var(--color-border-default);
}
.shell-body.tree-collapsed .build-assist {
  width: 0;
  border-right: 0;
}
.shell-body.is-tree-animating .build-assist {
  transition: width var(--dur-deliberate) var(--ease-out);
}
.pane-resize.is-assist {
  left: calc(var(--column-start, 0px) + var(--tree-w, 360px));
  transform: translateX(-50%);
}
.shell-body.is-tree-animating .pane-resize.is-assist {
  transition: left var(--dur-deliberate) var(--ease-out);
}
/* Full assistant: the page is hidden and the assistant takes the window, the
   rail kept. The conversation and composer sit in a 720px reading column, and
   the head's toggle (the one that shows the page again) is padded to where the
   page's button sits, clear of the parked tab when it is on the right edge. */
.shell-body.is-page-hidden > .main {
  display: none;
}
.shell-body.is-page-hidden > .build-assist {
  flex: 1 1 auto;
  width: auto;
  border-right: 0;
}
.shell-body.is-page-hidden > .pane-resize.is-assist {
  display: none;
}
.shell-body.is-page-hidden .build-assist-head {
  padding-right: var(--space-5);
}
body:has(> .chat-panel.is-tucked.fo-edge-right) .shell-body.is-page-hidden .build-assist-head {
  padding-right: calc(var(--parked-tab-w) + var(--space-4));
}
.shell-body.is-page-hidden .build-assist .chat-thread,
.shell-body.is-page-hidden .build-assist .chat-composer,
.shell-body.is-page-hidden .build-assist .builder-notice {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  box-sizing: border-box;
}
/* F18 toolbar: Undo all (F04 ghost), New session and History (F05 compact),
   then the column's collapse icon at the right end — the sidebar's own toggle,
   at the size it has beside the Surfaces heading. */
.build-assist-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  border-bottom: var(--border-thin) solid var(--color-border-default);
  min-width: 0;
}
.build-assist-icon {
  width: 26px;
  height: 26px;
}
.build-assist-icon:disabled {
  opacity: 0.5;
  cursor: default;
}
/* The pane toggles of a build page: the assistant's head toggle and the page's
   button on its breadcrumb line, one 24px button with a 15px glyph. */
.build-toggle {
  flex: none;
  width: 24px;
  height: 24px;
  color: var(--color-text-faint);
}
.build-toggle svg {
  width: 15px;
  height: 15px;
}
.build-assist .builder-convo {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.build-assist .chat-composer {
  background: var(--color-surface-readable);
}
.build-assist-opening {
  margin: auto;
}
/* The build page's icon rail: a slim strip at the far left of the shell, in
   front of the left column, that picks what the column holds — the sidebar's
   ☰ or the assistant's sparkle. It stays while the column is collapsed. Its
   width is --column-start, which the column, its drag handle and the panels
   hanging off its edge all start after. */
.build-rail {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  width: var(--column-start, 40px);
  padding-block: var(--space-2);
  background: var(--color-surface-nav);
  border-right: var(--border-thin) solid var(--color-border-default);
}
/* F05 icon button, toggle bucket: the column's new state is its answer, so no
   press response is laid on top. Lit, with a mark on its left edge, while the
   open column shows it — the accent for the sidebar, the agent's colour for
   the assistant. */
.build-rail-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.build-rail-btn:hover {
  color: var(--color-text-default);
  background: var(--color-surface-hover);
}
.build-rail-btn.is-on {
  color: var(--color-text-default);
}
.build-rail-btn.is-on::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-1));
  top: var(--space-2);
  bottom: var(--space-2);
  width: var(--border-emphasis);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
}
.build-rail-btn.is-assistant.is-on {
  color: var(--color-agent);
}
.build-rail-btn.is-assistant.is-on::before {
  background: var(--color-agent);
}
.build-rail-btn:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: -2px;
}
/* The breadcrumb's line, centred on the column's collapse icon — or on the
   rail's first icon while the column is collapsed (the line's top margin is
   measured to it). */
.build-topline {
  display: flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: var(--space-3);
}
.build-topline > .lib-crumbs {
  margin-bottom: 0;
}
.builder-spacer {
  flex: 1 1 auto;
}
/* F04 compact: secondary, ghost, primary. */
.builder-btn {
  flex: none;
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-2);
  background: transparent;
  font: inherit;
  font-size: var(--fs-12);
  cursor: pointer;
}
.builder-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.builder-btn--secondary {
  border-color: var(--color-border-default);
  color: var(--color-text-default);
}
.builder-btn--secondary:not(:disabled):hover {
  border-color: var(--color-accent);
}
.builder-btn--ghost {
  color: var(--color-text-muted);
}
.builder-btn--ghost:not(:disabled):hover {
  color: var(--color-text-default);
  background: var(--color-surface-hover);
}
.builder-btn--primary {
  background: var(--btn-accent-bg);
  color: var(--btn-accent-text);
  font-weight: 600;
}
.builder-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-3);
}
.builder-empty {
  margin: auto;
}
.builder-notice {
  margin: 0 var(--space-3) var(--space-2);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.builder-composer {
  flex: none;
}
.builder-preview {
  min-width: 0;
}
/* The draft marker: F07 label, neutral — a draft is not a problem. */
.agentpg-draft {
  flex: none;
  padding: 0 var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  background: var(--color-surface-substrate-2);
  color: var(--color-text-muted);
  font-size: var(--fs-11);
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}
/* The header's right end: a draft's Discard and Create, else the ⋯ menu. */
.agentpg-head-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}
/* ⋯: F05 icon button, default size. It opens the F12 menu of Export and
   Delete agent (or Uninstall), so it tints on press rather than kicking. */
.agentpg-more {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
  font-size: var(--fs-15);
  transition:
    background-color var(--dur-quick) var(--ease-out),
    color var(--dur-quick) var(--ease-out);
}
.agentpg-more:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.agentpg-more:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
/* F13, in place: a title is a field where it is shown. At rest the text is a
   button in the heading's own face and size, a hover grounds it as the
   invitation, and a double-click swaps in a bare input that holds the same
   face, so nothing on the row moves. */
.agentpg-inplace {
  display: inline-block;
  /* The padding is hung outside the text by the margin below, so the text
     lines up with the lines under it; the width allows for both sides. */
  max-width: calc(100% + 2 * var(--space-1));
  vertical-align: top;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: none;
  border-radius: var(--radius-1);
  padding: 0 var(--space-1);
  margin: 0 calc(-1 * var(--space-1));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: inherit;
  cursor: text;
}
.agentpg-inplace:hover {
  background: var(--color-surface-hover);
}
.agentpg-inplace:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
.agentpg-inplace.is-empty {
  color: var(--color-text-faint);
}
.agentpg-inplace-input {
  box-sizing: border-box;
  max-width: calc(100% + 2 * var(--space-1));
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  color: var(--color-text-default);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-1);
  padding: 0 var(--space-1);
  margin: 0 calc(-1 * var(--space-1));
  outline: none;
}
.agentpg-inplace-input:focus {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
/* A heading that clips its text to an ellipsis would clip the field's focus
   ring too, so it lets the ring out while a field stands in it. */
.agentpg-title:has(> .agentpg-inplace-input) {
  overflow: visible;
}
/* The description at rest is plain text, and its last word carries an F05
   compact pencil that opens the editor. The word and the pencil wrap
   together; the -3px keep the 24px target inside the line without growing
   it. */
.agentpg-desc-tail {
  white-space: nowrap;
}
.agentpg-desc-edit {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: -3px 0 -3px var(--space-1);
  padding: 0;
  vertical-align: middle;
  border: 0;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
/* Empty, the description is one F04 ghost compact button in its place, its
   padding hung outside so its words line up with the title's. */
.agentpg-desc-add {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 calc(-1 * var(--space-2));
  padding: var(--space-1) var(--space-2);
  border: 0;
  border-radius: var(--radius-2);
  background: transparent;
  font: inherit;
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  cursor: pointer;
}
.agentpg-desc-edit .icon,
.agentpg-desc-add .icon {
  display: flex;
}
.agentpg-desc-edit:focus-visible,
.agentpg-desc-add:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
/* The description's editor, in place: the field's padding and border hang
   outside the text, so the words stay where they were at rest. It grows with
   what it holds, two lines at least. */
textarea.agentpg-inplace-input {
  display: block;
  width: calc(100% + 2 * (var(--space-3) + var(--border-thin)));
  max-width: none;
  min-height: calc(2lh + 2 * var(--space-2) + 2 * var(--border-thin));
  margin: calc(-1 * (var(--space-2) + var(--border-thin)))
    calc(-1 * (var(--space-3) + var(--border-thin)));
  padding: var(--space-2) var(--space-3);
  border-color: var(--color-border-default);
  border-radius: var(--radius-2);
  field-sizing: content;
  resize: none;
}
/* Under the field, one row: the hint when the page gives one, then Cancel and
   Save, ending on the field's right edge. */
.agentpg-desc-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: calc(var(--space-2) + var(--border-thin) + var(--space-3));
  margin-right: calc(-1 * (var(--space-3) + var(--border-thin)));
}
.agentpg-desc-hint {
  flex: 1;
  min-width: 0;
  margin-right: var(--space-2);
  font-size: var(--fs-12);
  line-height: 1.4;
  color: var(--color-text-muted);
}
/* A change line points at what it changed: hovering it is the invitation. Its
   words are the elastic part, as a path is on a call's line. */
.chat-trace-line--change {
  cursor: pointer;
}
.chat-trace-line--change .chat-trace-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-trace-line--change:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* A rewrite's line holds one change per row, each its own hover target; the
   call's outcome note sits after the last. */
.chat-trace-line--changes {
  flex-wrap: wrap;
}
.chat-trace-line--changes .chat-trace-change {
  flex-basis: 100%;
}
.chat-trace-line--changes:hover {
  text-decoration: none;
}
.chat-trace-line--changes .chat-trace-change:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* The live-change tint: the agent's steady wash behind the region a change
   line is pointing at. */
.builder .is-live-change {
  background-color: var(--color-agent-wash);
  box-shadow: 0 0 0 var(--space-1) var(--color-agent-wash);
  transition: background-color var(--dur-quick) var(--ease-out);
}
/* A change that just landed flashes its region once, a beat stronger than the
   steady wash, and fades to nothing: it says "this just changed", never "this
   is selected". The script takes the class off when the fade ends. */
@keyframes srf-just-changed {
  from {
    background-color: color-mix(in srgb, var(--color-agent-wash), var(--color-agent-edge) 30%);
    box-shadow: 0 0 0 var(--space-1)
      color-mix(in srgb, var(--color-agent-wash), var(--color-agent-edge) 30%);
  }
  to {
    background-color: transparent;
    box-shadow: 0 0 0 var(--space-1) transparent;
  }
}
.builder .is-just-changed,
.wfpg .is-just-changed {
  animation: srf-just-changed 1600ms var(--ease-out) both;
}
/* Less motion: a brief static tint instead, taken off when the window ends. */
@media (prefers-reduced-motion: reduce) {
  .builder .is-just-changed,
  .wfpg .is-just-changed {
    animation: none;
    background-color: var(--color-agent-wash);
    box-shadow: 0 0 0 var(--space-1) var(--color-agent-wash);
  }
}
/* A heading or block a link just landed on takes the same fade a change that
   just landed does, as a box laid over it; the script removes the box when the
   fade ends. */
.anchor-landed {
  position: absolute;
  pointer-events: none;
  border-radius: var(--radius-1);
  animation: srf-just-changed 1600ms var(--ease-out) both;
}
@media (prefers-reduced-motion: reduce) {
  .anchor-landed {
    animation: none;
    background-color: var(--color-agent-wash);
  }
}
/* The question: the agent's prose, then its answers as F06 toggle chips —
   recommended first, marked — and a line for an answer in the person's words. */
.chat-question {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.chat-question-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.chat-question-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  max-width: 100%;
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-12);
  cursor: pointer;
}
.chat-question-chip:not(:disabled):hover {
  border-color: var(--color-accent);
}
.chat-question-chip:disabled {
  cursor: default;
  color: var(--color-text-muted);
}
.chat-question-chip.is-recommended {
  border-color: var(--color-accent-soft-2);
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
}
.chat-question-chip-note {
  font-size: var(--fs-11);
  font-weight: 600;
}
.chat-question-notes {
  margin: 0;
  padding-left: var(--space-4);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.chat-question-other {
  display: flex;
}
.chat-question-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--space-1) var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-12);
}
.chat-question.is-answered .chat-question-other {
  display: none;
}
/* New agent: F11 dialog — Browse, Describe it, templates, Blank. */
.builder-new {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(520px, 92vw);
}
.builder-new-label {
  margin-top: var(--space-2);
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-text-muted);
}
.builder-new-browse {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  align-self: flex-start;
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-12);
  cursor: pointer;
}
.builder-new-describe {
  width: 100%;
  padding: var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-13);
  resize: vertical;
}
.builder-new-actions {
  display: flex;
  justify-content: flex-end;
}
.builder-new-templates {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
/* The template rows, in a box of their own so their room can be held while
   the list is on its way. */
.builder-new-template-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
/* A row's room before its template is known: the same shape, nothing to press. */
.builder-new-template--pending {
  pointer-events: none;
}
/* F02 selectable rows: a template, and Blank last. */
.builder-new-template {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--row-pad) var(--space-3);
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-default);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.builder-new-template:hover {
  background: var(--color-surface-hover);
}
.builder-new-template-title {
  font-size: var(--fs-13);
  font-weight: 600;
}
.builder-new-template-desc {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.agentpg-ref-remove {
  border-color: var(--color-border-default);
  color: var(--color-text-default);
}
/* The export confirmation (F11 dialog): each list a head and its rows, each
   row the item and, muted, where it is. */
.agentpg-export-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.agentpg-export-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.agentpg-export-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
  font-size: var(--fs-13);
  color: var(--color-text-default);
}
.agentpg-export-label {
  flex: none;
}
.agentpg-export-detail {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.agentpg-export-note {
  font-size: var(--fs-12);
}
/* F14 checkbox at the margin's scale: the menu row's 16px box, and the
   statement beside it as the label. The row itself is bare. */
.agentpg-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-1) 0;
  border: none;
  background: transparent;
  color: var(--color-text-default);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.agentpg-check:disabled {
  cursor: default;
  opacity: 0.6;
}
.agentpg-check:hover:not(:disabled) .fmenu-box {
  border-color: var(--color-accent);
}
.agentpg-check .fmenu-box {
  margin-top: 1px;
}
.agentpg-check-label {
  font-size: var(--fs-12);
  line-height: 1.45;
}
.agentpg-check-wrap .agentpg-slot-note {
  margin: 0 0 var(--space-1) calc(16px + var(--space-2));
}
.agentpg-slot-line--edit {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}
.agentpg-slot-text {
  min-width: 0;
}
/* F05 compact: a bare glyph that takes one line out of the file. */
.agentpg-remove {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  margin: -3px calc(-1 * var(--space-1)) -3px 0;
  border: none;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-faint);
  cursor: pointer;
}
.agentpg-remove:hover {
  color: var(--color-text-default);
  background: var(--color-surface-hover);
}
/* F13 bare field, compact, for a new starter. */
.agentpg-add-input {
  width: 100%;
  margin-top: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-12);
}
.agentpg-add-input:focus {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
/* The Schedule slot's editor, in place of the line it edits: F25 tracks for the
   two-to-four-way choices (how often; before or after a meeting and which
   meetings), F13 compact fields for the values (the day and the time; the
   minutes; what happens to a file, the folder and the file types), then F04
   Cancel and Save. A menu row's worth of space between each. */
.agentpg-sched-editor {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-1) 0 var(--space-2);
}
.agentpg-sched-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.agentpg-sched-label {
  flex: 0 0 4.5em;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.agentpg-sched-input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin-top: 0;
}
.agentpg-sched-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}
/* Why Save is off: muted, at the left of the buttons. */
.agentpg-sched-why {
  margin-right: auto;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
/* A field that wraps and grows with what is typed (a starter), up to a few lines. */
.agentpg-sched-input--grow {
  field-sizing: content;
  min-height: 0;
  max-height: calc(var(--fs-12) * 1.5 * 6);
  resize: none;
  line-height: 1.5;
}
.agentpg-sched-edit {
  flex: none;
  margin: calc(-1 * var(--space-1)) 0;
}
/* The three ways to add a trigger, one F04 ghost each, stacked flush left. */
.agentpg-sched-adds {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.agentpg-sched-add {
  margin: var(--space-1) 0 0 calc(-1 * var(--space-3));
}
.skills-detail-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.skills-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font-size: var(--fs-13);
  font-family: inherit;
  cursor: pointer;
}
.skills-action:hover {
  border-color: var(--color-accent);
}
.skills-action--primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  font-weight: 600;
}
.skills-action--primary:hover {
  background: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
}
/* The destructive member of the same button family — outlined rather than
   filled, so it never competes with the primary action beside it. */
.skills-action--danger {
  color: var(--color-danger);
}
.skills-action--danger:hover {
  border-color: var(--color-danger);
  background: var(--color-danger-soft);
}
.lib-errors {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.lib-error {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-12);
  color: var(--color-danger);
  background: var(--color-surface-substrate);
  border: var(--border-thin) solid var(--color-danger);
  border-radius: var(--radius-2);
  padding: var(--space-2) var(--space-3);
}
.lib-error-icon {
  flex: none;
}
/* AW4/05 (revised, issue #592): static warn accent when there are unresolved
   needs-input items — the pulse animation was distracting and was removed. */
.notif-bell--needs-input {
  border-color: var(--color-warn-dot);
  color: var(--color-warn);
}
/* AW4/05: inline elevated needs-input bubble in the chat thread */
.chat-turn--needs-input {
  align-items: flex-start;
}
.chat-bubble--needs-input {
  background: color-mix(in srgb, var(--color-warn) 8%, transparent);
  border: 1.5px solid var(--color-warn-dot);
  border-radius: var(--radius-3);
  padding: var(--space-3) var(--space-4);
  max-width: 92%;
  width: 100%;
  box-sizing: border-box;
}
.ni-title {
  font-weight: 600;
  font-size: var(--fs-13);
  color: var(--color-warn);
  margin-bottom: var(--space-1);
}
.ni-desc {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  line-height: 1.5;
}
/* The ask under a held tool call: the needs-input bubble, sized to sit in a
   trace rather than to end a turn. It answers exactly the call above it. */
.chat-trace-ask {
  margin: var(--space-1) 0 var(--space-2);
  padding: var(--space-2) var(--space-3);
  max-width: 100%;
}
.chat-trace-ask .ni-desc {
  margin-bottom: var(--space-2);
}
.ni-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.ni-btn {
  padding: 6px 12px;
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-substrate);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.ni-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-text-default);
}
.ni-btn--deny {
  color: var(--color-danger);
  border-color: var(--color-danger);
}
.ni-btn--deny:hover {
  background: color-mix(in srgb, var(--color-danger) 8%, transparent);
}
.ni-btn--approve {
  color: var(--color-accent-strong);
  border-color: var(--color-accent);
}
.ni-btn--approve:hover {
  background: var(--color-accent-soft);
}
.ni-btn--primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.ni-btn--primary:hover {
  background: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
}

/* The pane for a file the app has no surface for. F01 empty state, centred
   variant: this pane IS the empty thing, so it takes the pane-filling shape
   rather than the inline hint. */
.editor-declined {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-7) var(--space-5);
  color: var(--color-text-faint);
  font-size: var(--fs-13);
  text-align: center;
}
.editor-declined-icon {
  color: var(--color-text-muted);
}
.editor-declined-title {
  color: var(--color-text-muted);
  font-size: var(--fs-15);
  font-weight: 600;
}
.editor-declined-copy {
  max-width: 52ch;
  line-height: 1.6;
}
.editor-declined-path {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  word-break: break-all;
}
/* F05 icon button, compact. It sits at the end of the title row because this
   dialog deliberately does not dismiss on a backdrop click. */
/* F17 inline notice, warn — the one filled box, on the one direction that
   cannot be undone. */

/* ---------- 13. resolve-open-issues batch (#339–#489) ---------- */

/* #340 — palette section header carries a result count */
.psection {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.psection-count {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface-substrate-2);
  border-radius: var(--radius-1);
  padding: 0 5px;
  letter-spacing: 0;
}

/* #343 — one-line command description under the row title */
.prow .prow-desc {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* #475 — right-aligned relative timestamp on recently-touched rows */
.prow .prow-meta {
  margin-left: auto;
  flex: none;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-faint);
}
/* keep the type badge adjacent when a meta timestamp is also present */
.prow .badge + .prow-meta {
  margin-left: var(--space-2);
}

/* #489 — unread badge on the top-bar bell.
   Neutral-dark, not red: unread counts are not failures, and red only stays
   meaningful while error states own it exclusively. */
.icon-btn-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--color-text-default);
  color: var(--color-surface-readable);
  font-size: var(--fs-11);
  font-weight: 600;
  display: grid;
  place-items: center;
  line-height: 1;
}

/* #472 — real homepage workspace-card grid, draft-style flip cards */
/* Three across, fixed. Filling the row with as many as fit made the card width
   a function of the window, so the same workspace showed three fat cards or six
   thin ones depending on the monitor; three holds a card wide enough to carry a
   description before it clips. */
.homepage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}
/* One height for every card, whether or not its workspace has been measured:
   a grid row sizes to its tallest member, so a card that grew would leave dead
   space under the other two. 156px fits the back (title row, a description that
   scrolls, and the two-figure strip) and the front with two recent files; a
   longer description scrolls in the front's middle. */
.workspace-card {
  perspective: 1400px;
  height: 156px;
  border-radius: var(--radius-3);
  cursor: pointer;
}
.workspace-card:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 4px;
}
/* Files dragged in from the OS land in this workspace — the same accent ring the
   tree's folder rows use, so "you can drop here" reads the same everywhere. */
.workspace-card.is-drop-target {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 4px;
}
.pcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 560ms var(--ease-out);
}
.workspace-card.is-flipped .pcard-inner {
  transform: rotateY(180deg);
}
/* The lifted surface, defined once: the homepage's workspace cards. A card that
   sits ABOVE the page rather than on it is one treatment, so it is one rule — a
   second implementation of it is how two surfaces come to lift by different
   amounts. The selector list is the shared implementation (the same shape the
   press response uses), which is what lets each family keep its own geometry:
   the flip-card's absolute positioning below. The dark theme block further down
   carries the same selectors. Anything else that needs to lift joins these
   lists rather than restating them. */
.pcard-face {
  border-radius: var(--radius-3);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-readable);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  transition:
    box-shadow var(--dur-standard) var(--ease-out),
    border-color var(--dur-standard) var(--ease-out);
}
.workspace-card:hover .pcard-face {
  box-shadow: var(--shadow-2);
  border-color: var(--color-border-strong);
}
.pcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  padding: var(--space-4) var(--space-5);
}
.pcard-back {
  transform: rotateY(180deg);
}
.pcard-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.pcard-spacer {
  flex: 1;
}
.proj-glyph {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-2);
  display: grid;
  place-items: center;
  flex: none;
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
.pcard-name {
  margin: 0;
  font-size: var(--fs-16);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text-default);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pcard-flip {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--color-text-faint);
  flex: none;
  transition:
    color var(--dur-quick) var(--ease-out),
    background-color var(--dur-quick) var(--ease-out);
}
.pcard-flip:hover {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}
.pcard-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.pcard-meta {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
/* Issues #573/#596: card-front at-a-glance signal — description blurb + file
   count. Collapsed length is controlled in JS (a "more" button expands in
   place), so no line-clamp — the button must never be clipped away. */
.pcard-desc {
  margin: 6px 0 0;
  font-size: var(--fs-12);
  line-height: 1.45;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}
.pcard-desc-more {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-accent);
}
.pcard-desc-more:hover {
  text-decoration: underline;
}
/* The front's changeable middle. Carries no spacing of its own — the blurb,
   the recent-notes list and the empty state each bring their own top margin,
   and the footer below still pins itself to the bottom of the face. A long
   description scrolls here rather than spilling out of the 156px card. */
.pcard-body {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
}
/* Editing the description in place, where the blurb sits. */
.pcard-desc-edit {
  margin: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pcard-desc-input {
  font: inherit;
  font-size: var(--fs-12);
  line-height: 1.45;
  color: var(--color-text-default);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-2);
  padding: 6px 8px;
  min-height: 62px;
  resize: none;
  outline: none;
}
.pcard-desc-input:focus {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.pcard-desc-hint {
  font-size: 10px;
  color: var(--color-text-faint);
}
/* Renaming in place. The input replaces the heading, so it has to hold the
   heading's width without pushing the controls beside it off the row. */
.pcard-name-edit {
  min-width: 0;
  flex: 1;
}
.pcard-name-input {
  font: inherit;
  font-size: var(--fs-16);
  font-weight: 600;
  letter-spacing: -0.01em;
  width: 100%;
  color: var(--color-text-default);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-accent);
  border-radius: var(--radius-2);
  padding: 1px 6px;
  outline: none;
}
.pcard-name-error {
  font-size: var(--fs-12);
  color: var(--color-danger);
  margin-top: 2px;
}
.pcard-name-error:empty {
  display: none;
}
/* Issue #608: recent-notes fallback on description-less card fronts. */
.pcard-recent {
  margin: 6px 0 0;
  min-width: 0;
  overflow: hidden;
}
.pcard-recent-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-bottom: 3px;
}
.pcard-recent-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pcard-recent-note {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 2px 4px;
  border: 0;
  background: none;
  border-radius: var(--radius-1);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  text-align: left;
  cursor: pointer;
}
.pcard-recent-note:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.pcard-recent-note svg {
  flex: none;
  color: var(--color-text-faint);
}
.pcard-recent-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
/* Issue #629: truly-empty workspace card front — an inviting first-note state
   (one quiet line + one accent action) instead of a whitespace void. */
.pcard-empty {
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.pcard-empty-line {
  font-size: var(--fs-13);
  color: var(--color-text-faint);
}
.pcard-empty-write {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 0;
  background: none;
  border-radius: var(--radius-1);
  color: var(--color-accent);
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
  margin-left: -4px;
}
.pcard-empty-write:hover {
  background: var(--color-accent-soft);
}
.pcard-empty-write svg {
  flex: none;
}
.pcard-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.pcard-count svg {
  flex: none;
  color: var(--color-text-faint);
}
.pcard-count + .pcard-meta::before {
  content: '·';
  margin-right: var(--space-2);
  color: var(--color-text-faint);
}
/* "Restricted", last in the foot of an untrusted workspace's card: the foot's own
   separator, then the caution glyph and the word. Open bucket: it leads to
   Settings, so a press tints. */
.pcard-restricted {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-warn);
}
.pcard-restricted::before {
  content: '·';
  margin-right: calc(var(--space-2) - 4px);
  font-weight: 400;
  color: var(--color-text-faint);
}
.pcard-restricted svg {
  flex: none;
}
.pcard-restricted:hover .pcard-restricted-text {
  text-decoration: underline;
}
/* The run pill — the enrichment run's readout in the tree's footer: how far it
   has got, or that it is waiting on a person. Pushed to the end of the footer so
   it reads as the row's one affordance rather than a third statistic. The tone
   classes below carry the state; the base is only the shape. */
.tree-enrich {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 8px;
  border: var(--border-thin) solid var(--color-warn-dot);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-warn);
  font: inherit;
  font-size: var(--fs-12);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--dur-quick) var(--ease-out),
    color var(--dur-quick) var(--ease-out);
}
.tree-enrich:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-warn);
}
/* The pill's faces. It is a RUN READOUT: the progress while a run works, and the
   review or pause it waits at. */
/* Working: the app's own accent, not the warn tone — this is not a problem
   being reported, it is a thing being done. */
.tree-enrich--running {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
/* Waiting on a person: the same accent, filled, because it is now a request
   rather than a status. */
.tree-enrich--review {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
/* A count a menu item measured when it opened. Right-aligned so several items
   with counts line up rather than each ending wherever its label does. */
.ctx-item-count {
  margin-left: auto;
  padding-left: var(--space-3);
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}
.pcard-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
  /* The card is a fixed height and the back face fills it, so this is the one
     part that can be asked for more room than exists. The heights above are set
     so it never is — this is the backstop for a font or a locale that measures
     wider than the box was fitted to. It scrolls in the space it has rather
     than silently losing its last rows: `min-height: 0` is what lets a flex
     child shrink below its content at all, and the horizontal axis stays
     clipped so long paths keep ellipsizing instead of growing a second
     scrollbar. */
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
/* F19 stat strip — measured figures read across rather than down: a figure
   over its heading, under a hairline that separates measurement from the
   standing facts above it.
   Each column is its own ellipsizing box, so a wider figure shortens its own
   heading and never pushes a neighbour out of its container.

   Named for the job rather than for the workspace card it was first drawn on,
   because a profile's two figures are the same job at a different width. How
   many columns is the only thing a consumer sets. */
.stat-strip {
  --stat-cols: 3;
  display: grid;
  grid-template-columns: repeat(var(--stat-cols), minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-1);
  padding-top: var(--space-2);
  border-top: var(--border-thin) solid var(--color-border-default);
}
.stat-strip-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.stat-strip-value {
  font-size: var(--fs-15);
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-default);
}
.stat-strip-label {
  font-size: var(--fs-11);
  line-height: 1.25;
  color: var(--color-text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (prefers-reduced-motion: reduce) {
  .pcard-inner {
    transition: none;
    transform: none !important;
  }
  .pcard-back {
    transform: none;
    visibility: hidden;
  }
  .workspace-card.is-flipped .pcard-back {
    visibility: visible;
  }
  .workspace-card.is-flipped .pcard-front {
    visibility: hidden;
  }
}

/* ---------- 14. resolve-open-issues follow-up (#490–#492) ---------- */

/* #492 — capability rows with human-readable descriptions + risk legend */
.mp-caps {
  flex-direction: column;
  align-items: stretch;
}
.mp-cap-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  width: 100%;
}
.mp-cap-row .mp-cap {
  flex: none;
  align-self: flex-start;
}
.mp-cap-desc {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  line-height: 1.45;
}
.mp-cap-legend {
  width: 100%;
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  line-height: 1.45;
  margin-top: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: rgba(240, 145, 138, 0.1);
  border: var(--border-thin) solid rgba(240, 145, 138, 0.3);
  border-radius: var(--radius-2);
}

/* #490 — Install affordance + capability-consent preview (side panel) */
/* F04 button — the detail rail's full-width actions. Install is the page's one
   accent. `.mp-grant-btn` is the quiet variant, because opening an
   explanation is not the same act as running something. */
.mp-install-btn,
.mp-download-btn,
.mp-grant-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--row-pad) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid transparent;
  background: var(--btn-accent-bg);
  color: var(--btn-accent-text);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
}
/* The creation page's one action card (F10 content): Install or the installed
   state, Try it out, a rule, then the rating. Its children are full width. */
.mp-action-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  padding: var(--space-4);
}
.mp-action-rule {
  height: 0;
  border-top: var(--border-thin) solid var(--color-border-default);
  margin: var(--space-2) 0;
}
/* The installed card and the rating are parts of the action card, not boxes of their own. */
.mp-action-card .pi-install {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
/* Try it out is the F04 secondary: transparent, hairline, default ink, glyph muted. */
.mp-try-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--row-pad) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
}
.mp-try-btn svg {
  color: var(--color-text-muted);
}
.mp-try-btn:hover {
  background: var(--color-surface-hover);
}
/* Add to library on the website, under Download: 32px tall, the card's own surface
   with the strong hairline, so Download is the one accent there. The same button the
   desktop draws in the accent, so it wears the install class and this modifier. Press
   bucket: commit, so it dips. */
.mp-install-btn--quiet {
  box-sizing: border-box;
  height: 32px;
  padding: 0 var(--space-3);
  border: var(--border-thin) solid var(--color-border-strong);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  text-decoration: none;
}
/* On the website Download leads in the accent button, a link, and Add to
   library follows in the quiet one. A link, so it resets the anchor's underline. */
a.mp-download-btn {
  box-sizing: border-box;
  text-decoration: none;
}
/* A saved creation's bookmark is filled; the outline alone is not saved. */
.mp-save-btn.is-saved svg {
  fill: currentColor;
}
.mp-install-btn.mp-install-btn--quiet:hover {
  background: var(--color-surface-hover);
  filter: none;
}
.mp-install-btn--quiet:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}
/* A line of the card's own words: the website's install lines and "installed
   elsewhere". UI font, not the mono face the hint lines used. */
.mp-card-note {
  font-size: var(--fs-12);
  line-height: 1.4;
  color: var(--color-text-muted);
}
.mp-grant-btn {
  margin-bottom: var(--space-3);
  background: var(--color-surface-substrate);
  border-color: var(--color-border-default);
  color: var(--color-text-muted);
  font-weight: 500;
}
.mp-grant-btn:hover {
  background: var(--color-surface-substrate-2);
  color: var(--color-text-default);
}
.mp-install-btn:hover,
.mp-download-btn:hover {
  filter: brightness(1.06);
}
.mp-consent-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-weight: 600;
  font-size: var(--fs-13);
  color: var(--color-text-default);
}
.mp-consent-warn {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-danger);
  background: rgba(240, 145, 138, 0.12);
  border-radius: var(--radius-2);
  padding: var(--space-2) var(--space-3);
}
.mp-consent-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mp-consent-cap {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.mp-consent-cancel {
  box-sizing: border-box;
  width: 100%;
  min-height: 32px;
  padding: var(--row-pad) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
}
.mp-consent-cancel:hover {
  border-color: var(--color-accent);
  color: var(--color-text-default);
}

/* A pack's page and its one consent sheet. "In this pack" is a group label (F15)
   over one white list, a row per item: the kind's glyph, the name and kind, the
   one-line description and a chevron that turns down while the row is open, its
   overview then showing under it inset past the glyph. The sheet gives each item
   a head, its name and a token chip for its kind, over the consent sheet's own
   rows, one item after another under a hairline. */
.mp-pack-list {
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  background: var(--color-surface-readable);
  overflow: hidden;
}
.mp-pack-row + .mp-pack-row {
  border-top: var(--border-thin) solid var(--color-border-default);
}
.mp-pack-row-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 0;
  background: transparent;
  color: var(--color-text-default);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mp-pack-row-head:hover {
  background: var(--color-surface-hover);
}
/* an item the registry does not list is one quiet line that opens nothing */
.mp-pack-row--gone > .mp-pack-row-head {
  cursor: default;
}
.mp-pack-row--gone > .mp-pack-row-head:hover {
  background: transparent;
}
.mp-pack-row-head > .icon:first-child {
  flex: none;
  color: var(--color-accent);
}
.mp-pack-row-head > .icon:last-child {
  flex: none;
  color: var(--color-text-faint);
}
.mp-pack-row.is-open > .mp-pack-row-head > .icon:last-child {
  transform: rotate(90deg);
}
.mp-pack-row-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mp-pack-row-name {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
.mp-pack-row-kind {
  font-weight: 400;
  color: var(--color-text-muted);
}
.mp-pack-row-desc {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-pack-more {
  padding: var(--space-1) var(--space-4) var(--space-3) calc(var(--space-4) + 16px + var(--space-3));
}
.mp-pack-more .mp-longdesc {
  font-size: var(--fs-13);
  margin-bottom: var(--space-3);
}
.mp-pack-more .mp-example {
  margin-bottom: var(--space-2);
}
.mp-pack-link {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-accent-strong);
  cursor: pointer;
}
.mp-pack-link:hover {
  text-decoration: underline;
}
.mp-pack-sheet {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mp-pack-sheet-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: var(--border-thin) solid var(--color-border-default);
}
.mp-pack-sheet-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.mp-pack-sheet-name {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
.mp-pack-sheet .mp-cap {
  white-space: nowrap;
}
.mp-pack-sheet .mp-install-btn:disabled {
  opacity: 0.5;
  cursor: default;
  filter: none;
}

/* marketplace.md M2/M3/M5/M6 — registry status banner, kill-list notice,
   update/uninstall affordances (real app only). */
.mp-banner {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  font-size: var(--fs-12);
}
.mp-banner--warn {
  background: rgba(224, 178, 94, 0.1);
  border-color: rgba(224, 178, 94, 0.5);
}
.mp-banner--error {
  background: rgba(240, 145, 138, 0.12);
  border-color: rgba(240, 145, 138, 0.55);
}
.mp-banner-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--color-text-default);
}
.mp-banner-detail {
  color: var(--color-text-muted);
  line-height: 1.45;
}
.mp-kill-id {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-text-default);
}
.mp-kill-guidance {
  margin-top: 2px;
}
/* Moderation policy — the standing footer under the browse list, the
   contextual link inside a takedown notice, and the sub-route both open.
   The footer's sentence is load-bearing on its own: it states the scan's
   limits to everyone who scrolls, whether or not they open the page. */
.mp-policy-foot {
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: var(--border-thin) solid var(--color-border-default);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  line-height: 1.5;
}
/* On Discover the standing line and the wiring note are the surface's FOOT,
   not the end of whatever list happens to be above them. A lane with nothing
   in it yet left them stranded a third of the way down an empty page, reading
   as content rather than as the bottom of the surface.

   So the pane fills the surface's height and the footer takes up the slack
   above it: with little on the page it sits on the bottom edge, and with
   enough items it is pushed below the fold to the foot of the scroll, which is
   the same place — the bottom of everything there is. `auto` on the FIRST of
   the two, because the wiring note follows it and the pair has to travel
   together. */
.surface-pane[data-route='discover'] {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.surface-pane[data-route='discover'] .mp-policy-foot {
  margin-top: auto;
}
/* Both entry points are the same control in two settings, so they share a
   look: an inline text button, never a bordered one — neither sits in a
   position where a button shape would read as the primary action. */
.mp-policy-link,
.mp-banner-link {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-accent-strong);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
}
.mp-banner-link {
  align-self: flex-start;
  margin-top: var(--space-1);
  font-size: var(--fs-12);
}
.mp-policy-link:hover,
.mp-banner-link:hover {
  text-decoration: underline;
}
.mp-policy {
  max-width: 62ch;
}
.mp-policy-lede {
  font-size: var(--fs-14);
  color: var(--color-text-default);
  line-height: 1.6;
  margin: 0 0 var(--space-4);
}
.mp-policy-head {
  font-size: var(--fs-12);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin: var(--space-5) 0 var(--space-2);
}
.mp-policy-list {
  margin: 0;
  padding-left: var(--space-4);
}
.mp-policy-list li {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  line-height: 1.7;
}
/* The class recorded against the item, printed beside the ground it belongs
   to. Showing it is what makes the page checkable rather than merely trusted:
   a user who sees a reason in a takedown notice can find that exact word here.
   Its treatment comes from the capability-token declaration, which does the same
   job on the same panel — an inline machine word set beside prose — so the two
   are one family and share one rule. */
.mp-policy-class {
  margin-left: var(--space-2);
}
.mp-policy-body {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
}
.mp-policy-address {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--color-accent-strong);
}
.mp-policy-note {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-substrate-2);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.mp-policy-note svg {
  flex: none;
  margin-top: 2px;
  color: var(--color-text-faint);
}
/* --- Publish requirements (MP4/06) ---------------------------------------
   The two requirements beyond the harm scan. Families, named: the Yes/No answer
   and the service tokens are F06 (toggle and token, on the .mp-sort and
   .mp-authorchip recipes); the service entry is an F13 wrapper field, so the
   wrapper owns the border and takes the ring via :focus-within; the attestation
   is an F14 checkbox at the 16px standard; the licence options are single-select
   rows with an F14-geometry radio, deliberately round where the checkbox above
   them is square; Publish and Save draft are F04 primary and secondary; the
   blocker list is an F17 danger notice and the scan line reuses .mp-policy-note,
   the neutral one. Nothing here invents a token. The entry control in the
   filter row is F04 secondary, compact. */
.mp-publish-open,
.mp-yours-open {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
}
.mp-publish-open:hover,
.mp-yours-open:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}
.mp-publish-open .icon,
.mp-yours-open .icon,
.lib-saved-btn.lib-new-item .icon {
  color: var(--color-text-muted);
}
.mp-publish-open:focus-visible,
.mp-yours-open:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
.mp-publish {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 600px;
}
.mp-publish-item {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.mp-publish-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mp-publish-label {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
.mp-publish-help {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-top: calc(-1 * var(--space-1));
}
.mp-publish-answers {
  display: flex;
  gap: var(--space-2);
}
/* F06 toggle, on the .mp-sort recipe. */
.mp-publish-chip {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-substrate);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
}
.mp-publish-chip:hover {
  border-color: var(--color-accent);
  color: var(--color-text-default);
}
.mp-publish-chip.is-active {
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  border-color: var(--color-accent);
}
/* F13 wrapper field: the wrapper draws the boundary, the input inside is bare. */
.mp-publish-field {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-height: 32px;
  padding: var(--row-pad) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-readable);
}
.mp-publish-field:focus-within {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.mp-publish-input {
  flex: 1 1 120px;
  min-width: 120px;
  border: 0;
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-13);
  outline: none;
}
.mp-publish-input::placeholder {
  color: var(--color-text-faint);
}
/* F06 token, on the .mp-authorchip recipe. */
.mp-publish-token {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex: none;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font-size: var(--fs-11);
  font-weight: 600;
}
.mp-publish-token-clear {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: var(--fs-12);
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}
.mp-publish-token-clear:hover {
  opacity: 1;
}
/* F14 checkbox at the 16px standard, with its statement as the label. */
.mp-publish-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-substrate);
  text-align: left;
  cursor: pointer;
}
.mp-publish-check:hover {
  border-color: var(--color-accent);
}
.mp-publish-check.is-on {
  border-color: var(--color-accent);
}
.mp-publish-box {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-1);
  flex: none;
}
.mp-publish-box.is-checked {
  background: var(--btn-accent-bg);
  border-color: var(--btn-accent-bg);
  color: var(--btn-accent-text);
}
.mp-publish-check-label {
  font-size: var(--fs-13);
  color: var(--color-text-default);
  line-height: 1.5;
}
.mp-publish-licence {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mp-publish-licopt {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-substrate);
  text-align: left;
  cursor: pointer;
}
.mp-publish-licopt:hover {
  border-color: var(--color-accent);
}
.mp-publish-licopt.is-selected {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}
/* Round where the attestation's box is square: the shape is the only thing
   separating "pick exactly one" from "tick if true" at a glance. */
.mp-publish-radio {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  flex: none;
}
.mp-publish-radio.is-checked {
  border-color: var(--btn-accent-bg);
  border-width: 5px;
}
.mp-publish-licbody {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mp-publish-licname {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
.mp-publish-licsummary {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.mp-publish-actions {
  display: flex;
  gap: var(--space-2);
}
/* F04 primary. */
.mp-publish-go {
  padding: var(--row-pad) var(--space-4);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid transparent;
  background: var(--btn-accent-bg);
  color: var(--btn-accent-text);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
}
.mp-publish-go:disabled {
  opacity: 0.5;
  cursor: default;
}
/* F04 secondary. */
.mp-publish-draft-btn {
  padding: var(--row-pad) var(--space-4);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
}
.mp-publish-draft-btn:hover {
  border-color: var(--color-accent);
}
/* --- Blocked version, the author's view ----------------------------------
   Families, named: the headline is an F17 inline notice on the danger tier; the
   findings are F03 key/value rows inside an F09 panel under an F15 group label;
   the history badges are F07 badges in the three status tiers; the two actions
   are F04 secondary buttons, and the entry control in the filter row is F04
   ghost, compact. The neutral note reuses .mp-policy-note. No new token. */
.mp-blocked-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  max-width: 600px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-danger-soft-2);
  background: var(--color-danger-soft);
  color: var(--color-danger);
}
.mp-blocked-notice svg {
  flex: none;
  margin-top: 2px;
}
.mp-blocked-headline {
  font-size: var(--fs-13);
  line-height: 1.5;
}
.mp-blocked-panel {
  max-width: 600px;
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-readable);
}
.mp-blocked-sec {
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}
.mp-blocked-kvs {
  margin: 0 0 var(--space-3);
}
.mp-blocked-kvs:last-of-type {
  margin-bottom: 0;
}
.mp-blocked-kv {
  display: flex;
  gap: var(--space-3);
  padding: var(--row-pad) 0;
  font-size: var(--fs-13);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.mp-blocked-kv:last-child {
  border-bottom: 0;
}
.mp-blocked-kv dt {
  flex: none;
  width: 108px;
  color: var(--color-text-muted);
}
.mp-blocked-kv dd {
  margin: 0;
  color: var(--color-text-default);
}
.mp-blocked-mono {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
}
.mp-blocked-acts {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.mp-blocked-act {
  padding: var(--row-pad) var(--space-4);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
}
.mp-blocked-act:hover {
  border-color: var(--color-accent);
}
.mp-blocked-history {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--fs-13);
}
.mp-blocked-histrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.mp-blocked-badge {
  flex: none;
  min-width: 76px;
  text-align: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--fs-11);
  font-weight: 600;
}
.mp-blocked-badge--blocked {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}
.mp-blocked-badge--live {
  background: var(--color-success-soft);
  color: var(--color-success);
}
.mp-blocked-badge--superseded {
  background: var(--color-surface-substrate-2);
  color: var(--color-text-muted);
}
.mp-blocked-date {
  margin-left: auto;
  color: var(--color-text-faint);
  font-size: var(--fs-12);
}
.mp-blocked-badge--checking {
  background: var(--color-surface-substrate);
  color: var(--color-text-muted);
}
.mp-blocked-badge--held {
  background: var(--color-warn-soft);
  color: var(--color-warn);
}
.mp-blocked-badge--pulled {
  background: var(--color-surface-substrate-2);
  color: var(--color-text-muted);
}
/* --- Publishing and Your creations (AW57) --------------------------------
   Families, named: what is being published is an F09 white panel (.pi-card); the
   states are F17 inline notices in four tones (.pi-notice); the limits are an F03
   key/value panel (.pi-kv); each creation is a white F09 row (.pi-row); the
   buttons are F04, white and compact (.pi-btn) with one accent (.pi-btn--primary).
   The questions keep the shipped .mp-publish-* controls, with their fields made
   white inside .pi-white (AW55 D17). No new token. */
.pi-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-1);
}
.pi-card-name {
  font-size: var(--fs-15);
  font-weight: 600;
  color: var(--color-text-default);
}
.pi-card-id {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.pi-card-meta {
  margin-top: var(--space-1);
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.pi-white .mp-publish-field,
.pi-white .mp-publish-check,
.pi-white .mp-publish-licopt {
  background: var(--color-surface-readable);
}
.pi-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.pi-dim {
  opacity: 0.45;
  pointer-events: none;
}
.pi-hint {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.pi-note {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.pi-fine {
  margin-top: var(--space-2);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.pi-gap {
  margin-top: var(--space-4);
}
.pi-gap-below {
  margin-bottom: var(--space-4);
}
/* The drop zone on the website's publish page: an F09 white panel with a dashed edge
   (the dashed edge says "put something here"), and a .pi-btn inside it. */
.pi-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  max-width: 600px;
  padding: var(--space-7) var(--space-5);
  background: var(--color-surface-readable);
  border: var(--border-thin) dashed var(--color-border-strong);
  border-radius: var(--radius-3);
  text-align: center;
}
.pi-drop.is-over {
  border-color: var(--color-accent);
}
.pi-drop-title {
  font-size: var(--fs-15);
  font-weight: 600;
  color: var(--color-text-default);
}
.pi-drop-or {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.pi-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  max-width: 600px;
  padding: var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font-size: var(--fs-13);
}
.pi-notice b {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
}
.pi-sub {
  color: var(--color-text-muted);
}
.pi-notice-act {
  margin-top: var(--space-2);
}
.pi-notice--ok {
  background: var(--color-success-soft);
  border-color: var(--color-success-soft-2);
}
.pi-notice--ok b {
  color: var(--color-success);
}
.pi-notice--warn {
  background: var(--color-warn-soft);
  border-color: var(--color-warn-soft-2);
}
.pi-notice--bad {
  background: var(--color-danger-soft);
  border-color: var(--color-danger-soft-2);
}
.pi-notice--bad b {
  color: var(--color-danger);
}
.pi-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--color-text-faint);
}
.pi-dot--ok {
  background: var(--color-success);
}
.pi-dot--warn {
  background: var(--color-warn);
}
.pi-dot--bad {
  background: var(--color-danger);
}
.pi-btn {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
}
.pi-btn:hover {
  border-color: var(--color-accent);
}
/* Under a notice in the creation pane (a flex column): clear of the box, and as wide as its label. */
.mp-blocked-found {
  align-self: flex-start;
  margin-top: var(--space-3);
}
.pi-btn--primary {
  padding: var(--space-2) var(--space-4);
  border-color: transparent;
  background: var(--btn-accent-bg);
  color: var(--btn-accent-text);
  font-size: var(--fs-13);
}
.pi-btn--primary:hover {
  border-color: transparent;
}

/* The creation page's install card on the desktop: installed, update available,
   updates paused. One accent at most (the update); Uninstall is a white button. */
.pi-install {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-1);
}
.pi-install-title {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
.pi-install-sub {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.pi-install-acts {
  display: flex;
  gap: var(--space-2);
}

/* The computers a creation can be sent to: a radio list inside the dialog. */
.pi-devs {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.pi-dev {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  font-size: var(--fs-13);
  cursor: pointer;
}
.pi-dev.on {
  border-color: var(--color-accent);
}
.pi-dev .s {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--fs-12);
}
.pi-dev-name {
  font-weight: 600;
}
.pi-dev .r {
  flex: none;
  width: var(--space-3);
  height: var(--space-3);
  border-radius: 999px;
  border: var(--border-thin) solid var(--color-border-strong);
}
.pi-dev.on .r {
  border: var(--space-1) solid var(--color-accent);
}
.pi-limits {
  max-width: 600px;
  margin-bottom: var(--space-4);
}
.pi-prog {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 600px;
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
}
.pi-prog-line {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--fs-13);
}
.pi-prog-line span + span {
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.pi-meter {
  height: 4px;
  margin-top: var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--color-border-default);
  overflow: hidden;
}
.pi-meter i {
  display: block;
  height: 100%;
  background: var(--color-text-faint);
}
.pi-prog-hint {
  margin-top: var(--space-1);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
.pi-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2) var(--space-5);
  margin: 0;
  padding: var(--space-4);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  font-size: var(--fs-13);
}
.pi-kv dt {
  color: var(--color-text-muted);
}
.pi-kv dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.pi-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 600px;
}
.pi-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  color: var(--color-text-default);
  font-size: var(--fs-13);
  text-align: left;
  cursor: pointer;
}
.pi-row:hover {
  border-color: var(--color-accent);
}
.pi-n {
  font-weight: 600;
}
.pi-id {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.pi-m {
  margin-left: auto;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.pi-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.pi-h {
  font-size: var(--fs-18);
  font-weight: 600;
}
.pi-acts {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.pi-cap {
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pi-hist {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 600px;
  margin-top: var(--space-3);
  font-size: var(--fs-13);
}
.pi-histrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.pi-mono {
  font-family: var(--font-mono);
}
.pi-when {
  margin-left: auto;
  color: var(--color-text-faint);
  font-size: var(--fs-12);
}
.mp-uninstall-btn {
  align-self: flex-start;
  padding: 4px var(--space-2);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: transparent;
  color: var(--color-danger);
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
}
.mp-uninstall-btn:hover {
  border-color: var(--color-danger);
  filter: brightness(1.05);
}

/* #491 — onboarding per-step primary CTAs */
.onb-cta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.onb-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--row-pad) var(--space-4);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid transparent;
  background: var(--btn-accent-bg);
  color: var(--btn-accent-text);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
}
.onb-cta:hover {
  filter: brightness(1.06);
}
.onb-cta.is-disabled,
.onb-cta:disabled {
  background: var(--color-surface-substrate-2);
  color: var(--color-text-faint);
  border-color: var(--color-border-default);
  cursor: not-allowed;
  filter: none;
}
.onb-cta-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.22);
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  line-height: 1;
}
.onb-cta-icon {
  display: inline-flex;
}
.onb-cta-receipt {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  line-height: 1.45;
}

/* ===========================================================================
   15. impeccable-audit quick-wins (accessibility + reading-view fidelity)
   See .claude/skills/ux-walkthrough/ui-improvements-audit.md.
   =========================================================================== */

/* §6.1 — GFM task-list items render as real checkboxes in the reading view,
   instead of leaking raw `[x]` / `[ ]` tokens (parity with the chipped
   frontmatter strip). State is read-only; clicking still enters in-place edit. */
.prose li.task-item {
  list-style: none;
  margin-left: -1.15em;
  display: flex;
  align-items: baseline;
  gap: 0.5em;
}
.prose .task-check {
  flex: none;
  width: 15px;
  height: 15px;
  transform: translateY(2px);
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-1);
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  color: transparent;
}
.prose .task-check.is-checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--btn-accent-text);
}
.prose li.task-item.is-done .task-label {
  color: var(--color-text-faint);
  text-decoration: line-through;
}

/* §2.3 — visible keyboard-focus ring on the custom controls that previously
   styled only :hover. Additive — controls with their own focus-visible rule
   (task selects, workspace cards) keep theirs. Reuses the palette's accent. */
.brand:focus-visible,
.mp-risk-btn:focus-visible,
.route-btn:focus-visible,
.icon-btn:focus-visible,
.avatar-btn:focus-visible,
.nav-fold:focus-visible,
.tree-item:focus-visible,
.tree-folder-row:focus-visible,
.t-chevron-btn:focus-visible,
.t-name-link:focus-visible,
.seg-btn:focus-visible,
.tree-act:focus-visible,
.tree-ctl-btn:focus-visible,
.tree-search-mode:focus-visible,
.tree-result-file:focus-visible,
.tree-result-snippet:focus-visible,
.ctx-item:focus-visible,
.prow:focus-visible,
.pempty-fallback:focus-visible,
.fo-callout-close:focus-visible,
.insp-tabs button:focus-visible,
.chat-toggle-btn:focus-visible,
.chat-full-btn:focus-visible,
.chat-min-btn:focus-visible,
.notif-action:focus-visible,
.fmenu-row:focus-visible,
.tree-foot:focus-visible,
.notif-filter-pill:focus-visible,
.notif-filter-btn:focus-visible,
.notif-feed-link:focus-visible,
.tree-ctl-more:focus-visible,
.mp-sort:focus-visible,
.mp-refresh:focus-visible,
.mp-card:focus-visible,
.mp-back:focus-visible,
.mp-policy-link:focus-visible,
.mp-banner-link:focus-visible,
.mp-fork-btn:focus-visible,
.mp-install-btn:focus-visible,
.mp-download-btn:focus-visible,
.mp-try-btn:focus-visible,
.mp-consent-cancel:focus-visible,
.task-card:focus-visible,
.settings-nav-item:focus-visible,
.sp-acct-item:focus-visible,
.settings-search-clear:focus-visible,
.settings-retrieval-enrich-btn:focus-visible,
.onb-cat:focus-visible,
.onb-aff:focus-visible,
.onb-cta:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
/* The sidebar's rows run flush to the window's edge, where a ring drawn
   outside them is cut off, so theirs is drawn inside. And the ROW draws it,
   trailing chevron and toggle included, rather than the open button within it,
   whose ring stopped short of them: the row owns its states. */
.nav-sidebar .nav-row:focus-visible,
.nav-row--sub:has(> .nav-row-open:focus-visible),
.nav-row--head:has(> .nav-row-open:focus-visible) {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: -2px;
}
.nav-row-open:focus-visible {
  outline: none;
}

/* §7 — honour prefers-reduced-motion globally. Users who ask for less motion
   get near-instant state changes instead of slides/flips/transitions. The
   scoped flip-card rule (§13) still handles the back-face visibility swap. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Issue #604: in-UI dialogs (styled confirm/prompt/alert) ---------- */
/* Real DOM overlays replacing native window.confirm()/prompt()/alert() — styled,
   validating, and scriptable (native dialogs are invisible to automation). */
.srf-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--color-bg) 55%, transparent);
  backdrop-filter: blur(2px);
  padding: var(--space-5);
}
.srf-dialog {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-3);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
/* The soft frame (`confirmDialog({ soft: true })`): a faint lift over a light
   scrim with no blur, so the surface the question is about stays readable
   behind it. */
.srf-dialog-backdrop--soft {
  background: color-mix(in srgb, var(--color-bg) 35%, transparent);
  backdrop-filter: none;
}
.srf-dialog--soft {
  box-shadow: var(--shadow-soft);
}
.srf-dialog-title {
  font-size: var(--fs-15, var(--fs-13));
  font-weight: 600;
  color: var(--color-text-default);
}
/* A title that carries a mark puts it on the text's own baseline rather than
   above it: the mark identifies what the dialog is about, so it reads as part
   of the title rather than as an icon introducing one. Muted ink, because the
   words are what the reader is here for. */
.srf-dialog-title--marked {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.srf-dialog-title-mark {
  display: inline-flex;
  flex: none;
  color: var(--color-text-muted);
}
/* F17 inline notice, warn severity — a fact about what the confirm is about to
   do, weighed before agreeing. Not danger: danger is for an act that destroys
   something, and this dialog's own primary button carries that when it applies.
   On the -soft token pair rather than a computed tint, which is what keeps the
   text at a readable contrast on both themes. */
.srf-dialog-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: var(--border-thin) solid var(--color-warn-soft-2);
  border-radius: var(--radius-2);
  background: var(--color-warn-soft);
  color: var(--color-warn);
  font-size: var(--fs-12);
  line-height: 1.45;
}
.srf-dialog-notice-icon {
  display: flex;
  flex: none;
  /* Sits on the first line of the text beside it rather than centred against a
     block that may wrap to three. */
  margin-top: 1px;
}
.srf-dialog-body {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
  /* Newlines in a message render as line breaks — an outcome report that has
     to explain skipped files needs more than one paragraph. Runs of spaces
     still collapse, so ordinary single-line messages are unaffected. */
  white-space: pre-line;
}
/* The address a dialog's question is about, under its body: one mono line, its
   middle cut where it is too long, the whole of it on hover. */
.srf-dialog-url {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
/* The exact words behind a plain-language failure, for whoever needs them. */
.srf-dialog-detail {
  overflow-wrap: anywhere;
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.srf-dialog-input {
  font: inherit;
  font-size: var(--fs-13);
  color: var(--color-text-default);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-2);
  padding: var(--row-pad) var(--space-3);
  outline: none;
}
.srf-dialog-input:focus {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
/* Label for a dialog's optional second field. Sits tight above its input so the
   pair reads as one thing, which the dialog's own row gap would otherwise
   undo. */
.srf-dialog-sublabel {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  margin-bottom: calc(-1 * var(--space-2));
}
.srf-dialog-input--multiline {
  min-height: 72px;
  line-height: 1.5;
  resize: vertical;
}
/* The format slot: an F25 segmented control (--lg) naming what is about to be
   created. A track rather than a dropdown because the whole roster is three
   items wide and fits the card — a select would hide two of the three answers
   behind a click, which is the thing the picker exists to stop. */
.srf-dialog-formats {
  align-self: flex-start;
}
/* The filename the dialog would actually create. It is the one place the
   typed name and the chosen format are resolved into a single answer, so it
   stays visible even when they disagree. */
.srf-dialog-preview {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  margin-top: calc(-1 * var(--space-1));
  overflow-wrap: anywhere;
}
.srf-dialog-preview.is-empty {
  display: none;
}
.srf-dialog-error {
  color: var(--color-danger);
  font-size: var(--fs-12);
}
.srf-dialog-error:empty {
  display: none;
}
.srf-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-1);
}
.srf-dialog-btn {
  padding: var(--row-pad) var(--space-4);
  border-radius: var(--radius-2);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-readable);
  color: var(--color-text-muted);
}
.srf-dialog-btn:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.srf-dialog-btn--primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--btn-accent-text);
}
/* The filled variants restate their fill on hover: the base hover above
   outranks the variant class and would otherwise grey them. */
.srf-dialog-btn--primary:hover {
  opacity: 0.9;
  background: var(--color-accent);
  color: var(--btn-accent-text);
}
.srf-dialog-btn--danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: var(--btn-accent-text);
}
.srf-dialog-btn--danger:hover {
  opacity: 0.9;
  background: var(--color-danger);
  color: var(--btn-accent-text);
}
.srf-dialog-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
/* A dialog's list of ticks: one F14 box and a name per row, the whole row the
   control. Uninstalling a pack lists its items this way, ticked to go. */
.srf-dialog-checks {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.srf-dialog-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  border: 0;
  background: transparent;
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-13);
  text-align: left;
  cursor: pointer;
}
.srf-dialog-check:hover .fmenu-box {
  border-color: var(--color-accent);
}
.srf-dialog-check:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
/* A destructive way out that is a word rather than a button: F23's text link in
   the danger colour, at the dialog's own type size, with no padding box. It
   leads the actions row and takes the free space after it, so Cancel and the
   confirm button stay together at the far end. */
.srf-dialog-actions .srf-dialog-link--danger {
  margin-right: auto;
}
.srf-dialog-link--danger {
  padding: 0;
  border: 0;
  background: none;
  font-size: var(--fs-13);
  font-weight: 400;
  text-align: left;
  color: var(--color-danger);
  text-decoration: underline;
  cursor: pointer;
}
.srf-dialog-link--danger:hover {
  opacity: 0.8;
}
.srf-dialog-link--danger:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}

/* What changed, the update's dialog (F11 dialog, wide): one list per kind of
   change, each a label over a bordered list of rows, the name in default ink
   and the reason muted. Static rows: nothing here is pressed but Done. */
.srf-change-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.srf-change-heading {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-text-default);
}
.srf-change-list {
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
}
.srf-change-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-13);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.srf-change-row:last-child {
  border-bottom: none;
}
.srf-change-name {
  color: var(--color-text-default);
}
.srf-change-detail {
  color: var(--color-text-muted);
}

/* AG5/07: filePickerDialog — search input + live-filtered result list.
   Reuses the .srf-dialog shell; --picker just gives the list room to breathe. */
.srf-dialog--picker {
  max-width: 480px;
}
/* F11 dialog, wide — the documented size for a dialog holding a row of scope
   chips beside a folder path, where the prose width would wrap both. */
.srf-dialog--wide {
  max-width: 520px;
}
/* F11 dialog, results — what a trial would change: the file tree beside the
   note it opens, which needs the width of a reading pane, not of a form. */
.srf-dialog--results {
  max-width: min(880px, 100%);
}

/* ---------- The two honesty components ---------- */
/* Both are shared: every fixture-backed region and every action with no backend
   reaches these, so there is one appearance for "this is an example" and one
   for "this is not built yet" across the whole app. */

/* F17 inline notice, neutral severity, banner placement — the one persistent
   statement on a fixture-backed region in the served app. Never rendered in the
   render harness, whose brand chip already says the same thing; the module
   returns null there rather than an empty box with a margin. */
.srf-fixture-notice {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0;
  padding: var(--space-2) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate-2);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  line-height: 1.4;
}
.srf-fixture-notice-icon {
  flex: 0 0 auto;
  opacity: 0.8;
}

/* F11 dialog, default size — "What this will do". The three lines from the
   decision record read as a list rather than a paragraph, because they answer
   three different questions and running them together loses which is which. */
.srf-willdo .srf-dialog-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  white-space: normal;
}
.srf-willdo-line {
  padding-left: var(--space-3);
  border-left: 2px solid var(--color-border-default);
}
/* The line the dialog appends itself. It is the statement the whole dialog
   exists to make, so it is the one thing in it that is not muted. */
.srf-willdo-flag {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate-2);
  color: var(--color-text-default);
  font-size: var(--fs-12);
  font-weight: 600;
}

/* ---------- The run list under a skill's body ---------- */
/* Two lines per row, the chevron centred across both. List density at
   --fs-12, which is the type floor for a row like this: the collapsed record
   this shape was taken from sat at 10px, below the floor, and that part of it
   is deliberately not reused. */
.skrun-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.skrun-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--row-pad) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate);
  text-align: left;
  font-family: inherit;
  color: var(--color-text-default);
}
button.skrun-row {
  cursor: pointer;
}
button.skrun-row:hover {
  border-color: var(--color-accent);
}
button.skrun-row:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
.skrun-row-chevron {
  flex: none;
  color: var(--color-text-faint);
}
.skrun-row-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.skrun-row-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
/* The message yields; the scope does not. Two runs of one skill are told
   apart by where they ran, so the folder stays pinned to the right edge and
   the message ellipsises before it. */
.skrun-row-message {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-13);
}
.skrun-row-scope {
  flex: none;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-muted);
}
.skrun-row-line--meta {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.skrun-row-skill {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-muted);
}
.skrun-row-meta {
  margin-left: auto;
  flex: none;
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
/* Status and trial markers — a badge, borrowing the status colour vocabulary
   of the topbar's presence pill without borrowing its box. The trial badge is
   deliberately NEUTRAL: violet is the agent rail's register, for the app
   acting unbidden, and a trial is the most deliberate thing a user can do. */
.skrun-badge {
  flex: none;
  padding: 1px var(--space-2);
  border-radius: var(--radius-pill);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-substrate-2);
  color: var(--color-text-muted);
  font-size: var(--fs-11);
  font-weight: 600;
}
.skrun-badge--run {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}
.skrun-badge--fail {
  background: var(--color-danger-soft);
  border-color: var(--color-danger);
  color: var(--color-danger);
}
/* An agent's history in its run tab writes its tags as words (Trial,
   Waiting, Done); the skill-run list keeps its lowercase tags. */
.chat-agent-history .skrun-badge {
  text-transform: capitalize;
}
.skrun-badge--warn {
  background: var(--color-warn-soft);
  border-color: var(--color-warn);
  color: var(--color-warn);
}
.skrun-empty {
  padding: var(--space-3);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}

/* ---------- The run page ---------- */
.skrun-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.skrun-page-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.skrun-page-scope {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-muted);
}
.skrun-cancel {
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: var(--space-1) var(--space-3);
  background: transparent;
  color: var(--color-danger);
  font-family: inherit;
  font-size: var(--fs-12);
  cursor: pointer;
}
.skrun-cancel:hover {
  border-color: var(--color-danger);
}
/* The details block — key/value rows, plus one note line naming what a count
   cannot: which files went, what was refused, which version ran. */
.skrun-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate);
}
.skrun-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--space-3);
}
.skrun-detail-key {
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
.skrun-detail-value {
  font-size: var(--fs-15, var(--fs-13));
  font-weight: 600;
  color: var(--color-text-default);
}
.skrun-detail-value--warn {
  color: var(--color-warn);
}
.skrun-detail-note {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.skrun-detail-empty {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.skrun-transcript {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
/* ---------- A trial's results: the tree, and the file beside it ---------- */
.skrun-tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.skrun-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: var(--fs-12);
  cursor: pointer;
}
.skrun-tab.is-on {
  color: var(--color-text-default);
  border-bottom-color: var(--color-agent);
  font-weight: 600;
}
.skres {
  display: flex;
  min-height: 320px;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  overflow: hidden;
}
.skres-tree {
  flex: 0 0 240px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: var(--space-2);
  border-right: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-substrate);
  overflow: auto;
}
.skres-search {
  width: 100%;
  margin-bottom: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-1);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font-family: inherit;
  font-size: var(--fs-12);
}
/* One selectable row per entry, indented by depth so the run's own hierarchy
   is what the reader sees. */
.skres-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 2px var(--space-2);
  padding-left: calc(var(--space-2) + var(--depth, 0) * var(--space-3));
  border: 0;
  border-radius: var(--radius-1);
  background: transparent;
  color: var(--color-text-default);
  font-family: inherit;
  font-size: var(--fs-12);
  text-align: left;
}
button.skres-row {
  cursor: pointer;
}
button.skres-row:hover {
  background: var(--color-surface-substrate-2);
}
.skres-row.is-selected {
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
}
.skres-row--folder {
  color: var(--color-text-muted);
}
.skres-op {
  flex: none;
  width: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-text-faint);
}
.skres-op--new {
  color: var(--color-warn);
}
.skres-op--edit {
  color: var(--color-accent);
}
.skres-op--del {
  color: var(--color-danger);
}
.skres-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skres-name--gone {
  text-decoration: line-through;
  color: var(--color-text-faint);
}
.skres-view {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.skres-vbar {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.skres-vfile {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 600;
}
/* Every entry says where a REAL run would have written it, so the result reads
   as what would have happened rather than as a tour of a scratch directory. */
.skres-vwould {
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
.skres-vcount {
  margin-left: auto;
  font-size: var(--fs-11);
  color: var(--color-text-muted);
}
/* The diff body — the shipped editor's own line states: removed a danger tint,
   added amber, both color-mix at 12%. Added is deliberately NOT accent: accent
   means "you can act on this" everywhere else, and spending it on every added
   line would drain it exactly where a reader scans fastest. */
.skres-split {
  display: flex;
  min-width: 0;
}
.skres-half {
  flex: 1 1 50%;
  min-width: 0;
  overflow: hidden;
}
.skres-half + .skres-half {
  border-left: var(--border-thin) solid var(--color-border-default);
}
.skres-side {
  padding: 2px var(--space-2);
  border-bottom: var(--border-thin) solid var(--color-border-default);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.skres-code {
  margin: 0;
  padding: var(--space-2) 0;
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  line-height: 1.5;
  overflow-x: auto;
}
.skres-line {
  display: block;
  padding: 0 var(--space-2);
  white-space: pre;
  color: var(--color-text-muted);
}
.skres-line.is-add {
  background: color-mix(in srgb, var(--color-warn) 12%, transparent);
  color: var(--color-text-default);
}
.skres-line.is-del {
  background: color-mix(in srgb, var(--color-danger) 12%, transparent);
  color: var(--color-text-default);
}
/* A line that exists on one side only: hatched on the other, so an inserted
   line is distinguishable from a shifted one. */
.skres-line.is-gap {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    color-mix(in srgb, var(--color-text-faint) 12%, transparent) 4px,
    color-mix(in srgb, var(--color-text-faint) 12%, transparent) 8px
  );
}
.skres-gutter {
  display: inline-block;
  width: 30px;
  margin-right: var(--space-2);
  text-align: right;
  color: var(--color-text-faint);
}
/* The fold band spans BOTH panes — folding per pane would desynchronise the
   gutters, which is the one thing a side-by-side reader cannot recover from. */
.skres-fold {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-1) var(--space-3);
  border: 0;
  border-top: var(--border-thin) solid var(--color-border-default);
  border-bottom: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-substrate);
  color: var(--color-text-faint);
  font-family: inherit;
  font-size: var(--fs-11);
  font-style: italic;
  cursor: pointer;
}
.skres-fold:hover {
  color: var(--color-text-muted);
}
.skres-fold-action {
  margin-left: auto;
  font-style: normal;
}
.skres-empty {
  padding: var(--space-4);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}

/* ---------- A result file, read as a document ----------
   A note that carries its data in frontmatter is mostly YAML, so shown as raw
   text it is honest and unreadable. These style the formatted reading of one:
   a sentence saying what the write does, every field as a row (the shared
   .properties-strip), and the body as prose. The raw text is one press away and
   the flip is per-file, never sticky — the same shape the editor's own mirror
   view takes. */
.skres-doc {
  padding: var(--space-4);
  overflow: auto;
  min-width: 0;
}
/* The note's body, below its fields. Prose face rather than the pane's mono,
   because this half IS prose — the fields above it are the data. */
.skres-body {
  margin-top: var(--space-4);
  font-family: var(--font-prose);
  font-size: var(--fs-15);
  line-height: 1.6;
  color: var(--color-text-default);
}
.skres-body > :first-child {
  margin-top: 0;
}
/* Raw ⇄ formatted, in the view bar. Pushed to the far end so the bar reads
   file-then-facts-then-control, matching the editor top bar's own order. */
.skres-flip {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex: none;
  background: transparent;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-1);
  padding: 1px var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--fs-11);
  color: var(--color-text-muted);
  cursor: pointer;
}
.skres-flip:hover {
  border-color: var(--color-accent);
  color: var(--color-text-default);
}
/* Which fields an edit moved — the rows above a diff. Each says the key and
   both sides, so the diff below is a place to look rather than a thing to
   decode. */
.skres-changes {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-1) var(--space-3);
  align-items: baseline;
  margin-top: var(--space-2);
}
.skres-change-key {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
.skres-change-val {
  font-size: var(--fs-12);
  color: var(--color-text-default);
  min-width: 0;
  overflow-wrap: anywhere;
}
/* A side an edit did not have: the key was added, or taken away. Italic rather
   than a dash alone, so "(none)" cannot be mistaken for a stored value. */
.skres-change-none {
  font-style: italic;
  color: var(--color-text-faint);
}

/* ---------- The skill launcher (the Run dialog) ---------- */
/* The skill's name inside the dialog title, so the title reads as one sentence
   with the subject picked out rather than as a heading plus a label. */
.skrun-title-name {
  font-family: var(--font-mono);
  color: var(--color-accent-strong);
}
/* F06 toggle chips — four exclusive scope kinds, none active on open. */
.skrun-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.skrun-chip {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-substrate);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.skrun-chip:hover {
  border-color: var(--color-accent);
  color: var(--color-text-default);
}
.skrun-chip.is-active {
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  border-color: var(--color-accent);
}
.skrun-chip:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
/* F13 field — the wrapper draws the boundary; the value and its control sit
   inside it, the same recipe the marketplace publish field uses. */
.skrun-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: var(--row-pad) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-readable);
}
.skrun-field-value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-13);
  color: var(--color-text-default);
}
.skrun-field-change {
  flex: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  font-family: inherit;
  cursor: pointer;
}
.skrun-field-change:hover {
  color: var(--color-accent-strong);
}
/* The model row holds the shipped nested picker, which brings its own trigger
   styling — the field is only the boundary around it. */
.skrun-field--model {
  justify-content: space-between;
}
.skrun-message {
  min-height: 72px;
}
/* F14 checkbox — this system has no switch, and a trial is a checkbox. */
.skrun-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-readable);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.skrun-check:hover:not(:disabled),
.skrun-check.is-on {
  border-color: var(--color-accent);
}
.skrun-check:disabled {
  cursor: default;
  opacity: 0.6;
}
.skrun-check-box {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex: none;
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-1);
  font-size: var(--fs-11);
  line-height: 1;
  color: transparent;
}
.skrun-check.is-on .skrun-check-box {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.skrun-check-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.skrun-check-label {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
.skrun-check-help {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}

/* An enrichment run's cards, in the agent panel's thread.

   There is no modal here any more: the run dialog and the proposal-review
   modal are gone, and a run is a sequence of ordinary thread messages. The
   panel is about a third of the window, so everything below is sized for that
   — one line per file, diffs closed until asked for, and a full-width editor a
   click away when a compact diff is not enough. */
.srf-runcard {
  display: flex;
  flex-direction: column;
  /* In the thread a turn aligns its children to the start, which lets a card
     take its content's width; it may not outgrow the panel, and its own
     contents shrink and wrap to fit. */
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  background: var(--color-surface-readable);
  font-size: var(--fs-13);
}
.srf-runcard--settled {
  opacity: 0.72;
}
.srf-runcard-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.srf-runcard-head--toggle {
  cursor: pointer;
  user-select: none;
}
.srf-runcard-icon {
  flex: 0 0 auto;
  color: var(--color-text-muted);
}
/* A run that is working says so by the breath in the icon's slot — the
   machine-activity signal, built by enrichment-run-cards.js — not by a word
   that has to be re-read to notice it changed. */
.srf-runcard-title {
  font-weight: 600;
  color: var(--color-text-default);
}
.srf-runcard-sub,
.srf-runcard-status {
  margin-left: auto;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.srf-runcard-chevron {
  margin-left: auto;
  color: var(--color-text-faint);
}
.srf-runcard-head--toggle .srf-runcard-sub {
  margin-left: auto;
}
.srf-runcard-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.srf-runcard-group-head {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-text-default);
}
.srf-runcard-list {
  margin: 0;
  padding-left: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.srf-runcard-item {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  line-height: 1.45;
}
.srf-runcard-cost,
.srf-runcard-note {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.srf-runcard-error {
  font-size: var(--fs-12);
  color: var(--color-danger);
}
/* Accrued spend, in the actions row beside Stop. Pushed to the far side so the
   buttons keep their position as the figure grows during a run. */
.srf-runcard-spend {
  margin-left: auto;
  font-size: var(--fs-12);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}
.srf-runcard-model {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
/* The model's button gives way to the card: its label ends in an ellipsis. */
.srf-runcard-model .chat-model-menu {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.srf-runcard-model-label {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
/* F16 progress meter — the one real meter in the app, a run card's progress
   through its files. The fill's width is set by the renderer. */
.srf-runcard-bar {
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-substrate-2);
  overflow: hidden;
}
.srf-runcard-bar-fill {
  height: 100%;
  background: var(--color-accent);
  transition: width 240ms ease-out;
}
.srf-runcard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.srf-runcard-btn {
  padding: 3px 10px;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-1, 3px);
  background: var(--color-surface-substrate);
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-12);
  cursor: pointer;
}
.srf-runcard-btn:hover {
  background: var(--color-accent-soft);
}
.srf-runcard-btn--primary {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--btn-accent-text);
}
.srf-runcard-btn--quiet {
  border-color: transparent;
  color: var(--color-text-muted);
}
/* The danger register in this family. It carries two related jobs: the armed
   press of a two-press destructive action, and a control that is destructive
   from idle and says so before it is armed (memory's Reset, which then arms by
   changing its label to name the count). Added to the family rather than as a
   one-off beside the Memory panel that needed it first, so the next
   irreversible button has it. */
.srf-runcard-btn--danger {
  border-color: var(--color-danger);
  background: var(--color-danger-soft);
  color: var(--color-danger);
}
.srf-runcard-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
/* One line per file. The whole point: thirty of these read as a list, where
   thirty expanded diffs read as a wall. */
.srf-runcard-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: 4px 0;
  border-top: var(--border-thin) solid var(--color-border-default);
}
.srf-runcard-row-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.srf-runcard-row-name {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: var(--fs-12);
  color: var(--color-accent);
  cursor: pointer;
  text-align: left;
}
.srf-runcard-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.srf-runcard-row--stale .srf-runcard-row-name {
  color: var(--color-text-muted);
}
.srf-runcard-row-stale {
  font-size: var(--fs-11);
  color: var(--color-warn);
}
.srf-runcard-diff {
  margin: 0;
  padding: var(--space-2);
  max-height: 220px;
  overflow: auto;
  border-radius: var(--radius-1, 3px);
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  line-height: 1.4;
  white-space: pre;
}
.srf-runcard-fact {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.srf-runcard-fact-val {
  font-weight: 600;
  color: var(--color-text-default);
}
.srf-runcard-fact-key {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}

/* folderPickerDialog — the import destination browser. Reuses the .srf-dialog
   shell and adds a breadcrumb bar, grouped rows, and the split row: a body that
   picks the folder and a chevron that opens it.

   Rows are 36px so the chevron can occupy a 36x36 hit area. A chevron sized to
   its own glyph is roughly 8x11px, which is below every touch-target guideline
   and is missed often enough to be worth the extra 4px of row height. */
.srf-dialog--folders {
  max-width: 520px;
}
.srf-folder-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  min-height: 20px;
}
.srf-folder-crumbs__sep {
  color: var(--color-text-faint);
  padding: 0 1px;
}
.srf-folder-crumbs__step {
  background: none;
  border: none;
  padding: 2px 4px;
  border-radius: var(--radius-1, 3px);
  font: inherit;
  color: var(--color-accent);
  cursor: pointer;
}
.srf-folder-crumbs__step:hover {
  background: var(--color-accent-soft);
}
.srf-folder-crumbs__here {
  padding: 2px 4px;
  font-weight: 600;
  color: var(--color-text-default);
}
.srf-folder-list {
  max-height: 320px;
  overflow-y: auto;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
}
.srf-folder-row {
  display: flex;
  align-items: stretch;
  border-bottom: var(--border-thin) solid var(--color-border-default);
  min-height: 36px;
}
.srf-folder-row:last-child {
  border-bottom: none;
}
.srf-folder-row__body {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding: 0 10px;
  background: none;
  border: none;
  font: inherit;
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  text-align: left;
  cursor: pointer;
}
.srf-folder-row__body:hover,
.srf-folder-row.sel > .srf-folder-row__body {
  background: var(--color-accent-soft);
  color: var(--color-text-default);
}
.srf-folder-row__name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.srf-folder-row__path {
  margin-left: auto;
  padding-left: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}
/* The descend target: a full-height 36px square, visually separated from the
   pick target so the two gestures never read as one. */
.srf-folder-row__into {
  flex: none;
  width: 36px;
  /* Set on the button, not inherited from the row: the row's 36px min-height
     is its border-box, so the divider would otherwise leave 35px of target. */
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  border-left: var(--border-thin) solid var(--color-border-default);
  color: var(--color-text-faint);
  cursor: pointer;
}
.srf-folder-row__into:hover {
  background: var(--color-accent-soft);
  color: var(--color-text-default);
}

/* The Works in tree and the Workspace list, on the folder dialog's rows: a line
   under the title, a box (or a check) leading each row, and the foot's note.
   A ticked row, the level's own row and the row an agent is in now read in the
   default ink; an unticked one stays muted. */
.srf-folder-hint {
  margin: calc(-1 * var(--space-1)) 0 0;
  font-size: var(--fs-12);
  line-height: 1.45;
  color: var(--color-text-muted);
}
.srf-folder-row.is-all > .srf-folder-row__body,
.srf-folder-row.is-checked > .srf-folder-row__body,
.srf-folder-row.is-current > .srf-folder-row__body {
  color: var(--color-text-default);
}
.srf-folder-row__body > .fmenu-slot {
  color: var(--color-text-default);
}
.srf-dialog--folders .srf-dialog-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.srf-dialog-summary {
  margin-right: auto;
  align-self: center;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}

/* Import panel — source input + classified preview (mirror/note/attachment/skip).
   Reuses the .srf-dialog shell; the .srf-import-* rules add the source row, the
   per-category count chips, and the classified file list. */
.srf-import {
  max-width: 560px;
}
.srf-import-dest {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  font-size: var(--fs-12);
}
.srf-import-dest__label {
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--fs-11);
}
.srf-import-dest__value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  color: var(--color-text-default);
}
.srf-import-dest__btn {
  flex: none;
}
/* Source-kind presets. Cards rather than a select, so the four supported
   sources are visible without opening anything — the panel used to name them
   only inside the input's placeholder. */
.srf-import-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.srf-import-kind {
  padding: 5px 12px;
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-strong);
  background: var(--color-surface-substrate);
  font: inherit;
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
}
.srf-import-kind:hover {
  color: var(--color-text-default);
  border-color: var(--color-accent);
}
.srf-import-kind.is-active {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}
.srf-import-hint {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  line-height: 1.45;
}
/* The banner above a preview the assistant staged. Accent-tinted so it reads as
   something brought in from elsewhere rather than as the panel's own hint. */
.srf-import-pending {
  font-size: var(--fs-12);
  line-height: 1.45;
  color: var(--color-text-muted);
  border-left: 2px solid var(--color-accent);
  background: var(--color-accent-soft);
  padding: var(--space-2);
  border-radius: var(--radius-2);
}
.srf-import-pending:empty {
  display: none;
}
/* Name-conflict affordances. A conflicting row is tinted and carries its own
   choice; the bar above applies one choice to all of them at once. */
.srf-import-count--conflict {
  color: var(--color-warn);
  font-weight: 600;
}
.srf-import-conflicts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-12);
}
.srf-import-conflicts:empty {
  display: none;
}
.srf-import-conflicts__label {
  color: var(--color-text-muted);
}
.srf-import-conflicts__btn {
  padding: 3px 9px;
  font-size: var(--fs-11);
}
.srf-import-row--conflict {
  background: var(--color-accent-soft);
}
.srf-import-row__resolve {
  flex: none;
  margin-left: auto;
  font: inherit;
  font-size: var(--fs-11);
  color: var(--color-text-default);
  background: var(--color-surface-substrate);
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-1, 3px);
  padding: 2px 4px;
  cursor: pointer;
}
.srf-import-source {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
}
.srf-import-source__input {
  flex: 1 1 auto;
  min-width: 0;
}
.srf-import-counts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.srf-import-counts:empty {
  display: none;
}
.srf-import-count {
  font-size: var(--fs-12);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  background: var(--color-surface-substrate);
  border: var(--border-thin) solid var(--color-border-default);
}
.srf-import-count--mirror {
  color: var(--color-accent-strong);
  background: var(--color-accent-soft);
  border-color: var(--color-accent-soft-2);
}
.srf-import-count--attachment {
  color: var(--color-warn);
}
.srf-import-count--selected {
  margin-left: auto;
  color: var(--color-text-default);
}
.srf-import-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 46vh;
  overflow-y: auto;
}
.srf-import-list:empty {
  display: none;
}
.srf-import-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px var(--space-2);
  border-radius: var(--radius-2);
  font-size: var(--fs-13);
}
.srf-import-row:hover {
  background: var(--color-surface-hover);
}
.srf-import-row--skip {
  opacity: 0.55;
}
.srf-import-row__check {
  flex: none;
  accent-color: var(--color-accent);
}
.srf-import-badge {
  flex: none;
  font-size: var(--fs-11, var(--fs-12));
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: var(--radius-1);
  color: var(--color-text-muted);
  background: var(--color-surface-substrate-2);
}
.srf-import-badge--mirror {
  color: var(--color-text-invert);
  background: var(--color-accent);
}
.srf-import-badge--note {
  color: var(--color-text-invert);
  background: var(--color-text-muted);
}
.srf-import-badge--attachment {
  color: var(--color-text-invert);
  background: var(--color-warn-dot);
}
.srf-import-row__name {
  color: var(--color-text-default);
  overflow-wrap: anywhere;
}
.srf-import-row__out {
  color: var(--color-text-faint);
  font-size: var(--fs-12);
}

.srf-dialog-search-list {
  max-height: 320px;
  overflow-y: auto;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  display: flex;
  flex-direction: column;
}
.srf-dialog-search-item {
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.srf-dialog-search-item:last-child {
  border-bottom: none;
}
.srf-dialog-search-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 7px 10px;
  cursor: pointer;
  border-bottom: var(--border-thin) solid var(--color-border-default);
  color: var(--color-text-muted);
  font-size: var(--fs-13);
}
.srf-dialog-search-row:last-child,
.srf-dialog-search-item > .srf-dialog-search-row {
  border-bottom: none;
}
.srf-dialog-search-row-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  margin-left: var(--space-2);
  padding: 0 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-faint);
  line-height: 1;
}
.srf-dialog-search-row-toggle:hover {
  color: var(--color-text-default);
}
.srf-dialog-search-row-detail {
  padding: 0 10px 8px 32px;
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  line-height: 1.45;
  white-space: normal;
}
.srf-dialog-search-row:hover,
.srf-dialog-search-row.sel {
  background: var(--color-accent-soft);
  color: var(--color-text-default);
}
.srf-dialog-search-row-name {
  font-weight: 600;
}
.srf-dialog-search-row-sub {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}
.srf-dialog-search-empty {
  padding: var(--space-4);
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--fs-13);
}

/* The surfaces reflow by the width the sidebar leaves them, not by the
   viewport — hence container queries on the surface (`.shell-body > .main`
   names it `main`). Below 900px the homepage grid packs tighter and the skill
   detail's fixed 260px sidebar stacks; below ~600px one homepage column, so
   the grid's gap cannot push a 2nd 220px track off-screen. */
@container main (max-width: 900px) {
  .homepage-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  .skills-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .agentpg-grid {
    grid-template-areas:
      'top'
      'main'
      'side';
  }
  .agentpg-grid > .agentpg-margin {
    margin-top: var(--space-5);
  }
  /* One column: the header card's halves stacked, a hairline between them,
     then the instructions, then the right card, unpinned. */
  .agentpg-shell,
  .agentpg-shell.is-skill {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .agentpg-shell > .agentpg-runcard {
    border-left: 0;
    border-top: var(--border-thin) solid var(--color-border-default);
  }
  .agentpg-grid > .agentpg-margin.agentpg-card {
    position: static;
    max-height: none;
    overflow: visible;
  }
}
@container main (max-width: 600px) {
  .homepage-grid {
    grid-template-columns: 1fr;
  }
  /* The run card's columns stack. */
  .agentpg-cols {
    grid-template-columns: minmax(0, 1fr);
  }
  .agentpg-cols > .agentpg-col + .agentpg-col {
    border-left: 0;
    border-top: var(--border-thin) solid var(--color-border-default);
  }
  .lib-grid {
    grid-template-columns: 1fr;
  }

  .homepage-pane {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* ---------- Issue #628: desktop topbar overflow ----------
   The `.app` grid had a single implicit column that auto-sized to its widest
   child. `.topbar-inner` is a non-wrapping flex row whose min-content width
   (~1001px) stretched that track, so `.homepage-pane` and the workspace `.main`
   inherited a 1001px canvas and the viewport showed only a left slice with a
   horizontal document scrollbar below ~1000px (a half-width desktop window).
   Fix: pin the grid track to the viewport (minmax(0,1fr) can't be stretched by
   min-content), then SHRINK the topbar instead of scrolling it — drop the brand
   tag, truncate the workspace name, hide the sync pill's label. Below the phone breakpoint the secondary
   chrome folds away entirely, leaving the brand, the sidebar toggle, bell and
   avatar, which fit any width. Kept at end-of-file so these overrides win by
   source order, like the #605 block. */
@media (max-width: 1000px) {
  /* Constrain every grid track to the viewport so nothing inherits an
     oversized scroll canvas (covers both the homepage and the workspace shell). */
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
  .topbar-inner {
    min-width: 0;
  }
  .brand-tag {
    display: none;
  }
}

/* ==========================================================================
   Editor-catalog surfaces
   ========================================================================== */

/* E1/E4/E6 — the editor banner strip between the topbar and the prose:
   conflict (disk changed under a dirty buffer), orphan (file deleted on disk
   under the open buffer), save-failure (buffer stays dirty, retrying). */
.editor-notices {
  flex: none;
}
.editor-banner {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-bottom: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-substrate);
  font-size: var(--fs-13);
}
.editor-banner.is-conflict,
.editor-banner.is-orphan {
  border-left: 3px solid var(--color-warn-dot);
}
.editor-banner.is-save-error {
  border-left: 3px solid var(--color-danger);
}
.editor-banner-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}
.editor-banner-icon {
  flex: none;
  margin-top: 2px;
  color: var(--color-warn);
}
.editor-banner.is-save-error .editor-banner-icon {
  color: var(--color-danger);
}
.editor-banner-text {
  color: var(--color-text-default);
}
.editor-banner-text strong {
  font-weight: 600;
}
.editor-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.editor-banner-btn {
  font: inherit;
  font-size: var(--fs-12);
  padding: 2px 10px;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-overlay);
  color: var(--color-text-default);
  cursor: pointer;
}
.editor-banner-btn:hover {
  border-color: var(--color-accent-soft-2);
}
.editor-banner-btn.is-danger {
  color: var(--color-danger);
  border-color: var(--color-danger);
}

/* F20 diff, unified — the conflict diff peek: − your version / + disk
   version. The family's canon: the only diff with a skip line, which a diff of
   a whole note is unreadable without. */
.editor-diff {
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--code-bg);
  overflow: hidden;
}
.editor-diff-legend {
  padding: 2px var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
  border-bottom: var(--border-thin) solid var(--color-border-default);
  white-space: pre;
}
.editor-diff-body {
  max-height: 240px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
}
.editor-diff-line {
  padding: 0 var(--space-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.editor-diff-line.is-del {
  background: color-mix(in srgb, var(--color-danger) 12%, transparent);
  color: var(--color-text-default);
}
.editor-diff-line.is-add {
  background: color-mix(in srgb, var(--color-warn) 12%, transparent);
  color: var(--color-text-default);
}
.editor-diff-line.is-ctx {
  color: var(--color-text-muted);
}
.editor-diff-line.is-skip {
  color: var(--color-text-faint);
  font-style: italic;
}

/* E5 — invalid/complex frontmatter: raw YAML block + indicator, chips disabled. */
.properties-raw {
  margin: 0 0 var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  overflow: hidden;
}
.properties-raw-flag {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px var(--space-2);
  font-size: var(--fs-12);
  color: var(--color-warn);
  background: var(--color-surface-substrate);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.properties-raw-flag.is-error {
  color: var(--color-danger);
}
.properties-raw-flag-icon {
  flex: none;
}
.properties-raw-src {
  margin: 0;
  padding: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* E7 — Reading-view tables (read-only render of pipe tables; editing stays a
   Live-Preview affordance via .cm-editable-table). */
.rv-table-wrap {
  margin: 0.6em 0;
  overflow-x: auto;
}
.rv-table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-14);
}
.rv-table th,
.rv-table td {
  border: var(--border-thin) solid var(--color-border-default);
  padding: var(--space-1) var(--space-2);
  text-align: left;
  vertical-align: top;
}
.rv-table thead th {
  background: var(--color-surface-substrate);
  font-weight: 600;
}
/* Word-document editing surface (real app only; mounted by the docx pane) */
.docx-editor-host {
  min-height: 100%;
  padding: var(--space-6) var(--space-8);
}
/* Formatting toolbar above the document — sticks to the top of the scroll. */
.docx-toolbar {
  position: sticky;
  top: calc(-1 * var(--space-6));
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: calc(-1 * var(--space-4)) 0 var(--space-4);
  padding: var(--space-2) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
}
.docx-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.docx-toolbar-group + .docx-toolbar-group {
  border-left: var(--border-thin) solid var(--color-border-default);
  padding-left: var(--space-3);
}
.docx-tb-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  border: 0;
  border-radius: var(--radius-1);
  background: none;
  color: var(--color-text-muted);
  font-size: var(--fs-13);
  line-height: 1;
  cursor: pointer;
}
.docx-tb-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.docx-tb-btn.is-on {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
.docx-tb-bold {
  font-weight: 600;
}
.docx-tb-italic {
  font-style: italic;
}
.docx-tb-underline {
  text-decoration: underline;
}
.docx-tb-strike {
  text-decoration: line-through;
}
.docx-tb-select {
  height: 26px;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-1);
  background: var(--color-surface-readable);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
}
.docx-tb-color {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: var(--radius-1);
  cursor: pointer;
}
.docx-tb-color:hover {
  background: var(--color-surface-hover);
}
.docx-tb-color-letter {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: underline solid #000;
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}
.docx-tb-color input[type='color'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.docx-tb-swatch {
  position: relative;
}
.docx-tb-swatch::after {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto;
  border-radius: 3px;
  border: 1px solid var(--color-border-default);
  background: var(--swatch);
}
.docx-editor-host .ProseMirror {
  line-height: 1.65;
  outline: none;
  white-space: pre-wrap;
}
.docx-editor-host .ProseMirror p {
  margin: 0 0 0.6em;
}
.docx-editor-host .ProseMirror table {
  border-collapse: collapse;
}
.docx-editor-host .ProseMirror td,
.docx-editor-host .ProseMirror th {
  border: 1px solid var(--color-border-default);
  padding: var(--space-1) var(--space-2);
}

/* PDF viewing surface (real app only; mounted by the pdf pane). The host is
   the positioning context PDFViewer requires: its scroll container must be
   absolutely positioned inside a box with a definite height (the pane grid's
   1fr row provides it via the flex content row). */
.pdf-host {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}
.pdf-viewer-container {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: var(--space-4) 0;
  /* pdf_viewer.css sizes pages against --scale-factor set by PDFViewer. */
  background: var(--color-surface-substrate);
}
/* The vendored stylesheet gives a page a declared width plus a 9px border and
   relies on the UA default (content-box) to keep them separate. This file's
   global `* { box-sizing: border-box }` reset overrides that, which takes the
   border OUT of the declared width: the canvas fills the shrunken content box
   while the text and annotation layers keep sizing themselves from the scale
   factor, so the overlays end up ~2.5% larger than the image beneath them.
   Nothing looks broken — selection, find highlighting and link hitboxes just
   drift further below their glyphs the further down the page they sit. Opting
   this subtree back out of the reset realigns all three to the same box. */
.pdf-viewer-container .pdfViewer .page {
  box-sizing: content-box;
}
/* Topbar control cluster: zoom, the page field, the find toggle. Sits after the
   read-only badge, which already claims `margin-left: auto`, so this group
   trails it at the right end of the bar. */
.pdf-controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: none;
}
/* Zoom readout — a button, not a label: activating it fits the page width
   again, which is what a reader wants far more often than any given
   percentage. Written to the F04 compact-ghost spec (transparent fill, muted
   text, `--space-1`/`--space-3` padding, `--radius-2`, `--fs-12`) because the
   stylesheet ships no shared ghost class to reuse — the reference page's
   specimens define their own. */
.pdf-zoom-readout {
  min-width: 52px;
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-2);
  background: none;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-variant-numeric: tabular-nums;
  text-align: center;
  transition:
    background-color var(--dur-quick) var(--ease-out),
    color var(--dur-quick) var(--ease-out);
}
.pdf-zoom-readout:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
/* Page field — F13 bare input at the compact rung, sized to four digits so the
   cluster does not reflow as the reader scrolls from page 9 to page 10. */
.pdf-page-input {
  width: 44px;
  font: inherit;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--color-text-default);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: 2px var(--space-1);
  outline: none;
}
.pdf-page-input:focus {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.pdf-page-input:disabled {
  opacity: 0.5;
}
/* Page total — F07 badge: read-only, attached to the field beside it. */
.pdf-page-total {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Positioning context for the find bar that floats over the document. Every
   document surface carries one now, so it belongs on the row itself rather
   than on the PDF viewer's variant of it. */
.editor-content-row {
  position: relative;
}
/* Password prompt — the in-pane ask for an encrypted document, built from the
   dialog family (title, input, error, primary button) laid out as a centered
   column where the document would be. */
.pdf-password-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  max-width: 360px;
  margin: var(--space-8) auto 0;
  padding: 0 var(--space-4);
  text-align: center;
}
.pdf-password-text {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.pdf-password-input {
  width: 220px;
  text-align: center;
}
/* The PDF variant of the outline panel: a column whose switch stays put while
   the list under it scrolls. The note variant keeps scrolling as a whole,
   having nothing pinned above its list. */
.outline-panel--pdf {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.outline-panel--pdf .outline-list {
  overflow-y: auto;
  min-height: 0;
}
/* The PDF sidebar's two-way switch — an F25 segmented control (--fill) at the
   head of the panel the markdown outline uses. Placement only. */
.pdf-sidebar-seg {
  margin-bottom: var(--space-3);
}
/* The page strip. Each cell keeps its number visible whether or not its image
   has painted yet, so a document being scrolled through never shows a column
   of anonymous empty boxes. */
.pdf-page-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
}
.pdf-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1);
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-2);
  background: none;
  /* Holds the cell's shape before its image lands, so the strip does not
     jump as pages paint in. Portrait A4/Letter at the render width. */
  min-height: 190px;
}
.pdf-thumb:hover {
  background: var(--color-surface-hover);
}
.pdf-thumb.is-active {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}
.pdf-thumb-canvas {
  display: block;
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-readable);
}
.pdf-thumb-num {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.pdf-thumb.is-active .pdf-thumb-num {
  color: var(--color-accent);
}
/* The find bar — one control, on every document surface. Built as a floating
   overlay (readable ground, container radius, deepest shadow) holding a wrapper
   text field and three compact icon buttons, anchored to the top-right of
   whatever document is open. */
.find-bar {
  position: absolute;
  top: var(--space-3);
  right: var(--space-4);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-3);
}
/* Where a PDF's viewer waits while the reader is looking at that document's
   markdown mirror. Out of sight but still laid out: `visibility` rather than
   `display: none`, because a box with no layout is one the renderer cannot
   scroll, and it is asked to whenever the reader flips back. */
.editor-parked-viewer {
  position: absolute;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
}
/* Compact rung (24px) for the bar's three nav controls — the find bar is
   denser chrome than the topbar, which sits at 28px. */
.find-bar .icon-btn {
  width: 24px;
  height: 24px;
  font-size: var(--fs-13);
}
/* Wrapper field: the wrapper owns the boundary, the input is bare. */
.find-bar-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 24px;
  padding: 0 var(--space-2);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
}
.find-bar-field:focus-within {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.find-bar-input {
  width: 168px;
  font: inherit;
  font-size: var(--fs-13);
  color: var(--color-text-default);
  background: none;
  border: 0;
  outline: none;
  padding: var(--space-1) 0;
}
.find-bar-count {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Every match the bar found, wherever it found it: a CodeMirror decoration, a
   wrapper in rendered prose, a ProseMirror decoration in a Word document. One
   treatment, so the same search reads the same on every surface — the soft
   accent wash for the others, the full accent for the one the reader is on. */
.srf-find-match {
  background: var(--color-accent-soft);
  color: inherit;
  border-radius: var(--radius-1);
}
.srf-find-match.is-current {
  background: var(--color-accent);
  color: var(--color-surface-readable);
}
/* The topbar badge on every surface that cannot be typed into: the PDF and
   image viewers, and a document read through its markdown mirror. Same quiet
   weight as the code pane's language badge, because it does the same job —
   naming what the pane is, not warning about it. Pushed to the far right,
   where each of those topbars ends its left cluster. */
.editor-readonly-badge {
  margin-left: auto;
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  flex: none;
}
/* Read-only source view for a mirror-read document, when the vendored
   CodeMirror bundle is absent. Same monospaced treatment as the code host it
   stands in for, wrapping rather than scrolling sideways. */
.source-fallback {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
/* An HTML page, rendered. The frame fills the pane and the page scrolls inside
   its own frame: a page's height is its own, and a parent cannot read it across
   the sandbox, so the pane gives up its padding and its scroll to the frame.
   The frame paints the light canvas a browser gives an unstyled page — with
   `color-scheme: light` an unstyled page is transparent over `Canvas`, and a
   page that declares itself dark paints its own opaque canvas instead. */
/* The pane has no notices strip, so its content row would land in the grid's
   second, auto-sized row and shrink the frame to its default 150px. */
.editor-pane:has(.html-page-host) {
  grid-template-rows: auto 1fr;
}
.editor-scroll:has(> .html-page-host) {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.html-page-host {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}
/* A page's read still out after a moment: the wave, centred in the pane. */
.html-page-loading {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
}
/* A page's controls, pinned to the bar's right edge in every mode — badge,
   toggle, Preview beside, Refetch — so none of them moves when the mode or the
   file changes. The crumbs before it take the rest and ellipsize first; the
   cluster never wraps or truncates. F07 label badge, F25 segmented control and
   F05 icon buttons; none adds a state rule of its own. */
.html-page-cluster {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}
/* Refetch while its request is out: the glyph turns, a turn a second. Under
   reduced motion it holds still, dimmed. */
.icon-btn.is-busy {
  cursor: progress;
}
.icon-btn.is-busy > .icon {
  animation: html-page-refetch-spin 1s linear infinite;
}
@keyframes html-page-refetch-spin {
  to {
    rotate: 360deg;
  }
}
@media (prefers-reduced-motion: reduce) {
  .icon-btn.is-busy > .icon {
    animation: none;
    color: var(--color-text-faint);
  }
}
.html-page-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: none;
  color-scheme: light;
  background: Canvas;
}
/* Image viewing surface (mounted by the image pane, in both the served app and
   the static harness). The host scrolls; the frame centres the image in it and
   fills the pane when the image is smaller than the viewport, so a small icon
   sits in the middle of the surface rather than in its top-left corner. */
.image-host {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--color-surface-substrate);
}
.image-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 100%;
  padding: var(--space-6);
}
/* Never upscaled: the element's max-width is set from the view-model's
   intrinsic size once the image loads, so it only ever scales DOWN to fit. */
.image-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-2);
}
/* Topbar dimensions readout, fed by the image view-model's intrinsic size. */
.image-dimensions {
  margin-left: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Native-viewer fallback when the pdf.js bundle or byte fetch fails. */
.pdf-embed-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- Feed row expansion (accordion detail on notifications + activity) ---- */
.feed-item-chevron {
  color: var(--color-text-faint);
  align-self: center;
  flex: none;
}
.notif-item.is-expanded {
  background: var(--color-surface-readable);
}
.feed-detail {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: var(--border-thin) solid var(--color-border-default);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  cursor: default;
}
.feed-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
}
/* A fact: its label, a gap, its value. */
.feed-detail-metarow {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.feed-detail-metakey {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 2px;
}
.feed-detail-metaval {
  font-size: var(--fs-12);
  color: var(--color-text-default);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.feed-detail-diffs {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.feed-detail-diff {
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--color-surface-readable);
}
/* Authorship, on a 3px edge OUTSIDE the add/remove gutter. The gutter is the
   border-left on .feed-detail-before/.feed-detail-after below, and it already
   means added or removed — green has meant "added" in every diff ever made.
   The register wants green to mean "the human", so putting both on one stripe
   makes a human-authored addition cancel itself. This edge sits on the BLOCK,
   to the left of the wash, and the two axes never touch.

   An unmarked block keeps a transparent edge of the same width, so a diff
   whose records predate the field does not shift sideways beside one that
   carries it. */
.feed-detail-diff {
  border-left: 3px solid transparent;
}
.feed-detail-diff[data-authored='agent'] {
  border-left-color: var(--color-agent);
}
.feed-detail-diff[data-authored='human'] {
  border-left-color: var(--color-accent);
}
.feed-detail-diffhead {
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
}
.feed-detail-difftool {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-accent-strong);
}
.feed-detail-diffanchor {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-faint);
}
.feed-detail-diffwhy {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  font-style: italic;
}
.feed-detail-before,
.feed-detail-after {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-1);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-left: 3px solid transparent;
}
.feed-detail-before {
  background: color-mix(in srgb, var(--color-danger) 8%, transparent);
  border-left-color: var(--color-danger);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--color-danger) 45%, transparent);
}
.feed-detail-after {
  background: color-mix(in srgb, var(--color-success) 9%, transparent);
  border-left-color: var(--color-success);
}
.feed-detail-nodiff {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.feed-detail-revert-ok {
  font-size: var(--fs-12);
  color: var(--color-success);
}
.feed-detail-revert-err {
  font-size: var(--fs-12);
  color: var(--color-danger);
}
.feed-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.feed-detail-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-12);
  color: var(--color-text-default);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  padding: 3px 10px;
  cursor: pointer;
}
.feed-detail-action:hover {
  border-color: var(--color-border-strong);
}
/* Ask agent speaks in the agent's blue. */
.feed-detail-action--ask {
  color: var(--color-agent);
  font-weight: 600;
}
.feed-detail-action--ask:hover {
  background: var(--color-agent-wash);
  border-color: var(--color-agent-edge);
}
.feed-detail-action--revert {
  color: var(--color-danger);
}
.feed-detail-action:disabled {
  opacity: 0.5;
  cursor: default;
}
/* Nested member rows inside an expanded burst. */
.feed-burst-list {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  cursor: default;
}

/* Hung off the window instead of nested in a positioned field, which is what
   the picker's own placement rule assumes. */
.hpanel-pick-pop--float {
  position: fixed;
  bottom: auto;
  z-index: 260;
}

/* ---------- Accent-forward theming ----------
   The brand green stops being a detail color and structures the chrome.

   Light theme — a tonal ladder of one green, each step paired with its own
   ink so contrast holds on every surface:
     bands #a9cab3  →  panel bodies #cfe0d2  →  paper #fff
   The panel-body step and its hairline are the two the ladder shares widely
   enough to name: --color-surface-panel and --color-border-panel, defined in
   both theme blocks so a surface reaching for either resolves in dark too.
   The navigation sidebar sits on white (--color-surface-nav) with the page's
   own ink, so the accent is left to mark the current page; the top bar sits on the light
   chrome token so the mark keeps its canonical green; the panel surfaces
   carry the lighter steps; documents and cards stay white so reading surfaces
   never tint.

   Dark theme — the surfaces stay the neutral evergreen darks, with the sidebar
   on the deeper chrome step and the bar on the readable ground every container
   takes; the green arrives through the linework (border tokens, grid).

   Rules here are scoped per theme with `html[data-theme=…]`; anything both
   themes share (dividers, rail, pill states) lives with its component. */

/* ---- dark: the sidebar is the chrome, the bar sits on the readable ground ---- */
/* The bar is a docked container, so it takes the readable ground every
   container takes, told apart from the page by its hairline rather than by a
   grey step. Both selectors are needed: dark is the default theme (no
   attribute) and also reachable explicitly via the toggle. */
html:not([data-theme='light']) .topbar,
html[data-theme='dark'] .topbar {
  background: var(--color-surface-readable);
}

/* ---- light: lifted homepage cards ---- */
/* The green canvas needs the floating surfaces to actually float: a layered
   drop shadow lifts panels, workspace cards and the agent box off the grid.
   The shadow works alone — an outline (a white ring once lived here) reads
   as a drawn edge around the border rather than as elevation. */

html[data-theme='light'] .pcard-face {
  box-shadow:
    0 12px 26px rgba(24, 46, 36, 0.14),
    0 2px 5px rgba(24, 46, 36, 0.08);
}
/* ---- dark: lifted homepage cards ---- */
/* Dark cannot lift with shadow alone: a pure-black shadow can darken the
   near-black page by only a few units. So elevation here is a soft dark
   contact halo hugging the card plus a faint accent glow just past it that
   ties the cards to the page's accent. Both are kept TIGHT — a
   wide glow merges between grid neighbours and reads as the whole page
   glowing. No light rim: every one of these surfaces has a real border,
   and an inset top highlight under a visible border doubles the edge. */
html[data-theme='dark'] .pcard-face {
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.6),
    0 0 10px 2px rgba(0, 0, 0, 0.4),
    0 0 18px 4px rgba(95, 185, 138, 0.09);
}
html[data-theme='dark'] .workspace-card:hover .pcard-face {
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.7),
    0 0 12px 3px rgba(0, 0, 0, 0.45),
    0 0 22px 5px rgba(95, 185, 138, 0.13);
}

/* The composer used to re-derive a darker green band and pin a white well
   inside it, and the model picker before that restated the page's light tokens
   to undo an inherited on-green scheme. Both are gone: the panel is white, so
   the composer, its field and everything mounted out of it inherit the page's
   own ink, border and surface steps with nothing left to correct. */

/* The memory surface's profile meter: a track and its fill. */
.usage-bar {
  height: 6px;
  margin: 6px 0;
  background: var(--color-surface-substrate);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  background: var(--color-accent);
}
/* The memory surface's over-budget profile meter. It lives HERE, beside the
   declaration it overrides, rather than with the rest of the memory-surface
   families further up the file: both selectors are one class, so the cascade
   is decided by source order alone and the variant declared earlier would
   silently lose to the base. Amber rather than danger red because nothing is
   broken and nothing is dropped — the tier still loads whole, it just costs
   more of every turn than it was meant to. */
.usage-bar-fill--over {
  background: var(--color-warn);
}

/* ==========================================================================
   A person's page, and the shelf of what they kept
   ========================================================================== */

/* A byline is a control now that there is a profile to open. It keeps the type
   of whatever line it sits in — it is still a name in a sentence, not a button
   parked in one — and earns its underline on hover rather than wearing one. */
.prf-byline {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.prf-byline:hover {
  text-decoration: underline;
}
/* The handle after a post's byline: who the person is to a reader first, then
   how to find them again — one step smaller, in the muted ink, and never part
   of the underline the name takes under the pointer. Stated against the parent
   so it holds inside every byline class, which each set their own colour. */
.prf-byline .prf-byline-handle {
  display: inline-block;
  margin-left: var(--space-1);
  font-size: 0.86em;
  font-weight: 400;
  color: var(--color-text-muted);
  text-decoration: none;
}
/* A creation's publisher beside its name: the same quieter register as a
   person's handle beside theirs. */
.creation-handle {
  margin-left: var(--space-1);
  font-family: var(--font-ui);
  font-size: 0.86em;
  font-weight: 400;
  color: var(--color-text-muted);
}
.prf-byline:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-1);
}

.prf-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  box-sizing: border-box;
  width: 100%;
  max-width: 640px;
  margin: var(--space-4) auto 0;
}
/* Initials on a colour derived from the handle, since nobody has a photo yet.
   The text is the invert token rather than white, so it stays legible against
   the mark in either theme. */
.prf-avatar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-18);
  font-weight: 600;
  color: var(--color-text-invert);
}
.prf-who {
  min-width: 0;
}
/* The name with the "…" directly after it, not pushed to the far edge. */
.prf-nameline {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.prf-nameline .prf-audience {
  margin-left: 0;
  align-self: center;
}
/* The buttons sit under the description. Follow and Edit profile share one
   size, 200 by 32; a Post button beside Edit profile keeps its own width. */
.prf-head-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.prf-head-acts .soc-follow,
.prf-head-acts .sp-prf-edit {
  box-sizing: border-box;
  width: 200px;
  max-width: 100%;
  height: 32px;
  margin: 0;
  padding: 0 var(--space-3);
}
/* A Post button beside Edit profile is as tall as it, and keeps its own width. */
.prf-head-acts .cm-post {
  box-sizing: border-box;
  height: 32px;
  margin: 0;
}
.prf-name {
  margin: 0;
  font-size: var(--fs-22);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-default);
}
.prf-handle {
  display: block;
  font-size: var(--fs-13);
  color: var(--color-text-faint);
}
.prf-bio {
  margin: var(--space-2) 0 0;
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--color-text-muted);
}
/* The counts line under About me: the numbers at 600 in default ink, the words
   muted. Followers and following are the links to their lists, underlined on
   hover and nowhere else. */
.prf-counts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1);
  margin-top: var(--space-2);
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.prf-count b {
  font-weight: 600;
  color: var(--color-text-default);
}
.prf-countlink {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.prf-countlink:hover {
  text-decoration: underline;
}
.prf-countlink:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-1);
}
/* A profile's rows are the Following lane's row. These are the lines that row
   does not have: why it is on this page (a quote, a repost), who and when, and
   the creations it is about. */
.prf-row-note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.prf-row-note b {
  font-weight: 600;
  color: var(--color-text-default);
}
.prf-row-meta {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.prf-row-author {
  font-weight: 600;
  color: var(--color-text-default);
}
.prf-row-when {
  color: var(--color-text-faint);
}
.prf-row-about {
  margin-top: var(--space-2);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.prf-gone {
  color: var(--color-text-faint);
}
.prf-more,
.prf-people-more {
  align-self: flex-start;
}
.prf-more-wait,
.prf-people-wait {
  padding: var(--space-4) 0;
  font-size: var(--fs-13);
  color: var(--color-text-faint);
}
/* Followers and Following: the shipped dialog with a scrolling list of people. At
   the phone width it fills the screen and the close is a step back. */
.prf-people-dialog {
  width: min(480px, calc(100vw - 2 * var(--space-6)));
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
}
.prf-people-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.prf-people-back {
  display: none;
  align-items: center;
  gap: var(--space-1);
  padding: 0;
  border: none;
  background: none;
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  cursor: pointer;
}
.prf-people-x {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
}
.prf-people {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: var(--space-3);
  overflow-y: auto;
}
.prf-person {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) 0;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
}
.prf-person-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.prf-person-row .prf-person {
  flex: 1;
  min-width: 0;
  width: auto;
}
.prf-person-mark {
  flex: none;
  width: 36px;
  height: 36px;
  font-size: var(--fs-12);
  object-fit: cover;
}
.prf-person-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.prf-person-who b {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
.prf-person-who span {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
@media (max-width: 700px) {
  .prf-people-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .prf-people-back {
    display: inline-flex;
  }
  .prf-people-x {
    display: none;
  }
}
/* The reader's own header (photo family, 96px): the page's header grown around a
   bigger photo, and the same header as a form in place. The photo is the focal
   point, so it centres the name beside it; as a form it sits at the top. */
.sp-prf-head.is-edit .prf-avatar,
.sp-prf-head.is-edit .sp-ph-img {
  width: 96px;
  height: 96px;
  font-size: var(--fs-28);
}
/* The page's own header: the photo at 128px, initials at 36px. */
.sp-prf-head:not(.is-edit) .prf-avatar,
.sp-prf-head:not(.is-edit) .sp-ph-img {
  width: 128px;
  height: 128px;
  font-size: var(--fs-36);
}
.sp-prf-head .prf-avatar.is-wait {
  opacity: 0.45;
}
.sp-prf-head .prf-bio {
  max-width: 560px;
}
.sp-prf-edit {
  margin-top: var(--space-2);
}
.sp-prf-photo {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  /* Wide enough that the longest line under the photo wraps rather than
     stretching the column. */
  max-width: 180px;
  text-align: center;
}
.sp-prf-photo .sp-msg {
  margin-top: 0;
}
.sp-prf-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 520px;
  min-width: 0;
}
.sp-prf-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.sp-prf-field label {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.sp-prf-form .srf-dialog-input {
  width: 100%;
  box-sizing: border-box;
}
.sp-prf-acts {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-1);
}
/* The six acts as a rail rather than a stack. The list sits between the profile
   header and the tabs, so its height is somebody's work pushed below the fold —
   six cards in a row that scrolls sideways is about a third of the stacked
   height and still shows every act's benefit. Ticks and a count, and
   deliberately nothing that could be read as a proportion — no bar, no
   percentage, no ring that fills. */
.prf-acts {
  margin-top: var(--space-5);
}
.prf-acts-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.prf-acts-count {
  font-size: var(--fs-12);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-faint);
}
/* Scrolls sideways when it runs out of width, the way the topic chips on
   Discover do, rather than wrapping into the stack this replaced. */
.prf-acts-rail {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  scroll-snap-type: x proximity;
}
.prf-act {
  flex: 0 0 196px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  text-align: left;
  cursor: pointer;
}
.prf-act:hover {
  border-color: var(--color-accent);
}
.prf-act:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
.prf-act:disabled {
  cursor: default;
  background: var(--color-surface-substrate);
}
/* An empty ring for an act not yet done, the tick glyph for one that is. */
.prf-act-tick {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  border: var(--border-thin) solid var(--color-border-strong);
  color: var(--color-success);
}
.prf-act.is-done .prf-act-tick {
  border-color: var(--color-success);
}
.prf-act-label {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
.prf-act.is-done .prf-act-label {
  color: var(--color-text-muted);
}
.prf-act-benefit {
  font-size: var(--fs-12);
  line-height: 1.45;
  color: var(--color-text-faint);
}

.prf-saved-btn {
  margin-top: var(--space-4);
}
.prf-tabs {
  margin-top: var(--space-4);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.prf-published,
.prf-activity,
.svp-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.prf-item {
  cursor: pointer;
}
.prf-entry-foot,
.svp-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.prf-entry-open {
  height: 24px;
  padding: 0 var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-text-default);
  cursor: pointer;
}
.prf-entry-open:hover {
  border-color: var(--color-accent);
}
/* The shelf. The item a kept post is about, said once under the writing. */
.svp-row-item {
  margin-top: var(--space-2);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
/* How many posts are saved, under the title and over the collection chips. */
.svp-count {
  margin-top: var(--space-2);
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.svp-back-shelf {
  margin-top: var(--space-3);
}

/* A kept post open over its shelf: the shipped dialog at the width a post is
   read at, with a step to the neighbour either side of the card. The steps are
   flex siblings of the card inside the backdrop, which already centres them. */
.srf-dialog.svp-post-dialog {
  max-width: min(720px, calc(100vw - 2 * var(--space-6)));
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding: var(--space-4);
  gap: 0;
}
/* The card takes focus when it opens so the arrow keys and Escape answer at
   once; a ring on the whole dialog would say nothing a reader could act on. */
.srf-dialog.svp-post-dialog:focus {
  outline: none;
}
.svp-post-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.svp-post-step--prev,
.svp-post-step--next {
  position: relative;
  z-index: 1;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  box-shadow: var(--shadow-2);
  cursor: pointer;
}
.svp-post-step--prev {
  margin-right: var(--space-4);
}
.svp-post-step--next {
  margin-left: var(--space-4);
}
.svp-post-step--prev:not(:disabled):hover,
.svp-post-step--next:not(:disabled):hover {
  border-color: var(--color-accent);
}
.svp-post-step--prev:disabled,
.svp-post-step--next:disabled {
  opacity: 0.4;
  cursor: default;
}
/* Below the width the card and its two steps need side by side (720px, and a
   step with its gap each side), the steps overlap the card's own edges rather
   than being squeezed out of the window. */
@media (max-width: 831px) {
  .svp-post-step--prev {
    margin-right: calc(-1 * (40px + var(--space-2)));
  }
  .svp-post-step--next {
    margin-left: calc(-1 * (40px + var(--space-2)));
  }
}

/* Under 700px the block is the page's width and the photo shrinks to 96px. */
@media (max-width: 700px) {
  .prf-head {
    gap: var(--space-4);
  }
  .sp-prf-head:not(.is-edit) .prf-avatar,
  .sp-prf-head:not(.is-edit) .sp-ph-img {
    width: 96px;
    height: 96px;
    font-size: var(--fs-28);
  }
}

/* ---------------------------------------------------------------------------
   The inbox's two families, and the two tiers that silence somebody
   --------------------------------------------------------------------------- */

/* Activity's Social view is a flex column so the sign-in card below the
   example rows can take the leftover height. Scoped to that view: every other
   surface, and Activity's log, is a plain block and has no reason to change. */
.surface-pane[data-route='activity-feed'][data-view='social'] {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* The slot the sign-in card sits in.

   `margin-block: auto` is the whole mechanism: in a flex column an auto margin
   absorbs the leftover space and splits it evenly above and below, so on a tall
   window the card is centred between the last row and the bottom of the page —
   and when there is no leftover space it resolves to zero, so on a short window
   the card simply follows the rows instead of being pushed off. A fixed gap
   would have had to pick one of those two behaviours. */
.notif-signin-slot {
  display: flex;
  justify-content: center;
  margin-block: auto;
}
/* Leading a lane rather than closing a page, the card needs a gap under it —
   without one it butts straight against the first post. */
.dsc-lane--following > .ws-card {
  margin-bottom: var(--space-4);
}

/* A social row is the Activity row with the social edge, one 32px line. */
.notif-item--social {
  align-items: center;
  min-height: 0;
  padding-block: 0;
  border-left-color: var(--color-accent-soft);
  cursor: pointer;
}
/* A notice from the service takes the edge Activity gives what needs attention. */
.notif-item--social.notif-item--moderation {
  border-left-color: var(--color-warn-dot);
}
/* The first face at 20px; the shield sits in a circle of the same size. */
.soc-lead {
  display: flex;
  align-items: center;
  flex: none;
  min-width: 20px;
}
.soc-lead > * {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  font-size: var(--fs-11);
  box-shadow: 0 0 0 2px var(--color-surface-readable);
}
.soc-lead--notice {
  justify-content: center;
  border-radius: 50%;
  background: var(--color-surface-substrate-2);
  color: var(--color-text-muted);
}
.soc-lead--notice > * {
  width: 14px;
  height: 14px;
  box-shadow: none;
}
/* The names carry the weight; a read row is muted with its names a step lighter. */
.soc-sentence {
  font-size: var(--fs-13);
  color: var(--color-text-default);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.soc-sentence b {
  font-weight: 600;
}
.notif-item--social:not(.is-unread) .soc-sentence {
  color: var(--color-text-muted);
}
.notif-item--social:not(.is-unread) .soc-sentence b {
  font-weight: 500;
}
/* The sentence takes the room the face, time and dot leave. */
.notif-item--social .soc-body {
  flex: 1 1 auto;
  min-width: 0;
}
/* Mark as read: white, compact, on hover and focus. */
.soc-mark-read {
  flex: none;
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font-size: var(--fs-12);
  line-height: 1.2;
  opacity: 0;
}
.notif-item--social:hover .soc-mark-read,
.soc-mark-read:focus-visible {
  opacity: 1;
}
.soc-mark-read:hover {
  border-color: var(--color-border-strong);
}
.notif-item--social .notif-item-time {
  flex: none;
  font-family: var(--font-ui);
  font-size: var(--fs-12);
}
.notif-item--social .feed-item-chevron {
  flex: none;
  color: var(--color-text-faint);
}
.feed-day-rows > .notif-item--social {
  border-left-width: 3px;
}

/* The overflow that offers muting and blocking. An icon button, always visible:
   a control that appears on hover is a control a reader cannot find, and the
   one thing this must never be is the single visible click that makes something
   go away. */
.prf-audience {
  flex: 0 0 auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-2);
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--dur-quick) var(--ease-out);
}
.prf-audience:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
  border-color: var(--color-border-default);
}
/* The "..." of your own post (Edit, Delete) wears the author menu's dress, so the
   name line carries one kind of "..." whoever wrote the post. */
.prf-more {
  flex: 0 0 auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-2);
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--dur-quick) var(--ease-out);
}
.prf-more:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
  border-color: var(--color-border-default);
}

/* What the reader already did about this person, with the undo on it. Tinted by
   tier: muting is a quiet preference and blocking is the heavier of the two, so
   it reads in the warn slot rather than in danger red — nothing has been
   destroyed and nothing is wrong. */
.prf-standing {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate-2);
  font-size: var(--fs-12);
  line-height: 1.45;
}
.prf-standing--muted {
  background: var(--color-surface-substrate-2);
}
.prf-standing-icon {
  flex: 0 0 auto;
  align-self: center;
  color: var(--color-text-faint);
}
.prf-standing-copy {
  flex: 1 1 240px;
  color: var(--color-text-muted);
}
.prf-standing-undo {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prf-standing-undo:hover {
  color: var(--color-accent-strong);
}

/* What a blocked person's profile or post shows the person who blocked them: one
   centred card with the two ways on. Neither of the two is the page's accent. */
.prf-blocked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  max-width: 420px;
  margin: var(--space-6) auto;
  padding: var(--space-5);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  background: var(--color-surface-readable);
  text-align: center;
}
.prf-blocked-title {
  margin: 0;
  font-size: var(--fs-18);
  font-weight: 600;
  color: var(--color-text-default);
}
.prf-blocked-copy {
  margin: 0;
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.prf-blocked-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.mp-posts-hidden-icon {
  flex: 0 0 auto;
  align-self: center;
  color: var(--color-text-faint);
}

/* ---------- A post read from the service, and the posts on a creation's page ----------
   A post's own page (`thr-`) draws a post whole with its replies under it; a
   creation's page (`cps-`) reuses the review row (`mp-review`) and adds only
   what is new: the author's thumb glyph, the owner's Hide and the faded row. */
.thr-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.thr-loading {
  font-size: var(--fs-13);
  color: var(--color-text-faint);
  padding: var(--space-3) 0;
}
.thr-post {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) 0;
}
.thr-id {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.thr-id-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
  min-width: 0;
}
.thr-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
}
.thr-name {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
.thr-when,
.thr-edited {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.thr-body {
  font-family: var(--font-prose);
  font-size: var(--fs-14);
  line-height: 1.5;
  color: var(--color-text-default);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.thr-ref {
  font-weight: 600;
}
.thr-ref.is-gone,
.thr-mention {
  color: var(--color-text-faint);
}
.thr-replies {
  display: flex;
  flex-direction: column;
}
.thr-replies--nested {
  margin-left: var(--space-5);
  padding-left: var(--space-4);
  border-left: var(--border-thin) solid var(--color-border-default);
}
.thr-gone {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) 0;
}
.thr-gone-mark {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: var(--border-thin) dashed var(--color-border-strong);
  flex: none;
}
.thr-gone-text {
  font-size: var(--fs-13);
  color: var(--color-text-faint);
}
.thr-quote {
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.thr-quote.is-gone {
  color: var(--color-text-faint);
}
.thr-quote-who {
  font-weight: 600;
  color: var(--color-text-default);
}
.thr-stat {
  color: var(--color-text-muted);
}
/* The creations the cube opens: a floating container where a row would be, lying
   over the comment box so opening it moves nothing. */
.thr-tags {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - var(--space-3) + var(--space-2));
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-2);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-2);
}
@media (max-width: 600px) {
  .thr-tags {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .thr-tags .thr-pill {
    min-width: 0;
  }
  .thr-tags .thr-pill-name,
  .thr-tags .thr-pill > span:not(.thr-thumb) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
/* F06 pill, name only, no fill: the thumb sets the colour. */
.thr-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px var(--space-2);
  border-radius: var(--radius-pill);
  border: var(--border-thin) solid var(--color-border-strong);
  background: transparent;
  color: var(--color-text-default);
  font-family: inherit;
  font-size: var(--fs-13);
  line-height: 1.3;
  white-space: nowrap;
}
button.thr-pill {
  cursor: pointer;
}
.thr-pill--up {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.thr-pill--down {
  border-color: var(--color-text-muted);
  color: var(--color-text-muted);
}
.thr-pill.is-gone {
  color: var(--color-text-faint);
}
.thr-thumb {
  display: inline-flex;
}
.thr-thumb svg {
  width: 100%;
  height: 100%;
}
.thr-thumb--down {
  transform: rotate(180deg);
}
.cps-thumb {
  width: 14px;
  height: 14px;
  flex: none;
}
.cps-thumb.thr-thumb--up {
  color: var(--color-accent);
}
.cps-thumb.thr-thumb--down {
  color: var(--color-text-muted);
}
.cps-row {
  cursor: pointer;
  border-radius: var(--radius-3);
  padding: var(--space-4);
}
.cps-row .mp-review-head {
  justify-content: flex-start;
  align-items: center;
  gap: var(--space-2);
}
.cps-row .mp-review-date {
  color: var(--color-text-faint);
  font-size: var(--fs-12);
}
.cps-row .mp-review-body {
  font-family: var(--font-prose);
  font-size: var(--fs-14);
  margin-top: var(--space-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cps-row.is-hidden {
  opacity: 0.55;
}
.cps-hide {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.cps-hidden-tag,
.cps-error {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.cps-hidden-tag {
  margin-top: var(--space-1);
}

/* This block is LAST in the stylesheet on purpose. A press response has to
   beat whatever a component declares for its own resting and hover state,
   and several of them declare it with the `background` shorthand — which
   resets `background-image`, the property the tint is laid in. At equal
   specificity the later rule wins, so the registry sits after every
   component rule rather than relying on each one being weaker than it.
   `.prf-audience:hover` and `.notif-item.is-expanded` are the two that
   proved it: both tie with the tint on specificity and both are declared
   further down the file. */
/* ---------- Press response — keyed to what a control does ---------- */
/* Four responses, chosen by a control's job rather than its appearance. The
   rule this replaces keyed on shape — bordered, filled or pill-shaped — which
   is how a card, a filter pill and a submit button ended up sharing one 1px
   dip across 137 selectors. What a press should answer is what the press is
   about to do:

     commit  it changes the workspace, a draft, or a remote. It dips 1px and
             springs back: the one gesture here that reads as force.
     open    it changes only what you are looking at — a route, a record, a
             menu, a dialog. The ground steps one tier and nothing moves. A
             row that slid under the finger would claim a force it does not
             carry.
     toggle  it flips a value the control already paints. Nothing is added,
             because the state flip is the feedback.

   Two overrides sit on top of that, because neither answer survives certain
   shapes. A 1px dip is invisible on a solid accent block, so a filled control
   recesses instead; and a bare glyph has no ground to step, so the glyph
   itself kicks while its container holds still. Both are chosen by shape
   deliberately — they are how a response is drawn, not which one applies.

   Movement is driven through `translate` and a forwards-filling animation
   rather than a transform transition, because `transform` is already taken on
   several of these (the workspace-card flip, the marketplace hover lift) and a
   shared `transition` declaration would silently clobber each control's own
   hover transitions. The tint is laid as a `background-image` over whatever
   ground the control happens to carry, so it steps one tier from the resting
   AND the hover state without either being restated here. Under reduced
   motion the global rule below collapses the movements to instant state
   changes; the tint is unaffected, being no movement to begin with.

   Placing a new control: docs/architecture/component-standards.md, rule 9. */
@keyframes srf-press-dip {
  to {
    translate: 0 1px;
  }
}
@keyframes srf-press-kick {
  to {
    translate: 1.5px -1.5px;
  }
}

/* --- commit: dips --- */
/* Settings: Reset puts a setting back to its default, and the search's clear empties the box */
.sp-set-reset:active,
.settings-search-clear:active,
/* the foot-of-window toast: Undo, Restart now and Later each change something */
.undo-toast-act:active,
.undo-toast-quiet:active,
/* the website: every white button that acts (Sign in on a card, Try again, Close) */
.ws-btn:not(.ws-btn--primary):active,
/* file tree */
.tree-enrich:active,
/* notifications + activity */
.notif-action:active,
.feed-clear-all:active,
.feed-mark-read:not(:disabled):active,
.notif-pop-markread:active,
.feed-day-more:active,
.feed-load-more:active,
.feed-detail-action--revert:not(:disabled):active,
.soc-mark-read:active,
/* discover: the post lanes */
.dsc-more:active,
/* marketplace */
.mp-refresh:active,
.mp-blocked-act:active,
.mp-publish-draft-btn:active,
.pi-btn:not(.pi-btn--primary):not(:disabled):active,
.mp-fork-btn:active,
.mp-install-btn:active,
.mp-download-btn:active,
.mp-uninstall-btn:active,
.mp-consent-cancel:active,
/* skills: cancelling a run */
.skrun-cancel:active,
/* a starter that sends its words: an agent's, and Edit skill's first two */
.agentpg-starter:not(.is-open):not(:disabled):active,
/* settings */
.settings-retrieval-enrich-btn:active,
/* editor */
.provenance-revert-btn:active,
.cm-table-row-add:active,
/* dialogs + flows; a workspace chosen from the Workspace list moves the agent */
.srf-dialog-btn:active,
.srf-folder-row__body[data-workspace]:active,
.srf-folder-row__body[data-workspace-all]:active,
.srf-runcard-btn:active,
/* agent panel — the panel's controls are being reworked separately and are
   not reclassified here; they keep the dip they have always had rather than
   being left behind in a block that no longer describes them. */
.chat-continue-btn:active,
.ctx-compact-btn:active,
.chat-history-reopen:active,
.chat-image-lightbox-close:active,
.chat-model-btn:active,
.ni-btn:not(.ni-btn--primary):not(.ni-btn--open):active,
.agentpg-ref-remove:active,
/* the build page's form: adding a field, removing one */
.agentpg-field-add:active,
.agentpg-field-remove:not(:disabled):active,
/* the agent page: a tool's + in Add tools, a trigger's Remove, and the link
   that resolves a mismatch with the instructions */
.agentpg-addbtn:active,
.agentpg-sched-remove:active,
.agentpg-mismatch-fix:active,
/* the agent builder: Discard and Undo all; picking an answer sends it; a
   template or Blank writes the agent */
.builder-btn--secondary:not(:disabled):active,
.builder-btn--ghost:not(:disabled):active,
.chat-question-chip:not(:disabled):active,
.builder-new-template:active,
/* a workflow's canvas: a pick in the "+" picker adds a step, and a small button in
   its inspector or its delete question changes the file; the inspector's foot,
   Run this step and Run from here, each start a run */
.wfpg-picker-row:active,
.wfpg-btn:not(:disabled):active,
.wfpg-insp-btn:not(:disabled):active,
/* the service's pages: Continue with a provider and Link a provider start a
   sign-in, Email me a code and Send a new code each send an email, and Unlink
   removes a way to sign in */
.sp-btn:not(.srf-empty-act--primary):active,
.sp-btn-sm:active,
/* onboarding: Continue before the date is real asks again, a pill fills its
   field, Continue while a username needs work answers it, and Skip on the topic
   picker moves on */
.sp-cbtn:not(.srf-empty-act--primary):active,
.sp-sugg:active,
/* the desktop hand-off: the account button signs the app in; the panel's white
   buttons that act (Cancel, Sign out). Choose a photo opens, below. */
.sp-acct:active,
.sp-sbtn:not([data-href]):not([data-media-pick]):not([data-home-act]):not([data-model-act]):active {
  animation: srf-press-dip var(--dur-quick) var(--ease-out) forwards;
}

/* --- commit, filled: recesses --- */
/* A dip on a solid accent block moves an edge nothing is watching. Pressing
   the block into the page is the same claim made in a way the fill can carry:
   an inner shadow at the top, and the fill itself dropped a shade. */
/* the website: Sign in in the bar, Go to Discover, Get the desktop app */
.ws-btn--primary:active,
.home-new-workspace-btn:active,
/* the composer's floating Post, and the compact Post on a profile: filled blocks */
.cm-fab:active,
.lib-saved-btn.cm-post:active,
.mp-grant-btn:active,
.mp-publish-go:not(:disabled):active,
.pi-btn--primary:not(:disabled):active,
.skills-action--primary:active,
.onb-cta:active,
/* the builder's primary, which the agent page's Start agent wears: it opens
   the run menu, but it is a filled block */
.builder-btn--primary:not(:disabled):active,
.ni-btn--primary:active,
/* the service's code step: Continue signs in */
.sp-btn.srf-empty-act--primary:active,
/* the delete confirm: Delete account removes the account for the grace period */
.sp-dangerfill:active,
/* the desktop account panel's one act per state: Sign in, Continue, Update */
.sp-pbtn:not([data-href]):not([data-model-act]):active,
/* onboarding: Continue records the age, makes the account and saves the topic picks */
.sp-cbtn.srf-empty-act--primary:active,
/* an Open control, but a filled block: the run tab's Edit agent when the agent
   cannot run, and Settings → Models' Add key while nothing is set up, which opens
   the key dialog */
.sp-pbtn[data-model-act]:active,
.chat-run-edit.is-main:active {
  box-shadow: inset 0 2px 5px rgb(0 0 0 / 30%);
  filter: brightness(0.93);
}

/* --- open: tints, and does not move --- */
/* Laid over the control's own ground rather than replacing it, so a card, a
   row and a pill all step one tier without this block knowing what any of
   them rests on. `--color-text-default` inverts between themes, which is what
   makes one declaration darken in light and lighten in dark. */
/* a card's Restricted label opens Settings → Srfice home */
.pcard-restricted:active,
/* the creation page's warning glyph opens the warning's popover */
.mp-risk-btn:active,
/* the creation page's Try it out opens a run tab or the explanation */
.mp-try-btn:active,
/* a pack's item row opens that creation's overview in place, and its
   Creation details link opens that creation's page */
.mp-pack-row-head:active,
.mp-pack-link:active,
/* the account page's Delete account opens the confirm */
.sp-danger:active,
/* a post's tag list: a creation pill opens that creation's page; a creation's
   page: a post row opens the post */
button.thr-pill:active,
/* a post's own page: a topic pill after the title opens that topic on Discover */
.dsc-topic-pill:active,
.cps-row:active,
.avatar-btn:active .avatar:not(img),
/* the folder dialogs: a row's chevron enters a folder, a breadcrumb step goes
   back up to one */
.srf-folder-row__into:active,
.srf-folder-crumbs__step:active,
/* the nav rail: each button goes to its page, as its sidebar row does; and
   the Files column's head, which opens the workspace's page */
.nav-rail-btn:active,
.files-column-name:active,
/* the agent object: the tab's two ways in, and the composer's "+". The mode
   pair is a Toggle and the grip is not a press, so neither is here. Full
   screen and minimize change only where the panel is drawn. */
.fo-tab-btn:active,
.fo-add:active,
.chat-full-btn:active,
.chat-min-btn:active,
/* the editor's tabs: choosing one changes what is on screen */
.editor-tab:active,
.workspace-card:active,
/* a folder's page, and a folder's row in the tree — whose chevron is a Toggle,
   so a press on it leaves the row alone */
.folder-row:active,
.folder-tile:active,
.tree-folder-row:not(:has(> .t-chevron-btn:active)):active,
/* home panels */
/* notifications + activity; Empty cleared opens its confirm */
.feed-empty-cleared:not(:disabled):active,
/* a row tints for a press on itself, not for one on a button in its open
   detail, its Mark as read or a row nested inside it, which answer for
   themselves */
.notif-item:not(:has(.feed-detail:active, .soc-mark-read:active, .notif-item:active)):active,
/* the open detail's Open file and Ask agent; Revert is a commit, above */
.feed-detail-action:not(.feed-detail-action--revert):not(:disabled):active,
.notif-pop-foot:active,
.fmenu-row:active .fmenu-box,
/* discover: the post lanes, and the pointer that opens the Featured one */
.dsc-featured-pointer-link:active,
/* a search's People row opens that person's page */
.srch-person-open:active,
.dsc-post:has(> .dsc-post-open:active),
.dsc-follow:not(.dsc-follow--post):active,
.dsc-follow--post:has(> .dsc-follow-open:active),
.dsc-arrow:active,
/* the image viewer's close and arrows; its zoom toggle answers with nothing */
.iv-close:active,
.iv-nav:active,
.dsc-more-all:active,
.dsc-post-card.is-openable:active,
.dsc-ref:active,
.dsc-tag-chip:active,
.dsc-panel-tolib:active,
/* a person's page, and the shelf of what they kept */
.prf-entry-open:active,
.svp-post-step--prev:not(:disabled):active,
.svp-post-step--next:not(:disabled):active,
.prf-audience:active,
.prf-more:active,
.prf-act:not(:disabled):active,
/* marketplace */
.mp-sort:active,
.mp-publish-open:active,
.mp-yours-open:active,
.pi-row:active,
.mp-card:active,
.mp-consent-dest-btn:active,
.mp-authorrow:active,
.mp-pager-btn:not(.is-gap):not(:disabled):active,
/* the composer: Alt on a tile opens the viewer on that file */
.cm-tile-alt:active,
/* a posted image's ALT pill opens its description */
.cm-alt-badge:active,
/* library */
.lib-saved-btn:active,
/* Edit skill's Try it starter, which opens the skill's trial tab */
.agentpg-starter.is-open:active,
.lib-sort-btn:active,
/* the collection chips' "+", which opens the dialog that makes one, and "+N",
   which opens the menu of the chips that did not fit; the chips themselves are
   toggles and answer with their own state */
.lib-coll-add:active,
.lib-coll-more:active,
/* a Library card's "+N", which opens the topics it leaves out */
.lib-tag--more:active,
/* skills */
.skills-action:not(.skills-action--primary):active,
.skrun-row:active,
button.skres-row:active,
/* settings: a row of the list */
.settings-nav-item:active,
.sp-acct-item:active,
/* editor; a web card's Try live, which shows the site in this view without
   saving anything */
.tag-chip:active,
.embed-card-try:active,
/* a waiting run's Open, which reopens its thread in the panel */
.ni-btn--open:active,
/* agent page: opening a broken link for editing; a section's +, the
   description's pencil and its empty Add a description, a column's "+N more",
   a row that opens its editor or menu, and the way back in Add tools */
.agentpg-ref-edit:active,
.agentpg-sec-add:active,
.agentpg-desc-edit:active,
.agentpg-desc-add:active,
.agentpg-col-more:active,
button.agentpg-row:not(.agentpg-row--check):not(.agentpg-prov):active,
.agentpg-row-hit:active,
.agentpg-pop-back:active,
/* a title, opening as a field where it stands */
.agentpg-inplace:active,
/* the New agent, workflow and skill sheets, and Discover's agents */
.lib-new-item:active,
.builder-new-browse:active,
/* the build page: the ⋯ menu; a Library card's ⋯ */
.agentpg-more:active,
.lib-card-menu:active,
/* the model menu, from the agent page's chip and the composer's text button */
.agentpg-model:active,
.chat-model-text:active,
/* the agent panel: jumping to the latest message (its circle is the ground),
   and a line in the "+" menu that opens the folder picker */
.chat-jump-latest:active,
/* the account menu's top: it opens the person's profile */
.acct-top:active,
.ctx-line.ctx-item:active,
/* the desktop account panel's links out: Manage your account, Turn on at
   srfice.com — they open the browser and change nothing here */
.sp-sbtn[data-href]:active,
.sp-pbtn[data-href]:active,
/* Settings → Srfice home: Open, Move…, Remove… and Add Srfice home… each open a
   question over the page and change nothing until it is answered */
.sp-sbtn[data-home-act]:active,
/* Settings → Models: Add key and Replace key open the key dialog */
.sp-sbtn[data-model-act]:active,
/* the service's media test: Choose a photo opens the file picker */
.sp-sbtn[data-media-pick]:active,
/* a workflow's "+": it opens the picker, and only the circle is a ground */
.wfpg-plus:active > i,
/* the workflow canvas's Fit, a word rather than a glyph: it changes only the
   view, so it tints in place where its glyph neighbours kick */
.wfpg-zoom-btn[data-zoom='fit']:active {
  background-image: linear-gradient(
    color-mix(in srgb, var(--color-text-default) 7%, transparent),
    color-mix(in srgb, var(--color-text-default) 7%, transparent)
  );
}

/* --- bare glyphs: the glyph kicks, the container holds still --- */
/* A borderless glyph has no ground to step and no edge to dip, so the press
   lands on the mark itself — up and to the right, the direction a pen leaves
   paper. The button does not move, which is what keeps this from reading as
   the jitter a shifting bare glyph used to read as. */
/* An icon button that carries `aria-pressed` is a Toggle — a view switch, the
   sidebar's show/hide — and answers with its own pressed state instead. */
.icon-btn:not([aria-pressed]):active > .icon,
.icon-btn:not([aria-pressed]):active > svg,
/* A page's Preview beside carries `aria-pressed` to say the other pane shows
   the page, but its job is to open that pane, not to flip a value: it kicks. */
.icon-btn[data-action='preview-beside']:active > .icon,
/* The workflow canvas's zoom control, likewise: zoom out, zoom in and full
   screen are bare glyphs on the control's ground, each changing only the view. */
.wfpg-zoom-btn:active > .icon,
.nav-fold:active > .icon,
.nav-fold:active > svg,
.tree-act:active > .icon,
.tree-act:active > svg,
.tree-ctl-btn:active > .icon,
.tree-ctl-btn:active > svg,
.pcard-flip:active > .icon,
.pcard-flip:active > svg,
.dsc-act:not(.dsc-act--toggle):not(.dsc-act-share):active > .icon,
.dsc-act:not(.dsc-act--toggle):not(.dsc-act-share):active > svg,
.notif-filter-btn:active > .icon,
.notif-filter-btn:active > svg,
.hpanel-pick-step:active > .icon,
.hpanel-pick-step:active > svg,
.properties-fold:active > .icon,
.properties-fold:active > svg,
.cm-table-col-add:active > .icon,
.cm-table-col-add:active > svg,
.cm-table-col-remove:active > .icon,
.cm-table-col-remove:active > svg,
.cm-table-row-remove:active > .icon,
.cm-table-row-remove:active > svg,
/* The turn foot's controls — copying a reply, re-asking it, and saving it as
   a note. Borderless marks on a row that is itself no object, so the press
   lands on the glyph. */
.chat-turn-foot-btn:active > .icon,
.chat-turn-foot-btn:active > svg,
/* agent page: taking a line out of the file, a row's ×, a folder's × in its menu */
.agentpg-remove:active > .icon,
.agentpg-remove:active > svg,
.agentpg-row-x:active > .icon,
.agentpg-pop-x:active > .icon,
/* a comment's Reply, Edit and Delete: bare text actions that open a box or ask a question */
.cm-comment-act:active,
/* the post composer: its ×, a chip's ×, a tile's ×, the tool glyphs, the viewer's
   way back and arrows */
.cm-close:active > .icon,
.cm-tok-x:active > .icon,
.cm-tile-x:active > .icon,
.cm-tool:not(:disabled):active > .icon,
.cm-lb-nav:active > .icon,
/* the composer's staged tiles: a tile's ×, and the edge chevrons that move the
   row */
.chat-staged-chip-remove:active > .icon,
.chat-staged-arrow:active > .icon,
/* a workflow's rail beside a card (Rename and Delete; the handle is dragged, not
   pressed), and the inspector's ⋯ and its remove marks */
.wfpg-rail-btn:not(.is-grip):active > svg,
.wfpg-pn-more:active > svg,
.wfpg-pn-icon:not(:disabled):not(.wfpg-pn-grip):active > svg,
/* Discover's search box: the phone's magnifier and arrow back, and the ×, are bare
   glyphs that change only the view */
.dsc-search-open:active > .icon,
.dsc-search-open:active > svg,
.dsc-search-back:active > .icon,
.dsc-search-back:active > svg,
.dsc-search-clear:active > .icon,
.dsc-search-clear:active > svg {
  animation: srf-press-kick var(--dur-quick) var(--ease-out) forwards;
}

/* Toggles answer with nothing: a filter pill, a view switch, a segmented
   button, a checkbox, a sort chip, an expand/collapse, a folder's tick in the
   Works in tree and the build page's
   rail icons all paint their own new state, and a press response on top of
   that is a second answer to a question already answered. The selectors that used to dip here are gone
   rather than rewritten — there is no declaration to make. A creation's vote
   thumbs (`.vote-btn`) are toggles too: the pressed thumb fills, which is the
   whole answer. The agent panel's Off-the-record shield
   (`.chat-offrecord-btn`) and the "+" menu's "What this message can see" row
   (`.ctx-disclose-head`) are toggles of this kind, and so is the model menu's
   Key | Subscription track (`.fmenu-billing`). */

/* ==========================================================================
   AUTHORSHIP REGISTER — who wrote this, on the surfaces that mark it
   ==========================================================================

   The memory row draws this: an edge in --color-agent for an entry the agent
   wrote, in --color-accent for one a person did.

   Why an inset shadow rather than a border or an outline: `border-color` is
   already the hover and checked answer on a box, and `outline` is the focus
   ring. Taking either would mean this mark and that state fighting over one
   property, in one theme, with valid CSS. `box-shadow` is unclaimed, and it is
   the property the memory row's edge already uses. */

/* ---------- A workflow's page (library/build/workflow/<id>) ----------
   The shared item header (the agent page's .agentpg-* classes) over a canvas
   of step cards. Families used: F10 card (.wfpg-card), F06 pill (.wfpg-pill),
   F07 label badge (.wfpg-kind, the header status), F17 inline notice (the
   header's problems), F15 sections (.wfpg-pn-sec, the inspector's, in the
   right card), and the page's one F09 embedded card (.wfpg-sheet) holding the
   canvas and the right card. That card fills the window under the
   header; the drawing is absolutely placed from the layout's measurements, so
   nothing here sizes a step card but its fixed width (CARD_W in
   lib/workflow/canvas-geometry.ts). */
.surface-pane--workflow {
  max-width: none;
  padding: 0;
}
.wfpg {
  display: flex;
  flex-direction: column;
}
.wfpg-top {
  width: 100%;
  padding: var(--space-5) var(--space-5) 0;
  box-sizing: border-box;
}
/* One F09 embedded card under the header card, which sets the --space-4 above
   it: the canvas on the left, the right card on the right, sharing its top and
   bottom edges. It ends --space-5 above the window's bottom, never shorter than
   520px; --wfpg-sheet-top is where it starts on the page, measured by
   workflow-card.js. The right card keeps the 260px column and gives up its own
   frame for a left hairline; while the page has put nothing in it, the canvas
   takes the whole card. */
.wfpg-sheet {
  grid-template-columns: minmax(0, 1fr) 260px;
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: none;
  gap: 0;
  align-items: stretch;
  box-sizing: border-box;
  height: max(520px, calc(100vh - var(--wfpg-sheet-top, 260px) - var(--space-5)));
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  background: var(--color-surface-readable);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.wfpg-sheet:has(> .agentpg-margin:empty) {
  grid-template-columns: minmax(0, 1fr);
}
.wfpg-sheet > .agentpg-main {
  grid-area: auto;
  grid-column: 1;
  grid-row: -2;
  display: flex;
  min-height: 0;
}
/* The right card scrolls inside itself, and is not pinned: the card it sits in
   already holds still. */
.wfpg-sheet > .agentpg-margin.agentpg-card {
  grid-area: auto;
  grid-column: 2;
  grid-row: -2;
  position: static;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  border: 0;
  border-left: var(--border-thin) solid var(--color-border-default);
  border-radius: 0;
  box-shadow: none;
}
.wfpg-sheet > .agentpg-margin:empty {
  display: none;
}
.wfpg-canvas {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  background: var(--color-surface-readable);
}
/* Full screen: the card sits over the window, --space-4 from its top, left and
   bottom, and its right edge clears the agent's tucked tab on the right edge:
   the tab's button, its padding either side and its one border, then
   --space-4. The rest of the page steps out from under it, so nothing shows in
   the gutters. */
.wfpg-sheet.is-full {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  bottom: var(--space-4);
  left: var(--space-4);
  z-index: 100;
  height: auto;
  grid-template-rows: 48px minmax(0, 1fr);
}
body:has(> .chat-panel.is-tucked.fo-edge-right) .wfpg-sheet.is-full {
  right: calc(var(--parked-tab-w) + var(--space-4));
}
.surface-pane--workflow:has(.wfpg-sheet.is-full) > :not(.wfpg),
.wfpg-top:has(> .wfpg-sheet.is-full) > :not(.wfpg-sheet) {
  display: none;
}
/* The header folded into a strip at the card's top: the kind tile, the name
   (cut with an ellipsis before the status), the status, then the run action. */
.wfpg-fullbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding: 0 var(--space-3) 0 var(--space-4);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.wfpg-fullbar > .agentpg-kind-tile {
  width: 28px;
  height: 28px;
}
.wfpg-fullbar-name {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-default);
  font-size: var(--fs-15);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wfpg-fullbar-space {
  flex: 1 1 auto;
}
.wfpg-fullbar > :not(.wfpg-fullbar-name, .wfpg-fullbar-space) {
  flex: none;
}
/* Below 900px the card stacks, as the agent page's grid does: the canvas keeps
   the window's height and the right card follows under it behind a top
   hairline. In full screen the right card takes what the canvas leaves, up to
   a share of the window. */
@container main (max-width: 900px) {
  .wfpg-sheet {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    height: auto;
  }
  .wfpg-sheet > .agentpg-main {
    grid-column: 1;
    grid-row: auto;
    height: max(
      520px,
      calc(100vh - var(--wfpg-sheet-top, 260px) - var(--space-5) - 2 * var(--border-thin))
    );
  }
  .wfpg-sheet > .agentpg-margin.agentpg-card {
    grid-column: 1;
    grid-row: auto;
    margin-top: 0;
    border-left: 0;
    border-top: var(--border-thin) solid var(--color-border-default);
    overflow: visible;
  }
  .wfpg-sheet.is-full {
    grid-template-rows: 48px minmax(0, 1fr) auto;
  }
  .wfpg-sheet.is-full > .agentpg-main {
    height: auto;
  }
  .wfpg-sheet.is-full > .agentpg-margin.agentpg-card {
    max-height: 40vh;
    overflow-y: auto;
  }
}
/* The assistant's work on the canvas: the wash behind the step a change line points at
   (a step a change just landed in flashes and fades, with the builder's rule above),
   and the outline the steps a turn changed keep until the next turn. */
.wfpg .is-live-change {
  background-color: var(--color-agent-wash);
  box-shadow: 0 0 0 var(--space-1) var(--color-agent-wash);
  transition: background-color var(--dur-quick) var(--ease-out);
}
.wfpg-card.is-turn-change {
  outline: 2px solid var(--color-agent-edge);
  outline-offset: 2px;
}
/* "Or describe it:" under an empty workflow's one "+". */
.wfpg-describe {
  position: absolute;
  left: 50%;
  bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: min(560px, calc(100% - var(--space-6)));
  transform: translateX(-50%);
}
.wfpg-describe-label {
  color: var(--color-text-muted);
  font-size: var(--fs-13);
  white-space: nowrap;
}
.wfpg-describe-input {
  flex: 1;
  min-width: 0;
  padding: var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-13);
}
.wfpg-scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
}
.wfpg-scaler {
  margin: 0 auto;
}
.wfpg-stage {
  position: relative;
  transform-origin: 0 0;
}
.wfpg-edges {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
}
.wfpg-edge {
  fill: none;
  stroke: var(--color-border-strong);
  stroke-width: 1.5;
}
.wfpg-edge--loop {
  stroke: var(--color-accent);
  stroke-dasharray: 4 4;
}
.wfpg-ah {
  fill: none;
  stroke: var(--color-border-strong);
  stroke-width: 1.5;
}
.wfpg-al {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 1.5;
}
.wfpg-bracket {
  position: absolute;
  box-sizing: border-box;
  border: var(--border-thin) dashed var(--color-border-strong);
  border-radius: var(--radius-3);
  background: var(--color-surface-substrate-2);
}

/* F10 card: a step. */
.wfpg-card {
  position: absolute;
  box-sizing: border-box;
  width: 300px;
  padding: var(--space-2) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  background: var(--color-surface-readable);
  box-shadow: var(--shadow-1);
  color: var(--color-text-default);
  font-size: var(--fs-13);
  cursor: pointer;
}
.wfpg-card:hover {
  border-color: var(--color-border-strong);
}
.wfpg-card:focus-visible,
.wfpg-start:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
.wfpg-card.is-selected,
.wfpg-start.is-selected {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 var(--border-emphasis) var(--color-accent-soft-2);
}
.wfpg-card.is-skipped {
  opacity: 0.6;
}
.wfpg-card-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.wfpg-grow {
  flex: 1 1 auto;
}
.wfpg-num {
  flex: none;
  min-width: 18px;
  height: 18px;
  padding: 0 var(--space-1);
  box-sizing: border-box;
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font-size: var(--fs-11);
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}
.wfpg-kind {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  font-weight: 600;
}
.wfpg-kind-glyph {
  display: inline-flex;
  color: var(--color-accent-strong);
}
.wfpg-kind-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wfpg-glyph {
  display: inline-flex;
  flex: none;
  color: var(--color-text-faint);
}
.wfpg-more,
.wfpg-skip-tag {
  flex: none;
  color: var(--color-text-faint);
  font-size: var(--fs-11);
}
.wfpg-title {
  margin-top: var(--space-1);
  font-size: var(--fs-14);
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.wfpg-title.is-fallback {
  color: var(--color-text-faint);
  font-weight: 400;
  font-style: italic;
}
.wfpg-sum {
  margin-top: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  overflow-wrap: anywhere;
}
.wfpg-dot {
  position: absolute;
  top: calc(var(--space-1) * -1);
  right: calc(var(--space-1) * -1);
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--color-warn-dot);
  border: var(--border-emphasis) solid var(--color-surface-panel);
}
.wfpg-fold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-1);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.wfpg-fold:hover {
  background: var(--color-surface-hover);
}
.wfpg-start {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  background: var(--color-surface-panel);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

/* F06 pill: a lane's name on its line, a loop's limit, a bracket's label. */
.wfpg-pill {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  box-sizing: border-box;
  max-width: 320px;
  padding: 0 var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  background: var(--color-surface-panel);
  color: var(--color-text-muted);
  font-size: var(--fs-11);
  line-height: 20px;
  cursor: pointer;
  /* The layout gives a pill's centre. */
  transform: translate(-50%, -50%);
}
.wfpg-pill--loop {
  border-color: var(--color-accent-soft-2);
  color: var(--color-accent-strong);
}
.wfpg-pill--block {
  background: var(--color-surface-substrate-2);
}
.wfpg-pill-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wfpg-pill-count {
  flex: none;
  white-space: nowrap;
}
.wfpg-note {
  position: absolute;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  box-sizing: border-box;
  max-width: 260px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-2);
  background: var(--color-warn-soft);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
}
.wfpg-note-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Zoom: − 100% + Fit, and full screen, at the canvas's lower left. */
.wfpg-zoom {
  position: absolute;
  left: var(--space-3);
  bottom: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-panel);
  box-shadow: var(--shadow-1);
}
.wfpg-zoom-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 var(--space-1);
  border: 0;
  border-radius: var(--radius-1);
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-12);
  cursor: pointer;
}
.wfpg-zoom-btn:hover {
  background: var(--color-surface-hover);
}
.wfpg-zoom-readout {
  min-width: 40px;
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  text-align: center;
}

/* The right card as a chosen step's inspector: "‹" and the workflow's name,
   the step's number · kind and title, then its sections, which scroll, over a
   foot pinned to the card's bottom edge behind a hairline. */
.wfpg-sheet > .agentpg-margin.is-inspecting {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wfpg-insp {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}
.wfpg-insp-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: var(--space-2);
}
.wfpg-insp-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  max-width: calc(100% - 2 * var(--space-3));
  margin: var(--space-3) var(--space-3) 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--fs-12);
  cursor: pointer;
}
.wfpg-insp-back:hover {
  color: var(--color-text-default);
}
.wfpg-insp-back-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wfpg-pn-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) 0;
}
.wfpg-pn-title {
  margin: var(--space-1) var(--space-3) var(--space-2);
  font-size: var(--fs-15);
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.wfpg-pn-title.is-fallback {
  color: var(--color-text-faint);
  font-weight: 400;
  font-style: italic;
}
.wfpg-pn-body {
  display: flex;
  flex-direction: column;
}
.wfpg-pn-body > .wfpg-pn-problem {
  margin: 0 var(--space-3) var(--space-2);
}
/* A section of the inspector is one of the right card's sections; its words
   sit at the rows' inset. A section an editor fills with the agent page's own
   section (Tools, Skills, Agent) gives its inset to that section. */
.wfpg-pn-sec {
  padding-right: var(--space-3);
  padding-left: var(--space-3);
}
.wfpg-pn-sec > .agentpg-sec-label {
  margin-bottom: var(--space-1);
}
.wfpg-pn-sec[data-edit] {
  padding: 0;
}
.wfpg-pn-sec[data-edit] > .agentpg-sec {
  padding-top: 0;
  padding-bottom: 0;
}
/* "From the workflow": the tools an AI step runs with when it names none. */
.wfpg-pn-inherited {
  padding: 0 var(--space-3) var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
}
.wfpg-pn-sec:not([data-edit]) > .wfpg-pn-inherited {
  padding-right: 0;
  padding-left: 0;
}
/* F04 compact secondary: the foot's Run this step and Run from here. */
.wfpg-insp-btn {
  flex: none;
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-12);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.wfpg-insp-btn:hover {
  border-color: var(--color-border-strong);
}
.wfpg-insp-btn:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
.wfpg-insp-note {
  min-width: 0;
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  line-height: 1.3;
}
.wfpg-pn-problem {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  background: var(--color-warn-soft);
  color: var(--color-warn);
  font-size: var(--fs-13);
  line-height: 1.4;
}
.wfpg-pn-text {
  margin: 0;
  font-size: var(--fs-13);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.wfpg-pn-text--faint,
.wfpg-pn-hint {
  color: var(--color-text-faint);
}
.wfpg-pn-hint {
  font-size: var(--fs-12);
}
.wfpg-pn-line {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}
.wfpg-pn-line-name {
  color: var(--color-text-faint);
  font-size: var(--fs-11);
  font-family: var(--font-mono);
}
.wfpg-pn-missing {
  color: var(--color-danger);
  font-size: var(--fs-12);
}
.wfpg-pn-lanes {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.wfpg-pn-lane {
  display: flex;
  gap: var(--space-2);
}
.wfpg-pn-lane-num {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-substrate-2);
  color: var(--color-text-muted);
  font-size: var(--fs-11);
  line-height: 18px;
  text-align: center;
}
.wfpg-pn-lane-name {
  font-size: var(--fs-13);
  font-weight: 600;
}
.wfpg-chip {
  white-space: normal;
}
.wfpg-chip.broken {
  cursor: pointer;
}
/* The AI sparkle before an argument the model fills in. */
.wfpg-pn-spark {
  display: inline-flex;
  margin-right: var(--space-1);
  color: var(--color-agent);
  vertical-align: -2px;
}

/* The line at the foot of the window that says something was done and offers Undo. */
.undo-toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-5);
  transform: translateX(-50%);
  z-index: 320;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-3);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-panel);
  box-shadow: var(--shadow-3);
  color: var(--color-text-default);
  font-size: var(--fs-13);
}
.undo-toast-act {
  padding: 0 var(--space-2);
  border: 0;
  background: transparent;
  color: var(--color-accent-strong);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
}
/* F04 button, bare text: the update line's Later, plainer than Restart now. */
.undo-toast-quiet {
  padding: 0 var(--space-2);
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--fs-13);
  font-weight: 400;
  cursor: pointer;
}

/* ---------- Editing a workflow on its canvas ----------
   What the page adds when it can write the file. Families used: F12 overlay
   (.wfpg-picker, .wfpg-ask), F05 icon button, compact (.wfpg-rail-btn,
   .wfpg-pn-icon, .wfpg-pn-more), F04 button, compact (.wfpg-btn), F13 text
   input (.wfpg-input, .wfpg-pn-title-input, .wfpg-title-input), F25 segmented
   control (the Fixed | AI fills it switch and Context's mode, built by
   ui-segmented.js), F14 checkbox (Context's list) and F06 chip (the pill that
   names a lane). Nothing here is drawn when the page cannot edit. */

/* The layer of "+" over the drawing. It takes no press itself: only the
   buttons on it do. */
.wfpg-edit-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* A "+" answers along the whole line between two steps: the button is as tall
   as the line and the circle shows where the press will land. Under the last
   step of a sequence, and in an empty one, the circle is always drawn. Open:
   it opens the picker. */
.wfpg-plus {
  position: absolute;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 40px;
  padding: 0;
  border: 0;
  background: none;
  transform: translateX(-50%);
  cursor: pointer;
  pointer-events: auto;
}
.wfpg-plus > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-panel);
  color: var(--color-text-muted);
  opacity: 0;
  transform: scale(0.7);
  transition:
    opacity var(--dur-quick) var(--ease-out),
    transform var(--dur-quick) var(--ease-out);
}
.wfpg-plus:hover > i,
.wfpg-plus:focus-visible > i,
.wfpg-plus.is-end > i,
.wfpg-plus.is-active > i {
  opacity: 1;
  transform: none;
}
.wfpg-plus:hover > i,
.wfpg-plus.is-active > i {
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}
.wfpg-plus:focus-visible {
  outline: none;
}
.wfpg-plus:focus-visible > i {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
/* While a step is dragged the "+" are out of the way and the drop marks show. */
.wfpg-edit-layer.is-dragging .wfpg-plus {
  display: none;
}

/* Drop marks and the ghost of a step being dragged. */
.wfpg-drop {
  position: absolute;
  width: 120px;
  height: 4px;
  border-radius: var(--radius-1);
  background: var(--color-border-strong);
  opacity: 0.5;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.wfpg-drop.is-hot {
  background: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
  opacity: 1;
}
.wfpg-ghost {
  z-index: 330;
  opacity: 0.92;
  box-shadow: var(--shadow-3);
  pointer-events: none;
}
.is-dragging-src {
  opacity: 0.3;
}
body.is-dragging,
body.is-dragging * {
  cursor: grabbing !important;
  user-select: none;
}

/* The rail beside a card, or a block's label, under the pointer: Rename, Delete
   and a handle to drag by. F05 compact, borderless, so each press lands on its
   glyph. */
.wfpg-rail-h {
  position: absolute;
  left: calc(100% + var(--space-2));
  top: 50%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-quick) var(--ease-out);
}
.wfpg-card:hover > .wfpg-rail-h,
.wfpg-card:focus-within > .wfpg-rail-h,
.wfpg-pill:hover > .wfpg-rail-h,
.wfpg-pill:focus-within > .wfpg-rail-h,
.wfpg-rail-h:hover {
  opacity: 1;
  pointer-events: auto;
}
/* A bridge of hover across the gap between the card and its rail. */
.wfpg-rail-h::before {
  content: '';
  position: absolute;
  left: calc(var(--space-2) * -1);
  top: calc(var(--space-2) * -1);
  bottom: calc(var(--space-2) * -1);
  width: var(--space-2);
}
.wfpg-rail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-1);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.wfpg-rail-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.wfpg-rail-btn.is-del:hover {
  color: var(--color-danger);
}
.wfpg-rail-btn.is-grip {
  cursor: grab;
}
.wfpg-rail-btn:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
.wfpg-card.is-dragging-src .wfpg-rail-h,
.wfpg-edit-layer.is-dragging ~ .wfpg-card .wfpg-rail-h {
  display: none;
}

/* A card's title, renamed in place. F13 bare input at the title's own size. */
.wfpg-title-input,
.wfpg-input,
.wfpg-pn-title-input {
  box-sizing: border-box;
  width: 100%;
  padding: var(--space-1) var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font-family: inherit;
  font-size: var(--fs-13);
  line-height: 1.3;
}
.wfpg-title-input {
  margin-top: var(--space-1);
  font-size: var(--fs-14);
  font-weight: 600;
}
.wfpg-pn-title-input {
  width: calc(100% - 2 * var(--space-3));
  margin: var(--space-2) var(--space-3) 0;
  font-size: var(--fs-16);
  font-weight: 600;
}
.wfpg-title-input:focus,
.wfpg-input:focus,
.wfpg-pn-title-input:focus,
.wfpg-pn-json:focus {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.wfpg-input[type='number'] {
  width: 64px;
}

/* F04 button, compact: ghost to add, danger to confirm a delete. */
.wfpg-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: var(--fs-12);
  cursor: pointer;
}
.wfpg-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.wfpg-btn--danger {
  border-color: var(--color-border-default);
  color: var(--color-danger);
}
.wfpg-btn:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}

/* F12 popover: the picker the "+" opens. */
.wfpg-picker,
.wfpg-ask {
  position: fixed;
  z-index: 320;
  box-sizing: border-box;
  width: 300px;
  max-width: calc(100vw - var(--space-4));
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  background: var(--color-surface-readable);
  box-shadow: var(--shadow-3);
  color: var(--color-text-default);
  font-size: var(--fs-13);
}
.wfpg-picker {
  display: flex;
  flex-direction: column;
  max-height: min(460px, calc(100vh - var(--space-5)));
  padding: var(--space-1);
}
.wfpg-picker-filter {
  box-sizing: border-box;
  width: 100%;
  margin-bottom: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font-family: inherit;
  font-size: var(--fs-13);
}
.wfpg-picker-filter:focus {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.wfpg-picker-list {
  overflow-y: auto;
}
.wfpg-picker-group {
  padding: var(--space-2) var(--space-2) 2px;
  color: var(--color-text-faint);
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.wfpg-picker-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-1) var(--space-2);
  border: 0;
  border-radius: var(--radius-1);
  background: transparent;
  color: var(--color-text-default);
  font-family: inherit;
  font-size: var(--fs-13);
  text-align: left;
  cursor: pointer;
}
.wfpg-picker-row:hover,
.wfpg-picker-row.is-active {
  background: var(--color-surface-hover);
}
.wfpg-picker-row.is-paste {
  margin-bottom: var(--space-1);
  border-bottom: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-1) var(--radius-1) 0 0;
}
.wfpg-picker-row > svg {
  flex: none;
  color: var(--color-text-muted);
}
.wfpg-picker-row.is-paste > svg {
  color: var(--color-accent);
}
.wfpg-picker-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wfpg-picker-hint {
  margin-left: auto;
  flex: none;
  color: var(--color-text-faint);
  font-size: var(--fs-11);
}
.wfpg-picker-empty {
  padding: var(--space-3);
  color: var(--color-text-faint);
}

/* F12 popover: which lane of a Branch to keep when it is deleted. */
.wfpg-ask {
  width: 280px;
  padding: var(--space-3) var(--space-4);
}
.wfpg-ask h4 {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-13);
}
.wfpg-ask-opt {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px 0;
  color: var(--color-text-muted);
}
.wfpg-ask-row {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* The inspector's editors. */
.wfpg-insp.is-editing .wfpg-pn-title {
  display: none;
}
/* F05 compact icon button: the step's ⋯ at the end of its number · kind. */
.wfpg-pn-more {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.wfpg-pn-more:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.wfpg-pn-editor {
  max-height: 260px;
  overflow-y: auto;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate);
  padding: var(--space-1) var(--space-2);
  font-size: var(--fs-13);
}
.wfpg-pn-editor .cm-editor {
  background: transparent;
}
.wfpg-pn-editor .cm-editor.cm-focused {
  outline: none;
}
.wfpg-pn-editor:focus-within {
  outline: 1.5px solid var(--color-accent);
  outline-offset: -1px;
}
.wfpg-pn-arg {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}
.wfpg-pn-arg-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.wfpg-pn-arg-head .wfpg-pn-line-name {
  flex: 1 1 auto;
}
.wfpg-pn-arg-head .seg-btn {
  white-space: nowrap;
}
.wfpg-pn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-1);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.wfpg-pn-icon:hover:not(:disabled) {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.wfpg-pn-icon:disabled {
  opacity: 0.4;
  cursor: default;
}
.wfpg-pn-json {
  box-sizing: border-box;
  width: 100%;
  padding: var(--space-2);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate);
  color: var(--color-text-default);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
}
.wfpg-pn-lane--edit {
  align-items: flex-start;
}
.wfpg-pn-lane--edit .wfpg-pn-lane-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.wfpg-pn-grip {
  cursor: grab;
}
.wfpg-pn-lane.is-dragging-src {
  opacity: 0.4;
}
.wfpg-pn-lane-drop {
  height: 3px;
  margin: 0;
  border-radius: var(--radius-1);
  background: var(--color-accent);
  list-style: none;
}
.wfpg-pn-atmost {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.wfpg-pn-checks {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: var(--space-2);
}
.wfpg-pn-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-13);
}
.wfpg-pn-context-mode {
  margin-bottom: var(--space-1);
}

/* ---------- A workflow's run, drawn back on its page ----------
   The run bar over the canvas (F11 toolbar), the Activity list under it
   (F05 list rows), a mark on each card (F07 label badge) and the lines the run
   went along. A step the run never reached is dimmed, never hidden: the page
   still shows the whole workflow. */
.wfpg-canvas.has-run .wfpg-scaler {
  margin-top: var(--space-7);
}
.wfpg-runbar {
  position: absolute;
  top: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 340px;
  max-width: calc(100% - 380px);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  background: var(--color-surface-readable);
  box-shadow: var(--shadow-1);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.wfpg-runbar-what {
  white-space: nowrap;
}
.wfpg-runbar-outcome {
  font-weight: 600;
  white-space: nowrap;
}
.wfpg-runbar-outcome--done {
  color: var(--color-success);
}
.wfpg-runbar-outcome--stopped {
  color: var(--color-danger);
}
.wfpg-runbar-outcome--running,
.wfpg-runbar-outcome--waiting {
  color: var(--color-warn);
}
.wfpg-runbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  min-width: 24px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-default);
  font-size: var(--fs-12);
  cursor: pointer;
}
.wfpg-runbar-btn:hover {
  background: var(--color-surface-hover);
}
.wfpg-runbar-back {
  border: var(--border-thin) solid var(--color-border-default);
}
.wfpg-dot-run {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-text-faint);
}
.wfpg-dot-run--done {
  background: var(--color-success);
}
.wfpg-dot-run--stopped {
  background: var(--color-danger);
}
.wfpg-dot-run--running,
.wfpg-dot-run--waiting {
  background: var(--color-warn-dot);
}

.wfpg-runs {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-4) var(--space-5) var(--space-6);
  box-sizing: border-box;
}
.wfpg-runs-title {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-14);
}
.wfpg-runs-empty {
  color: var(--color-text-faint);
  font-size: var(--fs-13);
}
.wfpg-runs-list {
  display: flex;
  flex-direction: column;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  overflow: hidden;
}
.wfpg-run-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-bottom: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font-size: var(--fs-13);
  text-align: left;
  cursor: pointer;
}
.wfpg-run-row:last-child {
  border-bottom: 0;
}
.wfpg-run-row:hover,
.wfpg-run-row.is-open {
  background: var(--color-surface-hover);
}
.wfpg-run-how {
  color: var(--color-text-faint);
}
.wfpg-run-outcome {
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-muted);
}
.wfpg-run-outcome--stopped {
  color: var(--color-danger);
}

.wfpg-run-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex: none;
  color: var(--color-text-faint);
  font-size: var(--fs-11);
}
.wfpg-run-mark--ok {
  color: var(--color-success);
}
.wfpg-run-mark--failed {
  color: var(--color-danger);
}

/* A step the person let go on without asking wears an open lock, in the
   attention colour: it is the one thing on a card that is not safe by default. */
.wfpg-glyph--unlocked {
  color: var(--color-warn);
}
/* The inspector's foot, pinned to the right card's bottom edge: run this step
   alone, or from here to the end, or the note saying what that needs. */
.wfpg-pn-foot {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-top: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-readable);
}
/* A run holding a question for the person: a hand, the words, its answers. */
.wfpg-waiting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  background: var(--color-warn-soft);
  color: var(--color-warn);
  font-size: var(--fs-13);
  line-height: 1.4;
}
.wfpg-waiting-hand {
  display: inline-flex;
  flex: none;
}
.wfpg-waiting-text {
  flex: 1 1 12ch;
  min-width: 0;
  overflow-wrap: anywhere;
}
.wfpg-waiting-acts {
  display: inline-flex;
  gap: var(--space-2);
}
.wfpg-run-mark--waiting {
  color: var(--color-warn);
}
.wfpg-run-mark--rejected {
  color: var(--color-danger);
}
.wfpg-card[data-run-state='waiting'] {
  border-color: var(--color-warn);
}
.wfpg-card[data-run-state='rejected'] {
  border-color: var(--color-danger);
}
/* The header's status when a run is held for the person: the attention colour, and a link. */
.agentpg-status--waiting {
  background: var(--color-warn-soft);
  border-color: var(--color-warn-soft-2);
  color: var(--color-warn);
}
/* A trigger's fire that was skipped ran nothing, so its row is quiet. */
.wfpg-run-outcome--skipped {
  color: var(--color-text-faint);
}
.wfpg-card[data-run-state='didnt-run'],
.wfpg-bracket[data-run-state='didnt-run'],
.wfpg-pill[data-run-state='didnt-run'] {
  opacity: 0.45;
}
.wfpg-card[data-run-state='failed'] {
  border-color: var(--color-danger);
}
.wfpg-edge.is-travelled {
  stroke: var(--color-success);
}
.wfpg-edge.is-untravelled {
  opacity: 0.33;
}
/* The lane a Branch took, in the travelled line's green. */
.wfpg-pill[data-lane-taken] {
  border-color: var(--color-success);
  background: var(--color-success-soft);
  color: var(--color-success);
}
/* A step inside a loop: which execution the panel shows, between ‹ and ›. */
.wfpg-iter {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}
.wfpg-iter-label {
  flex: 1;
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  font-weight: 600;
  text-align: center;
}
.wfpg-runbar-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.wfpg-run-text {
  max-height: 160px;
  margin: 0;
  padding: var(--space-2);
  overflow: auto;
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate-2);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ============================================================================
   Server pages — the sign-in and account pages the community service renders
   on its own origin, linking this stylesheet rather than a copy of its tokens.

   The frame has no bar: the lockup centred at the top, one card (or, on the
   account page, a card per section) below it, the way back beneath. Every
   class here is prefixed `sp-` and appears only on those pages; the two places
   they depart from the app's own families — composers on the readable surface,
   and text links underlined only under the pointer — are scoped to `.sp-body`
   so the app itself is untouched.
   ============================================================================ */
.sp-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text-default);
  font-family: var(--font-ui);
}
.sp-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-7) var(--space-5) var(--space-5);
  gap: var(--space-5);
}
.sp-page .brand {
  cursor: default;
  padding: 0;
}
.sp-page .brand:hover {
  background: none;
}
.sp-card {
  width: 100%;
  max-width: 380px;
  box-sizing: border-box;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-1);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
/* A form inside a card lays its fields out as the card's own children. */
.sp-form {
  display: contents;
}
.sp-title {
  font-size: var(--fs-22);
  font-weight: 600;
  margin: 0;
}
.sp-lede {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  margin: calc(-1 * var(--space-2)) 0 var(--space-1);
  line-height: 1.5;
}
.sp-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
.sp-btn svg {
  flex: none;
}
/* "Send a new code": the secondary button at its compact size, centred under Continue. */
.sp-btn-sm {
  align-self: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-12);
  background: var(--color-surface-readable);
}
.sp-input {
  width: 100%;
  box-sizing: border-box;
}
.sp-input.is-err {
  border-color: var(--color-danger);
}
.sp-code {
  font-family: var(--font-mono);
  font-size: var(--fs-22);
  letter-spacing: 0.4em;
  text-align: center;
  padding: var(--space-2);
}
.sp-c {
  align-self: center;
}
.sp-msg {
  font-size: var(--fs-12);
  line-height: 1.45;
  margin-top: calc(-1 * var(--space-2));
}
.sp-msg--err {
  color: var(--color-danger);
}
.sp-msg--hint {
  color: var(--color-text-faint);
}
.sp-msg--center {
  text-align: center;
}
/* "or" between the provider buttons and the email field, a hairline either side. */
.sp-or {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.sp-or::before,
.sp-or::after {
  content: '';
  flex: 1;
  border-top: var(--border-thin) solid var(--color-border-default);
}
/* The line under the sign-in buttons that makes continuing the agreement to the
   Terms and Privacy Policy: the last child of the email step's card, a step above
   the card's own gap. Its links are plain text links, underlined under the pointer. */
.sp-terms {
  margin: var(--space-1) 0 0;
  font-size: var(--fs-12);
  line-height: 1.5;
  color: var(--color-text-muted);
  text-align: center;
}
.sp-terms a {
  color: var(--color-accent-strong);
  text-decoration: none;
}
.sp-terms a:hover {
  text-decoration: underline;
}
/* Cloudflare's widget shows only when it needs the person. Hidden, it still
   puts an empty element in the card, which the card would space like any other
   control, so its container pulls itself up by one gap and takes no room. The
   page marks the container while the widget shows (Cloudflare reports both
   moments), and it then sits centred with the card's normal spacing. */
.sp-turnstile {
  display: flex;
  justify-content: center;
  margin-top: calc(-1 * var(--space-3));
}
.sp-turnstile.is-shown {
  margin-top: 0;
}
/* The account page: the frame grown to 640px, a card per section. */
.sp-page--acct {
  gap: var(--space-4);
}
/* A notice about the whole service (read-only, a paused feature): the inline
   notice family at warn severity, as wide as the card it sits above. */
.sp-notice {
  width: 100%;
  max-width: 380px;
  box-sizing: border-box;
  background: var(--color-warn-soft);
  border: var(--border-thin) solid var(--color-warn-soft-2);
  border-radius: var(--radius-2);
  color: var(--color-warn);
  font-size: var(--fs-13);
  line-height: 1.45;
  padding: var(--space-2) var(--space-3);
}
.sp-page--acct .sp-notice {
  max-width: 640px;
}
.sp-acct-top {
  width: 100%;
  max-width: 640px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
/* The website's list of the account's four pages: a card of rows in the settings
   list's own look, the open page marked with the accent's soft ground. */
.sp-acct-list {
  width: 100%;
  max-width: 640px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
}
.sp-acct-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--row-pad) var(--space-2);
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
  font-size: var(--fs-13);
  text-decoration: none;
  transition:
    background-color var(--dur-quick) var(--ease-out),
    color var(--dur-quick) var(--ease-out);
}
.sp-acct-item:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.sp-acct-item.is-active,
.sp-acct-item.is-active:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
.sp-acct-item-icon {
  display: inline-flex;
  flex: none;
}
.sp-acct-item-label {
  flex: 1;
  min-width: 0;
}
/* The open page's title, over its cards. */
.sp-acct-title {
  width: 100%;
  max-width: 640px;
  margin: 0;
  font-size: var(--fs-22);
  font-weight: 600;
  color: var(--color-text-default);
}
/* A setting row whose control is a value and a button side by side (Username, Email). */
.sp-set-ctl.sp-set-ctl--inline {
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
}
.seg--lg.seg--form .seg-btn {
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-13);
}
/* A glyph before a row's name (a device, a decision), top-aligned with the name. */
.sp-set-icon {
  display: inline-flex;
  flex: none;
  color: var(--color-text-muted);
}
.sp-kv--setting > .sp-set-text {
  flex: 1;
}
/* A provider's mark sits before its name on the same line. */
.sp-set-name svg {
  display: inline-block;
  margin-right: var(--space-2);
  vertical-align: -3px;
}
.sp-set-name .sp-tag {
  margin-left: var(--space-1);
  vertical-align: 1px;
}
.sp-set-text .sp-dec-q {
  margin: var(--space-1) 0 0;
}
a.sp-sbtn {
  text-decoration: none;
}
/* A card's footer band: muted ground, a hairline above, its action right-aligned, across the card's bottom. */
.sp-sec-foot {
  display: flex;
  justify-content: flex-end;
  margin: var(--space-4) calc(var(--space-5) * -1) calc(var(--space-4) * -1);
  padding: var(--space-3) var(--space-5);
  border-top: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-substrate);
  border-radius: 0 0 var(--radius-3) var(--radius-3);
}
.sp-set-val {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
/* A button that opens something else ends in its arrow or chevron. */
.srf-empty-act .sp-glyph {
  margin-left: var(--space-1);
  vertical-align: -2px;
}
/* The seg control in a row's control cell keeps its own width. */
.sp-set-ctl .seg {
  flex: none;
}
/* Terms, Privacy and Contact: one card of plain text, then the three pages'
   links beneath it. */
.sp-doc {
  width: 100%;
  max-width: 640px;
  box-sizing: border-box;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-1);
  padding: var(--space-5) var(--space-6);
  color: var(--color-text-default);
  font-size: var(--fs-14);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.sp-doc h1 {
  margin: 0;
  font-size: var(--fs-22);
  font-weight: 600;
}
.sp-doc .sp-doc-date {
  margin: var(--space-1) 0 var(--space-4);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.sp-doc h2 {
  margin: var(--space-5) 0 var(--space-2);
  font-size: var(--fs-15);
  font-weight: 600;
}
.sp-doc h3 {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--fs-14);
  font-weight: 600;
}
.sp-doc p,
.sp-doc ul,
.sp-doc ol {
  margin: 0 0 var(--space-3);
}
.sp-doc ul,
.sp-doc ol {
  padding-left: var(--space-5);
}
.sp-doc a {
  color: var(--color-accent-strong);
  text-decoration: none;
}
.sp-doc a:hover {
  text-decoration: underline;
}
.sp-doc .sp-doc-contact {
  margin: var(--space-4) 0 0;
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.sp-doc-foot {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  font-size: var(--fs-12);
}
.sp-doc-foot a {
  color: var(--color-text-muted);
  text-decoration: none;
}
.sp-doc-foot a:hover,
.sp-doc-foot a[aria-current='page'] {
  color: var(--color-text-default);
}
.sp-doc-foot a:hover {
  text-decoration: underline;
}
.sp-id {
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.sp-id-name {
  font-size: var(--fs-18);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.sp-sec {
  width: 100%;
  max-width: 640px;
  box-sizing: border-box;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-1);
  padding: var(--space-4) var(--space-5);
}
.sp-sec-h {
  font-size: var(--fs-15);
  font-weight: 600;
  margin: 0 0 var(--space-2);
}
.sp-sec-sub {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: var(--space-3) 0 var(--space-1);
}
.sp-sec-h + .sp-sec-sub {
  margin-top: 0;
}
.sp-kv {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: var(--border-thin) solid var(--color-border-default);
  font-size: var(--fs-13);
}
.sp-sec-h + .sp-kv,
.sp-sec-sub + .sp-kv {
  border-top: 0;
}
.sp-kv-v,
.sp-tw-v {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 var(--space-1);
  color: var(--color-text-default);
  overflow-wrap: anywhere;
}
.sp-kv-v small,
.sp-tw-v small {
  color: var(--color-text-muted);
  font-size: var(--fs-12);
}
.sp-kv-v svg,
.sp-tw-v svg {
  flex: none;
}
/* A row's label in the account card ("Username", "Email"): a muted column of its own. */
.sp-kv-l {
  width: 130px;
  flex: none;
  color: var(--color-text-muted);
}
/* A moderator's statement under the heading it explains: left rule, muted words. */
.sp-stmt {
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--color-text-muted);
  border-left: 2px solid var(--color-border-default);
  padding-left: var(--space-3);
}
.sp-stmt b {
  color: var(--color-text-default);
  font-weight: 600;
}
/* A deadline in warn ink, and the label of a row that waits on one or has been approved. */
.sp-warn,
.sp-kv-v small.sp-warn,
.sp-tw-v small.sp-warn {
  color: var(--color-warn);
}
.sp-kv-l.warn {
  color: var(--color-warn);
  font-weight: 600;
}
.sp-kv-l.ok {
  color: var(--color-success);
  font-weight: 600;
}
/* A refused link or unlink, under the rows it is about. */
.sp-sec-msg {
  margin-top: var(--space-1);
}
/* A section's actions beneath its rows: "Link <provider>", each its own width. */
.sp-sec-acts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.sp-sec-acts .sp-btn {
  width: auto;
}
/* The desktop hand-off. The account itself is the one button on "Sign in to
   the desktop app?": the selectable-row shape at chooser scale, its press a
   commit. */
.sp-acct {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  cursor: pointer;
  transition:
    background-color var(--dur-quick) var(--ease-out),
    border-color var(--dur-quick) var(--ease-out);
}
.sp-acct:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}
.sp-acct:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
.sp-acct-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.sp-acct-go {
  flex: none;
  display: flex;
  color: var(--color-text-muted);
}
.sp-who-name {
  font-size: var(--fs-14);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.sp-who-sub {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}
/* An account's initials mark: on the hand-off's button (32px) and in the
   desktop panel's row (40px). */
.sp-acct-av,
.sp-acc-av {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  background: var(--btn-accent-bg);
  color: var(--btn-accent-text);
  font-size: var(--fs-13);
  font-weight: 600;
}
.sp-acc-av {
  width: 40px;
  height: 40px;
}
.sp-p {
  font-size: var(--fs-13);
  line-height: 1.5;
  margin: 0;
  color: var(--color-text-default);
}
.sp-p--muted {
  color: var(--color-text-muted);
}
/* A wider card, for the page that lists what deleting an account withdraws. */
.sp-card--440 {
  max-width: 440px;
}
/* The creations deleting an account withdraws: a bordered list, each with its
   install count beside the name. */
.sp-list {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  list-style: none;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  font-size: var(--fs-13);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.sp-list li small {
  color: var(--color-text-muted);
  font-size: var(--fs-12);
}
/* Delete account on the account page: a quiet red outline that opens the confirm.
   Open bucket in the press block. */
.sp-danger {
  padding: var(--row-pad) var(--space-4);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-danger);
  font: inherit;
  font-size: var(--fs-13);
  font-weight: 600;
}
/* The confirm's one filled red button, the app's danger confirm. Commit,
   filled bucket in the press block. */
.sp-dangerfill {
  padding: var(--row-pad) var(--space-4);
  border-radius: var(--radius-2);
  border: var(--border-thin) solid transparent;
  background: var(--color-danger);
  color: var(--btn-accent-text);
  font: inherit;
  font-size: var(--fs-13);
  font-weight: 600;
  width: 100%;
}
.sp-center {
  text-align: center;
}
/* The manual code the failure page shows, to copy into the app: framed, on
   the readable surface, and not spaced as widely as the 6-digit field. */
.sp-code--manual {
  letter-spacing: 0.2em;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  overflow-wrap: anywhere;
}
/* The compact buttons: filled for the one act a state asks for, white for the
   rest (the account page's row actions, the desktop panel's, the media test's). */
.sp-pbtn,
.sp-sbtn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-2);
  font: inherit;
  font-size: var(--fs-12);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.sp-pbtn {
  border: var(--border-thin) solid transparent;
  background: var(--btn-accent-bg);
  color: var(--btn-accent-text);
}
.sp-sbtn {
  /* Positioned so a file input inside a label of this class can sit under it. */
  position: relative;
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
}
.sp-sbtn:hover {
  border-color: var(--color-border-strong);
}
/* A label wearing the button (the media test's Choose a photo) shows the focus of
   the input it holds. */
.sp-sbtn:focus-within {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
.sp-sbtn svg {
  flex: none;
}

/* Settings → Device → Account → Srfice account, in the app. */
.sp-acc {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 640px;
  margin-top: var(--space-3);
}
/* The website's cards under the account box, apart as the service's own pages set them. */
.sp-acc-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.sp-acc-p {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}
.sp-acc-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  min-width: 0;
}
.sp-acc-who {
  min-width: 0;
}
.sp-acc-name {
  font-size: var(--fs-14);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.sp-acc-sub {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}
.sp-acc-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
/* Settings → Srfice home: a row is the account row with a folder glyph, and its
   buttons sit at the end. A path has no spaces to wrap at, so it breaks anywhere. */
.sp-home-row .sp-acc-who {
  flex: 1;
}
.sp-home-row .sp-acc-acts {
  margin-left: auto;
}
/* The homes are one card: each row runs to the card's edges and the hairlines
   between rows replace the row's own border, as a setting row's do. */
.sp-sec.sp-home-host .sp-home-row {
  margin: 0 calc(var(--space-5) * -1);
  padding: var(--space-4) var(--space-5);
  border: 0;
  border-radius: 0;
}
.sp-sec.sp-home-host .sp-home-row + .sp-home-row {
  border-top: var(--border-thin) solid var(--color-border-default);
}
.sp-sec.sp-home-host > .sp-home-row:first-child {
  margin-top: calc(var(--space-4) * -1);
}
.sp-sec.sp-home-host .sp-home-add {
  margin-top: var(--space-4);
}
.sp-home-glyph {
  flex: none;
  color: var(--color-text-muted);
}
/* A home whose folder is gone: the glyph steps back, the sub line carries the warning. */
.sp-home-row[data-missing] .sp-home-glyph {
  color: var(--color-text-faint);
}
.sp-home-now {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.sp-home-add {
  align-self: flex-start;
}
/* Settings → Srfice home: the sub line is the fold. A button wearing the sub line's
   type, with the chevron after the counts; a press only reveals the rows, so it
   answers with nothing. */
.sp-home-fold {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.sp-home-fold:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
.sp-home-fold-chevron {
  flex: none;
}
/* An unfolded home wraps its workspaces onto a second line, under a hairline, indented
   to the name column (the 18px glyph and the row's gap). */
.sp-home-row {
  flex-wrap: wrap;
}
.sp-home-ws {
  flex: 0 0 calc(100% - 18px - var(--space-3));
  min-width: 0;
  margin-left: calc(18px + var(--space-3));
  border-top: var(--border-thin) solid var(--color-border-default);
}
.sp-home-ws-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}
.sp-home-ws-row + .sp-home-ws-row {
  border-top: var(--border-thin) solid var(--color-border-default);
}
/* A long name gives way before "Restricted" and the switch do. */
.sp-home-ws-name {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-13);
  color: var(--color-text-default);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-home-ws-label {
  flex: none;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.sp-home-ws-row .sp-acc-warn {
  flex: none;
}

/* F29 switch — one setting that is on or off. A 40 x 24 track, an 18px knob inset 3px.
   On is the accent with the knob at the end, off is the neutral border colour with the
   knob at the start; there is no text in it. A switch where off is a warning (Trusted)
   asks for the danger-off variant and is red when off. Press: toggle, which answers
   with nothing. */
.srf-switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--color-border-strong);
  cursor: pointer;
}
.srf-switch--danger-off {
  background: var(--color-danger);
}
.srf-switch[aria-checked='true'] {
  background: var(--color-accent);
}
.srf-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--color-surface-readable);
}
.srf-switch[aria-checked='true']::after {
  left: 19px;
}
.srf-switch:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
/* Add Srfice home…: the first-launch card inside a dialog, with the dialog's own frame. */
.srf-dialog--home-setup {
  max-width: 420px;
}
.sp-body--over {
  min-height: 0;
  background: none;
}
.sp-body--over .sp-page {
  padding: 0;
}
.sp-body--over .sp-card {
  max-width: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.sp-acc-fine {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  line-height: 1.5;
}
.sp-acc-err {
  font-size: var(--fs-12);
  color: var(--color-danger);
}
.sp-acc-warn {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-warn);
}
.sp-acc-wait {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-13);
  color: var(--color-text-default);
}
@keyframes sp-spin {
  to {
    rotate: 1turn;
  }
}
.sp-spin {
  flex: none;
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border-radius: var(--radius-pill);
  border: 2px solid var(--color-border-default);
  border-top-color: var(--color-accent);
  animation: sp-spin 0.9s linear infinite;
}
.sp-acc-code {
  display: flex;
  gap: var(--space-2);
}
.sp-acc-code .srf-dialog-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  letter-spacing: 0.2em;
  background: var(--color-surface-readable);
}
/* A deleted or suspended account covers the whole window with its page; the
   app is still there underneath, as it was. */
.sp-cover {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  overflow: auto;
  background: var(--color-bg);
  color: var(--color-text-default);
  font-family: var(--font-ui);
}
/* As on the service's pages, a link here is marked by its colour and
   underlined only under the pointer. */
.sp-cover .ctx-link,
.sp-acc .ctx-link {
  text-decoration: none;
}
.sp-cover .ctx-link:hover,
.sp-acc .ctx-link:hover {
  text-decoration: underline;
}
/* The suspended page's Appeal is a link wearing the filled button; its text is not underlined. */
.sp-cover a.srf-empty-act {
  text-decoration: none;
}
/* Delete account on the suspended page: a quiet link in the danger ink. */
.sp-cover .ctx-link--danger,
.sp-acc .ctx-link--danger {
  color: var(--color-danger);
}

/* On these pages a composer sits on the readable surface, never the substrate grey. */
.sp-body .srf-dialog-input {
  background: var(--color-surface-readable);
}
/* On these pages a text link is marked by its colour, and underlined only under the pointer. */
.sp-body .ctx-link {
  text-decoration: none;
}
.sp-body .ctx-link:hover {
  text-decoration: underline;
}
/* The media test panel on the account page: the photo beside what is happening
   to it, in the photo-state family (a 72px photo, then the message, the meter or
   the way to pick another). Waiting reads faint and the photo fades; refusals
   read in danger ink; a cleared photo reads in success ink. */
.sp-sec-p {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0 0 var(--space-3);
}
.sp-msg--wait {
  color: var(--color-text-faint);
}
.sp-msg--ok {
  color: var(--color-success);
}
.sp-ph {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}
.sp-ph-img {
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--color-surface-substrate-2);
  object-fit: cover;
}
.sp-ph-img.is-wait {
  opacity: 0.45;
}
.sp-ph-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  min-width: 0;
}
.sp-ph-side .sp-msg {
  margin-top: 0;
}
.sp-meter {
  width: 120px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-substrate-2);
  overflow: hidden;
}
.sp-meter i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--color-accent);
  transition: width var(--dur-quick) var(--ease-out);
}
/* The file input inside it: there to be clicked through the label, never drawn. */
.sp-media-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
/* The account page's line under the person's name: their username. */
.sp-id-sub {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

/* Onboarding: the age card and the username card. A card with its heading and
   lede centred over centred fields (the age card, the refusal). */
.sp-card--c .sp-title,
.sp-card--c .sp-lede {
  text-align: center;
}
/* The date of birth: Day · Month · Year side by side, each labelled above,
   values centred in tabular figures. */
.sp-dob2 {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  align-items: flex-start;
}
.sp-dob2 label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.sp-dob2 input {
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
}
.sp-dob2 .d {
  width: 64px;
}
.sp-dob2 .m {
  width: 72px;
}
.sp-dob2 .y {
  width: 88px;
}
.sp-dob2 .is-err {
  border-color: var(--color-danger);
}
/* Under the fields: a number offered back, and the one line that says what is
   missing. It keeps its height empty, so the card does not grow under the
   pointer when either appears. */
.sp-under {
  min-height: 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
}
.sp-err {
  flex-basis: 100%;
  font-size: var(--fs-12);
  color: var(--color-danger);
  text-align: center;
}
/* A one-press pick: a number offered back, or a username that is free. The
   F06 token shape in the accent-soft tier. */
.sp-sugg {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  border: var(--border-thin) solid var(--color-accent-soft-2);
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font: inherit;
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
}
.sp-sugg:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
.sp-sugrow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: calc(-1 * var(--space-1));
}
/* The answer read back before it counts. */
.sp-echo {
  margin: 0;
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--color-text-default);
}
.sp-echo b {
  font-weight: 600;
}
.sp-echo.c {
  text-align: center;
}
/* Continue and Finish: the default size, centred, never wider than the fields. */
.sp-cbtn {
  align-self: center;
  min-width: 120px;
}
.sp-label {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  margin-bottom: calc(-1 * var(--space-2));
}
/* The topic picker: Discover's pill (`.dsc-chip`) as tick boxes, so the form posts
   the picks with no script. The box is hidden but still takes the keyboard; the
   ticked look is the pill's active look, and the pill rests on the card's white. */
.sp-topics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}
.sp-topic {
  position: relative;
  display: inline-flex;
}
.sp-topic-box {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.sp-topic-pill {
  padding: var(--row-pad) var(--space-3);
  background: var(--color-surface-readable);
  font-size: var(--fs-13);
}
.sp-topic-box:checked + .sp-topic-pill {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}
.sp-topic-box:focus-visible + .sp-topic-pill {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 2px;
}
/* Skip and Continue, side by side under the pills. */
.sp-topics-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
}
.sp-topics-actions .sp-cbtn {
  min-width: 120px;
}
/* The username field: the "@" inside the composer, before what is typed. */
.sp-field {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-strong);
  border-radius: var(--radius-2);
  padding: 0 var(--space-3);
}
.sp-field:focus-within {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: 1px;
}
.sp-field.is-err {
  border-color: var(--color-danger);
}
.sp-field span {
  color: var(--color-text-faint);
  font-size: var(--fs-13);
}
.sp-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: var(--fs-13);
  padding: var(--row-pad) 0;
  color: var(--color-text-default);
}
.sp-help {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  line-height: 1.45;
  margin-top: calc(-1 * var(--space-2));
}
/* A help line that sits on its own, or beside a button, rather than under a field. */
.sp-help--flush {
  margin: 0;
}
.sp-help--beside {
  margin: 0;
  align-self: center;
}
/* The first-launch card's Location: the field and its Browse button side by side. */
.sp-row {
  display: flex;
  gap: var(--space-2);
}
.sp-row .sp-input {
  flex: 1;
  width: auto;
  min-width: 0;
}
/* A field with its label and message, hidden together when the card has no use for it. */
.sp-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
/* While the first-launch screen is up, nothing else the app mounts in the page shows
   (the floating agent tab, its hint). */
html[data-first-launch] body > :not(.sp-body):not(script) {
  display: none;
}
/* The link under the first-launch card. */
.sp-add {
  align-self: center;
  font-size: var(--fs-13);
}
/* The Add card: a long path breaks anywhere rather than widening the card. */
.sp-add-card .sp-lede,
.sp-add-card .sp-help,
.sp-missing-card .sp-lede,
.sp-missing-card .sp-msg {
  overflow-wrap: anywhere;
}
/* The move's progress lays itself out as the card does: one column, the card's gap. */
.sp-move {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.sp-move .sp-cbtn {
  align-self: flex-start;
}
/* The meter takes the card's full width, and a long path breaks anywhere. */
.sp-move .sp-meter {
  width: 100%;
}
.sp-move .sp-lede {
  overflow-wrap: anywhere;
}
/* The trust line: the info glyph beside the text, the glyph level with the first line. */
.sp-help--icon {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}
.sp-help--icon svg {
  flex: none;
  margin-top: 1px;
}
/* The Add card's workspaces: a bordered list that caps and scrolls when it is long. */
.sp-wl-ws {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
}
.sp-wl-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--row-pad) var(--space-3);
  font-size: var(--fs-13);
  color: var(--color-text-default);
}
.sp-wl-row + .sp-wl-row {
  border-top: var(--border-thin) solid var(--color-border-default);
}
.sp-wl-row svg {
  flex: none;
  color: var(--color-text-muted);
}
.sp-wl-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
/* The Add card's two buttons: stacked, centred, both as wide as the wider label. */
.sp-wl-acts {
  display: grid;
  grid-template-columns: max-content;
  justify-content: center;
  gap: var(--space-2);
}
.sp-wl-acts .sp-cbtn {
  min-width: 0;
}
/* The username line's other answers: free, checking, and the service busy. */
.sp-msg--ok {
  color: var(--color-success);
}
.sp-msg--wait {
  color: var(--color-text-faint);
}
.sp-msg--neutral {
  color: var(--color-text-muted);
}
/* Fine print: the refusal's line about a mistake. */
.sp-fine {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  line-height: 1.5;
  text-align: center;
}

/* ---------- the web shell (srfice.com) ----------
   The frame the website draws around every page: the bar's Sign in and quiet
   desktop link, the avatar menu, the sidebar's desktop group and foot, the
   phone's drawer, the signed-out card and the two states that stand in for a
   page. Every rule is reached only by markup the web host draws, so the
   desktop and the render harness are unchanged. */

/* F04 buttons in the white composer treatment, two sizes. */
.ws-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-12);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.ws-btn:hover {
  background: var(--color-surface-hover);
}
.ws-btn--lg {
  padding: var(--row-pad) var(--space-4);
  font-size: var(--fs-13);
}
.ws-btn--primary {
  background: var(--btn-accent-bg);
  color: var(--btn-accent-text);
  border-color: transparent;
}
.ws-btn--primary:hover {
  background: var(--btn-accent-bg);
  filter: brightness(1.05);
}

.ws-dl-card {
  max-width: 480px;
}
.ws-dl-fine {
  margin-top: var(--space-3);
}
/* The download page: one row per system, the visitor's own outlined. */
.ws-dl {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.ws-dl-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
}
.ws-dl-row.is-you {
  border-color: var(--color-border-strong);
}
.ws-dl-os {
  font-size: var(--fs-14);
  font-weight: 600;
}
.ws-dl-sub {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.ws-dl-row .ws-btn,
.ws-dl-none {
  margin-left: auto;
}
.ws-dl-row .ws-btn {
  text-decoration: none;
}
.ws-dl-none {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}

/* The Windows warning under the Windows row: a neutral inline notice with the steps one click away. */
.ws-dl-note {
  padding: var(--space-2) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate-2);
  font-size: var(--fs-12);
  line-height: 1.5;
  color: var(--color-text-muted);
}
.ws-dl-note strong {
  font-weight: 600;
  color: var(--color-text-default);
}
.ws-dl-more {
  margin-top: var(--space-1);
}
.ws-dl-more > summary {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  width: fit-content;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--color-text-default);
}
.ws-dl-more > summary::-webkit-details-marker {
  display: none;
}
.ws-dl-more > summary svg {
  flex: none;
  transition: transform var(--dur-quick) var(--ease-out);
}
.ws-dl-more[open] > summary svg {
  transform: rotate(90deg);
}
.ws-dl-more ol {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* F12 menu, account variant: the avatar's menu is 288px wide on both hosts. Its
   top is the person (name over @handle, opening the profile) or, signed out,
   the invitation; the theme row carries a compact F25 of glyph segments. */
.ctx-menu--account {
  width: 288px;
}
.acct-top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  color: var(--color-text-default);
  text-align: left;
}
.acct-top:hover {
  background: var(--color-surface-hover);
}
.acct-top .avatar {
  width: 40px;
  height: 40px;
  font-size: var(--fs-13);
}
.acct-top-words {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}
.acct-top-words b {
  font-size: var(--fs-13);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-top-words span {
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-top > svg {
  flex: none;
  color: var(--color-text-faint);
}
.acct-invite {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
}
.acct-invite-line {
  font-size: var(--fs-13);
  color: var(--color-text-default);
}
.acct-invite-acts {
  display: flex;
  gap: var(--space-2);
}
.acct-theme {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-1) 10px;
  font-size: var(--fs-13);
  color: var(--color-text-default);
}
.acct-theme-icon {
  display: inline-flex;
  flex: none;
  color: var(--color-text-faint);
}
.acct-theme-label {
  flex: 1 1 auto;
}
/* A segment drawn as a glyph in place of words (the theme row's choices). */
.seg-btn--glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-3);
}

/* The admin area's sidebar sits a step below its bar; the foot holds the site links. */
.nav-sidebar--web {
  padding-top: var(--space-2);
}
.ws-nav-foot {
  margin-top: auto;
  padding: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
.ws-nav-foot a {
  color: inherit;
  text-decoration: none;
}
.ws-nav-foot a:hover {
  text-decoration: underline;
}

/* The phone's drawer, over a scrim. */
.ws-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border-right: var(--border-thin) solid var(--color-border-default);
  box-shadow: var(--shadow-2);
  z-index: 1000;
  overflow-y: auto;
}
/* The drawer holds the Sidebar itself, across the drawer's width; its own toggle
   has nothing to collapse here. */
.ws-drawer .nav-sidebar {
  flex: 1;
  width: auto;
  border-right: 0;
}
.ws-drawer .nav-sidebar-toggle {
  display: none;
}
.ws-drawer-head {
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.ws-scrim {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 35%);
  z-index: 999;
}

/* The signed-out card. */
.ws-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-5);
  max-width: 520px;
  box-sizing: border-box;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-1);
}
.ws-card-title {
  font-size: var(--fs-15);
  font-weight: 600;
}
.ws-card-copy {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.ws-card .ws-btn {
  margin-top: var(--space-2);
}

/* Not found and cannot be reached, centred in the pane. */
.ws-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: calc(var(--space-7) * 2) var(--space-5);
  max-width: 440px;
  margin: 0 auto;
}
.ws-state-title {
  font-size: var(--fs-22);
  font-weight: 600;
  color: var(--color-text-default);
}
.ws-state-copy {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.ws-state-acts {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-2);
}

/* The signed-out bar: along the bottom of the page area, from the sidebar's edge to
   the window's right edge, on every page of the website while nobody is signed in.
   The sidebar's width is --tree-w, so a collapsed sidebar widens it. Its shadow is
   clipped at the left, right and bottom edges so none falls on the sidebar, and it
   sits under dialogs, the menus and the sidebar's peek. The page's own content ends
   with the bar's height so it never covers a last row, and the one pinned element
   the website has at the bottom (the undo toast) lifts above it. The phone has no
   bar: the top bar carries a Create account button there. */
.ws-signedout-bar {
  --ws-signedout-bar-h: 60px;
  position: fixed;
  right: 0;
  bottom: 0;
  left: var(--tree-w, 256px);
  z-index: 30;
  box-sizing: border-box;
  height: var(--ws-signedout-bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-3) var(--space-5);
  background: var(--color-surface-readable);
  border-top: var(--border-thin) solid var(--color-border-default);
  box-shadow: var(--shadow-2);
  clip-path: inset(-32px 0 0 0);
}
.ws-signedout-words {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ws-signedout-title {
  font-size: var(--fs-15);
  font-weight: 600;
  color: var(--color-text-default);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-signedout-copy {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-signedout-acts {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.ws-signedout-app {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  text-decoration: underline;
  white-space: nowrap;
}
.ws-signedout-app:hover {
  color: var(--color-text-default);
}
@media (max-width: 1000px) {
  .ws-signedout-copy {
    display: none;
  }
}
body[data-signed-out-bar] .main--surface {
  padding-bottom: 60px;
}
body[data-signed-out-bar] .undo-toast {
  bottom: calc(60px + var(--space-3));
}

/* The server-rendered first paint of a shared page: the app's 56px bar with the
   lockup alone, and the 640px reading column below it. The app replaces both
   when it mounts. */
.ws-ssr-bar {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-5);
  box-sizing: border-box;
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.ws-ssr-bar .brand {
  color: inherit;
  text-decoration: none;
}
.ws-ssr-main {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.ws-ssr-meta {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.ws-ssr-main h1 {
  margin: 0;
  font-size: var(--fs-22);
  line-height: 1.25;
  font-weight: 600;
}
.ws-ssr-main p {
  margin: 0;
  font-family: var(--font-prose);
  font-size: var(--fs-15);
  line-height: 1.6;
}
.ws-ssr-img {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-3);
  background: var(--color-surface-substrate);
  border: var(--border-thin) solid var(--color-border-default);
}

/* ==========================================================================
   Compose: the Post button, the composer dialog, its pickers, the media tray
   and the viewer. Extends the shipped families (F04 buttons, F06 chips, F11
   dialog, F12 menu, F13 fields, F16 meter, F17 notice) and adds only the
   arrangement; `cm-` prefixes every rule.
   ========================================================================== */

.cm-write {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px var(--space-4);
}
.cm-write .icon,
.cm-write svg {
  width: 14px;
  height: 14px;
}
/* On a phone the button in the row gives way to the floating one. */
.cm-fab {
  display: none;
}
@media (max-width: 700px) {
  .cm-write {
    display: none;
  }
  .cm-fab {
    position: fixed;
    right: var(--space-5);
    bottom: var(--space-5);
    z-index: 300;
    width: 52px;
    height: 52px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--btn-accent-bg);
    color: var(--btn-accent-text);
    box-shadow: var(--shadow-3);
    cursor: pointer;
  }
  .cm-fab {
    display: inline-flex;
  }
}

.lib-saved-btn.cm-post {
  gap: 4px;
  background: var(--btn-accent-bg);
  color: var(--btn-accent-text);
  border-color: transparent;
  font-weight: 600;
}
.lib-saved-btn.cm-post:hover {
  background: var(--btn-accent-bg);
  border-color: transparent;
  filter: brightness(1.06);
}
.cm-post .icon,
.cm-post svg {
  width: 12px;
  height: 12px;
}

/* The composer dialog (600px wide; the whole screen at 700px and narrower). It
   is 560px tall from the moment it opens, however many creations, people or
   topics are added, and steps up to 660px once when the first picture arrives
   (.cm-has-media). The body field takes up the slack, never under 72px, then
   scrolls inside. The window caps it, less --space-5 above and below. */
.cm-dialog {
  position: relative;
  max-width: 600px;
  box-sizing: border-box;
  height: 560px;
  max-height: calc(100vh - 2 * var(--space-5));
  gap: var(--space-3);
}
.cm-dialog.cm-has-media {
  height: 660px;
}
.cm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cm-close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--color-text-muted);
  border-radius: var(--radius-2);
  cursor: pointer;
}
.cm-close:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.cm-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}
.cm-about {
  align-self: flex-start;
  gap: 6px;
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
}
.cm-about .icon,
.cm-about svg {
  width: 14px;
  height: 14px;
}
.cm-chosen {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  align-items: center;
}
.cm-add {
  width: 26px;
  height: 26px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}
/* F06 token chips: a creation or a tagged person, each with its own ×. */
.cm-tok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 10px;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  background: var(--color-surface-readable);
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-text-default);
}
.cm-tok.is-bad {
  border-color: var(--color-danger);
  color: var(--color-danger);
}
.cm-tok .icon,
.cm-tok svg {
  width: 13px;
  height: 13px;
}
.cm-tok-x {
  display: inline-flex;
  border: 0;
  background: none;
  padding: 2px;
  border-radius: 50%;
  color: var(--color-text-faint);
  cursor: pointer;
}
.cm-tok-x:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.cm-glyph {
  display: inline-flex;
  color: var(--color-text-muted);
}
.cm-glyph .icon,
.cm-glyph svg {
  width: 15px;
  height: 15px;
}
/* The title grows with its text. */
.cm-title-wrap {
  position: relative;
}
.cm-title {
  width: 100%;
  box-sizing: border-box;
  font-size: var(--fs-15);
  font-weight: 600;
  padding: 9px 12px;
  resize: none;
  overflow: hidden;
  line-height: 1.4;
  display: block;
  font-family: inherit;
}
/* The body holds chips, so it is an editable box rather than a textarea. In the
   composer dialog it is the one part of the form that stretches. */
.cm-body-ed {
  min-height: 180px;
  box-sizing: border-box;
  padding: 10px 12px;
  line-height: 1.6;
  font-size: var(--fs-13);
  position: relative;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
}
.cm-dialog .cm-body-ed {
  flex: 1 1 auto;
  min-height: 72px;
  overflow-y: auto;
}
.cm-body-ed:focus {
  outline: none;
  border-color: var(--color-accent);
}
.cm-body-ed:empty::before {
  content: attr(data-placeholder);
  color: var(--color-text-faint);
  pointer-events: none;
}
.cm-with {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
/* The Topics row: its label (or the line saying the creations cover more than
   three), a toggle pill per topic (`.dsc-chip`) and the add circle the creation
   row uses (`.cm-add`). A suggestion that is not chosen is dashed and faint. */
.cm-topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.cm-topics-label,
.cm-topics-over {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.cm-topics-label {
  font-weight: 600;
}
.cm-topics-over {
  flex: 1 0 100%;
}
.cm-topics .dsc-chip:not(.is-active) {
  background: var(--color-surface-readable);
}
.cm-topics .dsc-chip.is-suggested {
  border-style: dashed;
  color: var(--color-text-faint);
}
.cm-topics .dsc-chip.is-locked,
.cm-topics .dsc-chip.is-locked:hover {
  border-color: var(--color-border-default);
  color: var(--color-text-faint);
  cursor: default;
}
/* The tool row: two 36px accent glyphs. */
.cm-tools {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  border-top: var(--border-thin) solid var(--color-border-default);
  padding-top: var(--space-3);
}
.cm-tool {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--color-text-muted);
  border-radius: var(--radius-2);
  cursor: pointer;
}
.cm-tool:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.cm-tool--big {
  width: 36px;
  height: 36px;
  color: var(--color-accent);
}
.cm-tool--big .icon,
.cm-tool--big svg {
  width: 22px;
  height: 22px;
}
.cm-tool:disabled {
  opacity: 0.4;
  cursor: default;
}
.cm-foot {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.cm-spacer {
  flex: 1;
}
.cm-reason {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  margin-right: var(--space-2);
}
.cm-notice-text {
  flex: 1;
}
.srf-dialog-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.cm-confirm {
  z-index: 500;
}
@media (max-width: 700px) {
  .srf-dialog-backdrop.cm-full {
    padding: 0;
    align-items: stretch;
  }
  .cm-full .cm-dialog {
    max-width: none;
    border-radius: 0;
    border: 0;
    height: 100%;
    max-height: none;
  }
  .cm-full .cm-body-ed {
    flex: 1;
  }
  .cm-foot {
    flex-wrap: wrap;
    row-gap: var(--space-2);
  }
  .cm-foot .cm-spacer {
    flex-basis: 100%;
    height: 0;
  }
  .cm-foot .srf-dialog-btn {
    flex: 1;
  }
}

/* The Share menu, in the one picker's dress: 220px wide, placed by script under
   its button. The glyphs are the muted ink, the sites' marks included. */
.cm-menu.cm-menu--share {
  position: fixed;
  width: 220px;
  max-width: none;
}
/* The rule's --space-1 above and below is padding rather than margin, because
   the rows' 1px margin would swallow part of a margin and the menu would measure
   a pixel short of the design's 154. */
.cm-menu--share .fmenu-sep {
  box-sizing: content-box;
  margin: 0;
  padding: var(--space-1) 0;
  background-clip: content-box;
}
.cm-menu--share .fmenu-glyph {
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
}

/* The one picker (F12): a floating menu of 26px rows, a plain search line with
   its count, a tick at the end of chosen rows, sentence-case group labels and a
   foot. A row answers a press with its tick, so it is a toggle in the press
   block and has no press rule of its own. */
.cm-menu {
  position: absolute;
  display: flex;
  flex-direction: column;
  width: 300px;
  max-width: calc(100% - 2 * var(--space-4));
  max-height: 304px;
  overflow: hidden;
  z-index: 400;
}
.cm-menu--narrow {
  width: 240px;
}
.cm-menu-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
/* A row's geometry and its selected ground are declared once for the picker's
   rows and the note editor's completion menu (CodeMirror's own autocomplete,
   which keeps its keyboard, filtering and insertion), so the two cannot drift.
   The completion selectors carry CodeMirror's full tooltip prefix so they
   out-rank its base theme in both themes. */
.cm-menu .fmenu-row,
.cm-tooltip.cm-tooltip-autocomplete > ul > li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 26px;
  margin-bottom: 1px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-2);
  color: var(--color-text-default);
  font-family: var(--font-ui);
  font-size: var(--fs-13);
  line-height: normal;
  white-space: nowrap;
}
/* One row looks selected: the pointer moves the keys' row, so the hover ground
   is not a second one. */
.cm-menu .fmenu-row:hover {
  background: transparent;
}
.cm-menu .fmenu-row.is-active,
.cm-menu .fmenu-row.is-active:hover,
html .cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected],
html[data-theme='light'] .cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected],
html[data-theme='dark'] .cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected] {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
/* A row that cannot be chosen right now (the topic list at three): faint, and it
   keeps no selected ground. */
.cm-menu .fmenu-row.is-locked,
.cm-menu .fmenu-row.is-locked:hover,
.cm-menu .fmenu-row.is-locked.is-active {
  color: var(--color-text-faint);
  background: transparent;
  cursor: default;
}
/* The note editor's completion menu ("/" and "[[") on the picker's surface. It
   is not the picker's .fmenu, whose overflow would clip the hover panel CodeMirror
   draws beside the list, so the surface values are repeated here with the same
   tokens, and the list scrolls inside it. */
.cm-tooltip.cm-tooltip-autocomplete {
  min-width: 240px;
  padding: var(--space-1);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-3);
}
.cm-tooltip.cm-tooltip-autocomplete > ul {
  font-family: var(--font-ui);
  font-size: var(--fs-13);
  max-height: calc(304px - 2 * var(--space-1));
  min-width: 0;
  border-radius: inherit;
  overflow: hidden auto;
}
.cm-tooltip.cm-tooltip-autocomplete .cm-completionLabel {
  color: inherit;
}
/* The matched substring CodeMirror marks while it filters. */
.cm-tooltip.cm-tooltip-autocomplete .cm-completionMatchedText {
  font-weight: 600;
  text-decoration: none;
}
/* The syntax hint (`#`, `---`, `- [ ]`) sits right beside the name, small. */
.cm-tooltip.cm-tooltip-autocomplete .cm-completionDetail {
  margin: 0;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  font-style: normal;
  font-size: var(--fs-12);
}
.cm-tooltip.cm-tooltip-autocomplete .cm-completionIcon {
  display: none;
}
.cm-tooltip.cm-tooltip-autocomplete .cm-completionGlyph {
  display: flex;
  flex: none;
  color: var(--color-text-muted);
}
.cm-menu .fmenu-label {
  flex: 0 1 auto;
}
.cm-menu .fmenu-hint {
  flex: 0 100 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cm-menu .fmenu-head {
  padding: var(--space-2) var(--space-2) var(--space-1);
  font-size: var(--fs-12);
  letter-spacing: normal;
  text-transform: none;
}
.fmenu-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2) var(--space-2);
  margin-bottom: var(--space-1);
  border-bottom: var(--border-thin) solid var(--color-border-default);
  color: var(--color-text-faint);
}
.fmenu-search .icon {
  display: flex;
  flex: none;
}
.fmenu-search-field {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--color-text-default);
  font: inherit;
  font-size: var(--fs-13);
}
.fmenu-check {
  display: flex;
  flex: none;
  margin-left: auto;
  color: var(--color-accent);
}
.fmenu-foot {
  padding: var(--space-2) var(--space-2) var(--space-1);
  margin-top: var(--space-1);
  border-top: var(--border-thin) solid var(--color-border-default);
  font-size: var(--fs-11);
  color: var(--color-text-faint);
}
.cm-menu-empty {
  padding: var(--space-2);
}
.cm-mini-av {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: var(--fs-11);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
@media (max-width: 700px) {
  .cm-menu,
  .cm-menu--inline {
    width: calc(100% - 2 * var(--space-4));
    left: var(--space-4) !important;
  }
}

/* The dropdown under the Settings search box (the one picker, typed form; F12 dress).
   It hangs 4px under the box with its left edge on the box's, 420px wide, over the
   page: nothing under it moves. The list scrolls inside past 420px and the foot stays.
   Rows are the picker's, so a press answers as any picker row does. */
.cm-menu.cm-menu--settings-search {
  top: 100%;
  left: 0 !important;
  width: 420px;
  max-width: none;
  max-height: 420px;
  margin-top: var(--space-1);
}
.cm-menu--settings-search .fmenu-row {
  height: auto;
  gap: var(--space-3);
  padding: var(--row-pad) var(--space-3);
}
.cm-menu--settings-search .cm-glyph {
  color: var(--color-text-muted);
}
.settings-path {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.settings-path-seg {
  flex: none;
}
.settings-path-sep {
  display: inline-flex;
  flex: none;
  margin: 0 var(--space-1);
  color: var(--color-text-faint);
}
/* The row the keys and the pointer share: a quiet accent wash, ordinary ink, and an
   arrow at its end. */
.cm-menu--settings-search .fmenu-row.is-active,
.cm-menu--settings-search .fmenu-row.is-active:hover {
  background: color-mix(in srgb, var(--color-accent) 7%, transparent);
  color: var(--color-text-default);
}
.settings-dd-go {
  display: none;
  flex: none;
  margin-left: auto;
  color: var(--color-text-muted);
}
.cm-menu--settings-search .fmenu-row.is-active .settings-dd-go {
  display: inline-flex;
}
/* Ask Surf, in the logo's blue, glyph and words alike. */
.cm-menu--settings-search .fmenu-row[data-id='ask-surf'],
.cm-menu--settings-search .fmenu-row[data-id='ask-surf'] .cm-glyph {
  color: var(--color-agent-mark);
}
.settings-ask-words {
  font-weight: 600;
}
/* The foot: a hairline above, no fill, the two keys as keycaps. */
.cm-menu--settings-search .fmenu-foot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: 0;
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-12);
}
.settings-dd-foot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.settings-dd-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-1);
  color: var(--color-text-faint);
}
.settings-dd-foot-word {
  margin-right: var(--space-2);
}
/* On a phone the dropdown is exactly the box's width and its rows grow for a finger. */
@media (max-width: 640px) {
  .cm-menu.cm-menu--settings-search {
    width: 100%;
  }
  .cm-menu--settings-search .fmenu-row {
    min-height: 44px;
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
  }
}

/* The media tray: square tiles four across (two on a phone), each in its own state. */
.cm-media {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.cm-tray {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}
.cm-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  overflow: hidden;
  background: var(--color-surface-substrate);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cm-tile > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cm-tile.is-faded > img {
  opacity: 0.4;
}
.cm-tile-x {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  border-radius: 50%;
  color: var(--btn-accent-text);
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}
.cm-tile-state {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 var(--space-2);
  text-align: center;
  font-size: var(--fs-12);
  line-height: 1.35;
  color: var(--color-text-default);
}
.cm-tile.is-faded .cm-tile-state {
  background: var(--color-surface-readable);
  border-radius: var(--radius-2);
  padding: 4px 8px;
  font-weight: 600;
}
.cm-tile-why {
  border: 0;
  background: none;
  padding: 0;
  color: var(--color-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.cm-tile-bar {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 1;
}
.cm-tile-dur,
.cm-tile-alt {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 1;
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--btn-accent-text);
  background: rgba(0, 0, 0, 0.55);
  border-radius: var(--radius-1);
  padding: 1px 5px;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.cm-tile-alt {
  cursor: pointer;
  padding: 2px 6px;
}
.cm-tile.is-bad {
  border-color: var(--color-danger);
}
.cm-refused {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--fs-12);
  color: var(--color-danger);
}
.cm-hint {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  line-height: 1.45;
}
@media (max-width: 700px) {
  .cm-tray {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The viewer: the dialog grows to hold one staged file, and keeps its head. */
.cm-dialog.cm-viewing {
  max-width: min(1100px, 92vw);
  width: min(1100px, 92vw);
  height: 86vh;
  box-sizing: border-box;
}
.cm-vpanel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
  min-height: 0;
}
.cm-vhead {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.cm-vcount {
  margin-left: auto;
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.cm-vstage {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: var(--radius-2);
  background: var(--color-surface-substrate);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.cm-vstage img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}
.cm-vstage.is-zoomed img {
  max-width: none;
  max-height: none;
  cursor: grab;
}
/* The post's window over a tall image: the picture's own width and 3:4, the rest
   dimmed by the window's shadow (clipped to the picture), a 2px ring and a round
   grip. The grip is a drag handle, so it answers a press with nothing. A zoomed
   image drops it, so the drag never fights the pinch. */
.cm-crop {
  position: absolute;
  overflow: hidden;
  z-index: 1;
  cursor: ns-resize;
  touch-action: none;
}
.cm-vstage.is-zoomed .cm-crop {
  display: none;
}
.cm-crop-win {
  position: absolute;
  left: 0;
  right: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--btn-accent-text);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
}
.cm-crop-win:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.cm-crop-grip {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--btn-accent-text);
  background: rgba(0, 0, 0, 0.55);
}
.cm-lb-nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--btn-accent-text);
  background: rgba(0, 0, 0, 0.45);
  z-index: 2;
}
.cm-lb-nav--prev {
  left: 12px;
}
.cm-lb-nav--next {
  right: 12px;
}
.cm-vstrip {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
}
.cm-vstrip img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  opacity: 0.6;
  cursor: pointer;
}
.cm-vstrip img.is-on {
  opacity: 1;
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}
.cm-alt-wrap {
  position: relative;
}
.cm-alt-label {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  display: block;
}
.cm-alt {
  width: 100%;
  box-sizing: border-box;
  min-height: 64px;
  resize: none;
  font-family: inherit;
  font-size: var(--fs-13);
  line-height: 1.5;
  padding: 9px 12px;
}
@media (max-width: 700px) {
  .cm-full .cm-dialog.cm-viewing {
    width: auto;
    height: 100%;
  }
  .cm-vstage .cm-lb-nav {
    display: none;
  }
}

/* A post's topics on its own page: small pills that carry on after the title's
   last word, wrapping with it. The title's text is the line they centre on, so
   each sits 4px above the baseline. Open bucket in the press block. */
.dsc-topic-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  margin-inline-start: var(--space-2);
  padding: 0 var(--space-2);
  vertical-align: 4px;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-pill);
  background: var(--color-surface-readable);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
/* On its own page the title is whole: no clamp to hide a pill on a third line. */
.dsc-post-card--page .dsc-caption {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* A post as the service sends it: its title, the files it carries, the people it tags. */
.thr-title {
  margin: 0 0 var(--space-1);
  font-size: var(--fs-15);
  font-weight: 600;
  line-height: 1.4;
}
.thr-with {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.thr-mention.is-plain {
  color: var(--color-text-muted);
}

/* A comment or a reply written in place: the shipped composer box, with chips,
   one image or GIF, and Edit, Delete and Reply beside each comment. */
.cm-comment {
  position: relative;
  flex-direction: column;
  align-items: stretch;
  /* The words carry their own padding, so the box holds only the sides: words sit 16px in
     (box + words) and 8px down, at rest and open alike. */
  min-height: 0;
  padding: 0 var(--space-2);
}
.cm-comment.dsc-composer--open {
  padding-bottom: var(--space-1);
}
.cm-comment .cm-body-ed {
  min-height: 0;
  padding: var(--space-2);
  border: 0;
  background: transparent;
  /* Eight lines, then it scrolls inside the box. */
  max-height: calc(8 * 1.6em + 2 * var(--space-2));
  overflow-y: auto;
}
.cm-comment .cm-body-ed:empty {
  min-height: 1.6em;
}
/* The cut edge fades over 16px; an edge with nothing past it stays sharp. */
.cm-comment .cm-body-ed[data-fade='bottom'] {
  mask-image: linear-gradient(to bottom, currentColor calc(100% - 16px), transparent);
}
.cm-comment .cm-body-ed[data-fade='top'] {
  mask-image: linear-gradient(to top, currentColor calc(100% - 16px), transparent);
}
.cm-comment .cm-body-ed[data-fade='both'] {
  mask-image: linear-gradient(
    to bottom,
    transparent,
    currentColor 16px,
    currentColor calc(100% - 16px),
    transparent
  );
}
.cm-comment .dsc-composer-send:disabled {
  opacity: 0.45;
  cursor: default;
}
.cm-signin {
  justify-content: center;
  min-height: 39px;
  padding: 0 var(--space-4);
  font: inherit;
  font-size: var(--fs-13);
  text-align: left;
  color: var(--color-text-faint);
}
.cm-signin:hover {
  color: var(--color-text-default);
}
.cm-rfoot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
}
.cm-comment-acts {
  display: flex;
  gap: var(--space-3);
  margin: 0 0 var(--space-2) var(--space-6);
}
.cm-comment-act {
  border: 0;
  background: none;
  padding: 0;
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  cursor: pointer;
}
.cm-comment-act:hover {
  color: var(--color-text-default);
}
.cm-comment-act.is-danger:hover {
  color: var(--color-danger);
}
.cm-comment-slot:empty {
  display: none;
}

/* A posted image with a description: the ALT pill at the frame's bottom right, and the
   white panel it opens over the frame's foot. */
.cm-alt-badge {
  position: absolute;
  right: 10px;
  bottom: 12px;
  z-index: 3;
  border: 0;
  font-size: var(--fs-11);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--btn-accent-text);
  background: rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-1);
  padding: 2px 6px;
  cursor: pointer;
}
.cm-alt-pop {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-2);
  font-size: var(--fs-13);
  line-height: 1.5;
}
.cm-alt-pop b {
  font-size: var(--fs-11);
  font-weight: 700;
  color: var(--color-text-muted);
  margin-right: 6px;
}
.cm-alt-pop span {
  flex: 1;
}
/* Rating the creations in the composer: a rectangular trigger (F04 compact secondary)
   opening an F12 menu laid over the title and body, one row per creation with its
   thumbs and the eye, or the reason it cannot be rated. The thumbs are the creation
   page's: Lucide `thumbs-up`, and the same glyph turned over for down.
   Press buckets: the trigger opens (tint, no movement); the thumbs and the eye are
   toggles (the state flip is the answer). */
.cm-rating-slot {
  position: relative;
  align-self: flex-start;
}
.cm-rate-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-2);
}
.cm-rate-trigger b {
  font-weight: 600;
  color: var(--color-accent);
}
.cm-rate-menu {
  position: absolute;
  width: 440px;
  max-width: calc(100% - 2 * var(--space-4));
  max-height: 320px;
  z-index: 400;
}
.cm-rate-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--row-pad) var(--space-3);
  border-radius: var(--radius-2);
  font-size: var(--fs-13);
  min-height: 32px;
}
.cm-rate-row .cm-glyph svg {
  width: 14px;
  height: 14px;
}
.cm-rate-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.cm-rate-why {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.cm-rate-row.is-hidden .cm-rate-name,
.cm-rate-row.is-hidden .cm-thumbs {
  opacity: 0.45;
}
.cm-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--color-text-faint);
  cursor: pointer;
}
.cm-eye:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.cm-eye svg {
  width: 15px;
  height: 15px;
}
@media (max-width: 700px) {
  .cm-rate-menu {
    width: calc(100% - 2 * var(--space-4));
    left: var(--space-4) !important;
  }
}

/* The thumbs themselves (the composer's rows and the creation page's box): the pyramids'
   control drawn with thumbs. At rest both muted; up pressed in accent,
   down pressed in default ink, each filled at 18%; disabled in the strong border ink. */
.vote.cm-thumbvote .vote-btn {
  width: 32px;
  height: 30px;
  color: var(--color-text-muted);
  border-radius: 50%;
}
.vote.cm-thumbvote .vote-btn svg {
  width: 18px;
  height: 18px;
}
.vote.cm-thumbvote .vote-btn--down svg {
  transform: rotate(180deg);
}
.vote.cm-thumbvote .vote-btn:not([disabled]):hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.vote.cm-thumbvote .vote-btn--up[aria-pressed='true'] {
  color: var(--color-accent);
}
.vote.cm-thumbvote .vote-btn--down[aria-pressed='true'] {
  color: var(--color-text-default);
}
.vote.cm-thumbvote .vote-btn[aria-pressed='true'] svg {
  fill: currentColor;
  fill-opacity: 0.18;
}
.vote.cm-thumbvote .vote-btn[disabled] {
  color: var(--color-border-strong);
}
.vote.cm-thumbvote.cm-side {
  flex-direction: row;
  align-self: center;
}
=======
/* ---------- The two live lanes: shells, the controls under a card, the phone tabs ----------
   A first load fills the lane with empty cards where the posts will land, in the
   card's own shell: the readable surface, a hairline and the card radius, a media
   block and three bars. A reopen paints the cached posts and never shows these. */
.dsc-skel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
}
.dsc-skel--tile {
  height: 308px;
}
.dsc-skel--row {
  padding: var(--space-4);
}
.dsc-skel-media {
  flex: 1;
  background: var(--color-surface-substrate);
}
.dsc-skel-lines {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4) var(--space-4);
}
.dsc-skel--row .dsc-skel-lines {
  padding: 0;
}
.dsc-skel-line {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-substrate);
}

/* A card and, under it, the like and repost controls the service makes live. The
   card is one click target and a control inside a button cannot be pressed, so
   the two are siblings. */
.feed-slot {
  flex-direction: column;
  gap: var(--space-1);
}
.feed-slot > .dsc-post,
.feed-slot > .dsc-follow {
  flex: 1 1 auto;
}
.feed-acts {
  padding: 0 var(--space-1);
}
.dsc-post-when {
  color: var(--color-text-faint);
}

/* The lane tabs' glyphs are drawn only where the words give way to them. A control
   that belongs at the right of the tab row (the Post button) takes this class. */
.dsc-lane-glyph {
  display: none;
}
.dsc-lane-glyph svg {
  stroke-width: 1.75;
}
.dsc-lanes > .dsc-lanes-trailing {
  margin-left: auto;
}
/* The Post button at the end of the strip is 28px and centred on the 32px tab
   row, so it takes no height from the strip: 33px on every lane, with the current
   tab's underline on the strip's bottom edge. Scoped to the row button, because the
   phone's floating Post button carries the same class. */
.dsc-lanes > .cm-write.dsc-lanes-trailing {
  align-self: center;
  height: 28px;
  margin-block: 0;
  padding-block: 0;
}

@media (max-width: 700px) {
  /* A post's title is never cut on a phone: one size up and no clamp, while the
     body keeps its three lines. */
  .dsc-caption,
  .dsc-follow-why {
    display: block;
    font-size: var(--fs-18);
    -webkit-line-clamp: unset;
    overflow: visible;
  }

  /* The four lane tabs are glyph only, in one row of four equal cells that never
     wraps; the name stays as the label and the tooltip. The current tab's line is
     36px and centred under the glyph, drawn by the hidden label's own box. */
  .dsc-lanes {
    flex-wrap: nowrap;
    gap: 0;
  }
  .dsc-lanes .lib-tab {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) 0 calc(var(--space-3) + var(--border-thin));
  }
  .dsc-lanes .dsc-lane-name {
    display: none;
  }
  .dsc-lanes .dsc-lane-glyph {
    display: inline-flex;
  }
  .dsc-lanes .lib-tab.is-current {
    box-shadow: none;
  }
  .dsc-lanes .lib-tab::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 36px;
    margin-left: -18px;
    height: 0;
    visibility: visible;
  }
  .dsc-lanes .lib-tab.is-current::after {
    height: var(--border-emphasis);
    background: var(--tab-ink);
  }
}

/* ---------- Discover: the search box in the tab row ---------- */

/* One box on every Discover lane, in the tab row, pushed right and directly left
   of Post (Daniel's design D1). It is the Marketplace's own search bar (F13) at
   300 x 28, so the 33px row keeps its height. The tab family's gap would put
   `--space-4` between it and Post; the negative margin brings that to `--space-2`.
   The magnifier and the way back are drawn at every width and shown only on a
   phone. */
.dsc-lanes > .dsc-search {
  flex: none;
  align-self: center;
  width: 300px;
  margin: 0 0 0 auto;
}
.dsc-lanes > .dsc-search ~ .dsc-lanes-trailing {
  margin-left: calc(var(--space-2) - var(--space-4));
}
.dsc-search .mp-searchbar {
  height: 28px;
  min-height: 28px;
  padding-block: 0;
  padding-inline: var(--space-2);
}
.dsc-search-clear,
.dsc-search-open,
.dsc-search-back {
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.dsc-search-clear {
  width: 20px;
  height: 20px;
}
.dsc-search-clear:hover,
.dsc-search-open:hover,
.dsc-search-back:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-default);
}
.dsc-search-open,
.dsc-search-back {
  display: none;
  width: 28px;
  height: 28px;
}

@media (max-width: 700px) {
  /* The box is a 28px magnifier until it is pressed, then it takes the row in
     place of the tabs, with the chevron to go back. */
  .dsc-lanes > .dsc-search {
    width: 28px;
    margin-left: var(--space-2);
  }
  .dsc-search .dsc-search-open {
    display: grid;
  }
  .dsc-search .mp-searchbar,
  .dsc-search .srch-dd-mount {
    display: none;
  }
  .dsc-search.is-open .dsc-search-open {
    display: none;
  }
  .dsc-search.is-open .dsc-search-back {
    display: grid;
  }
  .dsc-search.is-open .mp-searchbar,
  .dsc-search.is-open .srch-dd-mount {
    display: flex;
  }
  .dsc-search.is-open .srch-dd-mount {
    display: block;
  }
  .dsc-lanes.is-searching > .lib-tab,
  .dsc-lanes.is-searching > .cm-write {
    display: none;
  }
  /* The row keeps the height its glyph tabs gave it (20px glyph, `--space-3` above
     and below, and the rule), so opening the box moves nothing under it. */
  .dsc-lanes.is-searching {
    min-height: calc(20px + 2 * var(--space-3) + var(--border-thin));
  }
  .dsc-lanes.is-searching > .dsc-search {
    display: flex;
    flex: 1 1 auto;
    width: auto;
    margin-left: 0;
    gap: var(--space-2);
  }
  .dsc-lanes.is-searching > .dsc-search .mp-searchbar {
    flex: 1;
    min-width: 0;
  }
}

/* ============================================================================
   The moderation area (/admin) — server-rendered in the website's frame: the
   bar with "Moderation" beside the lockup, the sections in the sidebar (and in
   the drawer on a phone, opened by a checkbox so the page needs no script).
   Every class is prefixed `md-` and appears only there.
   ============================================================================ */
.md-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text-default);
  font-family: var(--font-ui);
}
.md-menu-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.md-menu-btn {
  display: none;
}
.md-area {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  margin-left: var(--space-3);
  padding-left: var(--space-3);
  border-left: var(--border-thin) solid var(--color-border-default);
}
.md-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 420px;
  max-width: 40vw;
  margin-left: var(--space-5);
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  background: var(--color-surface-readable);
  color: var(--color-text-faint);
  font-size: var(--fs-13);
}
.md-search-btn {
  display: inline-flex;
  color: inherit;
  cursor: pointer;
}
.md-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text-default);
  font: inherit;
}
.md-shell {
  flex: 1;
  display: flex;
  min-height: 0;
}
.md-sidebar {
  flex: none;
}
.md-body a {
  text-decoration: none;
}
.md-body .brand,
.md-body .avatar-btn {
  color: inherit;
}
.md-nav-row {
  text-decoration: none;
}
.md-count {
  margin-left: auto;
  min-width: 18px;
  padding: 0 var(--space-2);
  border-radius: 999px;
  background: var(--color-warn-soft);
  color: var(--color-text-default);
  font-size: var(--fs-11);
  font-weight: 600;
  text-align: center;
  line-height: 18px;
}
.md-menu-count {
  margin-left: auto;
}
.md-pane {
  flex: 1;
  min-width: 0;
  max-width: 960px;
  box-sizing: border-box;
  padding: var(--space-5) var(--space-6);
}
.md-h1 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-22);
  font-weight: 600;
  color: var(--color-text-default);
  margin: 0 0 var(--space-2);
}
.md-h1 svg {
  color: var(--color-text-muted);
}
.md-lede {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-5);
}
.md-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  padding: var(--space-7) var(--space-5);
  border: var(--border-thin) dashed var(--color-border-default);
  border-radius: var(--radius-3);
  color: var(--color-text-muted);
  font-size: var(--fs-13);
}
.md-empty b {
  font-size: var(--fs-15);
  color: var(--color-text-default);
}
.md-scrim,
.md-drawer {
  display: none;
}
@media (max-width: 700px) {
  .md-sidebar {
    display: none;
  }
  .md-menu-btn {
    display: inline-flex;
  }
  .md-area {
    display: none;
  }
  .md-search {
    width: auto;
    margin-left: auto;
    padding: var(--space-1);
    border: 0;
    background: transparent;
  }
  .md-search-input {
    display: none;
  }
  .md-pane {
    padding: var(--space-4);
  }
  .md-menu-toggle:checked ~ .md-shell .md-scrim {
    display: block;
  }
  .md-menu-toggle:checked ~ .md-shell .md-drawer {
    display: flex;
  }
}

/* Two-step verification on the server pages: the chooser's rows, the
   authenticator's QR code and key, the backup codes, and "On". */
.sp-choice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-3);
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  text-align: left;
  cursor: pointer;
}
.sp-choice:hover {
  border-color: var(--color-border-strong);
}
.sp-choice-glyph {
  flex: none;
  display: inline-flex;
  color: var(--color-text-muted);
}
.sp-choice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sp-choice-text b {
  font-size: var(--fs-13);
  font-weight: 600;
}
.sp-choice-text small {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.sp-qr {
  align-self: center;
  width: 200px;
  max-width: 100%;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  overflow: hidden;
  line-height: 0;
}
.sp-qr svg {
  width: 100%;
  height: auto;
}
.sp-key {
  align-self: center;
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  letter-spacing: 0.04em;
  text-align: center;
  overflow-wrap: anywhere;
}
.sp-codes {
  list-style: none;
  margin: 0;
  padding: var(--space-3);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2) var(--space-4);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  font-family: var(--font-mono);
  font-size: var(--fs-13);
}
.sp-on {
  color: var(--color-success);
  font-weight: 600;
}
/* A label badge on an account row: Always on, This device. */
.sp-tag {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-2);
  border-radius: 999px;
  background: var(--color-surface-hover);
  color: var(--color-text-muted);
  font-size: var(--fs-12);
  font-weight: 500;
}

/* Reports, the moderators' queue and the case page. */
.md-dialog {
  max-width: 440px;
  max-height: calc(100vh - 2 * var(--space-5));
  overflow: auto;
}
.md-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.md-head .srf-dialog-title {
  flex: 1;
}
.md-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.md-iconbtn:hover {
  background: var(--color-surface-hover);
}
.md-sub {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  margin-top: calc(-1 * var(--space-1));
}
.md-reasons {
  display: flex;
  flex-direction: column;
  margin: 0 calc(-1 * var(--space-2));
}
.md-reason {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-2);
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--color-text-default);
  font: inherit;
}
.md-reason:hover {
  background: var(--color-surface-hover);
}
.md-reason-t {
  display: block;
  font-size: var(--fs-13);
  font-weight: 600;
}
.md-reason-d {
  display: block;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.md-reason-txt {
  flex: 1;
}
.md-reason .md-chev {
  color: var(--color-text-faint);
  flex: none;
}
.md-radio {
  flex: none;
  width: var(--space-3);
  height: var(--space-3);
  border-radius: 999px;
  border: var(--border-thin) solid var(--color-border-strong);
}
.md-reason.on .md-radio {
  border: var(--space-1) solid var(--color-accent);
}
.md-chosen {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
}
.md-chosen .md-reason-txt {
  flex: 1;
}
.md-change {
  border: 0;
  background: transparent;
  color: var(--color-accent);
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.md-note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.md-label {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
@media (max-width: 700px) {
  .md-dialog-full .srf-dialog-backdrop,
  .srf-dialog-backdrop.md-full {
    padding: 0;
  }
  .md-full .srf-dialog {
    max-width: none;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    border: 0;
  }
}
@media (max-width: 700px) {
  .md-pick {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 700px) {
  .md-pane {
    padding: var(--space-4);
  }
}
/* The queue: tiers, each a white list of case rows. */
.md-tier {
  margin-bottom: var(--space-5);
}
.md-tier-h {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
}
.md-tier-h span {
  font-weight: 400;
  color: var(--color-text-muted);
}
.md-tier-h em {
  margin-left: auto;
  font-style: normal;
  font-weight: 400;
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.md-list {
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  overflow: hidden;
}
.md-qrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: var(--border-thin) solid var(--color-border-default);
  cursor: pointer;
}
.md-qrow:first-child {
  border-top: 0;
}
.md-qrow:hover {
  background: var(--color-surface-hover);
}
.md-qglyph {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--color-bg);
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
}
.md-qmain {
  flex: 1;
  min-width: 0;
}
.md-qt {
  font-size: var(--fs-13);
  color: var(--color-text-default);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.md-qt b {
  font-weight: 600;
}
.md-qt i {
  font-style: normal;
  color: var(--color-text-muted);
}
.md-qm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: 2px;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.md-badge {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-2);
  border-radius: 999px;
  font-size: var(--fs-11);
  font-weight: 600;
  line-height: 18px;
  border: var(--border-thin) solid var(--color-border-default);
  color: var(--color-text-muted);
}
.md-badge--new {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.md-badge--warn {
  background: var(--color-warn-soft);
  border-color: transparent;
  color: var(--color-text-default);
}
.md-qtime {
  flex: none;
  text-align: right;
  font-size: var(--fs-12);
  color: var(--color-text-faint);
  white-space: nowrap;
}
.md-qtime b {
  display: block;
  font-weight: 600;
  color: var(--color-text-muted);
}
.md-qtime b.is-late {
  color: var(--color-danger);
}
@media (max-width: 700px) {
  .md-qrow {
    align-items: flex-start;
    padding: var(--space-3);
  }
  .md-tier-h em {
    display: none;
  }
}
/* The case page. */
.md-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: var(--fs-13);
  color: var(--color-accent);
  cursor: pointer;
  margin-bottom: var(--space-3);
}
.md-case {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--space-5);
  align-items: start;
  max-width: 1100px;
}
.md-case-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-13);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-5);
}
.md-sec {
  margin-bottom: var(--space-5);
}
.md-sec-h {
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin: 0 0 var(--space-2);
}
.md-card {
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  padding: var(--space-4);
}
.md-subj-id {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.md-subj-id b {
  color: var(--color-text-default);
  font-weight: 600;
}
.md-subj-t {
  font-size: var(--fs-15);
  font-weight: 600;
  color: var(--color-text-default);
  margin: var(--space-2) 0 var(--space-1);
}
.md-subj-b {
  font-family: inherit;
  font-size: var(--fs-14);
  line-height: 1.55;
  color: var(--color-text-muted);
  margin: 0;
}
.md-subj-f {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-3);
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.md-subj-f a {
  color: var(--color-accent);
  text-decoration: none;
}
.md-rep {
  padding: var(--space-3) 0;
  border-top: var(--border-thin) solid var(--color-border-default);
  font-size: var(--fs-13);
}
.md-rep:first-child {
  border-top: 0;
  padding-top: 0;
}
.md-rep:last-child {
  padding-bottom: 0;
}
.md-rep-h {
  display: flex;
  gap: var(--space-2);
  color: var(--color-text-default);
}
.md-rep-h span {
  color: var(--color-text-faint);
  margin-left: auto;
  font-size: var(--fs-12);
}
.md-rep q {
  display: block;
  margin-top: var(--space-1);
  color: var(--color-text-muted);
}
.md-ev {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--fs-13);
  color: var(--color-text-default);
}
.md-ev-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--color-border-strong);
}
.md-ev-main {
  flex: 1;
}
.md-ev-main small {
  display: block;
  color: var(--color-text-faint);
  font-size: var(--fs-12);
}
.md-ev-note {
  margin-top: var(--space-1);
  padding-left: var(--space-3);
  border-left: 2px solid var(--color-border-default);
  color: var(--color-text-muted);
}
.md-panel {
  position: sticky;
  top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.md-owner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.md-owner .avatar {
  width: 32px;
  height: 32px;
  font-size: var(--fs-12);
}
.md-owner b {
  display: block;
  font-size: var(--fs-13);
}
.md-owner div span {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.md-strikes {
  margin-top: var(--space-3);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.md-strikes b {
  color: var(--color-text-default);
  font-weight: 600;
}
.md-acts {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.md-acts .srf-dialog-btn {
  width: 100%;
  justify-content: center;
}
.md-acts-row {
  display: flex;
  gap: var(--space-2);
}
.md-acts-row .srf-dialog-btn {
  flex: 1;
}
.md-note-field {
  margin-top: var(--space-2);
}
@media (max-width: 700px) {
  .md-case {
    grid-template-columns: 1fr;
  }
  .md-panel {
    position: static;
  }
}
.md-subj-f a {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.md-help {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.md-warnline {
  display: flex;
  gap: var(--space-2);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  background: var(--color-warn-soft);
  border-radius: var(--radius-2);
  padding: var(--space-2) var(--space-3);
}
.md-dialog .seg {
  width: 100%;
}
@media (max-width: 700px) {
  .md-grid {
    grid-template-columns: 1fr;
  }
}
.md-quiet {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}

.md-note-field .srf-dialog-input {
  width: 100%;
  box-sizing: border-box;
}

/* Removing a post, and an appeal on its case. */
.md-dialog--wide {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
}
.md-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.md-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
/* The suspension form: a preview and a button for each length, and only the
   chosen length's shows. */
.md-susp-opt {
  display: inline-flex;
  gap: var(--space-2);
  margin-right: var(--space-4);
  font-size: var(--fs-13);
}
.md-susp .md-susp-go,
.md-susp .md-susp-preview {
  display: none;
}
.md-susp:has(input[value='1']:checked) .md-susp-preview[data-for='1'],
.md-susp:has(input[value='7']:checked) .md-susp-preview[data-for='7'],
.md-susp:has(input[value='30']:checked) .md-susp-preview[data-for='30'],
.md-susp:has(input[value='date']:checked) .md-susp-preview[data-for='date'],
.md-susp:has(input[value='permanent']:checked) .md-susp-preview[data-for='permanent'] {
  display: block;
}
.md-susp:has(input[value='1']:checked) .md-susp-go[data-for='1'],
.md-susp:has(input[value='7']:checked) .md-susp-go[data-for='7'],
.md-susp:has(input[value='30']:checked) .md-susp-go[data-for='30'],
.md-susp:has(input[value='date']:checked) .md-susp-go[data-for='date'],
.md-susp:has(input[value='permanent']:checked) .md-susp-go[data-for='permanent'] {
  display: inline-flex;
}
.md-preview {
  border: var(--border-thin) dashed var(--color-border-default);
  border-radius: var(--radius-3);
  padding: var(--space-3);
  background: var(--color-bg);
}
.md-preview .md-sec-h {
  margin-bottom: var(--space-2);
}
.md-told {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.md-ev-stmt {
  margin-top: var(--space-1);
  padding-left: var(--space-3);
  border-left: 2px solid var(--color-border-strong);
  color: var(--color-text-default);
}
.md-ev-stmt small {
  display: block;
  color: var(--color-text-faint);
}
.md-badge--done {
  background: var(--color-danger-soft);
  border-color: transparent;
  color: var(--color-danger);
}
.md-appeal {
  border-left: 3px solid var(--color-warn-dot);
}
.md-appeal-h {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-13);
  color: var(--color-text-default);
  margin-bottom: var(--space-2);
}
.md-appeal-h span {
  color: var(--color-text-faint);
  font-size: var(--fs-12);
}
.md-appeal p {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-13);
  line-height: 1.55;
  color: var(--color-text-default);
}
.md-thumbs {
  display: flex;
  gap: var(--space-2);
}
.md-thumbs a {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-2);
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-bg);
  overflow: hidden;
  display: block;
}
.md-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Your moderation decisions, and the appeal page. */
.sp-dec {
  padding: var(--space-3) 0;
  border-top: var(--border-thin) solid var(--color-border-default);
}
.sp-dec:first-of-type {
  border-top: 0;
}
.sp-dec-h {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--fs-13);
}
.sp-dec-h span {
  font-size: var(--fs-12);
  color: var(--color-text-faint);
}
.sp-dec-q {
  margin: var(--space-2) 0;
  padding-left: var(--space-3);
  border-left: 2px solid var(--color-border-default);
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.sp-dec-q small {
  display: block;
  color: var(--color-text-faint);
}
.sp-dec-a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.sp-dec-s {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.sp-addfile {
  align-self: flex-start;
  cursor: pointer;
}
.sp-attaches {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.sp-attach {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-13);
}
.sp-attach small {
  margin-left: auto;
  color: var(--color-text-muted);
}
.md-pick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}
.md-pick button {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-2);
  overflow: hidden;
  background: var(--color-bg);
  cursor: pointer;
}
.md-pick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.md-pick button:hover {
  border-color: var(--color-border-strong);
}
.md-pick-n {
  position: absolute;
  left: var(--space-1);
  bottom: var(--space-1);
  padding: 0 var(--space-2);
  border-radius: 999px;
  background: var(--color-surface-readable);
  font-size: var(--fs-11);
  color: var(--color-text-muted);
}
@media (max-width: 700px) {
  .md-pick {
    grid-template-columns: repeat(2, 1fr);
  }
}
.md-tile {
  background: var(--color-surface-readable);
  border: var(--border-thin) solid var(--color-border-default);
  border-radius: var(--radius-3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.md-tile-img {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--color-bg);
  overflow: hidden;
}
.md-tile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: blur(18px) grayscale(1);
  transform: scale(1.15);
}
.md-tile-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--color-surface-substrate) 75%, transparent);
  pointer-events: none;
}
.md-tile-img:has(.md-show:checked) img {
  filter: none;
  transform: none;
}
.md-tile-img:has(.md-show:checked)::after {
  display: none;
}
.md-reveal {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.md-show {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.md-show-on,
.md-show-off {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  border: var(--border-thin) solid var(--color-border-default);
  background: var(--color-surface-readable);
  color: var(--color-text-default);
  font-size: var(--fs-12);
  font-weight: 600;
  pointer-events: none;
}
.md-show-off {
  display: none;
}
.md-show:checked ~ .md-show-on {
  display: none;
}
.md-show:checked ~ .md-show-off {
  display: inline-flex;
}
.md-show:focus-visible ~ .md-show-on,
.md-show:focus-visible ~ .md-show-off {
  outline: 2px solid var(--color-border-strong);
}
.md-tile-b {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}
.md-tile-b b {
  font-size: var(--fs-13);
  color: var(--color-text-default);
}
.md-tile-acts {
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--space-3) var(--space-3);
}
.md-tile-acts .srf-dialog-btn,
.md-tile-acts form {
  flex: 1;
  display: flex;
  justify-content: center;
}
.md-tile-acts .srf-dialog-btn {
  justify-content: center;
  padding: var(--space-1) var(--space-2);
}
.md-tile-acts {
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--space-3) var(--space-3);
}
.md-tile-acts .srf-dialog-btn {
  flex: 1;
  justify-content: center;
  padding: var(--space-1) var(--space-2);
}
.md-hide {
  margin-left: auto;
}
.md-sec-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: var(--border-thin) solid var(--color-border-default);
  font-size: var(--fs-13);
}
.md-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
@media (max-width: 700px) {
  .md-tiles {
    grid-template-columns: 1fr;
  }
}
.md-evi {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.md-evi-img {
  position: relative;
  flex: none;
  width: 120px;
  height: 90px;
  border-radius: var(--radius-2);
  overflow: hidden;
  background: var(--color-bg);
  border: var(--border-thin) solid var(--color-border-default);
}
.md-evi-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.md-evi-img.is-hidden {
  filter: blur(14px) grayscale(1);
  background: var(--color-border-default);
}
.md-evi-img.is-hidden::after {
  content: '';
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--color-surface-substrate) 75%, transparent);
}
.md-evi-none {
  flex: none;
  width: 120px;
  height: 90px;
  border-radius: var(--radius-2);
  border: var(--border-thin) dashed var(--color-border-strong);
  display: grid;
  place-items: center;
  color: var(--color-text-faint);
  text-align: center;
  font-size: var(--fs-11);
  padding: var(--space-2);
}
.md-evi-title {
  font-size: var(--fs-13);
}
.md-evi-acts {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-3);
}
.md-evi .srf-dialog-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.md-kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--space-1) var(--space-3);
  margin: var(--space-2) 0 0;
  font-size: var(--fs-13);
}
.md-kv dt {
  color: var(--color-text-muted);
}
.md-kv dd {
  margin: 0;
  color: var(--color-text-default);
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  .md-evi {
    flex-direction: column;
  }
  .md-kv {
    grid-template-columns: 1fr;
  }
}

/* The Topics card on an account page: the pills sit left-aligned under the line,
   with room above and below. */
.sp-sec .sp-topics {
  justify-content: flex-start;
  margin: var(--space-1) 0 var(--space-3);
}

/* ---------- Discover: a search's results ---------- */

/* What a results tab says when nothing matched, or when the words cannot be
   searched: a heading, one line that explains, and the way out, left-aligned in
   the tab's own area. */
.srch-none {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding-top: var(--space-6);
}
.srch-none-title {
  font-size: var(--fs-15);
  font-weight: 600;
  color: var(--color-text-default);
  overflow-wrap: anywhere;
}
.srch-none-copy {
  font-size: var(--fs-13);
  color: var(--color-text-muted);
}
.srch-none > .mp-sort {
  margin-top: var(--space-2);
}

/* The People tab: two columns of slim rows, one column in a narrow window. A row
   is the photo and words (one button that opens the person) beside the shipped
   follow control, 48px tall with a hairline under it. */
.srch-people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-6);
  align-content: start;
  padding-top: var(--space-3);
}
@media (max-width: 700px) {
  .srch-people {
    grid-template-columns: minmax(0, 1fr);
  }
}
.srch-person {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 48px;
  border-bottom: var(--border-thin) solid var(--color-border-default);
}
.srch-person-open {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
}
.srch-person-open:focus-visible {
  outline: var(--border-emphasis) solid var(--color-accent);
  outline-offset: -2px;
}
.srch-person .prf-avatar,
.srch-person-mark {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-12);
  object-fit: cover;
}
.srch-person-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.srch-person-line {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
}
.srch-person-name {
  flex: 0 1 auto;
  min-width: 0;
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--color-text-default);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.srch-person-handle {
  flex: 0 100 auto;
  min-width: 0;
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.srch-person-bio {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.srch-person > .soc-follow {
  flex: none;
}

/* The People tab while its rows are on their way: the feed's row shells. */
.srch-people--loading {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
