/* RPP Central component styles. Values come from tokens.css; see docs/DESIGN.md.
   The few app-level constants tokens.css does not define are named once here. */

:root {
  --rail-w: 76px;
  --rail-link: 44px;
  --rail-drawer-w: 264px;
  --topbar-h: 66px;
  --page-header-sticky-inset: var(--space-3);  /* a sticky page header's padding, which its margins give back */
  --product-header-h: calc(var(--control-h-md) + 2 * var(--page-header-sticky-inset));  /* the product page's sticky header: its row between the sticky bar's insets */
  --control-h-xs: 32px;      /* segmented items, icon buttons over photos */
  --control-h-chip: 34px;    /* filter chips and topbar controls */
  --pill-h: 26px;
  --tag-h: 22px;             /* tags, the callout icon, the product badge */
  --inset-control: 14px;     /* side inset of fields and filter chips */
  --inset-pill: 10px;        /* dot-side inset of status pills; tags */
  --gap-control: 10px;       /* icon to label in buttons */
  --segment-gap: 2px;
  --toggle-w: 40px;
  --toggle-h: 22px;
  --toggle-thumb: 18px;
  --avatar-20: 20px; --avatar-24: 24px; --avatar-28: 28px; --avatar-32: 32px; --avatar-36: 36px; --avatar-40: 40px; --avatar-56: 56px; --avatar-64: 64px;
  --hairline: 1px;
  --dot: 6px;
  --pill-dot: 8px;
  --swatch: 10px;
  --divider-w: 28px;
  --cal-hour-h: 52px;
  --cal-col-min: 88px;       /* below it the time grid scrolls inside its card */
  --cal-event-min: 78px;     /* fits "12:45pm" or "12pm EXT"; with a column's insets, no more than --cal-col-min */
  --event-title-min: 4ch;    /* below this an entry's title drops out, "7 L…" */
  --cal-day-min-h: 112px;
  --mini-day-h: 28px;
  --filters-w: 300px;
  --event-bar-w: 3px;
  --tip-notch: 7px;
  --thumb-inset: 2px;
  --agenda-time-w: 56px;
  --file-tile-min: 200px;
  --file-tile-compact-min: 156px;  /* the order pages' tiles, as the boards draw them */
  --empty-desc-max: 360px;
  --title-max: 880px;
  --logo-h: 36px;            /* public header lock-up; minimum on screen is 24px */
  --public-w: 1040px;        /* the delivery board's 1440 less its 200px sides */
  --lede-max: 520px;         /* on two lines, as on the delivery board */
  --cover-h: clamp(400px, 52vh, 520px);  /* the delivery header over a cover, at least */
  --side-panel-w: 320px;
  --announcement-composer-w: 420px;  /* the composer beside the list, as on the Announcements board */
  --settings-nav-w: 240px;
  --section-head-min: 320px; /* before a settings card's actions wrap under its title */
  --integration-tile-min: 280px;  /* three side by side beside the settings nav from 1280px */
  --book-bar-h: 64px;
  --book-actions-h: 84px;
  --wizard-bar-h-fallback: 136px;  /* until wizard_bar_controller.js sets --wizard-bar-h */
  --book-pill-w: 28px;
  --book-w-narrow: 560px;
  --book-w-mid: 768px;
  --book-w-wide: 1024px;
  --slot-min-w: 96px;
  --hatch: 6px;
  --places-max-h: 280px;
  --unit-input-w: 120px;
  --bill-select-min: 240px;  /* before Custom line wraps under the product select */
  --profile-text-min: 240px; /* before the customer header's actions wrap under its name */
  --folder-name-min: 160px;  /* before a group folder's order pills wrap under its name */
  --customer-lifetime-w: 184px;  /* fits its header and a seven-figure average */
  --customer-last-shoot-w: 232px; /* fits a lapsed date and how long ago on one line */
  --member-role-w: 140px;
  --member-status-w: 110px;
  --role-admin-w: 140px;
  --role-photographer-w: 240px;
  --role-note-w: 200px;
  --alert-way-w: 64px;
  --time-select-w: 150px;
  --hours-day-w: 100px;
  --product-preview-w: 240px;
  --breakdown-title-w: 140px;    /* fits "Orders by status" */
  --report-panel-h: 260px;
  --service-card-min: 260px;  /* four across the team's Services at 1440, as the board draws them */
  --overlay-ink: color-mix(in srgb, var(--rpp-grey-900) 94%, transparent);
  --overlay-line: color-mix(in srgb, var(--color-surface) 22%, transparent);
  --overlay-chip: color-mix(in srgb, var(--color-surface) 50%, transparent);
  --overlay-scrim: color-mix(in srgb, var(--rpp-grey-900) 45%, transparent);  /* behind a dialog */
  --overlay-tile: color-mix(in srgb, var(--color-surface) 8%, transparent);  /* the lightbox's icon tiles */
  /* darkest where the type sits, so the photo shows yet the type stays legible over a bright sky */
  --overlay-cover:
    linear-gradient(90deg, color-mix(in srgb, var(--rpp-grey-900) 80%, transparent) 0%, color-mix(in srgb, var(--rpp-grey-900) 60%, transparent) 45%, color-mix(in srgb, var(--rpp-grey-900) 20%, transparent) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--rpp-grey-900) 40%, transparent) 0%, transparent 30%, transparent 55%, color-mix(in srgb, var(--rpp-grey-900) 55%, transparent) 100%);
  --book-dialog-w: 640px;
  --confirm-dialog-w: 480px;
  --area-map-h: 420px;
  --area-overview-h: 520px;
  --area-cards-w: 300px;
  --place-map-h: 240px;
  --run-map-h: 820px;
  --run-map-h-narrow: 520px;
  --run-card-w: 460px;
  --run-line-w: 4px;         /* read by run_map_controller.js */
  --area-pick: 28px;
  --area-ring: 2px;          /* gap and ring around the chosen colour */
  --check-list-max-h: 220px;
  --tab-underline: 2px;
  --status-property-min: 176px;  /* fits the widest status select, "Not started" */
  --status-date-w: 72px;
  --status-notes-w: 48px;
  --status-cell-min: 124px;
  --task-tile-min: 136px;        /* fits its name and the widest status, "Not started", with its chevron */
  --cover-w: 280px;
  --notifications-w: 400px;      /* the bell's panel */
  --badge-h: 18px;               /* the bell's unread count */
  --search-w: 480px;
  --search-panel-w: 560px;
  --chart-line: 2px;             /* a chart's lines and their legend keys */
  --field-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2382878C' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");  /* grey-600: a data URL can't read a token */
  --field-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2382878C' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E");  /* grey-600 */
  --field-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2382878C' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");  /* grey-600 */
}

*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--font-sans); font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-light); color: var(--color-text-body); background: var(--color-bg); -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100vh; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); }
a:not([class]) { font-weight: var(--weight-medium); }  /* classed links style themselves */
h1, h2, h3, p, ul, ol { margin: 0; }
h1, h2, h3 { color: var(--color-text); }
button, input, select, textarea { font: inherit; color: inherit; }
strong, b { font-weight: var(--weight-medium); }  /* the brand has no bold; never let the browser fake one */
img { max-width: 100%; height: auto; }
.icon { flex: none; vertical-align: middle; }
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.rail { width: var(--rail-w); flex: none; display: flex; flex-direction: column; align-items: center; padding: var(--space-4) 0; background: var(--color-surface); border-right: var(--hairline) solid var(--color-border); position: sticky; top: 0; height: 100vh; z-index: 6; }  /* over Upload to Editor's pinned bar, so a rail tip shows */
.rail-logo img { height: var(--space-8); width: auto; display: block; }
.rail-nav { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); margin-top: var(--space-4); flex: 1; }
.rail-divider { width: var(--divider-w); height: var(--hairline); background: var(--color-border); margin: var(--space-2) 0; }
.rail-foot { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.rail-foot form { margin: 0; }
.rail-link { position: relative; display: flex; align-items: center; justify-content: center; width: var(--rail-link); height: var(--rail-link); border-radius: var(--radius-tile); color: var(--color-text-muted); background: transparent; border: 0; cursor: pointer; transition: background var(--duration-fast) var(--easing-standard), color var(--duration-fast) var(--easing-standard); }
.rail-link:hover { background: var(--color-surface-alt); color: var(--color-text); }
.rail-link.active { background: var(--color-primary); color: var(--color-text-inverse); box-shadow: var(--shadow-glow); }
.rail-link.active:hover { background: var(--color-primary-hover); color: var(--color-text-inverse); }
.rail-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.rail-tip { position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%) translateX(-4px); background: var(--rpp-grey-900); color: var(--color-text-inverse); font-size: var(--text-xs); font-weight: var(--weight-medium); line-height: var(--lh-xs); padding: var(--space-1) var(--space-2); border-radius: var(--radius-card); box-shadow: var(--shadow-md); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--duration-fast) var(--easing-standard), transform var(--duration-fast) var(--easing-standard); z-index: 20; }
.rail-tip::before { content: ""; position: absolute; left: calc(-1 * var(--tip-notch) / 2); top: 50%; width: var(--tip-notch); height: var(--tip-notch); margin-top: calc(-1 * var(--tip-notch) / 2); background: inherit; transform: rotate(45deg); }
.rail-link:hover .rail-tip, .rail-link:focus-visible .rail-tip { opacity: 1; transform: translateY(-50%) translateX(0); }
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rail-toggle, .rail-scrim { display: none; }
/* Phone: the rail becomes a drawer with its labels shown. */
@media (max-width: 600px) {
  .rail { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; height: auto; width: var(--rail-drawer-w); align-items: stretch; padding: var(--space-4) var(--space-3); overflow-y: auto; box-shadow: var(--shadow-lg); transform: translateX(-100%); visibility: hidden; transition: transform var(--duration-normal) var(--easing-standard), visibility 0s linear var(--duration-normal); }
  .rail-open .rail { transform: none; visibility: visible; transition: transform var(--duration-normal) var(--easing-standard); }
  .rail-scrim { position: fixed; z-index: 39; inset: 0; background: var(--overlay-scrim); }
  .rail-open .rail-scrim { display: block; }
  .rail-logo { padding: 0 var(--space-3); }
  .rail-nav, .rail-foot { align-items: stretch; }
  .rail-divider { width: auto; margin: var(--space-2) var(--space-3); }
  .rail-link { width: auto; justify-content: flex-start; gap: var(--space-3); padding: 0 var(--space-3); }
  .rail-tip { position: static; opacity: 1; transform: none; background: none; color: inherit; box-shadow: none; padding: 0; font-size: var(--text-sm); line-height: var(--lh-sm); }
  .rail-tip::before { display: none; }
  .rail-link:hover .rail-tip, .rail-link:focus-visible .rail-tip { transform: none; }
  .rail-foot > .avatar { margin-left: var(--space-3); }
  .rail-foot form .rail-link { width: 100%; }
  .rail-toggle { display: inline-flex; align-items: center; justify-content: center; width: var(--control-h-chip); height: var(--control-h-chip); margin-left: calc(-1 * var(--space-2)); padding: 0; border: 0; border-radius: var(--radius-tile); background: transparent; color: var(--color-text); cursor: pointer; flex: none; }
  .rail-toggle:hover { background: var(--color-surface-alt); }
  .rail-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); height: var(--topbar-h); padding: 0 var(--space-8); border-bottom: var(--hairline) solid var(--color-border); background: var(--color-surface); }
.eyebrow { font-size: var(--text-xs); line-height: var(--lh-eyebrow); font-weight: var(--weight-medium); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-primary); }
.topbar-eyebrow { font-size: var(--text-xs); line-height: var(--lh-eyebrow); font-weight: var(--weight-medium); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-subtle); white-space: nowrap; flex: none; }  /* the workspace chip gives way first */
.topbar-chip { display: flex; align-items: center; gap: var(--space-2); max-width: 100%; height: var(--control-h-chip); padding: 0 var(--space-2) 0 var(--space-1); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-pill); background: var(--color-surface); box-shadow: var(--shadow-sm); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text); min-width: 0; list-style: none; cursor: pointer; transition: border-color var(--duration-fast) var(--easing-standard); }  /* the avatar sits inside the pill's curve */
.topbar-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.topbar-actions > .menu { flex: none; }
.topbar-actions > .account-menu { flex: 0 1 auto; min-width: 0; max-width: var(--side-panel-w); }
.topbar-clocks { display: inline-flex; align-items: center; gap: var(--space-2); height: var(--control-h-chip); padding: 0 var(--space-3); border-radius: var(--radius-pill); background: var(--color-surface-alt); font-size: var(--text-xs); color: var(--color-text); white-space: nowrap; }
@media (max-width: 600px) { .topbar-clocks { display: none; } }
.topbar-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--control-h-chip); height: var(--control-h-chip); border-radius: var(--radius-pill); color: var(--color-text); list-style: none; cursor: pointer; transition: background var(--duration-fast) var(--easing-standard); }
.topbar-icon::-webkit-details-marker, .topbar-chip::-webkit-details-marker { display: none; }
.topbar-icon:hover, .menu[open] > .topbar-icon { background: var(--color-surface-alt); }
.topbar-icon:focus-visible, .topbar-chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.topbar-badge { position: absolute; top: calc(-1 * var(--space-1)); right: calc(-1 * var(--space-1)); min-width: var(--badge-h); height: var(--badge-h); padding: 0 var(--space-1); border-radius: var(--radius-pill); background: var(--color-primary); color: var(--color-text-inverse); font-size: var(--text-xs); line-height: var(--badge-h); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; text-align: center; }
.topbar-chip:hover, .menu[open] > .topbar-chip { border-color: var(--color-border-strong); }
.topbar-chip > .icon { color: var(--color-text-subtle); }
.dot { display: inline-block; width: var(--dot); height: var(--dot); border-radius: var(--radius-circle); background: var(--color-primary); flex: none; }
.page { padding: var(--space-8); width: 100%; }
/* Below 960px the menus open from the whole group's right edge, so the bell's wide panel stays on screen. */
@media (max-width: 960px) {
  .topbar-actions { position: relative; }
  .topbar-actions > .menu { position: static; }
  .topbar-actions .menu-panel { max-width: calc(100vw - 2 * var(--space-4)); }
}
@media (max-width: 600px) {
  .topbar, .page { padding-left: var(--space-4); padding-right: var(--space-4); }
  .page { padding-top: var(--space-6); }
  .topbar { justify-content: flex-start; gap: var(--space-2); }
  .topbar-actions { flex: none; margin-left: auto; }  /* on a narrow phone the eyebrow shortens instead */
  .topbar-eyebrow { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .topbar-chip-name { display: none; }  /* the account menu names the organisation */
}

/* ---------- Topbar search (⌘K) ---------- */
.topbar-search { position: relative; flex: 0 1 var(--search-w); min-width: 0; margin-right: auto; }
.search-open { display: none; padding: 0; border: 0; background: none; }  /* the phone's button */
.search-box { position: relative; background: var(--color-surface); }
.search-field .input { padding-right: var(--space-16); }  /* room for the hint, "Ctrl K" the widest */
.search-field .input:not(:placeholder-shown) { padding-right: var(--inset-control); }  /* typing: the clear button sits at the field's edge */
.search-field .input::-webkit-search-cancel-button { cursor: pointer; }
.search-kbd { position: absolute; right: var(--space-3); top: 50%; transform: translateY(-50%); padding: 0 var(--space-1); border: var(--hairline) solid var(--color-border-strong); border-radius: var(--radius-field); font-family: inherit; font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text-subtle); pointer-events: none; }
.search-field .input:not(:placeholder-shown) ~ .search-kbd { display: none; }  /* the field's clear button takes its place */
.search-panel { position: absolute; top: calc(100% + var(--space-1)); left: 0; z-index: 30; width: max(100%, var(--search-panel-w)); max-height: calc(100vh - var(--topbar-h) - var(--space-6)); overflow-y: auto; padding: var(--space-3); background: var(--color-surface); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); box-shadow: var(--shadow-pop); }
.search-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); padding-bottom: var(--space-3); }
.search-list { display: flex; flex-direction: column; }
.search-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-field); color: var(--color-text); cursor: pointer; }
.search-row:hover { color: var(--color-text); }
.search-row.is-active { background: var(--color-surface-alt); }
.search-row-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.search-row-title, .search-row-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-row-title { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); }
.search-row-meta { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); }
.search-show-all, .search-show-all:hover { gap: var(--space-2); font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-primary); }
.search-show-all.is-active { color: var(--color-primary-hover); }
.search-none { padding: var(--space-2) var(--space-3); font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-text-muted); }
.search-panel .empty { padding: var(--space-6) var(--space-4); }
/* Below 960px the panel spans the topbar, clear of the rail and the menus. */
@media (max-width: 960px) {
  .topbar { position: relative; }
  .topbar-search, .search-box { position: static; }
  .search-panel { top: calc(100% - var(--space-2)); left: var(--space-8); right: var(--space-8); width: auto; }
  .topbar-search ~ .topbar-actions { flex: none; }
  .topbar-search ~ .topbar-actions .topbar-chip-name { display: none; }
}
/* Phone: the field folds into a button, 4px from the menus so it fits beside the longest eyebrow. */
@media (max-width: 600px) {
  .topbar:has(.topbar-search), .topbar-search ~ .topbar-actions { gap: var(--space-1); }
  .topbar-search { flex: none; margin-left: auto; margin-right: 0; }
  .topbar-search ~ .topbar-actions { margin-left: 0; }
  .search-open { display: inline-flex; }
  .search-box { display: none; }
  .topbar-search.is-expanded .search-box { display: block; position: absolute; z-index: 31; top: calc((var(--topbar-h) - var(--control-h-md)) / 2); left: var(--space-4); right: var(--space-4); }
  .search-kbd { display: none; }
  .search-field .input { padding-right: var(--inset-control); }
  .search-panel { top: calc(100% + var(--space-1)); left: 0; right: 0; }
  .search-row .search-row-icon { display: none; }
  .search-row-title, .search-row-meta { white-space: normal; overflow-wrap: anywhere; }
}

/* ---------- Page header ---------- */
.breadcrumb { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text-subtle); margin-bottom: var(--space-2); }
.breadcrumb .icon { color: var(--color-text-disabled); }
.breadcrumb-current { min-width: 0; overflow-wrap: anywhere; color: var(--color-text-muted); font-weight: var(--weight-medium); }
.record-header > .breadcrumb { margin-bottom: var(--space-5); }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4) var(--space-6); margin-bottom: var(--space-6); }
/* On the page ground, so what scrolls under it is covered; the margins give back the insets, leaving the header where it stood. */
.page-header-sticky { position: sticky; top: 0; z-index: 5; background: var(--color-bg); border-bottom: var(--hairline) solid var(--color-border); padding: var(--page-header-sticky-inset) 0; margin-top: calc(-1 * var(--page-header-sticky-inset)); margin-bottom: calc(var(--space-6) - var(--page-header-sticky-inset)); }
.page-header > div:first-child { min-width: 0; }
.page-header .eyebrow { margin-bottom: var(--space-2); }
.page-title-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.page-title { font-weight: var(--weight-light); font-size: var(--text-h3); line-height: var(--lh-h3); letter-spacing: var(--tracking-heading); }
.page-title-greeting { font-size: var(--text-h2); line-height: var(--lh-h2); }
.page-subtitle { color: var(--color-text-body); font-size: var(--text-base); line-height: var(--lh-base); margin-top: var(--space-2); display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.page-header .page-actions, .record-card-bar > .page-actions, .record-actions { gap: var(--space-3); }
.page-actions form { margin: 0; }

/* ---------- Layout helpers ---------- */
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--space-2); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-panel-w); gap: var(--space-6); align-items: start; }
@media (max-width: 960px) { .grid-2, .grid-3, .detail { grid-template-columns: minmax(0, 1fr); } }
.muted { color: var(--color-text-muted); }
.hint { color: var(--color-text-subtle); font-size: var(--text-xs); line-height: var(--lh-xs); }
.num { font-variant-numeric: tabular-nums; }
.prewrap { white-space: pre-wrap; }

/* ---------- Card ---------- */
.card { background: var(--color-surface); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: var(--space-6); }
.card-flush { padding: 0; overflow: hidden; }
.card:has(.table):not(:has(.menu)) { position: relative; overflow-x: auto; }  /* a row menu would be clipped, so a card with one keeps the page scroll; relative, or a header's visually hidden label, being absolute, escapes the scroll box and widens the page */
.card-flush > .empty { padding: var(--space-10) var(--space-6); }
.card-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-lg); line-height: var(--lh-lg); font-weight: var(--weight-light); letter-spacing: var(--tracking-heading); margin-bottom: var(--space-4); }
.card-title .icon { color: var(--color-text-subtle); }
.card-title .pill { margin-left: var(--space-1); }
.card-title .count { font-size: var(--text-sm); font-weight: var(--weight-light); }
.count { font-size: var(--text-xs); font-weight: var(--weight-medium); letter-spacing: 0; color: var(--color-text-subtle); font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--gap-control); height: var(--control-h-md); padding: 0 var(--space-5); border-radius: var(--radius-button); border: var(--hairline) solid transparent; font-size: var(--text-sm); font-weight: var(--weight-medium); line-height: 1; cursor: pointer; white-space: nowrap; transition: background var(--duration-fast) var(--easing-standard), border-color var(--duration-fast) var(--easing-standard), color var(--duration-fast) var(--easing-standard), transform var(--duration-normal) var(--easing-standard); text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(var(--press-scale)); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled { cursor: default; }
.btn-sm { height: var(--control-h-sm); padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn-lg { height: var(--control-h-lg); padding: 0 var(--space-8); font-size: var(--text-base); }
.btn-block { width: 100%; }
.btn-icon { width: var(--control-h-md); height: var(--control-h-md); padding: 0; }
.btn-icon.btn-sm { width: var(--control-h-sm); height: var(--control-h-sm); }
.btn-primary { background: var(--color-primary); color: var(--color-text-inverse); box-shadow: var(--shadow-glow); }
.btn-primary:hover { background: var(--color-primary-hover); color: var(--color-text-inverse); }
.btn-primary:disabled { background: var(--rpp-orange-100); color: var(--color-text-inverse); box-shadow: none; }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--rpp-orange-100); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--color-surface-alt); color: var(--color-text); border-color: var(--rpp-orange-200); }
.btn-secondary:disabled { color: var(--color-text-disabled); border-color: var(--color-border); box-shadow: none; }
.btn-secondary .icon:last-child:not(:only-child) { color: var(--color-primary); }
.btn-secondary[aria-current="true"], .btn-secondary[aria-current="true"]:hover, .choice-chip:has(:checked), .choice-chip:has(:checked):hover, .delivery-chip[aria-pressed="true"],
.folder-chip:has(> [aria-current="true"]), .folder-chip:has(> [aria-current="true"]):hover { background: var(--color-primary-tint); border-color: var(--color-primary); color: var(--rpp-orange-900); }
.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { background: var(--color-surface-alt); color: var(--color-text); }
.btn-danger { background: var(--color-surface); color: var(--color-primary-hover); border-color: var(--rpp-orange-200); }
.btn-danger:hover { background: var(--rpp-orange-100); color: var(--color-primary-hover); }
.btn-inverse { background: transparent; color: var(--color-text-inverse); border-color: var(--overlay-line); }
.btn-inverse:hover, .menu[open] > .btn-inverse { background: var(--overlay-line); color: var(--color-text-inverse); }
.btn-inverse:disabled { background: transparent; color: var(--overlay-chip); }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.label { font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text); }
.input, .select { height: var(--control-h-md); padding: 0 var(--inset-control); border: var(--hairline) solid var(--color-border-strong); border-radius: var(--radius-field); background: var(--color-surface); box-shadow: var(--shadow-sm); width: 100%; font-size: var(--text-sm); color: var(--color-text); transition: border-color var(--duration-fast) var(--easing-standard), box-shadow var(--duration-fast) var(--easing-standard); }
.input:focus, .select:focus { outline: none; border-color: var(--color-primary); box-shadow: var(--focus-ring); }
.input::placeholder { color: var(--color-text-subtle); }
.input-sm { height: var(--control-h-sm); font-size: var(--text-sm); }
.input-static, .appointment-form .input[readonly] { background: var(--color-surface-alt); color: var(--color-text-muted); border-color: var(--color-border); box-shadow: none; }
.input-static { display: flex; align-items: center; }
.appointment-form .input[readonly]:focus { border-color: var(--color-primary); box-shadow: var(--focus-ring); }
.textarea { height: auto; padding: var(--space-2) var(--inset-control); resize: vertical; line-height: var(--lh-sm); }
.textarea-fit { field-sizing: content; }  /* a browser without field-sizing keeps the rows it is drawn with */
.select { appearance: none; padding-right: var(--space-10); background-image: var(--field-chevron); background-repeat: no-repeat; background-position: right var(--inset-control) center; }
/* The select runs to the shell's end, so a press there opens it. */
.select-field { display: inline-flex; align-items: center; gap: var(--space-2); max-width: 100%; height: var(--control-h-md); padding-left: var(--inset-control); border: var(--hairline) solid var(--color-border-strong); border-radius: var(--radius-field); background: var(--color-surface); box-shadow: var(--shadow-sm); font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-text-muted); transition: border-color var(--duration-fast) var(--easing-standard), box-shadow var(--duration-fast) var(--easing-standard); }
.select-field:focus-within { border-color: var(--color-primary); box-shadow: var(--focus-ring); }
.select-field .select, .select-field .select:focus { height: 100%; min-width: 0; padding-left: 0; border: 0; box-shadow: none; background-color: transparent; font-weight: var(--weight-medium); field-sizing: content; }
/* The browser's own picker button is stretched, unseen, over the whole field, so a press anywhere opens it
   (Chrome and Edge; Safari has no button, Firefox keeps its own). */
