/* ==========================================================================
   Manila -- interface stylesheet
   ==========================================================================

   This is the application's one first-party stylesheet. It defines the design
   system the rest of the interface is built from, in a fixed reading order.
   Later rules only ever override earlier ones at equal specificity, so a
   change belongs in the section that owns the thing being changed.

     1.  Design tokens          the single source of every colour, size and step
     2.  Base                   document defaults and focus
     3.  Shell and page frame   header band, main column, footer, page heading
     4.  Primitives             section, row and surface building blocks
     5.  Buttons and controls   the button levels and their hit target
     6.  Forms and fields       labels, inputs, choices, toggles
     7.  Tables                 record tables and their scroll region
     8.  Overlays               dialogs and the destructive confirm
     9.  Sign-in                the standalone login page
     10. Icons                  the self-hosted icon sprite's rendering rules
     11. GTD views              the seven views, cards, filter bar and action rows
     12. Dashboards             the shared record-dashboard layout
     13. Notepad and notes      the notepad list, card grid and note page
     14. Agenda and events      the agenda page and an event's own page
     15. Calendar               the calendar page over the vendored library
     16. Checklists             the checklist editor, runs and run page
     17. Third-party overrides  tom-select, Overtype, the vendored dialog CSS
     18. Responsive            every narrow-viewport rule, in one place
     19. Motion                reduced-motion and animation preferences

   Two rules govern everything below.

   Hierarchy comes from type, space and rules before it comes from borders.
   A rule (a one-pixel line) separates related things; a border (a four-sided
   box) is reserved for a genuinely discrete object, and boxes do not nest
   inside boxes.

   No component hardcodes a colour, a font size, a radius or a spacing value.
   Every one of those is a token in section 1, so the whole interface moves
   together when a token changes.

   Established by the interface-foundation redesign (task 066). Behaviour,
   routes and markup are unchanged by this stylesheet: it restyles the classes
   the application already renders.
   ========================================================================== */

/* ==========================================================================
   1. Design tokens
   --------------------------------------------------------------------------
   Every value below is named for what it is for, not for where it is used.
   ========================================================================== */

:root {
  /* Type: five steps, from the brief's five sizes. A page title is the one
     large step; a section heading and a row title are the two middle ones;
     metadata is deliberately small so a row's own title dominates it. */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* The wordmark face (task094). Fraunces is self-hosted (see the @font-face
     below and public_html/assets/brand/); the fallbacks are what the wordmark
     reads in before the one subset arrives, and on a browser that refuses it. */
  --font-display: "Fraunces", Georgia, serif;
  --text-wordmark: 1.4375rem;
  /* The mark in the brand link, and the gap between it and the word, are the
     artboard's own values (28px and 10px; task094). */
  --brand-mark: 1.75rem;
  --brand-gap: 0.625rem;
  /* The same brand, scaled down together for the widths where the band is at
     its tightest (see 18. Responsive; task094). The artboard's proportions are
     kept -- the mark still leads the word -- but the pixels are not; they are
     as large as the one-line promise leaves room for. */
  --text-wordmark-compact: 0.875rem;
  --brand-mark-compact: 1.125rem;
  --brand-gap-compact: 0.375rem;
  --text-page-title: clamp(1.875rem, 3.2vw, 2.125rem);
  --text-section: 1.25rem;
  --text-subsection: 1.125rem;
  --text-row-title: 1rem;
  --text-body: 1rem;
  --text-label: 0.875rem;
  --text-meta: 0.8125rem;
  --text-micro: 0.75rem;
  --leading-title: 1.2;
  --leading-body: 1.5;

  /* Space: a seven-step scale, each step about half again the one before it.
     Small gaps pair related things; large gaps separate sections. */
  --space-0: 0.25rem;
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.25rem;
  --space-6: 3.5rem;

  /* Layout and targets. The minimum target is the smallest a control may be. */
  --layout-width: 76rem;
  --target-min: 44px;
  --preview-clamp: 12rem;
  /* A row or card in a list shows a few lines of a rendered description, not
     the whole of it, so one long capture cannot grow the list (task 099 R1). */
  --row-preview-clamp: 5rem;
  /* A create dialog is wide enough for the densest widget it holds -- an
     event's time controls with recurrence switched on -- so nothing on one
     line is squeezed or scrolls sideways. The vendored sheet's 700px cap is
     overridden with this, not edited into it (section 17). */
  --dialog-width: 60rem;

  /* Structure: navy carries the frame, cream and warm white the workspace,
     pale grey the quiet fills. Ink and muted are the two text weights. */
  --navy: #14243a;
  --navy-dark: #0d1a2b;
  --navy-light: #233956;
  --cream: #f6f2ea;
  --warm-white: #fdfcf9;
  --pale-grey: #e9ebee;
  --surface: #ffffff;
  --canvas: var(--cream);
  --ink: #19212b;
  --muted: #57616e;
  --on-navy: #ffffff;
  --nav-link: #eaf1f7;
  --nav-divider: rgb(255 255 255 / 25%);

  /* Lines, controls and interaction. --line separates regions, --rule
     separates rows inside one region, --control-line outlines a field. */
  --line: #ccd2d9;
  --rule: #dfe3e8;
  --control-line: #78848f;
  --link: #105485;
  --hover-surface: #eef3f7;
  --focus: #003f70;

  /* The mark behind the matched text in a search snippet (task088). It is a
     highlight surface the ink already sits legibly on, not a status: it marks
     where the query matched and nothing else. */
  --highlight-surface: #fdf0b5;

  /* Semantic status. Each colour is a pair: the ink for text, the surface it
     sits on. The meaning of each pair is documented in docs/architecture.md;
     they are defined here and applied only where the markup already carries a
     status, never invented per page. */
  --danger: #8c1f1f;
  --danger-surface: #fbe6e4;
  --status-overdue-ink: #8c1f1f;
  --status-overdue-surface: #fbe6e4;
  --status-waiting-ink: #6d4a00;
  --status-waiting-surface: #f9edd2;
  --status-active-ink: #1c5b32;
  --status-active-surface: #dcefe1;
  --status-someday-ink: #463576;
  --status-someday-surface: #ece7f6;
  --status-scheduled-ink: #105485;
  --status-scheduled-surface: #dfeaf4;
  --status-neutral-ink: #33404f;
  --status-neutral-surface: #e7eaee;
  --status-destructive: var(--danger);

  /* Radii: restrained. A control is barely rounded, a surface a little more,
     and only a pill or a switch is fully round. */
  --radius-sm: 4px;
  --radius: var(--radius-sm);
  --radius-pill: 999px;
  --radius-round: 50%;

  /* Elevation: one shadow for a floating panel, one for a quiet lift. */
  --shadow-card: 0 1px 2px rgb(20 36 58 / 6%);
  --shadow-popup: 0 6px 16px rgb(20 36 58 / 18%);
  --shadow-toast: 0 8px 20px rgb(20 36 58 / 30%);
}

/* The one wordmark face, self-hosted (task094). Fraunces 600 is served from
   `public_html/assets/brand/` (Fontsource `@fontsource/fraunces` 5.3.0, SIL
   Open Font License 1.1, `LICENSE.fraunces` beside it) and requested for the
   wordmark alone. `font-display: swap` draws the fallback immediately and
   swaps the one subset in when it arrives; nothing is fetched from another
   origin. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/brand/fraunces-latin-600-normal.woff2") format("woff2");
}

/* ==========================================================================
   2. Base
   --------------------------------------------------------------------------
   Document defaults. Nothing here is page-specific.
   ========================================================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  /* The page is a column, at least as tall as the window, so the tail below
     (see the footer's own rule) has somewhere to grow into (task094). The
     header, the main column and the footer are its three in-flow children and
     lay out exactly as they did as blocks. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

/* A control inherits the typography around it rather than the browser's. */
button,
input,
select,
textarea {
  font: inherit;
}

/* Links carry the one link colour; a long URL may break anywhere. */
a {
  color: var(--link);
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--navy);
}

/* One focus treatment for the whole interface, visible on every surface. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ==========================================================================
   3. Shell and page frame
   --------------------------------------------------------------------------
   The site header band, the main column and the footer. The navigation inside
   the header is styled in section 5's neighbourhood but its layout is the
   shell's: it wraps rather than scrolling.
   ========================================================================== */

.site-header {
  background: var(--navy);
  color: var(--on-navy);
  border-bottom: 1px solid var(--navy-dark);
  /* The header owns its own layer, so an open navigation menu is drawn above
     the page it overlaps rather than underneath it. The bundled Markdown editor
     is the case that forced this (task081 item 2): its toolbar carries
     `z-index: 100` and its container and wrapper both leave `z-index` auto, so
     the toolbar competes in the root stacking context and covered the menu.
     A stacking context here settles every header popup at once, now and later,
     instead of each one needing a raised value; its own panels keep their
     relative order inside it. 150 is above the editor's in-field layers (100)
     and below a dialog (199), which must still cover the header -- and the
     vendored editor is not edited to achieve this (section 17). */
  position: relative;
  z-index: 150;
}

.site-header__inner {
  width: min(100% - 2rem, var(--layout-width));
  margin: auto;
  min-height: 4rem;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* The brand is the Manila mark beside the word "Manila" in Fraunces 600
   (task094). It reads as one link, so the mark and the word are laid out with the
   artboard's own 10px gap; the mark is 28px and the word 23px, both below the
   band's own 4rem minimum height, so the brand cannot grow the header bar. The
   mark is decoration and the word is the visible name; the link's accessible
   name comes from its `aria-label`, so assistive technology hears exactly one
   "Manila home" rather than the mark and the word twice. */
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--brand-gap);
  color: var(--on-navy);
  font-family: var(--font-display);
  font-size: var(--text-wordmark);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}

.site-brand__mark {
  width: var(--brand-mark);
  height: var(--brand-mark);
  flex: none;
}

.site-brand__word {
  white-space: nowrap;
}

/* The brand is drawn on the navy band, so the global `a:hover`
   (`color: var(--navy)`) would paint "Manila" navy on navy -- unreadable, and
   the same fault on keyboard focus. Task 097 keeps the band's own `--on-navy`
   ink here and shows the hover/focus state as an underline instead, which is a
   cue the colour change was standing in for. */
.site-brand:hover,
.site-brand:focus-visible {
  color: var(--on-navy);
  text-decoration: underline;
}

/* At desktop widths the row and the band are one line, so neither wraps: the
   row's own line is the owner's daily workflow (task067) and a second line is
   a regression rather than a collapse. Below `72rem` -- where the band is at
   its narrowest and the navigation becomes the menu toggle -- both wrap again,
   which is what the `72rem` block restores. The search field is the flex item
   that yields to keep the promise: it carries `min-width: 0`, so the squeeze
   lands on the field and never on the row's destinations. */
.primary-navigation {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  gap: 0.15rem;
  align-items: center;
}

.primary-navigation a {
  color: var(--nav-link);
  text-decoration: none;
  padding: 0.65rem 0.7rem;
  border-radius: var(--radius-sm);
}

.primary-navigation a:hover,
.primary-navigation a[aria-current="page"] {
  background: var(--navy-light);
  color: var(--on-navy);
}

/* The current page is marked by weight and a rule under the label, so it reads
   without relying on colour alone. */
.primary-navigation a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--on-navy);
  font-weight: 700;
}

/* Focus inside the navy band needs a light ring to stay visible. The Quick Add
   disclosure's own *items* are the exception: each is a link on the popup
   surface, not on the band, so it takes the application's ink-on-light ring
   instead (task046). The rule is scoped to those items and not to the whole
   menu, because the menu also holds the caret -- a light chip on the band, whose
   ring is drawn against the band and so needs the light ring like any other
   header control. */
.site-header :focus-visible {
  outline-color: var(--on-navy);
}

.site-header .nav-quick-add__menu .gtd-menu__item:focus-visible {
  outline-color: var(--focus);
}

/* The navigation row and its "More" disclosure (task067). The row is the
   owner's daily workflow; everything else -- the labelled browse routes and
   every module's index page -- is inside the disclosure. A collapsed panel is
   `display: none`, taken from the trigger's own `aria-expanded`, so it is out
   of the tab order and out of the accessibility tree without a second source of
   truth that could disagree with what assistive technology is told. */
.primary-navigation__row {
  display: flex;
  flex: 1 1 auto;
  /* The row's floor is its own one-line width, not the width of its longest
     word: without this a squeeze would shrink the row and wrap a label inside
     its own item ("Someday" on two lines), which is a second line even though
     the row itself never wrapped. */
  min-width: max-content;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-more {
  position: relative;
}

.nav-more__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: var(--target-min);
  padding: 0.65rem 0.7rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--nav-link);
  font: inherit;
  cursor: pointer;
}

.nav-more__trigger:hover,
.nav-more__trigger[aria-expanded="true"],
.nav-more__trigger[aria-current="true"] {
  background: var(--navy-light);
  color: var(--on-navy);
}

/* The current page inside "More" is marked the way the row marks one: weight
   and a rule under the label, so it reads without relying on colour alone. */
.nav-more__trigger[aria-current="true"] {
  box-shadow: inset 0 -2px 0 var(--on-navy);
  font-weight: 700;
}

/* Need to reduce padding around submenu items.*/
.primary-navigation .nav-more a {
  padding: 0.1rem 0.7rem;
}

/* A navigation icon sits beside its label, spaced by one type step so it scales
   with the text and never by a fixed pixel size (task091). The icon is
   decoration and the label beside it is the link's name. */
.primary-navigation a .icon {
  margin-right: 0.4em;
}

/* The desktop navigation row is text only (task091, owner decision of
   2026-09-29). The row's links carry their icons anyway, because the phone list is
   the very same elements (task090's one flat list), so on a wide screen the
   icon is hidden rather than left out -- which is also what keeps the row's
   wrap point and the 62rem breakpoint exactly where task088 and task090
   measured them. The "More" panel's own items keep theirs: they are not
   `.primary-navigation__row > li > a`. */
.primary-navigation__row > li > a .icon {
  display: none;
}

/* A chevron that turns as the disclosure opens. It is decoration: the button's
   own label and its `aria-expanded` carry the meaning. */
.nav-more__trigger::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.15rem) rotate(45deg);
}

.nav-more__trigger[aria-expanded="true"]::after {
  transform: translateY(0.1rem) rotate(225deg);
}

.nav-more__panel {
  display: none;
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 20;
  min-width: 13rem;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  border: 1px solid var(--nav-divider);
  border-radius: var(--radius);
  background: var(--navy-dark);
  box-shadow: var(--shadow-popup);
}

.nav-more__trigger[aria-expanded="true"] + .nav-more__panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* The global Quick Add control in the header band (task046). It is the
   header's one creation action, so it reads as one control: a light box
   carrying the `plus-lg` icon for the default destination -- "Quick add
   Capture", named by its accessible name and tooltip rather than by a word
   beside the glyph (task088 owner scope change) -- and, beside it, a caret
   that opens the same light surface holding the other destinations. The caret
   is a second control rather than part of the primary action, so the two are
   separated by the row's own gap -- two facts on one line are never allowed to
   touch (the interface rule task066/077 measures). The disclosure reuses the
   row's own `.gtd-menu` building block and its chevron, so the control needs
   no glyph of its own beyond the `plus-lg` in the primary action.
 *
 * It lives on the band rather than inside `.primary-navigation`, so it is
 * visible at every width: the navigation is what collapses into the menu toggle
 * on a phone, and a creation action that vanished with it would not be the
 * global one the task asks for. `margin-left: auto` keeps it at the band's end
 * on a wide screen, beside the sign-out form. */
