/* Any author `display` rule outranks the browser's own [hidden], which
   would leave a hidden element on screen as a dead button. */
[hidden] {
  display: none !important;
}

/* The agency's brand style sheet: --primary is its wordmark blue, one
   fixed button fill in both themes; --lime the one accent, a background
   and never text; --geico-green only for status colours. --primary-text,
   --surface and --muted-text lighten on a dark background. */
:root {
  /* "only": a browser's forced dark never darkens it; dark is the toggle's, below. */
  color-scheme: only light;
  --primary: #1B4696;
  --primary-text: var(--primary);
  --subtle-blue-text: #526D96;
  /* Text and marks drawn over --primary, which is one fixed blue in both themes. */
  --on-primary: #fff;
  /* Amber, fixed in both themes: something is keeping alerts from this desk.
     --on-amber is the words on it and on every other bright fixed fill. */
  --amber: #ffb300;
  --on-amber: #10240f;
  /* A banner that something is wrong or waiting, fixed in both themes. */
  --alert-red: #b00020;
  --alert-red-edge: #7a0016;
  --on-alert-red: #fff;
  --alert-yellow: #ffd54f;
  /* Greyed: an office or a button not open yet, fixed in both themes. */
  --unavailable: #888;
  --on-unavailable: #ddd;
  --deep-navy: #14306B;
  --lime: #A8CE3A;
  --background: #FBFDFC;
  --secondary-background: #E4ECF7;
  --surface: #fff;
  --text: #3C4650;
  --muted-text: #4a4a4a;
  --hairline: #E3E9E6;
  --input-border: #C7D5E8;
  --button-hover: #E8F4EF;
  --pressed: #143675;
  --sign-out-red: #B0301F;
  /* A Remove, an error, a field left wrong. */
  --danger: #B3261E;
  /* A box's hint before anything is typed, lighter than what is typed. */
  --placeholder-text: #6E7A86;
  /* A chart's readout over the page, dark on light and light on dark. */
  --tip-background: #2b2b2b;
  --tip-text: #fff;
  /* A table's line between rows, grey enough for either background. */
  --row-rule: rgba(128, 128, 128, 0.35);
  --geico-green: #4B8F39;
  /* A figure a little under its mark and under it, as a bar, a dot or its
     words; --geico-green is at it, --neutral-dot not read yet. */
  --warn-fill: #B7791F;
  --bad-fill: #B00020;
  --neutral-dot: #9aa0a6;
  /* The colours website_campaigns.ini's [Colors] names for a site's bars. */
  --chart-blue: var(--primary-text);
  --chart-green: var(--geico-green);
  /* A Dashboard grid's second and third group of columns, its first being --chart-blue: a teal and an
     orchid, hues no site's bars ([Colors]) and no status (green, amber, red) take. */
  --grid-second: #02787E;
  --grid-third: #C262BB;
  --status-neutral-bg: #eef1f6;
  --status-good-bg: #e3f1de;
  --status-good-text: #2f6a24;
  --status-warn-bg: #fbefd6;
  --status-warn-text: #8a5a10;
  --status-bad-bg: #f9e0e4;
  --status-bad-text: #8f001a;
  --status-orange-bg: #fde4d0;
  --status-orange-text: #9a4400;
  --status-yellow-bg: #fbf3c2;
  --status-yellow-text: #6b5a00;
  /* A Compliance line NICHOLS has muted: calmer than amber. */
  --status-muted-dot: #D9B300;
  --status-info-bg: #e2ebfa;
  --status-info-text: #1B4696;
  --standards-below-bg: #17191d;
  --standards-below-text: #ff5a5f;
  --standards-below-ink: #e6eaf0;
  --standards-best-bg: #dccbf2;
  --standards-best-text: #3d2473;
  /* A light: a shared-out customer's (share_out/lights.py) and a job's dot, each at least 3:1 on every surface. */
  --light-completed: #2E7D32;
  --light-in-progress: #C25E00;
  --light-not-started: #C62828;
  /* Behind the office logo, whose wordmark is the brand's dark blue. */
  --logo-backing: transparent;
}

/* Dark is the toggle's choice alone (theme_toggle.js, data-theme on
   <html>): every page starts light, whatever the computer's own setting.
   color-scheme keeps form controls and scrollbars in the page's theme. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary-text: #86AEEA;
  --subtle-blue-text: #9BB6DF;
  --background: #12181F;
  --secondary-background: #1B2430;
  --surface: #1E2733;
  --text: #DCE3EA;
  --muted-text: #9AA7B5;
  --hairline: #2B3645;
  --input-border: #3A475A;
  --button-hover: #24303F;
  --pressed: #6E93D6;
  --sign-out-red: #E8837A;
  --danger: #E8837A;
  --placeholder-text: #7D8A99;
  --tip-background: #E4EAF2;
  --tip-text: #12181F;
  --geico-green: #7BC65E;
  --warn-fill: #D9A040;
  --bad-fill: #E5606F;
  --grid-second: #57E3DF;
  --grid-third: #C360BC;
  --status-neutral-bg: #232E3D;
  --status-good-bg: #24391F;
  --status-good-text: #9BDB89;
  --status-warn-bg: #3A2E12;
  --status-warn-text: #E8C27D;
  --status-bad-bg: #3A1A20;
  --status-bad-text: #E89AA6;
  --status-orange-bg: #3D2616;
  --status-orange-text: #F0A46A;
  --status-yellow-bg: #363112;
  --status-yellow-text: #E5D36B;
  --status-muted-dot: #E5CF4F;
  --status-info-bg: #1F2D47;
  --status-info-text: #9DBDF2;
  --standards-below-bg: #000;
  --standards-below-text: #ff7479;
  --standards-below-ink: #e6eaf0;
  --standards-best-bg: #4a3670;
  --standards-best-text: #e6d8fc;
  --light-completed: #7BC65E;
  --light-in-progress: #F59E42;
  --light-not-started: #F2727F;
  --logo-backing: #F4F7FB;
}

* {
  box-sizing: border-box;
}

/* A plain link reads the same visited or not; no weight, so any link
   with a colour of its own keeps it. */
:where(a:link, a:visited) {
  color: var(--primary-text);
}

/* The scrollbar's room kept on every page, scrolling or not: Windows
   draws one that takes width, so without this the centred logo and
   title move sideways between a long page and a short one. Not the
   lobby TV, which never scrolls and fills the screen. */
html {
  scrollbar-gutter: stable;
}

html:has(> body.display-body) {
  scrollbar-gutter: auto;
}

body {
  margin: 0;
  font-family: 'Karla', -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--background);
  color: var(--text);
}

/* ---- Controls ---- */
/* Every control in the page's font, and one no component draws in the
   theme's colours rather than the browser's own, at no specificity so a
   component's rule always wins. A tick, a radio and a slider take the
   theme's blue; a date's and a time's picker, and the scrollbars,
   follow color-scheme. */
:root {
  accent-color: var(--primary-text);
}

:where(button, input, select, textarea) {
  font-family: inherit;
}

:where(button) {
  color: var(--text);
  background-color: var(--surface);
}

:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"],
               [type="button"], [type="submit"], [type="reset"], [type="image"]), select, textarea) {
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: 4px;
}

:where(input[type="color"]) {
  inline-size: 3rem;
  block-size: 2.4rem;
  padding: 2px;
  background: var(--surface);
  border: 1px solid var(--input-border);
  border-radius: 4px;
  cursor: pointer;
}

/* The file box's own button, as .btn-secondary. */
:where(input[type="file"])::file-selector-button {
  margin-inline-end: 0.75rem;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--primary-text);
  border-radius: 4px;
  cursor: pointer;
}

:where(fieldset) {
  border: 1px solid var(--input-border);
  border-radius: 4px;
}

::placeholder {
  color: var(--placeholder-text);
  opacity: 1;
}

/* A box the browser filled in (a saved username) keeps the box's colours
   rather than Chrome's own blue, which no rule can recolour. */
input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 100vmax var(--surface) inset;
}

/* The keys' ring in the theme's blue; an option in an open list is marked
   by its row's colours instead (Dropdowns). */
:where(:focus-visible:not(option)) {
  outline: 2px solid var(--primary-text);
  outline-offset: 2px;
}

:where(input:focus-visible, select:focus-visible, textarea:focus-visible) {
  outline-offset: 0;
}

/* Held while it sends (sending.js) or not open yet: no pointer. */
button:disabled {
  cursor: default;
}

/* Transparent PNG on the off-white band -- no color plate behind it. */
.brand-header {
  background: var(--background);
  padding: 0.75rem 1.5rem;
  text-align: center;
}

.brand-header img {
  display: block;
  height: 140px;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  background: var(--logo-backing);
}

/* The one lime band per screen, per the style sheet. */
header {
  background: var(--lime);
  color: var(--deep-navy);
  padding: 1rem 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
}

/* Ends on --toggle-clear, so the last row scrolls clear of the corner buttons. */
main {
  padding: 1.5rem 1.5rem var(--toggle-clear);
  max-width: 900px;
  margin: 0 auto;
}

.card {
  background: var(--secondary-background);
  border-radius: 4px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

/* Headings and a box's lone lines read centred; a list of rows under
   them keeps its left edge, where the eye runs down it. */
.card > h2,
.card > h3,
details.card > summary,
.attendance-group > summary,
.dash-glossary > summary,
.dash-section-name,
.dash-person,
.dash-h4,
.dash-def,
.dash-note,
.dash-empty,
.dash-metric-empty,
.relay-job-status,
.relay-job-round,
.relay-empty,
.selfservice-goal-note,
.authenticator-card {
  text-align: center;
}

.checkin-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checkin-form label {
  display: block;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

/* A fixed height, not padding: a select, a date box and a text box
   otherwise each pick their own and show it side by side. */
.checkin-form input:not([type="checkbox"], [type="radio"], [type="hidden"]),
.checkin-form select,
.checkin-form textarea,
.selfservice-staff-box input:not([type="checkbox"], [type="radio"], [type="hidden"]),
.selfservice-staff-box select {
  display: block;
  width: 100%;
  height: 3.5rem;
  /* Chrome centers a date box's fields on line-height, not height. */
  line-height: 3.5rem;
  padding: 0 1rem;
  font-size: 1.25rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: 4px;
}

#submit-button {
  display: block;
  width: 100%;
}

.language-picker,
.department-picker,
.policy-type-picker,
.has-policy-picker,
.yes-no-picker {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Pills, not buttons that submit -- lime marks the chosen one, and
   lime never carries text (the brand style sheet's own rule). */
.language-btn,
.department-btn,
.policy-type-btn,
.has-policy-btn,
.yes-no-btn,
.where-btn {
  flex: 1;
  min-width: 120px;
  padding: 1rem;
  font-size: 1.1rem;
  background: var(--surface);
  color: var(--primary-text);
  border: 1px solid var(--input-border);
  border-radius: 999px;
}

.language-btn.selected,
.department-btn.selected,
.policy-type-btn.selected,
.has-policy-btn.selected,
.yes-no-btn.selected,
.where-btn.selected {
  background: var(--lime);
  color: var(--deep-navy);
  border-color: var(--lime);
}

.checkin-form button {
  margin-top: 1rem;
  padding: 1rem;
  font-size: 1.25rem;
}

button {
  font-size: 1rem;
  padding: 0.6rem 1.1rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:active {
  background: var(--pressed);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--primary-text);
}

/* An <a> that reads as a button: the shape rules above are on the
   button element, so a link styled .btn-* would otherwise sit flat. */
.link-button {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

#location-retry {
  margin-top: 0.75rem;
}

/* gea-nichols.com's office picker (packaging/build_home_page.py). */
.office-picker {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 28rem;
  margin: 1.5rem auto 0;
}

.office-button {
  display: block;
  padding: 1.25rem;
  border-radius: 8px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 1.5rem;
  font-weight: 600;
  text-decoration: none;
}

.office-button:active {
  background: var(--pressed);
}

/* Greyed as the sign-in's unfinished Sign In button is. */
.office-button.unavailable,
.office-button.unavailable:active {
  background: var(--unavailable);
  color: var(--on-unavailable);
  cursor: not-allowed;
}

.office-button small {
  display: block;
  font-size: 0.9rem;
  font-weight: 400;
}

/* /transfer's Notes: no label, the placeholder is the whole prompt. */
.notes-box {
  margin-top: 1.25rem;
}

.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-warn {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
  border: 1px solid var(--status-warn-text);
}

.btn-good {
  background: var(--status-good-bg);
  color: var(--status-good-text);
  border: 1px solid var(--status-good-text);
}

.now-serving {
  text-align: center;
  padding: 2rem;
}

.now-serving .label {
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  color: var(--primary-text);
  font-weight: 700;
}

.now-serving .ticket {
  font-size: 4rem;
  font-weight: 800;
  margin: 0.25rem 0;
}

.now-serving .name {
  font-size: 2rem;
}

.now-serving.empty .ticket {
  font-size: 2rem;
  color: var(--muted-text);
}

/* One of the viewer's own walk-ins on /queue; several stack, newest first. */
.my-visit .ticket {
  font-size: 2.5rem;
}

.my-visit + .my-visit {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}

/* Centred so "✓ Sale Recorded" sits level with the buttons beside it. */
.my-visit .now-serving-actions {
  flex-wrap: wrap;
  align-items: center;
}

.now-serving-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Record's kept sales: each line, why it waits for its rep, and its buttons, wrapping on a narrow screen. */
#held-sales .held-sale {
  flex-wrap: wrap;
  align-items: center;
}

#held-sales .held-why {
  color: var(--status-warn-text);
  font-size: 0.9rem;
}

/* A person's own switch (Queue's Walk Ins and Quiet Queue, the Staff
   Roster's Show Every Office): filled blue and saying On while it is on,
   so it reads without colour too; Queue's line under it is the one for
   its state. */
.up-front-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.up-front-switch {
  min-width: 4.5rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--primary-text);
}

.up-front-switch[aria-checked="true"] {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.up-front-switch[aria-checked="true"] .up-front-off,
.up-front-switch[aria-checked="false"] .up-front-on,
.up-front:has(.up-front-switch[aria-checked="true"]) .up-front-said-off,
.up-front:has(.up-front-switch[aria-checked="false"]) .up-front-said-on {
  display: none;
}

.roster-switch-row {
  flex-wrap: wrap;
  margin: 0.5rem 0 0.75rem;
}

.up-front-said {
  text-align: center;
  margin: 0.5rem 0 0;
}

.ticket-detail {
  font-size: 0.85rem;
  color: var(--muted-text);
}

.waiting-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.waiting-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--hairline);
}

.waiting-list li:last-child {
  border-bottom: none;
}

/* A walk-in left waiting past pages.ini's [Queue] minutes, so a supervisor
   sees whom to Assign: amber, then red; the wait itself is in words too. */
.waiting-list li[data-waited="amber"],
.waiting-list li[data-waited="red"] {
  padding-left: 0.6rem;
  padding-right: 0.6rem;
  border-left: 4px solid var(--status-warn-text);
  background: var(--status-warn-bg);
}

.waiting-list li[data-waited="red"] {
  border-left-color: var(--status-bad-text);
  background: var(--status-bad-bg);
}

.waiting-list li[data-waited="amber"] .waited {
  color: var(--status-warn-text);
  font-weight: 600;
}

.waiting-list li[data-waited="red"] .waited {
  color: var(--status-bad-text);
  font-weight: 700;
}

.ticket-number {
  font-variant-numeric: tabular-nums;
  color: var(--muted-text);
  width: 4ch;
}

.name {
  flex: 1;
}

/* Sits at the far right of the same bar as .ticket-number/.name. */
.department {
  color: var(--muted-text);
}

/* /display, the lobby TV read from across the room: one screen, never
   scrolled, every size following the screen's own (vmin), so a
   portrait TV and a landscape one both fill. */
.display-body {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: calc(1.6vmin + 0.4rem);
}

.display-body .brand-header {
  padding: 0.5em 1em;
}

.display-body .brand-header img {
  height: 9vmin;
}

.display-body header {
  font-size: 1.35em;
  padding: 0.6em 1em;
}

/* Wrapped onto two lines on a narrow screen, each line centred. */
.display-body .bilingual-header {
  justify-content: space-around;
  gap: 0.25em 2em;
}

.display-main {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1em;
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.display-main .card {
  margin: 0;
  padding: 1em;
}

.display-heading {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 1em;
  margin: 0 0 0.5em;
  font-size: 1.4em;
  letter-spacing: 0.05em;
  color: var(--primary-text);
}

/* Several desks can serve at once: one entry fills the row, more share it. */
.display-serving-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13em), 1fr));
  gap: 0.75em;
}

.display-serving-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5em 0.75em;
  background: var(--surface);
  border-left: 0.35em solid var(--primary-text);
  border-radius: 4px;
}

.display-serving-entry .ticket {
  font-size: 4em;
  font-weight: 800;
  line-height: 1.1;
  color: var(--primary-text);
  font-variant-numeric: tabular-nums;
}

.display-serving-list[data-count="1"] .ticket {
  font-size: 8em;
}

.display-serving-entry .name {
  flex: none;
  font-size: 2em;
  font-weight: 700;
}

.display-serving-list[data-count="1"] .name {
  font-size: 2.6em;
}

/* Quieter than the customer's own name -- it says who is coming. */
.display-serving-entry .called-by {
  font-size: 1.2em;
  color: var(--muted-text);
}

.display-empty {
  text-align: center;
  color: var(--muted-text);
  font-size: 1.5em;
  padding: 0.5em 0;
}

#serving-empty {
  font-size: 4em;
}

/* An empty section says so in its middle. */
.display-main .display-empty {
  margin: auto 0;
}

.display-serving {
  display: flex;
  flex-direction: column;
}

.display-waiting {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.display-waiting .waiting-list {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.display-body .waiting-list li {
  font-size: 1.9em;
  padding: 0.35em 0;
}

.display-body .waiting-list .ticket-number {
  width: 4ch;
  font-weight: 700;
  color: var(--primary-text);
}

.display-body .waiting-list .department {
  color: var(--muted-text);
}

.display-more {
  text-align: center;
  font-size: 1.4em;
  font-weight: 700;
  color: var(--muted-text);
  padding-top: 0.35em;
  border-top: 1px solid var(--hairline);
}

/* A landscape screen: the two sections side by side. */
@media (min-aspect-ratio: 1/1) {
  .display-main {
    flex-direction: row;
  }

  .display-serving {
    flex: 1.2 1 0;
    min-width: 0;
    overflow: hidden;
  }

  .display-waiting {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* Tabs under the page title, since the installed app has no address
   bar. Above the cards, so it's there for a back-office desk too. */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  background: var(--secondary-background);
}

/* A desk's own tabs on one side, what a manager opens on the other,
   so the two aren't read as one list. */
.page-nav-desk,
.page-nav-end {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-nav-link {
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-text);
  text-decoration: none;
}

/* A tab lights up in the title band's green as the pointer crosses it. */
a.page-nav-link:hover {
  background: var(--lime);
  color: var(--deep-navy);
}

.page-nav-link.current {
  background: var(--primary);
  color: var(--on-primary);
}

/* A link without a clear keyboard ring is indistinguishable from the
   selected tab when the portal is used without a mouse. */
.page-nav-link:focus-visible,
.sign-out button:focus-visible {
  outline: 3px solid var(--deep-navy);
  outline-offset: 3px;
}

/* A tab with more under it: the Dashboard's pages, Record, Tools, Self
   Service, and Sign Out's other offices. */
.page-nav-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.page-nav-more {
  background: none;
  border: 0;
  margin-left: -0.75rem;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.75rem;
  color: var(--primary-text);
  cursor: pointer;
}

/* A tab that only names its menu: a button, so it is reachable by
   keyboard without being a link to nowhere. */
.page-nav-choice {
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: inherit;
  cursor: pointer;
}

.page-nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.4rem;
  background: var(--secondary-background);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}

.page-nav-dropdown.flip {
  left: auto;
  right: 0;
}

.page-nav-menu:hover > .page-nav-dropdown,
.page-nav-menu:focus-within > .page-nav-dropdown,
.page-nav-menu.open > .page-nav-dropdown {
  display: flex;
}

/* A page in a menu with its own pages opens them in a second list beside
   it, its first page level with it. */
.page-nav-sub > .page-nav-dropdown {
  top: -0.4rem;
  left: 100%;
}

.page-nav-sub > .page-nav-dropdown.flip {
  left: auto;
  right: 100%;
}

/* On a page under the menu, its tab and arrow show where you are. */
.page-nav-menu:has(.page-nav-dropdown .current) {
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px var(--primary-text);
}

/* A heading over a group of pages in a menu, not a link itself. */
.page-nav-group {
  padding: 0.35rem 1rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted-text);
}

.page-nav-group + .page-nav-link {
  padding-left: 1.5rem;
}

.sign-out {
  text-align: center;
  padding: 0.35rem 0;
}

/* Same box as a tab, pushed to the far end so it doesn't read as one. */
.page-nav .sign-out,
.sign-out-menu {
  margin-left: auto;
  padding: 0;
}

/* Sign Out's arrow in its red, so the two read as one control. */
.sign-out-menu .page-nav-more {
  color: var(--sign-out-red);
}

@media (max-width: 560px) {
  /* Keep each group intact and let a compact screen scroll the tabs
     horizontally instead of wrapping the sign-out control into them. */
  .page-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-inline: 0.75rem;
  }

  .page-nav-desk,
  .page-nav-end {
    flex: 0 0 auto;
    flex-wrap: nowrap;
  }

  .page-nav-link,
  .page-nav .sign-out {
    flex: 0 0 auto;
  }

  /* A scrolling strip would clip a menu hanging under its tab, and a
     phone has no hover, so what is under one is a tab of its own here,
     never popped out by a tap's hover or focus. */
  .page-nav-menu,
  .page-nav-dropdown,
  .page-nav-menu:is(:hover, :focus-within, .open) > .page-nav-dropdown {
    display: contents;
  }

  .page-nav-more,
  .page-nav-choice,
  .page-nav-group {
    display: none;
  }

  .page-nav-menu:has(.page-nav-dropdown .current) {
    box-shadow: none;
  }

  .page-nav-group + .page-nav-link {
    padding-left: 1rem;
  }

  /* A second list's pages follow their page in the strip, marked as under it. */
  .page-nav-sub > .page-nav-dropdown > .page-nav-link::before {
    content: "\203A\00A0" / "";
    opacity: 0.6;
  }
}

