/* =====================================================================================================
   Key Light: the kbpricing.com sign-in (spec 4.1-4.3, 7)

   keylight.css, a name of its own (ruling R88): LIVE's access/signin.css stays as it is, because the Bath
   host serves it too, to style its hand-off page.

   Tokens, base, layout, panel, button, stage, states, account controls, then reduced motion and forced
   colours. A property that a breakpoint changes is declared in one section only, ahead of that section's
   media queries, so that source order never overrides a breakpoint.

   CSP (spec 5.8): style-src 'self', font-src 'self', img-src 'self'. Everything is in this file: no data:
   URIs, nothing remote, no style attributes in the markup. What moves is set through CSSOM by
   tooling/k3d/plates.mjs: --wb, --pool and --k3d-fade on the root, each plate's z-index, each bloom's left
   and top, and the stage box's isolation. url()s are relative to this file, which is served from /access/
   like every file the page loads (ruling R85), wherever the page itself is served (/ and /account/).

   The switch wires (svg.k3d-wires) are a fixed layer drawn in viewport px: none of their ancestors (html,
   body, #access-root, main, the stage) may take a transform, filter, perspective, contain, container-type
   or will-change, or "fixed" would stop meaning the viewport.
   ===================================================================================================== */


/* ----- Tokens ---------------------------------------------------------------------------------------- */

/* The light (spec 4.2). plates.mjs sets --wb and --pool on the root from the light state; registered, they
   transition with the plates over --k3d-fade instead of jumping. */
@property --wb {
  syntax: "<color>";
  inherits: true;
  initial-value: #E8A866;
}
@property --pool {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}

/* Cormorant Garamond 500, self-hosted (spec 4.3): the normal face sets the H1 and is preloaded (Task 12);
   the italic sets the one word "yours" and loads on first use. */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/cormorant-garamond-latin-500-normal.woff2") 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: "Cormorant Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/cormorant-garamond-latin-500-italic.woff2") 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;
}

/* Georgia, fitted to Cormorant so that the swap moves nothing (spec 4.3). Cormorant sets USE_TYPO_METRICS
   with typo = hhea (ascent 924, descent 287, line gap 0 per 1000 units), so every engine lays it out on
   those. size-adjust is the ratio of the two faces' advance widths over the H1s of Appendix A (for the
   italic, over "yours"); the overrides are Cormorant's metrics divided by it, because size-adjust scales
   them too. */
@font-face {
  font-family: "Cormorant Fallback";
  font-style: normal;
  font-weight: 500;
  src: local("Georgia");
  size-adjust: 89.15%;
  ascent-override: 103.65%;
  descent-override: 32.19%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Cormorant Fallback";
  font-style: italic;
  font-weight: 500;
  src: local("Georgia Italic"), local("Georgia-Italic");
  size-adjust: 76.54%;
  ascent-override: 120.72%;
  descent-override: 37.5%;
  line-gap-override: 0%;
}

:root {
  color-scheme: dark;

  /* DESIGN.md (spec 4.2) */
  --bg: #090C11;
  --surface: #11161E;
  --raised: #1A222D;
  --border: #354150;
  --text: #F2F4F7;
  --muted: #AAB5C3;
  --champagne: #D2AF68;
  --focus: #F4D58B;
  --danger: #FFB4AB;
  --success: #69D7A2;

  /* The light, LIT by default: the stage's poster fallback and the page before the stage starts rely on
     it. --k3d-fade is the length of the light change under way; 0ms is a cut. */
  --wb: #E8A866;
  --pool: 1;
  --k3d-fade: 0ms;
  transition: --wb var(--k3d-fade) linear, --pool var(--k3d-fade) linear;

  /* The page's white balance (spec 4.2): --wb mixed into the background at 3 % and the hairlines at 4 %.
     The whole threshold warms with the Switch and cools at Lights Out. */
  --page: color-mix(in oklab, var(--bg) 97%, var(--wb));
  --hairline: color-mix(in oklab, var(--border) 96%, var(--wb));

  /* Text fields' borders: hairlines are rules and cards, but a field's edge is how it is found, so it meets
     WCAG 1.4.11's 3:1 against the page (either white balance) and against a field or card's surface. At rest
     #5E6D80 is at least 3.43:1 (3.71 on #090C11, 3.61 / 3.65 on the warm / blue page, 3.43 on #11161E);
     on hover #7A8899 is at least 5.02:1. layout.spec.mjs checks the code field. */
  --field-border: #5E6D80;
  --field-border-hover: #7A8899;

  /* The champagne switch plate (spec 4.2) */
  --plate-top: #EAD7AE;
  --plate-edge: #A88A4E;
  --plate-ink: #15120C;

  /* Type and motion (spec 4.2, 4.3) */
  --sans: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --serif: "Cormorant Garamond", "Cormorant Fallback", Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ui: 180ms;

  /* Geometry, phone first (spec 4.1); the layout's media queries move these. */
  --gutter-l: max(16px, env(safe-area-inset-left));
  --gutter-r: max(16px, env(safe-area-inset-right));
  --col: 480px;                              /* the widest panel while the page is one column */
  --stage-h: clamp(200px, 40svh, 360px);     /* the stage's height while the page is one column */
  --h1-size: 40px;
  --h1-lh: 1.05;
  --body-size: 15px;
  --body-lh: 1.5;
  --plate-h: 56px;
  --rule-gap: 12px;                          /* rule to eyebrow */
  --eyebrow-gap: 6px;                        /* eyebrow to H1 */
  --title-gap: 10px;                         /* H1 to intro */
  --intro-gap: 16px;                         /* the heading block to the button */
  --panel-pad-top: 12px;                     /* the stage (or the page's top) to the heading block */

  /* R50: "Open my workspace" takes the passkey button's exact rectangle (spec 3.2; the Switch's wires leave
     from it). The heading block (.panel-head: rule, eyebrow, H1, intro) therefore keeps one height, --head-h,
     whether it greets ("Good evening.") or welcomes a name ("Welcome back, Bartholomew Winterbourne."); its
     contents sit at its foot, so a short heading leaves the room above the rule. --head-h is the taller of
     the two layouts, each counted at its widest:
       ready      the eyebrow on --ready-eyebrow lines, the greeting on one line, the intro on --ready-intro;
       signed in  the eyebrow on one line, the name on --name-lines lines at --name-size, the intro on
                  --signed-intro.
     Names of up to 24 characters fit. Measured in Cormorant 500 (-0.01em) in Chrome, Firefox and WebKit, the
     widest 24-character greetings need 11.05em a line on two lines and 7.03em on three. So the one-column
     layouts set the name on two lines at no more than --text-w / 11.3, and the two-column layouts set it at
     the H1's own size on three (7.14em fit at 56 px in 400 px). A longer name wraps further and pushes the
     button down; it never overlaps, and the whole name stays in the text. */
  --eyebrow-line: 16.8px;                    /* 12 px at 1.4 */
  --h1-line: calc(var(--h1-size) * var(--h1-lh));
  --intro-line: calc(var(--body-size) * var(--body-lh));
  --text-w: min(var(--col), 100vw - var(--gutter-l) - var(--gutter-r));   /* the panel's text measure, one column */
  --name-em: 11.3;
  --name-size: min(var(--h1-size), var(--text-w) / var(--name-em));
  --name-lines: 2;
  --ready-eyebrow: 1;
  --ready-intro: 2;
  --signed-intro: 1;
  --head-h: calc(2px + var(--rule-gap) + var(--eyebrow-gap) + var(--title-gap) + max(
    var(--ready-eyebrow) * var(--eyebrow-line) + var(--h1-line) + var(--ready-intro) * var(--intro-line),
    var(--eyebrow-line) + var(--name-lines) * var(--name-size) * var(--h1-lh) + var(--signed-intro) * var(--intro-line)));

  /* Where the primary button's rectangle lands (noscript.css lays its notice there): one column, under the
     52 px header and the stage; the two-column layouts redefine it. */
  --action-top: calc(52px + env(safe-area-inset-top) + var(--stage-h) + var(--panel-pad-top) + var(--head-h) + var(--intro-gap));
  --action-left: max(var(--gutter-l), (100vw - var(--col)) / 2);
  --action-w: var(--text-w);
}


/* ----- Base ------------------------------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--page);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p {
  margin: 0;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  margin: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

a,
button,
input,
select,
summary,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

::selection {
  background-color: color-mix(in oklab, var(--champagne) 36%, transparent);
  color: var(--text);
}

/* Focus is always shown: 2 px of #F4D58B at an offset (spec 7), about 13:1 on the page. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  z-index: 10;
  top: -80px;
  left: var(--gutter-l);
  padding: 12px 18px;
  border-radius: 10px;
  background-color: var(--champagne);
  color: var(--plate-ink);
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}


/* ----- Layout ---------------------------------------------------------------------------------------- */

/* Phones first (spec 4.1): one column with 16 px gutters and the safe-area insets. The header (52 px),
   then the stage, full-bleed, then the panel and the footer. The panel comes first in the DOM; the grid
   draws the stage above it (spec 7).

   CSS has no named media queries, so the layout's conditions are written out each time they are used. Keep
   the copies in step when one changes:
     two columns, desktop and laptop   (min-width: 1024px) and (min-height: 501px)
     two columns, short landscape      (orientation: landscape) and (max-height: 500px) and (min-width: 520px)
     one column                        (max-width: 1023px), and (max-width: 767px) / (min-width: 768px) for
                                       phones and tablets, (max-width: 360px) for the narrowest
   They appear in the layout below, in the header's mark, and in the stage's grid fade, slate, hint and
   toolbar. (noscript.css repeats none: its notice reads the --action-* tokens these layouts set.) */
#access-root {
  display: grid;
  grid-template: "header" auto "main" auto "footer" 1fr / minmax(0, 1fr);
  min-height: 100svh;
}