.nav-quick-add {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  gap: 0.15rem;
}

/* The summary shows no word of its own, so its chevron is the disclosure's
   only mark and its accessible name comes from `aria-label`/`title` -- the same
   arrangement the primary action beside it now uses for its icon. Its surface,
   ink and padding are the ones `.gtd-control` already sets, so nothing here
   restates them: the only rule of this control's own is the 44px minimum width
   a target needs. */
.nav-quick-add__more {
  justify-content: center;
  min-width: var(--target-min);
}

.nav-quick-add__more:hover,
.nav-quick-add__more[aria-expanded="true"] {
  background: var(--hover-surface);
  color: var(--navy);
}

/* The primary action is an icon button (task088 owner scope change,
   2026-09-29). It was a chip naming its destination in words, which cost the
   band the width of a label; the row needs that width back for the two
   reading surfaces the owner wants beside the workflow destinations and for
   the search field. The `plus-lg` icon says "create" without a word, so the
   control's accessible name and its tooltip are what name the destination --
   "Quick add Capture" -- and those are on the element, not drawn beside it.
   Its size, padding and radius keep it the same target the chip was. */
.nav-quick-add__primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--target-min);
  min-height: var(--target-min);
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--warm-white);
  color: var(--navy);
  font-size: var(--text-label);
  font-weight: 700;
  text-decoration: none;
}

/* This control states its own ink for its links. It sits on the header band
   beside the navigation, whose own links are the light `--nav-link` chosen for
   the navy band; but the primary action is a light chip and the disclosure's
   items sit on a white popup, where light text would be light on light. The
   rules below therefore restate the darker ink at `.nav-quick-add a`'s
   specificity, which is above the navigation's own hover and current-page
   rules, so the chip and the popup stay legible whatever the row does. */
.nav-quick-add a {
  color: var(--navy);
}

.nav-quick-add a:hover,
.nav-quick-add a:focus-visible {
  background: var(--hover-surface);
  color: var(--navy);
}

/* The primary action keeps its weight by inverting on hover, which is also
   what tells it apart from the disclosure's own items. */
.nav-quick-add a.nav-quick-add__primary:hover,
.nav-quick-add a.nav-quick-add__primary:focus-visible {
  background: var(--navy-dark);
  color: var(--on-navy);
}

.nav-quick-add__menu .gtd-menu__popup {
  right: 0;
  left: auto;
}


/* The header's global search box and its live suggestions (task088).
 *
 * On a wide screen it is a compact field beside Quick Add: a real GET form to
 * `/search`, so it works without JavaScript, with the suggestions floating over
 * the page below it. Nothing here changes the height or the position of the
 * band's other controls: the field is one more inline control of the same
 * minimum target height, and the dropdown is absolutely positioned, so it takes
 * no room in the row.
 *
 * The control is deliberately not a positioning context: below `72rem` the
 * opened field is positioned against the header band, so it covers the band
 * rather than pushing the brand, the Quick Add control and the menu toggle
 * aside. The search icon itself is the only thing those widths show until the
 * field is opened; only from `72rem` up is the field itself in the row. */
.nav-search {
  position: static;
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.nav-search__toggle {
  display: none;
}

.nav-search__form {
  position: relative;
  min-width: 0;
}

.nav-search__input {
  min-height: var(--target-min);
  width: 14rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--nav-link);
  border-radius: var(--radius-sm);
  background: var(--warm-white);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-label);
}

.nav-search__input::placeholder {
  color: var(--muted);
}

/* The field's own close control, drawn only where the field is opened over the
   band -- below `72rem` (task088 owner scope change, 2026-09-29). It is what a
   reader who opened the field by keyboard or by touch uses to put it away
   again without hunting for the icon underneath the band's other controls. A
   wide screen shows the field in the row, where Escape and clicking away
   already close it, so the control is not drawn there: it would take the row
   width this change is making room for. Its own rules live in the `72rem` block
   with the rest of the opened field. */
.nav-search__close {
  display: none;
}

/* The suggestions dropdown is right-aligned to the field, not left-aligned
   (task088 R1-F2). Quick Add's `margin-left: auto` keeps the field at the
   band's end, so a box anchored to the field's left edge grew rightwards past
   the viewport; anchored to its right edge it grows leftwards, into space that
   is always there. The `max-width` stays capped against the viewport as well,
   so the box is inside it at every width. */
.nav-search__suggestions {
  position: absolute;
  top: calc(100% + var(--space-0));
  right: 0;
  left: auto;
  z-index: 20;
  width: max-content;
  min-width: 100%;
  max-width: min(30rem, calc(100vw - 2rem));
  max-height: 60vh;
  margin: 0;
  padding: var(--space-0) 0;
  list-style: none;
  overflow: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-popup);
}

/* The collapsed dropdown is out of the tab order and out of the accessibility
   tree by its own `hidden` attribute, so no second source of truth can
   disagree with what assistive technology is told (task088 AC6). */
.nav-search__suggestions[hidden] {
  display: none;
}

.nav-search__group {
  padding: var(--space-0) var(--space-1);
  color: var(--muted);
  font-size: var(--text-meta);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* A suggestion group and each result under it carry the kind's own icon before
   the text, with the one-type-step gap the results page gives it (Task096). */
.nav-search__group .icon,
.nav-search__option-name .icon {
  margin-right: 0.4em;
}

.nav-search__option {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: var(--space-0) var(--space-1);
  cursor: pointer;
}

.nav-search__option:hover,
.nav-search__option.is-active {
  background: var(--hover-surface);
}

.nav-search__option-name {
  color: var(--ink);
  font-size: var(--text-label);
  font-weight: 600;
}

.nav-search__option-status,
.nav-search__option-snippet,
.nav-search__notice {
  color: var(--muted);
  font-size: var(--text-meta);
}

.nav-search__option-snippet mark,
.search-row__snippet mark {
  background: var(--highlight-surface);
  color: inherit;
}

/* The `/search` results page (task088). It is grouped by kind; each group is a
   plain section with a heading, a markerless list of record links, and an
   optional "Show all" link to the module's own filtered index. */
.search-group {
  margin-top: var(--space-3);
}

/* The group's heading carries the kind's own icon before its label (task091),
   with the gap a word beside an icon needs. Task096 puts the same icon before
   every result in the group, so the heading and the rows read alike. */
.search-group h2 .icon,
.search-row__link .icon {
  margin-right: var(--space-1);
}

.search-group__rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-row {
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--rule);
}

.search-row__link {
  color: var(--link);
  font-size: var(--text-row-title);
  font-weight: 600;
}

.search-row__status {
  margin-left: var(--space-0);
  padding: 0 var(--space-0);
  border-radius: var(--radius-sm);
  background: var(--pale-grey);
  color: var(--muted);
  font-size: var(--text-meta);
}

.search-row__snippet {
  margin: var(--space-0) 0 0;
  color: var(--muted);
  font-size: var(--text-label);
}

.search-page__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.search-page__form input[type="search"] {
  min-height: var(--target-min);
  flex: 1 1 16rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}


/* The phone-width menu toggle; hidden until the responsive section shows it. */
.menu-toggle {
  display: none;
  width: auto;
  min-height: var(--target-min);
  margin-left: auto;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--nav-link);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--on-navy);
  cursor: pointer;
}

main {
  width: min(100% - 2rem, var(--layout-width));
  margin: var(--space-5) auto;
}

/* The footer is the header's navy band, full width, so the page is framed top
   and bottom. It sits outside the layout width and wraps its own inner column,
   exactly as `.site-header` does, and its text is `--on-navy` -- 15.63:1 on
   `--navy`, the same pairing the header already uses -- rather than the muted
   ink it had as a plain rule. Task081 item 13 (owner decision, 2026-09-25). */
footer {
  background: var(--navy);
  color: var(--on-navy);
  border-top: 1px solid var(--navy-dark);
}

/* On a page shorter than the window the footer's navy band stops where its text
   does and the body's beige shows beneath it, so the frame task081 item 13
   draws top and bottom is left open at the bottom. This tail is the last child
   of the column body and grows into whatever height is left over: the strip
   below the footer is the footer's own `--navy`, and the main column keeps its
   `--canvas` beige (task094).

   A tail rather than a navy root, because the root's background is what the
   browser paints in the rubber-band area: navy there would flash above the
   header when the page is pulled down, which the owner ruled out. On a page
   taller than the window there is no free space to grow into and the tail is
   zero height, so a long page is unchanged -- and, being in flow, it can never
   add a scrollbar. It carries `aria-hidden` because it is paint, not content,
   and the sign-in page, which has no footer, simply does not render one. */
.site-tail {
  flex: 1 1 0;
  min-height: 0;
  background: var(--navy);
}

footer p {
  width: min(100% - 2rem, var(--layout-width));
  margin: 0 auto;
  padding: var(--space-4) 0;
  font-size: var(--text-meta);
}

footer :focus-visible {
  outline-color: var(--on-navy);
}

/* The footer's own links, when it gains any, read on the navy band rather than
   inheriting the page's dark ink. */
footer a {
  color: var(--on-navy);
}

/* The same navy-on-navy hover fault the brand had (task 097). A footer link
   keeps `--on-navy` on hover and focus and underlines instead. */
footer a:hover,
footer a:focus-visible {
  color: var(--on-navy);
  text-decoration: underline;
}

/* Headings sit on the navy structure colour and never compete with a long
   record name: the page title is capped, a section heading is a full step
   below it. */
h1,
h2 {
  color: var(--navy);
  line-height: var(--leading-title);
}

h1 {
  margin: 0;
  font-size: var(--text-page-title);
  font-weight: 700;
}

h2 {
  margin: var(--space-5) 0 var(--space-2);
  font-size: var(--text-section);
  font-weight: 700;
}

/* The page heading is a title and the actions for it. The title takes the
   first line and shrinks before the actions do. */
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.page-heading > h1 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  max-width: 100%;
  gap: var(--space-2);
}

/* A page action sizes to its own label here. It only fills the width once the
   heading stacks, which is the responsive section's business, not this one's. */

/* The way back to a record's module index, above the heading (task071). Meta
   type rather than a button: it states where the record came from, and nothing
   on the page competes with the record's own name. */
.page-breadcrumb {
  margin-bottom: var(--space-2);
  font-size: var(--text-meta);
}

.page-breadcrumb a {
  color: var(--muted);
}

/* What kind of record the page shows, above its title (task091): the module's
   own icon and label. Meta type like the breadcrumb, so it says what the page
   is without competing with the record's name for the reader's eye. */
.page-kind {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0 0 var(--space-1);
  color: var(--muted);
  font-size: var(--text-meta);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}


/* ==========================================================================
   4. Primitives
   --------------------------------------------------------------------------
   The three building blocks the rest of the interface composes from. They are
   listed first and then applied by the component sections, so every section
   and row in the application is one of these.

   .section      a region separated from the one above it by a rule and space
   .row          one row inside a region, separated from its neighbours by a
                 rule rather than owned by its own box
   .surface-card the one bordered object, for something genuinely discrete
   ========================================================================== */

/* A GTD view list and the home dashboard's cards wear the same card as the
   filter bar: a white surface with a light-grey border and the same padding
   (task081 items 5, 6 and 8, owner decision 2026-09-25, revised 2026-09-26 --
   the first version used `--pale-grey`, which the owner asked to be white with
   a `--line` border instead). This supersedes task069's rule-separated
   treatment: the three surfaces are the same kind of thing and should read as
   one system. A card is now an object with its own edge, so it is no longer a
   band that must suppress the rule above it when it is first on a page -- see
   the first-child exception below, which no longer names it. */
.section {
  padding: var(--space-3) 0 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.gtd-view,
.gtd-card {
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* The first section on a page needs no rule above it. */
.section:first-child {
  border-top: 0;
  padding-top: 0;
}

/* A row separates by a rule and closes with whitespace; it owns no box, so
   rows never nest card inside card. The last row in a list draws no rule. */
.row,
.gtd-row,
.agenda__item,
.notepad-note,
.dashboard__project,
.dashboard__initiative,
.dashboard__note,
.dashboard__event,
.checklist-runs__item {
  padding: var(--space-2) 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  margin-bottom: 0;
}

.row:last-child,
.gtd-list > .gtd-row:last-child,
.agenda__items > .agenda__item:last-child,
.notepad-list > .notepad-note:last-child,
.dashboard__projects > :last-child,
.dashboard__initiatives > :last-child,
.dashboard__notes > :last-child,
.dashboard__events > :last-child,
.checklist-runs__list > .checklist-runs__item:last-child {
  border-bottom: 0;
}

/* The one bordered object: a discrete thing with its own edge, such as a note
   card in a grid or the sign-in form. */
.surface-card,
.notepad-card,
.login-form {
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

/* ==========================================================================
   5. Buttons and controls
   --------------------------------------------------------------------------
   Four levels, each distinguishable at a glance:

     primary     the page's or the form's own workflow action, filled navy
     secondary   a maintenance action beside it, outlined
     quiet       an overflow trigger, no border at rest
     destructive a delete or similar, outlined in the danger ink and filled
                 danger only at the moment of confirmation

   Every level keeps a --target-min hit target.
   ========================================================================== */

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target-min);
  width: auto;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

/* Level 1: the primary workflow action. `.button-primary` is the page's own
   action; a bare button inside a form is that form's. */
.button-primary,
form button {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--on-navy);
}

.button-primary:hover,
form button:hover {
  background: var(--navy-dark);
  border-color: var(--navy-dark);
  color: var(--on-navy);
}

/* Level 2: a maintenance action beside the primary one. */
.button-secondary {
  border-color: var(--line);
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--hover-surface);
  border-color: var(--control-line);
  color: var(--ink);
}

/* Level 3: a quiet overflow trigger. No border and no fill at rest, so it
   never competes with the actions it sits beside. */
.button-quiet {
  padding-inline: var(--space-2);
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.button-quiet:hover {
  background: var(--hover-surface);
  color: var(--ink);
}

/* The destructive level: outlined in the danger ink rather than filled, so a
   delete on a record page is a quiet control, not a permanent red button. */
.button-danger {
  background: var(--surface);
  border-color: var(--danger);
  color: var(--danger);
}

.button-danger:hover {
  background: var(--danger-surface);
  border-color: var(--danger);
  color: var(--danger);
}

/* The same control inside a dialog is the confirming action, and is filled:
   the danger is stated once, where the decision is made. */
.dialog-actions .button-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--on-navy);
}

.dialog-actions .button-danger:hover {
  background: var(--status-overdue-ink);
  border-color: var(--status-overdue-ink);
  color: var(--on-navy);
}

/* ==========================================================================
   6. Forms and fields
   --------------------------------------------------------------------------
   The record form, its labelled controls, its choice groups and its toggle.
   Form layout is the same at every width apart from the responsive section,
   which folds the label column above the field.
   ========================================================================== */

/* The record form: a label column and a field column, on one surface. */
.modulebuilder form {
  display: grid;
  grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr);
  gap: var(--space-2) var(--space-3);
  align-items: start;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.modulebuilder form > label {
  padding-top: 0.65rem;
  font-weight: 700;
}