.sign-out button {
  background: none;
  border: 0;
  padding: 0.35rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: inherit;
  color: var(--sign-out-red);
  cursor: pointer;
}

.login-form {
  max-width: 420px;
  margin: 0 auto;
}

.location-button {
  display: block;
  margin: 0.5rem auto 0;
}

#submit-button:disabled {
  cursor: not-allowed;
}

/* One box that reads as six slots -- separate boxes would lose the
   phone's one-tap code fill and paste. */
.checkin-form input.code-input {
  text-align: center;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.75rem;
  letter-spacing: 0.6em;
  padding-left: 1.6em;
}

.checkin-form input.code-input::placeholder {
  color: var(--input-border);
}

.login-error {
  color: var(--danger);
  font-weight: 600;
  text-align: center;
}

.login-note {
  color: var(--muted-text);
  text-align: center;
  margin: 1rem 0 0;
}

.login-note + .login-note {
  margin-top: 0.25rem;
}

/* Self Service > Mobile's Signed In On: a line a sign-in, this browser's marked. */
.signed-in-on-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
}

.signed-in-on-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--hairline);
}

.signed-in-on-browser {
  font-weight: 600;
}

.signed-in-on-this {
  font-size: 0.85rem;
  color: var(--muted-text);
}

/* Keep me signed in on this computer: the tick beside its words. */
.checkin-form label.login-keep {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  margin: 1.25rem 0 0;
  cursor: pointer;
}

.login-keep input[type="checkbox"] {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
}

.setup-key {
  display: block;
  margin: 0.75rem 0;
  text-align: center;
  font-size: 1.4rem;
  letter-spacing: 0.12em;
  user-select: all;
}

.setup-qr {
  display: flex;
  justify-content: center;
  margin: 0.75rem 0;
}

.setup-instructions {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
}

.setup-instructions h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.setup-instructions summary {
  cursor: pointer;
  padding: 0.5rem 0;
  font-weight: 600;
  color: var(--primary-text);
}

.setup-instructions details p {
  margin: 0.25rem 0 0.75rem;
  color: var(--muted-text);
}

/* Wider than the shared 900px: a ticket's detail line needs the room. */
.admin-body main {
  max-width: 1300px;
}

/* A form page (check-in, sign-in, a desk's own pages) reads as a centered
   form on a tablet or a phone, not a left-aligned document. */
.checkin-body main {
  text-align: center;
}

/* A lobby taking no walk-ins: the way to the front desk, a line per language. */
.checkin-closed p {
  font-size: 1.4rem;
  margin: 0.75rem 0;
}

/* Form controls don't reliably inherit text-align, so they're set
   directly -- this is also what centers their placeholders. Chrome and
   Edge center a select's chosen value on text-align-last instead. */
.checkin-body .checkin-form input,
.checkin-body .checkin-form select {
  text-align: center;
  text-align-last: center;
}

/* Two fields on one line, neither of which needs the full width.
   Wraps back to stacked on a narrow phone. */
.field-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.field-row .field {
  flex: 1;
  min-width: 10rem;
}

.checkin-body #submit-button {
  background: var(--primary);
}

.checkin-body #submit-button.incomplete {
  background: var(--unavailable);
  color: var(--on-unavailable);
}

input.invalid,
select.invalid {
  border-color: var(--danger) !important;
  border-width: 2px !important;
}

/* The box to fix is focused at once, so its ring is red too. */
input.invalid:focus,
select.invalid:focus {
  outline: 2px solid var(--danger);
}

.department-picker.invalid,
.policy-type-picker.invalid,
#policy-number-question.invalid,
#ended-policy-question.invalid {
  border: 2px solid var(--danger);
  border-radius: 4px;
  padding: 0.5rem;
}

.form-warning {
  margin-top: 0.75rem;
  color: var(--status-warn-text);
  font-size: 0.9rem;
}

/* A phone box has no label of its own, so it takes a question's space from the answer above it. */
#phone-number-field,
#service-phone-number-field {
  margin-top: 1.5rem;
}

/* Check In's way on in English, under the notice that nobody in speaks the customer's language. */
.language-warning button {
  display: block;
  margin-top: 0.75rem;
}

/* The customer's pick of a rep: two pills on the form, and the whole
   list in a sheet over the page, so a long floor never stretches the form. */
.rep-choice {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.checkin-form .rep-btn,
.assign-sheet .rep-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: 1.15rem;
  text-align: left;
  background: var(--surface);
  color: var(--primary-text);
  border: 1px solid var(--input-border);
  border-radius: 12px;
}

.checkin-form .rep-pill {
  flex: 1;
  min-width: 12rem;
  min-height: 4rem;
  justify-content: center;
  border-radius: 999px;
}

.rep-initial {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--secondary-background);
  color: var(--primary-text);
  font-weight: 700;
}

.rep-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-form .rep-btn.selected {
  background: var(--lime);
  color: var(--deep-navy);
  border-color: var(--lime);
}

.rep-btn.selected .rep-initial {
  background: var(--deep-navy);
  color: var(--lime);
}

.rep-sheet {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.5);
}

.rep-sheet[hidden] {
  display: none;
}

.rep-sheet-panel {
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  max-height: 100%;
  overflow: hidden;
  background: var(--secondary-background);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.rep-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 1rem 1.5rem;
  border-bottom: 1px solid var(--hairline);
  color: var(--primary-text);
  font-size: 1.35rem;
  font-weight: 700;
}

.checkin-form .rep-sheet-close,
.assign-sheet .rep-sheet-close {
  flex: none;
  width: 3rem;
  height: 3rem;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--input-border);
  font-size: 1.75rem;
  line-height: 1;
}

.rep-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.6rem;
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Queue's Assign: the same sheet as a <dialog>, so the page behind it is
   out of reach and Escape closes it. One rep or many sit centred, a
   column on a phone, each with Free or whom they're helping under the
   name and the rep the customer asked for marked. */
.assign-sheet {
  width: min(44rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: var(--secondary-background);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.assign-sheet[open] {
  display: flex;
  flex-direction: column;
}

.assign-sheet::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.assign-sheet-detail {
  margin: 0;
  padding: 0.75rem 1.5rem 0;
}

.assign-sheet .rep-picker {
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 14rem));
  justify-content: center;
}

.assign-sheet .rep-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.assign-sheet button:focus-visible {
  outline: 3px solid var(--primary-text);
  outline-offset: 2px;
}

.assign-sheet .rep-btn.asked-for {
  border-color: var(--primary-text);
  box-shadow: inset 0 0 0 1px var(--primary-text);
}

.assign-rep-words {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.assign-rep-words .rep-name {
  max-width: 100%;
  font-weight: 700;
}

.assign-rep-status {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted-text);
}

.assign-asked {
  margin-top: 0.25rem;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.75rem;
  font-weight: 700;
}

.assign-sheet-note {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
  color: var(--muted-text);
}

.assign-sheet-foot {
  display: flex;
  justify-content: flex-end;
  padding: 0 1.5rem 1.25rem;
}

.assign-sheet-foot button {
  margin: 0;
}

@media (max-width: 560px) {
  .assign-sheet .rep-picker {
    grid-template-columns: minmax(0, 1fr);
    padding: 1rem;
  }

  .assign-sheet-detail {
    padding: 0.75rem 1rem 0;
  }

  .assign-sheet-foot {
    padding: 0 1rem 1rem;
  }
}

.rep-hint,
.question-hint {
  margin-top: 0.75rem;
  color: var(--muted-text);
  font-size: 0.95rem;
}

/* A shared tablet on a stand: no grey flash or double-tap zoom on a
   tap, and clear of the home bar. */
.kiosk {
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}

.kiosk button {
  touch-action: manipulation;
}

@media (min-width: 700px) {
  .kiosk main {
    max-width: 760px;
    padding: 2rem;
  }

  .kiosk header {
    font-size: 1.6rem;
    padding: 1.25rem 2rem;
  }

  .kiosk .card {
    padding: 1.75rem 2rem;
    border-radius: 12px;
  }

  .kiosk .checkin-form label {
    font-size: 1.2rem;
  }

  .kiosk .language-btn,
  .kiosk .department-btn,
  .kiosk .policy-type-btn,
  .kiosk .has-policy-btn,
  .kiosk .yes-no-btn {
    min-height: 4rem;
    font-size: 1.3rem;
  }
}

/* The first question sits at the card's own padding, not a label's gap. */
.kiosk #policy-type-question > label,
.kiosk #policy-number-question > label {
  margin-top: 0;
}

.kiosk .brand-header img {
  height: 100px;
}

/* An iPad on its side: the logo gives up more height so the form
   starts on screen. */
@media (orientation: landscape) and (max-height: 900px) {
  .kiosk .brand-header img {
    height: 72px;
  }
}

#subject-other-field label {
  margin-top: 1.25rem;
}

#subject-other-field input {
  width: 100%;
}

.bilingual-header {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}


/* The training copy's strip, first on every page: in the page's flow, so
   it never covers anything, and in em, so the lobby TV's reads across the
   room. Orange, a hue no other banner across the page takes. */
.training-banner {
  padding: 0.5em 1em;
  background: var(--status-orange-bg);
  color: var(--status-orange-text);
  border-bottom: 3px solid currentColor;
  font-weight: 700;
  text-align: center;
}

/* A banner across the page: a notice, the call bar, a relay's state.
   Queue's lost connection means every alert there is off, so it mustn't
   look like furniture. */
.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  /* Every banner is as tall as one with a button, so the page doesn't jump. */
  min-height: 61px;
}

.alert-banner button,
#desk-alerts-callout button {
  padding: 0.4rem 0.9rem;
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid currentColor;
  border-radius: 4px;
  cursor: pointer;
}

/* Amber: something here needs fixing before the page works as it should. */
.alert-banner.alerts-off {
  color: var(--on-amber);
  background: var(--amber);
}

/* Green: what the last save did. */
.alert-banner.alerts-on {
  color: var(--on-amber);
  background: var(--lime);
}

/* Red: the page has lost the stream, so every alert on it is off. */
.alert-banner.connection-lost {
  color: var(--on-alert-red);
  background: var(--alert-red);
}

.alert-banner.waiting {
  color: var(--on-amber);
  background: var(--alert-yellow);
}

/* Confirms the call this desk just accepted, and carries the name and
   number the accepted row took with it when it left the list above. */
.alert-banner.call-waiting {
  color: var(--on-primary);
  background: var(--primary);
}

.call-banner-detail {
  font-weight: 400;
  opacity: 0.9;
}

.call-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* A phone has no room beside the words, so the bar's buttons go under them and wrap. */
@media (max-width: 560px) {
  .alert-banner.call-waiting {
    flex-direction: column;
    align-items: stretch;
  }

  .call-banner-actions {
    flex-wrap: wrap;
    flex-shrink: 1;
  }
}

/* Sits where the Record Sale button was, so the confirmation lands
   under the eye that just clicked it. */
.sale-recorded {
  white-space: nowrap;
}

/* Calls Waiting and Accepted Calls: left border in the same blue, so the
   card reads as belonging with the call banner above it rather than as
   another queue. */
.call-queue {
  border-left: 6px solid var(--primary-text);
}

/* Callers owed a ring back, red: the one list here that only goes down
   when somebody acts on it. */
.call-missed {
  border-left: 6px solid var(--danger);
}

.call-missed .card-heading {
  color: var(--danger);
}

.card-heading {
  margin-bottom: 0.75rem;
}

/* The call lists' rows are two lines or more, so they sit top-aligned. */
.call-queue .waiting-list li,
.call-missed .waiting-list li {
  align-items: flex-start;
}

/* A missed walk-in's buttons sit under the customer and wrap, since its
   outcomes are more than the end of a row holds on a phone or an iPad. */
.walk-ins-missed .waiting-list li {
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
}

.walk-ins-missed .call-actions {
  margin-top: 0.4rem;
}

.walk-ins-missed .call-note {
  margin-top: 0;
}

.missed-walk-in-name {
  font-weight: 600;
}

/* /transfer's own "who took the call" answer -- the one thing the
   asker is still on that page to read. */
.transfer-status {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-text);
  margin-bottom: 0.35rem;
}

/* A bordered part of a form or page under its legend; a saved /sales
   policy shuts to one summary line. */
.box {
  border: 1px solid var(--primary-text);
  border-radius: 4px;
  padding: 0 1rem 1rem;
  margin-top: 1.5rem;
}

/* An auto margin centres a legend and keeps it shrink-to-fit, so its
   notch in the border moves with it. */
.box legend {
  margin-inline: auto;
  font-weight: 600;
  color: var(--primary-text);
  padding: 0 0.5rem;
}

.box label {
  margin-top: 1rem;
}

.box.collapsed .box-fields {
  display: none;
}

.box-summary {
  padding: 1rem 0 0.25rem;
  font-size: 1.1rem;
}

/* Record's Agent for a sales agent, who records only their own sales:
   no arrow and full strength, so it reads as fixed rather than broken. */
.checkin-form select:disabled {
  appearance: none;
  opacity: 1;
  background: var(--secondary-background);
  cursor: default;
}

/* A box Record fills in and holds (the dealership a referral type always
   is, a picked-up referral's credit) reads as fixed, as the Agent does. */
#refer-form input[readonly] {
  background: var(--secondary-background);
  cursor: default;
}

/* Record's buttons under the Source of Account and a referral's type:
   Check In's rep-choice pills, sized for a form with six in a row and
   centred as Check In's are, each wrapped line too. */
#refer-form .record-choice,
#settings-form .record-choice {
  margin-top: 0.75rem;
  justify-content: center;
}

#refer-form .record-choice .rep-pill,
#settings-form .record-choice .rep-pill {
  flex: 0 0 auto;
  min-width: 8rem;
  min-height: 2.75rem;
  font-size: 1rem;
}

#refer-form .record-choice .rep-pill:disabled {
  cursor: default;
}

/* Record's word that a write-up is recorded, over the form already
   cleared for the next, and the link to edit the sale. */
#recorded-note {
  margin-bottom: 1rem;
}

#recorded-link {
  color: var(--primary-text);
  font-weight: 600;
}

/* The contact's email on file: shown read-only in place of the box, which
   is still sent, as `hidden` would stop. */
#dealer-email-field.on-file #dealer-email,
#dealer-email-field:not(.on-file) #dealer-email-on-file {
  display: none;
}

.checkin-form textarea {
  height: auto;
  line-height: 1.4;
  padding: 0.75rem 1rem;
  resize: vertical;
}

/* No background of its own: a dark-mode browser leaves inherited
   colors alone and fights a fixed light one. */
.price-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 1.1rem;
}

.price-table th,
.price-table td {
  padding: 0.5rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid var(--row-rule);
}

.price-table th:first-child {
  text-align: left;
  font-weight: 600;
}

.price-table thead th {
  font-weight: 400;
  opacity: 0.75;
}

.price-note {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  opacity: 0.8;
}

.price-table tr.bundle {
  font-weight: 700;
  font-size: 1.25rem;
}

/* /hr/schedule: a quarter's Saturdays and a year's PTO read as plain tables. */
.hr-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.hr-table th,
.hr-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--row-rule);
}

.hr-table thead th {
  font-weight: 400;
  opacity: 0.75;
}

/* The quarter reads as columns on a laptop: the day never wraps, the
   counts sit together, and a wide quarter scrolls sideways inside its card. */
.hr-table-wrap {
  overflow-x: auto;
}

.hr-table td.hr-day {
  white-space: nowrap;
}

.hr-table td.hr-count {
  white-space: nowrap;
  text-align: center;
}

.hr-table th.hr-count {
  text-align: center;
}

.hr-table td.hr-short {
  color: var(--status-bad-text);
  font-weight: 600;
}

.hr-quarter th,
.hr-quarter td {
  min-width: 7rem;
}

.hr-quarter tr.hr-cover td.hr-day {
  color: var(--status-warn-text);
  font-weight: 600;
}

.hr-table form {
  display: inline;
}

/* A table in a card too narrow for its columns -- a phone, or an iPad
   with the text made larger: a row each, its first cell the heading and
   every other a label beside its value, so none of it scrolls sideways.
   /dealer's figures, and Admin's lists. */
.road-table-card {
  container-type: inline-size;
}

/* A figure wraps in a tight column rather than pushing the table past its card. */
.road-table td.hr-count {
  white-space: normal;
}

@container (max-width: 36rem) {
  .road-table,
  .road-table tbody {
    display: block;
  }

  .road-table thead {
    display: none;
  }

  .road-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.15rem 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--row-rule);
  }

  .road-table :is(td, th) {
    padding: 0;
    border: 0;
    text-align: left;
  }

  .road-table tr > :first-child {
    grid-column: 1 / -1;
    font-weight: 700;
  }

  .road-table td[data-label] {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 0.5rem;
    text-align: right;
  }

  .road-table td[data-label]::before {
    content: attr(data-label);
    font-weight: 400;
    color: var(--muted-text);
    text-align: left;
  }

  /* A long label or value, or a pick, takes the row's whole width, a
     value too long for the label's line reading from the left under it. */
  .road-table td.wide {
    grid-column: 1 / -1;
    text-align: left;
  }
}

/* A list with more columns than its card can hold side by side (GEICO
   Rejections' and Premiums' lists) folds the same way wherever its card is
   narrower than those columns need, a laptop's included, so none of it
   runs past the card. */
@container (max-width: 76rem) {
  .road-table-wide,
  .road-table-wide tbody {
    display: block;
  }

  .road-table-wide thead {
    display: none;
  }

  .road-table-wide tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.15rem 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--row-rule);
  }

  .road-table-wide :is(td, th) {
    padding: 0;
    border: 0;
    text-align: left;
  }

  .road-table-wide tr > :first-child {
    grid-column: 1 / -1;
    font-weight: 700;
  }

  .road-table-wide td[data-label] {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 0.5rem;
    text-align: right;
  }

  .road-table-wide td[data-label]::before {
    content: attr(data-label);
    font-weight: 400;
    color: var(--muted-text);
    text-align: left;
  }

  .road-table-wide td.wide {
    grid-column: 1 / -1;
    text-align: left;
  }
}

/* All Saturdays: a row per day that opens to its people as one chip each. */
.hr-quarter td.hr-open-cell {
  min-width: 0;
  text-align: right;
}

.hr-open {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--primary-text);
  background: var(--surface);
  color: var(--primary-text);
  cursor: pointer;
}

.hr-open[aria-expanded="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.hr-quarter tr:has(+ tr.hr-people:not([hidden])) td {
  border-bottom: 0;
}

.hr-quarter tr.hr-people td {
  background: var(--secondary-background);
  padding: 0.75rem;
}

/* Admin's Retention: the customers a rep has finished, folded under who is left. */
.retention-completed {
  margin-top: 0.75rem;
}

.retention-completed > summary {
  cursor: pointer;
  font-weight: 600;
}

/* A step's tick and the word beside it, both read-only. */
.road-table td.retention-step input {
  margin: 0;
}

.road-table td.retention-step span {
  margin-left: 0.35rem;
}

/* Admin's Commissions: a rep's row opens to their sales the same way,
   in the table's own weight once it folds and its row heads go bold. */
.road-table tr.commissions-rep-sales > td {
  background: var(--secondary-background);
  padding: 0.75rem;
  font-weight: 400;
}

.road-table tr.commissions-total > * {
  font-weight: 700;
}

/* A rep's sales: the whole date on one line, the customer roomy, Active
   and Pays as narrow as their words, Verified room for its check and
   Check, the flags what is left. */
.commissions-sales {
  table-layout: fixed;
}

.commissions-sales th:nth-child(1) { width: 22%; }
.commissions-sales th:nth-child(2) { width: 17%; }
.commissions-sales th:nth-child(3) { width: 7rem; }
.commissions-sales th:nth-child(4) { width: 8rem; }
.commissions-sales th:nth-child(5) { width: 10rem; }
.commissions-sales th:nth-child(6) { width: 3.75rem; }

.commissions-sales .commissions-check {
  margin: 0.35rem 0 0;
  padding: 0.2rem 0.75rem;
  font-size: 0.85rem;
}

/* Check's form, a row of its own under the sale it checks. */
.commissions-check-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 1rem;
}

/* A grid, not a column of flex: a table's select grows along its flex. */
.commissions-check-form label {
  display: grid;
  gap: 0.2rem;
  font-weight: 600;
}

.commissions-check-form label[hidden] {
  display: none;
}

