/* document_history.html uses the shared .list-controls* toolbar
   (static/shared/css/list-controls.css, loaded from base.html). The
   /templates/?view=all catalogue keeps the shared search/sort bar but
   moves the facets into an off-canvas "Filters" tray -- .template-catalogue*
   / .template-filters* near the bottom of this file (it still reuses
   articles/_filter_sidebar.html for the category combobox and the shared
   list_controls_ajax.js in-place-filtering contract, with
   documents/js/catalogue_filters.js keeping the tray open across a swap). */

/* .card--lift lives in static/shared/css/cards.css (loaded from
   base.html) -- extracted there once a third app (this one) needed a
   byte-for-byte copy, per agent_docs/frontend-css-conventions.md's own
   "extract once a third app needs it" rule. */

.document-card .card-body {
  padding: var(--site-card-padding, 1rem);
}

/* A big pill button: gold on dark navy text by default, with the
   --primary / --outline-primary variants below (the document page's action
   bar and the builders' headers). It was the navy template and component
   cards' CTA until those cards became GitHub-style (2026-10-21). Not
   Bootstrap's .btn (that resets to the theme's blue/gray button shapes) --
   a bare <button>/<a> styled from scratch, so it supplies its own focus
   ring explicitly below rather than relying on .btn's. */
.document-card__pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border: 0;
  border-radius: 980px;
  background-color: #ffc107;
  color: #16233c;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.document-card__pill-btn:hover {
  background-color: #ffca2c;
  color: #16233c;
}

.document-card__pill-btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.document-card__pill-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Solid blue variant -- for a pill CTA that sits on a light background
   (the quick-look modal's action bar, _template_quicklook.html) rather
   than the navy .document-card--illustrated the gold default is tuned
   for. Same blue + hover-darken as .template-catalogue__finder-card__cta's
   own pill CTA; the focus ring is navy instead of the default's white so
   it still reads against a white surface (WCAG 1.4.11). */
.document-card__pill-btn--primary {
  background-color: var(--site-btn-primary-bg-color, #0067b8);
  color: #fff;
}

.document-card__pill-btn--primary:hover {
  background-color: #00558f;
  color: #fff;
}

.document-card__pill-btn--primary:focus-visible {
  outline: 3px solid #16233c;
  outline-offset: 2px;
}

/* Outline variant of --primary above -- transparent fill, blue border/text,
   for secondary actions that sit beside a solid --primary one (e.g.
   document_fill.html's History/Finalize/Download next to its solid Save)
   on the same light background --primary is tuned for. */
.document-card__pill-btn--outline-primary {
  background-color: transparent;
  border: 1px solid var(--site-btn-primary-bg-color, #0067b8);
  color: var(--site-btn-primary-bg-color, #0067b8);
}

.document-card__pill-btn--outline-primary:hover {
  background-color: rgba(0, 103, 184, 0.08);
  color: var(--site-btn-primary-bg-color, #0067b8);
}

.document-card__pill-btn--outline-primary:focus-visible {
  outline: 3px solid #16233c;
  outline-offset: 2px;
}

/* The complexity_bars templatetag's inline SVG glyph -- one filled bar per
   tier step, drawn in currentColor so it follows the surrounding text's
   colour (the template cards' facts line; see documents_tags.py for the
   fill-count logic). */
.document-card__complexity-bars {
  flex-shrink: 0;
  display: block;
}

/* .card__badge lives in static/shared/css/cards.css -- see the
   .card--lift comment above. */

/* .card__divider lives in static/shared/css/cards.css -- see the
   .card--lift comment above. Per-content-type color override below,
   same descendant-scoped pattern as assessments.css's own
   .assessment-card .card__divider (that shared rule is used unscoped by
   multiple apps, each with their own default, so the color override
   can't live on .card__divider itself). */
.document-card .card__divider {
  border-top-color: var(--documents-card-divider-color, #adb5bd);
}

/* Generic reusable muted icon+text meta line (agent_docs/frontend-css-
   conventions.md) -- same as assessments.css's own .card__meta/
   .card__meta-label. Colour: static/shared/css/cards.css. */
.card__meta {
  font-size: 0.75rem;
}

.card__meta-label {
  color: #0067b8;
}

.document-detail__intro {
  overflow: hidden;
}

/* Standalone now (a sibling above .document-detail__intro, not its first
   child) -- carries its own rounded corners + clip instead of inheriting
   the card's, matching Bootstrap's own card corner radius so the two
   still read as one unit stacked with a small gap between them. */
.document-detail__hero-wrap {
  overflow: hidden;
  border-radius: var(--bs-border-radius, 0.375rem);
}

/* Collapsed state, applied by template_description_toggle.js only when
   the full text actually overflows it -- a short description never gets
   clamped or a "Show more" toggle in the first place. */
.document-detail__description.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.document-detail__description-toggle {
  font-size: 0.875rem;
  text-decoration: none;
  margin-top: 0.5rem;
}

.document-detail__hero {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  object-position: var(--focal-x, 50%) var(--focal-y, 50%);
  transform: scale(var(--zoom, 1));
  transform-origin: var(--focal-x, 50%) var(--focal-y, 50%);
}

.document-detail__hero--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 6;
  background: linear-gradient(135deg, #0067b8, #00365e);
  color: rgba(255, 255, 255, 0.85);
  font-size: 4rem;
}

.document-detail__title {
  color: #0067b8;
}

/* .back-link (was .document-detail__back-link) moved to
   static/shared/css/cards.css (code-audit finding FE-05, 2026-09-17). */

.document-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* A readable subtle pill for a template's taxonomy/meta chips -- the bare
   shared .card__badge has white text and no background of its own (it
   expects a per-context colour override), so it isn't reused here. Shared
   by _template_intro.html's own meta line (template_detail.html,
   document_fill.html, and the catalogue quick-look modal all include it)
   and _template_quicklook.html's "Discovery taxonomy" card. */
.document-chip {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border: 1px solid #d7dee5;
  border-radius: 980px;
  background: #f2f5f8;
  color: #495057;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

/* The shared "modern info card" -- an icon badge + a stacked label/value
   list, replacing a plain Bootstrap dl.row grid. Used by
   _template_guided_info.html's three cards (template_detail.html,
   document_fill.html, and the catalogue quick-look modal all include it)
   and the quick-look's own Discovery taxonomy card. Reuses the site's own
   card radius token (.card--lift, static/shared/css/cards.css) rather than
   inventing a new one; stacked with .card--bordered in the template for
   the standard 1px hairline -- no .card--lift here since these are static
   reading cards, not clickable ones, so they skip its hover-lift affordance. */
.document-info-card {
  border-radius: var(--site-card-border-radius, 1.25rem);
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
}

.document-info-card .card-body {
  padding: 1.5rem;
}

.document-info-card__heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.document-info-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 0.75rem;
  background: #e9f2fc;
  border: 1px solid #cfe1f2;
  color: #1668c9;
  font-size: 1.05rem;
}

.document-info-card__title {
  margin: 0;
  font-weight: 700;
  color: #16233c;
}

.document-info-card__list {
  margin: 0;
}

.document-info-card__row {
  padding: 0.65rem 0;
}

.document-info-card__row:first-child {
  padding-top: 0;
}

.document-info-card__row:not(:first-child) {
  border-top: 1px solid #eef1f4;
}

.document-info-card__row dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  /* #5c6672 (about 5.9:1 on white): small bold uppercase text is still
     "normal" text for WCAG 1.4.3, which needs 4.5:1 -- the earlier
     #8a94a3 measured 3.06:1. */
  color: #5c6672;
  margin-bottom: 0.3rem;
}

.document-info-card__row dd {
  margin: 0;
  color: #1d1d1f;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.document-detail__image-credit {
  font-size: 0.75rem;
}

.document-fill__section-title {
  margin-bottom: 0.5rem;
  color: #0067b8;
}

/* Same border colour (#ccc) as the shared rich-text toolbar pinned above
   these sections -- Quill's own .ql-toolbar.ql-snow default border
   (quill.snow.css), unchanged by this project's toolbar overrides further
   down this file -- so a section card reads as continuous with the
   toolbar above it. Top corners rounded (bottom left square, matching the
   straight bottom edge these cards sit on). */
.document-fill__section.card--bordered {
  border-top-left-radius: 0.75rem;
  border-top-right-radius: 0.75rem;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-color: #ccc;
}

/* Bootstrap's own .card-header:first-child rule already rounds the
   header's top corners to match the card -- restated explicitly here so
   it stays in step with the card's own radius above rather than relying
   on inheritance from a rule elsewhere. */
.document-fill__section.card--bordered .card-header.builder-form-card__header {
  border-top-left-radius: 0.75rem;
  border-top-right-radius: 0.75rem;
}

/* Light gray instead of .builder-form-card__header's own shared light-
   blue tint (#e9f2fc/#cfe1f2, used site-wide on the template/assessment
   builders) -- scoped to just this page's own section headers (plus the
   "Example" tray's matching cards, document_fill.html's own comment on
   why those reuse this exact look) rather than the shared rule, which
   stays untouched for every other page using it. */
.document-fill__section.card--bordered .card-header.builder-form-card__header,
.document-fill__sample-section.builder-form-card .card-header.builder-form-card__header,
.document-rail-layout__section.builder-form-card .card-header.builder-form-card__header {
  background-color: #f1f3f5;
  border-bottom-color: #dee2e6;
}

/* The Customize panel's section/field action buttons, against the gray
   header strip above: base.html's site-wide .btn-outline-secondary theme
   already sets an explicit white --bs-btn-bg for its own *enabled,
   resting* state (Edit, and the reorder arrows when not the first/last
   row) -- that was already fine. Two gaps it left, now visible against
   gray instead of blending into white: .btn-outline-danger (Delete)
   isn't covered by that rule at all, so it kept Bootstrap's own
   transparent default; and disabled buttons read --bs-btn-disabled-bg,
   a separate variable base.html never set, so a disabled reorder arrow
   fell back to Bootstrap's own transparent default too.
   Setting the *variable* (not a plain background-color/.bg-white
   utility) matters here -- a plain background-color would tie Bootstrap's
   own same-specificity :hover rule and can win it by source order,
   forcing the background to stay white through hover too while the
   hover *text/icon* colour still switches to white, producing an
   invisible white-on-white icon (confirmed: this is exactly what
   happened when this was first tried with .bg-white). Setting --bs-btn-bg
   only touches the resting state; --bs-btn-hover-bg/--bs-btn-active-bg
   (already set red by .btn-outline-danger itself) are untouched, so
   hover still properly fills red with a white icon. */
.document-rail-layout__section .btn-outline-danger,
.document-rail-layout__field .btn-outline-danger {
  --bs-btn-bg: #fff;
}

.document-rail-layout__reorder .btn:disabled {
  --bs-btn-disabled-bg: #fff;
}

/* document_fill.html's sections are a Bootstrap collapse (native
   data-bs-toggle, no custom JS) rather than the .accordion component --
   keeps the existing .builder-form-card header look (tinted strip,
   title/subtitle typography) instead of Bootstrap's own accordion-button
   styling. Every section starts open (no data-bs-parent -- each toggles
   independently, same "always open by default" rule as the admin/builder
   accordion patterns) so nothing on the form is hidden on first load. */
.document-fill__section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1.35rem;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

/* document_fill.html isn't inside .document-builder__main (the builder's
   own "several cards stacked" scope that otherwise shrinks
   .builder-form-card__title to 1.15rem) -- same smaller size here, so a
   section header reads proportionate to the tighter padding above. Scoped
   to the <h2> itself (not .document-fill__section-toggle) since a section
   with a help button has the title span as the toggle's sibling, not its
   descendant -- see the stretched-button comment further down. */
.document-fill__section-header .builder-form-card__title,
.document-fill__section-toggle .builder-form-card__title {
  font-size: 1.4rem;
}

/* Flex row (not the plain d-block the markup used before) so the leading
   icon/number badge is vertically centered against the title text by
   layout rather than a hand-tuned vertical-align offset against the
   text's font metrics. */
.document-fill__section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.document-fill__section-icon {
  color: #1668c9;
  flex-shrink: 0;
}

.document-fill__section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: #1668c9;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.document-fill__section-chevron {
  flex-shrink: 0;
  font-size: 1.1rem;
  transition: transform 0.15s ease;
}

.document-fill__section-toggle.collapsed .document-fill__section-chevron {
  transform: rotate(-90deg);
}

/* A section with a help button: a help button can't nest inside the
   collapse-toggle button (a <button> can't contain another <button>), so
   the toggle is instead an invisible button absolutely positioned over the
   *entire* row ("stretched button", same idea as Bootstrap's own
   .stretched-link) -- the title text and chevron are plain static content
   stacked on top of it (CSS stacking puts a positioned element above its
   non-positioned siblings by default, so clicks on them fall through to the
   toggle underneath with no pointer-events trickery needed), and the help
   button is promoted into its own stacking position above *that* so it
   still receives its own clicks. Every other (no-description) section's
   header is untouched -- still the single full-width toggle button. */
.document-fill__section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.1rem 1.35rem;
  position: relative;
}

.document-fill__section-toggle--stretched {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.document-fill__section-toggle--stretched:focus-visible {
  outline: 2px solid #1668c9;
  outline-offset: -2px;
}

.document-fill__section-chevron--end {
  margin-left: auto;
}

/* The sibling equivalent of the .document-fill__section-toggle.collapsed
   .document-fill__section-chevron rule above -- general sibling combinator
   since the chevron is no longer a descendant of the toggle button here. */
.document-fill__section-toggle--stretched.collapsed ~ .document-fill__section-chevron--end {
  transform: rotate(-90deg);
}

/* Icon-only help button, opens #documentFillSectionHelp. Byte-for-byte
   copy of assessments.css's .builder-field-info (2nd app using this
   pattern -- promotes to static/shared/css/cards.css on a 3rd).
   position:relative + z-index above the stretched toggle button (1) so
   this one keeps receiving its own clicks instead of the toggle
   underneath stealing them. */
.document-fill__section-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* WCAG 2.5.8 target size: at least 24 x 24px to click or tap, however
     small the icon inside is drawn. */
  min-width: 24px;
  min-height: 24px;
  position: relative;
  z-index: 2;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6c757d;
  font-size: 1.05rem;
  line-height: 1;
  border-radius: 50%;
}

.document-fill__section-help-btn:hover,
.document-fill__section-help-btn:focus-visible {
  color: #1668c9;
}

.document-fill__section-help-btn:focus-visible {
  outline: 2px solid #1668c9;
  outline-offset: 2px;
}

/* Static label above the (dynamic, per-section) offcanvas title -- says
   what the tray itself is for, since "Document control" alone doesn't.
   A tinted pill (not just .document-page-head__eyebrow's plain text) so it
   stands out as its own thing above the title -- same blue tint as
   .assessment-page-head__icon/.document-page-head__icon's badge look.
   #1668c9 on #e9f2fc is 4.8:1, clears WCAG 1.4.3's 4.5:1 minimum for this
   text's size. */
.document-fill__section-help-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1668c9;
  background-color: #e9f2fc;
  border: 1px solid #cfe1f2;
  border-radius: 980px;
  padding: 0.2rem 0.65rem;
}

/* agent_docs/design.md's "Form Design Best Practices" source: match field
   length to the expected input rather than stretching every field to the
   full container width. Scoped by HTML5 input type, which already signals
   the expected input shape (forms.build_widget_field) -- a generic
   short_text/long_text keeps the full-width default since its expected
   length varies too much per field to guess from the type alone. */
.document-fill__field input[type="date"],
.document-fill__field input[type="time"],
.document-fill__field input[type="datetime-local"],
.document-fill__field input[type="tel"],
.document-fill__field input[type="number"] {
  max-width: 220px;
}

.document-fill__field input[type="email"],
.document-fill__field input[type="url"] {
  max-width: 360px;
}

/* Hidden by conditional_fields.js when a field's own condition isn't met
   -- kept out of the layout entirely (display: none) rather than just
   visually hidden, so a hidden field's inputs don't confuse tab order. */
.document-fill__field.d-none {
  display: none;
}

/* The document page's header (document_fill.html, ADR 0089), in two parts.
   The title row (.document-fill__head) says which document this is and
   scrolls away with the page. The toolbar (.document-fill__bar) is the only
   thing that pins, at every width, under the navbar (shared/js/
   sticky_list_controls.js, [data-sticky-pin]): one slim row of actions, not a
   third of the screen. var(--lc-sticky-top, 4rem) is that script's
   live-measured navbar height; the 4rem fallback only matters before it
   runs / with JS disabled, since this page doesn't otherwise load
   list-controls.css (which is where that var's own :root fallback lives). */
.document-fill__head {
  margin-bottom: 0.75rem;
}

.document-fill__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
}

