/* The producer app's own sheet: the native app's design system, for a browser.
 *
 * Read off WrangleUI rather than invented, because the point is that somebody
 * who knows the Mac app knows this one. The sources, so a change there can be
 * followed here:
 *   colours        Support/WranglePalette.swift, the Paper skin (the default
 *                  every device was migrated to), light and dark
 *   accent         Support/WrangleAppearance.swift, Pounamu 2FA37A
 *   type           Support/WrangleTheme.swift -- DM Sans, and the size ramp:
 *                  every size under 20 is drawn at size + (20 - size) / 2, so
 *                  the "13" all over the Swift is 17 on screen. The sizes
 *                  below are the drawn ones.
 *   geometry       Shared/WrangleListStyle.swift, Shared/WrangleCardList.swift
 *   chips          Shared/StatusBadge.swift; the fills are the tone colours
 *                  "deepened" until white reads on them
 *   avatars        Shared/PersonAvatar.swift
 *   shell          WrangleRootView.swift, Shell/SidebarRow.swift, BottomPill
 *
 * Section sheets (`views/<section>.css`) build on the tokens and components
 * here and should not restate them. Sentence case everywhere: no
 * text-transform on anything, ever -- the apps took every uppercase label out.
 */

@font-face { font-family: "DM Sans"; src: url("/fonts/DMSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/fonts/DMSans-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/fonts/DMSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/fonts/DMSans-Black.ttf") format("truetype"); font-weight: 900; font-display: swap; }

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

:root {
  color-scheme: light;
  /* Paper, light. */
  --page: #FFFFFF;
  --surface: #FFFFFF;
  --raised: #F3F3F3;      /* a card's face on Paper */
  --sunken: #EEEEEE;
  --deep: #E7E7E7;
  --ink: #222222;
  --ink-2: #6A6A6A;       /* secondary */
  --ink-3: #9A9A9A;       /* tertiary */
  --rule: #EBEBEB;
  --edge: #E4E4E4;
  --bar: #1F1F22;         /* the sidebar and the phone's bottom bar */
  --bar-ink: #F7F6F3;
  --danger: #B3261E;
  --warning: #C2410C;
  --lift: 0 1px 8px rgba(0, 0, 0, 0.05);  /* WrangleCardShadow: black 5%, radius 4, drop 1 */
  --lift-hover: 0 6px 18px rgba(0, 0, 0, 0.08);
  --wash: rgba(0, 0, 0, 0.04);  /* hover over a plain surface */
  --scrim: rgba(0, 0, 0, 0.35);
  --field-in-card: #FFFFFF;
  --link: var(--accent-deep);

  /* The accent. Pounamu, the default; a team that picks another sets these. */
  --accent: #2FA37A;
  --accent-deep: #24825F;
  --accent-ink: #FFFFFF;
  --accent-tint: rgba(47, 163, 122, 0.12);
  --partner: #E8A33D;

  /* Chip fills: the tone, deepened to carry white. Paid and Signed are always
   * pounamu (2D9B74), whatever the app's colour -- see StatusBadge. */
  --chip-accent: #2D9B74;
  --chip-warning: #C2410C;
  --chip-danger: #B3261E;
  --chip-neutral: #757575;
  --chip-briefed: #6C787E;
  --chip-concept: #776E97;
  --chip-pre: #4A80AD;
  --chip-post: #966476;

  /* Avatar colours, by hash of the name. */
  --face-0: #6E9CC4; --face-1: #A8806A; --face-2: #8C89B8;
  --face-3: #7FA98C; --face-4: #C09A5B; --face-5: #A3768F;

  /* Geometry. */
  --radius: 26px;          /* cards and the page itself */
  --radius-small: 12px;
  --radius-field: 8px;
  --gutter: 24px;          /* page edge */
  --card-inset: 24px;      /* card edge to text, Mac; 22 on the phone */
  /* How far a row's card reaches past the page margin. The Mac's is 14
   * (WrangleMetrics.cardOutset), with the words on the margin; in a browser
   * window that read as cards overhanging the header, and the last column
   * running almost to the page's edge, so on the desktop the cards stand on
   * the margin like everything else and the words sit inside them. */
  --card-outset: 0px;
  --row-inset: 16px;       /* a row card's edge to its words: 16 on the desktop, 22 on the phone */
  --word-inset: 16px;      /* a tile's edge to its words: 16 on the desktop, the outset on the phone */
  --gap: 12px;
  --rail: 240px;
  --frame: 10px;           /* the dark border round the page on a desktop */
  --control: 40px;         /* button and field height, Mac; 38 on the phone */

  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "Courier New", ui-monospace, monospace;
}

/* Paper, dark: by preference, unless this page has been told light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #111113; --surface: #1C1C1F; --raised: #232327; --sunken: #18181B; --deep: #2C2C31;
    --ink: #EDEDED; --ink-2: #A6A6AA; --ink-3: #7E7E84;
    --rule: #2A2A2E; --edge: #303035;
    --bar: #222226; --bar-ink: #EDEDED;
    --danger: #E07070; --warning: #E0A85C;
    --lift: 0 1px 8px rgba(0, 0, 0, 0.05); --lift-hover: 0 6px 18px rgba(0, 0, 0, 0.45);
    --wash: rgba(255, 255, 255, 0.05); --scrim: rgba(0, 0, 0, 0.55); --field-in-card: #18181B; --link: var(--accent);
    --chip-warning: #95703D; --chip-danger: #B55A5A; --chip-neutral: #75757A;
  }
}
/* And told dark, whatever the system says. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111113; --surface: #1C1C1F; --raised: #232327; --sunken: #18181B; --deep: #2C2C31;
  --ink: #EDEDED; --ink-2: #A6A6AA; --ink-3: #7E7E84;
  --rule: #2A2A2E; --edge: #303035;
  --bar: #222226; --bar-ink: #EDEDED;
  --danger: #E07070; --warning: #E0A85C;
  --lift: 0 1px 8px rgba(0, 0, 0, 0.05); --lift-hover: 0 6px 18px rgba(0, 0, 0, 0.45);
  --wash: rgba(255, 255, 255, 0.05); --scrim: rgba(0, 0, 0, 0.55); --field-in-card: #18181B; --link: var(--accent);
  --chip-warning: #95703D; --chip-danger: #B55A5A; --chip-neutral: #75757A;
}

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

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bar);
  color: var(--ink);
  font: 17px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.trouble { color: var(--danger); }
.figure { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.icon { width: 1em; height: 1em; flex: 0 0 auto; fill: currentColor; vertical-align: -0.125em; }

/* ------------------------------------------------------------------- Shell */