.input-wrapper {
  min-width: 0;
}

/* Every field control shares one outline, one height and one radius. */
input:not([type="radio"]):not([type="checkbox"]),
textarea,
select,
.ts-wrapper {
  width: 100%;
  min-height: var(--target-min);
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}

textarea {
  min-height: 7rem;
  padding: 0.65rem;
  resize: vertical;
}

input:not([type="radio"]):not([type="checkbox"]),
select {
  padding: 0.45rem 0.6rem;
}

input[type="radio"],
input[type="checkbox"] {
  min-width: 1.2rem;
  min-height: 1.2rem;
  accent-color: var(--navy);
}

.input-wrapper label {
  font-style: normal;
}

/* A group of radio or checkbox choices: each choice is one atomic flex item so
   its control and its label never land on different rows. */
.radio-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  padding: 0.45rem 0;
}

.radio-wrapper label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: var(--target-min);
  margin: 0;
  cursor: pointer;
}

.radio-wrapper .choice {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* The toggle switch. It keeps a comfortable target in a form even though its
   own track is small. */
.toggleswitch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.toggleswitch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggleswitch .slider {
  position: absolute;
  inset: 0;
  top: 5px;
  bottom: 5px;
  cursor: pointer;
  background: var(--control-line);
  transition: 0.15s;
}

.toggleswitch .slider::before {
  position: absolute;
  content: "";
  width: 26px;
  height: 26px;
  left: 4px;
  bottom: 4px;
  background: var(--surface);
  transition: 0.15s;
}

/* An on toggle is structure, not status, so it takes the navy. */
.toggleswitch input:checked + .slider {
  background: var(--navy);
}

.toggleswitch input:focus-visible + .slider {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.toggleswitch input:checked + .slider::before {
  transform: translateX(26px);
}

.toggleswitch .slider.round {
  border-radius: 34px;
}

.toggleswitch .slider.round::before {
  border-radius: var(--radius-round);
}

.toggleswitch-widget {
  min-height: var(--target-min);
}

.modulebuilder .toggleswitch {
  height: var(--target-min);
}

/* Custom controls must shrink with their form column rather than push it. */
.modulebuilder select,
.modulebuilder input,
.time-input,
.module-picker {
  min-width: 0;
  max-width: 100%;
}

.modulebuilder .overtype-toolbar {
  flex-wrap: wrap;
  height: auto;
}

.modulebuilder .overtype-toolbar-button {
  min-height: var(--target-min);
}

/* Form feedback. An inline message is one line of danger ink; a form-level
   error is a bordered notice and stays empty until it has something to say. */
.form-message,
.form-network-error {
  color: var(--danger);
  font-weight: 650;
}

.form-message {
  margin-top: 0.3rem;
}

.form-network-error {
  grid-column: 1 / -1;
  padding: 0.65rem;
  border-left: 4px solid var(--danger);
  background: var(--danger-surface);
}

.form-network-error:empty {
  display: none;
}

/* A field group (task070) is one declaration rendered twice: a labelled section
   on the form and on the record page. Inside a form it spans the form's own
   grid and reproduces its label/field columns, so labels line up across groups
   exactly as they did in the flat list. A group that starts collapsed is a
   `.gtd-menu` disclosure and inherits that contract rather than adding another
   one, but it is part of the page rather than a popup over it, so it owns no
   floating surface and its summary reads as a section heading. */
.field-group__label {
  margin: 0 0 var(--space-2);
  color: var(--navy);
  font-size: var(--text-subsection);
  font-weight: 700;
}

.modulebuilder form > .field-group {
  grid-column: 1 / -1;
}

.modulebuilder form .field-group__fields {
  display: grid;
  grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr);
  gap: var(--space-2) var(--space-3);
  align-items: start;
}

.field-group--collapsible > summary {
  min-height: var(--target-min);
  cursor: pointer;
}

/* An open group is a section, not a pressed menu: its open state is its own
   body being visible, so its summary keeps the heading treatment the groups
   beside it have rather than taking the menu's hover surface. */
.field-group[open] > .field-group__label {
  background: transparent;
  color: var(--navy);
}

/* The filtered module index: the filter form is a quiet panel above the list,
   and its own action sits under the fields rather than in the label column. */
.filter.modulebuilder form {
  margin-bottom: var(--space-4);
  background: var(--pale-grey);
}

.filter.modulebuilder form button {
  grid-column: 2;
  justify-self: start;
}

/* The advanced recurrence rule is a read-only value behind a disclosure, not
   an editable-looking field. */
.rrule-advanced {
  margin-top: 0.5rem;
}

.rrule-advanced summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--link);
  padding: 0.3rem 0;
}

.rrule-advanced summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.rrule-advanced textarea {
  background: var(--pale-grey);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-meta);
}

/* The two monthly-recurrence options are alternative strategies, so the hint
   spans the whole form width. */
.month-options-hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-label);
}

/* ==========================================================================
   7. Tables
   --------------------------------------------------------------------------
   A record table and the region that scrolls it. The table is the record
   itself, not a box: it carries rules, and the scroll wrapper carries none.
   ========================================================================== */

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin: var(--space-3) 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.table-scroll:focus-visible {
  outline-offset: 3px;
}

.record-table {
  width: 100%;
  min-width: 38rem;
  border-collapse: collapse;
  background: transparent;
  border-bottom: 1px solid var(--line);
}

.record-table th,
.record-table td {
  padding: 0.8rem 0.9rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

/* The header is a quiet band under a firm rule, so it reads as a label row
   rather than as a third colour in the page. */
.record-table thead tr {
  background: var(--pale-grey);
  color: var(--navy);
}

.record-table th {
  font-size: var(--text-label);
  border-bottom: 2px solid var(--navy);
}

.record-table td {
  border-bottom: 1px solid var(--rule);
}

.record-table tbody tr:nth-child(even) {
  background: var(--warm-white);
}

.record-table tbody tr:last-child td {
  border-bottom: 0;
}

/* A module's index is a browse table, so its heading labels stay on one line
   each (task073). A heading that wraps into a stack of words is what made the
   old index read as the database's own view of the module; the region already
   scrolls sideways, so the label row sets the table's width instead. */
.module-index th {
  white-space: nowrap;
}

/* A row's identifying column carries more weight than the metadata beside it.
   The weight goes on the link, which is the whole of that cell's content, so
   the row's own name is the one thing in it that reads as a title. */
.module-index .record-table__identifying a {
  font-weight: 600;
}

/* ==========================================================================
   8. Overlays
   --------------------------------------------------------------------------
   Dialogs. The vendored a11y-dialog stylesheet owns the positioning and the
   scroll behaviour; the rules here are this application's treatment of it.
   ========================================================================== */

.dialog {
  position: fixed;
  inset: 0;
  z-index: 199;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-3);
}

.dialog-actions .button {
  min-width: 7rem;
}

.dialog-content .form-network-error {
  margin-top: var(--space-2);
}

/* A dialog offering several full-width choices -- this occurrence, the whole
   series, this occurrence onwards -- stacks rather than sizing each one alike. */
.dialog-actions-stacked {
  flex-direction: column;
  align-items: stretch;
}

.dialog-actions-stacked .button {
  min-width: 0;
  width: 100%;
}

/* The inherit dialog's offer groups (task086). A fieldset is the right
   container for a set of related choices, but the browser's default treatment
   is not: it draws a border and runs the controls inline, so a long record name
   wraps and the group reads as one paragraph. Each group is a labelled set with
   no box of its own, and each candidate takes a full line with a comfortable
   target, the way a form's own choice group does (see .radio-wrapper). */
.relation-inherit-group {
  min-width: 0;
  margin: 0 0 var(--space-3);
  padding: 0;
  border: 0;
}

.relation-inherit-group > legend {
  padding: 0;
  font-weight: 600;
}

.relation-inherit-choice {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target-min);
  cursor: pointer;
}

/* ==========================================================================
   9. Sign-in
   --------------------------------------------------------------------------
   The login page never loads the module navigation, so it carries its own
   minimal centred layout.
   ========================================================================== */

.login-page {
  display: flex;
  min-height: 100vh;
  margin: 0;
}

.login-main {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(24rem, 100%);
  padding: var(--space-4);
}

.login-form h1 {
  margin: 0 0 var(--space-2);
}

.login-form .input-wrapper label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 700;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--target-min);
}

.login-remember label {
  margin: 0;
  font-weight: 400;
}

.login-error {
  margin: 0;
  padding: 0.65rem;
  border-left: 4px solid var(--danger);
  background: var(--danger-surface);
  color: var(--danger);
  font-weight: 650;
}

/* The sign-out control sits in the header band and keeps its own quiet
   treatment rather than the page's button levels. */
.site-signout {
  display: inline;
  margin: 0;
}

.site-signout button {
  min-height: var(--target-min);
  padding: 0.35rem 0.7rem;
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  font-weight: 700;
}

/* ==========================================================================
   10. Icons
   --------------------------------------------------------------------------
   The rendering contract for the self-hosted icon sprite, which belongs at
   public_html/assets/icons/bootstrap-icons.svg: one `.icon` element per icon,
   with a `use` pointing at one symbol of that sprite.

   Task091: the markup is written in exactly one place per language --
   `Icon::svg()` in app/ui/Icon.php and `Icon.markup()`/`Icon.element()` in
   public_html/js/icon.js -- so nothing else has to know the element's shape.

   Nothing loads from another origin: the sprite is a file in this repository,
   so an icon costs no request beyond the document's own. An icon is always
   decorative -- it takes its colour from the text around it, its size from
   that text's font size, and it never carries an accessible name: the
   control's own label or aria-label does that. That is why aria-hidden is part
   of the contract rather than something a template may forget.

   The sprite is a subset of Bootstrap Icons 1.13.1 (MIT), built at
   `public_html/assets/icons/README.md`; see docs/architecture.md for its provenance
   and the symbol list. Bootstrap Icons draws with filled geometry rather than
   strokes -- each symbol is one filled path on a 16x16 viewBox -- so the
   contract is `fill: currentColor`, and a symbol that is drawn rather than
   filled would need its own rules at its own use site.
   ========================================================================== */

.icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: currentColor;
  vertical-align: -0.125em;
}

/* A size step for an icon that must read larger than its text, still driven by
   the type scale rather than a fixed pixel size. */
.icon--lg {
  width: 1.25em;
  height: 1.25em;
}

/* ==========================================================================
   11. GTD views
   --------------------------------------------------------------------------
   The seven view pages, the dashboard cards and the shared filter bar. The
   same row markup is used on a page and in a card, so all row styling is
   shared, and one filter bar serves a page with several cards.
   ========================================================================== */

.gtd-page__description {
  margin: 0.35rem 0 var(--space-3);
  color: var(--muted);
}

.gtd-view__count {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: var(--text-meta);
  font-weight: 700;
}

/* The filter bar: a plain GET form, so it works with no JavaScript. Task069:
   a toolbar rather than a tinted panel -- a rule under it separates it from
   the work, the way a rule separates any two regions in this stylesheet,
   rather than a background and a border boxing it off. */
/* The GTD filter bar is one card rather than a rule under the heading (task081
   item 5, owner decision 2026-09-25, revised 2026-09-26: the owner asked for a
   white surface with a light-grey border rather than the tinted panel this
   first used). This supersedes task069's "a toolbar rather than a tinted
   panel": the owner asked for the bar to stand out as a card on the page's
   cream, and it is the same card the home cards and the GTD views wear. Its
   controls, chips and "More filters" disclosure are unchanged. */
.gtd-filter-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.gtd-filter-bar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2) var(--space-3);
}

.gtd-filter-control {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 10rem;
  /* The column is a fixed width, not a minimum that a selected value can
     stretch. A searchable filter renders its selection itself, so a long
     record name used to widen the whole column -- and with it the toolbar
     row -- which moved the Apply button out from under the pointer between
     mousedown and mouseup. The value truncates now (see the single-value
     rules in "Third-party overrides"), so the column, the control and the row
     are the same size in every state. Task085 R1-F1. */
  width: 10rem;
}

.gtd-filter-control label {
  font-size: var(--text-label);
  font-weight: 700;
  color: var(--muted);
}

.gtd-filter-bar__locked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* A filter the page presets is shown as a locked pill, so the reader knows why
   the list is narrowed. */
.gtd-filter-locked {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  background: var(--status-neutral-surface);
  color: var(--status-neutral-ink);
  border-radius: var(--radius-pill);
  font-size: var(--text-meta);
  font-weight: 700;
}

.gtd-filter-locked__note {
  font-weight: 400;
  opacity: 0.85;
}

.gtd-filter-bar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

/* Review R1-F1: at phone width the actions row stretches to full width
   (18. Responsive), which otherwise lets "Clear" wrap mid-word; kept on one
   line instead, with no new token. */
.gtd-filter-bar__clear {
  white-space: nowrap;
}

/* What is currently applied, as removable pills that stay visible whether
   "More filters" is open or collapsed (task069 AC3/AC4). Same shape as a
   locked chip's pill, on the same neutral status surface. */
.gtd-filter-bar__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.gtd-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  background: var(--status-neutral-surface);
  color: var(--status-neutral-ink);
  border-radius: var(--radius-pill);
  font-size: var(--text-meta);
  font-weight: 700;
}

.gtd-filter-chip__remove {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.gtd-filter-chip__remove:hover {
  text-decoration: underline;
}

/* "More filters" is the same `.gtd-menu` disclosure task067/068 already gave
   a keyboard/Escape/click-away contract to (task069 AC2), but its panel is
   this component's own -- an inline region under the toolbar, never a
   floating `.gtd-menu__popup`, so it can never read as a modal. */
.gtd-filter-bar__advanced {
  align-self: flex-start;
}

.gtd-filter-bar__advanced-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--rule);
}

/* On the phone band a page's whole filter bar folds behind one "Filters"
   control, so the records come first (the owner's report, 2026-09-29). The
   band is the phone menu's own: task090's 62rem (992px) breakpoint, the same
   value, not a second number. Above it this panel is styled away, so the bar
   is exactly what it was: the details and its body generate no box and its
   children join the form's own flex column as before, and the summary -- the
   control that only the phone band shows -- is not drawn. The panel is a
   native `<details>`, so it opens and closes with no script and reads as a
   disclosure to assistive technology; the only script involved decides its
   state on arrival (public_html/js/filter-bar.js). */
.gtd-filter-bar__phone {
  display: contents;
}

.gtd-filter-bar__phone > summary {
  display: none;
  list-style: none;
}

.gtd-filter-bar__phone > summary::-webkit-details-marker {
  display: none;
}

/* The panel's body is the bar's own column (task 097), so the bar's spacing
   token separates the toolbar row, the applied chips and "More filters". As
   `display: contents` those three were laid out as plain blocks inside the
   phone disclosure, where the bar's flex `gap` never reached them: a chip sat
   flush against the field above it and the "More filters" control below it
   (0px at 1280px and in the open phone panel). The token is the same one the
   bar itself uses, so nothing else in the bar's rhythm changes. */
.gtd-filter-bar__phone-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

