/*
 * BD25 canonical standards components.
 *
 * Lifted verbatim from the /standards/ visual guide (templates/standards/index.html).
 * That page is the source of truth for how these look; this file is the source of
 * truth for where they live, so a module no longer has to copy the CSS to use them.
 *
 * SPECIFICITY: plain single-class selectors, i.e. (0,1,0). Deliberate, and load
 * order matters. This file is linked immediately after nazox/app.min.css and
 * BEFORE every BD module stylesheet, so it:
 *   - OUTRANKS Bootstrap's element rules (a, h2, p, button, label are (0,0,1)).
 *     Required: without it <a class="std-btn-sample"> renders link-blue text on
 *     a black button, and <h2 class="std-section-title"> takes Bootstrap's h2
 *     sizing instead of the guide's.
 *   - LOSES to any module that defines its own .std-* rule, since that rule has
 *     equal specificity and comes later in source order. So the ~306 templates
 *     already using these classes are unaffected.
 *
 * An earlier revision wrapped everything in :where() for zero specificity. That
 * was wrong - at (0,0,0) Bootstrap's element selectors won every conflict.
 *
 * COLORS: theme-bridged `var(--bd-theme-<slot>-<hex>, #literal)` per
 * scripts/css_theme_bridge.py. Never add a raw literal here.
 *
 * Do NOT declare tokens on :root in a consuming template - see
 * bd_theme_contract.css. Board-private tokens go on the board's root class.
 */

/* Hidden guard (rank 150). Layered !important display rules (bd-work-partials
   header buttons, for one) outrank Bootstrap's unlayered [hidden] reset, so a
   hidden button showed. This layer is declared first, and an earlier layer wins
   an !important tie, so [hidden] stays hidden over every later layer. Pages
   that state their layer order up front list bd-hidden-guard first. */
@layer bd-hidden-guard {
  [hidden]:not([hidden="until-found"]) { display: none !important; }
}

