/* Protention components in the reference language (sky, materials, inversion, pills, one centred column).
   Requires tokens.css. Plain CSS for the portal (no build, CSP style-src 'self'); Desk and the call page map the same
   rules onto their DesignX components (DESIGN-SYSTEM.md section 12). Class prefix: prt-.
   Logical properties only (left/right never appear), so Arabic mirrors without extra rules except glyph flips (section 25).
   Every component lists its states in DESIGN-SYSTEM.md; every class here is a test unit (one unit test, one full test).
   Revision 2: corrections from critique/CRITIQUE.md (finding ids in comments), and every [GAP] rule of the prototype
   stage folded in, so this file plus tokens.css is the complete system (proto.css keeps only fonts and stand-ins).
   Containers: .prt-column (column), .prt-group (group), .prt-run (run), .prt-dialog (unnamed). Layout that depends on the
   room a component actually has uses container queries, not the viewport. */

/* ── 0. Base ───────────────────────────────────────────────────────────────────────────────────── */
/* Scope: the base rules and the universal focus ring apply only on a page (or inside an element) that carries data-ds. A page that
   has not moved to the system loads this file and renders exactly as before: every other rule here needs a prt- class, a
   data-materials or data-sky attribute, or data-theme-switching, none of which an unmoved page carries. A restyled page sets
   <html data-ds>. Each selector keeps the specificity of the unscoped rule (:where adds none). */
:where([data-ds], [data-ds] *), :where([data-ds], [data-ds] *)::before, :where([data-ds], [data-ds] *)::after { box-sizing: border-box; }
:where(html[data-ds]) { -webkit-text-size-adjust: 100%; background: var(--sky-dusk-1); }
:where(html[data-ds] > body, body[data-ds]) {
  margin: 0; min-width: 320px; min-height: 100svh;
  font-family: var(--font-sans); font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-regular);
  color: var(--on-sky-1); /* no body background: it would paint over the fixed sky layer (z-index -1) */
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-synthesis: none;
}
:where([data-ds]) :where(h1, h2, h3, p, figure, ul, ol) { margin: 0; }
:where([data-ds]) :where(ul, ol) { padding: 0; list-style: none; }
:where([data-ds]) a { color: inherit; text-decoration: none; }
:where([data-ds]) :where(button, input, textarea, select) { font: inherit; color: inherit; letter-spacing: inherit; }
:where([data-ds]) button { cursor: pointer; background: none; border: 0; padding: 0; }
:where([data-ds]) :where(button, a, input, textarea, select, label) { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:where([data-ds]) ::selection { background: var(--brand); color: #FFFFFF; }
:where([data-ds]) :where(img, svg) { display: block; }
.prt-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.prt-nowrap { white-space: nowrap; }   /* number + unit pairs ("112 MB", "1 min 12 s") also carry U+00A0 in the copy (L4) */

/* Focus (C6): one two-tone ring on every control: a 2 px ring at 2 px offset sandwiched in a 6 px halo, ring vs halo
   19.6:1, so it shows on every surface. The doubled :root lifts it above every component rule that sets box-shadow
   (circles, segments, row circles, checked inputs), so no control loses its halo. A component that needs the ring inside
   its own box sets --focus-offset and --focus-shadow on its :focus-visible state (rows, menu items). */
:where([data-ds], [data-ds] *):focus { outline: none; }
:root:root :where([data-ds], [data-ds] *):focus-visible { outline: 2px solid var(--focus-ring); outline-offset: var(--focus-offset, 2px); box-shadow: var(--focus-shadow, 0 0 0 6px var(--focus-halo)); }
/* Text entry inside a wrapper: the wrapper draws the ring (field, textarea card, composer, chrome select, key-value row). */
:root:root :is(.prt-field, .prt-textarea, .prt-composer__box, .prt-chrome-pill, .prt-row--kv) :is(input:not([type='checkbox'], [type='radio'], [type='range']), select, textarea):focus-visible { outline: none; box-shadow: none; }
.prt-field:has(> input:focus-visible, > select:focus-visible), .prt-textarea:has(textarea:focus-visible), .prt-composer__box:has(textarea:focus-visible), .prt-chrome-pill:has(select:focus-visible) {
  outline: 2px solid var(--focus-ring); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-halo); }

/* Icons: outline geometry on a 24 grid (ISC licence, see the third-party notices), 1.5 px stroke, round caps, currentColor. */
.prt-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.prt-icon--16 { width: 16px; height: 16px; }
.prt-icon--24 { width: 24px; height: 24px; }

/* Responsive visibility helpers (chrome only). */
@media (max-width: 599.98px) { .prt-hide-narrow { display: none !important; } }
@media (min-width: 600px) { .prt-show-narrow { display: none !important; } }
@media (max-width: 359.98px) { .prt-hide-xs { display: none !important; } }

/* ── 1. The sky (a fixed layer behind everything; content scrolls over it) ─────────────────────── */
.prt-sky { position: fixed; inset: 0; z-index: var(--z-sky); pointer-events: none; background: var(--sky-dusk); }
body[data-sky='deep'] .prt-sky, body[data-sky='chat'] .prt-sky { background: var(--sky-deep); }
:root[toggle-theme='light'] body[data-sky='chat'] .prt-sky, :root[data-theme='light'] body[data-sky='chat'] .prt-sky { background: var(--sky-day); }
/* html carries #000A24 (= --sky-dusk-1 = --sky-deep-1) for overscroll; the day sky's own top is drawn by the layer. */

/* Build gap (w107): focus must not land under the floating chrome or the composer (WCAG 2.4.11): scrolling keeps clear of them. */
:where(html[data-ds]):has(.prt-composer) { scroll-padding-block-end: calc(var(--h-composer) + var(--composer-bottom) + var(--s-6)); }
:where(html[data-ds]):has(.prt-chrome) { scroll-padding-block-start: var(--fade-edge); }

/* Theme switching: theme.js sets data-theme-switching on <html> for one frame so fills change at once (deterministic snapshots). */
:root[data-theme-switching] *, :root[data-theme-switching] *::before, :root[data-theme-switching] *::after { transition: none !important; }

/* ── 2. Materials ──────────────────────────────────────────────────────────────────────────────── */
.prt-mat-regular, .prt-mat-thin, .prt-mat-field, .prt-mat-ghost { -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); }
.prt-mat-regular { background: var(--mat-regular); box-shadow: var(--highlight-inner); color: var(--ink-1); }
.prt-mat-thin { background: var(--mat-thin); color: var(--ink-1); }
.prt-mat-field { background: var(--mat-field); color: var(--ink-1); }
.prt-mat-ghost { background: var(--mat-ghost); color: var(--on-sky-1); }
/* The opaque fallback for browsers without backdrop-filter is at the end of this file (section 27), after every rule it overrides. */

/* ── 3. Page frames ────────────────────────────────────────────────────────────────────────────── */
/* 3.1 Settings recipe: one centred column, top-aligned, empty sky below. */
.prt-page { position: relative; min-height: 100svh; padding: var(--top-page) var(--gutter) var(--s-24); }
.prt-column { container: column / inline-size; width: min(100%, var(--w-settings)); margin-inline: auto; display: flex; flex-direction: column; }
.prt-column > * + * { margin-block-start: var(--gap-group); }
.prt-column > .prt-page-head + * { margin-block-start: var(--s-6); }
.prt-column > .prt-helper + * { margin-block-start: var(--s-6); }
.prt-column > .prt-page-head + .prt-helper { margin-block-start: var(--s-2); padding-inline-start: calc(var(--h-control) + var(--s-4)); }   /* helper shares the title's text edge */
.prt-column > .prt-signout { margin-block-start: var(--s-6); }

/* 3.2 Auth recipe: media panel on the inline-start, form column centred in the rest. Always dark materials (H1). */
.prt-auth { position: relative; display: grid; grid-template-columns: var(--w-media-panel) 1fr; min-height: 100svh; padding: var(--s-5); gap: 0; }
.prt-media-panel { position: sticky; inset-block-start: var(--s-5); height: calc(100svh - 2 * var(--s-5)); border-radius: var(--r-media); overflow: hidden; background: var(--sky-deep-2); }
/* M12: our photograph graded toward the muted, naturally lit reference media (#1, #5-#15): saturation × .45 and a 20 %
   page-navy veil, plus the bottom shade that carries the white pill (the critique asked for −40 % and 15-20 %; at −40 % the
   petals still measured chroma p95 122 against the sky's 57, so the grade goes further). Replace with people-in-context
   photography (owner decision D6). */
.prt-media-panel > img { width: 100%; height: 100%; object-fit: cover; object-position: 72% 40%; filter: saturate(.45); }
.prt-media-panel::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(0, 6, 26, .45), rgba(0, 6, 26, 0) 40%), linear-gradient(rgba(0, 10, 36, .20), rgba(0, 10, 36, .20)); }
/* H9: the panel's corner carries the word lockup (small), never the bare mark; its start edge = the pill's start edge. */
.prt-media-panel__brand { position: absolute; z-index: 1; inset-block-start: var(--s-5); inset-inline-start: var(--s-5); color: #FFFFFF; }
.prt-media-panel > .prt-media-panel__more { position: absolute; z-index: 1; inset-block-end: var(--s-5); inset-inline-start: var(--s-5); }
.prt-auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: var(--s-16) var(--s-6) var(--s-6); }
.prt-auth-column { width: min(100%, var(--w-auth)); display: flex; flex-direction: column; gap: var(--gap-control); margin-block: auto; transform: translateY(-4vh); }
/* M5: lockup → lead 24 (#1, #7); lead → sub 8; head → first control 24. */
.prt-auth-head { position: relative; display: grid; justify-items: center; gap: var(--s-6); margin-block-end: calc(var(--s-6) - var(--gap-control)); text-align: center; }
.prt-auth-lockup-row { position: relative; display: grid; justify-items: center; align-items: center; min-height: var(--h-control); }
/* Back is centred on the row by its box (inset-block 0 and auto margins on its fixed 48), never by a transform: the circle's :active scale
   replaced a translateY(-50%) on press, so the circle dropped 24 px under the finger and a tap on its upper part ended on the row (no click). */