.input:is([type="date"], [type="time"]) { position: relative; padding-left: var(--space-10); background-repeat: no-repeat; background-position: left var(--inset-control) center; }
.input[type="date"] { background-image: var(--field-calendar); }
.input[type="time"] { padding-right: var(--space-10); background-image: var(--field-clock), var(--field-chevron); background-position: left var(--inset-control) center, right var(--inset-control) center; }
.input:is([type="date"], [type="time"])::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.picker-field { display: flex; align-items: center; padding-left: var(--space-10); background-repeat: no-repeat; background-position: left var(--inset-control) center; text-align: left; cursor: pointer; }
.picker-field-date { background-image: var(--field-calendar); }
.picker-field-time { padding-right: var(--space-10); background-image: var(--field-clock), var(--field-chevron); background-position: left var(--inset-control) center, right var(--inset-control) center; }
.picker-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-empty { color: var(--color-text-subtle); }
.picker:has(.picker-panel:popover-open) .picker-field { border-color: var(--color-primary); box-shadow: var(--focus-ring); }
/* Placed under the field by picker_field.js. */
.picker-panel { inset: auto; margin: 0; padding: var(--space-3); background: var(--color-surface); color: var(--color-text); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); box-shadow: var(--shadow-pop); }
.calendar-pick-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.calendar-pick-title { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); }
.calendar-pick-grid { border-collapse: collapse; }
.calendar-pick-grid th { height: var(--control-h-sm); font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-regular); color: var(--color-text-muted); }
.calendar-pick-grid td { padding: 0; }
.calendar-pick-day { display: grid; place-items: center; width: var(--control-h-md); height: var(--control-h-md); padding: 0; border: 0; border-radius: var(--radius-field); background: none; font-size: var(--text-sm); color: var(--color-text); cursor: pointer; }
.calendar-pick-day:hover { background: var(--color-surface-alt); }
.calendar-pick-day:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.calendar-pick-day.is-outside { color: var(--color-text-subtle); }
.calendar-pick-day[aria-current="date"] { color: var(--color-primary); font-weight: var(--weight-medium); }
.calendar-pick-day[aria-pressed="true"] { background: var(--color-primary); color: var(--color-text-inverse); }
.calendar-pick-day:disabled { background: none; color: var(--color-text-disabled); cursor: default; }
/* Seven times show at once, as time_picker_controller.js's TIMES_PER_PAGE assumes. */
.time-pick { padding: var(--space-1); }
.time-pick-list { position: relative; max-height: calc(7 * var(--control-h-md)); margin: 0; padding: 0; overflow-y: auto; scrollbar-width: none; list-style: none; }
.time-pick-option { display: flex; align-items: center; min-height: var(--control-h-md); padding: 0 var(--space-3); border-radius: var(--radius-field); font-size: var(--text-sm); cursor: pointer; }
.time-pick-option:hover, .time-pick-option:focus { outline: none; background: var(--color-surface-alt); }
.time-pick-option[aria-selected="true"] { background: var(--rpp-orange-100); font-weight: var(--weight-medium); }
.time-pick-scroll { position: absolute; left: var(--space-1); right: var(--space-1); z-index: 1; display: flex; justify-content: center; padding: var(--space-1) 0; background: var(--color-surface); color: var(--color-text-muted); }
.time-pick-scroll:first-child { top: var(--space-1); }
.time-pick-scroll:last-child { bottom: var(--space-1); }
.check { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); line-height: var(--lh-sm); }
.check input { width: var(--space-4); height: var(--space-4); accent-color: var(--color-primary); }
.form-actions { display: flex; justify-content: flex-end; gap: var(--space-2); padding-top: var(--space-2); }
.form-actions.start { justify-content: flex-start; }
.form-actions.column { flex-direction: column; }
.form-actions > .hint { align-self: center; }
.phone-field { display: grid; grid-template-columns: var(--unit-input-w) minmax(0, 1fr); gap: var(--space-2); }
.inline-form { display: flex; gap: var(--space-2); align-items: center; margin-top: var(--space-4); }
.inline-form.tight { margin-top: 0; }
.inline-form .input, .inline-form .select { flex: 1; min-width: 0; }
.inline-form .select { flex: 0 1 180px; }
@media (max-width: 600px) { .inline-form { flex-wrap: wrap; } .inline-form .input { flex-basis: 100%; } }
.segmented { display: inline-flex; align-self: flex-start; border: var(--hairline) solid var(--color-border); border-radius: var(--radius-pill); padding: var(--space-1); gap: var(--segment-gap); background: var(--color-surface); box-shadow: var(--shadow-sm); }
.segment { position: relative; }
.segment input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segment input + span, a.segment { display: inline-flex; align-items: center; gap: var(--space-2); height: var(--control-h-xs); padding: 0 var(--space-4); border-radius: var(--radius-pill); font-size: var(--text-sm); line-height: 1; font-weight: var(--weight-medium); color: var(--color-text); transition: background var(--duration-fast) var(--easing-standard), color var(--duration-fast) var(--easing-standard); }
a.segment:hover { background: var(--color-surface-alt); color: var(--color-text); }
.segment input:checked + span, a.segment[aria-current], a.segment[aria-current]:hover { background: var(--color-primary); color: var(--color-text-inverse); box-shadow: var(--shadow-glow); }
.segment input:focus-visible + span, a.segment:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.choice-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.choice-chip { position: relative; display: inline-flex; align-items: center; min-width: 0; max-width: 100%; height: var(--control-h-chip); padding: 0 var(--inset-control); border: var(--hairline) solid var(--color-border-strong); border-radius: var(--radius-pill); background: var(--color-surface); font-size: var(--text-sm); line-height: 1; font-weight: var(--weight-medium); color: var(--color-text-body); white-space: nowrap; cursor: pointer; transition: background var(--duration-fast) var(--easing-standard), border-color var(--duration-fast) var(--easing-standard), color var(--duration-fast) var(--easing-standard); }
.choice-chip:hover { background: var(--color-surface-alt); color: var(--color-text); }
.choice-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }  /* the chip's title has the whole name */
.choice-chip:has(:focus-visible) { box-shadow: var(--focus-ring); }
.quick-add-chip { gap: var(--space-1); }
.quick-add-chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---------- Status pill and tag ---------- */
.pill { display: inline-flex; align-items: center; gap: var(--space-2); height: var(--pill-h); padding: 0 var(--space-3) 0 var(--inset-pill); border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: var(--weight-medium); line-height: 1; letter-spacing: 0; color: var(--rpp-grey-900); white-space: nowrap; --pill-dot-color: var(--rpp-grey-400); }
.pill::before { content: ""; width: var(--pill-dot); height: var(--pill-dot); border-radius: var(--radius-circle); background: var(--pill-dot-color); flex: none; }
.pill-neutral { background: var(--status-neutral-bg); --pill-dot-color: var(--rpp-grey-400); }
.pill-info { background: var(--status-blue-bg); --pill-dot-color: var(--status-blue); }
.pill-warning { background: var(--status-yellow-bg); --pill-dot-color: var(--status-yellow); }
.pill-success { background: var(--status-green-bg); --pill-dot-color: var(--status-green); }
.pill-danger { background: var(--rpp-orange-100); --pill-dot-color: var(--rpp-orange-500); }
.pill-off { background: var(--status-off-bg); color: var(--status-off-fg); --pill-dot-color: var(--rpp-grey-400); }
.tag { display: inline-flex; align-items: center; height: var(--tag-h); padding: 0 var(--inset-pill); border-radius: var(--radius-pill); background: var(--rpp-grey-200); color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-medium); line-height: 1; letter-spacing: 0; white-space: nowrap; }
.tag-remove { display: inline-flex; margin: 0 calc(-1 * var(--space-1)) 0 var(--space-1); padding: 0; border: 0; border-radius: var(--radius-circle); background: none; color: var(--color-text-subtle); cursor: pointer; }
.tag-remove:hover { color: var(--color-text); }
.tag-remove:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.tag-outline { height: var(--pill-h); background: var(--color-surface); border: var(--hairline) solid var(--color-border-strong); }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); line-height: var(--lh-sm); }
.table th { text-align: left; font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text-muted); padding: var(--space-2) var(--space-3); background: var(--color-surface-alt); border-bottom: var(--hairline) solid var(--color-border); }
.table td { color: var(--color-text); padding: var(--space-3); border-bottom: var(--hairline) solid var(--color-surface-alt); vertical-align: middle; }
.table td.muted { color: var(--color-text-muted); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--color-surface-alt); }
.table tfoot td { border-top: var(--hairline) solid var(--color-border-strong); border-bottom: 0; padding-top: var(--space-3); }
.table tfoot tr + tr td { border-top: 0; padding-top: 0; }
.card-flush .table th:first-child, .card-flush .table td:first-child { padding-left: var(--space-6); }
.card-flush .table th:last-child, .card-flush .table td:last-child { padding-right: var(--space-6); }
.card:not(.card-flush) > .table { margin: 0 calc(-1 * var(--space-6)); width: calc(100% + 2 * var(--space-6)); }
.card:not(.card-flush) > .table th:first-child, .card:not(.card-flush) > .table td:first-child { padding-left: var(--space-6); }
.card:not(.card-flush) > .table th:last-child, .card:not(.card-flush) > .table td:last-child { padding-right: var(--space-6); }
.card:not(.card-flush) > .table:last-child { margin-bottom: calc(-1 * var(--space-6)); }
.row-action { text-align: right; white-space: nowrap; }
.row-action form { display: inline-block; margin: 0; }
.row-action .app-dialog { white-space: normal; text-align: left; }  /* a dialog opened from a row's menu lives in its cell */
.link-strong { color: var(--color-text); font-weight: var(--weight-medium); }
.link-strong:hover { color: var(--color-primary); }
.text-strong { font-weight: var(--weight-medium); color: var(--color-text); }
.with-avatar { display: inline-flex; align-items: center; gap: var(--space-2); }
.cell-stack { display: flex; flex-direction: column; line-height: var(--lh-sm); }
.cell-sub { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); }
.qty-col { width: 90px; text-align: right; }
.qty { width: 72px; text-align: right; }
.tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag.finals-changed { background: var(--tint-orange-bg); color: var(--tint-orange-fg); }
.line-addon { display: flex; flex-direction: column; padding-left: var(--space-4); color: var(--color-text-body); }
.num-col { width: 110px; text-align: right; }
.total-label { text-align: right; font-weight: var(--weight-medium); }
.total-value { font-weight: var(--weight-medium); font-size: var(--text-base); color: var(--color-text); }

/* ---------- Avatar ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-circle); color: var(--color-text-inverse); font-weight: var(--weight-medium); letter-spacing: 0.3px; flex: none; width: var(--avatar-size); height: var(--avatar-size); font-size: calc(var(--avatar-size) * 0.4); }
.avatar-20 { --avatar-size: var(--avatar-20); }
.avatar-24 { --avatar-size: var(--avatar-24); }
.avatar-28 { --avatar-size: var(--avatar-28); }
.avatar-32 { --avatar-size: var(--avatar-32); }
.avatar-36 { --avatar-size: var(--avatar-36); }
.avatar-40 { --avatar-size: var(--avatar-40); }
.avatar-56 { --avatar-size: var(--avatar-56); }
.avatar-64 { --avatar-size: var(--avatar-64); }
.avatar-tint-1, .swatch-1 { background: var(--rpp-orange-500); }
.avatar-tint-2, .swatch-2 { background: var(--tint-blue-fg); }
.avatar-tint-3, .swatch-3 { background: var(--status-green-fg); }
.avatar-tint-4, .swatch-4 { background: var(--tint-purple-fg); }
.avatar-tint-5, .swatch-5 { background: var(--tint-amber-fg); }
.avatar-tint-6, .swatch-6 { background: var(--rpp-grey-800); }
.avatar-brand { background: var(--rpp-orange-100); color: var(--rpp-orange-900); }  /* on customer-facing pages, where identity colours never go */
.avatar-photo { background: var(--color-surface-alt); overflow: hidden; }
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.swatch-0 { background: var(--rpp-grey-400); }
/* An open area, hatched as the territory maps draw it. */
.swatch-hatched { background: repeating-linear-gradient(45deg, var(--rpp-grey-300) 0 2px, var(--color-surface-alt) 2px 5px); box-shadow: inset 0 0 0 var(--hairline) var(--rpp-grey-400); }

/* ---------- Callout ---------- */
.callout { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-card); border: var(--hairline) solid color-mix(in srgb, currentColor 35%, transparent); font-size: var(--text-sm); line-height: var(--lh-sm); margin-bottom: var(--space-4); }
.callout-icon { display: inline-flex; align-items: center; justify-content: center; width: var(--tag-h); height: var(--tag-h); border-radius: var(--radius-circle); background: var(--overlay-chip); flex: none; margin-top: -1px; }
.callout-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.callout-title { font-weight: var(--weight-medium); }
.callout-info { background: var(--status-blue-bg); color: var(--status-blue-fg); }
.callout-warning { background: var(--status-yellow-bg); color: var(--status-yellow-fg); }
.callout-success { background: var(--status-green-bg); color: var(--status-green-fg); }
.callout-danger { background: var(--rpp-orange-100); color: var(--rpp-orange-900); }
.callout .prewrap { margin-top: var(--space-1); }
.callout a { color: inherit; text-decoration: underline; }

/* ---------- Empty state ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--space-8) var(--space-4); gap: var(--space-1); }
.empty-glyph { width: var(--space-16); height: var(--space-16); border-radius: var(--radius-circle); background: var(--color-primary-wash); color: var(--color-primary-hover); display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-3); }
.empty-title { font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--color-text); }
.empty-desc { color: var(--color-text-muted); font-size: var(--text-sm); line-height: var(--lh-sm); max-width: var(--empty-desc-max); }
.empty-action { margin-top: var(--space-3); }
/* In a form: quiet, so the dialog's orange stays on its step and its Continue. */
.empty-boxed { border: var(--hairline) dashed var(--color-border-strong); border-radius: var(--radius-card); padding: var(--space-8); }
.empty-boxed .empty-glyph { width: var(--rail-link); height: var(--rail-link); border-radius: var(--radius-tile); background: var(--color-surface-alt); color: var(--color-text); margin-bottom: var(--space-2); }
.empty-boxed .empty-title { font-size: var(--text-sm); line-height: var(--lh-sm); }
.empty-boxed .empty-desc { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); }

/* ---------- Lists, menus, steps ---------- */
.list { list-style: none; padding: 0; display: flex; flex-direction: column; font-size: var(--text-sm); line-height: var(--lh-sm); }
.list li { color: var(--color-text); display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: var(--hairline) solid var(--color-surface-alt); }
.list li:last-child { border-bottom: 0; }
.list form { margin: 0; }
.steps { padding-left: var(--space-5); color: var(--color-text-muted); font-size: var(--text-sm); line-height: var(--lh-sm); display: flex; flex-direction: column; gap: var(--space-2); }
.menu { position: relative; display: inline-block; }
.menu-panel { position: absolute; right: 0; top: calc(100% + var(--space-1)); z-index: 30; width: 240px; padding: var(--space-3); background: var(--color-surface); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: var(--space-3); text-align: left; }
.menu-panel form { margin: 0; }
.menu-panel .btn { width: 100%; }
.disclosure > summary { list-style: none; display: inline-flex; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure[open] > summary { margin-bottom: var(--space-3); }
code { font-size: var(--text-xs); font-variant-numeric: tabular-nums; background: var(--color-surface-alt); padding: 1px var(--space-1); border-radius: var(--radius-xs); }

/* ---------- Auth ---------- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: var(--space-6); }
.auth { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: var(--space-6); }
.auth-logo { height: var(--control-h-lg); width: auto; }
.auth-card { width: 100%; padding: var(--space-8); }
.auth-title { font-weight: var(--weight-light); font-size: var(--text-lg); line-height: var(--lh-lg); letter-spacing: var(--tracking-heading); }
.auth-sub { color: var(--color-text-muted); margin: var(--space-2) 0 var(--space-6); }

/* ---------- Filter bar, tabs, stats ---------- */
.filter-bar { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-4); flex-wrap: wrap; }
.search { position: relative; flex: 0 1 320px; }
.search .icon { position: absolute; left: var(--inset-control); top: 50%; transform: translateY(-50%); color: var(--color-text-subtle); pointer-events: none; }  /* a press on it reaches the field */
.search .input { padding-left: var(--space-10); }
.tabs-pill { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.tab-pill, .filter-toggle { display: inline-flex; align-items: center; gap: var(--space-2); height: var(--control-h-chip); padding: 0 var(--inset-control); border-radius: var(--radius-pill); border: var(--hairline) solid var(--color-border-strong); background: var(--color-surface); box-shadow: var(--shadow-sm); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text-muted); transition: background var(--duration-fast) var(--easing-standard), color var(--duration-fast) var(--easing-standard), border-color var(--duration-fast) var(--easing-standard); }
.tab-pill:hover, .filter-toggle:hover { background: var(--color-surface-alt); color: var(--color-text); }
.tab-pill.active, .filter-toggle:has(:checked) { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-text-inverse); box-shadow: var(--shadow-glow); }
.tab-pill.active:hover, .filter-toggle:has(:checked):hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: var(--color-text-inverse); }
.tab-pill .num { font-weight: var(--weight-light); color: var(--color-text-subtle); }
.tab-pill.active .num { color: var(--rpp-orange-100); }
.tab-pill .dot { width: var(--space-2); height: var(--space-2); }
.filter-toggle { position: relative; cursor: pointer; }
.filter-toggle:has(:focus-visible) { box-shadow: var(--focus-ring); }
.filter-toggle:has(:checked) .icon { fill: currentColor; }

/* ---------- Jobs list ---------- */
.job-list-controls { display: grid; gap: var(--space-6); margin-bottom: var(--space-6); }
.job-list-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.job-list-filters-label { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text-muted); }
.job-list-filters .select { width: auto; max-width: 100%; }
.job-cards { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.job-card { display: grid; grid-template-columns: var(--space-16) minmax(0, 1fr) auto; grid-template-areas: "thumb body side"; align-items: center; gap: var(--space-4); padding: var(--space-3); }  /* no overflow clip, so the row menu opens over the cards below */
.job-card-thumb { grid-area: thumb; display: flex; align-items: center; justify-content: center; width: var(--space-16); height: var(--space-16); border-radius: var(--radius-image); background: var(--color-surface-alt); color: var(--color-text-subtle); overflow: hidden; }
.job-card-thumb img, .record-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.job-card-body { grid-area: body; min-width: 0; }
.job-card-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.job-card-address { font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); color: var(--color-text); overflow-wrap: anywhere; }
.job-card-meta { margin-top: var(--space-1); font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); }
.job-card-side { grid-area: side; display: flex; align-items: center; gap: var(--space-4); }
.job-card-people { display: flex; align-items: center; gap: var(--space-1); }
.avatar-empty { background: var(--color-surface-alt); color: var(--color-text-subtle); }
.job-card-total { min-width: var(--space-20); text-align: right; font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-text); }
.job-card-menu-space { width: var(--control-h-md); flex: none; }
.star-frame { display: inline-flex; }
.star-button { color: var(--color-text-subtle); }
.record-actions .star-button { width: var(--control-h-md); height: var(--control-h-md); }
.star-button[aria-pressed="true"], .star-button[aria-pressed="true"]:hover { color: var(--color-primary); }
.star-button[aria-pressed="true"] .icon { fill: currentColor; }
@media (max-width: 600px) {
  .job-card { grid-template-columns: var(--space-16) minmax(0, 1fr); grid-template-areas: "thumb body" "side side"; gap: var(--space-3) var(--space-4); }
  .job-card-side { flex-wrap: wrap; gap: var(--space-3); }
  .job-card-total { min-width: 0; margin-left: auto; }
  .job-card-menu-space { display: none; }
}

/* ---------- Customers list ---------- */
.customer-list-search .search { flex-grow: 1; }
/* Unclipped, so the last rows' menus can open below the card; the header band and last row take its corners. */
.customer-list { overflow: visible; }
.customer-table { border-collapse: separate; border-spacing: 0; }
.customer-table th:first-child { border-top-left-radius: calc(var(--radius-card) - var(--hairline)); }
.customer-table th:last-child { border-top-right-radius: calc(var(--radius-card) - var(--hairline)); }
.customer-table tbody tr:last-child td:first-child { border-bottom-left-radius: calc(var(--radius-card) - var(--hairline)); }
.customer-table tbody tr:last-child td:last-child { border-bottom-right-radius: calc(var(--radius-card) - var(--hairline)); }
.customer-table td { border-bottom-color: var(--color-border); }
.customer-table .with-avatar { display: flex; gap: var(--space-3); }  /* a block, so a photo avatar's baseline adds no line under it */
.customer-table th.num-col { text-align: right; }  /* .table th alone would put it left */
.customer-table .customer-lifetime, .customer-table .customer-jobs { width: auto; }  /* not .num-col's 110px */
.customer-table .customer-lifetime { white-space: nowrap; }
.customer-lifetime-total { font-size: var(--text-base); font-weight: var(--weight-medium); }
/* A company too long for its column breaks anywhere rather than squeeze Contact or widen the page. */
@media (min-width: 961px) and (max-width: 1199px) { .customer-table td:first-child .cell-sub { overflow-wrap: anywhere; } }
@media (max-width: 960px) { .customer-table td:first-child .cell-stack { min-width: 0; overflow-wrap: anywhere; } }
/* From 1200px the columns are fixed, so they stay put whatever the chip lists. */
@media (min-width: 1200px) {
  .customer-table { table-layout: fixed; }
  .customer-table td:first-child .cell-stack { min-width: 0; overflow-wrap: anywhere; }
  .customer-table th.customer-lifetime { width: var(--customer-lifetime-w); }
  .customer-table th.customer-jobs { width: var(--space-16); }
  .customer-table th.customer-last-shoot { width: var(--customer-last-shoot-w); }
  .customer-table th.customer-actions { width: calc(var(--space-3) + var(--control-h-md) + var(--space-6)); }
}
/* Where the table is tight, a long email breaks anywhere rather than widen it. */
.customer-table .customer-list-contact { overflow-wrap: anywhere; }
.customer-last-shoot time, .customer-last-shoot time > span { white-space: nowrap; }
.customer-jobs-unit { display: none; }  /* under the Jobs header the count says enough */
/* Last shoot more than 30 days ago. */
.last-shoot-lapsed { display: inline-flex; align-items: baseline; gap: var(--space-2); font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--rpp-orange-900); --pill-dot-color: var(--rpp-orange-500); }
/* Below 960px the columns don't fit and a card with menus can't scroll sideways, so each row stacks. */
@media (max-width: 960px) {
  .customer-table thead { display: none; }
  .customer-table, .customer-table tbody { display: block; }
  .customer-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-3); padding: var(--space-3) var(--space-6); border-bottom: var(--hairline) solid var(--color-border); }
  .customer-table tbody tr:last-child { border-bottom: 0; }
  .card-flush .customer-table td, .card-flush .customer-table td:first-child, .card-flush .customer-table td:last-child { display: block; grid-column: 1; padding: 0; border: 0; text-align: left; }
  .card-flush .customer-table td.row-action { grid-column: 2; grid-row: 1; }
  .customer-jobs-unit { display: inline; }
  .customer-last-shoot time { white-space: normal; }
  .customer-no-average { display: none; }  /* without the header, a bare dash under $0.00 says nothing */
  .customer-table tbody tr:hover td { background: none; }  /* the row band would tint only the cells, in blocks */
}
@media (max-width: 600px) { .customer-table tbody tr { padding-inline: var(--space-4); } }