.access-header {
  grid-area: header;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: calc(52px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(var(--gutter-r), (100% - var(--col)) / 2) 0 max(var(--gutter-l), (100% - var(--col)) / 2);
}

.access-layout {
  grid-area: main;
  display: grid;
  grid-template: "stage" auto "panel" auto / minmax(0, 1fr);
  align-content: start;
}

.panel {
  grid-area: panel;
  justify-self: center;
  width: min(100%, var(--col) + var(--gutter-l) + var(--gutter-r));
  padding: var(--panel-pad-top) var(--gutter-r) 32px var(--gutter-l);
}

/* The stage never sits under the panel (spec 4.1). It clips what runs past it, the drafting grid; the
   wires are fixed to the viewport and escape the clip. */
.k3d-stage {
  grid-area: stage;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  height: var(--stage-h);
  overflow: hidden;
  overflow: clip;
  --box-w: min(100%, var(--stage-h) * 8 / 7);   /* the 8:7 box's width; "100%" is the stage's */
  transition: height var(--ui) var(--ease);
  /* The stage's bottom row (Task 30, R181; r15): the five keys of the toolbar at the right, the slate and the hint above them
     while the page is one column. Each is placed from these, so the row has one place. */
  --k3d-key: 44px;                                                              /* 40 px with a fine pointer (below) */
  --k3d-right: max(var(--gutter-r), (100% - var(--col)) / 2);                   /* the row's right edge, on the panel's column */
  --k3d-row: 8px;                                                               /* its distance from the stage's foot */
  --k3d-clear: 8px;                                                             /* what the phone hint and Measure's label leave free at the top */
}

.access-footer {
  grid-area: footer;
  align-self: end;
  position: relative;
  z-index: 2;
  padding: 8px max(var(--gutter-r), (100% - var(--col)) / 2) calc(24px + env(safe-area-inset-bottom)) max(var(--gutter-l), (100% - var(--col)) / 2);
}

/* The AccessBoundary fallback stands alone in the root. */
.access-fallback {
  grid-area: 1 / 1 / -1 / -1;
  align-self: center;
  justify-self: center;
  width: min(100%, 520px);
  padding: 48px var(--gutter-r) 48px var(--gutter-l);
}

/* Tablet (768-1023 px): stacked as on phones, the stage at 48svh and the panel at most 480 px, centred. */
@media (min-width: 768px) {
  :root {
    --stage-h: 48svh;
    --h1-size: 46px;
    --h1-lh: 1.06;
    --body-size: 16px;
    --body-lh: 1.6;
    --rule-gap: 16px;
    --eyebrow-gap: 8px;
    --title-gap: 14px;
    --intro-gap: 24px;
    --panel-pad-top: 24px;
  }
}

/* Two columns: desktops and laptops (1024 px wide or more, taller than 500 px), and short landscape
   screens (spec 4.1). The panel takes the left column. The stage fills the right column at the viewport's
   full height and stays there (sticky) while a long panel scrolls. The header and the footer lie over the
   same grid cell: the header across the top, the footer in the left column only. */
@media (min-width: 1024px) and (min-height: 501px), (orientation: landscape) and (max-height: 500px) and (min-width: 520px) {
  :root {
    --name-size: var(--h1-size);
    --action-top: calc(var(--panel-pad-top) + var(--head-h) + var(--intro-gap));
    --action-left: var(--pad-l);
    --action-w: var(--panel-w);
  }

  #access-root {
    grid-template: "page" minmax(100svh, auto) / minmax(0, 1fr);
  }

  .access-header,
  .access-layout,
  .access-footer {
    grid-area: page;
  }

  .access-header {
    align-self: start;
    pointer-events: none;   /* a transparent strip across the stage: only what is in it takes the pointer */
  }

  .access-header > * {
    pointer-events: auto;
  }

  .access-layout {
    grid-template: ". panel . stage" minmax(100svh, auto) / var(--pad-l) var(--panel-w) var(--gap) minmax(0, 1fr);
    align-items: start;
  }

  .panel {
    justify-self: stretch;
    width: auto;
    padding-inline: 0;
  }

  .k3d-stage {
    position: sticky;
    top: 0;
    height: 100svh;
    transition: none;
  }

  .access-footer {
    align-self: end;
    justify-self: start;
    width: calc(var(--pad-l) + var(--panel-w));
    padding: 0 0 24px var(--pad-l);
  }
}

/* Desktop 1440 x 900 and laptop 1280 x 720 (spec 4.1). The panel is x 96-496 at 1440 and x 64-424 at 1280
   (--pad-l runs through both). The stage starts at x 520; its 8:7 box is 846 x 740, centred at (990, 450),
   at 1440 x 900, and 700 x 612 at 1280 x 720 (--stage-pad runs through 80 and 54 px). The button never
   needs scrolling; the help and the security note may.

   Ruling R64: the panel is anchored, not centred on its own height (spec 4.1 says "vertically centred"),
   so that a message, an open help or a long greeting never moves the button. The ready heading's rule sits
   at 24svh (216 px at 900), which is a little high on very tall screens. The heading block keeps R50's
   room for a three-line name above that rule, so the block starts two H1 lines higher, never above 80 px:
   at 1280 x 720 that floor holds, and the ready rule sits about 20 px above 24svh. */
@media (min-width: 1024px) and (min-height: 501px) {
  :root {
    --pad-l: clamp(48px, 20vw - 192px, 160px);
    --panel-w: 360px;
    --gap: 24px;
    --stage-pad: clamp(40px, 14.4444svh - 50px, 80px);
    --h1-size: 46px;
    --h1-lh: 1.06;
    --rule-gap: 22px;
    --eyebrow-gap: 8px;
    --title-gap: 20px;
    --intro-gap: 32px;
    --name-lines: 3;
    --panel-pad-top: max(80px, 24svh - 2 * var(--h1-line));
  }

  .access-header {
    min-height: 0;
    padding: 32px 64px 0 var(--pad-l);
  }

  .panel {
    padding-bottom: 88px;
  }

  .k3d-stage {
    padding-left: 20px;
    --box-w: min(100%, (100svh - 2 * var(--stage-pad)) * 8 / 7, 1000px);
  }
}

@media (min-width: 1281px) and (min-height: 501px) {
  :root {
    --panel-w: 400px;
  }
}

/* Wide (1600 px and up): the panel is 440 px and the box grows to 1000 x 875. */
@media (min-width: 1600px) and (min-height: 501px) {
  :root {
    --panel-w: 440px;
  }
}

/* Desktop type: the H1 at 56/1.04 and the 400 x 60 button. Laptops keep 46/1.06 and 56 px. */
@media (min-width: 1281px) and (min-height: 721px) {
  :root {
    --h1-size: 56px;
    --h1-lh: 1.04;
    --plate-h: 60px;
  }
}

/* Landscape phones and screens 500 px tall or less (spec 4.1): two columns, the panel at 46 % with the
   button near its top, the stage beside it under the 52 px header. Height is short here, so the heading
   keeps room for a two-line name only (not one of R50's seven layouts): a longer greeting moves the button
   down a line rather than below a 320 px screen's fold. */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 520px) {
  :root {
    --pad-l: max(16px, env(safe-area-inset-left));
    --gap: 16px;
    --panel-w: calc(46% - var(--pad-l) - var(--gap));
    --h1-size: 34px;
    --h1-lh: 1.05;
    --body-size: 15px;
    --body-lh: 1.5;
    --plate-h: 56px;
    --rule-gap: 10px;
    --eyebrow-gap: 6px;
    --title-gap: 8px;
    --intro-gap: 16px;
    --panel-pad-top: 60px;
    --ready-eyebrow: 2;
    --signed-intro: 2;
  }

  .access-header {
    min-height: 52px;
    padding: 0 var(--gutter-r) 0 var(--pad-l);
  }

  .panel {
    padding-bottom: 64px;
  }

  .k3d-stage {
    padding: 52px var(--gutter-r) 24px 0;
    --box-w: min(100%, (100svh - 76px) * 8 / 7);
  }

  .access-footer {
    padding-bottom: 12px;
  }
}

/* 360 px wide or less (spec 4.1): the stage at 34svh. (The view name goes too; see the stage.) The eyebrow
   and the signed-in intro may take two lines at this measure, and the heading keeps room for them.

   "Or 200 % zoom": CSS cannot see zoom, only the viewport it leaves. Zoom that brings the viewport to 360 px
   or less takes this layout, and zoom that leaves a landscape 500 px tall or less takes the two-column one.
   Otherwise zoom is not caught: a 768 x 1024 tablet at 200 % (384 x 512) keeps the phone stage at 40svh. */
@media (max-width: 360px) {
  :root {
    --stage-h: 34svh;
    --ready-eyebrow: 2;
    --signed-intro: 2;
  }
}

/* The header: the three-stone mark with BLACKSTONE / HOME SERVICES on the left, a lock with "Private
   workspace" on the right (phones: "Private"). */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-radius: 4px;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: auto;
}

/* Touch targets are 44 px (spec 7). */
@media (pointer: coarse) {
  .brand {
    min-height: 44px;
  }
}

.brand > span {
  display: grid;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .22em;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .18em;
}

/* Inline, not flex: "Private" and " workspace" are separate pieces of text, and a flex gap would replace the
   word space between them. */
.private-label {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: .02em;
  white-space: nowrap;
}

.private-label svg {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -3px;
  color: var(--champagne);
}

.private-more {
  display: none;
}

@media (min-width: 768px) {
  .private-more {
    display: inline;
  }
}

@media (min-width: 1024px) and (min-height: 501px) {
  .brand img {
    width: 44px;
  }

  .brand > span {
    font-size: 13px;
    letter-spacing: .24em;
  }
}

.access-footer p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: .02em;
}

.access-fallback img {
  width: 44px;
  height: auto;
  margin-bottom: 28px;
}

.access-fallback h1 {
  margin-bottom: 12px;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.01em;
}

.access-fallback p:not(.eyebrow) {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

/* The Icon component's glyphs (lock, shield, passkey) are drawn by stroke. */
.private-label svg,
.primary-action svg,
.security-note svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}


/* ----- Panel ----------------------------------------------------------------------------------------- */

.panel {
  position: relative;
  z-index: 2;   /* over the stage: the switch wires run under the panel's text (spec 3.3) */
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* The heading block (R50; see --head-h): one height whatever it holds, its contents at its foot, so the
   button below keeps its rectangle from the greeting to the signed-in welcome. */
.panel-head {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: var(--head-h);
  margin-bottom: var(--intro-gap);
}

.panel-head > :last-child {
  margin-bottom: 0;   /* setup required has no intro: the H1 is last, and the block's own margin spaces it */
}

/* The heading: the 48 x 2 champagne rule, the eyebrow, the H1 and the intro (spec 4.1, 4.3). */
.signin-rule {
  flex: none;
  width: 48px;
  height: 2px;
  margin-bottom: var(--rule-gap);
  background-color: var(--champagne);
}

.eyebrow {
  margin-bottom: var(--eyebrow-gap);
  color: var(--champagne);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .14em;
  text-transform: uppercase;
}

#signin-title {
  margin-bottom: var(--title-gap);
  color: var(--text);
  font-family: var(--serif);
  font-size: var(--h1-size);
  font-weight: 500;
  line-height: var(--h1-lh);
  letter-spacing: -.01em;
  text-wrap: balance;
}

