    /* B-2b, 6 Oct 2026 - 15 literal(s) on this page became a var().
       The tail of tier B: everything within 25 RGB units of a
       token that was not one of B-2 four neutrals. Twenty-one
       spellings of a pale teal, fifty-three greys, and the
       Bootstrap alert colours. Same bounded gate as B-2: each
       one moves by exactly the distance the map records, or
       the round refuses to run.               [B-2b tier B] */
    /* B-2, 6 Oct 2026 - 6 literal(s) on this page became a var(), and
       unlike B-1 these MOVED: between 9 and 25 RGB units, which
       is below what an eye reads as a different colour and above
       nothing. Demetri looked at all four side by side at phone
       and desktop width before this ran.
       Two of them read BETTER: the muted grey goes 4.69:1 to
       5.53:1 on paper and the heading ink 10.98 to 12.95.
       The borders go the other way, 1.30 to 1.24, and that was
       the decision - they now agree with base.   [B-2 tier B] */
    /* B-1, 5 Oct 2026 - 38 literal(s) on this page became a var().
       Each one was already the byte-identical value of the
       token that replaced it, read from base's :root, so
       nothing here moved. What changes is that the page is on
       the token and will follow when the house does.
       Tier A of the Section B map; B and C move a pixel and
       are separate rounds.                   [B-1 tier A] */

  .ui-menu { position: relative; display: inline-block; }

  .ui-menu-toggle { white-space: nowrap; }
  .ui-menu-caret {
      margin-left: 6px;
      font-size: 11px;
      transition: transform 0.2s ease;
  }
  .ui-menu[data-open="true"] .ui-menu-caret { transform: rotate(180deg); }

  .ui-menu-panel {
      position: absolute;
      top: calc(100% + 6px);
      right: 0;
      min-width: 232px;
      background: var(--alv-paper);
      border: 1px solid var(--alv-line);
      border-radius: 8px;
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
      padding: 6px 0;
      z-index: 1050;
      text-align: left;
  }

  .ui-menu-item {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%;
      padding: 9px 16px;
      background: none;
      border: 0;
      text-align: left;
      font-size: 14px;
      color: var(--alv-ink);
      text-decoration: none;
      white-space: nowrap;
      cursor: pointer;
  }
  .ui-menu-item:hover,
  .ui-menu-item:focus {
      background: var(--alv-line-soft);
      color: var(--alv-accent);
      text-decoration: none;
      outline: none;
  }
  .ui-menu-item i { width: 16px; text-align: center; color: var(--alv-accent); }

  /* Belt and braces. The pages that use it also tag the wrapper with the
     house `.action-secondary` class, but the component should not depend on
     the page remembering to do that. */
  @media screen and (max-width: 768px) {
      .ui-menu { display: none; }
  }
  
/* ===== ALV-FILTER v1 ===== */
/* ====================================================================
   FILTER  -  one class, one owner.
   Replaces .filter-panel / .expanded / .force-expanded / the inline
   display:block !important escalation / four per-page toggle functions.
   ==================================================================== */

/* The panel. Hidden is the DEFAULT STATE, not a class you add - so a page
   that fails to run any JS shows a clean list rather than a sprung-open
   panel. `hidden` beats nothing: it is one class, no !important. */
.alv-filter            { display: none; margin-bottom: 30px; }
.alv-filter.is-open    { display: block; }
/* THE GAP UNDER AN OPEN PANEL, and why it is on .alv-filter rather than
   on .is-open beside the rule that opens it.

   W3, 28 Sep 2026. Reported on Celebration Management: the open panel
   touched the first contact card. Measured across the ten pages that
   use this component, with the panel forced open, nine already had a
   gap of 20 to 33px - because each carries a SECOND class,
   .filter-panel or .passport-filter-panel, whose rule sets a margin
   alongside a gradient and a border. celebration_management's panel is
   .alv-filter and nothing else, so it had nowhere to get one.

   .alv-filter.is-open is (0,2,0) and would have BEATEN all nine of
   those pages, imposing 30px on physical_invoice_list's 20 and on
   passport_management's 12 on a phone - two visible changes nobody
   asked for. On .alv-filter it is (0,1,0), the same weight as a page's
   own rule, and base is read first, so a page that states a margin
   still wins and a page that states none inherits this. That is what a
   default should mean.

   30px because eight of the nine already use it. The margin is inert
   while the panel is display:none, so it costs nothing until it opens. */

/* The button. NOT .action-secondary: base hides those on a phone
   (`.page-action-buttons .action-secondary { display:none }`) and
   filtering matters MORE on a small screen, not less. Own position
   class, secondary TONE. */
.btn.action-filter {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--alv-radius);
  font-family: var(--alv-font-ui); font-weight: 600; font-size: 14px;
  background: var(--alv-paper);
  border: 1px solid var(--alv-line);
  color: var(--alv-ink);
}
/* Pressed. A toggle with no visible state gets pressed twice. */
.btn.action-filter[aria-pressed="true"] {
  background: var(--alv-accent-soft);
  border-color: var(--alv-accent-line);
  color: var(--alv-accent-ink);
}
/* The count rides the button, so "something is filtering this list" is
   legible from the bar without scrolling to the chips. */
.action-filter-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; font-size: 11.5px; font-weight: 700; line-height: 1;
  background: var(--alv-accent); color: var(--alv-on-accent);
}
.btn.action-filter[aria-pressed="true"] .action-filter-count {
  background: var(--alv-accent-ink);
}
.action-filter-count:empty,
.action-filter-count[data-count="0"] { display: none; }


/* A FILTER MUST SHOW ITS OWN VALUE.
   Bootstrap 4.1.3 pins every control to a FIXED height -
   `.form-control { height: calc(2.25rem + 2px) }`, 38px - while these panels
   set `padding: 10px 14px` on top of it. With border-box that leaves ~14px of
   content box for a 14px font, so the chosen option is shaved off at the
   bottom and "All Properties" loses its descenders.
   Whether it actually clips depends on the font: it does on Segoe UI, it does
   not on the Linux faces this was first rendered against - which is precisely
   why this is fixed by removing the constraint rather than by tuning a number.
   The :not() pair is not decoration; Bootstrap's own selector carries it, and
   without matching that shape this rule loses on specificity, silently. */
/* WIDENED from `.alv-filter` to everywhere, 27 Aug 2026. The rule below was
   added by the filter round for filter panels; the same defect is on every
   add/edit form in the system. Measured: 47 of 184 controls across 20 form
   templates were rendering shorter than their own content.

   The `:not()` pair is not decoration - Bootstrap's own selector carries it,
   so without matching that shape this rule is (0,1,1) against its (0,2,1)
   and loses, silently. That happened on the first attempt. */
select.form-control:not([size]):not([multiple]),
input.form-control,
textarea.form-control { height: auto; }

/* The chips move OUT of the panel. This is the whole safety argument:
   a closed panel must never mean invisible filtering. */
/* Default HIDDEN, shown by a class - not the reverse. Starting visible and
   hiding it in script means a flash of "Active filters:" with nothing after
   it on every page load. */
.alv-filter-active { display: none; }
.alv-filter-active.has-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: -8px 0 16px;
  font-family: var(--alv-font-ui); font-size: 13px;
}
.alv-filter-active-label { color: var(--alv-ink-soft); font-weight: 600; }

/* ===== ALV FILTER FIELD v1 ===== 23 Sep 2026
   The filter bar's own controls - the Country / Status dropdown, the text
   box beside it, and the search input welded to its button. TEN pages
   carried a copy, the same properties in the same order, and they had
   drifted into disagreeing about the one thing that matters most here.

   MEASURED IN CHROMIUM, the same Country filter, before this block:

     page                          desk   phone   chevron
     act_expense                    44      44      yes
     passport_management            44      44      yes
     physical_invoice_list          44      44      NO
     fsr / properties / suppliers   44      46      yes
     tenant                         44      46      yes
     projects/projects              48      48      yes
     invoices                       42      43      NO
     unit_conversions_management    42      43      NO

   Four different heights on a phone, and THREE OF THE TEN below the 44px
   decision 3.4 has promised since it was written. Nobody had measured it;
   the running list recorded this as "the filter selects' own 44px rules on
   five pages", which was wrong about the number and wrong about the fault.

   HEIGHT, not min-height. 44 on the desk and 44 on the phone, so the
   control is the same size everywhere - which min-height cannot give,
   because the 16px iOS zoom guard grows the box to 46 or 48. Two pages
   already fixed the height and measured 44 at both widths; this is them.

   PAINTED FROM THE TOKENS. The copies wrote #e9ecef for the border and
   #0e7c8b for the focus. The focus literal already WAS --alv-accent; the
   border moves to --alv-line (#e3e8ea), which is the colour every other
   field in the system uses, so the filter bar finally matches the form
   below it. The chevron keeps its literal grey - a data: URI cannot read
   a custom property.

   z-index 10, and 20 on focus, with `overflow: visible` on the group:
   five of the ten needed it so a focus ring is not clipped by the field
   beside it. It travels with the component rather than being dropped.

   A page joins by DELETING its copy. Nine keep their class names, so no
   markup moves; passport_management, recipe_management and
   unit_conversions_management wrote their own names and are renamed.
                                              [test_filter_field.py] */
/* ===== ALV FILTER FRAME v1 ===== 30 Sep 2026
   base has owned the FIELD in this panel since 23 Sep - the group, the
   label, the select, the input. It owned none of the frame around them,
   and nine pages wrote that out themselves: thirty-one rules saying
   three things, with four pages declaring the header TWICE and the
   first declaration never rendering at all.

   WHAT RENDERED WAS NEARLY THE SAME EVERYWHERE. The differences were
   #2c3e50 on the title (8 of 9) and #dee2e6 on the border (5 of 9) -
   hexes in a page's own style block, which the standards name as NEVER
   - plus a cursor and a hover on a header nothing clicks.

   THE VALUES ARE NOT NEW. celebration_management was tokenised in a
   round this week, and measured against these three rules it matches
   all three exactly. base adopts the one copy that has been reviewed;
   the other eight come to it.

   A PAGE STILL NAMES ITS OWN COLUMNS. grid-template-columns is left to
   the page and really does differ - 2fr 1fr 1fr, 1fr 1fr, four equal
   columns - because how many filters a screen has is the screen's
   business.

   AND IT SUBMITS BY GET. Settled 1 Oct 2026, Section F round F1, after a
   census found eleven filter forms in three spellings - four method="GET",
   two method="get", five method="post" - plus one page that filters in
   the browser and never asks the server at all.

   A FILTER IS A VIEW, NOT A CHANGE. With GET the URL carries it, so a
   narrowed list can be bookmarked, re-opened and sent to somebody; Back
   returns to it instead of asking the browser to resubmit a form; and a
   refresh is safe. The five POST pages were converted in F1.

   WITH NO csrf_token IN IT. A GET form serialises every field into the
   query string, so a token left in one lands in the address bar, the
   history and the Referer header. Django exempts safe methods; it is not
   needed and must not be there.

   Lowercase `get`, for no better reason than that an attribute value is
   lowercase everywhere else in this file.
                            [test_filter_frame.py] [test_filter_get.py] */