@media (max-width: 62rem) {
  /* The panel is the bar's own box now, so its folded state takes the space
     of the control alone and its open state stacks the toolbar row, the chips
     and "More filters" with the bar's own rhythm. */
  .gtd-filter-bar__phone {
    display: block;
  }

  .gtd-filter-bar__phone[open] {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }

  .gtd-filter-bar__phone > summary {
    display: inline-flex;
    width: 100%;
    justify-content: flex-start;
  }

  /* The disclosure caret the `.gtd-control` look does not carry, on the end
     edge; it turns when the panel is open, the way the advanced group's own
     summary does not need to because it is always right under the control. */
  .gtd-filter-bar__phone > summary::after {
    content: "\25be";
    margin-left: auto;
    font-size: var(--text-micro);
  }

  .gtd-filter-bar__phone[open] > summary::after {
    transform: rotate(180deg);
  }

  .gtd-filter-bar__phone-label {
    font-weight: 700;
  }

  .gtd-filter-bar__phone-count {
    color: var(--muted);
    font-weight: 700;
  }
}

.gtd-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* One action row. The row's title carries the row; its metadata is smaller and
   muted; its status is set in caps at the smallest step. */
.gtd-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-0) var(--space-3);
  justify-content: space-between;
}

.gtd-row__main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  min-width: min(100%, 18rem);
  flex: 1 1 18rem;
}

.gtd-row__name {
  font-size: var(--text-row-title);
  font-weight: 700;
}

.gtd-row__status {
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.gtd-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem var(--space-2);
  font-size: var(--text-meta);
  color: var(--muted);
}

/* The Inbox row and the home Inbox card render a Capture's description as
   parsed Markdown (task 099 R1), so a long or mailed capture keeps its
   structure instead of flattening into one line. The block takes its own line
   under the title and is clamped to a few lines; `data-markdown-clamped`, set
   by `editor.js` once the container is filled, adds the fade only to a block
   that is really cut off, so a short description is never dimmed (task 099
   R1-F1 and R1-F2). */
.gtd-row__description,
.capture-row__description {
  flex: 1 1 100%;
  min-width: 0;
  max-height: var(--row-preview-clamp);
  margin: 0.2rem 0 0;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* Only a mask's opacity matters, so the gradient's opaque end is any opaque
   colour: it is written as the ink token rather than a colour of its own. */
.gtd-row__description[data-markdown-clamped="true"],
.capture-row__description[data-markdown-clamped="true"] {
  -webkit-mask-image: linear-gradient(to bottom, var(--ink) calc(100% - 1.1rem), transparent);
  mask-image: linear-gradient(to bottom, var(--ink) calc(100% - 1.1rem), transparent);
}

/* A heading inside a clamped preview reads as a bold line, not a title: at the
   heading scale the editor and the record page use, one `# Heading` filled the
   whole clamp and was cut through by the fade (task 099 R2, presentation point
   3b). Inside these two preview blocks h1 to h6 are scaled to about body size
   with tight margins and the preview's own line-height. Scoped to the preview
   container, so the capture page, the notepad cards and the editor keep the
   full heading scale (task 100). */
.gtd-row__description h1,
.gtd-row__description h2,
.gtd-row__description h3,
.gtd-row__description h4,
.gtd-row__description h5,
.gtd-row__description h6,
.capture-row__description h1,
.capture-row__description h2,
.capture-row__description h3,
.capture-row__description h4,
.capture-row__description h5,
.capture-row__description h6 {
  font-size: 1.05em;
  font-weight: 700;
  line-height: inherit;
  margin: 0.1em 0;
}

.gtd-field__label {
  font-weight: 700;
}

/* A badge is a status word on its semantic surface. The default is the neutral
   pair: a status with no semantic colour of its own is not coloured. */
.gtd-badge {
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  font-size: var(--text-micro);
  font-weight: 700;
  background: var(--status-neutral-surface);
  color: var(--status-neutral-ink);
}

/* Today must distinguish due from scheduled, and overdue outranks both. */
.gtd-badge--due-today,
.gtd-badge--scheduled-today {
  background: var(--status-active-surface);
  color: var(--status-active-ink);
}

.gtd-badge--overdue-due,
.gtd-badge--overdue-scheduled,
.gtd-badge--followup-overdue {
  background: var(--status-overdue-surface);
  color: var(--status-overdue-ink);
}

.gtd-badge--followup-today {
  background: var(--status-waiting-surface);
  color: var(--status-waiting-ink);
}

.gtd-badge--deferred,
.gtd-badge--hidden-until {
  background: var(--status-someday-surface);
  color: var(--status-someday-ink);
}

/* A dashboard flag reuses the waiting pair: something needs a decision, but
   nothing has failed. */
.gtd-badge--needs-next {
  background: var(--status-overdue-surface);
  color: var(--status-overdue-ink);
}

.gtd-badge--open-actions {
  background: var(--status-waiting-surface);
  color: var(--status-waiting-ink);
}

/* An empty region is a sentence, not a dashed box. */
.gtd-empty {
  padding: var(--space-2) 0;
  color: var(--muted);
  border: 0;
  border-radius: 0;
}

.gtd-day__date {
  margin: var(--space-3) 0 var(--space-1);
  font-size: var(--text-row-title);
}

.gtd-events,
.gtd-projects {
  margin-top: var(--space-4);
}

.gtd-events__title,
.gtd-projects__title {
  margin: 0 0 var(--space-2);
}

.gtd-event-list,
.gtd-project-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* A single event or project line inside a day or a card. */
.gtd-event,
.gtd-project {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem var(--space-2);
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.gtd-event__name,
.gtd-project a {
  font-weight: 700;
}

/* The home dashboard: the same views as sections, one shared filter bar. */
.gtd-dashboard__title {
  margin-bottom: var(--space-3);
}

.gtd-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: var(--space-4) var(--space-4);
  align-items: start;
}

/* The dashboard's cards are laid out by this grid alone. `.gtd-card`'s own
   padding comes from the one card surface rule above; a padding rule used to
   sit here setting `var(--space-3) 0 0`, which overrode it (later in the sheet
   at the same specificity) and left the card's content flush against its
   border, so the cards had no side or bottom padding. Task081 item 1 (owner
   report, 2026-09-26). */

/* The one card the page leads with gets a firmer rule, not a louder colour. */
.gtd-card--prominent {
  border-top: 3px solid var(--navy);
}

.gtd-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.gtd-card__title {
  margin: 0;
  font-size: var(--text-subsection);
}

/* A card's heading icon belongs to the words after it, never to the card's
   name (Task096). */
.gtd-card__title .icon {
  margin-right: 0.4em;
}

.gtd-card__count {
  padding: 0.1rem 0.5rem;
  background: var(--status-neutral-surface);
  color: var(--status-neutral-ink);
  border-radius: var(--radius-pill);
  font-size: var(--text-micro);
  font-weight: 700;
}

.gtd-card__footer {
  margin: var(--space-2) 0 0;
}

.gtd-card__see-all {
  font-weight: 700;
}

/* The inline action controls every list carries. One row component and one
   browser component drive them, so these rules style a single markup shape.
   The controls wrap rather than scroll, and a control is never narrower than a
   comfortable touch target. */
.gtd-row__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.gtd-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target-min);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-label);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.gtd-control:hover {
  background: var(--hover-surface);
  color: var(--ink);
}

/* An icon inside a control sits beside its word with the gap one type step
   gives, and the word is still the control's name (task091). The page actions
   of a record use it too, so a button and a menu row read the same. */
/* A date fact's icon sits between its field's label and its day, and between a
   chip's edge and its words, with the same one-type-step gap the controls use
   (task091) -- so a flag, a calendar and a return arrow all scale with the text
   they belong to rather than with a fixed pixel size. */
.record-block-value .icon,
.gtd-field .icon,
.gtd-badge .icon,
.agenda__time .icon,
.gtd-event__time .icon {
  margin-right: 0.4em;
}

.gtd-control .icon,
.gtd-menu__item .icon,
.button .icon {
  margin-right: 0.4em;
}

/* The one icon-only GTD control: the overflow menu of a row or a page
   (task091). It is a square, the size of every other control, and it takes its
   name from the aria-label its caller writes; the disclosure caret would only
   compete with the glyph, so it is dropped here -- and, since task094, on the
   Quick Add toggle below, for the same reason. */
.gtd-control--icon {
  width: var(--target-min);
  padding: var(--space-1);
}

/* `:is()` rather than a compound selector, so the modifier class is never
   written directly against a pseudo-element: the token check scans the
   stylesheet for custom-property declarations and would read a doubled dash
   touching a colon as one. */
.gtd-menu > summary:is(.gtd-control--icon)::after {
  content: none;
}

/* The Quick Add "More" toggle is the second icon-only disclosure, and it now
   draws the sprite's own `chevron-down` through the icon helper (task094), so the
   text-glyph caret `.gtd-menu > summary::after` would sit beside it as a
   second arrow of a different kind. It is dropped here, the way it is for the
   overflow trigger above, and the icon's trailing one-type-step gap is dropped
   with it -- the chevron is the summary's only child, and the gap would push
   it off the centre the button is built around. */
.gtd-menu > summary:is(.nav-quick-add__more)::after {
  content: none;
}

.nav-quick-add__more .icon {
  margin-right: 0;
}

/* The status, defer, follow-up and overflow menus are native disclosures: they
   open without any script, and their panel is positioned so opening one never
   reflows the row (task068). */
.gtd-menu {
  position: relative;
}

.gtd-menu > summary {
  list-style: none;
}

.gtd-menu > summary::-webkit-details-marker {
  display: none;
}

.gtd-menu > summary::after {
  content: "\25be";
  margin-left: 0.4rem;
  font-size: var(--text-micro);
}

.gtd-menu[open] > summary {
  background: var(--hover-surface);
  color: var(--ink);
}

.gtd-menu__popup {
  position: absolute;
  z-index: 5;
  right: 0;
  top: calc(100% + var(--space-0));
  width: max-content;
  min-width: 13rem;
  max-width: min(22rem, calc(100vw - 3rem));
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-popup);
}

.gtd-menu__items {
  display: flex;
  flex-direction: column;
}

.gtd-menu__item {
  display: block;
  justify-content: flex-start;
  width: 100%;
  min-height: var(--target-min);
  padding: 0.35rem 0.6rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  text-decoration: none;
}

.gtd-menu__item:hover {
  background: var(--hover-surface);
  color: var(--ink);
}

/* A destructive command inside a menu says so in ink rather than by filling a
   button (task071): the menu is where the decision is made, and the dialog that
   follows is still where it is confirmed. */
.gtd-menu__item--danger {
  color: var(--danger);
}

.gtd-menu__item--danger:hover {
  background: var(--danger-surface);
  color: var(--danger);
}

/* The overflow menu's own popup holds whatever the page's primary control did
   not claim (task068): flat items (Complete, Skip, Edit) styled as
   `.gtd-menu__item`, and Status/Defer/Follow-up nested as their own
   `.gtd-menu` disclosure -- the same `<details>` building block task041
   already used for a page-level menu, just placed one level deeper. A nested
   summary reads as a menu row like its flat neighbours; its own popup opens
   beside it exactly as a page-level one does. */
.gtd-menu__sections {
  display: flex;
  flex-direction: column;
}

.gtd-menu__sections > .gtd-menu > summary {
  display: block;
  width: 100%;
  min-height: var(--target-min);
  padding: 0.35rem 0.6rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}

.gtd-menu__sections > .gtd-menu > summary:hover,
.gtd-menu__sections > .gtd-menu[open] > summary {
  background: var(--hover-surface);
  color: var(--ink);
}

.gtd-menu__custom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--rule);
}

.gtd-menu__label {
  flex: 1 1 100%;
  font-size: var(--text-micro);
  font-weight: 700;
  color: var(--muted);
}

.gtd-menu__date {
  flex: 1 1 9rem;
  min-width: 0;
}

.gtd-menu__custom .gtd-control {
  flex: 0 0 auto;
}

/* The one message area for the inline controls. It sits outside the lists, so
   re-rendering a list never removes it, and it is fixed to the viewport so it
   is visible from wherever the control was used. */
.action-toast {
  display: none;
  position: fixed;
  left: 50%;
  bottom: var(--space-3);
  transform: translateX(-50%);
  z-index: 20;
  align-items: center;
  gap: var(--space-2);
  max-width: min(92vw, 34rem);
  padding: var(--space-1) var(--space-2);
  background: var(--navy);
  color: var(--on-navy);
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow-toast);
}

.action-toast[data-action-toast-open] {
  display: flex;
}

.action-toast__message {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.action-toast__undo {
  flex: 0 0 auto;
  min-height: var(--target-min);
  padding: 0.25rem 0.8rem;
  border-color: var(--on-navy);
  background: var(--on-navy);
  color: var(--navy);
}

.action-toast__undo:hover {
  background: var(--hover-surface);
  color: var(--navy);
}

/* --------------------------------------------------------------------------
   Pagination (task084): the shared control for the index pages, the GTD views
   and the Inbox.

   The control is a plain list of links under the list it pages: Previous and
   Next, the current page's neighbourhood and the two ends, with an ellipsis
   where a gap is skipped. It uses the same tokens as every other control, no
   JavaScript, and no colour of its own beyond the palette the rest of the
   interface uses, so it reads as one with the filter bar above the list.
   -------------------------------------------------------------------------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--rule);
}

.pagination__summary {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-meta);
}

.pagination__pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-0);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination__item {
  display: flex;
}

.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--target-min);
  min-height: var(--target-min);
  padding: 0 var(--space-1);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--link);
  font-size: var(--text-label);
  text-decoration: none;
}

.pagination__link:hover {
  background: var(--hover-surface);
}

.pagination__link--current {
  border-color: var(--control-line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.pagination__link--disabled {
  color: var(--muted);
}

.pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  min-width: var(--space-3);
  justify-content: center;
  color: var(--muted);
}

/* A page of tables gets its control under the table; the table itself already
   scrolls horizontally, so the control does not need to. */
.pagination__summary,
.pagination__pages {
  min-width: 0;
}

/* ==========================================================================
   12. Dashboards
   --------------------------------------------------------------------------
   The shared record-dashboard layout: a header that says what the record is
   and where it stands, main-content regions, and a context column of linked
   records. Tasks 042, 043, 062 and 044 all render this markup.
   ========================================================================== */

/* The record header is a band closed by a rule rather than another box. */
.dashboard__header {
  margin-bottom: var(--space-4);
  padding: 0 0 var(--space-3);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.dashboard__heading {
  margin-bottom: 0;
}

.dashboard__title {
  margin: 0;
  overflow-wrap: anywhere;
}

.dashboard__summary {
  margin-top: var(--space-2);
}

.dashboard__status {
  margin: 0.2rem 0 0.4rem;
  font-size: var(--text-meta);
  color: var(--muted);
}

.dashboard__status-label {
  font-weight: 700;
}

.dashboard__description {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* The record's key state as the chip row under the title (task104). Each chip
   is a status word on its own semantic pair, the same pairs the rest of the
   interface uses, so a page and a list mark one record the same way. The due
   chip wears the due day's own icon (task091); the overdue chip the overdue
   pair. */
.dashboard__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin: var(--space-1) 0 0;
}

.record-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: var(--text-micro);
  font-weight: 700;
  background: var(--status-neutral-surface);
  color: var(--status-neutral-ink);
}

.record-chip--scheduled {
  background: var(--status-scheduled-surface);
  color: var(--status-scheduled-ink);
}

.record-chip--waiting {
  background: var(--status-waiting-surface);
  color: var(--status-waiting-ink);
}

.record-chip--someday {
  background: var(--status-someday-surface);
  color: var(--status-someday-ink);
}

.record-chip--active {
  background: var(--status-active-surface);
  color: var(--status-active-ink);
}

.record-chip--due {
  background: var(--status-waiting-surface);
  color: var(--status-waiting-ink);
}

.record-chip--overdue {
  background: var(--status-overdue-surface);
  color: var(--status-overdue-ink);
}

.record-chip .icon {
  width: 1em;
  height: 1em;
}

/* The heading's aside is a row of control groups, not a column (task 097).
   Task042's project header puts "Add Action" and the overflow menu in one
   group and "Change status" in the next, and a column stacked the two by
   default -- "Change status" dropped under "Add Action" with the whole row
   empty beside it. As a row the groups share the line when the heading has
   room and wrap *as a group* when it genuinely does not. It is sized by its
   content (`flex: 0 0 auto`) rather than by a 16rem basis, so the heading's
   own title shrinks first and the buttons keep their one line; `max-width`
   keeps a very wide group from leaving the page. */
.dashboard__aside {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-2);
  flex: 0 0 auto;
  max-width: 100%;
  min-width: min(100%, 16rem);
}

