/* ==========================================================================
   ledger.css - TCH Jozi Tasking, "Ledger" redesign (woodzgit/tasking#4)
   Production stylesheet for the /v2/ pages. Self-contained: the pages load
   no Bootstrap and no BeyondAdmin, only jQuery and this file.

   Sources (docs/design-handover/returned/):
     brand/tokens.css v1.1, tokens/ledger-tokens.css, README.md,
     designs/Ledger Toolkit.dc.html (T1-T13), Ledger Final Draft.dc.html
     (A1-A3), Ledger Web Screens.dc.html (W2, W3, W6-W8).

   Rules of the house (README "Design tokens"):
     - Square corners everywhere. Exceptions: radios, the live-timer circle.
     - Structure comes from rules, not boxes: 2px charcoal under section
       heads, 1px g15 between rows. Shadows only on menus, dialogs, toasts.
     - One red signal per view. Colours always via var(--tch-*).
     - Theme: data-theme on <html> ("light" / "dark"); absent = follow OS.
     - Text size: data-fontsize="large" on <html>; absent = Standard (#59).
     - Single layout breakpoint: 900px (below it = phone / narrow layout).

   ASCII only: this file is served beside Windows-1252 pages. Non-ASCII
   glyphs are written as CSS escapes inside content: strings.

   Contents
     01  Fonts (@font-face, self-hosted in ../fonts/)
     02  Brand tokens v1.1 (verbatim values)
     03  Ledger tokens: overrides, dark theme, reduced motion, keyframes
     04  Ledger-local hooks (theme-dependent images, extra keyframes)
     05  Reset and base
     06  Icons
     07  Shell: top bar, nav, dropdown menus, search, icon buttons, avatar
     08  Page: crumbs, head, title, tabs, section heads, rules
     09  KPI strip
     10  Filter bar, segmented toggle, inline select
     11  Buttons
     12  Forms: fields, inputs, check, radio, toggle, stepper, type cards,
         drop zone, progress, generic detail form (W7), bulk bar (W6)
     13  Badges and markers: status, pill, badge, overdue, priority, focus,
         unread dot, close stamp
     14  Table (T5 / A2) and pager
     15  Board (A2)
     16  Task detail (A3): layout, key/value, time bars, files
     17  Activity thread (T6): messages, events, composer
     18  Feedback (T8 / T9): toast, alerts, dialog, empty, skeleton
     19  Sign in (A1)
     20  Motion helpers (T12)
     21  Utilities
     22  Narrow screens (< 900px, W8)
   ========================================================================== */


/* ==========================================================================
   01  FONTS
   ========================================================================== */
@font-face {
  font-family: 'Jost';
  src: url('../fonts/jost-var.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/plexsans-var.woff2') format('woff2');
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/plexmono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/plexmono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/plexmono-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}


/* ==========================================================================
   02  BRAND TOKENS - brand/tokens.css v1.1 (The Code House, June 2026)
   Values copied verbatim. Comments transliterated to ASCII only.
   ========================================================================== */
:root {
  /* -- Brand colour -- */
  --tch-red:        #D32027;   /* primary signal - the "h", accents, links, CTAs */
  --tch-red-dark:   #9E1820;   /* hover / pressed */
  --tch-red-tint:   #FBEAEA;   /* tinted backgrounds, emphasis rows */
  --tch-charcoal:   #383838;   /* body text, the "t", dark surfaces */

  /* -- Neutral ramp -- */
  --tch-ink:        #2A2A2A;
  --tch-g70:        #5C5C5C;
  --tch-g50:        #8A8A8A;
  --tch-g30:        #B8B8B8;
  --tch-g15:        #E4E4E4;
  --tch-g08:        #F1F1F1;
  --tch-g05:        #F7F7F7;
  --tch-white:      #FFFFFF;

  /* -- Functional (data / status only - never brand surfaces) -- */
  --tch-success:    #1F8A5B;
  --tch-warning:    #C9871D;
  --tch-info:       #2C6FB0;
  --tch-error:      #D32027;

  /* -- Type -- */
  --tch-font-display: 'Jost', system-ui, sans-serif;        /* headings, logotype */
  --tch-font-body:    'IBM Plex Sans', system-ui, sans-serif;/* body, UI */
  --tch-font-mono:    'IBM Plex Mono', ui-monospace, monospace; /* data, IDs, currency */

  /* type scale (px / line-height) */
  --tch-text-display: 48px;  --tch-lh-display: 1.0;
  --tch-text-h1:      32px;  --tch-lh-h1:      1.1;
  --tch-text-h2:      22px;  --tch-lh-h2:      1.2;
  --tch-text-body:    15px;  --tch-lh-body:    1.6;
  --tch-text-caption: 11px;  --tch-lh-caption: 1.4;
  --tch-text-data:    12px;  --tch-lh-data:    1.5;

  /* -- Geometry -- */
  --tch-radius:     7px;     /* the brand radius - matches the monogram terminal */
  --tch-radius-sm:  5px;
  --tch-radius-lg:  12px;

  /* -- Spacing (8pt base) -- */
  --tch-space-1: 4px;  --tch-space-2: 8px;  --tch-space-3: 12px;
  --tch-space-4: 16px; --tch-space-5: 24px; --tch-space-6: 32px;
  --tch-space-7: 48px; --tch-space-8: 64px;

  /* -- Elevation -- */
  --tch-shadow-sm: 0 4px 14px rgba(0,0,0,.06);
  --tch-shadow-md: 0 8px 24px rgba(0,0,0,.14);
}


/* ==========================================================================
   03  LEDGER TOKENS - tokens/ledger-tokens.css (verbatim)
   Extends brand/tokens.css v1.1. NEW = not in the brand kit.
   OVERRIDE = changes a brand value.
   ========================================================================== */
:root {
  /* OVERRIDE: square corners everywhere (brand = 7px). Exceptions: radios, live-timer button. */
  --tch-radius: 0; --tch-radius-sm: 0; --tch-radius-lg: 0;

  /* NEW: desk behind pages and phones */
  --tch-canvas: #E9E9E9;

  /* NEW: task status. Text colour + tint background. Always pair with a label or shape. */
  --tch-status-pending:  #2C6FB0;  --tch-status-pending-tint:  #E8F0F8;  /* = --tch-info */
  --tch-status-progress: #B87814;  --tch-status-progress-tint: #FBF2E2;  /* darker than --tch-warning for 4.5:1 text */
  --tch-status-hold:     #6B4FA0;  --tch-status-hold-tint:     #EFEBF6;  /* new hue */
  --tch-status-actioned: #1F8A5B;  --tch-status-actioned-tint: #E4F3EC;  /* = --tch-success */
  --tch-status-complete: #7A1F2B;  --tch-status-complete-tint: #F4E6E8;  /* new, maroon */
  --tch-status-signoff:  #0F7C8A;  --tch-status-signoff-tint:  #E1F1F3;  /* new, teal: Awaiting sign-off (#40 P4) */
  --tch-status-release:  #5A6472;  --tch-status-release-tint:  #ECEEF1;  /* new, slate: Awaiting release, with the client's project manager (#67) */

  /* NEW: type steps the brand scale lacks */
  --tch-text-hero: 120px;       --tch-lh-hero: .9;
  --tch-text-display-xl: 64px;  /* page titles, KPI numerals */
  --tch-text-h1-detail: 48px;   /* task detail title */
  --tch-text-ui: 13px;          --tch-lh-ui: 1.4;

  /* NEW: text size (#59). Profile menu "Text size" sets html[data-fontsize="large"].
     Body and UI text (up to 22px) grows by --l-fs; headlines and numerals (24px+) stay. */
  --l-fs: 1;
  --tch-text-h2:      calc(22px * var(--l-fs));
  --tch-text-body:    calc(15px * var(--l-fs));
  --tch-text-caption: calc(11px * var(--l-fs));
  --tch-text-data:    calc(12px * var(--l-fs));
  --tch-text-ui:      calc(13px * var(--l-fs));

  /* NEW: motion */
  --tch-ease-out: cubic-bezier(.2,.8,.2,1);
  --tch-ease-in-out: cubic-bezier(.6,0,.2,1);
  --tch-dur-fast: 150ms;   /* press 120, toggle 200 */
  --tch-dur-base: 350ms;   /* menus 300, toasts 400, sheets 450 */
  --tch-dur-slow: 750ms;   /* entrances 600, rules + charts 900 */

  /* Elevation used in Ledger */
  --tch-shadow-sm: 0 8px 24px rgba(0,0,0,.08);
  --tch-shadow-md: 0 16px 40px rgba(0,0,0,.16);
}

/* NEW: dark theme. Follows the OS unless the user picked Light; data-theme="dark" forces it. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tch-canvas: #0E0E0E; --tch-white: #181818; --tch-g05: #202020; --tch-g08: #262626; --tch-g15: #303030;
    --tch-ink: #F1F1F1; --tch-g70: #B8B8B8; --tch-g50: #8A8A8A; --tch-charcoal: #F1F1F1;
    --tch-red: #E5484D; --tch-red-dark: #C7353A; --tch-red-tint: #3A1C1E;
    --tch-status-pending: #6FA3DA;  --tch-status-pending-tint: #1B2836;
    --tch-status-progress: #E0A84A; --tch-status-progress-tint: #33281A;
    --tch-status-hold: #A890D8;     --tch-status-hold-tint: #251F33;
    --tch-status-actioned: #4CB884; --tch-status-actioned-tint: #15291F;
    --tch-status-complete: #D27986; --tch-status-complete-tint: #35191E;
    --tch-status-signoff: #4FB8C6;  --tch-status-signoff-tint: #14292C;
    --tch-status-release: #A3ADBA;  --tch-status-release-tint: #23272D;
    --tch-shadow-sm: 0 8px 24px rgba(0,0,0,.5); --tch-shadow-md: 0 16px 40px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  --tch-canvas: #0E0E0E; --tch-white: #181818; --tch-g05: #202020; --tch-g08: #262626; --tch-g15: #303030;
  --tch-ink: #F1F1F1; --tch-g70: #B8B8B8; --tch-g50: #8A8A8A; --tch-charcoal: #F1F1F1;
  --tch-red: #E5484D; --tch-red-dark: #C7353A; --tch-red-tint: #3A1C1E;
  --tch-status-pending: #6FA3DA;  --tch-status-pending-tint: #1B2836;
  --tch-status-progress: #E0A84A; --tch-status-progress-tint: #33281A;
  --tch-status-hold: #A890D8;     --tch-status-hold-tint: #251F33;
  --tch-status-actioned: #4CB884; --tch-status-actioned-tint: #15291F;
  --tch-status-complete: #D27986; --tch-status-complete-tint: #35191E;
  --tch-status-signoff: #4FB8C6;  --tch-status-signoff-tint: #14292C;
  --tch-status-release: #A3ADBA;  --tch-status-release-tint: #23272D;
  --tch-shadow-sm: 0 8px 24px rgba(0,0,0,.5); --tch-shadow-md: 0 16px 40px rgba(0,0,0,.7);
}
/* Printed documents are always light */
@media print { :root { color-scheme: light; } }

/* Reduced motion: no movement, final states shown */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .l-flash { animation-duration: 900ms !important; }   /* #105: a colour fade is not movement, so the flash still plays */
}

/* Keyframes used across Ledger */
@keyframes tch-rise    { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes tch-growx   { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes tch-growy   { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes tch-drop    { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes tch-sheet   { from { transform: translateY(100%); } to { transform: none; } }
@keyframes tch-strike  { from { width: 0; } to { width: 100%; } }
@keyframes tch-stamp   { 0% { opacity: 0; transform: scale(1.8) rotate(-8deg); } 60% { opacity: 1; transform: scale(.94) rotate(-4deg); } 100% { opacity: 1; transform: scale(1) rotate(-4deg); } }
@keyframes tch-flash   { from { background-color: var(--tch-g15); } }   /* #105: grey, ends on the element's own background */
@keyframes tch-pulse   { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes tch-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }


/* ==========================================================================
   04  LEDGER-LOCAL HOOKS
   Things that must change with the theme but cannot be expressed as a
   token (data-URI images cannot read var()), plus two keyframes the
   Toolkit uses that the tokens file does not ship (fade, toast out).
   ========================================================================== */
:root {
  color-scheme: light;
  /* checkbox tick: drawn in the colour that sits on charcoal (white in light) */
  --l-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10.5 8 14 15.5 6' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E");
  /* select chevron: g50, identical in both themes */
  --l-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9.5 12 15.5 18 9.5' fill='none' stroke='%238A8A8A' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E");
  /* light/dark logo switches */
  --l-logo-light: block;
  --l-logo-dark: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --l-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10.5 8 14 15.5 6' fill='none' stroke='%23181818' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E");
    --l-logo-light: none;
    --l-logo-dark: block;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --l-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10.5 8 14 15.5 6' fill='none' stroke='%23181818' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E");
  --l-logo-light: none;
  --l-logo-dark: block;
}

@keyframes l-fade      { from { opacity: 0; } to { opacity: 1; } }
@keyframes l-toast-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(12px); } }


/* ==========================================================================
   05  RESET AND BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

:root { --l-bar-h: 68px; }   /* top bar height (56px under 900px); sticky heads and scroll-padding use it (#105) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--l-bar-h) + 16px); }   /* jumps and focus land below the bar; no scroll-behavior here */
html[data-fontsize="large"] { --l-fs: 1.15; }   /* Text size: Large (#59) */

body,
.l-body {
  margin: 0;
  font-family: var(--tch-font-body);
  font-size: var(--tch-text-body);
  line-height: var(--tch-lh-body);
  color: var(--tch-ink);
  background: var(--tch-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
h1, h2, h3, h4, h5, h6 { font-weight: 500; }
ul, ol { margin: 0; padding: 0; }
img, svg, video { max-width: 100%; }
img { height: auto; }
b, strong { font-weight: 600; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
  border-radius: 0;
}
button { cursor: pointer; }
table { border-collapse: collapse; border-spacing: 0; }

a { color: var(--tch-red); text-decoration: none; }
a:hover { color: var(--tch-ink); text-decoration: underline; }

/* Visible keyboard focus everywhere; mouse clicks stay clean */
:focus-visible { outline: 2px solid var(--tch-ink); outline-offset: 2px; }

::placeholder { color: var(--tch-g50); opacity: 1; }

[hidden] { display: none !important; }


/* ==========================================================================
   06  ICONS (T13)
   <svg class="l-ico"><use href="/v2/assets/icons.svg#bell"/></svg>
   24px grid, stroke from the sprite, colour = currentColor.
   Sizes: 16 inline with 13px text, 20 in buttons / top bar (default),
   24 app tab bar, 32 empty states.
   ========================================================================== */
.l-ico {
  width: 20px;
  height: 20px;
  flex: none;
  display: inline-block;
  vertical-align: -.3em;
  color: inherit;
}
.l-ico--16 { width: 16px; height: 16px; vertical-align: -.2em; }
.l-ico--24 { width: 24px; height: 24px; }
.l-ico--32 { width: 32px; height: 32px; }


/* ==========================================================================
   07  SHELL (W2, T10)
   Top bar 68px, white, 1px g15 bottom border, padding 0 40px, gap 48px.
   No left sidebar. Logo 26px high, reversed file shown in dark theme.
   ========================================================================== */
.l-top {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--l-bar-h);
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 0 40px;
  background: var(--tch-white);
  border-bottom: 1px solid var(--tch-g15);
}
.l-top__home { display: flex; align-items: center; flex: none; }   /* link around the two logos */
.l-top__logo { height: 26px; width: auto; flex: none; }
.l-top__logo--light, .l-logo--light { display: var(--l-logo-light); }
.l-top__logo--dark,  .l-logo--dark  { display: var(--l-logo-dark); }

/* Hamburger: only below 900px (see section 22) */
.l-top__burger {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tch-ink);
  flex: none;
}

/* -- Primary nav: Plex Sans 15, gap 32, active = ink 600 + 2px red underline
      running the full bar height -- */
.l-nav {
  display: flex;
  align-self: stretch;
  gap: 32px;
  font-size: calc(15px * var(--l-fs));
}
.l-nav__item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0;
  border: 0;
  border-top: 2px solid transparent;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--tch-g70);
  font-size: calc(15px * var(--l-fs));
  white-space: nowrap;
  text-decoration: none;
}
.l-nav__item:hover { color: var(--tch-ink); text-decoration: none; }
.l-nav__item.is-active {
  color: var(--tch-ink);
  font-weight: 600;
  border-bottom-color: var(--tch-red);
}
/* dropdown chevron beside a nav label: 10px, g50 */
.l-nav__item .l-ico { width: 12px; height: 12px; color: var(--tch-g50); }