.std-scope {
  --std-border: var(--bd-theme-border-111111, #111);
  --std-rule: var(--bd-theme-border-d0d5dd, #d0d5dd);
  --std-muted: var(--bd-theme-fg-667085, #667085);
  --std-soft: var(--bd-theme-palette-f8fafc, #f8fafc);
  --std-ink: var(--bd-theme-fg-111827, #111827);
}

/* Guidance belongs beside the decision. Ordinary field/section notes stay flat. */
.std-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  margin: 0 0 12px;
  padding: 12px;
  border-left: 3px solid var(--bd-theme-border-strong, #a8b3c2);
  background: var(--bd-theme-surface-soft, #f8fafc);
  color: var(--bd-theme-text, #111827);
  font-size: .82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.std-callout > i {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--bd-theme-text-muted, #667085);
  font-size: 1rem;
  line-height: 1;
}
.std-callout > :not(i) { min-width: 0; }
.std-callout p { margin: 0; }
.std-callout p + p { margin-top: 8px; }
.std-callout.is-warn { border-left-color: var(--bd-theme-warning, #b54708); }
.std-inline-note {
  margin: 4px 0 12px;
  color: var(--bd-theme-text-muted, #667085);
  font-size: .82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.std-scope * {
  min-width: 0;
}

/* ---------------------------------------------------------------- surfaces */

.std-panel, .std-source-card, .std-table-demo {
  border: 1px solid var(--std-border, var(--bd-theme-border-111111, #111));
  border-radius: .95rem;
  background: var(--bd-theme-bg-ffffff, #fff);
  box-shadow: 0 .45rem 1.2rem var(--bd-theme-shadow-0f172a-0f, rgba(15, 23, 42, .06));
}

.std-panel {
  padding: 1rem;
}

/* Work shells are flat. Only outer panels carry the ambient shadow. */
.std-work-shell {
  border: 1px solid var(--bd-theme-border-111111, #111);
  border-radius: .95rem;
  background: var(--bd-theme-bg-ffffff, #fff);
  overflow: hidden;
}

.std-work-head {
  padding: .95rem;
  border-bottom: 1px solid var(--bd-theme-border-111111, #111);
}

.std-work-body {
  padding: .95rem;
  display: grid;
  gap: .85rem;
}

/* ------------------------------------------------------- command maps */
/* Promoted verbatim from /standards/ so modules consume the map contract. */
.std-map-demo {
  border: 1px solid var(--bd-theme-border-111111, #111);
  border-radius: .95rem;
  background: var(--bd-theme-bg-ffffff, #fff);
  overflow: hidden;
}

.std-map-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  flex-wrap: wrap;
  padding: .68rem .78rem;
  border-bottom: 1px solid var(--bd-theme-border-111111, #111);
}

.std-map-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 360px;
}

.std-map-canvas {
  position: relative;
  min-height: 360px;
  background:
    linear-gradient(90deg, var(--bd-theme-bg-111111-0a, rgba(17,17,17,.04)) 1px, transparent 1px),
    linear-gradient(0deg, var(--bd-theme-bg-111111-0a, rgba(17,17,17,.04)) 1px, transparent 1px),
    var(--bd-theme-bg-f8fafc, #f8fafc);
  background-size: 42px 42px;
  overflow: hidden;
}

.std-map-sidebar {
  border-left: 1px solid var(--bd-theme-border-111111, #111);
  background: var(--bd-theme-bg-ffffff, #fff);
  padding: .72rem;
  overflow: auto;
  display: grid;
  gap: .55rem;
  align-content: start;
}

/* Operational map modifier: use the screen instead of a short demo viewport. */
.std-map-demo.is-tall-map .std-map-body {
  height: clamp(44rem, 72vh, 58rem);
  min-height: 44rem;
}

.std-map-demo.is-tall-map .std-map-canvas {
  min-height: 0;
}

.std-map-list-row {
  border: 1px solid var(--bd-theme-border-d0d5dd, #d0d5dd);
  border-radius: .62rem;
  background: var(--bd-theme-bg-ffffff, #fff);
  padding: .55rem;
}

.std-section-title {
  display: flex;
  align-items: center;
  gap: .42rem;
  margin: 0;
  color: var(--bd-theme-fg-111827, #111827);
  font-size: 1.12rem;
  line-height: 1.2;
  font-weight: 800;
}

.std-section-title i {
  color: var(--bd-theme-fg-667085, #667085);
  font-size: 1.08em;
  line-height: 1;
}

.std-section-copy {
  margin: .24rem 0 0;
  color: var(--std-muted, var(--bd-theme-fg-667085, #667085));
  line-height: 1.45;
  max-width: 58rem;
}

/* -------------------------------------------------------------- KPI strip */
/*
 * One bordered container, cells divided by internal rules. KPIs are NOT
 * free-floating tiles with gaps between them - that reads as generic SaaS and
 * is explicitly not the house pattern.
 */

.std-kpi-strip {
  /* One row of equal cells while every cell keeps --kpi-min; it wraps only
   * when a cell would drop below that readable width (then two balanced rows,
   * then two across), never into a fixed 4x2 or 3+2 fold. N counts only
   * rendered tiles. */
  --kpi-n: 4;
  --kpi-min: 8.6rem;
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--bd-theme-card-border, #111);
  border-radius: .82rem;
  overflow: hidden;
  background: var(--bd-theme-bg-ffffff, #fff);
}

/* When a strip summarizes the work card immediately below it, the card owns
 * the outside frame. The strip docks to the identity header and contributes
 * only the shared divider plus its internal cell rules. */
.std-kpi-attached-shell,
.bd-module-workbench .bd-tab-card.std-kpi-attached-shell {
  overflow: hidden !important;
}

.std-kpi-attached-shell > .bd-tab-card__head:has(+ .std-kpi-strip),
.bd-module-workbench .bd-tab-card.std-kpi-attached-shell > .bd-tab-card__head:has(+ .std-kpi-strip) {
  border-bottom: 0 !important;
}

.std-kpi-attached-shell > .std-kpi-strip,
.std-kpi-attached-shell > :not(.std-kpi-strip) > .std-kpi-strip:only-child {
  border: 0 !important;
  border-top: 1px solid var(--bd-theme-card-border, #111) !important;
  border-bottom: 1px solid var(--bd-theme-card-border, #111) !important;
  border-radius: 0 !important;
}

/*
 * is-4 is the default, but templates say `is-{{ n }}` and a missing modifier is
 * an invisible bug - the strip silently keeps 4 columns for 1, 4 or 7 cells.
 * Every count a caller can produce is declared.
 */
.std-kpi-strip.is-1 { --kpi-n: 1; }
.std-kpi-strip.is-2 { --kpi-n: 2; }
.std-kpi-strip.is-3 { --kpi-n: 3; }
.std-kpi-strip.is-4 { --kpi-n: 4; }
.std-kpi-strip.is-5 { --kpi-n: 5; }
.std-kpi-strip.is-6 { --kpi-n: 6; }
.std-kpi-strip.is-7 { --kpi-n: 7; }
.std-kpi-strip.is-8 { --kpi-n: 8; }
/* The rendered tiles decide, whatever modifier the caller passed. */
.std-kpi-strip:has(> :nth-last-child(1 of :not([hidden])):nth-child(1 of :not([hidden]))) { --kpi-n: 1; }
.std-kpi-strip:has(> :nth-last-child(1 of :not([hidden])):nth-child(2 of :not([hidden]))) { --kpi-n: 2; }
.std-kpi-strip:has(> :nth-last-child(1 of :not([hidden])):nth-child(3 of :not([hidden]))) { --kpi-n: 3; }
.std-kpi-strip:has(> :nth-last-child(1 of :not([hidden])):nth-child(4 of :not([hidden]))) { --kpi-n: 4; }
.std-kpi-strip:has(> :nth-last-child(1 of :not([hidden])):nth-child(5 of :not([hidden]))) { --kpi-n: 5; }
.std-kpi-strip:has(> :nth-last-child(1 of :not([hidden])):nth-child(6 of :not([hidden]))) { --kpi-n: 6; }
.std-kpi-strip:has(> :nth-last-child(1 of :not([hidden])):nth-child(7 of :not([hidden]))) { --kpi-n: 7; }
.std-kpi-strip:has(> :nth-last-child(1 of :not([hidden])):nth-child(8 of :not([hidden]))) { --kpi-n: 8; }
/* --kpi-half is ceil(N / 2). The basis picks the widest layout that fits:
   one row of N; else two balanced rows (N/2 across, so 8 never folds 7 + 1);
   else two across. Each (min * count - 100%) * 999 term is a huge positive
   length when that row would not fit and negative when it would. */
.std-kpi-strip { --kpi-half: 2; }
.std-kpi-strip:is(.is-1, .is-2) { --kpi-half: 1; }
.std-kpi-strip:is(.is-5, .is-6) { --kpi-half: 3; }
.std-kpi-strip:is(.is-7, .is-8) { --kpi-half: 4; }
.std-kpi-strip:has(> :nth-last-child(1 of :not([hidden])):nth-child(-n+2 of :not([hidden]))) { --kpi-half: 1; }
.std-kpi-strip:has(> :nth-last-child(1 of :not([hidden])):nth-child(n+3 of :not([hidden])):nth-child(-n+4 of :not([hidden]))) { --kpi-half: 2; }
.std-kpi-strip:has(> :nth-last-child(1 of :not([hidden])):nth-child(n+5 of :not([hidden])):nth-child(-n+6 of :not([hidden]))) { --kpi-half: 3; }
.std-kpi-strip:has(> :nth-last-child(1 of :not([hidden])):nth-child(n+7 of :not([hidden])):nth-child(-n+8 of :not([hidden]))) { --kpi-half: 4; }
.std-kpi-strip > * {
  flex: 1 1 max(
    calc(100% / var(--kpi-n) - 1px),
    min(calc(100% / var(--kpi-half) - 1px), calc((var(--kpi-min) * var(--kpi-n) - 100%) * 999)),
    min(calc(50% - 1px), calc((var(--kpi-min) * var(--kpi-half) - 100%) * 999))
  );
  min-width: 0;
}
.std-kpi-strip > [hidden] { display: none !important; }

/*
 * A KPI reads value first, label under it, meta last. Internal rules are drawn
 * as 1px shadows on the right and bottom of every cell; the strip clips the
 * ones that land on its own edge, so the rules stay correct at any column
 * count (6 cells in 3 columns, 5 in 2) without per-count nth-child math.
 */
.std-kpi {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  align-content: start;
  gap: .65rem;
  min-width: 0;
  padding: .68rem .78rem;
  border-right: 0;
  box-shadow: 1px 0 0 var(--bd-theme-card-border, #111), 0 1px 0 var(--bd-theme-card-border, #111);
}

.std-kpi:last-child {
  border-right: 0;
}

.std-kpi > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* The text column beside an icon sits in the 1fr track, so its width never
   depends on its content; the metric size in bd_typography.css reads it. */
.std-kpi > span:last-child:not(:first-child) {
  container-type: inline-size;
}

.std-kpi > span:last-child > .std-kpi__value {
  order: -1;
  margin-top: 0;
  margin-bottom: .14rem;
  white-space: nowrap;
}

/* A name or record number in the figure slot wraps; only figures are atomic. */
.std-kpi > span:last-child > .std-kpi__value.is-text {
  white-space: normal;
  overflow-wrap: break-word;
}

/*
 * The KPI icon is a 2.05rem transparent box holding a 1.28rem mdi glyph at full
 * opacity. It is NOT a tinted dot and NOT faded. It sits beside the figure;
 * the figure still leads the text column (value, then label, then meta).
 */
.std-kpi__icon {
  width: 2.05rem;
  height: 2.05rem;
  display: grid;
  place-items: center;
  align-self: start;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--bd-theme-fg-111827, #111827);
  font-size: 1.28rem;
  line-height: 1;
}

.std-kpi__label {
  display: block;
  color: var(--bd-theme-text-subtle, #475467);
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.05;
  text-transform: none;
}

.std-kpi__value {
  display: block;
  margin-top: .12rem;
  color: var(--bd-theme-fg-111827, #111827);
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  /* A figure is atomic. `overflow-wrap: anywhere` here rendered $17,659,667 as
     "$17,62" on one line and "5,971" on the next — two numbers, neither real.
     If a value is too long for its cell, the cell is too narrow. */
  white-space: nowrap;
}

.std-kpi__meta {
  display: block;
  margin-top: .12rem;
  color: var(--std-muted, var(--bd-theme-fg-667085, #667085));
  font-size: .72rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

@media (max-width: 767.98px) {
  .std-kpi__meta { white-space: normal; overflow-wrap: anywhere; }
}

/*
 * Tone on a KPI tints the VALUE only. The cell keeps the strip's white ground -
 * filling the whole cell turns the strip into a traffic light and destroys the
 * scannability the single-container layout exists to provide.
 */
.std-kpi.is-good .std-kpi__value { color: var(--bd-theme-fg-166534, #166534); }
.std-kpi.is-warn .std-kpi__value { color: var(--bd-theme-fg-7a4f01, #7a4f01); }
.std-kpi.is-bad  .std-kpi__value { color: var(--bd-theme-fg-b42318, #b42318); }
.std-kpi.is-info .std-kpi__value { color: var(--bd-theme-fg-31546b, #31546b); }

/*
 * Zeros recede, problems advance. .is-zero greys a cell whose figure is zero
 * (set by the template or by bd_kpi_tone.js). .is-problem marks a figure that
 * cannot be trusted or needs work now: warning ground, straight left accent,
 * meta reads as the action.
 */
.std-kpi.is-zero .std-kpi__icon,
.std-kpi.is-zero .std-kpi__value,
.std-kpi.is-zero .std-kpi__label,
.std-kpi.is-zero .std-kpi__meta {
  color: var(--bd-theme-text-muted, #667085);
}

.std-kpi.is-zero .std-kpi__value {
  font-weight: 400 !important;
}

.std-kpi.is-problem {
  background: color-mix(in srgb, var(--bd-theme-warning) 16%, var(--bd-theme-surface, #fff));
  box-shadow: inset 4px 0 0 var(--bd-theme-warning), 1px 0 0 var(--bd-theme-card-border, #111), 0 1px 0 var(--bd-theme-card-border, #111);
}

.std-kpi.is-problem .std-kpi__value {
  color: var(--bd-theme-text-strong, #111);
}

.std-kpi.is-problem .std-kpi__meta {
  color: var(--bd-theme-text-strong, #111);
}

/* Only a meta that is a link reads as the action. */
.std-kpi.is-problem a.std-kpi__meta {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The accent is a straight edge: the strip's corner never curves it. */
.std-kpi-strip:has(> .std-kpi.is-problem:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/*
 * A strip without an is-N modifier sizes its columns to the cells it has
 * (one, two or three cells no longer leave empty framed space).
 */
.std-kpi-strip.is-auto {
  --kpi-min: 150px;
}

/* --------------------------------------------------------- score meters */
/* {% bd_meter %}: number, status word, five steps lit in the status tone. */
.bd-meter {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: start;
  gap: 2px 8px;
  min-width: 92px;
}
.bd-meter__value {
  color: var(--bd-theme-text-strong, #111);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
}
.bd-meter__label {
  color: var(--bd-theme-text-subtle, #475467);
  font-size: 12px;
  white-space: nowrap;
}
.bd-meter__steps {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  width: 90px;
  height: 5px;
}
.bd-meter__steps > i { background: var(--bd-theme-surface-muted, #eef1f5); }
.bd-meter__steps > i.is-on { background: var(--bd-meter-tone, var(--bd-theme-info)); }
.bd-meter.is-good { --bd-meter-tone: var(--bd-theme-success); }
.bd-meter.is-warn { --bd-meter-tone: var(--bd-theme-warning); }
.bd-meter.is-bad { --bd-meter-tone: var(--bd-theme-danger); }
.bd-meter.is-info { --bd-meter-tone: var(--bd-theme-info); }
.bd-meter.is-muted { --bd-meter-tone: var(--bd-theme-border-strong); }

/* ------------------------------------------------------- chips and actions */

.std-chip-row, .std-pill-row, .std-action-strip, .std-subnav {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}

.std-chip, .std-path, .std-tab, .std-action {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  max-width: 100%;
  border: 1px solid var(--bd-theme-border-111111, #111);
  border-radius: .5rem;
  background: var(--bd-theme-bg-ffffff, #fff);
  color: var(--bd-theme-fg-344054, #344054);
  font-size: .74rem;
  font-weight: 800;
  line-height: 1.15;
  padding: .24rem .5rem;
  overflow-wrap: anywhere;
}

.std-chip.is-info  { background: var(--bd-theme-bg-eef3f8, #eef3f8); color: var(--bd-theme-fg-31546b, #31546b); }
.std-chip.is-good  { background: var(--bd-theme-bg-f5fbf6, #f5fbf6); color: var(--bd-theme-fg-166534, #166534); }
.std-chip.is-warn  { background: var(--bd-theme-bg-fff8e6, #fff8e6); color: var(--bd-theme-fg-7a4f01, #7a4f01); }
.std-chip.is-muted { background: var(--bd-theme-bg-f8fafc, #f8fafc); color: var(--bd-theme-fg-475467, #475467); }
/*
 * The guide's chip set has no `bad`. It is added here because analytics has
 * genuine failure states, and it is tuned to match .std-btn-sample.is-danger
 * rather than inventing a new red.
 */
.std-chip.is-bad   { background: var(--bd-theme-bg-fbf3f2, #fbf3f2); color: var(--bd-theme-fg-6f2f2a, #6f2f2a); }

/* "Not Saved" beside a refused change (bdOutbox.markNotSaved): one compact
   chip with Retry and Discard, on the same row as the entry. */
.std-chip.bd-not-saved { padding: .12rem .14rem .12rem .4rem; gap: .28rem; margin-top: .25rem; vertical-align: middle; white-space: nowrap; }
.std-chip.bd-not-saved > .std-btn-sample.is-compact { padding: .08rem .38rem; font-size: .7rem; line-height: 1.1; }

/* Chip icons inherit the chip's color at full opacity. Never fade them. */
.std-chip > i {
  font-size: 1.02em;
  line-height: 1;
  flex: 0 0 auto;
}

.std-action {
  width: 2rem;
  height: 2rem;
  justify-content: center;
  padding: 0;
  background: var(--bd-theme-bg-ffffff, #fff);
}

.std-path {
  background: var(--bd-theme-bg-f8fafc, #f8fafc);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .72rem;
  font-weight: 700;
}

.std-subnav-label {
  display: none !important;
}

/* ------------------------------------------------------------------ buttons */

.std-btn-sample {
  min-height: 34px;
  border: 1px solid var(--bd-theme-border-111111, #111);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  padding: .42rem .72rem;
  font-weight: 800;
  color: var(--bd-theme-fg-111827, #111827);
  background: var(--bd-theme-bg-ffffff, #fff);
}

.std-btn-sample.is-primary { background: var(--bd-theme-action, #111); border-color: var(--bd-theme-action-border, #111); color: var(--bd-theme-action-text, #fff); }
.std-btn-sample.is-muted   { background: var(--bd-theme-bg-f8fafc, #f8fafc); }
.std-btn-sample.is-danger  { background: var(--bd-theme-bg-fbf3f2, #fbf3f2); color: var(--bd-theme-fg-6f2f2a, #6f2f2a); }
.std-btn-sample.is-compact { min-height: 32px; padding: .32rem .6rem; font-size: .78rem; }
.std-btn-sample.is-touch { min-height: 34px; padding: .42rem .72rem; }
.std-btn-sample:disabled,
.std-btn-sample[aria-disabled="true"] { opacity: .55; cursor: default; pointer-events: none; }
.std-btn-sample[aria-busy="true"] { min-width: var(--std-busy-width, auto); cursor: wait; pointer-events: none; }

/* ------------------------------------------------------------ status tiles */
/* Separate bordered tiles WITH gaps are correct here - unlike KPIs. */

.std-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .65rem;
}

.std-status-tile {
  border: 1px solid var(--bd-theme-border-111111, #111);
  border-radius: .78rem;
  padding: .72rem;
  background: var(--bd-theme-bg-ffffff, #fff);
}

/* ------------------------------------------------------------------ tables */

.std-table-demo {
  overflow: hidden;
}

/*
 * Wide tables scroll rather than clip. `overflow:hidden` on a wrapper makes
 * columns past the container edge permanently unreachable.
 */
.std-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--bd-theme-border-111111, #111);
  border-radius: .95rem;
  background: var(--bd-theme-bg-ffffff, #fff);
}

.std-table-wrap > table {
  margin: 0;
}

/* The frame draws the table's bottom edge; the last row does not add a second. */
.std-table-wrap > table > tbody:last-child > tr:nth-last-child(1 of :not([hidden])) > * {
  border-bottom-width: 0;
}

.std-table-head th {
  background: var(--bd-theme-bg-f8fafc, #f8fafc);
  color: var(--bd-theme-fg-667085, #667085);
}

/* ------------------------------------------------------------- page head */
/* Rank 48. templates/partials/_page_head_open.html + _page_head_close.html
   render the standards work head (std-work-head + std-work-title) as the
   page's one H1 (22px / 700, MDI icon) and its one action group. It only
   adds the row layout; it is not a second head style. */
.std-work-head.std-page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; }
.std-page-head__title { display: grid; gap: .15rem; min-width: 0; }
.std-page-head h1 { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; }
.std-page-head h1 > .mdi { font-size: 22px; line-height: 1; }
.std-page-head__sub { margin: 0; color: var(--std-muted, var(--bd-theme-fg-667085, #667085)); font-size: .82rem; }
.std-page-head__actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.std-page-head__actions:empty { display: none; }

/* ------------------------------------------------------ one border owner */
/* Ranks 3 and 172. The element marked data-bd-border-owner sits inside the
   one card that draws the frame; every framed box inside it (subcards, inner
   cards, table shells, tab bodies) loses its own border, radius and shadow
   and reads as a band divided by a single rule. Strips keep only their
   top and bottom rules. Modals and menus inside keep their own frames.
   Opt a box out with data-bd-own-frame. */
[data-bd-border-owner] :is(.card, .bd-card, .bd-subcard, .bd-tab-card, .std-panel, .std-work-panel, .std-table-wrap, .std-register-body, .bd-table-shell, .pi-table-shell, .pa-summary-card, .std-flush):not([data-bd-own-frame], .modal *, .dropdown-menu *, .bdm2 *) {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
[data-bd-border-owner] :is(.card, .bd-card, .bd-subcard, .bd-tab-card, .std-panel, .std-work-panel, .std-table-wrap, .std-register-body, .bd-table-shell, .pi-table-shell, .pa-summary-card, .std-flush):not([data-bd-own-frame], .modal *, .dropdown-menu *, .bdm2 *):not(:first-child) {
  border-top: 1px solid var(--bd-theme-border, #d0d5dd) !important;
}
[data-bd-border-owner] .std-kpi-strip:not([data-bd-own-frame]) {
  border-left: 0 !important;
  border-right: 0 !important;
  border-radius: 0 !important;
}
/* Grid tiles side by side divide with a left rule instead of stacked frames. */
[data-bd-border-owner] :is([class*="-grid"], .row) > :is(.bd-subcard, .bd-card, .card, .std-work-panel, .std-flush):not([data-bd-own-frame]) {
  border-top: 0 !important;
}

/* ------------------------------------------------------- wide fact list */
/* Rank 112. A key/value list (label and value per row) tiles its rows into
   two or three columns on wide screens instead of stretching one row across
   2000px; the label stays next to its value. Below 1800px it is one column. */
@media (min-width: 1800px) {
  .std-fact-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 28rem), 1fr));
    column-gap: 2rem;
    align-items: start;
  }
  .std-fact-list > * { min-width: 0; }
}

/* ------------------------------------------------------------- load more */
/* templates/partials/_load_more_sentinel.html: the last row of a register is
   a loading row shaped like a record. It fetches the next rows when it scrolls
   into view and replaces itself. No count, no button. */
.bd-load-more > td { padding: .7rem .75rem; }
.bd-load-more.is-block { padding: .7rem .75rem; }
.bd-load-more__bones { display: flex; align-items: center; gap: 1.25rem; }

/* ------------------------------------------------------------ live state */
/* Nothing at rest: a live-connection chip renders only once its owner marks
   it Offline (accounting_workspace.js), so first paint never says Connecting. */
:is(.std-chip:has([data-acct-connection-status]), [data-acct-connection-status]:not(.std-chip *)):not([data-acct-offline]) { display: none !important; }

/* --------------------------------------------------- active filter banner */
/* One applied-filter row for every register: chips wrap with one gap, and
   the clear action sits at the row end. */
.std-active-filter-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--bd-theme-fg-344054, #344054); font-weight: 800; }
.std-active-filter-banner > i { color: var(--bd-theme-fg-101828, #101828); }
.std-active-filter-banner > :is(.bd-btn, .std-btn-sample):last-child { margin-left: auto; }

/* ------------------------------------------------------------ empty states */

.std-empty-state {
  display: grid;
  place-items: center;
  gap: .35rem;
  padding: 1.6rem 1rem;
  color: var(--std-muted, var(--bd-theme-fg-667085, #667085));
  font-size: .82rem;
  text-align: center;
}

/* In a grid (photo cards, tiles) the one empty state spans the whole row
   instead of sitting in the first cell. No effect outside a grid. */
.std-empty-state {
  grid-column: 1 / -1;
}

/* Title Case label, one line, no subline (2 to 5 words). */
.std-empty-state > strong {
  font-weight: 700;
  color: var(--bd-theme-text-subtle, #475467);
}

.std-empty-state > i {
  font-size: 1.5rem;
  line-height: 1;
  color: inherit;
}

/* ------------------------------------------------------------- responsive */
/* Breakpoints match the guide exactly: 1199.98px and 767.98px. */

@media (max-width: 1199.98px) {
  .std-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

/* Tablet: five or six cells share one row, so the icon sits above the figure
 * (full-width text column) and the figure keeps its size. */
@media (min-width: 768px) and (max-width: 1099.98px) {
  .std-kpi-strip > .std-kpi {
    grid-template-columns: minmax(0, 1fr);
    gap: .3rem;
  }
  .std-kpi-strip > .std-kpi > .std-kpi__icon {
    width: auto;
    height: 1.4rem;
    justify-self: start;
    font-size: 1.2rem;
  }
}
/* Six or more cells stay stacked up to laptop widths, where a cell is still
 * under ~11rem and an icon beside the text would starve the figure. */
@media (min-width: 1100px) and (max-width: 1599.98px) {
  .std-kpi-strip:has(> :nth-child(6)) > .std-kpi {
    grid-template-columns: minmax(0, 1fr);
    gap: .3rem;
  }
  .std-kpi-strip:has(> :nth-child(6)) > .std-kpi > .std-kpi__icon {
    width: auto;
    height: 1.4rem;
    justify-self: start;
    font-size: 1.2rem;
  }
}

@media (max-width: 767.98px) {
  .std-panel {
    padding: .85rem;
  }

  .std-work-head {
    padding: .85rem;
  }

  .std-status-grid {
    grid-template-columns: 1fr;
  }

  /* Phones read figures two across (the strip's own fold gives that). An odd
   * count never leaves one tile alone on a row: the last three tiles share a
   * row a third each (5 folds 2+3, 7 folds 2+2+3). */
  .std-kpi-strip {
    --kpi-min: 9rem;
  }
  .std-kpi-strip.std-kpi-strip.std-kpi-strip > :nth-last-child(1 of :not([hidden])):nth-child(odd of :not([hidden])),
  .std-kpi-strip.std-kpi-strip.std-kpi-strip > :nth-last-child(2 of :not([hidden])):nth-child(even of :not([hidden])),
  .std-kpi-strip.std-kpi-strip.std-kpi-strip > :nth-last-child(3 of :not([hidden])):nth-child(odd of :not([hidden])) {
    /* Never narrower than a readable tile: a row of three that cannot fit
       (a phone modal) falls back to two plus one. */
    flex-basis: max(var(--kpi-third-min, 8.5rem), calc(100% / 3 - 1px));
  }

  .std-action-strip {
    justify-content: flex-start;
  }
}


/* ------------------------------------------------- element-tag compatibility */
/*
 * These classes are frequently applied to semantic elements (<a> as a button,
 * <h2> as a section title, <p> as copy, <label> as a chip). Bootstrap styles
 * those tags directly, so the class must explicitly neutralise the tag defaults
 * it cares about. Without this the component silently renders wrong depending
 * on which element it landed on.
 */

a.std-btn-sample,
a.std-btn-sample:hover,
a.std-btn-sample:focus,
a.std-chip,
a.std-chip:hover,
a.std-chip:focus {
  text-decoration: none;
}

a.std-btn-sample.is-primary,
a.std-btn-sample.is-primary:hover,
a.std-btn-sample.is-primary:focus {
  color: var(--bd-theme-action-text, #fff);
}

a.std-btn-sample:not(.is-primary),
a.std-btn-sample:not(.is-primary):hover,
a.std-btn-sample:not(.is-primary):focus {
  color: var(--bd-theme-fg-111827, #111827);
}

a.std-btn-sample.is-danger,
a.std-btn-sample.is-danger:hover,
a.std-btn-sample.is-danger:focus {
  color: var(--bd-theme-fg-6f2f2a, #6f2f2a);
}

button.std-btn-sample,
button.std-action {
  appearance: none;
  font-family: inherit;
  cursor: pointer;
}

h1.std-section-title,
h2.std-section-title,
h3.std-section-title,
h4.std-section-title,
h5.std-section-title,
h6.std-section-title {
  margin-bottom: 0;
  font-size: 1.12rem;
  font-weight: 800;
}

p.std-section-copy,
p.std-kpi__meta {
  margin-bottom: 0;
}

label.std-chip {
  display: inline-flex;
  margin-bottom: 0;
}

button.std-chip,
button.std-tab {
  font: inherit;
  font-size: .74rem;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 1199.98px) {
  .std-map-body { grid-template-columns: 1fr; }
  .std-map-sidebar { border-left: 0; border-top: 1px solid var(--bd-theme-border-111111, #111); }
  .std-map-demo.is-tall-map .std-map-body { height: auto; min-height: 0; }
  .std-map-demo.is-tall-map .std-map-canvas { min-height: 32rem; }
}

/* Keep KPI/chip typography from inheriting a tag's own weight. */
span.std-kpi__value,
div.std-kpi__value {
  font-weight: 900;
}

/* ------------------------------------------------- module title + dock nav */
/*
 * Promoted from templates/standards/index.html and accounting_workspace.css.
 * The /standards/ page presents this as THE module nav but it only existed in
 * that page's inline style and in accounting's own sheet, so service, projects
 * and accounting each grew a private copy.
 */

.std-work-title {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.std-work-title h3 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.2;
}

.std-module-title-icon {
  display: inline-grid;
  place-items: center;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--bd-theme-fg-111827, #111827);
}

.std-project-dock {
  border: 1px solid var(--bd-theme-border-111111, #111);
  border-radius: .82rem;
  overflow: hidden;
  background: var(--bd-theme-bg-ffffff, #fff);
}

.std-project-dock__main {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
  padding: .35rem .5rem;
  border-bottom: 1px solid var(--bd-theme-border-d0d5dd, #d0d5dd);
}

.std-project-dock__sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem;
  padding: .35rem .5rem;
  background: var(--bd-theme-bg-f8fafc, #f8fafc);
}

.std-dock-main-item,
.std-dock-sub-item {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 0;
  background: transparent;
  color: var(--bd-theme-fg-111827, #111827);
  font-size: .78rem;
  font-weight: 800;
  padding: .26rem .5rem;
  border-radius: .4rem;
  cursor: pointer;
  text-decoration: none;
}

.std-dock-main-item:hover,
.std-dock-sub-item:hover {
  background: var(--bd-theme-bg-hover, rgba(148, 163, 184, .16));
  color: var(--bd-theme-fg-111827, #111827);
}

.std-dock-main-item.is-active {
  background: var(--bd-theme-fg-111827, #111);
  color: var(--bd-theme-bg-ffffff, #fff);
}

.std-dock-sub-item.is-active {
  border-color: var(--bd-theme-border-strong, #111);
  background: var(--bd-theme-surface-muted, #f8fafc);
  box-shadow: none;
}

.std-dock-main-item i,
.std-dock-sub-item i {
  font-size: 1em;
  line-height: 1;
  flex: 0 0 auto;
}

@media (max-width: 767.98px) {
  .std-dock-main-item span,
  .std-dock-sub-item span { display: none; }
  .std-dock-main-item, .std-dock-sub-item { padding: .3rem .42rem; }
}


/* ==========================================================================
 * PROMOTED FROM THE GUIDE (static/standards/index.css)
 * --------------------------------------------------------------------------
 * These components are demonstrated at /standards/ and were the canonical
 * vocabulary all along, but they only ever lived in the guide's own stylesheet
 * and in private per-module copies. Accounting alone carried drifted duplicates
 * of 54 of them - most notably std-work-panel, which is the single most used
 * class in the module (497 refs / 215 templates) and had no shared definition.
 *
 * Rules below are the GUIDE's definitions verbatim, with one deliberate change:
 * every bare `var(--std-*)` gained its canonical fallback. The guide declares
 * those tokens on `.std-scope`, and pages that do not carry that class were
 * resolving `border: 1px solid var(--std-border)` to no border at all.
 *
 * Same contract as the rest of this file: plain (0,1,0) selectors, loaded
 * before module stylesheets, theme-bridged colors only.
 * ========================================================================== */

.std-rule-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.std-filter-bar { border: 1px solid var(--bd-theme-border-111111, #111); border-radius: .82rem; padding: .72rem; background: var(--bd-theme-bg-ffffff, #fff); }
/* Folds by its own width (never a fixed five-track row that clips at 1024):
   fields wrap two or more across, and the action cell keeps its buttons at
   their own width at the row end instead of stretching them. */
.std-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .55rem; align-items: end; }
.std-filter-grid > :is(.std-filter-actions, .std-filter-grid__actions) { display: flex; gap: .45rem; justify-content: flex-end; flex-wrap: wrap; }
.std-filter-grid > :is(.std-filter-actions, .std-filter-grid__actions) > .std-btn-sample { width: auto; }
.std-search-control { display: flex; align-items: center; gap: .45rem; border: 1px solid var(--bd-theme-border-111111, #111); border-radius: .55rem; padding: .34rem .55rem; background: var(--bd-theme-bg-ffffff, #fff); }
.std-search-control input { border: 0; outline: 0; width: 100%; min-width: 0; font-size: .9rem; background: transparent; }
/* One focus ring, on the control; the input inside draws none. */
.std-search-control:focus-within { outline: 2px solid var(--bd-theme-accent, #345f8c); outline-offset: 1px; }
.std-search-control input:focus, .std-search-control input:focus-visible { outline: 0; box-shadow: none !important; }
.std-select-shell { border: 1px solid var(--bd-theme-border-111111, #111); border-radius: .55rem; min-height: 33px; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .28rem .5rem; background: var(--bd-theme-bg-ffffff, #fff); font-size: .84rem; }
.std-user-select-row { display:inline-flex; align-items:center; gap:.5rem; min-width:0; }
.std-user-avatar { position:relative; width:28px; height:28px; flex:0 0 28px; display:inline-flex; align-items:center; justify-content:center; overflow:hidden; border:1px solid var(--bd-theme-border-111111,#111); border-radius:999px; background:var(--bd-theme-bg-f7f0e5,#f7f0e5); color:var(--bd-theme-fg-111111,#111); font-size:.7rem; font-weight:850; }
.ts-control > .std-user-select-row.item, .ts-dropdown .std-user-select-row.option { display:inline-flex; align-items:center; gap:.5rem; }
.ts-dropdown .std-user-select-row.option { display:flex; }
.ts-control > .std-user-select-row.item .std-user-avatar { margin-inline-end:.5rem; }
.std-user-avatar img { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:cover; }
.std-user-avatar img[hidden] { display:none; }
.std-user-select-copy { display:inline-flex; min-width:0; flex-direction:column; line-height:1.15; }
.std-user-select-copy strong,.std-user-select-copy small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.std-user-select-copy small { color:var(--std-muted,var(--bd-theme-fg-667085,#667085)); font-size:.68rem; }
.std-sortable { cursor: pointer; user-select: none; }
.std-detail-shell { border: 1px solid var(--bd-theme-border-111111, #111); border-radius: .95rem; overflow: hidden; background: var(--bd-theme-bg-ffffff, #fff); }
.std-detail-head, .std-detail-body, .std-detail-nav { padding: .85rem; }
.std-detail-head, .std-detail-nav { border-bottom: 1px solid var(--bd-theme-border-111111, #111); }
.std-entry-head { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .68rem .78rem; border-bottom: 1px solid var(--bd-theme-border-d9d9d9, #d9d9d9); }
.std-grid-wrap { overflow-x: auto; }
.std-entry-grid { min-width: 920px; }
.std-grid-head, .std-grid-row { display: grid; grid-template-columns: minmax(250px, 2.1fr) minmax(170px, 1.2fr) 84px 96px 110px 104px; }
.std-grid-head > div, .std-grid-row > div { display: flex; align-items: center; min-width: 0; padding: .48rem .55rem; border-right: 1px solid var(--bd-theme-border-e2e2e2, #e2e2e2); border-bottom: 1px solid var(--bd-theme-border-e2e2e2, #e2e2e2); background: var(--bd-theme-bg-ffffff, #fff); }
.std-grid-head > div { color: var(--std-muted, var(--bd-theme-fg-667085, #667085)); font-size: .72rem; font-weight: 800; text-transform: none; letter-spacing: normal; }
.std-grid-row input { width: 100%; border: 0; outline: 0; font-size: .88rem; background: transparent; }
.std-num { justify-content: flex-end; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.std-status-dot { width: .58rem; height: .58rem; border-radius: 999px; display: inline-block; border: 1px solid var(--bd-theme-border-000000-2e, rgba(0,0,0,.18)); background: var(--bd-theme-bg-c9c9c9, #c9c9c9); }
.std-status-dot.is-dirty { background: var(--bd-theme-warning); }
.std-status-dot.is-saving { background: var(--bd-theme-info); }
.std-status-dot.is-saved { background: var(--bd-theme-success); }
.std-status-dot.is-error { background: var(--bd-theme-danger); }
/* Unsaved-change display owned by static/js/shell/bd_dirty_state.js. Color and outline only, so nothing reflows.
   The chip is a fixed 12px wherever it sits, including inside page and modal titles. */
.bd-dirty-chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: .3rem; color: var(--bd-theme-fg-7a4f00, #7a4f00); font-size: 12px; font-weight: 700; line-height: 1.2; letter-spacing: normal; white-space: nowrap; vertical-align: middle; }
.bd-dirty-chip:not(.is-dirty) { display: none; }
.bd-dirty-summary:not(.is-dirty):empty { display: none; }
/* One access and link notice (templates/partials/_review_link_unavailable.html, core.http.access_notice). */
.std-notice-page { width: 100%; max-width: 48rem; margin: 0 auto; padding: 1.5rem 16px; }
.std-notice-page .std-mainstay-body.std-notice-page__body { display: block; }
.std-notice-page__foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.bd-dirty-summary { display: block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body .bd-dirty-summary.is-dirty, html body .std-foot-note.bd-dirty-summary.is-dirty { color: var(--bd-theme-fg-7a4f00, #7a4f00) !important; }
html body label.bd-field-dirty { color: var(--bd-theme-fg-7a4f00, #7a4f00) !important; }
.std-foot-note:has(> .bd-dirty-summary) { min-width: 0; }
html body .bd-field-dirty > :is(label:not(.std-choice-card), .form-label, legend, .std-field-label, .std-msection__h, h3, h4, h5, h6), html body .bd-field-dirty :is(.bd-info-label > label, [data-bd-dirty-label]) { color: var(--bd-theme-fg-7a4f00, #7a4f00) !important; }
html body .bd-field-dirty :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), textarea, select, .ts-control, .std-input-shell, .std-acct-control, .std-authored-control) { border-color: var(--bd-theme-border-b78512, #b78512) !important; background-color: var(--bd-theme-bg-fffaf0, #fffaf0) !important; box-shadow: 0 0 0 2px var(--bd-theme-shadow-b78512-1f, rgba(183, 133, 18, .12)); }
html body .bd-field-dirty.bd-field-dirty :is(.std-input-shell, .std-acct-control, .std-authored-control) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), textarea, select, .ts-control) { border-color: transparent !important; background-color: transparent !important; box-shadow: none !important; }
html body .bd-field-dirty :is(input[type=checkbox], input[type=radio]):not(.std-choice-card *):not(.std-switch *):not(.bd-hidden-input) { outline: 2px solid var(--bd-theme-border-b78512, #b78512); outline-offset: 1px; }
html body .bd-field-dirty :is(.std-switch__track, .bd-switch__control, .bd-slider) { box-shadow: 0 0 0 2px var(--bd-theme-border-b78512, #b78512); }
html body .bd-field-dirty .std-choice-card:is(.is-selected, :has(input:checked)), html body .bd-field-dirty.std-choice-card, html body .bd-field-dirty.bd-subcard, html body .bd-field-dirty.bd-wizard-tool { box-shadow: inset 0 0 0 2px var(--bd-theme-border-b78512, #b78512) !important; }
/* Validation feedback is owned by bd_client_validation.css. */
.std-ap-entry-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .42fr); gap: .85rem; align-items: start; }
.std-ap-form-card { border: 1px solid var(--bd-theme-border-111111, #111); border-radius: .65rem; padding: .85rem; background: var(--bd-theme-bg-ffffff, #fff); }
.std-ap-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.std-ap-derived-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.std-ap-derived-field { border: 1px solid var(--bd-theme-border-d0d5dd, #d0d5dd); border-radius: .45rem; padding: .38rem .48rem; background: var(--bd-theme-bg-f8fafc, #f8fafc); min-height: 44px; }
.std-ap-entry-layout .std-search-control { min-height: 34px; font-size: .82rem; }
.std-ap-math-card { border: 1px solid var(--bd-theme-border-111111, #111); border-radius: .65rem; overflow: hidden; background: var(--bd-theme-bg-ffffff, #fff); }
.std-ap-math-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(132px, .38fr); align-items: center; min-height: 38px; border-bottom: 1px solid var(--bd-theme-border-e2e2e2, #e2e2e2); }
.std-ap-math-row:last-child { border-bottom: 0; }
.std-ap-math-row > span, .std-ap-math-row > div, .std-ap-math-row > input { padding: .42rem .58rem; }
.std-ap-math-row > span { color: var(--bd-theme-fg-475467, #475467); font-size: .78rem; font-weight: 800; text-transform: none; }
.std-ap-math-row input { width: 100%; border: 0; border-left: 1px solid var(--bd-theme-border-e2e2e2, #e2e2e2); outline: 0; background: transparent; text-align: right; font-weight: 800; }
.std-ap-math-row > div { border-left: 1px solid var(--bd-theme-border-e2e2e2, #e2e2e2); text-align: right; font-weight: 800; }
.std-ap-sheet-grid { border: 1px solid var(--bd-theme-border-111111, #111); border-radius: .65rem; min-width: 1180px; overflow: hidden; }
.std-ap-sheet-grid .std-grid-head, .std-ap-sheet-grid .std-grid-row { grid-template-columns: 44px minmax(140px, .9fr) minmax(170px, 1.1fr) minmax(130px, .85fr) minmax(110px, .72fr) 96px 70px 104px 104px 38px 82px; }
.std-ap-sheet-grid .std-grid-head > div { background: var(--bd-theme-bg-f8fafc, #f8fafc); border-bottom: 1px solid var(--bd-theme-border-111111, #111); }
.std-ap-sheet-grid .std-grid-head > div:last-child, .std-ap-sheet-grid .std-grid-row > div:last-child { border-right: 0; }
.std-ap-sheet-grid .std-grid-row:last-child > div { border-bottom: 0; }
.std-ap-sheet-grid .std-grid-row input { min-height: 32px; }
.std-ap-sheet-grid .std-grid-row > div { position: relative; }
.std-ap-sheet-grid .std-grid-row > div:focus, .std-ap-sheet-grid .std-grid-row > div:focus-within { z-index: 2; background: var(--bd-theme-bg-f8fafc, #f8fafc); box-shadow: inset 0 0 0 2px var(--bd-theme-shadow-111827, #111827); outline: 0; }
.std-ap-sheet-grid .std-grid-row > div[data-sheet-cell] { cursor: cell; }
.std-ap-add-row > div { background: var(--bd-theme-bg-f8fafc, #f8fafc); min-height: 42px; }
.std-ap-add-row > div:nth-child(2):last-child { grid-column: span 9; }
.std-ap-add-row button { border: 0; background: transparent; color: var(--bd-theme-fg-344054, #344054); font-weight: 800; }
.std-ap-posting-rule { display: flex; align-items: flex-start; gap: .55rem; border: 1px solid var(--bd-theme-border-d0d5dd, #d0d5dd); border-radius: .65rem; padding: .65rem .75rem; color: var(--bd-theme-fg-475467, #475467); background: var(--bd-theme-bg-ffffff, #fff); }
.std-ap-posting-rule i { color: var(--bd-theme-fg-111827, #111827); font-size: 1.05rem; line-height: 1.35; }
.std-ap-bottom-actions { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; flex-wrap: wrap; border-top: 1px solid var(--bd-theme-border-d0d5dd, #d0d5dd); margin-top: .85rem; padding-top: .85rem; }
.std-acct-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.std-acct-total { border: 1px solid var(--bd-theme-border-d0d5dd, #d0d5dd); border-radius: .58rem; padding: .48rem .55rem; background: var(--bd-theme-bg-ffffff, #fff); }
.std-ap-dropzone { min-height: 157px; display: grid; place-items: center; border: 1px dashed var(--bd-theme-border-111111, #111); border-radius: .82rem; background: var(--bd-theme-bg-ffffff, #fff); padding: 1rem; text-align: center; }
.std-ap-dropzone i { display: block; margin-bottom: .45rem; color: var(--bd-theme-fg-111827, #111827); font-size: 1.8rem; line-height: 1; }
.std-mainstay-shell { border: 1px solid var(--bd-theme-border-111111, #111); border-radius: .9rem; background: var(--bd-theme-bg-ffffff, #fff); overflow: hidden; }
.std-mainstay-head, .std-mainstay-viewbar, .std-mainstay-body, .std-mainstay-footer { padding: .85rem; }
.std-mainstay-head, .std-mainstay-viewbar { border-bottom: 1px solid var(--bd-theme-border-111111, #111); }
.std-mainstay-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .85rem; flex-wrap: wrap; }
.std-mainstay-title { margin: 0; display: flex; align-items: center; gap: .45rem; color: var(--bd-theme-fg-111827, #111827); font-size: 1.05rem; font-weight: 900; }
.std-mainstay-viewbar { display: flex; align-items: center; justify-content: space-between; gap: .7rem; flex-wrap: wrap; background: var(--bd-theme-bg-f8fafc, #f8fafc); }
.std-view-chip-row { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.std-view-chip { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--bd-theme-border-d0d5dd, #d0d5dd); border-radius: .55rem; background: var(--bd-theme-bg-ffffff, #fff); color: var(--bd-theme-fg-344054, #344054); padding: .32rem .5rem; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.std-view-chip.is-active { border-color: var(--bd-fill-active); background: var(--bd-fill-active); color: var(--bd-fill-active-text); }
/* A filter-bar dropdown (owner decision 50): keeps its own width in a flex filter row and matches the search control height. */
.std-filter-select { width: auto; flex: 0 0 auto; min-height: 34px; border: 1px solid var(--bd-theme-border-111111, #111); border-radius: .55rem; background-color: var(--bd-theme-bg-ffffff, #fff); font-size: .85rem; font-weight: 700; }
/* The theme forces field padding with !important; an auto-width select needs room for its chevron. */
.std-filter-select.form-select { padding-right: 2rem !important; }
.std-filter-select:focus-visible { outline: 2px solid var(--bd-theme-accent, #345f8c); outline-offset: 1px; box-shadow: none; }
.std-mainstay-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .62fr); gap: .85rem; align-items: start; }
.std-work-panel { border: 1px solid var(--bd-theme-border-111111, #111); border-radius: .75rem; background: var(--bd-theme-bg-ffffff, #fff); overflow: hidden; }
.std-work-panel__head { display: flex; align-items: center; justify-content: space-between; gap: .65rem; flex-wrap: wrap; border-bottom: 1px solid var(--bd-theme-border-111111, #111); padding: .65rem .75rem; }
.std-work-panel__body { padding: .72rem .75rem; }
.std-work-panel__title { display: flex; align-items: center; gap: .42rem; margin: 0; color: var(--bd-theme-fg-111827, #111827); font-size: .92rem; font-weight: 900; }
.std-mainstay-side { display: grid; gap: .85rem; }
.std-aging-mini-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 72px; gap: .55rem; align-items: center; padding: .35rem 0; font-size: .82rem; }
.std-aging-mini-track { height: .48rem; border: 1px solid var(--bd-theme-border-111111, #111); border-radius: 0; background: var(--bd-theme-bg-ffffff, #fff); overflow: hidden; }
.std-aging-mini-fill { display: block; height: 100%; background: var(--bd-theme-bg-111827, #111827); }
.std-mainstay-footer { border-top: 1px solid var(--bd-theme-border-111111, #111); background: var(--bd-theme-bg-f8fafc, #f8fafc); }
.std-variance-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; align-items: start; border: 1px solid var(--bd-theme-border, #d0d5dd); border-radius: .62rem; padding: .55rem .62rem; background: var(--bd-theme-bg-ffffff, #fff); }
.std-modal-card { max-width: 760px; margin-inline: auto; border: 1px solid var(--bd-theme-border-111111, #111); border-radius: .82rem; background: var(--bd-theme-bg-ffffff, #fff); overflow: hidden; box-shadow: 0 .7rem 1.7rem var(--bd-theme-shadow-0f172a-24, rgba(15, 23, 42, .14)); }
.std-modal-head, .std-modal-foot { min-height: 54px; padding: .72rem .85rem; background: var(--bd-theme-bg-ffffff, #fff); display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.std-modal-head { border-bottom: 1px solid var(--bd-theme-border-111111, #111); }
.std-modal-body { padding: .85rem; overflow: auto; background: var(--bd-theme-bg-ffffff, #fff); }
/* The 360px cap is for the static specimens on /standards/ only. Live modals size their
   body to the safe frame (docs/MODAL_STANDARD_V2.md §1) through .bdm2 in bd_modal_v2.css. */
.std-page .std-modal-body, .std-demo .std-modal-body { max-height: 360px; }
.std-modal-foot { border-top: 1px solid var(--bd-theme-border-111111, #111); justify-content: flex-end; flex-wrap: wrap; }
.std-modal-close { width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid var(--bd-theme-border-111111, #111); border-radius: .55rem; display: inline-flex; align-items: center; justify-content: center; background: var(--bd-theme-bg-ffffff, #fff); color: var(--bd-theme-fg-111827, #111827); }

@media (max-width: 1199.98px) {
  .std-rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .std-mainstay-body { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
  .std-rule-grid { grid-template-columns: 1fr; }
  .std-filter-grid { grid-template-columns: 1fr; }
  .std-ap-entry-layout, .std-ap-form-grid, .std-ap-derived-grid, .std-acct-totals, .std-mainstay-body, .std-aging-mini-row, .std-variance-row { grid-template-columns: 1fr; }
}

/* Denser row padding for reference/lookup tables that carry many short rows. */
.std-table-compact th,
.std-table-compact td {
  padding: .38rem .48rem;
}

/* ====================================================================== */
/* MODULE NAVIGATION — the /standards/ contract, verbatim                  */
/*                                                                        */
/* Level 1 (module): rounded button, action fill when active.             */
/* Level 2 (object): quiet bordered selection, never an accent edge.      */
/* Two levels must not share one active treatment or the page stops        */
/* saying which choice is which.                                          */
/*                                                                        */
/* Phone menus are separate components and are deliberately not matched    */
/* here; see .service-nav-mobile and .bd-module-nav-toggle.               */
/* ====================================================================== */
.dock-main-item,
.dock-sub-item,
.tc-main-item,
.tc-sub-item,
.hr-module-nav .hr-nav-item,
.manpower-tab-nav .bd-pill-link,
#estimate-nav .bd-pill-link,
.bd-settings-category-link,
.bd-personal-nav .bd-work-nav__main > a,
.ana-tab,
.bd-support-tab,
.profile-section-nav a,
.obs-workbench-nav .obs-tab,
.bd-mr-tabs button,
.pqm-tab,
.acct-tab,
.bd-tablist .nav-link,
.std-dock-main-item,
.std-dock-sub-item,
.bd-settings-subnav .bd-pill-link,
.svc-queue-tabs button {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex: 0 0 auto;
  border: 1px solid transparent;
  background: transparent;
  color: var(--bd-theme-text, #344054);
  font-size: .75rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: none;
}

/* The glyph, not the label, was setting the row height: module sheets left nav
   icons at 17px/25.5px line-height, so 25.5 + 12.6 padding made a 40px item
   inside a 31px contract. Pin the icon so min-height governs. */
.dock-main-item > i,
.dock-sub-item > i,
.tc-main-item > i,
.tc-sub-item > i,
.dock-main-item > .mdi,
.dock-sub-item > .mdi,
.tc-main-item > .mdi,
.tc-sub-item > .mdi,
.hr-module-nav .hr-nav-item > i,
.hr-module-nav .hr-nav-item > .mdi,
.manpower-tab-nav .bd-pill-link > i,
.manpower-tab-nav .bd-pill-link > .mdi,
#estimate-nav .bd-pill-link > i,
#estimate-nav .bd-pill-link > .mdi,
.bd-settings-category-link > i,
.bd-settings-category-link > .mdi,
.bd-personal-nav .bd-work-nav__main > a > i,
.bd-personal-nav .bd-work-nav__main > a > .mdi,
.ana-tab > i,
.ana-tab > .mdi,
.bd-support-tab > i,
.bd-support-tab > .mdi,
.profile-section-nav a > i,
.profile-section-nav a > .mdi,
.obs-workbench-nav .obs-tab > i,
.obs-workbench-nav .obs-tab > .mdi,
.bd-mr-tabs button > i,
.bd-mr-tabs button > .mdi,
.pqm-tab > i,
.pqm-tab > .mdi,
.inv-nav-item > i,
.inv-nav-item > .mdi,
.acct-tab > i,
.acct-tab > .mdi,
.bd-tablist .nav-link > i,
.bd-tablist .nav-link > .mdi,
.bd-settings-subnav .bd-pill-link > i,
.bd-settings-subnav .bd-pill-link > .mdi,
.svc-queue-tabs button > i,
.svc-queue-tabs button > .mdi {
  font-size: 1rem !important;
  line-height: 1 !important;
  flex: 0 0 auto;
}

.dock-main-item,
.tc-main-item,
.hr-module-nav .hr-nav-item,
.manpower-tab-nav .bd-pill-link,
#estimate-nav .bd-pill-link,
.bd-settings-category-link,
.bd-personal-nav .bd-work-nav__main > a,
.ana-tab,
.bd-support-tab,
.profile-section-nav a,
.obs-workbench-nav .obs-tab,
.bd-mr-tabs button,
.pqm-tab,
.acct-tab,
.bd-tablist .nav-link,
.std-dock-main-item {
  min-height: 31px;
  padding: .42rem .58rem;
  border-radius: 7px;
}

.dock-sub-item,
.tc-sub-item,
.inv-nav-item,
.bd-settings-subnav .bd-pill-link,
.svc-queue-tabs button,
.std-dock-sub-item {
  min-height: 28px;
  padding: .32rem .58rem;
  border-radius: 0;
  border-bottom-color: transparent;
}

.dock-main-item:hover,
.dock-sub-item:hover,
.tc-main-item:hover,
.tc-sub-item:hover,
.hr-module-nav .hr-nav-item:hover,
.manpower-tab-nav .bd-pill-link:hover,
#estimate-nav .bd-pill-link:hover,
.bd-settings-category-link:hover,
.bd-personal-nav .bd-work-nav__main > a:hover,
.ana-tab:hover,
.bd-support-tab:hover,
.profile-section-nav a:hover,
.obs-workbench-nav .obs-tab:hover,
.bd-mr-tabs button:hover,
.pqm-tab:hover,
.inv-nav-item:hover,
.acct-tab:hover,
.std-dock-main-item:hover,
.std-dock-sub-item:hover,
.bd-tablist .nav-link:hover,
.bd-settings-subnav .bd-pill-link:hover,
.svc-queue-tabs button:hover {
  color: var(--bd-theme-text-strong, #111827);
  background: var(--bd-theme-surface-muted, #f8fafc);
}

.dock-main-item.active,
.dock-main-item.is-active,
.tc-main-item.active,
.tc-main-item.is-active,
.hr-module-nav .hr-nav-item.active,
.hr-module-nav .hr-nav-item.is-active,
.manpower-tab-nav .bd-pill-link.active,
.manpower-tab-nav .bd-pill-link.is-active,
#estimate-nav .bd-pill-link.active,
#estimate-nav .bd-pill-link.is-active,
.bd-settings-category-link.active,
.bd-settings-category-link.is-active,
.bd-personal-nav .bd-work-nav__main > a.active,
.bd-personal-nav .bd-work-nav__main > a.is-active,
.ana-tab.active,
.ana-tab.is-active,
.bd-support-tab.active,
.bd-support-tab.is-active,
.profile-section-nav a.active,
.profile-section-nav a.is-active,
.obs-workbench-nav .obs-tab.active,
.obs-workbench-nav .obs-tab.is-active,
.bd-mr-tabs button.active,
.bd-mr-tabs button.is-active,
.pqm-tab.active,
.pqm-tab.is-active,
.acct-tab.active,
.acct-tab.is-active,
.bd-tablist .nav-link.active,
.bd-tablist .nav-link.is-active,
.std-dock-main-item.active,
.std-dock-main-item.is-active {
  border-color: var(--bd-theme-border-strong, #111);
  background: var(--bd-theme-action, #111827);
  color: var(--bd-theme-action-text, #fff);
}

.dock-sub-item.active,
.dock-sub-item.is-active,
.tc-sub-item.active,
.tc-sub-item.is-active,
.inv-nav-item.active,
.inv-nav-item.is-active,
.bd-settings-subnav .bd-pill-link.active,
.bd-settings-subnav .bd-pill-link.is-active,
.svc-queue-tabs button.active,
.svc-queue-tabs button.is-active,
.std-dock-sub-item.active,
.std-dock-sub-item.is-active {
  border-color: var(--bd-theme-border-strong, #111);
  border-radius: .4rem;
  background: var(--bd-theme-surface-muted, #f8fafc);
  color: var(--bd-theme-text-strong, #111827);
  box-shadow: none;
}

.dock-sub-item:hover,
.tc-sub-item:hover { border-bottom-color: transparent; }
.dock-sub-item.active:hover,
.dock-sub-item.is-active:hover,
.tc-sub-item.active:hover,
.tc-sub-item.is-active:hover { border-bottom-color: var(--bd-theme-border-strong, #111); }

/* The row scrolls sideways rather than wrapping into a second line. Twelve
   Estimates tabs wrapped onto a centered second row, which reads as two
   separate navs. */
.service-nav-main,
.subnav-row,
#estimate-nav .manpower-tab-nav,
.acct-dock-row {
  /* !important because the Estimates row carries Bootstrap's `.d-flex` plus a
     module rule that re-wraps it; without this the 12th tab drops to its own
     line and reads as a second nav. */
  flex-wrap: nowrap !important;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

/* ====================================================================== */
/* FILTER FIELD — the guide's .std-input-shell, shared                     */
/* A filter is one bordered field with its icon INSIDE it. It is never a   */
/* label chunk welded to a control inside a button strip: that reads as    */
/* two controls, gives the select two competing borders, and leaves the    */
/* joined seam without a bottom edge. Button strips stay for buttons.      */
/* ====================================================================== */
.std-field-demo {
  display: grid;
  gap: .38rem;
}

.std-field-demo > label {
  margin: 0;
  color: var(--bd-theme-text-strong, var(--bd-theme-fg-344054, #344054));
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.2;
}

.std-input-shell {
  display: flex;
  align-items: center;
  gap: .48rem;
  min-height: 32px;
  padding: .28rem .65rem;
  border: 1px solid var(--bd-theme-border-111111, #111);
  border-radius: 6px;
  background: var(--bd-theme-bg-ffffff, #fff);
  color: var(--bd-theme-fg-344054, #344054);
  font-size: .8rem;
  /* A shell never grows past its column: its input clips instead of pushing
     the border over the next field (LF-0413). */
  min-width: 0;
  max-width: 100%;
}

.std-input-shell:focus-within {
  border-color: var(--bd-theme-border-strong, #111);
  box-shadow: 0 0 0 3px var(--bd-theme-shadow-111111-1a, rgba(17, 17, 17, .1));
}

.std-input-shell > i,
.std-input-shell > .mdi {
  flex: 0 0 auto;
  color: var(--bd-theme-text-muted, var(--bd-theme-fg-667085, #667085));
  font-size: 1rem;
  line-height: 1;
}

.std-input-shell > :is(input, select, textarea) {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit;
  font: inherit;
}

.std-input-shell.bd-invalid {
  border-color: var(--bd-theme-border-b42318, #b42318);
}

/* A TomSelect inside the shell takes the shell's one border; it draws no box of its own.
   Promoted from personalization.css so every shelled select gets it. */
.std-input-shell > .ts-wrapper {
  flex: 1;
  min-width: 0;
}

.std-input-shell > .ts-wrapper.ts-wrapper .ts-control,
.std-input-shell > .ts-wrapper.single.input-active .ts-control,
.std-input-shell > .ts-wrapper.focus.focus .ts-control {
  min-height: 0 !important;
  padding: 0 24px 0 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit;
}


.std-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin: 0;
  cursor: pointer;
}

.std-switch > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.std-field {
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  min-height: 32px;
  padding: .28rem .65rem;
  border: 1px solid var(--bd-theme-border-111111, #111);
  border-radius: 6px;
  background: var(--bd-theme-bg-ffffff, #fff);
  color: var(--bd-theme-fg-344054, #344054);
  font-size: .8rem;
}

.std-field > i,
.std-field > .mdi {
  flex: 0 0 auto;
  color: var(--bd-theme-fg-475467, #475467);
  font-size: 1rem;
  line-height: 1;
}

.std-field > input,
.std-field > select {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: 700;
}

/* A `<label class="std-field">` picks up Bootstrap's `label{margin-bottom:.5rem}`
   and sits 8px lower than the sibling divs in the same filter row. */
label.std-field { margin-bottom: 0; }

/* A label that wraps its own radio or checkbox is the control itself (choice
   card, segmented strip cell, chip, toggle row), not a caption above a field.
   Bootstrap's caption margin left every such cell 8px short of its row, so
   strips showed a dead band under the selected underline and card grids got
   uneven row spacing. Same specificity as Bootstrap's `label`, so any
   component that sets its own margin still wins. */
label:where(:has(input[type="radio"], input[type="checkbox"])) { margin-bottom: 0; }
/* A bare `<label><input type="checkbox"> Text</label>` (no component class)
   sat the box on the text baseline with only a space between them. */
label:where(:not([class]):has(> input[type="radio"], > input[type="checkbox"])) {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
/* `<label class="form-check"><input class="form-check-input"><span class="form-check-label">`
   relied on Bootstrap's float and negative margin; the checkbox contract zeroes
   input margins, so the box touched its caption. Lay the pair out as a row. */
label.form-check:where(:not(.form-switch):has(> input.form-check-input:not([role="switch"]) + .form-check-label)) {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-left: 0;
}

/* A searchable select inside a field takes the FIELD's geometry. Leaving it on
   the standalone TomSelect geometry is what produced a rounded control floating
   inside a square one, and a 47px field beside 38px ones.
   `discovery.css` carries several `html body .ts-wrapper .ts-control` rules with
   `!important`, which out-specify a plain `.std-field .ts-control` even when that
   is also `!important` — hence the `html body` prefix here. */
html body .std-field .ts-wrapper,
html body .std-field .ts-wrapper .ts-control {
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font: inherit !important;
}

/* The field draws the one focus ring; the control inside never draws a second box
   (bd_global_overrides outlines every focused .ts-control). */
html body .std-field .ts-wrapper .ts-control,
html body .std-field .ts-wrapper:is(.focus, .input-active, .dropdown-active).single .ts-control {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
.std-field:focus-within { outline: 2px solid var(--bd-theme-accent, #111); outline-offset: 1px; }

html body .std-field .ts-wrapper .ts-control > input {
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  font: inherit !important;
}

/* TomSelect's own caret is redundant beside the field's leading icon, but it
   reserves 28px of right padding for it. Keep the caret, drop the reservation. */
/* discovery.css sets `flex-wrap: wrap` on every .ts-control so multi-select
   chips can flow. On a SINGLE select that wraps the selected item and the
   typing input onto two lines, which is what made these fields 47px against
   the 38px ones beside them. */
html body .std-field .ts-wrapper.single .ts-control {
  flex-wrap: nowrap !important;
  padding-right: 1.6rem !important;
}

html body .std-field .ts-wrapper.single .ts-control > input {
  flex: 1 1 auto !important;
  width: 0 !important;
}
/* The caret keeps its gutter even where a module zeroes the control padding, the selected
   value truncates before it, and the control stays inside its grid or flex cell (tomselect-field). */
html body .std-field .ts-wrapper { flex: 1 1 auto; min-width: 0; max-width: 100%; }
html body .std-field .ts-wrapper.single.single .ts-control { padding-right: 1.6rem !important; }
html body .std-field .ts-wrapper.single .ts-control > .item { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.std-field--grow { flex: 1 1 260px; }

/* TomSelect dropdowns are portaled to #bd-portal-root, so they lose every
   ancestor class. Their surface has to be stated globally or they render as a
   bare unbordered list beside a bordered control. */
html body .ts-dropdown {
  border: 1px solid var(--bd-theme-border-111111, #111);
  border-radius: 8px;
  background: var(--bd-theme-bg-ffffff, #fff);
  box-shadow: 0 12px 28px var(--bd-theme-shadow-111827-29, rgba(17, 24, 39, .16));
  font-size: .8rem;
  overflow: hidden;
}

html body .ts-dropdown .option {
  padding: .38rem .6rem;
  color: var(--bd-theme-fg-344054, #344054);
  line-height: 1.25;
}

html body .ts-dropdown .active {
  color: var(--bd-theme-fg-111827, #111827);
  background: var(--bd-theme-bg-f8fafc, #f8fafc);
}

/* ====================================================================== */
/* ROUNDED CONTAINERS: the edge child follows the curve                    */
/*                                                                        */
/* A container with a radius that does NOT clip shows a square corner      */
/* wherever a painted child reaches its edge — a sticky header, a panel    */
/* head, a filter bar. `border-radius: inherit` is correct here because    */
/* these are DIRECT children, so `inherit` resolves to the container's own */
/* radius. (It is NOT correct on a table cell, whose parent is the row.)   */
/* ====================================================================== */
html body :is(.std-work-panel, .estimate-list-shell, .bd-files-module-shell) > :first-child {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

html body :is(.std-work-panel, .estimate-list-shell, .bd-files-module-shell) > :last-child {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}

/* A collapsed <details> panel: the body is still in the DOM and still the last
   child, but it is not rendered, so the SUMMARY is the panel's bottom edge and
   has to carry the bottom radius. Matching on `:last-child` alone misses this. */
/* `.std-work-panel:not([open])` would have matched every panel that is not a
   <details> — i.e. nearly all of them — and rounded a head that still has a
   body under it. Only these two cases put the head at the panel's bottom edge. */
html body .std-work-panel > .std-work-panel__head:last-child,
html body details.std-work-panel:not([open]) > .std-work-panel__head {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
  /* Nothing sits under it, so no divider: the panel's own edge closes it. */
  border-bottom-width: 0;
}

/* Nested shells must agree on their radius, or the outer one shows a ring of
   its own colour around the inner one at every corner. */
html body .bd-files-module-shell > .bd-file-manager-modal,
html body .bd-files-module-shell > .bdm2 {
  border-radius: inherit;
}

/* ====================================================================== */
/* FIGURES                                                                 */
/*                                                                        */
/* Any element that carries a number is atomic and uses tabular numerals   */
/* so digits line up down a column. These four classes wrap `${{ }}` output */
/* in 40 places and had NO rule anywhere in the repo — they inherited      */
/* whatever the parent did, which under a KPI value meant breaking a       */
/* currency figure across two lines.                                       */
/* ====================================================================== */
.std-figure,
.math-value,
.co-readonly,
.tm-kv-v,
.lead-fact-card__value,
.bdw-money-amount,
.bdw-aging-bucket,
.bd-price-chip,
.footer-total,
.num-cell,
.cx-kpi__value,
.pa-total-value,
.svc-kv-v {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bd-dropdown-caret{display:inline-block;width:.45rem;height:.45rem;flex:0 0 .45rem;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg) translateY(-2px);transform-origin:center}
.bd-send-menu-button{display:inline-flex!important;align-items:center;justify-content:center;gap:.45rem;min-height:34px;padding:.36rem .65rem!important;white-space:nowrap}.bd-send-menu-button.dropdown-toggle::after{display:none!important}.bd-send-menu-button .bd-dropdown-caret{margin-left:.15rem}

/* Card command menu: shared dropdown treatment for compact, contextual actions. */
.bd-card-context-menu{min-width:min(296px,calc(100vw - 24px));max-width:calc(100vw - 24px);animation:none!important;padding:5px!important;border:1px solid var(--bd-theme-border-111111,#111)!important;border-radius:5px!important;background:var(--bd-theme-bg-ffffff,#fff);box-shadow:0 12px 28px var(--bd-theme-shadow-0f172a-29,rgba(15,23,42,.16))!important}
.bd-card-context-menu__label{padding:5px 8px 7px;border-bottom:1px solid var(--bd-theme-border-d0d5dd,#d0d5dd);color:var(--bd-theme-fg-667085,#667085);font-size:.62rem;font-weight:850;letter-spacing:normal;text-transform:none}
.bd-card-context-menu__separator{height:1px;margin:4px 3px;background:var(--bd-theme-border-d0d5dd,#d0d5dd)}
.bd-card-context-menu .bd-card-context-menu__item{display:grid!important;width:100%;min-height:44px;grid-template-columns:22px minmax(0,1fr) 14px;align-items:center;gap:7px;padding:6px 7px!important;border:0!important;border-radius:3px!important;background:transparent!important;color:var(--bd-theme-fg-344054,#344054)!important;text-align:left;white-space:normal}
.bd-card-context-menu .bd-card-context-menu__item:hover,.bd-card-context-menu .bd-card-context-menu__item:focus-visible{outline:0;background:var(--bd-theme-bg-eef4ff,#eef4ff)!important;color:var(--bd-theme-fg-111111,#111)!important}
.bd-card-context-menu__item>i{width:22px;color:var(--bd-theme-fg-475467,#475467);font-size:1rem;text-align:center}
.bd-card-context-menu__item-copy{display:grid;gap:1px;min-width:0}.bd-card-context-menu__item-copy strong{font-size:.73rem;line-height:1.2}.bd-card-context-menu__item-copy small{color:var(--bd-theme-fg-667085,#667085);font-size:.63rem;line-height:1.25;white-space:normal}.bd-card-context-menu__trail{color:var(--bd-theme-fg-667085,#667085)!important;font-size:.85rem!important}
.bd-card-context-menu .bd-card-context-menu__item.is-danger,.bd-card-context-menu .bd-card-context-menu__item.is-danger>i{color:var(--bd-theme-fg-cc334f,#cc334f)!important}
.bd-card-context-menu .bd-card-context-menu__item.is-danger:hover,.bd-card-context-menu .bd-card-context-menu__item.is-danger:focus-visible{background:var(--bd-theme-bg-fbf3f2,#fbf3f2)!important}
.bd-card-context-menu>li>form{display:block;margin:0}

/* Shared boolean switches: compact rectangular track, theme accent, no state badge.
   Explicit legacy adapters keep module controls consistent without changing behavior.
   Dim and dark give the off thumb a light gray so it reads against the muted track;
   the on state uses the on-accent thumb so it reads against the accent track in every theme. */
:root[data-theme="dim"], :root[data-theme="dark"] { --bd-switch-thumb-off: var(--bd-theme-text-muted, #b7c0ca); --bd-switch-track-off: var(--bd-theme-surface-muted); }
html body .std-switch__track,
html body .bd-switch__control,
html body .bd-slider,
html body .nh-switch,
html body .crm-switch,
html body .cx-switch > span,
html body .profile-switch,
html body .form-switch input.form-check-input,
html body .est-toggle-row > input.form-check-input[role="switch"] {
  box-sizing: border-box !important; position: relative !important;
  display: inline-block !important; flex: 0 0 38px !important;
  width: 38px !important; min-width: 38px !important; height: 22px !important;
  padding: 0 !important; border: 1px solid var(--bd-theme-border-strong, #475467) !important;
  border-radius: 7px !important; background: var(--bd-theme-surface-muted, #e5e7eb) !important;
  background-image: none !important; box-shadow: none !important;
  appearance: none !important; vertical-align: middle; cursor: pointer;
  transition: background-color .12s ease !important;
}
html body .std-switch__track::after,
html body .bd-switch__control::after,
html body .bd-slider::before,
html body .nh-switch::after,
html body .crm-switch::after,
html body .cx-switch > span::after,
html body .profile-switch::after,
html body .form-switch input.form-check-input::after,
html body .est-toggle-row > input.form-check-input[role="switch"]::after {
  content: "" !important; box-sizing: border-box !important; position: absolute !important;
  top: 3px !important; left: 3px !important; width: 14px !important; height: 14px !important;
  border: 1px solid var(--bd-theme-border-strong, #475467) !important;
  border-radius: 4px !important; background: var(--bd-switch-thumb-off, var(--bd-theme-bg-ffffff, #fff)) !important;
  box-shadow: none !important; transform: translateX(0) !important;
  transition: transform .12s ease !important;
}
html body input:checked + .std-switch__track,
html body input:checked + .bd-switch__control,
html body input:checked + .bd-slider,
html body input:checked + .nh-switch,
html body input:checked + .crm-switch,
html body .cx-switch input:checked + span,
html body .profile-notary-declaration:has(input:checked) .profile-switch,
html body .form-switch input.form-check-input:checked,
html body .est-toggle-row > input.form-check-input[role="switch"]:checked { background: var(--bd-theme-accent, #2563eb) !important; }
html body input:checked + .std-switch__track::after,
html body input:checked + .bd-switch__control::after,
html body input:checked + .bd-slider::before,
html body input:checked + .nh-switch::after,
html body input:checked + .crm-switch::after,
html body .cx-switch input:checked + span::after,
html body .profile-notary-declaration:has(input:checked) .profile-switch::after,
html body .form-switch input.form-check-input:checked::after,
html body .est-toggle-row > input.form-check-input[role="switch"]:checked::after { transform: translateX(16px) !important; background: var(--bd-theme-on-accent, #fff) !important; }
html body input:focus-visible + .std-switch__track,
html body input:focus-visible + .bd-switch__control,
html body input:focus-visible + .bd-slider,
html body input:focus-visible + .nh-switch,
html body input:focus-visible + .crm-switch,
html body .cx-switch input:focus-visible + span,
html body .profile-notary-declaration:has(input:focus-visible) .profile-switch,
html body .form-switch input.form-check-input:focus-visible,
html body .est-toggle-row > input.form-check-input[role="switch"]:focus-visible { outline: 2px solid var(--bd-theme-accent, #2563eb) !important; outline-offset: 3px !important; }
html body input:disabled + .std-switch__track,
html body input:disabled + .bd-switch__control,
html body input:disabled + .bd-slider,
html body input:disabled + .nh-switch,
html body input:disabled + .crm-switch,
html body .cx-switch input:disabled + span,
html body .profile-notary-declaration:has(input:disabled) .profile-switch,
html body .form-switch input.form-check-input:disabled,
html body .est-toggle-row > input.form-check-input[role="switch"]:disabled { opacity: .45 !important; cursor: not-allowed !important; }
html body :is(.std-switch,.bd-switch,.cx-switch,.nh-switch-row,.crm-rule-row,.employee-switch,.mp-asset-switch) input[type="checkbox"] {
  display: block !important; position: absolute !important; width: 1px !important;
  min-width: 1px !important; height: 1px !important; margin: -1px !important;
  padding: 0 !important; opacity: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important;
}
:where(.std-choice-card, .std-choice-row) { position: relative; }
html body :is(.std-choice-card, .std-choice-row) > input.bd-hidden-input {
  display: block !important; position: absolute !important; width: 1px !important;
  min-width: 1px !important; height: 1px !important; margin: -1px !important;
  padding: 0 !important; opacity: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important;
  white-space: nowrap !important; border: 0 !important; appearance: none !important;
}
html body .bd-switch { width: 38px; height: 22px; flex-shrink: 0; }
html body .cx-switch { width: auto; min-height: 22px; grid-template-columns: 38px auto; }
html body .form-switch { min-height: 22px; padding-left: 3em; }
html body .form-switch input.form-check-input::before { content: none !important; }
/* One check and switch row (form-controls, rank 28): a raw Bootstrap .form-check or
   .form-switch row, or the house .std-check, lays the control and its caption out as one row
   with a fixed gap, the caption on the control's centre line instead of under its baseline.
   Every existing form-check row gets it without a template change. */
html body :is(.form-check, .std-check):has(> input:is(.form-check-input, [type="checkbox"], [type="radio"])) {
  display: flex; align-items: center; gap: .5rem; min-height: 24px; margin-bottom: 0; padding-left: 0;
}
html body :is(.form-check-inline, .std-check.is-inline):has(> input:is(.form-check-input, [type="checkbox"], [type="radio"])) { display: inline-flex; margin-right: 1rem; }
html body :is(.form-check, .std-check) > input:is(.form-check-input, [type="checkbox"], [type="radio"]) { float: none !important; flex: 0 0 auto; margin: 0 !important; }
html body :is(.form-check, .std-check) > :is(label, .form-check-label, span) { margin: 0; line-height: 1.3; }
@media (prefers-reduced-motion: reduce) {
  html body :is(.std-switch__track,.bd-switch__control,.bd-slider,.nh-switch,.crm-switch,.profile-switch,.form-switch input.form-check-input,.est-toggle-row > input.form-check-input[role="switch"]),
  html body :is(.std-switch__track,.bd-switch__control,.nh-switch,.crm-switch,.profile-switch,.form-switch input.form-check-input,.est-toggle-row > input.form-check-input[role="switch"])::after,
  html body .cx-switch > span, html body .cx-switch > span::after,
  html body .bd-slider::before { transition: none !important; }
}
/* Inline labelled legacy switches share the same track and travelling thumb. */
html body :is(.employee-switch > span,.mp-asset-switch > .mp-asset-choice-label) {
  position: relative; display: inline-block; min-height: 22px; padding-left: 46px; line-height: 22px;
}
html body .mp-asset-switch { display: inline-flex; }
html body :is(.employee-switch > span,.mp-asset-switch > .mp-asset-choice-label)::before {
  content: "" !important; box-sizing: border-box; position: absolute; left: 0; top: 0;
  width: 38px; height: 22px; margin: 0; border: 1px solid var(--bd-theme-border-strong,#475467);
  border-radius: 7px; background: var(--bd-theme-surface-muted,#e5e7eb); box-shadow: none !important;
}
html body :is(.employee-switch > span,.mp-asset-switch > .mp-asset-choice-label)::after {
  content: ""; box-sizing: border-box; position: absolute; left: 4px; top: 4px;
  width: 14px; height: 14px; border: 1px solid var(--bd-theme-border-strong,#475467);
  border-radius: 4px; background: var(--bd-switch-thumb-off, var(--bd-theme-bg-ffffff, #fff)); transform: translateX(0);
}
html body :is(.employee-switch,.mp-asset-switch) > input:checked + span::before { background:var(--bd-theme-accent,#2563eb) !important; }
html body :is(.employee-switch,.mp-asset-switch) > input:checked + span::after { transform:translateX(16px); background:var(--bd-theme-on-accent, #fff); }
html body :is(.employee-switch,.mp-asset-switch) > input:focus-visible + span::before { outline:2px solid var(--bd-theme-accent,#2563eb); outline-offset:3px; }
html body :is(.employee-switch,.mp-asset-switch) > input:disabled + span { opacity:.45; cursor:not-allowed; }

/* Interface labels retain their authored case; uppercase is reserved for data such as state codes. */
.text-uppercase:not(input):not(textarea), .dropdown-header { text-transform: none !important; letter-spacing: normal; }

/* Joined actions have square internal seams; the strip owns its outside corners. */
html body .bd-action-strip .bd-action-strip__btn { border-radius:0!important; }
html body .bd-action-strip > .bd-action-strip__btn:first-child { border-top-left-radius:inherit!important; border-bottom-left-radius:inherit!important; }
html body .bd-action-strip > .bd-action-strip__btn:last-child { border-top-right-radius:inherit!important; border-bottom-right-radius:inherit!important; }

/* Tablet topbar search has one icon track and its own opaque results surface. */
html body #mobile-search-form input[type="search"] { padding-left:36px!important; padding-right:36px!important; min-height:40px; }
html body #mobile-search-form > .position-relative > .mdi { left:12px!important; margin-left:0!important; pointer-events:none; }
html body #quick-search-results-mobile { background:var(--bd-theme-surface,#fff)!important; color:var(--bd-theme-text,#344054); border-color:var(--bd-theme-border,#d0d5dd)!important; }

/* ------------------------------------------------------ object navigation */
/*
 * Promoted from /standards/#navigation. Record pages (purchase orders,
 * subcontractors, coordination) each carried a private copy; use this one.
 */
.std-object-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  overflow-x: auto;
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--bd-theme-border-111111, #111);
  background: var(--bd-theme-surface-raised, var(--bd-theme-bg-ffffff, #fff));
}

.std-object-nav > a,
.std-object-nav > button {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex: 0 0 auto;
  padding: .42rem .58rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--bd-theme-text, #344054);
  font: inherit;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.std-object-nav > a:hover,
.std-object-nav > button:hover {
  background: var(--bd-theme-surface-soft, var(--bd-theme-bg-f8fafc, #f8fafc));
}

/* Optional count from _record_tab.html (tab_count). */
.std-object-nav__count { min-width: 1.1rem; padding: 0 .3rem; border-radius: 4px; background: var(--bd-theme-surface-soft, var(--bd-theme-bg-f2f4f7, #f2f4f7)); color: var(--bd-theme-text-muted, #667085); font-size: .68rem; font-variant-numeric: tabular-nums; text-align: center; }
.std-object-nav > .is-active > .std-object-nav__count { background: transparent; color: inherit; }

.std-object-nav > a.is-active,
.std-object-nav > button.is-active {
  border-color: var(--bd-theme-border-111111, #111);
  background: var(--bd-theme-action, #111827);
  color: var(--bd-theme-action-text, #fff);
}

/* ------------------------------------------------------- record shell */
/* Rank 73. templates/partials/_record_head.html is the one project-record
   head: icon + number (h2), name, status badge, a meta line, and one
   bd-action-strip that starts with Back (forms and the PDF control sit inside
   it as segments).
   Record tabs are std-object-nav buttons from templates/partials/_record_tab.html
   (the third level under bd-work-nav). .std-record-notices holds the warnings
   between the nav and the body. */
.std-record-head.std-page-head { align-items: center; }
/* A head with a meta line under the title keeps the actions on the title line. */
.std-record-head.std-page-head:has(> .std-page-head__title > .std-record-head__meta) { align-items: flex-start; }
/* Back is the first segment of the record's action strip, never a line above the title. */
.std-record-head__back { text-decoration: none; }
.std-record-head .std-record-head__title { flex-wrap: wrap; gap: .35rem .55rem; min-width: 0; }
.std-record-head .std-record-head__title h2 { margin: 0; color: var(--bd-theme-text-strong, #111827); font-size: 1.12rem; font-weight: 800; line-height: 1.2; }
.std-record-head__name { min-width: 0; color: var(--bd-theme-text-muted, #667085); font-size: .95rem; font-weight: 600; overflow-wrap: break-word; }
.std-record-head__meta { display: flex; flex-wrap: wrap; gap: .2rem .5rem; }
.std-record-head__meta > * + *::before { content: "\00b7"; margin-right: .5rem; }
/* Forms, the PDF control and live slot spans (Submittal packet link) wrap
   segments without breaking the strip. */
.std-record-head__strip > :is(form, span, .field-pdf-control) { display: contents; }
/* The strip clips its square segments to its rounded frame (project-body
   strips are overflow:visible); a strip holding a dropdown keeps its menu. */
html body :is(#project-body, .std-record-head) .std-record-head__strip:not(:has(.dropdown)) { overflow: hidden; }
html body .std-record-head__strip > :not(:first-child) > .bd-action-strip__btn:first-child { border-left: 1px solid var(--bd-theme-border-dfe3e8, #dfe3e8); }
html body .std-record-head__strip > .field-pdf-control > .std-btn-sample { height: 32px; min-height: 32px; margin: 0; padding: 0 10px; gap: .35rem; border: 0 !important; border-left: 1px solid var(--bd-theme-border-dfe3e8, #dfe3e8) !important; border-radius: 0 !important; background: transparent; box-shadow: none; font-weight: 400; }
.std-record-head__strip > .field-pdf-control > :not(.std-btn-sample, .bd-action-strip__btn) { display: none; }
.std-record-notices { display: grid; gap: .4rem; padding: .7rem .95rem; border-bottom: 1px solid var(--bd-theme-border-111111, #111); }
.std-record-notices > p { display: flex; align-items: flex-start; gap: .45rem; margin: 0; color: var(--bd-theme-text, #344054); font-size: .8rem; }
.std-record-notices > p > .mdi { margin-top: .1rem; color: var(--bd-theme-fg-7a4f01, #7a4f01); }
.std-record-notices > p.is-bad > .mdi { color: var(--bd-theme-fg-b42318, #b42318); }
.std-record-notices a { font-weight: 700; }
/* Record strips are icons with instant tooltips (bd_instant_tooltips.js reads
   the hidden label). Only the primary action keeps its words, and below
   tablet width it folds to its icon too. A segment with no icon keeps its
   label, since there would be nothing left to press. */
html body :is(#project-body, .std-record-head) .std-record-head__strip .bd-action-strip__btn:not(.bd-action-strip__btn--hero):has(> :is(i, svg)) { flex: 0 0 auto !important; width: 36px !important; min-width: 36px; padding-inline: 0 !important; justify-content: center; gap: 0; }
html body .std-record-head__strip .bd-action-strip__btn:not(.bd-action-strip__btn--hero):has(> :is(i, svg)) > .bd-action-strip__label,
html body .std-record-head__strip .bd-action-strip__btn:not(.bd-action-strip__btn--hero) > :is(i, svg) ~ span:not([class]),
html body .std-record-head__strip .bd-action-strip__btn:not(.bd-action-strip__btn--hero) > span:not([class]):has(~ :is(i, svg)) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html body .std-record-head__strip .bd-action-strip__btn > :is(i, svg) { margin: 0 !important; font-size: 1.05rem; }
/* Record strips stay compact on tablets and up, touch or not (owner, Nov 11 2026); phones keep 40px targets below. */
@media (min-width: 576px) { html body :is(#project-body, .std-record-head) .std-record-head__strip :is(.bd-action-strip__btn, .field-pdf-control > .std-btn-sample) { height: 34px !important; min-height: 34px !important; } }
html body .std-record-head__strip .bd-action-strip__btn--hero > :is(i, svg) { margin-right: .35rem !important; }
/* One primary action carries words; a second one beside it folds to its icon. */
html body :is(#project-body, .std-record-head) .std-record-head__strip .bd-action-strip__btn--hero ~ .bd-action-strip__btn--hero:has(> :is(i, svg)) { flex: 0 0 auto !important; width: 36px !important; min-width: 36px; padding-inline: 0 !important; justify-content: center; }
html body .std-record-head__strip .bd-action-strip__btn--hero ~ .bd-action-strip__btn--hero:has(> :is(i, svg)) > .bd-action-strip__label,
html body .std-record-head__strip .bd-action-strip__btn--hero ~ .bd-action-strip__btn--hero > :is(i, svg) ~ span:not([class]),
html body .std-record-head__strip .bd-action-strip__btn--hero ~ .bd-action-strip__btn--hero > span:not([class]):has(~ :is(i, svg)) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html body .std-record-head__strip .bd-action-strip__btn--hero ~ .bd-action-strip__btn--hero > :is(i, svg) { margin-right: 0 !important; }
@media (max-width: 767.98px) {
  html body :is(#project-body, .std-record-head) .std-record-head__strip .bd-action-strip__btn--hero:has(> :is(i, svg)) { flex: 0 0 auto !important; width: 36px !important; min-width: 36px; padding-inline: 0 !important; justify-content: center; }
  html body .std-record-head__strip .bd-action-strip__btn--hero:has(> :is(i, svg)) > .bd-action-strip__label,
  html body .std-record-head__strip .bd-action-strip__btn--hero > :is(i, svg) ~ span:not([class]),
  html body .std-record-head__strip .bd-action-strip__btn--hero > span:not([class]):has(~ :is(i, svg)) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html body .std-record-head__strip .bd-action-strip__btn--hero > :is(i, svg) { margin-right: 0 !important; }
}
@media (max-width: 575.98px) {
  .std-record-head__meta { flex-direction: column; }
  .std-record-head__meta > * + *::before { content: none; }
  /* Phone: one compact row. The hero keeps icon + label; every other
     segment is a 40px icon whose label stays as its accessible name. */
  .std-record-head .std-page-head__actions { width: 100%; }
  html body :is(#project-body, .std-record-head) .std-page-head__actions > .std-record-head__strip { flex-wrap: nowrap !important; width: auto !important; min-width: 0; max-width: 100% !important; height: auto; }
  html body .std-record-head__strip :is(.bd-action-strip__btn, .field-pdf-control > .std-btn-sample) { flex: 0 0 auto; height: 34px; min-height: 34px; }
  html body .std-record-head__strip .bd-action-strip__btn:not(.bd-action-strip__btn--hero),
  html body .std-record-head__strip > .field-pdf-control > .std-btn-sample { width: 40px; min-width: 40px; padding: 0; justify-content: center; }
  html body :is(#project-body, .std-record-head) .std-record-head .std-record-head__strip .bd-action-strip__btn--hero { flex: 0 1 auto !important; width: auto; min-width: 0; padding: 0 12px; white-space: nowrap; }
  html body :is(#project-body, .std-record-head) .std-record-head__strip .bd-action-strip__btn--hero > .bd-action-strip__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap !important; }
  .std-record-head__strip .bd-action-strip__btn:not(.bd-action-strip__btn--hero) > span:not(.badge, [class*="count"]),
  .std-record-head__strip > .field-pdf-control > .std-btn-sample > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Comms log (templates/partials/_comms_log.html): the card owns the frame,
   the register divides with one rule. */
.bd-comms-log__register { border-top: 1px solid var(--bd-theme-border-111111, #111); }
.bd-comms-log__expand-col { width: 36px; }

/* Only a rendered adjacent KPI strip owns the divider. First-use states
 * without a strip retain their header's separation from the work body. */
.std-kpi-attached-shell > .std-work-head:has(+ .std-kpi-strip) {
  border-bottom: 0;
}

/* Record maps (CRM company and territory maps, Sales Account maps, and any
   map container marked data-bd-themed-map: Inventory Locations, project and
   estimate site maps, project photo map, My Schedule). Mapbox draws popups
   white while their text inherits the theme, so dark themes got light text
   on white. Popups and attribution take the theme surface here. */
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-popup-content {
  border: 1px solid var(--bd-theme-border);
  border-radius: 8px;
  background: var(--bd-theme-surface);
  color: var(--bd-theme-text);
  box-shadow: var(--bd-theme-shadow);
}
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-popup-content strong { color: var(--bd-theme-text-strong, var(--bd-theme-text)); }
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-popup-content a { color: var(--bd-theme-accent); }
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-popup-anchor-top .mapboxgl-popup-tip,
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip,
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip { border-bottom-color: var(--bd-theme-border); }
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip,
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip,
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip { border-top-color: var(--bd-theme-border); }
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-popup-anchor-left .mapboxgl-popup-tip { border-right-color: var(--bd-theme-border); }
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-popup-anchor-right .mapboxgl-popup-tip { border-left-color: var(--bd-theme-border); }
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-popup-close-button {
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--bd-theme-text-muted);
  background: transparent;
  line-height: 1;
}
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-popup-close-button:is(:hover, :focus-visible) {
  color: var(--bd-theme-text);
  background: var(--bd-theme-surface-muted);
}
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-popup-close-button:focus-visible { outline: 2px solid var(--bd-theme-accent); outline-offset: 1px; }
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-ctrl-attrib,
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-ctrl-attrib.mapboxgl-compact {
  background: color-mix(in srgb, var(--bd-theme-surface) 92%, transparent);
  color: var(--bd-theme-text-muted);
}
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-ctrl-attrib a { color: var(--bd-theme-text); }
:is(.cx-map, .acct-map-canvas, [data-account-footprint-map], [data-bd-themed-map]) .mapboxgl-ctrl-attrib-button { background-color: var(--bd-theme-surface); }

/* Reveal control (static/js/shell/bd_reveal.js). Task-named button with a chevron, never a caret
   triangle. The chevron turns when the section is open. Pair with btn btn-sm btn-outline-dark. */
.bd-reveal-toggle{display:inline-flex;align-items:center;gap:.4rem;min-width:0;max-width:100%;text-align:left;}
.bd-reveal-toggle > .mdi{font-size:1rem;line-height:1;flex:0 0 auto;}
.bd-reveal-toggle__meta{font-weight:400;color:var(--bd-theme-text-muted,#667085);overflow-wrap:anywhere;min-width:0;}
.bd-reveal-toggle__count{display:inline-flex;align-items:center;justify-content:center;min-width:1.25rem;height:1.25rem;padding:0 .3rem;border-radius:.3rem;background:var(--bd-theme-accent,#2563eb);color:var(--bd-theme-on-accent,#fff);font-size:.72rem;font-weight:700;font-variant-numeric:tabular-nums;}
.bd-reveal-toggle > .bd-reveal-toggle__chevron{margin-left:auto;transition:transform .15s ease;}
.bd-reveal-toggle[aria-expanded="true"],.bd-reveal-toggle[aria-expanded="true"]:hover,.bd-reveal-toggle[aria-expanded="true"]:focus,.bd-reveal-toggle[aria-expanded="true"]:active{background:var(--bd-theme-surface-muted,#f3f5f7)!important;color:var(--bd-theme-text-strong,#101828)!important;border-color:var(--bd-theme-border-strong,#111)!important;}
.bd-reveal-toggle[aria-expanded="true"] > .bd-reveal-toggle__chevron{transform:rotate(180deg);}
@media (prefers-reduced-motion: reduce){.bd-reveal-toggle > .bd-reveal-toggle__chevron{transition:none;}}
.bd-reveal-panel[hidden]{display:none!important;}

/* Application partials: one header geometry for every main workspace.
 * The shared important layer survives legacy inline fragment styles on HTMX
 * swaps. Typography stays with bd-type-section in bd_typography.css. */
@layer bd-work-partials {
  /* Accounting's title row owns the inset; its outer header also holds nav. */
  .acct-work-header:has(> .acct-work-header__main) {
    padding: 0 !important;
  }
  :is(.bd-work-partial__head, .bd-tab-card__head, .std-mainstay-shell > .std-mainstay-head, .acct-work-header > .acct-work-header__main) {
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 12px 16px !important;
    margin: 0 !important;
    padding: 12px 16px !important;
    min-height: 60px !important;
    min-width: 0 !important;
    text-align: left !important;
  }
  :is(.bd-work-partial__head, .bd-tab-card__head, .std-mainstay-shell > .std-mainstay-head, .acct-work-header > .acct-work-header__main) > :first-child {
    min-width: 0 !important;
    max-width: 100% !important;
    align-self: center !important;
  }
  :is(.bd-work-partial__title, .std-mainstay-shell > .std-mainstay-head .std-mainstay-title, .acct-work-header__title, .bd-tab-card__head > :is(h1, h2, h3, h4, h5, h6), .bd-tab-card__head > div > :is(h1, h2, h3, h4, h5, h6)) {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    min-width: 0 !important;
    text-align: left !important;
    color: var(--bd-theme-text-strong) !important;
  }
  :is(.bd-work-partial__title, .std-mainstay-shell > .std-mainstay-head .std-mainstay-title, .acct-work-header__title, .bd-tab-card__head > :is(h1, h2, h3, h4, h5, h6), .bd-tab-card__head > div > :is(h1, h2, h3, h4, h5, h6)) > .mdi {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 20px !important;
    width: 20px !important;
    margin: 0 !important;
    font-size: 20px !important;
    line-height: 1 !important;
    color: var(--bd-theme-text-muted) !important;
  }
  :is(.bd-work-partial__actions, .acct-work-header__actions) {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    align-self: center !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 0 0 auto !important;
  }
  /* Older panels pad the entire surface. Cancel only that header's inset;
   * their existing body spacing and controls remain owned by the panel. */
  .bd-work-partial__head.bd-work-partial__head--inset {
    margin: calc(-1 * var(--bd-work-partial-inset, 1rem))
      calc(-1 * var(--bd-work-partial-inset, 1rem)) 1rem !important;
  }
  @media (max-width: 767.98px) {
    :is(.bd-work-partial__head, .bd-tab-card__head, .std-mainstay-shell > .std-mainstay-head, .acct-work-header > .acct-work-header__main) { padding: 12px !important; }
    :is(.bd-work-partial__actions, .acct-work-header__actions):not(.bd-work-partial__actions--end) {
      justify-content: flex-start !important;
      margin-left: 0 !important;
    }
  }
}

/* Shape contract: legacy pill class names use rectangular chrome everywhere. */
html body :is(.rounded-pill, .badge, .bd-chip, .bd-badge, .bd-sub-status,
              .bd-meta-pill, .pill, [class$="-pill"], [class*="-pill "], [class*="-pill-"],
              [class^="pill-"], [class*=" pill-"]) {
  border-radius: 6px !important;
}
html body #page-topbar #global-search {
  border-radius: 8px !important;
}

/* Shared shape contract: statuses, filters, counters and identities are rectangles.
   Keep the rule above later module !important overrides through a named layer. */
@layer bd-shape-contract {
  html body :is(.std-status-dot, #pwa-connection-dot) {
    border-radius: 2px !important;
  }
  html body :is(
    .badge, .bd-badge, .std-chip, .bd-chip, .bd-sub-status, .rounded-pill,
    .bd-meta-pill, .pill, [class$="-pill"], [class*="-pill "], [class*="-pill-"],
    [class^="pill-"], [class*=" pill-"],
    [class*="-chip"], [class*="-badge"], [class*="pill"], .ts-wrapper.multi .ts-control > .item
  ):not([class*="avatar"]):not([class*="__icon"]):not([class*="-icon"])
   /* Second-level nav tabs are square underlines; `.bd-pill-link` only matches
      here by name, and a layered !important beats their unlayered radius 0. */
   :not(:is(.bd-settings-subnav, .bd-work-nav__sub-row, .subnav-row, .tc-subnav-row) .bd-pill-link) {
    border-radius: 6px !important;
  }
  html body :is(
    .progress, .progress-bar, .std-aging-mini-track, .bd-progress-pipeline,
    .bd-micro-pipeline, .pipeline-fill, .aging-bar, #agingFill,
    .estimate-setup-draft__track, .estimate-setup-draft__track > span
  ) {
    border-radius: 0 !important;
  }
}

/* Timeclock/HR dialog audit: shared decorative tracks follow the no-pill rule. */
@layer bd-shape-contract {
  html body :is(.bdm2-grab, .bd-action-underline) {
    border-radius: 0 !important;
  }
}

/* Work header actions: one joined strip of header-size buttons, in the order
   primary actions, Manage menu, Edit, Favorite, Pin, Minimize. Forms and
   include wrappers lay their buttons into the strip. The strip never clips:
   menus hang from their positioned .dropdown, so the end buttons carry the
   rounded corners themselves. */
html body .bd-action-strip.bd-action-strip--header {
  display: inline-flex; align-items: stretch; flex-wrap: nowrap; gap: 0 !important;
  max-width: 100%; border: 1px solid var(--bd-theme-border-111111, #111);
  border-radius: 6px; background: var(--bd-theme-bg-ffffff, #fff); overflow: visible;
}
html body .bd-action-strip.bd-action-strip--header > :not(.std-btn-sample, .dropdown, [data-favorite-error], .visually-hidden, [hidden], script, template) { display: contents !important; }
html body .bd-action-strip.bd-action-strip--header > .dropdown { display: flex; }
html body .bd-action-strip.bd-action-strip--header .std-btn-sample:not(.bd-action-strip__btn):not([hidden]):not(.d-none) {
  border: 0 !important; border-left: 1px solid var(--bd-theme-border-111111, #111) !important;
  border-radius: 0 !important; box-shadow: none !important; margin: 0 !important; height: 34px !important;
}
html body .bd-action-strip.bd-action-strip--header > .std-btn-sample:first-child:not(.bd-action-strip__btn):not([hidden]):not(.d-none),
html body .bd-action-strip.bd-action-strip--header > :first-child > button.std-btn-sample:first-of-type:not(.bd-action-strip__btn):not([hidden]):not(.d-none),
html body .bd-action-strip.bd-action-strip--header > :first-child > .std-btn-sample:first-child:not(.bd-action-strip__btn):not([hidden]):not(.d-none),
html body .bd-action-strip.bd-action-strip--header > :first-child:not(.std-btn-sample):not(:has(.std-btn-sample)) + .std-btn-sample:not(.bd-action-strip__btn):not([hidden]):not(.d-none),
html body .bd-action-strip.bd-action-strip--header > :first-child:not(.std-btn-sample):not(:has(.std-btn-sample)) + :not(.std-btn-sample) > .std-btn-sample:first-child:not(.bd-action-strip__btn):not([hidden]):not(.d-none) {
  border-left: 0 !important; border-radius: 5px 0 0 5px !important;
}
html body .bd-action-strip.bd-action-strip--header > .std-btn-sample:last-child:not(.bd-action-strip__btn):not([hidden]):not(.d-none),
html body .bd-action-strip.bd-action-strip--header > :last-child > button.std-btn-sample:last-of-type:not(.bd-action-strip__btn):not([hidden]):not(.d-none) {
  border-top-right-radius: 5px !important; border-bottom-right-radius: 5px !important;
}
html body .bd-action-strip.bd-action-strip--header .std-btn-sample:not(.is-primary):not(.bd-btn-promote) { background: transparent; }
html body .bd-action-strip--header .std-btn-sample:not(.is-primary):not(.bd-btn-promote):hover { background: var(--bd-theme-bg-0f172a-0a, rgba(15, 23, 42, .04)); }
html body .bd-action-strip--header .std-btn-sample:focus-visible { outline-offset: -3px; }
html body .bd-action-strip--header .std-btn-sample > .bd-action-strip__label { white-space: nowrap; }
html body .bd-action-strip--header .std-btn-sample.dropdown-toggle::after { display: none; }
html body .bd-action-strip--header .std-btn-sample > .bd-dropdown-caret { margin: 0 .1rem 0 .1rem; width: .4rem; height: .4rem; flex-basis: .4rem; }
html body .bd-action-strip--header .std-btn-sample[aria-expanded="true"] > .bd-dropdown-caret { transform: rotate(225deg) translate(-1px, -1px); }
@media (max-width: 767.98px) {
  html body .bd-action-strip.bd-action-strip--header { flex-wrap: wrap; }
  html body .bd-action-strip--header .std-btn-sample > span:not(.bd-dropdown-caret, .visually-hidden, .bd-promote-spin) {
    position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important;
    overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important;
  }
}

/* Table card headers: one button geometry and the shared table tools.
 * Every card that owns a table gets Export and Columns at the end of its
 * header actions (static/js/bd_table_tools.js). Module buttons keep their
 * order; primary (filled) first, then other actions, then the tools. Bootstrap
 * .btn variants in these headers take the std-btn-sample shape so a header
 * never mixes pill, outline, and solid styles. */
@layer bd-work-partials {
  :is(.bd-work-partial__actions, .management-register__actions, .acct-work-header__actions) :is(.btn, .std-btn-sample):not(.dropdown-item):not(.btn-link):not(.btn-close):not(.bd-action-strip__btn):not([data-tt-absorbed]):not(.bd-table-tools *) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .38rem !important;
    min-height: 32px !important;
    padding: .32rem .62rem !important;
    border: 1px solid var(--bd-theme-border-111111, #111) !important;
    border-radius: 6px !important;
    font-size: var(--bd-type-label, 12px) !important;
    font-weight: var(--bd-type-regular, 400) !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    box-shadow: none !important;
  }
  :is(.bd-work-partial__actions, .management-register__actions, .acct-work-header__actions) :is(.btn, .std-btn-sample):not(:is(.btn-dark, .btn-primary, .btn-success, .btn-danger, .is-primary, .is-danger, .btn-outline-danger, .dropdown-item, .btn-link, .btn-close)):not(.bd-table-tools *) {
    background: var(--bd-theme-bg-ffffff, #fff) !important;
    color: var(--bd-theme-fg-111827, #111827) !important;
  }
  :is(.bd-work-partial__actions, .management-register__actions, .acct-work-header__actions) :is(.btn-dark, .btn-primary, .btn-success, .is-primary):not(.dropdown-item):not(.bd-table-tools *) {
    background: var(--bd-theme-action, #111) !important;
    border-color: var(--bd-theme-action-border, #111) !important;
    color: var(--bd-theme-action-text, #fff) !important;
  }
  :is(.bd-work-partial__actions, .management-register__actions, .acct-work-header__actions) :is(.btn-danger, .btn-outline-danger, .is-danger):not(.dropdown-item):not(.bd-table-tools *) {
    background: var(--bd-theme-bg-fbf3f2, #fbf3f2) !important;
    color: var(--bd-theme-fg-6f2f2a, #6f2f2a) !important;
  }
  :is(.bd-work-partial__actions, .management-register__actions, .acct-work-header__actions) :is(.btn, .std-btn-sample) > .mdi {
    margin: 0 !important;
    font-size: 1rem !important;
    line-height: 1 !important;
  }
  :is(.bd-work-partial__actions, .management-register__actions, .acct-work-header__actions) > form { display: contents !important; }
  /* Header actions placed beside the title without the actions wrapper, or
   * in a private wrapper or button skin, take the same geometry. The title
   * column, navigation, segmented modes and menus keep their own. */
  :is(.bd-work-partial__head, .bd-tab-card__head) > :not(:first-child):is(button, a.btn, a.std-btn-sample, a.bd-btn):not(:is(.dropdown-item, .btn-link, .btn-close, .bd-action-strip__btn, .dr-mode-option, [role="tab"], [role="radio"], [data-tt-absorbed])),
  :is(.bd-work-partial__head, .bd-tab-card__head) > :not(:first-child, nav, [role="tablist"], [role="radiogroup"]) :is(button, a.btn, a.std-btn-sample, a.bd-btn):not(:is(.dropdown-item, .btn-link, .btn-close, .bd-action-strip__btn, .dr-mode-option, [role="tab"], [role="radio"], [data-tt-absorbed], .bd-table-tools *, .dropdown-menu *, .bd-action-strip *, .bd-file-action-strip *, [role="radiogroup"] *, [role="tablist"] *, .btn-group *)) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .38rem !important;
    min-height: 32px !important;
    height: auto !important;
    padding: .32rem .62rem !important;
    border-radius: 6px !important;
    font-size: var(--bd-type-label, 12px) !important;
    font-weight: var(--bd-type-regular, 400) !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    box-shadow: none !important;
  }
  :is(.bd-work-partial__head, .bd-tab-card__head) > :not(:first-child) :is(.bd-btn-primary, .bd-btn-dark):not(.dropdown-item):not(.bd-table-tools *),
  :is(.bd-work-partial__head, .bd-tab-card__head) > :not(:first-child):is(.bd-btn-primary, .bd-btn-dark) {
    background: var(--bd-theme-action, #111) !important;
    border-color: var(--bd-theme-action-border, #111) !important;
    color: var(--bd-theme-action-text, #fff) !important;
  }
}

/* The tools: a joined Export menu and an icon-only Columns menu. */
html body .bd-table-tools__actions:has(> .bd-table-tools[hidden]:only-child),
html body :is([data-tt-absorbed], .bd-table-tools)[hidden] { display: none !important; }
.bd-table-tools { display: inline-flex; align-items: stretch; flex: 0 0 auto; }
.bd-table-tools > .bd-table-tools__group { display: flex; }
/* Layered so the global button overrides cannot round the joined seam. */
@layer bd-work-partials {
  .bd-table-tools .std-btn-sample { height: 32px !important; min-height: 32px !important; padding: 0 .62rem !important; font-size: var(--bd-type-label, 12px) !important; gap: .38rem !important; border-radius: 0 !important; background: var(--bd-theme-bg-ffffff, #fff) !important; color: var(--bd-theme-fg-111827, #111827) !important; box-shadow: none !important; }
  .bd-table-tools > .bd-table-tools__group:first-child .std-btn-sample { border-radius: 6px 0 0 6px !important; }
  .bd-table-tools > .bd-table-tools__group:last-child .std-btn-sample { border-radius: 0 6px 6px 0 !important; }
  .bd-table-tools > .bd-table-tools__group:only-child .std-btn-sample { border-radius: 6px !important; }
  .bd-table-tools > .bd-table-tools__group + .bd-table-tools__group .std-btn-sample { border-left: 0 !important; }
  .bd-table-tools .std-btn-sample:hover { background: var(--bd-theme-bg-f8fafc, #f8fafc) !important; }
  .bd-table-tools .bd-table-tools__columns { padding: 0 .5rem !important; color: var(--bd-theme-fg-475467, #475467) !important; }
  .bd-table-tools--float .std-btn-sample { height: 28px !important; min-height: 28px !important; padding: 0 .42rem !important; }
  /* Module heads use 34px buttons (New Project, Pin, Minimize), so the tools match them there. */
  @media (min-width: 768px), (pointer: fine) { [data-work-header] .bd-table-tools:not(.bd-table-tools--float) .std-btn-sample { height: 34px !important; min-height: 34px !important; } }
  /* Owner 2026-11-27: buttons are 34px on every screen, phones included. */
  @media (pointer: coarse) and (max-width: 767.98px) { .bd-table-tools .std-btn-sample { height: 34px !important; min-height: 34px !important; min-width: 34px !important; } }
}
.bd-table-tools .std-btn-sample.dropdown-toggle::after { display: none; }
.bd-table-tools .std-btn-sample > .mdi { font-size: 1rem; line-height: 1; margin: 0; }
.bd-table-tools .bd-dropdown-caret { width: .4rem; height: .4rem; flex-basis: .4rem; margin: 0 .05rem 0 .1rem; }
.bd-table-tools__columns { position: relative; }
.bd-table-tools__dot { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 1px; background: var(--bd-theme-action, #111); }
.bd-table-tools__dot[hidden] { display: none; }
.bd-table-tools__menu { min-width: 248px; z-index: 1085; }
.bd-table-tools__menu .bd-card-context-menu__item:disabled { opacity: .55; cursor: default; }
.bd-table-tools__menu .bd-card-context-menu__item:disabled:hover { background: transparent !important; }
.bd-table-tools__checks { max-height: min(50vh, 340px); overflow-y: auto; }
.bd-card-context-menu .bd-table-tools__check { grid-template-columns: 22px minmax(0, 1fr) !important; min-height: 36px; margin: 0 !important; padding: 2px 7px 2px 2px !important; touch-action: none; }
.bd-table-tools__check.is-dragging { background: var(--bd-theme-bg-eef4ff, #eef4ff) !important; box-shadow: 0 0 0 1px var(--bd-theme-border-111111, #111) inset; }
.bd-table-tools__grip { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 30px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--bd-theme-fg-667085, #667085); cursor: grab; touch-action: none; }
.bd-table-tools__grip:hover, .bd-table-tools__grip:focus-visible { color: var(--bd-theme-fg-111111, #111); background: var(--bd-theme-bg-f8fafc, #f8fafc); outline: 0; }
.bd-table-tools__check.is-dragging .bd-table-tools__grip { cursor: grabbing; }
.bd-table-tools__grip > .mdi { font-size: 1.05rem; line-height: 1; }
.bd-table-tools__check-label { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; cursor: pointer; font-size: .73rem; font-weight: 700; }
.bd-table-tools__check-label > input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--bd-theme-action, #111); cursor: pointer; }
.bd-table-tools__check-label > input:disabled { cursor: default; }
.bd-table-tools__check-label > input:disabled + span { color: var(--bd-theme-fg-667085, #667085); }
.bd-table-tools__check-label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-table-tools__check-label > .bd-table-tools__extra { flex: 0 0 auto; margin-left: auto; padding: 1px 6px; border: 1px solid var(--bd-theme-border-d0d5dd, #d0d5dd); border-radius: 999px; color: var(--bd-theme-fg-667085, #667085); font-size: .62rem; font-weight: 700; line-height: 1.4; }
/* Optional columns start hidden; the Columns menu marks the ones a person turned on. The layer
   lets this !important outrank module rules that force cells to display with !important. */
@layer bd-optional-columns {
  [data-column-optional]:not([data-column-shown]) { display: none !important; }
  @media (768px <= width < 1200px) {
    [data-bd-tablet-hide]:not([data-column-shown]) { display: none !important; }
  }
}
/* Extra facts read as quiet single-line values; long text opts into wrapping with is-wrap. */
td[data-column-optional] { white-space: nowrap; font-variant-numeric: tabular-nums; }
td[data-column-optional].is-wrap { white-space: normal; min-width: 12rem; max-width: 22rem; }
[data-tt-grid] .bd-grid-extra[data-column-optional] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; font-variant-numeric: tabular-nums; }
td[data-column-optional] .bd-optional-empty { color: var(--bd-theme-fg-98a2b3, #98a2b3); }
.bd-table-tools__hint { float: right; font-weight: 600; }
@media (pointer: coarse) { .bd-table-tools__grip { width: 36px; height: 40px; } .bd-card-context-menu .bd-table-tools__check { grid-template-columns: 36px minmax(0, 1fr) !important; min-height: 44px; } }
/* Tables without a card header: the same tools, icon-only, over the table's top corner on hover or focus. */
.bd-table-tools-host { position: relative; }
.bd-table-tools--float { position: absolute; top: 4px; right: 4px; z-index: 6; opacity: 0; transition: opacity .12s; box-shadow: 0 1px 2px var(--bd-theme-shadow-0f172a-0f, rgba(15, 23, 42, .06)); border-radius: 6px; }
.bd-table-tools-hover:hover > .bd-table-tools--float, .bd-table-tools--float:focus-within, .bd-table-tools--float:has([aria-expanded="true"], [aria-busy="true"], .bd-table-tools__dot:not([hidden])) { opacity: 1; }
/* Touch has no hover, so the tools sit in flow on their own line above the table
   instead of permanently covering its last header cells. */
@media (hover: none) { .bd-table-tools--float { position: static; display: flex; width: max-content; margin: 0 0 6px auto; opacity: 1; box-shadow: none; } }
/* Live document-worker progress on the Export button. */
.bd-register-worker-button { position: relative; overflow: hidden; isolation: isolate; }
.bd-register-worker-button::before { content: ''; position: absolute; bottom: 0; left: 0; height: 2px; width: var(--register-progress, 0%); background: currentColor; transition: width .2s; }
.bd-register-worker-button[aria-busy="true"], .bd-table-tools__export.is-mirroring { cursor: wait; }
@media (max-width: 767.98px) { .bd-table-tools__label { display: none; } }
@media print { .bd-table-tools { display: none !important; } }
/* The print frame holds the worker PDF while the browser print dialog is open. */
.bd-print-frame { position: fixed; left: -10000px; top: 0; width: 816px; height: 1056px; border: 0; opacity: 0; pointer-events: none; }

/* ===================================================== shared pieces, P1 css */

/* Filled active fill (ranks 181, 53). The pressed segment, active chip or
   toggle: navy (the action fill) in light, inverted to the text color in dim
   and dark so it never reads as a dark fill on a dark surface. Use these two
   instead of --bd-theme-bg-111111 for any "on" state. */
:root {
  --bd-fill-active: var(--bd-theme-action, #1f3a5f);
  --bd-fill-active-text: var(--bd-theme-action-text, #fff);
}
:root:is([data-theme="dim"], [data-theme="dark"]) {
  --bd-fill-active: var(--bd-theme-text, #edf1f5);
  --bd-fill-active-text: var(--bd-theme-surface, #1b2028);
}

/* Segmented control (rank 53). The .bd-action-strip owns the rounded edge;
   segments are square (above). A pressed or current segment takes the one
   filled-active look, whatever the module marks it with. */
html body .bd-action-strip .bd-action-strip__btn:is(.is-active, .active, [aria-pressed="true"], [aria-checked="true"], [aria-current]:not([aria-current="false"])),
html body .bd-action-strip .bd-action-strip__btn:is(.is-active, .active, [aria-pressed="true"], [aria-checked="true"], [aria-current]:not([aria-current="false"])):hover {
  background: var(--bd-fill-active) !important;
  color: var(--bd-fill-active-text) !important;
}

/* Favorite star. A favorited record keeps the button's normal surface and
   only the star itself turns the theme's muted yellow; the segment never
   fills like a pressed tab. */
html body .bd-favorite-toggle[aria-pressed="true"],
html body .bd-favorite-toggle[aria-pressed="true"]:hover,
html body .bd-action-strip .bd-action-strip__btn.bd-favorite-toggle[aria-pressed="true"],
html body .bd-action-strip .bd-action-strip__btn.bd-favorite-toggle[aria-pressed="true"]:hover {
  background: var(--bd-theme-surface) !important;
  color: var(--bd-theme-warning) !important;
}
html body .bd-favorite-toggle[aria-pressed="true"] > .mdi { color: inherit; }

/* Numeric cells (rank 39). Any table cell marked .is-num is right-aligned,
   tabular and on one line. Mark the header cell too. */
html body :is(th, td).is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Wrapping names and titles (rank 46). Names wrap between words, never
   mid-letter (overflow-wrap:anywhere broke "Northstar" into "Northsta / r");
   a single unbreakable token still breaks rather than overflowing. Put
   .std-identity-col on the th/td that holds a register's name or title so the
   table cannot squeeze it below a readable width. */
.std-wrap-words { min-width: 0; overflow-wrap: break-word; word-break: normal; }
:is(th, td).std-identity-col { min-width: 12rem; }

/* Mono token (rank 189). An id, hash, slug or column list: muted mono text in
   a quiet box, never Bootstrap's pink <code>. Long values truncate; put the
   full value in data-bd-instant-tooltip. .is-block wraps a list instead. */
:root { --bs-code-color: var(--bd-theme-fg-475467, #475467); }
.std-mono {
  display: inline-block;
  max-width: 100%;
  padding: .05rem .32rem;
  border: 1px solid var(--bd-theme-border, #d0d5dd);
  border-radius: 4px;
  background: var(--bd-theme-bg-f8fafc, #f8fafc);
  color: var(--bd-theme-fg-475467, #475467);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .78em;
  line-height: 1.45;
  vertical-align: bottom;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.std-mono.is-block { display: block; white-space: normal; overflow-wrap: anywhere; }

/* Width measure (rank 36). A settings editor or form never stretches its
   fields across a wide screen: put .std-measure on the form (or the editor
   body) and its fields and controls stay within 60rem of their labels.
   Key/value lists use .std-fact-list (above). */
.std-measure { max-width: min(100%, 60rem); }
.std-measure.is-narrow { max-width: min(100%, 40rem); }

/* One column (rank 44). Owner rule: no two-column bodies. On a Bootstrap .row
   every column takes the full width at every size; on any other container
   the children stack in one column. Key facts and actions go under the header. */
.row.std-one-column > [class*="col"] { flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; }
.std-one-column:not(.row) { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: var(--std-one-column-gap, 1rem); }
.std-one-column:not(.row) > * { grid-column: 1 / -1 !important; min-width: 0; }

/* Phone header actions (rank 128). At phone a header's buttons drop their
   labels (the label stays the accessible name) and wrap as one compact group;
   no module forces them to full-width slabs. Labels must sit in a <span>. */
@media (max-width: 575.98px) {
  :is(.bd-work-partial__actions, .acct-work-header__actions, .std-page-head__actions) { flex-wrap: wrap; gap: 6px; }
  :is(.bd-work-partial__actions, .acct-work-header__actions, .std-page-head__actions) :is(.std-btn-sample, .btn, .std-action):not(.dropdown-menu *):has(> .mdi) {
    width: auto !important; flex: 0 0 auto !important;
  }
  :is(.bd-work-partial__actions, .acct-work-header__actions, .std-page-head__actions) :is(.std-btn-sample, .btn, .std-action):not(.dropdown-menu *) > .mdi ~ span:not(.visually-hidden, .bd-dropdown-caret, .bd-promote-spin, .badge, [class*="count"]),
  :is(.bd-work-partial__actions, .acct-work-header__actions, .std-page-head__actions) :is(.std-btn-sample, .btn, .std-action):not(.dropdown-menu *) > span:not(.visually-hidden, .bd-dropdown-caret, .bd-promote-spin, .badge, [class*="count"]):has(~ .mdi) {
    position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important;
    overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important;
  }
  :is(.bd-work-partial__actions, .acct-work-header__actions, .std-page-head__actions) :is(.std-btn-sample, .btn, .std-action):not(.dropdown-menu *) > .mdi.mdi { margin: 0 !important; }
}

/* ---------------------------------------------------------------- rate grid */
/* A rate sheet is a ruled grid: cells you type straight into. The cell is the field, its
   decorator sits inside it, and the focused cell takes the ring. The first column names the row.
   Used by the wizard rates tables (.bd-wizard-register.is-rates) and by .bd-rate-grid anywhere else. */
.bd-rate-grid { border: 1px solid var(--bd-theme-border-111111, #111); border-radius: 9px; background: var(--bd-theme-bg-ffffff, #fff); overflow: hidden; }
.bd-rate-grid > table { width: 100%; margin: 0; border-collapse: collapse; }
.bd-rate-grid th { background: var(--bd-theme-palette-f8fafc, #f8fafc); color: var(--bd-theme-fg-667085, #667085); font-size: .69rem; text-align: left; white-space: nowrap; }
.bd-rate-grid td { border-top: 1px solid var(--bd-theme-border-d0d5dd, #d0d5dd); color: var(--bd-theme-fg-344054, #344054); font-size: .8rem; vertical-align: middle; }
.bd-rate-grid tbody tr:first-child > td { border-top: 0; }
.bd-rate-grid .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.bd-rate-grid .std-empty-state { padding: 1rem; }
html body :is(.bd-wizard-register.is-rates, .bd-rate-grid) { border-color: var(--bd-theme-border-111111, #111); }
html body :is(.bd-wizard-register.is-rates, .bd-rate-grid) :is(th, td) { padding: 0; border-left: 1px solid var(--bd-theme-border-d0d5dd, #d0d5dd); }
html body :is(.bd-wizard-register.is-rates, .bd-rate-grid) :is(th, td):first-child { border-left: 0; }
html body :is(.bd-wizard-register.is-rates, .bd-rate-grid) th { padding: 8px 10px; border-bottom: 1px solid var(--bd-theme-border-111111, #111); }
html body :is(.bd-wizard-register.is-rates, .bd-rate-grid) tbody :is(tr, td) { background: var(--bd-theme-bg-ffffff, #fff); }
html body :is(.bd-wizard-register.is-rates, .bd-rate-grid) td.is-rowhead { min-width: 220px; height: 1px; background: var(--bd-theme-palette-f8fafc, #f8fafc); }
:is(.bd-wizard-register.is-rates, .bd-rate-grid) td.is-rowhead > div { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px; }
:is(.bd-wizard-register.is-rates, .bd-rate-grid) td.is-rowhead > div > .mdi { color: var(--bd-theme-fg-667085, #667085); font-size: 1rem; line-height: 1; }
:is(.bd-wizard-register.is-rates, .bd-rate-grid) td.is-rowhead > div > span { display: grid; }
html body :is(.bd-wizard-register.is-rates, .bd-rate-grid) td.is-rowhead strong { color: var(--bd-theme-fg-111827, #111827); font-size: .8rem; font-weight: 700; line-height: 1.25; white-space: nowrap; }
html body :is(.bd-wizard-register.is-rates, .bd-rate-grid) td > .std-input-shell { width: 100%; height: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
html body :is(.bd-wizard-register.is-rates, .bd-rate-grid) td > .std-input-shell:focus-within { background: var(--bd-theme-accent-soft, #f8fafc); box-shadow: inset 0 0 0 2px var(--bd-theme-accent, #29449c); }
html body :is(.bd-wizard-register.is-rates, .bd-rate-grid) td > .std-input-shell.bd-invalid, html body :is(.bd-wizard-register.is-rates, .bd-rate-grid) td > .std-input-shell:has([aria-invalid="true"]) { box-shadow: inset 0 0 0 2px var(--bd-theme-border-b42318, #b42318); }
:is(.bd-wizard-register.is-rates, .bd-rate-grid) td > .std-input-shell > .mdi { font-size: .9rem; }
html body :is(.bd-wizard-register.is-rates, .bd-rate-grid) td > .std-input-shell > input { min-height: 0; height: auto; background: transparent !important; box-shadow: none !important; text-align: inherit; font-variant-numeric: tabular-nums; }
html body :is(.bd-wizard-register.is-rates, .bd-rate-grid) td.is-num > .std-input-shell > input { text-align: right; }
html body :is(.bd-wizard-register.is-rates, .bd-rate-grid) td.is-actions { width: 44px; text-align: center; }
:is(.bd-wizard-register.is-rates, .bd-rate-grid) td.is-actions > .bd-action-strip { border: 0; background: transparent; }
:is(.bd-wizard-register.is-rates, .bd-rate-grid) td > .std-field-error { margin: 4px 6px; white-space: normal; text-align: start; }
:is(.bd-wizard-register.is-rates, .bd-rate-grid) td small { display: block; color: var(--bd-theme-fg-667085, #667085); }
/* On a phone the grid stays a grid and scrolls sideways; it does not fall back to stacked cards. */
@media (max-width: 767.98px) {
  html body :is(.bd-wizard-page .bd-wizard-register.is-rates, .bd-rate-grid) { display: block !important; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  html body :is(.bd-wizard-page .bd-wizard-register.is-rates, .bd-rate-grid) > table { display: table !important; min-width: 780px; }
  html body :is(.bd-wizard-page .bd-wizard-register.is-rates, .bd-rate-grid) thead { display: table-header-group !important; }
  html body :is(.bd-wizard-page .bd-wizard-register.is-rates, .bd-rate-grid) tbody { display: table-row-group !important; }
  html body :is(.bd-wizard-page .bd-wizard-register.is-rates, .bd-rate-grid) tr { display: table-row !important; padding: 0 !important; }
  html body :is(.bd-wizard-page .bd-wizard-register.is-rates, .bd-rate-grid) :is(th, td) { display: table-cell !important; }
  html body :is(.bd-wizard-page .bd-wizard-register.is-rates, .bd-rate-grid) td.is-num::before { content: none !important; }
  html body :is(.bd-wizard-page .bd-wizard-register.is-rates, .bd-rate-grid) td > .std-input-shell { min-height: 44px; }
}

/* Filter strip standard (owner decision, Nov 11 2026): the search field is the main control, then a
   Filters button with a chevron, then Clear. Every other filter lives in its own card that slides
   open under the strip. Behavior is static/js/bd_filter_strip.js. */
.std-filter-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; min-width: 0; }
.std-filter-strip > .std-filter-strip__search { order: 1; flex: 1 1 220px; min-width: min(100%, 220px); margin: 0; }
.std-filter-strip > .std-filter-strip__toggle { order: 2; flex: 0 0 auto; }
.std-filter-strip > .std-filter-strip__status { order: 3; flex: 0 0 auto; color: var(--bd-theme-text-muted, #667085); font-size: .76rem; font-weight: 800; white-space: nowrap; }
.std-filter-strip > .std-filter-strip__clear { order: 4; flex: 0 0 auto; }
.std-filter-strip > :is(.std-filter-strip__toggle, .std-filter-strip__clear) { min-height: 32px; padding: 0 10px; font-size: .82rem; }
.std-filter-strip > .std-filter-drawer { order: 10; flex: 1 0 100%; min-width: 0; display: grid; grid-template-rows: 0fr; margin-top: -10px; transition: grid-template-rows .2s ease, margin-top .2s ease; }
.std-filter-strip > .std-filter-drawer.is-open { grid-template-rows: 1fr; margin-top: 0; }
/* A closed drawer still wraps onto its own flex line, and the row gap above it would leave dead space
   under the strip. Out of flow while closed (it stays in flow while it slides shut), so the strip is
   only as tall as its controls and they sit centered in it. */
.std-filter-strip > .std-filter-drawer:not(.is-open):not(.is-closing) { position: absolute; width: 1px; height: 0; overflow: hidden; pointer-events: none; }
.std-filter-drawer__clip { min-height: 0; overflow: hidden; }
.std-filter-drawer.is-settled > .std-filter-drawer__clip { overflow: visible; }
.std-filter-card { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 240px)); gap: 12px; align-items: end; padding: 12px; border: 1px solid var(--bd-theme-border-111111, #111); border-radius: 8px; background: var(--bd-theme-palette-f8f9fb, #f8f9fb); }
.std-filter-card > :is(label, .std-filter-card__field) { display: grid; gap: 4px; min-width: 0; margin: 0; font-size: 12px; font-weight: 700; }
.std-filter-card > :is(label, .std-filter-card__field) > label { margin: 0; font-size: 12px; font-weight: 700; }
.std-filter-card :is(select, input:not([type="checkbox"]):not([type="radio"]), .ts-wrapper) { width: 100%; min-width: 0; }
/* Every control in a filter card is one size with one text inset, whichever picker built it (plain
   select, lookup, tag picker, date field): 32px tall, 6px corners, text 12px in from the edge. The
   doubled classes out-rank the `html body .ts-wrapper .ts-control` rules in discovery.css. */
html body .std-filter-card .ts-wrapper.ts-wrapper { height: auto !important; min-height: 32px !important; }
html body .std-filter-card .ts-wrapper.ts-wrapper .ts-control { min-height: 32px !important; padding-left: 12px !important; border-radius: 6px !important; }
html body .std-filter-card .ts-wrapper.single.single .ts-control { height: 32px !important; }
html body .std-filter-card .ts-wrapper.multi.multi .ts-control { height: auto !important; padding-top: 2px !important; padding-bottom: 2px !important; }
html body .std-filter-card .std-date-field.std-date-field { height: 32px !important; min-height: 32px !important; border-radius: 6px !important; }
@media (prefers-reduced-motion: reduce) { .std-filter-strip > .std-filter-drawer { transition: none; } }
@media (max-width: 650px) { .std-filter-card { grid-template-columns: 1fr; } }
.std-filter-strip > .std-filter-strip__action { order: 5; flex: 0 0 auto; }
.std-filter-strip > .std-filter-strip__search > input:not([type="hidden"]) { flex: 1 1 auto; height: auto !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
.std-filter-card > .std-filter-card__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
/* One strip geometry everywhere (owner, Nov 12 2026). Hosts still carry their old layout classes
   (.row, .std-filter-grid, .pi-filter, .team-toolbar, module grids), and each one bent the strip a
   different way: Filters stretched to a grid column, the three controls stacked full width, a
   taller search. The strip's own layout out-ranks all of them: search takes the free width,
   Filters and Clear size to their labels, all three are 32px tall with 6px corners on one line,
   the signed input size. On a phone the search takes the first line and Filters and Clear share
   the second, still 32px (owner 2026-11-27, #34). */
html body .std-filter-strip.std-filter-strip:not([hidden]):not(.d-none) { display: flex !important; flex-flow: row wrap !important; align-items: center !important; justify-content: flex-start !important; gap: 10px !important; margin-inline: 0 !important; }
@layer bd-filter-strip {
  html body .std-filter-strip.std-filter-strip > :is(.std-filter-strip__search, .std-filter-strip__toggle, .std-filter-strip__clear) { box-sizing: border-box !important; height: 32px !important; min-height: 32px !important; max-height: 32px !important; margin: 0 !important; align-self: center !important; border-radius: 6px !important; }
}
html body .std-filter-strip.std-filter-strip > .std-filter-strip__search { display: flex !important; flex-direction: row !important; align-items: center !important; flex: 1 1 220px !important; width: auto !important; min-width: min(100%, 220px) !important; max-width: none !important; padding: 0 10px !important; gap: 8px !important; }
html body .std-filter-strip.std-filter-strip > :is(.std-filter-strip__toggle, .std-filter-strip__clear) { flex: 0 0 auto !important; width: auto !important; min-width: 0 !important; max-width: none !important; padding: 0 10px !important; white-space: nowrap; }
html body .std-filter-strip.std-filter-strip > :is(.std-filter-strip__toggle, .std-filter-strip__clear) > span { display: inline !important; }
html body .std-filter-strip.std-filter-strip > .std-filter-strip__search > input:not([type="hidden"]) { flex: 1 1 auto !important; width: 100% !important; min-width: 0 !important; height: auto !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; outline: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 14px !important; line-height: 1.4 !important; text-indent: 0 !important; }
html body .std-filter-strip.std-filter-strip > .std-filter-strip__search > :is(i, .mdi, svg) { flex: 0 0 auto !important; margin: 0 !important; font-size: 18px !important; line-height: 1 !important; }
html body .std-filter-strip.std-filter-strip > .std-filter-strip__search > input:not([type="hidden"])::placeholder { font-size: 1em !important; font-weight: 400 !important; opacity: 1; }
html body .std-filter-strip.std-filter-strip > .std-filter-drawer { width: auto; max-width: none !important; margin-inline: 0 !important; padding: 0 !important; }
html body .std-filter-strip.std-filter-strip > .std-filter-drawer.is-open { flex: 1 0 100% !important; }
@media (max-width: 575.98px) {
  html body .std-filter-strip.std-filter-strip > .std-filter-strip__search { flex: 1 1 100% !important; }
  html body .std-filter-strip.std-filter-strip:not(:has(> .std-filter-strip__toggle)) > .std-filter-strip__search { flex: 1 1 12rem !important; min-width: 0 !important; }
  html body .std-filter-strip.std-filter-strip > :is(.std-filter-strip__toggle, .std-filter-strip__clear) { flex: 0 0 auto !important; justify-content: center; }
  html body .std-filter-strip.std-filter-strip > .std-filter-strip__search > input:not([type="hidden"]) { font-size: 16px !important; }
}

/* Active Filters row (owner decision, Nov 11 2026): whenever a register is searched or filtered, the
   first row of its table body says so, docked edge to edge under the column headers: no cell padding,
   no inset, radius or border of its own. Icon and "Active Filters", one chip per filter, then Clear
   Filters at the right. Markup: tr.std-active-filter-row > td[colspan] > .std-active-filter-banner.
   The layer and !important retire the per-module banner styles that inset it. */
@layer bd-active-filter-row {
  :is(tr.std-active-filter-row, tr.table-filter-banner-row) > td { padding: 0 !important; background: transparent !important; border-top: 0 !important; border-bottom: 1px solid var(--bd-theme-card-border, #111) !important; box-shadow: none !important; }
  :is(tr.std-active-filter-row, tr.table-filter-banner-row) > td::before { content: none !important; display: none !important; }
  div.std-active-filter-row { border-bottom: 1px solid var(--bd-theme-card-border, #111) !important; }
  :is(tr.std-active-filter-row, tr.table-filter-banner-row) > td > :is(.std-active-filter-banner, div:only-child), div.std-active-filter-row > .std-active-filter-banner { display: flex !important; align-items: center !important; flex-wrap: wrap !important; gap: 6px 10px !important; width: 100% !important; box-sizing: border-box !important; margin: 0 !important; padding: 9px 16px !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: var(--bd-theme-bg-fff8db, #fff8db) !important; color: var(--bd-theme-fg-344054, #344054) !important; font-size: .84rem !important; font-weight: 700 !important; line-height: 1.35 !important; text-align: left !important; }
}
.std-active-filter-banner > :is(.std-filter-lead, .std-active-filter-banner__label) { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--bd-theme-fg-111827, #111827); }
.std-active-filter-banner > :is(.std-filter-lead, .std-active-filter-banner__label) > i, .std-active-filter-banner > i { color: var(--bd-theme-fg-111827, #111827); font-size: 1rem; }
.std-active-filter-banner :is(.std-active-filter-chip, .bd-chip) { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 26px; margin: 0; padding: 2px 9px; border: 1px solid var(--bd-theme-border-c9b55b, #c9b55b); border-radius: 6px; background: transparent; color: var(--bd-theme-fg-111827, #111827); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.std-active-filter-banner :is(.std-active-filter-chip, .bd-chip) > i { display: none; }
.std-active-filter-banner > :is(.bd-btn, .std-btn-sample, .btn, a.std-btn-sample) { margin-left: auto; min-height: 32px; }
table[style*="--bd-active-row-width"] tr.std-active-filter-row > td > .std-active-filter-banner { position: sticky; left: 0; max-width: var(--bd-active-row-width); }

/* Docked children. A filter bar or table wrapper placed directly in a work
   panel shares the panel's edge: no second border, radius, shadow or inset,
   and the last row never draws a line on top of the panel's bottom border. */
.std-work-panel > :is(.std-table-demo, .std-filter-bar, .std-kpi-strip) { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.std-work-panel > .std-kpi-strip { border-bottom: 1px solid var(--bd-theme-border-111111, #111); }
.std-work-panel > .std-filter-bar { padding: .65rem .75rem; border-bottom: 1px solid var(--bd-theme-border-111111, #111); }
.std-work-panel > .std-table-demo { overflow-x: auto; }
.std-work-panel > .std-table-demo > table { margin: 0; }
.std-work-panel > .std-table-demo:last-child > table > :is(tbody, tfoot):last-child > tr:last-child > * { border-bottom-width: 0; }

/* Attached headers with a body band: <div class="std-work-shell
   std-kpi-attached-shell"> holding std-work-head then std-work-body. The KPI
   strip and the tab dock inside the body are bands of the header card, with
   one shared divider between them and none doubled under the head. */
.std-kpi-attached-shell > .std-work-body { gap: 0; padding: 0; }
.std-kpi-attached-shell > .std-work-body:not(.std-work-head + *) { border-top: 1px solid var(--bd-theme-border-111111, #111); }
.std-kpi-attached-shell > .std-work-body > :is(.std-kpi-strip, .std-project-dock) { width: 100%; margin: 0; border: 0 !important; border-radius: 0 !important; box-shadow: none; }
.std-kpi-attached-shell > .std-work-body > :is(.std-kpi-strip, .std-project-dock):not(:first-child) { border-top: 1px solid var(--bd-theme-border-111111, #111) !important; }
.std-kpi-attached-shell > .std-work-body > .std-project-dock { padding-inline: 0; }
.std-kpi-attached-shell > .std-work-body > .std-project-dock > :is(.std-project-dock__main, .std-project-dock__sub) { margin-inline: 0; padding-inline: .75rem; }
.std-kpi-attached-shell > .std-work-body > .std-project-dock > .std-project-dock__main:last-child { border-bottom: 0; }
/* The shared search field colors its own text so it reads in every theme
   (Accounting carried this rule privately; other pages showed black on dark). */
.std-search-control input { color: var(--bd-theme-fg-111827, #111827); }

/* Registers on phones: <div class="std-table-demo is-stack"> turns each row
   into a stacked record. Cells marked std-stack-lead (record tag, title) lead
   without a label, every other cell reads "Label  value" from its data-label,
   and std-stack-actions holds the row strip at the bottom. Rows keep the
   register's shared dividers; they are not separate cards. */
@media (max-width: 767.98px) {
  .std-table-demo.is-stack { overflow: visible !important; }
  .std-table-demo.is-stack > table { display: block; width: 100% !important; min-width: 0 !important; }
  .std-table-demo.is-stack > table > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .std-table-demo.is-stack > table > :is(tbody, tfoot) { display: block; }
  .std-table-demo.is-stack > table > :is(tbody, tfoot) > tr { display: flex; flex-direction: column; gap: .3rem; padding: .7rem .75rem; border-bottom: 1px solid var(--bd-theme-border-111111, #111); }
  .std-table-demo.is-stack > table > :is(tbody, tfoot):last-child > tr:last-child { border-bottom: 0; }
  .std-table-demo.is-stack > table > :is(tbody, tfoot) > tr > :is(td, th) { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-width: 0; padding: 0 !important; border: 0 !important; background: transparent; text-align: right; white-space: normal; }
  .std-table-demo.is-stack > table > :is(tbody, tfoot) > tr > :is(td, th)[data-label]:not(.std-stack-lead, .std-stack-actions, [colspan])::before { content: attr(data-label); flex: none; color: var(--bd-theme-text-muted, #667085); font-size: .75rem; font-weight: 400; text-align: left; }
  .std-table-demo.is-stack > table > :is(tbody, tfoot) > tr > :is(.std-stack-lead, [colspan]) { display: block; text-align: left; }
  .std-table-demo.is-stack > table > :is(tbody, tfoot) > tr > .std-stack-actions { justify-content: flex-start; margin-top: .25rem; }
  .std-table-demo.is-stack > table > :is(tbody, tfoot) > tr > :empty { display: none; }
  .std-table-demo.is-stack > table > tbody > tr:is(.std-active-filter-row, [role="status"]) { padding-block: .55rem; }
}

/* Phone cards: put data-bd-stack on the element that wraps a table and, on a phone
   (viewport under 768px), its rows become labelled records. Tablets and desktops always
   keep the docked table (signed rule: "A register is a table. At iPad width it must stay
   a docked table ... Cards are for phones only"). data-bd-stack="wide" and "narrow" are
   still accepted from older markup and behave the same. bd_table_stack.js copies each
   header's text into the cells' data-label and marks the lead cell (first cell, or
   .std-stack-lead) and the action cell (.std-stack-actions, or a row strip under an
   empty header). Sortable headers (.sortable, .std-sortable, [aria-sort]) stay as a row
   of sort chips above the records; the other headers hide.
   Project and Estimate list registers keep project_registers.js's own cards. */
[data-bd-stack] { container: bd-stack / inline-size; min-width: 0; }
@media (max-width: 767.98px) {
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) { display: block !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > thead { display: block; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > thead > tr { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; padding: 0 .5rem; border: 0; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > thead > tr > :is(th, td) { display: none; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > thead > tr > :is(.sortable, .std-sortable, [aria-sort]) { display: inline-flex; align-items: center; width: auto !important; min-width: 0 !important; min-height: 36px; padding: 0 .4rem !important; border: 0 !important; background: transparent; white-space: nowrap; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > :is(tbody, tfoot) { display: block; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > :is(tbody, tfoot) > tr:not([hidden]) { display: flex; flex-direction: column; gap: .3rem; padding: .7rem .75rem; border-bottom: 1px solid var(--bd-theme-border-111111, #111); }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > :is(tbody, tfoot):last-child > tr:last-child { border-bottom: 0; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > tbody > tr.std-active-filter-row { padding: 0; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > :is(tbody, tfoot) > tr > :is(td, th) { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: auto !important; min-width: 0 !important; max-width: none !important; padding: 0 !important; border: 0 !important; background: transparent; flex-wrap: wrap; text-align: right; white-space: normal !important; overflow-wrap: anywhere; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > :is(tbody, tfoot) > tr > [data-label]:not([data-label=""], [data-bd-stack-role="lead"], [data-bd-stack-role="actions"], [colspan])::before { content: attr(data-label); flex: none; max-width: 45%; color: var(--bd-theme-text-muted, #667085); font-size: .75rem; font-weight: 400; text-align: left; overflow-wrap: normal; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > :is(tbody, tfoot) > tr > :is([data-bd-stack-role="lead"], [colspan]) { display: block; text-align: left; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > :is(tbody, tfoot) > tr > [data-bd-stack-role="actions"] { justify-content: flex-start; flex-wrap: wrap; margin-top: .25rem; order: 2; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > :is(tbody, tfoot) > tr > [data-bd-stack-role="lead"] { order: -1; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > :is(tbody, tfoot) > tr > [data-bd-stack-role="select"] { justify-content: flex-start; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > :is(tbody, tfoot) > tr > :empty { display: none; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > :is(tbody, tfoot) > tr > :is(td, th) > * { max-width: 100%; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > :is(tbody, tfoot) > tr > :is(td, th) > :is(form, .d-flex, .d-inline-flex) { flex-wrap: wrap; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > :is(tbody, tfoot) > tr > :is(td, th):not([data-bd-stack-role]) > * + * { flex: 1 0 100%; text-align: right; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) > :is(tbody, tfoot) > tr > :is(td, th):not([data-bd-stack-role]) > [type="hidden"] + * { flex: 0 1 auto; text-align: inherit; }
  [data-bd-stack] table[data-bd-stack-table]:not([data-project-register="list"]) :is(input, select, textarea):not([type="checkbox"], [type="radio"], [type="hidden"]) { min-width: 0; max-width: 100%; }
}

/* Takeoffs, budgets and other number sheets keep their columns at every
   width: <div class="std-table-demo is-sheet">. The first column stays put
   and the edge fades show there is more to scroll (bd_table_scroll.js sets
   the bd-scroll-can-* classes on every shared table host). */
.std-table-demo.is-sheet > table > :is(thead, tbody, tfoot) > tr > :first-child { position: sticky; left: 0; z-index: 1; white-space: nowrap; background: var(--bd-theme-surface, #fff); }
.std-table-demo.is-sheet > table > thead > tr > :first-child { z-index: 2; background: var(--bd-theme-table-header-bg, #f3f4f6); }
.std-table-demo.is-sheet.bd-scroll-can-left > table > :is(thead, tbody, tfoot) > tr > :first-child { box-shadow: 6px 0 6px -6px rgba(0, 0, 0, .35); }
.bd-scroll-overflowing.bd-scroll-can-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.bd-scroll-overflowing.bd-scroll-can-left:not(.is-sheet) { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); }
.bd-scroll-overflowing.bd-scroll-can-left.bd-scroll-can-right:not(.is-sheet) { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); }

/* Theme color classes (owner, 2026-11-27): the one shared set for text tone, surface and strong edge.
   Use these instead of Bootstrap color helpers (text-muted, text-dark, text-danger, bg-white, border-dark).
   Tokens only, so each reads in Light, Dim and Dark and follows the accent. Important matches the
   Bootstrap utility weight they replace. */
.bd-tone-muted { color: var(--bd-theme-text-muted) !important; }
.bd-tone-strong { color: var(--bd-theme-text-strong) !important; }
.bd-tone-danger { color: var(--bd-theme-danger) !important; }
.bd-tone-success { color: var(--bd-theme-success) !important; }
.bd-tone-warning { color: var(--bd-theme-warning) !important; }
.bd-tone-info { color: var(--bd-theme-info) !important; }
.bd-surface { background-color: var(--bd-theme-surface) !important; }
.bd-edge-strong { border-color: var(--bd-theme-card-border) !important; }