/* ---------- Products list ---------- */
/* The pill keeps a slot as wide as Inactive, so the prices and switches line up from row to row. Below
   960px the switch leaves the name too little room, so the row stacks. */
.product-list-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-6); }
.product-list-find { display: flex; flex: 1 1 auto; align-items: center; justify-content: flex-end; gap: var(--space-3); }
.product-list-count, .report-section-label { margin-bottom: var(--space-3); font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text-muted); }
.product-card-meta { display: flex; gap: var(--space-1); }
.product-card-description { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-card-category { flex: none; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-card-price { text-align: right; white-space: nowrap; }
.product-card-amount { font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--color-text); }
.product-card-switch { display: flex; margin: 0; }
.product-card-status { display: flex; justify-content: flex-end; min-width: var(--space-20); }
@media (max-width: 960px) {
  .product-card { grid-template-columns: var(--space-16) minmax(0, 1fr); grid-template-areas: "thumb body" "side side"; gap: var(--space-3) var(--space-4); }
  .product-card .job-card-side { flex-wrap: wrap; gap: var(--space-3); }
  .product-card-price { margin-right: auto; text-align: left; }
  .product-card-status { min-width: 0; }
}
@media (max-width: 600px) { .product-list-find .search { flex-grow: 1; } }
/* A category name is short, so each field keeps its button beside it on a phone too. */
.category-list li { align-items: flex-start; padding: var(--space-3) 0; }
.category-list li:first-child { padding-top: 0; }
.category-form { flex: 1; min-width: 0; }
.category-form .inline-form { flex-wrap: nowrap; }
.category-form .inline-form .input { flex-basis: 0; }

/* ---------- The product page ---------- */
.product-page .page-header { align-items: center; }
.product-page .page-title { font-size: var(--text-h4); line-height: var(--lh-h4); }
.product-live-switch { display: inline-flex; align-items: center; gap: var(--gap-control); font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); cursor: pointer; }
.product-live-switch:has(.toggle:disabled) { cursor: default; }
.product-page-body { display: grid; grid-template-columns: var(--settings-nav-w) minmax(0, 1fr) var(--side-panel-w); grid-template-areas: "nav main preview"; gap: var(--space-6); align-items: start; }
.product-page-body > .section-nav { grid-area: nav; top: calc(var(--product-header-h) + var(--space-6)); }
.product-page-main { grid-area: main; min-width: 0; }
.product-form { gap: var(--space-6); }
.product-section { scroll-margin-top: calc(var(--product-header-h) + var(--space-4)); }  /* a section jumped to stands clear of the sticky header */
.product-preview { grid-area: preview; position: sticky; top: calc(var(--product-header-h) + var(--space-6)); display: flex; flex-direction: column; gap: var(--space-3); }
.product-preview-note { text-align: center; }
@media (max-width: 1199px) {
  .product-page-body { grid-template-columns: var(--settings-nav-w) minmax(0, 1fr); grid-template-areas: "nav main" "nav preview"; }
  .product-preview { position: static; max-width: var(--side-panel-w); }
  .product-page-body > .section-nav { top: calc(var(--product-header-h) + var(--control-h-md) + var(--space-6)); }  /* the sticky header's actions have wrapped under its title */
  .product-section { scroll-margin-top: calc(var(--product-header-h) + var(--control-h-md) + var(--space-4)); }
}
@media (max-width: 960px) {
  .product-page-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "nav" "main" "preview"; }
  .product-page-body > .section-nav { position: static; }
}
.section-nav { position: sticky; top: var(--space-8); padding: var(--space-2); }
.section-nav-links { display: flex; flex-direction: column; }
.section-nav .menu-item { border-radius: var(--radius-card); }
.section-nav .section-nav-link { color: var(--color-text-muted); }
.section-nav .section-nav-link[aria-current] { background: var(--rpp-orange-100); color: var(--rpp-orange-900); }
.section-nav-link[aria-current] .icon { color: var(--color-primary); }
.section-nav-link .attention-dot { margin: 0 0 0 auto; }
.section-nav-foot { margin-top: var(--space-2); padding-top: var(--space-2); border-top: var(--hairline) solid var(--color-border); }
.section-nav-foot form { margin: 0; }
/* Rails wraps a refused field and its label in a box that keeps no place of its own. */
.field-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.field-count { flex: none; margin-inline-start: auto; }
.field-count.is-over { color: var(--color-primary-hover); }
.field-error { color: var(--color-primary-hover); font-size: var(--text-xs); line-height: var(--lh-xs); }
.product-form .field_with_errors { display: contents; }
:is(.product-form, .category-form, .policy-form) .field_with_errors > :is(.input, .select) { border-color: var(--color-primary); }
.product-twilight { display: contents; }  /* keeps no place of its own, so fields hidden for Digital leave no gap */

.stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-6); margin-bottom: var(--space-6); }
@media (max-width: 1360px) { .stats:has(.stat:nth-child(4)) { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); } }  /* four or five across leave a money figure too little room */
@media (max-width: 960px) { .stats, .stats:has(.stat:nth-child(4)) { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); } }
.stat { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-6); background: var(--color-surface); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); color: var(--color-text); }
.stat-label { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text-muted); }
.stat-value { margin-top: var(--space-1); font-size: var(--text-h3); line-height: var(--lh-h3); font-weight: var(--weight-light); letter-spacing: var(--tracking-heading); font-variant-numeric: tabular-nums; }
.stat-sub { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); min-height: var(--lh-xs); }
.stat-star { margin-inline-start: var(--space-2); color: var(--color-primary); fill: currentColor; }
.stat-value-long { font-size: var(--text-h4); }  /* the line height stays, so the row lines up */
.stat-icon { display: flex; align-items: center; justify-content: center; width: var(--avatar-36); height: var(--avatar-36); margin-bottom: var(--space-3); border-radius: var(--radius-tile); background: var(--color-primary-tint); color: var(--color-primary); }

/* ---------- Dashboard briefing ---------- */
.briefing { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); margin-bottom: var(--space-6); }
.briefing-column { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.briefing-column > :last-child { flex: 1 0 auto; }
@media (max-width: 1360px) {
  .briefing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .briefing-column:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) { .briefing, .briefing-column:last-child { grid-template-columns: minmax(0, 1fr); } }

.revenue { display: block; }
.revenue[busy] .revenue-summary, .revenue[busy] .revenue-chart, .revenue[busy] .revenue-empty { opacity: .5; transition: opacity var(--duration-fast) var(--easing-standard); }  /* the last period's card stays while the next one loads */
.revenue-period { display: flex; align-items: center; width: auto; font-weight: var(--weight-medium); list-style: none; cursor: pointer; }
.revenue-period::-webkit-details-marker { display: none; }
.revenue-menu .menu-panel { width: max-content; min-width: 100%; }
.revenue-summary { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.revenue-legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: var(--text-xs); line-height: var(--lh-xs); }
.revenue-legend li { display: inline-flex; align-items: center; gap: var(--space-2); }
.revenue-key { flex: none; width: var(--space-4); height: var(--chart-line); background: var(--color-primary); }
.revenue-key-previous { background: repeating-linear-gradient(90deg, var(--rpp-grey-400) 0 var(--space-1), transparent var(--space-1) var(--space-2)); }
.revenue-total { display: flex; flex-direction: column; align-items: flex-end; margin-left: auto; font-size: var(--text-xs); line-height: var(--lh-xs); }
.revenue-total-value { font-size: var(--text-h4); line-height: var(--lh-h4); font-weight: var(--weight-light); letter-spacing: var(--tracking-heading); color: var(--color-text); }
.revenue-empty { margin-top: var(--space-4); padding: var(--space-12) 0; border-top: var(--hairline) solid var(--color-border); text-align: center; font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-text-subtle); }
.revenue-chart { display: flex; gap: var(--space-2); margin-top: var(--space-4); }
.revenue-ticks { flex: none; width: var(--space-16); overflow: visible; }
.revenue-plot { position: relative; flex: 1 1 0; min-width: 0; border-radius: var(--radius-xs); }
.revenue-plot:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.revenue-svg { display: block; overflow: visible; }
.revenue-grid, .revenue-crosshair { stroke-width: var(--hairline); shape-rendering: crispEdges; }
.revenue-grid { stroke: var(--color-border); }
.revenue-crosshair { stroke: var(--color-border-strong); }
.revenue-line { fill: none; stroke-width: var(--chart-line); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.revenue-line-current { stroke: var(--color-primary); }
.revenue-line-previous { stroke: var(--rpp-grey-400); stroke-dasharray: var(--space-1) var(--space-1); stroke-linecap: butt; }  /* square ends, so its dashes match the legend's key */
.revenue-dot { fill: var(--color-primary); stroke: var(--color-surface); stroke-width: calc(2 * var(--chart-line)); paint-order: stroke; }
.revenue-axis { fill: var(--color-text-subtle); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.revenue-tip { position: absolute; top: 0; z-index: 2; display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-2) var(--space-3); background: var(--color-surface); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); box-shadow: var(--shadow-pop); font-size: var(--text-xs); line-height: var(--lh-xs); white-space: nowrap; pointer-events: none; transform: translateX(var(--space-3)); }
.revenue-tip.is-flipped { transform: translateX(calc(-100% - var(--space-3))); }
.revenue-tip-day { font-weight: var(--weight-medium); color: var(--color-text); }
.revenue-tip-row { display: flex; align-items: center; gap: var(--space-2); }
.revenue-tip-value { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); font-variant-numeric: tabular-nums; }

.pipeline { list-style: none; padding: 0; }
.pipeline li { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) 0; border-bottom: var(--hairline) solid var(--color-border); }
.pipeline li:first-child, .attention li:first-child .attention-row { padding-top: 0; }
.pipeline-row { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--text-sm); line-height: var(--lh-sm); }
.pipeline-count { font-weight: var(--weight-medium); color: var(--color-text); font-variant-numeric: tabular-nums; }
.pipeline-bar { --bar-track: var(--color-surface-alt); width: 100%; }  /* a progress is 10em wide by default, so it would not stretch to the column */

.table tr.is-ticked td { background: var(--color-primary-wash); }
/* A licence fee among a studio's editing bills. */
.table tr.is-shaded td { background: var(--color-surface-alt); }
/* A group's label over its rows (Editing prices' Photo editing, Floor plans…), set as the settings nav's group labels. */
.table .table-group th { padding-top: var(--space-4); background: none; border-bottom: 0; line-height: var(--lh-eyebrow); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-subtle); }
/* A line per team in two cells of one row: each line takes a pill's height, so a team stays level with its margin. */
.rate-lines { display: flex; flex-direction: column; gap: var(--space-1); padding: 0; list-style: none; }
.rate-lines li { display: flex; align-items: center; min-height: var(--pill-h); white-space: nowrap; }
.num-col .rate-lines li { justify-content: flex-end; }
.row-tick { display: block; width: var(--space-4); height: var(--space-4); margin: 0; accent-color: var(--color-primary); }
/* The one dark field: what the ticked orders add up to, kept in view while the list scrolls. */
.bulk-bar { position: sticky; bottom: var(--space-4); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-top: var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-card); background: var(--rpp-grey-900); color: var(--color-text-inverse); font-size: var(--text-sm); line-height: var(--lh-sm); box-shadow: var(--shadow-md); }
.bulk-bar .text-strong { color: inherit; }
.bulk-bar-summary { flex: 1 1 auto; min-width: 0; color: var(--rpp-grey-300); }
.bulk-bar-clear { padding: 0; border: 0; background: none; color: var(--rpp-grey-300); font: inherit; font-weight: var(--weight-medium); cursor: pointer; }
.bulk-bar-clear:hover { color: var(--color-text-inverse); }

.attention { list-style: none; padding: 0; }
.attention li { border-bottom: var(--hairline) solid var(--color-border); }
.attention-row { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) 0; color: var(--color-text); }
.attention-row:hover { color: var(--color-text); }
.attention-row:hover .attention-name { color: var(--color-primary); }
.attention-text { display: flex; flex-direction: column; min-width: 0; }
.attention-action { margin-left: auto; text-align: right; }
.attention-action > span { white-space: nowrap; }
.attention-name { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); overflow-wrap: anywhere; }
.attention-more { margin-top: var(--space-3); }
.attention-row + .text-link { margin-bottom: var(--space-3); }  /* an action under a row that is a link itself */

.recent-tiles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); }
.recent-tile { display: flex; flex-direction: column; gap: var(--space-2); color: var(--color-text); }
.recent-tile:hover { color: var(--color-primary); }
.recent-cover { display: flex; align-items: center; justify-content: center; aspect-ratio: 2 / 1; border-radius: var(--radius-image); background: var(--rpp-grey-200); color: var(--color-text-subtle); overflow: hidden; }
.recent-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity var(--duration-fast) var(--easing-standard); }
.recent-tile:hover .recent-cover img { opacity: .88; }
.recent-name { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 960px) { .recent-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .recent-tiles { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Agenda and definition lists ---------- */
.agenda { list-style: none; padding: 0; display: flex; flex-direction: column; }
.agenda li + li { border-top: var(--hairline) solid var(--color-surface-alt); }
.agenda-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; color: var(--color-text); }
.agenda-item:hover .agenda-title { color: var(--color-primary); }
.agenda-time { flex: 0 0 auto; min-width: var(--agenda-time-w); font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text); white-space: nowrap; }
.agenda-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.agenda-title { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-sub { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); }
@media (max-width: 600px) { .agenda-item { flex-wrap: wrap; row-gap: var(--space-1); } .agenda-time { flex-basis: 100%; } }  /* the time sits on its own line so the address keeps its width */

.dl { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: var(--space-2) var(--space-3); font-size: var(--text-sm); line-height: var(--lh-sm); margin-top: var(--space-3); }
.dl-wide { grid-template-columns: 130px minmax(0, 1fr); margin-top: 0; }
.dl > div { display: contents; }  /* a term and its value wrapped together, so the pair can be hidden as one */
.dl dt { color: var(--color-text-subtle); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--color-text); display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; }
.dl dd.stack-sm { flex-direction: column; align-items: flex-start; gap: var(--space-1); }
.page-meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); margin-top: var(--space-2); }
.page-meta .icon { color: var(--color-text-subtle); }
.meta-sep { color: var(--color-text-disabled); }

/* ---------- Calendar ---------- */
/* Below 1440px the right group takes a row of its own, so paging to a longer title never moves the grid. */
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5); margin-bottom: var(--space-5); }
.cal-toolbar-start, .cal-toolbar-end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); min-width: 0; }
.cal-paging { display: flex; gap: var(--space-1); }
.cal-nav { display: inline-flex; align-items: center; justify-content: center; width: var(--rail-link); height: var(--rail-link); border-radius: var(--radius-tile); color: var(--color-text); transition: background var(--duration-fast) var(--easing-standard); }
.cal-nav:hover { background: var(--color-surface-alt); color: var(--color-text); }
.cal-nav:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cal-title { margin-left: var(--space-2); font-size: var(--text-h4); line-height: var(--lh-h4); font-weight: var(--weight-light); letter-spacing: var(--tracking-heading); }
.cal-filters-panel { width: var(--filters-w); max-width: calc(100vw - 2 * var(--space-4)); padding: var(--space-4); gap: var(--space-4); }
.cal-filters-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.cal-filters-group legend, .cal-filters-label { display: block; padding: 0; margin-bottom: var(--space-2); font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); }
.cal-filters-group .check { color: var(--color-text); }
.cal-filters-group .dot { width: var(--swatch); height: var(--swatch); }
.cal-filters-group .check + .check { margin-top: var(--space-2); }
.cal-filters-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.menu-panel .cal-filters-foot .btn { width: auto; }
@media (min-width: 1440px) {
  .cal-toolbar, .cal-toolbar-start { flex-wrap: nowrap; }
  .cal-toolbar-end { flex: none; }
  .cal-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 1439px) {
  .cal-toolbar-start { flex-basis: 100%; }
  .cal-toolbar-end { position: relative; }
  .cal-toolbar-end > .menu { position: static; }
}
@media (max-width: 600px) { .cal-title { flex-basis: 100%; margin-left: 0; } }

/* The side panel goes under the grid below 1200px: beside it, a week's seven --cal-col-min days would scroll sideways. */
.cal-body { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-panel-w); gap: var(--space-5); align-items: start; }
.cal-main { min-width: 0; }
@media (max-width: 1199px) { .cal-body { grid-template-columns: minmax(0, 1fr); } }

/* An entry sits at --start for --span minutes, in lane --lane of --lanes; where lanes get less than --cal-event-min
   each, later ones are inset over the one before. */
.cal-grid { display: grid; grid-template-columns: var(--space-12) repeat(var(--columns), minmax(auto, 1fr)); overflow-x: auto; }
.cal-grid-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; }
.cal-col-head { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: var(--space-2) var(--space-1); border-left: var(--hairline) solid var(--color-border); text-align: center; }
.cal-col-head.is-today { background: var(--color-primary-tint); }
.cal-day-name { font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text-subtle); }
.cal-col-head.is-today .cal-day-name { color: var(--color-primary); }
.cal-day-num { display: inline-flex; align-items: center; justify-content: center; min-width: var(--avatar-32); height: var(--avatar-32); border-radius: var(--radius-circle); font-size: var(--text-lg); line-height: 1; font-weight: var(--weight-light); color: var(--color-text); }
.cal-col-head.is-today .cal-day-num { background: var(--color-primary); color: var(--color-text-inverse); font-size: var(--text-base); font-weight: var(--weight-medium); }
.cal-grid.is-people .cal-col-head { padding: var(--space-3) var(--space-2); }
.cal-col-person { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-1) var(--space-2); max-width: 100%; font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); }
.cal-allday { border-top: var(--hairline) solid var(--color-border); }
.cal-gutter { position: sticky; left: 0; z-index: 1; background: var(--color-surface); }  /* over the columns scrolled under it */
.cal-allday-label { align-self: stretch; display: flex; align-items: center; justify-content: flex-end; padding-right: var(--space-2); text-align: right; font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text-subtle); }
.cal-allday-cell { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; padding: var(--space-1); border-left: var(--hairline) solid var(--color-border); }
.cal-allday .event-time { display: none; }  /* the row says All day */
.cal-grid-body .cal-gutter { display: flex; flex-direction: column; padding-top: var(--space-2); }
.cal-hour { position: relative; top: calc(var(--lh-xs) / -2); flex: none; height: var(--cal-hour-h); padding-right: var(--space-2); text-align: right; font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text-subtle); }
.cal-col { position: relative; isolation: isolate; min-width: max(var(--cal-col-min), calc(var(--col-lanes, 1) * (var(--cal-event-min) + var(--space-1)) + var(--space-1) + var(--hairline))); height: calc(var(--hours) * var(--cal-hour-h) + var(--space-2)); padding-top: var(--space-2); border-left: var(--hairline) solid var(--color-border); background: repeating-linear-gradient(to bottom, var(--color-border) 0 var(--hairline), transparent var(--hairline) var(--cal-hour-h)) no-repeat content-box border-box; }
.cal-col.is-today, .cal-allday-cell.is-today { background-color: var(--color-surface-alt); }
.cal-col .event { --event-w: max(var(--cal-event-min), calc((100% - var(--space-1)) / var(--lanes) - var(--space-1))); position: absolute; z-index: var(--lane); top: calc(var(--space-2) + var(--start) * var(--cal-hour-h) / 60 + var(--hairline)); left: calc(var(--space-1) + var(--lane) * (100% - 2 * var(--space-1) - var(--event-w)) / max(var(--lanes) - 1, 1)); width: var(--event-w); height: max(calc(var(--lh-xs) + 2 * var(--hairline)), calc(var(--span) * var(--cal-hour-h) / 60 - var(--space-1))); box-shadow: 0 0 0 var(--hairline) var(--color-surface); }
.cal-col .event:hover, .cal-col .event:focus-visible { z-index: var(--lanes); }
.cal-col .event:not(.is-tall) .event-sub { display: none; }  /* an entry under an hour and a half has no room for its sub line */

/* The one coloured-bar card the design allows. On one line the title's gap is a margin on its text, so a title with
   no room costs EXT nothing; too narrow, an item wraps onto a hidden second line. */
.event { display: flex; flex-wrap: wrap; align-content: flex-start; column-gap: var(--space-1); min-width: 0; padding: var(--space-1) var(--space-2); border: var(--hairline) solid var(--color-border-strong); border-left: var(--event-bar-w) solid var(--event-bar, var(--color-border-strong)); border-radius: var(--radius-xs); background: var(--color-surface); color: var(--color-text); font: inherit; font-size: var(--text-xs); line-height: var(--lh-xs); text-align: left; overflow: hidden; cursor: pointer; transition: filter var(--duration-fast) var(--easing-standard); }
.event:hover { color: var(--color-text); filter: brightness(.97); }
.event:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.event-time { flex: none; font-weight: var(--weight-medium); color: var(--color-text); white-space: nowrap; }
.event-tag { flex: 1 1000 0; min-width: 0; max-height: 1lh; overflow: hidden; text-align: right; font-weight: var(--weight-medium); color: var(--color-text-subtle); text-decoration: none; cursor: inherit; }
.event-tag::before { content: "\200B"; }
.event-title { flex: 1 0 100%; min-width: 0; max-height: 1lh; font-weight: var(--weight-light); color: var(--color-text-body); overflow: hidden; }
.event-title::before { content: "\200B"; }
.event-title > span { display: inline-block; vertical-align: top; min-width: var(--event-title-min); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: inherit; }  /* an inline block takes no strike-through from its parent, so it inherits a cancelled job's */
.event-sub { flex: 1 0 100%; min-width: 0; color: var(--color-text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event.is-short { flex-wrap: nowrap; align-items: center; column-gap: 0; padding-block: 0; }
.event.is-short .event-title { flex: 1 1 0; }
.event.is-short .event-title > span { max-width: calc(100% - var(--space-1)); margin-left: var(--space-1); }
.event.is-short .event-tag { flex: 0 1 auto; order: 1; margin-left: var(--space-1); }
.cal-allday .event.is-short .event-title > span { max-width: 100%; margin-left: 0; }
.event.is-short .event-sub { display: none; }
.event.is-cancelled .event-time, .event.is-cancelled .event-title { color: var(--color-text-subtle); }
.event.is-cancelled .event-title { text-decoration: line-through; }
.event-1 { --event-bar: var(--rpp-orange-500); }
.event-2 { --event-bar: var(--tint-blue-fg); }
.event-3 { --event-bar: var(--status-green-fg); }
.event-4 { --event-bar: var(--tint-purple-fg); }
.event-5 { --event-bar: var(--tint-amber-fg); }
.event-6 { --event-bar: var(--rpp-grey-800); }
.event-0 { --event-bar: var(--rpp-grey-400); }
.event-block { --event-bar: var(--color-border-strong); background: var(--color-surface-alt); }
.event-block .event-title { font-weight: var(--weight-medium); }

.confirm-dialog.cal-detail .app-dialog-body { flex-direction: column; align-items: stretch; gap: var(--space-4); }
.cal-detail .app-dialog-title { min-width: 0; overflow-wrap: anywhere; }
.cal-detail-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--inset-control); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); font-size: var(--text-sm); line-height: var(--lh-sm); }
.cal-detail-row > .icon { color: var(--color-text-subtle); }
.cal-detail-row > .text-strong { min-width: 0; overflow-wrap: anywhere; }  /* even a long web address */
.cal-detail-row > .tag { margin-left: auto; }
.cal-detail-note { padding: var(--space-2) var(--inset-control); border-radius: var(--radius-card); background: var(--color-surface-alt); }
.cal-detail-notes { font-size: var(--text-sm); line-height: var(--lh-sm); white-space: pre-line; overflow-wrap: anywhere; }
.cal-detail-when { justify-content: space-between; }
.cal-detail-label { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text-subtle); }
.cal-detail-value { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }

.cal-month-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-month-week + .cal-month-week { border-top: var(--hairline) solid var(--color-border); }
.cal-month-dow { padding: var(--space-2) var(--space-1); text-align: center; font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text-subtle); text-decoration: none; }
.cal-month-day { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; min-height: var(--cal-day-min-h); padding: var(--space-1) var(--space-1) var(--space-2); }
.cal-month-day + .cal-month-day { border-left: var(--hairline) solid var(--color-border); }
.cal-month-day.is-today { background: var(--color-surface-alt); }
.cal-month-num { align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; min-width: var(--avatar-24); height: var(--avatar-24); border-radius: var(--radius-circle); font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-text); transition: background var(--duration-fast) var(--easing-standard); }
.cal-month-num:hover { background: var(--color-border); color: var(--color-text); }
.cal-month-num:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cal-month-day.is-outside .cal-month-num { color: var(--color-text-disabled); }
.cal-month-day.is-today .cal-month-num { background: var(--color-primary); color: var(--color-text-inverse); }
.cal-more { padding: 0 var(--space-2); font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); }
.cal-month-count { display: none; align-items: center; gap: var(--space-1); font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); }
@media (max-width: 600px) {
  .cal-month-day { align-items: center; min-height: var(--space-16); }
  .cal-month-num { align-self: center; }
  .cal-month-day .event, .cal-more { display: none; }
  .cal-month-count { display: inline-flex; }
}

.cal-agenda { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; row-gap: var(--space-6); }
.cal-agenda > .empty { grid-column: 1 / -1; }
.cal-agenda-group, .cal-agenda-list, .cal-agenda-list > li, .event.cal-agenda-item { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; }
.cal-agenda-day { grid-column: 1 / -1; margin-bottom: var(--space-3); font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); }
.cal-agenda-list { list-style: none; padding: 0; row-gap: var(--space-2); }
.event.cal-agenda-item { align-items: center; column-gap: var(--space-4); padding: var(--space-3) var(--space-4); font-size: var(--text-sm); line-height: var(--lh-sm); }
.cal-agenda-item > :last-child { justify-self: end; }
.cal-agenda-body { display: flex; flex-direction: column; min-width: 0; }
.cal-agenda-item .event-title { font-weight: var(--weight-medium); color: var(--color-text); }
.cal-agenda-item .event-sub { font-size: var(--text-xs); line-height: var(--lh-xs); }
@media (max-width: 600px) {
  .cal-agenda { grid-template-columns: minmax(0, 1fr) auto; }
  .cal-agenda-item .event-time { grid-column: 1 / -1; }
}

.cal-mini-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.cal-mini-head .card-title { margin-bottom: 0; }
.cal-mini-nav { display: flex; gap: var(--space-1); }
.cal-mini-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-mini-dow { padding-bottom: var(--space-1); text-align: center; font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text-subtle); text-decoration: none; }
.cal-mini-day { display: flex; align-items: center; justify-content: center; height: var(--mini-day-h); font-size: var(--text-xs); font-weight: var(--weight-light); color: var(--color-text-body); }
.cal-mini-day > span { display: inline-flex; align-items: center; justify-content: center; width: var(--avatar-24); height: var(--avatar-24); border-radius: var(--radius-circle); transition: background var(--duration-fast) var(--easing-standard); }
.cal-mini-day:hover { color: var(--color-text); }
.cal-mini-day:hover > span { background: var(--color-border); }
.cal-mini-day:focus-visible { outline: none; }
.cal-mini-day:focus-visible > span { box-shadow: var(--focus-ring); }
.cal-mini-day.is-shown { background: var(--color-surface-alt); font-weight: var(--weight-medium); color: var(--color-text); }
.cal-mini-day.is-today > span { background: var(--color-primary); color: var(--color-text-inverse); font-weight: var(--weight-medium); }
.legend { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-text-body); }
.legend li { display: flex; align-items: center; gap: var(--gap-control); }
.swatch { display: inline-block; width: var(--swatch); height: var(--swatch); border-radius: var(--radius-xs); flex: none; }
.legend-row { flex-direction: row; flex-wrap: wrap; column-gap: var(--space-4); row-gap: var(--space-2); margin-top: var(--space-3); }
.legend .num { margin-left: auto; font-weight: var(--weight-medium); color: var(--color-text); }
.cal-summary { margin: 0; }
.cal-summary > div { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: var(--hairline) solid var(--color-border); font-size: var(--text-sm); line-height: var(--lh-sm); }
.cal-summary dt { color: var(--color-text-body); }
.cal-summary dd { margin: 0; font-weight: var(--weight-medium); color: var(--color-text); }
.cal-summary + .btn { margin-top: var(--space-4); }
.cal-google-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.cal-google .hint { margin-top: var(--space-2); }

/* ---------- Orders and files ---------- */
.subhead { font-size: var(--text-base); font-weight: var(--weight-medium); margin: var(--space-5) 0 var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.dropzone { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: var(--hairline) dashed var(--rpp-orange-200); border-radius: var(--radius-card); background: var(--color-primary-wash); color: var(--color-text); text-align: left; cursor: pointer; transition: border-color var(--duration-fast) var(--easing-standard), background var(--duration-fast) var(--easing-standard); }
.dropzone:hover, .dropzone.over { border-color: var(--color-primary); background: var(--color-primary-tint); }
.dropzone:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.dropzone-badge { width: var(--space-10); height: var(--space-10); border-radius: var(--radius-circle); background: var(--color-surface); color: var(--color-primary-hover); display: flex; align-items: center; justify-content: center; flex: none; }
.dropzone-text { display: flex; flex-direction: column; gap: var(--space-1); }
.dropzone-title { font-size: var(--text-sm); font-weight: var(--weight-medium); }
.dropzone-title .hint-strong { color: var(--color-primary-hover); }
.dropzone .hint { color: var(--color-text-muted); }
.upload-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.upload-list:empty { display: none; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 90px 120px auto; gap: var(--space-3); align-items: center; font-size: var(--text-sm); line-height: var(--lh-sm); padding: var(--space-2) var(--space-3); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); }
.upload-name { color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-size, .upload-status { color: var(--color-text-subtle); font-size: var(--text-xs); }
.upload-row.done .upload-status { color: var(--status-green-fg); }
.upload-row.failed .upload-status { color: var(--color-primary-hover); }
.upload-bar { height: 6px; background: var(--color-surface-alt); border-radius: var(--radius-pill); overflow: hidden; }
.upload-fill { display: block; height: 100%; width: 0; background: var(--color-primary); transition: width var(--duration-fast) linear; }
.upload-row.done .upload-fill { width: 100%; background: var(--status-green); }
.file-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--file-tile-min), 100%), 1fr)); gap: var(--space-4); }
.file-tile { position: relative; border: var(--hairline) solid var(--color-border); border-radius: var(--radius-image); overflow: hidden; display: flex; flex-direction: column; background: var(--color-surface); }
.file-thumb { display: block; aspect-ratio: 4 / 3; background: var(--color-surface-alt); overflow: hidden; }
.file-thumb img, .file-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity var(--duration-fast) var(--easing-standard); }
button.file-thumb { width: 100%; border: 0; padding: 0; cursor: zoom-in; }
button.file-thumb:hover img, button.file-thumb:hover video { opacity: .88; }
.file-video { position: relative; cursor: pointer; }
button.file-thumb:focus-visible { outline: none; }
.file-tile:has(> button.file-thumb:focus-visible) { box-shadow: var(--focus-ring); }  /* the tile shows the ring: the photo would cover the button's own */
.file-icon { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: var(--space-1); color: var(--color-text-subtle); font-size: var(--text-xs); font-weight: var(--weight-medium); }
.file-meta { padding: var(--space-2) var(--space-3) var(--space-3); display: flex; flex-direction: column; }
.file-name { font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); }
.file-tag { align-self: flex-start; margin-top: var(--space-2); }
.file-actions { position: absolute; top: var(--space-2); right: var(--space-2); display: flex; gap: var(--space-1); opacity: 0; transition: opacity var(--duration-fast) var(--easing-standard); }
.file-tile:hover .file-actions, .file-tile:focus-within .file-actions { opacity: 1; }
.file-actions form { margin: 0; }
.file-action { display: inline-flex; align-items: center; justify-content: center; width: var(--control-h-xs); height: var(--control-h-xs); border: 0; border-radius: var(--radius-tile); background: var(--overlay-ink); color: var(--color-text-inverse); cursor: pointer; }
.file-action:hover { background: var(--rpp-grey-900); color: var(--color-text-inverse); }
.file-action:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---------- Public pages ---------- */
.public-body { background: var(--color-bg); }
.public-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-8); border-bottom: var(--hairline) solid var(--color-border); background: var(--color-surface); }
.public-brand { display: flex; align-items: center; gap: var(--space-4); min-width: 0; color: var(--color-text); }
.public-logo { height: var(--logo-h); width: auto; display: block; flex: none; }
.public-studio { padding-left: var(--space-4); border-left: var(--hairline) solid var(--color-border); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text); }
.public-page { max-width: calc(var(--public-w) + 2 * var(--space-6)); margin: 0 auto; padding: var(--space-8) var(--space-6) var(--space-16); }
.public-hero { text-align: left; margin-bottom: var(--space-8); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.public-hero.centred { text-align: center; align-items: center; }
.public-kicker { font-size: var(--text-xs); line-height: var(--lh-eyebrow); font-weight: var(--weight-medium); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-primary); }
.public-title { font-weight: var(--weight-light); font-size: var(--text-h3); line-height: var(--lh-h3); letter-spacing: var(--tracking-heading); max-width: var(--title-max); }
@media (min-width: 900px) { .public-title { font-size: var(--text-h2); line-height: var(--lh-h2); } }
.public-footer { text-align: center; color: var(--color-text-subtle); font-size: var(--text-xs); line-height: var(--lh-xs); margin-top: var(--space-12); }
.public-body:has(.delivery-end) { display: flex; flex-direction: column; }
.delivery-page, .delivery-end-inner { width: 100%; }  /* a flex item with auto margins grows to a long chip and scrolls a phone sideways */
.delivery-end { flex: 1 0 auto; display: flex; flex-direction: column; background: var(--rpp-grey-900); }
.delivery-end .page-title { color: var(--color-text-inverse); }
.delivery-end-inner { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.delivery-footer { margin-top: auto; padding: var(--space-8) var(--space-6); border-top: var(--hairline) solid var(--overlay-line); color: var(--rpp-grey-300); }
.public-notice { max-width: 480px; margin: 10vh auto; padding: var(--space-8); }
.btn.is-waiting { cursor: progress; }
.menu-item.is-waiting { color: var(--color-text-subtle); cursor: progress; }
.menu-item.is-waiting:hover { background: none; color: var(--color-text-subtle); }
/* A layer of its own, over the tiles (z-index 1), so its Download menu opens over them. */
.delivery-header { position: relative; z-index: 2; background: var(--rpp-grey-900); color: var(--color-text-inverse); }
.delivery-cover { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; }
.delivery-header.has-cover::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--overlay-cover); }
.delivery-header-inner { max-width: calc(var(--public-w) + 2 * var(--space-6)); margin: 0 auto; padding: var(--space-6) var(--space-6) var(--space-16); }
.delivery-header.has-cover .delivery-header-inner { min-height: var(--cover-h); display: flex; flex-direction: column; }
.delivery-header.has-cover .delivery-hero { margin-top: auto; padding-top: var(--space-16); }
.delivery-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.delivery-header .public-studio { color: var(--color-text-inverse); border-left-color: var(--overlay-line); }
.delivery-hero { margin: var(--space-16) 0 0; gap: var(--space-4); }
.delivery-hero .public-kicker { display: flex; align-items: center; gap: var(--space-2); }
.delivery-header .public-title { color: var(--color-text-inverse); }
.delivery-lede { max-width: var(--lede-max); color: var(--rpp-grey-300); }
.delivery-counts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin-top: var(--space-2); padding: 0; list-style: none; font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--rpp-grey-200); }
.delivery-counts li { display: inline-flex; align-items: center; gap: var(--space-2); }
.delivery-downloads { flex: none; }
.delivery-downloads .menu-panel { width: var(--side-panel-w); max-width: calc(100vw - 2 * var(--space-4)); }
.delivery-downloads.is-locked { position: relative; }
.delivery-downloads-note { position: absolute; right: 0; top: calc(100% + var(--space-1)); white-space: nowrap; font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--rpp-grey-300); }
.delivery-page { padding-top: var(--space-10); padding-bottom: var(--space-12); }
.public-actions { display: flex; flex-direction: column; gap: var(--space-4); }
.public-actions:has(.callout, .pay-banner, .btn) { margin-bottom: var(--space-10); }
.public-actions .callout { margin-bottom: 0; }
.pay-frame { display: flex; flex-direction: column; gap: var(--space-4); }
.pay-frame > :empty { display: none; }
.pay-banner { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-5) var(--space-6); background: var(--rpp-orange-100); border: var(--hairline) solid var(--rpp-orange-300); border-radius: var(--radius-card); }
.pay-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pay-banner-title { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); color: var(--color-text); }
.pay-banner-title .icon { color: var(--color-primary); }
.pay-banner-sub { margin-top: var(--space-1); font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-body); }
.pay-banner a { color: inherit; text-decoration: underline; }  /* orange is too faint on the orange-100 fill; a link reads as one by its underline, as in a callout */
.pay-banner .pay-amount { margin-top: var(--space-2); }
.pay-banner form { margin: 0; flex: none; }
.pay-amount { font-size: var(--text-lg); line-height: var(--lh-lg); font-weight: var(--weight-light); color: var(--color-text); letter-spacing: var(--tracking-heading); }
.delivery-folder + .delivery-folder, .delivery-policy { margin-top: var(--space-10); padding-top: var(--space-10); border-top: var(--hairline) solid var(--color-border); }
.delivery-folder > .page-header { margin-bottom: var(--space-8); }
.policy-text { max-width: var(--title-max); white-space: pre-wrap; overflow-wrap: anywhere; }
.delivery-includes { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-8); font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text-body); }
.delivery-includes > .icon { color: var(--color-text-subtle); }
.delivery-chip { min-width: 0; max-width: 100%; border: var(--hairline) solid transparent; cursor: pointer; transition: background var(--duration-fast) var(--easing-standard), border-color var(--duration-fast) var(--easing-standard), color var(--duration-fast) var(--easing-standard); }
.delivery-chip[aria-pressed="false"]:hover { background: var(--color-border-strong); }
.delivery-chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.delivery-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }  /* the chip's title has the whole name */
.gallery { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-6) var(--space-3); align-items: start; }
.gallery-item { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.gallery-tile { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius-image); background: var(--rpp-grey-200); }
.gallery-thumb { display: block; width: 100%; height: 100%; background: none; border: 0; padding: 0; cursor: zoom-in; }
.gallery-thumb img, .gallery-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity var(--duration-fast) var(--easing-standard); }
.gallery-tile:hover .gallery-thumb:not(.is-locked) :is(img, video) { opacity: .88; }
.gallery-thumb:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
.gallery-video, .gallery-file { cursor: pointer; transition: background var(--duration-fast) var(--easing-standard); }
.gallery-video:hover, .gallery-file:not(.is-locked):hover { background: var(--color-border-strong); }
.gallery-file.is-locked { cursor: default; }
.gallery-thumb.is-locked img { filter: saturate(.6); opacity: .85; }
.gallery-glyph { position: absolute; inset: 0; margin: auto; display: flex; align-items: center; justify-content: center; width: var(--avatar-36); height: var(--avatar-36); border-radius: var(--radius-circle); background: var(--color-surface); color: var(--color-text); pointer-events: none; }
.gallery-tile .file-actions { z-index: 1; }
.gallery-tile:hover .file-actions, .gallery-tile:focus-within .file-actions { opacity: 1; }
/* Touch has no hover. Keep this after every rule that sets the opacity: a media query adds no specificity. */
@media (hover: none) { .file-actions { opacity: 1; } }
/* A file's thread dialog is laid out in reverse, so it opens at the latest comment above the form. */
.gallery-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-2); }
.gallery-meta .file-name { grid-area: 1 / 1; }
.gallery-meta .file-size { grid-area: 2 / 1 / 3 / 3; }
.gallery-comments { grid-area: 1 / 2; }
@media (max-width: 960px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .public-page, .delivery-header-inner { padding-left: var(--space-4); padding-right: var(--space-4); }
  .delivery-bar .public-brand { flex-direction: column; align-items: flex-start; gap: var(--space-1); }
  .delivery-bar .public-studio { padding-left: 0; border-left: 0; }
  .pay-banner { flex-direction: column; align-items: flex-start; }
}
/* The stars follow the pointer, except while the arrow keys choose (the focus ring shows). */
.delivery-review { scroll-margin-top: var(--space-8); }
.delivery-review > .page-header { margin-bottom: var(--space-8); }
.review-form { display: flex; flex-direction: column; gap: var(--space-4); }
.review-form > .callout { margin-bottom: 0; }
.review-title { font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); color: var(--color-text); }
.review-sub { margin-top: var(--space-1); font-size: var(--text-sm); line-height: var(--lh-sm); }
.review-stars { display: inline-flex; align-self: flex-start; margin: calc(-1 * var(--space-1)); }  /* only as wide as its stars, so they light only with the pointer over one */
.review-star { position: relative; display: flex; align-items: center; justify-content: center; width: var(--control-h-sm); height: var(--control-h-sm); border-radius: var(--radius-field); color: var(--color-border-strong); cursor: pointer; transition: color var(--duration-fast) var(--easing-standard); }
.review-star .icon { fill: var(--star-fill, none); }
.review-stars:has(:checked) .review-star, .review-stars:hover:not(:has(:focus-visible)) .review-star { --star-fill: currentColor; color: var(--color-primary); }
.review-stars:is(:not(:hover), :has(:focus-visible)) .review-star:has(:checked) ~ .review-star, .review-stars:not(:has(:focus-visible)) .review-star:hover ~ .review-star { --star-fill: none; color: var(--color-border-strong); }
.review-star:has(:focus-visible) { box-shadow: var(--focus-ring); }
.review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.review-given { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.review-rating { display: inline-flex; gap: var(--space-2); color: var(--color-border-strong); }
.review-rating .is-on { color: var(--color-primary); fill: currentColor; }
.comments-dialog-head { align-items: center; padding: var(--space-5) var(--space-5) var(--space-4); border-bottom: var(--hairline) solid var(--color-border); flex: none; }
.comments-dialog-file { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.comments-dialog-name { overflow-wrap: anywhere; }
.comments-dialog-body { display: flex; flex-direction: column-reverse; min-height: 0; overflow: auto; padding: var(--space-5); }
.comments-dialog-content { display: flex; flex-direction: column; gap: var(--space-5); }
.comments-dialog .comments { margin: 0; }
.comments-plain .comment { grid-template-columns: minmax(0, 1fr); }
.file-mini { display: flex; align-items: center; justify-content: center; width: var(--space-12); height: var(--space-12); flex: none; object-fit: cover; border-radius: var(--radius-image); background: var(--color-surface-alt); color: var(--color-text-muted); }
/* The photo is the box its pins are placed in, as fractions of it; it fits the stage, a size container. */
.lightbox { border: 0; padding: 0; background: transparent; width: 100vw; height: 100vh; max-width: none; max-height: none; color: var(--color-text-inverse); }
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox::backdrop { background: var(--overlay-ink); }
.lightbox-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-5) var(--space-8); }
.lightbox-title { display: flex; flex-direction: column; min-width: 0; }
.lightbox-name { font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox-count { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--rpp-grey-400); }
.lightbox-actions { display: flex; gap: var(--space-2); flex: none; }
.lightbox-body { flex: 1; min-height: 0; display: flex; align-items: center; gap: var(--space-8); padding: 0 var(--space-8) var(--space-8); }
.lightbox-stage { flex: 1; min-width: 0; align-self: stretch; container-type: size; display: flex; align-items: center; justify-content: center; }
.lightbox-photo { position: relative; line-height: 0; }
.lightbox-photo[tabindex] { cursor: crosshair; }
.lightbox-photo img, .lightbox-video { display: block; max-width: 100cqw; max-height: 100cqh; border-radius: var(--radius-image); }
.lightbox-photo:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.lightbox-pins { position: absolute; inset: 0; }
.lightbox-tile { display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--rail-link); height: var(--rail-link); border: 0; border-radius: var(--radius-tile); background: var(--overlay-tile); color: var(--color-text-inverse); cursor: pointer; transition: background var(--duration-fast) var(--easing-standard); }
.lightbox-tile:hover { background: var(--overlay-line); color: var(--color-text-inverse); }
.lightbox-tile:focus-visible { outline: none; box-shadow: var(--focus-ring); }
/* The thread is laid out in reverse, so it opens at the latest comment; an auto margin keeps a short one at the top. */
.lightbox-panel { flex: none; align-self: stretch; display: flex; flex-direction: column; gap: var(--space-4); width: var(--side-panel-w); min-height: 0; padding: var(--space-5); border-radius: var(--radius-card); background: var(--color-surface); color: var(--color-text-body); }
.lightbox-panel-title { font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); }
.lightbox-panel-sub { margin-top: var(--space-1); }
.lightbox-panel-thread { flex: 1; min-height: 0; display: flex; flex-direction: column-reverse; overflow: auto; }
.lightbox-panel-content { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: auto; }
.lightbox-panel-empty { font-size: var(--text-sm); line-height: var(--lh-sm); }
.lightbox-comments { display: flex; flex-direction: column; gap: var(--space-4); margin: 0; }
.lightbox-comments .comment { padding: 0; border-top: 0; }
.lightbox-comments .comment-head { align-items: center; font-size: var(--text-xs); line-height: var(--lh-xs); }
.comment-as, .lightbox-pin-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); font-size: var(--text-sm); line-height: var(--lh-sm); overflow-wrap: anywhere; }
.lightbox-pin-status { display: contents; }  /* a live region that takes no gap of the form's while hidden */
@media (max-width: 960px) {
  .lightbox[open] { overflow-y: auto; }
  .lightbox-body { flex: none; flex-wrap: wrap; row-gap: var(--space-6); }
  .lightbox-stage { align-self: center; container-type: inline-size; }
  .lightbox-photo img, .lightbox-video { max-height: 60svh; }
  .lightbox-panel { flex-basis: 100%; width: auto; }
  .lightbox-panel-thread { overflow: visible; }
}
@media (max-width: 600px) {
  .lightbox-top { padding: var(--space-4); }
  /* Previous and Next go under the photo, which beside them would be narrower than its own tile on the page. */
  .lightbox-body { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); padding: 0 var(--space-4) var(--space-4); }
  .lightbox-stage { grid-column: 1 / -1; grid-row: 1; }
  .lightbox-next { justify-self: end; }
  .lightbox-panel { grid-column: 1 / -1; margin-top: var(--space-2); }
}
.link-row { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.link-row .label { flex: none; }
.link-row .input { flex: 1; }
@media (max-width: 600px) { .link-row { flex-wrap: wrap; } .link-row .input { flex-basis: 100%; } }

/* ---------- Payments and settings ---------- */
.setting-row { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); background: var(--color-surface); cursor: pointer; }
.setting-badge { width: var(--avatar-40); height: var(--avatar-40); border-radius: var(--radius-circle); background: var(--tint-blue-bg); color: var(--tint-blue-fg); display: flex; align-items: center; justify-content: center; flex: none; }
.setting-badge-purple { background: var(--tint-purple-bg); color: var(--tint-purple-fg); }
.setting-badge-amber { background: var(--tint-amber-bg); color: var(--tint-amber-fg); }
.setting-text { flex: 1; display: flex; flex-direction: column; gap: var(--space-1); }
.setting-title { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); }
.setting-desc { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-muted); }
.toggle { appearance: none; width: var(--toggle-w); height: var(--toggle-h); margin: 0; border-radius: var(--radius-pill); background: var(--rpp-grey-300); position: relative; cursor: pointer; transition: background var(--duration-fast) var(--easing-standard); flex: none; }
.toggle::after { content: ""; position: absolute; top: var(--thumb-inset); left: var(--thumb-inset); width: var(--toggle-thumb); height: var(--toggle-thumb); border-radius: var(--radius-circle); background: var(--color-surface); box-shadow: var(--shadow-sm); transition: transform var(--duration-fast) var(--easing-standard); }
.toggle:checked { background: var(--color-primary); }
.toggle:checked::after { transform: translateX(calc(var(--toggle-w) - var(--toggle-thumb) - 2 * var(--thumb-inset))); }
.toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.toggle:disabled { cursor: default; background: var(--rpp-grey-200); }
.toggle:checked:disabled { background: var(--rpp-grey-300); }
.integration-tiles { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.integration-tile { flex: 1 1 var(--integration-tile-min); min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); }
.integration-tile-wide { flex-basis: 100%; }
.integration-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.integration-name { font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); }
.integration-tile .dl { margin-top: 0; }
.integration-tile .inline-form { flex-wrap: wrap; }
.integration-tile > .callout { margin-bottom: 0; }
.integration-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.integration-actions form { margin: 0; }