/* Tasks count chip: Plex Mono 11px on charcoal */
.l-nav__count {
  font-family: var(--tch-font-mono);
  font-size: calc(11px * var(--l-fs));
  font-weight: 400;
  line-height: 1.5;
  padding: 1px 6px;
  background: var(--tch-charcoal);
  color: var(--tch-white);
}

/* -- Dropdown wrapper + menu panel --
   <div class="l-dd [is-open]"> trigger <div class="l-menu">...</div> </div>
   Panel: white, 1px g15, 2px charcoal top rule, shadow-md, Drop motion. */
.l-dd { position: relative; display: flex; align-items: center; }
.l-nav .l-dd { height: 100%; }

.l-menu {
  display: none;
  position: absolute;
  top: calc(100% - 8px);           /* W2: panel top at 60px under a 68px bar */
  left: 0;
  z-index: 60;
  min-width: 260px;
  padding: 8px 0;
  background: var(--tch-white);
  border: 1px solid var(--tch-g15);
  border-top: 2px solid var(--tch-charcoal);
  box-shadow: var(--tch-shadow-md);
  font-size: calc(14px * var(--l-fs));
  line-height: 1.45;
  color: var(--tch-ink);
}
.l-dd.is-open > .l-menu {
  display: block;
  animation: tch-drop 300ms var(--tch-ease-out) both;
}
.l-menu--right { left: auto; right: 0; }
.l-menu--wide  { width: 360px; }     /* W2 "My open tasks" panel */
.l-menu--panel { width: 440px; }     /* W2 notifications panel */

/* Monthly summary (#24): 12 month columns scroll sideways; the metric names stay readable */
.l-wide { overflow-x: auto; margin-bottom: 40px; }
.l-table--months th, .l-table--months td { white-space: nowrap; }
.l-table--months tbody th[scope="row"] { min-width: 260px; padding-right: 24px; font-family: var(--tch-font-body); font-size: calc(14px * var(--l-fs)); font-weight: 500; letter-spacing: normal; text-transform: none; color: var(--tch-ink); text-align: left; white-space: normal; padding-top: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--tch-g15); }

/* W2 notifications panel (the bell, #4 5.9d): title + Mark all read, two tabs, lines of who / what / ref, time */
.l-menu.l-notes { padding: 0; }   /* phones: full width from the 899px rule on .l-top__right .l-menu */
.l-notes__head { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 20px 12px; }
.l-notes__title { font-family: var(--tch-font-display); font-size: calc(22px * var(--l-fs)); font-weight: 500; }
.l-notes__all { padding: 0; border: 0; background: none; color: var(--tch-red); font-size: calc(13px * var(--l-fs)); cursor: pointer; }
.l-notes__all:hover { text-decoration: underline; }
.l-notes__tabs { display: flex; gap: 20px; padding: 0 20px; border-bottom: 1px solid var(--tch-g15); font-size: calc(13px * var(--l-fs)); }
.l-notes__tab { padding: 0 0 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--tch-g70); font: inherit; cursor: pointer; }
.l-notes__tab .l-mono { color: var(--tch-g50); }
.l-notes__tab.is-on { color: var(--tch-ink); font-weight: 600; border-bottom-color: var(--tch-red); }
.l-notes__list { max-height: min(60vh, 520px); overflow-y: auto; }
.l-note { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--tch-g15); color: var(--tch-ink); }
.l-note:hover { background: var(--tch-g05); text-decoration: none; color: var(--tch-ink); }
.l-note__dot { width: 8px; height: 8px; margin-top: 6px; background: transparent; }
.l-note.is-new .l-note__dot { background: var(--tch-ink); }
.l-note--due .l-note__dot { background: var(--tch-red); }
.l-note__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.l-note__what { font-size: calc(14px * var(--l-fs)); line-height: 1.45; }
.l-note__what b { font-weight: 600; }
.l-note__ref { overflow: hidden; font-family: var(--tch-font-mono); font-size: calc(12px * var(--l-fs)); color: var(--tch-g70); white-space: nowrap; text-overflow: ellipsis; }
.l-note__at { font-family: var(--tch-font-mono); font-size: calc(11px * var(--l-fs)); color: var(--tch-g50); white-space: nowrap; }
.l-note__empty, .l-note__more { display: block; padding: 14px 20px; font-size: calc(13px * var(--l-fs)); color: var(--tch-g70); }
.l-note__more { border-bottom: 1px solid var(--tch-g15); }
.l-notes__foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 20px; font-size: calc(13px * var(--l-fs)); }
.l-notes__foot span { color: var(--tch-g50); }

/* Menus that hang off the right cluster (bell, avatar) sit 8px below a 36px button */
.l-top__right .l-menu { top: calc(100% + 16px); left: auto; right: 0; }

.l-menu__head {
  display: block;
  padding: 10px 16px 4px;
  font-family: var(--tch-font-mono);
  font-size: calc(11px * var(--l-fs));
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tch-g70);
}
.l-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 16px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--tch-ink);
  font-size: calc(14px * var(--l-fs));
  text-align: left;
  text-decoration: none;
}
.l-menu__item:hover { background: var(--tch-g05); color: var(--tch-ink); text-decoration: none; }
.l-menu__item.is-active { background: var(--tch-g05); font-weight: 600; }
.l-menu__item--danger { color: var(--tch-red); font-weight: 600; }   /* "Sign out" */
.l-menu__item > :last-child:not(:first-child) { margin-left: auto; }

/* Small right-hand mono note in a menu line (counts, times, "Email + push") */
.l-menu__meta {
  margin-left: auto;
  font-family: var(--tch-font-mono);
  font-size: calc(11px * var(--l-fs));
  font-weight: 400;
  color: var(--tch-g50);
  white-space: nowrap;
}

.l-menu__sep { height: 1px; margin: 8px 0; background: var(--tch-g15); border: 0; }

/* Label + right value; an optional .l-menu__bar drops onto its own line
   under them. <a class="l-menu__row"><span>In progress</span><span>4</span>
   <span class="l-menu__bar"><span style="width:40%"></span></span></a> */
.l-menu__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-height: 32px;
  padding: 6px 16px;
  font-size: calc(14px * var(--l-fs));
  color: var(--tch-ink);
  text-decoration: none;
}
a.l-menu__row:hover { background: var(--tch-g05); color: var(--tch-ink); text-decoration: none; }
.l-menu__row > :first-child { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.l-menu__row > :nth-child(2):not(.l-menu__bar) {
  margin-left: auto;
  font-family: var(--tch-font-mono);
  font-size: calc(13px * var(--l-fs));
  text-align: right;
}
.l-menu__bar {
  order: 3;
  flex: 1 1 100%;
  height: 6px;
  background: var(--tch-g05);
}
.l-menu__bar > span {
  display: block;
  height: 100%;
  background: var(--tch-ink);     /* override inline with the status colour */
  transform-origin: left;
  animation: tch-growx 700ms 100ms var(--tch-ease-out) both;
}

/* -- Right cluster: search, bell, avatar (gap 20) -- */
.l-top__right {
  margin-left: auto;
  min-width: 0;   /* lets the search box shrink (to 220px) on a narrow desktop: at 900-1030px the bar ran 30px past the screen */
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Search 300-340 x 38 with a "/" shortcut hint */
.l-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 340px;
  min-width: 220px;
  flex: 0 1 340px;
  height: 38px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--tch-g15);
  background: var(--tch-white);
  color: var(--tch-g50);
  font-size: calc(14px * var(--l-fs));
}
.l-search:focus-within { border-color: var(--tch-ink); }
.l-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--tch-ink);
  font-size: calc(14px * var(--l-fs));
}
.l-search .l-ico { width: 16px; height: 16px; }
.l-search__key {
  flex: none;
  font-family: var(--tch-font-mono);
  font-size: calc(11px * var(--l-fs));
  line-height: 1.5;
  padding: 1px 6px;
  border: 1px solid var(--tch-g15);
  color: var(--tch-g50);
}

/* 36px square icon button (bell). Open state from W2: g05 fill + 2px ink outline */
.l-iconbtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tch-ink);
  flex: none;
  transition: background var(--tch-dur-fast);
}
.l-iconbtn:hover { background: var(--tch-g05); color: var(--tch-ink); text-decoration: none; }
.l-iconbtn.is-open,
.l-dd.is-open > .l-iconbtn { background: var(--tch-g05); outline: 2px solid var(--tch-ink); outline-offset: 0; }
.l-iconbtn__badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  padding: 1px 5px;
  background: var(--tch-red);
  color: #FFFFFF;                       /* --onred: white in both themes */
  font-family: var(--tch-font-mono);
  font-size: calc(10px * var(--l-fs));
  line-height: 1.4;
  text-align: center;
}

/* Avatar: 36px square charcoal, white initials (13px 600). Square, never round. */
.l-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  padding: 0;
  border: 0;
  background: var(--tch-charcoal);
  color: var(--tch-white);
  font-family: var(--tch-font-body);
  font-size: calc(13px * var(--l-fs));
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}
.l-avatar:hover { color: var(--tch-white); text-decoration: none; }
.l-avatar--sm    { width: 28px; height: 28px; font-size: calc(11px * var(--l-fs)); }
.l-avatar--xs    { width: 24px; height: 24px; font-size: calc(10px * var(--l-fs)); }   /* board cards, assign rows */
.l-avatar--quiet { background: var(--tch-g05); color: var(--tch-ink); }  /* the other party */
.l-avatar--quiet:hover { color: var(--tch-ink); }

/* Client's "+ Raise a task" in the bar (W2 client view: 38px, 14px 600) */
.l-btn-raise {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 0;
  background: var(--tch-red);
  color: #FFFFFF;
  font-size: calc(14px * var(--l-fs));
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--tch-dur-fast), transform 120ms var(--tch-ease-out);
}
.l-btn-raise:hover { background: var(--tch-red-dark); color: #FFFFFF; text-decoration: none; }
.l-btn-raise:active { transform: scale(.96); }


/* ==========================================================================
   08  PAGE
   ========================================================================== */
/* 1360px of content inside 40px gutters (= the 1440 design frame) */
.l-page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 40px 64px;
}

/* Breadcrumb: Plex Mono 13, g70, gap 10; current page (last item) in ink.
   Put the "/" separators in the markup as their own <span>s. */
.l-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  font-family: var(--tch-font-mono);
  font-size: calc(13px * var(--l-fs));
  line-height: 1.5;
  color: var(--tch-g70);
}
.l-crumbs > :last-child { color: var(--tch-ink); }

/* Title row: title block left, page actions right, bottoms aligned */
.l-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px 40px;
}
.l-head > :first-child { min-width: 0; }
.l-head--ruled {                       /* A3 / W3: 2px charcoal rule under the head */
  padding-bottom: 32px;
  border-bottom: 2px solid var(--tch-charcoal);
}
.l-head__meta {                        /* A3: status pill + overdue + PO row above the title */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.l-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.l-title {
  font-family: var(--tch-font-display);
  font-weight: 500;
  font-size: var(--tch-text-display-xl);   /* 64px */
  line-height: 1;
  letter-spacing: -.03em;
  margin: 0;
}
.l-title--detail {
  position: relative;                      /* anchor for the close strike */
  font-size: var(--tch-text-h1-detail);    /* 48px */
  line-height: 1.08;
  letter-spacing: -.02em;
  max-width: 900px;
  text-wrap: pretty;
}
.l-title__count {                          /* W6: "Companies 23" */
  font-size: 28px;
  letter-spacing: 0;
  color: var(--tch-g50);
  margin-left: 14px;
}

/* Role line under the page title */
.l-sub {
  margin-top: 10px;
  font-size: calc(15px * var(--l-fs));
  color: var(--tch-g70);
}

/* Scope tabs (#67, 2026-10-30, operator: "a bit lost at the top"): 16px, a rule under the row, the count as a
   square badge; a tab that needs the viewer's action (To release, Awaiting my sign-off, Overdue) shows it in red when > 0. */
.l-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  margin-top: 20px;
  border-bottom: 1px solid var(--tch-g15);
  font-size: calc(16px * var(--l-fs));
}
.l-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -1px;
  padding: 0 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--tch-g70);
  font-size: calc(16px * var(--l-fs));
  white-space: nowrap;
  text-decoration: none;
}
.l-tab:hover { color: var(--tch-ink); text-decoration: none; }
.l-tab.is-active { color: var(--tch-ink); font-weight: 600; border-bottom-color: var(--tch-red); }
.l-tab__count {   /* plain count (also used outside the tabs, replay.asp) */
  font-family: var(--tch-font-mono);
  font-size: calc(12px * var(--l-fs));
  font-weight: 400;
  color: var(--tch-g50);
}
.l-tabs .l-tab__count {
  display: inline-block;
  min-width: 24px;
  padding: 2px 7px;
  background: var(--tch-g08);
  color: var(--tch-ink);
  font-family: var(--tch-font-mono);
  font-size: calc(12px * var(--l-fs));
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}
.l-tabs .l-tab__count.is-alert { background: var(--tch-red); color: #FFFFFF; font-weight: 700; }

/* "Waiting for you" notice above the tabs (#67): a client's requests to release and tasks to sign off. */
.l-waiting { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.l-waiting__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--tch-red);
  border-left-width: 4px;
  background: var(--tch-red-tint);
  color: var(--tch-ink);
  font-size: calc(15px * var(--l-fs));
  text-decoration: none;
}
.l-waiting__item:hover { color: var(--tch-ink); text-decoration: none; border-color: var(--tch-red-dark); }
.l-waiting__num { font-family: var(--tch-font-mono); font-size: calc(18px * var(--l-fs)); font-weight: 700; color: var(--tch-red); }
.l-waiting__go { margin-left: auto; color: var(--tch-red); font-weight: 600; white-space: nowrap; }

/* Section head: Plex Mono 12 caps +6%, g70, 2px charcoal rule under (A3 ACTIVITY).
   --thin = 1px charcoal rule, --bare = no rule (A3 DETAILS / ATTACHMENTS). */