.dashboard__actions,
.dashboard__quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

/* The "Add" block is a section of its own, with its own title, so it keeps the
   full width and its own line rather than joining the actions row (task097). */
.dashboard__quick-actions {
  flex: 1 1 100%;
}

.dashboard__quick-title {
  flex: 1 1 100%;
  margin: 0;
  font-size: var(--text-micro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.dashboard__body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.dashboard__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.dashboard__region {
  min-width: 0;
}

/* --------------------------------------------------------------------------
   The record dashboards (task103) as a card grid, a context sidebar and a jump
   bar. Every action section is one `.dashboard-card` (the GTD card surface,
   wrapped in a native `<details>` so it can collapse on a phone). Nothing
   here needs a new breakpoint: the phone band is task090's 62rem and the
   two-column grid is the site's 72rem.
   -------------------------------------------------------------------------- */

/* The main column is one column of the same cards in the same order by
   default (the 62rem-to-72rem band and the phone band both start here). */
.dashboard__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Each card is the GTD surface; its own padding comes from `.gtd-card`. The
   summary is the card's header, and carries no marker above the phone band. */
.dashboard-card {
  display: block;
  min-width: 0;
}

.dashboard-card__summary {
  cursor: default;
  list-style: none;
}

.dashboard-card__summary::-webkit-details-marker {
  display: none;
}

.dashboard-card__summary::after {
  content: "";
}

.dashboard-card__body {
  margin-top: var(--space-1);
}

/* A card's heading is the GTD heading. The home page's cards use an `<h2>`,
   so their titles are bold by the element's own rule; these are a `<span>`,
   so the weight has to be set rather than inherited. */
.dashboard-card__title {
  font-weight: 700;
}

/* A card's title is a real `<h2>` again (task103, review finding R1-F3): the
   element the record pages' headings were before the cards moved into a
   `<summary>`, so heading navigation finds the cards, as it finds the home
   dashboard's. It carries the region's or the sidebar's own title class, and
   keeps the card title's own type inside the summary rather than the section
   heading's, so the page's heading structure comes back without moving a
   pixel. */
.dashboard-card__summary .dashboard__region-title,
.dashboard-card__summary .dashboard__sidebar-title {
  margin: 0;
  font-size: var(--text-subsection);
  font-weight: 700;
}

/* The overdue chip belongs to the phone summary only (the design puts it
   there); above the phone band the count already says how much is in a card. */
.dashboard-card__badge {
  display: none;
}

/* Above 62rem every card is always open and its summary is not a toggle:
   the marker is hidden and the summary does not respond to a click, while the
   title link and any other control on it still do. This rule is also how the
   page's pre-paint script tells the two bands apart -- a summary that takes a
   tap is a phone -- so the band stays stated here once. */
@media (min-width: 62rem) {
  .dashboard-card__summary {
    pointer-events: none;
  }

  .dashboard-card__summary a,
  .dashboard-card__summary .dashboard-card__count,
  .dashboard-card__summary .dashboard__horizon {
    pointer-events: auto;
  }

  .dashboard-card__summary::after {
    content: none;
  }

  .dashboard-card__body {
    margin-top: 0;
  }
}

/* Below 62rem every card collapses: the summary is a compact 48px tap target
   with the design's disclosure marker, and the body is the card's content.
   The card's own padding is moved onto the summary and the body, so the
   summary is the whole top of the card -- the tap target the design draws --
   rather than the card's 16px padding plus a 44px row.

   Task103 R1-F1: the phone band stops just below 62rem, not at it (61.99rem =
   991.84px), so the band and the `min-width: 62rem` band above cannot both
   match at one width. At exactly 992px the desktop band is the one that holds,
   which is also the width `dashboard-cards.js` treats as the desktop band --
   before this, both bands matched there, the script closed every card and the
   desktop rule left it untappable, so the page's contents could not be reached
   at all. */
@media (max-width: 61.99rem) {
  /* The sidebar drops below the cards on a phone, after the "Linked" label. */
  .dashboard__body {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }

  .dashboard-card {
    padding: 0;
  }

  .dashboard-card__summary {
    min-height: 48px;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    margin: 0;
    cursor: pointer;
  }

  /* A long card title wraps onto a second line rather than being clipped: a
     name cut mid-word ("Source record for this A...") tells the reader nothing
     about what the card holds, and the collapsed row is allowed to grow by the
     words the title needs (task104 review R3). `overflow-wrap: anywhere` keeps
     a single over-long word inside the row instead of spilling out of it. */
  .dashboard-card__summary .dashboard-card__title {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .dashboard-card__summary::after {
    content: "\25BE";
    margin-left: 0.4em;
    color: var(--muted);
    font-size: var(--text-meta);
  }

  .dashboard-card[open] .dashboard-card__summary::after {
    content: "\25B4";
  }

  /* The count and any overdue chip sit at the right of the row, in that
     order, immediately before the chevron. The title takes the slack, so the
     rest of the row packs to the right however many of them there are. */
  .dashboard-card__summary .dashboard-card__title {
    margin-right: auto;
  }

  .dashboard-card__summary .dashboard__horizon {
    margin-left: 0;
  }

  .dashboard-card__badge {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
  }

  .dashboard-card__count {
    margin-left: auto;
  }

  /* The badge and the count sit together at the right of the summary. */
  .dashboard-card__badge + .dashboard-card__count {
    margin-left: var(--space-2);
  }

  .dashboard-card__body {
    padding: 0 var(--space-3) var(--space-3);
  }

  /* A collapsed card shows no control in its own header row: the horizon
     select belongs to the open card. */
  .dashboard-card:not([open]) .dashboard__horizon {
    display: none;
  }

  /* A card the page marks always-open (the Details card, and the
     Description card on a single-record page) is never a toggle, on either
     band -- the owner's decision is that it stays open everywhere, so its
     summary takes no tap and shows no disclosure marker. It keeps its place
     and its height at the top of the card, where the phone's collapsed rows
     put every other card's summary. The desktop band's rule says the same
     thing for the wider band, so this one is the phone's half of it. */
  .dashboard-card--fixed > .dashboard-card__summary {
    pointer-events: none;
    cursor: default;
  }

  .dashboard-card--fixed > .dashboard-card__summary::after {
    content: none;
  }
}

/* 72rem and up: a dashboard's action cards are a two-column grid -- Events |
   Waiting, then Next | Other open, with Completed spanning both columns --
   beside the sidebar. The grid's own order is the markup order.

   Task104: only a dashboard's main column takes the grid (its `page()` passes
   `main_grid`, which names it in the markup). A single-record page's cards
   stack -- Description, Details, then the page's extras -- because a record is
   read top to bottom, and its Details card is where field groups sit side by
   side.

   `align-items: stretch` gives the cards in one grid row the same height
   (owner decision, 2026-09-30): a short card beside a long one is as tall as
   its neighbour rather than a ragged edge, and the card's own content order is
   untouched -- the extra height is empty space below the content, not a
   reflow. */
@media (min-width: 72rem) {
  .dashboard__main--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3) var(--space-3);
    align-items: stretch;
  }

  /* Completed (and any single-column card the page names) spans the row. */
  .dashboard-card--wide {
    grid-column: 1 / -1;
  }

  /* The main column's Details card and the jump bar sit above the card grid
     and span it (task104), so the first grid row of cards starts below the
     whole Details band. */
  .dashboard__main--grid > .dashboard__jump {
    grid-column: 1 / -1;
  }

  /* Compact rows in the grid: a card here is half the main column wide, so a
     row's own controls sit to the right of its title whenever the title leaves
     room for them, and wrap below it when it does not. The row's markup and
     content order are unchanged (owner decision, 2026-09-30). */
  .dashboard-card .gtd-row,
  .dashboard-card .dashboard__event {
    padding: var(--space-1) 0;
  }

  .dashboard-card .gtd-row__main {
    min-width: 0;
    flex: 1 1 auto;
  }
}

/* An empty card says what it has not got and offers the page's own "+ Add"
   where the page has one (owner decision, 2026-09-30). On a phone the summary
   of an empty card is muted -- with its count of zero -- so a screenful of
   collapsed cards reads as what is still missing. */
.dashboard-card__add {
  margin: var(--space-1) 0 0;
}

.dashboard-card__add-link {
  font-weight: 700;
}

@media (max-width: 61.99rem) {
  .dashboard-card--empty .dashboard-card__summary,
  .dashboard-card--empty .dashboard-card__count {
    color: var(--muted);
  }
}

/* The sidebar's linked-record cards: the same card surface, a little tighter,
   and the phone-only "Linked" group label above them. */
.dashboard__sidebar-group {
  display: none;
}

@media (max-width: 61.99rem) {
  .dashboard__sidebar-group {
    display: block;
    margin: 0;
    padding-top: var(--space-1);
    font-size: var(--text-micro);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
  }
}

/* Above the phone band a sidebar card is a little tighter than a main card
   and its summary is a plain heading. Below it, the card and its summary take
   the phone band's own padding, so a collapsed sidebar card is the same
   compact 48px row a main card is. */
@media (min-width: 62rem) {
  .dashboard-card--sidebar {
    padding: var(--space-2) var(--space-3);
  }

  .dashboard-card--sidebar .dashboard-card__summary {
    padding-bottom: var(--space-1);
  }
}

@media (max-width: 61.99rem) {
  .dashboard-card--sidebar .dashboard-card__summary {
    padding: var(--space-2) var(--space-3);
  }
}

/* The Details card (task104): the record's field groups side by side at the
   site's 72rem, stacked below it, each group a labelled column. The card itself
   is the shared card; this is only its column layout. */
.dashboard-card__details {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3) var(--space-4);
  /* The groups sit under the card's own title with the card's usual reading
     distance, so "Details" and the first group's label ("Basics") do not run
     together. */
  margin-top: var(--space-2);
}

/* Each group is labelled by its own small heading, the way the design's
   BASICS / TIMING / RECORDED columns are: quiet, upper-case and spaced, so it
   reads as a label over the facts rather than as a second card title. */
.dashboard-card__details .field-group__label {
  margin: 0 0 var(--space-1);
  font-size: var(--text-micro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

@media (min-width: 72rem) {
  .dashboard-card__details {
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  }

  /* Side by side, the column gap is what separates one group from the next, so
     the groups drop `.section`'s top rule -- across the second and third
     columns it read as a divider between columns, and it left the first column
     without one, so the row looked wrong rather than deliberate. `.section`'s
     top padding goes with it, so every group's label sits at the same height.
     Below 72rem the groups stack and the rule is what separates one from the
     one above, exactly as it does everywhere else in the application. */
  .dashboard-card__details .field-group {
    border-top: 0;
    padding-top: 0;
  }
}

.dashboard-card__description {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Above 62rem the body's own top gap is removed, because every other card's
   first content is a row list that carries its own padding. The Details card's
   first content is prose, so it has to state that gap itself: without this the
   description sits against the card's title, which the other cards' rows do not
   (task104, owner report 2026-10-01). */
.dashboard-card__body > .dashboard-card__description:first-child {
  margin-top: var(--space-2);
}

/* The dashboard Details card's own fact lines (a person's Email | Phone |
   Birthday): their own block, laid out in the same columns as the grouped
   fields below them, so the card reads as one band of facts. */
.dashboard-card__facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-1) var(--space-4);
}

@media (min-width: 72rem) {
  .dashboard-card__facts {
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  }
}

/* A dashboard's long description is clamped to about four lines (owner
   decision, 2026-09-30) with a "Show more" toggle. The clamp is the script's:
   without JavaScript the class is never added, so the whole description shows
   and the button stays hidden -- the page's reading never depends on it. */
/* The clamp is a max-height rather than `-webkit-line-clamp`: a line-clamped
   box reports its own truncated height as its scrollHeight, so the script
   could not tell a cut-off description from a short one. Four lines of the
   body's leading is the same "about four lines" the owner asked for, and a
   max-height leaves the overflow measurable. */
.dashboard-card__description.is-clamped:not(.is-open) .dashboard-card__description-text {
  max-height: calc(4 * var(--leading-body) * 1em);
  overflow: hidden;
}

.dashboard-card__clamp-toggle {
  display: inline-block;
  margin-top: var(--space-1);
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  color: var(--link);
  cursor: pointer;
}

.dashboard-card__clamp-toggle[hidden] {
  display: none;
}

/* A sidebar row's secondary text is one word or a short status ("Active"), so it
   is never the thing that gives way: without its own line and `flex: none` the
   flex row shrinks it below its content width and breaks it mid-word
   ("Acti / ve"). The record's name is the part that wraps instead, inside its
   own `min-width: 0` box (task104, owner report 2026-10-01). */
.dashboard__sidebar-sub {
  flex: none;
  margin-left: auto;
  font-size: var(--text-meta);
  color: var(--muted);
  white-space: nowrap;
}

/* Same for the badge a sidebar row carries ("No next action"): it is a label,
   not a paragraph, and the row must not squeeze it onto two lines either. */
.dashboard__sidebar-item .dashboard__flag,
.dashboard__sidebar-item .gtd-badge {
  flex: none;
  margin: 0;
  white-space: nowrap;
}

.dashboard__sidebar-more {
  display: inline-block;
  margin-top: var(--space-1);
  font-weight: 700;
}

.dashboard__sidebar-add {
  margin-top: var(--space-1);
}

/* The jump bar: a row of pill links under the header, hidden on phones. */
.dashboard__jump {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.dashboard__jump-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: var(--text-label);
  font-weight: 700;
  text-decoration: none;
}

.dashboard__jump-count {
  padding: 0 0.4rem;
  background: var(--status-neutral-surface);
  color: var(--status-neutral-ink);
  border-radius: var(--radius-pill);
  font-size: var(--text-micro);
}

@media (max-width: 61.99rem) {
  .dashboard__jump {
    display: none;
  }
}

.dashboard__region-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-section);
}

.dashboard__group-title {
  margin: var(--space-2) 0 var(--space-1);
  font-size: var(--text-row-title);
}

.dashboard__empty {
  margin: 0;
  padding: var(--space-2) 0;
  color: var(--muted);
  border: 0;
  border-radius: 0;
}