/* ---------- Settings frame ---------- */
.settings { display: grid; grid-template-columns: var(--settings-nav-w) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
/* Sticky makes the nav a stacking context, so Search settings' list can't rise above it; the z-index lifts both
   over the page's positioned content (a service area's colour picker and map). */
.settings-nav { z-index: 1; padding: var(--space-4) var(--space-3); }
.settings-nav-title { display: flex; align-items: center; gap: var(--gap-control); padding: var(--space-1) var(--space-2); font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); color: var(--color-text); }
.settings-nav-group { padding: var(--space-3) var(--space-3) var(--space-1); font-size: var(--text-xs); line-height: var(--lh-eyebrow); font-weight: var(--weight-medium); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-subtle); }
.settings-search { position: relative; margin: var(--space-3) 0 var(--space-4); }
.settings-search .search-panel { top: calc(100% + var(--space-1)); left: 0; right: auto; width: max(100%, var(--side-panel-w)); }  /* under its field at every width, unlike the topbar search's below 960px */
.settings-main > .stack { gap: var(--space-6); }
.settings-main .card { scroll-margin-top: var(--space-8); }  /* a card Search settings opens stands clear of the window's top */
.settings-main .record-card-bar > .section-head { flex: 1 1 var(--section-head-min); }
.settings-main .label:not(.app-dialog *) { font-size: var(--text-sm); line-height: var(--lh-sm); }
.settings-main .grid-2:not(.app-dialog *) { gap: var(--space-4); }
.settings-main .setting-row { box-shadow: none; }
.settings-main .setting-row .setting-desc { color: var(--color-text-subtle); }
.settings-main .setting-text { gap: 0; }
.settings-main .link-row { margin-bottom: 0; }
.settings-main .stack > .callout { margin-bottom: 0; }
.settings-main .field_with_errors { display: contents; }  /* Rails wraps a refused field and its label; the field keeps its place */
.settings-main .card:not(.card-flush) > .table { margin: 0; width: 100%; }
.settings-main .card:not(.card-flush) > .table :is(th, td) { padding: var(--space-3) var(--space-4) var(--space-3) 0; border-bottom: var(--hairline) solid var(--color-border); background: none; }
.settings-main .card:not(.card-flush) > .table th { padding-top: 0; }
.settings-main .card:not(.card-flush) > .table :is(th, td):last-child { padding-right: 0; }
.invite-panel { margin-bottom: var(--space-5); padding: var(--space-5); border-radius: var(--radius-card); background: var(--color-surface-alt); }
.invite-panel > h3 { margin-bottom: var(--space-3); font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); color: var(--color-text); }
.invite-panel .form-actions { padding-top: 0; }
.members-table .with-avatar { gap: var(--space-3); }
.editing-teams li > :last-child, .invitation-list li > :first-child { min-width: 0; overflow-wrap: anywhere; }
/* A row menu means the card can't scroll sideways, so a long name or email breaks anywhere. */
.members-table .cell-stack { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 1200px) {
  .members-table th:nth-child(2) { width: calc(var(--member-role-w) + var(--space-4)); }
  .members-table th:nth-child(3) { width: calc(var(--member-status-w) + var(--space-4)); }
  .members-table th:last-child { width: var(--control-h-md); }
}
@media (max-width: 960px) {
  .members-table thead { display: none; }
  .members-table, .members-table tbody { display: block; }
  .members-table tbody tr { display: grid; grid-template-columns: var(--avatar-36) auto minmax(0, 1fr) auto; gap: var(--space-2) var(--space-3); padding: var(--space-3) 0; border-bottom: var(--hairline) solid var(--color-border); }
  .card:not(.card-flush) > .members-table tbody tr { padding-inline: var(--space-6); }  /* the table runs to the card's edges */
  .settings-main .card:not(.card-flush) > .members-table tbody tr { padding-inline: 0; }  /* where it stays inside the card's padding */
  .page .card:not(.card-flush) > .members-table td, .page .card:not(.card-flush) > .members-table td:last-child { display: block; padding: 0; border: 0; }
  .members-table td:first-child { grid-column: 1 / 4; }
  .members-table td:nth-child(2) { grid-column: 2; grid-row: 2; }
  .members-table td:nth-child(3) { grid-column: 3; grid-row: 2; }
  .members-table td.row-action { grid-column: 4; grid-row: 1; }
  /* An editing team's Team: role, services, hours and the week each take a line under the name. */
  .team-table tbody tr { grid-template-columns: minmax(0, 1fr) auto; }
  .members-table.team-table td:not(:first-child, .row-action) { grid-column: 1; grid-row: auto; }
  .members-table.team-table td:first-child { grid-column: 1; }
  .members-table.team-table td.row-action { grid-column: 2; grid-row: 1; }
}
.table .role-col { text-align: center; }  /* .table th alone would set it left */
.table .role-admin { width: calc(var(--role-admin-w) + var(--space-4)); }
.table .role-photographer { width: var(--role-photographer-w); }
.role-yes { color: var(--color-primary); }
.role-no { color: var(--color-text-subtle); }
.role-note { display: block; max-width: var(--role-note-w); margin: var(--space-1) auto 0; }
.role-subarea { display: flex; align-items: center; gap: var(--space-1); padding-left: var(--space-5); }
.role-subarea > .icon { color: var(--color-text-disabled); flex: none; }
.role-name { white-space: nowrap; }
.table .alert-way { width: var(--alert-way-w); text-align: center; }  /* .table th alone would set it left */
.alert-way .row-tick { margin-inline: auto; }
.team-channel { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); padding: var(--space-3) var(--inset-control); border-radius: var(--radius-card); background: var(--color-surface-alt); }
.team-channel .setting-text { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 960px) { .settings { grid-template-columns: minmax(0, 1fr); } .settings-nav { position: static; } }

/* ---------- Settings › Project status ---------- */
.stage-stack { display: flex; flex-direction: column; gap: var(--space-3); }
.stage-row .setting-text { min-width: 0; overflow-wrap: anywhere; }
.stage-lock { display: inline-flex; align-items: center; justify-content: center; width: var(--control-h-sm); color: var(--color-text-subtle); flex: none; }
.stage-controls { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; }
.stage-controls > form { display: flex; }
.status-options { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 600px) { .stage-controls { flex-basis: 100%; justify-content: space-between; } }

/* ---------- Online booking ---------- */
.narrow-page { max-width: 760px; }

/* ---------- Settings groups, question rows, hours table ---------- */
.section-head { display: flex; align-items: flex-start; gap: var(--space-4); }
.section-head .setting-title { font-size: var(--text-base); line-height: var(--lh-base); display: flex; align-items: center; gap: var(--space-2); }
.setting-badge-tile { border-radius: var(--radius-tile); background: var(--color-primary-tint); color: var(--color-primary); }
.setting-badge-orange { background: var(--tint-orange-bg); color: var(--tint-orange-fg); }
.slug-field { display: flex; align-items: center; }
.slug-prefix { height: var(--control-h-md); display: inline-flex; align-items: center; padding: 0 var(--inset-control); border: var(--hairline) solid var(--color-border-strong); border-right: 0; border-radius: var(--radius-field) 0 0 var(--radius-field); background: var(--color-surface-alt); color: var(--color-text-muted); font-size: var(--text-sm); white-space: nowrap; }
.slug-field .input { border-radius: 0 var(--radius-field) var(--radius-field) 0; }
.unit-field { display: flex; align-items: center; gap: var(--space-2); }
.unit-field .input { width: var(--unit-input-w); }
.unit-field .unit { color: var(--color-text-muted); font-size: var(--text-sm); }
.question-row { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); }
.question-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.question-foot > :last-child { margin-inline-start: auto; }
.select-time { width: var(--time-select-w); }
.hours-list { display: flex; flex-direction: column; }
.hours-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); min-height: calc(var(--toggle-h) + var(--space-5) + var(--hairline)); padding: var(--space-2) 0; border-bottom: var(--hairline) solid var(--color-border); }
.hours-day { flex: none; width: var(--hours-day-w); font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); }
.hours-times { display: flex; align-items: center; gap: var(--space-4); }
.hours-to, .hours-closed { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-text-subtle); }
.hours-row .toggle { margin-left: auto; }
@media (max-width: 600px) {
  .hours-times { order: 1; flex-basis: 100%; min-width: 0; }
  .hours-times .select-time { flex: 1 1 0; min-width: 0; }  /* two 150px selects don't fit a phone's card side by side */
}
.card-foot { padding: var(--space-4) var(--space-6); border-top: var(--hairline) solid var(--color-border); }
.input-file { padding: calc((var(--control-h-md) - var(--control-h-sm)) / 2 - var(--hairline)); }
.input-file::file-selector-button { height: var(--control-h-sm); margin-right: var(--space-3); padding: 0 var(--space-3); border: var(--hairline) solid var(--color-primary-tint); border-radius: var(--radius-button); background: var(--color-surface); box-shadow: var(--shadow-sm); font: inherit; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text); cursor: pointer; transition: background var(--duration-fast) var(--easing-standard), border-color var(--duration-fast) var(--easing-standard); }
.input-file::file-selector-button:hover { background: var(--color-surface-alt); border-color: var(--rpp-orange-200); }  /* as .btn-secondary:hover */
.product-image-preview { width: var(--product-preview-w); height: auto; display: block; border-radius: var(--radius-image); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.req { color: var(--color-primary); }

/* ---------- Public booking page ---------- */
.book { min-height: 100vh; padding: calc(var(--book-bar-h) + var(--space-8)) var(--space-4) calc(var(--book-actions-h) + var(--space-8)); }
.book-bar { position: fixed; top: 0; left: 0; right: 0; height: var(--book-bar-h); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 var(--space-6); background: var(--color-surface); border-bottom: var(--hairline) solid var(--color-border); z-index: 5; }
.book-mark { height: var(--space-8); width: auto; }
.book-studio { justify-self: end; font-weight: var(--weight-medium); color: var(--color-text); }
.book-progress { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: var(--space-2); }
.book-progress li { width: var(--dot); height: var(--dot); border-radius: var(--radius-pill); background: var(--rpp-grey-300); transition: width var(--duration-normal) var(--easing-standard), background var(--duration-fast) var(--easing-standard); }
.book-progress li.is-done { background: var(--color-primary); }
.book-progress li.is-current { width: var(--book-pill-w); background: var(--color-primary); }
.book-tally { justify-self: end; display: flex; align-items: center; gap: var(--space-2); color: var(--color-text-subtle); }
.book-total { font-weight: var(--weight-medium); color: var(--color-text); }
.book-counter { font-size: var(--text-xs); }
.book-form { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - var(--book-bar-h) - var(--book-actions-h) - 2 * var(--space-8)); }
.book-form > .callout { width: 100%; max-width: var(--book-w-mid); margin-bottom: var(--space-6); }
.book-step { width: 100%; display: flex; flex-direction: column; gap: var(--space-5); animation: book-in var(--duration-normal) var(--easing-standard); }
.book-w-narrow { max-width: var(--book-w-narrow); }
.book-w-mid { max-width: var(--book-w-mid); }
.book-w-wide { max-width: var(--book-w-wide); }
@keyframes book-in { from { opacity: 0; transform: translateY(var(--space-2)); } to { opacity: 1; transform: none; } }
.book-head { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-2); }
.book-title { font-weight: var(--weight-light); font-size: var(--text-h3); line-height: var(--lh-h3); letter-spacing: var(--tracking-heading); }  /* the narrow steps have no room for the greeting size */
.book-sub { color: var(--color-text-muted); font-size: var(--text-base); line-height: var(--lh-base); }
.book-h2 { font-size: var(--text-lg); line-height: var(--lh-lg); font-weight: var(--weight-light); letter-spacing: var(--tracking-heading); margin-bottom: var(--space-3); }
.book-questions { display: flex; flex-direction: column; gap: var(--space-4); padding-top: var(--space-4); border-top: var(--hairline) solid var(--color-border); }
.book-continuing { padding: var(--space-3) var(--space-4); border-radius: var(--radius-card); background: var(--color-surface-alt); color: var(--color-text-muted); font-size: var(--text-sm); }
.book-grid { gap: var(--space-4); }
.book-new-client { margin: 0; padding: 0; border: 0; min-width: 0; }

/* Address suggestions */
.places { position: relative; }
.places-list { list-style: none; margin: 0; font-size: var(--text-sm); line-height: var(--lh-sm); padding: var(--space-1); position: absolute; left: 0; right: 0; top: calc(100% + var(--space-1)); background: var(--color-surface); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); box-shadow: var(--shadow-pop); z-index: 4; max-height: var(--places-max-h); overflow: auto; }
.places-list li { display: flex; flex-direction: column; padding: var(--space-2) var(--space-3); border-radius: var(--radius-field); cursor: pointer; }
.places-list li.is-active { background: var(--color-surface-alt); }
.places-main { font-weight: var(--weight-medium); color: var(--color-text); }
.places-secondary { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); }

/* Product cards */
.book-section-head { display: flex; align-items: baseline; gap: var(--space-3); }
.book-products + .book-section-head { margin-top: var(--space-12); }
.book-section-title { font-size: var(--text-h4); line-height: var(--lh-h4); font-weight: var(--weight-light); letter-spacing: var(--tracking-heading); }
.book-products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-4); }
@media (max-width: 960px) { .book-products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .book-products { grid-template-columns: 1fr; } }
.book-product { display: flex; flex-direction: column; background: var(--color-surface); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-image); box-shadow: var(--shadow-card); overflow: hidden; transition: border-color var(--duration-fast) var(--easing-standard), box-shadow var(--duration-fast) var(--easing-standard); }
.book-product.is-selected { border-color: var(--color-primary); box-shadow: var(--shadow-glow); }
.book-product-media { position: relative; aspect-ratio: 3 / 2; background: var(--color-surface-alt); }
.book-product-media img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: var(--radius-image); }
.book-product-hatch { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: var(--space-4); text-align: center; color: var(--color-text-subtle); font-size: var(--text-xs); background: repeating-linear-gradient(135deg, var(--color-surface) 0 var(--hatch), var(--color-surface-alt) var(--hatch) calc(2 * var(--hatch))); }
.book-product-badge { position: absolute; left: var(--space-3); top: var(--space-3); height: var(--tag-h); display: inline-flex; align-items: center; padding: 0 var(--inset-pill); border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-primary-hover); font-size: var(--text-xs); font-weight: var(--weight-medium); box-shadow: var(--shadow-sm); }
.book-product-check { position: absolute; right: var(--space-3); top: var(--space-3); width: var(--avatar-24); height: var(--avatar-24); border-radius: var(--radius-circle); background: var(--color-primary); color: var(--color-text-inverse); display: none; align-items: center; justify-content: center; }
.book-product.is-selected .book-product-check { display: inline-flex; }
.book-product-body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); flex: 1; }
.book-product-title { font-size: var(--text-lg); line-height: var(--lh-lg); font-weight: var(--weight-light); letter-spacing: var(--tracking-heading); }
.book-product-meta { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--color-text-subtle); font-size: var(--text-sm); }
.book-product-desc { color: var(--color-text-muted); font-size: var(--text-sm); line-height: var(--lh-sm); }
.book-product-foot { margin-top: auto; padding-top: var(--space-3); display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.book-product-price { display: flex; flex-direction: column; font-weight: var(--weight-medium); color: var(--color-text); }
.book-stepper { display: inline-flex; align-items: center; border: var(--hairline) solid var(--color-border-strong); border-radius: var(--radius-pill); padding: 0 var(--space-1); }
.book-stepper-qty { min-width: var(--space-6); text-align: center; font-weight: var(--weight-medium); color: var(--color-text); }

/* Calendar and slots */
.book-cal-head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.book-cal-month { font-size: var(--text-lg); line-height: var(--lh-lg); font-weight: var(--weight-light); letter-spacing: var(--tracking-heading); }
.book-cal-nav { display: inline-flex; gap: var(--space-1); margin-right: auto; }
.btn.is-disabled { color: var(--color-text-disabled); pointer-events: none; }
.book-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2); }
.book-day { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); padding: var(--space-3) 0; border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-sm); transition: border-color var(--duration-fast) var(--easing-standard), background var(--duration-fast) var(--easing-standard); }
.book-day:hover { border-color: var(--rpp-orange-200); color: var(--color-text); }
.book-day.is-selected { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-text-inverse); box-shadow: var(--shadow-glow); }
.book-day.is-off { background: var(--color-surface-alt); color: var(--color-text-disabled); box-shadow: none; }
.book-day-name { font-size: var(--text-xs); line-height: var(--lh-xs); }
.book-day-num { font-size: var(--text-base); font-weight: var(--weight-medium); }
.book-day-dot { width: var(--dot); height: var(--dot); border-radius: var(--radius-circle); background: var(--color-primary); }
.book-day.is-selected .book-day-dot { background: var(--color-text-inverse); }
.book-day-title { font-size: var(--text-lg); line-height: var(--lh-lg); font-weight: var(--weight-light); letter-spacing: var(--tracking-heading); margin-top: var(--space-2); }
.book-period { display: flex; flex-direction: column; gap: var(--space-2); }
.book-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--slot-min-w), 1fr)); gap: var(--space-2); }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.slot span { display: flex; align-items: center; justify-content: center; height: var(--control-h-md); border: var(--hairline) solid var(--color-border-strong); border-radius: var(--radius-field); background: var(--color-surface); color: var(--color-text); font-size: var(--text-sm); font-variant-numeric: tabular-nums; box-shadow: var(--shadow-sm); transition: border-color var(--duration-fast) var(--easing-standard), background var(--duration-fast) var(--easing-standard); }
.slot input:checked + span { border-color: var(--color-primary); background: var(--color-primary); color: var(--color-text-inverse); font-weight: var(--weight-medium); box-shadow: var(--shadow-glow); }
.slot input:focus-visible + span { box-shadow: var(--focus-ring); }
.slot.is-off span { background: var(--color-surface-alt); border-color: var(--color-border); color: var(--color-text-disabled); box-shadow: none; }
.book-after-time { display: flex; flex-direction: column; gap: var(--space-4); }

/* Review and confirmation */
.book-summary { margin: 0; display: flex; flex-direction: column; }
.book-summary-row { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) 0; border-bottom: var(--hairline) solid var(--color-border); }
.book-summary-row dt { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); }
.book-summary-row dd { margin: 0; font-weight: var(--weight-medium); color: var(--color-text); }
.book-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.book-lines li { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; color: var(--color-text); }
.book-total-row { display: flex; justify-content: space-between; align-items: baseline; padding-top: var(--space-4); border-top: var(--hairline) solid var(--color-border-strong); }
.book-grand { font-size: var(--text-lg); line-height: var(--lh-lg); font-weight: var(--weight-light); color: var(--color-text); }
.book-done-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; padding-top: var(--space-2); }
.book-done { padding-bottom: var(--space-8); }
.book-done .book-step { margin: 0 auto; }

/* Action bar */
.book-actions { position: fixed; left: 0; right: 0; bottom: 0; height: var(--book-actions-h); display: flex; align-items: center; justify-content: center; padding: 0 var(--space-4); background: var(--color-surface); border-top: var(--hairline) solid var(--color-border); z-index: 5; }
.book-actions-inner { display: flex; gap: var(--space-2); width: 100%; max-width: var(--book-w-narrow); }
.book-next { flex: 1; }
@media (max-width: 600px) {
  .book-bar { padding: 0 var(--space-4); }
  .book-counter { display: none; }
  .book-days { gap: var(--space-1); }
}