/* The frame: the dark bar the sidebar sits in, with the page as a rounded
 * card inside it -- the Mac app's "page card", 10 in from the edges. */
.frame { display: flex; min-height: 100vh; background: var(--bar); }

.sidebar {
  width: var(--rail); flex: 0 0 var(--rail);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  color: var(--bar-ink);
  padding: 10px 10px 12px;
  overflow-y: auto; scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar-top { display: flex; align-items: center; gap: 10px; padding: 6px 6px 8px; }
.crest {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 900; font-size: 18px;
}
.team-switch {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 6px 8px; border-radius: 999px; cursor: pointer;
  color: var(--bar-ink); text-align: left;
}
.team-switch:hover { background: rgba(255, 255, 255, 0.08); }
.team-switch .name { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-switch .icon { opacity: 0.6; font-size: 12px; }
/* An account on no team has nothing to switch between: the name, standing. */
.team-switch.solo { cursor: default; }
.team-switch.solo:hover { background: none; }

.side-search {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin: 4px 0 6px; padding: 8px 12px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 15px;
  color: color-mix(in srgb, var(--bar-ink) 62%, transparent);
  background: color-mix(in srgb, var(--bar-ink) 9%, transparent);
}
.side-search kbd { margin-left: auto; font: inherit; font-size: 13px; opacity: 0.8; }

.side-group { margin-top: 6px; }
.side-heading {
  font-size: 16px; font-weight: 600; padding: 8px 12px 3px;
  color: color-mix(in srgb, var(--bar-ink) 50%, transparent);
}
.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  color: color-mix(in srgb, var(--bar-ink) 78%, transparent);
  font-size: 17px; text-decoration: none; border: 0; background: none; width: 100%; text-align: left;
}
.side-item .icon { width: 18px; height: 18px; flex: 0 0 20px; }
.side-item:hover { background: color-mix(in srgb, var(--bar-ink) 10%, transparent); }
.side-item.on { background: var(--bar-ink); color: var(--bar); font-weight: 600; }
.side-item .badge {
  margin-left: auto; background: var(--partner); color: #1A1A1A;
  font-size: 13px; font-weight: 600; border-radius: 999px; padding: 0 6px; min-width: 20px; text-align: center;
}
.side-foot { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.profile {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 999px;
  background: none; border: 0; cursor: pointer; color: var(--bar-ink); text-align: left; width: 100%;
}
.profile:hover { background: color-mix(in srgb, var(--bar-ink) 10%, transparent); }
.profile .who { min-width: 0; }
.profile .who div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile .who .faint { color: color-mix(in srgb, var(--bar-ink) 50%, transparent); font-size: 14px; }
.side-me { display: flex; align-items: center; gap: 4px; }
.side-me .profile { flex: 1; min-width: 0; }
.circle.side-signout { flex: none; background: none; color: color-mix(in srgb, var(--bar-ink) 62%, transparent); }
.circle.side-signout:hover { background: color-mix(in srgb, var(--bar-ink) 10%, transparent); color: var(--bar-ink); }

/* The page, as a card in the frame. */
.page {
  flex: 1 1 auto; min-width: 0;
  /* The Mac's page card starts 250 from the window's edge: the sidebar's 240
   * and the frame's 10. */
  margin: var(--frame) var(--frame) var(--frame) var(--frame);
  background: var(--page);
  border-radius: var(--radius);
  min-height: calc(100vh - 2 * var(--frame));
  position: relative;
  display: flex; flex-direction: column;
}
.screen {
  flex: 1 1 auto;
  /* The title's capitals stand 21 below the page card's top edge, as
   * `ScreenTitleRow.macTop` puts them. */
  padding: 11px var(--gutter) 60px;
  min-width: 0;
}

/* Saving: the marker that says an edit has not reached the server. */
.saving {
  position: absolute; top: 14px; right: 18px; z-index: 5;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  background: var(--raised); color: var(--ink-2);
}
.saving.failing { background: var(--chip-warning); color: #FFFFFF; }

/* The phone's bottom bar. */
.bottom-bar { display: none; }

/* -------------------------------------------------------------- Page title */

/* One title line per page. Black 34, as ScreenTitle; a record's page is
 * Black 26 with an eyebrow and a subtitle, as RecordPageTitle. */
.title-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 12px; min-height: 44px;
}
.page-title { font-size: 34px; font-weight: 900; line-height: 1.1; letter-spacing: -0.2px; flex: 1 1 auto; min-width: 0; }
/* The actions keep their own width (no shrinking into a wrap while the title
 * has room) and wrap only when they are wider than the whole row -- which on
 * a phone they often are. */
.title-row .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; flex: 0 0 auto; max-width: 100%; }
/* A worded button there stands as tall as the circles and the search beside
 * it (`WrangleTitleMetrics.barControl`, 36), not a form's 40. */
.title-row .actions > .button { height: 36px; }
/* A search among them is a fixed 280 on a desktop (a percentage there has
 * nothing to be a percentage of) and the whole width on a phone. */
.title-row > .title-search { width: 280px; max-width: 100%; height: 36px; background: var(--raised); flex: 0 1 auto; }
.title-words { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.title-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.title-line .page-title { flex: 0 1 auto; }
/* A record's page: `RecordPageHeader`. The back circle 12 before the title,
 * the title Black 26 on a 44 line, the eyebrow (SemiBold 16, the accent,
 * tracked) and the subtitle (17, secondary) under it. */
.record-title { align-items: flex-start; gap: 12px; flex-wrap: nowrap; }
.title-line { flex-wrap: wrap; row-gap: 4px; }
.title-line > :not(.page-title) { margin: 0; }
.record-title .title-line { min-height: 44px; }
.record-title .actions { min-height: 44px; }
.record-title .eyebrow { font-size: 16px; font-weight: 600; letter-spacing: 0.4px; color: var(--accent); }
.record-title .page-title { font-size: 26px; line-height: 1.15; }
.record-title .subtitle { font-size: 17px; color: var(--ink-2); }
.circle.back { margin-top: 4px; }
.circle.back .icon { width: 20px; height: 20px; }

/* -------------------------------------------------------- Cards and groups */

.card {
  background: var(--raised);
  border-radius: var(--radius);
  padding: 18px var(--card-inset);
  box-shadow: var(--lift);
  min-width: 0;
}
.card.plain { background: var(--surface); box-shadow: none; border: 1px solid var(--edge); }
/* `DetailCard` on Paper: no face. The heading (Bold 20, a fold's chevron
 * after it), 14 under it what the card holds, 28 under that a hairline, and
 * the next card 28 on. */
.card.detail { background: none; box-shadow: none; border-radius: 0; padding: 0 0 28px; border-bottom: 0.75px solid var(--rule); margin-bottom: 28px; }
.card.detail + .card { margin-top: 0; }
.card.detail > .card-title { margin: 0 0 14px; font-size: 20px; }
.card-fold { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; color: inherit; text-align: left; }
.card-fold .icon { width: 14.5px; height: 14.5px; color: var(--ink-3); transition: transform 0.16s; }
.card.detail.folded > :not(.card-title) { display: none; }
.card.detail.folded > .card-title { margin-bottom: 0; }
.card.detail.folded .card-fold .icon { transform: rotate(-90deg); }
/* With no face under them, a card's soft buttons are the raised pill again
 * (`wrangleSoftPill`), and its fields keep their rim. */
.card.detail :where(.button:not(.primary):not(.accent):not(.danger)) { background: var(--raised); }
.card.detail :where(.button:not(.primary):not(.accent):not(.danger)):hover { background: var(--deep); }
/* Detail cards side by side: two columns once there is room, each card
 * standing on the one above it, 28 between the columns. */
.card-grid:has(> .card.detail) { display: block; columns: 2 460px; column-gap: 28px; }
.card-grid:has(> .card.detail) > .card { break-inside: avoid; display: block; }
.card-grid:has(> .card.detail) > .card.detail { display: flow-root; }
.card-title { font-size: 20px; font-weight: 700; margin: 0 0 14px; }
.card + .card { margin-top: var(--gap); }
.card.pressable { cursor: pointer; transition: box-shadow 0.16s ease-out, background 0.16s ease-out; }
.card.pressable:hover { background: var(--sunken); }
:root[data-theme="dark"] .card.pressable:hover { background: var(--deep); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card.pressable:hover { background: var(--deep); } }

/* An adaptive grid: 330 minimum, so two columns at a laptop, three or four on
 * a wide screen, one on a phone. */
.card-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr));
}
.card-grid > .card + .card { margin-top: 0; }