.dashboard__projects,
.dashboard__initiatives,
.dashboard__notes,
.dashboard__events {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dashboard__project,
.dashboard__initiative,
.dashboard__note,
.dashboard__event {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem var(--space-2);
}

.dashboard__project-name,
.dashboard__initiative-name,
.dashboard__note-name,
.dashboard__event-name {
  font-size: var(--text-row-title);
  font-weight: 700;
}

.dashboard__project-status,
.dashboard__initiative-status,
.dashboard__note-type {
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.dashboard__project-due,
.dashboard__note-date,
.dashboard__event-date,
.dashboard__event-time {
  font-size: var(--text-meta);
  color: var(--muted);
}

.dashboard__note-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem var(--space-2);
}

/* The preview is the note's body as parsed Markdown (task072 AC8), so the
   panel stays compact by clamping the rendered block the way `/notepad`'s
   cards do, rather than by cutting the body to characters on the way out. */
.dashboard__note-preview {
  flex: 1 1 100%;
  max-height: var(--preview-clamp);
  margin: 0.2rem 0 0;
  color: var(--muted);
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* The context column: a section of linked records, separated by its own rule
   rather than by a box around it.

   Task103 (owner decision, 2026-09-30): the column carries no top border and no
   top padding, so its first card lines up with the top of the first card in the
   main column instead of hanging a rule and a gap above it. */
.dashboard__sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.dashboard__sidebar-title {
  margin: 0 0 var(--space-1);
  font-size: var(--text-row-title);
}

/* A sidebar section's title and each record it lists carry the kind's own icon
   before the text, with the same one-type-step gap the other icons use, so the
   icon never grows the row or wraps the name (Task096). */
.dashboard__sidebar-title .icon,
.dashboard__sidebar-item .icon {
  margin-right: 0.4em;
}

.dashboard__sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* The row is a flex line again (task103, review finding R1-F6), so a linked
   record's name and its secondary text are two facts side by side with a real
   gap between them rather than one run-together string. The name keeps the
   slack and wraps inside its own box; the separation is the name's own right
   margin, which is outside both boxes, so it holds even when a long name fills
   the row -- the secondary text's padding sat inside its own box, where a
   measured gap of the two rendered boxes could not see it. */
.dashboard__sidebar-item {
  display: flex;
  align-items: baseline;
  padding: 0.25rem 0;
  overflow-wrap: anywhere;
}

.dashboard__sidebar-item a {
  min-width: 0;
  margin-right: var(--space-2);
}

.dashboard__sidebar-empty {
  margin: 0;
  color: var(--muted);
}

/* A dashboard without a context sidebar fills the width instead of leaving the
   sidebar's column empty. */
.dashboard__body--single {
  grid-template-columns: minmax(0, 1fr);
}

/* The header's own health flags, deadline and light context. A flag is a
   warning, so it is readable without being an error. */
.dashboard__flag {
  margin: 0.2rem 0 0;
  padding: 0.35rem 0.6rem;
  background: var(--status-waiting-surface);
  border-left: 3px solid var(--status-waiting-ink);
  border-radius: var(--radius-sm);
  color: var(--status-waiting-ink);
  overflow-wrap: anywhere;
}

.dashboard__deadline {
  margin: 0.2rem 0 0;
}

.dashboard__deadline-label {
  font-weight: 700;
  color: var(--muted);
}

/* The deadline's date-fact icon belongs to the line it opens, with the same
   one-type-step gap every other icon uses (Task096). */
.dashboard__deadline .icon {
  margin-right: 0.4em;
}

/* A person's contact details are decisive facts, so they are summary lines in
   the same shape as the deadline above: a bold muted label and the value. No
   marker, because these are not a list of options. */
.dashboard__contact {
  margin: 0.2rem 0 0;
}

.dashboard__contact-label {
  font-weight: 700;
  color: var(--muted);
}

/* The record's own status control and the completed-horizon form. Both work
   without JavaScript; the scripts only make the status menu faster. */
.dashboard__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.dashboard__status-control {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.dashboard__status-menu {
  position: absolute;
  z-index: 5;
  top: 100%;
  left: 0;
  margin-top: var(--space-0);
  padding: var(--space-1);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-popup);
}

.dashboard__status-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-0);
  list-style: none;
  margin: 0;
  padding: 0;
}

.dashboard__status-item {
  width: 100%;
  text-align: left;
}

.dashboard__status-message {
  flex: 1 1 100%;
  margin: 0;
  font-size: var(--text-meta);
  color: var(--muted);
}

.dashboard__status-message--error {
  color: var(--danger);
}

.dashboard__horizon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: var(--space-2);
}

.dashboard__horizon-label {
  font-size: var(--text-meta);
  color: var(--muted);
}

/* The Completed card's horizon control is compact and sits in the card's
   header row, after the title, so it reads as part of the heading rather
   than as a line above the rows (task 103). */
.dashboard-card__summary .dashboard__horizon {
  margin: 0 0 0 auto;
  gap: var(--space-1);
}

.dashboard-card__summary .dashboard__horizon-label,
.dashboard-card__summary .dashboard__horizon-select {
  font-size: var(--text-meta);
}

.dashboard-card__summary .dashboard__horizon-select {
  width: auto;
  max-width: 9rem;
  padding: 0.1rem 0.3rem;
}

.dashboard-card__summary .dashboard__horizon-show {
  padding: 0.1rem 0.5rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: inherit;
  font: inherit;
  font-size: var(--text-meta);
  font-weight: 700;
  cursor: pointer;
}

/* The action record page's own state chips (task071). They are the same
   `.gtd-badge`s a row shows, laid out with the row's own spacing and wrapping,
   so one action's state reads identically in a list and on its own page. */
.action-page__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
}

/* ==========================================================================
   13. Notepad and notes
   --------------------------------------------------------------------------
   `/notepad`: a compact list and a card grid of the same filtered notes. The
   card preview is clamped here, and the expand-all control removes the clamp
   by setting data-notepad-expanded on the page root. The note's own body keeps
   the editor's .markdown-view classes, so parsed Markdown looks the same here
   as on a record page.
   ========================================================================== */

.notepad__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
}

.notepad__aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.notepad__count {
  color: var(--muted);
}

.notepad__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2);
  margin: var(--space-2) 0;
}

.notepad__filter {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.notepad__filter-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.notepad__clear {
  font-size: var(--text-meta);
}

.notepad__views {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.notepad__view {
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.notepad__view--current {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--on-navy);
}

.notepad__expand {
  margin-left: auto;
}

.notepad-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Capture rows are an application list, never a browser-marked list. */
.capture-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.capture-outputs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notepad-note {
  padding: var(--space-2) 0;
}

.notepad-note__head,
.notepad-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem var(--space-2);
}

.notepad-note__title,
.notepad-card__title {
  font-size: var(--text-row-title);
  font-weight: 700;
}

.notepad-note__type {
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.notepad-note__date {
  font-size: var(--text-meta);
  color: var(--muted);
}

.notepad-note__excerpt {
  margin: 0.3rem 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.notepad-note__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem var(--space-2);
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  font-size: var(--text-meta);
}

.notepad-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.notepad-card {
  min-width: 0;
  padding: var(--space-3);
}

/* The clamp is a fixed design value, shared with its release below. */
.notepad-card__preview {
  max-height: var(--preview-clamp);
  margin-top: 0.3rem;
  overflow: hidden;
}

[data-notepad-expanded="true"] .notepad-card__preview {
  max-height: none;
}

/* The note's own page. The body is the document; the linked records are the
   layout's context column. */
.note-page__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem var(--space-2);
  margin: 0.3rem 0 0;
}

.note-page__type {
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.note-page__date {
  font-size: var(--text-meta);
  color: var(--muted);
}

.note-page__source {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
}

.note-page__source-label {
  font-weight: 700;
  color: var(--muted);
}

/* ==========================================================================
   14. Agenda and events
   --------------------------------------------------------------------------
   `/agenda` and an event's own page. The agenda reuses the GTD page
   vocabulary and adds what a day list needs: a day heading, its items, and the
   all-day and birthday badges.
   ========================================================================== */

.agenda-page__title {
  margin-bottom: 0;
}

.agenda-page__description {
  margin: 0.35rem 0 var(--space-2);
  color: var(--muted);
}

.agenda-page__period {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: var(--text-meta);
}

.agenda__period {
  margin-bottom: var(--space-4);
}

.agenda__count {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: var(--text-meta);
  font-weight: 700;
}

.agenda__day {
  margin-bottom: var(--space-3);
}

.agenda__date {
  margin: 0 0 var(--space-1);
  font-size: var(--text-row-title);
}

/* The day's items are a plain list, so it carries no marker or indent. */
.agenda__items {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Each item is a rule-separated line sharing the primitives' row treatment. */
.agenda__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem var(--space-2);
  min-width: 0;
}

.agenda__name {
  font-weight: 700;
}

.agenda__time {
  font-size: var(--text-meta);
  color: var(--muted);
}

.agenda__badge {
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  font-size: var(--text-micro);
  font-weight: 700;
  background: var(--status-neutral-surface);
  color: var(--status-neutral-ink);
}

.agenda__badge--all-day {
  background: var(--status-active-surface);
  color: var(--status-active-ink);
}

.agenda__badge--birthday {
  background: var(--status-someday-surface);
  color: var(--status-someday-ink);
}

/* A reminder is told apart from the kind of record it belongs to (task 075), on
   every surface that lists one. The treatment belongs to the variant rather
   than to any one declaration, so a birthday that carries a lead is drawn the
   same way a note's reminder is: the waiting pair's pale surface, its ink for
   the words, and the bell mark before them. It is the same "waiting on you"
   meaning the status pair already carries, which is why it is that pair and
   not a new colour (the owner's presentation decision of 2026-09-23). */
.agenda__item--reminder {
  padding: 0.2rem var(--space-2);
  background: var(--status-waiting-surface);
  border-left: 3px solid var(--status-waiting-ink);
  border-radius: var(--radius);
  color: var(--status-waiting-ink);
}

/* The name is a link, so it carries the link colour everywhere else; inside a
   reminder it carries the reminder's own ink, which is the pair that was
   checked for contrast against the surface above. */
.agenda__item--reminder .agenda__name {
  color: var(--status-waiting-ink);
}

/* The mark leads the item's own line, so it reads as the item's marker rather
   than as part of the name. */
.agenda__item--reminder [data-gtd-reminder-mark] {
  align-self: center;
}

/* The section a page groups its reminders into -- Today, Upcoming and the Home
   dashboard's Today card all read the same items, so they read the same
   section. */
.gtd-reminders {
  margin: var(--space-3) 0 0;
}

.gtd-reminders__title {
  margin: 0 0 var(--space-1);
  font-size: var(--text-label);
  font-weight: 700;
  color: var(--muted);
}

/* The one reminder section, at the top of `<main>` on every page (task081
   items 10-12). It is the `/today` page's own section, full width, so it is not
   inside a card and not inside the header; it is absent from the page entirely
   when there is nothing outstanding, so a page without reminders has no
   reserved space. */
.gtd-reminder-section {
  width: 100%;
}

.gtd-reminder-section .gtd-reminders {
  margin: 0 0 var(--space-3);
}

/* A reminder about the record the page being read is about is marked, so the
   connection between the page and the warning about it is visible -- a
    different colour and a firmer left rule than the item's resting
   waiting pair, which is what made the first attempt invisible: it set the
   very border and fill the item already had (task081 item 3, owner report
   2026-09-26). The pair used here is the danger pair, because being on the
   record the warning is about is a stronger signal than the reminder's own. */
.agenda__item--own-record {
  border-left: 5px solid var(--danger);
  background: var(--danger-surface);
  color: var(--danger);
}

.agenda__item--own-record .agenda__name,
.agenda__item--own-record [data-gtd-reminder-mark] {
  color: var(--danger);
}

/* The row's own source date, beside its overdue badge: the day the reminder is
   about, worded from the field's declared label. It is not a status, so it
   wears the neutral line and ink rather than a status pair. */
.agenda__badge--source {
  background: var(--pale-grey);
  color: var(--muted);
}

/* A card of the agenda is the page's leading days, so its own item list needs
   no further layout; only the day heading is smaller inside a card. */
.agenda-card .agenda__date {
  font-size: var(--text-label);
}

/* An event's own page. The schedule reuses the read-only block markup, so only
   the header's own lines and the context list are added. */
.event-page__location,
.event-page__source,
.event-page__context {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
}

.event-page__location-label,
.event-page__source-label,
.event-page__context-label {
  font-weight: 700;
  color: var(--muted);
}

.event-page__context {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem var(--space-2);
  list-style: none;
  padding: 0;
}

.event-page__context-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem;
}

/* The read-only block a detail template places outside the record table. */
.record-block {
  margin: 0 0 var(--space-3);
}

.record-block:last-child {
  margin-bottom: 0;
}

.record-block-label {
  font-size: var(--text-label);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.record-block-value {
  overflow-wrap: anywhere;
}

/* A polymorphic source reads as the related record's own name, with the module
   it belongs to beside it as meta rather than in parentheses (task072 AC9). */
.relation-source__type {
  margin-left: 0.4rem;
  font-size: var(--text-meta);
  color: var(--muted);
}

/* ==========================================================================
   15. Calendar
   --------------------------------------------------------------------------
   `/calendar`. The page owns the heading, the kind toggles that hide one kind
   of item, and the line a failed fetch is reported on; the vendored FullCalendar
   library owns the board and injects its own stylesheet at load, so this adds
   the page's own parts, one colour per kind, and the dimming of what the
   service reported as completed. The board is given this application's colours
   rather than the library's defaults, so a period reads as part of the same
   site as the agenda.
   ========================================================================== */

.calendar-page__title {
  margin-bottom: 0;
}

.calendar-page__description {
  margin: 0.35rem 0 var(--space-2);
  color: var(--muted);
}

.calendar-page__views {
  margin: 0 0 var(--space-3);
  color: var(--muted);
  font-size: var(--text-meta);
}

/* The kinds' own surface is the one the filter bar and the cards wear, chosen
   once for task081 items 5, 6 and 8, and the "Show" word is the row's first
   item rather than a `<legend>` the browser drew outside it. The label
   therefore lines up with the first toggle by construction; it carries the
   toggles' own height so the baseline and left edge match rather than sitting
   a few pixels high. Task081 item 8. */
.calendar-page__kinds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem var(--space-3);
  margin: 0 0 var(--space-3);
  padding: var(--space-1) var(--space-2);
  background: var(--pale-grey);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.calendar-page__kinds-legend {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  padding: 0 0.35rem;
  font-weight: 700;
  color: var(--muted);
}

.calendar-page__kind {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: var(--target-min);
  cursor: pointer;
}

.calendar-page__error {
  margin: 0 0 var(--space-3);
  padding: 0.65rem;
  border-left: 4px solid var(--danger);
  background: var(--danger-surface);
  color: var(--danger);
  font-weight: 650;
}

.calendar-page__noscript {
  color: var(--muted);
}

.calendar-page__board {
  padding: var(--space-2) 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

/* A surfacing kind's colour is declared, not listed here (task 074). A
   declaration names a task 066 semantic token and the page puts that token's
   name on the chip and on every board item of the kind, so these rules map a
   token to the property the chip and the item read -- they name the palette's
   own colours rather than the kinds, and a new declaration that names one
   needs no rule at all. */
.calendar-colour--navy {
  --calendar-item-color: var(--navy);
}

.calendar-colour--status-overdue-ink {
  --calendar-item-color: var(--status-overdue-ink);
}

.calendar-colour--status-waiting-ink {
  --calendar-item-color: var(--status-waiting-ink);
}

.calendar-colour--status-active-ink {
  --calendar-item-color: var(--status-active-ink);
}

.calendar-colour--status-someday-ink {
  --calendar-item-color: var(--status-someday-ink);
}

.calendar-colour--status-scheduled-ink {
  --calendar-item-color: var(--status-scheduled-ink);
}

.calendar-colour--status-neutral-ink {
  --calendar-item-color: var(--status-neutral-ink);
}

.calendar-colour--danger {
  --calendar-item-color: var(--danger);
}

.calendar-page__kind .calendar-item {
  padding: 0.1rem 0.5rem;
  border-left: 4px solid var(--calendar-item-color);
  border-radius: var(--radius-pill);
  background: var(--status-neutral-surface);
  color: var(--calendar-item-color);
  font-size: var(--text-label);
  font-weight: 700;
}

/* The board's own items are filled blocks of their kind's colour. */
.fc .fc-event.calendar-item {
  background: var(--calendar-item-color);
  border-color: var(--calendar-item-color);
  border-left: 4px solid var(--calendar-item-color);
  color: var(--on-navy);
}

/* A reminder is not filled with its kind's colour like every other item
   (task 075): it is drawn on the pale "waiting" surface in that pair's own ink, so
   it reads as a reminder whatever kind it belongs to, a birthday included.
   The item stays the record's link and carries no control, so this rule states
   a treatment and nothing more (the owner's presentation decision of
   2026-09-23). */
.fc .fc-event.calendar-item--reminder {
  background: var(--status-waiting-surface);
  border-color: var(--status-waiting-ink);
  border-left: 4px solid var(--status-waiting-ink);
  color: var(--status-waiting-ink);
}

/* The label beside a reminder's name is a chip on the item, so it takes the
   item's own surface and ink rather than the neutral chip the rest use. */
.calendar-item--reminder .calendar-item__label {
  background: transparent;
  color: var(--status-waiting-ink);
}

/* The mark leads the name, as it does in the lists. */
.calendar-reminder [data-gtd-reminder-mark] {
  align-self: center;
}

/* A completed item and a completed occurrence are still shown -- a period's
   history is part of what it answers -- but they read as done: dimmed, with
   the title struck through. A skipped occurrence is not an item at all,
   because the service does not produce one. */
.fc .fc-event.calendar-item--completed {
  opacity: 0.55;
}

.fc .fc-event.calendar-item--completed .fc-event-title {
  text-decoration: line-through;
}

/* An item the page draws itself -- a reminder, and every item whose field
   declares a label (task 075) -- still reads as its kind's item, because the
   kind's colour reaches it the same way: the fill and the declared word both
   come from the token the item's own class names. The label is the field's
   declaration, shown beside the name exactly as the agenda shows it. */
.calendar-reminder,
.calendar-surfaced {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
}

.calendar-reminder__name,
.calendar-surfaced__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The reminder's own ink (task 075), stated on the item the page draws, so it
   reaches the name in a grid cell and in a list row alike -- a list row's
   colour comes from the row rather than from the grid block above. */
.calendar-reminder {
  color: var(--status-waiting-ink);
}

.calendar-item__label {
  padding: 0 0.35rem;
  border-radius: var(--radius-pill);
  background: var(--status-neutral-surface);
  color: var(--calendar-item-color, var(--navy));
  font-size: var(--text-label);
  font-weight: 700;
}

/* The narrow view draws the same items as rows of a table, and a table row
   cannot be narrower than its own content: a name that does not wrap makes the
   whole list wider than the screen, because every row is as wide as the widest
   one. The nowrap above is for a grid cell, which is a fixed shape; a list row's
   name therefore wraps rather than widening the row. */
.fc-list-event-title .calendar-reminder__name,
.fc-list-event-title .calendar-surfaced__name {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

/* ==========================================================================
   16. Checklists
   --------------------------------------------------------------------------
   The checklist editor, a record's run panel and the run's own page. A row
   wraps rather than overflowing: at a phone width the text field takes the
   first line and the controls, each still a target, take the next.
   ========================================================================== */

.checklist-editor-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist-editor-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--rule);
}

.checklist-editor-item:last-child {
  border-bottom: 0;
}

.checklist-editor-item-text {
  flex: 1 1 12rem;
  min-width: 0;
}

.checklist-editor-item .button {
  flex: 0 0 auto;
  min-width: var(--target-min);
  padding: 0.35rem 0.6rem;
}

.checklist-editor-controls {
  margin-top: 0.5rem;
}

.checklist-editor-empty {
  margin: 0;
  color: var(--muted);
}

.checklist-editor-broken {
  margin: 0;
  color: var(--danger);
  font-weight: 650;
}

.checklist-view {
  margin: 0;
  padding-left: 1.2rem;
}

.checklist-view-item {
  overflow-wrap: anywhere;
}

.checklist-panel {
  margin: var(--space-4) 0;
}

/* The panel that starts a run and lists the runs a record already has. */
.checklist-start {
  margin: var(--space-3) 0;
  padding: var(--space-3);
  background: var(--warm-white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.checklist-start__title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-subsection);
}

/* On a checklist's own page the start control is the page's one visible
   primary control, so it takes the header's shape rather than the panel a
   record's page shows it in: no box, no heading, and the button itself carries
   the primary ink. Everything inside the form is unchanged, so the browser
   half drives it wherever it sits. */
.checklist-start--control {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}

/* How many steps a checklist holds: the one decisive fact about a template,
   stated under its name rather than as a chip, because a checklist has no
   state to settle and this number only describes what the record contains. */
.checklist-page__items {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.checklist-start__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.checklist-start__field {
  font-weight: 700;
}

.checklist-start__help,
.checklist-start__message {
  flex: 1 1 100%;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-meta);
}

.checklist-start__message[data-checklist-start-message]:empty {
  display: none;
}

.checklist-start__message[data-checklist-start-message][role="alert"] {
  color: var(--danger);
  font-weight: 650;
}

.checklist-runs {
  margin: var(--space-3) 0;
}

.checklist-runs__title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-subsection);
}