.commissions-check-form input[type="date"] {
  height: 3rem;
  padding: 0 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: 4px;
}

.commissions-check-form button {
  margin: 0;
}

.commissions-sales :is(th, td) {
  padding-inline: 0.5rem;
  overflow-wrap: anywhere;
}

.commissions-sales td.commissions-written {
  white-space: nowrap;
}

.commissions-sales .dash-pill {
  padding-inline: 0.5rem;
}

/* A MOAT sold with an auto: indented under it, its row joined to the auto's. */
.commissions-sales tr.commissions-has-linked,
.commissions-sales tr.commissions-has-linked > * {
  border-bottom: 0;
}

.commissions-sales tr.commissions-linked > :first-child {
  padding-left: 1.75rem;
  text-indent: -1.25rem;
}

.commissions-link-mark {
  display: inline-block;
  width: 1.25rem;
  text-indent: 0;
  color: var(--muted-text);
}

.hr-bands {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem 1.25rem;
}

.hr-band h4 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted-text);
}

.hr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hr-chips li {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
}

.hr-chip,
.hr-for {
  white-space: nowrap;
}

.hr-chip {
  border: 1px solid var(--input-border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.9rem;
}

.hr-chip-cover {
  border-color: currentColor;
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
  font-weight: 600;
}

/* A $ that can't be typed over, drawn in front of the box's text. */
.money {
  position: relative;
}

.money::before {
  content: "$";
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  color: var(--muted-text);
  pointer-events: none;
}

.money input {
  padding-left: 2rem;
}


/* Same treatment the check-in form's own pickers get when submitted
   with nothing chosen. */
.language-picker.invalid {
  border: 2px solid var(--danger);
  border-radius: 4px;
  padding: 0.5rem;
}


/* Who the U-code resolved to, always shown: what this desk is alerted
   about follows from it. */
.signed-in {
  text-align: center;
  padding: 0.4rem 1.25rem;
  font-size: 0.85rem;
  color: var(--muted-text);
  background: var(--secondary-background);
}


/* /jobs, /compliance and the relay's page: one centred column,
   The relay's waiting count in its own box. */
.relay-body main {
  max-width: 620px;
}

.relay-status {
  text-align: center;
}

/* Red while no relay is collecting, since nothing reaches Slack then;
   green once one is. */
.relay-banner {
  justify-content: center;
  gap: 0.6rem;
  margin: 0;
  color: var(--on-alert-red);
  background: var(--alert-red);
  /* Its "sending" state is the header's own lime, which would
     otherwise blend into the lime header with no visible edge. */
  border-top: 1px solid var(--deep-navy);
}

/* The Start button sits on a line of its own under the sentence: a
   full-width break before it, since a fit-content button would otherwise
   fit beside the text. */
.relay-banner {
  flex-wrap: wrap;
}
.relay-banner::after {
  content: "";
  flex-basis: 100%;
  order: 1;
}
#relay-start {
  order: 2;
  max-width: fit-content;
  margin: 0 auto;
}
/* The training copy's line, in the Start button's place. */
#relay-training {
  order: 2;
}

/* Amber while the relay is open but its Slack isn't signed in yet. */
.relay-banner.starting {
  color: var(--on-amber);
  background: var(--amber);
}

.relay-banner.sending {
  color: var(--on-amber);
  background: var(--lime);
}

.relay-banner::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentColor;
}

.relay-stat {
  display: block;
  width: fit-content;
  margin: 1.1rem auto 0;
  padding: 1.1rem 2.75rem;
  background: var(--surface);
  border: 2px solid var(--primary-text);
  border-radius: 4px;
}

.relay-count {
  display: block;
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--primary-text);
}

.relay-label {
  display: block;
  margin-top: 0.4rem;
  font-weight: 600;
}

.relay-sub {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted-text);
}

.relay-setup summary {
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  color: var(--primary-text);
}

.relay-steps {
  margin: 1rem 0 0;
  padding-left: 1.4rem;
  line-height: 1.6;
}

.relay-steps li + li {
  margin-top: 0.6rem;
}

.step-aside {
  display: block;
  font-size: 0.9rem;
  color: var(--muted-text);
}

/* Its own line under the step, not wedged into the sentence. */
.relay-steps .link-button {
  display: block;
  width: fit-content;
  margin: 0.6rem 0 0.35rem;
}

.relay-path {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--surface);
  word-break: break-all;
}

.relay-footnote {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--muted-text);
}

/* Settings, Self Service and HR: a note over a list, a row per person or
   request and its buttons. Wraps rather than squeezing, since a manager
   reads this on a phone. */
.access-note {
  color: var(--muted-text);
  margin: 0 0 1rem;
  text-align: center;
}

/* A box of those rows under its legend: a department on the roster, a
   person's stops or a dealership's people on Self Service. */
.access-box {
  padding-bottom: 0.25rem;
}

.access-list li {
  flex-wrap: wrap;
  /* As tall as a row with a button, so a list steps evenly down the
     page whether or not each person has one. */
  min-height: 3.5rem;
}

.access-state {
  color: var(--muted-text);
  font-size: 0.9rem;
}

.access-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.access-actions button {
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
}

.relay-section-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--primary-text);
}

.relay-messages,
.relay-notes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.relay-message,
.relay-note {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-top: 1px solid color-mix(in srgb, var(--primary-text) 12%, transparent);
}

.relay-message:first-child,
.relay-note:first-child {
  border-top: 0;
}

/* A relay computer on the relay's page: its name over its facts,
   which keep the list's left edge. */
.relay-lane {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.relay-lane .lead-fields {
  justify-content: flex-start;
}

.relay-when {
  flex-shrink: 0;
  width: 4.5rem;
  font-size: 0.85rem;
  opacity: 0.7;
}

.relay-message-body {
  flex: 1;
  min-width: 0;
}

.relay-where {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-text);
}

.relay-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relay-check {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--geico-green);
}

.relay-dropped {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--danger);
}

.relay-spinner {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  border: 3px solid color-mix(in srgb, var(--primary-text) 20%, transparent);
  border-top-color: var(--primary-text);
  border-radius: 50%;
  animation: relay-spin 0.8s linear infinite;
}

@keyframes relay-spin {
  to { transform: rotate(360deg); }
}

.relay-day-title {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.relay-day:first-child .relay-day-title {
  margin-top: 0;
}

.relay-empty {
  margin: 0;
  opacity: 0.7;
}

.relay-job-status {
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.relay-job-round {
  margin: -0.5rem 0 0.75rem;
  font-size: 0.85rem;
  opacity: 0.8;
}

.relay-job-round.over-half {
  color: var(--status-warn-text);
  opacity: 1;
}

.relay-caption {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  opacity: 0.7;
}

.relay-stop {
  margin: 0;
  text-align: center;
}

.relay-console summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary-text);
}

.relay-console pre {
  max-height: 20rem;
  overflow: auto;
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  white-space: pre-wrap;
}

/* Settings, Self Service and HR: each section opens on its own, as
   The relay's setup card does, since each is a long list. */
.selfservice-section > summary {
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-text);
}

/* The triangle is drawn in the browser's own colour unless told: the
   same blue as the tab text, which the heading beside it already is. */
.selfservice-section > summary::marker,
.selfservice-section > summary::-webkit-details-marker {
  color: var(--primary-text);
}

/* Fields on this page name themselves, so the form's gap does the spacing. */
.selfservice-section .checkin-form {
  gap: 1rem;
}

.selfservice-section .box {
  padding-bottom: 1.5rem;
}

/* Room under the box's own heading before the first field. */
.selfservice-section .box > .checkin-form {
  margin-top: 1rem;
}

.selfservice-section .box + .box {
  margin-top: 2rem;
}

#notice {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.notice-dismiss {
  background: none;
  border: 0;
  color: inherit;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0 0.25rem;
  cursor: pointer;
}

/* Where somebody is headed, on their roster row: a pill filled green so
   it reads as a highlight beside the grey state. */
.move-tag {
  font-size: 0.8rem;
  background: var(--geico-green);
  color: var(--surface);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  margin-left: 0.5rem;
}

/* Home or Away after the name of somebody at more than one office on the
   Staff Roster (shared/_office_tag.html): the status pills' green at their
   home office, blue at the other. Away names their home office on hover,
   and in a bubble once tapped or tabbed to, since a touch screen has no
   hover. Somebody from another office alone is outlined in its name. */
.office-tag {
  position: relative;
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}
.office-tag.home { background: var(--status-good-bg); color: var(--status-good-text); }
.office-tag.away { background: var(--status-info-bg); color: var(--status-info-text); cursor: help; }
.office-tag.elsewhere { border: 1px solid var(--status-info-text); color: var(--status-info-text); }
.office-tag.away:focus::after {
  content: attr(title);
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 10;
  padding: 0.15rem 0.5rem;
  border-radius: 0.35rem;
  background: var(--status-info-text);
  color: var(--status-info-bg);
  font-weight: 500;
}

/* A PTO day's status on /hr/schedule. */
.pto-status {
  font-size: 0.8rem;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.pto-status-requested {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
}

.pto-status-approved {
  background: var(--status-good-bg);
  color: var(--status-good-text);
}

.pto-status-accepted {
  background: var(--status-info-bg);
  color: var(--status-info-text);
}

/* A Saturday taken in a swap reads as that, not as the rotation that first set it. */
.pto-status-swapped {
  background: var(--status-info-bg);
  color: var(--status-info-text);
}

.pto-status-declined {
  background: var(--status-bad-bg);
  color: var(--status-bad-text);
}

.pto-status-withdrawn {
  background: var(--status-neutral-bg);
  color: var(--muted-text);
}

/* Self Service's form boxes read centred; a form control doesn't
   inherit text-align, so it is set directly. */
.selfservice-staff-box,
.selfservice-staff-box input,
.selfservice-staff-box select {
  text-align: center;
}

/* What a closed select shows is centred by this, not text-align. */
.selfservice-staff-box select {
  text-align-last: center;
}

.selfservice-tick {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.selfservice-tick input[type="checkbox"] {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
}

.selfservice-tick-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.selfservice-tick-row input[type="checkbox"] {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
}

/* Dimmed rather than recoloured, so it reads as off under a browser's
   dark rendering too -- a fixed light grey there is the one white box. */
.selfservice-tick-row input[type="text"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.selfservice-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Edit fills the form above the roster, so it lights up as it scrolls
   into view rather than looking like it did nothing. */
.selfservice-staff-box.just-opened {
  animation: selfservice-lit 1.6s ease-out;
}

/* The roster row a save was about, after the reload it causes: lit up
   briefly, with what the save did on a line of its own under it. */
.access-list li.just-saved {
  animation: selfservice-lit 2.4s ease-out;
}

.access-list .row-saved {
  flex-basis: 100%;
  color: var(--status-good-text);
  font-weight: 500;
}

@keyframes selfservice-lit {
  from { box-shadow: 0 0 0 4px var(--geico-green); }
  to { box-shadow: 0 0 0 0 transparent; }
}

/* Self Service › Dealerships: the roster's rows, a box per territory. A
   row's address, and the contacts a search matched, are lines of their
   own; its contacts and either form open under it, full width. A long
   name or email breaks rather than widening the page, and a box nested
   in a box gives up a fieldset's own minimum width for the same reason. */
.dealership-group,
.dealership-form {
  min-width: 0;
}

.dealership-row > .name,
.dealership-contact > .name,
.dealership-row .access-state,
.dealership-line {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* A name claims a line of its own before the facts beside it squeeze it,
   which a roster row's name, with less beside it, never needs. */
.dealership-row > .name,
.dealership-contact > .name {
  flex: 1 1 12rem;
}

.dealership-line {
  flex-basis: 100%;
  color: var(--muted-text);
  font-size: 0.9rem;
}

/* The facts are what a row is read for, so they keep the theme's own muted colour. */
.dealership-row .access-state,
.dealership-contact .access-state {
  color: var(--muted-text);
}

.dealership-hit {
  color: var(--primary-text);
}

.dealership-contacts,
.dealership-row > .dealership-form,
.dealership-contact > .dealership-form {
  flex-basis: 100%;
  min-width: 0;
}

/* Indented under its dealership by a rule, so a contact never reads as a dealership. */
.dealership-contacts {
  padding-left: 0.75rem;
  border-left: 3px solid var(--input-border);
}

.dealership-contacts .selfservice-buttons {
  margin-top: 0.75rem;
}

/* Three buttons under a dealership's form don't fit a phone's line. */
.dealership-form .selfservice-buttons {
  flex-wrap: wrap;
}

.waiting-list .dealership-row,
.waiting-list .dealership-contact {
  row-gap: 0.35rem;
}

/* A request from a visit: who and where, any likely match under it,
   then the answers, wrapping on a phone. */
.signoff-list li {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.signoff-list .selfservice-buttons {
  flex-wrap: wrap;
}

.signoff-list .call-about {
  display: block;
}

.signoff-match {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.9rem;
}

.dealership-row.taken-off > .name {
  color: var(--muted-text);
}

/* Quiet: what was taken off sits closed under the list. */
.dealership-taken-off {
  margin-top: 1.5rem;
}

/* Move Dealerships' ticks, under each territory, scrolled in the box
   so the territory pick stays in reach on a phone. */
.move-list {
  display: grid;
  gap: 0.4rem;
  max-height: 22rem;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}

.move-group {
  margin-top: 0.5rem;
  color: var(--muted-text);
  font-size: 0.9rem;
  text-align: left;
}

/* The form centres its labels; a tick sits beside its name instead. */
.move-list .selfservice-tick-row {
  justify-content: flex-start;
  margin: 0;
  text-align: left;
  font-weight: 400;
}

.dealership-taken-off > summary {
  cursor: pointer;
  color: var(--muted-text);
  font-size: 0.9rem;
  text-align: center;
}

/* What was just saved lights up where it now sits in the list. */
.dealership-row.just-saved,
.dealership-contact.just-saved {
  animation: selfservice-lit 1.6s ease-out;
}


/* ---- Dashboard ---- */

/* Wide enough for four boxes a row with a dollar figure in each. */
.dashboard-body main {
  max-width: 1040px;
}

/* The Dashboard's own pages widen on a wide screen, so a year of days has room. */
@media (min-width: 1400px) {
  .dash-wide main {
    max-width: 1600px;
  }
}

/* The Dashboard's own tabs: underlined, so they don't read as the pill
   chips for the range under them. */
.dash-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  margin: -0.5rem 0 1rem;
  border-bottom: 1px solid var(--input-border);
}

.dash-tab {
  padding: 0.55rem 0.2rem;
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-text);
  text-decoration: none;
}

a.dash-tab:hover {
  border-bottom-color: var(--input-border);
}

.dash-tab.current {
  border-bottom-color: var(--primary-text);
  color: var(--text);
}

/* A GEICO Rejections decision: its question, pick and what it comes to, a line each under the cell's label. */
.group-reject-decision {
  flex: 1 1 100%;
  text-align: left;
}

/* Admin's queue tabs with nothing pending, quiet at the row's end. */
.admin-all-clear {
  align-self: center;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: var(--muted-text);
}

.admin-all-clear a:not([hidden]) ~ a:not([hidden])::before {
  content: ", ";
  display: inline-block;
  white-space: pre;
  color: var(--muted-text);
}

/* A section's source strip: the tab strip's shape a size down, under the
   section's own boxes and over the sections it switches. */
.dash-sources {
  margin: 0.25rem 0 0.6rem;
  gap: 0.25rem 1.25rem;
}

.dash-sources .dash-tab {
  padding: 0.4rem 0.2rem;
  font-size: 0.95rem;
}

.dash-ranges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.dash-range {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--primary-text);
  color: var(--primary-text);
  background: var(--surface);
  text-decoration: none;
  font-size: 0.88rem;
  cursor: pointer;
  list-style: none;
}

.dash-range.current {
  background: var(--primary);
  color: var(--on-primary);
}

/* A team's My Team / Office switch: the chips joined into one control, so
   it reads as a pick of two rather than two more ranges. */
.dash-views {
  gap: 0;
}

.dash-views .dash-range {
  border-radius: 0;
  min-width: 6.5rem;
  text-align: center;
}

.dash-views .dash-range + .dash-range {
  border-left-width: 0;
}

.dash-views .dash-range:first-child {
  border-radius: 999px 0 0 999px;
}

.dash-views .dash-range:last-child {
  border-radius: 0 999px 999px 0;
}

.dash-custom summary::-webkit-details-marker {
  display: none;
}

.dash-custom {
  position: relative;
}

/* Floated rather than laid out, so opening it doesn't widen the chip
   and shove "Choose Dates" off centre. */
.dash-custom-form {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--input-border);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-text) 14%, transparent);
}

.dash-custom-form input {
  height: 2.4rem;
  padding: 0 0.6rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
}

.dash-as-of,
.dash-note {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted-text);
}

/* A note under a table stands clear of its last row's rule. */
.hr-table + .dash-note {
  margin-top: 0.5rem;
}

.dash-as-of {
  text-align: center;
}

/* The range and when the numbers landed are two facts, so they read as
   two lines rather than one run-on. */
.dash-range-name,
.dash-updated {
  display: block;
}

.dash-range-name {
  font-weight: 600;
  color: var(--text);
}

/* A note about the page rather than another card of numbers, so it
   carries no card of its own. */
.dash-glossary {
  margin-bottom: 1rem;
}

.dash-source {
  margin-top: -0.4rem;
}

.dash-person {
  margin: 0 0 0.6rem;
  font-size: 1.3rem;
}

.dash-person small {
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--muted-text);
}

/* A row of boxes shares its width evenly, however long one box's figure
   is. The page splits a long row into even ones (seven are four and
   three), so a row never ends on a lone narrow box. */
.dash-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.dash-tiles[data-tiles="1"] { grid-template-columns: minmax(0, 1fr); }
.dash-tiles[data-tiles="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-tiles[data-tiles="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.dash-tiles + .dash-h4 {
  margin-top: 1.2rem;
}

/* The boxes an opened metric leads to: a size down, so its own box
   stays the one the page is about. */
.dash-alongside .dash-tile-value {
  font-size: 1.6rem;
}

.dash-alongside .dash-tile.self .dash-tile-value {
  font-size: 2.2rem;
}

@media (max-width: 560px) {
  .dash-tiles,
  .dash-tiles[data-tiles="3"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-tiles[data-tiles="3"] .dash-tile:last-child {
    grid-column: span 2;
  }

  /* Two to a row, so a premium in the millions still fits its box. */
  .dash-tiles .dash-tile-value,
  .dash-alongside .dash-tile.self .dash-tile-value {
    font-size: 1.7rem;
  }

  .dash-alongside .dash-tile-value {
    font-size: 1.4rem;
  }
}

/* A tab's sections, each a box of its own: the summary its header, a
   card's shade, holding the name and top line of boxes, with a chevron
   that turns as it opens. With no script, a shut header is one tap that
   opens it, so a box there takes a tap only once it is open; with
   metric_panels.js, a box there opens the section and its own chart at
   once. */
.dash-sections {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.dash-section {
  min-width: 0;
  background: var(--background);
  border: 1px solid var(--input-border);
  border-radius: 4px;
}

.dash-section > summary {
  position: relative;
  padding: 0.75rem 0.9rem 0.05rem;
  border-radius: 3px;
  background: var(--secondary-background);
  cursor: pointer;
  list-style: none;
}

.dash-section[open] > summary {
  border-bottom: 1px solid var(--input-border);
  border-radius: 3px 3px 0 0;
}

.dash-section > summary::-webkit-details-marker {
  display: none;
}

.dash-section > summary:focus-visible {
  outline: 3px solid var(--deep-navy);
  outline-offset: 2px;
}

/* Open or shut, in the header's corner: down while shut, up once open. */
.dash-section > summary::after {
  content: "\25BE";
  position: absolute;
  top: 0.65rem;
  right: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--input-border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary-text);
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.15s;
}

.dash-section[open] > summary::after {
  transform: rotate(180deg);
}

.dash-section > summary:hover::after {
  background: var(--button-hover);
}

/* Padded both sides alike, so the name stays centred clear of the chevron. */
.dash-section-name {
  display: block;
  margin-bottom: 0.7rem;
  padding: 0.15rem 2.3rem 0;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--primary-text);
}

.dash-section > summary:hover .dash-section-name {
  text-decoration: underline;
}

.dash-section:not([open]) > summary .dash-tile {
  pointer-events: none;
}

.dash-panels-on .dash-section:not([open]) > summary .dash-tile {
  pointer-events: auto;
}

/* The top line's boxes keep a four-across box's width, centred under
   the name, however few there are; on a phone, two to a row. */
.dash-section > summary .dash-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.dash-section > summary .dash-tile {
  flex: 0 1 calc((100% - 2.1rem) / 4);
  min-width: 0;
}

.dash-section-body {
  padding: 0.8rem 0.9rem 0.2rem;
}

/* A section's bars, side by side where there is room. A chart's panel
   takes the whole width under its row, the chart beside it staying put
   (dense). */
.dash-section-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  grid-auto-flow: row dense;
  gap: 0 2rem;
  margin-bottom: 1rem;
}

.dash-section-chart {
  min-width: 0;
}

.dash-section-bars > .dash-panel {
  grid-column: 1 / -1;
  margin-top: 0.6rem;
}

.dash-more {
  display: inline-block;
  margin: 0.2rem 0 0.6rem;
  font-size: 0.88rem;
  color: var(--primary-text);
}

