/* Sell or Scale. The app's screens: the kit. How to use it: KIT.md.

   One object everywhere, the pane: a sheet of the notification's warm paper white with the app's own bar on one
   hairline. On ink it is lit, and it is the only light in view. On paper it sits flat, with a hairline edge.
   Where the device is the point, the home page's phone holds the same pane.

   - Every class starts with ui-. Nothing here styles anything outside a screen, and nothing here needs site.css's
     classes or its reset: only its tokens (--ink, --text, --text-2, --rule, --rule-2, --on-ink, --font, --ease).
     No address is loaded from here: the glyphs, the mark and the grain are in this file.
   - A screen answers to its own width (the container "ui"), never the window's:
       under 600 the phone app; from 600 the desk layout; from 900 wider gutters and the ledger feed;
       from 1000 the page tabs in the bar; from 1120 the widest rows and Ask's Sources panel.
     A browser without container queries gets the desk layout.
   - Type: rows and messages 16px on a 22px line, notes 15px on 21, times 14px. Nothing smaller. Tabular figures.
   - Vertical module 34px: a section head is 34, a list row 68, a tight row 34, the gap between sections 34.
     So hairlines in two columns meet.
   - State is an ink word with a small mark. Green and amber are marks only. The one warm colour is the AI's answer.
   - No script is needed. kit.js only lets a reader press Approve or Decline on a request. */

:root {
  --ui-paper: #f6f3ee;                      /* the sheet: the notification's warm paper white (--on-ink) */
  --ui-ai: #f9e9d4;                         /* the AI's answer: --light mixed 34% into the sheet, flat. The one warm colour */
  --ui-fill: rgba(11, 13, 17, 0.06);        /* another person's bubble, initials, the open row */
  --ui-wait: #d98c1c;                       /* amber: a dot only, beside "Waiting for you" and "Needs you" */
  --ui-ok: #23874f;                         /* green: a dot or a tick only, beside "Live", "Approved", done */
  --ui-idle: #6b727c;                       /* the grey of a ring: "In design", "Rehearsing" */

  /* Sizes are px on purpose, here and all through this file: a screen is a picture of the app, drawn on px boxes, and
     it keeps its sizes when a reader's browser text is larger, as the home page's phone does. (In rem its words
     outgrew their boxes at a 24px browser size: the lead figure ran into its label and the phone's tab row into itself.) */
  --ui-fs: 16px;                            /* rows and messages */
  --ui-lh: 22px;
  --ui-fs-note: 15px;                       /* notes, labels, controls */
  --ui-lh-note: 21px;
  --ui-fs-time: 14px;                       /* a timestamp, initials, a tag. Nothing is smaller */
  --ui-r: 14px;                             /* a pane's corner */

  --ui-i-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M8.5 30 11.23 20.57 4.08 11.64 5.12 10.56 13.67 17.11 26.7 2.15 27.9 3.05 16.72 20.4 19.5 30Z'/%3E%3C/svg%3E");
  --ui-i-mark-16: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M8 30 10.91 20.55 4.03 11.79 5.57 10.21 13.61 16.24 26.12 2.14 27.88 3.46 17.05 20.41 20 30Z'/%3E%3C/svg%3E");
  --ui-i-go: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 3.75 4.25 4.25L6 12.25'/%3E%3C/svg%3E");
  --ui-i-back: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 3.75 5.75 8 10 12.25'/%3E%3C/svg%3E");
  --ui-i-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.75 6 4.25 4.25L12.25 6'/%3E%3C/svg%3E");
  --ui-i-to: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.75 8h10.5M8.75 3.75 13 8l-4.25 4.25'/%3E%3C/svg%3E");
  --ui-i-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 13.25V2.75M3.75 7 8 2.75 12.25 7'/%3E%3C/svg%3E");
  --ui-i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.4l3 3 6-6.8'/%3E%3C/svg%3E");
  --ui-i-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='m4.25 4.25 7.5 7.5m0-7.5-7.5 7.5'/%3E%3C/svg%3E");
  --ui-i-play: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5.5 3.85v8.3a.6.6 0 0 0 .91.51l6.6-4.15a.6.6 0 0 0 0-1.02L6.41 3.34a.6.6 0 0 0-.91.51z'/%3E%3C/svg%3E");
  --ui-i-status: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 62 14' fill='%230b0d11'%3E%3Crect x='1' y='9.4' width='2.6' height='3.4' rx='.7'/%3E%3Crect x='5.2' y='7.2' width='2.6' height='5.6' rx='.7'/%3E%3Crect x='9.4' y='4.8' width='2.6' height='8' rx='.7'/%3E%3Crect x='13.6' y='2.2' width='2.6' height='10.6' rx='.7'/%3E%3Cg fill='none' stroke='%230b0d11' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M23.3 6.3a8.2 8.2 0 0 1 11.4 0'/%3E%3Cpath d='M25.7 8.9a4.7 4.7 0 0 1 6.6 0'/%3E%3C/g%3E%3Ccircle cx='29' cy='11.6' r='1.25'/%3E%3Crect x='41.5' y='2.5' width='16' height='9.5' rx='2.8' fill='none' stroke='%230b0d11' opacity='.45'/%3E%3Crect x='43' y='4' width='10.5' height='6.5' rx='1.5'/%3E%3Cpath d='M58.8 5.6c.7.2 1.2.9 1.2 1.65s-.5 1.45-1.2 1.65z' opacity='.5'/%3E%3C/svg%3E");
  --ui-grain: url("data:image/png;base64,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");
}

/* ---------- a screen: the size container, and where its light hangs ---------- */

.ui-screen { position: relative; z-index: 0; container: ui / inline-size; min-width: 0; margin: 0; }

