/*
 * Topside design system (r379). Loaded on every page (config/settings.py UNFOLD["STYLES"]).
 *
 * One set of rules for the whole app: colors, type, spacing, corners, shadows, and the shared pieces (buttons, cards, section tabs, the
 * summary strip, tags and the Needs attention list). New and reworked pages use the --ds-* tokens and the .ds-* classes here instead of
 * defining their own. The job page (.jo), customer page (.cp) and dashboard (.db) already do; other pages move over in batches.
 *
 * Colors build on the app's own palettes: the cool neutral grays (Unfold's base palette; warm in r378, cool since v2, r385) and the company's
 * brand color (core/branding.py), whose deep shade is used for main buttons, links and focus. Red is kept for blockers and always comes with a word.
 *
 * Topside 2.0 (r385, the approved mockups): crisp white cards on a cool light-gray page, softer and larger corners, tighter headings, and a
 * dark graphite sidebar (the --ds-rail-* tokens) in both light and dark mode.
 */

/* ---- tokens ------------------------------------------------------------------------------------------------------------------ */
:root {
  /* color */
  --ds-page: var(--color-base-50, #f5f6f8);
  --ds-surface: #ffffff;
  --ds-surface-2: var(--color-base-100, #f4f1ec);
  --ds-line: var(--color-base-200, #e7e2da);
  --ds-line-strong: var(--color-base-300, #d9d2c6);
  --ds-text: var(--color-base-900, #1c1917);
  --ds-muted: var(--color-base-500, #6b6359);
  --ds-primary: var(--color-primary-700, #1d4ed8);
  --ds-primary-hover: var(--color-primary-800, #1e3a8a);
  --ds-link: var(--color-primary-700, #1d4ed8);
  --ds-tint: color-mix(in srgb, var(--color-primary-700, #1d4ed8) 9%, transparent);
  --ds-good: #047857;
  --ds-warn: #92400e;  --ds-warn-bg: #fdf3dc;
  --ds-bad: #b91c1c;   --ds-bad-bg: #fdecea;
  --ds-focus: var(--color-primary-700, #1d4ed8);
  --ds-shadow: 0 1px 2px rgba(16, 20, 28, .04);
  --ds-shadow-lift: 0 1px 2px rgba(16, 20, 28, .06), 0 8px 24px rgba(16, 20, 28, .08);

  /* v2 (r385): the dark graphite sidebar, the same in both themes */
  --ds-rail: #0c111b;
  --ds-rail-raised: #151c2a;
  --ds-rail-line: #1e2533;
  --ds-rail-active: #1b2232;
  --ds-rail-text: #c9ced8;
  --ds-rail-muted: #8a93a6;
  --ds-rail-strong: #ffffff;

  /* type: one family (Inter, bundled with the app), four sizes in everyday use, two weights for emphasis */
  --ds-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ds-fs-xs: .75rem;      /* 12px  labels, tags, captions */
  --ds-fs-sm: .8125rem;    /* 13px  secondary text */
  --ds-fs-base: .875rem;   /* 14px  body (the app's base) */
  --ds-fs-md: 1rem;        /* 16px  row titles, emphasis */
  --ds-fs-lg: 1.25rem;     /* 20px  card titles */
  --ds-fs-xl: 2rem;        /* 32px  page titles */
  --ds-lh: 1.5;
  --ds-lh-tight: 1.15;
  --ds-w-medium: 500;
  --ds-w-strong: 600;
  --ds-w-title: 650;

  /* space: a 4px grid */
  --ds-1: 4px; --ds-2: 8px; --ds-3: 12px; --ds-4: 16px; --ds-5: 20px; --ds-6: 24px; --ds-8: 32px; --ds-12: 48px;

  /* corners */
  --ds-r-sm: 6px; --ds-r: 10px; --ds-r-lg: 14px; --ds-r-pill: 999px;
}
.dark {
  --ds-page: var(--color-base-950, #0b0f17);
  --ds-surface: var(--color-base-900, #141a25);
  --ds-surface-2: var(--color-base-800, #1d2431);
  --ds-line: rgba(255, 255, 255, .08);
  --ds-line-strong: rgba(255, 255, 255, .16);
  --ds-text: var(--color-base-100, #f5f5f4);
  --ds-muted: var(--color-base-400, #a8a29e);
  --ds-primary: var(--color-primary-600, #2563eb);
  --ds-primary-hover: var(--color-primary-700, #1d4ed8);
  --ds-link: var(--color-primary-300, #93c5fd);
  --ds-tint: color-mix(in srgb, var(--color-primary-400, #60a5fa) 16%, transparent);
  --ds-good: #6ee7b7;
  --ds-warn: #fcd34d;  --ds-warn-bg: rgba(252, 211, 77, .10);
  --ds-bad: #fca5a5;   --ds-bad-bg: rgba(248, 113, 113, .12);
  --ds-focus: #fbbf24;
  --ds-shadow: none;
  --ds-shadow-lift: 0 8px 24px rgba(0, 0, 0, .45);
  --ds-rail: #080b12;
  --ds-rail-raised: #111723;
  --ds-rail-active: #182030;
}

/* ---- typography, everywhere ----------------------------------------------------------------------------------------------------- */
/* Inter's own alternates: a single-storey a and open digits read softer and more refined than the defaults, at no cost in legibility. */
body { font-feature-settings: "cv11", "ss01", "calt"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, h3, .ds-title { font-feature-settings: "cv11", "ss01", "calt", "kern"; letter-spacing: -.015em; }
/* numbers that line up: money, counts and every table cell */
.ds-num, td, th, .tabular-nums, input[type="number"] { font-variant-numeric: tabular-nums; }

.ds-title { margin: 0; font-size: var(--ds-fs-xl); line-height: var(--ds-lh-tight); font-weight: var(--ds-w-title); letter-spacing: -.02em; color: var(--ds-text); overflow-wrap: anywhere; }
.ds-subtitle { margin: var(--ds-2) 0 0; font-size: var(--ds-fs-base); color: var(--ds-muted); }
.ds-label { font-size: var(--ds-fs-xs); font-weight: var(--ds-w-strong); text-transform: uppercase; letter-spacing: .08em; color: var(--ds-muted); }
.ds-muted { color: var(--ds-muted); }
@media (max-width: 600px) { .ds-title { font-size: 1.6rem; } }

/* ---- the shared pieces --------------------------------------------------------------------------------------------------------- */
/* Each rule names the .ds-* class (for any page) and the same piece on the three pages built first (job .jo, customer .cp, dashboard .db). */

/* cards */
.ds-card, .jo .jo-card, .cp .cp-card, .db .db-card, .db .db-tile {
  border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); background: var(--ds-surface); box-shadow: var(--ds-shadow); }
.ds-card { padding: var(--ds-4) var(--ds-5); }

/* buttons: quiet by default; the main one in the brand color's deep shade */
.ds-btn, .jo .jo-btn, .cp .cp-btn, .db .db-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ds-2); min-height: 40px; padding: var(--ds-2) var(--ds-4);
  border-radius: var(--ds-r); border: 1px solid var(--ds-line-strong); background: var(--ds-surface); color: var(--ds-text) !important;
  font: inherit; font-size: var(--ds-fs-base); font-weight: var(--ds-w-strong); text-decoration: none !important; cursor: pointer; box-shadow: var(--ds-shadow);
  transition: background-color .15s, border-color .15s, color .15s; }
.ds-btn:hover, .jo .jo-btn:hover, .cp .cp-btn:hover, .db .db-btn:hover { border-color: var(--ds-muted); background: var(--ds-surface); }
.ds-btn.primary, .jo .jo-btn.primary, .cp .cp-btn.primary, .db .db-btn.primary { background: var(--ds-primary); border-color: var(--ds-primary); color: #fff !important; }
.ds-btn.primary:hover, .jo .jo-btn.primary:hover, .cp .cp-btn.primary:hover, .db .db-btn.primary:hover { background: var(--ds-primary-hover); border-color: var(--ds-primary-hover); }

/* focus you can see, in both themes */
.ds-page :focus-visible, .jo :focus-visible, .cp :focus-visible, .db :focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; border-radius: var(--ds-r-sm); }

/* the summary strip under a title */
.ds-sum, .jo-sum, .cp-sum, .db-sum { border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); background: var(--ds-surface); padding: 14px var(--ds-5) var(--ds-4); margin-bottom: var(--ds-2); box-shadow: var(--ds-shadow); }
.ds-sum h2, .jo-sum h2, .cp-sum h2, .db-sum h2 { margin: 0 0 var(--ds-3); font-size: var(--ds-fs-xs); font-weight: var(--ds-w-strong); text-transform: uppercase; letter-spacing: .08em; color: var(--ds-muted); }
.ds-sum-grid, .jo-sum-grid, .cp-sum-grid, .db-sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 28px; margin: 0; }
.ds-sum-grid > div, .jo-sum-grid > div, .cp-sum-grid > div, .db-sum-grid > div { min-width: 0; border: 0; padding: 0; }
.ds-sum-grid dt, .jo-sum-grid dt, .cp-sum-grid dt, .db-sum-grid dt { color: var(--ds-muted); font-size: var(--ds-fs-sm); font-weight: var(--ds-w-medium); margin-bottom: 2px; }
.ds-sum-grid dd, .jo-sum-grid dd, .cp-sum-grid dd, .db-sum-grid dd { margin: 0; overflow-wrap: anywhere; line-height: var(--ds-lh); font-size: var(--ds-fs-base); }

/* small status flags */
.ds-flag, .jo-flag, .cp-flag, .db-flag { display: inline-block; font-weight: var(--ds-w-strong); font-size: var(--ds-fs-sm); padding: 1px var(--ds-2); border-radius: var(--ds-r-sm); border: 0; background: var(--ds-surface-2); color: var(--ds-muted); }
.ds-flag.warn, .jo-flag.warn, .cp-flag.warn, .db-flag.warn { color: var(--ds-warn); background: var(--ds-warn-bg); }
.ds-flag.bad, .jo-flag.bad, .cp-flag.bad, .db-flag.bad { color: var(--ds-bad); background: var(--ds-bad-bg); }

/* section tabs: an underline on the page that follows the theme */
.ds-tabs, .jo-tabs, .cp-tabs, .db-tabs { display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; margin: var(--ds-1) 0 18px; padding: 0; border-radius: 0; background: transparent;
  border-bottom: 1px solid var(--ds-line); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ds-tabs::-webkit-scrollbar, .jo-tabs::-webkit-scrollbar, .cp-tabs::-webkit-scrollbar, .db-tabs::-webkit-scrollbar { display: none; }
.ds-tabs a, .jo .jo-tabs a, .cp .cp-tabs a, .db .db-tabs a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: var(--ds-2) var(--ds-3); margin-bottom: -1px;
  border-radius: 0; color: var(--ds-muted); font-weight: var(--ds-w-medium); font-size: var(--ds-fs-base); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; background: transparent; }
.ds-tabs a small, .jo .jo-tabs a small, .cp .cp-tabs a small, .db .db-tabs a small { color: inherit; opacity: .75; font-weight: var(--ds-w-medium); font-variant-numeric: tabular-nums; }
.ds-tabs a:hover, .jo .jo-tabs a:hover, .cp .cp-tabs a:hover, .db .db-tabs a:hover { color: var(--ds-text); background: transparent; text-decoration: none; }
.ds-tabs a.on, .jo .jo-tabs a.on, .cp .cp-tabs a.on, .db .db-tabs a.on { color: var(--ds-text); font-weight: var(--ds-w-strong); border-bottom-color: var(--ds-primary); background: transparent; }
.ds-tabs a:focus-visible, .jo .jo-tabs a:focus-visible, .cp .cp-tabs a:focus-visible, .db .db-tabs a:focus-visible { outline-offset: -2px; }

/* Needs attention: hairline rows, a small colored dot with the word, one button each */
.ds-count, .jo-count, .cp-count, .db-count { display: inline-block; min-width: 1.6em; padding: 0 6px; border-radius: var(--ds-r-sm); background: var(--ds-bad-bg); color: var(--ds-bad); text-align: center; letter-spacing: 0; margin-left: 6px; font-weight: var(--ds-w-title); }
.ds-att-list, .jo-att-list, .cp-att-list, .db-att-list { list-style: none; margin: 0; padding: 0; }
.ds-att-item, .jo-att-item, .cp-att-item, .db-att-item { display: flex; flex-wrap: wrap; gap: 6px var(--ds-4); align-items: center; justify-content: space-between; padding: 14px 0;
  border-top: 1px solid var(--ds-line); border-left: 0; margin-left: 0; }
.ds-att-item:first-child, .jo-att-item:first-child, .cp-att-item:first-child, .db-att-item:first-child { border-top: 0; padding-top: 6px; }
.ds-att-text, .jo-att-text, .cp-att-text, .db-att-text { flex: 1 1 260px; min-width: 0; }
.ds-att-label, .jo-att-label, .cp-att-label, .db-att-label { margin: 0; font-size: .98rem; line-height: 1.45; }
.ds-att-label b, .jo-att-label b, .cp-att-label b, .db-att-label b { font-weight: var(--ds-w-strong); }
.ds-att-meta, .jo-att-meta, .cp-att-meta, .db-att-meta { color: var(--ds-muted); font-weight: var(--ds-w-medium); }
.ds-att-ctx, .jo-att-ctx, .cp-att-ctx, .db-att-ctx { margin: 3px 0 0; color: var(--ds-muted); font-size: .9rem; line-height: var(--ds-lh); }
.ds-att-links, .jo-att-links, .cp-att-links, .db-att-links { list-style: none; margin: 3px 0 0; padding: 0; font-size: .9rem; }
.ds-tag, .jo-tag, .cp-tag, .db-tag { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; padding: 0; border: 0 !important; background: none !important;
  font-size: .7rem; font-weight: var(--ds-w-title); text-transform: uppercase; letter-spacing: .07em; vertical-align: 1px; }
.ds-tag::before, .jo-tag::before, .cp-tag::before, .db-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ds-tag.bad, .jo-tag.bad, .cp-tag.bad, .db-tag.bad { color: var(--ds-bad); }
.ds-tag.warn, .jo-tag.warn, .cp-tag.warn, .db-tag.warn { color: var(--ds-warn); }
.ds-allclear, .jo-allclear, .cp-allclear, .db-allclear { margin: 0; color: var(--ds-good); font-weight: var(--ds-w-strong); }

@media (max-width: 600px) {
  .ds-sum, .jo-sum, .cp-sum, .db-sum { padding: var(--ds-3) 14px; }
}
@media (prefers-reduced-motion: reduce) { .ds-btn, .jo .jo-btn, .cp .cp-btn, .db .db-btn { transition: none; } }

/* ---- the sidebar (r380; dark graphite rail since v2, r385) ---------------------------------------------------------------------- */
/* A dark rail in both themes: quiet small-caps group names, thin icons, the current page as a lighter graphite row in white, and Create new
   in the brand color. The markup is Unfold's unfold/helpers/navigation.html plus templates/unfold/helpers/app_list.html and search.html;
   the ids win over Unfold's utility classes, so nothing there has to change. Colors are the --ds-rail-* tokens (contrast checked: the
   everyday text #c9ced8 on #0c111b is about 12:1, the muted #8a93a6 about 6:1). */
#nav-sidebar-inner, .dark #nav-sidebar-inner { background: var(--ds-rail); color: var(--ds-rail-text); border-right: 0; }
#nav-sidebar-inner > div:first-child { border-bottom-color: var(--ds-rail-line); }                              /* the logo row */
#nav-sidebar-inner > div:first-child, #nav-sidebar-inner > div:first-child * { color: var(--ds-rail-strong); }
#nav-sidebar-inner > div:first-child > div:hover { background: rgba(255, 255, 255, .05); }
#nav-sidebar-inner [role="button"] > div {                                                                         /* the search box */
  background: var(--ds-rail-raised); border-color: var(--ds-rail-line); box-shadow: none; }
#nav-sidebar-inner [role="button"] > div, #nav-sidebar-inner [role="button"] > div * { color: var(--ds-rail-muted); background-color: transparent; }
#nav-sidebar-inner [role="button"] > div { background-color: var(--ds-rail-raised); }
#nav-sidebar-inner [role="button"]:hover > div { border-color: #2c3547; }
#nav-sidebar-inner [role="button"]:focus-visible { outline: 2px solid var(--ds-rail-strong); outline-offset: 2px; border-radius: var(--ds-r); }

#nav-sidebar-apps { padding-bottom: var(--ds-4); scrollbar-color: #2c3547 transparent; }
#nav-sidebar-apps > div { margin-bottom: var(--ds-1); }
#nav-sidebar-apps h2, .dark #nav-sidebar-apps h2 {
  margin: var(--ds-3) var(--ds-3) 2px; padding: var(--ds-1) var(--ds-3); font-size: .7rem; font-weight: var(--ds-w-strong); text-transform: uppercase; letter-spacing: .09em;
  color: var(--ds-rail-muted); border-radius: var(--ds-r-sm); }
#nav-sidebar-apps h2:hover, .dark #nav-sidebar-apps h2:hover { color: var(--ds-rail-strong); }
#nav-sidebar-apps h2 .material-symbols-outlined { font-size: 16px; color: var(--ds-rail-muted) !important; font-variation-settings: 'wght' 300, 'opsz' 20; }
#nav-sidebar-apps hr, .dark #nav-sidebar-apps hr { border-color: var(--ds-rail-line); margin: var(--ds-2) var(--ds-6); }
#nav-sidebar-apps ol { padding-left: var(--ds-3); padding-right: var(--ds-3); gap: 1px; }
#nav-sidebar-apps ol a, .dark #nav-sidebar-apps ol a {
  height: 36px; margin: 0; padding: 0 var(--ds-3); border-radius: var(--ds-r); font-size: var(--ds-fs-base); font-weight: var(--ds-w-medium);
  color: var(--ds-rail-text); background: transparent; transition: background-color .12s, color .12s; }
#nav-sidebar-apps ol a .material-symbols-outlined {
  font-size: 18px; color: var(--ds-rail-muted); font-variation-settings: 'wght' 300, 'opsz' 20, 'FILL' 0; transition: color .12s; }
#nav-sidebar-apps ol a:hover, .dark #nav-sidebar-apps ol a:hover { background: rgba(255, 255, 255, .05); color: var(--ds-rail-strong); }
#nav-sidebar-apps ol a:hover .material-symbols-outlined { color: var(--ds-rail-strong); }
#nav-sidebar-apps ol a.active, .dark #nav-sidebar-apps ol a.active { background: var(--ds-rail-active); color: var(--ds-rail-strong); font-weight: var(--ds-w-strong); }
#nav-sidebar-apps ol a.active .material-symbols-outlined, .dark #nav-sidebar-apps ol a.active .material-symbols-outlined {
  color: var(--ds-rail-strong); font-variation-settings: 'wght' 400, 'opsz' 20, 'FILL' 0; }
#nav-sidebar-apps a:focus-visible, #create-new button:focus-visible, #create-new a:focus-visible { outline: 2px solid var(--ds-rail-strong); outline-offset: -2px; }
/* the signed-in person at the foot of the rail */
#nav-sidebar-inner > :last-child { border-color: var(--ds-rail-line); }
#nav-sidebar-inner > :last-child, #nav-sidebar-inner > :last-child * { color: var(--ds-rail-text); }

#create-new { margin: var(--ds-1) var(--ds-3) var(--ds-2); }
#create-new > button {
  height: 40px; padding: 0 var(--ds-3); border-radius: var(--ds-r); border: 0; background: var(--ds-primary); color: #fff;
  font-size: var(--ds-fs-base); font-weight: var(--ds-w-strong); box-shadow: none; transition: background-color .12s; }
#create-new > button:hover { background: var(--ds-primary-hover); }
#create-new > button .material-symbols-outlined { color: #fff; font-variation-settings: 'wght' 500, 'opsz' 20; }
#create-new ul, .dark #create-new ul { margin-top: var(--ds-1); padding: var(--ds-1); border: 1px solid var(--ds-rail-line); border-radius: var(--ds-r); background: var(--ds-rail-raised); box-shadow: var(--ds-shadow-lift); }
#create-new ul a { height: 36px; padding: 0 var(--ds-2); border-radius: var(--ds-r-sm); font-weight: var(--ds-w-medium); color: var(--ds-rail-text); }
#create-new ul a:hover { background: rgba(255, 255, 255, .06); color: var(--ds-rail-strong); }
#create-new ul a .material-symbols-outlined { color: var(--ds-rail-muted); font-variation-settings: 'wght' 300, 'opsz' 20; }
@media (prefers-reduced-motion: reduce) { #nav-sidebar-apps ol a, #nav-sidebar-apps ol a .material-symbols-outlined, #create-new > button { transition: none; } }

/* ---- record lists (r381) ------------------------------------------------------------------------------------------------------- */
/* Unfold's list pages (#changelist, table.result-list): a warm card with hairline rows, quiet small-caps column names, a soft hover on
   the row under the pointer, and the search box and filter button as quiet fields. Nothing about which columns show or how they sort. */
#changelist div:has(> table.result-list) { background: var(--ds-surface); border-color: var(--ds-line); border-radius: var(--ds-r-lg); box-shadow: var(--ds-shadow); }
table.result-list thead th {
  padding-top: 11px; padding-bottom: 11px; font-size: var(--ds-fs-xs); font-weight: var(--ds-w-strong); text-transform: uppercase; letter-spacing: .06em;
  color: var(--ds-muted); background: var(--ds-surface-2); white-space: nowrap; }
table.result-list thead th a { color: inherit; }
table.result-list thead th a:hover { color: var(--ds-text); }
table.result-list tbody td { border-top-color: var(--ds-line) !important; padding-top: 9px; padding-bottom: 9px; vertical-align: middle; color: var(--ds-text); white-space: nowrap; }
/* one line per row: even rows are easier to scan; a wide table scrolls sideways inside its card (it already did for the widest ones) */
table.result-list tbody tr { transition: background-color .1s; }
table.result-list tbody tr:hover > td { background: color-mix(in srgb, var(--ds-surface-2) 70%, transparent); }
table.result-list tbody tr.selected > td { background: var(--ds-tint); }
table.result-list td a, table.result-list th a { font-weight: var(--ds-w-medium); }
table.result-list tbody th a { color: var(--ds-link); }
#changelist div:has(> #searchbar) { background: var(--ds-surface); border-color: var(--ds-line-strong); border-radius: var(--ds-r); box-shadow: none; }
#changelist #searchbar { background: transparent; }
#changelist div:has(> table.result-list) ~ div, #changelist .paginator { color: var(--ds-muted); }

/* ---- edit forms (r381) --------------------------------------------------------------------------------------------------------- */
/* Sections as quiet labelled cards, fields with warm hairline borders and a brand-colored focus ring, help text in the muted color, the
   form's own tabs as the same underline as the section tabs elsewhere (and able to scroll sideways when there are many), and the save bar
   as a frosted warm strip. Field order, labels and saving are unchanged. */
#content fieldset.module { background: var(--ds-surface); border-color: var(--ds-line); border-radius: var(--ds-r-lg); box-shadow: var(--ds-shadow); }
#content fieldset.module > h2 {
  height: auto; margin: 0 0 var(--ds-3); padding: var(--ds-3) var(--ds-4) var(--ds-2); background: transparent; border-radius: 0; border-bottom: 1px solid var(--ds-line);
  font-size: var(--ds-fs-xs); font-weight: var(--ds-w-strong); text-transform: uppercase; letter-spacing: .08em; color: var(--ds-muted); }
#content .form-row > div > label, #content .form-row label.required, #content .form-row label { color: var(--ds-text); font-weight: var(--ds-w-strong); }
#content form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):not([type="hidden"]),
#content form select, #content form textarea {
  background-color: var(--ds-surface); border-color: var(--ds-line-strong); border-radius: var(--ds-r); box-shadow: none; color: var(--ds-text); font-weight: 400; }
#content form input:not([type="checkbox"]):not([type="radio"]):focus, #content form select:focus, #content form textarea:focus {
  outline: 2px solid var(--ds-focus); outline-offset: -1px; border-color: transparent; }
#content form input[readonly], #content form .readonly { color: var(--ds-text); }
#content .form-row .help, #content .form-row [class*="help"], #content .form-row .text-font-subtle-light { color: var(--ds-muted); }
#content .form-row { border-color: var(--ds-line) !important; }

/* the form's own tabs (General, Schedule entries, Estimates ...): an underline, scrolling sideways instead of pushing the page wider */
#tabs-wrapper > .flex-row { min-width: 0; max-width: 100%; }
#tabs-wrapper nav { min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; background: transparent; padding: 0; gap: 2px; border-radius: 0; border-bottom: 1px solid var(--ds-line); }
#tabs-wrapper nav::-webkit-scrollbar { display: none; }
#tabs-wrapper nav > a { border-radius: 0 !important; background: transparent !important; box-shadow: none !important; padding: 10px 12px !important; margin-bottom: -1px;
  border-bottom: 2px solid transparent; color: var(--ds-muted); font-weight: var(--ds-w-medium); }
#tabs-wrapper nav > a:hover { color: var(--ds-text); }
#tabs-wrapper nav > a.active { color: var(--ds-text); font-weight: var(--ds-w-strong); border-bottom-color: var(--ds-primary); }

/* the save bar */
#submit-row .backdrop-blur-xs { background: color-mix(in srgb, var(--ds-page) 85%, transparent); }
#submit-row > div { border-top-color: var(--ds-line); }

/* ---- the shared tab strip (r382) ------------------------------------------------------------------------------------------------ */
/* core/templates/core/_tab_strip.html, on 44 pages: the same underline as the section tabs above. Its own small style block comes later in
   the page, so these few properties are marked important. */
nav.ts { border-bottom-color: var(--ds-line) !important; gap: 2px !important; scrollbar-width: none; }
nav.ts::-webkit-scrollbar { display: none; }
nav.ts a { color: var(--ds-muted) !important; font-weight: var(--ds-w-medium) !important; padding: 8px 12px !important; border-bottom-width: 2px !important; font-size: var(--ds-fs-base); }
nav.ts a:hover { color: var(--ds-text) !important; }
nav.ts a.on { color: var(--ds-text) !important; font-weight: var(--ds-w-strong) !important; border-bottom-color: var(--ds-primary) !important; }
nav.ts a:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: -2px; }

/* ---- custom pages on the design system, batch 1 (r382) -------------------------------------------------------------------------- */
/* Pipeline (.pb), Schedule (.sb), My day (.md), Who owes you (.up) and Estimate follow-ups (.fu). Each page names its colors the same way
   (--line, --muted, --text, --bg, --accent ...); these rules point those names at the design system, so the page's own rules follow it
   without being rewritten. "html" in front outranks each page's own definitions, light and dark. Job-type and visit-kind colors
   (--t-*, --k-*) are data, not decoration, and stay as they are. */
html :is(.pb, .sb, .md, .up) {
  --line: var(--ds-line); --line-strong: var(--ds-line-strong); --muted: var(--ds-muted); --text: var(--ds-text);
  --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --col: var(--ds-surface-2); --weekend: var(--ds-surface-2);
  --accent: var(--ds-link, var(--color-primary-700)); --accent-soft: var(--ds-tint); --today: var(--ds-tint); --today-line: var(--ds-primary, var(--color-primary-700));
  --good: var(--ds-good); --warn: var(--ds-warn); --warn-bg: var(--ds-warn-bg); --bad: var(--ds-bad); --danger: var(--ds-bad); }
html.dark :is(.pb, .sb, .md, .up) {
  --line: var(--ds-line); --line-strong: var(--ds-line-strong); --muted: var(--ds-muted); --text: var(--ds-text);
  --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --col: var(--ds-surface-2); --weekend: var(--ds-surface-2);
  --accent: var(--ds-link, var(--color-primary-300)); --accent-soft: var(--ds-tint); --today: var(--ds-tint); --today-line: var(--ds-link, var(--color-primary-300));
  --good: var(--ds-good); --warn: var(--ds-warn); --warn-bg: var(--ds-warn-bg); --bad: var(--ds-bad); --danger: var(--ds-bad); }
html .fu, html.dark .fu { --fu-line: var(--ds-line); --fu-muted: var(--ds-muted); --fu-bg: var(--ds-surface); --fu-text: var(--ds-text); --fu-accent: var(--ds-primary, var(--color-primary-700)); }

/* page titles: the same size and weight everywhere */
html :is(.pb, .sb, .md, .up, .fu) h1 { font-size: var(--ds-fs-xl); line-height: var(--ds-lh-tight); font-weight: var(--ds-w-title); letter-spacing: -.02em; }
@media (max-width: 600px) { html :is(.pb, .sb, .md, .up, .fu) h1 { font-size: 1.6rem; } }

/* buttons: the design system's quiet button, keeping each page's size (My day's are large on purpose, for gloves and phones) */
.pb .pb-btn, .sb .sb-btn, .md .md-btn, .up .up-btn {
  border-color: var(--ds-line-strong); background: var(--ds-surface); color: var(--ds-text); border-radius: var(--ds-r); font-weight: var(--ds-w-strong); box-shadow: var(--ds-shadow); }
.pb .pb-btn:hover, .sb .sb-btn:hover, .md .md-btn:hover, .up .up-btn:hover { border-color: var(--ds-muted); background: var(--ds-surface); }
.pb .pb-btn.primary, .sb .sb-btn.primary, .md .md-btn.primary, .up .up-btn.primary { background: var(--ds-primary); border-color: var(--ds-primary); color: #fff !important; }
.pb .pb-btn.primary:hover, .sb .sb-btn.primary:hover, .md .md-btn.primary:hover, .up .up-btn.primary:hover { background: var(--ds-primary-hover); border-color: var(--ds-primary-hover); }
.md .md-btn { border-radius: var(--ds-r-lg); }
.fu .fu-days a { border-color: var(--ds-line-strong); }
.fu .fu-days a.on { background: var(--ds-primary); border-color: var(--ds-primary); }
:is(.pb, .sb, .md, .up, .fu) :focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }

/* ---- v2 (r387): the everyday screens in the Topside 2.0 look ------------------------------------------------------------------- */
/* Pipeline, Schedule, Who owes you and Estimate follow-ups: the larger corners, soft shadows and lift on hover from the dashboard.
   My day's own part is in core/templates/core/my_day.html. */
.pb .pb-col, .sb .sb-scroll, .up .up-tile, .up .up-card, .fu .fu-card { border-radius: var(--ds-r-lg); box-shadow: var(--ds-shadow); }
.pb .pb-col { border-color: transparent; }
.pb .pb-card { border-radius: var(--ds-r); border-color: var(--ds-line); box-shadow: var(--ds-shadow); transition: box-shadow .12s, transform .12s; }
.pb .pb-card:hover { box-shadow: var(--ds-shadow-lift); }
.up .up-tile { padding: 14px 18px; }
.up .up-card, .fu .fu-card { padding: 16px 20px; }
.up .up-empty { border-radius: var(--ds-r-lg); }
:is(.pb, .sb, .up) :is(.pb-chip, .sb-chip) { border-color: var(--ds-line-strong); }
@media (prefers-reduced-motion: reduce) { .pb .pb-card { transition: none; } }

/* ---- v2 (r389): record edit forms in the Topside 2.0 look ------------------------------------------------------------------------ */
/* Every Unfold add / edit form (contacts, visits, jobs, crews ...). A page title (templates/admin/change_form.html), each section as a white
   card with a sentence-case title like the job page's cards, solid hairlines between fields instead of dashes, and the pickers (search
   boxes, the two-list "Available / Chosen" picker) and the inline tables (Work items ...) on the same tokens. Fields, labels and saving
   are unchanged. */
.ds-form-head { padding: 6px 0 18px; }
.ds-form-kind { margin: 0 0 6px; font-size: var(--ds-fs-sm); font-weight: var(--ds-w-medium); color: var(--ds-muted); }
.ds-form-kind a { color: inherit; text-decoration: none; }
.ds-form-kind a:hover { color: var(--ds-text); text-decoration: underline; }
.ds-form-head h1 { margin: 0; font-size: var(--ds-fs-xl); line-height: var(--ds-lh-tight); font-weight: var(--ds-w-title); letter-spacing: -.025em; color: var(--ds-text); overflow-wrap: anywhere; }
@media (max-width: 600px) { .ds-form-head h1 { font-size: 1.6rem; } }

#content form fieldset.module { border: 0; padding: 0; background: transparent; box-shadow: none; }       /* the card is Unfold's own .form-rows */
#content form fieldset.module .form-rows { border-color: var(--ds-line); border-radius: var(--ds-r-lg); background: var(--ds-surface); box-shadow: var(--ds-shadow); }
#content form fieldset.module > h2, #content .inline-related > fieldset > h2 {
  height: auto; margin: 0 0 10px; padding: 0 2px; background: transparent; border: 0; border-radius: 0;
  font-size: 1rem; font-weight: var(--ds-w-title); text-transform: none; letter-spacing: -.01em; color: var(--ds-text); }
#content form .field-line { border-bottom-style: solid; border-color: var(--ds-line); }
#content form .field-line label { font-weight: var(--ds-w-medium); }
#content form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):not([type="hidden"]),
#content form select:not([multiple]) { min-height: 40px; }
#content form textarea { border-radius: var(--ds-r); }

/* search pickers (choose a job, a customer ...) */
#content .select2-container--admin-autocomplete .select2-selection {
  min-height: 40px; border-color: var(--ds-line-strong); border-radius: var(--ds-r); background: var(--ds-surface); box-shadow: none; }
#content .select2-container--admin-autocomplete.select2-container--focus .select2-selection,
#content .select2-container--admin-autocomplete.select2-container--open .select2-selection { outline: 2px solid var(--ds-focus); outline-offset: -1px; border-color: transparent; }
.select2-container--admin-autocomplete .select2-dropdown { border-color: var(--ds-line-strong); border-radius: var(--ds-r); box-shadow: var(--ds-shadow-lift); overflow: hidden; }
.select2-container--admin-autocomplete .select2-results__option--highlighted[aria-selected] { background: var(--ds-primary); color: #fff; }

/* the two-list picker (Employees on a visit ...) */
#content .selector .selector-available, #content .selector .selector-chosen { border-color: var(--ds-line); border-radius: var(--ds-r-lg); background: var(--ds-surface); overflow: hidden; }
#content .selector .selector-available-title, #content .selector .selector-chosen-title { background: var(--ds-surface-2); border-color: var(--ds-line); color: var(--ds-text); }
#content .selector select[multiple] { border-color: var(--ds-line); background: var(--ds-surface); }
#content .selector .selector-chooseall, #content .selector .selector-clearall { color: var(--ds-link); }

/* inline tables (Work items, Payments ...) */
#content .tabular .formset-wrapper { border-color: var(--ds-line); border-radius: var(--ds-r-lg); background: var(--ds-surface); box-shadow: var(--ds-shadow); }
#content .tabular table thead th { padding-top: 10px; padding-bottom: 10px; background: var(--ds-surface-2); border-color: var(--ds-line);
  font-size: var(--ds-fs-xs); font-weight: var(--ds-w-strong); text-transform: uppercase; letter-spacing: .06em; color: var(--ds-muted); }
#content .tabular table td { border-color: var(--ds-line); }

/* the save bar: Save in the brand color, the others quiet */
#submit-row button[name="_save"] { background: var(--ds-primary); border-color: var(--ds-primary); color: #fff; border-radius: var(--ds-r); }
#submit-row button[name="_save"]:hover { background: var(--ds-primary-hover); border-color: var(--ds-primary-hover); }
#submit-row button:not([name="_save"]), #submit-row a { border-radius: var(--ds-r); }


/* ---- v2 (r389): the custom form pages on the design system ---------------------------------------------------------------------- */
/* About 80 pages with forms (settings, imports, clean-up tools, QuickBooks, accounting, leads, marketing ...) each name their colors on
   their own wrapper (.cm, .hi, .cl ...), in the r382 way. These rules point those names at the design system's tokens, so the page's own
   rules follow it in both themes: the cool grays, white cards, and the brand color's deep shade for main buttons (the old hard-coded
   blue and purple are gone). "html" / "html.dark" in front outranks each page's own light and dark values. Generated from the pages'
   style blocks; to add a page, put its wrapper in the group with the same color names. Fields themselves follow the edit-form rules above. */
html :is(.cm), html.dark :is(.cm) {
  --accent: var(--ds-primary); --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --good: var(--ds-good); --line: var(--ds-line); --muted: var(--ds-muted); --text: var(--ds-text); --warn: var(--ds-warn); }
html :is(.af, .ak, .au, .be, .cf, .cs, .ei, .la, .ld, .li, .ls, .lt, .mk, .re, .sn, .sp, .tt), html.dark :is(.af, .ak, .au, .be, .cf, .cs, .ei, .la, .ld, .li, .ls, .lt, .mk, .re, .sn, .sp, .tt) {
  --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --line: var(--ds-line); --muted: var(--ds-muted); --text: var(--ds-text); }
html :is(.bk), html.dark :is(.bk) {
  --acc: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --good: var(--ds-good); --l: var(--ds-line); --line: var(--ds-line); --m: var(--ds-muted); --muted: var(--ds-muted); --t: var(--ds-text); --text: var(--ds-text); --warn: var(--ds-warn); }
html :is(.bn, .hf, .mi), html.dark :is(.bn, .hf, .mi) {
  --acc: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --l: var(--ds-line); --m: var(--ds-muted); --ok: var(--ds-good); --t: var(--ds-text); }
html :is(.cq, .rp), html.dark :is(.cq, .rp) {
  --accent: var(--ds-primary); --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --line: var(--ds-line); --muted: var(--ds-muted); --text: var(--ds-text); }
html :is(.cl), html.dark :is(.cl) {
  --acc: var(--ds-primary); --accent: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --good: var(--ds-good); --l: var(--ds-line); --line: var(--ds-line); --line-strong: var(--ds-line-strong); --m: var(--ds-muted); --muted: var(--ds-muted); --ok: var(--ds-good); --t: var(--ds-text); --text: var(--ds-text); --warn: var(--ds-warn); }
html :is(.ca, .fq, .hn), html.dark :is(.ca, .fq, .hn) {
  --acc: var(--ds-primary); --bg: var(--ds-surface); --l: var(--ds-line); --m: var(--ds-muted); --t: var(--ds-text); }
html :is(.dr, .rf), html.dark :is(.dr, .rf) {
  --bg: var(--ds-surface); --line: var(--ds-line); --muted: var(--ds-muted); --text: var(--ds-text); }
html :is(.dl), html.dark :is(.dl) {
  --acc: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --good: var(--ds-good); --l: var(--ds-line); --m: var(--ds-muted); --soft: var(--ds-surface-2); --t: var(--ds-text); --warn: var(--ds-warn); }
html :is(.ea), html.dark :is(.ea) {
  --ea-accent: var(--ds-primary); --ea-bg: var(--ds-surface); --ea-line: var(--ds-line); --ea-muted: var(--ds-muted); --ea-text: var(--ds-text); }
html :is(.fb, .gs), html.dark :is(.fb, .gs) {
  --acc: var(--ds-primary); --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --line: var(--ds-line); --muted: var(--ds-muted); --text: var(--ds-text); }
html :is(.hi, .nn, .rj), html.dark :is(.hi, .nn, .rj) {
  --accent: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --good: var(--ds-good); --line: var(--ds-line); --muted: var(--ds-muted); --text: var(--ds-text); --warn: var(--ds-warn); }
html :is(.jn), html.dark :is(.jn) {
  --acc: var(--ds-primary); --accent: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --good: var(--ds-good); --l: var(--ds-line); --line: var(--ds-line); --m: var(--ds-muted); --muted: var(--ds-muted); --ok: var(--ds-good); --t: var(--ds-text); --text: var(--ds-text); }
html :is(.mt), html.dark :is(.mt) {
  --accent: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --good: var(--ds-good); --line: var(--ds-line); --line-strong: var(--ds-line-strong); --muted: var(--ds-muted); --text: var(--ds-text); --warn: var(--ds-warn); }
html :is(.oc), html.dark :is(.oc) {
  --accent: var(--ds-primary); --bg: var(--ds-surface); --line: var(--ds-line); --muted: var(--ds-muted); --soft: var(--ds-surface-2); --text: var(--ds-text); }
html :is(.order-new), html.dark :is(.order-new) {
  --accent: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --line: var(--ds-line); --line-strong: var(--ds-line-strong); --muted: var(--ds-muted); --text: var(--ds-text); }
html :is(.pc), html.dark :is(.pc) {
  --acc: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --l: var(--ds-line); --m: var(--ds-muted); --t: var(--ds-text); }
html :is(.rb), html.dark :is(.rb) {
  --accent: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --good: var(--ds-good); --line: var(--ds-line); --muted: var(--ds-muted); --soft: var(--ds-surface-2); --text: var(--ds-text); }
html :is(.tk), html.dark :is(.tk) {
  --tk-accent: var(--ds-primary); --tk-bad: var(--ds-bad); --tk-bg: var(--ds-surface); --tk-line: var(--ds-line); --tk-muted: var(--ds-muted); --tk-text: var(--ds-text); }
html :is(.ts), html.dark :is(.ts) {
  --ts-accent: var(--ds-primary); --ts-bg: var(--ds-surface); --ts-line: var(--ds-line); --ts-muted: var(--ds-muted); --ts-text: var(--ds-text); }
html :is(.ww), html.dark :is(.ww) {
  --accent: var(--ds-primary); --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --good: var(--ds-good); --line: var(--ds-line); --line-strong: var(--ds-line-strong); --muted: var(--ds-muted); --text: var(--ds-text); --warn: var(--ds-warn); }
/* their page titles: the same size and weight as everywhere else */
html :is(.af, .ak, .au, .be, .bk, .bn, .ca, .cf, .cl, .cm, .cq, .cs, .dl, .dr, .ea, .ei, .fb, .fq, .gs, .hf, .hi, .hn, .jn, .la, .ld, .li, .ls, .lt, .mi, .mk, .mt, .nn, .oc, .order-new, .pc, .rb, .re, .rf, .rj, .rp, .sn, .sp, .tk, .tt, .ts, .ww) > h1, html :is(.af, .ak, .au, .be, .bk, .bn, .ca, .cf, .cl, .cm, .cq, .cs, .dl, .dr, .ea, .ei, .fb, .fq, .gs, .hf, .hi, .hn, .jn, .la, .ld, .li, .ls, .lt, .mi, .mk, .mt, .nn, .oc, .order-new, .pc, .rb, .re, .rf, .rj, .rp, .sn, .sp, .tk, .tt, .ts, .ww) > header h1 { font-size: var(--ds-fs-xl); line-height: var(--ds-lh-tight); font-weight: var(--ds-w-title); letter-spacing: -.02em; }
@media (max-width: 600px) { html :is(.af, .ak, .au, .be, .bk, .bn, .ca, .cf, .cl, .cm, .cq, .cs, .dl, .dr, .ea, .ei, .fb, .fq, .gs, .hf, .hi, .hn, .jn, .la, .ld, .li, .ls, .lt, .mi, .mk, .mt, .nn, .oc, .order-new, .pc, .rb, .re, .rf, .rj, .rp, .sn, .sp, .tk, .tt, .ts, .ww) > h1, html :is(.af, .ak, .au, .be, .bk, .bn, .ca, .cf, .cl, .cm, .cq, .cs, .dl, .dr, .ea, .ei, .fb, .fq, .gs, .hf, .hi, .hn, .jn, .la, .ld, .li, .ls, .lt, .mi, .mk, .mt, .nn, .oc, .order-new, .pc, .rb, .re, .rf, .rj, .rp, .sn, .sp, .tk, .tt, .ts, .ww) > header h1 { font-size: 1.6rem; } }
/* checkboxes and radio buttons in the brand color, on every form */
#content input[type="checkbox"], #content input[type="radio"] { accent-color: var(--ds-primary); }


/* ---- v2 (r391): the remaining pages on the design system ------------------------------------------------------------------------ */
/* The pages without forms that still named their own colors: the hubs, reports and money pages, Texts, Photos, Payroll hours, Time
   corrections, Crew days, Field mode, My work, Search, the job's Inspection, Change order and Gantt parts, the day and week-by-hour
   schedules and the Visit list. Same way as the form pages above: each page's color names point at the design system's tokens, in both
   themes. Data colors (job types --t-*, visit kinds --k-*, lanes) stay as they are. Generated from the pages' style blocks. */
html :is(.co, .gt, .in), html.dark :is(.co, .gt, .in) {
  --acc: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --good: var(--ds-good); --l: var(--ds-line); --m: var(--ds-muted); --soft: var(--ds-surface-2); --t: var(--ds-text); --warn: var(--ds-warn); }
html :is(.es), html.dark :is(.es) {
  --es-accent: var(--ds-primary); --es-bg: var(--ds-surface); --es-line: var(--ds-line); --es-muted: var(--ds-muted); --es-text: var(--ds-text); }
html :is(.pr), html.dark :is(.pr) {
  --accent: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --line: var(--ds-line); --line-strong: var(--ds-line-strong); --muted: var(--ds-muted); --text: var(--ds-text); }
html :is(.sf), html.dark :is(.sf) {
  --sf-accent: var(--ds-primary); --sf-bg: var(--ds-surface); --sf-line: var(--ds-line); --sf-muted: var(--ds-muted); --sf-text: var(--ds-text); }
html :is(.cd, .cw), html.dark :is(.cd, .cw) {
  --accent: var(--ds-primary); --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --good: var(--ds-good); --line: var(--ds-line); --line-strong: var(--ds-line-strong); --muted: var(--ds-muted); --text: var(--ds-text); --warn: var(--ds-warn); }
html :is(.fm), html.dark :is(.fm) {
  --accent: var(--ds-primary); --bg: var(--ds-surface); --good: var(--ds-good); --line: var(--ds-line); --muted: var(--ds-muted); --text: var(--ds-text); }
html :is(.fr), html.dark :is(.fr) {
  --acc: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --l: var(--ds-line); --m: var(--ds-muted); --ok: var(--ds-good); --t: var(--ds-text); }
html :is(.ra, .rt, .sh, .tx), html.dark :is(.ra, .rt, .sh, .tx) {
  --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --line: var(--ds-line); --muted: var(--ds-muted); --text: var(--ds-text); }
html :is(.jp, .sj), html.dark :is(.jp, .sj) {
  --acc: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --l: var(--ds-line); --m: var(--ds-muted); --t: var(--ds-text); --warn: var(--ds-warn); }
html :is(.mr), html.dark :is(.mr) {
  --accent: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --good: var(--ds-good); --line: var(--ds-line); --muted: var(--ds-muted); --soft: var(--ds-surface-2); --text: var(--ds-text); }
html :is(.mw), html.dark :is(.mw) {
  --mw-accent: var(--ds-primary); --mw-bg: var(--ds-surface); --mw-line: var(--ds-line); --mw-muted: var(--ds-muted); --mw-text: var(--ds-text); }
html :is(.ph, .rm, .rv, .tc), html.dark :is(.ph, .rm, .rv, .tc) {
  --accent: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --good: var(--ds-good); --line: var(--ds-line); --line-strong: var(--ds-line-strong); --muted: var(--ds-muted); --text: var(--ds-text); --warn: var(--ds-warn); }
html :is(.sr), html.dark :is(.sr) {
  --accent: var(--ds-primary); --bad: var(--ds-bad); --bg: var(--ds-surface); --good: var(--ds-good); --line: var(--ds-line); --muted: var(--ds-muted); --soft: var(--ds-surface-2); --sr-accent: var(--ds-primary); --sr-bg: var(--ds-surface); --sr-line: var(--ds-line); --sr-muted: var(--ds-muted); --sr-text: var(--ds-text); --text: var(--ds-text); }
html :is(.sd), html.dark :is(.sd) {
  --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --danger: var(--ds-bad); --line: var(--ds-line); --line-strong: var(--ds-line-strong); --muted: var(--ds-muted); --soft: var(--ds-surface-2); --text: var(--ds-text); --today-line: var(--ds-primary); --warn: var(--ds-warn); }
html :is(.st), html.dark :is(.st) {
  --bg: var(--ds-surface); --line: var(--ds-line); --muted: var(--ds-muted); --text: var(--ds-text); }
html :is(.tb), html.dark :is(.tb) {
  --bad: var(--ds-bad); --bg: var(--ds-surface); --l: var(--ds-line); --m: var(--ds-muted); --ok: var(--ds-good); --t: var(--ds-text); }
html :is(.us), html.dark :is(.us) {
  --us-accent: var(--ds-primary); --us-bg: var(--ds-surface); --us-line: var(--ds-line); --us-muted: var(--ds-muted); --us-text: var(--ds-text); }
html :is(.vl-pop-back), html.dark :is(.vl-pop-back) {
  --accent: var(--ds-primary); --bg: var(--ds-surface); --bg-soft: var(--ds-surface-2); --line: var(--ds-line); --line-strong: var(--ds-line-strong); --muted: var(--ds-muted); --text: var(--ds-text); --warn: var(--ds-warn); }
/* their page titles: the same size and weight as everywhere else */
html :is(.cd, .co, .cw, .es, .fm, .fr, .gt, .in, .jp, .mr, .mw, .ph, .pr, .ra, .rm, .rt, .rv, .sd, .sf, .sh, .sj, .sr, .st, .tb, .tc, .tx, .us, .vl-pop-back) > h1, html :is(.cd, .co, .cw, .es, .fm, .fr, .gt, .in, .jp, .mr, .mw, .ph, .pr, .ra, .rm, .rt, .rv, .sd, .sf, .sh, .sj, .sr, .st, .tb, .tc, .tx, .us, .vl-pop-back) > header h1 { font-size: var(--ds-fs-xl); line-height: var(--ds-lh-tight); font-weight: var(--ds-w-title); letter-spacing: -.02em; }
@media (max-width: 600px) { html :is(.cd, .co, .cw, .es, .fm, .fr, .gt, .in, .jp, .mr, .mw, .ph, .pr, .ra, .rm, .rt, .rv, .sd, .sf, .sh, .sj, .sr, .st, .tb, .tc, .tx, .us, .vl-pop-back) > h1, html :is(.cd, .co, .cw, .es, .fm, .fr, .gt, .in, .jp, .mr, .mw, .ph, .pr, .ra, .rm, .rt, .rv, .sd, .sf, .sh, .sj, .sr, .st, .tb, .tc, .tx, .us, .vl-pop-back) > header h1 { font-size: 1.6rem; } }

/* ---- v2 (r391): record lists get a page title --------------------------------------------------------------------------------- */
/* templates/admin/change_list.html: the list's name as the page title, and "+ Add ..." beside it. */
.ds-list-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; padding: 6px 0 18px; }
.ds-list-head h1 { margin: 0; font-size: var(--ds-fs-xl); line-height: var(--ds-lh-tight); font-weight: var(--ds-w-title); letter-spacing: -.025em; color: var(--ds-text); }
@media (max-width: 600px) { .ds-list-head h1 { font-size: 1.6rem; } .ds-list-head .ds-btn { width: 100%; } }
/* the hub pages' tiles: the dashboard's corners, shadow and lift on hover */
.sh a.tile { border-radius: var(--ds-r-lg); box-shadow: var(--ds-shadow); transition: box-shadow .12s, border-color .12s; }
.sh a.tile:hover { box-shadow: var(--ds-shadow-lift); border-color: var(--ds-line-strong); }
.sh a.tile:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .sh a.tile { transition: none; } }

/* r404: compact record forms. On the contact, prospect and job forms, fields listed together in the admin's fieldsets (a tuple)
   sit side by side on a wide screen, with shorter labels so the boxes keep their room. Narrow screens stack them as before. */
@media (min-width: 1024px) {
  .model-contact .form-row.field-row:has(> .field-line + .field-line),
  .model-prospect .form-row.field-row:has(> .field-line + .field-line),
  .model-job .form-row.field-row:has(> .field-line + .field-line) { display: flex; }
  .model-contact .form-row.field-row:has(> .field-line + .field-line) > .field-line,
  .model-prospect .form-row.field-row:has(> .field-line + .field-line) > .field-line,
  .model-job .form-row.field-row:has(> .field-line + .field-line) > .field-line { flex: 1 1 0; min-width: 0; }
  .model-contact .form-row.field-row > .field-line + .field-line,
  .model-prospect .form-row.field-row > .field-line + .field-line,
  .model-job .form-row.field-row > .field-line + .field-line { border-left: 1px dashed var(--ds-line); }
  .model-contact .form-row.field-row:has(> .field-line + .field-line) > .field-line > div:first-child,
  .model-prospect .form-row.field-row:has(> .field-line + .field-line) > .field-line > div:first-child,
  .model-job .form-row.field-row:has(> .field-line + .field-line) > .field-line > div:first-child { min-width: 9rem; width: 9rem; }
}
.model-prospect textarea[name="notes"] { height: 6.5rem; min-height: 6.5rem; resize: vertical; }      /* r404: room for a few lines; drag to grow */