.filter-grid {
    display: grid;
    gap: 20px;
    /* START, NOT end - FA-1, 4 Oct 2026, and Demetri found it on
       Projects: "The filters are not in line...."

       end aligns the BOTTOMS of the groups. A group is a label above a
       control, so its bottom is the bottom of the control - and the
       moment two groups are not the same height, their TOPS part
       company. Rendered at 1280, ten of the seventeen panels in this
       tree were out of line, for two reasons:

         2px, on eight pages: the search field is an <input> and the
         rest are <select>, and a select is 2px taller.

         25px, on Projects: its Search group carries an
         .alv-search-hint UNDER the control, so the group's bottom is
         the bottom of the HINT and the whole group - label, box and
         all - was lifted 25px to put the hint where the other controls
         ended.

       The hint was doing what it was told. The instruction was wrong: a
       filter panel is a row of LABELLED controls and what a reader
       lines up on is the top of the labels. With start, all seventeen
       measure label top 0 and control top 27, and a hint hangs below
       its own control and pushes nothing - which is what a hint is for.

       Every .filter-label in the tree is one line, 21px, which is why
       aligning the labels aligns the controls too. test_filter_align
       section 2 fails if one ever wraps. */
    align-items: start;
    /* COLUMNS - FG-1, 3 Oct 2026, and the reason this round exists.
       This rule declared display: grid and no columns, which is a grid
       with ONE column: every field stacks and each one fills the track.
       It worked anyway for a year because all twelve pages using it set
       their own grid-template-columns - and then IB-1 shipped a page
       that did not, and its two fields rendered stacked, 1888px wide
       each, on a 1920 screen.

       A component that only behaves when its caller remembers to finish
       it is not finished. So the default is here now, and a page that
       sets its own still wins - a declaration here is (0,1,0) and a
       page's copy comes later in the document.

       auto-fit lets the browser count the columns, so a panel that
       gains a field does not need its track list rewritten. The floor
       keeps a field usable; the CAP is what Demetri asked for on 3 Oct:
       "the filter fields must be made less wide, so that they fit on
       one line". Without justify-content the slack is shared BETWEEN
       the tracks and two fields sit at opposite ends of the panel. */
    grid-template-columns: repeat(auto-fit, minmax(200px, 240px));
    justify-content: start;
}

/* ONE COLUMN ON A PHONE. A 240px cap on a 358px screen would leave a
   third of the width empty, and every filter panel in the tree already
   goes single-column here. */
@media screen and (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--alv-line);
}

.filter-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--alv-ink);
    user-select: none;
}

/* THE HEADER'S TWO LABELS - IB-1, 2 Oct 2026.
   A filter panel header carries a long label and a short one for each of
   its two pieces, and shows one of each. Without these, BOTH print:
   "Ingredient Filters Filters" and "Clear AllClear" - which is exactly
   what the IB-1 render caught before the round went anywhere.

   suppliers.html has carried these three rules locally since 23 Sep. They
   are here now because base owns every other class in that header, and a
   second page copying them would have been the twelfth local copy of a
   filter rule in this tree. The suppliers copy is identical and is left
   alone; test_ingredient_filter.py pins the count.      [ALV FILTER v1] */
.filter-title-text-mobile,
.clear-all-text-mobile { display: none; }
@media screen and (max-width: 768px) {
  .filter-title-text { display: none; }
  .filter-title-text-mobile { display: inline; }
  .clear-all-text { display: none; }
  .clear-all-text-mobile { display: inline; }
}

.filter-group {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
}
.filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--alv-ink-strong);
  font-size: 14px;
  font-weight: 500;
}
.filter-label i { color: var(--alv-ink-soft); width: 14px; }

.filter-select,
.filter-input {
  position: relative;
  z-index: 10;
  width: 100%;
  /* BORDER-BOX, ADDED 29 SEP 2026, AND THE REASON IS ABOVE THIS BLOCK.
     height: 44px in the browser's default content-box means 44 of
     CONTENT, and this component's own 10px padding and 2px border are
     then added to it: 68.

     IT HID BEHIND TWO THINGS AT ONCE. The browser's own sheet gives a
     <select> border-box and a text <input> content-box, so the same rule
     was right on one element and 68 on the other; and 25 of the 30 uses
     also carry .form-control, which Bootstrap makes border-box, covering
     the difference wherever it appears. Two bare text inputs were left,
     and both measured 68 today.
                                                [test_filter_box.py] */
  box-sizing: border-box;
  height: 44px;
  padding: 10px 14px;
  background: var(--alv-paper);
  border: 2px solid var(--alv-line);
  border-radius: var(--alv-radius);
  font-family: var(--alv-font-ui);
  font-size: 14px;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.filter-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px 12px;
  padding-right: 40px;
}
.filter-select:focus,
.filter-input:focus {
  z-index: 20;
  border-color: var(--alv-accent);
  box-shadow: 0 0 0 3px var(--alv-accent-ring);
  outline: none;
}

/* The search box: an input welded to a button, which is why the two carry
   half a radius each and no border between them. The button was teal on
   five pages and GREEN on recipe_management - the same colour-by-module
   fault D3 found in the row actions, and the same answer: it is the one
   thing you came to the bar to do, so it is the accent, everywhere. */
/* A search box that does NOT narrow as you type says so, once,
   quietly, under the box. Two lists cannot have the live filter -
   projects and recipes both search a field that is not rendered on the
   page (a project's description, a recipe's ingredients), so narrowing
   the screen would answer a different question from the glass. Demetri
   asked for the line on 1 Oct 2026.       [test_search_hint.py] */
.alv-search-hint {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    line-height: 1.35;
    color: var(--alv-ink-soft);
}

.search-input-group {
  position: relative;
  display: flex;
  align-items: stretch;
}
.search-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 10px 14px;
  background: var(--alv-paper);
  border: 2px solid var(--alv-line);
  border-right: none;
  border-radius: var(--alv-radius) 0 0 var(--alv-radius);
  font-family: var(--alv-font-ui);
  font-size: 14px;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-input:focus {
  position: relative;
  z-index: 20;
  border-color: var(--alv-accent);
  box-shadow: 0 0 0 3px var(--alv-accent-ring);
  outline: none;
}
.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 44px;
  padding: 10px 16px;
  background: var(--alv-accent);
  border: 2px solid var(--alv-accent);
  border-left: none;
  border-radius: 0 var(--alv-radius) var(--alv-radius) 0;
  color: var(--alv-on-accent);
  cursor: pointer;
}
.search-btn:hover,
.search-btn:focus {
  background: var(--alv-accent-ink);
  border-color: var(--alv-accent-ink);
  color: var(--alv-on-accent);
}
.search-btn:active { transform: scale(0.98); }
.search-btn:focus-visible {
  outline: 2px solid var(--alv-accent);
  outline-offset: 2px;
}

/* 16px stops iOS zooming the page when a control is tapped. HEIGHT is
   fixed above, so the bigger type does not grow the box - which is the
   whole reason this component sets height rather than min-height. */
@media screen and (max-width: 768px) {
  .filter-select,
  .filter-input,
  .search-input { font-size: 16px; }
  .search-input-group { width: 100%; }
}
/* ===== /ALV FILTER FIELD v1 ===== */

/* ===== ALV FILTER CHIP v1 ===== 22 Sep 2026
   The chip that says a filter is on - "Property: Limassol  x". Nine pages
   carried the same four rules, copied from one another; this is them, once,
   painted from the tokens. Scripts build most chips at run time, so the
   class names ARE the interface: .filter-tags holds them, .filter-tag is
   one, .filter-tag .remove-tag is its x (a <button>, or an <a> where
   clearing is a link).

   THE x IS 16PX TO SEE AND 44PX TO TAP. On a phone an invisible ring
   grows the target to 44px, and the rows are spaced 20px so the rings of
   two rows meet rather than overlap. On paper the chips print - they say
   what the sheet shows - and the x, a control, does not.
                                                [test_filter_chip.py] */
.filter-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 16px;
  background: var(--alv-accent);
  color: var(--alv-paper);
  font-size: 12px;
  font-weight: 500;
}
.filter-tag .remove-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  color: var(--alv-paper);
  font-size: 10px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.filter-tag .remove-tag:hover,
.filter-tag .remove-tag:focus-visible {
  background: rgba(255, 255, 255, 0.5);
  color: var(--alv-paper);
  text-decoration: none;
}
@media screen and (max-width: 768px) {
  .filter-tags { row-gap: 20px; }
  .filter-tag .remove-tag { position: relative; }
  .filter-tag .remove-tag::before {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 50%;
  }
}
@media print {
  .filter-tag .remove-tag { display: none !important; }
}
/* ===== /ALV FILTER CHIP v1 ===== */

@media screen and (max-width: 768px) {
  /* Same treatment Back gets: keep the target, drop the label. */
  .page-action-buttons .action-filter {
    flex: 0 0 auto; width: 44px; height: 44px;
    padding: 0; justify-content: center; gap: 0;
  }
  .page-action-buttons .action-filter .action-filter-label { display: none; }
  /* The count still has to show, or the phone loses the only cue. */
  .page-action-buttons .action-filter .action-filter-count {
    position: absolute; transform: translate(14px, -12px);
  }
  .page-action-buttons .action-filter { position: relative; }
}

/* ===== ALV TAP TARGET v1 ===== 22 Sep 2026
   44px is the smallest thing a thumb should be asked to hit, and 3.4 of
   the standards has promised it on a phone for weeks. Until 22 Sep base
   itself made the action bar 38px there, fifteen pages put 44 back with
   copies of their own, and seven more did it for their pop-up footers.

   PHONE ONLY. On a desk a pointer is precise and the bar stays 35px.
   The bar's heights are set in its own phone rules; this block is the
   FLOOR for every house button wherever it sits. min-height, not height,
   so a page that pins a height loses to the floor instead of fighting it.
   A page's own button classes are the page's to raise - base cannot know
   them.                                          [test_tap_target.py] */