/* the pane: warm paper white, a corner, a hairline edge */
.ui-pane {
  --ui-g: 24px;                             /* its gutter: 20 as the phone app, 24 at a desk, 32 from 900 */
  position: relative;
  display: flex; flex-direction: column;
  box-sizing: border-box; width: 100%;
  overflow: hidden;
  border: 1px solid var(--rule); border-radius: var(--ui-r);
  background: var(--ui-paper); color: var(--text);
  font: 400 var(--ui-fs) / var(--ui-lh) var(--font);
  font-feature-settings: "ss01", "cv11"; font-variant-numeric: tabular-nums;
  letter-spacing: -0.006em; text-align: left; white-space: normal;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
/* everything a screen needs of the page's reset, so it stands on its tokens alone */
:where(.ui-pane, .ui-phone) :where(*, *::before, *::after) { box-sizing: border-box; }
:where(.ui-pane, .ui-phone) :where(p, ul, ol, dl, dt, dd, h3, h4, figure, table, th, td) { margin: 0; padding: 0; }
:where(.ui-pane) :where(ul, ol) { list-style: none; }
:where(.ui-pane) :where(a) { color: inherit; text-decoration: none; }
:where(.ui-pane) :where(i) { font-style: normal; }
:where(.ui-pane) :where(h3, h4) { font-size: inherit; font-weight: inherit; }
:where(.ui-pane) :where(b, strong) { font-weight: 600; }
.ui-screen .ui-pane :focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
.ui-pane [hidden] { display: none !important; }
.ui-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ui-nb { white-space: nowrap; }

@container ui (min-width: 900px) {
  .ui-pane { --ui-g: 32px; }
}
@container ui (max-width: 599px) {
  .ui-pane { --ui-g: 20px; }
}
@container ui (max-width: 339px) {
  .ui-pane { --ui-g: 16px; }
  .ui-co::after { display: none; }      /* no room for the arrow beside the company's whole name */
}

/* what a screen shows at each width. Each of these only ever hides. */
@container ui (max-width: 599px) {
  .ui-not-phone { display: none !important; }
}
@container ui (min-width: 600px) {
  .ui-phone-only { display: none !important; }
}
@container ui (max-width: 1119px) {
  .ui-wide-only { display: none !important; }
}
@container ui (min-width: 1120px) {
  .ui-not-wide { display: none !important; }
}
@container ui (min-width: 600px) and (max-width: 1119px) {
  .ui-not-mid { display: none !important; }
}
@supports not (container-type: inline-size) {
  .ui-phone-only, .ui-wide-only, .ui-not-mid { display: none !important; }
}

/* ---------- on ink: the screen is the light ----------
   .ui-room is the ink section a lit screen stands in: it clips the light at the window's edges and ends it 90px
   before the section does, so light never stops on a line. .ui-light is the light itself, the first child of a lit
   screen. Refitted to the home page's: about 45/41/38 at the pane's edge (the home page's phone reads 50 there),
   28 at 100px and 20 at 240px, a pool on the floor under the pane, and next to nothing over it, so a heading over a pane stands on
   clean ink. No blur is wider than 110px. The home page's grain lies over it, so no faint gradient shows its steps. */

.ui-room { position: relative; overflow: hidden; overflow: clip; background: var(--ink); color: var(--on-ink); }
.ui-room::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 12, 16, 0) 0%, rgba(10, 12, 16, 0.064) 20%, rgba(10, 12, 16, 0.229) 40%, rgba(10, 12, 16, 0.466) 60%, rgba(10, 12, 16, 0.743) 80%, rgba(10, 12, 16, 0.883) 90%, #0a0c10 100%);
}

.ui-screen--lit > .ui-pane { border-color: transparent; }
.ui-light {
  position: absolute; z-index: -1; pointer-events: none;
  inset: -90px -460px -330px;               /* the pane stands 90px down and 460px in from the light's own box */
  background:
    /* the air beside it: one tall ellipse on each edge, brightest at the pane's middle, gone by its top corners */
    radial-gradient(460px 44% at 460px calc(90px + (100% - 420px) * 0.56), rgba(255, 204, 150, 0.085) 0%, rgba(255, 204, 150, 0.074) 18%, rgba(255, 204, 150, 0.056) 38%, rgba(255, 204, 150, 0.035) 58%, rgba(255, 204, 150, 0.015) 78%, rgba(255, 204, 150, 0) 100%),
    radial-gradient(460px 44% at calc(100% - 460px) calc(90px + (100% - 420px) * 0.56), rgba(255, 204, 150, 0.085) 0%, rgba(255, 204, 150, 0.074) 18%, rgba(255, 204, 150, 0.056) 38%, rgba(255, 204, 150, 0.035) 58%, rgba(255, 204, 150, 0.015) 78%, rgba(255, 204, 150, 0) 100%),
    /* the pool on the floor: two half ellipses hung from the pane's foot, as wide as the pane and no wider, so
       each starts at nothing at the pane's two ends. A bright core close in, and a long skirt */
    radial-gradient(50% 140px at 50% 0, rgba(255, 228, 188, 0.092) 0%, rgba(255, 228, 188, 0.076) 14%, rgba(255, 228, 188, 0.056) 28%, rgba(255, 228, 188, 0.037) 42%, rgba(255, 228, 188, 0.021) 56%, rgba(255, 228, 188, 0.01) 70%, rgba(255, 228, 188, 0.003) 85%, rgba(255, 228, 188, 0) 100%) 50% 100% / calc(100% - 960px) 330px no-repeat,
    radial-gradient(50% 300px at 50% 0, rgba(255, 199, 135, 0.042) 0%, rgba(255, 199, 135, 0.036) 18%, rgba(255, 199, 135, 0.027) 36%, rgba(255, 199, 135, 0.017) 54%, rgba(255, 199, 135, 0.008) 72%, rgba(255, 199, 135, 0.002) 88%, rgba(255, 199, 135, 0) 100%) 50% 100% / calc(100% - 920px) 330px no-repeat;
}
.ui-light::before, .ui-light::after { content: ""; position: absolute; }
/* the pane's own shape, cast down and out: most of it falls under the pane, little over it */
.ui-light::before {
  inset: 90px 460px 330px; border-radius: var(--ui-r);
  box-shadow:
    0 14px 36px rgba(255, 243, 198, 0.05),
    0 46px 110px rgba(255, 217, 177, 0.1);
}
.ui-light::after {
  inset: 0;
  background: var(--ui-grain) 0 0 / 64px 64px;
  -webkit-mask-image: radial-gradient(closest-side, #000 60%, rgba(0, 0, 0, 0) 100%);
          mask-image: radial-gradient(closest-side, #000 60%, rgba(0, 0, 0, 0) 100%);
}
@media (min-resolution: 1.5dppx) {
  .ui-light::after { background-size: 32px 32px; }      /* the grain stays one screen pixel fine */
}

/* A first screen may arrive once: the pane, then its light. Each piece fills backwards only, so with no script and
   under reduced motion it is simply there. */
@keyframes ui-appear { from { opacity: 0; } }
@keyframes ui-light { 0% { opacity: 0; } 5% { opacity: 0.311; } 10% { opacity: 0.457; } 20% { opacity: 0.65; } 30% { opacity: 0.777; } 45% { opacity: 0.897; } 60% { opacity: 0.961; } 80% { opacity: 0.995; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .ui-screen--arrive > .ui-pane, .ui-screen--arrive > .ui-phone { animation: ui-appear 0.8s ease-out 0.45s backwards; }
  .ui-screen--arrive > .ui-light { animation: ui-light 1.15s linear 0.7s backwards; }
}

/* ---------- small parts ---------- */

/* the mark, alone: never the lockup inside a pane. (Its drawing begins 2px inside its box.) */
.ui-mark { display: inline-block; flex: none; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--ui-i-mark) center / contain no-repeat; mask: var(--ui-i-mark) center / contain no-repeat; }

/* the kit's glyphs: each a control's own sign */
.ui-ico { display: inline-block; flex: none; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--ui-i) center / contain no-repeat; mask: var(--ui-i) center / contain no-repeat; }
.ui-ico--go { --ui-i: var(--ui-i-go); }
.ui-ico--back { --ui-i: var(--ui-i-back); }
.ui-ico--down { --ui-i: var(--ui-i-down); }
.ui-ico--to { --ui-i: var(--ui-i-to); }
.ui-ico--x { --ui-i: var(--ui-i-x); }
.ui-ico--check { --ui-i: var(--ui-i-check); }

/* people are round initials, one neutral for everyone */
.ui-avatar {
  display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px;
  border-radius: 50%; background: rgba(11, 13, 17, 0.08); color: var(--text);
  font-size: var(--ui-fs-time); font-weight: 600; letter-spacing: -0.02em; line-height: 1;
}
.ui-avatar--lg { width: 32px; height: 32px; }

/* the AI's face: the mark, paper white on an ink tile, square where people are round. One colourway everywhere */
.ui-face { position: relative; display: inline-block; flex: none; width: 28px; height: 28px; border-radius: 22.4%; background: var(--ink); vertical-align: middle; }
.ui-face::before { content: ""; position: absolute; inset: 14%; background: var(--on-ink); -webkit-mask: var(--ui-i-mark) center / contain no-repeat; mask: var(--ui-i-mark) center / contain no-repeat; }
.ui-face--xs { width: 20px; height: 20px; }
.ui-face--xs::before { -webkit-mask-image: var(--ui-i-mark-16); mask-image: var(--ui-i-mark-16); }
.ui-face--lg { width: 32px; height: 32px; }

/* "AI assistant", once where the AI is introduced. One style of label */
.ui-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border: 1px solid var(--rule-2); border-radius: 6px; font-size: var(--ui-fs-time); font-weight: 500; line-height: 1; letter-spacing: 0; color: var(--text-2); white-space: nowrap; }