.l-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: 0 0 14px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--tch-charcoal);
  font-family: var(--tch-font-mono);
  font-size: calc(12px * var(--l-fs));
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tch-g70);
}
.l-section-head--thin { padding-bottom: 12px; border-bottom-width: 1px; }
.l-section-head--bare { padding-bottom: 0; border-bottom: 0; }
.l-section-head__aside {             /* right-hand note: "Drop files anywhere on this page" */
  font-family: var(--tch-font-body);
  font-size: calc(13px * var(--l-fs));
  letter-spacing: 0;
  text-transform: none;
  color: var(--tch-g50);
}

.l-rule       { height: 0; margin: 0; border: 0; border-top: 2px solid var(--tch-charcoal); }
.l-rule--thin { border-top: 1px solid var(--tch-g15); }


/* ==========================================================================
   09  KPI STRIP (A2, T11)
   4 columns under a 2px charcoal rule, 1px g15 vertical dividers.
   ========================================================================== */
.l-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 36px;
  border-top: 2px solid var(--tch-charcoal);
}
.l-kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin-right: 24px;
  padding: 20px 24px 24px 0;
  border-right: 1px solid var(--tch-g15);
}
.l-kpi__label {
  font-family: var(--tch-font-mono);
  font-size: calc(12px * var(--l-fs));
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--tch-g70);
}
.l-kpi__num {
  font-family: var(--tch-font-display);
  font-weight: 400;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--tch-ink);
  font-variant-numeric: tabular-nums;
}
.l-kpi__num.is-red { color: var(--tch-red); }
.l-kpi__sub { font-size: calc(13px * var(--l-fs)); color: var(--tch-g70); }


/* ==========================================================================
   10  FILTER BAR (A2, T5)
   Between two 1px g15 rules. Chips left, "+ Filter", controls right.
   ========================================================================== */
.l-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 14px 0;
  border-top: 1px solid var(--tch-g15);
  border-bottom: 1px solid var(--tch-g15);
  /* #64: chips are raised off the page in both themes (in dark the page and an idle chip were both #181818) */
  --l-chip-bg: var(--tch-g05);
  --l-chip-line: #BDBDBD;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .l-filters { --l-chip-bg: #262626; --l-chip-line: #5C5C5C; } }
:root[data-theme="dark"] .l-filters { --l-chip-bg: #262626; --l-chip-line: #5C5C5C; }
.l-fchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--l-chip-line, var(--tch-g15));
  background: var(--l-chip-bg, var(--tch-white));
  color: var(--tch-ink);
  font-size: calc(13px * var(--l-fs));
  white-space: nowrap;
  text-decoration: none;
}
.l-fchip:hover { border-color: var(--tch-ink); color: var(--tch-ink); text-decoration: none; }
/* #64: an applied filter is red - border, tint and a 3px bar - so it is plain which filters are on */
.l-fchip.is-active { border-color: var(--tch-red); background: var(--tch-red-tint); box-shadow: inset 3px 0 0 var(--tch-red); }
.l-fchip__k { color: var(--tch-g70); }
.l-fchip:focus-within { border-color: var(--tch-ink); }
.l-fchip strong, .l-fchip b { font-weight: 600; }
.l-fchip .l-ico { width: 12px; height: 12px; color: var(--tch-g50); }
/* <label class="l-fchip"><span class="l-fchip__k">Client</span><select>..</select></label>
   or two <input type="date">: drawn inline, no frame of their own */
.l-fchip select,
.l-fchip input {
  -webkit-appearance: none;
  appearance: none;
  height: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--tch-ink);
  font-family: var(--tch-font-body);
  font-size: calc(13px * var(--l-fs));
  font-weight: 600;
  cursor: pointer;
}
.l-fchip select {
  padding-right: 18px;
  background: transparent var(--l-chev) no-repeat right 0 center / 12px 12px;
}
/* the open list is drawn by the browser: give it the page colours so it is never dark text on dark */
.l-fchip select option { background: var(--tch-white); color: var(--tch-ink); font-weight: 400; }
.l-fchip input[type="date"] { width: auto; }
.l-fchip input[type="date"]::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
/* An empty From / To date (list.asp): "Any" over the box, whose own text is hidden until it is used
   (Safari draws today's date in an empty date box, which reads as a filter). Still a real date box. */
.l-dateany { position: relative; display: inline-flex; align-items: center; height: 100%; }
.l-dateany__any { display: none; }
.l-dateany input.is-empty:not(:focus),
.l-dateany input.is-empty:not(:focus)::-webkit-datetime-edit { color: transparent; }
.l-dateany input.is-empty:not(:focus) + .l-dateany__any {
  display: block; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--tch-ink); font-size: calc(13px * var(--l-fs)); font-weight: 600;
}

.l-fadd {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--tch-red);
  font-size: calc(13px * var(--l-fs));
  font-weight: 600;
  white-space: nowrap;
}
.l-fadd:hover { color: var(--tch-red-dark); text-decoration: none; }
.l-fadd .l-ico { width: 14px; height: 14px; }

/* #64: Reset filters - a real button, always in the bar; red with a count when filters are on */
.l-freset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--l-chip-line, var(--tch-g15));
  background: transparent;
  color: var(--tch-g70);
  font-size: calc(13px * var(--l-fs));
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.l-freset:hover { border-color: var(--tch-ink); color: var(--tch-ink); text-decoration: none; }
.l-freset.is-on { border-color: var(--tch-red); color: var(--tch-red); }
.l-freset.is-on:hover { background: var(--tch-red); color: #FFFFFF; }
.l-freset__n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--tch-red); color: #FFFFFF;
  font-size: calc(11px * var(--l-fs)); font-weight: 700; line-height: 1;
}
.l-freset.is-on:hover .l-freset__n { background: #FFFFFF; color: var(--tch-red); }

.l-filters__right {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: calc(13px * var(--l-fs));
  color: var(--tch-g70);
}

/* Segmented toggle (density, Table / Board, priority): 1px g15 frame, 2px inset */
.l-seg {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--tch-g15);
  background: var(--tch-white);
}
.l-seg__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--tch-g70);
  font-size: calc(12px * var(--l-fs));
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--tch-dur-fast);
}
.l-seg__btn:hover { color: var(--tch-ink); text-decoration: none; }
.l-seg__btn.is-on { background: var(--tch-charcoal); color: var(--tch-white); }
.l-seg__btn .l-ico { width: 14px; height: 14px; }

/* "Group  Client / Category": borderless select, value in ink 600 */
.l-select-inline {
  -webkit-appearance: none;
  appearance: none;
  height: 30px;
  padding: 0 22px 0 4px;
  border: 0;
  background: transparent var(--l-chev) no-repeat right 2px center / 14px 14px;
  color: var(--tch-ink);
  font-size: calc(13px * var(--l-fs));
  font-weight: 600;
  cursor: pointer;
}
.l-select-inline:hover { background-color: var(--tch-g05); }


/* ==========================================================================
   11  BUTTONS (T2)
   Base = outlined ink (quiet default). Primary = red, one per view.
   Secondary = charcoal, the next most likely action. Quiet = g15 frame.
   Text = red text, low stakes. Labels are verbs.
   Sizes: sm 32 / base 42 (T2 Medium) / lg 56 (A1 sign-in).
   Press: scale .96 over 120ms.
   ========================================================================== */
.l-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--tch-ink);
  background: transparent;
  color: var(--tch-ink);
  font-family: var(--tch-font-body);
  font-size: calc(14px * var(--l-fs));
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--tch-dur-fast), border-color var(--tch-dur-fast), color var(--tch-dur-fast), transform 120ms var(--tch-ease-out);
}
.l-btn:hover { background: var(--tch-g05); color: var(--tch-ink); text-decoration: none; }
.l-btn:active { transform: scale(.96); }

.l-btn--primary {
  border-color: transparent;
  background: var(--tch-red);
  color: #FFFFFF;
  font-weight: 600;
  padding: 0 18px;
}
.l-btn--primary:hover { background: var(--tch-red-dark); color: #FFFFFF; }

.l-btn--secondary {
  border-color: transparent;
  background: var(--tch-charcoal);
  color: var(--tch-white);
  font-weight: 600;
}
.l-btn--secondary:hover { background: var(--tch-g70); color: var(--tch-white); }

.l-btn--quiet {
  border-color: var(--tch-g15);
  background: var(--tch-white);
  font-weight: 400;
}
.l-btn--quiet:hover { background: var(--tch-g05); }

.l-btn--text,
.l-btn--danger-text {
  border-color: transparent;
  background: transparent;
  color: var(--tch-red);
  font-weight: 600;
  padding: 0 12px;
}
.l-btn--text:hover,
.l-btn--danger-text:hover { background: transparent; color: var(--tch-red); text-decoration: underline; }
.l-btn--danger-text:hover { color: var(--tch-red-dark); }

.l-btn--sm { height: 32px; padding: 0 12px; font-size: calc(13px * var(--l-fs)); }
.l-btn--lg { height: 56px; padding: 0 22px; font-size: calc(16px * var(--l-fs)); font-weight: 600; }
.l-btn--block { display: flex; width: 100%; }

.l-btn[disabled],
.l-btn.is-disabled,
.l-btn[aria-disabled="true"] {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}
.l-btn.is-busy { cursor: progress; }

.l-btn .l-ico { width: 18px; height: 18px; }
.l-btn--sm .l-ico { width: 16px; height: 16px; }


/* ==========================================================================
   12  FORMS (T3, W3, W7)
   ========================================================================== */
.l-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  min-width: 0;
}
.l-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: calc(13px * var(--l-fs));
  font-weight: 600;
  line-height: 1.4;
  color: var(--tch-ink);
}
.l-label a { font-weight: 500; }           /* A1: "Forgot password?" */
.l-req { color: var(--tch-red); }           /* required asterisk */
.l-label--caps {                            /* T3 / T5 section labels */
  font-family: var(--tch-font-mono);
  font-size: calc(11px * var(--l-fs));
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tch-g70);
}

/* Text field states (T3): default 1px g50, focus 2px ink, error 2px red on
   red tint, read-only borderless on g05, disabled 1px dashed g15. */
.l-input,
.l-select,
.l-textarea {
  display: block;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--tch-g50);
  background: var(--tch-white);
  color: var(--tch-ink);
  font-size: calc(15px * var(--l-fs));
  line-height: 1.4;
  outline: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--tch-dur-fast);
}
.l-input:hover, .l-select:hover, .l-textarea:hover { border-color: var(--tch-g70); }
.l-input:focus, .l-select:focus, .l-textarea:focus {
  border: 2px solid var(--tch-ink);
  padding-left: 13px;
  padding-right: 13px;
}
.l-input.is-error, .l-select.is-error, .l-textarea.is-error,
.l-input[aria-invalid="true"], .l-select[aria-invalid="true"], .l-textarea[aria-invalid="true"] {
  border: 2px solid var(--tch-red);
  padding-left: 13px;
  padding-right: 13px;
  background-color: var(--tch-red-tint);
}
.l-input[readonly], .l-textarea[readonly] {
  border: 1px solid transparent;
  padding-left: 14px;
  padding-right: 14px;
  background: var(--tch-g05);
  color: var(--tch-g70);
}
.l-input:disabled, .l-select:disabled, .l-textarea:disabled {
  border: 1px dashed var(--tch-g15);
  padding-left: 14px;
  padding-right: 14px;
  background: var(--tch-white);
  color: var(--tch-g50);
  cursor: not-allowed;
}

.l-select {
  padding-right: 40px;
  background-image: var(--l-chev);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  cursor: pointer;
}
.l-select:focus { padding-right: 39px; }

.l-textarea {
  height: auto;
  min-height: 120px;
  padding-top: 14px;
  padding-bottom: 14px;
  line-height: 1.65;
  resize: vertical;
}
.l-textarea:focus { padding-top: 13px; padding-bottom: 13px; }

.l-input--lg {                              /* A1 sign-in: 52px, 16px text */
  height: 52px;
  padding: 0 16px;
  font-size: calc(16px * var(--l-fs));
}
.l-input--lg:focus, .l-input--lg.is-error { padding-left: 15px; padding-right: 15px; }

.l-input--title {                           /* W3: 60px field, Jost 24 */
  height: 60px;
  padding: 0 16px;
  font-family: var(--tch-font-display);
  font-size: 24px;
  font-weight: 400;
}
.l-input--title:focus, .l-input--title.is-error { padding-left: 15px; padding-right: 15px; }

.l-help  { font-size: calc(12px * var(--l-fs)); line-height: 1.5; color: var(--tch-g50); }
.l-error { font-size: calc(12px * var(--l-fs)); line-height: 1.5; color: var(--tch-red); }

/* -- Checkbox: 20px square, 1.5px g50 frame; checked = charcoal fill + tick.
      <label class="l-check"><input type="checkbox"> Keep me signed in</label> -- */
.l-check,
.l-radio,
.l-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: calc(15px * var(--l-fs));
  line-height: 1.4;
  color: var(--tch-ink);
  cursor: pointer;
}
.l-check input[type="checkbox"],
input[type="checkbox"].l-check {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid var(--tch-g50);
  background: transparent no-repeat center / 16px 16px;
  cursor: pointer;
  transition: background-color var(--tch-dur-fast), border-color var(--tch-dur-fast);
}
.l-check input[type="checkbox"]:checked,
input[type="checkbox"].l-check:checked {
  border-color: var(--tch-charcoal);
  background-color: var(--tch-charcoal);
  background-image: var(--l-tick);
}
.l-check input[type="checkbox"]:disabled,
input[type="checkbox"].l-check:disabled { opacity: .35; cursor: not-allowed; }

/* -- Radio: the one round control, so it never reads as a checkbox -- */
.l-radio input[type="radio"],
input[type="radio"].l-radio {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid var(--tch-g50);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color var(--tch-dur-fast), background 200ms var(--tch-ease-out);
}
.l-radio input[type="radio"]:checked,
input[type="radio"].l-radio:checked {
  border-color: var(--tch-ink);
  background: radial-gradient(circle, var(--tch-ink) 0 4.5px, transparent 5px);
}

/* -- Toggle switch: 40 x 22 track, 16px square knob, 200ms. Off = g15,
      on = actioned green (T3 "Billable"). Built on the checkbox itself:
      <label class="l-toggle"><input type="checkbox" role="switch"> Billable</label> -- */
.l-toggle input[type="checkbox"],
input[type="checkbox"].l-toggle {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 40px;
  height: 22px;
  margin: 0;
  border: 0;
  background-color: var(--tch-g15);
  background-image: linear-gradient(var(--tch-white), var(--tch-white));
  background-repeat: no-repeat;
  background-size: 16px 16px;
  background-position: 3px 3px;
  cursor: pointer;
  transition: background-color 200ms, background-position 200ms var(--tch-ease-out);
}
.l-toggle input[type="checkbox"]:checked,
input[type="checkbox"].l-toggle:checked {
  background-color: var(--tch-status-actioned);
  background-position: 21px 3px;
}
.l-toggle input[type="checkbox"]:disabled,
input[type="checkbox"].l-toggle:disabled { opacity: .35; cursor: not-allowed; }

/* -- Stepper: [-] value [+], 36px buttons, 15-minute steps (T3) -- */
.l-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.l-stepper button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--tch-g15);
  background: var(--tch-white);
  color: var(--tch-ink);
  transition: background var(--tch-dur-fast), transform 120ms var(--tch-ease-out);
}
.l-stepper button:hover { background: var(--tch-g05); }
.l-stepper button:active { transform: scale(.96); }
.l-stepper button .l-ico { width: 16px; height: 16px; }
.l-stepper input,
.l-stepper__val {
  width: 72px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tch-ink);
  font-family: var(--tch-font-mono);
  font-size: calc(16px * var(--l-fs));
  font-weight: 600;
  line-height: 36px;
  text-align: center;
  outline: 0;
}
.l-stepper input:focus { box-shadow: inset 0 -2px 0 var(--tch-ink); }