/* A breakdown's bars or a grid's rows past its first (dashboard.PAGE_BARS):
   Expand More under them opens the rest in place, then reads Collapse,
   which puts them away again. */
.dash-more-bars > summary {
  cursor: pointer;
  list-style: none;
}

.dash-more-bars > summary::-webkit-details-marker {
  display: none;
}

.dash-more-bars:not([open]) .dash-more-open,
.dash-more-bars[open] .dash-more-shut {
  display: none;
}

/* The rest wait in their own list or table, hidden until the Expand More
   right after it is open, so a list's names keep one column; a grid's in
   every part's table, opening together so its rows still line up. */
.dash-bars:not(:has(+ .dash-rows-expand[open])) > .dash-rows-held,
.dash-grid-groups:not(:has(+ .dash-rows-expand[open])) .dash-rows-held {
  display: none;
}

/* A metric's page opened in place under the box, bar or column it was
   opened from (metric_panels.js): the page's own card, edged in the
   boxes' blue so it reads as the box's. */
.dash-panel {
  min-width: 0;
  margin: 0 0 0.9rem;
  padding: 0.7rem 1rem 0.8rem;
  background: var(--secondary-background);
  border: 2px solid var(--primary-text);
  border-radius: 4px;
}

.dash-panel + .dash-h4 {
  margin-top: 1.2rem;
}

.dash-panel-head {
  position: relative;
  min-height: 1.9rem;
  padding: 0.25rem 2.4rem 0;
}

.dash-panel-title {
  margin: 0;
  font-size: 1rem;
  text-align: center;
  color: var(--text);
}

.dash-panel-close {
  position: absolute;
  top: -0.15rem;
  right: -0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--input-border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary-text);
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
}

.dash-panel-close:hover {
  background: var(--button-hover);
}

.dash-panel-close:focus-visible {
  outline: 3px solid var(--deep-navy);
  outline-offset: 2px;
}

.dash-panel-note {
  margin: 0.6rem 0;
}

.dash-panel-foot {
  margin: 1rem 0 0;
  text-align: center;
}

.dash-panel-page {
  font-weight: 600;
  color: var(--primary-text);
}

/* The box whose chart is open: edged twice as heavy, a notch pointing
   down at its panel; a bar or column heading, bold and underlined. */
.dash-tile:has(> .dash-tile-open[aria-expanded="true"]) {
  box-shadow: inset 0 0 0 1px var(--primary-text);
}

.dash-tile:has(> .dash-tile-open[aria-expanded="true"])::before {
  content: "";
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  border: 0.45rem solid transparent;
  border-top-color: var(--primary-text);
  border-bottom-width: 0;
  transform: translateX(-50%);
}

a[data-panel][aria-expanded="true"]:not(.dash-tile-open) {
  font-weight: 700;
  text-decoration: underline 2px;
  text-underline-offset: 2px;
}

/* A section's grid: groups of columns, each under its heading and in its
   own bar colour, a row per hour or source, each bar sized against its
   own column. Its own width picks the layout (a container query, so a
   grid inside a section reads its own room): wide, every group sits in
   one line with the row names once at the left; narrower, each group
   takes a line with its own names; on a phone each part of three stacks
   with them. So nothing scrolls sideways and no group is ever without
   its names. */
.dash-grid {
  /* The group headings' row, and the column names' row under it: three
     lines of a name, or with a note under one (through yesterday) room
     for the note's two as well. */
  --grid-band: 1.5rem;
  --grid-plain: 3.6rem;
  --grid-noted: 5rem;
  --grid-heads: var(--grid-plain);
  container-type: inline-size;
  margin-bottom: 1rem;
}

.dash-grid:has(.dash-grid-heads small) {
  --grid-heads: var(--grid-noted);
}

.dash-grid-groups {
  --grid-names: 4.2rem;
  --grid-gutter: 1.25rem;
  display: flex;
  column-gap: var(--grid-gutter);
  row-gap: 1.4rem;
  font-size: 0.85rem;
}

/* The line's room after the names and gutters, shared by column count;
   the first group holds the names too. */
.dash-grid-group {
  --grid-tone: var(--chart-blue);
  display: flex;
  row-gap: 1.4rem;
  min-width: 0;
  flex: 0 1 calc((100% - var(--grid-names) - var(--grid-gutter) * var(--grid-gaps)) * var(--group-of) / var(--grid-of));
}

.dash-grid-group:first-child {
  flex-basis: calc(var(--grid-names) + (100% - var(--grid-names) - var(--grid-gutter) * var(--grid-gaps)) * var(--group-of) / var(--grid-of));
}

.dash-grid-group.tone-2 {
  --grid-tone: var(--grid-second);
}

.dash-grid-group.tone-3 {
  --grid-tone: var(--grid-third);
}

/* A group's parts share its room, the one holding the names a name's
   width more. */
.dash-grid-part {
  min-width: 0;
  flex: 0 1 calc(100% * var(--grid-share) / var(--group-of));
}

.dash-grid-group:first-child > .dash-grid-part {
  flex-basis: calc((100% - var(--grid-names)) * var(--grid-share) / var(--group-of));
}

.dash-grid-group:first-child > .dash-grid-part:first-child {
  flex-basis: calc(var(--grid-names) + (100% - var(--grid-names)) * var(--grid-share) / var(--group-of));
}

.dash-grid table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.dash-grid-group + .dash-grid-group .dash-grid-name,
.dash-grid-part + .dash-grid-part .dash-grid-name {
  display: none;
}

/* A group's heading over its columns, one line over a rule in its colour;
   a part after the first carries the rule alone, reaching back over the
   seam between the two tables, so the heading reads once. */
.dash-grid thead .dash-grid-band th {
  height: var(--grid-band);
  padding: 0 0.4rem 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: none;
}

/* The corner over the names: the heading row's own height, not a row's. */
.dash-grid .dash-grid-band td {
  height: var(--grid-band);
  padding: 0;
}

.dash-grid-band span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dash-grid-band th::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--grid-tone);
}

.dash-grid-part + .dash-grid-part .dash-grid-band th::after {
  left: -2px;
}

.dash-grid-part + .dash-grid-part .dash-grid-band span {
  visibility: hidden;
}

/* Scrolled past a grid's top, its headings stay over the rows still
   showing: the group headings at the top, the column names just under
   them, opaque so no row shows through. */
.dash-grid thead th,
.dash-grid thead td {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--background);
}

.dash-grid-band + .dash-grid-heads th {
  top: var(--grid-band);
}

/* As a grid's last rows leave, its names slide under its headings. */
.dash-grid .dash-grid-band > * {
  z-index: 2;
}

/* A column's name runs to three lines beside its i, its note wrapping
   under it, in a heading row of one height across the parts on a line,
   so the rows still line up across them. */
.dash-grid thead th {
  height: var(--grid-heads);
  padding: 0 0.4rem 0.3rem;
  vertical-align: bottom;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  border-bottom: 1px solid var(--hairline);
}

.dash-grid thead th a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-decoration: none;
}

.dash-grid thead th a:hover {
  text-decoration: underline;
}

.dash-grid thead th small {
  display: block;
  white-space: normal;
}

.dash-grid .dash-grid-name {
  width: var(--grid-names);
  padding-right: 0.6rem;
  text-align: right;
  font-weight: 400;
  white-space: nowrap;
  color: var(--muted-text);
  font-variant-numeric: tabular-nums;
}

.dash-grid tbody th,
.dash-grid td {
  height: 1.65rem;
  padding: 0 0.4rem;
}

/* Every other row shaded, so a row reads across the columns. */
.dash-grid tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--secondary-background) 55%, transparent);
}

/* A rule between columns, so a figure and its bar read as one column's. */
.dash-grid tbody td,
.dash-grid .dash-grid-heads th:not(.dash-grid-name) {
  border-left: 1px solid var(--hairline);
}

/* Each figure ahead of its own bar, in the width the column's widest sets
   (`--figure`, in characters, with room for a % or a $), so a column's
   figures line up and its bars start together. */
.dash-grid-cell {
  display: grid;
  grid-template-columns: calc((var(--figure, 3) + 0.6) * 1ch) minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem;
}

.dash-grid .dash-bar {
  height: 0.7rem;
}

.dash-grid .dash-bar-fill {
  background: var(--grid-tone, var(--chart-blue));
}

.dash-grid-value {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dash-grid td.nothing .dash-grid-value {
  color: var(--muted-text);
}

/* A figure its amber lines mark (By Area's cost per sale), a place to cut
   or move spend, or a person's share well under the office's (a table of
   shares): shaded and in amber, its bar too, so it reads without the
   pointer. */
.dash-grid td.warn {
  background: var(--status-warn-bg);
}

.dash-grid td.warn .dash-grid-value {
  color: var(--status-warn-text);
  font-weight: 600;
}

.dash-grid td.warn .dash-bar-fill {
  background: var(--status-warn-text);
}

/* A table of people's rate at or past its target, or past its floor. */
.dash-grid td.good {
  background: var(--status-good-bg);
}

.dash-grid td.good .dash-grid-value {
  color: var(--status-good-text);
  font-weight: 600;
}

.dash-grid td.good .dash-bar-fill {
  background: var(--status-good-text);
}

.dash-grid td.bad {
  background: var(--status-bad-bg);
}

.dash-grid td.bad .dash-grid-value {
  color: var(--status-bad-text);
  font-weight: 600;
}

.dash-grid td.bad .dash-bar-fill {
  background: var(--status-bad-text);
}

/* A table of people's rate past its amber band and still at its minimum standard. */
.dash-grid td.minimum {
  background: var(--status-orange-bg);
}

.dash-grid td.minimum .dash-grid-value {
  color: var(--status-orange-text);
  font-weight: 600;
}

.dash-grid td.minimum .dash-bar-fill {
  background: var(--status-orange-text);
}

/* A grid by source ends in the All row, the column's own figure: a weight, no bar. */
.dash-grid tr.total th,
.dash-grid tr.total td {
  font-weight: 600;
  border-top: 1px solid var(--hairline);
}

.dash-grid tbody th a {
  color: var(--primary-text);
  text-decoration: none;
}

.dash-grid tbody th a:hover {
  text-decoration: underline;
}

/* A grid by source, closed by its All row: the names are sources', left
   and given a name's room. */
.dash-grid:has(tr.total) .dash-grid-groups {
  --grid-names: 7.4rem;
}

.dash-grid:has(tr.total) th.dash-grid-name {
  text-align: left;
}

/* A grid by value (keywords): the names left and given a keyword's room,
   cut short on one line so the rows still line up across the parts, the
   pointer giving the whole. */
.dash-grid-named .dash-grid-groups {
  --grid-names: 12rem;
}

.dash-grid-named th.dash-grid-name {
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  color: var(--text);
}

/* A grid by value closed by its All row (By Area) keeps a value's room. */
.dash-grid-named:has(tr.total) .dash-grid-groups {
  --grid-names: 12rem;
}

.dash-grid-under {
  font-size: 0.72rem;
  color: var(--muted-text);
}

/* Rows that name what each value is within (a keyword's campaign, a
   search term's keyword) take two lines, every row alike, so the rows
   still line up across the parts. */
.dash-grid-paired tbody th,
.dash-grid-paired td {
  height: 2.6rem;
}

.dash-grid-paired th.dash-grid-name {
  line-height: 1.2;
}

.dash-grid-paired .dash-grid-under {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Too narrow for every group in one line: each group a line of its own,
   its names beside it. */
@container (max-width: 56rem) {
  .dash-grid-groups {
    flex-wrap: wrap;
  }

  .dash-grid-group,
  .dash-grid-group:first-child {
    flex-basis: 100%;
  }

  .dash-grid-group > .dash-grid-part {
    flex-basis: calc((100% - var(--grid-names)) * var(--grid-share) / var(--group-of));
  }

  .dash-grid-group > .dash-grid-part:first-child {
    flex-basis: calc(var(--grid-names) + (100% - var(--grid-names)) * var(--grid-share) / var(--group-of));
  }

  .dash-grid-group + .dash-grid-group .dash-grid-part:first-child .dash-grid-name {
    display: table-cell;
  }

  /* A group on a line of its own is as tall as its own names need. */
  .dash-grid-group {
    --grid-heads: var(--grid-plain);
  }

  .dash-grid-group:has(.dash-grid-heads small) {
    --grid-heads: var(--grid-noted);
  }
}

/* A phone: each part of a group under the last, its heading and names
   said again. */
@container (max-width: 42rem) {
  .dash-grid-groups {
    --grid-names: 3.3rem;
    font-size: 0.8rem;
  }

  .dash-grid-group {
    flex-wrap: wrap;
  }

  .dash-grid-group > .dash-grid-part,
  .dash-grid-group > .dash-grid-part:first-child,
  .dash-grid-group:first-child > .dash-grid-part,
  .dash-grid-group:first-child > .dash-grid-part:first-child {
    flex-basis: 100%;
  }

  .dash-grid-group + .dash-grid-group .dash-grid-name,
  .dash-grid-part + .dash-grid-part .dash-grid-name {
    display: table-cell;
  }

  .dash-grid-part + .dash-grid-part .dash-grid-band span {
    visibility: visible;
  }

  .dash-grid thead th {
    height: auto;
    padding: 0 0.15rem 0.3rem 0.45rem;
  }

  .dash-grid thead th a {
    display: block;
  }

  .dash-grid:has(tr.total) .dash-grid-groups {
    --grid-names: 4.9rem;
  }

  .dash-grid:has(tr.total) tbody th.dash-grid-name {
    white-space: normal;
    line-height: 1.15;
  }

  .dash-grid-named .dash-grid-groups {
    --grid-names: 8rem;
  }

  .dash-grid-named:has(tr.total) .dash-grid-groups {
    --grid-names: 8rem;
  }

  .dash-grid-named:has(tr.total) tbody th.dash-grid-name {
    white-space: nowrap;
    line-height: inherit;
  }

  .dash-grid tbody th,
  .dash-grid td {
    padding: 0 0.15rem 0 0.45rem;
  }

  .dash-grid-cell {
    gap: 0.35rem;
  }
}

/* A table of shares (people by a value, three columns each): too many for
   one line, so its values sit two to a line, each with the people's names
   on one line and a person's room, and one to a line where two don't fit.
   After the rules above, whose weight it matches or passes. */
.dash-grid.dash-grid-named.dash-grid-shares .dash-grid-groups {
  --grid-names: 10rem;
  flex-wrap: wrap;
}

.dash-grid.dash-grid-shares .dash-grid-group {
  flex: 0 1 calc((100% - var(--grid-gutter)) / 2);
}

.dash-grid.dash-grid-shares .dash-grid-group > .dash-grid-part {
  flex-basis: 100%;
}

.dash-grid.dash-grid-shares .dash-grid-group .dash-grid-name {
  display: table-cell;
}

.dash-grid.dash-grid-named.dash-grid-shares tbody th.dash-grid-name {
  white-space: nowrap;
}

@container (max-width: 56rem) {
  .dash-grid.dash-grid-shares .dash-grid-group {
    flex-basis: 100%;
  }
}

@container (max-width: 42rem) {
  .dash-grid.dash-grid-named.dash-grid-shares .dash-grid-groups {
    --grid-names: 8rem;
  }
}

/* A section inside another is a box inside its body, its name a size down. */
.dash-section-body .dash-sections {
  gap: 0.7rem;
  margin: 0.4rem 0 0.8rem;
}

.dash-section-body .dash-section-name {
  font-size: 0.95rem;
}

/* A phone keeps a 16px gutter and lends the boxes inside the rest. */
@media (max-width: 560px) {
  .dashboard-body main {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .dash-section > summary .dash-tile {
    flex-basis: calc((100% - 0.7rem) / 2);
  }

  /* The Office Log's Lead Sales keeps its three tiles to one row. */
  .lead-sales-view > summary .dash-tile {
    flex-basis: calc((100% - 1.4rem) / 3);
  }

  .dash-section > summary {
    padding: 0.65rem 0.5rem 0.05rem;
  }

  .dash-section > summary::after {
    right: 0.45rem;
  }

  .dash-section-body {
    padding: 0.7rem 0.5rem 0.1rem;
  }

  .dash-panel {
    padding: 0.6rem 0.6rem 0.7rem;
  }

  .dash-panel-close {
    right: -0.2rem;
  }
}

.dash-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.85rem 0.7rem 0.75rem;
  background: var(--surface);
  border: 2px solid var(--primary-text);
  border-radius: 4px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
}

/* Every box but the page's own opens further from anywhere on it, its
   link stretched over the whole box, and says so under the pointer. */
.dash-tile-open {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.dash-tile-open::after {
  content: "";
  position: absolute;
  inset: 0;
}

.dash-tile:has(> .dash-tile-open:hover) {
  box-shadow: 0 3px 12px color-mix(in srgb, var(--primary-text) 20%, transparent);
}

.dash-tile-open:focus-visible {
  outline: none;
}

.dash-tile:has(> .dash-tile-open:focus-visible) {
  outline: 3px solid var(--deep-navy);
  outline-offset: 2px;
}

/* A figure's i: its definition under the pointer, and in place under the
   figure on a tap. No bigger than the words beside it, its reach a size
   up so a thumb finds it. */
.dash-info {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: var(--primary-text);
  font-family: inherit;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
  cursor: pointer;
}

.dash-info::before {
  content: "";
  position: absolute;
  inset: -0.6em;
}

.dash-info[aria-expanded="true"] {
  background: var(--primary-text);
  color: var(--surface);
}

.dash-info:focus-visible {
  outline: 2px solid var(--deep-navy);
  outline-offset: 2px;
}

.dash-info-text {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: normal;
  text-transform: none;
  color: var(--muted-text);
}

.dash-info-text[hidden] {
  display: none;
}

/* A box's i sits in its corner and its words under the figure, both over
   the box's link. */
.dash-tile > .dash-info {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 1;
}

.dash-tile[data-definitions] .dash-tile-label {
  padding: 0 0.85rem;
}

.dash-tile > .dash-info-text {
  position: relative;
  z-index: 1;
}

.dash-section-chart > .dash-info-text {
  margin: -0.2rem 0 0.4rem;
}

.dash-bar-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.dash-bar-row > .dash-info-text {
  grid-column: 1 / -1;
  padding-bottom: 0.2rem;
}

.dash-grid-head {
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
}

.dash-grid-head > a {
  min-width: 0;
}

.dash-grid-part > .dash-info-text {
  margin-top: 0.4rem;
}

/* The page's own box: its shading all but vanishes in dark mode, so the
   border thickens too. */
.dash-tile.self {
  background: var(--secondary-background);
  box-shadow: inset 0 0 0 1px var(--primary-text);
}

.dash-tile-label {
  font-weight: 600;
  font-size: 0.85rem;
}

/* A figure its source only dates by month: the same number whichever
   range is picked. */
.dash-monthly {
  font-weight: 400;
  font-size: 0.7rem;
  opacity: 0.65;
  white-space: nowrap;
}

.dash-tile-value {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--primary-text);
  font-variant-numeric: tabular-nums;
}

.dash-tile-empty,
.dash-metric-empty,
.dash-empty {
  font-size: 0.85rem;
  color: var(--muted-text);
  font-style: italic;
}

.dash-tile-office,
.dash-metric-office,
.dash-tile-solid {
  font-size: 0.8rem;
  color: var(--muted-text);
}

/* Green, amber, red: at or about the mark, a little under, under. */
.dash-sig {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.3rem;
  vertical-align: middle;
  background: var(--neutral-dot);
}

.dash-sig.good, .dash-goal-fill.good, .dash-bar-fill.good { background: var(--geico-green); }
.dash-sig.warn, .dash-goal-fill.warn, .dash-bar-fill.warn { background: var(--warn-fill); }
.dash-sig.bad, .dash-goal-fill.bad, .dash-bar-fill.bad { background: var(--bad-fill); }
small.good { color: var(--geico-green); }
small.warn { color: var(--warn-fill); }
small.bad { color: var(--bad-fill); }

.dash-goal-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
}

.dash-goal {
  display: block;
  position: relative;
  width: 100%;
  height: 0.6rem;
  border-radius: 4px;
  background: var(--secondary-background);
  overflow: hidden;
}

.dash-goal-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 4px;
  background: var(--primary);
}

.dash-goal-text {
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dash-group h2,
.dash-card-head h2 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
}

/* The heading centred, whatever sits beside it. */
.dash-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.dash-card-head h2 {
  margin: 0;
}

.dash-metric {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 1rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--input-border);
  color: var(--text);
  text-decoration: none;
}

.dash-metric:first-of-type {
  border-top: 0;
}

.dash-metric-label {
  flex: 1 1 10rem;
  font-weight: 600;
}

.dash-metric-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-text);
  font-variant-numeric: tabular-nums;
}

.dash-metric-value small,
.dash-metric-office small,
.dash-bar-value small {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted-text);
}

.dash-def {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
}

.dash-h4 {
  margin: 1rem 0 0.4rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-text);
}

/* A slot per day of the range (--slots of them), so the gaps narrow
   with a long range rather than pushing the chart past the card. */
.dash-trend {
  display: flex;
  align-items: flex-end;
  gap: min(3px, calc(25% / var(--slots, 1)));
  height: 96px;
  padding-top: 4px;
  border-bottom: 1px solid var(--input-border);
}

.dash-trend-slot {
  flex: 1;
  display: flex;
  align-items: flex-end;
  align-self: stretch;
  position: relative;
  cursor: default;
}