/* a state: an ink word, and a small mark beside it. Never a coloured word */
.ui-state { font-weight: 500; color: var(--text); white-space: nowrap; }
.ui-state::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; vertical-align: 0.07em; }
.ui-state--wait::before { background: var(--ui-wait); }
.ui-state--live::before { background: var(--ui-ok); }
.ui-state--todo::before, .ui-state--half::before { width: 10px; height: 10px; margin-right: 7px; vertical-align: -0.01em; box-shadow: inset 0 0 0 1.5px var(--ui-idle); }
.ui-state--half::before { background: linear-gradient(90deg, var(--ui-idle) 50%, rgba(0, 0, 0, 0) 50%); }
.ui-state--done::before, .ui-state--no::before { width: 14px; height: 14px; margin-right: 5px; border-radius: 0; vertical-align: -0.13em; background: var(--ui-ok); -webkit-mask: var(--ui-i-check) center / contain no-repeat; mask: var(--ui-i-check) center / contain no-repeat; }
.ui-state--no::before { background: var(--ui-idle); -webkit-mask-image: var(--ui-i-x); mask-image: var(--ui-i-x); }

.ui-time { font-size: var(--ui-fs-time); font-weight: 400; color: var(--text-2); white-space: nowrap; }
.ui-n { margin-left: 8px; font-weight: 450; color: var(--text-2); }
.ui-math { word-spacing: 0.06em; white-space: nowrap; }
.ui-note { font-size: var(--ui-fs-note); line-height: var(--ui-lh-note); color: var(--text-2); text-wrap: pretty; }

/* a source: at least 30px tall. One you can play carries the triangle; the one open in the panel is edged in ink */
.ui-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--rule-2); border-radius: 8px; font-size: var(--ui-fs-note); font-weight: 500; line-height: 1; white-space: nowrap; color: var(--text); }
.ui-chip--play::before { content: ""; width: 10px; height: 10px; margin-left: -1px; background: currentColor; -webkit-mask: var(--ui-i-play) center / contain no-repeat; mask: var(--ui-i-play) center / contain no-repeat; }
/* (edged in ink only where the panel is there to show it open: from 1120) */

/* a play control, drawn as a control: an outlined circle with the triangle */
.ui-play { position: relative; display: inline-block; flex: none; width: 26px; height: 26px; border: 1.5px solid var(--text); border-radius: 50%; vertical-align: middle; }
.ui-play::before { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -5px; background: var(--text); -webkit-mask: var(--ui-i-play) center / contain no-repeat; mask: var(--ui-i-play) center / contain no-repeat; }

/* buttons: the app's own. Approve is always the ink one */
.ui-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; margin: 0;
  border: 1px solid var(--rule-2); border-radius: 8px; background: transparent; color: var(--text);
  font: 500 var(--ui-fs-note) / 1 var(--font); letter-spacing: -0.006em; white-space: nowrap;
  -webkit-appearance: none; appearance: none;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
button.ui-btn { cursor: pointer; }
button.ui-btn:hover { border-color: rgba(11, 13, 17, 0.55); }
button.ui-btn:active { transform: translateY(1px); }
.ui-btn--main { background: var(--text); border-color: var(--text); color: #fff; }
button.ui-btn--main:hover { background: #272c35; border-color: #272c35; }
.ui-btn--sm { height: 34px; padding: 0 12px; }
.ui-btn--lg { height: 48px; border-radius: 12px; font-size: var(--ui-fs); }
.ui-btn--play::before { content: ""; width: 10px; height: 10px; background: currentColor; -webkit-mask: var(--ui-i-play) center / contain no-repeat; mask: var(--ui-i-play) center / contain no-repeat; }
@media (prefers-reduced-motion: reduce) {
  .ui-btn { transition: none; }
}

/* ---------- the bar: the pane's one piece of chrome ----------
   The mark, the page's name (or the page tabs), the company, the signed-in person's initials. */

.ui-bar {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-rows: 52px; align-items: center;
  flex: none; padding: 0 var(--ui-g); border-bottom: 1px solid var(--rule); white-space: nowrap;
}
.ui-bar > .ui-mark { grid-area: 1 / 1; margin: 0 10px 0 -2px; }
.ui-bar__title { grid-area: 1 / 2; display: flex; align-items: center; font-weight: 600; letter-spacing: -0.012em; }
.ui-bar__title .ui-ico { margin: 0 2px 0 -5px; }
.ui-bar__end { grid-area: 1 / 4; display: flex; align-items: center; gap: 14px; min-width: 0; }
.ui-co { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-size: var(--ui-fs-note); color: var(--text-2); }
.ui-co::after { content: ""; flex: none; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--ui-i-down) center / contain no-repeat; mask: var(--ui-i-down) center / contain no-repeat; }
.ui-bar .ui-avatar { width: 32px; height: 32px; }

/* The page tabs. Each is a real control, 44px or more each way, the open one underlined on the bar's hairline.
   They stand in the bar only where they fit (from 1000 wide, 24px or more clear of the company); under that the
   bar names the open page and the tabs take a row of their own. As the phone app, the tab row at the foot takes over. */
.ui-tabs {
  grid-area: 2 / 1 / 3 / -1; display: flex; height: 45px;
  margin: 0 calc(-1 * var(--ui-g)); padding: 0 calc(var(--ui-g) - 12px);
  border-top: 1px solid var(--rule);
}
.ui-tab {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: 0 12px;
  font-size: var(--ui-fs-note); font-weight: 500; color: var(--text-2);
  transition: color 0.2s var(--ease);
}
a.ui-tab:hover { color: var(--text); }
.ui-screen .ui-pane .ui-tab:focus-visible { outline-offset: -4px; border-radius: 8px; }
.ui-tab[aria-current], .ui-tab.is-current { color: var(--text); }
.ui-tab[aria-current]::after, .ui-tab.is-current::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--text); }
.ui-tab__n { margin-left: 6px; font-weight: 450; }
@container ui (min-width: 1000px) {
  .ui-tabs { grid-area: 1 / 3; height: 52px; margin: 0 0 0 10px; padding: 0; border-top: 0; }
  .ui-bar--tabs .ui-bar__title { display: none; }
}