@media screen and (max-width: 768px) {
  .page-action-buttons .btn,
  .action-more-item,
  .btn.action-primary,
  .btn.action-secondary,
  .btn.action-danger,
  .btn.action-back,
  .btn.back-button,
  .status-btn,
  .modal-footer .btn { min-height: 44px; }
  .icon-action-btn { width: 44px; height: 44px; }
}
/* ===== /ALV TAP TARGET v1 ===== */

@media print {
  .alv-filter, .btn.action-filter { display: none !important; }
  /* The chips DO print - they say what the page you are holding shows. */
  .alv-filter-active.has-filters { display: flex !important; }
}



/* ===== ALV TABS v1 ===== */
/* Panel-level tabs: several views of one panel, one of them current, the
   bar sitting directly above the thing it controls.

   THE LOOK IS NOT CHOSEN HERE. ALV-SEG's note settled what a tab bar is
   when the segmented control went in - "full width, with an underline
   under the current one, sitting directly above the chart they control" -
   and said base would get one when a second page asked. Five did, and
   205 of the tabs in this app are rendered by one of them. These are the
   Issues Analysis modal's own rules, the one copy that was already
   entirely on tokens, lifted as they stand.

   NOT ALV-SEG, AND THE DIFFERENCE IS IN THAT NOTE TOO. A segment is a
   PAGE-level choice worn in an action bar, and the chosen one is FILLED.
   A tab is a panel-level choice worn above the panel, and the current one
   is UNDERLINED. Two controls, two jobs; neither is a substitute.

   NEVER A BARE .nav-link. The TOP NAVIGATION BAR wears .nav-link ten
   times in this very file - every menu item, the bell, the profile link,
   Login. A rule on .nav-link alone would repaint the whole navigation.
   Every selector below is scoped to .nav-tabs, and apply_tabs.py gates
   it.

   TWO SPELLINGS BECAUSE BOOTSTRAP'S PLUGIN OWNS THE BEHAVIOUR. Four of
   the five bars are `data-toggle="tab"` on a .nav-link inside
   ul.nav.nav-tabs; the plugin keys on that markup, so renaming it would
   mean reimplementing it. .alv-tab is for a bar that is not Bootstrap's.

   AND THE RULE MUST BEAT BOOTSTRAP AT EQUAL SPECIFICITY, which it does by
   being LATER: bootstrap.min.css is linked above this block, not below.
   .nav-tabs .nav-link.active is 0,3,0 in both sheets.

   WHAT IT REPLACED, named so it is never re-derived: #007bff, which is
   Bootstrap's own .nav-link and what act_expense's three tabs and all 205
   help tabs fell back to; #495057 and #0e7c8b, written inline per tab by
   the help shell and again as rules by notifications.html and the two
   projects pages; and #dee2e6 / #e9ecef / #f8f9fa on the box-tab borders
   and hovers. Not one of them survives in the CSS below - the whole
   component is tokens.

   flex: 1 1 0 WITH white-space: nowrap, at both ends. Three tabs share
   the row equally, which is the reviewed look. Nine - the largest help
   modal - cannot shrink below their own text, so the bar scrolls rather
   than stacking into slivers.
                                                        [test_tabs.py] */
.alv-tabs,
.nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    border-bottom: 1px solid var(--alv-line);
    margin-bottom: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
.alv-tab,
.nav-tabs .nav-link {
    flex: 1 1 0;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    padding: 10px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--alv-ink-soft);
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.alv-tab.active,
.alv-tab[aria-selected="true"],
.nav-tabs .nav-link.active,
.nav-tabs .nav-link[aria-selected="true"] {
    color: var(--alv-accent-ink);
    background: transparent;
    border-color: transparent;
    border-bottom-color: var(--alv-accent);
}
.alv-tab:focus-visible,
.nav-tabs .nav-link:focus-visible {
    outline: 2px solid var(--alv-accent);
    outline-offset: -2px;
}
@media (hover: hover) and (pointer: fine) {
    .alv-tab:not(.active):hover,
    .nav-tabs .nav-link:not(.active):hover {
        color: var(--alv-accent-ink);
        border-bottom-color: var(--alv-accent-line);
    }
}
@media screen and (max-width: 768px) {
    .alv-tab,
    .nav-tabs .nav-link {
        flex: 0 0 auto;
        font-size: 12.5px;
        padding: 9px 10px;
    }
}
/* ===== /ALV TABS v1 ===== */

/* ===== ALV-SEG v1 ===== */
/* A segmented control: two or three views of the same screen, one of them
   current. Deferred twice as "one use does not justify a component" -
   financial_indicators hand-rolls one out of Bootstrap's .btn-group, and
   finance_expense was the third asker that finally justified building it.

   AMENDED 2 Sep. This note used to name tenant_payment_days as a second
   hand-roller. It is not one: its only toggle is .pd-toggle, a per-row
   expand chevron on aria-expanded with a rotating icon - a disclosure, not
   a choice of view. The file has no aria-pressed and no aria-current. A
   component's note listing an asker that never existed sends the next
   reader looking for it, so the count is corrected rather than left to
   flatter the decision. financial_indicators joined on 2 Sep.

   NOT A TAB BAR, and the difference was measured before it was asserted.
   The Issues Analysis modal has three panel-level tabs - full width, with
   an underline under the current one, sitting directly above the chart they
   control. Rendered as segments they shrink to a third of the row and read
   as a second filter beside the date pickers rather than as part of the
   panel below. A segment here is a PAGE-level choice, worn in an action
   bar; those tabs stay as they are. If a second page ever wants a panel
   tab bar, that is when base gets one - not before.

   It is NOT the pill scale and NOT the button tones. A segment is not a verb
   you press to make something happen; it is which view you are looking at,
   so the pressed one is filled and the rest are quiet, and nothing here
   carries a semantic colour. */
.alv-seg {
    display: inline-flex;
    border: 1px solid var(--alv-line);
    border-radius: var(--alv-radius-sm);
    overflow: hidden;
    background: var(--alv-paper);
}
.alv-seg > * {
    appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--alv-ink-soft);
    padding: 7px 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.alv-seg > * + * { border-left: 1px solid var(--alv-line); }
.alv-seg > [aria-pressed="true"],
.alv-seg > [aria-current="page"] {
    background: var(--alv-accent);
    color: var(--alv-on-accent);
}
.alv-seg > *:focus-visible { outline: 2px solid var(--alv-accent); outline-offset: -2px; }

/* IN AN ACTION BAR, A SEGMENT IS THE BAR'S HEIGHT - PN-1, 3 Oct 2026.

   .alv-seg sets its own 13px type and 7px/14px padding, which is right
   where it was first used - a view bar of its own on finance_expense. In
   an ACTION BAR it came to 35.5px against the 34.8px every .btn there is
   given, and three quarters of a pixel is enough to move a centred
   sibling: finance_pl_act's year dropdown is a 24px control, and after
   SG-2 put a segment beside it the dropdown sat a pixel lower than
   everything else. test_button_sweep measures distinct row positions and
   said the bar was two rows.

   The fix is not to shave the padding to something that happens to land.
   It is to say what was always meant: a control in the action bar takes
   the bar's control metrics - the same font, the same line-height, the
   same padding as the .btn beside it - so the arithmetic is the same
   arithmetic and the heights are equal rather than nearly equal. */
.page-action-buttons .alv-seg > * {
    font-size: 14px;
    line-height: 1.2;
    padding: 8px 16px;
}
@media (hover: hover) and (pointer: fine) {
    .alv-seg > *:not([aria-pressed="true"]):not([aria-current="page"]):hover {
        background: var(--alv-accent-soft);
        color: var(--alv-accent-ink);
    }
}

/* ===== ALV-MATRIX v1 ===== */
/* A table read across as well as down: years, months, buckets. It scrolls
   sideways and freezes its first column.

   THIS COULD NOT BE .table-container. That one sets `overflow: clip` on
   purpose - a sticky heading pins to its nearest SCROLLING ancestor, so a
   scroll container swallows it. A matrix needs `overflow-x: auto`, which is
   the opposite requirement. Two components, two names.

   Worth knowing when the next page needs one: financial_indicators.html and
   vacancy_management.html already use the NAME .table-container for exactly
   this, which is the collision the sticky sweep reported as its group D and
   deliberately left alone. They belong on this, in a round of their own. */
.alv-matrix-scroll {
    overflow-x: auto;
    background: var(--alv-paper);
    border-radius: var(--alv-radius);
}
table.alv-matrix {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-family: var(--alv-font-ui);
    font-variant-numeric: tabular-nums;
}
.alv-matrix th,
.alv-matrix td {
    padding: 10px 14px;
    white-space: nowrap;
    border-bottom: 1px solid var(--alv-line-soft);
    background: var(--alv-paper);
}
.alv-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--alv-surface);
    color: var(--alv-ink-strong);
    font-size: 13.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .01em;
    text-align: right;
    box-shadow: inset 0 -1px 0 var(--alv-line);
}
/* The frozen edges. Each needs a background of its own - a sticky cell is
   painted over by whatever scrolls under it otherwise - and a higher stacking
   order where the two overlap at the corners. */
.alv-matrix th.alv-matrix-row-head,
.alv-matrix td.alv-matrix-row-head {
    position: sticky;
    left: 0;
    z-index: 1;
    text-align: left;
    font-weight: 600;
    min-width: 190px;
    box-shadow: 1px 0 0 var(--alv-line);
}
.alv-matrix th.alv-matrix-total,
.alv-matrix td.alv-matrix-total {
    position: sticky;
    right: 0;
    z-index: 1;
    background: var(--alv-surface);
    box-shadow: -1px 0 0 var(--alv-line);
}
.alv-matrix thead th.alv-matrix-row-head,
.alv-matrix thead th.alv-matrix-total { z-index: 4; }
.alv-matrix td { text-align: right; }

/* THE AGEING SCALE.
   One severity class carries the step; one application class decides what to
   do with it. So four steps drive a dot, a bar segment, a column tint and a
   pill without four parallel families of class - which is exactly what the
   Outstanding Invoices report had, three of them, disagreeing.
   Severity: .alv-age-0 (not ageing) .. .alv-age-4 (severe). */
/* AG-1 - step 0 is the TOP OF THIS SCALE now, not the good token. It
   used to be --alv-good literally, which is how a ledger column came to
   be green. Not ageing is the absence of ageing, not a health verdict. */