/* ---------- Radio cards, on the settings screens and the booking page ---------- */
.choices { display: flex; flex-direction: column; gap: var(--space-2); }
.choice { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); box-shadow: var(--shadow-card); transition: border-color var(--duration-fast) var(--easing-standard), background var(--duration-fast) var(--easing-standard); }
label.choice, .choice-pick { cursor: pointer; }
.choice-pick { flex: 1; display: flex; align-items: center; gap: var(--space-3); }
.choice input:is([type="radio"], [type="checkbox"]) { width: var(--space-4); height: var(--space-4); margin: 0; accent-color: var(--color-primary); flex: none; }
.choice:has(input:is([type="radio"], [type="checkbox"]):checked) { border-color: var(--color-primary); background: var(--color-primary-wash); }
.choice:has(input:is([type="radio"], [type="checkbox"]):focus-visible) { box-shadow: var(--focus-ring); }
.choices-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) { .choices-2 { grid-template-columns: minmax(0, 1fr); } }  /* a card shrinks to the phone, not the phone's page to the card */
.choices-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) { .choices-3 { grid-template-columns: minmax(0, 1fr); } }
.choice-card { position: relative; flex-direction: column; align-items: flex-start; flex-wrap: nowrap; padding: var(--space-4); }
.choice.choice-card input[type="radio"] { position: absolute; top: var(--space-3); right: var(--space-3); }
.choice-card-icon { display: flex; align-items: center; justify-content: center; width: var(--avatar-36); height: var(--avatar-36); border-radius: var(--radius-tile); background: var(--color-surface-alt); color: var(--color-text); transition: background var(--duration-fast) var(--easing-standard), color var(--duration-fast) var(--easing-standard); }
.choice-card:has(:checked) .choice-card-icon { background: var(--color-primary-tint); color: var(--color-primary); }
.choice-card .choice-text { gap: var(--space-1); }
.preference-switches { gap: var(--space-3); }
.preference-switches > form { display: flex; flex-direction: column; gap: var(--space-2); }
.preference-switches .setting-row { flex: 1; gap: var(--space-3); transition: border-color var(--duration-fast) var(--easing-standard), background var(--duration-fast) var(--easing-standard); }
.preference-switches .setting-row:has(.toggle:checked) { border-color: var(--color-primary); background: var(--color-primary-tint); }
.preference-switches .setting-text { gap: 0; }
.preference-switches .setting-desc { color: var(--color-text-subtle); }
/* Its own grid, not .grid-3, so the 1360px step doesn't override .grid-3's. */
.option-cards-count { margin-bottom: var(--space-3); }
.option-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.option-card { display: flex; flex-direction: column; min-width: 0; border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); overflow: hidden; }
.option-card-body { flex: 1; display: flex; gap: var(--space-3); padding: var(--space-4); }
.option-card-icon { flex: none; display: flex; align-items: center; justify-content: center; width: var(--avatar-36); height: var(--avatar-36); border-radius: var(--radius-tile); background: var(--tint-blue-bg); color: var(--color-text); }
.option-card-text { display: flex; flex-direction: column; min-width: 0; }
.option-card-name { font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); color: var(--color-text); overflow-wrap: anywhere; }
.option-card-desc { min-height: calc(2 * var(--lh-xs)); font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); overflow-wrap: anywhere; }
.option-card-foot { display: grid; grid-template-columns: 1fr 1fr; border-top: var(--hairline) solid var(--color-border); }
.option-card-foot > div { display: flex; align-items: center; justify-content: center; min-height: var(--control-h-md); }
.option-card-foot > div + div { border-left: var(--hairline) solid var(--color-border); }
.option-card-foot .btn-ghost { color: var(--color-text); }
.option-card-foot .btn-danger { border-color: transparent; }
.option-cards-limits { margin-top: var(--space-4); }
@media (max-width: 1360px) { .option-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) { .option-cards { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Settings › Service area ---------- */
.area-overview { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.area-overview:has(> .area-overview-map:not([hidden])) { grid-template-columns: var(--area-cards-w) minmax(0, 1fr); }
.area-list { display: flex; flex-direction: column; gap: var(--space-3); }
.area-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--area-cards-w), 100%), 1fr)); gap: var(--space-3); }
.area-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); transition: border-color var(--duration-fast) var(--easing-standard), background var(--duration-fast) var(--easing-standard); }
.area-card:has(.toggle:checked) { border-color: var(--color-primary); background: var(--color-primary-tint); }
.area-card-head { display: flex; align-items: center; gap: var(--space-2); }
.area-card-head form { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.area-card-name { min-width: 0; overflow-wrap: anywhere; font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); color: var(--color-text); }
.area-card-meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.area-card-products { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); }
@media (max-width: 1200px) { .area-overview:has(> .area-overview-map:not([hidden])) { grid-template-columns: minmax(0, 1fr); } }
.area-colours { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.area-colour { position: relative; display: inline-flex; }
.area-colour input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.area-colour span { width: var(--area-pick); height: var(--area-pick); border-radius: var(--radius-circle); transition: box-shadow var(--duration-fast) var(--easing-standard); }
.area-colour input:checked + span { box-shadow: 0 0 0 var(--area-ring) var(--color-surface), 0 0 0 calc(2 * var(--area-ring)) var(--color-text); }
.area-colour input:focus-visible + span { box-shadow: var(--focus-ring); }
.area-map { height: var(--area-map-h); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); overflow: hidden; background: var(--color-surface-alt); }
/* The territory maps' hatching of open areas, an SVG in the map's overlay pane. */
.territory-hatch { position: absolute; pointer-events: none; }
.territory-hatch path { fill: url(#territory-hatch); fill-rule: evenodd; }
.territory-hatch line { stroke: var(--rpp-grey-600); stroke-width: 1.5; }
.area-overview-map { height: var(--area-overview-h); border: 0; background: var(--rpp-grey-200); }  /* after .area-map, which it resizes */
.place-map { height: var(--place-map-h); }

/* ---------- Dashboard › Run mode ---------- */
   /* A visit's number takes its first person's .swatch-N colour, which the map's pins copy. */
.run-mode { display: flex; gap: var(--space-6); align-items: stretch; }
.run-map { flex: 1 1 0; min-width: 0; height: auto; min-height: var(--run-map-h); box-shadow: var(--shadow-card); }
.run-card { flex: 1 1 0; min-width: 0; }
.run-map:not([hidden]) ~ .run-card { flex: 0 0 var(--run-card-w); }
@media (max-width: 1199px) {
  .run-mode { flex-direction: column; }
  .run-map, .run-map:not([hidden]) ~ .run-card { flex: none; }
  .run-map { min-height: var(--run-map-h-narrow); }
  .run-mode[data-run-map-area-value] > .run-card { order: -1; }
}
.run-number { display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--avatar-24); height: var(--avatar-24); border-radius: var(--radius-circle); color: var(--color-text-inverse); font-size: var(--text-xs); font-weight: var(--weight-medium); line-height: 1; }
.run-number.swatch-0 { color: var(--color-text); }
.run-legend li { flex-wrap: wrap; row-gap: 0; }
.run-legend .hint { flex-basis: 100%; padding-left: calc(var(--swatch) + var(--gap-control)); }

/* ---------- Products: variation rows and checkbox lists ---------- */
.option-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: var(--space-3); align-items: end; }
.option-row > :last-child { grid-column: -2; }  /* keeps the row's end while Digital hides the duration before it */
.option-row-booked { line-height: var(--control-h-md); white-space: nowrap; }
@media (max-width: 600px) { .option-row { grid-template-columns: 1fr; } }
.check-list { display: flex; flex-direction: column; gap: var(--space-2); max-height: var(--check-list-max-h); overflow: auto; padding: var(--space-3); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-field); background: var(--color-surface); }

/* ---------- Booking page: product dialog, photographer, twilight visit, payment ---------- */
.book-product-option { color: var(--color-primary-hover); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.book-product-option:empty { display: none; }
.book-dialog, .app-dialog { width: min(var(--book-dialog-w), calc(100vw - 2 * var(--space-4))); max-height: calc(100vh - 2 * var(--space-8)); padding: 0; border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-pop); overflow: hidden; }
.book-dialog[open], .app-dialog[open] { display: flex; flex-direction: column; }
.book-dialog::backdrop, .app-dialog::backdrop { background: var(--overlay-scrim); }
.book-dialog-media { position: relative; aspect-ratio: 3 / 1; background: var(--color-surface-alt); flex: none; }
.book-dialog-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-dialog-close { position: absolute; right: var(--space-3); top: var(--space-3); }
.book-dialog-body, .app-dialog-body { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); overflow: auto; }
.book-dialog-title, .app-dialog-title { font-size: var(--text-lg); line-height: var(--lh-lg); font-weight: var(--weight-light); letter-spacing: var(--tracking-heading); }
.book-dialog-foot, .app-dialog-foot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-4); padding: var(--space-4) var(--space-5); border-top: var(--hairline) solid var(--color-border); flex: none; }
.app-dialog-foot.end { justify-content: flex-end; gap: var(--space-3); }
.app-dialog-foot.end > .hint { margin-right: auto; }
@media (max-width: 600px) { .app-dialog-foot.end > .hint { flex-basis: 100%; } }  /* so Cancel and the action keep one line */
.app-dialog-sub { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-text-muted); }
/* Set left and wrapping, whatever the cell it sits in (a list row's .row-action). */
.confirm-dialog { width: min(var(--confirm-dialog-w), calc(100vw - 2 * var(--space-4))); white-space: normal; text-align: left; }
.confirm-dialog .app-dialog-body { flex-direction: row; align-items: flex-start; gap: var(--space-4); }
.confirm-text { display: flex; flex-direction: column; gap: var(--space-2); overflow-wrap: anywhere; }
.confirm-form { margin: 0; }
.book-dialog-total { display: flex; flex-direction: column; margin-left: auto; text-align: right; font-weight: var(--weight-medium); }
.book-dialog .choice .num { font-weight: var(--weight-medium); }
.book-included { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-sm); color: var(--color-text-muted); }
.book-included li { display: flex; align-items: flex-start; gap: var(--space-2); }
.book-included .icon { color: var(--color-primary); }
.book-block { display: flex; flex-direction: column; gap: var(--space-2); }
.book-people { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.book-person { position: relative; }
.book-person input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.book-person > span { display: inline-flex; align-items: center; gap: var(--space-2); height: var(--control-h-md); padding: 0 var(--space-4) 0 var(--space-2); border: var(--hairline) solid var(--color-border-strong); border-radius: var(--radius-pill); background: var(--color-surface); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.book-person input:checked + span { border-color: var(--color-primary); box-shadow: var(--shadow-glow); }
.book-person input:focus-visible + span { box-shadow: var(--focus-ring); }
.book-twilight .book-slots { max-width: calc(2 * var(--slot-min-w)); }
.book-due-row { display: flex; justify-content: space-between; color: var(--color-primary-hover); font-weight: var(--weight-medium); }
.book-due { display: contents; }

/* ---------- Upload to Editor ---------- */
/* The bar sticks at the wizard's end in a place of its own, so the last card always scrolls clear of it. */
/* Scrolling stops short of the bar, at the height wizard_bar_controller.js measures. */
html:has(.wizard-bar) { scroll-padding-bottom: calc(var(--wizard-bar-h, var(--wizard-bar-h-fallback)) + var(--space-4)); }
.page:has(> .wizard) { flex: 1; display: flex; flex-direction: column; padding-bottom: 0; }
.wizard { flex: 1; display: flex; flex-direction: column; gap: var(--space-6); }
.wizard-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.wizard-step-sep { display: flex; color: var(--color-text-disabled); }
.wizard-step-link { display: inline-flex; align-items: center; gap: var(--gap-control); padding: 0; border: 0; background: none; font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text-subtle); cursor: default; }
button.wizard-step-link:focus-visible, a.wizard-step-link:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-pill); }
.wizard-step-dot { display: inline-flex; align-items: center; justify-content: center; width: var(--avatar-24); height: var(--avatar-24); border-radius: var(--radius-circle); background: var(--color-surface-alt); color: var(--color-text-muted); font-size: var(--text-xs); }
.wizard-step-dot .icon { display: none; }
.wizard-step.is-current .wizard-step-link, .wizard-step.is-done .wizard-step-link { color: var(--color-text); }
.wizard-step.is-current .wizard-step-dot { background: var(--color-primary); color: var(--color-text-inverse); }
.wizard-step.is-done .wizard-step-dot { background: var(--rpp-grey-900); color: var(--color-text-inverse); }
.wizard-step.is-done .wizard-step-num { display: none; }
.wizard-step.is-done .wizard-step-dot .icon { display: block; }
.wizard-step.is-done .wizard-step-link { cursor: pointer; }
.wizard-step:not(.is-done) button.wizard-step-link { pointer-events: none; }
.wizard-body { width: 100%; margin: 0 auto; }
.wizard-narrow { max-width: var(--book-w-mid); }
.wizard-wide { max-width: var(--book-w-wide); }
.wizard-head { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; margin-bottom: var(--space-2); }
.wizard-title { font-weight: var(--weight-light); font-size: var(--text-h3); line-height: var(--lh-h3); letter-spacing: var(--tracking-heading); }
.wizard-sub { color: var(--color-text-body); font-size: var(--text-base); line-height: var(--lh-base); }
.wizard-search { flex: none; width: 100%; }
.job-matches { z-index: 30; }
.job-matches li { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-3); }
.job-matches li:not(.is-active):hover { background: none; }
.job-matches li.is-empty { cursor: default; color: var(--color-text-subtle); background: none; }
.wizard-job { flex-wrap: nowrap; }
.wizard-job-pin { display: flex; align-items: center; justify-content: center; width: var(--avatar-32); height: var(--avatar-32); flex: none; border-radius: var(--radius-tile); background: var(--tint-orange-bg); color: var(--tint-orange-fg); }
.wizard-job-text { flex: 1; min-width: 0; }
.wizard-job-text .text-strong { overflow-wrap: anywhere; }
.wizard-job-text .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* One four-column grid for every group, so tiles are one size. */
.wizard-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-6) var(--space-4); }
.wizard-group { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; row-gap: var(--space-3); align-content: start; }
.wizard-group.is-half { grid-column: span 2; }
.wizard-group-head { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-control); min-height: var(--control-h-sm); }
.wizard-tiles { display: contents; }
@media (max-width: 960px) { .wizard-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wizard-group.is-half { grid-column: 1 / -1; } }
.wizard-tile { position: relative; aspect-ratio: 1; display: flex; align-items: flex-end; overflow: hidden; border: var(--hairline) solid var(--color-border); border-radius: var(--radius-image); background: var(--scrim-photo), var(--rpp-grey-600); box-shadow: var(--shadow-card); cursor: pointer; transition: border-color var(--duration-fast) var(--easing-standard), box-shadow var(--duration-fast) var(--easing-standard); }
.wizard-tile-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity var(--duration-fast) var(--easing-standard); }
.wizard-tile:hover .wizard-tile-photo { opacity: .88; }
.wizard-tile-caption { position: relative; width: 100%; display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-8) var(--space-4) var(--space-4); background: var(--scrim-photo); color: var(--color-text-inverse); font-size: var(--text-xs); line-height: var(--lh-xs); }
.wizard-tile-name { font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); }
.wizard-tile-badge { position: absolute; left: var(--space-3); top: var(--space-3); display: flex; align-items: center; justify-content: center; width: var(--avatar-28); height: var(--avatar-28); border-radius: var(--radius-tile); background: var(--color-surface); color: var(--color-text-muted); }
.wizard-tile-check { position: absolute; right: var(--space-3); top: var(--space-3); width: var(--space-5); height: var(--space-5); margin: 0; accent-color: var(--color-primary); cursor: pointer; }
.wizard-tile:has(.wizard-tile-check:checked) { border-color: var(--color-primary); box-shadow: var(--shadow-glow); }
.wizard-tile:has(.wizard-tile-check:checked) .wizard-tile-badge { background: var(--color-primary); color: var(--color-text-inverse); }
.wizard-tile:has(.wizard-tile-check:focus-visible) { box-shadow: var(--focus-ring); }
.wizard-tile:has(.wizard-tile-check:disabled) { cursor: default; opacity: .6; }
.wizard-note { display: flex; align-items: flex-start; gap: var(--space-2); }
.wizard-tabs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-6); border-bottom: var(--hairline) solid var(--color-border); }
.wizard-tab-group { display: flex; flex-direction: column; gap: var(--gap-control); }
.wizard-tab-row { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.wizard-tab { display: inline-flex; align-items: center; gap: var(--space-2); margin-bottom: calc(-1 * var(--hairline)); padding: 0 0 var(--space-3); border: 0; border-bottom: var(--tab-underline) solid transparent; background: none; font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text-subtle); cursor: pointer; white-space: nowrap; }
.wizard-tab:hover { color: var(--color-text); }
.wizard-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.wizard-tab[aria-selected="true"] { color: var(--color-text); border-bottom-color: var(--color-primary); }
.wizard-tab-add { margin-left: auto; color: var(--color-primary); }
.wizard-tab-add:hover { color: var(--color-primary-hover); }
.text-link { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); white-space: nowrap; }
.record-header { margin-bottom: var(--space-6); }
.record-header .eyebrow { margin-bottom: var(--space-2); }
.record-header .page-title { overflow-wrap: anywhere; }
.record-title { display: grid; grid-template-columns: minmax(0, 1fr) var(--cover-w); grid-template-areas: "name cover" "status cover"; align-items: start; gap: var(--space-6); }
.record-name { grid-area: name; }
.record-address { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); color: var(--color-text-muted); overflow-wrap: anywhere; }
.record-address .icon { color: var(--color-text-subtle); }
.record-cover { grid-area: cover; align-self: stretch; display: flex; align-items: center; justify-content: center; border: var(--hairline) solid var(--color-border); border-radius: var(--radius-image); background: var(--color-surface); box-shadow: var(--shadow-card); color: var(--color-text-subtle); overflow: hidden; }  /* a card's plane, so the placeholder reads on the ground */
@media (max-width: 600px) {
  .record-title { grid-template-columns: minmax(0, 1fr) var(--space-16); grid-template-areas: "name cover" "status status"; gap: var(--space-4); }
  .record-cover { align-self: start; aspect-ratio: 1; }
}
.record-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4); min-height: var(--control-h-md); margin-bottom: var(--space-6); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-pill); background: var(--color-surface); box-shadow: var(--shadow-sm); }  /* a button's height even with only the pill, so the title never moves */
.record-actions { justify-content: flex-end; margin-left: auto; }
.record-tabs { width: fit-content; max-width: 100%; margin-bottom: var(--space-6); }
.record-tabs .segment[aria-current] .count { color: var(--rpp-orange-100); }  /* the grey count would not read on the orange */
.record-tabs .count { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-light); color: var(--color-text-subtle); }
/* A mask uses only alpha: its opaque colour is never drawn. No fade while a tab has keyboard focus, so its focus
   ring is never faded. */