/* the phone app's tab row: Home, Ask, Approvals with its count, More. The pane's own paper and hairlines */
.ui-tabbar { display: none; }

/* ---------- inside a page: columns, sections, rows ---------- */

.ui-view { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }

/* two columns with a hairline between (Home, Connections) */
.ui-cols { display: grid; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr) minmax(264px, 36%); }
.ui-cols--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ui-cols > * { min-width: 0; padding: 24px var(--ui-g) 20px; }
.ui-cols > * + * { border-left: 1px solid var(--rule); }
@container ui (min-width: 1120px) {
  .ui-cols { grid-template-columns: minmax(0, 1fr) 416px; }
  .ui-cols--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* a list and the thing open beside it (Approvals, Systems, Time away). The list is never under 244px: its head
   ("Your plan 8", "All in design") then keeps to one line at every desk width, also in the 664px column a screen
   has beside a page's words */
.ui-split { display: grid; flex: 1 1 auto; grid-template-columns: minmax(244px, 36%) minmax(0, 1fr); }
.ui-split > * { min-width: 0; padding: 24px var(--ui-g) 20px; }
.ui-split > * + * { border-left: 1px solid var(--rule); }
@container ui (min-width: 1120px) {
  .ui-split { grid-template-columns: 424px minmax(0, 1fr); }
}

.ui-sec + .ui-sec { margin-top: 34px; }
.ui-sec__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; min-height: 34px; padding-bottom: 11px; border-bottom: 1px solid var(--rule-2); }
.ui-sec__title { font-weight: 600; letter-spacing: -0.012em; white-space: nowrap; }
.ui-sec__title .ui-state { font-weight: inherit; }
.ui-sec__meta { font-size: var(--ui-fs-note); line-height: var(--ui-lh-note); color: var(--text-2); white-space: nowrap; }
.ui-sec__meta .ui-state { font-weight: 400; color: inherit; }
.ui-sec__foot { margin-top: 12px; }

/* a list row: a title, one note under it, and where it leads. 68px, so two columns of rows share their hairlines */
.ui-row { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.ui-rows > .ui-row:last-child { border-bottom: 0; }
.ui-row__body { display: grid; flex: 1 1 0; min-width: 0; }
.ui-row__title { font-weight: 560; letter-spacing: -0.01em; text-wrap: pretty; }
.ui-row__title .ui-face { margin: -3px 8px 0 0; }
.ui-row__meta { font-size: var(--ui-fs-note); line-height: var(--ui-lh-note); color: var(--text-2); text-wrap: pretty; }
.ui-row__meta .ui-state { margin-right: 6px; }
.ui-row__name { flex: 1 1 0; min-width: 0; }
.ui-row__side { font-size: var(--ui-fs-note); line-height: var(--ui-lh-note); color: var(--text-2); white-space: nowrap; }
.ui-row__side .ui-state { font-weight: 400; color: inherit; }
.ui-row__text { text-wrap: pretty; }
.ui-row > .ui-ico { color: var(--text-2); }
.ui-rows--tight > .ui-row { flex-wrap: wrap; gap: 0 12px; min-height: 34px; padding: 5px 0; }
.ui-rows--tight .ui-row__name { flex: 1 0 auto; max-width: 100%; }
/* a list to pick from: no hairlines, the open row filled */
.ui-rows--pick { display: grid; gap: 2px; margin: 6px -10px 0; }
.ui-rows--pick > .ui-row { min-height: 60px; padding: 8px 8px 8px 10px; border-bottom: 0; border-radius: 8px; }
.ui-rows--pick.ui-rows--tight > .ui-row { min-height: 40px; padding: 8px 8px 8px 10px; }
.ui-rows--pick > .ui-row.is-open { background: var(--ui-fill); }
.ui-rows--pick > .ui-row.is-open > .ui-ico { color: var(--text); }

.ui-more { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: var(--ui-fs-note); font-weight: 500; }

/* a name and its value, between hairlines. 44px a row */
.ui-facts { border-top: 1px solid var(--rule-2); }
.ui-sec__head + .ui-facts, .ui-lead + .ui-facts { border-top: 0; }
.ui-facts dt .ui-state { margin-left: 10px; font-size: inherit; }
.ui-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; min-height: 44px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.ui-facts dt { font-size: var(--ui-fs-note); color: var(--text-2); text-wrap: pretty; }
.ui-facts dd { font-weight: 560; letter-spacing: -0.01em; text-align: right; }
/* keyed: the name in a column of its own, the value beside it. A source chip always sits under its words */
.ui-facts--keyed > div { display: grid; grid-template-columns: 144px minmax(0, 1fr); justify-content: normal; }
.ui-facts--keyed dd { display: grid; gap: 8px; justify-items: start; text-align: left; }
.ui-facts__said { font-weight: 400; letter-spacing: -0.006em; }
@container ui (min-width: 900px) {
  .ui-facts--keyed > div { grid-template-columns: 200px minmax(0, 1fr); }
}

/* a table: grey heads over a firmer line, figures at the right, the total under an ink rule */
.ui-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--ui-fs); line-height: var(--ui-lh); }
.ui-table th { height: 34px; padding: 0 0 11px 16px; border-bottom: 1px solid var(--rule-2); font-size: var(--ui-fs-note); font-weight: 400; color: var(--text-2); text-align: left; vertical-align: baseline; white-space: nowrap; }
.ui-table td { height: 44px; padding: 0 0 0 16px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.ui-table th:first-child, .ui-table td:first-child { padding-left: 0; }
.ui-table .is-num { text-align: right; white-space: nowrap; }
.ui-table .ui-table__title { font-size: var(--ui-fs); font-weight: 600; letter-spacing: -0.012em; color: var(--text); }
.ui-table b { font-weight: 600; }
.ui-table tfoot td { border-bottom: 0; border-top: 1px solid var(--text); font-weight: 600; }
.ui-table tbody tr:last-child td { border-bottom: 0; }
.ui-table--end tbody tr:last-child td { border-bottom: 1px solid var(--rule); }

/* what happened and when: the time in a column, the sentence beside it */
.ui-log > li { display: grid; grid-template-columns: 92px minmax(0, 1fr); column-gap: 16px; align-items: baseline; min-height: 44px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.ui-log > li:last-child { border-bottom: 0; }
.ui-log > li > :last-child { text-wrap: pretty; }
.ui-log .ui-math, .ui-feed .ui-math { margin-left: 6px; font-size: var(--ui-fs-note); color: var(--text-2); }
.ui-log .ui-state { margin-left: 6px; font-size: var(--ui-fs-note); }
/* numbered steps: the same rows, the number where the time was */
.ui-log--steps > li { grid-template-columns: 24px minmax(0, 1fr); column-gap: 8px; }

/* ---------- Home: the lead figure, then what ran ---------- */

/* the lead figure: the home page's light numeral. A screen has one */
.ui-lead { min-height: 102px; padding-bottom: 15px; border-bottom: 1px solid var(--rule-2); }
.ui-lead__label { font-weight: 600; letter-spacing: -0.012em; }
.ui-open__head + .ui-lead, .ui-title + .ui-lead { margin-top: 20px; }
.ui-lead__line { display: flex; align-items: flex-end; align-items: last baseline; justify-content: space-between; gap: 12px 24px; height: 52px; margin-top: 12px; }
.ui-figure { display: inline-flex; align-items: flex-end; align-items: last baseline; gap: 12px; }
.ui-figure__n { font-size: 64px; font-weight: 320; line-height: 0.8125; letter-spacing: -0.045em; margin-left: -0.04em; white-space: nowrap; }
.ui-figure__unit { font-weight: 500; letter-spacing: -0.01em; }
.ui-figure__unit small { display: block; font-size: var(--ui-fs-note); font-weight: 400; letter-spacing: -0.006em; color: var(--text-2); }
/* the figures are tabular, and a 1 stands in a wide cell: wrap the 1 in this and the gap closes */
.ui-k1 { margin: 0 -0.055em 0 -0.075em; }
.ui-k1:first-child { margin-left: -0.09em; }
/* a second, quieter fact beside the lead figure */
.ui-aside { display: grid; justify-items: end; text-align: right; }
.ui-aside b { font-weight: 560; letter-spacing: -0.01em; }
.ui-aside span { font-size: var(--ui-fs-note); line-height: var(--ui-lh-note); color: var(--text-2); }

/* the feed: which system, when, what it did. Narrow: the system and the time on one line, the sentence under them */
.ui-feed > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; row-gap: 2px; align-items: baseline; min-height: 68px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.ui-feed__k { grid-area: 1 / 1; font-weight: 560; letter-spacing: -0.01em; }
.ui-feed__k .ui-face { margin: -3px 8px 0 0; }
.ui-feed__t { grid-area: 1 / 2; }
.ui-feed__v { grid-area: 2 / 1 / 3 / 3; text-wrap: pretty; }
.ui-feed__m { display: block; font-size: var(--ui-fs-note); line-height: var(--ui-lh-note); color: var(--text-2); }
.ui-feed__m .ui-math { margin: 0 10px 0 0; }
@container ui (min-width: 900px) {
  .ui-feed > li { grid-template-columns: 176px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 20px; row-gap: 0; }
  .ui-feed__t { grid-area: 2 / 1; line-height: var(--ui-lh-note); }
  .ui-feed__v { grid-area: 1 / 2 / 3 / 3; }
}

/* ---------- an open thing: a request, a system, a document ---------- */

.ui-open__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; }
.ui-title { font-size: 24px; line-height: 28px; font-weight: 580; letter-spacing: -0.024em; }
.ui-open__head > .ui-state, .ui-open__head > .ui-note { font-size: var(--ui-fs-note); }
.ui-statusline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; margin-top: 6px; font-size: var(--ui-fs-note); line-height: var(--ui-lh-note); color: var(--text-2); }
.ui-by { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; font-size: var(--ui-fs-note); line-height: var(--ui-lh-note); color: var(--text-2); }
.ui-by .ui-face { margin-top: 0.5px; }
.ui-sub { margin-top: 14px; max-width: 36em; text-wrap: pretty; }
.ui-open .ui-thread { margin-top: 20px; }
.ui-open .ui-facts { margin-top: 20px; }
.ui-open .ui-sec { margin-top: 24px; }
.ui-open > .ui-note { margin-top: 12px; }
.ui-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 8px; margin-top: 20px; }
.ui-actions .ui-btn--main { min-width: 152px; }
.ui-actions .ui-note { margin-left: 4px; }