.alv-age-0 { --age: var(--alv-age-0);  --age-soft: var(--alv-age-0-soft); }
.alv-age-1 { --age: var(--alv-age-1);  --age-soft: var(--alv-age-1-soft); }
.alv-age-2 { --age: var(--alv-age-2);  --age-soft: var(--alv-age-2-soft); }
.alv-age-3 { --age: var(--alv-age-3);  --age-soft: var(--alv-age-3-soft); }
.alv-age-4 { --age: var(--alv-age-4);  --age-soft: var(--alv-age-4-soft); }

.alv-age-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none;
    background: var(--age, var(--alv-neutral));
}
.alv-age-fill {
    height: 100%;
    background: var(--age, var(--alv-neutral));
}
.alv-age-cell { background: var(--age-soft, transparent); }
/* AG-1, 4 Oct 2026 - THE TEXT IS --alv-ink AT EVERY STEP. It was
   var(--age), and with a one-tone scale that put #8a979d on #fafaf9 and
   #8a8578 on #f2f1ee - 2.87 and 3.26, both failing AA on a pill that
   exists to be read. The STEP shows in the background and in a 1px
   border of --age, so it is encoded twice and nothing is under 7.6. */
.alv-age-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--age-soft, var(--alv-neutral-soft));
    border: 1px solid var(--age, var(--alv-line));
    color: var(--alv-ink);
}
/* THE GRADING SCALE.
   Same machinery as the ageing scale above - the step class carries the
   colour, the application class decides what to do with it - so a grade can
   drive a cell tint today and a pill or a bar tomorrow without a second
   family of classes.

   COLOUR IS REDUNDANT HERE, NOT LOAD-BEARING. Every graded cell prints its
   own figure, so a reader who cannot separate the two ends of a red-green
   scale still has the number. That is the condition under which a scale like
   this is defensible, and it is written down so the next screen that wants
   one has to meet it too. */
.alv-grade-1 { --grade: var(--alv-grade-1); --grade-soft: var(--alv-grade-1-soft); }
.alv-grade-2 { --grade: var(--alv-grade-2); --grade-soft: var(--alv-grade-2-soft); }
.alv-grade-3 { --grade: var(--alv-grade-3); --grade-soft: var(--alv-grade-3-soft); }
.alv-grade-4 { --grade: var(--alv-grade-4); --grade-soft: var(--alv-grade-4-soft); }
.alv-grade-5 { --grade: var(--alv-grade-5); --grade-soft: var(--alv-grade-5-soft); }

.alv-grade-cell { background: var(--grade-soft, transparent); }
.alv-grade-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none;
    background: var(--grade, var(--alv-neutral));
}
@media print {
    /* A tint that carried meaning has to survive a printer, the way the
       ageing columns do. */
    .alv-grade-cell {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* A year that straddles a change: the months before it carry the previous
   figure and the months after it the current one, so the column matches
   neither charge. Marked rather than explained away - an unmarked blend reads
   as a third charge, and did. */
.alv-matrix thead th.alv-matrix-blend { color: var(--alv-warn); }
.alv-matrix thead th.alv-matrix-blend span[aria-hidden] {
    font-size: .9em;
    opacity: .85;
}
.alv-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
@media (hover: hover) and (pointer: fine) {
    .alv-matrix tbody tr:hover td { background: var(--alv-accent-soft); }
}
.alv-matrix tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--alv-surface);
    font-weight: 700;
    box-shadow: inset 0 1px 0 var(--alv-line);
}
.alv-matrix tfoot td.alv-matrix-row-head,
.alv-matrix tfoot td.alv-matrix-total { z-index: 3; }
/* A cell where the property was not in the distribution at all. NOT zero -
   the whole point is that you can tell "was not in it" from "was in it and
   cost nothing", which is the distinction the Expenses list loses. */
.alv-matrix .alv-matrix-absent { color: var(--alv-ink-faint); }

@media print {
    /* Decided: this view does not print. A frozen column and a sideways
       scroll have no meaning on paper, so it goes with the rest of the
       furniture rather than printing something misleading. */
    .alv-seg, .alv-matrix-scroll { display: none !important; }
}

/* ===== ALV-ICON-COLOURS v1 ===== */
/* The MOBILE bar's colour variants. base had four of the seven actions; the
   three below were left to each page, which is why the one page that needed
   them kept its own literals - Bootstrap green, orange and blue - long after
   base had moved to the house tones. A standard with holes in it is a
   standard that gets copied around. */
.icon-color-approve   { color: var(--alv-good); }
.icon-color-unapprove { color: var(--alv-warn); }
.icon-color-send      { color: var(--alv-accent); }

/* Duplicate: a NAME on an existing colour, not a seventh tone. Duplicating
   creates a new draft, which is a write, exactly as Edit is - so it points at
   --alv-edit and gets its own name so the markup does not claim a button
   edits when it duplicates. This is the .icon-upload precedent, and it is now
   the rule for any new action: alias first, add a colour only with a reason. */
.icon-duplicate       { color: var(--alv-edit); border-color: var(--alv-edit); }
.icon-duplicate:hover { background-color: var(--alv-edit); color: var(--alv-on-accent); }
.icon-color-duplicate { color: var(--alv-edit); }

/* Leftovers: the fourth NAME on an existing colour - MO-1, 19 Oct 2026.
   Putting a meal on another day as leftovers creates a new row, which is a
   write exactly as Duplicating is, so it points at --alv-edit and sits in
   the COPY family beside it. It gets its own name rather than wearing
   .icon-duplicate because A CLASS CARRIES ONE PICTURE: the first cut of
   MO-1 hung fa-redo on .icon-duplicate beside the fa-copy it already wore
   on eleven buttons, and test_icon_names refused it in under a minute.
   Alias the colour, never the name. */
.icon-leftover       { color: var(--alv-edit); border-color: var(--alv-edit); }
.icon-leftover:hover { background-color: var(--alv-edit); color: var(--alv-on-accent); }
.icon-color-leftover { color: var(--alv-edit); }

/* Move: the fifth NAME on the same colour - RD-2, 19 Oct 2026. Moving a
   meal to another day changes a row rather than creating or destroying
   one, so it is CHANGE, like Leftovers beside it and Duplicate above.
   Its own name, for the reason written there: a class carries one
   picture, this one is fa-arrow-right, and .icon-leftover is already
   spoken for by fa-redo. */
.icon-move       { color: var(--alv-edit); border-color: var(--alv-edit); }
.icon-move:hover { background-color: var(--alv-edit); color: var(--alv-on-accent); }
.icon-color-move { color: var(--alv-edit); }

/* Manage: the third NAME on an existing colour, and for the same reason as
   Duplicate and Upload. Opening an expense's record - its details, its invoice
   document, its delete tab - is a VIEW, so it points at --alv-view, the same
   colour the eye already wears.

   It gets its own name rather than reusing .icon-view because a class carries
   ONE picture. `test_icon_buttons.py` §1b exists because .icon-edit had drifted
   to two glyphs across the system; hanging fa-folder-open on .icon-view beside
   the fa-eye it already carries would be that same fault, one class along.
   Alias the colour, never the name. */
.icon-manage       { color: var(--alv-view); border-color: var(--alv-accent-line); }

/* List: the FIFTH NAME on --alv-view, added by ML-1 on 2 Oct 2026 for
   Meal Plans' shopping-list row action (fa-shopping-cart). A shopping list
   is something the row SHOWS you, which is what --alv-view means here, and
   there was no name that read correctly on that button - "manage" does not
   describe a list of what to buy.

   THE RULE base ALREADY STATES, three names above this one: a new NAME on
   an existing colour, not a sixth colour. Nothing is added to the palette.
   The name exists so the markup says what the control is. */
.icon-list       { color: var(--alv-view); border-color: var(--alv-accent-line); }
.icon-list:hover { background-color: var(--alv-view); border-color: var(--alv-view); color: var(--alv-on-accent); }
.icon-color-list { color: var(--alv-view); }

/* Event: the fourth NAME on --alv-view, added by Section H round H2 for
   Celebrations' "Add Event" row action (fa-calendar-plus). Adding an event
   to a contact opens that contact's record to write to it, which is the
   same family as Manage - so it points at the colour the eye already
   wears, and takes its own name because a class carries ONE PICTURE.
   Alias the colour, never the name. */
.icon-event        { color: var(--alv-view); border-color: var(--alv-accent-line); }
.icon-manage:hover { background-color: var(--alv-view); border-color: var(--alv-view); color: var(--alv-on-accent); }
.icon-color-manage { color: var(--alv-view); }

/* Permissions, lock and unlock: three more NAMES ON EXISTING COLOURS, for
   Administration's user list. Same rule as Duplicate, Upload and Manage
   above - no new hex enters the palette.

   Permissions opens a screen that shows what a user MAY do, which is a
   view, so it wears --alv-view exactly as .icon-manage does.

   Lock and unlock are Disable and Enable. By shape they are the pair that
   .icon-unapprove and .icon-approve already are - amber and green, a state
   you can toggle back - and they take their own names rather than
   borrowing those, because an Enable button carrying a class called
   `approve` says something the button does not do.

   AND THEY ARE NOT CALLED .icon-disable. base already has .icon-disabled,
   which is a STATE on a control the user may not use, not an action. Two
   class names one character apart in one stylesheet is how
   `\bform-section\b` came to match inside `form-section-title` and cost
   this project a round; the edge of a class name is not a word boundary,
   and the cheapest moment to avoid that is before the name exists. */
.icon-permissions       { color: var(--alv-view); border-color: var(--alv-accent-line); }
.icon-permissions:hover { background-color: var(--alv-view); border-color: var(--alv-view); color: var(--alv-on-accent); }
.icon-color-permissions { color: var(--alv-view); }

.icon-lock       { color: var(--alv-warn); border-color: var(--alv-warn-line); }
.icon-lock:hover { background-color: var(--alv-warn); border-color: var(--alv-warn); color: var(--alv-on-accent); }
.icon-color-lock { color: var(--alv-warn); }

/* Reset Password: ANOTHER NAME ON AN EXISTING COLOUR, added by Section A
   round A1 for the user list's row actions. No new hex enters the palette -
   the rule Duplicate, Upload, Manage and Event were all added under.

   WHY --alv-warn. It is the same WEIGHT of action as Disable: it begins
   the process that replaces somebody's password. Not --alv-edit, which
   would sit beside the pencil at a glance and read as "change this row";
   not --alv-delete, because nothing is destroyed - the current password
   keeps working until the emailed link is used.

   WHY ITS OWN NAME AND NOT .icon-lock. A class carries ONE PICTURE.
   .icon-lock is fa-user-slash (Disable, IC-1); this is
   fa-envelope. Hanging a second
   glyph on a class that already has one is precisely the drift
   test_icon_buttons section 1b exists to catch, and .icon-edit had
   already done it once.                            [test_auth_flow.py] */