#signin-title em {
  font-style: italic;
}

/* Signed in, the H1 welcomes a name at --name-size: the H1's own size in two columns, fitted to two lines
   in one (R50). */
.panel-head:has(+ .panel-view[data-view="signedIn"]) > #signin-title {
  font-size: var(--name-size);
}

#signin-title:focus-visible {
  outline-offset: 6px;
  border-radius: 4px;
}

.signin-intro {
  max-width: 34em;
  color: var(--muted);
  font-size: var(--body-size);
  line-height: var(--body-lh);
  text-wrap: pretty;
}

/* What the panel shows: the sign-in, the invitation or the signed-in view (data-view). */
.panel-view {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.panel-view > .primary-action,
.panel-view > .hint-row,
.panel-view > #invitation-form,
.panel-view > .account-controls {
  align-self: stretch;
}

/* The row under the button: the device hint, or Cancel while the passkey prompt is open, in the same
   44 px, so nothing moves (spec 4.1). */
.hint-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 24px;
  min-height: 44px;
  margin-top: 4px;
}

/* The invitation's row holds nothing but Cancel during the enrolment, so while empty it takes no room. */
.hint-row:empty {
  min-height: 0;
  margin-top: 0;
}

/* ...except while the invitation is still busy: once a sign-in is verified, Cancel leaves the row for the
   frame in which the panel waits for its view transition (phase verifying, or enrolling when the session
   check found the person signed in), and "Back to sign in" must not jump in the transition's old snapshot.
   #create-passkey is aria-disabled for exactly as long as the form is busy. */
#create-passkey[aria-disabled="true"] + .hint-row:empty {
  min-height: 44px;
  margin-top: 4px;
}

.device-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Quiet actions: text over a champagne hairline, with a 44 px target. */
.text-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: color-mix(in oklab, var(--champagne) 50%, transparent);
  transition: color var(--ui) var(--ease), text-decoration-color var(--ui) var(--ease);
}

.text-action:hover {
  text-decoration-color: var(--champagne);
}

/* The arrow sits out of flow in the link's own padding: an out-of-flow box is never underlined. */
#back-to-signin {
  position: relative;
  padding-left: 1.3em;
}

#back-to-signin > span {
  position: absolute;
  left: 0;
  color: var(--champagne);
}

/* The invitation: a masked code field with Show/Hide inside it. */
#invitation-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#invitation-form > label {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.code-field {
  display: flex;
  align-self: stretch;
  min-height: 52px;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background-color: var(--surface);
  transition: border-color var(--ui) var(--ease);
}

.code-field:hover {
  border-color: var(--field-border-hover);
}

.code-field:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.code-field input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 9px 0 0 9px;
  outline: none;   /* the field's own ring shows instead (.code-field:focus-within) */
  background: transparent;
  color: var(--text);
  font-size: 16px;   /* 16 px keeps iOS from zooming in on focus */
  letter-spacing: .04em;
  caret-color: var(--champagne);
}

.code-field input:disabled {
  color: var(--muted);
}

#show-code {
  flex: none;
  min-width: 64px;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid var(--hairline);
  border-radius: 0 9px 9px 0;
  background: none;
  color: var(--champagne);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: background-color var(--ui) var(--ease);
}

#show-code:hover {
  background-color: var(--raised);
}

#show-code:focus-visible {
  outline-offset: -5px;
}

#show-code:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.field-hint {
  margin: 10px 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* The status region (role=status) expands in place under the actions. Empty, it takes no room but stays
   rendered, so that what it says next is announced. */
.status-message {
  margin-top: 12px;
  padding: 12px 16px;
  border-left: 2px solid var(--champagne);
  border-radius: 0 8px 8px 0;
  background-color: var(--surface);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  animation: status-in var(--ui) var(--ease);
}

.status-message:empty {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  animation: none;
}

@keyframes status-in {
  from {
    opacity: 0;
  }
}

/* "Can't use your passkey?": a 44 px summary with a hairline plus that becomes a minus. */
.access-help {
  margin-top: 20px;
}

.access-help summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-radius: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
  transition: color var(--ui) var(--ease);
}

.access-help summary::-webkit-details-marker {
  display: none;
}

.access-help summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  background:
    linear-gradient(var(--champagne), var(--champagne)) center / 9px 1px no-repeat,
    linear-gradient(var(--champagne), var(--champagne)) center / 1px 9px no-repeat;
  transition: background-size var(--ui) var(--ease);
}

.access-help[open] summary::after {
  background-size: 9px 1px, 1px 0;
}

.access-help summary:hover,
.access-help[open] summary {
  color: var(--text);
}

.access-help p {
  max-width: 34em;
  margin: 2px 0 6px;
  padding-left: 14px;
  border-left: 1px solid color-mix(in oklab, var(--champagne) 45%, transparent);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* The security note, 12 px, under a hairline. */
.security-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
}

.security-note svg {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--champagne);
  stroke-width: 1.5;
}

.security-note p {
  max-width: 36em;
  font-size: 12px;
  line-height: 1.6;
  text-wrap: pretty;
}


/* ----- Button ---------------------------------------------------------------------------------------- */

/* The passkey button is a champagne switch plate (spec 4.2): #D2AF68 with a 1 px #EAD7AE highlight along
   its top and a 1 px #A88A4E edge along its bottom, a 10 px radius, the label in #15120C (about 9:1). It
   rests on the obsidian with a contact shadow and a soft fall-off, and pressing sinks it 1 px. Inside: the
   pilot light, the passkey glyph, the label, and the arrow at the right. "Open my workspace" takes the same
   rectangle (spec 3.2). 400 x 60 on desktops, 360 x 56 on laptops, the panel's width x 56 on phones. */
.primary-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--plate-h);
  padding: 10px 20px 10px 18px;
  border: 1px solid transparent;
  border-top-color: var(--plate-top);
  border-bottom-color: var(--plate-edge);
  border-radius: 10px;
  background-color: var(--champagne);
  color: var(--plate-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .01em;
  text-align: left;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 0 rgb(0 0 0 / .55), 0 14px 26px -16px rgb(0 0 0 / .9);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition:
    background-color var(--ui) var(--ease),
    box-shadow var(--ui) var(--ease),
    transform 120ms var(--ease);
}

.primary-action:hover {
  background-color: color-mix(in oklab, var(--champagne) 90%, var(--plate-top));
}

.primary-action:active {
  transform: translateY(1px);
  background-color: color-mix(in oklab, var(--champagne) 93%, var(--plate-edge));
  box-shadow: 0 0 0 rgb(0 0 0 / .55), 0 8px 16px -14px rgb(0 0 0 / .9);
}

.primary-action svg {
  width: 22px;
  height: 22px;
}

.action-label {
  flex: 1 1 auto;
  min-width: 0;
}

.action-arrow {
  flex: none;
  margin-left: auto;
  font-size: 18px;
  line-height: 1;
  transition: translate var(--ui) var(--ease);
}

.primary-action:hover .action-arrow,
.primary-action:focus-visible .action-arrow {
  translate: 3px 0;
}

/* The pilot light reads the house (spec 4.2): warm when lit, an ember while the passkey prompt is open, a
   hollow ring while the house rests. It changes with the light, over the same fade. */
.pilot {
  --pilot-ring: rgb(21 18 12 / .5);
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: transparent;
  box-shadow: inset 0 0 0 1px var(--pilot-ring);
  transition: background-color var(--k3d-fade) linear, box-shadow var(--k3d-fade) linear;
}

.pilot[data-pilot="lit"] {
  --pilot-ring: rgb(21 18 12 / .4);
  background-color: #F0892A;
}

.pilot[data-pilot="ember"] {
  --pilot-ring: rgb(21 18 12 / .45);
  background-color: #9E3514;
}


/* ----- Stage ----------------------------------------------------------------------------------------- */

/* The stage (spec 3.5, 4.1): three plates crossfade in an 8:7 box (the plates are 1260 x 1102, ruling R24;
   every <img> says 1680 x 1470) on the model's 24-in drafting grid, over a tungsten pool. */
.k3d-box,
.k3d-canvas {
  grid-area: 1 / 1;
  width: var(--box-w);
  aspect-ratio: 8 / 7;
}

.k3d-box {
  position: relative;
  isolation: isolate;   /* plates.mjs sets it too: the plates' growing z-index stays inside the box */
}

/* The live engine's canvas (Task 24) takes the box's exact rectangle, above the poster. The host takes the stage's
   input; once the model is coming, a vertical swipe still scrolls the page (touch-action: pan-y) and a horizontal one
   turns the model. The canvas is clear until the handoff (the person's first gesture, R110): then it crossfades in
   over 240 ms, an opacity change and no camera motion, so also under reduced motion; .is-cut brings the poster back at
   once (a lost context). Once the canvas is in, the poster beneath goes (.is-live on the stage). */
.k3d-canvas {
  position: relative;
  z-index: 1;
}

/* The viewer is a tab stop exactly while a touch on it is the model's (the bridge's syncTab: the probe, loading, ready,
   live, and T1 waiting for the touch that starts the engine). The first swipe on a phone is that touch: the browser reads
   touch-action when the finger lands, so it is pan-y before the engine starts, or the browser takes the swipe from the
   page (pointercancel after two moves) and the model is left between views. */
.k3d-canvas[tabindex] {
  touch-action: pan-y;
}

/* The viewer (Task 26): a double-click must not select the text around it, and its focus ring sits inside the box. */
.k3d-canvas {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.k3d-canvas:focus-visible {
  outline-offset: -3px;
}

.k3d-stage:is([data-k3d="ready"], [data-k3d="live"]) .k3d-canvas {
  cursor: grab;
}

.k3d-stage:is([data-k3d="ready"], [data-k3d="live"]) .k3d-canvas.is-grabbing {
  cursor: grabbing;
}

.k3d-canvas > canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 240ms linear;
}