.dash-trend-slot:hover .dash-trend-bar,
.dash-trend-slot:focus-visible .dash-trend-bar {
  filter: brightness(0.85);
}

/* A day past what a lagging figure reads through: shaded, not a zero. */
.dash-trend-slot.unread {
  background: repeating-linear-gradient(135deg, var(--input-border) 0 1px, transparent 1px 5px);
}

/* Shown the moment the column is under the pointer, so a day answers
   straight away rather than after the browser's own delay. */
.dash-trend-tip {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  white-space: nowrap;
  background: var(--tip-background);
  color: var(--tip-text);
  font-size: 0.75rem;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  z-index: 2;
  pointer-events: none;
}

.dash-trend-slot:hover .dash-trend-tip,
.dash-trend-slot:focus-visible .dash-trend-tip {
  display: block;
}

/* The first and last columns would otherwise hang off the card. */
.dash-trend-slot:first-child .dash-trend-tip { left: 0; transform: none; }
.dash-trend-slot:last-child .dash-trend-tip { left: auto; right: 0; transform: none; }

.dash-trend {
  overflow: visible;
}

.dash-trend-bar {
  width: 100%;
  display: block;
  min-height: 2px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

/* A source per colour: lines of the figure to each day, or a sum's
   parts stacked. The slots under the lines carry each day's readout;
   the lines themselves catch the pointer through a wide unseen twin. */
.dash-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem 1rem;
  margin: 0 0 0.4rem;
  padding: 0;
  font-size: 0.85rem;
}
.dash-legend b { font-weight: 600; }
.dash-swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: -1px;
}
.dash-swatch.own {
  height: 0;
  border-top: 2px dashed currentColor;
  vertical-align: 3px;
}
.dash-chart { position: relative; }
.dash-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.dash-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: none;
}
.dash-line.own {
  stroke: currentColor;
  stroke-width: 2;
  stroke-dasharray: 6 5;
  opacity: 0.7;
}
.dash-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  pointer-events: visibleStroke;
}
.dash-series:has(.dash-hit:hover) .dash-line { opacity: 0.25; }
.dash-series .dash-line:has(+ .dash-hit:hover) { opacity: 1; stroke-width: 4; }
.dash-line-label {
  display: none;
  position: absolute;
  right: 0;
  transform: translateY(-120%);
  font-size: 0.8rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border-radius: 3px;
  padding: 0 0.3rem;
  pointer-events: none;
}
.dash-overlay .dash-trend-slot:hover,
.dash-overlay .dash-trend-slot:focus-visible {
  box-shadow: inset 1px 0 0 currentColor;
}
.dash-trend-slot.stacked {
  flex-direction: column-reverse;
  justify-content: flex-start;
  gap: 1px;
}
.dash-trend-slot.stacked .dash-trend-bar {
  min-height: 0;
  border-radius: 0;
}
.dash-trend-tip.multi {
  white-space: normal;
  text-align: left;
  min-width: 10rem;
}
.dash-trend-tip.multi b,
.dash-trend-tip.multi span { display: block; }
.dash-trend-tip.multi span b { display: inline; }

.dash-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted-text);
  margin-top: 0.25rem;
  position: relative;
  container-type: inline-size;
}

/* A day chart's month (or Monday) marks: a faint line up the chart at the
   day's left edge, its name centred under the day. A name near the axis's
   own first or last shows only where the chart is wide enough for both. */
.dash-chart .dash-trend {
  position: relative;
}
.dash-gridline {
  position: absolute;
  top: 4px;
  bottom: 0;
  left: calc(100% * var(--at) / var(--slots));
  border-left: 1px dashed var(--input-border);
  pointer-events: none;
}
.dash-mark-name {
  position: absolute;
  left: calc(100% * (var(--at) + 0.5) / var(--slots));
  transform: translateX(-50%);
  white-space: nowrap;
}
@container (max-width: 36rem) {
  .dash-mark-name.crowded { display: none; }
}
.dash-axis.dash-months {
  display: grid;
  grid-template-columns: repeat(var(--slots), minmax(0, 1fr));
  text-align: center;
}
.dash-months small {
  display: block;
  font-size: 0.65rem;
}

/* Read by touch (chart_scrub.js): a sideways drag is the chart's, a
   vertical one still scrolls the page; the day under the finger, or the
   keyboard's, is lit and its readout pinned above the chart in place of
   the tips. */
.dash-chart[data-scrub] {
  touch-action: pan-y;
}
.dash-trend-slot.scrub-at {
  background: color-mix(in srgb, var(--primary-text) 14%, transparent);
  outline: 1px solid var(--primary-text);
}
.dash-trend-slot.scrub-at .dash-trend-bar {
  filter: brightness(0.85);
}
.dash-chart.pinned .dash-trend-tip {
  display: none !important;
}
.dash-readout {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 100%;
  margin: 0;
  background: var(--tip-background);
  color: var(--tip-text);
  font-size: 0.75rem;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  text-align: center;
  z-index: 3;
  pointer-events: none;
}
.dash-readout > * + * {
  margin-left: 0.6em;
}

.dash-bars {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
}

.dash-bar-row {
  display: grid;
  grid-template-columns: minmax(6rem, 10rem) 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
  font-size: 0.9rem;
}

.dash-bar-row.me {
  font-weight: 700;
}

.dash-you {
  padding: 0 0.35em;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--status-good-bg);
  color: var(--status-good-text);
}

/* A rep among the office's reps: their bar green, everyone else's blue, as on their day chart. */
.dash-bars.against .dash-bar-fill:not(.dash-bar-overlay) {
  background: var(--chart-blue);
}

.dash-bars.against .me .dash-bar-fill:not(.dash-bar-overlay) {
  background: var(--chart-green);
}

.dash-bar-name {
  color: var(--text);
  text-decoration: none;
}

a.dash-bar-name {
  color: var(--primary-text);
}

.dash-bar {
  position: relative;
  display: block;
  height: 0.8rem;
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
}

.dash-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  height: 100%;
  background: var(--primary);
}

/* Wraps, so five or six sources fit a phone. */
.dash-site-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--muted-text);
}

.dash-site-legend i {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.3rem;
  border-radius: 2px;
}

/* The overlay, always the smaller, is drawn in the success green so it
   reads as the good outcome rather than a second series. */
.dash-bar-overlay {
  background: var(--geico-green);
}

/* A bar with a solid part (the offers at the computer) is that part solid
   and the rest of it the same colour, lighter. */
.dash-bar-faint {
  opacity: 0.4;
}

/* A bullet's bands sit faint behind the rep's own figure -- red under
   the floor, amber up to the goal -- and the figure is a thinner green
   bar over them, so where it ends reads against both. */
.dash-bar-band {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  opacity: 0.3;
}

.dash-bar-band.bad { background: var(--bad-fill); }
.dash-bar-band.warn { background: var(--warn-fill); }

.dash-bar-progress {
  top: 25%;
  height: 50%;
  background: var(--geico-green);
}

/* A fixed value column, so every row's bar is the same width and the
   bands line up down the list. */
.dash-bar-row.bullet {
  grid-template-columns: minmax(6rem, 10rem) 1fr 8.5rem;
}

/* The same for words after the figure, so a row with none has a bar as wide
   as the rest; a phone has no room beside them, so the bar takes its own line. */
.dash-bar-row.worded {
  grid-template-columns: minmax(6rem, 10rem) 1fr 13rem;
}

@media (max-width: 560px) {
  .dash-bar-row.worded {
    grid-template-columns: 1fr auto;
  }

  .dash-bar-row.worded .dash-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .dash-bar-row.worded .dash-bar-value {
    grid-column: 2;
    grid-row: 1;
  }
}

.dash-bar-value {
  font-variant-numeric: tabular-nums;
  min-width: 3.2rem;
  text-align: right;
}

/* A list's names share one column as wide as its longest, each on one line
   and right against its bar, so a long name never wraps into a gap. A name
   past the cap (a phone's narrower) is cut short, whole under the pointer. */
@supports (grid-template-columns: subgrid) {
  .dash-bars {
    display: grid;
    grid-template-columns: minmax(6rem, max-content) 1fr auto;
    column-gap: 0.5rem;
  }

  .dash-bars:has(> .bullet) {
    grid-template-columns: minmax(6rem, max-content) 1fr 8.5rem;
  }

  .dash-bars:has(> .worded) {
    grid-template-columns: minmax(6rem, max-content) 1fr 13rem;
  }

  .dash-bar-row,
  .dash-bar-row.bullet,
  .dash-bar-row.worded {
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
  }

  .dash-bar-row > .dash-bar-name,
  .dash-bar-label {
    justify-self: end;
    max-width: 22rem;
  }

  .dash-bar-label {
    justify-content: flex-end;
  }

  .dash-bar-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  @media (max-width: 560px) {
    .dash-bar-row > .dash-bar-name,
    .dash-bar-label {
      max-width: 9rem;
    }

    /* A cut-short name would otherwise give the words all the room. */
    .dash-bar-row.worded {
      grid-template-columns: minmax(50%, 1fr) auto;
    }

    .dash-bar-row.worded > .dash-bar-name,
    .dash-bar-row.worded > .dash-bar-label {
      justify-self: start;
      max-width: 100%;
    }
  }
}

/* The scorecard: result and rating per metric, the overall beneath. */
.dash-score {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.8rem;
  align-items: center;
  font-variant-numeric: tabular-nums;
}

.dash-score-h {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-text);
}

.dash-score-m {
  font-weight: 600;
}

.dash-right {
  text-align: right;
}

.dash-stars {
  display: inline-flex;
  gap: 2px;
  vertical-align: middle;
}

.dash-stars i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--secondary-background);
}

.dash-stars i.on {
  background: var(--primary);
}

.dash-overall {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--input-border);
}

/* All Referrals' dealer tables: the rep's colour down the name's edge, the total in weight. */
.ar-table th.shaded {
  border-left: 4px solid var(--rep-colour);
}

.ar-table tr.total th,
.ar-table tr.total td {
  font-weight: 700;
}

/* A row's name is a rep's, not a heading's: as the lines below write names. */
.ar-table tbody th {
  text-transform: none;
  letter-spacing: normal;
  font-size: inherit;
  color: inherit;
  white-space: nowrap;
}

.ar-table .dash-gloss td,
.ar-table .dash-gloss th.dash-right {
  text-align: right;
  white-space: nowrap;
}

/* The scorecard's How the Ratings Work panel, under the overall. */
.dash-legend {
  margin: 0.8rem 0 0;
}

.dash-legend .dash-gloss .dash-right {
  text-align: right;
}

.dash-legend p {
  text-align: left;
}

.dash-big {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-text);
}

.dash-pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.dash-pill.good { background: var(--status-good-bg); color: var(--status-good-text); }
.dash-pill.warn { background: var(--status-warn-bg); color: var(--status-warn-text); }
.dash-pill.bad { background: var(--status-bad-bg); color: var(--status-bad-text); }
.dash-pill.yellow { background: var(--status-yellow-bg); color: var(--status-yellow-text); }
.dash-pill.info { background: var(--status-info-bg); color: var(--status-info-text); }

.dash-glossary summary,
.dash-group summary,
.partner-relations-day summary {
  cursor: pointer;
  font-weight: 600;
}

.dash-wide {
  overflow-x: auto;
}

.dash-gloss {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
}

.dash-gloss th,
.dash-gloss td {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--input-border);
  vertical-align: top;
}

.dash-gloss th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-text);
}

/* Monthly Targets on Settings: the unit belongs with the field's name, so
   a manager isn't guessing whether a box wants a count or a percentage. */
.selfservice-goal-unit {
  font-weight: 400;
  color: var(--muted-text);
  font-size: 0.8rem;
  margin-left: 0.3rem;
}

.selfservice-goal-note {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--muted-text);
}

.selfservice-goal-more > summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.2rem 0;
}

.selfservice-goal-group {
  margin: 0.9rem 0 0.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-text);
}

/* One dot per relay job on the relay's page: green running, amber
   running but not yet able to send, red not running or stopped. */
.relay-dot {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--light-not-started);
  vertical-align: middle;
}
.relay-dot.on { background: var(--light-completed); }
.relay-dot.waiting { background: var(--light-in-progress); }
/* The status page and Compliance: a line for information only, neither good nor bad. */
.relay-dot.note { background: var(--neutral-dot); }
.relay-dot.muted { background: var(--status-muted-dot); }
/* A card per topic, tapped into for its lines, as the Dashboard's boxes are. */
.checks-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 0.75rem;
}
.checks-card {
  display: block;
  margin: 0;
  color: inherit;
  text-align: center;
  text-decoration: none;
}
.checks-card:hover,
.checks-card:focus-visible {
  outline: 2px solid var(--primary-text);
}
.checks-card .relay-section-title {
  margin-bottom: 0.4rem;
}
.checks-counts {
  margin-left: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.75;
}
.checks-sentence {
  margin: 0;
}
.checks-line .relay-dot {
  flex: none;
  align-self: flex-start;
  margin-top: 0.35rem;
}
.checks-line {
  align-items: flex-start;
}
/* A line's words and names wrap inside the box at any width. */
.checks-line-body {
  flex: 1;
  min-width: 0;
}
.checks-line .relay-text {
  white-space: normal;
  overflow-wrap: anywhere;
}
/* Names listed under the sentence by group, never run into it. */
.checks-group {
  margin-top: 0.35rem;
  font-size: 0.9rem;
}
.checks-group-label {
  font-weight: 700;
}
.checks-names {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.3rem 0 0;
  padding: 0;
  list-style: none;
}
/* Each name its own chip, so a list reads as separate people. */
.checks-names li {
  max-width: 100%;
  padding: 0.05rem 0.55rem;
  border: 1px solid var(--input-border);
  border-radius: 999px;
  background: var(--status-neutral-bg);
  color: var(--text);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
/* A name with details: its chip opens them under it, the whole row wide. */
.checks-detail > summary {
  cursor: pointer;
}
.checks-detail > summary::marker,
.checks-detail > summary::-webkit-details-marker {
  color: var(--muted-text);
}
.checks-names li:has(> .checks-detail[open]) {
  flex-basis: 100%;
  border-radius: 8px;
}
.checks-detail-lines {
  margin: 0.25rem 0 0.2rem;
  padding-left: 1.1rem;
  color: var(--muted-text);
  font-size: 0.8rem;
}
.checks-names .checks-detail-lines li {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

/* Compliance: a muted line keeps its words, on yellow, with who muted it and why. */
.checks-line.is-muted {
  margin: 0 -0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  background: var(--status-yellow-bg);
}
.checks-muted,
.checks-muted-count {
  margin: 0.35rem 0 0;
  color: var(--status-yellow-text);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
.checks-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.checks-buttons .checks-action {
  margin: 0;
}
.checks-mute-form,
.checks-confirm-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex-basis: 100%;
}
.checks-mute-label,
.checks-confirm-text {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
}
.checks-mute-note {
  flex: 1 1 14rem;
  min-width: 0;
}
/* Lead Intake: a new key, shown once, whole on one line to copy. */
.intake-key {
  width: 100%;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* A month for Monthly Targets or a day for the Visit Schedule: the pick
   and its button read as one choice, centred, rather than a field with
   something beside it. */
.selfservice-goal-month {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* A holiday each, with an x to take it off. */
.selfservice-holidays {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}
.selfservice-holiday {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--primary-text);
  color: var(--primary-text);
  border-radius: 999px;
  padding: 0.15rem 0.5rem 0.15rem 0.7rem;
}
.selfservice-holiday-drop {
  border: 0;
  background: none;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.1rem;
  cursor: pointer;
}
.selfservice-holiday-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* theme_toggle.js's band, fixed so it rides above every page's scroll:
   Feedback and Help in the bottom left corner, text size and the theme
   in the bottom right. Only the buttons take a click, never the gap. */
#page-controls {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.25rem;
  pointer-events: none;
}

.page-controls-start,
.page-controls-end {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  pointer-events: auto;
}

.page-controls-end {
  margin-left: auto;
}

/* The Not Ready banner (_not_ready_banner.html), in the sale banner's
   place over the top of the page, the sale banner dropping below it
   while it is up (--not-ready-clear, set by not_ready_banner.js). Queue's
   connection-lost red, one fill in both themes, white text on it. */
.not-ready-banner {
  position: fixed;
  top: max(0.5rem, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1051;
  display: flex;
  justify-content: center;
  width: max-content;
  max-width: calc(100vw - 2rem);
  pointer-events: none;
}

.not-ready-banner-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  padding: 0.2rem 0.2rem 0.2rem 1rem;
  border-radius: 999px;
  background: var(--alert-red);
  color: var(--on-alert-red);
  border: 1px solid var(--alert-red-edge);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.not-ready-banner-text {
  overflow-wrap: anywhere;
}

.not-ready-banner-hide {
  flex: none;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
}

.not-ready-banner-hide:hover,
.not-ready-banner-hide:focus-visible {
  background: rgba(255, 255, 255, 0.25);
}

.not-ready-banner-hide:focus-visible {
  outline: 2px solid var(--on-alert-red);
  outline-offset: -2px;
}

/* The sale banner (_sale_banner.html), fixed over the top of the page so
   nothing under it moves as a sale comes or goes; only its rows take a
   click. Above the corner band, under a pop-up's backdrop. */
.sale-banner {
  position: fixed;
  top: calc(max(0.5rem, env(safe-area-inset-top)) + var(--not-ready-clear, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  pointer-events: none;
}

.sale-banner-item,
.sale-banner-more {
  pointer-events: auto;
  display: flex;
  align-items: center;
  max-width: 100%;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sale-banner-item {
  gap: 0.25rem;
  padding: 0.2rem 0.2rem 0.2rem 1rem;
  background: var(--status-good-bg);
  color: var(--status-good-text);
  border: 1px solid var(--geico-green);
  font-weight: 700;
}

/* A sale a staff member referred: its line, then theirs smaller under it, the × beside both. */
.sale-banner-item.has-referred {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.25rem;
  border-radius: 1.25rem;
}

.sale-banner-item.has-referred .sale-banner-hide {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

.sale-banner-referred {
  grid-column: 1;
  grid-row: 2;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.85;
  padding-bottom: 0.15rem;
}

.sale-banner-more {
  padding: 0.2rem 0.8rem;
  background: var(--surface);
  color: var(--muted-text);
  border: 1px solid var(--hairline);
  font-size: 0.875rem;
}

.sale-banner-text {
  overflow-wrap: anywhere;
}

.sale-banner-hide {
  flex: none;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
}

.sale-banner-hide:hover,
.sale-banner-hide:focus-visible {
  background: var(--button-hover);
}

/* Room at the foot of every page for the band: its 2.75rem over 1rem of
   inset, and a gap. */
:root {
  --toggle-clear: 4.25rem;
}

/* A phone has no room beside the rows, so they close the page instead. */
@media (max-width: 560px) {
  :root {
    --toggle-clear: 1.5rem;
  }

  #page-controls {
    position: static;
    padding: 1rem;
  }
}

#theme-toggle,
#carrier-logins-open,
#call-notes-open {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--primary-text);
  background: var(--secondary-background);
  font-size: 1.3rem;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

/* Call Notes (call_notes.js): a window over any page for jotting a call's
   vehicle, financing and address; its button above, light blue while it is
   open. The window draws its own boxes, so a page's form rules (Record's
   tall, centred boxes) never reach into it. */
#call-notes-open.selected,
#call-notes .cn-pill.selected {
  background: color-mix(in srgb, var(--primary-text) 25%, var(--background));
}

#call-notes {
  position: fixed;
  z-index: 1001;
  width: min(26rem, calc(100vw - 1rem));
  max-height: min(80vh, calc(100vh - 1rem));
  min-width: 18rem;
  min-height: 12rem;
  display: flex;
  flex-direction: column;
  background: var(--background);
  border: 1px solid var(--primary);
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  resize: both;
}

#call-notes[hidden] {
  display: none;
}

#call-notes.moving {
  opacity: 0.92;
  user-select: none;
}

#call-notes.minimized {
  resize: none;
  min-height: 0;
  height: auto !important;
}

#call-notes.minimized .call-notes-body {
  display: none;
}

#call-notes .call-notes-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  background: var(--primary);
  color: var(--on-primary);
  cursor: move;
  touch-action: none;
}

#call-notes .call-notes-title {
  flex: 1;
  font-weight: 700;
}

#call-notes .call-notes-bar button {
  margin: 0;
  padding: 0.2rem 0.8rem;
  border: 1px solid var(--on-primary);
  border-radius: 999px;
  background: transparent;
  color: var(--on-primary);
  cursor: pointer;
}

#call-notes .call-notes-min,
#call-notes .call-notes-close {
  padding: 0.15rem 0.55rem;
  font-size: 1.2rem;
  line-height: 1;
}

#call-notes .call-notes-body {
  overflow: auto;
  padding: 0.75rem 1rem 1rem;
  text-align: left;
}

#call-notes .notes-part {
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--hairline);
}

#call-notes .notes-part:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

#call-notes label {
  display: block;
  margin: 0.3rem 0 0.1rem;
  font-size: 0.8rem;
}

#call-notes .notes-part-title {
  font-weight: 700;
  color: var(--primary-text);
}

#call-notes label.notes-part-title {
  margin-top: 0;
  font-size: 1rem;
}

#call-notes input[type="text"],
#call-notes textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.3rem 0.55rem;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: left;
}