/* the answer that takes the buttons' place (kit.js): the buttons keep their room */
.ui-do { display: grid; align-items: center; }
.ui-do > * { grid-area: 1 / 1; }
.ui-answer { display: inline-flex; align-items: center; justify-self: center; font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.ui-answer:focus, .ui-screen .ui-pane .ui-answer:focus-visible { outline: none; }      /* it takes the focus the pressed button had; it is not a control */
.is-answered .ui-do > .ui-actions { visibility: hidden; }

/* ---------- the conversation ----------
   You are the ink bubble on the right. Another person is round initials, a name and a role, and a quiet grey bubble.
   The AI's face is the mark, its bubble is the one warm colour, and its answer ends with its sources.
   Every bubble hugs its words. */

.ui-thread { display: grid; gap: 12px; align-content: start; }
.ui-msg { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; row-gap: 4px; align-items: start; }
.ui-msg > .ui-face, .ui-msg > .ui-avatar { grid-area: 1 / 1; }
.ui-msg > .ui-face:first-child, .ui-msg > .ui-avatar:first-child { margin-top: 6px; }      /* no name line: the face stands on the bubble's first line */
.ui-msg__who { grid-area: 1 / 2; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; min-height: 28px; font-size: var(--ui-fs-note); line-height: var(--ui-lh-note); color: var(--text-2); }
.ui-msg__who b { font-size: var(--ui-fs); font-weight: 600; letter-spacing: -0.012em; color: var(--text); }
.ui-bubble { grid-column: 2; justify-self: start; max-width: min(100%, 560px); padding: 9px 14px; border-radius: 4px 16px 16px 16px; background: var(--ui-fill); text-wrap: pretty; }
.ui-bubble b { font-weight: 620; }
.ui-msg--ai > .ui-bubble { background: var(--ui-ai); }
/* yours: the time it was sent, then the bubble */
.ui-msg--me { grid-template-columns: minmax(0, 1fr) fit-content(calc(100% - 76px)); align-items: center; }
.ui-msg--me > .ui-time { grid-area: auto / 1; justify-self: end; }
.ui-msg--me > .ui-msg__who { grid-area: auto / 1 / auto / -1; justify-content: flex-end; }
.ui-msg--me > .ui-avatar { grid-area: auto; }
.ui-msg--me > .ui-bubble { grid-column: 2; justify-self: end; border-radius: 16px 4px 16px 16px; background: var(--text); color: #fff; }
/* an exchange closes up: the answer sits nearer its question than the next question does */
.ui-msg--me + .ui-msg--ai { margin-top: -4px; }
.ui-msg--ai + .ui-msg--me { margin-top: 4px; }

/* someone's own words inside an answer, with the place to play them: a rule down the side, not a box */
.ui-quote { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--rule-2); }
.ui-quote__src { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: var(--ui-fs-note); line-height: var(--ui-lh-note); color: var(--text-2); }
.ui-quote__src b { font-weight: 600; color: var(--text); }
.ui-quote__text { margin-top: 6px; }
/* the words an answer rests on. On the sheet they are marked in the one warm colour; inside the warm bubble, in weight */
.ui-pane mark { padding: 0.08em 0.1em; margin: 0 -0.1em; border-radius: 3px; background: var(--ui-ai); color: inherit; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.ui-bubble mark { padding: 0; margin: 0; background: none; font-weight: 620; }
.ui-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; }
.ui-sources__label { margin-right: 2px; font-size: var(--ui-fs-note); color: var(--text-2); }

/* a change the AI proposes: two lines between hairlines, not a card */
.ui-proposal { margin-top: 10px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.ui-proposal > * { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 16px; padding: 5px 0 4px; }
.ui-proposal > * + * { padding: 0 0 6px; }
.ui-proposal__head { font-size: var(--ui-fs-note); line-height: var(--ui-lh-note); color: var(--text-2); }
.ui-proposal__to { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ui-proposal__to s { color: var(--text-2); }

/* the box to type in */
.ui-composer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; height: 48px; padding: 0 5px 0 16px; border: 1px solid var(--rule-2); border-radius: 12px; }
.ui-composer__ph { color: var(--text-2); white-space: nowrap; overflow: hidden; }
.ui-composer__send { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 9px; background: var(--text); color: #fff; }
.ui-composer__send::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--ui-i-up) center / contain no-repeat; mask: var(--ui-i-up) center / contain no-repeat; }

/* ---------- Ask: who you are talking to, the conversation, the box, and from 1120 the open sources beside it ---------- */

.ui-ask { display: grid; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr); }
.ui-ask__talk { display: flex; flex-direction: column; min-width: 0; }
.ui-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; flex: none; min-height: 49px; padding: 8px var(--ui-g); border-bottom: 1px solid var(--rule); }
.ui-contact__name { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.ui-contact__name b { font-weight: 600; letter-spacing: -0.012em; }
.ui-contact__sub { margin-left: 4px; font-size: var(--ui-fs-note); line-height: var(--ui-lh-note); color: var(--text-2); }
.ui-ask .ui-thread { flex: 1 1 auto; align-content: end; padding: 12px var(--ui-g) 0; }
.ui-ask .ui-composer { margin: 12px var(--ui-g) 12px; }

.ui-panel { min-width: 0; border-left: 1px solid var(--rule); }
.ui-panel__head { display: flex; align-items: center; justify-content: space-between; height: 49px; padding: 0 24px; border-bottom: 1px solid var(--rule); font-weight: 600; letter-spacing: -0.012em; }
.ui-panel__head .ui-ico { color: var(--text-2); }
.ui-source { padding: 16px 24px 18px; }
.ui-source + .ui-source { border-top: 1px solid var(--rule); }
.ui-source__head { display: flex; align-items: center; gap: 10px; }
.ui-source__id { display: grid; }
.ui-source__id b { font-weight: 600; letter-spacing: -0.012em; }
.ui-source__id span { font-size: var(--ui-fs-note); line-height: var(--ui-lh-note); color: var(--text-2); }
.ui-source__quote { margin-top: 12px; text-wrap: pretty; }
.ui-source .ui-btn { margin-top: 12px; }
.ui-source .ui-table { margin-top: 10px; }
.ui-source .ui-table th { height: 30px; padding-bottom: 8px; }
.ui-source .ui-table td { height: 36px; }
.ui-source__math { margin-top: 6px; text-align: right; font-size: var(--ui-fs-note); color: var(--text-2); }
@container ui (min-width: 1120px) {
  .ui-ask { grid-template-columns: minmax(0, 1fr) 344px; }
  .ui-chip.is-open { border-color: var(--text); box-shadow: inset 0 0 0 0.5px var(--text); }
}

/* ---------- Connections: what is still needed, across the foot ---------- */

.ui-need { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; flex: none; padding: 14px var(--ui-g) 15px; border-top: 1px solid var(--rule); }
.ui-need > .ui-state { font-size: var(--ui-fs-note); }
.ui-need__body { display: grid; flex: 1 1 224px; min-width: 0; }

/* ---------- Proof: the lead figure beside the weeks, then two ledgers ---------- */

.ui-proof { display: grid; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 48px; row-gap: 28px; align-content: start; padding: 24px var(--ui-g) 24px; }
.ui-proof__top { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 20px; align-items: start; }
.ui-proof > .ui-sec { margin-top: 0; }
@container ui (min-width: 640px) {
  .ui-proof__top { grid-template-columns: 192px minmax(0, 1fr); column-gap: 28px; }
}
@container ui (min-width: 900px) {
  .ui-proof__top { grid-template-columns: 272px minmax(0, 1fr); column-gap: 40px; }
}
.ui-proof .ui-lead { min-height: 0; padding-bottom: 0; border-bottom: 0; }
.ui-proof .ui-lead__line { margin-top: 16px; }
.ui-proof .ui-lead .ui-note { margin-top: 10px; }
.ui-proof .ui-facts dd { font-weight: 560; }

/* the weekly bars: ink on hairlines. Every week in quiet ink, this week in full ink with its value over it.
   The picture is one svg in per cent units (never stretched), so its words keep their size. */
.ui-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 8px; font-size: var(--ui-fs-time); line-height: 1.3; color: var(--text-2); }
.ui-chart__top { grid-column: 2; justify-self: end; }
.ui-chart__y { grid-area: 2 / 1; display: flex; flex-direction: column; justify-content: space-between; margin: -0.65em 0; text-align: right; }
.ui-chart__plot { grid-area: 2 / 2; position: relative; height: 150px; }
.ui-chart__plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ui-chart__plot line { stroke: var(--rule); stroke-width: 1; shape-rendering: crispEdges; }
.ui-chart__plot .ui-chart__base { stroke: var(--rule-2); }
.ui-chart__plot .ui-chart__from { stroke: var(--text-2); stroke-dasharray: 1 3; }
.ui-chart__plot rect { fill: rgba(11, 13, 17, 0.26); shape-rendering: crispEdges; }
.ui-chart__plot .ui-chart__now { fill: var(--text); }
.ui-chart__plot text { fill: var(--text); font-size: var(--ui-fs-note); font-weight: 600; letter-spacing: -0.01em; text-anchor: middle; }
.ui-chart__x { grid-area: 3 / 2; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); white-space: nowrap; }
.ui-chart__x > li { display: flex; justify-content: center; min-width: 0; }
/* too narrow for ten dates: every third one, each still under its own week */
@container ui (max-width: 759px) {
  .ui-chart__x > .ui-chart__fine { visibility: hidden; }
}