.checklist-runs__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.checklist-runs__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem var(--space-2);
}

.checklist-runs__link {
  font-weight: 700;
}

.checklist-runs__date {
  font-size: var(--text-meta);
  color: var(--muted);
}

.checklist-run {
  min-width: 0;
}

.checklist-run__progress {
  display: inline-block;
  margin: 0 0 var(--space-2);
  font-weight: 700;
  color: var(--navy);
}

.checklist-run__message {
  margin: var(--space-2) 0 0;
  color: var(--muted);
}

.checklist-run__message:empty {
  display: none;
}

.checklist-run__message[role="alert"] {
  color: var(--danger);
  font-weight: 650;
}

.checklist-run__meta {
  margin: 0 0 0.2rem;
  overflow-wrap: anywhere;
}

.checklist-run__label {
  font-size: var(--text-label);
  font-weight: 600;
  color: var(--muted);
}

.checklist-run__flag {
  margin: 0.4rem 0 0;
  font-weight: 700;
}

.checklist-run__linked {
  margin: 0;
  overflow-wrap: anywhere;
}

.checklist-run-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Each item's label is a full-height target, so a phone can check an item
   without missing it. */
.checklist-run-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem var(--space-2);
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
}

.checklist-run-item:last-child {
  border-bottom: 0;
}

.checklist-run-item__label {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--target-min);
  font-weight: 600;
  cursor: pointer;
}

.checklist-run-item__text {
  overflow-wrap: anywhere;
}

.checklist-run-item__stamp {
  font-size: var(--text-meta);
  color: var(--muted);
}

.checklist-run-item[data-checklist-run-checked="1"] .checklist-run-item__text {
  color: var(--muted);
  text-decoration: line-through;
}

/* ==========================================================================
   17. Third-party overrides
   --------------------------------------------------------------------------
   Rules that adapt a vendored stylesheet or script to this interface. The
   vendored files themselves are never edited.
   ========================================================================== */

/* tom-select: the multi-select control is a field, so it matches the other
   fields' outline, height and radius. */
.ts-control,
.ts-wrapper.single .ts-control {
  min-height: 42px;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface);
  box-shadow: none;
}

/* A single selected value and the control's own search field share one line:
   the selected state is the same height as the empty one, and a value longer
   than the control is truncated with an ellipsis instead of widening the
   control or wrapping onto a second line. Task085 R1-F1. */
.ts-wrapper.single .ts-control {
  flex-wrap: nowrap;
}

.ts-wrapper.single .ts-control > .item {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A selected control yields the room its value needs to that value, so the
   value keeps a readable width instead of being squeezed to nothing next to
   the field's own minimum; with no value the search field keeps that minimum,
   which is the width the empty control already had. */
.ts-wrapper.single.has-items .ts-control > input {
  flex: 1 1 3rem;
  min-width: 2.5rem;
}

/* A GTD filter keeps the filter column's own width when the shared searchable
   control enhances it, and never grows past it. The control replaces the
   `<select>` inside `.gtd-filter-control`, whose column is `10rem`, and Tom
   Select's own wrapper is `width: 100%` by default -- which on a narrow column
   would otherwise overflow it. The column is a fixed width (task085 R1-F1),
   and a selected value truncates inside it (above), so this is true in the
   empty, focused, selected and blurred states alike. Task081 item 4. */
.gtd-filter-control .ts-wrapper {
  width: 100%;
  min-width: 0;
}

/* The filter's own dropdown sits above the rows it filters, and wraps a long
   record name rather than widening. A filter never offers the create entry
   (the control carries no `data-module`), so there is no create option to
   style. Task081 item 4. */
.gtd-filter-control .ts-dropdown {
  z-index: 30;
  min-width: 12rem;
}
.gtd-filter-control .ts-dropdown .option,
.gtd-filter-control .ts-dropdown .no-results {
  overflow-wrap: anywhere;
}

/* A selected value is a chip in the structure colour. */
.ts-wrapper.multi .ts-control [data-value] {
  background: var(--navy-light);
  color: var(--on-navy);
  overflow-wrap: anywhere;
  max-width: 100%;
}

/* Overtype (the bundled markdown editor): a visible border like every other
   field; a short empty state that expands on focus or content, never below
   the established editing minimum once active; and a monospace content size
   small enough that a long unbroken token wraps at a wider interval. */
.overtype-container {
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
}

.overtype-wrapper {
  border: none;
  transition: max-height 0.15s ease;
}

.overtype-wrapper:has(.overtype-input:placeholder-shown):not(:focus-within) {
  max-height: 60px;
  overflow: hidden;
}

.overtype-input,
.overtype-preview {
  font-size: var(--text-micro);
}

/* Overtype hides its own syntax markers; this stylesheet only guarantees they
   stay hidden in the rendered view. */
.overtype-content span.syntax-marker {
  display: none;
}

/* a11y-dialog: the vendored sheet owns the geometry and the scroll; this adds
   the application's surface colour and radius, and that much applies to every
   dialog. */
.dialog-content {
  background: var(--surface);
  border-radius: var(--radius);
}

/* Only a create dialog is widened past the vendored 700px cap (task078 AC10):
   it holds the densest widget in the application, an event's time controls
   with recurrence switched on, and that fits a wider box without a control
   being squeezed or the dialog scrolling sideways. A confirmation -- delete
   and the two occurrence dialogs -- holds only a heading, a short warning and
   its controls, so it deliberately keeps the vendored compact width. The
   override lives here rather than in the vendored file so it survives an
   update of that library; the 90% term is kept, so a narrow viewport still
   governs. */
.relation-create-dialog .dialog-content {
  max-width: min(90%, var(--dialog-width));
  width: var(--dialog-width);
}

/* ==========================================================================
   18. Responsive
   --------------------------------------------------------------------------
   Every narrow-viewport rule, in one place so it always wins over the base
   rule it adjusts. The breakpoint is the phone one: below it the header
   collapses into its menu toggle, the form label column folds above its
   field, and every control takes the full width.
   ========================================================================== */

/* Between the phone menu and the wide band the header search is an icon that
   opens its field over the band rather than a 14rem field taking width from the
   navigation row (task088 R1-F1). Without it the row cannot stay on one line at
   these widths, and task067's row (with the search control added to the band)
   is what regressed. These are the phone block's own rules, hoisted to the
   wider breakpoint; the phone block below adds only what the collapsed menu
   needs on top. Above `72rem` the field sits in the row again. */
@media (max-width: 72rem) {
  /* The opened field is positioned against the header band's inner width --
     not the row -- so opening it never grows the band and never moves the
     brand, Quick Add or the sign-out control. `.site-header` is already a
     positioning context; naming the inner here keeps the field inside the
     band's own gutters instead of spanning the whole viewport. */
  .site-header__inner {
    position: relative;
  }

  /* Below `72rem` the band holds everything at once and the row has the least
     width it ever has: the brand, the seven workflow and reading destinations
     plus "More", the Quick Add control, the search icon and the sign-out form.
     Task088's owner scope change put Calendar and Notepad back in the row at
     the same time as the search icon arrived, so the band's own gap and the
     row links' side padding are tightened here -- not the destinations, and
     not any target size, which stays at the 44px minimum -- to keep the row on
     one line from 1024px up. Task067's row is a workflow the owner reads in one
     glance, so a second line is a regression rather than a wrap. */
  .site-header__inner {
    gap: var(--space-2);
  }

  .primary-navigation a {
    padding: 0.65rem 0.5rem;
  }

  /* The brand is the fourth fixed-width item in the band, and below `72rem` it
     is the one that grew (task094) -- "KvZH" was 56px next to the 114px the
     artboard's 28px mark and 23px word need. That extra 58px is more than the
     row can give at 992-1050px, where the row has the least width it ever has,
     so the brand is scaled down here (18px mark, 14px word, 6px gap: the same
     drawing at 0.64, mark still leading the word) rather than shrinking a
     destination or a target. Above `72rem` the band has the room and the brand
     is the artboard's own 28px and 23px. */
  .site-brand {
    gap: var(--brand-gap-compact);
    font-size: var(--text-wordmark-compact);
  }

  .site-brand__mark {
    width: var(--brand-mark-compact);
    height: var(--brand-mark-compact);
  }

  /* Below `72rem` there is no search field in the row to yield -- the field is
     the icon until it is opened -- so the row and the band wrap again, exactly
     as they did before this change: the widths below the phone breakpoint are
     the documented limitation, not something this promise covers. */
  .primary-navigation,
  .primary-navigation__row {
    flex-wrap: wrap;
  }

  .primary-navigation__row {
    flex: 1;
    min-width: 0;
  }

  .nav-search__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--target-min);
    min-height: var(--target-min);
    padding: 0;
    border: 1px solid var(--nav-link);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--on-navy);
    cursor: pointer;
  }

  .nav-search__toggle:hover,
  .nav-search__toggle:focus-visible {
    background: var(--navy-light);
  }

  .nav-search__toggle .icon {
    width: 1.25rem;
    height: 1.25rem;
  }

  .nav-search__form {
    display: none;
  }

  /* The opened field is one row: the input takes the width it can and the close
     control sits at the end of it, both inside the band's own gutters. */
  .nav-search.is-open .nav-search__form {
    display: flex;
    align-items: center;
    gap: var(--space-0);
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 30;
    padding: var(--space-1) 0;
    background: var(--navy);
  }

  .nav-search.is-open .nav-search__input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }

  /* The close control is the field's own target on the navy band, so it takes
     the band's light ink and the same 44px box the toggle beside it uses. */
  .nav-search__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--target-min);
    min-height: var(--target-min);
    padding: 0;
    border: 1px solid var(--nav-link);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--on-navy);
    cursor: pointer;
  }

  .nav-search__close:hover,
  .nav-search__close:focus-visible {
    background: var(--navy-light);
  }

  .nav-search.is-open .nav-search__suggestions {
    width: 100%;
    max-width: none;
  }
}