#call-notes .vin-box {
  font-family: Consolas, "Courier New", monospace;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#call-notes .finance-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

#call-notes .finance-kinds {
  display: flex;
  gap: 0.3rem;
}

#call-notes .cn-pill {
  margin: 0;
  padding: 0.15rem 0.7rem;
  border: 1px solid var(--primary-text);
  border-radius: 999px;
  background: var(--background);
  color: var(--primary-text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

#call-notes .cn-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr 3.5rem 5rem;
  gap: 0.4rem;
}

/* A language after a name (language_tags.py): its colour as the border
   and a tint behind ordinary text, so it reads in both themes and the
   name of the language is always there. */
.language-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0 0.45rem;
  border: 1px solid var(--language-colour, var(--muted-text));
  border-left-width: 0.3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--language-colour, transparent) 16%, transparent);
  color: var(--primary-text);
  font-size: 0.8em;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}

/* pages.ini's colours are picked against the light page; on the dark one
   each is drawn part white, or the portal's navy vanishes into it. */
:root[data-theme="dark"] .language-tag {
  border-color: color-mix(in srgb, var(--language-colour, var(--muted-text)) 70%, white);
}

/* Who somebody reports to, after their name on the Staff Roster: the
   sign-in chips' neutral pill, a fact about the row rather than a warning. */
.reports-to-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0 0.5rem;
  border: 1px solid var(--input-border);
  border-radius: 999px;
  background: var(--status-neutral-bg);
  color: var(--muted-text);
  font-size: 0.8em;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}

/* Text size, to the toggle's left: A± opens A+ and A− stacked above it.
   The steps follow the button in the page, so Tab reaches them next. */
#text-size {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.25rem;
}
#text-size-steps {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
#text-size button {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--primary-text);
  background: var(--secondary-background);
  color: var(--primary-text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
#text-size button:disabled {
  opacity: 0.4;
}

/* The desk alerts' bell (_desk_alerts.html), first in the right corner,
   crossed out while alerts are off. */
#desk-alerts {
  position: relative;
}
#desk-alerts-bell {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--primary-text);
  background: var(--secondary-background);
  color: var(--primary-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
#desk-alerts-bell svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* The cross over a gap in the button's own colour, so it reads across the bell. */
#desk-alerts-bell .bell-cross-gap {
  stroke: var(--secondary-background);
  stroke-width: 5;
}
#desk-alerts-bell[aria-pressed="true"] .bell-cross,
#desk-alerts-bell[aria-pressed="true"] .bell-cross-gap {
  display: none;
}

/* Asking a desk to allow alerts: amber, pointing down at the bell, and
   as hard to miss as a banner across the page. */
#desk-alerts-callout {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  width: 22rem;
  max-width: calc(100vw - 9rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: var(--amber);
  color: var(--on-amber);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
#desk-alerts-callout p {
  margin: 0;
}
#desk-alerts-callout::after {
  content: "";
  position: absolute;
  top: 100%;
  right: calc(1.375rem - 0.6rem);
  border: 0.6rem solid transparent;
  border-top-color: var(--amber);
}

/* While the callout shows, the band sits at the foot of the page, in the
   room the page ends on, rather than over it: over it, a list too short to
   scroll sits under the callout. The page is at least the window's height,
   so on one that fits the band stays in the corner. */
@media (min-width: 561px) {
  :root:has(#desk-alerts:not([hidden]) #desk-alerts-callout:not([hidden])) {
    --toggle-clear: 13.5rem;
  }

  :root:has(#desk-alerts:not([hidden]) #desk-alerts-callout:not([hidden])) body {
    position: relative;
    min-height: 100vh;
  }

  :root:has(#desk-alerts:not([hidden]) #desk-alerts-callout:not([hidden])) #page-controls {
    position: absolute;
  }
}

/* A phone's band closes the page, so the callout stands above the bell in it. */
@media (max-width: 560px) {
  #desk-alerts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  #desk-alerts-callout {
    position: relative;
    bottom: auto;
    margin-bottom: 0.75rem;
  }
}

/* /leads: the search on one line, then a box per lead -- the same
   bordered box /sales and /transfer put a part of a form in -- a line
   each until opened. */
.lead-search {
  flex-direction: row;
  align-items: stretch;
  margin-bottom: 0.5rem;
}
.lead-search button {
  margin-top: 0;
}
.lead-count {
  color: var(--muted-text);
}
.lead {
  background: var(--surface);
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
}
.lead[open] {
  padding-bottom: 1rem;
}
/* The browser's own marker sits on a line of its own once the row below
   it is a grid, so the row carries its own, beside the name. */
.lead summary {
  cursor: pointer;
  color: var(--primary-text);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  list-style: none;
}
.lead summary::-webkit-details-marker {
  display: none;
}
.lead summary::before {
  content: "\25B8";
  width: 0.8rem;
  flex: none;
  text-align: center;
}
.lead[open] summary::before {
  content: "\25BE";
}
.lead summary:hover .lead-name {
  text-decoration: underline;
}
/* One row per lead, on columns of its own, so the phone under a long
   name starts where the phone above it does. */
.lead-line {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0.2rem 1rem;
  align-items: baseline;
}
.lead-tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.lead-tags:empty {
  display: none;
}
/* The tags keep their own line at every width, so the four values
   spread evenly and line up from one lead to the next. */
@media (min-width: 760px) {
  .lead-line {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.lead-name {
  font-weight: 700;
  font-size: 1.1rem;
}
.lead-when {
  color: var(--muted-text);
}
/* An opened lead's number, beside its Record Sale. */
.lead-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-top: 0.5rem;
}
.lead-number {
  color: var(--muted-text);
}
/* An opened lead: its parts side by side, each in a box of its own as a
   policy sits in /sales, so it reads as contact, insurance, driver and
   car rather than as one long list. */
.lead-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
  align-items: start;
}
@media (min-width: 760px) {
  .lead-row {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }
  /* A lead with one driver, or one car: centred rather than stretched
     across a width meant for two. */
  .lead-row.one {
    grid-template-columns: minmax(0, 32rem);
    justify-content: center;
  }
}
.lead-section {
  border: 1px solid var(--secondary-background);
  border-radius: 8px;
  background: var(--background);
  padding: 0.6rem 0.9rem;
}
.lead-transfer {
  background: var(--geico-green);
  color: var(--surface);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.85rem;
}
.lead-section h3 {
  color: var(--primary-text);
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}
/* A field is its own cell, the label over the value and each as wide as
   it needs: as many to a line as fit, and a line with fewer centred
   rather than left hanging. */
.lead-fields {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin: 0;
}
.lead-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.lead-fields dt {
  color: var(--muted-text);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.lead-fields dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* The Call List: a box per customer like /leads's leads, under a
   heading per standing, with the rep's own call picked out. */
.calls-summary {
  color: var(--muted-text);
}
.calls-problem {
  background: var(--status-bad-bg);
  color: var(--status-bad-text);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
}
/* static/live.js healing a page's connection: said quietly, and gone once it has. */
.live-reconnecting {
  color: var(--muted-text);
  font-style: italic;
}
/* The page's one strip under the tab strip, for whichever of its live views is cut off. */
.live-reconnecting-strip {
  margin: 0.5rem 0;
  text-align: center;
}
.call-group {
  margin-top: 1.25rem;
}
.call-group-title {
  color: var(--primary-text);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  cursor: default;
}
details.call-group > .call-group-title {
  cursor: pointer;
}
.call-group-title-done {
  color: var(--subtle-blue-text);
}
.call-row {
  text-align: left;
  background: var(--surface);
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
}
.call-row.yours {
  border-width: 2px;
  background: var(--secondary-background);
}
/* My Policies' full view: how far a sale has got, the box's edge amber
   where Sales Archive or Edge reads a figure differently and red once Edge
   says it is cancelling. */
.policy-stage { font-weight: 600; }
.policy-row.policy-differs { border-left: 6px solid var(--status-warn-text); }
.policy-differ { color: var(--status-warn-text); }
.policy-row.policy-cancelled { border-left: 6px solid var(--status-bad-text); }
.policy-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0;
}
/* My Policies' pay flags: a chip each (my_policies/flags.py's tones), red
   where pay could be taken back, amber where something wants checking,
   green where it counts for the rep, yellow for DriveEasy still to
   register, blue for a bundle, gray for what it is. */
.policy-summary { font-weight: 600; margin: 0.5rem 0 0.25rem; }
.policy-commission span { font-style: italic; color: var(--muted-text); }
.policy-filters { margin: 0.5rem 0; }
/* My Policies' edit form: the Company box and its label sit in the form's own column, gone for an auto. */
.policy-company {
  display: contents;
}

.policy-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}
.policy-flag {
  padding: 0.05rem 0.55rem;
  border: 1px solid var(--input-border);
  border-radius: 999px;
  background: var(--status-neutral-bg);
  font-size: 0.8rem;
}
.policy-flag.bad { border-color: var(--status-bad-text); background: var(--status-bad-bg); color: var(--status-bad-text); }
.policy-flag.warn { border-color: var(--status-warn-text); background: var(--status-warn-bg); color: var(--status-warn-text); }
.policy-flag.good { border-color: var(--status-good-text); background: var(--status-good-bg); color: var(--status-good-text); }
.policy-flag.yellow { border-color: var(--status-yellow-text); background: var(--status-yellow-bg); color: var(--status-yellow-text); }
.policy-flag.info { border-color: var(--status-info-text); background: var(--status-info-bg); color: var(--status-info-text); }
.policy-pay { margin-top: 0.5rem; font-size: 0.9rem; }
.policy-pay summary { cursor: pointer; }
.policy-pay-line { margin: 0.3rem 0 0; }
.policy-pay-line[title] { cursor: help; }
.policy-source { color: var(--muted-text); }
/* My Policies' boxes, in both views: a card a sale on the list's own
   background, the customer and a status pill over the product, chips and
   a bottom row of small buttons. */
.policy-cards-count {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--muted-text);
}
.policy-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  text-align: left;
}
.policy-card + .policy-card { margin-top: 0.6rem; }
.policy-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1rem;
}
.policy-card-name {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}
.policy-card-meta {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--muted-text);
  overflow-wrap: anywhere;
}
.policy-card .policy-flags { margin-top: 0.5rem; }
/* Active green, Cancel Pending amber, Cancelled red. */
.policy-pill {
  flex: none;
  padding: 0.1rem 0.65rem;
  border-radius: 999px;
  background: var(--status-neutral-bg);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
}
.policy-pill.good { background: var(--status-good-bg); color: var(--status-good-text); }
.policy-pill.warn { background: var(--status-warn-bg); color: var(--status-warn-text); }
.policy-pill.bad { background: var(--status-bad-bg); color: var(--status-bad-text); }
/* The Verified column: a slot at each box's right edge, under a heading
   over the list set in by the box's own border and padding, so the tags
   line up down the page. */
.policy-cards-head {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.25rem;
  padding: 0 calc(1rem + 1px);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-text);
}
.policy-verified {
  flex: none;
  width: 5.25rem;
  text-align: center;
}
.policy-verified .policy-flag {
  padding: 0.05rem 0.45rem;
  font-size: 0.75rem;
}
/* Edit and Remove on the left, the copy buttons on the right; a number
   the browser wouldn't copy shows beside its button, to select by hand. */
.policy-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0.65rem 0 0;
}
.policy-buttons-edit, .policy-buttons-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
/* The copy buttons take the rest of the row, wrapping within it on a
   narrow screen; a small basis keeps them beside Edit and Remove there. */
.policy-buttons-edit { flex: none; }
.policy-buttons-copy { flex: 1 1 10rem; justify-content: flex-end; }
.policy-buttons button, .checkin-form .policy-remove-offer button {
  margin: 0;
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
}
.policy-buttons button { white-space: nowrap; }
.policy-copy-shown { font-size: 0.85rem; user-select: all; overflow-wrap: anywhere; }
.policy-remove-offer { margin: 0.5rem 0 0; font-size: 0.9rem; color: var(--muted-text); }
/* A MOAT bundle under the auto it was written up with: a thin blue line,
   labelled, joins the two boxes. */
.policy-bundle-link {
  margin: 0 0 0 1.5rem;
  padding: 0.2rem 0 0.2rem 0.6rem;
  border-left: 2px solid var(--status-info-text);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--status-info-text);
}
.policy-bundle-link + .policy-card { margin-top: 0; }
@media (max-width: 600px) {
  .card:has(> .policy-card) { padding: 0.75rem; }
  .policy-card { padding: 0.7rem 0.8rem; }
  .policy-cards-head { padding: 0 calc(0.8rem + 1px); }
  .policy-card-head { gap: 0.5rem 0.6rem; }
  .policy-verified { width: 4.6rem; }
  .policy-buttons button { padding: 0.3rem 0.55rem; font-size: 0.8rem; }
}
.call-line {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 0.2rem 1rem;
  align-items: baseline;
}
/* A Call List card's line (name, phone and days left, its number on the
   Copy button) and a follow-up row's (customer, company, day and rep, in
   the same columns on SSL's, which has no company). No name breaks: each
   part keeps to one line and the company takes the slack, and below the
   page's full width (main's 900px) the name has a row of its own. */
.call-line.call-list-line {
  grid-template-columns: minmax(max-content, 1.4fr) minmax(max-content, 1fr) minmax(max-content, 0.8fr);
}
.call-line.followup-line {
  grid-template-columns: minmax(max-content, 1.4fr) minmax(0, 1fr) max-content minmax(max-content, 0.8fr);
}
.followup-line .followup-day { grid-column: 3; }
.followup-line .followup-agent { grid-column: 4; }
@media (max-width: 899px) {
  .call-line.call-list-line {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .call-list-line .lead-name {
    grid-column: 1 / -1;
  }
  /* After the name, each part whole beside the last where it fits, else on the next row. */
  .call-line.followup-line {
    display: flex;
    flex-wrap: wrap;
  }
  .followup-line .lead-name {
    flex-basis: 100%;
  }
}
.call-left {
  justify-self: end;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  color: var(--status-warn-text);
  font-weight: 600;
}
/* Days left before a customer leaves the list: red on the last day,
   then orange, yellow and, from three on, green. */
.call-row.left-0 { border-left: 6px solid var(--status-bad-text); }
.call-row.left-1 { border-left: 6px solid var(--status-orange-text); }
.call-row.left-2 { border-left: 6px solid var(--status-yellow-text); }
.call-row.left-3 { border-left: 6px solid var(--status-good-text); }
.call-row.left-0 .call-left { background: var(--status-bad-bg); color: var(--status-bad-text); }
.call-row.left-1 .call-left { background: var(--status-orange-bg); color: var(--status-orange-text); }
.call-row.left-2 .call-left { background: var(--status-yellow-bg); color: var(--status-yellow-text); }
.call-row.left-3 .call-left { background: var(--status-good-bg); color: var(--status-good-text); }
.call-about {
  color: var(--muted-text);
  margin-top: 0.3rem;
}
.call-line .call-about {
  margin-top: 0;
}
.call-note {
  margin-top: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  display: inline-block;
  background: var(--status-neutral-bg);
}
.call-note.done {
  background: var(--status-good-bg);
  color: var(--status-good-text);
}
.call-note.awaiting, .call-note.to_call {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
}
.call-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: center;
}
.call-let-go {
  background: none;
  color: var(--primary-text);
  text-decoration: underline;
  font-weight: 400;
}
/* copy_number.js's button, bottom right of a Call List card or follow-up
   row. Its labels share one grid cell, so it is the widest one's width
   whichever shows. */
.copy-number {
  display: inline-grid;
  justify-items: center;
  margin-left: auto;
}
.copy-number-label {
  grid-area: 1 / 1;
}
/* A shared-out customer's light: green done, orange worked and still
   open, red not started; a pool customer has none. Its words are for a
   screen reader and the hover title, and the key over the page. */
.status-light {
  display: inline-block;
  flex: none;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  vertical-align: baseline;
}
.status-light.completed { background: var(--light-completed); }
.status-light.in-progress { background: var(--light-in-progress); }
.status-light.not-started { background: var(--light-not-started); }
.status-light-key {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1rem;
}
.call-line .lead-name .status-light {
  vertical-align: 0.05rem;
}
/* Words a screen reader says that the page shows another way. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 600px) {
  .call-line {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* /service: every section collapsed to its heading and count until tapped. */
.service-section > summary {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--input-border);
}
.service-section .section-count,
.dash-tab .section-count,
.attendance-group .section-count {
  color: var(--muted-text);
  font-weight: 400;
}
.service-section > .calls-summary {
  margin-top: 0.75rem;
}

/* A person page's review sections, each shut to the line that carries its figure. */
.review-section > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.2rem 0;
}
/* The audit form inside its section, centred like Self Service's. */
.review-section > .card {
  text-align: center;
}
.review-section .review-figure {
  color: var(--muted-text);
  font-weight: 400;
  font-size: 0.95rem;
}
.review-section .review-figure::before {
  content: " -- ";
}
.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 0.6rem;
}
.review-table th,
.review-table td {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-top: 1px solid var(--input-border);
  white-space: nowrap;
}

/* ---- Sales Standards (/sales-standards) ---- */

/* The office's box for each standard, a row sharing its width evenly. */
.standards-tiles {
  display: grid;
  grid-template-columns: repeat(var(--tiles, 4), minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

/* The page's levels in the workbook sheet's colours: green at goal, yellow at the expected standard, red at the
   minimum standard and black below it. A box takes its figure's as its cell in the grid does. */
.standards-tile.good {
  border-color: var(--status-good-text);
  background: var(--status-good-bg);
}

.standards-tile.warn {
  border-color: var(--status-yellow-text);
  background: var(--status-yellow-bg);
}

.standards-tile.minimum {
  border-color: var(--status-bad-text);
  background: var(--status-bad-bg);
}

.standards-tile.bad,
.standards-tile.bad:hover {
  border-color: var(--standards-below-bg);
  background: var(--standards-below-bg);
  color: var(--standards-below-ink);
}

.standards-tile.bad .dash-tile-label,
.standards-tile.bad .dash-tile-office,
.standards-tile.bad .standards-group,
.standards-tile.bad .standards-reps {
  color: var(--standards-below-ink);
}

.standards-tile.good .dash-tile-value,
.standards-tile.good .standards-level,
.standards-level-name.good { color: var(--status-good-text); }
.standards-tile.warn .dash-tile-value,
.standards-tile.warn .standards-level,
.standards-level-name.warn { color: var(--status-yellow-text); }
.standards-tile.minimum .dash-tile-value,
.standards-tile.minimum .standards-level,
.standards-level-name.minimum { color: var(--status-bad-text); }
.standards-tile.bad .dash-tile-value,
.standards-tile.bad .standards-level { color: var(--standards-below-text); }

/* The minimum standard's dot on the Dashboard's table, between amber and red. */
.dash-sig.minimum {
  background: var(--status-orange-text);
}

/* A level's dot on this page, in the sheet's colours; the black one ringed so it shows on a black box. */
.standards-page .dash-sig.warn { background: var(--status-muted-dot); }
.standards-page .dash-sig.minimum { background: var(--bad-fill); }
.standards-page .dash-sig.bad {
  background: var(--standards-below-bg);
  box-shadow: 0 0 0 2px var(--standards-below-text);
}

/* A figure's level in words, so it reads without its colour. */
.standards-level,
.standards-level-name {
  font-size: 0.78rem;
  font-weight: 700;
}

.standards-tile:hover .dash-tile-label,
.standards-tile:focus-visible .dash-tile-label {
  text-decoration: underline;
}

.standards-tile .dash-tile-value {
  font-size: 1.8rem;
}

/* The table's group a standard sits under, over its name. */
.standards-group {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-text);
}

/* How many reps are green, amber and red on a standard. */
.standards-reps {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.standards-key {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 1.1rem;
  margin: 0.4rem 0 0;
}

/* A rep below goal and the rates that put them there, by level, the furthest first. */
.standards-off {
  list-style: none;
  margin: 0;
  padding: 0;
}

.standards-off li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--row-rule);
}

.standards-off li:first-child {
  border-top: 0;
}

.standards-off-name {
  flex: 0 0 15rem;
  font-weight: 600;
}

.standards-off-name a {
  color: var(--primary-text);
  text-decoration: none;
}

.standards-off-name a:hover {
  text-decoration: underline;
}

.standards-chips {
  display: flex;
  flex: 1 1 20rem;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
}

.standards-level-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.standards-chip {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.standards-chip.good {
  background: var(--status-good-bg);
  color: var(--status-good-text);
  border: 1px solid var(--status-good-text);
}

.standards-chip.warn {
  background: var(--status-yellow-bg);
  color: var(--status-yellow-text);
  border: 1px solid var(--status-yellow-text);
}

.standards-chip.minimum {
  background: var(--status-bad-bg);
  color: var(--status-bad-text);
  border: 1px solid var(--status-bad-text);
}

.standards-chip.bad {
  background: var(--standards-below-bg);
  color: var(--standards-below-text);
  border: 1px solid var(--standards-below-bg);
}

/* The grid's card: its name on the left, what the best's colour means and the tick for each standard's mark on
   the right. */
.standards-sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.6rem;
}

.standards-sheet-head h2 {
  margin: 0;
  text-align: left;
}

.standards-sheet-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.2rem;
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted-text);
}

.standards-sheet-tools label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.standards-swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  margin-right: 0.3rem;
  border-radius: 3px;
  background: var(--standards-best-bg);
  vertical-align: -1px;
}