.prt-auth-lockup-row .prt-auth-back { position: absolute; inset-inline-start: 0; inset-block: 0; margin-block: auto; }
.prt-auth-lockup-row + .prt-lead { margin-block-start: calc(var(--s-6) - var(--gap-control)); }
.prt-lead { font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: var(--fw-regular); color: var(--on-sky-1); text-wrap: balance; }
.prt-lead--start { text-align: start; }
.prt-auth-sub { margin-block-start: calc(var(--s-2) - var(--gap-control)); color: var(--on-sky-1); font-size: var(--fs-body); line-height: var(--lh-body); }
.prt-auth-column > .prt-rule { margin-block: 2px; }
.prt-auth-step { display: flex; flex-direction: column; gap: var(--gap-control); }
.prt-auth-step > .prt-or + *, .prt-auth-step > hr + * { margin-block-start: 0; }
/* H10: help and fine print sit low on the sky, where only full white keeps 4.5:1 (5.25:1 at the horizon). */
.prt-auth-help { font-size: var(--fs-detail); line-height: var(--lh-detail); color: var(--on-sky-1); text-align: start; }
.prt-auth-help a, .prt-auth-help button { color: var(--on-sky-1); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prt-fineprint { width: min(100%, var(--w-auth)); margin-block-start: var(--s-8); text-align: center; font-size: var(--fs-micro); line-height: var(--lh-micro); letter-spacing: var(--tr-small); color: var(--on-sky-1); text-wrap: balance; }
/* Links stay inline so punctuation never wraps away from them; 15 px block padding gives a 44 px hit area (L2) without moving the line. */
.prt-fineprint a { display: inline; padding-block: 15px; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
/* Channel choice note (C3): the state sits under its pill as a 12/16 line, never inside the pill. */
.prt-choice-note { margin-block-start: var(--s-2); text-align: center; color: var(--on-sky-1); font-size: var(--fs-micro); line-height: var(--lh-micro); }
/* Human-check zone: the third-party widget draws itself at a fixed 303 × 78 (compact 164 × 144 when the column is
   narrower than 303, set by script through the widget's size option). The zone only centres it and reserves its height. */
.prt-humancheck { display: grid; justify-items: center; min-height: 78px; container: humancheck / inline-size; }
/* The widget's room is reserved before it loads, at the size the page asks it for (ui/auth.js captchaSize: compact when its column is
   narrower than the widget's 303 px footprint, 320 screens), so nothing moves when the real widget arrives: 78 normal, 144 compact. */
@container humancheck (max-width: 302.98px) { .prt-humancheck > :first-child { min-height: var(--humancheck-compact-h); } }

@media (max-width: 1023.98px) {
  .prt-auth { grid-template-columns: 1fr; padding: 0; }
  .prt-media-panel { display: none; }
  .prt-auth-main { padding: calc(var(--s-16) + var(--s-6)) var(--gutter) var(--s-6); }
  .prt-auth-column { transform: none; }
}

/* 3.3 Call pre-join frame (V2): the Orb takes the media-panel slot, inside the panel (M13); the join column is the auth column. */
.prt-call { display: grid; grid-template-columns: var(--w-media-panel) 1fr; min-height: 100svh; padding: var(--s-5); }
.prt-call__stage { display: grid; place-items: center; background: var(--sky-stage); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.prt-call__stage::after { content: none; }
.prt-call .prt-auth-main { padding-block: var(--s-16) var(--s-6); }
.prt-call-name { display: flex; align-items: center; justify-content: center; gap: var(--s-3); }
.prt-call-name h1 { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-medium); letter-spacing: var(--tr-title); }
.prt-call-name .prt-badge--off { color: var(--on-sky-2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }   /* on the sky: follows the sky */
.prt-consent { max-height: 172px; overflow: auto; padding: var(--s-4) var(--pad-plate); color: var(--ink-2); font-size: var(--fs-body); line-height: var(--lh-body); }
.prt-meter { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; width: var(--w-meter); height: 12px; flex: none; }
.prt-meter i { border-radius: 2px; background: var(--mat-ghost-hover); }
.prt-meter i.on { background: var(--ink-1); }
@media (max-width: 1023.98px) {
  .prt-call { grid-template-columns: 1fr; padding: 0; }
  .prt-call > .prt-call__stage { display: grid; position: relative; inset: auto; width: calc(100% - 2 * var(--gutter)); height: 320px; margin: 72px auto 0; }
  .prt-call .prt-auth-main { padding: var(--s-6) var(--gutter) var(--s-10); }
}
@media (max-width: 599.98px) { .prt-call > .prt-call__stage { height: 220px; } }

/* ── 4. Floating chrome (no app bar; free-floating controls at equal insets) ───────────────────── */
.prt-chrome { position: fixed; z-index: var(--z-chrome); inset-block-start: var(--inset-chrome); inset-inline: var(--inset-chrome); display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); pointer-events: none; }
.prt-chrome > * { pointer-events: auto; }
.prt-chrome__start, .prt-chrome__end { display: flex; align-items: center; gap: var(--s-2); }
.prt-chrome__center { position: absolute; inset-inline-start: 50%; transform: translateX(-50%); }
:dir(rtl) .prt-chrome__center { transform: translateX(50%); }
/* H8: content fades and blurs out under the chrome (HL 2.5; #16, #36, #43, #49). The sky's own top colour is solid to
   40 % of the band and falls to 0 at its foot; a 12 px blur under it reaches 60 % before it eases out. At the middle of
   a 48 px control (y 40) content shows through at about 9 %; at the controls' foot (y 64) at about 55 %, blurred, as in
   #16 where bubbles stay faintly visible under the switch. */
.prt-fade-top { position: fixed; z-index: calc(var(--z-chrome) - 1); inset-block-start: 0; inset-inline: 0; height: var(--fade-edge); pointer-events: none;
  background: linear-gradient(180deg, var(--fade-color) 0%, var(--fade-color) 40%, transparent 100%); }
.prt-fade-top::before { content: ''; position: absolute; inset: 0; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent); mask-image: linear-gradient(180deg, #000 60%, transparent); }
.prt-fade-bottom { position: fixed; z-index: calc(var(--z-chrome) - 1); inset-block-end: 0; inset-inline: 0; height: calc(var(--h-composer) + var(--composer-bottom) + var(--s-6)); pointer-events: none;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); -webkit-mask-image: linear-gradient(0deg, #000 55%, transparent); mask-image: linear-gradient(0deg, #000 55%, transparent); }

/* 4.1 Circle button: 48, regular material, one 20 px glyph centred. */
.prt-circle { position: relative; display: inline-grid; place-items: center; flex: none; width: var(--h-control); height: var(--h-control); border-radius: var(--r-pill);
  background: var(--mat-regular); color: var(--ink-1); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); box-shadow: var(--highlight-inner);
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-press) var(--ease-out); }
.prt-circle--invert { background: var(--fill-invert); color: var(--on-invert); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.prt-circle--sm { width: var(--h-control-md); height: var(--h-control-md); }
.prt-circle--sm::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; }
.prt-circle:active { transform: scale(.96); }
.prt-circle:disabled, .prt-circle[aria-disabled='true'] { color: var(--ink-disabled); cursor: default; transform: none; }
@media (hover: hover) {
  .prt-circle:hover:not(:disabled):not([aria-disabled='true']) { background: color-mix(in srgb, var(--mat-regular), var(--ink-1) 8%); }
  .prt-circle--invert:hover:not(:disabled):not([aria-disabled='true']) { background: color-mix(in srgb, var(--fill-invert), var(--on-invert) 8%); }
}

/* 4.2 Chrome pill: the "search" style pill and the language select pill. */
.prt-chrome-pill { position: relative; display: inline-flex; align-items: center; gap: var(--s-2); height: var(--h-control); padding-inline: var(--s-5); border-radius: var(--r-pill);
  background: var(--mat-regular); color: var(--ink-2); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); box-shadow: var(--highlight-inner);
  font-size: var(--fs-body); font-weight: var(--fw-medium); white-space: nowrap; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.prt-chrome-pill select { appearance: none; height: var(--h-control); margin-block: 0; margin-inline: calc(-1 * var(--s-5)); padding-inline: var(--s-5) 36px; border: 0; border-radius: inherit; background: transparent; color: inherit; cursor: pointer; max-width: 200px; text-overflow: ellipsis; }
.prt-chrome-pill .prt-icon--16 { position: absolute; inset-inline-end: 16px; pointer-events: none; }
.prt-chrome-pill option { color: var(--ink-1); background: var(--solid-sheet); }
@media (hover: hover) { .prt-chrome-pill:hover { color: var(--ink-1); } }

/* 4.3 Chrome over the chat column when the side sheet is open, in whole pixels (1440: (1440 − 443 − 540) / 2 = 228.5 → 228). */
@media (min-width: 1024px) {
  .prt-with-side .prt-chrome__center { inset-inline-start: round(down, calc(var(--w-side-sheet) - var(--inset-chrome) + (100vw - var(--w-side-sheet)) / 2), 1px); }
}
/* 4.4 Phone chrome for the conversation (H8; HL 5.7 from #4, #6, #11): the switch stays, compact (2 × 64) and centred;
   search becomes a 48 circle beside the avatar. Below 360 the rail circle goes into the avatar menu and the switch
   takes the start position, so nothing overlaps. */
@media (max-width: 599.98px) {
  .prt-chrome .prt-segment { min-width: var(--w-segment-compact); padding-inline: var(--s-3); }
}
@media (max-width: 359.98px) {
  .prt-chrome__center { position: static; transform: none; order: -1; }
  :dir(rtl) .prt-chrome__center { transform: none; }
}
/* Fit check (script, unit ds.chrome.fit): when the centred zone would come within 8 px of a side zone at any width (a long
   translation of "Chat" or "Tasks"), script sets .prt-chrome--tight and the 320 layout applies. */
/* Build gap (w107): "the switch takes the start position": with the rail circle hidden its zone is empty, so the switch is ordered first. */
.prt-chrome--tight .prt-chrome__center { position: static; transform: none; order: -1; }
.prt-chrome--tight .prt-hide-xs { display: none !important; }
/* Build gap (w107): with a real long translation ("Aguardando" at 320) a compact segment cannot hold its label on one line; as the
   fill variant does (M15), the label wraps inside its 48 px segment instead of spilling past the track. */
@media (max-width: 599.98px) { .prt-chrome .prt-segment { min-width: var(--w-segment-compact); white-space: normal; line-height: 18px; overflow-wrap: anywhere; text-wrap: balance; } }
.prt-chrome--tight .prt-segment { white-space: normal; line-height: 18px; overflow-wrap: anywhere; text-wrap: balance; }

/* ── 5. Pills (buttons) ────────────────────────────────────────────────────────────────────────── */
.prt-pill { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-width: 0; height: var(--h-control); padding-inline: var(--s-6);
  border-radius: var(--r-pill); border: 0; font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-medium); letter-spacing: var(--tr-small); white-space: nowrap; text-align: center;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out), transform var(--dur-press) var(--ease-out); }