/* The phone menu opens as a full-width panel under the header bar (task090).
   --------------------------------------------------------------------------
   Where the phone layout starts is measured, not chosen: on the real signed-in
   header (brand, the workflow row with "More", Quick Add, the search control
   and Sign out) the row no longer fits on one line at 980px -- one line at
   981px, wrapped at 980px. The breakpoint is 62rem (992px), just above that
   measured wrap point, so no width shows a wrapped desktop row. The owner's
   own observation of the wrap is 910px; `docs/architecture.md` records both.
   Task067's decision to collapse the row into the menu toggle at 44rem is
   superseded here -- the collapse now happens at the width the row actually
   needs, which is this task's whole point.

   The band itself does not change. The panel is taken out of the band's flow
   (absolutely positioned, drawn out to the viewport's own edges and over the
   page), so opening the menu leaves the brand, Menu, Quick Add and search at
   the same positions and the band at the same height. */
@media (max-width: 62rem) {
  /* Shell: the same single band line the closed menu has, and the positioning
     context the opened panel is drawn against. */
  .site-header__inner {
    position: relative;
    flex-wrap: wrap;
    /* A tighter gap than the desktop band's, and still a real gap, so the
       brand, the Quick Add control and the menu toggle share one line even at
       the narrowest phone width (task046). */
    gap: var(--space-0);
    padding: var(--space-1) 0;
  }

  /* The band's controls are two groups, not four spread controls (task090
     R2-F1). The brand and the Menu button are the left group, and they sit
     together at the band's start: the base `.menu-toggle` rule's
     `margin-left: auto`, which would push the Menu button away from the brand,
     is cancelled here. The one auto margin left in the band is on
     `.nav-quick-add` below, and it is what holds the right-hand group (Quick
     Add and the search icon) together at the band's end. */
  .menu-toggle {
    display: inline-flex;
    margin-left: 0;
  }

  /* The closed navigation is out of the band's flow, so it neither draws
     anything nor takes a row: the band is exactly what it is with the menu
     closed. */
  .primary-navigation {
    display: none;
  }

  /* The open menu is a panel beneath the band, one viewport wide. It is
     positioned against `.site-header__inner`, whose gutters are exactly
     `--space-3` (1rem) at every width this block covers -- the inner is
     `100% - 2rem` wide and centred -- so a negative left/right of one gutter
     cancels them and the panel spans the viewport exactly. `top` is the
     inner's own height plus the band's 1px bottom border, so it sits directly
     under the bar whatever the band's height is. It overlays the page instead
     of pushing it down, and caps itself to the viewport height so a long list
     scrolls within the panel. The inline padding is the band's gutter minus a
     link's own padding, so the panel's words line up with the brand's. */
  .primary-navigation.is-open {
    display: flex;
    flex-direction: column;
    /* The 72rem block above wraps the navigation and its row so the band can
       stack them; inside this panel that wrap is what pushed the sign-out form
       into a second column beside the row (task090 R1-F1). The panel is a
       single column of full-width rows, so nothing here may wrap. */
    flex-wrap: nowrap;
    align-items: stretch;
    position: absolute;
    top: calc(100% + 1px);
    right: calc(-1 * var(--space-3));
    left: calc(-1 * var(--space-3));
    z-index: 20;
    max-height: calc(100vh - 4rem - 1px);
    overflow-y: auto;
    padding: var(--space-1) calc(var(--space-3) - 0.7rem);
    border-top: 1px solid var(--nav-divider);
    background: var(--navy);
    box-shadow: var(--shadow-popup);
  }

  /* One item per row. The workflow row and the desktop "More" panel's own
     list both stack, and every link fills its row with a comfortable touch
     target. `flex-wrap: nowrap` overrides the 72rem block's wrap on the row as
     well as on the panel above, so a row item can never wrap into a second
     column of the single-column list. */
  .primary-navigation__row {
    flex: 0 0 auto;
    min-width: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
  }

  .primary-navigation__row > li,
  .nav-more__panel > li {
    display: flex;
  }

  .primary-navigation__row > li > a,
  .primary-navigation .nav-more a {
    flex: 1;
  }

  /* One list, one row rhythm (task090 R1-F2). The workflow row's own items and
     the destinations the desktop hides behind "More" are the same flat list
     here, so they must share one left padding, one row height and one gap. The
     base `.primary-navigation .nav-more a` rule is the compact desktop
     dropdown's (0.1rem), and it is more specific than the row's, so it is
     overridden explicitly; the row's own gap comes from `.primary-navigation__row`
     and the disclosure panel is given the same one. */
  .primary-navigation a,
  .primary-navigation .nav-more a {
    padding: 0.65rem 0.5rem;
  }

  /* No "More" step on a phone: the disclosure's trigger is not drawn, and its
     panel is always in the list, so every destination -- the workflow row's
     own, plus every browse route and module index the desktop hides behind
     "More" -- is one flat list in navigation order. The trigger is a
     `display: none` control here, so it is out of the tab order and out of the
     accessibility tree rather than a hidden second step. */
  .nav-more {
    display: block;
  }

  .nav-more__trigger {
    display: none;
  }

  .nav-more__panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    /* The same gap as `.primary-navigation__row` above, so the two halves of
       the flat list read as one list rather than two rhythms (R1-F2). */
    gap: 0.15rem;
    position: static;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .primary-navigation a {
    min-height: var(--target-min);
    display: flex;
    align-items: center;
  }

  /* The phone list shows every item's icon (task091), including the workflow
     row's own -- the icons the desktop row hides above. The row's links are
     flex rows here, so the icon and its label line up on the row's centre and
     the label keeps the row's left padding. */
  .primary-navigation__row > li > a .icon {
    display: inline-block;
  }

  /* Sign out is its own full-width row at the end of the flat list (task090
     R1-F1, the coordinator's decision on the owner's behalf): after every
     navigation destination, divided from the list by a hairline rule, and
     still clearly an action rather than a destination -- it keeps the button's
     own outlined treatment, which no link carries. It lives in the panel
     rather than the band, so the band keeps exactly the controls it has with
     the menu closed. `.primary-navigation.is-open` is `align-items: stretch`,
     so the form spans the list's width; the button fills the form. */
  .site-signout {
    display: flex;
    /* `flex: 0 0 auto` like the row above: the panel scrolls rather than
       shrinking its rows, so the button keeps its target height. */
    flex: 0 0 auto;
    width: 100%;
    margin-top: var(--space-1);
    padding-top: var(--space-1);
    border-top: 1px solid var(--nav-divider);
  }

  .site-signout button {
    flex: 1;
    min-height: var(--target-min);
    padding: 0.65rem 0.5rem;
  }

  /* The Quick Add control stays in the header band at phone width, because it
     is the header's one creation action and it must not disappear with the
     navigation the menu toggle collapses (task046). It shares the band's one
     line with the brand and the toggle rather than taking a line of its own,
     so the header does not grow taller. It carries the band's only auto margin
     (task090 R2-F1): that single `margin-left: auto` puts the free space
     between the left group (brand and Menu) and this control, so Quick Add and
     the search icon after it stay together at the band's end instead of the
     row spreading its four controls evenly. Its own right margin is zero so
     the band's ordinary gap is all there is between it and the search icon. */
  .nav-quick-add {
    display: inline-flex;
    flex-wrap: nowrap;
    order: 0;
    width: auto;
    margin-left: auto;
    margin-right: 0;
  }

  /* The primary action and the caret keep their own widths; the brand and the
     toggle never shrink, so the free space is the control's to take. Task088
     (owner scope change): the primary action is an icon button and its
     `min-width` is the 44px touch target, so it must not shrink below it --
     `0 0 auto` is what keeps the target whole on the narrowest phone. */
  .nav-quick-add__primary,
  .nav-quick-add__menu {
    flex: 0 0 auto;
  }

  /* The disclosure opens as a floating panel under its summary, anchored to
     the right so it stays inside the viewport wherever the control sits on the
     line. */
  .nav-quick-add__menu .gtd-menu__popup {
    right: 0;
    left: auto;
    width: max-content;
    min-width: 13rem;
    max-width: min(22rem, calc(100vw - 2rem));
  }
}

@media (max-width: 44rem) {
  main {
    margin: var(--space-4) auto;
  }

  /* Page frame: the heading and its actions stack. */
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-actions,
  .page-actions .button,
  .page-heading > .button {
    width: 100%;
  }

  /* Forms */
  .modulebuilder form {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--space-3);
  }

  /* A group folds its label column above its fields with the form it is in. */
  .modulebuilder form .field-group__fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .modulebuilder form > label {
    padding-top: 0;
  }

  .filter.modulebuilder form button {
    grid-column: auto;
    width: 100%;
  }

  .month-options-hint {
    grid-column: auto;
  }

  .module-picker.time-input {
    flex-wrap: wrap;
  }

  .module-picker.time-input > * {
    max-width: 100%;
  }

  /* The event widget puts its paired fields on their own rows rather than
     squeezing two columns into the width. The repeat widget's own wrappers are
     not listed any more: task081 item 1 made them one column at every width in
     the widget's own style block, so there is nothing here left to override. */
  .event-wrapper .dates-outer-wrapper,
  .event-wrapper .duration-outer-wrapper {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: var(--space-2) !important;
  }

  .event-wrapper .dates-outer-wrapper,
  .event-wrapper .duration-outer-wrapper {
    align-items: stretch;
  }

  .repeat-wrapper .repeat-inner-wrapper {
    gap: var(--space-2);
  }

  .repeat-wrapper .week-options {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .duration-wrapper {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: var(--space-2) !important;
  }

  /* Tables keep a scrollable minimum rather than squeezing their columns. */
  .record-table {
    min-width: 32rem;
  }

  /* GTD views: one column, every control full width, and long names and
     values wrap instead of overflowing. */
  .gtd-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .gtd-filter-bar__row,
  .gtd-filter-bar__advanced-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .gtd-filter-control,
  .gtd-filter-bar__actions,
  .gtd-filter-bar__actions .button,
  .gtd-filter-bar__actions button {
    width: 100%;
    min-width: 0;
  }

  .gtd-filter-bar__advanced {
    align-self: stretch;
  }

  .gtd-row {
    flex-direction: column;
  }

  .gtd-row__main,
  .gtd-row__meta {
    flex: 1 1 auto;
    min-width: 0;
  }

  .gtd-row__name {
    overflow-wrap: anywhere;
  }

  .gtd-row__actions {
    flex: 1 1 auto;
    width: 100%;
  }

  .gtd-control {
    flex: 1 1 auto;
  }

  .gtd-menu {
    flex: 1 1 auto;
  }

  .gtd-menu > summary {
    width: 100%;
  }

  /* At phone width the panel becomes a full-width sheet under its summary
     rather than a floating panel that could push past the viewport edge. */
  .gtd-menu__popup {
    right: auto;
    left: 0;
    width: auto;
    min-width: 0;
    max-width: 100%;
  }

  /* The toast spans the width and wraps. */
  .action-toast {
    left: var(--space-2);
    right: var(--space-2);
    bottom: var(--space-2);
    max-width: none;
    transform: none;
    flex-wrap: wrap;
  }

  /* Dashboards */
  .dashboard__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard__actions,
  .dashboard__quick-actions {
    width: 100%;
  }

  .dashboard__actions .button,
  .dashboard__quick-actions .button {
    flex: 1 1 auto;
  }

  /* On the stacked heading the action groups (which are full width here)
     become the aside's own column (task 097). The base rule sizes the aside
     from its content, so once stacked it reserves no height of its own and
     the record's status line follows the buttons directly. */
  .dashboard__aside {
    min-width: 0;
  }

  .dashboard__controls {
    width: 100%;
  }

  .dashboard__controls .button {
    flex: 1 1 auto;
  }

  /* The status menu opens from the right edge rather than off the screen. */
  .dashboard__status-menu {
    left: auto;
    right: 0;
  }

  /* Notepad: the filter form stacks, the cards become one column, and the
     expand-all control follows the view switch instead of pushing it. */
  .notepad__aside {
    width: 100%;
  }

  .notepad__aside .button {
    flex: 1 1 auto;
  }

  .notepad__filter {
    flex: 1 1 100%;
  }

  .notepad__filter input,
  .notepad__filter select {
    width: 100%;
  }

  .notepad__expand {
    margin-left: 0;
  }

  .notepad-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Agenda: a day's item stacks its name over its time and badge, and the
     period control fills the width like the dashboards' horizon form. */
  .agenda__item {
    flex-direction: column;
    gap: 0.2rem;
  }

  .agenda__name,
  .agenda__time {
    flex: 1 1 auto;
    min-width: 0;
  }

  .agenda__period,
  .agenda__period select,
  .agenda__period button {
    width: 100%;
    min-width: 0;
  }

  .event-page__context-item {
    flex: 1 1 100%;
  }

  /* Calendar: the toggles stack and the board fills the width. The board is a
     list of the same items here, because a month grid is not readable at this
     width, so the month, week and day buttons are hidden rather than offering
     views the page does not draw. */
  .calendar-page__kinds,
  .calendar-page__kind {
    width: 100%;
  }

  .calendar-page__board {
    padding: var(--space-1) 0;
  }

  .fc .fc-dayGridMonth-button,
  .fc .fc-timeGridWeek-button,
  .fc .fc-timeGridDay-button {
    display: none;
  }

  .fc .fc-toolbar {
    flex-wrap: wrap;
    gap: var(--space-1);
  }

  /* Checklists: the start form stacks and its own action fills the width. On a
     checklist's own page the same form is the header's control, so it takes
     the header's full width here too and its message wraps under the button
     rather than forcing the heading wider than the screen. */
  .checklist-start__form {
    align-items: stretch;
  }

  .checklist-start__form > button {
    width: 100%;
  }

  .dashboard__controls .checklist-start--control,
  .dashboard__controls .checklist-start__form {
    width: 100%;
  }

  /* Pagination (task084): at phone width the summary and the page links stack
     rather than competing for one line, and the links wrap between them. */
  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination__pages {
    width: 100%;
  }
}

/* On the narrowest phones (task088) the band's own controls already fill its
   one line, so the search icon takes a row of its own rather than pushing Quick Add
   off the brand's row. The search control is the band's last element and this
   row is the whole of it, so the brand, Quick Add and the menu toggle keep the
   line they had, and showing or hiding Quick Add cannot change how many rows the
   band has. The icon is right-aligned, under the menu toggle. */
@media (max-width: 23rem) {
  .nav-search {
    flex-basis: 100%;
    justify-content: flex-end;
  }
}

/* ==========================================================================
   19. Motion
   --------------------------------------------------------------------------
   A reader who asks for less motion gets none of it, whatever the component
   intended.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