/* Group headings: Bold 17 in the text colour, sentence case -- the "dark
 * group headings" -- with an optional count beside them. */
.group-heading {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 17px; font-weight: 700; color: var(--ink);
  margin: 22px 0 8px;
}
.group-heading:first-child { margin-top: 4px; }
/* A list's first group straight under the title: `CardRowsHeader`'s 12 and
 * the stack's 12 again over it. */
.page-head + div > .group-heading:first-child, .page-head + [hidden] + div > .group-heading:first-child { margin-top: 26px; }
.group-heading .count { font-size: 16px; font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.group-heading .count.awaiting { color: var(--warning); }

/* Card rows: one card per row, like the list cards. On the Mac (Paper) a
 * row's words stand on the page margin, in line with the title, and its card
 * reaches 14 past that either side (`WrangleMetrics.cardOutset`); 22 above
 * and below the words (`wrangleRowInsets`: 15 + the skin's 8 + 2, less the
 * card's 3), and 12 between one card and the next (`rowGap`). */
.card-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.card-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--raised); border-radius: var(--radius);
  padding: 23px var(--row-inset); min-height: 58px;
  box-shadow: var(--lift); min-width: 0;
}
.screen .card-rows > .card-row, .screen .card-rows > li > .card-row { margin-left: calc(-1 * var(--card-outset)); margin-right: calc(-1 * var(--card-outset)); }
.card-row.pressable { cursor: pointer; }
.card-row.pressable:hover { background: var(--sunken); }
.card-row .main { flex: 1 1 auto; min-width: 0; }
.card-row .title { font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-row .meta { font-size: 16px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-row .side { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }

/* The Mac's list grid (`WrangleCardGrid`): at least 330 for the words, the
 * faces reaching 14 past them and 12 apart. */
.row-grid {
  list-style: none; padding: 0; margin: 0 calc(-1 * var(--card-outset)); display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(calc(330px + 2 * var(--card-outset)), 100%), 1fr));
  align-items: start;
}
.row-grid > .card { margin: 0; padding: 23px var(--row-inset); }
.row-grid > .card + .card { margin-top: 0; }

/* `ProductionStack`: the job as the heading, the count (or "N awaiting" in
 * the warning colour) and a chevron at its far end, which turns to point
 * along the line when the stack is closed. Closed, the top card shows with
 * the edges of one or two more under it. */
.stack-heading { cursor: pointer; align-items: center; flex-wrap: nowrap; }
.stack > .stack-heading, .stack > .stack-heading:first-child { margin: 19px 0 6px; }
.sort-bar + .stack > .stack-heading, .sort-bar + * > .stack:first-child > .stack-heading { margin-top: 18px; }
.sort-bar[hidden] + * > .stack:first-child > .stack-heading { margin-top: 27px; }
.stack-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack-toggle {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--ink-3);
}
.stack-toggle .count { font-size: 16px; font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.stack-toggle .count.awaiting { color: var(--warning); }
.stack-toggle .icon { width: 15.5px; height: 15.5px; transition: transform 0.16s; }
.stack:not(.open) .stack-toggle .icon { transform: rotate(-90deg); }
.stack.closed .row-grid > :not(:first-child) { display: none; }
.stack.closed .row-grid > :first-child { box-shadow: var(--lift), 0 7px 0 -3px var(--sunken); margin-bottom: 7px; }
.stack.closed.deep .row-grid > :first-child { box-shadow: var(--lift), 0 7px 0 -3px var(--sunken), 0 13px 0 -7px var(--deep); margin-bottom: 13px; }

/* Facts on a record's page: label and value. */
/* `DetailRow`: the label in the tertiary ink on the left, the value in the
 * ink on the right, 17 each. */
.facts { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 8px 16px; margin: 0; }
.facts dd { text-align: right; }
.facts dt { color: var(--ink-3); font-size: 17px; white-space: nowrap; }
.facts dd { margin: 0; font-size: 17px; min-width: 0; overflow-wrap: anywhere; }

/* A link among a record's facts -- an address, a number, another record --
 * in the accent, underlined on hover. At no weight (:where), so a section's
 * own link style still wins. */
:where(.facts) a { color: var(--link); text-decoration: none; overflow-wrap: anywhere; }
:where(.facts) a:hover { text-decoration: underline; }

/* -------------------------------------------------------------------- Table */

.table-wrap { overflow-x: auto; border-radius: var(--radius-small); }
.table { width: 100%; border-collapse: collapse; font-size: 16px; }
.table th {
  text-align: left; font-weight: 600; color: var(--ink-2); font-size: 15px;
  padding: 8px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tr.pressable { cursor: pointer; }
.table tr.pressable:hover td { background: var(--wash); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------------- Chips */

/* `WrangleStatusChip`, which is compact unless asked otherwise: SemiBold 12
 * with no ramp (`WrangleFont.dense`), 7 by 2.5 inside the capsule; 13 and 9
 * by 3.5 when it is not compact. A production's stage is `StatusBadge`:
 * 13 either way, 9 by 3.5, or 7 by 2.5 compact. */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; line-height: 16px;
  padding: 2.5px 7px; border-radius: 999px; white-space: nowrap;
  background: var(--chip-neutral); color: #FFFFFF;
}
.chip.large { font-size: 13px; line-height: 17px; padding: 3.5px 9px; }
.chip:is(.briefed, .concept, .pre_production, .shoot, .post_production, .delivered, .on_hold, .cancelled) { font-size: 13px; line-height: 17px; padding: 3.5px 9px; }
.chip.compact:is(.briefed, .concept, .pre_production, .shoot, .post_production, .delivered, .on_hold, .cancelled) { padding: 2.5px 7px; }
.chip.accent, .chip.paid, .chip.signed, .chip.delivered { background: var(--chip-accent); }
.chip.warning, .chip.shoot, .chip.awaiting { background: var(--chip-warning); }
.chip.danger, .chip.cancelled, .chip.overdue { background: var(--chip-danger); }
.chip.neutral, .chip.draft, .chip.on_hold { background: var(--chip-neutral); }
.chip.briefed { background: var(--chip-briefed); }
.chip.concept { background: var(--chip-concept); }
.chip.pre_production { background: var(--chip-pre); }
.chip.post_production { background: var(--chip-post); }
/* Waiting on somebody: Bold, warning ground, page-coloured words. */
.chip.waiting { background: var(--warning); color: var(--page); font-weight: 700; letter-spacing: 0.6px; font-size: 15px; line-height: 19px; padding: 3px 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--chip-neutral); }

/* A soft pill, for counts and tags that are not a status. */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--sunken); color: var(--ink-2); font-size: 15px; white-space: nowrap; }