/* The name and its pencil stay together as one item when the row wraps, and
   the pencil follows the name's last word when the name itself wraps (inline,
   not a flex row, which would pin it to the right edge of a two-line name). */
.document-fill__title {
  min-width: 0;
}

.document-fill__title .document-page-head__title {
  display: inline;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.document-fill__title .document-fill__icon-btn {
  vertical-align: middle;
  margin-left: 0.25rem;
}

/* The rename form takes the title's place (document_title_rename.js hides the
   heading wrapper while it's open). */
.document-fill__title-row .document-page-head__title-form:not([hidden]) {
  flex: 1 1 20rem;
  margin-bottom: 0;
}

/* The pencil beside the name: 2rem square (WCAG 2.5.8's minimum is 24px), grey
   until pointed at, like the project page's heart. */
.document-fill__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: var(--bs-border-radius, 0.375rem);
  background: none;
  color: #5c6672;
  font-size: 1.1rem;
  cursor: pointer;
}

.document-fill__icon-btn:hover {
  background-color: #f1f3f5;
  color: #0067b8;
}

/* The favorite toggle as a heart alone (plan/_favorite_toggle.html with
   icon=True). Same values as projects.css's .favorite-icon-button (two apps so
   far; it moves to static/shared/css on the third): 2.25rem square, grey
   outline heart (#5c6672, 5.8:1 on white), red and filled once it's a
   favorite or while pointed at (#dc3545, 4.5:1). */
.favorite-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: var(--bs-border-radius, 0.375rem);
  background: none;
  color: #5c6672;
  font-size: 1.25rem;
  cursor: pointer;
}

.favorite-icon-button:hover {
  background-color: #f1f3f5;
  color: #dc3545;
}

.favorite-icon-button.is-favorite {
  color: #dc3545;
}

.document-fill__template-line {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: #5c6672;
}

/* The status next to the name (Draft, In review, Final): a small pill, not a
   button-sized one. Solid gray/white for a draft, the lifecycle-status-badge
   convention used everywhere else on the site (.template-card__status-token--
   draft); a plain class rather than Bootstrap's .text-bg-secondary, whose
   color/background-color are !important. 4.7:1, clears WCAG 1.4.3. */
.document-fill__status {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 980px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
}

.document-fill__status--draft {
  background-color: #6c757d;
  color: #fff;
}

.document-fill__bar {
  position: sticky;
  top: var(--lc-sticky-top, 4rem);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  padding-block: 0.25rem;
  margin-bottom: 1rem;
  background-color: var(--site-bg-color, #fff);
  border-bottom: 1px solid #dee2e6;
}

/* Bottom-only shadow ledge once pinned -- full PAGE width (list-controls.css's
   own ::after trick: break out of the centered column with 100vw + a
   centred left, so the pinned shadow reads as a page-spanning edge). #main-
   content's overflow-x: clip (base.html) keeps the 100vw from adding a
   horizontal scrollbar. */
.document-fill__bar::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  top: 100%;
  height: 0;
  background-color: var(--site-bg-color, #fff);
  box-shadow: 0 0 0 transparent;
  transition: height 0.12s ease, box-shadow 0.12s ease;
}

.document-fill__bar.is-pinned::after {
  height: 1rem;
  box-shadow: 0 8px 14px -4px rgba(0, 0, 0, 0.22);
}

/* Flash messages rendered inside the pinned bar (document_fill.html's own
   {% block flash_messages %} override) -- zero the alert's own bottom
   margin so it doesn't double up with the bar's own `gap`. */
.document-fill__actions-messages .alert {
  margin-bottom: 0;
}

/* Two groups that wrap rather than scroll: finding your way around on the
   left, what you do with the document on the right (margin-left: auto, so
   when the row is too narrow the right group drops to its own line, still at
   the right). Only Finalize looks like a button; the rest are text. */
.document-fill__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.5rem;
}

.document-fill__toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.5rem;
}

@media (min-width: 992px) {
  .document-fill__toolbar-group {
    column-gap: 1rem;
  }
}

.document-fill__toolbar-group--end {
  margin-left: auto;
}

/* A text control in the toolbar: an icon and a label in the site's link blue,
   no fill and no border, underlined when pointed at or focused (the same
   treatment as .document-fill__collapse-all-btn and My work's text
   buttons). 2.5rem tall so a finger can hit it (WCAG 2.5.8). The focus ring
   is focus.css's. */