.prt-pill > span { overflow: hidden; text-overflow: ellipsis; }
.prt-pill:active { transform: scale(.98); }
.prt-pill--primary { background: var(--fill-invert); color: var(--on-invert); }
.prt-pill--secondary { background: var(--mat-regular); color: var(--ink-1); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); box-shadow: var(--highlight-inner); }   /* on the sky only, never inside a plate (H6) */
.prt-pill--ghost { background: transparent; color: var(--ink-1); font-weight: var(--fw-semibold); }   /* the second action inside any container (#92, #139) */
.prt-pill--on-sky { background: var(--mat-ghost); color: var(--on-sky-1); }                 /* ghost on the sky (Create, Sign out) */
.prt-pill--quiet { background: var(--mat-ghost); color: var(--on-sky-1); }
.prt-pill--attention { background: var(--attention); color: var(--on-attention); }
.prt-pill--action { height: var(--h-control-sm); padding-inline: var(--s-3h); background: var(--fill-action); color: var(--on-action); font-size: var(--fs-detail); box-shadow: var(--action-edge); }
.prt-pill--action::after { content: ''; position: absolute; inset: -6px -2px; border-radius: inherit; }   /* 44 px tall target */
.prt-pill--md { height: var(--h-control-md); padding-inline: var(--s-4); }   /* inside a bubble or a run card */
.prt-pill--md::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; }   /* 44 px target */
/* A block pill never truncates: it wraps to two centred lines in long languages and at 320 (C3). */
.prt-pill--block { display: flex; width: 100%; height: auto; min-height: var(--h-control); padding-block: 14px; white-space: normal; text-wrap: balance; }
.prt-pill--block > span { overflow: visible; }
.prt-pill--icon-start { padding-inline-start: var(--s-5); }
@media (hover: hover) {
  .prt-pill--primary:hover:not(:disabled):not([aria-disabled='true']) { background: color-mix(in srgb, var(--fill-invert), var(--on-invert) 8%); }
  .prt-pill--secondary:hover:not(:disabled):not([aria-disabled='true']) { background: color-mix(in srgb, var(--mat-regular), var(--ink-1) 8%); }
  .prt-pill--ghost:hover:not(:disabled):not([aria-disabled='true']) { background: var(--mat-ghost-hover); }
  .prt-pill--on-sky:hover:not(:disabled):not([aria-disabled='true']), .prt-pill--quiet:hover { background: var(--mat-ghost-hover); }
  .prt-pill--attention:hover:not(:disabled):not([aria-disabled='true']) { background: color-mix(in srgb, var(--attention), #000 10%); }
  .prt-pill--action:hover:not(:disabled):not([aria-disabled='true']) { background: color-mix(in srgb, var(--fill-action), var(--on-action) 10%); }
}
/* Dimmed states use filter: opacity() (build note, w107): the same 40 % as the opacity property, but Chromium at 1× drew a lighter
   rectangle around a dimmed filled pill inside a glass plate with the property, and not with the filter. Same for every dimmed control. */
/* Disabled (H2): the same pill at 40 % so the sky shows through, until the step's value is valid (reference #3 → #1,
   #5 → #7). Use aria-disabled so the control stays focusable and its hint is announced. Busy: gerund label + spinner. */
.prt-pill:disabled, .prt-pill[aria-disabled='true'] { filter: opacity(.4); cursor: default; transform: none; }
.prt-pill[aria-busy='true'] { filter: opacity(.6); cursor: progress; }
/* Build gap (w107): at 40 % the universal ring of a focused resting primary fades with the pill (ring vs halo 2.75:1 in light, under
   the 3:1 of 3.7); while it holds keyboard focus the resting pill shows at 60 %, still plainly not ready. Same for the submit circle. */
.prt-pill[aria-disabled='true']:focus-visible, .prt-field__submit[aria-disabled='true']:focus-visible { filter: opacity(.6); }
.prt-pill[aria-busy='true'] .prt-spinner { width: 16px; height: 16px; }
/* Text link (inline): underlined in the text colour, never blue. */
.prt-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prt-link--muted { color: var(--ink-3); text-decoration: none; }
@media (hover: hover) { .prt-link--muted:hover { color: var(--ink-1); } }

/* Button rows: end-aligned to the container padding (dialogs, forms). Pills never shrink; when two do not fit on one line
   the row wraps in reverse, so the primary (last in reading order) lands on the upper line, both end-aligned. */
.prt-actions { display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; align-items: center; gap: var(--s-2); }
.prt-actions > .prt-pill { flex: 0 0 auto; max-width: 100%; }
.prt-actions--stack { flex-direction: column-reverse; align-items: stretch; }
.prt-actions--stack > .prt-pill { width: 100%; }
/* Build gap (w107): a stacked pill is full width, so like the block pill it wraps a long label (+40 % text at 320) instead of cutting it. */
.prt-actions--stack > .prt-pill, .prt-group__foot .prt-pill, .prt-dialog .prt-actions > .prt-pill { max-width: 100%; }
.prt-actions--stack > .prt-pill { height: auto; min-height: var(--h-control); padding-block: 14px; white-space: normal; text-wrap: balance; }
.prt-actions--stack > .prt-pill > span { overflow: visible; }

/* ── 6. Segmented control and choice chips ────────────────────────────────────────────────────── */
.prt-segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: var(--h-control); padding: 0; border-radius: var(--r-pill);
  background: var(--mat-regular); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); box-shadow: var(--highlight-inner); }
/* Fill: equal widths across the container; a long label wraps to two lines inside its segment, never past the track (M15). */
.prt-segmented--fill { display: grid; width: 100%; }
/* Build gap (w107): three equal segments at 320 hold a translated label on three lines ("Unlimited agent usage"), which ran out of
   the 48 px track onto the sky; the fill track grows with its tallest label instead (48 at least). */
.prt-segmented.prt-segmented--fill { height: auto; min-height: var(--h-control); }
.prt-segmented--fill .prt-segment { height: auto; min-height: var(--h-control); padding-block: 6px; }
.prt-segmented--fill .prt-segment { min-width: 0; padding-inline: var(--s-2); white-space: normal; line-height: 18px; overflow-wrap: anywhere; }
.prt-segment { position: relative; isolation: isolate; min-width: 76px; height: var(--h-control); padding-inline: var(--s-4); border-radius: var(--r-pill);
  color: var(--ink-2); font-size: var(--fs-body); font-weight: var(--fw-medium); white-space: nowrap; transition: color var(--dur-fast) var(--ease-out); }
.prt-segment::before { content: ''; position: absolute; z-index: -1; inset: 4px; border-radius: var(--r-pill); background: transparent; transition: background-color var(--dur-base) var(--ease-out); }
.prt-segment[aria-selected='true'], .prt-segment[aria-pressed='true'], .prt-segment[aria-current='page'] { color: var(--on-invert); }
.prt-segment[aria-selected='true']::before, .prt-segment[aria-pressed='true']::before, .prt-segment[aria-current='page']::before { background: var(--fill-invert); }
/* Build gap (w107): DESIGN-SYSTEM.md 7.8 lists "disabled opacity .40" for segments; this is that rule. */
.prt-segment:disabled, .prt-segment[aria-disabled='true'] { filter: opacity(.4); cursor: default; }
@media (hover: hover) { .prt-segment:hover:not([aria-selected='true']):not([aria-pressed='true']):not([aria-current='page']) { color: var(--ink-1); } }

.prt-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.prt-chip { position: relative; display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--target); padding-inline: var(--s-3h); border-radius: var(--r-chip);
  background: var(--mat-regular); color: var(--ink-2); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); font-size: var(--fs-body); font-weight: var(--fw-medium); text-align: start;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.prt-chip[aria-pressed='true'] { background: var(--fill-invert); color: var(--on-invert); }
@media (hover: hover) { .prt-chip:hover:not([aria-pressed='true']) { color: var(--ink-1); } }
.prt-chip:disabled { filter: opacity(.4); cursor: default; }

/* ── 7. Fields ─────────────────────────────────────────────────────────────────────────────────── */
.prt-field { position: relative; display: flex; align-items: center; gap: var(--s-2); width: 100%; height: var(--h-control); padding-inline: var(--s-5) var(--s-1); border-radius: var(--r-pill);
  background: var(--mat-field); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); color: var(--ink-1); transition: background-color var(--dur-fast) var(--ease-out); }
.prt-field:not(:has(.prt-field__submit, .prt-field__trail)) { padding-inline-end: var(--s-5); }
.prt-field input, .prt-field select { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--ink-1); font-size: var(--fs-body); outline: none; box-shadow: none; }
.prt-field input::placeholder, .prt-textarea textarea::placeholder { color: var(--ink-3); opacity: 1; }
/* Select field (C5): the select fills the pill so its own box holds the value; 20 start, 36 end for the chevron. */
.prt-field.prt-field--select { padding-inline: 0; }   /* two classes: beats the end padding of .prt-field:not(:has(…)) */
.prt-field--select select { appearance: none; cursor: pointer; padding-inline: var(--s-5) 36px; border-radius: inherit; }
.prt-field--select .prt-icon--16 { position: absolute; inset-inline-end: var(--s-4); pointer-events: none; color: var(--ink-2); }
.prt-field__suffix { flex: none; color: var(--ink-3); font-size: var(--fs-body); white-space: nowrap; }
.prt-field__trail { display: flex; align-items: center; gap: var(--s-1); }
.prt-field__submit { position: relative; display: grid; place-items: center; flex: none; width: var(--h-control-md); height: var(--h-control-md); border-radius: var(--r-pill); background: var(--fill-invert); color: var(--on-invert);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-press) var(--ease-out); }
.prt-field__submit::after { content: ''; position: absolute; inset: -2px; border-radius: var(--r-pill); }
.prt-field__submit:disabled, .prt-field__submit[aria-disabled='true'] { filter: opacity(.4); cursor: default; }
.prt-field__submit:active:not(:disabled) { transform: scale(.94); }
.prt-field__reveal { display: grid; place-items: center; width: var(--target); height: var(--target); color: var(--ink-2); border-radius: var(--r-pill); }
.prt-field[aria-invalid='true'], .prt-field:has([aria-invalid='true']) { box-shadow: inset 0 0 0 1.5px var(--error-ink); }
.prt-field:has(:disabled) { filter: opacity(.55); }
/* Build gap (w107): the error ring and the focus halo are both box-shadows, so an invalid field that takes focus lost its halo (the
   later error rule won); focused and invalid, the wrapper draws both. The textarea card's pair is below its own rules. */
.prt-field:is([aria-invalid='true'], :has([aria-invalid='true'])):has(> input:focus-visible, > select:focus-visible) { box-shadow: inset 0 0 0 1.5px var(--error-ink), 0 0 0 6px var(--focus-halo); }
/* Field row (country + number): the country column never drops below 120, so the longest code ("GB +44") shows whole. */
.prt-field-row { display: grid; grid-template-columns: minmax(120px, 30%) minmax(0, 1fr); gap: var(--s-2); }
.prt-field-row > * { min-width: 0; }
.prt-field-row--three { grid-template-columns: 2fr 1fr 1.4fr; }
/* M14: helper lines start at the field's outer edge (#7). On-sky-1: the auth column sits in the middle of the sky, below
   the upper band where on-sky-2 is allowed (measured 3.83:1 there in on-sky-2). */
.prt-field-help { font-size: var(--fs-detail); line-height: var(--lh-detail); color: var(--on-sky-1); padding-inline: 0; }