/* ------------------------------------------------------------------ Avatars */

.avatar {
  --size: 32px;
  width: var(--size); height: var(--size); border-radius: 50%;
  flex: 0 0 auto; display: inline-grid; place-items: center; overflow: hidden;
  font-weight: 600; font-size: max(10px, calc(var(--size) * 0.36)); line-height: 1;
  color: var(--face, var(--ink-2));
  background: color-mix(in srgb, var(--face, var(--ink-2)) 22%, transparent);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* The rim is for photographs only. */
.avatar.photo { box-shadow: 0 0 0 1px var(--rule); background: var(--sunken); }
.avatar.small { --size: 24px; }
.avatar.large { --size: 44px; }
.avatar.huge { --size: 72px; }
.faces { display: inline-flex; }
.faces .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--raised); }

/* ------------------------------------------------------------------ Buttons */

/* One height for every button on a page, 40 on a desktop and 38 on a phone.
 * Capsules, as WrangleActionStyle. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--control); padding: 0 17px; border-radius: 999px; border: 0;
  font-size: 16px; font-weight: 600; cursor: pointer; white-space: nowrap;
  background: var(--raised); color: var(--ink);
  transition: transform 0.12s, background 0.12s;
  text-decoration: none;
}
.button:hover { background: var(--deep); }
.button:active { transform: scale(0.96); }
.button:disabled, .button[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
/* `wrangleInlinePill`: the page's colour on the ink, 14 either side. */
.button.primary { background: var(--ink); color: var(--page); padding: 0 14px; }
.empty-action { gap: 6px; }
.empty-action .icon { width: 14px; height: 14px; }
.button.primary:hover { background: var(--ink-2); }
.button.accent { background: var(--accent); color: var(--accent-ink); }
.button.accent:hover { background: var(--accent-deep); }
.button.plain { background: transparent; }
.button.plain:hover { background: var(--raised); }
.button.danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.button.small { height: 32px; padding: 0 12px; font-size: 15px; }
.button .icon { font-size: 16px; }
/* A round icon button: 36 in a title row, as the title bar's circles
 * (`WrangleTitleMetrics.barControl`, `WrangleCircleStyle`): the raised
 * ground and no rim -- Paper draws none -- so on a card it is the card's own
 * colour and only its mark shows. */