.icon-reset-pw       { color: var(--alv-warn); border-color: var(--alv-warn-line); }
.icon-reset-pw:hover { background-color: var(--alv-warn); border-color: var(--alv-warn); color: var(--alv-on-accent); }
.icon-color-reset-pw { color: var(--alv-warn); }

.icon-unlock       { color: var(--alv-good); border-color: var(--alv-good-line); }
.icon-unlock:hover { background-color: var(--alv-good); border-color: var(--alv-good); color: var(--alv-on-accent); }
.icon-color-unlock { color: var(--alv-good); }

/* Notify: THE ADVANCE FAMILY SPLITS BY CONSEQUENCE, added by NV-1c on
   16 Oct 2026 after Demetri asked for a standard for Notify - "maybe
   just a bell with a Notify Now hover".

   WHY --alv-warn AND NOT THE ACCENT. The three tones above are not
   decoration: .icon-send is accent because the thing goes out,
   .icon-approve and .icon-unlock are good because something becomes
   allowed, and .icon-unapprove, .icon-lock and .icon-reset-pw are warn
   because SOMEBODY WILL NOTICE. Notify Now emails everyone configured
   except the clicker, immediately, with a five-minute cooldown per
   comment. It is the third group.

   And fsr_details had already reached that reading on its own, in a
   page-local rule, in as many words: amber ink on a quiet outline
   because this one has consequences. This is that decision moved to
   where the other forty-one live, not a new one.

   WHY ITS OWN NAME AND NOT .icon-lock, whose rule this is byte for
   byte: A CLASS CARRIES ONE PICTURE. .icon-lock is fa-user-slash; this
   is fa-bell. base states that rule beside .icon-upload,
   .icon-document, .icon-reset-pw and .icon-permissions, and .icon-edit
   had already broken it once.         [test_icon_buttons.py 1b] */
.icon-notify       { color: var(--alv-warn); border-color: var(--alv-warn-line); }
.icon-notify:hover { background-color: var(--alv-warn); border-color: var(--alv-warn); color: var(--alv-on-accent); }
.icon-color-notify { color: var(--alv-warn); }

/* ===== ALV-MAP-NOKEY v1 ===== */
/* The map draws from a keyed provider, and the key arrives from the
   environment. When it is absent the tile layer is not added at all and this
   notice covers the map box instead, because a map with no basemap is an
   empty grey square, and an empty grey square reads as a fault in the page
   rather than as a setting nobody has filled in. That distinction is not
   theoretical: the same four pages spent months drawing CARTO tiles with
   API KEY REQUIRED printed into every image, and it drew, so nobody looked.
   Absolute inside Leaflet's own container, above its tile panes. */
.alv-map-nokey {
    position: absolute;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    background: var(--alv-paper);
    color: var(--alv-ink-soft);
    border: 1px solid var(--alv-line);
    border-radius: var(--alv-radius-sm);
    font-size: .9rem;
}

/* ===== ALV FORM v1 ===== */
/* The entry-screen components: the panel, the field, the control, the
   label and the help text. Section 3.6 has named `input.form-control`
   since the standard was written and base DECLARED NONE OF IT, so 34 of
   the 62 entry screens wrote the rule out - in two dialects that disagree
   on border, radius and padding. Third time a round has found base
   reaching a class name but not its rule, and the biggest instance yet.

   THE MODEL SCREEN IS A HYBRID OF THE TWO DIALECTS: its border and radius
   come from one, its padding from the other. That is why it is the
   standard here - not one page's taste, but where the two halves of the
   system already agree.

   THE PANEL CARRIES THE MODEL SCREEN'S WASH, and the first version of
   this block did not. 22 of the 23 panels in the system were flat white
   and the gradient was one page, so the count said white and the count
   was answering the wrong question. The brief was never "what do most
   pages do"; it was "make the system look like New Customer Invoice".
   A majority is evidence about the present, not an argument about the
   standard - the label standard went against a 338-to-207 majority on
   purpose for exactly this reason.

   It cost six lines to correct because the panel lives here now. Before
   this block existed it would have cost 23 pages.

   NO FONT-WEIGHT ON THE LABEL. The label round put a strong element
   inside every field label; a weight here would be a second way to say
   the same thing, and the one that does not show in the markup.

   .form-group SETS ONLY ITS BOTTOM MARGIN. The model page makes it a flex
   column. A block box stacks a label over a control identically and
   cannot disturb the pages that put something unusual inside a field. */
.form-card {
    background: linear-gradient(135deg,
                var(--alv-surface) 0%, var(--alv-surface-deep) 100%);
    border: 1px solid var(--alv-line);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 22px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.form-section-title {
    color: var(--alv-ink);
    font-weight: 600;
    margin: 0 0 16px;
    font-size: 16px;
    padding-bottom: 9px;
    border-bottom: 2px solid var(--alv-accent);
}
.form-section-title i {
    color: var(--alv-accent);
    margin-right: 6px;
}

/* THE PHONE, and base owns both halves of it.
   `screen and` is not optional: base already carries one bare
   `@media (max-width: 768px)` that fires on paper, A4 portrait being about
   718 CSS px of content, and the print-leak round found it the hard way.

   PADDING. 20px 24px costs 48px of a 375px screen before a field starts.
   14px gives the fields 20px back - measured 293px -> 313px - and the panel
   still reads as a panel. The margin stays at 22px on purpose: at 16px the
   gap BETWEEN panels equals the 16px gap between fields inside one, which
   erases the grouping. Measured, not assumed. See Show-MobileForm.py.

   FONT-SIZE is not here, and that is deliberate. The iOS zoom guard -
   .form-control at 16px below 768px - lives ONCE, in the form-components
   rule further down. This block used to declare it a second time, written
   without noticing the first; the zoom-guard round removed the copy.

   It also said "62 pages had each written this rule locally" and that
   those were redundant. Measured, it was 72 rules on 60 pages, and a third
   of them were not: they guard controls with no .form-control class, which
   this rule never reaches. See Show-ZoomGuards.py. */
@media screen and (max-width: 768px) {
    /* FC-1, 11 Oct 2026 - AND THE RADIUS, SAID HERE RATHER
       than on twenty-one pages. base says 12px at every
       width above this; measured, 21 pages overrode that on
       a phone with 10px, 8px or 6px, so one component wore
       four corners. 8px is var(--alv-radius) and six of the
       twenty-one already said exactly it. The plurality was
       10px and was refused - it is not a token, and minting
       a third radius for one component is the case D-12
       closed.                   [test_form_card_radius.py] */
    .form-card    { padding: 16px 14px;
                    border-radius: var(--alv-radius); }
    .form-section-title small { display: block; font-size: 0.75rem; }
}

/* A SECTION TITLE CAN CARRY A QUIET NOTE, and until now only one page knew
   how. edit_asset's Photos heading reads "Photos (up to 5 per asset -
   JPG/PNG, 5MB each)" with the parenthetical in a <small>, and the page
   declared `.form-section-heading small { font-weight: 400; font-size:
   0.8rem }` to keep it from inheriting the heading's 600. Retiring that
   class without base picking the rule up would have rendered the note at
   full heading weight - found by printing the body of every rule this round
   deletes instead of only its selector. The component needs this; it is not
   one page's taste. */
.form-section-title small {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--alv-ink-soft);
}

/* D-4, 10 Oct 2026 - THE TWO-COLUMN FIELD ROW, said once.
   Twelve pages had written this out and eleven of them agreed
   character for character, down to the 18px/22px gap. The twelfth,
   crs/submission_detail, spelled the columns repeat(2, 1fr) and used
   a 14px gap; it adopts these values here, which is the only visible
   change in the round and was taken from a render.
   .form-group-full is the escape hatch the four CRS forms already
   used: one field spanning both columns. */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 22px;
}

.form-group-full { grid-column: 1 / -1; }

/* THE KEYWORD IS NOT OPTIONAL. A4 portrait is about 718 CSS px, so a
   bare max-width query fires on paper and prints the phone layout.
   Eight CRS pages do exactly that today; this one does not. */
@media screen and (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; gap: 14px; }
}

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    color: var(--alv-ink);
    font-size: 14px;
    margin-bottom: 6px;
}

/* LB-1, 10 Oct 2026 - THE BOLD IS ABSOLUTE, NOT RELATIVE.
   <strong> carries the browser's font-weight: bolder, and bolder is
   measured FROM THE LABEL: 400 gives 700, but 600 gives 900. Eighteen
   pages set 600 on the label and pushed their own labels two steps
   past the house without asking for it. Pinning the value here ends
   that class of accident - and it is on the strong rather than on the
   label because 67 labels in the corpus bold only their NAME and keep
   a hint beside it in normal weight. A weight on the label would
   flatten all 67. */
.form-group label strong,
.form-group label b { font-weight: 700; }

.form-control {
    width: 100%;
    background: var(--alv-paper);
    border: 2px solid var(--alv-line);
    border-radius: var(--alv-radius);
    padding: 9px 12px;
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus {
    border-color: var(--alv-accent);
    box-shadow: 0 0 0 3px var(--alv-accent-ring);
    outline: none;
}
.form-control[readonly],
.form-control:disabled {
    background-color: var(--alv-neutral-soft);
    color: var(--alv-ink-soft);
    cursor: not-allowed;
    opacity: 1;
}

.form-text {
    font-size: 12px;
    color: var(--alv-ink-soft);
    margin-top: 4px;
}

/* SCREEN AND, not a bare max-width. 16px stops iOS zooming the page when
   a control is tapped; a query with no screen keyword also fires on
   paper, where A4 portrait is about 718 CSS px. 35 pages carry exactly
   that. */
@media screen and (max-width: 768px) {
    .form-control { font-size: 16px; }
}

/* ALV SMALL CONTROLS v1 - EVERY TEXT CONTROL, not only the one class.
   The rule above reaches .form-control and nothing else. Rendering all
   128 pages that extend base at 375 wide found 64 text controls on 16
   pages still under 16px, so iOS zoomed on every one: 30 quantity boxes
   on the lease generator, filter dropdowns on Properties, Tenants and
   Physical Invoices, the Analysis year pickers, the Edit Issue fields,
   seven "Applies from" dates. Chromium's own cascade said the same of
   all 64 - the PAGE made it small, with a local rule or an inline style
   at 13-14px, which beats a plain base rule by coming later or by being
   written on the element.
   So this one is important, the only way a stylesheet outranks inline.
   It cannot make anything smaller: measured, no text control on any page
   is above 16px at 375. The desktop is untouched - screen, 768 and below.
   Checkboxes, radios, buttons, colour and file pickers are left out;
   iOS does not zoom on them. Keep the input selector on ONE line - a
   line break inside that chain is a descendant combinator.
   See Show-SmallControls.py and test_small_controls.py. */
@media screen and (max-width: 768px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]):not([type="image"]):not([type="range"]):not([type="color"]),
    select,
    textarea { font-size: 16px !important; }
}
/* /ALV SMALL CONTROLS v1 */