/* -- Type cards (W3): Urgent 2 / Standard 5 / Project 10 working days -- */
.l-typecards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.l-typecard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--tch-g15);
  background: var(--tch-white);
  color: var(--tch-ink);
  text-align: left;
  cursor: pointer;
  transition: background var(--tch-dur-fast), border-color var(--tch-dur-fast);
}
.l-typecard:hover { border-color: var(--tch-g50); }
.l-typecard.is-on {
  padding: 13px 15px;                  /* keeps the box size with the 2px frame */
  border: 2px solid var(--tch-ink);
  background: var(--tch-g05);
}
/* allow <label class="l-typecard"><input type="radio" class="sr-only"> ...</label> */
.l-typecard:has(input:checked) { padding: 13px 15px; border: 2px solid var(--tch-ink); background: var(--tch-g05); }
.l-typecard:has(input:focus-visible) { outline: 2px solid var(--tch-ink); outline-offset: 2px; }
.l-typecard__name { font-size: calc(15px * var(--l-fs)); font-weight: 600; line-height: 1.4; }
.l-typecard__days { font-family: var(--tch-font-mono); font-size: calc(12px * var(--l-fs)); color: var(--tch-g70); }

/* -- Drop zone (T7, W3): idle dashed g50; .is-over 2px ink on g05;
      .is-error 2px red on red tint -- */
.l-drop {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border: 1.5px dashed var(--tch-g50);
  background: transparent;
  color: var(--tch-g70);
  font-size: calc(14px * var(--l-fs));
  cursor: pointer;
  transition: background var(--tch-dur-fast), border-color var(--tch-dur-fast);
}
.l-drop b, .l-drop strong { color: var(--tch-ink); }
.l-drop__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--tch-ink);
  color: var(--tch-ink);
}
.l-drop.is-over {
  padding: 17.5px 21.5px;
  border: 2px solid var(--tch-ink);
  background: var(--tch-g05);
  color: var(--tch-ink);
  font-weight: 600;
}
.l-drop.is-error {
  padding: 17.5px 21.5px;
  border: 2px solid var(--tch-red);
  background: var(--tch-red-tint);
  color: var(--tch-ink);
}

/* Upload progress: 4px g15 track, ink fill (child span width set inline) */
.l-progress { height: 4px; background: var(--tch-g15); }
.l-progress > span { display: block; height: 100%; background: var(--tch-ink); transition: width 300ms var(--tch-ease-out); }

/* -- Generic detail form (W7): sections in a 240px label column + 720px of
      fields; each field = 180px label + input. Edited fields get a 7px red
      marker. Sticky 76px save bar. -- */
.l-formsec {
  display: grid;
  grid-template-columns: 240px minmax(0, 720px);
  gap: 56px;
  padding: 32px 0;
  border-bottom: 1px solid var(--tch-g15);
}
.l-formsec__title { font-family: var(--tch-font-display); font-size: calc(22px * var(--l-fs)); font-weight: 500; line-height: 1.2; }
.l-formsec__note  { margin-top: 6px; font-size: calc(13px * var(--l-fs)); line-height: 1.5; color: var(--tch-g70); }
.l-formsec__fields { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.l-field--row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  margin-bottom: 0;
}
.l-field--row .l-label { justify-content: flex-start; }
.l-dirty { display: inline-block; flex: none; width: 7px; height: 7px; background: var(--tch-red); }

.l-savebar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 76px;
  margin: 0 -40px;
  padding: 0 40px;
  background: var(--tch-white);
  border-top: 2px solid var(--tch-charcoal);
  font-size: calc(14px * var(--l-fs));
  color: var(--tch-g70);
}
.l-savebar b, .l-savebar strong { color: var(--tch-ink); }
.l-savebar > :nth-child(2) { margin-left: auto; }

/* -- Bulk bar (W6): appears only when rows are ticked -- */
.l-bulk {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--tch-charcoal);
  color: var(--tch-white);
  font-size: calc(13px * var(--l-fs));
}
.l-bulk a, .l-bulk button { color: inherit; opacity: .75; background: none; border: 0; padding: 0; font-size: calc(13px * var(--l-fs)); }
.l-bulk a:hover, .l-bulk button:hover { opacity: 1; color: inherit; }
.l-bulk > :last-child { margin-left: auto; }


/* ==========================================================================
   13  BADGES AND MARKERS (T4)
   Meaning is never colour alone: always a label or a shape too.
   ========================================================================== */
/* Status colour map. Every status-aware component reads --st / --st-tint. */
.l-status--pending,  .l-pill--pending,  .l-event--pending,  .l-col--pending,  .l-sq--pending  { --st: var(--tch-status-pending);  --st-tint: var(--tch-status-pending-tint); }
.l-status--progress, .l-pill--progress, .l-event--progress, .l-col--progress, .l-sq--progress { --st: var(--tch-status-progress); --st-tint: var(--tch-status-progress-tint); }
.l-status--hold,     .l-pill--hold,     .l-event--hold,     .l-col--hold,     .l-sq--hold     { --st: var(--tch-status-hold);     --st-tint: var(--tch-status-hold-tint); }
.l-status--actioned, .l-pill--actioned, .l-event--actioned, .l-col--actioned, .l-sq--actioned { --st: var(--tch-status-actioned); --st-tint: var(--tch-status-actioned-tint); }
.l-status--complete, .l-pill--complete, .l-event--complete, .l-col--complete, .l-sq--complete { --st: var(--tch-status-complete); --st-tint: var(--tch-status-complete-tint); }
.l-status--signoff,  .l-pill--signoff,  .l-event--signoff,  .l-col--signoff,  .l-sq--signoff  { --st: var(--tch-status-signoff);  --st-tint: var(--tch-status-signoff-tint); }
.l-status--release,  .l-pill--release,  .l-event--release,  .l-col--release,  .l-sq--release  { --st: var(--tch-status-release);  --st-tint: var(--tch-status-release-tint); }
.l-event--date     { --st: var(--tch-red); }
.l-event--file     { --st: var(--tch-g50); }
.l-event--reassign { --st: var(--tch-charcoal); }

/* Bare status square (8px; --lg 10px). <span class="l-sq l-sq--hold"></span> */
.l-sq {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--st, var(--tch-g50));
}
.l-sq--lg { width: 10px; height: 10px; }

/* Inline status (table): 8px square + label, 13px 500, text = status colour.
   The square is drawn by ::before - markup is just the label. */
.l-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: calc(13px * var(--l-fs));
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--st, var(--tch-g70));
}
.l-status::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--st, var(--tch-g50));
}
.l-status--lg::before { width: 10px; height: 10px; }

/* Status pill (detail header): same + tint background, 600 */
.l-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  font-size: calc(13px * var(--l-fs));
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--st, var(--tch-g70));
  background: var(--st-tint, var(--tch-g05));
}
.l-pill::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--st, var(--tch-g50));
}

/* Badge: Plex Mono 11 caps in a 1px frame. PO approved = green frame + text;
   PO pending = dashed g50 frame. */
.l-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 7px;
  border: 1px solid var(--tch-g15);
  font-family: var(--tch-font-mono);
  font-size: calc(11px * var(--l-fs));
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--tch-g70);
}
.l-badge--po         { border-color: var(--tch-status-actioned); color: var(--tch-status-actioned); }
.l-badge--po-pending { border: 1px dashed var(--tch-g50); color: var(--tch-g70); }

/* Overdue due date: red 600 mono, "2d over" under it in 11px */
.l-over {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--tch-font-mono);
  font-size: calc(13px * var(--l-fs));
  font-weight: 600;
  line-height: 1.3;
  color: var(--tch-red);
  white-space: nowrap;
}
.l-over__by { font-size: calc(11px * var(--l-fs)); }
/* #95: when the project manager released the request, under the due date; grey, also inside a red .l-over */
.l-due { display: inline-flex; flex-direction: column; gap: 2px; line-height: 1.3; white-space: nowrap; }
.l-released { display: block; font-family: var(--tch-font-mono); font-size: calc(11px * var(--l-fs)); font-weight: 400; color: var(--tch-g50); white-space: nowrap; }

/* Priority: 3 rising bars, 4px wide, 6 / 10 / 14px tall, 2px apart,
   bottom-aligned. <span|button class="l-prio" data-level="0..3"><i></i><i></i><i></i></span>
   3 = all red, 2 = two ink, 1 = one ink, 0 = none filled; unfilled = g15. */
.l-prio {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  flex: none;
  height: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  vertical-align: middle;
}
button.l-prio { cursor: pointer; }
.l-prio > i {
  display: block;
  flex: none;
  width: 4px;
  height: 6px;
  background: var(--tch-g15);
}
.l-prio > i:nth-child(2) { height: 10px; }
.l-prio > i:nth-child(3) { height: 14px; }
.l-prio[data-level="1"] > i:nth-child(1),
.l-prio[data-level="2"] > i:nth-child(-n+2) { background: var(--tch-ink); }
.l-prio[data-level="3"] > i { background: var(--tch-red); }

/* Focus flag (today's bullhorn): icon in currentColor.
   0 = off (g30), 1 = blue, 2 = orange, 3 = green. */
.l-focus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tch-g30);
}
button.l-focus { cursor: pointer; }
.l-focus .l-ico { width: 16px; height: 16px; }
.l-focus[data-level="1"] { color: var(--tch-status-pending); }
.l-focus[data-level="2"] { color: var(--tch-status-progress); }
.l-focus[data-level="3"] { color: var(--tch-status-actioned); }

/* Unread / "new since you looked": 8px red square */
.l-dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  vertical-align: middle;
  background: var(--tch-red);
}

/* Client sign-off (README "Close"): strike the detail title, stamp COMPLETE.
   Add .is-closed to .l-title--detail; place <span class="l-stamp">COMPLETE</span>. */
.l-title--detail.is-closed { color: var(--tch-g50); }
.l-title--detail.is-closed::after {
  content: "";
  position: absolute;
  left: 0;
  top: 52%;
  height: 3px;
  background: var(--tch-ink);
  animation: tch-strike 600ms var(--tch-ease-in-out) both;
}
.l-stamp {
  display: inline-block;
  padding: 6px 26px;
  border: 5px solid var(--tch-status-complete);
  background: var(--tch-white);
  color: var(--tch-status-complete);
  font-family: var(--tch-font-display);
  font-size: 56px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: .08em;
  pointer-events: none;
  animation: tch-stamp 550ms 350ms var(--tch-ease-out) both;
}


/* ==========================================================================
   14  TABLE (T5, A2) - also the DataTables skin
   Columns (A2): dot 20 | Ref 92 | Title + latest | By -> To 200 | Due 120 |
   Taken / Est 110 | Priority 70 | Status 130. Column gap 16 = 8px each side.
   ========================================================================== */
.l-table {
  width: 100%;
  border-collapse: collapse;
  font-size: calc(13px * var(--l-fs));
  line-height: 1.45;
}
.l-table th {
  padding: 14px 8px;
  border-bottom: 1px solid var(--tch-charcoal);
  font-family: var(--tch-font-mono);
  font-size: calc(11px * var(--l-fs));
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  color: var(--tch-g70);
}
.l-table th a { color: inherit; }
.l-table th[aria-sort] { color: var(--tch-ink); }    /* sorted column header */
.l-table td {
  padding: 16px 8px;
  border-bottom: 1px solid var(--tch-g15);
  vertical-align: middle;
  color: var(--tch-g70);
}
.l-table th:first-child, .l-table td:first-child { padding-left: 0; }
.l-table th:last-child,  .l-table td:last-child  { padding-right: 0; }
.l-table tbody tr { transition: background var(--tch-dur-fast); }
.l-table tbody tr:hover { background: var(--tch-g05); }
.l-table tbody tr[data-href], .l-table tbody tr.is-link { cursor: pointer; }
.l-table tr.is-selected { background: var(--tch-g05); box-shadow: inset 3px 0 0 var(--tch-red); }

/* Density: Compact = 8px row padding. Per table (.is-compact) or for the
   whole site from the profile setting (html[data-density="compact"]). */
.l-table.is-compact td,
html[data-density="compact"] .l-table td { padding-top: 8px; padding-bottom: 8px; }

/* Column classes on th + td (A2 widths). The title column has no class and
   takes the free width. */
.l-table .l-col-dot    { width: 20px; padding-right: 0; line-height: 0; }
.l-table .l-col-ref    { width: 92px; }
.l-table .l-col-who    { width: 200px; }
.l-table .l-col-due    { width: 120px; }
.l-table .l-col-time   { width: 110px; text-align: right; white-space: nowrap; }
.l-table .l-col-prio   { width: 70px; white-space: nowrap; }
.l-table .l-col-status { width: 130px; white-space: nowrap; }
.l-table td.l-col-who  { font-size: calc(13px * var(--l-fs)); color: var(--tch-g70); }
.l-table td.l-col-time { font-family: var(--tch-font-mono); font-size: calc(13px * var(--l-fs)); }
.l-col-prio > * + *    { margin-left: 8px; }

/* Group row: Jost 22 "Client / Category" with right-aligned mono meta.
   <tr class="l-group"><td colspan="8">Kestrel Logistics <span class="l-group__sub">/ Bug</span>
   <span class="l-group__meta">4 open</span></td></tr> */
.l-table .l-group td {
  padding: 28px 0 10px;
  font-family: var(--tch-font-display);
  font-size: calc(22px * var(--l-fs));
  font-weight: 500;
  line-height: 1.2;
  color: var(--tch-ink);
}
.l-table.is-compact .l-group td,
html[data-density="compact"] .l-table .l-group td { padding-top: 20px; padding-bottom: 8px; }
.l-table tbody tr.l-group:hover { background: transparent; }
.l-group__name { font-family: var(--tch-font-display); font-size: calc(22px * var(--l-fs)); font-weight: 500; color: var(--tch-ink); }
.l-group__sub  { margin-left: 8px; font-family: var(--tch-font-display); font-size: calc(22px * var(--l-fs)); font-weight: 400; color: var(--tch-g50); }
.l-group__meta {
  float: right;
  margin-top: 8px;
  font-family: var(--tch-font-mono);
  font-size: calc(12px * var(--l-fs));
  font-weight: 400;
  color: var(--tch-g70);
}

/* Unread rows: red dot shows, title goes 600. The dot is hidden otherwise
   so the column stays aligned. */
.l-table tr:not(.is-unread) .l-dot { visibility: hidden; }

.l-ref {
  font-family: var(--tch-font-mono);
  font-size: calc(13px * var(--l-fs));
  color: var(--tch-g70);
  white-space: nowrap;
}
a.l-ref:hover { color: var(--tch-ink); }

/* Title + latest message: the title cell takes the free width and both
   lines truncate with an ellipsis. A PO badge may follow the title link. */
.l-table td:has(> .l-cell-title),
.l-table td.l-cell-title { width: 100%; max-width: 0; }
/* Generic lists + child tables (list.asp, edit.asp, CellFit): short values (.l-fit: numbers, money,
   dates) keep one line at their own width. A first column that is a number, date or code (.l-code,
   e.g. an invoice number) no longer takes the whole row. The text columns (.l-flex, no rule of their
   own) get the free width. Desktop only: phones stack the cells. */