/* A table wider than a narrow screen scrolls inside its card. */
.standards-wide {
  overflow-x: auto;
}

/* The sheet's grid: a column a standard under its heading, what each level is for it in the rows under that, then
   a row a rep, the office's and each supervisor's, every figure a block in its level's colour. */
.standards-board {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.standards-board th,
.standards-board td {
  padding: 2px 3px;
  text-align: center;
  white-space: nowrap;
}

.standards-board thead tr:first-child th {
  padding: 0.55rem 0.4rem;
  border-bottom: 2px solid var(--input-border);
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
  vertical-align: bottom;
}

/* The names stay in view while the figures scroll under them. */
.standards-board th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  padding-right: 0.8rem;
  padding-left: 0.6rem;
  background: var(--secondary-background);
  text-align: left;
  font-weight: 600;
}

.standards-board tbody th a {
  color: var(--primary-text);
  text-decoration: none;
}

.standards-board tbody th a:hover {
  text-decoration: underline;
}

.standards-board .standards-leader {
  padding-right: 0.6rem;
  text-align: left;
  color: var(--muted-text);
}

.standards-c {
  display: block;
  padding: 0.32rem 0.5rem;
  border-radius: 6px;
}

.standards-lv .standards-c,
.standards-each .standards-c {
  font-weight: 600;
}

.standards-lv.good .standards-c,
.standards-c.good {
  background: var(--status-good-bg);
  color: var(--status-good-text);
}

.standards-lv.warn .standards-c,
.standards-c.warn {
  background: var(--status-yellow-bg);
  color: var(--status-yellow-text);
}

.standards-lv.minimum .standards-c,
.standards-c.minimum {
  background: var(--status-bad-bg);
  color: var(--status-bad-text);
}

.standards-lv.bad .standards-c,
.standards-c.bad {
  background: var(--standards-below-bg);
  color: var(--standards-below-text);
  font-weight: 700;
}

/* The best rep's figure in its column, over its level's colour as the sheet had it. */
.standards-lv.standards-best .standards-c {
  background: var(--standards-best-bg);
  color: var(--standards-best-text);
  font-weight: 700;
}

.standards-mark .standards-c {
  font-weight: 700;
}

.standards-mark small {
  font-weight: 400;
  opacity: 0.75;
}

.standards-other .standards-c {
  text-align: right;
}

/* A count's share of the most any rep has, behind it. */
.standards-bar {
  background: linear-gradient(to right, var(--input-border) var(--bar), transparent var(--bar));
}

/* What each level is for each standard, a row a level under the headings. */
.standards-key-row th,
.standards-key-row td,
.standards-board .standards-key-row th:first-child {
  background: var(--surface);
}

.standards-board .standards-key-row th:first-child {
  text-align: right;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted-text);
}

.standards-key-row .standards-c {
  padding: 0.22rem 0.4rem;
  font-size: 0.78rem;
}

.standards-board .standards-key-rest {
  padding-left: 0.6rem;
  text-align: left;
  font-size: 0.75rem;
  color: var(--muted-text);
}

.standards-board thead tr:last-child > * {
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--input-border);
}

.standards-board tbody tr:first-child > * {
  padding-top: 0.45rem;
}

.standards-board tbody tr:hover > * {
  background: var(--surface);
}

.standards-board .standards-office-row > * {
  padding-top: 0.45rem;
  border-top: 2px solid var(--input-border);
  font-weight: 700;
}

.standards-board .standards-band th {
  position: static;
  padding: 1.1rem 0.6rem 0.35rem;
  border-bottom: 1px solid var(--row-rule);
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-text);
}

/* Each standard's own mark, shown by the card's tick. */
.standards-board .standards-each {
  display: none;
}

.standards-board.standards-show-each .standards-each {
  display: table-cell;
}

.standards-board thead th.standards-each {
  background: var(--status-neutral-bg);
  font-size: 0.78rem;
}

.standards-board thead th.standards-each span {
  font-weight: 400;
  color: var(--muted-text);
}

@media (max-width: 760px) {
  .standards-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .standards-off-name {
    flex-basis: 100%;
  }

  /* A level's name spans two columns, too wide to hold in view on a phone. */
  .standards-board .standards-key-row th:first-child {
    position: static;
  }
}

/* ---- Dealership (/dealer) ---- */

/* The day's marked visits, each with its own Unmark at the far end. */
.dealer-visits {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dealer-visits li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--input-border);
}

.dealer-visits li:first-child {
  border-top: none;
}

.dealer-visit-what {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dealer-visit-who {
  display: block;
  font-size: 0.85rem;
  color: var(--muted-text);
}

/* The day's stops: one visited reads as done rather than dropping off. */
.dealer-stops li.done .dealer-visit-what {
  opacity: 0.6;
}

.dealer-stops li:not(.done) .dealer-stop-done {
  display: none;
}

.dealer-stop-done {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--status-good-text);
}

.dealer-route {
  margin: 0.75rem 0 0;
}

/* Tall enough to place a stop on a phone held upright. */
#dealer-map {
  height: 320px;
  margin-top: 1rem;
  border-radius: 8px;
  z-index: 0;
}

/* The street tiles are a daylight picture: darkened with the page
   rather than swapped for a basemap that wants a key. The satellite is
   left alone -- inverted aerial imagery is unreadable. */
:root[data-theme="dark"] .map-street { filter: var(--map-dark-filter); }

/* The map's own controls in the page's colours rather than Leaflet's
   white boxes, which load after this sheet: hence the map's id. The
   layers icon is drawn in the text's colour, Leaflet's being a dark
   picture. */
#dealer-map .leaflet-bar,
#dealer-map .leaflet-control-layers {
  border-color: var(--input-border);
}

#dealer-map .leaflet-bar a,
#dealer-map .leaflet-control-layers {
  background-color: var(--surface);
  color: var(--text);
}

#dealer-map .leaflet-bar a {
  border-bottom-color: var(--hairline);
}

#dealer-map .leaflet-bar a:hover,
#dealer-map .leaflet-bar a:focus-visible {
  background-color: var(--button-hover);
}

#dealer-map .leaflet-bar a.leaflet-disabled {
  background-color: var(--secondary-background);
  color: var(--muted-text);
}

#dealer-map .leaflet-control-layers-toggle {
  position: relative;
  background-image: none;
}

#dealer-map .leaflet-control-layers-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2 8l10 5 10-5zM2 12l10 5 10-5M2 16l10 5 10-5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") center / 60% no-repeat;
}

#dealer-map .leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--text);
}

#dealer-map .leaflet-control-attribution a {
  color: var(--primary-text);
}

/* Admin's Attendance: the name search and the department groups.
   Dealerships' search is the same line. */
.attendance-find,
.dealership-find {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}
/* A control on a line rather than under a label of its own: a search, a
   pick in a list's row or table, and the filters over a list. */
.attendance-find input[type="search"],
.dealership-find input[type="search"],
.attendance-group select,
.attendance-group input:not([type="checkbox"], [type="radio"]),
.road-table select,
.referral-switches select {
  flex: 1 1 14rem;
  height: 3rem;
  padding: 0 1rem;
  font-size: 1.1rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: 4px;
}
.attendance-group > summary {
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-text);
}
.selfservice-section .attendance-group {
  padding: 0.75rem 1rem;
}
.selfservice-section .attendance-group + .attendance-group {
  margin-top: 0.75rem;
}

/* A notice over a page's figures: amber for a warning, red for an error. */
.run-notice {
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
  background: var(--status-neutral-bg);
}
.run-notice.warning { background: var(--status-warn-bg); color: var(--status-warn-text); }
.run-notice.error { background: var(--status-bad-bg); color: var(--status-bad-text); }
/* The relay that never answered: amber, fixable here and now. */
.install-banner {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
}
/* What the in-portal download is doing; empty until it starts. */
.download-status:empty { display: none; }

/* Self Service's Authenticator: a line of state, and the link while it is owed. */
.authenticator-card p {
  margin: 0.35rem 0 0.75rem;
}
.authenticator-card p:last-child {
  margin-bottom: 0;
}
/* Enabled in green, Disabled in red, from the status tokens each theme sets. */
.authenticator-state {
  padding: 0.05rem 0.6rem;
  border-radius: 999px;
}
.authenticator-state.on { background: var(--status-good-bg); color: var(--status-good-text); }
.authenticator-state.off { background: var(--status-bad-bg); color: var(--status-bad-text); }
a.authenticator-link {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
}

/* The Guide, opened by Help: the viewer's pages as the tab strip groups
   them, centred. */
.page-key {
  width: min(32rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 4rem);
  padding: 1rem 1.25rem;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}

.page-key::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

/* Three columns, so the title sits in the middle and the close button at the end. */
.page-key-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.page-key-head h2 {
  grid-column: 2;
  margin: 0;
  font-size: 1.15rem;
  text-align: center;
  color: var(--primary-text);
}

.page-key-close {
  grid-column: 3;
  justify-self: end;
  background: none;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}

.page-key-list {
  margin: 0.75rem 0 0;
  text-align: center;
}

.page-key-list dt {
  margin-top: 0.6rem;
  font-weight: 700;
}

.page-key-list dt a {
  color: var(--primary-text);
}

.page-key-list dd {
  margin: 0.1rem 0 0;
  color: var(--muted-text);
  font-size: 0.9rem;
}

/* The Dashboard's link to its targets, for whoever sets them. */
.dash-edit-targets {
  display: inline-block;
  margin-top: 0.25rem;
  color: var(--primary-text);
  font-weight: 600;
}

/* A manager gets Edit Targets and My Policies side by side. */
.dash-edit-targets + .dash-edit-targets {
  margin-left: 1.25rem;
}

.page-key-list .page-key-here {
  color: var(--text);
}

/* Feedback and Help, the band's left corner; Feedback's pop-up is in the Guide's shape. */
#feedback-open,
#page-key-open {
  height: 2.75rem;
  margin: 0;
  padding: 0 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--primary-text);
  background: var(--secondary-background);
  color: var(--primary-text);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

/* The carrier logins pop-up, in the Guide's shape: a site's link and who last
   changed it, then a row per field with its buttons at the right. */
.carrier-site {
  margin-top: 0.9rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--hairline);
}

.carrier-site-name {
  font-weight: 700;
}

.carrier-changed {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
}

.carrier-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.carrier-field-label {
  flex: 1 1 8rem;
}

.carrier-field button {
  margin: 0;
  padding: 0.3rem 0.65rem;
  font-size: 0.85rem;
}

.carrier-not-set {
  color: var(--status-warn-text);
  font-size: 0.9rem;
}

.carrier-said {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--status-good-text);
}

.carrier-said.carrier-wrong {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
}

.carrier-change {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.6rem;
  border: 1px solid var(--hairline);
  border-radius: 6px;
}

.carrier-change label {
  font-weight: 700;
}

.carrier-change input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--background);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

/* A page's guide: a numbered card per clip. Each clip's box is held before
   it loads, so one below the fold never reads as on screen and loads early. */
.guide-clips {
  list-style: none;
  margin: 0;
  padding: 0;
}

.guide-clip {
  margin: 0 0 1.25rem;
}

/* Who a run of clips is for, above it. */
.guide-audience {
  margin: 1.5rem 0 0.75rem;
  font-size: 1rem;
  color: var(--primary-text);
}

.guide-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: var(--surface);
}

.guide-caption {
  margin-top: 0.75rem;
}

.guide-step {
  display: inline-block;
  min-width: 1.6rem;
  margin-right: 0.3rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.85rem;
  font-weight: 700;
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.feedback form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.feedback label {
  margin-top: 0.4rem;
  font-weight: 700;
}

.feedback input,
.feedback textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--background);
  color: var(--text);
  font: inherit;
}

.feedback-warning {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
  font-size: 0.9rem;
}

.feedback-said {
  margin: 0.4rem 0 0;
  color: var(--status-good-text);
}

.feedback-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Record Service's pop-up, in the Guide's shape over any page: Record's
   fields, closer together and left-aligned as Feedback's are. */
.visit-dialog .checkin-form label {
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
}

.visit-dialog .checkin-form input,
.visit-dialog .checkin-form select {
  text-align: left;
  text-align-last: auto;
}

.visit-who {
  margin: 0.5rem 0 0;
  font-weight: 700;
  text-align: center;
}

.visit-saved {
  margin: 0.25rem 0 0;
  color: var(--status-good-text);
  text-align: center;
}

/* Every page's trail back: earlier steps bold in the text colour, a light
   separator, and this page plain and quieter. */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0;
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text);
}
.crumbs a,
.crumbs a:visited {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}
.crumbs a:hover,
.crumbs a:focus-visible {
  text-decoration: underline;
}
.crumbs > span:not(.crumbs-sep):not(.crumbs-here) {
  font-weight: 700;
}
.crumbs-sep {
  padding: 0 0.45rem;
  color: var(--muted-text);
}
.crumbs-here {
  font-weight: 400;
  color: var(--muted-text);
}

/* A person's sign-in on the Staff Roster, for whoever may reset it. */
.sign-in-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.sign-in-chip {
  padding: 0.05rem 0.55rem;
  border: 1px solid var(--input-border);
  border-radius: 999px;
  background: var(--status-neutral-bg);
  color: var(--text);
  font-size: 0.8rem;
}
.sign-in-chip.warn {
  border-color: var(--status-warn-text);
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
}
.access-actions form {
  margin: 0;
}

/* ---- Partner Relations' manager side (#317) ---- */
/* The scorecards' heading on the Dashboard's Partner Relations tab, set off from the day's lists above it. */
.partner-heading {
  margin-top: 1.5rem;
}
/* Tools > Attrition: the Dashboard's tabs and cards at a wide table's width. */
.attrition-main {
  max-width: 1100px;
}
/* Admin > Gift Cards: wide enough that a bonus's referral and a dealership's name each keep to one line. */
main.gift-cards-main {
  max-width: 1180px;
}
@container (min-width: 60rem) {
  .gift-card-line { white-space: nowrap; }
}
/* Each kind's part sets its columns alike, so the parts line up down the page. */
.gift-cards-part th:nth-child(1) { width: 18%; }
.gift-cards-part th:nth-child(2) { width: 29%; }
.gift-cards-part th:nth-child(3) { width: 18%; }
.gift-cards-part th:nth-child(4),
.gift-cards-part th:nth-child(5) { width: 10%; }
/* Folded on a phone, a card's status keeps its pill's height beside the taller Edit and Remove. */
.gift-cards-part .dash-pill { align-self: flex-start; }
/* Tools > Analytics: its list of reports, and a report's headings that sort and counts that open. */
.analytics-reports {
  margin: 0;
  padding: 0;
  list-style: none;
}

.analytics-reports li + li {
  margin-top: 0.75rem;
}

.analytics-reports a {
  font-weight: 600;
  color: var(--primary-text);
}

/* A note in Dealership Notes keeps the lines it was written in. */
.dealership-note-text {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.analytics-sort {
  color: inherit;
  text-decoration: none;
}

/* A heading that sorts its table on the page (sortable_table.js): the heading as it reads, pressed from the keyboard too. */
.table-sort {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.table-sort:hover,
.table-sort:focus-visible {
  text-decoration: underline;
}

.analytics-sort.current,
.analytics-sort:hover,
.analytics-sort:focus-visible {
  text-decoration: underline;
}

.analytics-count {
  font-weight: 600;
  color: var(--primary-text);
}

.analytics-table tr.opened td,
.analytics-callers td {
  background: var(--surface);
}

.analytics-callers ul {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.25rem;
}

.analytics-callers .hr-count {
  margin-left: 0.5rem;
  font-weight: 600;
}

/* A count that isn't whole yet, the days a total is whole over, and what a part is. */
.analytics-mark {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted-text);
}

.analytics-note {
  color: var(--muted-text);
}

/* A calling-dealerships report's dealership, tagged with its own office:
   drawn as the Staff Roster's Home and Away pills are, green for this
   office, blue for the office whose list it is. */
.dealer-home-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}
.dealer-home-tag.here { background: var(--status-good-bg); color: var(--status-good-text); }
.dealer-home-tag.calling { background: var(--status-info-bg); color: var(--status-info-text); }

.calling-home-count {
  margin-left: 0.35rem;
  font-weight: 400;
  opacity: 0.75;
}

.attrition-find {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.attrition-find label {
  margin: 0;
}
.attrition-find input[type="search"],
.attrition-find select {
  flex: 1 1 12rem;
  width: auto;
  min-width: 0;
}
/* A dealership's figures from GEICO's reports, inside its own form. */
.dealership-report {
  margin-top: 0.75rem;
}
/* Territory Overviews (/dealer/overviews): an overview a row, its Open
   and Download at the row's end, or under it on a phone. */
.overview-route {
  font-weight: 600;
}
.overview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}
.overview-actions .link-button {
  margin: 0;
}
.overview-earlier {
  margin-top: 0.75rem;
}
/* All Referrals (/dealer/referrals): a group per rep, headed in their
   colour with black writing whatever the theme, as on the morning's PDF
   (each colour is refused under 4.5:1 against black); each referral a
   line with its facts under it, so nothing scrolls sideways. */
.ar-group {
  padding: 0;
  overflow: hidden;
}
.ar-group > summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem 0.75rem;
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  list-style: none;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.ar-group > summary::-webkit-details-marker {
  display: none;
}
.ar-group > summary.shaded {
  background: var(--rep-colour);
  color: var(--on-amber);
}
.ar-count {
  font-size: 0.9rem;
}
.ar-note {
  margin: 0.75rem 1.25rem 0;
}
.ar-lines {
  padding: 0 1.25rem 0.25rem;
}
.ar-lines .preferred .ar-where {
  font-weight: 700;
}
/* Edit's box, and its picks' warning, open under the line at its full width, so each reads on a phone. */
.ar-lines li:has(> .ar-edit-box),
.ar-lines li:has(> .ar-edit-warning) {
  flex-wrap: wrap;
}
.ar-lines .ar-edit-box,
.ar-lines .ar-edit-warning {
  flex: 1 1 100%;
}
/* The search: its label over the box and button, which wrap on a phone. */
.ar-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  margin: 0.75rem 0;
}
.ar-search label {
  flex-basis: 100%;
  font-weight: 600;
}
.ar-search input {
  flex: 1 1 14rem;
  min-width: 0;
}
.ar-found .ar-lines {
  padding: 0;
}
@media (max-width: 560px) {
  .overview-list li {
    flex-wrap: wrap;
  }
  /* Picked dates open on a row of their own under the chips, inside the screen. */
  .ar-ranges .dash-custom[open] {
    flex-basis: 100%;
    text-align: center;
  }
  .ar-ranges .dash-custom-form {
    position: static;
    transform: none;
    flex-wrap: wrap;
    margin-top: 0.4rem;
  }
  .ar-ranges .dash-custom-form input {
    flex: 1 1 8rem;
    min-width: 0;
  }
}
/* /referrals: the switches under the search, on one line where they
   fit, and each referral's Retention # with its Copy Retention Number and Continue Recording Sale. */
.referral-switches {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin: 0.25rem 0 0.5rem;
}
.referral-switches label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-weight: 500;
}
.referral-switches input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
}
.referral-quote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.6rem;
}
.referral-quote .link-button,
.referral-quote button {
  margin: 0;
}
/* The name box and the dealership box stacked, "and/or" between, so
   one Search the height of both reads as searching by either. */