.circle {
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--raised); color: var(--ink); border: 0; cursor: pointer;
  flex: 0 0 auto; font-size: 16px;
}
.circle:hover { background: var(--deep); }
.circle:active { background: var(--ink); color: var(--page); transform: scale(0.94); }
.circle.large { width: 44px; height: 44px; }
.circle.accent { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.circle.accent:hover { background: var(--accent-deep); }
.circle:disabled { opacity: 0.4; cursor: default; pointer-events: none; }
.add-float {
  position: fixed; right: 26px; bottom: 26px; z-index: 20;
  width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--page);
  background: var(--accent); color: var(--accent-ink); font-size: 22px; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

/* A row's "…": the small see-through circle. */
.circle.quiet { width: 30px; height: 30px; font-size: 14px; background: transparent; box-shadow: none; color: var(--ink-3); }
.circle.quiet:hover { background: var(--deep); color: var(--ink); }

/* The sort control: ListSortButton. "Sorted by …" in Regular 16 in the ink
 * with a Bold chevron, no capsule; the reverse arrow at the row's far end in
 * the secondary ink. 2 above and 6 below, as its list row. */
.sort-bar { display: flex; align-items: center; gap: 6px; margin: 2px 0 6px; min-height: 28px; }
/* Straight under the title, it stands 17 below the title's row -- also
 * where a list draws it first in a wrapper of its own (quotes). */
.page-head + .sort-bar, .page-head + div > .sort-bar:first-child { margin-top: 17px; }
.sort-control {
  display: inline-flex; align-items: center; gap: 5px; padding: 0; height: 28px;
  border: 0; background: none; color: var(--ink);
  font-size: 16px; font-weight: 400; cursor: pointer; white-space: nowrap;
}
.sort-control .icon { width: 14px; height: 14px; }
.sort-control:hover span { text-decoration: underline; text-underline-offset: 3px; }
.sort-reverse {
  margin-left: auto; border: 0; background: none; padding: 4px; border-radius: 6px; cursor: pointer;
  color: var(--ink-2); display: inline-grid; place-items: center;
}
.sort-reverse .icon { width: 15px; height: 15px; }
.sort-reverse:hover { color: var(--ink); background: var(--wash); }

/* The grip on an arrangeable row: beside the card's words, so a press on
 * the card still opens it. */
.grip {
  flex: 0 0 auto; width: 32px; height: 40px; border: 0; border-radius: 10px;
  background: none; color: var(--ink-3); cursor: grab; display: grid; place-items: center; font-size: 17px;
}
.grip:hover { background: var(--wash); color: var(--ink-2); }
.grip:active { cursor: grabbing; }
.grip[hidden] { display: grid !important; visibility: hidden; }
.card-row.dragging { opacity: 0.45; }
.card-row.drop-over { box-shadow: inset 0 0 0 2px var(--accent); }

/* The entry card: `WrangleEntryCard`. A 42 disc on the page margin, 10
 * between it and the words: a title in Bold 18, a line under it in 17, 3
 * apart; faces (26) and a pill at the right. On the Mac's Paper the card has
 * no inset of its own -- the disc fills it, 3 above and below -- and reaches
 * 14 past the margin like every row; 7 between one and the next. */
.card-rows:has(> .entry) { gap: 7px; }
.card-row.entry { gap: 10px; padding: 0 var(--row-inset); min-height: 48px; }
.entry .main { display: flex; flex-direction: column; gap: 3px; }
.entry .title { font-size: 18px; font-weight: 700; line-height: 23px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.entry .meta { font-size: 17px; line-height: 22px; }
.entry.late .meta { color: var(--warning); }
.entry.done .title { text-decoration: line-through; color: var(--ink-3); }
.entry .side { gap: 8px; }
.entry .side .avatar { --size: 26px; }
/* `EntryBadge`: the tint on a disc of the page's own colour. */
.entry-badge {
  --tone: var(--ink-2);
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 20px;
  color: var(--tone); background: var(--page);
  border: 0; padding: 0;
}
.tone-shoot { --tone: var(--chip-warning); }
.tone-warning { --tone: var(--warning); }
.tone-accent { --tone: var(--accent); }
.tone-danger { --tone: var(--danger); }
.tone-quiet { --tone: var(--ink-2); }
.tone-ink { --tone: var(--ink); }
/* `TaskTick`: the tertiary circle with the accent ring inside it at seven
 * tenths; done, the accent filled with a tick. */
.entry-tick { cursor: pointer; }
.entry-tick-ring {
  position: relative; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--ink-3); font-size: 11px; color: var(--page);
  transition: background 0.12s, transform 0.12s;
}
.entry-tick-ring::after {
  content: ""; position: absolute; width: 11px; height: 11px; border-radius: 50%; box-sizing: border-box;
  border: 2px solid var(--accent); opacity: 0.9;
}
.entry-tick[aria-pressed="true"] .entry-tick-ring { background: var(--accent); border-color: var(--accent); }
.entry-tick[aria-pressed="true"] .entry-tick-ring::after { display: none; }
.entry-tick:hover .entry-tick-ring { transform: scale(1.1); }
/* `EntryPill`: Bold 17 at 11 by 7, the page's colour on the ink; quiet, the
 * secondary ink on the raised ground. */
.pill {
  display: inline-flex; align-items: center; padding: 7px 11px; border-radius: 999px; white-space: nowrap;
  font-size: 17px; font-weight: 700; line-height: 20px; font-variant-numeric: tabular-nums;
  background: var(--ink); color: var(--page);
}
.pill.quiet { background: var(--raised); color: var(--ink-2); }
.card-row .pill.quiet { background: var(--page); }
/* The Mac opens an entry's menu from a right-click and draws nothing for it;
 * a touch screen, which has no right-click, keeps the "…". */
@media (hover: hover) and (pointer: fine) { .entry-more { display: none; } }

/* A switch with its words beside it: SettingsToggle. In a card, rows stack
 * with a rule between them. */
.switch-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; }
.switch-row + .switch-row { border-top: 1px solid var(--rule); }
.card > .switch-row:first-child, .card > .card-title + .switch-row { padding-top: 0; }
.card > .switch-row:last-child { padding-bottom: 0; }
.switch-words { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.switch-title { font-size: 17px; color: var(--ink); }
.switch-detail { font-size: 15px; color: var(--ink-3); }
.switch { position: relative; flex: 0 0 auto; width: 44px; height: 26px; }
.switch-box { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 16%, transparent); transition: background 0.16s;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.16s;
}
.switch-box:checked + .switch-track { background: var(--accent); }
.switch-box:checked + .switch-track::after { transform: translateX(18px); }
.switch-box:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-box:disabled + .switch-track { opacity: 0.4; }
.switch-box:disabled { cursor: default; }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-track::after { transition: none; } }

/* -------------------------------------------------------------------- Forms */