/* ALV CUSTOM CONTROL v1 - 4 Oct 2026 ------------------------------------
   Demetri, of the Generate Task List modal: "I don't like the Blue on the
   Radio Button. I want something within our theme."

   NOTHING HERE HAD EVER CLAIMED THIS COMPONENT. base.html carried zero
   rules naming .custom-control, so the dot in a selected radio and the
   tick in a ticked box were drawn by bootstrap 4.1.3 in #007bff - on
   thirteen controls across three pages: seven radios on projects_detail
   (Budget Copy Options, and the English/Greek pair Demetri was looking
   at), five checkboxes on celebration_management, one on view_meal_plan.

   --alv-accent, AND NOT BY TASTE. Its own definition two thousand lines
   up reads "the system's own colour: primary actions, selection", and a
   checked radio is selection. The focus halo is --alv-accent-ring, the
   same one .form-control:focus draws, so a radio and a text box answer
   the keyboard the same way.

   BOOTSTRAP WRITES THE CHECKED COLOUR THREE TIMES, AT TWO SPECIFICITIES,
   and the first version of this block only matched one of them:

       .custom-control-input:checked ~ ... ::before        0,2,1  #007bff
       .custom-radio    .custom-control-input:checked ~ …  0,3,1  #007bff
       .custom-checkbox .custom-control-input:checked ~ …  0,3,1  #007bff

   A single 0,2,1 rule beats the first and LOSES to the other two. The
   browser test in section 2 is what found it: the radio turned and the
   checkboxes stayed blue, while every text search in the suite passed.
   So the selectors below are matched one for one, per type, and a
   comma group keeps each member's own specificity.

   AND IT IS background-color, NOT border. These controls have no border
   in 4.1.3 - the box is a filled ::before - so a border-color on its own
   sets a colour on a border that is not drawn. That was the other half
   of the same mistake.

   IT WINS BY BEING LATER, never by shouting: bootstrap.min.css is linked
   at the top of this file, above every style block in it, which is the
   same mechanism the tab component relies on. No !important, so a page
   that genuinely needs a different control can still write one.

   WHAT IT REPLACED, named so it is never re-derived: #007bff (the
   checked fill, three times), rgba(0,123,255,.25) (the focus halo),
   #b3d7ff (the active press), rgba(0,123,255,.5) (disabled but
   checked, twice), #6c757d (the disabled label) and #e9ecef (the
   disabled box).
                                            [test_custom_control.py] */
.custom-control-input:checked ~ .custom-control-label::before,
.custom-radio .custom-control-input:checked ~ .custom-control-label::before,
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--alv-accent);
}
.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 1px var(--alv-paper), 0 0 0 3px var(--alv-accent-ring);
}
.custom-control-input:active ~ .custom-control-label::before {
    background-color: var(--alv-accent-soft);
}
.custom-control-input:disabled ~ .custom-control-label {
    color: var(--alv-ink-faint);
}
.custom-control-input:disabled ~ .custom-control-label::before {
    background-color: var(--alv-surface-deep);
}
.custom-radio .custom-control-input:disabled:checked ~ .custom-control-label::before,
.custom-checkbox .custom-control-input:disabled:checked ~ .custom-control-label::before,
.custom-checkbox .custom-control-input:disabled:indeterminate ~ .custom-control-label::before {
    background-color: var(--alv-accent-line);
}
/* /ALV CUSTOM CONTROL v1 */

/* ALV PRINT BUTTONS v1 - A BUTTON IS FURNITURE ON PAPER.
   base's print block names containers - the action bar, the mobile bar,
   modals - and a button anywhere else printed. Measured at A4 portrait
   width: 283 of them on 55 pages, from Help and Back to row actions,
   disabled placeholders, quick-set chips and view toggles.
   So every button goes, the three button input types with it. The one
   exception is a button that IS content: mark it print-keep and it
   prints. home's dashboard rows are the case this was written for -
   each row of a card is a button so a keyboard can click through it,
   and without the mark the cards would print empty.
   Measured before writing: only buttons and what is inside them leave
   the page; nothing else on any page moves. The screen is untouched.
   See test_print_buttons.py. */
@media print {
    button:not(.print-keep),
    .btn:not(.print-keep),
    input[type="submit"],
    input[type="button"],
    input[type="reset"] { display: none !important; }
}
/* /ALV PRINT BUTTONS v1 */

/* ALV MODAL HEAD v1 - ONE POP-UP HEADER.
   Measured 21 Sep: 87 modal headers in 16 looks, and base defined none. A
   delete confirmation was red on fourteen, white on two, grey on one.
   This is the teal banner the Issues, Help and preview pop-ups already
   wore, with a white title and a white close button; the danger variant
   is the same banner in red, for a pop-up that deletes something.
   The paint is important on purpose. Headers were painted by Bootstrap's
   own important colour classes, by page rules scoped to a modal's id and
   by inline styles, and the standard has to win over all three.
   See test_modal_heads.py. */
.alv-modal-head {
    background: linear-gradient(135deg, var(--alv-accent) 0%,
                var(--alv-accent-ink) 100%) !important;
    color: var(--alv-on-accent) !important;
    border-bottom: 0 !important;
    padding: 16px 20px !important;
    align-items: center;
}
.alv-modal-head--danger {
    background: linear-gradient(135deg, var(--alv-bad) 0%,
                color-mix(in srgb, var(--alv-bad) 78%, #000) 100%) !important;
}
.alv-modal-head .modal-title,
.alv-modal-head h1, .alv-modal-head h2, .alv-modal-head h3,
.alv-modal-head h4, .alv-modal-head h5, .alv-modal-head h6 {
    color: var(--alv-on-accent) !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    line-height: 1.3;
    margin: 0;
}
.alv-modal-head .modal-title i,
.alv-modal-head h5 i { color: inherit !important; margin-right: 8px; }
.alv-modal-head .close {
    color: var(--alv-on-accent) !important;
    opacity: 0.85 !important;
    text-shadow: none !important;
}
.alv-modal-head .close:hover { opacity: 1 !important; }
/* /ALV MODAL HEAD v1 */

/* ===== ALV MODAL OVERLAY v1 ===== 24 Sep 2026
   THE POP-UP THAT IS NOT BOOTSTRAP'S.

   home and notifications build their drill-down pop-up in JavaScript - a
   div with class="modal-overlay", written as a string - so there is no
   .modal-dialog for .alv-modal-head to hang on, and 3.9 could never have
   reached it. Both pages carried the same eleven rules, one copied from
   the other; home's own comment said so.

   DIFFED, not eyeballed: the two copies differed in exactly two ways.
   One is whitespace inside rgba(). The other is the phone height - home
   said 100dvh, notifications said 100vh - and 100vh is wrong on a phone,
   because a browser's address bar counts inside 100vh and is not part of
   the screen: the pop-up's bottom edge, and its last row, sit under the
   toolbar. home had already fixed it. This is home's.

   The header is the SAME gradient declaration as .alv-modal-head, so
   this pop-up and the 51 Bootstrap ones are ONE look; both copies spelt
   the accent #0e7c8b by hand. test_modal_overlay.py renders the two and
   fails if they ever stop matching.

   The class names are the pages' own, unchanged: the markup is built in
   a script, so base takes the RULES and the pages keep the NAMES -
   exactly the call D4 made for .filter-select.

   Two literals are deliberate. rgba(0,0,0,.5) is the backdrop and
   rgba(0,0,0,.3) its shadow: there is no token for a scrim, and neither
   is a colour of the palette. The 12px corner is a POP-UP's corner;
   --alv-radius is 8px and is the card's.
   See test_modal_overlay.py. */
.modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.modal-overlay .modal-content {
    background: var(--alv-paper);
    border-radius: 12px;
    max-width: 90vw; max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}
.modal-overlay .modal-header {
    background: linear-gradient(135deg, var(--alv-accent) 0%,
                var(--alv-accent-ink) 100%);
    color: var(--alv-on-accent);
    padding: 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-overlay .modal-title {
    margin: 0;
    font-size: 20px; font-weight: 600;
    display: flex; align-items: center; gap: 10px;
}
.modal-overlay .modal-close {
    background: none; border: none;
    color: var(--alv-on-accent);
    font-size: 24px; cursor: pointer; padding: 0;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
.modal-overlay .modal-close:hover {
    background: color-mix(in srgb, var(--alv-on-accent) 20%, transparent);
}
.modal-overlay .modal-body {
    padding: 20px;
    max-height: 70vh; overflow-y: auto;
}
@media screen and (max-width: 768px) {
    .modal-overlay { height: 100dvh; }
    .modal-overlay .modal-content {
        max-width: 100vw; max-height: 100dvh;
        width: 100vw; height: 100dvh;
        border-radius: 0;
        display: flex; flex-direction: column;
        padding-top: env(safe-area-inset-top, 0);
        padding-bottom: env(safe-area-inset-bottom, 0);
        box-sizing: border-box;
    }
    .modal-overlay .modal-header { padding: 14px 16px; flex-shrink: 0; }
    .modal-overlay .modal-title { font-size: 16px; }
    .modal-overlay .modal-body {
        padding: 14px; max-height: none;
        flex: 1 1 auto; overflow-y: auto;
    }
}
/* ===== /ALV MODAL OVERLAY v1 ===== */

/* ===== ALV AVATAR v1 ===== 25 Sep 2026
   The signed-in person, as a disc of their initials. FIVE copies of this
   existed - .sidebar-avatar and an inline style= in base itself,
   .member-avatar on workspace_edit, .user-avatar on user_administration
   and .photo-placeholder on my_profile - all painting the same purple
   gradient, all flex-centring the same white initials, at 32 / 36 / 38 /
   32 / 80 pixels.

   FOUR OF THE FIVE FAILED CONTRAST. The initials are 12-15px, so 4.5:1 is
   the bar, and #667eea - the light end of the gradient, the top-left half
   of the disc - measures 3.66 against white. (The 80px one is large text
   and passed at 3.0; said so it is not claimed as more than it was.)

   THE PAINT IS FLAT, AND THAT IS MEASURED. This disc sits on the sidebar,
   #343a40, so it has to carry white initials AND stay apart from what is
   behind it. The house gradient - accent to accent-ink, as .alv-modal-head
   wears - ends 11.7 from the sidebar, which is not far enough: the bottom
   of the disc would melt into it. The flat accent is 4.91 against its
   text and 20.9 from the sidebar.

   The size is a modifier, never a copy. The ring is a modifier too: it
   exists for the two that sit on a dark surface, where a disc needs an
   edge.
   See test_avatar.py. */
.alv-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--alv-accent);
    color: var(--alv-on-accent);
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.alv-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.alv-avatar--md { width: 36px; height: 36px; font-size: 13px; }
.alv-avatar--lg { width: 38px; height: 38px; font-size: 15px; }
.alv-avatar--xl {
    width: 80px;
    height: 80px;
    font-size: 28px;
    letter-spacing: 1px;
}
/* On a dark surface only - the sidebar and the mobile nav. On paper the
   ring is white on white and draws nothing. */
.alv-avatar--ring { border: 2px solid rgba(255, 255, 255, 0.3); }
/* ===== /ALV AVATAR v1 ===== */


/* ALV REPORT HEAD v1 - the title row every business report shares.
   Titles on the left, Back or a headline figure on the right. The title
   is a label, so capitals, in ink; the subtitle - a date, a period, the
   record - in the soft ink, a size down. ALIVENTE ONLINE sits above the
   title on paper only: since 8 Sep no heading carries the brand, and a
   printed or emailed report is the one place it is the content rather
   than chrome. On a phone the row stacks and centres. See
   test_report_head.py. */
.alv-report-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.alv-report-titles {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}
.alv-report-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--alv-ink);
    text-transform: uppercase;
    margin: 0;
    overflow-wrap: anywhere;
}
.alv-report-sub {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--alv-ink-soft);
    margin: 5px 0 0 0;
    overflow-wrap: anywhere;
}
.alv-report-brand { display: none; }
/* WHAT SITS BESIDE BACK - 30 Sep 2026. A report head holds titles and,
   on the right, Back. Payment Behaviour also carries a view switch -
   Include past tenants - which is navigation like Back rather than an
   action on the data, and it had been sitting in a toolbar below the
   summary strip, three scrolls from the thing it switches.

   A row, so the head keeps its two children and anything beside Back is
   laid out by one rule rather than by each page. Back inside this row is
   a flex item at its own width, which is what the phone rule below was
   arranging for when Back was a direct child.  [test_stats_fold.py] */