.referral-search-boxes {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.referral-and-or {
  color: var(--muted-text);
  font-size: 0.85rem;
  text-align: center;
}
/* The dealer's rep under the dealership, not wrapped after it. */
.referral-contact {
  display: block;
}
/* Retention #, Copy and Continue on the columns of the line above, so
   Continue sits under the date and quote it carries on. */
@media (min-width: 560px) {
  .referral-quote {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr);
  }
  .referral-quote .copy-retention {
    grid-column: 2;
    justify-self: start;
  }
  .referral-quote .link-button {
    grid-column: 3;
    justify-self: start;
  }
}
@media (min-width: 760px) {
  .referral-quote {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---- Admin (/admin) ---- */
/* A pasted list reads from its left edge, in a centred box too. */
.selfservice-staff-box textarea {
  text-align: left;
}

/* A pick in a table's row fills its column, and the rest of its line once the table folds. */
.road-table select {
  width: 100%;
  min-width: 16rem;
  font-size: 1rem;
  text-align: left;
  text-align-last: auto;
}

/* Each line a preview leaves out, and why, under the rows it would have joined. */
.selfservice-staff-box .calls-problem {
  margin: 0.5rem 0 0;
}

/* A field's hint sits under it at the form's own gap, its buttons just under that. */
.selfservice-staff-box .question-hint {
  margin: 0;
}

.question-hint + .selfservice-buttons {
  margin-top: 0.5rem;
}

/* The filters over a list share its width, a line each on a phone. */
.referral-switches label:has(select) {
  flex: 1 1 12rem;
}

/* A line under a table cell's value says more of it, never as its heading. */
.road-table .call-about {
  font-weight: 400;
}

/* A person a row, a list's rows rather than a form's boxes; the pick sits
   level with its words, and Clear at the row's end. */
.selfservice-section .attendance-group .call-row {
  margin-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.attendance-group .call-actions label {
  margin: 0;
}

.attendance-group .call-actions :is(select, input) {
  flex: 0 1 16rem;
  min-width: 0;
}

.attendance-group .call-actions .btn-warn {
  margin-left: auto;
}

/* ---- Dropdowns ---- */
/* Chrome's customizable select, so an open list is the portal's own at
   its text size, where Chrome's own draws it at the box's 1.25rem.
   Safari and an older Edge keep theirs. A multiple or sized select is a
   list on the page, left native. */
@supports (appearance: base-select) {
  select:not([multiple], [size]),
  ::picker(select) {
    appearance: base-select;
  }

  /* The closed box as Chrome's own draws it: the value in regular
     weight on one line, centred top to bottom. */
  select:not([multiple], [size]) {
    position: relative;
    font-weight: normal;
    white-space: nowrap;
    cursor: default;
  }

  /* Chrome's own room inside every select's 1rem padding: 4px before the
     value, 12px for the arrow. Record's fixed Agent has no arrow
     (appearance: none), so keeps its plain box. */
  select:not([multiple], [size], :disabled) {
    padding-inline: calc(1rem + 4px) calc(1rem + 12px);
    line-height: normal;
    align-content: center;
    align-items: center;
  }

  /* Chrome's own chevron, where it drew it, in the text's colour. */
  select:not([multiple], [size])::picker-icon {
    content: "";
    position: absolute;
    inset-inline-end: 2px;
    top: 50%;
    width: 10px;
    height: 6px;
    translate: 0 -50%;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1.2 1.2 5 5l3.8-3.8' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  /* The field's width, scrolling past about eight rows; under the box
     wherever it fits, so it covers what comes after rather than before.
     A row reads from its left edge in a centred form too. */
  ::picker(select) {
    inline-size: anchor-size(self-inline);
    max-block-size: min(20rem, 50dvh);
    position-try-order: normal;
    overflow-y: auto;
    text-align: start;
    text-align-last: auto;
    margin-block: 2px;
    padding: 0.25rem 0;
    font-size: 1rem;
    line-height: 1.3;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  select:not([multiple], [size]) option {
    padding: 0.45rem 0.75rem;
    white-space: normal;
  }

  /* The tab strip's colours rather than a tick: the pick as the current
     tab, the row the keys are on or the pointer is over as a tab hovered,
     the keys' row giving way to the pick, which the list opens on. A
     blank pick is no pick. */
  select:not([multiple], [size]) option::checkmark {
    display: none;
  }

  select:not([multiple], [size]) option:focus-visible {
    background: var(--lime);
    color: var(--deep-navy);
  }

  select:not([multiple], [size]) option:checked:where(:not(:empty)) {
    background: var(--primary);
    color: var(--on-primary);
  }

  select:not([multiple], [size]) option:hover {
    background: var(--lime);
    color: var(--deep-navy);
  }
}

/* A text box's own list (type_ahead.js), the open select's above in
   every browser: the box's width, scrolling past about eight rows, under
   the box or over it where only that has room (--room, the script's).
   Fixed on the page, so a card or a table's scroll never clips it; over
   the banners and page controls (1050), under a sheet over the page (1100). */
.type-ahead-list {
  position: fixed;
  z-index: 1060;
  max-block-size: min(20rem, 50dvh, var(--room, 100dvh));
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: start;
  margin-block: 2px;
  padding: 0.25rem 0;
  font-size: 1rem;
  line-height: 1.3;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.type-ahead-list [role="option"] {
  padding: 0.45rem 0.75rem;
  overflow-wrap: anywhere;
  cursor: default;
}

/* The select's colours: the keys' row and the pointer's lime, the name
   in the box --primary, the keys' row giving way to it. */
.type-ahead-list [aria-selected="true"] {
  background: var(--lime);
  color: var(--deep-navy);
}

.type-ahead-list .picked {
  background: var(--primary);
  color: var(--on-primary);
}

.type-ahead-list [role="option"]:hover {
  background: var(--lime);
  color: var(--deep-navy);
}

/* The portal's log: a long line wraps rather than widening the page. */
.portal-log-line { display: block; }
.portal-log-line .relay-text { white-space: normal; overflow-wrap: anywhere; }
.portal-log-at { display: block; font-size: 0.85em; opacity: 0.75; }
.portal-log-line.is-serious .portal-log-at { font-weight: 700; opacity: 1; }
.checks-log-link { display: block; margin-top: 4px; }

/* This Computer: what the portal sees, a name and its answer a row. */
.computer-facts {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: 0.4rem 1rem;
  margin: 0;
}

.computer-facts dt {
  color: var(--muted-text);
}

.computer-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Self Service > Settings, laid out as Record: a list or table typed
   whole keeps its lines' own left edge and grows to them; a hint sits
   tight under its field; the grid's rows read from the left. */
/* A fieldset grows to its widest child unless told: the grid scrolls inside its box instead. */
#settings-form fieldset {
  min-width: 0;
}

/* Off, watch and on stay one row, as a phone has room for. */
#settings-form .settings-modes {
  flex-wrap: nowrap;
}

#settings-form .settings-modes .rep-pill {
  flex: 1 1 0;
  min-width: 0;
  max-width: 10rem;
}

#settings-form textarea {
  height: auto;
  line-height: 1.4;
  padding: 0.75rem 1rem;
  text-align: left;
}

#settings-form .ticket-detail {
  margin: 0.4rem 0 0;
}

/* Fields side by side keep their boxes level, a label that wraps taking the room above its own. */
#settings-form .field-row .field {
  display: flex;
  flex-direction: column;
}

#settings-form .field-row .field > label {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Every label wraps, never cut short, however narrow its field. */
#settings-form label {
  overflow-wrap: anywhere;
  white-space: normal;
}

/* A long line or list wraps in its box, centred as Record's fields are, and grows to it. */
#settings-form textarea.settings-wrap {
  min-height: 3.5rem;
  line-height: 1.5;
  padding: 0.85rem 1rem;
  text-align: center;
  resize: none;
  overflow: hidden;
}

/* The banner's ×, as it is over any page: never the form's own large button. */
#settings-form .settings-banner-preview .sale-banner-hide {
  margin: 0;
  padding: 0;
  font-size: 1.25rem;
}

/* The sale banner drawn in its card: its own rows, sitting in the page rather than floating over it. */
.settings-banner-preview .sale-banner {
  position: static;
  transform: none;
  width: auto;
  max-width: 100%;
  z-index: auto;
  margin-top: 0.75rem;
}

/* The grid of pages by departments: tight enough for every department to
   fit a laptop's box, the page names held at the left as it scrolls on a phone. */
.settings-grid th,
.settings-grid td {
  padding: 0.45rem 0.35rem;
}

.settings-grid thead th {
  font-size: 0.85rem;
}

.settings-grid abbr {
  text-decoration: none;
}

.settings-grid th[scope="row"] {
  min-width: 9rem;
  font-weight: 600;
  position: sticky;
  left: 0;
  background: var(--secondary-background);
}

#recent-changes .call-row p {
  margin: 0.25rem 0;
}

/* An announcement (shared/_training_banner.html): the training strip's
   own band across the top, in the colour its kind says, its one or two
   lines as typed; a notice the pop-up Feedback opens in. */
.announcement-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.announcement-banner-text {
  flex: 1;
  min-width: 0;
}

/* The ×, as the sale banner's; a gap as wide before the text keeps it centred. */
.announcement-banner:has(.announcement-hide)::before {
  content: "";
  flex: none;
  width: 2rem;
}

.announcement-hide {
  margin: 0;
}

.announcement-alert {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
}

.announcement-urgent {
  background: var(--status-bad-bg);
  color: var(--status-bad-text);
}

.announcement-celebration {
  background: var(--status-good-bg);
  color: var(--status-good-text);
}

/* An urgent notice: the pop-up in an urgent alert's red. */
.announcement-urgent-notice {
  background: var(--status-bad-bg);
  color: var(--status-bad-text);
  border-color: currentColor;
}

.announcement-urgent-notice .page-key-head h2,
.announcement-urgent-notice .page-key-close {
  color: inherit;
}

.announcement-text {
  white-space: pre-line;
  overflow-wrap: anywhere;
  font-size: 1.15rem;
}

/* Who sees an announcement: three to a row, Everyone across the bottom;
   on a phone, two to a row, packed so Administration fits. */
#announce-form .announce-who {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

#announce-form .announce-who .rep-pill {
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
}

#announce-form .announce-who [data-everyone] {
  grid-column: 1 / -1;
}

@media (max-width: 36rem) {
  #announce-form .announce-who {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  #announce-form .announce-who .rep-pill {
    padding-inline: 0.25rem;
    font-size: 0.9rem;
  }
}

#announce-form textarea.announce-text {
  height: auto;
  min-height: 5.5rem;
  line-height: 1.5;
  padding: 0.75rem 1rem;
}

/* Admin > Office Log: a view's search as a row of picks that wraps, one to a line on a phone. */
main.office-log-main {
  max-width: 1180px;
}

/* Its search's fieldset is the box, so its legend sits in the one border
   (Lead Sales' too). */
.box.office-log-search {
  border: 0;
  padding: 0;
}

.office-log-search > fieldset {
  min-width: 0;
  margin: 0;
  padding: 0 1rem 1rem;
  border: 1px solid var(--primary-text);
  border-radius: 4px;
}

.office-log-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.office-log-filters .field {
  flex: 1 1 11rem;
  min-width: 0;
}

.office-log-filters .field[hidden] {
  display: none;
}

.office-log-filters :is(select, input) {
  width: 100%;
}

.office-log-since {
  margin: 0 0 0.6rem;
}

/* A test entry removed reads apart from the lines that count, its Put Back beside it. */
.office-log-lines tr.office-log-removed > td:not(.office-log-actions) {
  color: var(--muted-text);
  text-decoration: line-through;
}

.office-log-lines td.office-log-actions {
  white-space: nowrap;
}

@container (max-width: 36rem) {
  .office-log-lines td.office-log-actions {
    white-space: normal;
  }
}

.office-log-lines tr.office-log-box-row > td {
  padding: 0.4rem 0 0.8rem;
}

.office-log-older .btn-secondary {
  margin-left: 0.4rem;
}

/* The Dealership Overview: a frequency picked and saved on its own row, and the next visit's due label. */
.visit-frequency-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.visit-due {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.visit-due-overdue {
  background: var(--status-bad-bg);
  color: var(--status-bad-text);
}

.visit-due-due {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
}

/* On a phone each dealership is its own block, every field labelled, so Next Visit is never scrolled out of sight. */
@media (max-width: 600px) {
  .visit-frequency-table thead {
    display: none;
  }

  .visit-frequency-table tr {
    display: block;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--row-rule);
  }

  .visit-frequency-table td {
    display: block;
    border-bottom: 0;
    padding: 0.15rem 0.25rem;
  }

  .visit-frequency-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-text);
  }

  .visit-frequency-name {
    font-weight: 700;
  }
}

/* The Overview's gear, beside Edit Targets and My Policies. */
.dash-gear {
  vertical-align: middle;
  line-height: 0;
}

.dash-gear svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

/* My Dashboard: a view is a block to start from, its tiles named under it. */
.dash-prefs form {
  text-align: left;
}

.dash-pref-views {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

.dash-pref-view {
  display: grid;
  gap: 0.25rem;
  justify-items: start;
  border: 1px solid var(--primary-text);
  border-radius: 4px;
  padding: 0.75rem 1rem;
}

.dash-pref-view.current {
  border-width: 2px;
}

.dash-pref-view .dash-note {
  text-align: left;
}

.dash-pref-view button {
  margin: 0.5rem 0 0;
}

.dash-pref-name,
.dash-pref-using {
  font-weight: 700;
  color: var(--primary-text);
}

.dash-pref-using {
  margin-top: 0.5rem;
}

.dash-pref-tiles {
  font-size: 0.9rem;
}

.dash-pref-reset {
  text-align: center;
  margin-top: 1.5rem;
}

/* My Layout: each section of the Overview a block that moves whole, its tiles moving inside it. */
.dash-order-sections {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.dash-order-section {
  border: 1px solid var(--primary-text);
  border-radius: 4px;
  padding: 0.75rem 1rem 1rem;
}

/* The section's own arrows sit apart at its left, its remove at its right, clear of its tiles'. */
.dash-order-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dash-order-moves {
  display: inline-flex;
  gap: 0.25rem;
}

.dash-order-title {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-text);
}

/* Four across, as the Overview draws a row. */
.dash-order-tiles {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.dash-order-tiles li {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.25rem;
  min-height: 3.25rem;
  border: 1px solid var(--primary-text);
  border-radius: 4px;
  padding: 0.35rem;
  text-align: center;
}

.dash-order-move {
  min-width: 2.25rem;
  margin: 0;
  padding: 0.2rem 0.45rem;
}

.dash-order-remove {
  color: var(--alert-red);
  border-color: var(--alert-red);
}

/* The next slot in the row: a dashed tile that is the picker itself. */
.dash-order-tiles .dash-order-slot {
  display: block;
  padding: 0;
  border-style: dashed;
}

.dash-order-add {
  width: 100%;
  height: 100%;
  min-height: 3.25rem;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--primary-text);
  font-weight: 700;
  text-align: center;
  text-align-last: center;
  cursor: pointer;
}

.dash-order-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.dash-order-foot button {
  margin: 0;
}

/* An end block has nowhere further to go that way. */
.dash-order-sections > :first-child > .dash-order-head [data-move="up"],
.dash-order-sections > :last-child > .dash-order-head [data-move="down"],
.dash-order-tiles > :first-child > [data-move="up"],
.dash-order-tiles > :nth-last-child(2) > [data-move="down"] {
  visibility: hidden;
}

@media (max-width: 900px) {
  .dash-order-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* What a new section starts as, asked under + Add a Section. */
.dash-order-choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.dash-order-choices[hidden] {
  display: none;
}

.dash-order-choices-ask {
  font-weight: 700;
}

.dash-order-choices-count {
  font-weight: 400;
  opacity: 0.75;
}

/* A tile that is in more than one section, marked on each of its blocks. */
.dash-order-also {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-text);
}

.dash-order-also[hidden] {
  display: none;
}

.dash-order-tiles .dash-order-repeat {
  border-style: double;
  border-width: 3px;
}

/* What a block is dragged by: a tile's name, a section's grip. */
.dash-order-grip {
  cursor: grab;
  user-select: none;
}

.dash-order-handle {
  display: inline-flex;
  align-items: center;
  padding: 0 0.35rem;
  font-size: 1.25rem;
  color: var(--primary-text);
}

/* Where the dragged block will land, shown in its place among the others. */
.dash-order-dragging {
  opacity: 0.35;
  border-style: dashed;
}

/* The Overview arranged in place (dashboard_edit.js). A held tile sinks a little while the hold counts. */
[data-overview-edit] .dash-tile {
  -webkit-touch-callout: none;
}

.dash-edit-holding {
  transform: scale(0.94);
  transition: transform 1.4s ease-in;
}

/* Arranging: every tile is a block to drag, and says so by moving. */
.dash-editing [data-overview-edit] .dash-tile {
  touch-action: none;
  user-select: none;
  cursor: grab;
  animation: dash-edit-sway 1.1s ease-in-out infinite alternate;
}

/* Neighbours sway out of step, so the row breathes and doesn't rock as one. */
.dash-editing [data-overview-edit] .dash-tile:nth-child(3n + 2) {
  animation-duration: 1.3s;
  animation-delay: -0.4s;
}

.dash-editing [data-overview-edit] .dash-tile:nth-child(3n) {
  animation-duration: 1.2s;
  animation-delay: -0.8s;
}

@keyframes dash-edit-sway {
  from { transform: translateY(-1.5px) rotate(-0.45deg); }
  to { transform: translateY(1.5px) rotate(0.45deg); }
}

@media (prefers-reduced-motion: reduce) {
  .dash-editing [data-overview-edit] .dash-tile {
    animation: none;
  }
}

.dash-editing main {
  padding-bottom: 7rem;
}

/* A section keeps the page's own shape, its heading centred over its rows, on a soft panel that sets it apart
   from the next. The panel is painted around it and takes no room, so the tiles stay where the page has them. */
.dash-edit-section {
  --panel: color-mix(in srgb, var(--primary-text) 7%, transparent);
  margin-bottom: 1.9rem;
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 0 0 0.6rem var(--panel);
  outline: 2px solid transparent;
  outline-offset: 0.6rem;
}

/* The one being dragged is the one outlined. */
.dash-edit-section.dash-edit-moving,
.dash-edit-section.dash-edit-ghost {
  outline-color: var(--primary-text);
}

.dash-edit-head {
  display: grid;
  grid-template-columns: 2rem 1fr 2rem;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 0.4rem;
}

.dash-edit-head .dash-order-title {
  margin: 0;
  padding: 0.1rem 0.4rem;
  border-color: transparent;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  color: var(--muted-text);
}

.dash-edit-head .dash-order-title:hover,
.dash-edit-head .dash-order-title:focus {
  border-color: var(--primary-text);
  background: var(--surface);
}

.dash-edit-head .dash-order-remove {
  min-width: 0;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border-radius: 50%;
  line-height: 1;
}

.dash-edit-grip {
  font-size: 1.2rem;
  text-align: center;
  color: var(--primary-text);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

/* The rows the Overview draws: each tile as wide as its row's share (--span of 12, dashboard_edit.js). */
@media (min-width: 561px) {
  .dash-tiles.dash-edit-tiles {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .dash-edit-tiles > .dash-tile {
    grid-column: span var(--span, 3);
  }
}

/* A tile's X sits on its corner, clear of its figure. */
.dash-edit-off {
  position: absolute;
  top: -0.6rem;
  left: -0.6rem;
  z-index: 2;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0;
  padding: 0;
  border: 2px solid var(--alert-red);
  border-radius: 50%;
  background: var(--surface);
  color: var(--alert-red);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

/* Under the rows, not in them, so adding a tile is offered without changing their shape. */
.dash-edit-slot {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
}

.dash-edit-add {
  width: auto;
  margin: 0;
  padding: 0.2rem 0.75rem;
  border: 0;
  background: transparent;
  color: var(--primary-text);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.dash-edit-add:hover,
.dash-edit-add:focus-visible {
  text-decoration: underline;
}

/* The tiles to add: a search box over every tile as a button, under its group's name. */
.dash-edit-picker {
  margin-top: 0.6rem;
  padding: 0.9rem 1rem 1rem;
  border-radius: 6px;
  background: var(--surface);
  text-align: left;
}

.dash-edit-picker-top {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.dash-edit-picker-top .dash-edit-find {
  flex: 1;
  margin: 0;
}

.dash-edit-picker-top button {
  width: auto;
  margin: 0;
}

.dash-edit-picker-group {
  margin-top: 0.75rem;
}

.dash-edit-picker-group[hidden] {
  display: none;
}

.dash-edit-picker-name {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-text);
}

.dash-edit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dash-edit-chip {
  width: auto;
  margin: 0;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--primary-text);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary-text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.dash-edit-chip[hidden] {
  display: none;
}

.dash-edit-chip:hover:not(:disabled),
.dash-edit-chip:focus-visible {
  background: var(--primary-text);
  color: var(--surface);
}

/* Already in the section. */
.dash-edit-chip:disabled {
  border-style: dashed;
  opacity: 0.45;
  cursor: default;
}

.dash-edit-chip-count {
  margin-left: 0.4rem;
  font-weight: 400;
  opacity: 0.75;
}

/* Add a Section, under the last one. */
.dash-edit-more {
  margin: 0.5rem 0 1rem;
  text-align: center;
}

.dash-edit-more > button {
  width: auto;
  margin: 0;
}

.dash-edit-more-choices {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem 1rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary-text) 7%, transparent);
  text-align: left;
}

.dash-edit-more-choices[hidden] {
  display: none;
}

.dash-edit-new {
  border-style: dashed;
}

/* Where the dragged block will land, and the copy of it under the pointer. */
.dash-edit-moving {
  opacity: 0.3;
}

.dash-edit-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  margin: 0;
  pointer-events: none;
  opacity: 0.92;
  animation: none;
}

.dash-edit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-top: 2px solid var(--primary-text);
}

.dash-edit-bar button,
.dash-edit-bar select {
  width: auto;
  margin: 0;
}

.dash-edit-bar-says {
  font-weight: 700;
}

/* A section that already holds the dragged tile, and the copy under the pointer saying so. */
.dash-edit-section.dash-edit-refuses {
  outline-color: var(--alert-red);
}

.dash-edit-refused {
  border-color: var(--alert-red);
}

.dash-edit-refused::after {
  content: "Already in this section";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--alert-red);
}

/* A block taken off shrinks away; a tile added pops into its place. */
.dash-editing [data-overview-edit] .dash-tile.dash-edit-leaving,
.dash-edit-section.dash-edit-leaving {
  animation: dash-edit-leave 0.22s ease-in forwards;
  pointer-events: none;
}

.dash-editing [data-overview-edit] .dash-tile.dash-edit-arriving {
  animation: dash-edit-arrive 0.3s ease-out;
}

@keyframes dash-edit-leave {
  to { transform: scale(0.6); opacity: 0; }
}

@keyframes dash-edit-arrive {
  from { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.04); opacity: 1; }
  to { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .dash-editing [data-overview-edit] .dash-tile.dash-edit-leaving,
  .dash-edit-section.dash-edit-leaving,
  .dash-editing [data-overview-edit] .dash-tile.dash-edit-arriving {
    animation-duration: 0.01s;
  }
}

/* Undo and Redo, greyed while there is no step that way. */
.dash-edit-step:disabled {
  opacity: 0.4;
  cursor: default;
}