.tab-strip { display: flex; overflow-x: auto; }
.tab-strip > * { flex: none; }
.tab-strip:is(.more-start, .more-end), .report-tabs:is(.more-start, .more-end) { mask-image: linear-gradient(to right, transparent, var(--color-text) var(--tabs-fade-start, 0px), var(--color-text) calc(100% - var(--tabs-fade-end, 0px)), transparent); }
.tab-strip.more-start, .report-tabs.more-start { --tabs-fade-start: var(--space-12); }
.tab-strip.more-end, .report-tabs.more-end { --tabs-fade-end: var(--space-12); }
.tab-strip:has(:focus-visible), .report-tabs:has(:focus-visible) { mask-image: none; }
/* A task tile's menu opens under the tile, as wide as it, so it never runs off the page. */
.project-status { display: block; grid-area: status; }
.project-status > .card { padding: var(--space-4) var(--space-5); }
.project-status .stack-sm > .callout { margin-bottom: 0; }
.project-status-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-3); }
.project-status-head .card-title { margin-bottom: 0; }
.project-status-head .project-status-bar { flex: 1 1 var(--space-16); }  /* the head is a row; in the Pipeline's column a basis would be the bar's height */
.project-status-bar { display: block; height: var(--space-1); border: 0; border-radius: var(--radius-pill); background: var(--bar-track, var(--rpp-grey-200)); appearance: none; overflow: hidden; }
.project-status-bar::-webkit-progress-bar { background: var(--bar-track, var(--rpp-grey-200)); }
.project-status-bar::-webkit-progress-value { background: var(--color-primary); border-radius: var(--radius-pill); }
.project-status-bar::-moz-progress-bar { background: var(--color-primary); border-radius: var(--radius-pill); }
button.text-link { padding: 0; border: 0; background: none; color: var(--color-primary); cursor: pointer; }
button.text-link:hover { color: var(--color-primary-hover); }
button.text-link:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-pill); }
.task-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(var(--task-tile-min), 100%), 1fr)); gap: var(--space-2); }
.task-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); padding: var(--space-2) var(--space-3); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); }
.task-tile .label { color: var(--color-text-muted); }
.task-tile .menu { position: static; }
.task-tile .menu-panel { left: 0; right: 0; width: auto; }
.task-select > summary { list-style: none; cursor: pointer; padding-right: var(--space-2); transition: box-shadow var(--duration-fast) var(--easing-standard); }
.task-select > summary::-webkit-details-marker { display: none; }
.task-select > summary .icon { color: var(--color-text-subtle); }
.task-select > summary:hover, .task-select[open] > summary { box-shadow: inset 0 0 0 var(--hairline) var(--color-primary); }
.task-select > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
@media (max-width: 600px) {
  .task-tile { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
}
.record-card-head { margin-bottom: var(--space-5); }
.record-card-head .card-title { margin-bottom: var(--space-1); }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--space-4); padding: var(--space-4) 0; border-top: var(--hairline) solid var(--color-border); }
.activity-row:first-child { border-top: 0; padding-top: 0; }
.activity-icon { display: flex; align-items: center; justify-content: center; width: var(--space-8); height: var(--space-8); border-radius: var(--radius-circle); background: var(--tint-orange-bg); color: var(--tint-orange-fg); }
.activity-text { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; font-size: var(--text-sm); line-height: var(--lh-sm); }
.activity-detail { color: var(--color-text-body); overflow-wrap: anywhere; }
.activity-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); overflow-wrap: anywhere; }
.activity-time { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); white-space: nowrap; }
/* A mention is Medium, not a link's orange: there is nothing to click. */
.comments { list-style: none; margin: 0 0 var(--space-5); padding: 0; }
.comment { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: var(--space-3); padding: var(--space-4) 0; border-top: var(--hairline) solid var(--color-border); scroll-margin-top: var(--space-8); }
.comment:first-child { border-top: 0; padding-top: 0; }
.comment:target { background: var(--color-surface-alt); border-radius: var(--radius-card); border-top-color: transparent; margin-inline: calc(-1 * var(--space-3)); padding: var(--space-4) var(--space-3); }
.comment-text { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; font-size: var(--text-sm); line-height: var(--lh-sm); }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
.comment-head > .text-strong { min-width: 0; overflow-wrap: anywhere; }
.comment-time { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); }
.comment-body, .review-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.mention { font-weight: var(--weight-medium); color: var(--color-text); }
.comment-form { display: flex; flex-direction: column; gap: var(--space-3); }
.comment-form > .callout { margin-bottom: 0; }
.comment-box { position: relative; display: flex; flex-direction: column; }
.mention-list li { flex-direction: row; align-items: center; gap: var(--space-2); }
.mention-list .places-secondary { margin-left: auto; }
.mention-list li:not(.is-active):hover { background: none; }
.comment-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.comment-actions .is-over { color: var(--color-primary-hover); }
.feedback-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.feedback-thread { padding: var(--space-4); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); scroll-margin-top: var(--space-8); }
.feedback-thread-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-2) var(--space-3); }
.feedback-thread-file { display: flex; border-radius: var(--radius-field); }
.feedback-thread-open { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); min-width: 0; border-radius: var(--radius-field); color: var(--color-text); font-size: var(--text-sm); line-height: var(--lh-sm); }
.feedback-thread-file:focus-visible, .feedback-thread-open:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.feedback-thread-open:hover { color: var(--color-text); }
.feedback-thread-open:hover .feedback-thread-name { color: var(--color-primary); }
.feedback-thread-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.feedback-thread-meta { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.feedback-thread-meta > .icon { color: var(--color-text-subtle); }
.feedback-thread-action { margin: 0; }
.feedback-thread-body { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-4); padding-top: var(--space-4); border-top: var(--hairline) solid var(--color-border); }
.feedback-thread .comments { margin: 0; }
.feedback-thread-body > .pin-stage { align-self: flex-start; }  /* the stage wraps the image, never the row's width */
.comments-deletable .comment { grid-template-columns: auto minmax(0, 1fr) auto; }
.feedback-reply { display: flex; flex-direction: column; gap: var(--space-3); }
.feedback-reply-actions { flex-wrap: wrap; justify-content: flex-end; }
.feedback-reply-actions > .hint { margin-right: auto; }
.feedback-status { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.feedback-status .select { width: auto; }
.feedback-archived { margin-top: var(--space-3); }
.feedback-archived > summary { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface-alt); cursor: pointer; list-style: none; font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); }
.feedback-archived > summary::-webkit-details-marker { display: none; }
.feedback-archived > summary > .icon { color: var(--color-text-subtle); }
.feedback-archived > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.feedback-archived-chevron { margin-left: auto; transition: transform var(--duration-normal) var(--easing-standard); }
.feedback-archived[open] .feedback-archived-chevron { transform: rotate(180deg); }
.feedback-archived[open] > summary { margin-bottom: var(--space-3); }
/* No overflow: hidden, so the summary's focus ring isn't clipped. */
.accordion { display: flex; flex-direction: column; gap: var(--space-2); }
.accordion-section { border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); }
.accordion-section > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-card); list-style: none; cursor: pointer; font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); }
.accordion-section > summary::-webkit-details-marker { display: none; }
.accordion-section > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.accordion-section[open] > summary { background: var(--color-primary-wash); border-radius: var(--radius-card) var(--radius-card) 0 0; }
.accordion-chevron { color: var(--color-text-subtle); flex: none; transition: transform var(--duration-normal) var(--easing-standard); }
.accordion-section[open] .accordion-chevron { transform: rotate(90deg); }
.accordion-body { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4); border-top: var(--hairline) solid var(--color-border); }
@media (max-width: 600px) {
  .feedback-thread-head { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .feedback-thread-meta { margin-left: 0; }
  .feedback-thread-action { grid-column: 2; justify-self: start; }
  .feedback-thread-action .btn { margin-left: calc(-1 * var(--space-3)); }
}
.appointment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.appointment-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-4); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); }
.appointment-text { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-sm); line-height: var(--lh-sm); }
.appointment-day { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.appointment-products { color: var(--color-text); }
.date-tile { display: flex; flex-direction: column; align-items: center; width: var(--space-12); padding: var(--space-1) 0; border-radius: var(--radius-tile); background: var(--color-primary-wash); }
.date-tile-month { font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-primary-hover); }
.date-tile-day { font-size: var(--text-lg); line-height: var(--lh-lg); font-weight: var(--weight-light); color: var(--color-text); }
.record-answers { margin-top: var(--space-5); }
.record-card-bar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3) var(--space-4); }
.record-card-bar > .text-link { min-height: var(--lh-lg); }
.appointment-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); }
.appointment-actions, .appointment-qty { display: flex; align-items: center; gap: var(--space-2); }
/* The Deliverables tab's folders. Settings › Project status's stages share the list, the row and the handle. */
.folder-adds { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); }
.folder-list, .stage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.folder-row, .stage-row { flex-wrap: wrap; gap: var(--space-2) var(--space-3); cursor: auto; }
.drag-handle { cursor: grab; touch-action: none; color: var(--color-text-subtle); }
.is-dragging > .setting-row, .folder-chip.is-dragging { box-shadow: var(--shadow-pop); }  /* the dragged row only, not an open folder's chips */
.is-dragging > .setting-row .drag-handle, .folder-chip.is-dragging .drag-handle { cursor: grabbing; }
.folder-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-3); border-radius: var(--radius-field); }
.folder-open > .icon { color: var(--color-text-subtle); }
.folder-open .setting-title { overflow-wrap: anywhere; }
.folder-open .tag { align-self: flex-start; }
.folder-open:hover .setting-title { color: var(--color-primary); }
.folder-open:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.folder-controls { display: flex; align-items: center; gap: var(--space-3); }
.folder-row:has(.folder-orders) .folder-open { flex-basis: var(--folder-name-min); }
.folder-orders { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.folder-orders + .folder-controls { margin-left: auto; }  /* wrapped beside the pills, the switch and menu stay at the line's end */
.folder-orders .pill:hover { color: var(--rpp-grey-900); text-decoration: underline; }  /* an order's pill keeps its label colour; the underline shows it is a link */
.folder-orders .pill:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.folder-visibility { display: flex; align-items: center; gap: var(--space-3); margin: 0; }
.folder-contents { padding: var(--space-4) 0 var(--space-2); }
.folder-chip-row { margin-bottom: var(--space-5); }
.folder-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.folder-chips > li { min-width: 0; max-width: 100%; }
.folder-chip { padding: 0; }
.folder-chip-open { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; height: 100%; padding: 0 var(--inset-control); border-radius: inherit; color: inherit; }
.folder-chip-open:hover { color: inherit; }
.folder-chip-open:focus-visible { outline: none; }
.folder-chip-handle { display: inline-flex; align-items: center; flex: none; height: 100%; padding: 0 0 0 var(--space-2); border: 0; border-radius: inherit; background: none; }
.folder-chip-handle:focus-visible { outline: none; box-shadow: var(--focus-ring); }  /* the handle shows its own ring, so moving to the link shows */
.folder-chip:has(> .folder-chip-handle:focus-visible) { box-shadow: none; }
.folder-chip-handle + .folder-chip-open { padding-left: var(--space-1); }
.folder-chip-count { flex: none; font-weight: var(--weight-light); color: var(--color-text-subtle); }
.folder-chip-row > .hint { margin-top: var(--space-2); }
.folder-chip-row:has(+ .folder-child-bar) { margin-bottom: var(--space-3); }  /* the shown child's line sits close under the chips */
.folder-child-bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); margin: 0 0 var(--space-4); font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-text-subtle); }
.folder-child-bar .text-strong { overflow-wrap: anywhere; }
.folder-link { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .folder-controls { flex-basis: 100%; justify-content: space-between; }
  .folder-add-dialog .upload-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .folder-add-dialog .upload-actions { grid-column: 2 / -1; justify-self: end; }
}
.bill-add { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); }
.bill-add-product { flex: 1 1 var(--bill-select-min); min-width: 0; }
.money-field { position: relative; display: flex; align-items: center; }
.money-field-sign { position: absolute; left: var(--inset-control); font-size: var(--text-sm); color: var(--color-text-muted); pointer-events: none; }
.money-field .input { padding-left: calc(var(--inset-control) + var(--space-3)); }
.bill-table th.qty-col, .bill-table th.num-col { text-align: right; }
.bill-table .money-field { display: inline-flex; }
.bill-table .money-field .input { width: var(--unit-input-w); text-align: right; }
.bill-table .row-action { width: var(--control-h-sm); }
.customer-head { display: flex; align-items: flex-start; gap: var(--space-4); }
.customer-text { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.customer-text .card-title { margin-bottom: 0; overflow-wrap: anywhere; }
/* The customer page's figures go two to a row below 1360px, where a quarter can't hold a seven-figure
   total or "September 2026". */
.customer-profile .customer-head { flex-wrap: wrap; gap: var(--space-4) var(--space-5); }
.customer-profile .customer-text { flex: 1 1 var(--profile-text-min); }
.customer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-text-muted); }
.customer-meta-item { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; overflow-wrap: anywhere; }
.customer-meta-item .icon { flex: none; color: var(--color-text-subtle); }
.record-figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-6); margin: var(--space-6) 0 0; padding-top: var(--space-6); border-top: var(--hairline) solid var(--color-border); }
.record-figures > div, .report-figures > div { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; color: var(--color-text); }
.record-figures dd, .report-figures dd { margin-inline: 0; }
.record-figures .stat-value, .report-figures .stat-value { font-size: var(--text-h4); line-height: var(--lh-h4); }
.record-figures .stat-value.num, .report-figures .stat-value.num { white-space: nowrap; }
@media (max-width: 1360px) { .record-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) { .record-figures { grid-template-columns: minmax(0, 1fr); } }
.job-rows { list-style: none; margin: 0; padding: 0; }
.job-rows .job-card { padding: var(--space-3) 0; border-top: var(--hairline) solid var(--color-border); }
.job-rows .job-card:first-child { border-top: 0; padding-top: 0; }
.job-rows .job-card:last-child { border-bottom: var(--hairline) solid var(--color-border); }
.job-rows .job-card-thumb { background: var(--rpp-grey-200); }
.job-rows .job-card-address { display: block; width: fit-content; font-size: var(--text-sm); line-height: var(--lh-sm); }  /* a block of its own lines, so the body's 24px line doesn't set them */
.job-rows .job-card-meta { margin-top: 0; }
.job-rows .job-card-side .btn-icon { margin-left: auto; color: var(--color-text-subtle); }
.job-rows .job-card-side .btn-icon:hover { color: var(--color-text); }
.note-panel { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border: var(--hairline) solid var(--status-yellow); border-radius: var(--radius-card); background: var(--status-yellow-bg); }
.note-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.note-panel .label, .note-panel .hint { color: var(--color-text-muted); }
.customer-note { overflow-wrap: anywhere; font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-text); }
.customer-tab .subhead + .wizard-facts { margin-top: 0; }
.customer-tab .side-panel .wizard-facts { margin-top: 0; }
@media (min-width: 961px) { .customer-tab .side-panel .wizard-facts { grid-template-columns: minmax(0, 1fr); } }
.recent-jobs li { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.recent-jobs a { overflow-wrap: anywhere; }
.team-list li { flex-wrap: wrap; padding: var(--space-3) 0; border-bottom-color: var(--color-border); }
.team-list li:first-child { padding-top: 0; }
.team-list li:last-child { padding-bottom: 0; }
.team-list .with-avatar { gap: var(--space-3); }
.team-list .with-avatar, .team-list .page-actions { min-width: 0; }
.team-list .page-actions { flex: auto; flex-wrap: nowrap; justify-content: flex-end; margin-inline-start: calc(var(--avatar-36) + var(--space-3)); }
.team-list .cell-stack { min-width: 0; overflow-wrap: anywhere; }
.team-list .tag { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; line-height: var(--tag-h); }
@media (max-width: 600px) {
  .team-list li { display: grid; grid-template-columns: var(--avatar-36) minmax(0, 1fr) auto; gap: var(--space-2) var(--space-3); }
  .team-list .with-avatar { grid-column: 1 / 3; }
  .team-list .page-actions { display: contents; }
  .team-list .menu { grid-area: 1 / 3; align-self: start; }
  .team-list .tag { grid-area: 2 / 2 / 3 / 4; justify-self: start; }
}
.app-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.app-dialog-head > .btn-ghost.btn-icon, .app-dialog-head-end > .btn-ghost.btn-icon { color: var(--color-text-subtle); }
.app-dialog-head > .btn-ghost.btn-icon:hover, .app-dialog-head-end > .btn-ghost.btn-icon:hover { color: var(--color-text); }
.app-dialog-form .app-dialog-head .confirm-text { gap: var(--space-1); }
.app-dialog-head .confirm-text > .eyebrow { margin-bottom: var(--space-1); }
.app-dialog-form { display: contents; }
.app-dialog-form > .app-dialog-body { padding: var(--space-6); gap: var(--space-5); }
.app-dialog-form > .app-dialog-foot { padding: var(--space-4) var(--space-6); }
.app-dialog .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: inherit; column-gap: var(--space-4); }
.app-dialog-form .link-row { margin-bottom: 0; }
.app-dialog .field_with_errors { display: contents; }  /* Rails wraps a refused field and its label; the field keeps its place */
.app-dialog .callout { margin-bottom: 0; }
.app-dialog-body > .dl { margin-bottom: 0; }
.app-dialog-body:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }  /* a body long enough to scroll takes focus as the dialog opens */
.app-dialog .list .cell-stack { min-width: 0; overflow-wrap: anywhere; }
.app-dialog .stack > .hint { overflow-wrap: anywhere; }
/* The address suggestions open in the step's flow, so the dialog's scrolling body never cuts them off. */
.dialog-progress { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.dialog-progress li { height: var(--space-1); border-radius: var(--radius-pill); background: var(--rpp-grey-200); transition: background var(--duration-fast) var(--easing-standard); }
.dialog-progress li.is-done, .dialog-progress li.is-current { background: var(--color-primary); }
.app-dialog-head-end { display: flex; align-items: center; gap: var(--space-3); flex: none; }
.dialog-step, .dialog-step > .team-fields { gap: var(--space-5); }
.dialog-step > .form-section-title + .photo-field { margin-top: calc(-1 * var(--space-2)); }
.form-section-title { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); }
.notes-band { padding: var(--space-4); border-radius: var(--radius-card); background: var(--color-surface-alt); }
.create-customer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.create-customer-bar .hint { flex: 1; }
.create-customer { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); }
.customer-contact { display: flex; flex-wrap: wrap; column-gap: var(--space-4); }
.customer-contact > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.places-verified { display: flex; align-items: center; gap: var(--space-1); }
.places-verified .icon { color: var(--status-green-fg); }
/* The photo's label holds the hidden file field, so the field scrolls with the dialog's body and focus brings the
   ring into view. */
.photo-field { display: flex; flex-direction: column; gap: var(--space-2); }
.photo-field > :not(.photo-pick) { margin-inline-start: calc(var(--avatar-56) + var(--space-4)); }
.photo-pick { position: relative; display: flex; align-items: center; gap: var(--space-4); align-self: flex-start; max-width: 100%; padding-inline-end: var(--space-4); border-radius: var(--radius-pill); cursor: pointer; }
.photo-pick:has(:focus-visible) { box-shadow: var(--focus-ring); }
.photo-pick-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.photo-pick-title { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); }
.email-field { position: relative; }
.email-field > .icon { position: absolute; left: var(--inset-control); top: 50%; transform: translateY(-50%); color: var(--color-text-subtle); pointer-events: none; }  /* a press on it reaches the field */
.email-field .input { padding-left: var(--space-10); }
.email-status:not(:has(.hint)) { margin-top: calc(-1 * var(--space-2)); }
.email-available { color: var(--color-text); }
.email-available .icon { color: currentColor; }
.billing-place { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) var(--unit-input-w); gap: var(--space-4); }
.dialog-step .billing-place { row-gap: var(--space-5); }
.select-prompt:has(option[value=""]:checked) { color: var(--color-text-subtle); }
.select-prompt option { color: var(--color-text); }
.accounting-panel { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--inset-control) var(--space-4); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface-alt); }
.accounting-panel > .cell-stack { min-width: 0; font-size: var(--text-sm); overflow-wrap: anywhere; }
.accounting-panel > .btn, .accounting-panel > .pill { flex: none; }
@media (max-width: 600px) {
  .app-dialog-form > .app-dialog-body, .app-dialog-form > .app-dialog-foot { padding-inline: var(--space-5); }  /* so a foot's two buttons keep one line */
  .app-dialog .grid-2, .billing-place { grid-template-columns: minmax(0, 1fr); }
  .accounting-panel { flex-direction: column; align-items: flex-start; }
}
.app-dialog .places-list { position: static; margin-top: var(--space-1); }
@media (max-width: 600px) {
  .record-bar { border-radius: var(--radius-card); }
  .record-actions { justify-content: flex-start; width: 100%; margin-left: 0; position: relative; }
  .record-actions .menu { position: static; }
  .record-actions .menu-panel { left: 0; right: auto; max-width: 100%; }
  .customer-profile .customer-text { flex-basis: 0; }
  .appointment-row { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .activity-row { grid-template-columns: auto minmax(0, 1fr); }
  .activity-time { grid-column: 2; }
  .appointment-row .date-tile { grid-row: span 2; }
  .appointment-row > .appointment-end { grid-column: 2; justify-content: flex-start; }
  .create-customer-bar .hint { flex-basis: 100%; }
  /* The step count and close button take a line of their own, so the title keeps the dialog's whole width. */
  .app-dialog-head:has(> .app-dialog-head-end) { flex-wrap: wrap; row-gap: var(--space-2); }
  .app-dialog-head:has(> .app-dialog-head-end) > * { flex-basis: 100%; }
  .app-dialog-head-end { order: -1; justify-content: space-between; }
  .app-dialog .dl-wide { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-1); }
  .app-dialog .dl-wide > div:not(:first-child) > dt { margin-top: var(--space-2); }
}
.wizard-line { margin: 0; padding: 0; border: 0; min-width: 0; }
.wizard-finals .input { width: var(--unit-input-w); }
.wizard-addons { margin: 0; padding: 0; border: 0; min-width: 0; }
.wizard-addons-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-4); width: 100%; padding: 0; margin-bottom: var(--space-2); }
.choices-wrap { flex-direction: row; flex-wrap: wrap; }
.choice-text { display: flex; flex-direction: column; font-size: var(--text-sm); line-height: var(--lh-sm); }
.choice-name { font-weight: var(--weight-medium); color: var(--color-text); }
label.choice:has(input:disabled) { cursor: default; }
/* An Editor who doesn't do the order's services, in the Assign dialog. */
label.choice:has(input[type="radio"]:disabled) { opacity: .5; }
.choice > .work-status { margin-left: auto; }
.work-status { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); white-space: nowrap; }
/* A floated legend leaves the fieldset's top border and joins its column. */
.wizard-brief { padding-top: var(--space-4); border-top: var(--hairline) solid var(--color-border); }
.wizard-brief > legend { float: left; }
.wizard-outputs .choice-text, .wizard-brief .choice-text { flex: 1; }
.wizard-custom-size { display: flex; align-items: center; gap: var(--space-2); }
.wizard-custom-size .input { flex: 1; min-width: 0; }
/* A bracket tile keeps no overflow clip, so its ⋯ menu can float out of it. */
.wizard-brackets-summary { font-size: var(--text-sm); line-height: var(--lh-sm); }
.bracket-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--file-tile-min), 100%), 1fr)); gap: var(--space-3); }
.bracket-tile { display: flex; flex-direction: column; min-width: 0; border: var(--hairline) solid var(--color-border); border-radius: var(--radius-image); background: var(--color-surface); box-shadow: var(--shadow-card); }
.bracket-thumb { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; overflow: hidden; background: var(--color-surface-alt); color: var(--color-text-subtle); }
.bracket-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bracket-thumb-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--space-6) var(--space-3) var(--space-2); background: var(--scrim-photo); color: var(--color-text-inverse); font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); }
.bracket-body { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3); min-width: 0; }
.bracket-name { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); }
.bracket-range { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket-actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.bracket-actions .menu-panel { left: 0; right: auto; gap: var(--space-2); }
.pin-stage { position: relative; display: inline-block; max-width: 100%; margin: 0; line-height: 0; }
.pin-stage img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-image); }
.pin-stage.is-editing { cursor: crosshair; }
.pin { position: absolute; left: var(--pin-x); top: var(--pin-y); transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; width: var(--avatar-24); height: var(--avatar-24); padding: 0; border: 0; border-radius: var(--radius-circle); background: var(--color-primary); color: var(--color-text-inverse); box-shadow: var(--shadow-sm); font-size: var(--text-xs); line-height: 1; font-weight: var(--weight-medium); }
button.pin { cursor: pointer; }
button.pin:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.pin-badge { display: inline-flex; align-items: center; justify-content: center; margin-right: var(--space-2); width: var(--badge-h); height: var(--badge-h); border-radius: var(--radius-circle); background: var(--color-primary); color: var(--color-text-inverse); font-size: var(--text-xs); line-height: 1; font-weight: var(--weight-medium); }
.notes-dialog { width: min(var(--book-w-wide), calc(100vw - 2 * var(--space-4))); }
.notes-dialog-head-end, .notes-dialog-actions { display: flex; align-items: center; gap: var(--space-2); }
.notes-dialog-actions { margin-left: auto; }
.notes-dialog-grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-panel-w); gap: var(--space-6); }
.notes-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.notes-tools .hint { margin-right: auto; }
.notes-canvas { container-type: size; aspect-ratio: 3 / 2; display: flex; align-items: center; justify-content: center; background: var(--color-surface-alt); }
.notes-canvas img { max-width: 100cqw; max-height: 100cqh; }
.notes-canvas-status { padding: var(--space-4); text-align: center; }
.notes-caption { display: flex; align-items: flex-start; gap: var(--space-2); }
.notes-chips, .notes-files { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 960px) { .notes-dialog-grid { grid-template-columns: minmax(0, 1fr); } }
/* ---------- Order pages ---------- */
.order-banner { display: flex; align-items: center; gap: var(--space-4) var(--space-6); padding: var(--space-5) var(--space-6); border: var(--hairline) solid var(--rpp-orange-500); border-radius: var(--radius-card); background: var(--color-primary-wash); }
.order-banner-revision { border-color: var(--status-yellow); background: var(--status-yellow-bg); }
.order-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-body); overflow-wrap: anywhere; }
.order-banner-title { font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); color: var(--color-text); }
.order-banner-note { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-text); }
.order-banner-actions { flex: none; display: flex; flex-wrap: wrap; gap: var(--space-3); }
.order-banner-actions form { margin: 0; }
@media (max-width: 1199px) { .order-banner { flex-direction: column; align-items: stretch; } }  /* beside the side card the text would be squeezed */
.card-head { margin-bottom: var(--space-4); }
.card-head .card-title { margin-bottom: 0; }
.table-box { border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); overflow-x: auto; margin-bottom: var(--space-4); }
.order-card-section { margin-top: var(--space-4); padding-top: var(--space-4); border-top: var(--hairline) solid var(--color-border); }
.order-card > .card-title + .order-card-section { margin-top: 0; padding-top: 0; border-top: 0; }
.brief-preferences { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.order-card .cal-summary > div:last-child { border-bottom: 0; }
.order-card .cal-summary dt { min-width: 0; }
.order-card .disclosure { margin-top: var(--space-2); }
.order-card .list li { flex-wrap: wrap; gap: var(--space-1) var(--space-3); }  /* a sibling's pill goes under its number when both don't fit */
.order-amounts-total dt { font-weight: var(--weight-medium); color: var(--color-text); }
.deliver-counts > div { align-items: center; }
.line-group > summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin-bottom: var(--space-3); list-style: none; cursor: pointer; border-radius: var(--radius-card); }
.line-group > summary::-webkit-details-marker { display: none; }
.line-group > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.line-group[open] > summary .accordion-chevron { transform: rotate(90deg); }
.line-group-name { font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); color: var(--color-text); }
.line-group .disclosure[open] > summary { display: none; }  /* the brackets it unfolded stay, as if never folded */
.line-group:has(.bracket-unfold:not([open])) .bracket-row-folded { display: none; }
.bracket-row > summary { justify-content: flex-start; }
.bracket-row-name { flex: none; }
.bracket-row-thumbs { display: flex; gap: var(--space-1); flex: none; }
.bracket-row[open] .bracket-row-thumbs { display: none; }
.bracket-row > summary .tag { flex: none; }
@media (max-width: 600px) { .bracket-row-thumbs { display: none; } }  /* the shots line needs the width */
.bracket-row-meta { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-light); color: var(--color-text-subtle); }
.bracket-row-thumbs .file-mini { height: auto; aspect-ratio: 4 / 3; overflow: hidden; color: var(--color-text-subtle); font-size: var(--text-xs); line-height: 1; }
.bracket-row-thumbs .file-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-grid-compact { --file-tile-min: var(--file-tile-compact-min); }
.file-grid-compact .file-tile { border: 0; }
.file-grid-compact .file-meta { flex-direction: row; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) 0 0; }
.file-grid-compact .file-size { flex: none; }
/* "+N more" is a checkbox, so the rest show without a script. */
.file-grid-capped:not(:has(.file-more input:checked)) .file-tile-extra { display: none; }
.file-grid-capped:has(.file-more input:checked) .file-more { display: none; }
.file-more-label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1); aspect-ratio: 4 / 3; border: var(--hairline) dashed var(--color-border-strong); cursor: pointer; }
.file-more-label:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.file-more-count { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); }
.set-aside { margin-top: var(--space-4); }
.delivery-note { margin-top: var(--space-3); }
.finished-line-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.finished-line .subhead { margin: 0; }
.finished-line > .subhead { margin-bottom: var(--space-3); }
.files-add { margin-top: var(--space-4); }
/* A revision: the tick box on a finished tile, the dialog's picker and flagged strip, and its comments on both order pages. */
.file-pick { position: absolute; z-index: 1; left: var(--space-2); top: var(--space-2); width: var(--space-5); height: var(--space-5); margin: 0; accent-color: var(--color-primary); cursor: pointer; }
.revision-picker { aspect-ratio: 3 / 2; overflow-y: auto; padding: var(--space-4); background: var(--color-surface-alt); }
.revision-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--space-20), 1fr)); gap: var(--space-3); }
.revision-option { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.revision-option:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.revision-option-thumb, .revision-comment-thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-image); background: var(--color-surface); color: var(--color-text-subtle); font-size: var(--text-xs); line-height: 1; font-weight: var(--weight-medium); }
.revision-option-thumb img, .revision-comment-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.revision-shown-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); overflow-wrap: anywhere; }
.revision-comment-edits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.revision-comment-edit { display: flex; align-items: flex-start; gap: var(--space-2); }
.revision-comment-edit .pin-badge { margin: var(--space-3) 0 0; flex: none; }
.revision-comment-edit .textarea { flex: 1; min-width: 0; }
.revision-strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.revision-strip-tiles { display: contents; }
.revision-strip-tile { position: relative; display: flex; align-items: center; justify-content: center; width: var(--avatar-64); aspect-ratio: 4 / 3; padding: 0; border: var(--hairline) solid var(--color-border); border-radius: var(--radius-image); background: var(--color-surface-alt); color: var(--color-text-muted); cursor: pointer; }
.revision-strip-tile .revision-option-thumb { width: 100%; height: 100%; }
.revision-strip-tile.is-current { border-color: var(--color-primary); box-shadow: var(--focus-ring); }
.revision-strip-tile:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.revision-strip-more { border-style: dashed; background: var(--color-surface); }
.revision-strip-count { position: absolute; top: calc(-1 * var(--space-2)); right: calc(-1 * var(--space-2)); }
.order-banner-revision, .order-banner-qc { flex-wrap: wrap; }
.order-banner-revision > :not(.order-banner-text, .order-banner-actions), .order-banner-qc > :not(.order-banner-text, .order-banner-actions) { flex-basis: 100%; }
.revision-comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.revision-comment { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); }
.revision-comment .pin-badge { margin: 0; flex: none; }
.revision-comment-thumb { flex: none; width: var(--avatar-56); background: var(--color-surface-alt); }
.revision-comment-text { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: var(--text-sm); color: var(--color-text); }
.revision-stages { align-items: flex-start; }
/* The editing team's figures: a dl puts dt before dd, so column-reverse shows the value above its label. */
.team-figures { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-3); margin: var(--space-3) 0 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-card); background: var(--color-surface-alt); }
.team-figures > div { display: flex; flex-direction: column-reverse; gap: var(--space-1); min-width: 0; }
.team-figures dt { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-subtle); }
.team-figures dd { margin: 0; font-size: var(--text-lg); line-height: var(--lh-lg); font-weight: var(--weight-light); color: var(--color-text); }
.revision-stages .pin-stage { max-width: min(100%, var(--book-w-narrow)); }
/* A bracket's preview keeps its own width, so the pins stay on their points, and sits a pin's radius below the note. */
.bracket-notes { align-items: flex-start; }
.bracket-notes .pin-stage { max-width: min(100%, var(--book-w-narrow)); margin-top: var(--space-1); }
.bracket-note { overflow-wrap: anywhere; font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-text); }
.upload-summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); box-shadow: var(--shadow-card); font-size: var(--text-sm); line-height: var(--lh-sm); }
.upload-summary .btn { margin-left: auto; }
.upload-summary-badge { display: flex; align-items: center; justify-content: center; width: var(--avatar-32); height: var(--avatar-32); border-radius: var(--radius-tile); background: var(--tint-green-bg); color: var(--tint-green-fg); }
.upload-summary.is-busy .upload-summary-badge { background: var(--color-surface-alt); color: var(--color-text); }
.upload-actions { display: flex; gap: var(--space-1); justify-content: flex-end; }
.wizard-sums { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-sm); line-height: var(--lh-sm); }
.wizard-sums li { display: flex; justify-content: space-between; gap: var(--space-3); }
.wizard-sums li > :last-child { color: var(--color-text); font-weight: var(--weight-medium); }
.wizard-sums-included > :first-child { color: var(--color-text-subtle); }
.wizard-sums-totals { padding-top: var(--space-2); border-top: var(--hairline) solid var(--color-border); }
.wizard-sums-totals .text-strong, .wizard-sums-grand li { color: var(--color-text); font-weight: var(--weight-medium); }
.wizard-sums-grand { padding-top: var(--space-3); border-top: var(--hairline) solid var(--color-border-strong); }
.wizard-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.wizard-card-head .card-title { margin-bottom: 0; }
.wizard-order-title { margin: 0; }
.wizard-review-line { padding: var(--space-4); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); }
.wizard-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin: var(--space-4) 0 0; font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-text); }
.wizard-facts dt.label { color: var(--color-text-muted); }
.wizard-facts dd { margin: var(--space-1) 0 0; overflow-wrap: anywhere; }
.wizard-facts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.xero-contact { overflow-wrap: anywhere; }
.xero-contact > .callout { margin-bottom: 0; }
.wizard-grand { font-size: var(--text-lg); line-height: var(--lh-lg); color: var(--color-text); }
.wizard-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-10); margin: auto calc(-1 * var(--space-8)) 0; padding: var(--space-4) var(--space-8); border-top: var(--hairline) solid var(--color-border); background: var(--color-surface); box-shadow: var(--shadow-card); }
.wizard-tally { display: flex; flex-direction: column; gap: var(--space-1); }
.wizard-tally-value { font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); color: var(--color-text); }
.wizard-bar-actions { display: flex; gap: var(--space-2); margin-left: auto; }
@media (max-width: 600px) { .wizard-facts { grid-template-columns: minmax(0, 1fr); } .wizard-bar { margin-inline: calc(-1 * var(--space-4)); padding-inline: var(--space-4); } .wizard-bar-actions { margin-left: 0; width: 100%; } .wizard-bar-actions .btn { flex: 1; } }