/* Labels above fields, as the Mac's WrangleField. */
.form { display: flex; flex-direction: column; gap: 14px; max-width: 660px; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > .label { font-size: 16px; font-weight: 600; color: var(--ink-2); }
.field > .hint { font-size: 15px; color: var(--ink-3); }
.field > .hint.trouble { color: var(--danger); }
.input, .textarea, .select {
  width: 100%; min-width: 0;
  min-height: var(--control); padding: 8px 11px;
  border-radius: var(--radius-field); border: 1px solid transparent;
  background: color-mix(in srgb, var(--raised) 100%, transparent);
  color: var(--ink); font-size: 17px; line-height: 1.35;
  transition: background 0.12s, border-color 0.12s;
}
.input:hover, .textarea:hover, .select:hover { background: var(--sunken); }
/* Inside a card the card is the raised colour, so a field there takes the
 * field-in-card colour or it cannot be seen -- white on Paper light, a step
 * down on dark. Every section gets this; none should restate it. */
.card .input, .card .textarea, .card .select, .card .search,
.card-row .input, .card-row .select { background-color: var(--field-in-card); box-shadow: inset 0 0 0 1px var(--edge); }
.card .input:hover, .card .textarea:hover, .card .select:hover,
.card-row .input:hover, .card-row .select:hover { background-color: var(--field-in-card); box-shadow: inset 0 0 0 1px var(--ink-3); }
.card .input:focus, .card .textarea:focus, .card .select:focus { box-shadow: none; }
/* The same for a soft button or a circle on a card: the raised colour on the
 * raised colour is a button nobody can see. */
/* Kept at one class's weight (:where), so a section's own look for its
 * buttons still wins. */
.card :where(.button:not(.primary):not(.accent):not(.danger):not(.plain)) { background: var(--field-in-card); }
.card :where(.button:not(.primary):not(.accent):not(.danger):not(.plain), .circle:not(.quiet):not(.accent)):hover { background: var(--deep); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.textarea { resize: vertical; min-height: 96px; }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input[type="date"], .input[type="time"] { font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 17px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* The search field: a capsule, the magnifying glass inside it. */
.search {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 14px; border-radius: 999px; background: var(--raised);
  color: var(--ink-2); min-width: 0;
}
.search input { flex: 1 1 auto; min-width: 0; border: 0; background: none; outline: none; font-size: 17px; color: var(--ink); }
.search:focus-within { box-shadow: inset 0 0 0 1px var(--accent); }

/* Segmented control: a track at 9% of the ink, the chosen one in ink. */
.segments { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 9%, transparent); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
/* `WrangleSegments`: SemiBold 17 in the secondary ink, the chosen one in the
 * page's colour on the ink; a 40 track at 9% of the ink. */
.segments button {
  border: 0; background: none; padding: 6px 10px; border-radius: 999px; cursor: pointer;
  font-size: 17px; line-height: 22px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.segments button[aria-checked="true"] { background: var(--ink); color: var(--page); }

/* Tabs for a record's sub-pages: the same capsules, set on a rule. */
.tabs { display: flex; gap: 4px; margin: 4px 0 18px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.tabs [role="tab"] {
  border: 0; background: none; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  font-size: 16px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.tabs [role="tab"]:hover { background: var(--raised); }
.tabs [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--page); }

/* Filter chips. */
.filter { border: 0; cursor: pointer; padding: 5px 10px; border-radius: 999px; font-size: 16px; font-weight: 700; background: var(--sunken); color: var(--ink-2); }
/* On, the words are the page's own colour on the tint (`wrangleBackground`):
 * white in light, near-black in dark. */
.filter[aria-pressed="true"] { background: var(--accent); color: var(--page); }

/* ---------------------------------------------------- Menus, sheets, toasts */

.menu {
  position: fixed; z-index: 60; min-width: 200px; max-width: min(320px, calc(100vw - 32px));
  max-height: min(420px, calc(100vh - 32px)); overflow-y: auto;
  background: var(--surface); border-radius: 14px; padding: 6px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22), 0 0 0 0.5px var(--edge);
}
.menu [role="menuitem"], .menu [role="option"] {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 12px; border-radius: 9px; border: 0; background: none; cursor: pointer;
  text-align: left; font-size: 16px; color: var(--ink);
}
.menu [role="menuitem"]:hover, .menu [role="menuitem"]:focus, .menu [role="option"][aria-selected="true"], .menu [role="option"]:hover { background: var(--raised); outline: none; }
.menu .danger { color: var(--danger); }
.menu .menu-label { flex: 1 1 auto; min-width: 0; }
.menu [role="menuitem"] > .icon { color: var(--ink-2); }
.menu .danger > .icon { color: var(--danger); }
.menu [role="menuitem"][aria-disabled="true"] { opacity: 0.4; cursor: default; }
.menu [role="menuitem"][aria-disabled="true"]:hover { background: none; }
.menu hr { border: 0; border-top: 1px solid var(--rule); margin: 6px 4px; }
.menu .menu-heading { font-size: 14px; font-weight: 600; color: var(--ink-3); padding: 6px 12px 2px; }

.scrim {
  position: fixed; inset: 0; z-index: 50; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 40px 16px;
  animation: appear 0.16s ease-out;
}
.sheet {
  width: min(660px, 100%); max-height: 100%; overflow: hidden;
  background: var(--surface); border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  display: flex; flex-direction: column;
  animation: rise 0.2s ease-out;
}
.sheet.narrow { width: min(420px, 100%); }
.sheet.wide { width: min(980px, 100%); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 10px; }
.sheet-head h2 { font-size: 20px; font-weight: 700; flex: 1 1 auto; min-width: 0; }
.sheet-body { padding: 6px 22px 18px; overflow-y: auto; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 18px; border-top: 1px solid var(--rule); }
.confirm-message { color: var(--ink-2); margin: 0 0 6px; }

.toasts { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  background: var(--bar); color: var(--bar-ink); border-radius: 999px; padding: 10px 18px;
  font-size: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); animation: rise 0.2s ease-out;
}
.toast.trouble { background: var(--chip-danger); color: #FFFFFF; }
.toast button { border: 0; background: none; color: inherit; font-weight: 700; cursor: pointer; padding: 0; }

@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------- Empty, loading, notices */

.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: 56px 24px; color: var(--ink-2);
}
.empty > .icon { font-size: 32px; color: var(--ink-3); }
.empty .empty-title { font-size: 19px; font-weight: 600; color: var(--ink); }
.empty .empty-message { font-size: 17px; max-width: 320px; }
.empty .button { margin-top: 4px; }

.skeleton { display: flex; flex-direction: column; gap: 6px; }
.skeleton .bone {
  height: 58px; border-radius: var(--radius); background: var(--raised);
  background-image: linear-gradient(90deg, transparent, var(--wash), transparent);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
.skeleton .bone.line { height: 18px; border-radius: 6px; width: 60%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton .bone, .scrim, .sheet, .toast { animation: none; } }

.notice { background: var(--accent-tint); color: var(--ink); border-radius: var(--radius-small); padding: 12px 16px; font-size: 16px; }

/* ---------------------------------------------------- Global search (⌘K) */

.finder .sheet-body { padding: 0 10px 12px; }
.finder .search { margin: 14px 12px 8px; }
.finder-top { display: flex; align-items: center; }
.finder-top .search { flex: 1 1 auto; min-width: 0; }
.finder-cancel { display: none; border: 0; background: none; color: var(--accent-deep); font: inherit; font-size: 17px;
  padding: 8px 12px 8px 0; cursor: pointer; white-space: nowrap; }
@media (max-width: 760px) { .finder-cancel { display: block; } }
.finder-group { font-size: 15px; font-weight: 600; color: var(--ink-3); padding: 10px 12px 4px; }
.finder-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; cursor: pointer; }
.finder-row .icon { font-size: 16px; color: var(--ink-2); flex: 0 0 22px; }
.finder-row .main { min-width: 0; flex: 1 1 auto; }
.finder-row .title { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finder-row .meta { font-size: 15px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finder-row[aria-selected="true"], .finder-row:hover { background: var(--raised); }

/* ------------------------------------------------------------- Sign in */

.signin { max-width: 360px; margin: 14vh auto; padding: 0 16px; color: var(--bar-ink); }
.signin .page-title { margin-bottom: 10px; }
.signin .muted { color: color-mix(in srgb, var(--bar-ink) 62%, transparent); }
.signin .input { background: color-mix(in srgb, var(--bar-ink) 10%, transparent); color: var(--bar-ink); margin: 14px 0; }
.signin .input::placeholder { color: color-mix(in srgb, var(--bar-ink) 42%, transparent); }
.signin .input:focus { background: color-mix(in srgb, var(--bar-ink) 14%, transparent); }
.signin .trouble { color: var(--warning); }

/* The sign-in page itself: the app's mark, one heading, address and password,
 * then the emailed link under a rule. A single column of full-width controls,
 * the same width at every size, on the bar's colour like the rest of the
 * signed-out pages. */
main.signin { margin-top: 12vh; text-align: center; }
.signin-mark {
  width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 15px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-size: 31px; font-weight: 900; line-height: 1;
}
main.signin .page-title { margin: 0 0 26px; }
.signin-form { display: flex; flex-direction: column; text-align: left; }
.signin-label { font-size: 14px; font-weight: 600; margin: 0 0 6px;
  color: color-mix(in srgb, var(--bar-ink) 72%, transparent); }
.signin-form .input { margin: 0 0 16px; }
main.signin .button { width: 100%; height: 44px; }
.signin-form .button { margin-top: 4px; }
main.signin .button:not(.accent) { background: color-mix(in srgb, var(--bar-ink) 12%, transparent); color: var(--bar-ink); }
main.signin .button:not(.accent):hover { background: color-mix(in srgb, var(--bar-ink) 18%, transparent); }
main.signin .button:disabled { opacity: 0.6; cursor: default; }
.signin-note { font-size: 14px; line-height: 1.45; margin: 12px 0 0; min-height: 1px;
  color: color-mix(in srgb, var(--bar-ink) 62%, transparent); text-align: center; }
.signin-note:empty { margin: 0; }
.signin-note.trouble { color: var(--warning); }
/* Apple and Google, each in the look it asks for on a dark page -- and this
   page is dark in either theme: Apple's white with its black mark, Google's
   white with its four colours. */
.signin-providers { display: flex; flex-direction: column; gap: 10px; }
main.signin .button.signin-provider { gap: 10px; font-weight: 600; background: #fff; color: #1f1f1f; }
main.signin .button.signin-provider:hover { background: #ececee; }
.signin-provider-mark { width: 18px; height: 18px; flex: none; }
main.signin .button.signin-provider.apple { color: #000; }
main.signin .button.signin-provider.apple .signin-provider-mark { width: 17px; height: 17px; margin-top: -2px; }
.signin-or { display: flex; align-items: center; gap: 12px; margin: 22px 0;
  font-size: 14px; color: color-mix(in srgb, var(--bar-ink) 50%, transparent); }
.signin-or::before, .signin-or::after { content: ""; flex: 1; height: 1px;
  background: color-mix(in srgb, var(--bar-ink) 16%, transparent); }
/* Under everything else, after a hairline: making an account, or the way
 * back from a page that is not the sign-in. */
.signin-foot { margin: 26px 0 0; padding: 22px 0 0; border-top: 1px solid color-mix(in srgb, var(--bar-ink) 16%, transparent); }
.signin-foot + .signin-foot { margin-top: 10px; padding-top: 0; border-top: 0; }
.signin-lead { margin: -14px 0 22px; }
/* The terms: four sentences, read left to right like any other. */
.signin-terms { text-align: left; font-size: 16px; line-height: 1.5;
  color: color-mix(in srgb, var(--bar-ink) 82%, transparent); }
.signin-terms p { margin: 0 0 12px; }
.signin-documents { margin: 6px 0 20px; }
.signin-documents a { color: var(--accent); text-decoration: none; font-weight: 600; }
.signin-documents a:hover { text-decoration: underline; }
main.signin .button .icon { width: 16px; height: 16px; }

/* --------------------------------------------------------------- Phone */

/* The phone: no frame and no sidebar. The page fills the screen with its
 * bottom corners rounded over a bar of icons, as BottomPill. 16 at the edges. */
@media (max-width: 760px) {
  /* The phone's one margin is 24 (`WrangleMetrics.edgeInset`); a card stands
   * 14 from the screen's edge (`cardMargin`) with its words 22 inside it. */
  :root { --gutter: 24px; --card-inset: 22px; --control: 38px; --card-outset: 10px; --row-inset: 22px; --word-inset: var(--card-outset); }
  body { font-size: 17px; }
  /* The page and the bar make exactly the window, and no more: the frame's
   * desktop min-height on top of the bar is what scrolled every page 56px
   * past its end. The bar is 6 + 44 + 6. */
  .frame { display: block; min-height: 0; }
  .sidebar { display: none; }
  .page {
    margin: 0; border-radius: 0 0 var(--radius) var(--radius);
    min-height: calc(100vh - 56px - env(safe-area-inset-bottom));
    min-height: calc(100dvh - 56px - env(safe-area-inset-bottom));
    padding-bottom: 0;
  }
  /* The demo's marker sits top centre on a phone, and the page starts below
   * it rather than under it -- top right, it covered the title's buttons. */
  body .demo-marker { left: 50%; right: auto; transform: translateX(-50%); top: 6px; }
  body:has(.demo-marker) .screen { padding-top: 34px; }
  /* The phone's title: the circles beside it where they fit and under it,
   * at the right, where they do not; a record's go on the back's line. */
  .title-row { flex-wrap: wrap; }
  .title-row .actions { margin-left: auto; justify-content: flex-end; flex-shrink: 1; min-width: 0; }
  .title-row:has(> .title-search) .actions { order: -1; width: 100%; }
  .title-row > .title-search { width: 100%; flex: 1 1 100%; order: 10; }
  .record-title .title-words { order: 1; flex-basis: 100%; }
  /* A worded button among the circles keeps only its mark, and is a circle
   * too, as the phone's toolbar has them -- so "Add photos" and "Recce
   * report" sit on the back's line rather than wrapping to a second. The
   * one primary button (Edit, Invite) keeps its words. */
  .title-row .actions > .button:not(.primary):has(> .icon):has(> .button-label) { width: 36px; padding: 0; }
  .title-row .actions > .button:not(.primary):has(> .icon) > .button-label { display: none; }
  .screen { padding: 16px var(--gutter) 40px; }
  .page-title { font-size: 34px; }
  .bottom-bar {
    display: flex; justify-content: center; position: sticky; bottom: 0; z-index: 30;
    background: var(--bar); padding: 6px 18px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-bar .slots { display: flex; width: 100%; max-width: 420px; justify-content: space-between; gap: 4px; }
  .bottom-bar button {
    flex: 1 1 0; height: 44px; border: 0; background: none; cursor: pointer; border-radius: 999px;
    color: color-mix(in srgb, var(--bar-ink) 62%, transparent); display: grid; place-items: center; font-size: 20px; position: relative;
  }
  .bottom-bar button.on { flex-grow: 1.25; background: var(--bar-ink); color: var(--bar); height: 38px; align-self: center; }
  .bottom-bar button .badge { position: absolute; top: 8px; right: calc(50% - 16px); width: 7px; height: 7px; border-radius: 50%; background: var(--partner); }
  .saving { top: 10px; right: 12px; }
  .add-float { bottom: calc(76px + env(safe-area-inset-bottom)); right: 16px; }
  .sheet { border-radius: 18px; }
  .scrim { padding: 16px; align-items: flex-end; }
  .card-row { padding: 18px var(--row-inset); }
  .title-row { margin-bottom: 10px; }
  /* `WrangleEntryCard` on the phone: 16 all round inside the card. */
  .card-row.entry { padding: 16px; gap: 10px; }
}

/* The section menu a phone opens from its bar: every section, as tiles. */
.section-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.section-menu .side-heading { grid-column: 1 / -1; color: var(--ink-3); padding: 8px 4px 0; }
.section-menu button {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; border: 0;
  background: var(--raised); color: var(--ink); cursor: pointer; font-size: 16px; font-weight: 600; text-align: left;
}
.section-menu button .icon { font-size: 19px; color: var(--accent-deep); }
.section-menu-account { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--rule); }
.section-menu-account .who { flex: 1; min-width: 0; }
.section-menu-account .who div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.section-menu-account .who .faint { color: var(--ink-3); font-size: 14px; font-weight: 400; }
.section-menu-account .who .faint:empty { display: none; }

/* A map's frame, before and after it draws (`ui.map`). The rest -- pins, the
 * corner controls, Leaflet's dark tiles -- is in map.css, loaded with the map
 * itself so a page without one never fetches it. */
.map-frame { position: relative; width: 100%; max-width: 100%; overflow: hidden; isolation: isolate;
  border-radius: 20px; background: var(--sunken); box-shadow: inset 0 0 0 0.75px var(--edge); }
.map-frame.map-none { display: grid; place-items: center; color: var(--ink-3); font-size: 14px; }

/* ------------------------------------------------------- Column dividers */

/* A hairline between a page's two columns. Without one, two columns of
 * headings and rows on the same white page read as one wide jumble -- which
 * card belongs to which side is a guess. The gap is split either side of the
 * rule, so the faces keep the distance they had. */
.card-grid:has(> .card.detail) { column-gap: 56px; column-rule: 1px solid var(--rule); }
@media (min-width: 1360px) {
  .productions-columns { column-gap: 28px; }
  .productions-columns > :nth-child(2) { border-left: 1px solid var(--rule); padding-left: 28px; align-self: stretch; }
  .calendar-layout { column-gap: 28px; }
  .calendar-slot-agenda { border-left: 1px solid var(--rule); padding-left: 28px; align-self: stretch; }
}
@media (min-width: 1100px) {
  .home-layout { column-gap: 28px; }
  .home-layout > .home-column + .home-column { border-left: 1px solid var(--rule); padding-left: 28px; align-self: stretch; }
  .settings-columns { column-gap: 23px; }
  .settings-columns > .settings-column + .settings-column { border-left: 1px solid var(--rule); padding-left: 23px; }
  .team-columns { column-gap: 28px; }
  .team-columns > :nth-child(2) { border-left: 1px solid var(--rule); padding-left: 28px; align-self: stretch; }
  .collaborators-page { column-gap: 28px; }
  .collaborators-page > .collaborators-side { border-left: 1px solid var(--rule); padding-left: 28px; align-self: stretch; }
}

/* ---------------------------------------------------------------- Motion */

/* One curve for everything that moves: quick to start, long to settle, the
 * feel of the apps' springs without the bounce. */
:root { --ease: cubic-bezier(0.32, 0.72, 0, 1); --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1); }

/* The sliding highlight (`ui.glide`): behind the items, under their words. */
.glides:not(.sidebar) { position: relative; }
.glides { isolation: isolate; }
.glider {
  position: absolute; left: 0; top: 0; z-index: -1; pointer-events: none; border-radius: 999px;
  transition: transform 0.42s var(--ease), width 0.42s var(--ease), height 0.42s var(--ease), opacity 0.2s;
  will-change: transform;
}
.sidebar.glides .glider { background: var(--bar-ink); }
.sidebar.glides .side-item.on { background: transparent; }
.side-item { transition: color 0.28s var(--ease-out), background-color 0.18s; }
.segments.glides .glider { background: var(--ink); }
.segments.glides button[aria-checked="true"] { background: transparent; }
.segments button { transition: color 0.3s var(--ease-out); }
.tabs.glides .glider { background: var(--ink); }
.tabs.glides [role="tab"][aria-selected="true"] { background: transparent; }
.tabs [role="tab"] { transition: color 0.3s var(--ease-out), background-color 0.18s; }

/* Menus grow out of where they were opened, and the highlight slides. */
.menu { animation: menu-in 0.18s var(--ease-out); position: fixed; isolation: isolate; }
.menu-lit {
  position: absolute; left: 6px; right: 6px; top: 0; z-index: -1; border-radius: 9px; background: var(--raised);
  opacity: 0; pointer-events: none;
  transition: transform 0.22s var(--ease), height 0.22s var(--ease), opacity 0.15s;
}
.menu [role="menuitem"]:hover, .menu [role="menuitem"]:focus { background: none; }
@keyframes menu-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

/* A page arriving. */
.screen.entering { animation: page-in 0.32s var(--ease-out); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Sheets settle rather than pop; the phone bar's chosen slot widens. */
.sheet { animation: sheet-in 0.32s var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.bottom-bar button { transition: flex-grow 0.38s var(--ease), background-color 0.25s, color 0.25s; }

/* Things that can be pressed answer the pointer. */
.card-row, .home-tile, .home-face, .locations-tile, .button, .circle-button, .filter, .chip {
  transition: background-color 0.18s, box-shadow 0.22s var(--ease-out), transform 0.16s var(--ease-out), color 0.18s;
}
a.card-row:active, button.card-row:active, .card-row[role="button"]:active, .locations-tile:active { transform: scale(0.99); }

@media (prefers-reduced-motion: reduce) {
  .glider, .menu-lit, .side-item, .segments button, .tabs [role="tab"], .bottom-bar button { transition: none; }
  .menu, .screen.entering, .sheet { animation: none; }
}