@media (min-width: 900px) {
  .l-table .l-fit { white-space: nowrap; }
  .l-table td.l-fit:has(> .l-cell-title),
  .l-table td.l-code:has(> .l-cell-title) { width: 1%; max-width: none; }
}
/* e-mail cells: a list of addresses has no spaces ("a@x.co.za,b@y.co.za"), so it may break anywhere
   instead of pushing the table past the screen (Debtors, Accounts email) */
.l-table td a[href^="mailto:"] { overflow-wrap: anywhere; }
.l-cell-title {
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: calc(15px * var(--l-fs));
  font-weight: 400;
  line-height: 1.4;
  color: var(--tch-ink);
  text-decoration: none;
}
a.l-cell-title:hover { color: var(--tch-ink); text-decoration: underline; }
tr.is-unread .l-cell-title { font-weight: 600; }
.l-cell-title:has(+ .l-badge) { max-width: calc(100% - 132px); }
.l-cell-title + .l-badge { margin-left: 8px; vertical-align: 2px; }
.l-cell-latest {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: calc(13px * var(--l-fs));
  color: var(--tch-g50);
}

.l-num {
  font-family: var(--tch-font-mono);
  font-size: calc(13px * var(--l-fs));
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.l-table th.l-num { font-size: calc(11px * var(--l-fs)); }

/* Paging footer: count left (mono), page boxes right (34px square
   .l-btn--sm links; current page = .is-active or aria-current) */
.l-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 0 0;
  font-size: calc(13px * var(--l-fs));
  color: var(--tch-g70);
}
.l-pager__count { font-family: var(--tch-font-mono); }
.l-pager__pages { display: flex; gap: 2px; }
.l-pager__pages > a,
.l-pager__pages > span,
.l-pager__pages > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--tch-g15);
  background: var(--tch-white);
  color: var(--tch-ink);
  font-family: var(--tch-font-mono);
  font-size: calc(13px * var(--l-fs));
  text-decoration: none;
}
.l-pager__pages > a:hover, .l-pager__pages > button:hover { background: var(--tch-g05); color: var(--tch-ink); }
.l-pager__pages > .is-active,
.l-pager__pages > [aria-current="page"] {
  border-color: var(--tch-charcoal);
  background: var(--tch-charcoal);
  color: var(--tch-white);
}
.l-pager__pages > .is-disabled { color: var(--tch-g30); pointer-events: none; }
.l-pager__pages .l-ico { width: 16px; height: 16px; }

/* A2 list footer: count, legend, red "Load 25 more" */
.l-table-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 18px;
  padding: 24px 0 40px;
  font-size: calc(13px * var(--l-fs));
  color: var(--tch-g70);
}
.l-table-foot > :first-child { font-family: var(--tch-font-mono); }
.l-table-foot__more { color: var(--tch-red); font-weight: 600; }


/* ==========================================================================
   15  BOARD (A2)
   5 equal columns, gap 16. Column head: 2px charcoal top rule, status
   square + name + Jost 28 count, caps note. Drag: card .35, allowed target
   column tints g05 and shows a dashed slot.
   ========================================================================== */
.l-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  padding: 28px 0 24px;
}
.l-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 560px;
  transition: background var(--tch-dur-fast);
}
.l-col.is-allowed { outline: 1px dashed var(--tch-g30); outline-offset: 4px; }   /* may drop here */
.l-col.is-target  { background: var(--tch-g05); }                                /* dropping here now */
.l-col__body { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; min-height: 64px; }

/* <div class="l-col__head"><span class="l-col__name"><i class="l-col__sq"></i>Pending</span>
   <span class="l-col__count">3</span><span class="l-col__note">NOT STARTED</span></div>
   (an .l-status--x can stand in for .l-col__name) */
.l-col__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 4px;
  padding: 14px 0 8px;
  border-top: 2px solid var(--tch-charcoal);
}
.l-col__name,
.l-col__head .l-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: calc(15px * var(--l-fs));
  font-weight: 600;
  color: var(--tch-ink);
}
.l-col__head .l-status::before { width: 10px; height: 10px; }
.l-col__sq { display: inline-block; flex: none; width: 10px; height: 10px; background: var(--st, var(--tch-g50)); }
.l-col__count {
  font-family: var(--tch-font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  color: var(--tch-ink);
}
.l-col__note {
  grid-column: 1 / -1;
  font-family: var(--tch-font-mono);
  font-size: calc(11px * var(--l-fs));
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--tch-g50);
}
.l-col__empty { padding: 20px 0; font-size: calc(12px * var(--l-fs)); color: var(--tch-g50); }
.l-col__empty b, .l-col__empty strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--tch-font-display);
  font-size: calc(18px * var(--l-fs));
  font-weight: 500;
  color: var(--tch-ink);
}

.l-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--tch-g15);
  background: var(--tch-white);
  color: var(--tch-ink);
  cursor: grab;
  transition: transform 200ms var(--tch-ease-out), box-shadow 200ms var(--tch-ease-out), border-color var(--tch-dur-fast), opacity var(--tch-dur-fast);
}
.l-card:hover { border-color: var(--tch-g50); }
.l-card.is-dragging { opacity: .35; }
.l-card.is-locked { cursor: default; }
/* Lift: the dragged copy (jQuery UI helper) or a card marked .is-lifted */
.l-card.is-lifted,
.l-card.ui-sortable-helper {
  transform: translateY(-4px) rotate(-1.5deg);
  box-shadow: var(--tch-shadow-md);
  cursor: grabbing;
}
.l-card.l-flash { animation: tch-flash 900ms ease-out; }

.l-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: var(--tch-font-mono);
  font-size: calc(12px * var(--l-fs));
  color: var(--tch-g70);
}
.l-card__top > :first-child { display: inline-flex; align-items: center; gap: 7px; }
.l-card__top .l-dot { width: 7px; height: 7px; }
.l-card:not(.is-unread) .l-card__top .l-dot { visibility: hidden; }
.l-card__top .l-over { flex-direction: row; font-size: calc(12px * var(--l-fs)); }
.l-card__title {
  font-size: calc(14px * var(--l-fs));
  font-weight: 500;
  line-height: 1.4;
  color: var(--tch-ink);
  text-wrap: pretty;
  text-decoration: none;
}
a.l-card__title:hover { color: var(--tch-ink); text-decoration: underline; }
.l-card.is-unread .l-card__title { font-weight: 600; }
.l-card__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--tch-g15);
  font-size: calc(12px * var(--l-fs));
  color: var(--tch-g70);
}
.l-card__foot > :first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.l-card__foot .l-mono { font-size: calc(12px * var(--l-fs)); }
/* Smaller priority bars on cards: 3px wide, 5 / 8 / 12 tall */
.l-card .l-prio { height: 12px; }
.l-card .l-prio > i { width: 3px; height: 5px; }
.l-card .l-prio > i:nth-child(2) { height: 8px; }
.l-card .l-prio > i:nth-child(3) { height: 12px; }

/* #105 M4: board column heads and the tasks table head stay under the top bar, desktop only. No animation.
   z-index below the top bar (50) and the menus (60). A border on a sticky cell does not travel with
   border-collapse, so the table head rule is drawn by box-shadow. */
@media (min-width: 900px) and (min-height: 700px) {
  .l-col__head { position: sticky; top: var(--l-bar-h); z-index: 40; background: var(--tch-white); transition: background var(--tch-dur-fast); }
  .l-col.is-target .l-col__head { background: var(--tch-g05); }
  .l-table[data-tasks] thead th { position: sticky; top: var(--l-bar-h); z-index: 40; background: var(--tch-white); border-bottom: 0; box-shadow: inset 0 -1px 0 var(--tch-charcoal); }
}

/* Drop placeholder: "Drop to move to In progress" (not used by the board since #105: the column tint shows the target) */
.l-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  border: 1.5px dashed var(--tch-g50);
  font-size: calc(13px * var(--l-fs));
  color: var(--tch-g70);
}


/* ==========================================================================
   16  TASK DETAIL (A3)
   Content (fills) + 380px aside, gap 64. Content blocks stack at gap 40.
   ========================================================================== */
.l-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 64px;
  padding-top: 40px;
}
.l-detail > :first-child {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-width: 0;
}
.l-prose {                               /* Details body copy: 16 / 1.65, 760 wide */
  max-width: 760px;
  font-size: calc(16px * var(--l-fs));
  line-height: 1.65;
}
.l-prose p + p { margin-top: 12px; }
.l-prose img { max-width: 100%; height: auto; }

.l-aside {
  display: flex;
  flex-direction: column;
  align-self: start;
  border-top: 2px solid var(--tch-charcoal);
  min-width: 0;
}

/* Key / value row: 120px key | value | optional red action on the right */
.l-kv {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--tch-g15);
  font-size: calc(14px * var(--l-fs));
}
.l-kv__k { font-size: calc(13px * var(--l-fs)); color: var(--tch-g70); }
.l-kv__v { font-size: calc(14px * var(--l-fs)); font-weight: 500; color: var(--tch-ink); min-width: 0; overflow-wrap: anywhere; }
.l-kv__act {
  padding: 0;
  border: 0;
  background: none;
  font-size: calc(12px * var(--l-fs));
  font-weight: 500;
  color: var(--tch-red);
  white-space: nowrap;
}
.l-kv__act:hover { color: var(--tch-red-dark); text-decoration: underline; }

/* Time vs estimate: label row + 8px bar. Fill = ink; over estimate = red.
   <div class="l-tbar-head"><span>Time vs estimate</span><span>2h 10m / 3h 00m</span></div>
   <div class="l-tbar [is-over]"><span style="width:72%"></span></div>
   A second <span> after the first draws the over-run segment in red. */
.l-tbar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 22px;
  margin-bottom: 12px;
  font-size: calc(13px * var(--l-fs));
  color: var(--tch-g70);
}
.l-tbar-head > :last-child { font-family: var(--tch-font-mono); color: var(--tch-ink); }
.l-tbar-head.is-over > :first-child { color: var(--tch-red); font-weight: 600; }
.l-tbar {
  display: flex;
  height: 8px;
  overflow: hidden;
  background: var(--tch-g05);
}
.l-tbar > span {
  display: block;
  height: 100%;
  background: var(--tch-ink);
  transform-origin: left;
  animation: tch-growx var(--tch-dur-base) var(--tch-ease-out) both;   /* #105: 350ms, no delay */
}
.l-tbar.is-over > span:only-child,
.l-tbar > span + span { background: var(--tch-red); }

/* Time per person: name 90 | bar | 56 time.
   <div class="l-people"><div><span>Sipho N.</span><span class="l-people__bar"><span style="width:78%"></span></span><span>1h 40</span></div>...</div> */
.l-people {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.l-people > * {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 10px;
  font-size: calc(13px * var(--l-fs));
}
.l-people > * > :first-child { color: var(--tch-g70); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.l-people > * > :last-child { font-family: var(--tch-font-mono); text-align: right; }
.l-people__bar { display: block; height: 6px; background: var(--tch-g05); }
.l-people__bar > span {
  display: block;
  height: 100%;
  background: var(--tch-g50);
  transform-origin: left;
  animation: tch-growx var(--tch-dur-base) var(--tch-ease-out) both;   /* #105: 350ms, no delay */
}
.l-people > :first-child .l-people__bar > span { background: var(--tch-ink); }   /* top contributor in ink */

/* Files grid (A3: 4 up, + tile). Tile = 96px type block on g05, name, meta.
   <a class="l-file" href="..."><span class="l-file__type">PDF</span>
   <span class="l-file__name">spec.pdf</span><span class="l-file__meta">410 KB . 15 Oct</span></a> */
.l-files {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.l-file {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--tch-g15);
  background: var(--tch-white);
  color: var(--tch-ink);
  text-decoration: none;
  transition: border-color var(--tch-dur-fast);
}
a.l-file:hover { border-color: var(--tch-g50); color: var(--tch-ink); text-decoration: none; }
.l-file__type {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 96px;
  overflow: hidden;
  background: var(--tch-g05);
  font-family: var(--tch-font-mono);
  font-size: calc(13px * var(--l-fs));
  text-transform: uppercase;
  color: var(--tch-g50);
}
.l-file__type img { width: 100%; height: 100%; object-fit: cover; }
.l-file__name {
  display: block;
  padding: 10px 12px 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: calc(13px * var(--l-fs));
  font-weight: 500;
}
.l-file__meta {
  display: block;
  padding: 2px 12px 10px;
  font-family: var(--tch-font-mono);
  font-size: calc(11px * var(--l-fs));
  color: var(--tch-g50);
}
.l-file__dl {                            /* T7 download corner button */
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--tch-g15);
  background: var(--tch-white);
  color: var(--tch-ink);
}
.l-file__dl .l-ico { width: 14px; height: 14px; }
.l-file__meta.is-caught { color: var(--tch-status-actioned); font-weight: 600; text-transform: uppercase; }  /* W3 "Caught from Details" */

.l-file--add {
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 150px;
  border: 1.5px dashed var(--tch-g50);
  background: transparent;
  color: var(--tch-g70);
  font-size: calc(13px * var(--l-fs));
  cursor: pointer;
}
a.l-file--add:hover, .l-file--add:hover { border-color: var(--tch-ink); color: var(--tch-ink); }
.l-file--add .l-ico { width: 22px; height: 22px; color: var(--tch-ink); }
.l-file--add .l-file__meta { padding: 0; }


/* ==========================================================================
   17  ACTIVITY THREAD (T6, A3)
   Them: g05 block on the left, indented 80px on the right.
   Me:   charcoal block, white text, indented 80px on the left.
   Avatar (36px) sits OUTSIDE the block, in a 44px column + 12px gap.
   Events: centred single mono line with an 8px coloured square.
   Oldest at top.

   <div class="l-msg l-msg--theirs">
     <span class="l-msg__avatar">LM</span>
     <b class="l-msg__who">Lerato M.</b> <span class="l-msg__role">Kestrel Logistics</span>
     <span class="l-msg__when">13 Oct 08:14</span>
     <div class="l-msg__body">...</div>
     <span class="l-msg__time">1h 25m &middot; billable &middot; ~1h still needed</span>
   </div>
   The clock glyph before .l-msg__time is drawn here - leave it out of the markup.
   ========================================================================== */
.l-thread { display: flex; flex-direction: column; }

.l-msg {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin: 8px 80px 8px 56px;            /* 44px avatar column + 12 gap (T6 grid) */
  padding: 16px 18px;
  background: var(--tch-g05);
  color: var(--tch-ink);
}
.l-msg--mine {
  margin: 8px 0 8px 136px;              /* 80 indent + 56 avatar column */
  background: var(--tch-charcoal);
  color: var(--tch-white);
}
.l-msg.l-rise { animation-duration: 400ms; }   /* a new line sliding into the thread */
.l-msg.is-pending .l-msg__body { opacity: .7; }   /* #105 M7: still being sent; the text dims, not the bubble (l-rise holds its opacity) */

.l-msg__avatar {
  position: absolute;
  top: 0;
  left: -56px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--tch-g05);
  color: var(--tch-ink);
  font-size: calc(12px * var(--l-fs));
  font-weight: 600;
  line-height: 1;
}
.l-msg--mine .l-msg__avatar { background: var(--tch-charcoal); color: var(--tch-white); }