/* ---------- Orders list ---------- */
.order-list-controls .select { width: auto; margin-left: auto; }  /* the dates are the bar's view control, on the right */
.order-list-table th.num-col { text-align: right; }  /* .table th alone would put it left */
.order-list-table td { white-space: nowrap; }
.order-list-table .app-dialog { white-space: normal; text-align: left; }  /* it sits in the row action cell, which is right-aligned and nowrap */
.order-list-more { margin-top: var(--space-3); }

/* ---------- Order status grid ---------- */
/* Rows are Turbo Frames, so this is CSS grid rather than a table. Up to nine columns need 1136px plus the page's
   chrome, so below 1360px each row wraps its cells under the property. */
.status-grid-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.status-grid-head .card-title { margin-bottom: var(--space-1); }
.status-grid { margin: 0 calc(-1 * var(--space-6)) calc(-1 * var(--space-6)); font-size: var(--text-sm); line-height: var(--lh-sm); }
.status-row { display: grid; grid-template-columns: minmax(var(--status-property-min), 2.4fr) var(--status-date-w) var(--status-notes-w); grid-auto-columns: minmax(var(--status-cell-min), 1fr); grid-auto-flow: column; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-6); border-bottom: var(--hairline) solid var(--color-surface-alt); }
.status-row:last-child { border-bottom: 0; }
.status-row-head { padding-top: var(--space-2); padding-bottom: var(--space-2); background: var(--color-surface-alt); border-bottom-color: var(--color-border); font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text-muted); }
.status-property { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.status-property-text { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); min-width: 0; }
.status-property-text > .menu { max-width: 100%; }
.status-property .menu-panel { width: max-content; }
.status-property .menu-item { white-space: nowrap; }
.status-property-name { display: flex; align-items: center; gap: var(--space-1); list-style: none; cursor: pointer; min-width: 0; }
.status-property-name::-webkit-details-marker, .status-select > summary::-webkit-details-marker, .status-notes-count::-webkit-details-marker { display: none; }
.status-property-name .text-strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-property-name:hover .text-strong { color: var(--color-primary); }
.status-property-name .icon, .status-select > summary .icon { color: var(--color-text-subtle); flex: none; }
.status-property .menu-panel, .status-select .menu-panel, .status-notes { left: 0; right: auto; }
.status-cell:nth-last-of-type(-n+2) .menu-panel { left: auto; right: 0; }
.status-cell-label { display: none; font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-medium); color: var(--color-text-muted); }
.status-notes-count { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--color-text-subtle); list-style: none; cursor: pointer; }
.status-notes { width: var(--side-panel-w); }
.status-select > summary { display: inline-flex; align-items: center; gap: var(--space-2); height: var(--pill-h); padding: 0 var(--space-2) 0 var(--inset-pill); border: var(--hairline) solid var(--color-border-strong); border-radius: var(--radius-pill); background: var(--color-surface); font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--rpp-grey-900); white-space: nowrap; list-style: none; cursor: pointer; transition: border-color var(--duration-fast) var(--easing-standard); }
.status-select > summary:hover, .status-select[open] > summary { border-color: var(--color-primary); }
.status-dot { width: var(--pill-dot); height: var(--pill-dot); border-radius: var(--radius-circle); background: var(--pill-dot-color, var(--rpp-grey-400)); flex: none; }
.cell-status-in-progress { --pill-dot-color: var(--status-blue); }
.cell-status-on-hold { --pill-dot-color: var(--status-yellow); }
.cell-status-complete { --pill-dot-color: var(--status-green); }
.status-dot-neutral, .status-dot-off { --pill-dot-color: var(--rpp-grey-400); }
.status-dot-info { --pill-dot-color: var(--status-blue); }
.status-dot-warning { --pill-dot-color: var(--status-yellow); }
.status-dot-success { --pill-dot-color: var(--status-green); }
.status-dot-danger { --pill-dot-color: var(--rpp-orange-500); }
.status-select > summary:focus-visible, .status-property-name:focus-visible, .status-notes-count:focus-visible, .menu-item:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.menu-list { gap: 0; padding: var(--space-2); }
.status-choices { display: contents; }
.menu-item { display: flex; align-items: center; gap: var(--inset-pill); width: 100%; padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-field); background: none; font: inherit; font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); text-align: left; list-style: none; cursor: pointer; }
.menu-item::-webkit-details-marker { display: none; }
.menu-item:hover { background: var(--color-surface-alt); color: var(--color-text); }
.menu-item.is-current { background: var(--rpp-orange-100); }
.menu-item[aria-disabled="true"], .menu-item[aria-disabled="true"]:hover { background: none; color: var(--color-text-subtle); cursor: default; }
.menu-item .pill { margin-left: auto; }
.menu-list > .hint { padding: var(--space-2) var(--space-3); }
.menu-divider { border: 0; border-top: var(--hairline) solid var(--color-border); margin: var(--space-2) 0; }
.menu-item .icon { color: var(--color-text-subtle); }
.menu-item-text { display: flex; flex-direction: column; min-width: 0; }
.menu-item-sub { font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: var(--weight-light); color: var(--color-text-subtle); }
.menu-item-danger, .menu-item-danger .icon, .menu-item-danger:hover { color: var(--color-primary); }
.menu-list form { margin: 0; }
.menu-list .disclosure[open] > summary { margin-bottom: var(--space-2); }
.menu-list > .callout { margin-bottom: var(--space-2); }
.account-menu > .menu-panel { width: var(--side-panel-w); }
.account-person { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); }
.account-person-text { display: flex; flex-direction: column; min-width: 0; font-size: var(--text-sm); line-height: var(--lh-sm); }
.account-person-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-profile { display: flex; align-items: center; gap: var(--space-4); min-width: 0; margin-bottom: var(--space-5); }
.notifications-panel { width: var(--notifications-w); max-height: calc(100vh - var(--topbar-h) - var(--space-6)); padding: 0; gap: 0; overflow: hidden; }
.notifications-panel > .hint { padding: var(--space-4); }
.notifications-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: var(--hairline) solid var(--color-border); flex: none; }
.notifications-title { font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); }
.notifications-head form, .notifications form { margin: 0; }
.notifications { list-style: none; padding: 0; overflow-y: auto; min-height: 0; }
.notifications li + li { border-top: var(--hairline) solid var(--color-border); }
.notification { display: flex; align-items: flex-start; gap: var(--space-3); width: 100%; padding: var(--space-3) var(--space-4); border: 0; background: var(--color-surface); text-align: left; cursor: pointer; transition: background var(--duration-fast) var(--easing-standard); }
.notification.is-unread { background: var(--color-primary-tint); }
.notification:not(.is-unread):hover { background: var(--color-surface-alt); }
.notification:hover .notification-title { color: var(--color-primary); }
.notification:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
.notification-icon, .search-row-icon { display: flex; align-items: center; justify-content: center; width: var(--avatar-32); height: var(--avatar-32); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-circle); background: var(--color-surface); color: var(--color-text); flex: none; }
.notification-text { display: flex; flex-direction: column; gap: var(--space-1); flex: 1; min-width: 0; font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--color-text-body); }
.notification-title { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); }
.notification-time { color: var(--color-text-subtle); }
.notification-dot, .attention-dot { width: var(--pill-dot); height: var(--pill-dot); margin-top: calc((var(--lh-sm) - var(--pill-dot)) / 2); border-radius: var(--radius-circle); background: var(--pill-dot-color, var(--color-primary)); flex: none; }
@media (max-width: 1360px) {
  .status-row { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: row; row-gap: var(--space-2); align-items: start; }
  .status-row-head { display: none; }
  .status-property { grid-column: 1 / -1; }
  .status-property, .status-cell { position: relative; }
  .status-row .menu { position: static; }
  .status-row .menu-panel { max-width: calc(100vw - 2 * var(--space-4)); }
  .status-property .menu-panel { max-width: 100%; }
  .status-property .menu-item { white-space: normal; }
  .status-cell { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); }
  .status-cell-label { display: block; }
  .status-cell:nth-last-of-type(-n+2) .menu-panel { left: 0; right: auto; }  /* wrapped, the four-across rule below picks the edge */
  .status-cell:nth-of-type(4n) .menu-panel, .status-cell:nth-of-type(4n+1) .menu-panel { left: auto; right: 0; }
}
@media (max-width: 960px) {
  .status-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-cell:nth-of-type(even) .menu-panel { left: 0; right: auto; }
  .status-cell:nth-of-type(odd) .menu-panel { left: auto; right: 0; }
}

/* ---------- Reports ---------- */
.report-filters { margin-bottom: var(--space-6); }
.report-dates { margin-top: var(--space-3); }
.report-breakdowns { display: flex; flex-direction: column; gap: var(--space-3); }
.report-breakdown { display: flex; align-items: center; gap: var(--space-3) var(--space-6); padding: var(--space-4); }
.report-breakdown-title { flex: none; width: var(--breakdown-title-w); font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); }
.report-breakdown-list { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); padding: 0; list-style: none; font-size: var(--text-sm); line-height: var(--lh-sm); }
.report-breakdown-list li { display: inline-flex; align-items: center; gap: var(--space-2); }
.report-breakdown-count { font-weight: var(--weight-medium); color: var(--color-text); }
@media (max-width: 600px) { .report-breakdown { flex-direction: column; align-items: flex-start; } }
.report-highlights, .report-tabs, .report-xero, .report-callout, .report-income, .report-invoices { margin-bottom: var(--space-6); }
.report-highlights > .subhead { margin-top: 0; }
.report-highlights > .subhead .icon { color: var(--color-primary); }
.report-highlights-list { display: flex; flex-direction: column; gap: var(--space-2); padding: 0; list-style: none; font-size: var(--text-sm); line-height: var(--lh-sm); }
.report-highlights-list li { display: flex; align-items: flex-start; gap: var(--space-2); }
.report-highlights-list li::before { content: ""; flex: none; width: var(--dot); height: var(--dot); margin-top: calc((var(--lh-sm) - var(--dot)) / 2); border-radius: var(--radius-circle); background: var(--rpp-grey-400); }
.report-tabs { display: flex; }
.report-tabs .segment { flex: none; }
.report-xero { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.report-xero-icon { display: flex; align-items: center; justify-content: center; flex: none; width: var(--avatar-40); height: var(--avatar-40); border-radius: var(--radius-tile); background: var(--color-surface-alt); color: var(--color-text); }
.report-xero-text { flex: 1 1 0; min-width: 0; font-size: var(--text-sm); line-height: var(--lh-sm); }
.report-xero-title { font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); }
.report-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); margin: 0; }
.report-bar { fill: var(--color-primary); }
.report-bar-earlier { fill: var(--rpp-orange-200); }
.report-bar-usual { fill: var(--rpp-grey-300); }  /* a week at or above the studio's usual, so the weeks below it stand out */
.money-bar-fees { fill: var(--rpp-grey-800); }
.money-bar-so-far { fill: var(--rpp-orange-300); }  /* this month, to date */
.money-bar-fees.money-bar-so-far { fill: var(--rpp-grey-400); }
.money-fee-lines, .money-fee-changes { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.money-fee-lines li { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.money-fee-amount { flex: none; align-items: flex-end; text-align: right; }
.report-panel { justify-content: center; min-height: var(--report-panel-h); }
.report-invoices-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-4); }
.report-jobs th.num-col { text-align: right; }
.report-aged { margin: 0; font-size: var(--text-sm); line-height: var(--lh-sm); }
.report-aged > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-3); padding: var(--space-3) 0; border-bottom: var(--hairline) solid var(--color-border); }
.report-aged > div:first-child { padding-top: 0; }
.report-aged > div:last-child { padding-bottom: 0; border-bottom: 0; }
.report-aged dd { display: flex; align-items: baseline; gap: var(--space-3); margin: 0; font-weight: var(--weight-medium); color: var(--color-text); }
.report-aged dd .hint { font-weight: var(--weight-light); }
@media (max-width: 960px) { .report-figures { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .page-actions .revenue-menu .menu-panel { left: 0; right: auto; }
  .report-tabs { overflow-x: auto; }
  .report-xero .btn { flex-basis: 100%; }
  .report-month:nth-last-of-type(even) { display: none; }  /* twelve months' names don't fit side by side; the period's last stays */
}

/* ---------- Editing team's Services ---------- */
.services-rates { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); font-size: var(--text-sm); line-height: var(--lh-sm); }
.services-rates > .icon { color: var(--color-text-subtle); flex: none; }
.services-group { font-size: var(--text-xs); line-height: var(--lh-eyebrow); font-weight: var(--weight-medium); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-subtle); }
.service-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--service-card-min), 1fr)); gap: var(--space-4); }
.service-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.service-card-picture { display: grid; aspect-ratio: 16 / 9; background: var(--color-surface-alt); }
.service-card-picture img { display: block; width: 100%; height: 100%; object-fit: cover; }
.service-card-photo { position: relative; margin: 0; overflow: hidden; background: var(--color-surface-alt); }
.service-card-photo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-image); transition: opacity var(--duration-fast) var(--easing-standard); }
.service-card-photo a:hover img { opacity: .88; }
.service-card-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); color: var(--color-text-subtle); font-size: var(--text-xs); line-height: var(--lh-xs); }
.service-card-body { flex: 1; display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }
.service-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.service-card-name { min-width: 0; font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); overflow-wrap: anywhere; }
.service-card-rate { font-size: var(--text-h4); line-height: var(--lh-h4); font-weight: var(--weight-light); letter-spacing: var(--tracking-heading); color: var(--color-text); }
.service-card-facts { display: flex; flex-direction: column; margin: 0; font-size: var(--text-sm); line-height: var(--lh-sm); }
.service-card-facts > div { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: var(--hairline) solid var(--color-border); }
.service-card-facts dd { margin: 0; color: var(--color-text); }
.service-card-note { padding: var(--space-3); border-radius: var(--radius-card); background: var(--status-yellow-bg); font-size: var(--text-xs); line-height: var(--lh-xs); overflow-wrap: anywhere; }
.service-card-actions { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: auto; }
.service-row-actions { display: inline-flex; gap: var(--space-4); }
.services-not-offered { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); border: var(--hairline) dashed var(--color-border-strong); background: transparent; box-shadow: none; }
.check-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.check-chip { display: inline-flex; align-items: center; gap: var(--space-1); max-width: 100%; height: var(--control-h-chip); padding: 0 var(--space-2) 0 var(--inset-control); border: var(--hairline) solid var(--color-border-strong); border-radius: var(--radius-pill); background: var(--color-surface); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text-body); white-space: nowrap; }
.check-chip > .icon { flex: none; color: var(--color-primary); }
.check-chips:not(:has(.check-chip-remove)) .check-chip { padding-right: var(--inset-control); }
.check-chip-remove { display: inline-flex; padding: var(--space-1); border: 0; border-radius: var(--radius-pill); background: none; color: var(--color-text-subtle); cursor: pointer; }
.check-chip-remove:hover { color: var(--color-text); }
.check-chip-remove:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.check-adder { display: flex; align-items: center; gap: var(--space-2); }
.rate-field { display: flex; align-items: center; gap: var(--space-3); }
.rate-field .money-field { width: var(--unit-input-w); }
.sample-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.sample-grid .service-card-photo { aspect-ratio: 4 / 3; }
.sample-add { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-4); text-align: center; overflow-wrap: anywhere; border: var(--hairline) dashed var(--color-border-strong); border-radius: var(--radius-card); background: var(--color-surface); font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--weight-medium); color: var(--color-text); cursor: pointer; }
.sample-add:hover { background: var(--color-surface-alt); }
.sample-add:has(:focus-visible) { box-shadow: var(--focus-ring); }
.services-decides { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4); border-radius: var(--radius-card); background: var(--color-surface-alt); font-size: var(--text-sm); line-height: var(--lh-sm); }
.service-kinds { margin: 0; padding: 0; border: 0; min-width: 0; }
.service-kinds > legend { float: left; margin-bottom: var(--space-2); }  /* a floated legend joins the field's column, as a label does */
.service-kinds > legend + * { clear: both; }
.choice-chip:has(:disabled) { cursor: default; opacity: .5; }

/* ---------- Head office's Announcements, and their card on a studio's dashboard ---------- */
.announcements-detail { grid-template-columns: minmax(0, 1fr) var(--announcement-composer-w); }
@media (max-width: 960px) { .announcements-detail { grid-template-columns: minmax(0, 1fr); } }
.announcement-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.announcement-row { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); color: var(--color-text); }
.announcement-row:hover { border-color: var(--color-border-strong); }
.announcement-row.is-current { border-color: var(--color-primary); }
.announcement-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.announcement-row-body { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-text-muted); white-space: pre-line; overflow-wrap: anywhere; }
.announcement-message { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--color-text-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.announcement-preview { padding: var(--space-3); border-radius: var(--radius-card); background: var(--color-bg); }
.announcement-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); box-shadow: var(--shadow-sm); }
.announcement-card-head { display: flex; align-items: center; gap: var(--space-3); }
.announcement-card-foot { display: flex; justify-content: flex-end; }
.announcement-cards { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-6); }
.announcement-reads { display: flex; align-items: center; gap: var(--space-2); }
.avatar-stack { display: flex; }
.avatar-stack > .avatar { box-shadow: 0 0 0 calc(2 * var(--hairline)) var(--color-surface); }
.avatar-stack > .avatar + .avatar { margin-left: calc(-1 * var(--space-1)); }
.announcement-card-icon { display: inline-flex; align-items: center; justify-content: center; width: var(--avatar-32); height: var(--avatar-32); border-radius: var(--radius-card); background: var(--color-primary-tint); color: var(--color-primary-hover); flex: none; }

/* ---------- Editor API guide: the Markdown in docs/, as api_doc renders it ---------- */
.doc { max-width: var(--title-max); }
.doc > * + * { margin-top: var(--space-4); }
.doc h2 { margin-top: var(--space-8); font-size: var(--text-lg); line-height: var(--lh-lg); font-weight: var(--weight-light); letter-spacing: var(--tracking-heading); }
.doc h3 { margin-top: var(--space-6); font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--weight-medium); }
.doc > :first-child { margin-top: 0; }
.doc h2 + *, .doc h3 + * { margin-top: var(--space-2); }
.doc ul, .doc ol { padding-left: var(--space-5); }
.doc li + li { margin-top: var(--space-1); }
.doc code { font-family: var(--font-mono); font-size: var(--text-sm); background: var(--color-surface-alt); border-radius: var(--radius-xs); padding: 0 var(--space-1); overflow-wrap: anywhere; }
.doc pre { overflow-x: auto; padding: var(--space-4); background: var(--color-surface-alt); border: var(--hairline) solid var(--color-border); border-radius: var(--radius-card); font-size: var(--text-sm); line-height: var(--lh-sm); }
.doc pre code { padding: 0; background: none; overflow-wrap: normal; }
.doc .table-box { margin-bottom: 0; }
.doc .table td { vertical-align: top; }  /* a cell runs to several lines beside one-line cells */

/* ---------- Print (print_controller.js) ---------- */
@media print {
  .rail, .rail-scrim, .topbar, .page > .callout[data-turbo-temporary], .page-actions, noscript { display: none; }
  html { background: var(--color-surface); }
  .page { padding: 0; }
  .card, .stat, .select-field { box-shadow: none; }
  .card, .stat { break-inside: avoid; }
  .stats, .stats:has(.stat:nth-child(4)) { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .select-field .select { padding-right: 0; background-image: none; }
}