.alv-report-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
}
@media screen and (max-width: 768px) {
    .alv-report-head {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
    }
    .alv-report-titles { align-items: center; text-align: center; }
    .alv-report-title { font-size: 1.25rem; }
    .alv-report-sub { font-size: 1rem; }
    .alv-report-head > .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
        padding: 10px 12px;
    }
    /* EXCEPT BACK - 30 Sep 2026. Demetri, testing on a phone, wrote
       "Back button" against four report screens in a row.

       The rule above stretches every button in the head to the full
       width and centres it, which is right for a headline figure and
       wrong for Back. Back is the one control in this system that is
       deliberately BORDERLESS - transparent background, transparent
       border, quiet on purpose. Measured at 390px it came out 362px
       wide, centred, and invisible: a line of centred text with an
       arrow in front of it, sitting under the date.

       So Back keeps its own width and goes to the right of the column -
       which is where it sits on a desktop, where it sits in every
       action bar, and where base's own phone rule for an action bar
       puts it. The 44px target is untouched.

       EIGHT REPORT PAGES, AND NOT ONE OF THEM IS EDITED. Every one
       already writes the markup 3.10 asks for.
                                             [test_report_back.py] */
    .alv-report-head > .btn.back-button,
    .alv-report-head > .btn.action-back {
        width: auto;
        align-self: flex-end;
    }
    /* The head is a column here, and .alv-report-actions is stretched
       across it like any other child - so the row it draws runs the full
       width of the phone with its first child left and Back right, which
       is what Demetri asked for. 30 Sep 2026. [test_stats_fold.py] */
    .alv-report-actions {
        justify-content: space-between;
        width: 100%;
    }
}
@media print {
    .alv-report-brand {
        display: block;
        margin: 0 0 4px 0;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.14em;
        color: var(--alv-accent-ink);
    }
}
/* /ALV REPORT HEAD v1 */

/* ALV APPLIES v1 - the date a Financials figure takes effect from, and
   the two ways to stop one. The panel sits under an entry form: a soft
   surface, the accent rule down its left edge, the label in ink with the
   calendar mark in the accent, the date as base's own field kept narrow,
   and the guidance under it in the soft ink. The choice cards are the two
   radios a delete pop-up offers - stop it from a date, the calm one, in
   the accent; remove it completely, which cannot be undone, in the bad
   colour. Their note and their date line indent to clear the radio. See
   test_applies_from.py. */
.alv-applies {
    background: var(--alv-surface);
    border: 1px solid var(--alv-line);
    border-left: 4px solid var(--alv-accent);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 18px;
}
.alv-applies > label {
    display: block;
    font-weight: 600;
    color: var(--alv-ink);
    margin-bottom: 6px;
}
.alv-applies > label > i { color: var(--alv-accent); }
.alv-applies > .form-control { max-width: 220px; }
.alv-applies-help {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: var(--alv-ink-soft);
    line-height: 1.5;
}
.alv-choice {
    display: block;
    border: 1px solid var(--alv-line);
    border-left: 4px solid var(--alv-accent);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: 400;
}
.alv-choice:last-child { margin-bottom: 0; }
.alv-choice--danger {
    border-color: color-mix(in srgb, var(--alv-bad) 30%, var(--alv-paper));
    border-left-color: var(--alv-bad);
}
.alv-choice--danger > strong { color: var(--alv-bad); }
.alv-choice-note {
    display: block;
    margin: 6px 0 0 22px;
    font-size: 13px;
    color: var(--alv-ink-soft);
}
.alv-choice-when {
    display: block;
    margin: 10px 0 0 22px;
    font-size: 13px;
    color: var(--alv-ink-soft);
}
.alv-choice-when > .form-control {
    display: inline-block;
    width: auto;
    margin-left: 6px;
    padding: 6px 10px;
}
/* /ALV APPLIES v1 */

/* ===== ALV PAGE HEADING v1 ===== */
/* The three classes base's own standards block is written in, which base
   did not declare until now. Every page that wanted one wrote it out: 33
   copies of the h2 rule, 26 of the subtitle, 12 of the form bar.

   THE BOTTOM MARGIN IS CONDITIONAL, and that is the whole of the apparent
   drift. The gap closes when a subtitle follows the heading and opens when
   nothing does - thirty pages worked that out one at a time, and five got
   it wrong. Said once, here, it cannot be got wrong again.

   The subtitle takes --alv-ink-soft. Six pages painted it #6c757d, which
   is Bootstrap's grey and belongs to no palette this project defines. A
   mode label under a module name should be the quieter of the two, which
   is what the shape-B round decided in words. */
.page-title-h2 {
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}
.page-title-h2:has(+ .page-subtitle-h4) { margin-bottom: 0; }
/* AND THE SAME FOR THE OTHER SUBTITLE. G3a put twelve pages onto
   .page-title-h2 whose next line is an h5, and this selector did not know
   about the h5 - so the gap the rule exists to close stayed open on every
   one of them. Named separately rather than in a list, because :has()
   with a comma inside is read as "has any of these DESCENDANTS" by more
   than one minifier, and this is a sibling test. */
.page-title-h2:has(+ .page-subtitle-h5) { margin-bottom: 0; }

/* THE LINE UNDER THE BAR. A page that has to say what it is FOR
   has nowhere house to say it: .page-subtitle-h4 is a MODE label -
   ADD NEW PROPERTY - and 37 of its 38 wearers are two or three
   capitalised words. So five pages each invented a name for this
   one sentence and base declared none of them:

       .sub-note   household_member_management   12px  #6c757d
       .an-note    act_expense                   12px  #495057
       .pd-note    tenant_payment_days           .85rem #7f8c8d
       .ia-hint    fsr (in a chart modal)        12px  accent, bold

   This is the first two of those, which are the same thing. It
   sits BELOW the action bar, not above it: the title and the
   controls are what every screen has, and the explanation is what
   this screen adds. */
.page-note {
  font-size: 12px;
  color: var(--alv-ink-soft);
  margin: 14px auto 1rem;
  text-align: center;
  /* A SENTENCE, NOT A LABEL. Centred and unconstrained it ran 966px
     across at 12px on a 1280px screen - measured - which is about 150
     characters to a line and reads as a caption stretched to fit.
     Capped so it wraps as a paragraph; the cap is inert below it, so a
     phone is unaffected. */
  max-width: 68ch;
}


.page-subtitle-h4 {
    text-align: center;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    color: var(--alv-ink-soft);
}

/* THE DESCRIPTIVE LINE, DECLARED AT LAST - 30 Sep 2026.
   The standards block above has said since 8 Sep that an h5 holds a
   SENTENCE describing the page, where the h4 holds a mode label - and
   base gave the h4 a class and the h5 nothing. So thirteen lines on
   twelve pages centred themselves with a center tag, took no colour
   from the palette, and sat outside every phone rule base has: 20px
   where its own sibling is 16px, measured at 390.

   IDENTICAL TO THE h4 ON PURPOSE. What separates the two is the TAG and
   the words, not the treatment - a subtitle is a subtitle. The h5 is
   already the smaller of the two before either rule applies.

   lease_timeline had invented this class locally and painted it #6c757d,
   Bootstrap's grey. That rule is gone; its two size overrides are not,
   and the suite says why.                    [test_subtitle_h5.py] */
.page-subtitle-h5 {
    text-align: center;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    color: var(--alv-ink-soft);
}

/* A BAR HOLDING ONLY A BACK BUTTON right-aligns it. Three pages declared
   this identically and base declared nothing.

   IT IS NOT THE VARIANT RETIRED YESTERDAY, though the declaration is the
   same. That one was inert because its bar carried a primary button which
   ate the free space, leaving justify-content nothing to distribute. A bar
   holding only Back has free space, and below 768px base removes the auto
   margin that would otherwise push it right - so without this the lone
   Back jumps to the left edge on a phone. Measured both ways at 1040px and
   400px. Same declaration, opposite verdict, and what decides it is what
   else is in the bar. */