.l-msg__head { display: flex; flex: 1 1 100%; align-items: baseline; gap: 12px; }
.l-msg__who  { font-size: calc(14px * var(--l-fs)); font-weight: 600; }
.l-msg__role { font-size: calc(12px * var(--l-fs)); opacity: .6; }
.l-msg__when {
  margin-left: auto;
  font-family: var(--tch-font-mono);
  font-size: calc(12px * var(--l-fs));
  opacity: .6;
  white-space: nowrap;
}
.l-msg__body {
  flex: 1 1 100%;
  max-width: 680px;
  font-size: calc(15px * var(--l-fs));
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.l-msg__body p + p { margin-top: 8px; }
.l-msg__body a { color: inherit; text-decoration: underline; }
.l-msg--mine .l-msg__body a:hover { color: var(--tch-white); }
.l-msg__body img { max-width: 100%; height: auto; }
.l-msg__time {
  flex: 1 1 100%;
  font-family: var(--tch-font-mono);
  font-size: calc(12px * var(--l-fs));
  opacity: .75;
}
.l-msg__time::before { content: "\25D4\00A0\00A0"; }   /* the clock-quarter glyph */

/* System event */
.l-event {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  padding: 10px 0;
  font-family: var(--tch-font-mono);
  font-size: calc(12px * var(--l-fs));
  line-height: 1.5;
  text-align: center;
  color: var(--tch-g70);
}
.l-event__sq { display: inline-block; flex: none; width: 8px; height: 8px; background: var(--st, var(--tch-g50)); }
.l-event__what { color: var(--tch-ink); }
.l-event__when { color: var(--tch-g50); }
.l-event .l-ico { width: 14px; height: 14px; color: var(--st, var(--tch-g70)); }

/* Composer: 2px ink frame. Text area borderless; bar = small inputs,
   billable toggle, attach, and the send button pushed right. */
.l-composer {
  display: flex;
  flex-direction: column;
  margin-top: 24px;
  border: 2px solid var(--tch-ink);
  background: var(--tch-white);
}
.l-composer--quiet { border: 1px solid var(--tch-g50); }   /* T6 client composer */
.l-composer__text {
  display: block;
  width: 100%;
  min-height: 84px;
  padding: 16px 18px;
  border: 0;
  outline: 0;
  resize: vertical;
  background: transparent;
  color: var(--tch-ink);
  font-size: calc(15px * var(--l-fs));
  line-height: 1.6;
}
.l-composer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--tch-g15);
  font-size: calc(13px * var(--l-fs));
}
.l-composer__bar > :last-child { margin-left: auto; }
/* #68: the @ picker under the message box, and a tag in a saved message */
.l-composer { position: relative; }
.l-mention-pick {
  position: absolute;
  left: 12px;
  top: 0;
  z-index: 30;
  min-width: 280px;
  max-width: calc(100% - 24px);
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--tch-g30);
  border-radius: var(--tch-radius-sm, 4px);
  background: var(--tch-white);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
  font-size: calc(13px * var(--l-fs));
}
.l-mention-pick[hidden] { display: none; }
.l-mention-pick__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--tch-ink);
}
.l-mention-pick__row b { white-space: nowrap; }
.l-mention-pick__row span { color: var(--tch-g70); white-space: nowrap; }
.l-mention-pick__row.is-on, .l-mention-pick__row:hover { background: var(--tch-g08); }
.l-mention { color: var(--tch-red); font-weight: 600; }
/* #69: a status waiting in the composer (Put on hold / Ask for sign-off), with Cancel */
.l-composer__armed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 4px 4px 12px;
  border-bottom: 1px solid var(--tch-g15);
  background: var(--tch-red-tint);
  font-size: calc(13px * var(--l-fs));
}
.l-composer__bar .l-toggle { gap: 8px; font-size: calc(13px * var(--l-fs)); padding: 0 4px; }
.l-composer__bar .l-btn { height: 38px; }
.l-composer__attach {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--tch-g70);
  font-size: calc(13px * var(--l-fs));
}
.l-composer__attach:hover { color: var(--tch-ink); }
.l-composer__attach .l-ico { width: 16px; height: 16px; }

/* Small labelled number input: "Time taken [25] min" */
.l-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--tch-g15);
  font-size: calc(13px * var(--l-fs));
  color: var(--tch-g70);
  white-space: nowrap;
}
.l-mini:focus-within { border-color: var(--tch-ink); }
.l-mini input {
  width: 3.2em;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--tch-ink);
  font-family: var(--tch-font-mono);
  font-size: calc(13px * var(--l-fs));
  font-weight: 600;
  text-align: right;
  -moz-appearance: textfield;
}
.l-mini input::-webkit-inner-spin-button,
.l-mini input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.l-mini__unit { color: var(--tch-g50); }


/* ==========================================================================
   18  FEEDBACK (T8, T9)
   ========================================================================== */
/* Toast: bottom centre, ink block, 400ms in, 4s hold (the red bar counts
   down; hover pauses it), 300ms out (add .is-out, set [hidden] after 300ms). */
.l-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 32px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 20px;
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 0 auto;
  padding: 14px 20px;
  overflow: hidden;
  background: var(--tch-ink);
  color: var(--tch-white);
  font-size: calc(14px * var(--l-fs));
  line-height: 1.45;
  box-shadow: var(--tch-shadow-md);
  animation: tch-rise 400ms var(--tch-ease-out) both;
}
.l-toast::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--tch-red);
  transform-origin: left;
  animation: tch-growx var(--l-toast-ms, 4s) linear reverse both;   /* the toast's time, set by L.toast */
}
.l-toast.is-restart::after { animation: none; }
.l-toast:hover::after { animation-play-state: paused; }
.l-toast.is-out { animation: l-toast-out 300ms ease-in both; }
.l-toast__ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  background: var(--tch-status-actioned);
  color: #FFFFFF;
}
.l-toast__ok .l-ico { width: 12px; height: 12px; }
.l-toast__undo {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--tch-red);
  font-size: calc(14px * var(--l-fs));
  font-weight: 600;
  cursor: pointer;
}
.l-toast__undo:hover { color: var(--tch-red); text-decoration: underline; }

/* Inline alert: tint background, 1px frame in the alert colour, 24px icon
   block, title + text, optional action link on the right.
   <div class="l-alert l-alert--warn"><span class="l-alert__icon">svg</span>
   <div class="l-alert__body"><b class="l-alert__title">..</b><span class="l-alert__text">..</span></div>
   <a class="l-alert__act" href="#">Fix</a></div> */
.l-alert {
  --al: var(--tch-status-pending);
  --al-tint: var(--tch-status-pending-tint);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--al);
  background: var(--al-tint);
  color: var(--tch-ink);
  font-size: calc(14px * var(--l-fs));
  line-height: 1.5;
}
.l-alert--info  { --al: var(--tch-status-pending);  --al-tint: var(--tch-status-pending-tint); }
.l-alert--ok    { --al: var(--tch-status-actioned); --al-tint: var(--tch-status-actioned-tint); }
.l-alert--warn  { --al: var(--tch-status-progress); --al-tint: var(--tch-status-progress-tint); }
.l-alert--error { --al: var(--tch-red);             --al-tint: var(--tch-red-tint); }
.l-alert__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  background: var(--al);
  color: var(--tch-white);
}
.l-alert__icon .l-ico { width: 14px; height: 14px; }
.l-alert__body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.l-alert__title { font-size: calc(14px * var(--l-fs)); font-weight: 600; }
.l-alert__text  { font-size: calc(13px * var(--l-fs)); line-height: 1.5; color: var(--tch-g70); }
.l-alert__act   { margin-left: auto; font-size: calc(13px * var(--l-fs)); font-weight: 600; white-space: nowrap; }

/* Dialog: dim backdrop, 440px panel, 2px charcoal top rule, Jost title,
   actions right. Never the browser's confirm(). */
.l-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,.45);
  animation: l-fade 300ms ease-out both;
}
.l-dialog {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 440px;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  background: var(--tch-white);
  border-top: 2px solid var(--tch-charcoal);
  box-shadow: var(--tch-shadow-md);
  color: var(--tch-ink);
  animation: tch-drop 300ms var(--tch-ease-out) both;
}
.l-dialog__title { font-family: var(--tch-font-display); font-size: 26px; font-weight: 500; line-height: 1.15; }
.l-dialog__text  { font-size: calc(14px * var(--l-fs)); line-height: 1.55; color: var(--tch-g70); }
.l-dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* Empty state: one sentence, one way forward. Icon 32, Jost title. */
.l-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 16px;
  text-align: center;
}
.l-empty > .l-ico { width: 32px; height: 32px; margin-bottom: 8px; color: var(--tch-g50); }
.l-empty__where {
  font-family: var(--tch-font-mono);
  font-size: calc(11px * var(--l-fs));
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tch-g50);
}
.l-empty__title { font-family: var(--tch-font-display); font-size: 26px; font-weight: 500; line-height: 1.2; }
.l-empty__text  { max-width: 46ch; font-size: calc(14px * var(--l-fs)); line-height: 1.55; color: var(--tch-g70); }
.l-empty__act   { margin-top: 4px; font-size: calc(14px * var(--l-fs)); font-weight: 600; }

/* Skeleton: shimmer block (1400ms linear loop). Rows only appear after
   300ms so fast loads never flicker. Never a spinner on a list. */
.l-skel {
  display: block;
  height: 12px;
  background: linear-gradient(90deg, var(--tch-g05) 0%, var(--tch-g15) 50%, var(--tch-g05) 100%);
  background-size: 200% 100%;
  animation: tch-shimmer 1400ms linear infinite;
}
.l-skel--title { height: 14px; }
.l-skel-row {
  display: grid;
  grid-template-columns: 20px 92px minmax(0, 1fr) 180px 110px 130px;
  column-gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--tch-g15);
  animation: l-fade 150ms 300ms both;
}


/* ==========================================================================
   19  SIGN IN (A1)
   Full viewport, 7/5 grid. Left: logo, red rule drawing in, three-line
   headline rising 150ms apart. Right: g05 panel with the form.
   ========================================================================== */
.l-signin {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--tch-white);
}
.l-signin__left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 56px 72px;
  min-width: 0;
}
.l-signin__logo,
.l-signin .l-top__logo { height: 40px; width: auto; animation: l-fade 800ms ease both; }
.l-signin__rule {
  width: 160px;
  height: 2px;
  margin-bottom: 28px;
  background: var(--tch-red);
  transform-origin: left;
  animation: tch-growx 900ms 200ms var(--tch-ease-out) both;
}
.l-signin__headline {
  font-family: var(--tch-font-display);
  font-weight: 500;
  font-size: clamp(68px, 11.67vw, 168px);   /* 168px at the 1440 design width */
  line-height: .86;
  letter-spacing: -.04em;
  margin: 0;
}
.l-signin__headline .l-rise {
  display: block;
  animation-duration: 900ms;
  animation-delay: calc(300ms + var(--i, 0) * 150ms);
}
.l-signin__headline em { font-style: normal; color: var(--tch-red); }   /* the final full stop */
.l-signin__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-family: var(--tch-font-mono);
  font-size: calc(12px * var(--l-fs));
  color: var(--tch-g50);
  animation: l-fade 1s 900ms both;
}
.l-signin__right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 36px;
  padding: 72px;
  background: var(--tch-g05);
  border-left: 1px solid var(--tch-g15);
  animation: l-fade 800ms 500ms both;
}
.l-signin__form { display: flex; flex-direction: column; gap: 36px; width: 100%; max-width: 400px; }
.l-signin__title,
.l-signin__right h1,
.l-signin__right h2 {
  font-family: var(--tch-font-display);
  font-weight: 500;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -.01em;
}
.l-signin__lead { margin-top: 8px; font-size: calc(15px * var(--l-fs)); color: var(--tch-g70); }
.l-signin__right .l-field { margin-bottom: 20px; }
.l-signin__right .l-input { background: var(--tch-white); }
.l-signin__right .l-check { font-size: calc(14px * var(--l-fs)); gap: 10px; }
.l-signin .l-btn--block { justify-content: space-between; }   /* "Sign in ->" */
.l-signin__note {
  padding-top: 20px;
  border-top: 1px solid var(--tch-g15);
  font-size: calc(13px * var(--l-fs));
  line-height: 1.6;
  color: var(--tch-g50);
}


/* ==========================================================================
   20  MOTION HELPERS (T12)
   Motion explains a change, never decorates. Enter ease-out, leave faster.
   Reduced motion is handled once, in section 03.
   ========================================================================== */