/* Textarea card (feedback recipe): regular plate, placeholder top-start, hairline over a bottom toolbar. */
.prt-textarea { display: flex; flex-direction: column; border-radius: var(--r-plate); background: var(--mat-field); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); }
.prt-textarea textarea { min-height: 132px; padding: var(--s-4) var(--pad-plate); border: 0; background: transparent; resize: vertical; color: var(--ink-1); font-size: var(--fs-body); line-height: var(--lh-body); outline: none; }
.prt-textarea__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-inline: var(--s-3); padding-block: var(--s-3); border-block-start: 1px solid var(--hairline); }
/* Build gap (w107): in long languages at 320 the bar's two pills do not fit on one line; they wrap, the primary keeps the end. */
.prt-textarea__bar { flex-wrap: wrap; }
.prt-textarea__bar > .prt-pill { flex: none; max-width: 100%; }
.prt-textarea__bar > :last-child { margin-inline-start: auto; }
/* Build gap (w107): 7.11 says "states as the field"; the field's error ring and disabled opacity, on the card. */
.prt-textarea:has(textarea[aria-invalid='true']) { box-shadow: inset 0 0 0 1.5px var(--error-ink); }
.prt-textarea:has(textarea:disabled) { filter: opacity(.55); }
.prt-textarea:has(textarea[aria-invalid='true']):has(textarea:focus-visible) { box-shadow: inset 0 0 0 1.5px var(--error-ink), 0 0 0 6px var(--focus-halo); }

/* Alert plate (M7): a rounded rectangle (radius 16, #9), glyph + short factual line, start-aligned, above the control it
   explains. Never in the slot of a pill and never pill-shaped; the step keeps its own control under it. */
.prt-alert { display: flex; align-items: flex-start; justify-content: flex-start; gap: var(--s-2); padding: 14px var(--s-4); border-radius: var(--r-alert);
  background: var(--mat-regular); color: var(--error-ink); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); font-size: var(--fs-body); line-height: var(--lh-body); text-align: start; }
.prt-alert .prt-icon { margin-block-start: 0; }
.prt-alert[hidden] { display: none; }

/* "or" divider and hairline */
.prt-or { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s-3); color: var(--on-sky-1); font-size: var(--fs-micro); line-height: var(--lh-micro); }
.prt-or::before, .prt-or::after { content: ''; height: 1px; background: rgba(255, 255, 255, .14); }
.prt-rule { height: 1px; border: 0; margin: 0; background: rgba(255, 255, 255, .14); }

/* ── 8. Checkbox, radio, switch ───────────────────────────────────────────────────────────────── */
.prt-check { display: flex; align-items: flex-start; gap: var(--s-3); min-height: var(--target); padding-block: 12px; cursor: pointer; color: inherit; }
.prt-check input { appearance: none; flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin: 0; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--ink-3); background: transparent; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.prt-check input::after { content: ''; width: 10px; height: 6px; margin-block-start: -2px; border-inline-start: 2px solid var(--on-invert); border-block-end: 2px solid var(--on-invert); transform: rotate(-45deg) scale(0); transition: transform var(--dur-fast) var(--ease-out); }
.prt-check input:checked { background: var(--fill-invert); box-shadow: none; }
.prt-check input:checked::after { transform: rotate(-45deg) scale(1); }
.prt-check input:disabled { filter: opacity(.4); cursor: default; }
.prt-check__text { font-size: var(--fs-body); line-height: var(--lh-body); padding-block-start: 0; }

.prt-radio { appearance: none; flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin: 0; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1.5px var(--ink-3); cursor: pointer; }
.prt-radio::after { content: ''; width: 10px; height: 10px; border-radius: var(--r-pill); background: var(--fill-invert); transform: scale(0); transition: transform var(--dur-fast) var(--ease-out); }
.prt-radio:checked { box-shadow: inset 0 0 0 1.5px var(--fill-invert); }
.prt-radio:checked::after { transform: scale(1); }

.prt-switch { appearance: none; position: relative; flex: none; width: 52px; height: 32px; margin: 0; border-radius: var(--r-pill); background: var(--mat-thin); box-shadow: inset 0 0 0 1.5px var(--ink-3); cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.prt-switch::before { content: ''; position: absolute; inset-block-start: 4px; inset-inline-start: 4px; width: 24px; height: 24px; border-radius: var(--r-pill); background: var(--ink-2); transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out); }
.prt-switch::after { content: ''; position: absolute; inset: -6px -2px; }   /* 44 px target */
.prt-switch:checked { background: var(--fill-invert); box-shadow: none; }
.prt-switch:checked::before { background: var(--on-invert); transform: translateX(20px); }
:dir(rtl) .prt-switch:checked::before { transform: translateX(-20px); }
.prt-switch:disabled { filter: opacity(.4); cursor: default; }

/* ── 9. Plates, groups and rows ───────────────────────────────────────────────────────────────── */
.prt-plate { border-radius: var(--r-plate); padding: var(--pad-plate); background: var(--mat-regular); color: var(--ink-1); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); box-shadow: var(--highlight-inner); }
.prt-group { container: group / inline-size; border-radius: var(--r-plate); background: var(--mat-regular); color: var(--ink-1); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); box-shadow: var(--highlight-inner); overflow: hidden; }
.prt-group > li { list-style: none; }
/* Row: 60 tall; icon at 20 from the edge, label at 52, value then chevron, chevron at 20 from the other edge (equal insets).
   C1/C2/C4: the label column never truncates and never gets less than --row-main-min (144; 120 below 360). Whatever
   trails it (value, badge, pill, meter) yields: it wraps to a second line, end-aligned, before it can squeeze the label.
   The badge of a two-line row lives inside the label column, so it can never enter the trailing column. */
.prt-row { position: relative; display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s-3); row-gap: var(--s-2); width: 100%; min-height: var(--h-row); padding-block: var(--s-2); padding-inline: var(--pad-row-x); color: var(--ink-1); text-align: start;
  font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-medium); transition: background-color var(--dur-fast) var(--ease-out); }
.prt-row + .prt-row::before, .prt-group > li + li > .prt-row::before, .prt-group > li + li > .prt-group__foot::before { content: ''; position: absolute; inset-block-start: 0; inset-inline: var(--pad-row-x); height: 1px; background: var(--hairline); }
a.prt-row, button.prt-row, label.prt-row { cursor: pointer; }
@media (hover: hover) { a.prt-row:hover, button.prt-row:hover:not(:disabled), label.prt-row:hover { background: color-mix(in srgb, transparent, var(--ink-1) 5%); } }
a.prt-row:active, button.prt-row:active { background: color-mix(in srgb, transparent, var(--ink-1) 9%); }
.prt-row:focus-visible { --focus-offset: -6px; --focus-shadow: inset 0 0 0 8px var(--focus-halo); border-radius: var(--r-plate); }
.prt-row__icon { flex: none; width: 20px; height: 20px; color: inherit; }
.prt-row__mark { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--solid-tile); color: var(--ink-2); font-size: 11px; font-weight: var(--fw-semibold); line-height: 1; }
.prt-row__main { flex: 1 1 0; min-width: min(var(--row-main-min), 100%); display: flex; flex-direction: column; gap: 2px; }
.prt-row__label { overflow-wrap: break-word; }
.prt-row__detail { color: var(--ink-3); font-size: var(--fs-detail); line-height: var(--lh-detail); font-weight: var(--fw-regular); overflow-wrap: anywhere; }
.prt-row__detail + .prt-row__detail { margin-block-start: 0; }
/* Build gap (w107): 7.15 "error: the detail line in error-ink with a triangle" and "loading: the value becomes a 64 × 12 skeleton bar". */
.prt-row__detail--error { display: flex; align-items: flex-start; gap: var(--s-1); color: var(--error-ink); }
.prt-row__detail--error .prt-icon { margin-block-start: 1px; }
.prt-row__value > .prt-skeleton { display: block; width: 64px; }
.prt-row__hash { font-family: var(--font-mono); font-size: var(--fs-micro); line-height: var(--lh-micro); color: var(--ink-3); overflow-wrap: anywhere; direction: ltr; text-align: start; font-weight: 400; }
.prt-row__value { flex: 0 1 auto; min-width: 0; max-width: 100%; margin-inline-start: auto; color: var(--ink-2); font-weight: var(--fw-regular); text-align: end; overflow-wrap: anywhere; }
.prt-row__value bdi { unicode-bidi: isolate; white-space: nowrap; }
.prt-row__trail { flex: none; display: flex; align-items: center; gap: var(--s-2); margin-inline-start: auto; }
/* L1: chevrons in ink-1 at a 1.75 stroke, the weight of the label (#122, #146). */
.prt-row__chevron { flex: none; width: 16px; height: 16px; color: var(--ink-1); stroke-width: 1.75; }
.prt-row--two-line { align-items: center; padding-block: var(--s-3); }
.prt-row__main > .prt-badge { align-self: flex-start; margin-block-start: 6px; }
/* A value or badge that does not fit beside the label becomes the row's second line under the label (C1; F-SHEET 390):
   label over value, the trail keeps its place, centred on the row. Applies to every row with a value when its group is
   narrower than 480 (every phone), and to any row at any width once the label needs the room. */
@container group (max-width: 479.98px) {
  .prt-row:has(> .prt-row__value) { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: 'lead main trail' 'lead value trail'; column-gap: var(--s-3); row-gap: 2px; padding-block: var(--s-3); }
  .prt-row:has(> .prt-row__value):not(:has(> .prt-row__icon, > .prt-row__mark)) { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'main trail' 'value trail'; }
  .prt-row:has(> .prt-row__value) > :is(.prt-row__icon, .prt-row__mark) { grid-area: lead; align-self: start; }
  .prt-row:has(> .prt-row__value) > .prt-row__main { grid-area: main; min-width: 0; }
  .prt-row:has(> .prt-row__value) > .prt-row__value { grid-area: value; margin: 0; text-align: start; justify-self: start; font-size: var(--fs-detail); line-height: var(--lh-detail); color: var(--ink-3); }
  .prt-row:has(> .prt-row__value) > .prt-row__value > .prt-badge { margin-block-start: 4px; }
  .prt-row:has(> .prt-row__value) > .prt-row__trail { grid-area: trail; margin: 0; }
}
/* Key-value row (profile recipe): muted label start, primary value end; an empty value shows a muted placeholder. */
.prt-row--kv { flex-wrap: nowrap; }
.prt-row--kv .prt-row__key { flex: none; width: 34%; color: var(--ink-3); font-weight: var(--fw-regular); }
.prt-row--kv .prt-row__val { flex: 1; min-width: 0; text-align: end; color: var(--ink-1); font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.prt-row--kv .prt-row__val:empty::before { content: attr(data-empty); color: var(--ink-3); font-weight: var(--fw-regular); }
.prt-row--kv input, .prt-row--kv textarea { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--ink-1); text-align: end; font-size: var(--fs-body); outline: none; resize: none; }
.prt-row--kv:has(input:focus-visible, textarea:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: -6px; box-shadow: inset 0 0 0 8px var(--focus-halo); border-radius: var(--r-plate); }   /* the row ring, inside the group's clip */
.prt-row--kv input::placeholder, .prt-row--kv textarea::placeholder { color: var(--ink-3); opacity: 1; }
.prt-row--radio { cursor: pointer; font-weight: var(--fw-regular); }
.prt-row--radio .prt-radio { margin-inline-start: auto; }
.prt-row[aria-disabled='true'], .prt-row:disabled { color: var(--ink-3); cursor: default; }
.prt-row[aria-disabled='true'] .prt-row__icon, .prt-row:disabled .prt-row__icon { color: var(--ink-3); }
/* Destructive trash circle inside a row: neutral at rest, red glyph only on hover. */
.prt-row .prt-circle--sm { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--ink-2); }
@media (hover: hover) { .prt-row .prt-circle--sm[data-tone='destructive']:hover { color: var(--destructive-icon); background: var(--mat-ghost-hover); } }
/* Group footer: helper text plus end-aligned pills. H5: its hairline is inset on both sides like every row hairline,
   never full-bleed. H6: the second action is a ghost (600), the first a primary; no material nests inside the plate. */