.k3d-canvas > canvas.is-live {
  opacity: 1;
}

.k3d-canvas > canvas.is-cut {
  transition: none;
}

.k3d-stage.is-live .k3d-box {
  visibility: hidden;
}

@media (max-width: 1023px) {
  .k3d-box,
  .k3d-canvas {
    transition: width var(--ui) var(--ease);
  }
}

/* The plates, stacked: plates.mjs gives the plate coming in a higher z-index and fades it in over the one
   it replaces, linearly (spec 3.1). */
.k3d-plate {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity var(--k3d-fade) linear;
  -webkit-user-drag: none;
  user-select: none;
}

.k3d-plate.is-on {
  opacity: 1;
}

/* The tungsten pool under the plinth (spec 4.1): a radial of #E8A866, about 720 x 240 at 1440 x 900, at
   most 6 %, up with the lights (--pool). */
.k3d-pool {
  position: absolute;
  left: 8%;
  top: 66%;
  width: 85%;
  height: 32%;
  background: radial-gradient(closest-side, rgb(232 168 102 / .06), rgb(232 168 102 / .035) 55%, rgb(232 168 102 / 0));
  opacity: var(--pool);
  pointer-events: none;
}

/* The model's own drafting grid (plates.mjs): its viewBox is the frame grown 16 % on every side, so it
   registers with the box at inset -16 %. It fades out before the stage's edges, over 120 px on desktops. */
.k3d-grid {
  --grid-x: 8%;
  --grid-y: 4%;
  --grid-fade: 120px;
  position: absolute;
  left: -16%;
  top: -16%;
  width: 132%;
  height: 132%;
  overflow: visible;
  pointer-events: none;
  -webkit-mask-image:
    linear-gradient(to right, transparent var(--grid-x), #000 calc(var(--grid-x) + var(--grid-fade)), #000 calc(100% - var(--grid-x) - var(--grid-fade)), transparent calc(100% - var(--grid-x))),
    linear-gradient(to bottom, transparent var(--grid-y), #000 calc(var(--grid-y) + var(--grid-fade)), #000 calc(100% - var(--grid-y) - var(--grid-fade)), transparent calc(100% - var(--grid-y)));
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent var(--grid-x), #000 calc(var(--grid-x) + var(--grid-fade)), #000 calc(100% - var(--grid-x) - var(--grid-fade)), transparent calc(100% - var(--grid-x))),
    linear-gradient(to bottom, transparent var(--grid-y), #000 calc(var(--grid-y) + var(--grid-fade)), #000 calc(100% - var(--grid-y) - var(--grid-fade)), transparent calc(100% - var(--grid-y)));
  mask-composite: intersect;
}

/* One column: the box fills the stage's height and nearly its width, so the grid fades by the box's
   edges, over a shorter run. */
@media (max-width: 1023px) {
  .k3d-grid {
    --grid-x: 12%;
    --grid-y: 12%;
    --grid-fade: 40px;
  }
}

/* The CSS bulb blooms of the Switch in plate mode (spec 3.3): centred on the pendant marks (plates.mjs sets
   left and top) and screened onto the plates. The plates' z-index only grows, so the blooms stand above
   any of them. */
.k3d-bloom {
  position: absolute;
  z-index: 2147483647;
  width: 11%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 236 204 / .85), rgb(255 198 132 / .38) 38%, rgb(255 178 104 / .12) 66%, rgb(255 170 98 / 0));
  mix-blend-mode: screen;
  opacity: 0;
  translate: -50% -50%;
  transition: opacity var(--k3d-fade) linear;
  pointer-events: none;
}

.k3d-bloom.is-on {
  opacity: 1;
}

/* The phones' hairline (Task 27; spec 3.5): while the engine streams on T1 (a phone, a tablet, a weak GPU), a 2 px champagne
   line on the stage's lower edge fills with the share of the download that has arrived (--k3d-progress, 0 to 1, set by
   the bridge through CSSOM) and goes when the model is ready. Decoration: no pointer, no text. */
.k3d-progress {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background-color: var(--champagne);
  transform: scaleX(var(--k3d-progress, 0));
  transform-origin: 0 50%;
  transition: transform 200ms linear;
  pointer-events: none;
}

.k3d-progress[hidden] {
  display: none;
}

/* The gold switch wires (spec 3.3; wires.mjs draws them in viewport px): one fixed layer over the whole
   viewport, above the stage and under the panel's text, never in the pointer's way. An SVG with only
   inset: 0 stays 300 x 150, hence the explicit size. */
.k3d-wires {
  position: fixed;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

/* The light slate ("Signature view · Lights on") at the bottom left, the hint, and the toolbar at the
   bottom right (the hint and the toolbar wait for the live engine, Task 24). */
.k3d-slate {
  position: absolute;
  z-index: 2;
  left: max(var(--gutter-l), (100% - var(--col)) / 2);   /* on the panel's column while the page is one column */
  bottom: calc(var(--k3d-row) + 2 * var(--k3d-key) + 8px);   /* above the six keys' row and the pendant slider: beside them the slate's text ran under the fifth key (Task 30, R181 I-2) */
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .02em;
  pointer-events: none;
}

.k3d-slate::before {
  content: "";
  flex: none;
  width: 16px;
  height: 1px;
  background-color: color-mix(in oklab, var(--champagne) 70%, transparent);
}

.k3d-hint {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: var(--k3d-clear);   /* on phones the hint is the stage's top line, clear of the model, the slider and the keys (R184 M-5) */
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}

/* The pendant dimmer's slider (Task 31): a labelled range in the stage's controls, on the slate's left edge, so that the bottom row stays the
   keys' and nothing in it moves: directly above the keys' row while the page is one column, above the slate beside the keys from 1024 px.
   It is the dimmer on touch (a vertical swipe is the page's scroll) and for the keyboard; the bridge shows it with the toolbar and enables
   it only in LIT with no play under way. */
.k3d-dimmer {
  position: absolute;
  z-index: 2;
  left: max(var(--gutter-l), (100% - var(--col)) / 2);
  bottom: calc(var(--k3d-row) + var(--k3d-key) + 4px);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--k3d-key);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .02em;
}

.k3d-dimmer[hidden] {
  display: none;
}

.k3d-dimmer label {
  flex: none;
  white-space: nowrap;
}

.k3d-dimmer input {
  flex: none;
  width: 160px;
  height: var(--k3d-key);
  margin: 0;
  accent-color: var(--champagne);
}

.k3d-dimmer input:disabled {
  opacity: .5;
}

.k3d-toolbar {
  position: absolute;
  z-index: 2;
  right: var(--k3d-right);
  bottom: var(--k3d-row);
  display: flex;
  gap: 8px;
}

/* Keys in #11161E with a 1 px #354150 border and 1.75 px champagne icons (spec 4.1): 44 px, or 40 px squares
   with a fine pointer (below). The tooltip is the key's own accessible name. */
.k3d-tool {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--k3d-key);
  height: var(--k3d-key);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--champagne);
  transition: background-color var(--ui) var(--ease), border-color var(--ui) var(--ease);
}

.k3d-tool svg {
  width: 20px;
  height: 20px;
}

.k3d-tool::after {
  content: attr(aria-label);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--raised);
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  translate: -50% 4px;
  transition: opacity var(--ui) var(--ease), translate var(--ui) var(--ease);
  pointer-events: none;
}

.k3d-tool:focus-visible::after {
  opacity: 1;
  translate: -50% 0;
}

/* Measure (Task 30): the fifth key is a toggle, lit while it is on. The label sits above the part's top centre (the bridge sets
   --k3d-measure-x and --k3d-measure-y, px in the stage, through CSSOM) and never takes the pointer, so the hover goes on under it.
   Its text is the part's name, size and finish, 12 px or more; the same words are announced in the live region. */
.k3d-tool[aria-pressed="true"] {
  border-color: var(--champagne);
  background-color: var(--raised);
}

.k3d-measure-label {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  width: max-content;
  max-width: min(320px, calc(100% - 16px));
  padding: 6px 10px;
  border: 1px solid color-mix(in oklab, var(--champagne) 50%, var(--border));
  border-radius: 6px;
  background-color: var(--raised);
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .01em;
  transform: translate(calc(var(--k3d-measure-x, 0px) - 50%), calc(var(--k3d-measure-y, 0px) - 100% - 10px));
  pointer-events: none;
}

.k3d-measure-label[hidden] {
  display: none;
}

/* The toolbar's load button (Task 24): "Explore in 3D" under reduced motion, "Load the 3D kitchen (X MB)" on Save-Data,
   a slow network or without the immutable cache header. A key of the toolbar's own kind, with its words. */
.k3d-load {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--champagne);
  font: 600 13px/1.3 var(--sans);
  transition: background-color var(--ui) var(--ease), border-color var(--ui) var(--ease);
}

@media (hover: hover) {
  .k3d-load:hover {
    border-color: color-mix(in oklab, var(--champagne) 40%, var(--border));
    background-color: var(--raised);
  }
}

@media (hover: hover) {
  .k3d-tool:hover {
    border-color: color-mix(in oklab, var(--champagne) 40%, var(--border));
    background-color: var(--raised);
  }

  .k3d-tool:hover::after {
    opacity: 1;
    translate: -50% 0;
  }
}

@media (min-width: 1024px) and (min-height: 501px) {
  .k3d-stage {
    --k3d-right: 64px;
    --k3d-row: 24px;
    --k3d-clear: 76px;   /* the header runs 63 px across the top of the stage */
  }

  .k3d-slate {
    left: 20px;
    bottom: 24px;
    min-height: 40px;
  }

  /* the label over the track: a column on the stage's left, above the slate */
  .k3d-dimmer {
    left: 20px;
    bottom: calc(var(--k3d-row) + 48px);   /* above the slate's 40 px */
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;   /* the track's focus ring clears its label's descenders (R184 M-4) */
  }

  .k3d-dimmer label {
    line-height: 16px;
  }

  .k3d-dimmer input {
    width: 128px;
  }

  .k3d-hint {
    left: 20px;
    top: auto;
    bottom: calc(var(--k3d-row) + var(--k3d-key) + 80px);   /* above the slider and its label */
  }
}