/* Rise: 600ms ease-out, 24px up + fade. Stagger with style="--i:N" (60ms). */
.l-rise {
  animation: tch-rise 600ms var(--tch-ease-out) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
/* Rule draw: 900ms ease-out, scaleX from the left */
.l-draw {
  transform-origin: left;
  animation: tch-growx 900ms var(--tch-ease-out) both;
}
/* Row flash: a row / card / count that just changed. Grey, 900ms, colour only (#105 M2; T12 said red, 1200ms) */
.l-flash { animation: tch-flash 900ms ease-out; }
/* Drop: menus, selects, pickers, notifications */
.l-drop-in { animation: tch-drop 300ms var(--tch-ease-out) both; }


/* ==========================================================================
   21  UTILITIES
   ========================================================================== */
.l-mono  { font-family: var(--tch-font-mono); font-variant-numeric: tabular-nums; }
.l-muted { color: var(--tch-g70); }
.l-red   { color: var(--tch-red); }
.l-right { text-align: right; }
.l-only-sm { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ==========================================================================
   22  NARROW SCREENS (< 900px) - W8, the website at phone width
   Gutters 40 -> 16. Top bar collapses to a hamburger panel. KPI 4 -> 2.
   Detail aside drops below. Table rows stack. Board scrolls sideways.
   ========================================================================== */
@media (max-width: 899px) {

  /* -- Utilities -- */
  .l-hide-sm { display: none !important; }
  .l-only-sm { display: revert !important; }

  /* -- Shell: 56px bar, burger, logo 20px, avatar 30px -- */
  :root { --l-bar-h: 56px; }
  .l-top {
    height: var(--l-bar-h);
    gap: 14px;
    padding: 0 16px;
  }
  .l-top__burger { display: inline-flex; margin-left: -6px; }
  .l-top__logo { height: 20px; }
  .l-top__right { gap: 14px; }
  .l-top__right .l-search { display: none; }
  .l-top__right .l-menu { position: fixed; top: 56px; left: 0; right: 0; width: auto; max-height: calc(100vh - 56px); overflow-y: auto; }
  .l-top__right > .l-avatar,
  .l-top__right > .l-dd > .l-avatar { width: 30px; height: 30px; font-size: calc(11px * var(--l-fs)); }
  .l-btn-raise { height: 34px; padding: 0 12px; font-size: calc(13px * var(--l-fs)); }

  .l-nav { display: none; }
  .l-top.is-open .l-nav {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 8px 0;
    background: var(--tch-white);
    border-bottom: 1px solid var(--tch-g15);
    box-shadow: var(--tch-shadow-md);
    animation: tch-drop 300ms var(--tch-ease-out) both;
  }
  .l-nav .l-dd { height: auto; flex-direction: column; align-items: stretch; }
  .l-nav__item {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border-top: 0;
    border-bottom: 0;
    border-left: 2px solid transparent;
  }
  .l-nav__item.is-active { border-left-color: var(--tch-red); }
  .l-nav .l-dd > .l-menu {
    position: static;
    min-width: 0;
    width: auto;
    margin: 0 0 8px 16px;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--tch-g15);
    box-shadow: none;
    animation: none;
  }

  /* -- Page -- */
  .l-page { padding: 20px 16px 48px; }
  .l-title { font-size: 36px; }
  .l-title--detail { font-size: 24px; line-height: 1.15; }
  .l-title__count { font-size: calc(22px * var(--l-fs)); }
  .l-head { gap: 16px; }
  .l-head--ruled { padding-bottom: 16px; }
  .l-tabs {
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    font-size: calc(13px * var(--l-fs));
  }
  .l-tab { font-size: calc(13px * var(--l-fs)); }

  /* -- KPI strip: 2 columns -- */
  .l-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 24px; }
  .l-kpi { margin-right: 16px; padding: 16px 16px 16px 0; }
  .l-kpi:nth-child(2n) { margin-right: 0; border-right: 0; padding-left: 0; }
  .l-kpi:nth-child(-n+2) { border-bottom: 1px solid var(--tch-g15); }
  .l-kpi__num { font-size: 40px; }
  .l-kpi__label { font-size: calc(11px * var(--l-fs)); }

  /* -- Filter bar -- */
  .l-filters { margin-top: 20px; gap: 6px; }
  .l-fchip { height: 30px; padding: 0 10px; font-size: calc(12px * var(--l-fs)); }
  .l-freset { height: 30px; padding: 0 10px; font-size: calc(12px * var(--l-fs)); }
  /* The Requested from - until chip is wider than a phone at Large text (#59): let it wrap, never overflow */
  .l-fchip:has(input[type="date"]) { flex-wrap: wrap; height: auto; min-height: 30px; max-width: 100%; padding-top: 4px; padding-bottom: 4px; }
  .l-filters__right { margin-left: 0; width: 100%; justify-content: space-between; gap: 8px; }

  /* -- Table -> stacked rows (W8): ref + due line, title, then the rest -- */
  .l-table, .l-table tbody { display: block; }
  .l-table thead { display: none; }
  .l-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--tch-g15);
  }
  .l-table td {
    display: block;
    padding: 0 !important;
    border: 0;
    font-size: calc(12px * var(--l-fs));
    order: 3;
  }
  .l-table td:empty { display: none; }
  .l-table td[class] { width: auto; }
  .l-table td.l-col-dot { order: 0; align-self: center; }
  .l-table tr:not(.is-unread) td.l-col-dot { display: none; }
  .l-table td.l-col-ref { order: 1; }
  .l-table td.l-col-due { order: 1; margin-left: auto; }
  .l-table td.l-col-time { text-align: left; font-size: calc(12px * var(--l-fs)); }
  .l-table .l-ref { font-size: calc(12px * var(--l-fs)); }
  .l-table td.l-col-due[data-label]::before,
  .l-table td.l-col-time[data-label]::before {
    content: attr(data-label) "\00A0";
    font-family: var(--tch-font-mono);
    font-size: calc(11px * var(--l-fs));
    font-weight: 400;
    color: var(--tch-g50);
  }
  .l-table td:has(> .l-cell-title) { order: 2; flex: 1 1 100%; max-width: none; }
  .l-cell-title:has(+ .l-badge) { max-width: none; }
  .l-table .l-cell-title { white-space: normal; font-size: calc(15px * var(--l-fs)); line-height: 1.35; }
  .l-table .l-cell-latest { white-space: nowrap; }
  .l-table .l-num { text-align: left; font-size: calc(12px * var(--l-fs)); }
  .l-table .l-over, .l-table .l-due { flex-direction: row; gap: 6px; font-size: calc(12px * var(--l-fs)); }
  .l-table .l-status { font-size: calc(12px * var(--l-fs)); gap: 6px; }
  /* the monthly summary (#24) stays a real table and scrolls sideways in its .l-wide box */
  .l-table.l-table--months { display: table; }
  .l-table.l-table--months thead { display: table-header-group; }
  .l-table.l-table--months tbody { display: table-row-group; }
  .l-table.l-table--months tr { display: table-row; padding: 0; border: 0; }
  .l-table.l-table--months th, .l-table.l-table--months td { display: table-cell; padding: 10px 8px !important; border-bottom: 1px solid var(--tch-g15); }
  .l-table.l-table--months .l-num { text-align: right; font-size: calc(13px * var(--l-fs)); }
  .l-table--months tbody th[scope="row"] { min-width: 180px; }
  .l-table .l-status::before { width: 7px; height: 7px; }
  .l-table tbody tr:hover { background: transparent; }
  .l-table .l-group { display: block; padding: 0; border-bottom: 1px solid var(--tch-charcoal); }
  .l-table .l-group td { display: block; padding: 14px 0 8px !important; font-size: calc(17px * var(--l-fs)); }
  .l-group__name, .l-group__sub { font-size: calc(17px * var(--l-fs)); }
  .l-group__meta { margin-top: 4px; font-size: calc(11px * var(--l-fs)); }
  .l-table.is-compact tr,
  html[data-density="compact"] .l-table tr { padding: 8px 0; }

  .l-table-foot { padding: 18px 0 24px; }

  /* -- Board: columns scroll sideways, one-and-a-bit in view -- */
  .l-board {
    grid-template-columns: repeat(6, minmax(260px, 80vw));
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 -16px;
    padding: 20px 16px;
    scroll-padding: 0 16px;
  }
  .l-col { min-height: 320px; scroll-snap-align: start; }

  /* -- Detail: aside drops below the content -- */
  .l-detail { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 24px; }
  .l-detail > :first-child { gap: 32px; }
  .l-prose { font-size: calc(15px * var(--l-fs)); }
  .l-files { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .l-kv { grid-template-columns: 110px minmax(0, 1fr) auto; }

  /* -- Thread: no avatars, 36px indents (W8) -- */
  .l-msg { margin: 5px 36px 5px 0; padding: 11px 14px; gap: 4px 12px; }
  .l-msg--mine { margin: 5px 0 5px 36px; }
  .l-msg__avatar { display: none; }
  .l-msg__who { font-size: calc(12px * var(--l-fs)); }
  .l-msg__body { font-size: calc(14px * var(--l-fs)); line-height: 1.5; }
  .l-event { font-size: calc(11px * var(--l-fs)); gap: 4px 8px; }
  .l-composer__bar > :last-child { margin-left: 0; flex: 1 1 100%; }
  .l-composer__bar .l-btn { width: 100%; }

  /* -- Forms -- */
  .l-typecards { grid-template-columns: minmax(0, 1fr); }
  .l-formsec { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 24px 0; }
  .l-field--row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .l-savebar { margin: 0 -16px; padding: 0 16px; height: auto; min-height: 64px; flex-wrap: wrap; gap: 8px; }
  .l-savebar > :first-child { flex: 1 1 100%; padding-top: 10px; }
  .l-savebar > :nth-child(2) { margin-left: 0; }

  /* -- Feedback -- */
  .l-toast { bottom: 16px; padding: 12px 16px; gap: 14px; font-size: calc(13px * var(--l-fs)); }
  .l-dialog { padding: 20px 16px; }
  .l-dialog__title { font-size: calc(22px * var(--l-fs)); }

  /* -- Sign in: single column, headline ~68px -- */
  .l-signin { grid-template-columns: minmax(0, 1fr); }
  .l-signin__left { padding: 32px 16px; gap: 32px; }
  .l-signin__logo, .l-signin .l-top__logo { height: 28px; }
  .l-signin__headline { font-size: 68px; }
  .l-signin__right {
    padding: 32px 16px 40px;
    gap: 28px;
    border-left: 0;
    border-top: 1px solid var(--tch-g15);
  }
  .l-signin__title, .l-signin__right h1, .l-signin__right h2 { font-size: 32px; }
}

/* ==========================================================================
   23  PAGE GLUE (classes used by the /v2/ pages beyond the component API)
   ========================================================================== */
.l-detail-head { margin-bottom: 32px; }
.l-detail-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0 12px; }
.l-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.l-detail__main { min-width: 0; }
.l-detail__main .l-section-head { margin-top: 32px; }
.l-detail__main .l-section-head:first-child { margin-top: 0; }
.l-details-body { font-size: calc(15px * var(--l-fs)); line-height: 1.6; overflow-wrap: anywhere; max-width: 760px; }
.l-details-body p, .l-details-body ul, .l-details-body ol, .l-details-body table, .l-details-body blockquote { margin: 0 0 12px; }
.l-details-body ul, .l-details-body ol { padding-left: 24px; }
.l-details-body img { max-width: 100%; height: auto; }
.l-details-body table { border-collapse: collapse; }
.l-details-body td, .l-details-body th { border: 1px solid var(--tch-g15); padding: 4px 8px; }
.l-details-body a { color: var(--tch-red); }
.l-kv__act { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.l-drop-page {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: color-mix(in srgb, var(--tch-white) 88%, transparent);
  border: 2px dashed var(--tch-ink);
  font-family: var(--tch-font-display); font-size: 28px; color: var(--tch-ink);
  pointer-events: none;
}
.l-drop-page[hidden] { display: none; }
.l-file.is-uploading { opacity: .5; }
.l-inline-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.l-inline-edit .l-input, .l-inline-edit .l-select { height: 36px; min-width: 0; flex: 1 1 160px; }

/* Gitea issue links on the task page (staff; woodzgit/tasking#40 P2) */
.l-links { margin-bottom: 12px; }
.l-link { padding: 12px 0; border-bottom: 1px solid var(--tch-g15); font-size: calc(14px * var(--l-fs)); }
.l-link__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.l-link__ref { font-family: var(--tch-font-mono); font-size: calc(13px * var(--l-fs)); color: var(--tch-ink); overflow-wrap: anywhere; }
.l-link__label { margin-top: 4px; font-weight: 500; color: var(--tch-ink); overflow-wrap: anywhere; }
.l-link__title { margin-top: 2px; font-size: calc(13px * var(--l-fs)); color: var(--tch-g70); overflow-wrap: anywhere; }
.l-link__acts { display: flex; gap: 16px; margin-top: 6px; }
.l-link-form { margin-bottom: 12px; }
.l-link-form .l-input { flex-basis: 100%; }
/* deploy state of a link (staff) and the client's Changes panel (woodzgit/tasking#40 P5) */
.l-link__proof { margin-top: 2px; font-size: calc(12px * var(--l-fs)); color: var(--tch-g70); overflow-wrap: anywhere; }
.l-badge--lnk-on_dev, .l-badge--lnk-awaiting { border-color: var(--tch-status-signoff); color: var(--tch-status-signoff); }
.l-badge--lnk-approved, .l-badge--lnk-on_live { border-color: var(--tch-status-actioned); color: var(--tch-status-actioned); }
.l-badge--lnk-held { border-style: dashed; }
.l-changes { margin-bottom: 12px; }
.l-change { padding: 12px 0; border-bottom: 1px solid var(--tch-g15); font-size: calc(14px * var(--l-fs)); }
.l-change__label { font-weight: 500; color: var(--tch-ink); overflow-wrap: anywhere; }
.l-change__state { margin-top: 2px; font-size: calc(13px * var(--l-fs)); color: var(--tch-g70); }
.l-change__state--awaiting { color: var(--tch-status-signoff); font-weight: 500; }
.l-change__state--approved, .l-change__state--on_live { color: var(--tch-status-actioned); }
.l-change__test { display: inline-block; margin-top: 4px; font-size: calc(13px * var(--l-fs)); color: var(--tch-ink); }
.l-change__acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
/* #130: Approve asks when it should go live (three choices, a date for "Not before") */
.l-golive__set { border: 0; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; width: 100%; }
.l-golive__set legend { width: 100%; margin-bottom: 4px; }
.l-golive__date { width: auto; max-width: 180px; }
.l-link__golive { margin-top: 4px; }
.l-change__note.l-input { flex-basis: 100%; height: auto; min-height: 72px; padding: 8px 10px; }
.l-editor { border: 1px solid var(--tch-g50); background: var(--tch-white); }
.l-editor:focus-within { outline: 2px solid var(--tch-ink); outline-offset: -1px; }
.l-editor__bar { display: flex; gap: 4px; padding: 4px 8px; border-bottom: 1px solid var(--tch-g15); }
.l-editor__area.l-input { display: block; height: auto; min-height: 180px; border: 0; outline: 0; padding: 12px 14px; line-height: 1.6; overflow-wrap: anywhere; }
.l-editor__area:empty::before { content: "Steps, what you expected, what happened. Paste screenshots here."; color: var(--tch-g50); }
.l-editor__area img { max-width: 200px; height: auto; vertical-align: middle; border: 1px solid var(--tch-g15); }
.l-editor__area ul, .l-editor__area ol { padding-left: 24px; }
.l-steps { margin: 0 0 24px; padding-left: 20px; font-size: calc(14px * var(--l-fs)); line-height: 1.6; }
.l-newtask .l-aside .l-field { margin-bottom: 16px; }
fieldset.l-field { border: 0; padding: 0; margin-left: 0; margin-right: 0; min-width: 0; }
.l-filters__group { display: inline-flex; align-items: center; gap: 6px; font-size: calc(13px * var(--l-fs)); }
@media (min-width: 900px) { .l-table[data-tasks] { table-layout: fixed; } }
.l-card__top .l-over__by { margin-left: 6px; }
.l-card__top .l-due { flex-direction: row; font-size: calc(12px * var(--l-fs)); }
.l-card__top .l-released { margin-left: 6px; }   /* #95 */
.l-aside .l-section-head { margin-top: 32px; }
.l-signin__left > .l-top__logo { align-self: flex-start; }   /* a stretched img centres its svg */
.l-msg__time::before { content: none; }   /* the clock glyph is missing from IBM Plex Mono; it rendered as a stray mark */
/* generic list + form glue (#4 item 5.8) */
.l-search--inline { width: 280px; height: 34px; }
.l-col-check { width: 36px; } .l-col-menu { width: 48px; text-align: right; }
.l-sort { color: inherit; text-decoration: none; } .l-sort:hover { color: var(--tch-ink); }
.l-table tbody tr[data-href] { cursor: pointer; } .l-table tbody tr.is-selected { background: var(--tch-g05); }
.l-formhead { display: flex; align-items: center; gap: 20px; padding-bottom: 20px; border-bottom: 2px solid var(--tch-charcoal); }
.l-formhead__hint { margin-left: auto; font-size: calc(12px * var(--l-fs)); display: inline-flex; align-items: center; gap: 6px; }
.l-formhead--send { flex-wrap: wrap; }
.l-formhead__send { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.l-formhead__hint + .l-formhead__send { margin-left: 0; }
.l-formhead__btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }   /* #93: the debtor's statement buttons */
.l-dialog__field { display: flex; flex-direction: column; gap: 6px; }
.l-dialog__error { color: var(--tch-red); font-size: calc(13px * var(--l-fs)); }
.l-avatar--lg { width: 56px; height: 56px; font-size: calc(18px * var(--l-fs)); background: var(--tch-g05); color: var(--tch-ink); }
.l-dirty-dot, .l-field.is-dirty > .l-label::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; background: var(--tch-red); }
.l-savebar__right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.l-form { padding-bottom: 8px; }
/* reports chart (#4 item 5.8d): stacked day bars, billable on top, dashed target line (T11) */
.l-chart { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 220px; margin: 24px 0 8px; padding-bottom: 22px; border-bottom: 1px solid var(--tch-charcoal); }
.l-chart__col { position: relative; flex: 1 1 0; display: flex; flex-direction: column-reverse; height: 100%; min-width: 0; }
.l-chart__bar { display: block; width: 100%; background: var(--tch-g30); transform-origin: bottom; animation: tch-growy 900ms var(--tch-ease-out) both; }
.l-chart__bar--bill { background: var(--tch-ink); }
.l-chart__col.is-weekend .l-chart__x { color: var(--tch-g30); }
.l-chart__x { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-family: var(--tch-font-mono); font-size: calc(10px * var(--l-fs)); color: var(--tch-g70); }
.l-chart__target { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--tch-red); pointer-events: none; z-index: 1; }
.l-chart__target span { position: absolute; right: 0; top: -18px; font-family: var(--tch-font-mono); font-size: calc(11px * var(--l-fs)); color: var(--tch-red); }
.l-sq--bill { background: var(--tch-ink); } .l-help .l-sq { display: inline-block; width: 8px; height: 8px; background: var(--tch-g30); vertical-align: middle; } .l-help .l-sq--bill { background: var(--tch-ink); }
.l-details summary { cursor: pointer; list-style: none; } .l-details summary::-webkit-details-marker { display: none; } .l-details summary::after { content: " +"; } .l-details[open] summary::after { content: " -"; }
.l-kpi .l-progress { margin-top: 10px; }
.l-table tfoot td { padding: 12px 8px; border-top: 1px solid var(--tch-charcoal); font-weight: 600; }
.l-table th.l-num, .l-table td.l-num { text-align: right; }
/* invoice line sub-grid (#4 5.8e.6) */
.l-nowrap { white-space: nowrap; }
.l-wrap { white-space: normal; min-width: 240px; }   /* long text in a table cell (quote lines) */
.l-lines tr.is-editing { background: var(--tch-g05); box-shadow: inset 3px 0 0 var(--tch-red); }
.l-lineform { margin: 8px 0 24px; }
.l-lineform output { display: inline-block; padding: 10px 0; }
/* attachments (#4 5.8e.8b): tile = open link + corner View / Save; icon tiles by file family; image viewer */
div.l-file:hover { border-color: var(--tch-g50); }
.l-file__main { display: flex; flex-direction: column; min-width: 0; color: inherit; text-decoration: none; }
.l-file__main:hover { color: inherit; text-decoration: none; }
.l-file__acts { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: .92; }
.l-file__acts .l-file__dl { position: static; }
.l-file__acts .l-file__dl:hover { border-color: var(--tch-ink); }
.l-file__type { flex-direction: column; gap: 4px; }
.l-file__type .l-ico--32 { width: 32px; height: 32px; }
.l-file__ext { font-size: calc(11px * var(--l-fs)); letter-spacing: .04em; }
.l-file__badge { position: absolute; left: 6px; bottom: 6px; padding: 1px 5px; background: var(--tch-ink); color: var(--tch-white); font-size: calc(10px * var(--l-fs)); }
.l-file__type { color: var(--tch-g70); }   /* file types in neutral grey: the functional colours are for status only (brand review, #4 5.7) */
.l-lightbox { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: rgba(15, 15, 15, .92); color: #FFFFFF; }   /* fixed dark backdrop: white text in both themes (--tch-white is dark in dark mode) */
.l-lightbox__bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; }
.l-lightbox__name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: calc(14px * var(--l-fs)); }
.l-lightbox__bar .l-btn { color: #FFFFFF; border-color: rgba(255, 255, 255, .4); background: transparent; }
.l-lightbox__stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px 16px 24px; }
.l-lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; background: var(--tch-white); }
/* Session replay player (/v2/replay.asp, #4 5.8f.3) */
.l-replay { margin-top: 24px; }
.l-replay__tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.l-replay__status { padding: 16px 0; color: var(--tch-g70); }
.l-replay__status .l-progress { margin-top: 8px; max-width: 420px; }
.l-replay__stage { border: 1px solid var(--tch-charcoal); background: var(--tch-g15); overflow: hidden; }
.l-replay__viewport { position: relative; width: 100%; min-height: 240px; overflow: hidden; }
.l-replay__viewport .replayer-wrapper { position: absolute; top: 0; left: 0; }
.l-replay__viewport iframe { border: 0; background: #fff; }
.l-replay__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0; }
.l-replay__timeline { flex: 1 1 200px; min-width: 0; accent-color: var(--tch-red); }
.l-replay [data-errors-body] tr { cursor: pointer; }
.l-replay [data-errors-body] tr:hover, .l-replay [data-errors-body] tr:focus { background: var(--tch-g15); outline: none; }