.prt-group__foot { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s-2); padding: var(--s-3) var(--pad-row-x) var(--s-4); }
.prt-group__foot::before { content: ''; position: absolute; inset-block-start: 0; inset-inline: var(--pad-row-x); height: 1px; background: var(--hairline); }
.prt-group__foot--solo { padding-block: var(--s-4); }
.prt-group__foot--solo::before { content: none; }
.prt-group__foot .prt-row__detail { flex: 1 1 200px; }
@container group (max-width: 399.98px) {
  .prt-group__foot:not(:has(.prt-row__detail)) { flex-direction: column-reverse; align-items: stretch; }
  .prt-group__foot .prt-pill { flex: none; width: 100%; }
}

/* ── 10. Page header, helper, section label, empty state ───────────────────────────────────────── */
/* Back circle's start edge = column start edge; title 16 px after it, centred on the title's first line (also when it wraps). */
.prt-page-head { display: flex; align-items: flex-start; gap: var(--s-4); min-height: var(--h-control); }
.prt-page-head__title { flex: 1; min-width: 0; padding-block-start: calc((var(--h-control) - var(--lh-title)) / 2); font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-medium); letter-spacing: var(--tr-title); color: var(--on-sky-1); text-wrap: balance; overflow-wrap: anywhere; }
.prt-page-head__title:focus-visible { --focus-offset: 4px; }
.prt-helper { color: var(--on-sky-2); font-size: var(--fs-detail); line-height: var(--lh-detail); text-wrap: pretty; }
.prt-section-label { margin-block-start: var(--s-6) !important; padding-inline: 2px; color: var(--on-sky-1); font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: var(--fw-medium); }
.prt-group-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 var(--s-4); }
.prt-group-title > span:last-child { color: var(--on-sky-1); font-size: var(--fs-body); font-weight: var(--fw-regular); }   /* H10: on-sky-1, it sits low on the sky */
.prt-empty { color: var(--on-sky-2); font-size: var(--fs-detail); line-height: var(--lh-detail); }
.prt-loading-line { color: var(--on-sky-2); font-size: var(--fs-detail); line-height: var(--lh-detail); }

/* ── 11. Account header, avatar, plan strip ───────────────────────────────────────────────────── */
.prt-account { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: var(--s-4); min-height: 56px; }
.prt-account__name { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-medium); letter-spacing: var(--tr-title); color: var(--on-sky-1); overflow-wrap: anywhere; }
.prt-account__detail { color: var(--on-sky-2); font-size: var(--fs-detail); line-height: var(--lh-detail); overflow-wrap: anywhere; }
.prt-account__detail bdi { white-space: nowrap; }   /* a number or address never breaks inside itself */
/* Detail joiner as its own isolated element (a ::before inside an LTR <bdi> lands on the wrong side in RTL):
   <bdi>…</bdi><span class="prt-joiner" aria-hidden="true"> · </span><bdi>…</bdi>. */
.prt-joiner { unicode-bidi: isolate; white-space: pre; }
.prt-avatar { flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: var(--r-pill); overflow: hidden; background: var(--avatar-default); color: #FFFFFF;
  font-size: var(--fs-lead); line-height: 1; font-weight: var(--fw-semibold); }
.prt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.prt-avatar--32 { width: 32px; height: 32px; font-size: 14px; }
.prt-avatar--48 { width: 48px; height: 48px; }
.prt-avatar--112 { width: 112px; height: 112px; font-size: 40px; }
.prt-avatar[data-state='loading'] { background: var(--mat-regular); }
.prt-strip { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-4); min-height: 80px; padding: var(--s-4) var(--pad-row-x); border-radius: var(--r-plate);
  background: var(--mat-regular); color: var(--ink-1); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); box-shadow: var(--highlight-inner); }
.prt-strip__main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prt-strip__name { font-family: var(--font-serif); font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: var(--fw-regular); }
.prt-strip__detail { color: var(--ink-3); font-size: var(--fs-detail); line-height: var(--lh-detail); text-wrap: pretty; }   /* M3: no one-word last line */
.prt-strip > .prt-pill { flex: none; }
/* M3: below 400 of column the pill drops under the text at full width; the strip then reads as one row of text over its action. */
@container column (max-width: 399.98px) {
  .prt-strip { flex-wrap: wrap; }
  .prt-strip > .prt-pill { width: 100%; }
}

/* ── 12. Badges, spinner, activity status pill, step list, confirmation pill ──────────────────── */
.prt-badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding-inline: 10px 12px; border-radius: var(--r-pill); font-size: var(--fs-micro); line-height: var(--lh-micro); font-weight: var(--fw-medium); letter-spacing: var(--tr-small); white-space: nowrap;
  background: var(--mat-ghost-hover); color: var(--ink-1); }
:root[toggle-theme='light'] body:not([data-materials='dark']) .prt-badge:not(.prt-badge--attention):not(.prt-badge--off),
:root[data-theme='light'] body:not([data-materials='dark']) .prt-badge:not(.prt-badge--attention):not(.prt-badge--off) { background: rgba(10, 20, 45, .07); }   /* white .12 vanishes on white glass */
/* C2: a badge inside the label column may wrap inside that column; it never overflows into the trailing column. */
.prt-row__main > .prt-badge, .prt-row__value > .prt-badge { max-width: 100%; height: auto; min-height: 28px; padding-block: 6px; white-space: normal; text-align: start; }
.prt-badge .prt-icon { width: 14px; height: 14px; }
.prt-badge--ok .prt-icon { color: var(--success-icon); }
.prt-badge--attention { background: var(--attention); color: var(--on-attention); }   /* H7: only "you must act now" */
.prt-badge--working .prt-spinner { width: 14px; height: 14px; }
.prt-badge--off { background: transparent; box-shadow: inset 0 0 0 1px var(--outline-status); color: var(--ink-2); }   /* settled or inactive states: Off, Not open, Blocked */
.prt-badge--lg { height: 40px; padding-inline: 14px 16px; font-size: var(--fs-detail); }

.prt-spinner { display: inline-block; flex: none; width: 20px; height: 20px; border-radius: var(--r-pill); border: 1.5px solid currentColor; border-block-start-color: transparent; opacity: .9; animation: prt-spin var(--dur-spin) linear infinite; }
@keyframes prt-spin { to { transform: rotate(360deg); } }

.prt-status { display: inline-flex; align-items: center; gap: var(--s-2); max-width: 100%; height: var(--h-control); padding-inline: var(--s-5); border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .20);
  color: var(--on-sky-2); --shimmer-base: var(--on-sky-2); --shimmer-peak: var(--on-sky-1); font-size: var(--fs-body); white-space: nowrap; overflow: hidden; }
.prt-status__text { overflow: hidden; text-overflow: ellipsis; }
.prt-status[data-live='true'] .prt-status__text { background: linear-gradient(90deg, var(--shimmer-base) 0%, var(--shimmer-base) 40%, var(--shimmer-peak) 50%, var(--shimmer-base) 60%, var(--shimmer-base) 100%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: prt-shimmer var(--dur-shimmer) linear infinite; }
@keyframes prt-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.prt-status--in-plate { color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--outline-status); --shimmer-base: var(--ink-3); --shimmer-peak: var(--ink-1); }
.prt-thread > .prt-status { align-self: flex-start; }
/* Day sky: nothing sits bare on it, so the status pill takes the thin material and ink-1. */
:root[toggle-theme='light'] body[data-sky='chat'] .prt-status, :root[data-theme='light'] body[data-sky='chat'] .prt-status { background: var(--mat-thin); color: var(--ink-1); box-shadow: none; --shimmer-base: var(--ink-2); --shimmer-peak: var(--ink-1); }

.prt-steps { display: flex; flex-direction: column; gap: var(--s-4); padding: var(--pad-plate); border-radius: var(--r-plate); background: var(--mat-regular); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); color: var(--ink-1); }   /* build gap (w107): the plate gives its head ink-1; it inherited white, unreadable on light glass */
.prt-steps__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); font-weight: var(--fw-medium); }
.prt-step { display: grid; grid-template-columns: 20px 1fr; column-gap: var(--s-3); align-items: start; color: var(--ink-2); }
.prt-step__mark { display: grid; place-items: center; width: 20px; height: 20px; }
.prt-step__mark::before { content: ''; width: 5px; height: 5px; border-radius: var(--r-pill); background: currentColor; }
.prt-step__mark .prt-icon { width: 16px; height: 16px; color: var(--success-icon); }
.prt-step__mark .prt-spinner { width: 14px; height: 14px; }
.prt-step[data-state='current'] { color: var(--ink-1); }
.prt-step[data-state='current'] .prt-step__mark::before, .prt-step[data-state='done'] .prt-step__mark::before { display: none; }
.prt-step__text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.prt-confirm { display: inline-flex; align-items: center; gap: var(--s-2); height: var(--h-control); padding-inline: var(--s-4) var(--s-5); border-radius: var(--r-pill); background: var(--fill-invert); color: var(--on-invert); font-weight: var(--fw-medium); }
.prt-confirm .prt-icon { color: var(--success-icon-on-invert); }