/* ---------- a document's contents: number, chapter, page ---------- */

.ui-toc > li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; min-height: 40px; border-bottom: 1px solid var(--rule); }
.ui-toc > li > :first-child, .ui-toc > li > :last-child { font-size: var(--ui-fs-time); color: var(--text-2); }

/* ---------- the tour: one pane, seven pages, one height for each layout ----------
   So opening another page inside the same pane never moves the page under it. */

.ui-screen--tour > .ui-pane { min-height: 760px; }      /* 600 to 899 wide */
@container ui (min-width: 900px) {
  .ui-screen--tour > .ui-pane { min-height: 720px; }
}

/* ---------- the phone app: a pane under 600 wide ----------
   A bar that keeps the company's name and the person's initials, one column, the short lists, and the tab row
   at the foot. Text stays 16px. */

@container ui (max-width: 599px) {
  .ui-bar { grid-template-columns: minmax(0, 1fr); grid-template-rows: 48px; }
  .ui-bar > .ui-mark, .ui-bar__title, .ui-tabs { display: none; }
  .ui-bar__end { grid-area: 1 / 1; justify-content: space-between; }
  .ui-co { font-size: var(--ui-fs); font-weight: 600; letter-spacing: -0.012em; color: var(--text); }
  /* a page opened from a list: the way back, and the company */
  .ui-bar--back, .ui-bar--brand { grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; padding-inline: 16px; }
  .ui-bar--back .ui-bar__title, .ui-bar--brand .ui-bar__title { grid-area: 1 / 1; display: flex; }
  .ui-bar--back .ui-bar__end, .ui-bar--brand .ui-bar__end { grid-area: 1 / 2; justify-content: flex-end; }
  /* a page that is not the signed-in app (a task page from an email): the mark and the name, and what the page is */
  .ui-bar--brand { grid-template-columns: auto auto minmax(0, 1fr); column-gap: 0; }
  .ui-bar--brand > .ui-mark { display: inline-block; grid-area: 1 / 1; margin-right: 8px; }
  .ui-bar--brand .ui-bar__title { grid-area: 1 / 2; }
  .ui-bar--brand .ui-bar__end { grid-area: 1 / 3; }
  .ui-bar--back .ui-co, .ui-bar--brand .ui-co { display: block; overflow: hidden; text-overflow: ellipsis; font-size: var(--ui-fs-time); font-weight: 400; letter-spacing: 0; color: var(--text-2); }
  .ui-bar--back .ui-co::after, .ui-bar--back .ui-avatar, .ui-bar--brand .ui-co::after, .ui-bar--brand .ui-avatar { display: none; }

  .ui-tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); flex: none; height: 52px; margin-top: auto; border-top: 1px solid var(--rule); white-space: nowrap; }
  .ui-tabbar__tab { position: relative; display: flex; align-items: center; justify-content: center; font-size: var(--ui-fs-note); font-weight: 500; color: var(--text-2); }
  .ui-tabbar__tab[aria-current], .ui-tabbar__tab.is-current { font-weight: 600; color: var(--text); }
  .ui-tabbar__tab[aria-current]::before, .ui-tabbar__tab.is-current::before { content: ""; position: absolute; left: 50%; top: -1px; width: 44px; height: 2px; margin-left: -22px; background: var(--text); }
  .ui-screen .ui-pane .ui-tabbar__tab:focus-visible { outline-offset: -4px; border-radius: 8px; }

  .ui-cols, .ui-cols--even, .ui-split { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .ui-cols > *, .ui-split > * { padding: 18px var(--ui-g) 0; }
  .ui-cols > * + *, .ui-split > * + * { border-left: 0; padding-top: 24px; }
  .ui-cols > :last-child, .ui-split > :last-child { padding-bottom: 8px; }
  .ui-sec + .ui-sec { margin-top: 24px; }

  .ui-lead { min-height: 0; }
  .ui-rows:not(.ui-rows--pick):not(.ui-rows--tight) > .ui-row { min-height: 46px; }
  .ui-rows--pick > .ui-row.is-open { background: none; }
  .ui-rows--pick > .ui-row.is-open > .ui-ico { color: var(--text-2); }
  .ui-lead__line { flex-direction: column; align-items: flex-start; gap: 14px; height: auto; }
  .ui-aside { justify-items: start; text-align: left; }
  .ui-feed > li:last-child { border-bottom: 0; }

  .ui-facts--keyed > div { grid-template-columns: 104px minmax(0, 1fr); column-gap: 12px; }
  .ui-title { font-size: 22px; line-height: 26px; }

  /* a request's page: the body, then its buttons held at the foot. Approve first and the widest */
  .ui-open { display: flex; flex: 1 1 auto; flex-direction: column; padding: 16px var(--ui-g) 0; }
  .ui-statusline { gap: 0 10px; margin-top: 2px; font-size: var(--ui-fs-time); }
  .ui-open .ui-thread { gap: 10px; margin-top: 12px; }
  .ui-open .ui-msg { row-gap: 2px; }
  .ui-open .ui-bubble { padding: 8px 12px; }
  .ui-open .ui-facts { margin-top: 12px; }
  .ui-open .ui-facts > div { min-height: 40px; padding: 8px 0; }
  .ui-open .ui-log { margin-top: 10px; }
  .ui-open .ui-sub { margin-top: 12px; }
  .ui-do { flex: none; margin-top: auto; padding: 10px 0 8px; }
  .ui-do .ui-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 0; }
  .ui-do .ui-actions .ui-btn { height: 44px; padding: 0 8px; }
  .ui-do .ui-actions .ui-btn--main { grid-column: 1 / -1; height: 48px; min-width: 0; border-radius: 12px; font-size: var(--ui-fs); }

  .ui-sources { gap: 6px; }
  .ui-sources__label, .ui-chip { font-size: var(--ui-fs-time); }
  .ui-chip { padding: 0 8px; }
  .ui-more { min-height: 36px; }
  .ui-ask .ui-thread { padding-top: 14px; }
  .ui-ask .ui-composer { margin: 12px var(--ui-g) 14px; }
  /* a bubble takes the full measure: the AI's face stands in its name line, or over the conversation */
  .ui-msg > .ui-bubble { grid-column: 1 / -1; }
  .ui-msg > .ui-face:first-child { display: none; }
  .ui-msg--me { grid-template-columns: minmax(0, 1fr) fit-content(calc(100% - 68px)); }
  .ui-msg--me > .ui-bubble { grid-column: 2; }

  .ui-need { gap: 8px 28px; padding: 12px var(--ui-g) 14px; margin-top: 4px; }
  .ui-need .ui-btn { flex: 1 1 100%; height: 44px; border-radius: 12px; font-size: var(--ui-fs); }

  .ui-proof { grid-template-columns: minmax(0, 1fr); row-gap: 20px; padding: 20px var(--ui-g) 16px; }
  .ui-proof__top { grid-template-columns: minmax(0, 1fr); row-gap: 16px; }
  .ui-chart__plot { height: 120px; }

  .ui-screen--tour > .ui-pane { min-height: 780px; }
}