.page-action-buttons-single { justify-content: flex-end; }

/* THERE IS ONE ACTION BAR. A .page-action-buttons-form variant lived here
   and was inert: its justify-content lost to the auto margin base puts on
   .action-back, which is on every entry screen. Measured in Chromium at
   three widths and three button counts before it was removed. A class that
   changes nothing is drift wearing a standard's clothes. */

/* SCREEN AND, not a bare max-width. A4 portrait is about 718 CSS px, so a
   bare query fires on paper and prints every report with a phone-sized
   heading. Nineteen pages carried exactly that around these three classes;
   their copies went with this round. */
@media screen and (max-width: 768px) {
    .page-title-h2    { font-size: 1.25rem; }
    .page-subtitle-h4 { font-size: 1rem; margin-bottom: 0.75rem; }
    .page-subtitle-h5 { font-size: 1rem; margin-bottom: 0.75rem; }

}
/* ===== ALV POP v1 ===== 2 Oct 2026
   A list that opens from a cell - "12 ingredients", clicked, showing which
   twelve. Two pages carried this, byte for byte identical, under two
   names: .ingredient-popup on Categories and .usage-popup on Measurement
   Units.

   WHY IT IS FIXED AND NOT ABSOLUTE, which is the bug Demetri found. The
   popup lived inside .table-container, and that container is
   `overflow: clip` ON PURPOSE - it is what gives a sticky heading
   something to stick to, and base measured the difference (with `hidden`
   the heading floated 615px above the viewport; with `clip` it pins at
   top: 0). An absolutely-positioned child is POSITIONED by its nearest
   positioned ancestor but CLIPPED by any ancestor that clips, so the list
   was cut at the container's edge - worst for the rows nearest the top,
   which is exactly what the screenshots showed.

   Two correct decisions colliding, not a mistake in either. `fixed` is
   positioned against the viewport, so no ancestor's overflow can reach it.

   THE SCRIPT PLACES IT; THESE RULES ONLY PAINT IT. top/left are written
   on the element at open time, measured from the trigger, and the arrow
   flips with .alv-pop--below when there is no room above.
                                                    [test_fixed_popup.py] */
.alv-pop-trigger {
    cursor: pointer;
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--alv-radius-sm);
    transition: background 0.2s;
}
.alv-pop-trigger:hover { background: var(--alv-surface-deep); }

.alv-pop {
    display: none;
    position: fixed;
    /* TOKENS, NOT LITERALS. The two page copies painted this #2c3e50
       on #fff. Carrying those into base would have been four new literal
       colours in the one file whose whole job is to have none -
       test_meal_row.py counts them and said so: 134 -> 138. --alv-ink is
       the system's own dark, a shade deeper and less blue, and --alv-paper
       is the white it already pairs with everywhere else. */
    background: var(--alv-ink);
    color: var(--alv-paper);
    padding: 12px 16px;
    border-radius: 10px;
    min-width: 180px;
    max-width: 280px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1200;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.alv-pop::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-top-color: var(--alv-ink);
}
.alv-pop--below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--alv-ink);
}
.alv-pop.show { display: block; animation: alvPopIn .2s ease; }
@keyframes alvPopIn {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}
.alv-pop-list { list-style: none; padding: 0; margin: 0; }
.alv-pop-list li {
    padding: 5px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.alv-pop-list li:last-child { border-bottom: none; }
.alv-pop-empty { font-size: 13px; opacity: .75; }
@media screen and (max-width: 768px) {
    .alv-pop { max-width: 90vw; min-width: 200px; }
}
/* ===== /ALV POP v1 ===== */
/* ===== ALV LANDING TABS v1 - TB-1, 8 Oct 2026 =================================
   ONE TAB TREATMENT, FOR EVERY LANDING PAGE THAT WEARS ONE.

   NOT TO BE CONFUSED WITH ALV TABS v1 ABOVE. That one is .alv-tab and
   .nav-tabs .nav-link - panel-level tabs, several views of ONE panel,
   the bar sitting directly above the thing it controls. This one is
   .admin-tab: the big folder tabs on a module landing page, each with
   a grid of tiles behind it. Two different components, both called
   tabs, and the only thing that keeps them apart is that somebody
   wrote this paragraph.

   Administration and Personal each carried a copy of this, and the two
   had already drifted in ten rules - eight of them in the mobile block,
   none of them chosen by anybody. Finance was about to be the third.

   A PAGE SUPPLIES TABS AND PANELS; THIS SUPPLIES THE LOOK. The markup
   a page needs is:

     <div class="admin-tabs">
       <div class="admin-tab active" id="tab-x" onclick="...">..</div>
       <div class="admin-tab"        id="tab-y" onclick="...">..</div>
     </div>
     <div class="tab-content-container">
       <div id="x-panel" class="tab-panel active"> .admin-grid of
                                                   .admin-btn </div>
       <div id="y-panel" class="tab-panel">        ..          </div>
     </div>

   There is no family class and no per-page token. A page that wants a
   tab a different colour overrides these rules on the page, and should
   write down why - the System tab was grey for nine days because
   somebody did that and the reason outlived the decision.
   ====================================================================== */

.admin-tabs {
    display: flex;
    max-width: 900px;
    margin: 0 auto;
    justify-content: flex-start;
}

.admin-tab {
    flex: 0 0 auto;
    width: 200px;
    padding: 15px 25px;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    border: 3px solid;
    border-radius: 10px 10px 0 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    margin-bottom: -3px;
    z-index: 1;
    border-color: var(--alv-accent);
    border-bottom-color: var(--alv-accent);
    color: var(--alv-accent);
    background-color: var(--alv-paper);
}

/* THE SHARED EDGE, DERIVED RATHER THAN DECLARED.
   `border-right: none` says "my right-hand neighbour draws this line",
   so it belongs to every tab that HAS one - which is every tab but the
   last. Written out by name it cost two defects on the same page ten
   days apart: P6 on 29 Sep, when P2 removed the neighbour and left the
   tab open on its right, and PR-1 this morning, when a new tab
   inherited the declaration and had no neighbour of its own.
   The browser can count. Let it. */
.admin-tab:not(:last-child) {
    border-right: none;
}

.admin-tab.active {
    background-color: var(--alv-accent-soft);
    border-bottom-color: var(--alv-accent-soft);
    color: var(--alv-accent);
    z-index: 10;
}

.admin-tab:not(.active):hover {
    background-color: var(--alv-accent-soft);
}

.tab-content-container {
    max-width: 900px;
    margin: 0 auto;
}

.tab-panel {
    display: none;
    padding: 30px;
    border: 3px solid;
    border-radius: 0 10px 10px 10px;
    animation: fadeIn 0.3s ease;
    border-color: var(--alv-accent);
    background-color: var(--alv-accent-soft);
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.admin-btn {
    height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    color: var(--alv-on-accent);
    background-color: var(--alv-accent);
    border: none;
    /* THE SAFER OF THE TWO, NOT BLINDLY ADMINISTRATION'S. personal.html
       had `padding: 12px; text-align: center` here and admin_apms had
       neither; the h6 line-height was the same story. Nothing wraps
       today on either page, so taking Administration's would have cost
       nothing visible - and the first long label somebody adds would
       have touched the tile edge. Where one copy is more defensive than
       the other, the drift is resolved toward the defensive one and
       said out loud. */
    padding: 12px;
    text-align: center;
}

.admin-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    color: var(--alv-on-accent);
    background-color: var(--alv-accent-ink);
    text-decoration: none;
}

.admin-btn i {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.admin-btn h6 {
    margin: 0;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

@media screen and (max-width: 768px) {
    .admin-tabs { padding: 0 4px; }
    .admin-tab {
        flex: 1 1 0;
        width: auto;
        padding: 11px 8px;
        font-size: 0.9rem;
        gap: 6px;
    }
    .admin-tab i { font-size: 1rem; }
    .tab-panel {
        padding: 16px;
        border-radius: 0 8px 8px 8px;
    }
    .admin-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .admin-btn {
        height: 110px;
        padding: 12px;
    }
    .admin-btn i {
        font-size: 2rem;
        margin-bottom: 8px;
    }
    .admin-btn h6 {
        font-size: 0.95rem;
        line-height: 1.2;
    }
}
/* ===== /ALV LANDING TABS v1 ===== */

/* ===== THE TOAST - AP-1, 20 Oct 2026 =============================
   A thing that happened, said without taking the page away, and a
   chance to put it back.

   IN BASE, because base owns the shared furniture: .modal-overlay,
   .alv-modal-head and RD-2's chip menu are all here, and base's own
   note records what it cost the last time a screen kept a private
   copy of one. Nothing about this is specific to recipes.

   IT IS NOT django messages. Those arrive with a page render, and
   the whole point of Demetri's answer - "stay put, with a toast and
   an Undo" - is that no page is rendered.

   NO COLOUR HERE THAT IS NOT A TOKEN. */
.alv-toast-dock {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* THE DOCK IS NOT A TARGET, only the toasts in it - otherwise an
       invisible strip across the foot of every page would eat clicks
       meant for whatever is under it. */
    pointer-events: none;
}
.alv-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: min(92vw, 520px);
    padding: 12px 16px;
    border-radius: var(--alv-radius-sm);
    background: var(--alv-ink);
    color: var(--alv-on-accent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
    font-size: 14px;
    line-height: 1.35;
}
.alv-toast-text { flex: 1 1 auto; }
.alv-toast-undo {
    flex: 0 0 auto;
    border: 0;
    background: none;
    color: var(--alv-on-accent);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    /* 44px, because it is a thumb target and it is the control that
       takes something back. */
    min-height: 44px;
    padding: 0 6px;
}
.alv-toast-undo:focus-visible {
    outline: 2px solid var(--alv-on-accent);
    outline-offset: 2px;
}
/* AND screen, NOT a bare max-width - a clause naming no media type
   matches print too, which test_print_queries has enforced since the
   21 September print-leak round. */
@media screen and (max-width: 767px) {
    .alv-toast-dock {
        left: 12px;
        right: 12px;
        bottom: 12px;
        transform: none;
    }
    .alv-toast { max-width: none; }
}
@media (prefers-reduced-motion: no-preference) {
    .alv-toast { animation: alv-toast-in 160ms ease-out; }
}
@keyframes alv-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}