/* ── 13. Toast: top-centre pill, one at a time, no close button ───────────────────────────────── */
.prt-toast-region { position: fixed; z-index: var(--z-toast); inset-block-start: 28px; inset-inline: 0; display: flex; justify-content: center; pointer-events: none; padding-inline: var(--gutter); }
.prt-toast { display: inline-flex; align-items: center; gap: var(--s-2); max-width: min(100%, 420px); min-height: 44px; padding: 10px var(--s-5) 10px var(--s-4); border-radius: var(--r-pill);
  background: var(--mat-regular); color: var(--ink-1); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); box-shadow: var(--shadow-float); font-size: var(--fs-body); font-weight: var(--fw-medium);
  animation: prt-toast-in var(--dur-base) var(--ease-out) both; pointer-events: auto; }   /* the region lets clicks through; the toast itself can be hovered (it stays while hovered) */
.prt-toast .prt-icon { color: var(--success-icon); }
.prt-toast[data-tone='attention'] .prt-icon { color: var(--attention); }
.prt-toast[data-leaving] { animation: prt-toast-out var(--dur-fast) var(--ease-in) both; }
@keyframes prt-toast-in { from { opacity: 0; transform: translateY(calc(-1 * var(--rise))); } }
@keyframes prt-toast-out { to { opacity: 0; transform: translateY(calc(-1 * var(--rise))); } }

/* ── 14. Dialogs and sheets (native <dialog>, top layer) ──────────────────────────────────────── */
.prt-dialog { width: min(100% - 32px, var(--w-dialog)); max-width: none; max-height: calc(100svh - 32px);   /* max-width: none drops the UA's calc(100% − 6px − 2em), which made it 354 at 390 */
   margin: auto; padding: var(--pad-dialog); border: 0; border-radius: var(--r-plate);
  background: var(--solid-dialog); color: var(--ink-1); box-shadow: var(--shadow-dialog); overscroll-behavior: contain; container-type: inline-size; }
.prt-dialog[open] { animation: prt-dialog-in var(--dur-base) var(--ease-out) both; }
.prt-dialog::backdrop { background: var(--scrim-dialog); -webkit-backdrop-filter: var(--scrim-blur); backdrop-filter: var(--scrim-blur); animation: prt-fade-in var(--dur-base) var(--ease-out) both; }
.prt-dialog__title { font-size: var(--fs-dialog); line-height: var(--lh-dialog); font-weight: var(--fw-bold); letter-spacing: var(--tr-title); text-wrap: balance; }
/* M1: title → body 16, body → actions 32 (#139: ≈23 from title baseline to body ascenders, ≈36 from body to buttons). */
.prt-dialog__body { margin-block-start: var(--s-4); color: var(--ink-1); font-size: var(--fs-body); line-height: var(--lh-body); text-wrap: pretty; }
.prt-dialog__body + .prt-dialog__body { margin-block-start: var(--s-2); }
.prt-dialog .prt-alert { margin-block-start: var(--s-4); }
.prt-dialog .prt-check { margin-block-start: var(--s-3); }
.prt-dialog .prt-actions { margin-block-start: var(--s-8); }
.prt-dialog[aria-busy='true'] .prt-actions > * { pointer-events: none; }
/* M2: the actions stay side by side, end-aligned (#92, #139); they stack only when two pills cannot fit (under 240). */
@container (max-width: 239.98px) { .prt-dialog .prt-actions { flex-direction: column-reverse; align-items: stretch; } .prt-dialog .prt-actions > .prt-pill { width: 100%; } }
/* Under 280 of content (320 screens) a dialog's pills take 16 px of inline padding, so two of them stay side by side in every language and stack
   only when they cannot fit (critique M2). One rule for every .prt-dialog (w109: it replaces the dashboard's copy in styles.css, whose named
   container never existed, and /manage's copy in hub.css). */
@container (max-width: 279.98px) { .prt-dialog .prt-actions > .prt-pill { padding-inline: var(--s-4); } }
/* Information dialog: light solid in both themes, key-value grid, primary pill at the end. */
.prt-dialog--info { background: #FEFEFE; color: #1C1F27; --ink-1: #1C1F27; --ink-3: #3A404D; --fill-invert: #16181E; --on-invert: #FFFFFF; }
.prt-dialog--info .prt-dialog__title { font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: var(--fw-medium); }
/* Build gap (w107): with minmax(96px, auto) a long translated key took the row and left the value so little room that a phone number
   broke inside itself at 320 (seen in the Arabic baseline); the key column is capped at 40 %, so a number keeps to one line and only a
   long address wraps (5.5: long values wrap). */
.prt-kv { display: grid; grid-template-columns: minmax(96px, 40%) minmax(0, 1fr); gap: var(--s-2) var(--s-5); margin-block-start: var(--s-5); font-size: var(--fs-body); }
.prt-kv dt { color: var(--ink-3); } .prt-kv dd { margin: 0; color: var(--ink-1); overflow-wrap: anywhere; }
@keyframes prt-dialog-in { from { opacity: 0; transform: scale(.96); } }
@keyframes prt-fade-in { from { opacity: 0; } }

/* Document sheet: centred solid sheet, floating top row (minimise, centred title, more), text fades at the lower edge. */
.prt-sheet { width: min(100% - 32px, var(--w-sheet)); max-width: none; height: calc(100svh - 112px); margin: 96px auto 16px; padding: 0; border: 0; border-radius: var(--r-sheet); background: var(--solid-sheet); color: var(--ink-1); overflow: visible; }
.prt-sheet::backdrop { background: var(--scrim-dialog); -webkit-backdrop-filter: var(--scrim-blur); backdrop-filter: var(--scrim-blur); }
.prt-sheet[open] { animation: prt-sheet-in var(--dur-enter) var(--ease-out) both; }
.prt-sheet__top { position: fixed; inset-block-start: var(--inset-chrome); inset-inline: var(--inset-chrome); display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; }
.prt-sheet__top-title { text-align: center; font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: var(--fw-medium); color: var(--on-sky-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prt-sheet__scroll { height: 100%; overflow: auto; padding: var(--s-10) var(--s-8) var(--s-16); border-radius: inherit; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 64px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 64px), transparent); }
@keyframes prt-sheet-in { from { opacity: 0; transform: translateY(16px); } }
/* Build gap (w107): the scroller is focusable by keyboard, and its mask hid a ring drawn outside it; the ring is drawn inside instead. */
.prt-sheet__scroll:focus-visible { --focus-offset: -6px; --focus-shadow: inset 0 0 0 8px var(--focus-halo); }
/* Build gap (w107): 7.29 "H1 in the serif (40/54), body 16/26, bold sub-heads 15/600". */
.prt-sheet__scroll h1 { margin-block-end: var(--s-5); font-family: var(--font-serif); font-size: var(--fs-serif-doc); line-height: var(--lh-serif-doc); font-weight: var(--fw-regular); text-wrap: balance; }
.prt-sheet__scroll h2 { margin-block: var(--s-6) var(--s-2); font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-semibold); }
.prt-sheet__scroll .prt-prose + .prt-prose { margin-block-start: var(--s-4); }

/* Crop dialog ("move and scale"): grey regular card, circular mask, full-width slider, Cancel + Save. */
.prt-crop { display: grid; gap: var(--s-5); }
.prt-crop__stage { position: relative; aspect-ratio: 1; border-radius: var(--r-tile); overflow: hidden; background: #000; }
.prt-crop__stage::after { content: ''; position: absolute; inset: 0; border-radius: var(--r-pill); box-shadow: 0 0 0 999px rgba(0, 6, 26, .55); pointer-events: none; }
.prt-range { appearance: none; width: 100%; height: var(--target); background: transparent; cursor: pointer; }
.prt-range::-webkit-slider-runnable-track { height: 4px; border-radius: var(--r-pill); background: var(--mat-ghost-hover); }
.prt-range::-webkit-slider-thumb { appearance: none; width: 24px; height: 24px; margin-top: -10px; border-radius: var(--r-pill); background: var(--fill-invert); box-shadow: var(--shadow-float); }
.prt-range::-moz-range-track { height: 4px; border-radius: var(--r-pill); background: var(--mat-ghost-hover); }
.prt-range::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: var(--r-pill); background: var(--fill-invert); }

/* ── 15. Menus and popovers ───────────────────────────────────────────────────────────────────── */
.prt-menu { min-width: 188px; max-width: min(100vw - 32px, 320px); padding: 4px; border-radius: var(--r-plate); background: var(--mat-regular); color: var(--ink-1); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur);
  box-shadow: var(--shadow-float), var(--highlight-inner); transform-origin: var(--menu-origin, top left); animation: prt-menu-in var(--dur-fast) var(--ease-out) both; }
.prt-menu__item { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 48px; padding-inline: var(--s-4); border-radius: 16px; font-weight: var(--fw-medium); text-align: start; }
.prt-menu__item:hover, .prt-menu__item:focus-visible { background: color-mix(in srgb, transparent, var(--ink-1) 10%); }
.prt-menu__item:focus-visible { --focus-offset: -4px; --focus-shadow: inset 0 0 0 6px var(--focus-halo); }
.prt-menu__sep { height: 1px; margin: 4px var(--s-4); background: var(--hairline); }
.prt-swatches { display: flex; gap: var(--s-2); padding: var(--s-2) var(--s-3); }
.prt-swatch { position: relative; width: 28px; height: 28px; border-radius: var(--r-pill); background: var(--swatch); }
.prt-swatch::after { content: ''; position: absolute; inset: -8px; border-radius: var(--r-pill); }
.prt-swatch[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--solid-dialog), 0 0 0 4px var(--ink-1); }
@keyframes prt-menu-in { from { opacity: 0; transform: scale(.96); } }

/* ── 16. Stat tiles (usage, invite stats) ─────────────────────────────────────────────────────── */
.prt-tiles { display: grid; grid-template-columns: repeat(var(--tiles, 3), minmax(0, 1fr)); gap: var(--s-2); }
.prt-tile { display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-2); min-height: 92px; padding: var(--s-3) var(--s-3h); border-radius: var(--r-tile); background: var(--solid-tile); color: var(--ink-1); }
/* M4: short labels (one line in English at every width); a translation may take two lines, never more, and the values
   keep one shared baseline because they sit at the tile's end. */