/* a browser without container queries on a small window: one column, so the desk layout is still usable */
@supports not (container-type: inline-size) {
  @media (max-width: 640px) {
    .ui-cols, .ui-cols--even, .ui-split, .ui-proof, .ui-proof__top { grid-template-columns: minmax(0, 1fr); }
    .ui-cols > * + *, .ui-split > * + * { border-left: 0; }
  }
}

/* ---------- the phone, where the device is the point ----------
   The home page's own CSS phone: 330 by 683 at a desk, following the window's height on short laptops as the
   home page's does. Its screen holds a pane, so everything inside is the phone app. On ink it is lit by the home
   page's light; on paper it sits flat. On a reader's own phone no phone is drawn: the screen is a pane. */

.ui-screen--phone {
  --ui-vh: 100vh;
  --ui-pw: clamp(292px, max(min(330px, calc(330px - (900px - var(--ui-vh)) * 0.2043)), min(calc((var(--ui-vh) - 290px) / 2.07), max(30vw, 330px))), 384px);
  width: var(--ui-pw); max-width: 100%;
  container-type: normal;
}
@supports (height: 100svh) {
  .ui-screen--phone { --ui-vh: 100svh; }
}
.ui-phone {
  position: relative; box-sizing: border-box;
  aspect-ratio: 1 / 2.07; padding: 0.56em;
  border-radius: 3.45em; background: #030406;
  font-size: calc(var(--ui-pw) / 22.5);     /* 1em is 16px on a 360px phone */
  line-height: 1;
}
/* the metal band */
.ui-phone::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 0.15em; pointer-events: none;
  background: linear-gradient(192deg, #6a717c 0%, #2a2e35 7%, #15171b 26%, #0c0d10 60%, #1d1b18 84%, #4a4035 95%, #85715a 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* its three keys */
.ui-phone::after {
  content: ""; position: absolute; z-index: -1; inset: 0 -0.14em; pointer-events: none;
  background:
    linear-gradient(180deg, #3d424a, #16181c 30%, #101114 70%, #24272c) 0 22.49% / 0.17em 4.4% no-repeat,
    linear-gradient(180deg, #3d424a, #16181c 30%, #101114 70%, #24272c) 0 30.72% / 0.17em 8.2% no-repeat,
    linear-gradient(180deg, #3d424a, #16181c 30%, #101114 70%, #24272c) 100% 35.31% / 0.17em 12.2% no-repeat;
}
.ui-phone__screen {
  position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden;
  border-radius: 2.9em; background: var(--ui-paper);
  container: ui / size;
}
.ui-phone__screen > .ui-pane { flex: 1 1 auto; min-height: 0; border: 0; border-radius: 0; background: none; padding-bottom: 1.1em; }
/* the clock, the camera and the signal, and the bar at the foot */
.ui-phone__status { position: relative; flex: none; height: 3.05em; color: var(--text); font-family: var(--font); }
.ui-phone__status::before { content: ""; position: absolute; top: 0.72em; left: 50%; width: 0.74em; height: 0.74em; margin-left: -0.37em; border-radius: 50%; background: #0a0c10; }
.ui-phone__status::after { content: ""; position: absolute; top: 0.78em; right: 1.5em; width: 3.5em; height: 0.79em; background: var(--ui-i-status) center / contain no-repeat; }
.ui-phone__status > span { position: absolute; left: 1.8em; top: 0.66em; font-size: max(14px, 1.02em); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ui-phone__screen::after { content: ""; position: absolute; left: 32%; right: 32%; bottom: 0.5em; height: 5px; border-radius: 3px; background: var(--text); }
/* a short phone (a short laptop window): the request keeps its buttons and gives up its two facts */
@container ui (max-height: 659px) {
  .ui-short-out { display: none !important; }
}

/* the home page's light, from the whole screen: the air in em of the phone, the pool hung from its foot */
@media (min-width: 600px) {
  .ui-screen--phone > .ui-light {
    font-size: calc(var(--ui-pw) / 22.5);
    inset: -14em -90em -20.5em;
    background:
      /* the air: one ellipse round the phone */
      radial-gradient(42em 33em at 50% calc(14em + (100% - 34.5em) * 0.54), rgba(255, 204, 150, 0.112) 0%, rgba(255, 204, 150, 0.112) 26%, rgba(255, 204, 150, 0.09) 38%, rgba(255, 204, 150, 0.06) 52%, rgba(255, 204, 150, 0.032) 68%, rgba(255, 204, 150, 0.011) 84%, rgba(255, 204, 150, 0) 100%),
      /* the home page's pool: a core and a skirt hung from the phone's foot. Each starts at nothing: a ramp of the
         room's own ink lies over its first stretch (the home page does this with a mask) */
      linear-gradient(180deg, #0a0c10 0, rgba(10, 12, 16, 0.719) 0.73em, rgba(10, 12, 16, 0.39) 1.46em, rgba(10, 12, 16, 0.168) 2.18em, rgba(10, 12, 16, 0) 2.91em) 50% 100% / 77.93em 20.5em no-repeat,
      radial-gradient(38.96em 21.86em at 50% 0.4em, rgba(255, 228, 188, 0.2502) 0%, rgba(255, 228, 188, 0.1805) 12%, rgba(255, 228, 188, 0.1262) 24%, rgba(255, 228, 188, 0.079) 36%, rgba(255, 228, 188, 0.0438) 50%, rgba(255, 228, 188, 0.0198) 66%, rgba(255, 228, 188, 0.0057) 82%, rgba(255, 228, 188, 0) 100%) 50% 100% / 77.93em 20.5em no-repeat,
      linear-gradient(180deg, #0a0c10 0, rgba(10, 12, 16, 0.962) 2.29em, rgba(10, 12, 16, 0.234) 4.58em, rgba(10, 12, 16, 0.04) 6.87em, rgba(10, 12, 16, 0) 9.16em) 50% 100% / 100% 20.5em no-repeat,
      radial-gradient(99.52em 35.37em at 50% 13.05em, rgba(255, 199, 135, 0.0369) 0%, rgba(255, 199, 135, 0.0401) 12%, rgba(255, 199, 135, 0.0431) 24%, rgba(255, 199, 135, 0.0297) 36%, rgba(255, 199, 135, 0.015) 50%, rgba(255, 199, 135, 0.006) 66%, rgba(255, 199, 135, 0.0044) 82%, rgba(255, 199, 135, 0) 100%) 50% 100% / 100% 20.5em no-repeat;
  }
  .ui-screen--phone > .ui-light::before {
    inset: 14em 90em 20.5em; border-radius: 3.45em;
    box-shadow:
      0 0 2.2em rgba(255, 243, 198, 0.03),
      0 0 10em rgba(255, 217, 177, 0.1);
  }
}


@media (max-width: 599px) {
  .ui-screen--phone { width: 100%; }
  .ui-phone { aspect-ratio: auto; padding: 0; border-radius: 0; background: none; font-size: 16px; }
  .ui-phone::before, .ui-phone::after, .ui-phone__screen::after { content: none; }
  .ui-phone__status { display: none; }
  .ui-phone__screen { height: auto; border: 1px solid var(--rule); border-radius: var(--ui-r); container-type: inline-size; }
  .ui-screen--lit .ui-phone__screen { border-color: transparent; }
  .ui-phone__screen > .ui-pane { padding-bottom: 0; }
}

@media (forced-colors: active) {
  .ui-ico, .ui-mark, .ui-co::after, .ui-chip--play::before, .ui-btn--play::before, .ui-play::before, .ui-composer__send::before, .ui-face::before { background: CanvasText; }
  .ui-state::before { forced-color-adjust: none; }
}