.document-fill__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
  min-height: 2.5rem;
  min-width: 2.5rem;
  padding: 0 0.1rem;
  border: 0;
  background: none;
  color: var(--site-link-color, #0067b8);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.document-fill__link:hover,
.document-fill__link:focus-visible {
  color: var(--site-link-color, #0067b8);
  text-decoration: underline;
}

.document-fill__link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* More has the three dots to say it's a menu, so no caret too. */
.document-fill__link.dropdown-toggle#documentFillMoreToggle::after {
  display: none;
}

/* "Autosaved": plain muted text, not a control. #5c6672 is 5.8:1 on white. */
.document-fill__saved {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: #5c6672;
}

/* "Exit customization", only while the Customize panel is open. Customize
   itself is in More; document_structure_panel.js keeps aria-expanded current
   on every [data-customize-toggle]. */
.document-fill__toolbar .document-fill__exit-customize[aria-expanded="false"] {
  display: none;
}

/* The two real buttons here (Finalize, and Save when autosave is off) are
   sized to the row's 2.5rem. */
.document-fill__toolbar .document-card__pill-btn {
  min-height: 2.5rem;
  padding: 0.4rem 1.1rem;
  font-size: 0.9375rem;
}

/* A label that gives way to its icon when the row runs out of room: clipped
   the way .visually-hidden is, not display: none, which would strip the
   accessible name along with the pixels. --lg collapses below 992px, --md
   below 768px, --sm below 576px. Measured by laying the real page out at 16
   widths from 320px to 1400px, with a template that has every link (Outline,
   Example, Help, Customize): the toolbar is one 49px row from 480px up and
   wraps to two (89px) below that, with no horizontal scroll at any width. */
@media (max-width: 991.98px) {
  .document-fill__label--lg {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (max-width: 767.98px) {
  .document-fill__label--md {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (max-width: 575.98px) {
  .document-fill__label--sm {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

.document-fill__more-menu {
  min-width: 14rem;
}

.document-fill__more-menu .dropdown-item i {
  margin-right: 0.5rem;
}

/* Archive, in red like the cards' Delete. #b02a37 is 6.4:1 on white and stays
   above 4.5:1 on the item's grey hover fill. */
.dropdown-item.document-fill__danger-item,
.dropdown-item.document-fill__danger-item:hover,
.dropdown-item.document-fill__danger-item:focus {
  color: #b02a37;
}

/* How the sections are shown (the examples switch, Collapse all): above the
   sections, not in the pinned bar. Gone while the Customize panel replaces
   the form. */
.document-fill__view-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.75rem;
}

.document-rail-layout--open .document-fill__view-options {
  display: none;
}

/* A plain small link, not a pill button -- a discrete option alongside
   the switch next to it. */
.document-fill__collapse-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.document-fill__collapse-all-btn:hover,
.document-fill__collapse-all-btn:focus-visible {
  text-decoration: underline;
}

.document-fill__guidance-switch {
  margin-bottom: 0;
  font-size: 0.875rem;
}

/* The examples switch, off -- hides every field's guidance toggle and any
   currently-open guidance panel at once. */
.document-fill__hide-guidance .document-fill__guidance-toggle,
.document-fill__hide-guidance .document-fill__guidance-panel {
  display: none;
}

/* The label sits above its input as plain bold text with a small gap --
   not a bordered gray box seamed onto the input (approved mockup from
   conversation: the input is the one thing that should read as "fill this
   in," the label next to it shouldn't compete with it for attention). A
   single Yes/No checkbox is exempt (kept as django-bootstrap5's plain
   combined .form-check render -- see the template) since splitting a
   one-line input+label pairing into a label-above-input layout would read
   as broken. The input (django-bootstrap5's own .form-control/.form-select)
   needs no radius override here -- it already renders fully rounded on its
   own via Bootstrap's default, now that it's not sharing an edge with the
   label box above it. */
.document-fill__field-label {
  margin-bottom: 0.4rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.document-fill__guidance-toggle {
  text-decoration: none;
}

.document-fill__guidance-panel {
  padding: 0.75rem 1rem;
  background-color: #f4f7fb;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

/* Info text / Divider (ADR 0068) -- no input, just a heading/body pair or a
   bare rule between the fields around it. */
.document-fill__note {
  margin-bottom: 1rem;
}

.document-fill__note-rule {
  margin: 1.5rem 0;
  /* Deliberately more visible than a generic hairline (#dee2e6, used for
     decorative dividers elsewhere) -- this rule's entire job is to read as
     an intentional divider, not blend into the background (reported as
     invisible against the previewer's light card background at the
     lighter shade). */
  border-top: 2px solid #adb5bd;
  opacity: 1;
}

.document-fill__note-title {
  margin-bottom: 0.35rem;
  color: #16233c;
}

/* The "Fields" off-canvas tray -- same treatment as the templates
   catalogue's own .template-filters.offcanvas (documents:list): no
   backdrop, so it starts below the navbar and carries its own shadow in
   place of one. */
.document-fill__nav.offcanvas {
  --bs-offcanvas-width: 20rem;
  top: var(--lc-sticky-top, 4rem);
  box-shadow: -4px 0 24px rgba(16, 35, 60, 0.18);
}

/* Byte-for-byte the same spacing treatment as .document-builder__palette-
   search (the customize rail's own field-type search box, further down
   this file) -- lines the search box's height up with the group toggles
   below it, same reasoning as that rule's own comment. */
.document-fill__nav-search {
  margin-bottom: 1rem;
}

.document-fill__nav-search .form-control,
.document-fill__nav-search .input-group-text {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.document-fill__nav-group + .document-fill__nav-group {
  margin-top: 1rem;
}

/* Same native data-bs-toggle collapse as the form's own
   .document-fill__section-toggle (no custom JS, starts open). */
.document-fill__nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0 0 0.25rem;
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.document-fill__nav-group-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #16233c;
}

.document-fill__nav-group-chevron {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: #6c757d;
  transition: transform 0.15s ease;
}

.document-fill__nav-group-toggle.collapsed .document-fill__nav-group-chevron {
  transform: rotate(-90deg);
}

.document-fill__nav-link {
  display: block;
  padding: 0.25rem 0;
  font-size: 0.875rem;
  color: #495862;
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 0.6rem;
}

.document-fill__nav-link:hover,
.document-fill__nav-link:focus-visible {
  color: #0067b8;
  border-left-color: #0067b8;
}

/* Brief highlight after a nav-link jump (document_fill_nav.js toggles this,
   removed after a couple seconds) -- confirms which field was brought into
   focus, since the smooth-scroll target isn't always obvious at a glance. */
.document-fill__field.is-nav-highlighted,
.document-fill__grid.is-nav-highlighted {
  animation: document-fill-nav-highlight 2s ease-out;
}

@keyframes document-fill-nav-highlight {
  from { background-color: #eef5fd; }
  to { background-color: transparent; }
}

/* "View example" tray (#documentFillSampleViewer) -- same no-backdrop
   offcanvas treatment as .document-fill__nav above. The industry switcher
   is a plain <select> (document_fill_sample_viewer.js toggles .d-none on
   the matching .document-fill__sample-pane on change) -- no bespoke
   styling needed beyond Bootstrap's own .form-select. Widened past the
   other trays' 20rem -- a section card with a real table inside it needs
   more room than a plain text list did. */
.document-fill__sample-viewer.offcanvas {
  --bs-offcanvas-width: 26rem;
  top: var(--lc-sticky-top, 4rem);
  box-shadow: -4px 0 24px rgba(16, 35, 60, 0.18);
}

/* Sticks to the top of .offcanvas-body (Bootstrap's own scroll container
   for this tray -- offcanvas-body: overflow-y: auto) as the example
   content scrolls underneath, so switching industry never needs a scroll
   back to the top first. The negative top/side margins (matching
   .offcanvas-body's own 1rem padding, re-added here) pull this element's
   background out to the body's actual top/side edges -- without it,
   "sticky" only covers from its own box downward, leaving the parent's
   top padding strip uncovered and letting scrolled content peek through
   that gap once pinned. */
.document-fill__sample-picker {
  position: sticky;
  top: -1rem;
  z-index: 2;
  background-color: var(--bs-offcanvas-bg, #fff);
  margin: -1rem -1rem 1rem;
  padding: 1rem 1rem 1rem;
  border-bottom: 1px solid #dce0e5;
}

.document-fill__sample-industry {
  color: #1668c9;
  margin-bottom: 0.25rem;
}

/* Each section is its own .builder-form-card (same card-header strip the
   real form's own sections use, _document_fill_groups.html) rather than a
   bare heading + running text -- that's what actually fixed "looks like
   one block of text": a bounded, bordered card per section reads as a
   distinct chunk at a glance, the same way it already does in the form
   behind this tray. The title doubles as a jump link (document_fill_
   sample_viewer.js) -- .builder-form-card__title already sets the
   weight/colour; only the link-specific states need adding here. */
.document-fill__sample-section-title,
.document-fill__sample-label {
  text-decoration: none;
  display: inline-block;
}

.document-fill__sample-section-title:hover,
.document-fill__sample-section-title:focus-visible,
.document-fill__sample-label:hover,
.document-fill__sample-label:focus-visible {
  text-decoration: underline;
}

/* A field's own label, also a jump link (straight to that field, not just
   its section) -- same document_fill_sample_viewer.js wiring as the
   section title above. */
.document-fill__sample-label {
  /* Bigger than the answer text below it (1rem, Bootstrap's default body
     size) -- at the smaller 0.875rem it used to be, bold alone wasn't
     enough to read as clearly the question rather than the answer. */
  color: #16233c;
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* Table field (documents.forms.TableField / _TableWidget) -- a fixed
   rows x columns grid of plain text cells, same table treatment as a Data
   Grid row (.table-responsive already handles horizontal overflow on a
   narrow viewport, ADR 0044). Each cell keeps its ordinary visible
   form-control border at rest -- no hover/focus-only affordance -- and
   just needs a sane minimum width so a short label doesn't collapse its
   column to an unusably narrow input. */
.document-fill__table th {
  white-space: nowrap;
}

.document-fill__table td {
  min-width: 8rem;
  padding: 0.35rem;
}

/* --- Guided template journey (ADR 0046) ---------------------------------- */

/* Finder (finder.html): the look of the assessment builder's front door
   (assessments/builder/new.html; product owner, 2026-11-02). A rail panel of
   "How it works" beside the intro and one .builder-form-card holding the
   question's choices. The layout, rail panel, rail title, progress label and
   bar, card strip and softer card border are the template builder's own rules
   (see "Template builder" below), with the .document-finder__* names added to
   their selectors; the stepper, intro and card are the shared .builder-*
   classes. Only what the Finder alone has is here. */

/* The progress block sits above "How it works" in the rail. */
.document-finder__progress {
  margin-bottom: 1.5rem;
}

/* Each step's text beside its marker: the label (.builder-stepper__label)
   over a quieter description (#5c6672, 5.9:1 on white). The marker is
   2.25rem tall, so the text starts 0.45rem down to put the label's first
   line level with the middle of the marker (or the tip's icon). */
.document-finder__rail .builder-stepper__link {
  align-items: flex-start;
}

.document-finder__step-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  padding-top: 0.45rem;
}

.document-finder__step-desc {
  font-size: 0.9375rem;
  line-height: 1.4;
  color: #5c6672;
}

/* "Not sure?" under the steps, as a last row under the same light rule that
   separates the steps (it only separates parts, so it is decorative under
   WCAG 1.4.11), with the steps' own spacing. The icon takes the marker's
   width and height. */
.document-finder__tip {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-top: 1.1rem;
  border-top: 1px solid #dee2e6;
  color: #16233c;
}

.document-finder__tip-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: #0067b8;
  font-size: 1.5rem;
}

/* The stepper's tighter rows below lg (.builder-stepper__link). */
@media (max-width: 991.98px) {
  .document-finder__tip {
    gap: 0.75rem;
    padding-top: 0.75rem;
  }
}

/* The question's choices (and the result's "Also consider"): bordered cards
   like the builder's Quick / Advanced options, but each a link to another
   page (no radios, no submit). As many columns as fit at 18rem each: one on a
   phone, two where the main column has room, and one again when the text is
   enlarged, since the rem grows with it. A fixed breakpoint can't know that,
   and at 200% text it left two columns splitting words mid-word. */
.document-finder__choices {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.document-finder__choice {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  height: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid #d3d9df;
  border-radius: 0.65rem;
  background-color: #fff;
  color: #16233c;
  text-decoration: none;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

/* Hover and keyboard focus look as the builder's selected option does
   (#0067b8 border and ring, #eef5fd fill) and underline the label, so the
   state is not colour alone. The focus ring itself is focus.css's. */
.document-finder__choice:hover,
.document-finder__choice:focus-visible {
  border-color: #0067b8;
  background-color: #eef5fd;
  box-shadow: inset 0 0 0 1px #0067b8;
}

.document-finder__choice:hover .document-finder__choice-label,
.document-finder__choice:focus-visible .document-finder__choice-label {
  text-decoration: underline;
}

.document-finder__choice-body {
  min-width: 0;
}

.document-finder__choice-label {
  display: block;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #1d2b45;
}

/* #5c6672 is 5.9:1 on white and 5.3:1 on the hover fill. */
.document-finder__choice-desc {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.9375rem;
  color: #5c6672;
}

.document-finder__choice-chevron {
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: #5c6672;
  font-size: 1.125rem;
}

.document-finder__choice:hover .document-finder__choice-chevron,
.document-finder__choice:focus-visible .document-finder__choice-chevron {
  color: #0067b8;
}

/* Finder result + completion "next step" callouts. */
.document-journey__callout {
  padding: 1.25rem;
  border: 1px solid #dee2e6;
  border-left: 4px solid var(--site-btn-primary-bg-color, #0067b8);
  border-radius: 0.5rem;
  background-color: #f4f7fb;
}

/* "When to use it" / "Who it's for" tinted info panels in the quick-look
   (_template_quicklook.html) -- icon circle + bold title + body text. Same
   icon-badge shape as
   .document-info-card__icon (the detail page's "Understand it" card),
   just two colors here (blue / green) instead of one, since this
   component's whole point is to tell the two fields apart at a glance. */
.document-card__info-panel {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.125rem;
  border-radius: 0.95rem;
  margin-bottom: 0.85rem;
}

.document-card__info-panel:last-child {
  margin-bottom: 0;
}

.document-card__info-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 1.125rem;
}

.document-card__info-panel-title {
  margin: 0 0 0.2rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: #16233c;
}

.document-card__info-panel-text {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.4;
  color: #495057;
}

.document-card__info-panel--when {
  background-color: #e9f2fc;
}

.document-card__info-panel--when .document-card__info-panel-icon {
  background-color: #3d7fc9;
  color: #fff;
}

.document-card__info-panel--who {
  background-color: #e9f7ee;
}

.document-card__info-panel--who .document-card__info-panel-icon {
  background-color: #3f9d6e;
  color: #fff;
}

/* Purple, distinct from --when's blue and --who's green -- this panel
   renders first (whenever it renders at all), so it needed its own tier
   in the same color family rather than reusing either. */
.document-card__info-panel--what {
  background-color: #f2edfb;
}

.document-card__info-panel--what .document-card__info-panel-icon {
  background-color: #7c5cc4;
  color: #fff;
}

/* A tag chip: the template builder's Tags field (_meta_fields.html,
   document_tags_editor.js). The catalogue cards stopped showing tags on
   2026-10-21. The z-index lift is a leftover from when a chip was a link
   inside a card. */
.document-card__tag-badge {
  position: relative;
  z-index: 2;
  display: inline-block;
  font-size: 0.6875rem;
  color: #495057;
  border: 1px solid #ced4da;
  padding: 0.15rem 0.5rem;
  border-radius: 980px;
  text-decoration: none;
}

.document-card__tag-badge:hover,
.document-card__tag-badge:focus-visible {
  border-color: #495057;
  color: #212529;
}

/* Settings step's Tags field (_meta_fields.html) -- document_tags_editor.js's
   chip editor, same interaction as articles' own #articleFormTagsEditor
   (article_tags_editor.js) but styled to this builder's own plain
   Bootstrap-default look (agent_docs/design.md's documented divergence --
   builder forms don't use the marketing form's boxed #9aa5b1 treatment)
   rather than duplicating that page's own custom-bordered row: the typed-
   word input is a plain second .form-control dropped into the same
   .input-group as the (now hidden) real #id_tags field + its bi-hash icon,
   so it inherits the exact border/radius/focus styling every other field on
   this step already has, no extra color rules needed here. Only the pill
   row below needs its own CSS. */
.document-form-tags-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Reuses .document-card__tag-badge's own color/border/radius, but larger
   than that card-badge context calls for -- a form control someone is
   actively reading/removing needs to read more easily than a compact card
   meta line does. Same bump articles' own .article-form-tags-pills
   .article-detail__tag-badge override makes over its base pill. */
.document-form-tags-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  cursor: default;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
}

.document-form-tags-remove {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  line-height: 1;
  font-size: 1rem;
  color: #6c757d;
}

.document-form-tags-remove:hover,
.document-form-tags-remove:focus-visible {
  color: #212529;
}

/* ============================================================= *
 *  Templates overview (/templates/) -- ADR 0057                  *
 * ============================================================= */

/* --- Search --------------------------------------------------- */
/* Left-aligned under the page heading (2026-10-18; it was centred). */
.template-home__search {
  max-width: 44rem;
  margin: 0 0 2.5rem;
}

.template-home__search-group {
  border-radius: 0.85rem;
  box-shadow: 0 1px 3px rgba(16, 35, 60, 0.06);
}

.template-home__search-group > .input-group-text {
  background: #fff;
  border-right: 0;
  color: #6c757d;
  padding-left: 1.1rem;
}

.template-home__search-group > .form-control {
  border-left: 0;
  padding-left: 0.25rem;
  font-size: 1.0625rem;
  box-shadow: none;
}

.template-home__search-group > .btn {
  padding-inline: 1.75rem;
  font-weight: 600;
}

.template-home__search-hint {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  /* #8a929c was 3.14:1 on white (WCAG 1.4.3, AX-11) */
  color: #5c6672;
}

/* --- The "not sure / browse" pair ----------------------------- */
.template-home__intro {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.template-home__intro-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 2rem 1.75rem;
  border: 1px solid #e3e7ec;
  border-radius: 1rem;
  background: #fff;
  color: #16233c;
  text-decoration: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.template-home__intro-card--accent {
  background: #eef4fc;
  border-color: #d6e4f5;
}

.template-home__intro-card:hover,
.template-home__intro-card:focus-visible {
  border-color: var(--site-btn-primary-bg-color, #0067b8);
  box-shadow: 0 6px 20px rgba(16, 35, 60, 0.08);
}

.template-home__intro-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  background: #dbe9fb;
  color: var(--site-btn-primary-bg-color, #0067b8);
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}

.template-home__intro-icon--solid {
  background: var(--site-btn-primary-bg-color, #0067b8);
  color: #fff;
}

.template-home__intro-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.template-home__intro-text {
  max-width: 24rem;
  font-size: 0.9375rem;
  color: #5c6672;
}

.template-home__intro-btn {
  margin-top: 0.75rem;
  border-radius: 0.6rem;
  font-weight: 600;
}

/* --- Sections ------------------------------------------------- */
.template-home__section {
  margin-top: 3rem;
}

.template-home__section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.template-home__section-head h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
}

/* "Continue your work": the "View all" link + the scroller arrows, pushed
   to the right edge and staying right-aligned if they wrap to their own
   line (margin-left:auto, not justify-content, survives the wrap). */
.template-home__section-head-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* Prev/Next buttons for a one-line scroller (scroll_rail.js) -- pushed to
   the far right of the section head ("Browse by tool"), or riding with
   the View-all link there ("Continue your work", above). */
.template-home__rail-controls {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.template-home__section-head > .template-home__rail-controls {
  margin-left: auto;
}

.template-home__rail-controls .btn:disabled {
  opacity: 0.35;
}

.template-home__section-sub {
  margin: 0.5rem 0 1rem;
  color: #6c757d;
}

.template-home__section-more {
  margin: 1rem 0 0;
  font-size: 0.9375rem;
}

.template-home__chevron {
  margin-left: auto;
  color: #adb5bd;
  flex-shrink: 0;
}

/* --- Continue your work -------------------------------------- */
.template-home__collections {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* A one-line horizontal scroller (documents/js/scroll_rail.js) -- mirrors
   .template-home__tools below and the Related Insights carousel
   (articles.css). Kept as its own copy of the mechanics: 2 rails in this
   app so far, graduate to a shared rule on the 3rd. */
.template-home__resume-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  /* clear the section head (its arrows would otherwise touch the cards) */
  margin-top: 1rem;
  /* room for the scrollbar without it adding visible height */
  padding-bottom: 0.5rem;
  margin-bottom: -0.5rem;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  cursor: grab;
}

.template-home__resume-grid.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  user-select: none;
}

.template-home__resume-grid.is-dragging .template-home__resume-card {
  pointer-events: none;
}

.template-home__resume-card,
.template-home__collection {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.15rem;
  border: 1px solid #e3e7ec;
  border-radius: 0.85rem;
  background: #fff;
  color: #16233c;
  text-decoration: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.template-home__resume-card {
  flex: 0 0 auto;
  width: clamp(15rem, 70vw, 20rem);
}

.template-home__resume-card:hover,
.template-home__resume-card:focus-visible,
.template-home__collection:hover,
.template-home__collection:focus-visible {
  border-color: var(--site-btn-primary-bg-color, #0067b8);
  box-shadow: 0 4px 14px rgba(16, 35, 60, 0.07);
}

.template-home__resume-icon,
.template-home__collection-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: #dbe9fb;
  color: var(--site-btn-primary-bg-color, #0067b8);
  font-size: 1.15rem;
  flex-shrink: 0;
}

.template-home__resume-body,
.template-home__collection-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.template-home__resume-name,
.template-home__collection-title {
  font-weight: 700;
}

.template-home__resume-meta {
  font-size: 0.875rem;
  /* same fix as .template-home__search-hint: #8a929c was 3.14:1 */
  color: #5c6672;
}

.template-home__collection-desc {
  font-size: 0.875rem;
  color: #5c6672;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Collection-icon tints ---------------------------------- */
.template-home__collection-icon--t0 { background: #e4eefc; color: #1a6df0; }
.template-home__collection-icon--t1 { background: #ece5fb; color: #6f42c1; }
.template-home__collection-icon--t2 { background: #e3f5e9; color: #1a9d54; }
.template-home__collection-icon--t3 { background: #fde8ec; color: #e8476f; }
.template-home__collection-icon--t4 { background: #fdf3d8; color: #cc8b00; }
.template-home__collection-icon--t5 { background: #e0f0fb; color: #0c8ac9; }

/* --- Browse by tool ---------------------------------------- */
/* A one-line horizontal scroller (documents/js/scroll_rail.js) rather than
   a wrapping cluster -- mirrors .template-home__resume-grid above and the
   Related Insights carousel (articles.css). Only the container behaviour
   changes; the pills themselves are unchanged. */
.template-home__tools {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.6rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  cursor: grab;
  /* hidden scrollbar -- navigation is the prev/next arrows + drag/wheel
     (same as .segmented-tabs / .catalog-switch) */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.template-home__tools::-webkit-scrollbar {
  display: none;
}

.template-home__tools.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  user-select: none;
}

.template-home__tools.is-dragging .template-home__tool {
  pointer-events: none;
}

.template-home__tool {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0.55rem 1.5rem;
  border: 1px solid #d3d9df;
  border-radius: 980px;
  background: #fff;
  color: #495057;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.template-home__tool:hover,
.template-home__tool:focus-visible {
  border-color: var(--site-btn-primary-bg-color, #0067b8);
  color: var(--site-btn-primary-bg-color, #0067b8);
}

@media (max-width: 767.98px) {
  .template-home__intro,
  .template-home__collections {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1200px) {
  .template-home__collections {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .template-home__intro-card,
  .template-home__resume-card,
  .template-home__collection {
    transition: none;
  }
}

/* Finder CTA card -- its own full-size grid cell right after the "+ New custom
   template" tile. Pale-blue throughout, no navy block -- the only solid
   navy left is the icon badge (below). A soft diagonal gradient (not a
   flat fill) plus a resting drop-shadow give it some depth/presence on
   the page instead of reading as a flat color swatch next to the
   illustrated card's own much punchier navy.

   No `border` here (overriding .card--bordered's own) -- an outline
   `box-shadow` ring instead (combined with the drop-shadow in the same
   box-shadow list), so :hover only needs to swap one color, not fight
   any box-model/clipping concerns a real border would raise for
   absolutely-positioned content layered inside. */
/* Size and corners (product owner, 2026-10-21): the template cards'.
   Beside them (md up) it fills the row's height, as the h-100 it had did.
   Alone on its line on a phone it takes their cover image's 3:2, and only
   grows if its text needs more room than that (aspect-ratio's automatic
   minimum height, e.g. at 320px). Its corners are the cover image's 0.5rem
   (.template-card__image-wrap), not the site's card radius .card--lift
   gives it (cards.css, loaded before this sheet). */
.template-catalogue__finder-card {
  --bs-card-border-radius: 0.5rem;
  --bs-card-inner-border-radius: 0.5rem;
  height: 100%;
  border-radius: 0.5rem;
}

@media (max-width: 767.98px) {
  .template-catalogue__finder-card {
    height: auto;
    aspect-ratio: 3 / 2;
  }
}

.template-catalogue__finder-card {
  position: relative;
  z-index: 0;
  background: linear-gradient(135deg, #dceaf9 0%, #eef4fc 55%, #f7fafd 100%);
  border: none;
  box-shadow: 0 0 0 1px #d6e4f5, 0 10px 24px rgba(16, 35, 60, 0.08);
  color: #16233c;
  text-decoration: none;
}

/* Also cancels .card--lift's own :hover/:focus-within translateY(-4px)
   "lift" (cards.css) -- this card already has its own distinct hover
   feedback (the border-ring color change here, the dots animating, the
   cta pill filling solid), so the inherited lift was redundant on top of
   that, and worse, visibly real: the card's own top edge rising 4px out
   of line with its still-resting neighbors in the same row read as the
   corner itself having shifted/misaligned. :focus-within (not just
   :focus-visible) matches .card--lift's own trigger exactly, so the
   cancellation applies under the same conditions the lift would. */
.template-catalogue__finder-card:hover,
.template-catalogue__finder-card:focus-visible,
.template-catalogue__finder-card:focus-within {
  transform: none;
  box-shadow: 0 0 0 1px var(--site-btn-primary-bg-color, #0067b8), 0 14px 30px rgba(16, 35, 60, 0.14);
}

/* A scattered-dot "confetti" texture, playful counterpart to the
   illustrated template card's own two soft drifting circles -- same idea
   (a decorative, low-opacity shape treatment tying the two cards
   together) in a different, lighter-touch form: several small dots
   instead of two big blobs, alternating brand-blue and the same gold the
   "Use template" CTA uses elsewhere, all faint enough to stay out of the
   text's way (checked against 1.4.3 -- the card's own near-black text on
   #eef4fc clears >12:1, and these dots barely nudge that). Real elements
   (not a background-image) so each can drift independently on hover --
   z-index -1 within the card's own stacking context (position:relative +
   z-index:0 above) tucks the layer behind the body, which stays
   unpositioned in-flow content and so paints above it by default. */
.template-catalogue__finder-card__dots {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.template-catalogue__finder-card__dot {
  position: absolute;
  border-radius: 50%;
  background-color: var(--dot-color);
  opacity: var(--dot-opacity);
}

.template-catalogue__finder-card__dot--1 { top: 10%; left: 18%; width: 10px; height: 10px; --dot-color: #0067b8; --dot-opacity: 0.14; }
.template-catalogue__finder-card__dot--2 { top: 20%; left: 90%; width: 10px; height: 10px; --dot-color: #ffc107; --dot-opacity: 0.5; }
.template-catalogue__finder-card__dot--3 { top: 58%; left: 10%; width: 16px; height: 16px; --dot-color: #0067b8; --dot-opacity: 0.12; }
.template-catalogue__finder-card__dot--4 { top: 80%; left: 92%; width: 8px; height: 8px; --dot-color: #0067b8; --dot-opacity: 0.14; }
.template-catalogue__finder-card__dot--5 { top: 88%; left: 38%; width: 8px; height: 8px; --dot-color: #ffc107; --dot-opacity: 0.45; }

/* A looping float per dot, not a one-shot drift-and-stop -- each keyframe
   round-trips rest -> drifted -> rest within a single cycle, repeated
   `infinite` only while the card is actually hovered/focused (the
   animation is applied there, not on the base .dot rule), so the motion
   keeps going the whole time a visitor's pointer stays over the card,
   not just once on entry. Slightly different duration per dot (and no
   shared animation-delay) so they drift out of sync with each other
   rather than marching in lockstep -- reads as a loose sparkle, not a
   single pulsing blob. The plain `transition` on the base .dot rule
   still handles the return to rest when the animation is removed on
   hover-out (a style recalculation a transition picks up same as any
   other change), so leaving hover still eases smoothly back rather than
   snapping. */
@media (prefers-reduced-motion: no-preference) {
  .template-catalogue__finder-card__dot {
    transition: transform 0.5s ease, opacity 0.5s ease;
  }

  .template-catalogue__finder-card:hover .template-catalogue__finder-card__dot--1,
  .template-catalogue__finder-card:focus-within .template-catalogue__finder-card__dot--1 {
    animation: finder-dot-float-1 2.8s ease-in-out infinite;
  }

  .template-catalogue__finder-card:hover .template-catalogue__finder-card__dot--2,
  .template-catalogue__finder-card:focus-within .template-catalogue__finder-card__dot--2 {
    animation: finder-dot-float-2 3.3s ease-in-out infinite;
  }

  .template-catalogue__finder-card:hover .template-catalogue__finder-card__dot--3,
  .template-catalogue__finder-card:focus-within .template-catalogue__finder-card__dot--3 {
    animation: finder-dot-float-3 3.6s ease-in-out infinite;
  }

  .template-catalogue__finder-card:hover .template-catalogue__finder-card__dot--4,
  .template-catalogue__finder-card:focus-within .template-catalogue__finder-card__dot--4 {
    animation: finder-dot-float-4 3s ease-in-out infinite;
  }

  .template-catalogue__finder-card:hover .template-catalogue__finder-card__dot--5,
  .template-catalogue__finder-card:focus-within .template-catalogue__finder-card__dot--5 {
    animation: finder-dot-float-5 3.9s ease-in-out infinite;
  }

  @keyframes finder-dot-float-1 {
    0%, 100% { transform: translate(0, 0); opacity: var(--dot-opacity); }
    50% { transform: translate(-16px, 14px); opacity: calc(var(--dot-opacity) * 2.4); }
  }

  @keyframes finder-dot-float-2 {
    0%, 100% { transform: translate(0, 0); opacity: var(--dot-opacity); }
    50% { transform: translate(14px, 18px); opacity: calc(var(--dot-opacity) * 2.4); }
  }

  @keyframes finder-dot-float-3 {
    0%, 100% { transform: translate(0, 0); opacity: var(--dot-opacity); }
    50% { transform: translate(-18px, -13px); opacity: calc(var(--dot-opacity) * 2.4); }
  }

  @keyframes finder-dot-float-4 {
    0%, 100% { transform: translate(0, 0); opacity: var(--dot-opacity); }
    50% { transform: translate(16px, -16px); opacity: calc(var(--dot-opacity) * 2.4); }
  }

  @keyframes finder-dot-float-5 {
    0%, 100% { transform: translate(0, 0); opacity: var(--dot-opacity); }
    50% { transform: translate(-13px, -20px); opacity: calc(var(--dot-opacity) * 2.4); }
  }
}

/* Centered both ways -- horizontally (align-items + text-align, now that
   there's no left-aligned "Guide me" badge anchoring the block to the
   left edge) and vertically (justify-content, so the group reads as one
   tight centered block regardless of how tall the card ends up, rather
   than sitting top-aligned with a gap before the cta). */
.template-catalogue__finder-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.65rem;
}

/* Bumped up from the body text's 0.9rem (and from its own earlier
   1.05rem) so the size jump alone reads as a heading, not just a bolder
   line of the same paragraph. */
/* Same size/weight/line-height as the illustrated template card's own
   .document-card__illustrated-title -- the two cards sit side by side in
   the same row, so their headings should carry the same visual weight. */
.template-catalogue__finder-card__title {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.15;
  color: #16233c;
}

/* Matches .document-card__illustrated-teaser's own size/line-height. */
.template-catalogue__finder-card__text {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: #5c6672;
}

/* A small solid-filled pill, not bare text + a trailing chevron -- reads
   as a real, clickable "the action" at rest, not just on hover, without
   matching the sibling illustrated card's solid-gold "Use template" CTA
   color (this stays blue, not gold, so the two cards' primary actions
   stay visually distinct). The whole card is already the link (no
   separate href here), so the darken-on-hover below rides the same
   :hover/:focus-within the card itself already answers to --
   reinforcing, not a second independent control. */
.template-catalogue__finder-card__cta {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding: 0.7rem 1.4rem;
  border: 1.5px solid var(--site-btn-primary-bg-color, #0067b8);
  border-radius: 980px;
  background-color: var(--site-btn-primary-bg-color, #0067b8);
  box-shadow: 0 4px 10px rgba(0, 103, 184, 0.25);
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
  color: #fff;
}

@media (prefers-reduced-motion: no-preference) {
  .template-catalogue__finder-card__cta {
    transition: background-color 0.15s ease, border-color 0.15s ease;
  }
}

.template-catalogue__finder-card:hover .template-catalogue__finder-card__cta,
.template-catalogue__finder-card:focus-within .template-catalogue__finder-card__cta {
  background-color: #00558f;
  border-color: #00558f;
}

/* ============================================================= *
 *  Templates catalogue (/templates/?view=all)                    *
 *  search / sort bar on top; facets in an off-canvas "Filters"   *
 *  tray (documents/_catalogue_filters.html)                      *
 * ============================================================= */

/* Sticky head: the library nav + search form (.template-catalogue__head)
   pin under the navbar as the results scroll past. --lc-sticky-top is the navbar's live height (published by
   static/shared/js/sticky_list_controls.js; list-controls.css has the
   no-JS fallback). The ::before is a full-viewport-width band behind the
   bar's content (100vw, centred on the head) so the pinned strip reads
   as a page-wide header -- #main-content's `overflow-x: clip` keeps the
   100vw from adding a horizontal scrollbar (base.html).

   z-index 5 lifts the pinned bar above the results' `position: relative`
   cards but stays well below the navbar (1020) so nav dropdowns aren't
   occluded. The Filters off-canvas is a descendant of this (sticky =>
   stacking-context) head, so it runs `data-bs-backdrop="false"` -- there
   is no body-level backdrop to be trapped behind, and its own z-index
   (1045, local to this context) still clears the cards. */
.template-catalogue__head {
  position: sticky;
  top: var(--lc-sticky-top, 4rem);
  z-index: 5;
  padding: 0.55rem 0;
}

.template-catalogue__head::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  background: var(--site-bg-color, #fff);
  transition: box-shadow 0.15s ease;
}

/* .is-pinned -- added by sticky_list_controls.js only once the head
   actually reaches the navbar's bottom edge. */
.template-catalogue__head.is-pinned::before {
  box-shadow: 0 10px 16px -12px rgba(16, 35, 60, 0.35);
}

/* The head's layout (product owner, 2026-10-21), like a catalogue's switch
   and search in list-controls.css: stacked at every width. The library
   nav's type switch is centred on its own line and the search centred on
   the line below, capped at 42rem like the articles search (All / Mine /
   Favorites are on the results line, plan/_library_filters.html). On a phone
   (below md) the search runs full width; the type switch keeps its own width,
   centred, like the articles switch (product owner, 2026-10-21; it spanned
   the column before). (From 2026-10-18 the nav sat beside the search from
   md up.) The nav keeps the articles switch's 0.5rem under it, not
   list-controls.css's 1rem. */
.template-catalogue__head > .library-nav {
  margin-bottom: 0.5rem;
}

@media (max-width: 767.98px) {
  .template-catalogue__head .template-catalogue__search {
    max-width: none;
  }
}

/* --- Top bar: a centred cluster -- [+ New custom template] [Google-style
   pill search] [Filters] -- all sharing one height (--tcat-h), on ONE line
   at every width. The search grows to a cap and shrinks (min-width: 0) to
   make room for the flanking controls rather than wrapping. --- */
.template-catalogue__bar {
  --tcat-h: 2.85rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.template-catalogue__head.is-pinned .template-catalogue__bar {
  margin-bottom: 0;
}

/* "New custom template" shortcut -- hidden until the bar is pinned (by
   then the grid's leading .add-card ghost tile has scrolled away).
   Deliberately quiet: a hairline dashed pill, no accent until :hover. */
.template-catalogue__create {
  display: none;
  flex: 0 0 auto;
}

.template-catalogue__head.is-pinned .template-catalogue__create {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: var(--tcat-h, 2.85rem);
  padding: 0 1.05rem;
  border: 1px dashed #adb5bd;
  border-radius: 999px;
  color: #495057;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.template-catalogue__create:hover,
.template-catalogue__create:focus-visible {
  border-color: var(--site-link-color, #0067b8);
  color: var(--site-link-color, #0067b8);
  background-color: rgba(0, 103, 184, 0.05);
}

.template-catalogue__create-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background-color: rgba(73, 80, 87, 0.14);
  font-size: 0.8rem;
}

@media (max-width: 767.98px) {
  /* keep all three on one line (nowrap on .template-catalogue__bar) --
     tighten the gap; the create shortcut drops to just its "+" disc in a
     round dashed border (no room for the label) */
  .template-catalogue__bar {
    gap: 0.5rem;
  }

  .template-catalogue__create-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .template-catalogue__head.is-pinned .template-catalogue__create {
    width: var(--tcat-h, 2.85rem);
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
}

.template-catalogue__search {
  position: relative; /* anchors the suggestions listbox */
  flex: 1 1 42rem;
  max-width: 42rem;
  min-width: 0;
}

/* The pill. A grey hairline at rest; on hover / focus the border turns the
   same blue as the Filters button's outline (--site-btn-secondary-text-color,
   base.html's .btn-outline-secondary). No shadow in any state. */
.template-catalogue__searchbox {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: var(--tcat-h, 2.85rem);
  padding: 0.15rem 0.5rem 0.15rem 1.05rem;
  background: var(--site-card-bg-color, #fff);
  /* the site-wide field border (static/shared/css/fields.css, WCAG 1.4.11) */
  border: 1px solid var(--site-input-border-color, #767676);
  border-radius: 999px;
  transition: border-color 0.15s ease;
}

.template-catalogue__searchbox:hover,
.template-catalogue__searchbox:focus-within {
  border-color: var(--site-btn-secondary-text-color, #0067b8);
}

/* --- Title type-ahead suggestions (documents:suggest). Byte-for-byte
   also lives as static/shared/css/list-controls.css's
   .list-controls__suggestions* (articles:suggest) -- keep the two in
   step; a third consumer is the trigger to move this to the shared
   sheet instead of copying again. --- */
.template-catalogue__suggestions {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: var(--site-card-bg-color, #fff);
  border: 1px solid #d3d6db;
  border-radius: 1rem;
  box-shadow: 0 10px 28px rgba(16, 35, 60, 0.16);
  max-height: 20rem;
  overflow-y: auto;
}

.template-catalogue__suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1.1rem;
  font-size: 0.97rem;
  color: var(--site-text-color, #202124);
  cursor: pointer;
}

.template-catalogue__suggestion:hover,
.template-catalogue__suggestion[aria-selected="true"] {
  background: rgba(0, 103, 184, 0.08);
}

.template-catalogue__suggestion-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Labels a collection-title match ("Plan your week") apart from a
   template-name match, since documents:suggest now searches both --
   Bootstrap's .badge.text-bg-light look, reproduced so this file doesn't
   need bootstrap_css loaded ahead of it. */
.template-catalogue__suggestion-kind {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #495862;
  background: #eef1f4;
  border-radius: 980px;
  padding: 0.2rem 0.6rem;
}

.template-catalogue__search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0.45rem 0;
  font-size: 1.05rem;
  color: var(--site-text-color, #1d1d1f);
  appearance: none;
}

/* our own clear button replaces the native one */
.template-catalogue__search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.template-catalogue__search-clear {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #5f6368;
  padding: 0.4rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}

.template-catalogue__search-clear:hover {
  color: var(--site-text-color, #202124);
  background: rgba(60, 64, 67, 0.08);
}

/* shown only once the field has text (placeholder no longer visible) */
.template-catalogue__search-input:not(:placeholder-shown) ~ .template-catalogue__search-clear {
  display: inline-flex;
}

/* divider between the search actions (clear / magnifier) and the Filters
   icon -- always shown */
.template-catalogue__search-divider {
  flex: 0 0 auto;
  align-self: stretch;
  width: 1px;
  margin: 0.4rem 0;
  background: #dadce0;
}

.template-catalogue__search-submit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--site-link-color, #1a73e8);
  padding: 0.4rem 0.6rem;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 999px;
}

.template-catalogue__search-submit:hover {
  background: rgba(0, 103, 184, 0.08);
}

/* the Filters icon, inside the search pill next to the magnifier */
.template-catalogue__search-filters {
  position: relative;
}

.template-catalogue__search-filters.is-active {
  background: rgba(0, 103, 184, 0.1);
}

/* active-filter count -- a small badge on the Filters icon's corner */
.template-catalogue__filters-count {
  position: absolute;
  top: -0.15rem;
  right: -0.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.25rem;
  border-radius: 980px;
  background: var(--site-link-color, #0067b8);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

/* --- The off-canvas Filters tray. Starts below the navbar (it has no
   backdrop, so a full-height drawer would tuck under the sticky navbar)
   and carries its own shadow in place of the missing backdrop. --- */
.template-filters.offcanvas {
  --bs-offcanvas-width: 21rem;
  --bs-offcanvas-padding-x: 1.15rem;
  --bs-offcanvas-padding-y: 1rem;
  top: var(--lc-sticky-top, 4rem);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(16, 35, 60, 0.18);
}

/* re-shown after an in-place swap (documents/js/catalogue_filters.js) --
   suppress the slide-in so the tray looks like it never closed */
.template-filters--no-anim.offcanvas {
  transition: none;
}

.template-filters__header {
  align-items: center;
  border-bottom: 1px solid #e6e8eb;
}

.template-filters__header-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-left: auto;
}

.template-filters__clear {
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.template-filters__clear:hover,
.template-filters__clear:focus-visible {
  text-decoration: underline;
}

.template-filters__body {
  flex: 1 1 auto;
  overflow-y: auto;
}

.template-filters__footer {
  flex: 0 0 auto;
  padding: 0.85rem var(--bs-offcanvas-padding-x, 1.15rem);
  border-top: 1px solid #e6e8eb;
  background: var(--site-card-bg-color, #fff);
}

/* --- A collapsible facet group --- */
.template-filters__group {
  border-bottom: 1px solid #e6e8eb;
  padding: 0.75rem 0;
}

.template-filters__group:first-of-type {
  padding-top: 0.25rem;
}

.template-filters__group-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: #16233c;
}

.template-filters__group-head::-webkit-details-marker {
  display: none;
}

.template-filters__group-head::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transform-origin: 60% 60%;
  opacity: 0.45;
  transition: transform 0.15s ease;
}

.template-filters__group[open] > .template-filters__group-head::after {
  transform: rotate(-135deg);
}

.template-filters__group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.35rem;
  border-radius: 980px;
  background: #e9f2fc;
  color: #1668c9;
  font-size: 0.7rem;
  font-weight: 700;
}

/* the <fieldset>/<div> that holds the option rows */
.template-filters__group-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border: 0;
  margin: 0;
  min-width: 0;
  padding: 0.6rem 0 0.15rem;
}

.template-filters__group-body .form-check {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0;
  min-height: 0;
  font-size: 0.875rem;
}

.template-filters__group-body .form-check-input {
  flex: 0 0 auto;
  margin-left: 0;
  float: none;
}

.template-filters__group-body .form-check-label {
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
}

/* Per-option result count, e.g. Planning area > "A project" (23). Purely
   supplementary -- the checkbox/radio's aria-describedby points at the same
   span so the count reaches assistive tech too, not just sighted users. */
.template-filters__option-count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 980px;
  background: #eef1f4;
  color: #5c6672;
  font-size: 0.7rem;
  font-weight: 600;
}

/* articles/_filter_sidebar.html's category -> subcategory pair defaults to
   a side-by-side row (flex: 0 1 27rem) -- too wide for the tray. Stack. */
.template-filters .list-controls__filter-pair {
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0.4rem;
}

.template-filters .list-controls__filter-pair > *,
.template-filters .list-controls__filter-pair > .position-relative {
  flex: 1 1 auto;
  width: 100%;
}

/* checkbox-group facet in the shared Filters panel (list_controls.html) */
.list-controls__checkgroup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  border: 0;
  padding: 0;
  margin: 0;
}

/* Guided step framing + collapsible help (document_guide.html). */
.document-guide__question {
  margin-bottom: 0.25rem;
}

.document-guide__help {
  margin: 0.5rem 0 1rem;
  color: var(--site-muted-text-color, #6c757d);
}

.document-guide__aside > summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--site-link-color, #0067b8);
}

.document-guide__aside[open] > summary {
  margin-bottom: 0.5rem;
}

/* ============================================================= *
 *  Catalogue quick-look modal (_template_quicklook.html)         *
 * ============================================================= */
/* .document-chip-list / .document-chip (the readable taxonomy/meta pill)
   live up near .document-detail__title -- shared with _template_intro.html's
   own meta line, not quick-look-specific. */

.document-quicklook__section-label {
  margin: 1.25rem 0 0.5rem;
}

/* Published-template quicklook section headings ("Know what it's for" /
   "Know who's involved" / "Know what to expect") -- bold + a colored
   left-border accent so each reads as a real section break, not a quiet
   caption (distinct from the muted, small .document-quicklook__section-label
   above, which stays as-is for the draft/component branch's own "What's
   in it" label). The accent color is the exact icon-circle color of the
   .document-card__info-panel variant every panel in that section uses
   (documents.css's --what/--who/--when rules), so the heading and its
   panels read as one color-coded unit. */
.document-quicklook__section-heading {
  margin: 1.75rem 0 0.85rem;
  padding-left: 0.85rem;
  border-left: 4px solid;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  color: #16233c;
}

.document-quicklook__section-heading:first-of-type {
  margin-top: 0;
}

.document-quicklook__section-heading--what {
  border-left-color: #7c5cc4;
}

.document-quicklook__section-heading--who {
  border-left-color: #3f9d6e;
}

.document-quicklook__section-heading--when {
  border-left-color: #3d7fc9;
}

/* Modal-header title (_template_quicklook_modal.html) -- moved here from
   the scrollable body so it stays visible while it scrolls (Bootstrap's
   .modal-dialog-scrollable already keeps .modal-header fixed above
   .modal-body, so this needs no sticky positioning of its own).
   template_quicklook.js fills it in per template; empty by default.

   Same navy as .document-card--illustrated's own header (the card this
   modal previews from), so the modal reads as a continuation of the card
   rather than a plain generic dialog -- .modal-header's own
   border-top-*-radius (Bootstrap) already clips this to the dialog's
   rounded corners, so no extra radius/overflow rule is needed here. The
   default border-bottom (a light gray tuned for a white header) is
   dropped -- the navy/white boundary beneath already reads as a clear
   section break on its own. */
.quicklook-modal-header {
  align-items: flex-start;
  background-color: var(--documents-card-header-bg, #163a66);
  border-bottom: 0;
}

.quicklook-modal-header__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

.quicklook-modal-header__title {
  color: #fff;
}

.quicklook-modal-header__title:empty {
  display: none;
}

/* The disabled field preview -- framed + slightly recessed so it reads as
   "a look at the form" rather than a form to fill in here. */
.document-quicklook__fields {
  margin: 0;
  padding: 1rem 1.1rem 0.25rem;
  border: 1px solid #e3e7eb;
  border-radius: 0.5rem;
  background: #f8fafc;
}

/* Sticky to the bottom edge of the scrollable modal body so the primary
   actions stay reachable however long the field preview runs. The negative
   side margins bleed the bar + its top border to #templateQuicklookModalBody's
   left/right edges. The bottom edge is deliberately NOT bled the same way
   (a negative bottom margin here paired with position:sticky left a sliver
   of the modal body's own padding -- and the page behind it -- visible
   below the bar while scrolled mid-list, since the sticky bottom:0 anchor
   resolves against the modal body's padding edge, not its visual one):
   #templateQuicklookModalBody zeroes its own bottom padding instead, so
   this bar's unchanged 0.9rem bottom padding is what actually reaches the
   true bottom edge, in every scroll state, with no negative margin needed. */
.document-quicklook__actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem -1rem 0;
  padding: 0.9rem 1rem;
  background: #fff;
  border-top: 1px solid #dce0e5;
}

#templateQuicklookModalBody {
  padding-bottom: 0;
}

/* ============================================================= *
 *  Template builder (documents/builder/*.html)                   *
 *  Same visual language as the assessment builder                *
 *  (agent_docs/assessment-builder-design.md): a tinted icon-badge *
 *  page head, a pale-blue-strip form card, a hero "intro" front   *
 *  door for the create page. `.builder-form-card` / `.builder-    *
 *  intro` are already generic (not `assessment-*`-prefixed) in    *
 *  assessments.css -- duplicated here byte-for-byte as documents  *
 *  is the 2nd app to use them; per                                *
 *  agent_docs/frontend-css-conventions.md they move to            *
 *  static/shared/css/cards.css once a 3rd app needs them.         *
 * ============================================================= */

/* Darker borders throughout the builder, same reasoning as
   assessments.css's own `.assessment-builder` rule: Bootstrap's default
   hairlines all but vanish here. Scoped to `.document-builder` so
   nothing else on the site changes. */
.document-builder {
  --bs-border-color: #adb5bd;
}

.document-builder .card--bordered {
  border-color: #adb5bd;
}

/* Normalizes every Bootstrap small-text utility this whole template tree
   uses -- .form-control-sm/.form-select-sm/.btn-sm/.col-form-label-sm
   (0.875em), .small/<small> (0.875em), .form-text (0.875em) -- plus
   .card__meta (0.875rem, shared with the public catalogue card, which
   stays as it is -- this is a builder-only floor, not a site-wide one) --
   in one place. Byte-for-byte copy of assessments.css's own site-wide
   text-size floor (`.assessment-builder .btn-sm` etc.), which this had
   never been given (reported directly: "Switch to advanced builder" read
   two sizes smaller here than its assessments equivalent -- the gap was
   this whole rule, not just that one button). [data-inline-editor-content]
   is shared infrastructure both builders' row-level editor pages/modal
   fragments (section_form.html/field_form.html here) extend, same as
   assessments' own row_form.html/question_form.html/rule_form.html --
   already covered by assessments.css's copy of this selector, so it's
   deliberately left out of the list below to avoid declaring the same
   rule twice. */
.document-builder .form-control-sm,
.document-builder .form-select-sm,
.document-builder .btn-sm,
.document-builder .col-form-label-sm,
.document-builder .small,
.document-builder small,
.document-builder .form-text,
.document-builder .card__meta {
  font-size: 1rem;
}

/* Front door only (template_form.html, mode=create) -- a softer card
   border, matching `[data-builder-new-form]` in assessments.css. Its
   fields keep the site-wide field border (static/shared/css/fields.css;
   the softer #d3d9df failed WCAG 1.4.11, accessibility audit 2026-10-16,
   AX-07). */
[data-document-builder-new-form] .builder-form-card.card--bordered,
.document-finder .builder-form-card.card--bordered {
  border-color: #dce0e5;
}

/* .cover-image-dropzone / .cover-image-preview / .image-focal-editor__*
   (the create-with-a-photo control) live in static/shared/css/cards.css
   -- this create page is the 3rd consumer, the "extract on the 3rd"
   trigger (agent_docs/frontend-css-conventions.md). Only this form's own
   per-instance override lives here: the template cover renders at 3:2 on
   cards + the landing hero (matching .document-card__image's own
   aspect-ratio), not the shared block's 1920/1080 default. */
#templateFormImageDropzone {
  --cover-aspect-ratio: 3 / 2;
}

/* Rail + main -- shared by the front door (template_form.html, mode=create,
   personal templates) and every builder shell step (_shell.html). Byte-
   for-byte copy of assessments.css's `.assessment-builder__layout` grid
   (single column below lg, a fixed rail column from lg up). The Finder
   (finder.html) shares this and the rail and main rules below
   (.document-finder__*). */
.document-builder__layout,
.document-finder__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

/* The assessment builder's rail panel (assessments.css's
   `.assessment-builder__rail`, itself the take page's; product owner,
   2026-10-20): no fill on the white page, the darker #adb5bd hairline and
   Bootstrap's --bs-border-radius, 1.5rem in (1rem below lg). It was the
   grey "Customize this document" panel (.document-rail-layout__rail). */
.document-builder__rail,
.document-finder__rail {
  padding: 1.5rem;
  border: 1px solid #adb5bd;
  border-radius: var(--bs-border-radius, 0.375rem);
}

@media (max-width: 991.98px) {
  .document-builder__rail,
  .document-finder__rail {
    padding: 1rem;
  }
}

/* The Help tab's guide (content/_step_guide.html, shared
   static/shared/css/builder_help.css) set straight on the rail, as in the
   assessment builder (product owner, 2026-10-20; a copy of assessments.css's
   `.assessment-builder__rail .builder-help*`, keep the two in step): no
   pale-blue box, a bigger title, the intro as a paragraph like the body
   text, a light rule above each heading typed into the body, and each list
   item as its bold name on a line of its own over a grey description,
   beside the check disc. Colours: #16233c 15:1, #495057 8.6:1, #5c6672
   5.9:1 on white; the rules only separate parts, so they're decorative
   under WCAG 1.4.11. 0.5rem on top of the tabs' own 1rem bottom margin. */
.document-builder__rail .builder-help {
  gap: 1.25rem;
  margin: 0.5rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  color: #495057;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.document-builder__rail .builder-help-heading {
  gap: 1rem;
}

.document-builder__rail .builder-help-title,
.document-builder__rail .builder-help-text :is(h1, h2, h3, h4, h5, h6) {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: #16233c;
}

.document-builder__rail .builder-help-intro {
  font-size: inherit;
  color: inherit;
}

/* The same grey as the intro (the site theme colours a bare <p>). */
.document-builder__rail .builder-help-text p {
  margin-bottom: 1rem;
  color: #495057;
}

.document-builder__rail .builder-help-text :is(h1, h2, h3, h4, h5, h6) {
  margin: 1.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid #dee2e6;
}

.document-builder__rail .builder-help-text > :is(h1, h2, h3, h4, h5, h6):first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.document-builder__rail .builder-help-text ul {
  margin-top: 1.25rem;
  gap: 1.5rem;
}

.document-builder__rail .builder-help-text ul li {
  padding-left: 3rem;
  color: #5c6672;
  font-size: 1rem;
}

.document-builder__rail .builder-help-text ul li > strong:first-child {
  display: block;
  margin-bottom: 0.25rem;
  color: #16233c;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
}

/* The check disc, a little bigger, centred on the item's name. */
.document-builder__rail .builder-help-text ul li::before {
  top: -0.15rem;
  width: 1.85rem;
  height: 1.85rem;
  background-color: #e3eefb;
  font-size: 1rem;
}

@media (max-width: 991.98px) {
  .document-builder__rail .builder-help-text ul li {
    padding-left: 2.6rem;
  }
}

.document-builder__rail,
.document-builder__main,
.document-finder__rail,
.document-finder__main {
  min-width: 0;
}

.document-builder__main,
.document-finder__main {
  overflow-wrap: break-word;
}

@media (min-width: 992px) {
  .document-builder__layout,
  .document-finder__layout {
    /* 360px, not the old 240px -- matches assessments'
       `.assessment-builder__layout` rail column exactly (reported
       directly). */
    grid-template-columns: 360px minmax(0, 1fr);
    align-items: start;
  }
  .document-builder__rail,
  .document-finder__rail {
    position: sticky;
    /* Clears the sticky .document-builder__header too (its height is
       published by document_builder_header_sticky.js; the Finder has no
       such header, so it falls back to 0px there). */
    top: calc(var(--lc-sticky-top, 4rem) + var(--document-builder-header-height, 0px) + 1rem);
  }
}

/* Quick/Advanced mode choice (front door only). Byte-for-byte copy of
   assessments.css's `.assessment-builder__mode-*` -- each <label> wraps
   its radio so the whole card is a click target with no JS;
   :has(input:checked) styles the selected one. */
.document-builder__mode-choice {
  display: grid;
  gap: 0.6rem;
}

@media (min-width: 768px) {
  .document-builder__mode-choice {
    grid-template-columns: 1fr 1fr;
  }
}

.document-builder__mode-legend {
  float: none;
  width: auto;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.document-builder__mode-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border: 1px solid #d3d9df;
  border-radius: 0.65rem;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.document-builder__mode-option:has(input:focus-visible) {
  outline: 2px solid #0067b8;
  outline-offset: 2px;
}

.document-builder__mode-option:has(input:checked) {
  border-color: #0067b8;
  background-color: #eef5fd;
  box-shadow: inset 0 0 0 1px #0067b8;
}

.document-builder__mode-option input {
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.document-builder__mode-icon {
  flex-shrink: 0;
  font-size: 1.6rem;
  line-height: 1.3;
}

.document-builder__mode-icon--simple {
  color: #0067b8;
}

.document-builder__mode-icon--advanced {
  color: #3f4b5e;
}

.document-builder__mode-body {
  min-width: 0;
}

.document-builder__mode-body strong {
  font-size: 1.0625rem;
  color: #1d2b45;
}

.document-builder__mode-subtitle {
  color: #495057;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

/* Simple / Advanced mode switch, under the progress and saved note
   (_mode_toggle.html) -- byte-for-byte copy of assessments.css's own
   `.assessment-builder__mode-toggle`/`-label`: set off by a light rule and
   the take rail's spacing (product owner, 2026-10-20, as there). The rule
   only separates parts, so it's decorative under WCAG 1.4.11. */
.document-builder__mode-toggle {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #dee2e6;
  font-size: 1rem;
}

@media (max-width: 991.98px) {
  .document-builder__mode-toggle {
    margin-top: 1rem;
    padding-top: 1rem;
  }
}

.document-builder__mode-toggle-label {
  font-size: 1rem;
  font-weight: 600;
  /* #6c757d was 4.44:1 on the rail's old #f8f9fa fill (AX-10); #5c6672
     is 5.9:1 on the white rail now */
  color: #5c6672;
  margin-bottom: 0.15rem;
}

/* Same fix as assessments.css's .assessment-builder__mode-toggle .btn-link:
   Bootstrap's #0d6efd was 4.26:1 on the rail's old #f8f9fa fill (AX-10). */
.document-builder__mode-toggle .btn-link {
  --bs-btn-color: var(--site-link-color, #0067b8);
  --bs-btn-hover-color: var(--site-link-hover-color, #005a9e);
}

/* Intro block: a decorative icon beside the eyebrow / heading / lede.
   Byte-for-byte layout copy of assessments.css's `.builder-intro`; the
   icon here is a Bootstrap Icons glyph rather than bespoke line art. */
.builder-intro {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.builder-intro__icon {
  width: 8rem;
  height: 8rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1a6df0;
  font-size: 4.5rem;
  line-height: 1;
}

@media (max-width: 575.98px) {
  .builder-intro__icon {
    width: 4.5rem;
    height: 4.5rem;
    font-size: 2.5rem;
  }
}

.builder-intro__eyebrow {
  font-size: 0.9rem;
  font-weight: 600;
  color: #6c757d;
  margin-bottom: 0.25rem;
}

.builder-intro__title {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
  color: #16233c;
  margin-bottom: 0.4rem;
}

.builder-intro__lede {
  font-size: 1.1875rem;
  line-height: 1.5;
  color: #5c6672;
}

/* Shared page header for every other builder page (settings, the
   section/field editor, the guided-journey step): a tinted icon badge
   next to an optional eyebrow, a bold title and an optional lede.
   Byte-for-byte copy of assessments.css's `.assessment-page-head`
   (app-prefixed there since it names "assessment"; named after the
   template builder here for the same reason). */
.document-page-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.document-page-head__icon {
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  background-color: #e9f2fc;
  border: 1px solid #cfe1f2;
  color: #1668c9;
  font-size: 1.5rem;
}

.document-page-head__eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6c757d;
  margin-bottom: 0.15rem;
}

.document-page-head__title {
  font-size: clamp(1.5rem, 1.3rem + 1vw, 1.9rem);
  font-weight: 800;
  line-height: 1.15;
  color: #16233c;
  margin-bottom: 0.25rem;
}

/* 20px above the builder's step title (product owner, 2026-10-20; the
   same as assessments.css's .assessment-builder__step-head rule). Only
   the shell's step head: the section/field/sample editors carry an
   eyebrow right above their title, and the fill page has its own. */
.document-builder__step-head .document-page-head__title {
  margin-top: 1.25rem;
}

/* document_fill.html's own title reads larger than the builder's -- it's
   the page's single most important piece of content (which document this
   is), not just a step heading alongside a stepper rail. */
.document-fill__head .document-page-head__title {
  font-size: clamp(1.75rem, 1.5rem + 1.3vw, 2.25rem);
}

/* :not([hidden]) rather than a bare class selector -- both have identical
   (0,1,0) specificity, so a plain `display: flex` here would tie with (and,
   by source order, beat) the browser's own `[hidden] { display: none }`
   default the instant document_title_rename.js sets/clears the attribute. */
.document-page-head__title-form:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.document-page-head__title-form .form-control {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 64rem;
  font-weight: 700;
}

/* Matches .document-page-head__title's enlarged size on this page so
   swapping into edit mode doesn't shrink the heading back down. */
.document-page-head__title-input {
  font-size: clamp(1.4rem, 1.2rem + 1vw, 1.75rem);
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.document-page-head__lede {
  font-size: 1.0625rem;
  line-height: 1.5;
  color: #5c6672;
}

@media (max-width: 575.98px) {
  .document-page-head__icon {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.25rem;
  }
}

/* The one form card (.builder-form-card: a pale-blue header strip + a
   plain body) lives in static/shared/css/cards.css since the project
   workspace became its third user (2026-10-20); only this app's own sizes
   are here. */

/* A page with several of these cards stacked down it (build.html,
   field_form.html, guided_form.html) uses the tighter strip -- same
   `.assessment-builder__main` treatment in assessments.css. */
.document-builder__main .builder-form-card__header,
.document-finder__main .builder-form-card__header {
  padding: 0.85rem 1.35rem;
}

.document-builder__main .builder-form-card__title,
.document-finder__main .builder-form-card__title {
  font-size: 1.15rem;
}

.document-builder__main .builder-form-card__subtitle,
.document-finder__main .builder-form-card__subtitle {
  font-size: 0.9375rem;
}

/* Halved from the shared .builder-form-card rule (cards.css), scoped to the fill
   page's own section cards only -- other builder-form-card users (the
   template builder steps, etc.) keep the standard padding. */
.document-fill__section .card-body {
  padding: 0.75rem 0.675rem;
}

/* Override .builder-form-card's own `overflow: hidden` (set purely to clip
   its header strip to the card's rounded top corners -- Bootstrap's own
   `.card-header:first-child` already carries that radius natively, so
   nothing actually depends on the parent clip) for this one card only.
   `overflow: hidden` on any ancestor stops a `position: sticky` descendant
   from sticking to the viewport at all (its containing block becomes that
   ancestor's own box instead) -- and a rich_text field's per-field toolbar
   slot ([data-richtext-toolbar-slot], documents.css further down) lives
   exactly one of these cards deep. Other .builder-form-card users (the
   template builder steps, assessments' own copy) are untouched. */
.document-fill__section {
  overflow: visible;
}

.builder-form-card__actions {
  margin-top: 1.5rem;
}

.builder-form-card__counter {
  color: #6c757d;
}

/* A collapsible .builder-form-card header -- native Bootstrap collapse
   (data-bs-toggle, no custom JS), same visual mechanism as
   document_fill.html's own .document-fill__section-toggle/-chevron pair,
   just under a generic name since builder/review.html reuses it across
   several different card kinds (readiness checklist / dependencies /
   publishing) on one page. */
.builder-form-card__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 1.25rem 1.35rem;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.document-builder__main .builder-form-card__toggle {
  padding: 0.85rem 1.35rem;
}

.builder-form-card__chevron {
  flex-shrink: 0;
  font-size: 1.1rem;
  transition: transform 0.15s ease;
}

.builder-form-card__toggle.collapsed .builder-form-card__chevron {
  transform: rotate(-90deg);
}

/* Section cards inside the build page -- a `.builder-form-card` header
   strip (name + actions) over a plain body (fields, one sortable-ish list
   of rows). */
.document-builder__section {
  overflow: hidden;
}

/* Collapse chevron -- revealed by document_builder.js's
   initSectionCollapse, byte-for-byte the same mechanism as assessments'
   own .assessment-builder__section-toggle (Questions step), just folding
   this page's existing .builder-form-card header/body instead of that
   page's bespoke section-head/-body pair. With no JS the button stays
   hidden and every section stays open. */
.document-builder__section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: #6c757d;
}

.document-builder__section-toggle:hover,
.document-builder__section-toggle:focus-visible {
  background-color: #eef2f6;
  color: #16233c;
}

.document-builder__section-toggle .bi {
  transition: transform 0.15s ease;
}

.document-builder__section.is-collapsed .document-builder__section-toggle .bi {
  transform: rotate(-90deg);
}

.document-builder__section.is-collapsed .builder-form-card__header {
  border-bottom: 0;
}

.document-builder__section.is-collapsed .card-body {
  display: none;
}

.document-builder__field {
  border-bottom: 1px solid #e6e9ee;
}

.document-builder__field:last-child {
  border-bottom: 0;
}

.document-builder__field-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
}

.document-builder__field-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  overflow-wrap: anywhere;
}

.document-builder__field-row .badge {
  font-weight: 500;
}

.document-builder__field-actions {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
}

.document-builder__grid {
  border-left: 2px solid #e6e9ee;
  padding-left: 0.75rem;
  margin: 0.35rem 0 0.75rem;
}

/* Add-a-field palette (ADR 0066/0068): one per container (a top-level
   section, or a Data Grid/Edit Grid's own row template) since each has its
   own scoped `field_add` form -- see _field_toolbar.html. A section's own
   instance lives in the persistent left rail, stacked under the Simple/
   Advanced mode toggle (`.document-builder__rail-palette`, build.html's
   `builder_rail_extra` block) -- one per section, separated by the same
   hairline the mode toggle itself uses above. A grid's own row-template
   instance stays inline next to that grid instead (no rail placement --
   see _field_toolbar.html's comment on why). */
.document-builder__rail-palette {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #adb5bd;
}

.document-builder__rail-palette .document-builder__palette + .document-builder__palette {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed #ced4da;
}

.document-builder__palette-search {
  margin-bottom: 0.6rem;
}

/* Bootstrap's own .input-group-sm padding (0.25rem vertical) renders
   noticeably shorter than the accordion-button rows below it (0.6rem
   vertical, set above) -- bumped to line the search box's height up with
   them instead of leaving it as the odd one out. */
.document-builder__palette-search .form-control,
.document-builder__palette-search .input-group-text {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* The palette itself is a standard Bootstrap accordion (agent_docs/
   django-admin-conventions.md's pattern: independent open/close, no
   `data-bs-parent`, every item collapsed by default) -- left mostly at
   Bootstrap's own defaults, just compacted for a narrow sidebar column. */
.document-builder__palette .accordion-button {
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #16233c;
}

.document-builder__palette .accordion-button:not(.collapsed) {
  color: #1668c9;
  background-color: #eef5fd;
  box-shadow: inset 0 -1px 0 #cfe1f2;
}

.document-builder__palette .accordion-body {
  padding: 0.55rem;
}

.document-builder__tiles {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.document-builder__tile {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  text-align: left;
  line-height: 1.2;
  font-size: 0.875rem;
  color: #1d1d1f;
  background-color: #fff;
  border: 1px solid #d6dbe1;
  border-radius: 0.45rem;
  cursor: pointer;
}

/* JS-only search (document_builder.js's initFieldSearch) hides
   non-matching tiles via the plain `hidden` attribute -- restated here
   since the `display: flex` above would otherwise win over the browser's
   own `[hidden]` default (same-origin author CSS beats the UA stylesheet
   regardless of specificity). */
.document-builder__tile[hidden] {
  display: none;
}

.document-builder__tile:hover,
.document-builder__tile:focus-visible {
  border-color: #0067b8;
  background-color: #f6faff;
  color: #0b3d69;
}

.document-builder__tile .bi {
  flex-shrink: 0;
  font-size: 1rem;
  color: #6c757d;
}

.document-builder__tile:hover .bi,
.document-builder__tile:focus-visible .bi {
  color: #0067b8;
}

/* Drag affordances (revealed by document_builder.js). */
.document-builder__handle {
  cursor: grab;
  color: #adb5bd;
  padding-right: 0.25rem;
}

.document-builder__handle:active {
  cursor: grabbing;
}

.document-builder .sortable-ghost {
  opacity: 0.5;
}

/* The field editor's live-preview panel (ADR 0067) -- stays in view while
   scrolling a long editor, same --lc-sticky-top navbar-offset convention as
   assessments.css's own sticky rail/toolbar (falls back to a plain 4rem when
   nothing on the page publishes the measured navbar height); inside the edit
   modal there's no sticky navbar to clear, so it sticks flush with the
   modal's own scrolling body instead. */
.document-builder__preview {
  position: sticky;
  top: var(--lc-sticky-top, 4rem);
}

#documentBuilderEditModal .document-builder__preview {
  top: 0;
}

/* Checkbox-choice "cards" for the guided-journey step's planning-taxonomy
   fieldsets (planning_outcomes/planning_areas/intended_audiences) --
   adapted from assessments.css's own .assessment-builder__check-cards/
   __check-card (the Overview step's "Respondents" card). That one stays a
   single column throughout (each card also carries a description line of
   varying length); these choices are label-only, so two columns fit
   comfortably at lg+ (reported directly: match image 1's look, max 2
   columns on large screens, 1 on medium/small). */
.document-builder__check-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

@media (min-width: 992px) {
  .document-builder__check-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.document-builder__check-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid #d3d9df;
  border-radius: 0.65rem;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
  margin-bottom: 0;
}

.document-builder__check-card:has(input:focus-visible) {
  outline: 2px solid #0067b8;
  outline-offset: 2px;
}

.document-builder__check-card:has(input:checked) {
  border-color: #0067b8;
  background-color: #eef5fd;
  box-shadow: inset 0 0 0 1px #0067b8;
}

.document-builder__check-card input {
  flex-shrink: 0;
}

.document-builder__check-card-label {
  font-size: 1rem;
  color: #1d2b45;
}

/* ==============================================================
 * Builder shell (rail + step head + footer, used by every step
 * page from Basics through Publish). The numbered rail + review
 * checklist are byte-for-byte copies of assessments.css's own
 * rules -- documents is the 2nd app to use them; per
 * agent_docs/frontend-css-conventions.md they move to
 * static/shared/css/cards.css once a 3rd app needs them.
 * ============================================================= */

/* Persistent name + status bar above the rail/main layout. Byte-for-byte
   copy of assessments.css's `.assessment-builder__header`/`__name`. */
.document-builder__header {
  border-bottom: 1px solid #adb5bd;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  background-color: var(--site-bg-color, #fff);
}

@media (min-width: 992px) {
  .document-builder__header {
    position: sticky;
    top: var(--lc-sticky-top, 4rem);
    z-index: 6;
  }
}

.document-builder__name {
  color: #0067b8;
  font-size: clamp(1.75rem, 1.5rem + 1.3vw, 2.25rem);
}

/* Rail "Step N of M" progress bar. Byte-for-byte copy of assessments.css's
   own `.assessment-builder__progress*` (product owner, 2026-10-20): a
   bigger, darker count (#16233c, 15:1) over a bar with rounded ends. */
.document-builder__progress-label,
.document-finder__progress-label {
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #16233c;
}

.document-builder__progress .progress,
.document-finder__progress .progress {
  height: 0.5rem;
  background-color: #e9ecef;
}

.document-builder__progress .progress,
.document-builder__progress .progress-bar,
.document-finder__progress .progress,
.document-finder__progress .progress-bar {
  border-radius: 980px;
}

.document-builder__progress .progress-bar,
.document-finder__progress .progress-bar {
  background-color: #0067b8;
}

/* Autosave status, right under the progress bar above: plain grey text
   (#495057, 8.6:1) after a blue cloud, a copy of assessments.css's
   `.assessment-builder__autosave-status` (product owner, 2026-10-20; it
   was bold blue text). Plain text + icon, not a pill/badge box and not a
   <button> -- no `cursor: pointer` and no hover/focus styling, since this
   is status text, not a control. */
.document-builder__autosave-status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  color: #495057;
  font-size: 1rem;
  font-weight: 400;
}

.document-builder__autosave-status .bi {
  color: var(--site-btn-primary-bg-color, #0067b8);
  font-size: 1.25rem;
}

/* "Steps" title above the progress bar/stepper -- same weight/colour as
   assessments' `.assessment-builder__rail-title` and this app's own
   `.document-rail-layout__rail-title` ("Customize this document" panel). */
.document-builder__rail-title,
.document-finder__rail-title {
  font-weight: 700;
  color: #16233c;
}

/* The live rail's own stepper list (_step_nav.html only -- the front
   door's non-interactive preview has no mode toggle above it, so it
   doesn't need this gap) -- byte-for-byte copy of assessments.css's own
   `.assessment-builder__step-nav` (reported directly: the mode toggle and
   the stepper list below it were touching, with no gap between them). */
.document-builder__step-nav {
  margin-top: 1rem;
}

/* Numbered vertical stepper. Two users, one look:
   - template_form.html (mode=create) -- the front door's non-interactive preview
   - _step_nav.html -- the builder shell's live rail (adds .builder-stepper--nav:
                        real links + per-step readiness state on the <li>)
   A copy of assessments.css's `.builder-stepper*` (product owner,
   2026-10-20; that one is the take page's section list): an open list
   with a light rule between rows, no box, a 2.25rem marker beside the name
   in dark semibold, and a chevron on a row that links to another step. It
   was a boxed white list with a tinted current row. The readiness marker
   (number/check, ringed by builder_status.Step.rail_status) stays: these
   rows carry real per-step state with no other place to show it (also
   read by screen readers via the visually hidden text beside it). The
   rules between rows only separate them, so they're decorative under WCAG
   1.4.11. Already generic-named (not `document-*`-prefixed), same as
   `.builder-form-card` / `.builder-intro` above; keep it identical to the
   assessments copy. */
.builder-stepper {
  display: flex;
  flex-direction: column;
}

.builder-stepper__step {
  position: relative;
}

.builder-stepper__step + .builder-stepper__step {
  border-top: 1px solid #dee2e6;
}

.builder-stepper__row {
  display: flex;
}

/* The whole row is the link (a bigger target than the name alone). */
.builder-stepper__link {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  padding: 1.1rem 0;
  border-radius: var(--bs-border-radius, 0.375rem);
  color: #16233c;
  text-decoration: none;
}

/* A step you can go to: its name underlines and turns blue on hover, with
   the chevron, so it reads as a link without colour alone. The focus ring
   is site-wide (focus.css). */
.builder-stepper--nav .builder-stepper__link:hover {
  color: #0067b8;
}

.builder-stepper--nav .builder-stepper__link:hover .builder-stepper__label {
  text-decoration: underline;
}

.builder-stepper__label {
  min-width: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Only on the rows that link to another step (_step_nav.html). */
.builder-stepper__chevron {
  flex-shrink: 0;
  margin-left: auto;
  color: #5c6672;
  font-size: 1.125rem;
}

.builder-stepper--nav .builder-stepper__link:hover .builder-stepper__chevron {
  color: #0067b8;
}

/* #495057 on white 8.6:1. */
.builder-stepper__marker {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 2px solid #adb5bd;
  background-color: #fff;
  color: #495057;
  font-size: 1rem;
  font-weight: 600;
}

/* Rail readiness state on the <li> (builder_status.Step.rail_status):
   red = a required check still fails, amber = only optional checks left,
   green = ready. A ready step is a solid green disc with a white check
   (white on #198754 4.5:1). */
.builder-stepper__step.is-complete .builder-stepper__marker {
  border-color: #198754;
  background-color: #198754;
  color: #fff;
}

.builder-stepper__step.is-complete .builder-stepper__marker .bi {
  font-size: 1.25rem;
}

.builder-stepper__step.is-optional .builder-stepper__marker {
  border-color: #f0ad4e;
  /* #b0730f was about 4:1 on white for the 13px number this used to be
     (WCAG 1.4.3) */
  color: #8a5c00;
}

.builder-stepper__step.is-blocked .builder-stepper__marker {
  border-color: #dc3545;
  color: #dc3545;
}

/* A blocked step also carries a small "!" badge on its marker, so the
   three states differ by shape, not only ring colour (WCAG 1.4.1,
   accessibility audit 2026-10-16, AX-13): a check (ready), a "!" badge
   (required items left) and a plain number (only optional items left).
   Shown on the current step too. Kept identical in assessments.css and
   documents.css, like the rest of .builder-stepper. */
.builder-stepper__alert {
  position: absolute;
  top: -0.35rem;
  right: -0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  border: 1px solid #fff;
  background-color: #dc3545;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
}

/* Current step -- filled blue, wins over the readiness state (white on
   #0067b8 5.9:1). Its name stays the other rows' colour: the filled disc
   is what marks it. */
.builder-stepper__step.is-current .builder-stepper__marker {
  border-color: #0067b8;
  background-color: #0067b8;
  color: #fff;
}

/* Forced colours: the current step's filled marker is its only visual cue,
   and High Contrast repaints the fill, so it takes the system's selection
   colours. assessments.css carries the same rule (keep the two in step). */
@media (forced-colors: active) {
  .builder-stepper__step.is-current .builder-stepper__marker {
    forced-color-adjust: none;
    border-color: Highlight;
    background-color: Highlight;
    color: HighlightText;
  }
}

/* Below lg the rail sits above the form, full page width: the same
   vertical one-step-per-row list, only tighter. */
@media (max-width: 991.98px) {
  .builder-stepper__link {
    gap: 0.75rem;
    padding: 0.75rem 0;
  }
}

/* Per-step "what's outstanding" callout (below the step head, _shell.html).
   Same data as the rail marker colour + the Publish step's checklist.
   Byte-for-byte copy of assessments.css's own `.assessment-builder__
   step-checks*`. */
.document-builder__step-checks {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.document-builder__step-checks-group {
  border: 1px solid;
  border-radius: 0.55rem;
}

.document-builder__step-checks-group.is-blocked {
  background-color: #fdecea;
  border-color: #f5c2c0;
}

.document-builder__step-checks-group.is-optional {
  background-color: #fef7e8;
  border-color: #e3ba6b;
}

.document-builder__step-checks-lead {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  margin: 0;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  list-style: none;
}

.document-builder__step-checks-lead::-webkit-details-marker { display: none; }

.document-builder__step-checks-lead > span:first-of-type {
  flex: 1 1 auto;
}

.document-builder__step-checks-caret {
  flex-shrink: 0;
  color: inherit;
  transition: transform 0.15s ease;
}

.document-builder__step-checks-group[open] .document-builder__step-checks-caret {
  transform: rotate(180deg);
}

.document-builder__step-checks-lead:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
  border-radius: 0.55rem;
}

.document-builder__step-checks-group.is-blocked .document-builder__step-checks-lead {
  color: #a12b21;
}

.document-builder__step-checks-group.is-optional .document-builder__step-checks-lead {
  color: #8a5a09;
}

.document-builder__step-checks-note {
  font-weight: 400;
  /* #6c757d was about 4.3:1 on the optional panel's #fef7e8 (WCAG 1.4.3;
     found by documents.tests.test_axe_browser) */
  color: #5c6672;
  font-size: 0.8125rem;
}

.document-builder__step-checks-list {
  margin: 0;
  padding: 0 0.9rem 0.8rem 2rem;
  font-size: 0.9375rem;
}

.document-builder__step-checks-list li + li {
  margin-top: 0.2rem;
}

.document-builder__step-checks-hint {
  display: block;
  font-size: 0.8125rem;
  color: #6c757d;
}

/* Publish step checklist. Byte-for-byte copy of assessments.css's own
   `.assessment-builder__check*`. */
.document-builder__check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #adb5bd;
}

.document-builder__check:last-child {
  border-bottom: 0;
}

/* A completed check reads as done, not as a still-open row -- drop its
   divider so it doesn't visually group with the incomplete/optional ones
   still below it. Documents-only divergence from assessments.css's
   otherwise-identical `.assessment-builder__check*` copy above. */
.document-builder__check.is-ok {
  border-bottom: 0;
}

.document-builder__check-icon {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.document-builder__check.is-ok .document-builder__check-icon {
  color: #198754;
}

.document-builder__check.is-blocking .document-builder__check-icon {
  color: #dc3545;
}

.document-builder__check.is-optional .document-builder__check-icon {
  color: #adb5bd;
}

.document-builder__check-body {
  flex-grow: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* review.html's per-check label (not its badge) is a real link -- jumps
   to the step page, focusing the relevant field there via ?focus=<id>
   (document_builder_focus_field.js). Keeps the default underline (only
   color is reset to match the surrounding text) so it still reads as a
   link; a bit bluer on hover/focus for the usual affordance. !important
   beats the link's .text-reset utility (itself !important). */
.document-builder__check-link:hover,
.document-builder__check-link:focus-visible {
  color: #0d6efd !important;
}

/* A typed-name Signature field (ADR 0064) reads as a signature, not a
   plain text input -- a light cursive cue, nothing more (no canvas capture
   yet, see the ADR). */
.document-fill__signature-input {
  font-family: "Brush Script MT", cursive;
  font-size: 1.25rem;
}

/* Rich text answer field (forms.QuillWidget, document_richtext.js). Quill's
   own snow theme covers the toolbar/editable chrome -- these rules only
   cover the parts Quill has no opinion on: our custom table embed and the
   hand-added Undo/Redo/Insert table/Print/Zoom controls. */
.document-richtext__custom-button {
  border: none;
  background: transparent;
  padding: 5px;
  width: 28px;
  height: 24px;
  font-size: 1rem;
  line-height: 1;
  color: #444;
  border-radius: 0.25rem;
}

.document-richtext__custom-button:hover,
.document-richtext__custom-button:focus-visible {
  background: #f0f0f0;
}

/* The header picker's "Title" / "Subtitle" / "Clear formatting" values
   (document_richtext.js's toolbarConfig()) have no built-in label in
   quill.snow.css -- only Normal/Heading 1-6 ship with one -- so these
   follow its own convention (a ::before rule keyed off the option's
   data-value, same selector pair it uses for every other value). */
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="title"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="title"]::before {
  content: "Title";
}

.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="subtitle"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="subtitle"]::before {
  content: "Subtitle";
}

.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="clear"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="clear"]::before {
  content: "Clear formatting";
}

.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="title"]::before {
  font-size: 2.25em;
  font-weight: 700;
}

.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="subtitle"]::before {
  font-size: 1em;
  color: #6c757d;
}

.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="clear"] {
  border-top: 1px solid #dee2e6;
  margin-top: 4px;
  padding-top: 6px;
}

/* Actual in-editor look for a Title/Subtitle block (an <h1>/<h2> carrying
   an extra class -- see document_richtext.js's Header.create patch) --
   distinct from a plain heading of the same level, matching the picker
   preview above. */
.document-richtext .ql-editor .ql-doc-title {
  font-weight: 800;
  font-size: 2.25em;
}

.document-richtext .ql-editor .ql-doc-subtitle {
  font-weight: 400;
  font-size: 1.15em;
  color: #6c757d;
}

.document-richtext .ql-editor {
  min-height: 8rem;
  font-size: 1.1rem;
}

/* The table embed (document_richtext.js, ADR 0070): the shared table editor
   (document_table.js, document_table.css) lives inside it; the table's own
   look is static/shared/css/doc_table.css. Quill's `.ql-editor > * { cursor:
   text }` would give the whole embed a text caret. */
.ql-document-table {
  margin: 0.75rem 0 1rem;
  cursor: default;
}

.ql-document-table .doc-table-wrap {
  margin-bottom: 0;
}

/* The toolbar as a floating rounded "pill" -- same visual language as the
   article body field's toolbar (rounded corners, transparent border, white background, soft
   shadow, detached with a gap from the editable box below instead of
   sharing one border with it, which is Quill's own default). Applies to
   every rich_text field via the shared .document-richtext wrapper.
   !important overrides quill.snow.css's own same-specificity
   .ql-toolbar.ql-snow rule, loaded after this stylesheet (via form.media
   in extra_head). */
.document-richtext .ql-toolbar.ql-snow {
  border-radius: 2rem !important;
  border-color: transparent !important;
  background-color: #fff !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
  padding: 0.4rem 0.75rem !important;
  margin-bottom: 0.5rem;
  /* .document-richtext-toolbar-slot (below) is a flex row -- without this
     the toolbar only shrink-wraps its own buttons instead of spanning the
     full column width. */
  flex: 1 1 auto;
  width: 100%;
}

/* Quill suppresses the editable box's own top border by default so it
   sits flush under the toolbar (.ql-toolbar.ql-snow + .ql-container.ql-
   snow { border-top: 0 }, quill.snow.css) -- restore a full border/radius
   now that the toolbar floats separately above it. The colour is the
   site-wide field border (static/shared/css/fields.css, WCAG 1.4.11);
   Quill's own #ccc and the #dee2e6 used here before were both under 3:1. */
.document-richtext .ql-container.ql-snow {
  border: 1px solid var(--site-input-border-color, #767676) !important;
  border-radius: 0 !important;
}

/* The editor's focus indicator (WCAG 2.4.7; accessibility re-check
   2026-10-16, AX-04): Quill's contenteditable has no outline of its own, so
   the box takes the site's two-tone ring while anything inside it has
   focus, the same look as static/shared/css/focus.css gives .form-control.
   (The article form styles its own editor's focus in articles.css.) */
.document-richtext .ql-container.ql-snow:focus-within {
  outline: 2px solid var(--site-focus-ring-color, #0067b8);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff;
}

.document-richtext .ql-toolbar.ql-snow .ql-formats {
  margin-bottom: 0;
}

/* Where document_richtext.js relocates whichever rich_text field's toolbar
   currently has focus (document_fill.html's own [data-richtext-toolbar-slot]
   variant below, or the page-level #documentRichTextToolbarSlot that
   document_guide.html/template_preview.html still use). Empty by default;
   :empty collapses it back to zero height so an unfocused field (or a page
   before anything's been clicked into) reserves no space for it. */
.document-richtext-toolbar-slot {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
}

.document-richtext-toolbar-slot:empty {
  min-height: 0;
}

/* #documentRichTextToolbarSlot, pinned "under breadcrumbs" -- document_
   guide.html/template_preview.html's single page-level slot, reused across
   every rich_text field on those pages and left visible (not hidden on
   blur, see document_richtext.js) once something has claimed it. */
.document-richtext-toolbar-slot[data-sticky-pin] {
  position: sticky;
  top: var(--lc-sticky-top, 4rem);
  z-index: 5;
  background-color: var(--site-bg-color, #fff);
  padding-block: 0.5rem;
}

.document-richtext-toolbar-slot[data-sticky-pin]:empty {
  padding-block: 0;
}

/* [data-richtext-toolbar-slot] -- document_fill.html's per-field variant
   (_document_fill_groups.html), rendered right under that field's own
   label. Hidden (via the :empty rule above) until the field is focused;
   document_richtext.js both attaches the toolbar here on focus and
   detaches it again on blur, so unlike the page-level slot above this one
   only ever holds a toolbar while its field is actually in use. Sticky
   only while it's holding something, so a long field's toolbar rides
   along as you scroll through it instead of scrolling out of reach, but
   an empty slot never pins an invisible 0-height box to the top of the
   viewport. `top` stacks --document-fill-actions-height (document_
   richtext.js) on top of --lc-sticky-top so this sits right below the
   already-pinned .document-fill__bar instead of underneath it at
   the same offset; z-index one below that bar's (5) for the same reason. */
.document-richtext-toolbar-slot[data-richtext-toolbar-slot]:not(:empty) {
  position: sticky;
  top: calc(var(--lc-sticky-top, 4rem) + var(--document-fill-actions-height, 4rem));
  z-index: 4;
  background-color: var(--site-bg-color, #fff);
  padding-block: 0.5rem;
}

/* Inline document-structure editor (agent_docs/adr/0069, pending) -- the
   "Customize this document" panel on document_fill.html. A responsive
   rail+main grid, same single-column-below-992px shape as
   .document-builder__layout above, but its own named pattern rather than a
   literal reuse of that one: the builder's rail only ever holds a narrow
   Add-a-field palette (240px is plenty), while this rail also holds the
   full section/field management canvas (customize/_canvas.html), which
   needs real reading width for a label + type + Edit/Delete actions on one
   row -- hence the wider fixed column below. */
.document-rail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

.document-rail-layout__rail,
.document-rail-layout__main {
  min-width: 0;
}

/* The 2-column split only applies once the panel is actually open
   (document_structure_panel.js toggles this class on openPanel()/
   closePanel()) -- not merely whenever the user is allowed to open it.
   Keying this off a static "can the user ever see a rail" class instead
   (document-rail-layout--has-rail, since removed) left the grid's 360px
   first track permanently reserved even while the <aside> sat `hidden`:
   with no visible item in that track, .document-rail-layout__main (the
   only remaining grid item) auto-placed into it instead of the second
   (1fr) track, squeezing the whole fill form into a 360px-wide column by
   default. */
@media (min-width: 992px) {
  .document-rail-layout--open {
    grid-template-columns: 360px minmax(0, 1fr);
    align-items: start;
  }

  /* Sticky, same --lc-sticky-top navbar-offset convention as
     .document-builder__rail above -- plus --document-fill-actions-height
     (document_richtext.js), since this page (unlike the builder) also has
     the pinned .document-fill__bar sitting above this grid. Without
     this, opening Customize while scrolled partway down a long document
     dropped the panel in at the grid's static top -- already scrolled out
     of view above the viewport -- leaving a user who'd just clicked
     Customize looking at an unchanged page (reported directly). max-height
     + its own scroll keeps a rail taller than the viewport from running
     off the bottom edge once pinned. */
  .document-rail-layout__rail {
    position: sticky;
    top: calc(var(--lc-sticky-top, 4rem) + var(--document-fill-actions-height, 4rem));
    max-height: calc(100vh - var(--lc-sticky-top, 4rem) - var(--document-fill-actions-height, 4rem) - 1.5rem);
    overflow-y: auto;
  }
}

.document-rail-layout__rail {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.75rem;
  padding: 1rem;
}

.document-rail-layout__rail[hidden] {
  display: none;
}

.document-rail-layout__rail-header {
  margin-bottom: 0.85rem;
}

.document-rail-layout__rail-title {
  font-weight: 700;
  color: #16233c;
}

.document-rail-layout__add-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem;
  font-weight: 600;
  color: #1668c9;
  background-color: #fff;
  border: 1px dashed #9aa5b1;
  border-radius: 0.5rem;
  cursor: pointer;
}

.document-rail-layout__add-section:hover,
.document-rail-layout__add-section:focus-visible {
  border-color: #1668c9;
  background-color: #f6faff;
}

.document-rail-layout__divider {
  margin: 1rem 0;
  border: 0;
  border-top: 1px solid #dee2e6;
  opacity: 1;
}

/* The canvas's own section cards -- rendered in the main column (in place
   of the fill form while customizing, not inside the narrow rail panel;
   see document_fill.html's own comment) so there's no shortage of width
   here. */
.document-rail-layout__section {
  border: 1px solid #e6e9ee;
  border-radius: 0.6rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.document-rail-layout__section:last-child {
  margin-bottom: 0;
}

.document-rail-layout__fields {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.document-rail-layout__field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #e6e9ee;
}

.document-rail-layout__field:last-child {
  border-bottom: 0;
}

.document-rail-layout__field-icon {
  flex-shrink: 0;
  color: #6c757d;
}

.document-rail-layout__field-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Drag affordances -- revealed by document_structure_panel.js, same
   "hidden until JS reveals it" convention as .document-builder__handle. */
.document-rail-layout__handle {
  cursor: grab;
  color: #adb5bd;
  padding-right: 0.25rem;
}

.document-rail-layout__handle:active {
  cursor: grabbing;
}

.document-rail-layout .sortable-ghost {
  opacity: 0.5;
}

/* The field editor when the field is a Table (ADR 0070): the designer needs the full
   width, so the live-preview column is dropped (the designer is its own preview). */
.is-table-type .document-builder__preview-col {
  display: none;
}

.is-table-type .document-builder__field-form-col {
  flex: 0 0 100%;
  max-width: 100%;
}

/* The Customize panel's field editor, while the field is a Table: wide enough for the table
   designer's toolbar to sit on one line (about 1210px), within the window on smaller screens.
   document_structure_panel.js adds the class from the Field type. */
.modal-dialog.document-customize-modal--wide {
  --bs-modal-width: min(1400px, calc(100vw - 2rem));
}

/* Move, beside a document's place in My work (plan_tags.document_place, ADR
   0085): a button, so it needs a 24px target (WCAG 2.5.8), not just its
   text's height. */
.document-location__move {
  min-width: 1.5rem;
  min-height: 1.5rem;
  padding: 0 0.25rem;
}

/* ============================================================= *
 *  "My templates" / "My components" card (.template-card,        *
 *  _my_template_card_cols.html)                                  *
 * ============================================================= */

/* GitHub-style like My articles' card (product owner, 2026-10-21;
   agent_docs/card-catalogue-metadata.yaml's management variant): no
   border, fill, shadow or padding, 0.5rem corners on card and cover with
   1.75rem under the cover, the status on its own line, the labels row, a
   22px medium-weight title in the heading colour, the summary as a muted
   teaser, the facts line, then text links. Sizes and spacing are copied
   from articles.css's .article-card (these pages don't load it; same as
   assessments.css's .assessment-card); keep the three in step. The
   catalogue's own card (_template_card_cols.html) is the same .template-card
   since 2026-10-21, in its reader form ("Preview" arrow + "Use template"). */
.template-card {
  --bs-card-border-width: 0;
  --bs-card-bg: transparent;
  border-radius: 0.5rem;
}

.template-card .card-body {
  padding: 0;
}

.template-card__image-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  margin-bottom: 1.75rem;
}

/* --focal-x/--focal-y/--zoom set inline per template
   (DocumentTemplate.image_focal_style), as on the article card. */
.template-card__image {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: var(--focal-x, 50%) var(--focal-y, 50%);
  transform: scale(var(--zoom, 1));
  transform-origin: var(--focal-x, 50%) var(--focal-y, 50%);
}

/* No cover image: the old navy catalogue card in miniature (product owner,
   2026-10-21; that card's .document-card--illustrated is gone): the same
   admin-editable navy and two soft, low-opacity circles clipped by the
   rounded cover, which drift apart and brighten while the pointer is over
   the card or focus is inside it. Decorative only (pseudo-elements, no
   pointer events), the icon above them; the movement is skipped under
   prefers-reduced-motion. The white icon is 11:1 on the default navy. */
.template-card__image--fallback {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 2;
  background-color: var(--documents-card-header-bg, #163a66);
  color: rgba(255, 255, 255, 0.85);
  font-size: 4rem;
}

.template-card__image--fallback .bi {
  position: relative;
  z-index: 1;
}

/* Each Resource Library type has its own shade of the default cover, so the
   three catalogues read apart at a glance (product owner, 2026-10-21):
   templates keep the documents card colour above (navy unless an admin
   changes it), components a deep teal, Planning Kits a deep indigo, all
   about as dark, so the white icon and circles read the same on each. The
   icon names the type as well (file / puzzle / files), so colour isn't the
   only cue. Set on the card root: _component_card_cols.html,
   _my_template_card_cols.html (a component), projects/_kit_card_cols.html. */
.template-card--component .template-card__image--fallback {
  background-color: #155a65;
}

.template-card--kit .template-card__image--fallback {
  background-color: #3b2a6f;
}

.template-card__image--fallback::before,
.template-card__image--fallback::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.template-card__image--fallback::before {
  width: 15rem;
  height: 15rem;
  top: -6rem;
  right: -5rem;
}

.template-card__image--fallback::after {
  width: 9rem;
  height: 9rem;
  bottom: -3.5rem;
  left: -3rem;
  background: rgba(255, 255, 255, 0.04);
}

@media (prefers-reduced-motion: no-preference) {
  .template-card__image--fallback::before,
  .template-card__image--fallback::after {
    transition: transform 0.5s ease, background-color 0.5s ease;
  }

  .template-card:hover .template-card__image--fallback::before,
  .template-card:focus-within .template-card__image--fallback::before {
    transform: scale(1.2) translate(0.75rem, -0.75rem);
    background-color: rgba(255, 255, 255, 0.1);
  }

  .template-card:hover .template-card__image--fallback::after,
  .template-card:focus-within .template-card__image--fallback::after {
    transform: scale(1.3) translate(-0.5rem, 0.75rem);
    background-color: rgba(255, 255, 255, 0.07);
  }
}

/* The lifecycle status on its own line above the category. With no
   category after it, it takes the labels row's own gap. */
.template-card__status {
  display: flex;
  margin-bottom: 0.5rem;
}

.template-card__status:has(+ .template-card__labels:empty) {
  margin-bottom: 1.25rem;
}

/* .card__token (static/shared/css/cards.css) with the fixed status
   colours My articles and Authored assessments use: Draft grey, Published
   green, Archived dark grey, and In review / Approved (the two states those
   don't have) Pending's yellow. The word carries the meaning; the fill only
   echoes it (WCAG 1.4.1). Text contrast: 4.7:1, 10.3:1, 10.3:1, 4.5:1,
   8.2:1. */
.template-card__status-token--draft {
  background-color: #6c757d;
  color: #fff;
}

.template-card__status-token--in_review,
.template-card__status-token--approved {
  background-color: #ffc107;
  color: #1d1d1f;
}

.template-card__status-token--published {
  background-color: #198754;
  color: #fff;
}

.template-card__status-token--archived {
  background-color: #495057;
  color: #fff;
}

/* Category · Subcategory. Written on one line in the template, so it's
   :empty (and takes no space) without a category. */
.template-card__labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.template-card__labels:empty {
  display: none;
}

.template-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.4;
}

/* The title with the ⋮ options button at its right end (the catalogue's
   reader card, _template_card_cols.html), like the article card's title
   row. */
.template-card__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.template-card__title-row .template-card__title {
  flex: 1 1 auto;
  min-width: 0;
}

/* Opens the card's options menu (template_card_options.js). The same
   values as articles.css's .article-card__more-btn (a ghost icon button,
   24px square for WCAG 2.5.8), lifted above the title's stretched link so
   a click opens the menu instead of the quick-look; the top margin lines
   it up with the title's first line. */
.template-card__more-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.25rem;
  padding: 0;
  border: none;
  border-radius: var(--bs-border-radius-sm, 0.25rem);
  background-color: transparent;
  color: inherit;
}

.template-card__more-btn:hover,
.template-card__more-btn[aria-expanded="true"] {
  background-color: #f1f3f5;
}

/* The menu itself, appended to <body> and placed in page coordinates by
   template_card_options.js. Same values as articles.css's
   .article-card__options-menu (z-index 1080 so it also shows above a
   Bootstrap modal). */
.template-card__options-menu {
  position: absolute;
  z-index: 1080;
  min-width: 200px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 0.5rem;
}

.template-card__options-menu button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  background: none;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  color: #212529;
}

.template-card__options-menu button .bi {
  flex: 0 0 auto;
}

.template-card__options-menu button:hover,
.template-card__options-menu button:focus-visible {
  background-color: #f1f3f5;
}

/* The whole card is the link (the title's stretched link). */
.template-card__title a {
  color: var(--site-heading-color, #1d1d1f);
}

/* DocumentTemplate.summary (at most 300 characters); left out when blank.
   #5c6672 is 5.8:1 on white. */
.template-card__summary {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 6em;
  margin-bottom: 0.75rem;
  color: #5c6672;
  font-size: 1rem;
  line-height: 1.5;
}

/* Time and effort, in the article card's "3 min read" spot (.card__meta
   colour from cards.css). */
.template-card__facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.template-card__facts:empty {
  display: none;
}

/* Each fact is its icon (the clock, or the effort bars, which the
   catalogue pills draw as a block) beside its words. */
.template-card__facts > span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Use, Edit and Duplicate on the left, Archive / Delete on the right. */
.template-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.template-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1.25rem;
}

/* Text links (and text-style <button>s in the POST forms), lifted above
   the title's .stretched-link overlay, or a click on one falls through to
   the card's own destination. The vertical padding keeps each target at
   least 24px tall (WCAG 2.5.8). Same as assessments.css's
   .assessment-card__link. */
.template-card__link {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0;
  border: 0;
  background: none;
  color: var(--site-link-color, #0067b8);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
}

.template-card__link:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Bootstrap's danger-text-emphasis red, 6.5:1 on white. */
.template-card__link--danger {
  color: #b02a37;
}

/* A secondary option that shouldn't compete with the card's main action
   (the Favorites page's "Remove from favorites", discovery/
   _favorite_remove.html): the card's grey meta colour, #5c6672 (5.8:1 on
   white), at normal weight and a size down. Still at least 24px tall
   (0.875rem on a 1.5 line plus the base padding: about 29px, WCAG 2.5.8);
   hover darkens it as well as underlining it. */
.template-card__link--quiet {
  color: #5c6672;
  font-size: 0.875rem;
  font-weight: 400;
}

.template-card__link--quiet:hover {
  color: #212529;
}

/* The catalogue card's "Use template" arrow (GitHub's expanding arrow, as on
   "Read article", articles.css's .article-card__read-arrow): the chevron's
   stem draws in as it nudges 2px right while the pointer is over the card
   or focus is inside it. */
.template-card__arrow {
  flex-shrink: 0;
  margin-inline-start: 0.25rem;
  transition: transform 0.2s ease;
}

.template-card__arrow-stem {
  stroke-dasharray: 10;
  stroke-dashoffset: 10;
  transition: stroke-dashoffset 0.2s ease;
}

.template-card:hover .template-card__arrow,
.template-card:focus-within .template-card__arrow {
  transform: translateX(2px);
}

.template-card:hover .template-card__arrow-stem,
.template-card:focus-within .template-card__arrow-stem {
  stroke-dashoffset: 20;
}

@media (prefers-reduced-motion: reduce) {
  .template-card__arrow,
  .template-card__arrow-stem {
    transition: none;
  }
}