.prt-tile__label { color: var(--ink-3); font-size: var(--fs-detail); line-height: var(--lh-detail); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prt-tile__value { font-size: 26px; line-height: 30px; letter-spacing: var(--tr-title); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* The infinity sign drawn at the digits' ink height (M4): Inter's ∞ inks at 0.42 em, its figures at 0.77 em, so the 26 px
   figures (ink 20) pair with a 46 px ∞ (ink 19.5), measured with canvas TextMetrics. */
.prt-tile__value--glyph { font-size: 46px; line-height: 30px; letter-spacing: 0; }
.prt-plate__head { display: flex; align-items: center; gap: var(--s-2); margin-block-end: var(--s-3); font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-medium); }
.prt-plate__foot { margin-block-start: var(--s-3); color: var(--ink-3); font-size: var(--fs-detail); line-height: var(--lh-detail); }
@container column (max-width: 389.98px) { .prt-tiles { --tiles: 1 !important; } .prt-tile { min-height: 60px; flex-direction: row; align-items: center; } .prt-tile__label { -webkit-line-clamp: 3; } }

/* ── 17. Copy field and QR pad ────────────────────────────────────────────────────────────────── */
.prt-copy { display: flex; align-items: center; gap: var(--s-2); height: var(--h-control); padding-inline: var(--s-5) var(--s-1); border-radius: var(--r-pill); background: var(--mat-field); color: var(--ink-1); }
.prt-copy code, .prt-copy__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-sans); font-size: var(--fs-body); direction: ltr; text-align: start; }
.prt-copy .prt-pill { height: var(--h-control-md); padding-inline: var(--s-4); }
/* Build gap (w107): the 40-tall Copy pill needs the 44 px target every control has (9.13), as the other 40-tall pills get it. */
.prt-copy .prt-pill::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; }
.prt-code { font-family: var(--font-mono); font-size: var(--fs-micro); line-height: var(--lh-micro); color: var(--ink-3); overflow-wrap: anywhere; direction: ltr; }
.prt-qr { display: grid; justify-items: center; gap: var(--s-3); }
.prt-qr__pad { padding: 12px; border-radius: var(--r-plate); background: var(--solid-pad); }
.prt-qr__pad img { width: 176px; height: 176px; image-rendering: pixelated; }
.prt-qr figcaption { color: var(--ink-3); font-size: var(--fs-detail); line-height: var(--lh-detail); text-align: center; }
@media (max-width: 599.98px) { .prt-qr { display: none; } }

/* ── 18. Skeleton and boot ────────────────────────────────────────────────────────────────────── */
.prt-skeleton { border-radius: var(--r-chip); background: linear-gradient(90deg, var(--mat-ghost-hover) 0%, color-mix(in srgb, var(--mat-ghost-hover), #FFFFFF 10%) 50%, var(--mat-ghost-hover) 100%); background-size: 200% 100%; animation: prt-skeleton var(--dur-glow) var(--ease-in-out) infinite; }
.prt-skeleton--line { height: 12px; } .prt-skeleton--block { height: 72px; border-radius: var(--r-tile); } .prt-skeleton--circle { border-radius: var(--r-pill); }
@keyframes prt-skeleton { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.prt-boot { position: fixed; inset: 0; display: grid; place-items: center; }
.prt-boot__mark { position: relative; display: grid; place-items: center; width: 96px; height: 96px; border-radius: var(--r-squircle); color: #FFFFFF; }
.prt-boot__mark::before { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 24px rgba(255, 255, 255, .35), 0 0 32px rgba(52, 133, 255, .25); animation: prt-glow var(--dur-glow) var(--ease-in-out) infinite; }
.prt-boot__mark :is(img, svg) { width: auto; height: 40px; fill: currentColor; }   /* H9: the bare mark only at 40 px or more */
@keyframes prt-glow { 50% { opacity: .45; } }

/* ── 19. Conversation (Desk, call page text): bubbles, dividers, receipts, composer, clock ─────── */
.prt-thread { width: min(100% - 2 * var(--gutter), var(--w-chat)); margin-inline: auto; display: flex; flex-direction: column; gap: var(--gap-bubble); padding-block: var(--s-24) calc(var(--h-composer) + var(--composer-bottom) + var(--s-6)); }
.prt-bubble { max-width: 82%; padding: var(--pad-bubble-y) var(--pad-bubble-x); border-radius: var(--r-bubble); font-size: var(--fs-body); line-height: var(--lh-body); overflow-wrap: anywhere; text-wrap: pretty; }
.prt-bubble--agent { align-self: flex-start; background: var(--solid-bubble-agent); color: var(--ink-1); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); }
.prt-bubble--owner { align-self: flex-end; background: var(--mat-thin); color: var(--ink-1); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); }
.prt-bubble h3 { margin-block-end: var(--s-2); font-family: var(--font-serif); font-size: var(--fs-serif-heading); line-height: var(--lh-serif-heading); font-weight: var(--fw-regular); }
.prt-bubble__preview { max-height: 168px; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent); mask-image: linear-gradient(180deg, #000 60%, transparent); }
.prt-bubble__open { margin-block-start: var(--s-3); }
.prt-divider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s-3); margin-block: var(--s-2); color: var(--ink-3); font-size: var(--fs-micro); line-height: var(--lh-micro); }
.prt-divider::before, .prt-divider::after { content: ''; height: 1px; background: var(--hairline); }
.prt-divider > span { padding: 4px 10px; border-radius: var(--r-pill); background: var(--mat-thin); color: var(--ink-1); }
.prt-receipt { align-self: flex-end; margin-block-start: calc(-1 * var(--s-2)); display: inline-flex; align-items: center; gap: 6px; color: var(--on-sky-2); font-size: var(--fs-micro); line-height: var(--lh-micro); }
:root[toggle-theme='light'] body[data-sky='chat'] .prt-receipt, :root[data-theme='light'] body[data-sky='chat'] .prt-receipt { padding: 2px 8px; border-radius: var(--r-pill); background: var(--mat-thin); color: var(--ink-1); }   /* day sky: never bare */
/* Composer (M8; #16, #21 vs #24): placeholder at the start, tools at the end, send appears only while there is a draft. */
.prt-composer { position: fixed; z-index: var(--z-chrome); inset-block-end: var(--composer-bottom); inset-inline: 0; width: min(100% - 2 * var(--gutter), var(--w-chat)); margin-inline: auto; display: flex; align-items: flex-end; gap: var(--s-2); }
.prt-composer__box { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: var(--s-1); min-height: var(--h-composer); padding: 5px 5px 5px var(--s-4); border-radius: 25px; background: var(--mat-regular); color: var(--ink-1);
  -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); box-shadow: var(--highlight-inner); }
.prt-composer__box textarea { flex: 1; min-width: 0; max-height: 160px; padding: 10px 0; border: 0; background: transparent; resize: none; color: var(--ink-1); font-size: var(--fs-body); line-height: var(--lh-body); outline: none; }
.prt-composer__tool { position: relative; display: grid; place-items: center; flex: none; width: var(--h-control-md); height: var(--h-control-md); border-radius: var(--r-pill); color: var(--ink-1); }
.prt-composer__tool::after, .prt-composer__send::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; }   /* 44 px targets */
@media (hover: hover) { .prt-composer__tool:hover { background: var(--mat-ghost-hover); } }
.prt-composer__send { position: relative; display: grid; place-items: center; flex: none; width: var(--h-control-md); height: var(--h-control-md); border-radius: var(--r-pill); background: var(--fill-invert); color: var(--on-invert); transition: opacity var(--dur-fast) var(--ease-out); }
.prt-composer__box:has(textarea:placeholder-shown) .prt-composer__send:not([data-state='recording']) { display: none; }
.prt-composer__send[data-state='recording'] { background: var(--live); color: #FFFFFF; }
.prt-composer__label { position: absolute; inset-block-end: calc(100% + var(--s-2)); inset-inline: 0; text-align: center; color: var(--on-sky-2); font-size: var(--fs-detail); }
.prt-clock { position: fixed; inset-inline-start: 66px; inset-block-start: 50%; transform: translateY(-50%); color: var(--on-sky-1); font-size: var(--fs-clock); line-height: var(--lh-clock); font-weight: var(--fw-regular); letter-spacing: var(--tr-display); font-variant-numeric: tabular-nums; pointer-events: none; }
.prt-clock span { display: block; }
@media (max-width: 1279.98px) { .prt-clock { display: none; } }
:root[toggle-theme='light'] body[data-sky='chat'] .prt-clock, :root[data-theme='light'] body[data-sky='chat'] .prt-clock { display: none; }   /* no text on the day sky */
/* Side sheet (#16): frosted column at the start; its content is a stack of separate panels 14 apart (M9). */
.prt-side-sheet { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--w-side-sheet); padding: 90px 18px 32px; overflow: auto; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 72px, #000 calc(100% - 72px), transparent); mask-image: linear-gradient(180deg, transparent 0, #000 72px, #000 calc(100% - 72px), transparent); }
.prt-side-sheet > * + * { margin-block-start: var(--gap-panel); }
.prt-side-sheet .prt-segmented { width: 100%; }
.prt-with-side .prt-thread, .prt-with-side .prt-composer { margin-inline-start: round(down, calc(var(--w-side-sheet) + (100vw - var(--w-side-sheet) - var(--w-chat)) / 2), 1px); }
@media (max-width: 1023.98px) { .prt-side-sheet { display: none; } .prt-with-side .prt-thread, .prt-with-side .prt-composer { margin-inline-start: auto; } }
/* Task panel (M9; #16, #17, #29, #52): one regular plate per task. The sentence starts with a verb chip; status under it. */
.prt-panels { display: flex; flex-direction: column; gap: var(--gap-panel); }
.prt-panel { position: relative; display: block; padding: var(--s-3h) var(--s-4); border-radius: var(--r-plate); background: var(--mat-regular); color: var(--ink-1); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); box-shadow: var(--highlight-inner);
  font-size: var(--fs-body); line-height: 26px; text-align: start; transition: background-color var(--dur-fast) var(--ease-out); }
@media (hover: hover) { a.prt-panel:hover, button.prt-panel:hover { background: color-mix(in srgb, var(--mat-regular), var(--ink-1) 6%); } }
.prt-verb { display: inline-block; margin-inline-end: 4px; padding-inline: 6px; border-radius: var(--r-verb); background: var(--verb-fill); font-weight: var(--fw-medium); line-height: 24px; }
.prt-panel__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-block-start: var(--s-2); color: var(--ink-3); font-size: var(--fs-detail); line-height: var(--lh-detail); }
/* Run card (K10; #18, #38): solid sheet at the column width, radius 24, equal 20 insets. C7: the head wraps; below 440 of
   card the actions take line 2, end-aligned, so Plan and Stop never leave the card. */
.prt-run { container: run / inline-size; align-self: stretch; display: grid; gap: var(--s-3); padding: var(--s-5); border-radius: var(--r-sheet); background: var(--solid-sheet); color: var(--ink-1); }
.prt-run__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); min-height: var(--h-control-md); }
.prt-run__time { color: var(--ink-3); font-size: var(--fs-detail); font-variant-numeric: tabular-nums; white-space: nowrap; margin-inline-end: auto; }
.prt-run__actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); }
@container run (max-width: 439.98px) { .prt-run__actions { flex-basis: 100%; } }
.prt-run__title { font-weight: var(--fw-medium); }
.prt-run .prt-step { color: var(--ink-3); }
.prt-run .prt-step[data-state='done'] { color: var(--ink-2); }
.prt-run .prt-step[data-state='current'] { color: var(--ink-1); }
.prt-kbd { font: inherit; font-size: var(--fs-micro); line-height: var(--lh-micro); padding: 2px 6px; border-radius: 6px; background: var(--mat-ghost-hover); color: var(--ink-2); }