/* /v2/widget-code.asp: a project manager's one-time code (woodzgit/tasking#83) */
.l-wcode { margin: 8px 0 24px; }
.l-wcode__digits { margin-bottom: 4px; font-size: calc(48px * var(--l-fs)); line-height: 1.1; font-weight: 600; letter-spacing: .08em; }
.l-wcode .l-help { margin: 0 0 12px; }
.l-wcode__steps { max-width: 560px; margin: 0; padding-left: 20px; line-height: 1.7; }
.l-wcode__steps kbd { padding: 1px 5px; border: 1px solid var(--tch-g30); font: inherit; font-size: .9em; }

/* ==========================================================================
   #99  STAGE, WHOSE TURN, TAGS (tasks list, board, task page)
   The stage is the status in plain words. The turn says who must act now.
   Red is kept for two things: your own turn, and late work that is with the
   assignee. A task that is late while it waits for the requester is grey.
   ========================================================================== */
.l-row--pending  { --st: var(--tch-status-pending);  --st-tint: var(--tch-status-pending-tint); }
.l-row--progress { --st: var(--tch-status-progress); --st-tint: var(--tch-status-progress-tint); }
.l-row--hold     { --st: var(--tch-status-hold);     --st-tint: var(--tch-status-hold-tint); }
.l-row--actioned { --st: var(--tch-status-actioned); --st-tint: var(--tch-status-actioned-tint); }
.l-row--complete { --st: var(--tch-status-complete); --st-tint: var(--tch-status-complete-tint); }
.l-row--signoff  { --st: var(--tch-status-signoff);  --st-tint: var(--tch-status-signoff-tint); }
.l-row--release  { --st: var(--tch-status-release);  --st-tint: var(--tch-status-release-tint); }
/* a 4px bar in the stage colour at the left of the row (a shadow: the table's borders stay as they are) */
.l-table[data-tasks] tbody tr[class*="l-row--"] > td:first-child { box-shadow: inset 4px 0 0 var(--st, transparent); padding-left: 10px; }
.l-table[data-tasks] thead th:first-child { padding-left: 10px; }
.l-table[data-tasks] .l-col-dot { width: 26px; }
/* the unread mark is ink, not red (the row is also bold) */
.l-table[data-tasks] .l-dot, .l-card__top .l-dot { background: var(--tch-ink); }
/* stage chip: the status square + words on the status tint */
.l-status--stage { padding: 3px 9px; background: var(--st-tint, var(--tch-g05)); font-weight: 600; }
.l-table .l-col-status { width: 148px; }
.l-table .l-col-who    { width: 168px; }
.l-table .l-col-turn   { width: 148px; }
.l-table .l-col-due    { width: 112px; }
.l-table .l-col-time   { width: 100px; }

/* whose turn: an arrow + who, and the age under it */
.l-turn { display: inline-flex; flex-direction: column; gap: 2px; max-width: 100%; font-size: calc(13px * var(--l-fs)); line-height: 1.3; white-space: nowrap; }
.l-turn__who { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--tch-ink); }
.l-turn__who::before { content: ""; flex: none; width: 0; height: 0; border-left: 7px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.l-turn__age { font-family: var(--tch-font-mono); font-size: calc(11px * var(--l-fs)); color: var(--tch-g50); }
.l-turn--r .l-turn__who, .l-turn--p .l-turn__who { color: var(--tch-status-signoff); }
.l-turn--x .l-turn__who { color: var(--tch-status-hold); }
.l-turn.is-stale .l-turn__age { color: var(--tch-g70); font-weight: 600; }
.l-turn.is-mine { padding: 3px 8px; background: var(--tch-red-tint); }
.l-turn.is-mine .l-turn__who, .l-turn.is-mine .l-turn__age { color: var(--tch-red); }
.l-turn--line { flex-direction: row; align-items: baseline; gap: 8px; }

/* tags under the title */
.l-tags { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 5px; }
.l-tag { display: inline-block; padding: 1px 7px; border: 1px solid var(--tch-g15); font-family: var(--tch-font-mono); font-size: calc(11px * var(--l-fs)); line-height: 1.5; color: var(--tch-g70); white-space: nowrap; }
.l-tag--q     { border-color: var(--tch-status-hold);     color: var(--tch-status-hold); }
.l-tag--ok    { border-color: var(--tch-status-actioned); color: var(--tch-status-actioned); }
.l-tag--test  { border-color: var(--tch-status-signoff);  color: var(--tch-status-signoff); }
.l-tag--alert { border-color: var(--tch-red);             color: var(--tch-red); }

/* past the due date while it waits for the requester or a third party: not red */
.l-due--waits { display: inline-flex; flex-direction: column; gap: 2px; color: var(--tch-g70); }
.l-due__waits { font-family: var(--tch-font-mono); font-size: calc(11px * var(--l-fs)); color: var(--tch-g50); white-space: nowrap; }

/* a figure that is a link to its list */
a.l-kpi--link { display: block; color: inherit; text-decoration: none; }
a.l-kpi--link:hover .l-kpi__label, a.l-kpi--link:focus-visible .l-kpi__label { color: var(--tch-red); text-decoration: underline; }

/* board card: latest message, then turn + tags */
.l-card__latest { margin-top: 6px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: calc(12px * var(--l-fs)); line-height: 1.4; color: var(--tch-g50); }
.l-card__turn { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 8px; }
.l-card__turn .l-turn { flex-direction: row; align-items: baseline; gap: 6px; font-size: calc(12px * var(--l-fs)); }
.l-card__turn .l-tags { margin-top: 0; }

/* task page: the turn line and the step line under the status pill */
.l-turnline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 14px 0 16px; padding: 10px 14px; background: var(--tch-g05); border-left: 4px solid var(--tch-ink); font-size: calc(14px * var(--l-fs)); line-height: 1.5; }
.l-turnline.is-mine { border-left-color: var(--tch-red); background: var(--tch-red-tint); }
.l-turnline b { font-weight: 600; }
.l-turnline__go { margin-left: auto; font-weight: 600; color: var(--tch-red); white-space: nowrap; }
.l-rail { display: flex; margin: 0 0 20px; padding: 0; list-style: none; max-width: 760px; }
.l-rail li { flex: 1; position: relative; padding-top: 16px; padding-right: 8px; font-family: var(--tch-font-mono); font-size: calc(11px * var(--l-fs)); line-height: 1.3; color: var(--tch-g50); }
.l-rail li::before { content: ""; position: absolute; top: 3px; left: 0; right: 0; height: 2px; background: var(--tch-g15); }
.l-rail li::after { content: ""; position: absolute; top: 0; left: 0; width: 8px; height: 8px; background: var(--tch-g15); }
.l-rail li.is-done { color: var(--tch-ink); }
.l-rail li.is-done::before, .l-rail li.is-done::after { background: var(--tch-ink); }
.l-rail li.is-now { color: var(--tch-red); font-weight: 600; }
.l-rail li.is-now::after { top: -1px; width: 10px; height: 10px; background: var(--tch-red); }
.l-rail li:last-child::before { display: none; }

/* the update box: "I need an answer" and what On hold waits for */
.l-composer__ask { display: inline-flex; align-items: center; gap: 6px; font-size: calc(13px * var(--l-fs)); color: var(--tch-g70); cursor: pointer; }
.l-composer__ask input { accent-color: var(--tch-red); }
.l-composer__wait { display: inline-flex; align-items: center; gap: 6px; font-size: calc(13px * var(--l-fs)); color: var(--tch-g70); }
.l-composer__wait[hidden] { display: none; }

@media (max-width: 899px) {
  .l-table[data-tasks] tbody tr[class*="l-row--"] { padding-left: 12px; box-shadow: inset 4px 0 0 var(--st, transparent); }
  .l-table[data-tasks] tbody tr[class*="l-row--"] > td:first-child { box-shadow: none; }
  .l-table td.l-col-status { order: 1; }
  .l-table td.l-col-due { order: 1; margin-left: auto; }
  .l-table td.l-col-turn { order: 3; flex: 1 1 100%; }
  .l-table td.l-col-turn .l-turn { flex-direction: row; align-items: baseline; gap: 8px; }
  .l-table .l-tags { margin-top: 4px; }
  .l-status--stage { padding: 2px 7px; }
  .l-rail li { font-size: calc(10px * var(--l-fs)); }
  .l-turnline__go { margin-left: 0; }
}

/* Watch list on the task page (woodzgit/tasking#106) */
.l-watch { align-items: flex-start; }
.l-watch__list { display: flex; flex-wrap: wrap; gap: 4px 12px; flex: 1 1 100%; }
.l-watch__who { display: inline-flex; align-items: center; gap: 4px; font-size: calc(14px * var(--l-fs)); }
/* #124: sticky task bar on v2/task.asp - ref, title and status stay in view while scrolling.
   Fixed under the top bar (68px, 56px on phones); shown by task.js when the title scrolls away. */
.l-stick {
  position: fixed; top: 68px; left: 0; right: 0; z-index: 45;
  background: var(--tch-white); border-bottom: 1px solid var(--tch-g15);
  transform: translateY(-100%); opacity: 0; visibility: hidden;
  transition: transform 160ms ease, opacity 160ms ease, visibility 0s linear 160ms;
}
.l-stick.is-on { transform: none; opacity: 1; visibility: visible; transition: transform 160ms ease, opacity 160ms ease; }
.l-stick__in {
  display: flex; align-items: center; gap: 14px; width: 100%; height: 48px; padding: 0 40px;
  border: 0; background: none; color: var(--tch-ink); font: inherit; text-align: left; cursor: pointer;
}
.l-stick__ref { flex: none; }
.l-stick__title { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; font-size: calc(15px * var(--l-fs)); }
.l-stick__pill { flex: none; }
.l-stick__pill .l-pill { white-space: nowrap; }
@media (max-width: 899px) {
  .l-stick { top: 56px; }
  .l-stick__in { gap: 10px; height: 44px; padding: 0 16px; }
  .l-stick__title { font-size: calc(14px * var(--l-fs)); }
  .l-stick__pill .l-pill { padding: 3px 8px; font-size: calc(12px * var(--l-fs)); }
}
@media (prefers-reduced-motion: reduce) { .l-stick, .l-stick.is-on { transition: none; } }
@media print { .l-stick { display: none; } }

/* ---- #109 3h: a "File Attached" line of the task activity links to its file, with View / Save as on the tile ---- */
.l-event__txt { min-width: 0; overflow-wrap: anywhere; }
.l-event__file { color: var(--tch-ink); text-decoration: underline; text-underline-offset: 2px; }
.l-event__file:hover, .l-event__file:focus-visible { text-decoration-thickness: 2px; }
.l-event .l-file__dl { position: static; display: inline-flex; vertical-align: middle; width: 22px; height: 22px; margin-left: 6px; }
.l-event .l-file__dl:hover { border-color: var(--tch-ink); }
.l-event .l-file__dl .l-ico { width: 12px; height: 12px; color: var(--tch-ink); }
@media print { .l-event .l-file__dl { display: none; } }

/* #143: Remove on a file tile (staff only; v2/_inc/files.asp FileTileHtml) */
button.l-file__rm { cursor: pointer; padding: 0; font: inherit; }
.l-file__acts .l-file__rm:hover, .l-file__acts .l-file__rm:focus-visible { border-color: var(--tch-red); color: var(--tch-red); }
.l-file__rm[disabled] { opacity: .5; cursor: default; }
@media print { .l-file__rm { display: none; } }