/* The 40 px squares are for a fine pointer; touch keeps 44 px on any layout, a landscape tablet's too
   (spec 7: 44 px on touch, 36 px or more with a pointer). */
@media (pointer: fine) {
  .k3d-stage {
    --k3d-key: 40px;
  }

  .k3d-load {
    min-height: 40px;
  }

  .k3d-dimmer input {
    height: 28px;   /* a pointer needs no 40 px track: the thumb is 16 px, and its focus ring then stays clear of the label */
  }
}

@media (orientation: landscape) and (max-height: 500px) and (min-width: 520px) {
  .k3d-stage {
    --k3d-right: var(--gutter-r);
    --k3d-clear: 60px;   /* the header's 52 px runs over the stage */
  }

  .k3d-slate {
    left: 0;
  }
}

@media (max-width: 360px) {
  .k3d-slate {
    display: none;
  }
}


/* ----- States ---------------------------------------------------------------------------------------- */

/* The greeting (spec 5.2, ruling R51): the prerender writes all four spans, the three times of day and
   COPY.ready.welcomeBack (data-daypart="none"), and exactly one shows, so the H1 never shows or reads two.
   html[data-daypart], set before first paint, picks its time of day. Without it (no JavaScript, or a value
   the page does not know) the H1 reads "Welcome back." (Appendix A). */
.greeting {
  display: none;
}

html[data-daypart="morning"] .greeting[data-daypart="morning"],
html[data-daypart="afternoon"] .greeting[data-daypart="afternoon"],
html[data-daypart="evening"] .greeting[data-daypart="evening"] {
  display: inline;
}

html:not([data-daypart="morning"], [data-daypart="afternoon"], [data-daypart="evening"]) .greeting[data-daypart="none"] {
  display: inline;
}

/* The plate unavailable (unsupported, setup required, a lockout): it goes dark, a graphite plate whose
   label stays legible (about 7.7:1) beside the reason it gives (spec 7). */
.primary-action:disabled {
  border-color: var(--hairline);
  background-color: var(--raised);
  color: var(--muted);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

.primary-action:disabled .pilot {
  --pilot-ring: color-mix(in oklab, var(--muted) 65%, transparent);
}

/* Waiting for the passkey (aria-disabled): the switch held down, a shade deeper, while the house holds its
   breath. */
.primary-action[aria-disabled="true"] {
  transform: translateY(1px);
  background-color: color-mix(in oklab, var(--champagne) 88%, var(--plate-edge));
  box-shadow: 0 0 0 rgb(0 0 0 / .55), 0 8px 16px -14px rgb(0 0 0 / .9);
  cursor: progress;
}

.primary-action[aria-disabled="true"] .action-arrow {
  translate: none;
}

/* An unavailable switch points nowhere; its arrow keeps its room, so the label does not move. */
.primary-action:disabled .action-arrow {
  visibility: hidden;
}

.text-action:disabled {
  color: var(--muted);
  text-decoration-color: transparent;
  cursor: not-allowed;
}

/* During the session check the invitation link waits a moment; it keeps the look it is about to have. */
#signin[data-phase="checking"] #show-invitation:disabled {
  color: var(--text);
  text-decoration-color: color-mix(in oklab, var(--champagne) 50%, transparent);
  cursor: progress;
}

.status-message[data-kind="success"] {
  border-left-color: var(--success);
}

.status-message[data-kind="error"] {
  border-left-color: var(--danger);
  background-color: color-mix(in oklab, var(--danger) 6%, var(--surface));
}

/* One column: while the invitation form has focus, the stage folds to a 140 px band (spec 4.1). */
.access-layout:has(#invitation-form:focus-within) {
  --stage-h: 140px;
}

/* A fresh sign-in turns the panel in a view transition: one short crossfade (spec 4.2). */
::view-transition-group(*) {
  animation-duration: 200ms;
}

::view-transition-old(*),
::view-transition-new(*) {
  animation-timing-function: var(--ease);
}


/* ----- Account controls ------------------------------------------------------------------------------ */

/* The live account controls under the signed-in view: a backup passkey, verifying again, and Manage
   invitations (the libraries, issuing with a role and library links, recovery with a typed-ID confirm,
   the issued code). */
.account-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 24px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
}

.account-controls > :not(.text-action) {
  flex: 1 0 100%;
}

.account-controls > .primary-action {
  margin-block: 8px;
}

.account-admin,
.issued-invitation {
  margin-top: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}