/* ── 20. Search overlay (command palette) ─────────────────────────────────────────────────────── */
.prt-search { width: min(100% - 32px, var(--w-search)); max-width: none; max-height: min(560px, 100svh - 96px); margin: 80px auto auto; padding: var(--s-3); border: 0; border-radius: var(--r-plate);
  background: var(--mat-regular); color: var(--ink-1); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); box-shadow: var(--shadow-dialog); display: flex; flex-direction: column; gap: var(--s-3); }
.prt-search::backdrop { background: var(--scrim-dialog); -webkit-backdrop-filter: var(--scrim-blur); backdrop-filter: var(--scrim-blur); }
.prt-search__label { padding-inline: var(--s-2); color: var(--ink-3); font-size: var(--fs-detail); font-weight: var(--fw-medium); }
.prt-search__results { overflow: auto; overscroll-behavior: contain; }
.prt-search__none { padding: var(--s-6) var(--s-4); text-align: center; color: var(--ink-3); }

/* ── 21. Paper pages (legal, 404) ─────────────────────────────────────────────────────────────── */
/* M10: the paper is a full-height column, so the footer always meets the bottom of the window. */
.prt-paper { display: flex; flex-direction: column; min-height: 100dvh; background: var(--page-paper); color: var(--paper-ink-1); color-scheme: light; --ink-1: var(--paper-ink-1); --ink-3: var(--paper-ink-2); --focus-ring: #16181E; --focus-halo: #FFFFFF; }
.prt-paper > main { flex: 1 0 auto; }
.prt-paper-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 76px; padding: var(--s-4) var(--s-6); }
.prt-paper-head .prt-wordmark { color: var(--brand-ink); }
.prt-paper-chip { position: relative; display: inline-flex; align-items: center; gap: var(--s-2); height: var(--target); padding-inline: var(--s-4); border-radius: var(--r-pill); background: var(--paper-chip); box-shadow: inset 0 0 0 1px var(--paper-rule); font-size: var(--fs-detail); font-weight: var(--fw-medium); cursor: pointer; list-style: none; }
.prt-paper-chip::-webkit-details-marker { display: none; }
/* M15: below 360 the chip shrinks to its globe (a 44 circle); the language name stays as its accessible name. */
@media (max-width: 359.98px) {
  .prt-paper-chip { width: var(--target); padding: 0; justify-content: center; }
  .prt-paper-chip > .prt-paper-chip__chevron { display: none; }
  .prt-paper-chip > .prt-paper-chip__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.prt-paper-main { width: min(100% - 2 * var(--gutter), var(--w-legal)); margin-inline: auto; padding-block: var(--s-16) var(--s-24); }
.prt-paper-updated { text-align: center; color: var(--paper-ink-2); font-size: var(--fs-micro); line-height: var(--lh-micro); }
.prt-paper h1 { margin-block: var(--s-3) var(--s-16); text-align: center; font-family: var(--font-serif); font-size: var(--fs-serif-h1); line-height: var(--lh-serif-h1); font-weight: var(--fw-light); text-wrap: balance; }
.prt-paper h2 { margin-block: 88px var(--s-5); font-family: var(--font-serif); font-size: var(--fs-serif-h2); line-height: var(--lh-serif-h2); font-weight: var(--fw-light); text-wrap: balance; }
.prt-prose { font-size: var(--fs-prose); line-height: var(--lh-prose); text-wrap: pretty; }
.prt-prose > * + * { margin-block-start: var(--s-5); }
.prt-prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prt-prose strong { font-weight: var(--fw-semibold); }
.prt-prose ol, .prt-prose ul { padding-inline-start: 1.25em; } .prt-prose ol { list-style: decimal; } .prt-prose ul { list-style: disc; }
.prt-prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-detail); line-height: var(--lh-detail); }
.prt-prose th, .prt-prose td { padding: var(--s-3); border: 1px solid var(--paper-rule); vertical-align: top; text-align: start; }
.prt-legal-back { display: flex; justify-content: center; margin-block-start: var(--s-16); }
/* 404 (M10, #136): the numeral leads at regular weight; the line under it is smaller and lighter in role. */
.prt-notfound { display: grid; justify-items: center; align-content: start; gap: var(--s-4); padding-block: 18vh var(--s-16); text-align: center; }
.prt-notfound__code { margin-block-end: calc(-1 * var(--s-2)); font-family: var(--font-serif); font-size: var(--fs-serif-display); line-height: var(--lh-serif-display); font-weight: var(--fw-regular); }
.prt-paper .prt-notfound__text { margin: 0; font-family: var(--font-sans); font-size: var(--fs-statement); line-height: var(--lh-statement); font-weight: var(--fw-regular); letter-spacing: var(--tr-title); }
.prt-notfound .prt-pill { margin-block-start: var(--s-4); }
.prt-paper .prt-pill--quiet { background: var(--paper-chip); box-shadow: inset 0 0 0 1px var(--paper-rule); color: var(--paper-ink-1); }
.prt-footer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--s-8); padding: var(--s-10) var(--s-6) var(--s-6); border-block-start: 1px solid var(--paper-rule); color: var(--paper-ink-2); font-size: var(--fs-detail); }
.prt-footer a { display: inline-flex; align-items: center; min-height: var(--target); color: var(--paper-ink-1); }
.prt-footer__links { display: flex; flex-wrap: wrap; gap: 0 var(--s-6); justify-content: flex-end; }
.prt-footer .prt-wordmark { color: var(--brand-ink); }
@media (max-width: 389.98px) { .prt-footer { grid-template-columns: 1fr; padding-inline: var(--s-4); } .prt-footer__links { justify-content: flex-start; } .prt-paper-head { padding-inline: var(--s-4); } }
.prt-menu--paper { background: #FFFFFF; color: var(--paper-ink-1); box-shadow: 0 8px 32px rgba(0, 10, 36, .14), inset 0 0 0 1px var(--paper-rule); }

/* ── 22. Wordmark (H9) ────────────────────────────────────────────────────────────────────────── */
/* The logo lockup (the owner's verdict of 2026-11-23): the mark image then the word, exactly as the live portal header sets it (styles.css
   .wordmark: inline-flex, centre-aligned, gap 5, 14 px at 600, line-height 1, mark 8 x 24). Header, footer and the media panel's corner use
   that size; the large lockup is that lockup x 1.5 in whole pixels (tokens.css). The mark file is white: on the sky, the media panel and the auth
   frames it reads as it does live (white on the photograph, both themes); paper is always light, so paper pages emit the brand kit's
   mono-ink mark (logos/protention-mark-ink.svg) and the word takes the same --brand-ink. */
.prt-wordmark { display: inline-flex; align-items: center; gap: var(--wordmark-gap); min-height: var(--target); color: var(--on-sky-1); font-family: var(--font-wordmark); font-size: var(--wordmark-size); line-height: 1; font-weight: var(--wordmark-weight); letter-spacing: normal; white-space: nowrap; }
.prt-wordmark img { display: block; flex: none; width: var(--wordmark-mark-w); height: var(--wordmark-mark-h); }
.prt-wordmark--lockup { gap: var(--lockup-gap); font-size: var(--lockup-size); }
.prt-wordmark--lockup img { width: var(--lockup-mark-w); height: var(--lockup-mark-h); margin-block: calc((var(--lockup-line) - var(--lockup-mark-h)) / 2); }
.prt-mark { display: block; width: auto; height: 40px; fill: currentColor; }

/* ── 23. Tooltip (derived from the toast; the reference has none) ─────────────────────────────── */
.prt-tip { position: fixed; z-index: var(--z-popover); padding: 6px 12px; border-radius: var(--r-pill); background: var(--mat-regular); color: var(--ink-1); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur);
  font-size: var(--fs-micro); line-height: var(--lh-micro); font-weight: var(--fw-medium); white-space: nowrap; pointer-events: none; animation: prt-fade-in var(--dur-fast) var(--ease-out) both; }

/* ── 24. Account sign-out row (ghost on the sky) ──────────────────────────────────────────────── */
.prt-signout { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 52px; padding-inline: var(--pad-row-x); border-radius: var(--r-plate); background: var(--mat-ghost); color: var(--on-sky-1); font-weight: var(--fw-medium); text-align: start;
  -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur); transition: background-color var(--dur-fast) var(--ease-out); }
@media (hover: hover) { .prt-signout:hover { background: var(--mat-ghost-hover); } }

/* ── 25. Right to left: glyphs that point flip; nothing else needs a rule (logical properties). ── */
:dir(rtl) .prt-flip, :dir(rtl) .prt-row__chevron, :dir(rtl) .prt-auth-back .prt-icon, :dir(rtl) .prt-page-head > .prt-circle:first-child .prt-icon, :dir(rtl) .prt-field__submit .prt-icon { transform: scaleX(-1); }
:dir(rtl) .prt-media-panel > img { transform: scaleX(-1); }
:dir(rtl) .prt-sky { transform: scaleX(-1); }       /* cloud masses mirror; the vertical ramp is symmetric */
:where([data-ds]) bdi, .prt-ltr { unicode-bidi: isolate; }
.prt-ltr { direction: ltr; }

/* ── 26. Reduced motion and forced colours ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .prt-status[data-live='true'] .prt-status__text { animation: none; background: none; color: inherit; }
  .prt-skeleton, .prt-boot__mark::before { animation: none; }
  .prt-spinner { animation-duration: 2400ms; }      /* still turning: it is the only "in progress" cue next to the text */
  .prt-dialog[open], .prt-sheet[open], .prt-menu, .prt-toast, .prt-toast[data-leaving] { animation-name: prt-fade-in; }
  .prt-pill:active, .prt-circle:active, .prt-field__submit:active { transform: none; }
}
@media (forced-colors: active) {
  .prt-plate, .prt-group, .prt-pill, .prt-circle, .prt-field, .prt-segmented, .prt-chip, .prt-badge, .prt-status, .prt-toast, .prt-dialog, .prt-menu, .prt-composer__box, .prt-panel, .prt-alert { border: 1px solid CanvasText; }
  .prt-segment[aria-selected='true']::before, .prt-segment[aria-pressed='true']::before, .prt-chip[aria-pressed='true'] { background: Highlight; forced-color-adjust: none; }
  :root:root :where([data-ds], [data-ds] *):focus-visible { outline-color: Highlight; box-shadow: none; }
  .prt-sky { display: none; }
}

/* ── 27. Without backdrop-filter: the opaque darkest-point composite ─────────────────────────────── */
/* Build gap (w107): in the design file this block sat in section 2, before .prt-plate, .prt-group, .prt-circle and the others set
   their own background, so at equal specificity those later rules won and only .prt-mat-regular ever fell back. It now comes last. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .prt-mat-regular, .prt-plate, .prt-group, .prt-chrome-pill, .prt-circle, .prt-segmented, .prt-menu, .prt-toast, .prt-composer__box, .prt-panel { background: var(--mat-fallback-regular); }
}