.account-admin h2 {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.account-admin > p,
.issued-invitation p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.account-admin form {
  display: flex;
  flex-direction: column;
}

.account-admin label,
.issued-invitation label {
  display: block;
  margin: 16px 0 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.account-admin input,
.account-admin select,
.issued-invitation textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  caret-color: var(--champagne);
  transition: border-color var(--ui) var(--ease);
}

.account-admin input:hover,
.account-admin select:hover,
.issued-invitation textarea:hover {
  border-color: var(--field-border-hover);
}

.account-admin input:focus-visible,
.account-admin select:focus-visible,
.issued-invitation textarea:focus-visible {
  outline-offset: 2px;
}

.account-admin input:disabled,
.account-admin select:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.account-admin select {
  padding-right: 40px;
  -webkit-appearance: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 21px) 50%, calc(100% - 16px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.account-admin form .primary-action {
  margin-top: 20px;
}

.account-admin > h3 {
  margin-top: 28px;
  color: var(--champagne);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.account-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.account-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}

.account-list li > span {
  flex: 1 1 160px;
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.account-list small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

/* Secondary buttons: outlined and quiet, 44 px for a finger (spec 7). */
.account-list button,
.account-recovery button,
.issued-invitation button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  transition: background-color var(--ui) var(--ease), border-color var(--ui) var(--ease);
}

.account-list button:hover:not(:disabled),
.account-recovery button:hover:not(:disabled),
.issued-invitation button:hover:not(:disabled) {
  border-color: color-mix(in oklab, var(--champagne) 40%, var(--border));
  background-color: var(--raised);
}

.account-list button:disabled,
.account-recovery button:disabled {
  border-color: var(--hairline);
  color: var(--muted);
  cursor: not-allowed;
}

.account-recovery {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background-color: var(--surface);
}

.account-recovery h3 {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.account-recovery p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.account-recovery label {
  font-weight: 500;
}

.account-recovery code {
  color: var(--champagne);
  font: 500 13px/1.5 var(--mono);
  overflow-wrap: anywhere;
}

.account-recovery input {
  background-color: var(--page);
}

.account-recovery button {
  margin: 12px 8px 0 0;
}

/* "Revoke old access and issue invitation" is the destructive one (.danger). */
.account-recovery button.danger:not(:disabled) {
  border-color: color-mix(in oklab, var(--danger) 55%, var(--border));
  color: var(--danger);
}

.account-recovery button.danger:hover:not(:disabled) {
  border-color: var(--danger);
  background-color: color-mix(in oklab, var(--danger) 10%, transparent);
}

.issued-invitation label {
  margin-top: 0;
  color: var(--champagne);
}

.issued-invitation textarea {
  min-height: 88px;
  padding: 10px 12px;
  font: 500 14px/1.5 var(--mono);
  letter-spacing: .02em;
  resize: vertical;
}

.issued-invitation button {
  margin-top: 12px;
}


/* ----- Reduced motion -------------------------------------------------------------------------------- */

/* Nothing moves or fades for longer than 1 ms (spec 7), except the light change: one 400 ms crossfade, the
   --k3d-fade the bridge sets. The plates crossfade over it, and the page's white balance and pool, which
   are the same light (ruling R52), follow them, as does the pilot light that reads it on the switch. The
   bridge draws no wires and no blooms then. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    transition-delay: 0s !important;
    animation-duration: 1ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  :root,
  .k3d-plate,
  .pilot {
    transition-duration: var(--k3d-fade) !important;
  }

  /* R110: the photograph hands over to the live model in a 240 ms crossfade under reduced motion too */
  .k3d-canvas > canvas {
    transition-duration: 240ms !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}


/* ----- Forced colours -------------------------------------------------------------------------------- */

/* System colours with real borders for the panel and the toolbar; the plates stay as content. The wires,
   the pool, the blooms, the grid and the pilot light go; the button's label says what the pilot showed
   (spec 7). */
@media (forced-colors: active) {
  .k3d-progress {
    background-color: Highlight;
  }

  .k3d-wires,
  .k3d-pool,
  .k3d-grid,
  .k3d-bloom,
  .pilot {
    display: none;
  }

  :focus-visible,
  .code-field:focus-within {
    outline-color: Highlight;
  }

  .private-label svg,
  .security-note svg {
    color: inherit;   /* the system's text colour: an SVG's own colour is not forced */
  }

  .signin-rule {
    background-color: CanvasText;
    forced-color-adjust: none;
  }

  .primary-action {
    border: 1px solid ButtonText;
    background-color: ButtonFace;
    color: ButtonText;
  }

  .primary-action:disabled,
  .primary-action[aria-disabled="true"] {
    border-color: GrayText;
    color: GrayText;
  }

  .status-message:not(:empty) {
    border: 1px solid CanvasText;
    border-left-width: 4px;
  }

  .code-field,
  .account-admin input,
  .account-admin select,
  .issued-invitation textarea,
  .account-recovery {
    border-color: CanvasText;
  }

  .account-admin select {
    -webkit-appearance: auto;
    appearance: auto;
  }

  .access-help summary::after {
    content: "+" / "";
    width: auto;
    height: auto;
    background: none;
  }

  .access-help[open] summary::after {
    content: "\2212" / "";
  }

  .k3d-tool,
  .k3d-load {
    border-color: ButtonText;
  }

  .k3d-tool[aria-pressed="true"] {
    border-color: Highlight;
    outline: 2px solid Highlight;
  }

  .k3d-measure-label {
    border-color: CanvasText;
  }
}


/* ----- More contrast --------------------------------------------------------------------------------- */

/* prefers-contrast: more raises the muted text and the hairlines (the creative direction's accessibility
   notes). */
@media (prefers-contrast: more) {
  :root {
    --muted: #CDD5DF;
    --border: #66778B;
    --field-border: #8C9AAC;         /* at least 6.34:1 on the page and the surface */
    --field-border-hover: #AAB5C3;
  }
}

/* Signed-in Kitchen team administration. All additions are local to this document mode. */
html.team-active {
  --bg: #10171b; --panel: #192328; --input: #111a1e; --line: #334045;
  --text: #f4f1e8; --muted: #bec8c8; --quiet: #a3afb0; --gold: #e3c38c;
  --gold-line: #86724e; --green: #95c6ac; --error: #f6b8a9;
  color-scheme: dark; background: var(--bg); color: var(--text);
#access-root { display: block; min-height: 100vh; }
body { font: 400 1rem/1.4 var(--sans); }
a { text-decoration: none; }
.brand { min-height: auto; }
.brand > span { display: block; }
.team-feedback { color: var(--muted); font-size: .88rem; margin-block: 12px; }
.team-feedback button { margin: 4px 0 4px 8px; }
.team-feedback:empty { display: none; }

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 16% -34%, #24303360, transparent 60%), var(--bg); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; }
button, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex="-1"]:focus-visible, .skip:focus-visible {
  outline: 2px solid #f0cf91; outline-offset: 3px;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 600; text-wrap: pretty; }
h1 { font-size: clamp(3.2rem, 4.9vw, 4.6rem); line-height: .99; letter-spacing: -.045em; }
h1 em { color: var(--gold); font-weight: 500; }
h3 { font-size: .94rem; font-weight: 600; }
p { line-height: 1.55; }
code { font: .875rem/1.5 Consolas, 'Courier New', monospace; overflow-wrap: anywhere; user-select: all; letter-spacing: .01em; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip:focus { position: fixed; z-index: 5; left: 12px; top: 12px; color: var(--bg); padding: 12px; background: var(--gold); }
.icon { width: 18px; height: 18px; flex: 0 0 auto; }
.shell { width: min(91.5%, 1536px); margin-inline: auto; }
.mast { border-bottom: 1px solid #354046; background: #141c20; }
.mast-inner, .mast nav, .page-heading, .tabs, .tabs button, .tools, .section-line, .detail-meta, .form-actions, .target,
.invite-person, .modal-bar, .modal-context, .detail-actions, .private-code > div, .crumb, .picker-trigger, .searchbox { display: flex; align-items: center; }
.mast-inner { min-height: 75px; justify-content: space-between; gap: 20px; }
.brand { text-align: left; padding: 0; display: grid; gap: 3px; color: var(--text); }
.brand span { font: 600 1.9rem/.9 var(--serif); text-transform: uppercase; letter-spacing: .083em; }
.brand small { display: flex; align-items: center; gap: 8px; font-size: .55rem; line-height: 1.35; text-transform: uppercase; color: var(--gold); letter-spacing: .37em; }
.brand small::after { content: ''; width: 26px; height: 1px; background: var(--gold-line); }
.mast nav { gap: 15px; }
.primary, .secondary, .quiet, .destructive, .text-button, .icon-button, .back-phone, .modal-back {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 6px; font-size: .865rem;
  font-weight: 550; line-height: 1.4; padding: 10px 15px; min-height: 42px; text-align: center;
}
.primary { color: #231c12; background: linear-gradient(110deg, #ecd3a8, #dcb880); border: 1px solid #e7c998; box-shadow: inset 0 1px 0 #fff3, 0 3px 10px #0002; }
.primary:hover:not(:disabled) { background: #f2d8aa; }
.primary:disabled { background: #353c3b; border-color: #48504d; color: #acb2ac; box-shadow: none; }
.secondary { background: #192226; border: 1px solid #4a5559; }
.secondary:hover { border-color: #87908e; background: #243035; }
.quiet { color: var(--muted); padding-inline: 9px; }
.quiet:hover, .text-button:hover, .back-phone:hover { color: #f8dbab; background: #ffffff09; }
.header-link { font-size: .8rem; min-height: 38px; }
.header-link .icon { width: 15px; height: 15px; }
#top-workspace { flex-direction: row-reverse; }
.identity { display: flex; align-items: center; padding: 0 0 0 18px; border-left: 1px solid var(--line); }
.identity .avatar { width: 2.125rem; height: 2.125rem; font-size: .78rem; }
.team-page { padding-top: clamp(24px, 3.3vh, 40px); padding-bottom: 48px; }
.crumb { font-size: .77rem; gap: 10px; color: var(--quiet); margin-bottom: 15px; }
.crumb a { padding: 3px 0; font-size: inherit; color: var(--muted); }
.crumb a:hover { color: var(--gold); text-decoration: underline; }
.crumb .icon { width: 10px; height: 10px; }
.page-heading { justify-content: space-between; gap: 20px; }
.page-heading .primary { padding: 11px 17px; }
.tabs { margin-top: 22px; gap: 27px; border-bottom: 1px solid var(--line); }
.tabs button { position: relative; gap: 8px; font-size: .89rem; font-weight: 530; color: var(--quiet); min-height: 49px; padding: 0 1px; }
.tabs .icon { width: 16px; height: 16px; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--gold); }
.tabs button[aria-selected="true"]::after { content: ''; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--gold); }
.count { padding: 1px 6px; border-radius: 4px; background: #263136; color: var(--muted); font-size: .69rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
[aria-selected="true"] .count { color: #e2c895; background: #35332b; }
.master-detail { display: grid; grid-template-columns: minmax(0, 2.12fr) minmax(300px, 1fr); gap: clamp(22px,2.3vw,38px); margin-top: 27px; align-items: start; }
.tools { gap: 10px; margin-bottom: 16px; }
.searchbox, input:not([type="search"]), .select-wrap select { background: var(--input); border: 1px solid #48565b; border-radius: 6px; }
.searchbox { padding: 0 13px; flex: 1; gap: 9px; min-width: 0; color: var(--quiet); }
.searchbox:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
input, select { min-width: 0; }
input::placeholder { color: #9eaaae; opacity: 1; }
input[type="search"] { border: 0; background: transparent; width: 100%; min-height: 43px; padding: 7px 0; font-size: .86rem; outline: 0; }
input[type="search"]:focus-visible { outline: 0; }
.select-wrap { position: relative; }
.select-wrap select { display: block; width: 100%; appearance: none; padding: 10px 35px 10px 13px; line-height: 1.45; }
.select-wrap > .icon:last-child { position: absolute; pointer-events: none; right: 12px; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; color: var(--muted); }
.filter { width: 149px; flex-shrink: 0; }
.filter select { min-height: 45px; font-size: .83rem; padding-left: 35px; padding-right: 25px; }
.filter > .icon:first-child { position: absolute; pointer-events: none; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.people-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.people-table th { text-align: left; text-transform: uppercase; letter-spacing: .12em; color: var(--quiet); font-size: .62rem; font-weight: 550; }
.people-table th, .people-table td { padding: 10px 9px; border-bottom: 1px solid var(--line); }
.people-table th:first-child, .people-table td:first-child { padding-left: 14px; }
.people-table td { height: 68px; line-height: 1.4; color: var(--muted); }
.people-table tbody tr { cursor: pointer; }
.people-table tbody tr:hover { background: #1c282c; }
.people-table tbody tr.selected { background: linear-gradient(90deg,#33342b, #242c2c 80%); }
.people-table tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.person-button { display: flex; align-items: center; gap: 12px; padding: 2px 0; min-height: 44px; color: var(--text); text-align: left; }
.person-label { min-width: 0; overflow-wrap: anywhere; }
.person-label strong, .invite-person strong { font-size: .92rem; font-weight: 560; }
.person-label small { display: none; color: var(--quiet); }
.avatar { --face: #d4c9ab; --rim: #645d4d; --fill: #302e26; width: 2.3125rem; height: 2.3125rem; border-radius: 50%; flex: none; display: inline-grid; place-items: center; background: var(--fill); border: 1px solid var(--rim); color: var(--face); font: 600 1.02rem/1 var(--serif); }
.tone-admin { --face: #d1c0cf; --rim: #5d505c; --fill: #2e2830; }
.tone-manager { --face: #b7cdd7; --rim: #455b65; --fill: #222e35; }
.tone-designer { --face: #c4d4c9; --rim: #485c51; --fill: #27332d; }
.selected .avatar { --face: #ecd6aa; --rim: #8c7956; --fill: #38352c; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; white-space: nowrap; color: #c3dcca; }
.status span { width: 6px; height: 6px; flex: none; background: var(--green); border-radius: 50%; }
.status.invited { color: #e4cb99; }
.status.invited span { background: transparent; border: 1.5px solid #dfb972; }
.status.revoked { color: var(--quiet); }
.status.revoked span { background: #a1a9aa; }
.row-chevron { width: 25px; }
.row-chevron .icon { width: 12px; height: 12px; color: #78878a; }
.selected .row-chevron .icon { color: var(--gold); }
.detail { border-radius: 11px; border: 1px solid #465253; background: var(--panel); box-shadow: 0 14px 40px #0002; overflow: clip; }
.detail-head { position: relative; isolation: isolate; overflow: hidden; padding: 22px 25px 20px; background: linear-gradient(116deg, #293432, #202b2d 72%, #1d292c); border-bottom: 1px solid #404c4e; }
.detail-head::after { content: ''; position: absolute; pointer-events: none; z-index: -1; top: -55%; bottom: -65%; width: 48%; right: -18px; background: repeating-linear-gradient(90deg,transparent 0 12px,#afbbac17 12px 13px,transparent 13px 18px,#afbbac0a 18px 19px); transform: skew(-28deg); mask-image: linear-gradient(90deg, transparent, #000 30%); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .15em; font-size: .62rem; font-weight: 600; color: var(--gold); }
.rule { width: 19px; height: 1px; background: var(--gold-line); }
.detail-head h2 { font-size: clamp(2.4rem, 3.1vw, 3.45rem); line-height: 1; letter-spacing: -.035em; margin: 11px 0 8px; overflow-wrap: anywhere; }
.detail-meta { gap: 11px; color: var(--muted); font-size: .84rem; }
.mid-dot { color: #89938e; }
.detail-body { padding: 0 24px 18px; }
.detail-body > section { padding: 18px 0; }
.detail-body > section + section { border-top: 1px solid var(--line); }
.section-line { justify-content: space-between; gap: 8px; }
.relationship p { color: var(--muted); font-size: .87rem; margin-top: 4px; overflow-wrap: anywhere; }
.relationship .team-scope { font-size: .82rem; margin-top: 8px; }
.text-button { color: var(--gold); font-size: .77rem; font-weight: 500; min-height: 30px; padding: 4px 0 4px 5px; }
.libraries { display: grid; gap: 7px; margin-top: 12px; }
.library-card { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: start; column-gap: 10px; padding: 10px 12px; border: 1px solid #384448; border-radius: 6px; background: #151f23; }
.lib-glyph { margin-top: 2px; color: #bda887; }
.lib-glyph .icon { width: 16px; height: 16px; }
.library-card > div { min-width: 0; }
.library-card .eyebrow { display: block; font-size: .57rem; color: #c8b18a; }
.library-card strong { display: block; font-size: .84rem; font-weight: 500; margin: 4px 0 2px; overflow-wrap: anywhere; }
.library-card code { grid-column: 2; color: var(--muted); }
.detail-actions { border-top: 1px solid var(--line); padding-top: 14px; justify-content: space-between; flex-wrap: wrap; gap: 4px; }
.detail-actions button { font-size: .78rem; min-height: 36px; padding: 7px 10px; }
.more-actions { display: grid; gap: 3px; padding: 6px; margin-top: 8px; background: var(--input); border: 1px solid var(--line); border-radius: 6px; }
.more-actions button { justify-content: flex-start; }
.danger { color: var(--error); }
.back-phone { display: none; }
.empty { padding: 40px 16px; border-block: 1px solid var(--line); text-align: center; }
.empty h2, .list-intro h2 { font-size: 2.1rem; }
.empty p, .list-intro p { color: var(--muted); font-size: .9rem; }
.empty button { margin-top: 13px; }
.invitation-list { margin: 30px 0; }
.invitation-list ul { padding: 0; margin: 22px 0; list-style: none; border-block: 1px solid var(--line); }
.invitation-list li { display: grid; grid-template-columns: minmax(140px,1fr) minmax(80px,.55fr) auto; align-items: center; gap: 14px; padding: 17px 12px; }
.invitation-list li + li { border-top: 1px solid var(--line); }
.invite-person, .target { gap: 12px; }
.invite-person small, .target small { display: block; margin-top: 4px; color: var(--quiet); font-size: .76rem; }
.invite-person strong, .target strong { overflow-wrap: anywhere; }
.notice { position: fixed; z-index: 2; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 13px; align-items: center; background: #293731; border: 1px solid #5e7163; border-radius: 8px; box-shadow: 0 4px 28px #0006; padding: 9px 10px 9px 14px; max-width: calc(100vw - 24px); width: max-content; font-size: .86rem; }
.notice button { display: inline-flex; padding: 5px; }
body.locked { overflow: hidden; }
dialog { box-sizing: border-box; width: min(530px,calc(100% - 40px)); max-width: none; max-height: min(90dvh,calc(var(--visible-height,100dvh) - 32px)); margin: auto; padding: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid #546063; border-radius: 12px; color: var(--text); background: #192327; box-shadow: 0 24px 100px #0008; scrollbar-color: #536165 #192327; }
dialog::backdrop { background: #050b0fd1; backdrop-filter: blur(3px); }
.dialog-inner { padding: 20px 27px 24px; }
.modal-bar { justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.modal-context { gap: 7px; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); font-size: .63rem; font-weight: 550; }
.modal-context .icon { width: 15px; height: 15px; }
.icon-button { width: 33px; min-height: 33px; color: var(--muted); border: 1px solid var(--line); padding: 5px; }
.icon-button:hover { color: var(--text); background: #273237; }
.modal-back { display: none; }
#dialog-title { font-size: 2.7rem; letter-spacing: -.035em; line-height: 1.03; margin-bottom: 23px; overflow-wrap: anywhere; }
#dialog-title:focus, #detail-title:focus, #page-title:focus { outline-offset: 5px; }
#dialog-title:focus:not(:focus-visible) { outline: none; }
form label, .field-label, .private-code label { display: block; margin-bottom: 7px; font-size: .83rem; font-weight: 550; }
form input:not([type="search"]), .private-code input { width: 100%; padding: 11px 12px; line-height: 1.4; }
.form-row { display: grid; grid-template-columns: 1.15fr 1fr; gap: 13px; }
.form-row > div { min-width: 0; }
form .select-wrap select { min-height: 45px; }
.library-fields { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 20px; }
.library-fields h3 { font-size: 1.03rem; }
.requirement { color: var(--muted); font-size: .84rem; margin: 5px 0 14px; }
.picker + .picker { margin-top: 12px; }
.picker-trigger { width: 100%; gap: 10px; min-height: 45px; border-radius: 6px; border: 1px solid #48565b; padding: 9px 12px; background: var(--input); color: var(--muted); font-size: .88rem; text-align: left; }
.picker-trigger > .icon:first-child { width: 16px; height: 16px; color: var(--quiet); }
.picker-trigger > .icon:last-child { margin-left: auto; width: 13px; height: 13px; }
.picker-trigger.picked { border-color: var(--gold-line); background: #252c28; color: var(--text); }
.picker-trigger code, .lib-option code { display: block; margin-top: 3px; color: var(--muted); }
.choices { padding: 9px; border: 1px solid #546266; border-radius: 6px; margin-top: 6px; background: #1e292d; }
.choices .searchbox { margin-bottom: 5px; display: flex; font-weight: 400; }
#lib-options { max-height: 200px; overflow-y: auto; overscroll-behavior: contain; }
.option-group h4 { margin: 0; padding: 10px 9px 4px; color: var(--muted); font-size: .76rem; font-weight: 550; }
.option-group:first-child h4 { color: var(--gold); }
.lib-option { width: 100%; padding: 9px; text-align: left; border-bottom: 1px solid var(--line); font-size: .86rem; }
.lib-option:not(:disabled):hover { background: #303a38; }
.lib-option:focus-visible { outline-offset: -2px; }
.lib-option:disabled { color: var(--quiet); background: #ffffff03; }
.lib-option small { display: block; color: #d0b997; margin-top: 2px; }
.no-options { font-size: .85rem; padding: 9px; }
.summary, .effect { border-left: 2px solid #b59a6b; border-radius: 3px 6px 6px 3px; padding: 12px 14px; background: #222e30; margin-top: 18px; font-size: .83rem; overflow-wrap: anywhere; }
.summary strong, .summary > span { display: block; }
.summary strong { font-weight: 580; margin-bottom: 3px; }
.summary strong span, .summary > span, .summary code { color: var(--muted); font-weight: 400; }
.summary > span { margin-top: 4px; }
.summary code { display: block; }
.form-actions { justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
#team-email section { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
#team-email section h3 { margin-bottom: 10px; }
#team-email section > p { margin-bottom: 12px; color: var(--muted); }
#team-email .invite-theme-options { min-width: 0; margin: 16px 0 0; padding: 0; border: 0; }
#team-email .invite-theme-options legend { margin-bottom: 8px; padding: 0; font-weight: 600; }
.invite-theme-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
#team-email .invite-theme-choice {
  margin: 0; display: flex; align-items: center; gap: 9px; min-height: 54px; padding: 8px 12px;
  border: 1px solid #62675e; border-radius: 6px; cursor: pointer;
  background: #192327; color: #f5f0e5; font: 500 16px/1.2 Georgia, serif;
}
#team-email .invite-theme-choice.parchment-purity { background: #f5f2e8; color: #26352e; border-color: #c5bba6; }
#team-email .invite-theme-choice input { appearance: auto; width: 16px; min-width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: #956b36; }
#team-email .invite-theme-choice:has(:checked) { box-shadow: inset 0 0 0 2px #ab8954; }
#team-email .invite-theme-choice:focus-within { outline: 2px solid var(--gold, #e2c28a); outline-offset: 2px; }
.email-review { margin: 12px 0; display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 8px 16px; font-size: .9rem; }
.email-review dt { color: var(--muted); }
.email-review dd { margin: 0; overflow-wrap: anywhere; }
.detail-actions { flex-wrap: wrap; }
.receipt-instructions, .expiry, .bounded p, #edit-form p { color: var(--muted); font-size: .9rem; }
.private-code, .account-id { border: 1px solid var(--line); border-radius: 7px; padding: 14px; margin-block: 16px; background: #152024; }
.private-code input { font-family: Consolas, monospace; font-size: 1rem; user-select: all; }
.private-code > div { margin-top: 10px; gap: 8px; flex-wrap: wrap; }
#copy-status { font-size: .78rem; color: var(--green); }
.expiry span { color: var(--quiet); font-size: .78rem; }
.bounded p + p { margin-top: 10px; }
.target { padding-bottom: 15px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.current { margin-bottom: 14px; }
.current strong { display: inline-block; margin-left: 5px; color: var(--text); }
.account-id code { display: block; margin-top: 5px; }
.deletion-library { border-block-start: 1px solid var(--line); padding-block: 14px; }
.deletion-library h3 { margin-block: 0 5px; }
.deletion-library code, .target code { display: block; color: var(--quiet); font-size: .75rem; }
.deletion-library summary { color: var(--gold); cursor: pointer; padding-block: 6px; }
.deletion-library li { margin-block: 6px; overflow-wrap: anywhere; }
.deletion-library ul { padding-inline-start: 1.2rem; }
.target > div { min-width: 0; }
.destructive { background: #f0b4a5; color: #341c17; }
.field-error { margin-top: 7px; color: var(--error); font-size: .82rem; }
#edit-form .field-error { color: var(--error); }
@media (min-width: 900px) and (max-width: 1090px) {
  .shell { width: 94%; }
  .master-detail { grid-template-columns: minmax(0,1.65fr) minmax(275px,1fr); gap: 18px; }
  .people-table td, .people-table th { padding-inline: 5px; }
  .person-button { gap: 7px; }
  .detail-body { padding-inline: 16px; }
  .detail-head { padding-inline: 16px; }
}
@media (max-width: 899px) {
  .shell { width: min(92%, 720px); }
  .master-detail { display: block; }
  .team-page:not(.detail-screen) #detail-slot, .detail-screen .directory-top, .detail-screen .directory { display: none; }
  .detail-screen .master-detail { margin: 0; }
  .back-phone { display: inline-flex; justify-content: flex-start; color: var(--gold); padding: 10px 18px; }
  .people-table tbody tr.selected { background: transparent; }
  .people-table tr.selected td:first-child { box-shadow: none; }
  .people-table tbody .user-selected { background: #262e2d; box-shadow: inset 2px 0 var(--gold); }
  .people-table .user-selected td:first-child { padding-left: 8px; }
  .selected .tone-designer { --face: #c4d4c9; --rim: #485c51; --fill: #27332d; }
  .detail-body { padding-inline: 20px; }
  .detail-head h2 { font-size: 2.8rem; }
  .detail-actions button, .text-button { min-height: 44px; }
}
@media (max-width: 600px) {
  .shell { width: calc(100% - 36px); }
  .mast-inner { min-height: 63px; gap: 8px; }
  .brand span { font-size: min(1.52rem, calc((100vw - 108px) / 7.4)); }
  .brand small { font-size: min(.46rem,3.1vw); }
  .mast .header-link { display: none; }
  .identity { border: 0; padding: 5px; }
  .team-page { padding-top: 17px; }
  .crumb { margin-bottom: 13px; }
  .crumb a { min-height: 33px; }
  h1 { font-size: clamp(2.9rem,11.6vw,4.35rem); }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
  .page-heading .primary { min-height: 43px; padding: 9px 14px; }
  .tabs { margin-top: 14px; column-gap: 24px; }
  .tabs button { min-height: 46px; }
  .master-detail { margin-top: 17px; }
  .tools { gap: 7px; margin-bottom: 10px; }
  .filter { width: 122px; }
  .filter select { padding-left: 10px; }
  .filter > .icon:first-child { display: none; }
  .tools input, .tools select, input#lib-search { font-size: 1rem; }
  .searchbox { padding-inline: 10px; gap: 6px; }
  .searchbox .icon { width: 15px; height: 15px; }
  .people-table th:nth-child(2), .people-table th:nth-child(3), .people-table .col-role, .people-table .col-libraries { display: none; }
  .people-table th:first-child, .people-table td:first-child { padding-left: 1px; }
  .people-table th, .people-table td { padding-inline: 4px; }
  .people-table td { height: 72px; }
  .person-button { gap: 9px; }
  .person-label small { display: block; font-size: .71rem; line-height: 1.5; margin-top: 2px; }
  .person-label small span { padding-inline: 1px; }
  .row-chevron { width: 12px; }
  .status { font-size: .73rem; }
  .detail-screen { padding-top: 12px; }
  .detail { border-radius: 8px; }
  .detail-head { padding: 20px; }
  .detail-meta, .relationship p { font-size: .93rem; }
  .library-card code { grid-column: 1/-1; margin-top: 2px; }
  .invitation-list { margin-top: 21px; }
  .list-intro h2 { font-size: 1.9rem; }
  .invitation-list li { grid-template-columns: minmax(0,1fr) auto; padding-inline: 2px; }
  .invitation-list li button { grid-column: 1/-1; justify-self: start; }
  dialog { position: fixed; inset: var(--viewport-top,0px) 0 auto; margin: 0; width: 100%; height: var(--visible-height,100dvh); max-height: var(--visible-height,100dvh); border: 0; border-radius: 0; background: #131d21; }
  .dialog-inner { padding: 0 20px max(24px,env(safe-area-inset-bottom)); }
  .modal-bar { border-bottom: 1px solid var(--line); margin: 0 -20px 21px; padding: 4px 10px; }
  .modal-back { display: flex; min-height: 44px; padding-inline: 6px; color: var(--gold); }
  .modal-context, #modal-close { display: none; }
  #dialog-title { font-size: 2.45rem; margin-bottom: 20px; }
  .form-row { grid-template-columns: 1fr; gap: 13px; }
  .library-fields { margin-top: 18px; padding-top: 16px; }
  .library-fields h3 { font-size: 1.08rem; }
  .picker-trigger { min-height: 46px; }
  form input, form select { font-size: 1rem; }
  .form-actions .primary, .form-actions .destructive { flex: 1; }
  .form-actions .quiet { min-height: 44px; }
  #cancel-invite { display: none; }
  .receipt-instructions { font-size: .96rem; }
  .private-code input { font-size: .94rem; }
}
@media (max-width: 359px) {
  .shell { width: calc(100% - 28px); }
  .filter { width: 102px; }
  .filter select { font-size: .88rem; }
  .person-button { gap: 7px; }
  .person-button .avatar { width: 1.875rem; height: 1.875rem; font-size: .87rem; }
  .person-label strong { font-size: .84rem; }
  .person-label small { font-size: .66rem; }
  .dialog-inner { padding-inline: 15px; }
  .modal-bar { margin-inline: -15px; }
  .row-chevron { display: none; }
}
.team-page { container: content-page / inline-size; }
@container content-page (max-width: 17em) {
  .tabs { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); gap: 8px; }
  .tabs button { flex-wrap: wrap; justify-content: flex-start; gap: 4px; padding-block: 8px; font-size: .82rem; }
  .tabs .icon { display: none; }
  .tools { display: grid; grid-template-columns: minmax(0,1fr); }
  .filter { width: 100%; }
  .filter select { font-size: 1rem; }
  .people-table, .people-table tbody { display: block; }
  .people-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .people-table tbody tr { display: grid; grid-template-columns: minmax(0,1fr); padding-block: 10px; border-bottom: 1px solid var(--line); }
  .people-table tbody td { height: auto; border: 0; padding: 0; }
  .people-table tbody td:first-child { padding: 0; }
  .person-button .avatar { display: none; }
  .people-table tbody td:nth-child(4) { padding-top: 4px; }
  .people-table .user-selected { padding-inline: 8px; }
  .people-table .row-chevron { display: none; }
  .section-line { align-items: flex-start; flex-direction: column; }
  .section-line .text-button { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
}

/* Generated from tooling/opening-screen.css */
/* The dimensions, palette, artwork and motion follow the pricing workspace boot screen. */
.opening-screen {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  overflow: auto;
  display: grid;
  align-items: safe center;
  justify-items: center;
  padding: 24px;
  margin: 0;
  background: #0e1316;
  color: #93a2a9;
  text-align: center;
  font: 400 15px/1.4 "Bahnschrift", "DIN Alternate", "DIN Next", "Roboto Condensed", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.opening-content { display: grid; justify-items: center; gap: 14px; width: min(34ch, 100%); position: relative; }
.opening-mark { --light: -140; width: 88px; height: 62px; display: block; }
.opening-screen .opening-mark svg { stroke: none; }
.opening-screen [role="status"] { margin: 0; color: inherit; font: inherit; letter-spacing: normal; }
.opening-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; }
.opening-actions a, .opening-actions button { color: #edf1f2; font: inherit; }
.opening-actions button { padding: 6px 14px; background: #1c252a; border: 1px solid #2a363c; border-radius: 8px; }
.opening-actions :focus-visible { outline: 2px solid #ffe3a3; outline-offset: 3px; }
.opening-noscript { position: fixed; inset: auto 16px 12px; color: #edf1f2; text-align: center; }
/* Keep the ordinary opening frame clean. The exit is always reachable by keyboard. */
.opening-screen:not([data-error]) .opening-actions:not(:focus-within) {
  position: absolute; top: 100%; margin-top: 8px; opacity: 0; pointer-events: none;
  animation: opening-show-exit 0s forwards;
  /* This delay reveals a way out of a stalled load. It is independent of motion preferences. */
  animation-delay: 6s !important;
}
.opening-screen:not([data-error]) .opening-actions:focus-within { position: absolute; top: 100%; margin-top: 8px; }
.opening-actions:focus-within, .opening-screen[data-error] .opening-actions {
  animation: none !important; transition: none !important; opacity: 1; pointer-events: auto;
}
@keyframes opening-show-exit { to { opacity: 1; pointer-events: auto; } }
.opening-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.opening-mark .rim,
.opening-mark .spec,
.opening-mark .glint {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.opening-mark .st-big .rim {
  transform-origin: 47px 37px;
  transform: rotate(calc((var(--light) + 10) * 1deg));
}
.opening-mark .st-big .spec {
  transform: translate(calc(cos(var(--light) * 1deg) * 9.02px), calc(sin(var(--light) * 1deg) * 5.22px + 1.45px));
}
.opening-mark .st-big .glint {
  transform: translate(calc(cos(var(--light) * 1deg) * 12.30px), calc(sin(var(--light) * 1deg) * 6.38px + 1.45px));
}
.opening-mark .st-med .rim {
  transform-origin: 85px 53px;
  transform: rotate(calc((var(--light) + 8) * 1deg));
}
.opening-mark .st-med .spec {
  transform: translate(calc(cos(var(--light) * 1deg) * 6.38px), calc(sin(var(--light) * 1deg) * 3.69px + 1.03px));
}
.opening-mark .st-med .glint {
  transform: translate(calc(cos(var(--light) * 1deg) * 8.70px), calc(sin(var(--light) * 1deg) * 4.51px + 1.03px));
}
.opening-mark .st-sml .rim {
  transform-origin: 50px 64px;
  transform: rotate(calc((var(--light) + 6) * 1deg));
}
.opening-mark .st-sml .spec {
  transform: translate(calc(cos(var(--light) * 1deg) * 4.18px), calc(sin(var(--light) * 1deg) * 2.43px + 0.68px));
}
.opening-mark .st-sml .glint {
  transform: translate(calc(cos(var(--light) * 1deg) * 5.70px), calc(sin(var(--light) * 1deg) * 2.97px + 0.68px));
}
.opening-mark .shadow {
  display: none;
}
:root[data-theme="light"] .opening-mark .shadow {
  display: inline;
}
:root[data-theme="light"] .opening-mark .halo {
  display: none;
}
.opening-mark .halo {
  animation: opening-breathe 7s ease-in-out infinite;
}
.opening-mark .st-med .halo {
  animation-delay: -2.3s;
}
.opening-mark .st-sml .halo {
  animation-delay: -4.6s;
}
@keyframes opening-breathe {
  50% {
    opacity: 0.5;
  }
}
.opening-mark.busy .rim {
  animation: opening-orbit 1.5s linear infinite;
}
.opening-mark.busy .st-med .rim {
  animation-delay: -0.5s;
}
.opening-mark.busy .st-sml .rim {
  animation-delay: -1s;
}
@keyframes opening-orbit {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.opening-mark .sweep {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .opening-mark, .opening-mark * { animation: none !important; transition: none !important; }
}
.opening-screen[data-error] .opening-mark * { animation: none; }
/* End opening screen */
