/* W8Hive design system. Tokens and component values follow the estate's WASM portals (W8Fuel.Ai, ported from the
   W8Sense design system); the accent stays W8Hive's honey from the approved mockups
   (docs/design/artifacts/w8hive-mockups.html). Shell classes per blackbee-portal-shell.
   Theme: a stored choice stamps data-theme on <html>; with none, the OS preference applies. */

:root {
  /* Accent: honey. Tints derive from --accent, so a custom accent (Appearance) carries them along. Honey is light,
     so text on a filled accent is near-black and accent-coloured text uses the darker --accent-ink. */
  --honey: #c98a00;
  --accent: var(--honey);
  --accent-soft: color-mix(in oklab, var(--accent) 14%, white);
  --accent-ink: color-mix(in oklab, var(--accent) 62%, black);
  --accent-text: #1b1404;
  --accent-bg: var(--accent-soft);

  /* Neutrals: cool */
  --bg: #F7F8FA; --surface: #FFFFFF; --surface-2: #FBFCFD; --soft: #F1F4F7;
  --line: #E5E9EE; --line-strong: #D4DAE2;
  --text: #0F1620; --text-2: #3A4654; --muted: #6A7585; --muted-2: #7B8492; /* was #9098A3: under 3:1 on white for the sidebar and group labels (2026-11-09) */

  /* Status */
  --ok: #16A34A; --ok-bg: #DCFCE7; --warn: #D97706; --warn-bg: #FEF3C7;
  --crit: #DC2626; --crit-bg: #FEE2E2; --info: #2563EB; --info-bg: #DBEAFE;

  /* W8Hive only: internal-note tint and the ticket-type series (Bug, Query, Feature) */
  --note: #fff8e6; --note-line: #efd48a;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;

  /* Radius and shadow scales */
  --r1: 6px; --r2: 10px; --r3: 14px; --r4: 20px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(15, 22, 32, .05), 0 1px 3px rgba(15, 22, 32, .04);
  --shadow-2: 0 4px 12px rgba(15, 22, 32, .06), 0 2px 4px rgba(15, 22, 32, .04);
  --shadow-3: 0 12px 32px rgba(15, 22, 32, .12);
  --shadow: var(--shadow-2);

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Density */
  --pad-card: 18px; --pad-screen: 28px; --gap-grid: 16px;
  --sidebar-w: 248px; --topbar-h: 60px; --bottom-nav-h: 60px;
  --tone-ink: 82%; --tone-mix: black;
  --focus-ring: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --honey: #f2b632;
    --accent-soft: color-mix(in oklab, var(--accent) 22%, #131922);
    --accent-ink: var(--accent);
    --tone-ink: 72%; --tone-mix: white;
    --bg: #0B0F14; --surface: #131922; --surface-2: #181F2A; --soft: #1B2330;
    --line: rgba(255, 255, 255, .12); --line-strong: rgba(255, 255, 255, .22);
    --text: #ECF1F7; --text-2: #BCC6D3; --muted: #8492A4; --muted-2: #5F6C7E;
    --ok-bg: color-mix(in oklab, var(--ok) 18%, #131922); --warn-bg: color-mix(in oklab, var(--warn) 18%, #131922);
    --crit-bg: color-mix(in oklab, var(--crit) 18%, #131922); --info-bg: color-mix(in oklab, var(--info) 18%, #131922);
    --note: #262012; --note-line: #5a4716;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 4px 12px rgba(0, 0, 0, .4); --shadow-3: 0 12px 32px rgba(0, 0, 0, .5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --honey: #f2b632;
  --accent-soft: color-mix(in oklab, var(--accent) 22%, #131922);
  --accent-ink: var(--accent);
  --tone-ink: 72%; --tone-mix: white;
  --bg: #0B0F14; --surface: #131922; --surface-2: #181F2A; --soft: #1B2330;
  --line: rgba(255, 255, 255, .12); --line-strong: rgba(255, 255, 255, .22);
  --text: #ECF1F7; --text-2: #BCC6D3; --muted: #8492A4; --muted-2: #5F6C7E;
  --ok-bg: color-mix(in oklab, var(--ok) 18%, #131922); --warn-bg: color-mix(in oklab, var(--warn) 18%, #131922);
  --crit-bg: color-mix(in oklab, var(--crit) 18%, #131922); --info-bg: color-mix(in oklab, var(--info) 18%, #131922);
  --note: #262012; --note-line: #5a4716;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 4px 12px rgba(0, 0, 0, .4); --shadow-3: 0 12px 32px rgba(0, 0, 0, .5);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 22px; letter-spacing: -.02em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
a { color: inherit; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* FocusOnNavigate (App.razor) focuses the page h1 after every navigation, filter toggles included, so screen readers
   hear the new page. Script-only focus targets (tabindex -1) can't be tabbed to, so they need no visible ring. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Scrollbars, app-wide: a slim rounded thumb on a clear track, in the theme's colours. Chromium and Safari take the
   ::-webkit-scrollbar rules (Chromium ignores them on any element that also sets scrollbar-color/-width, so the
   standard properties are given only where those pseudo-elements don't exist, i.e. Firefox). The transparent border
   insets the thumb so a 10px hit area draws as a 6px pill. */
:root { --scroll-thumb: color-mix(in oklab, var(--muted) 45%, transparent); --scroll-thumb-hover: color-mix(in oklab, var(--muted) 75%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border: 2px solid transparent; border-radius: var(--r-pill); background-clip: padding-box; min-height: 32px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
}

/* ---------- app shell ---------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100vh; height: 100dvh; }

.sidebar { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; z-index: 30; }
.sidebar-head { height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.sidebar-head .brand { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.sidebar-close { margin-left: auto; }
/* Phone-only controls; .icon-btn (declared later) sets display, so these need the extra class to stay hidden. */
.icon-btn.sidebar-close, .icon-btn.mobile-menu { display: none; }
.sidebar-nav { flex: 1; overflow: auto; padding: 12px 10px 16px; display: flex; flex-direction: column; gap: 10px; }
.sidebar-section { display: flex; flex-direction: column; gap: 2px; }
.sidebar-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); font-weight: 500; padding: 14px 12px 4px; display: flex; justify-content: space-between; gap: 8px; }
.sidebar-section:first-child .sidebar-label { padding-top: 4px; }
.sidebar-caption { text-transform: none; letter-spacing: 0; font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r2); color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none; }
.nav-item:hover { background: var(--soft); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); }
.sidebar-foot { border-top: 1px solid var(--line); padding: 14px; display: flex; align-items: center; gap: 10px; }
.user-chip { min-width: 0; flex: 1; }
.user-chip b, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip b { font-weight: 500; font-size: 13.5px; }
.user-chip small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); flex: none; text-decoration: none; }
.topbar .avatar { width: 30px; height: 30px; font-size: 12px; }

.app-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 12px; padding: 0 var(--pad-screen); background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.breadcrumb { display: flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb b { color: var(--text); font-weight: 600; }
.topbar .topbar-back, .sidebar .nav-item.drawer-only { display: none; } /* phones only (plan 002) */
.scope-bar { margin-right: auto; display: flex; gap: 8px; }
.scope-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-pill); padding: 5px 12px; font-size: 13px; white-space: nowrap; }
.scope-pill .scope-label { color: var(--muted); }
.scope-pill b { font-weight: 500; }
.scope-pill:disabled { cursor: default; opacity: 1; }
/* The Client filter is a native <select> inside the pill, so it stays keyboard- and screen-reader-friendly. */
.scope-select { position: relative; cursor: pointer; }
.scope-select:hover { background: var(--soft); }
.scope-select select { appearance: none; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 500; padding: 0 2px; height: auto; cursor: pointer; max-width: 22ch; text-overflow: ellipsis; }
.scope-select select:disabled { color: var(--muted); cursor: default; }
.scope-select:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
/* The pill carries the focus ring; the select's own would draw a second one inside it. */
.scope-select select:focus, .scope-select select:focus-visible { outline: none; box-shadow: none; }
/* A transparent select leaves Chromium's native list white under light dark-theme text; give options the theme surface. */
.scope-select select option { background: var(--surface); color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
/* Without the client filter (a client's header) nothing else pushes the actions to the right. */
.topbar:not(:has(.scope-bar)) .topbar-actions { margin-left: auto; }

.icon-btn { position: relative; width: 36px; height: 36px; border-radius: var(--r2); display: grid; place-items: center; border: 1px solid transparent; background: none; color: var(--text-2); text-decoration: none; }
.icon-btn:hover { background: var(--soft); color: var(--text); }

/* position: relative makes the scroller the containing block for absolute children (.sr-only); without it they sit
   against the document and stretch it past the viewport, adding a second scrollbar. */
.content { flex: 1; overflow: auto; padding: var(--pad-screen); min-height: 0; position: relative; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.page-head > div:first-child { flex: 1 1 320px; min-width: 0; } /* a long intro wraps itself, so the page's buttons stay top right */
.page-head > :not(:first-child) { flex: none; }

.bottom-nav { display: none; }
.scrim { display: none; }

/* ---------- controls ---------- */
/* .btn is the secondary button; .primary (and .accent) is filled accent, .ghost is bare, .danger is filled red. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); padding: 6px 12px; border-radius: var(--r2); font-weight: 500; font-size: 13px; white-space: nowrap; text-decoration: none; transition: background 120ms, border-color 120ms, color 120ms, transform 80ms; }
.btn:hover { background: var(--soft); }
.btn:active { transform: translateY(1px); }
.btn.primary, .btn.accent { background: var(--accent); color: var(--accent-text); border-color: var(--accent); box-shadow: 0 1px 0 color-mix(in oklab, var(--accent) 70%, black) inset; }
.btn.primary:hover, .btn.accent:hover { background: color-mix(in oklab, var(--accent) 88%, black); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn.danger:hover { background: color-mix(in oklab, var(--crit) 88%, black); }
/* Tinted buttons, named like the chips: a soft fill, coloured text and border, so secondary actions read as
   available and their kind shows at a glance (ok = move forward, info = edit or open, warn = changes course,
   crit = removes or cancels, acc = W8Hive action). The filled .primary stays the one main action. */
.btn.ok, .btn.info, .btn.warn, .btn.crit, .btn.acc { --tone: var(--muted); --tone-bg: var(--soft); background: var(--tone-bg); color: color-mix(in oklab, var(--tone) var(--tone-ink), var(--tone-mix)); border-color: color-mix(in oklab, var(--tone) 35%, transparent); }
.btn.ok { --tone: var(--ok); --tone-bg: var(--ok-bg); }
.btn.info { --tone: var(--info); --tone-bg: var(--info-bg); }
.btn.warn { --tone: var(--warn); --tone-bg: var(--warn-bg); }
.btn.crit { --tone: var(--crit); --tone-bg: var(--crit-bg); }
.btn.acc { --tone: var(--accent); --tone-bg: var(--accent-soft); }
.btn.ok:hover, .btn.info:hover, .btn.warn:hover, .btn.crit:hover, .btn.acc:hover { background: color-mix(in oklab, var(--tone) 18%, var(--tone-bg)); border-color: color-mix(in oklab, var(--tone) 55%, transparent); }
.btn.wide { width: 100%; padding: 9px 14px; font-size: 14px; }
.btn.small { padding: 3px 9px; font-size: 12px; border-radius: var(--r1); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
/* Segmented control: a soft track, the chosen option raised on the surface. */
.seg { display: inline-flex; background: var(--soft); border-radius: var(--r2); padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: var(--r-pill); background: var(--soft); color: var(--muted); white-space: nowrap; line-height: 1.4; }
.chip.ok { background: var(--ok-bg); color: color-mix(in oklab, var(--ok) var(--tone-ink), var(--tone-mix)); } /* toned text mixed as on .btn tones, so it reads on its tint in either theme */
.chip.warn { background: var(--warn-bg); color: color-mix(in oklab, var(--warn) var(--tone-ink), var(--tone-mix)); }
.chip.crit { background: var(--crit-bg); color: color-mix(in oklab, var(--crit) var(--tone-ink), var(--tone-mix)); }
h1 .cant-work-count { vertical-align: middle; margin-left: 8px; }
.chip.info { background: var(--info-bg); color: color-mix(in oklab, var(--info) var(--tone-ink), var(--tone-mix)); }
.chip.acc { background: var(--accent-soft); color: var(--accent-ink); }
.chip.bug { background: color-mix(in oklab, var(--s1) 14%, transparent); color: color-mix(in oklab, var(--s1) var(--tone-ink), var(--tone-mix)); }
.chip.query { background: color-mix(in oklab, var(--s2) 14%, transparent); color: color-mix(in oklab, var(--s2) var(--tone-ink), var(--tone-mix)); }
.chip.feature { background: color-mix(in oklab, var(--s3) 16%, transparent); color: color-mix(in oklab, var(--s3) var(--tone-ink), var(--tone-mix)); }
.chip.line { background: none; border: 1px solid var(--line-strong); color: var(--muted); }
/* UC-030 palette (plan P11): configured types and kinds name a PaletteColour; tinted like the type chips above. Series 1–3 are
   today's Bug, Query and Feature colours; Grey is today's plain task chip; the label colours tint at the same strength. */
:root { --pal-red: #b3261e; --pal-orange: #a14a00; --pal-yellow: #7a5c00; --pal-green: #1e7a34; --pal-teal: #00696b; --pal-blue: #1a57b5; --pal-purple: #6b3fa0; }
.chip.pal-series1 { background: color-mix(in oklab, var(--s1) 14%, transparent); color: color-mix(in oklab, var(--s1) var(--tone-ink), var(--tone-mix)); }
.chip.pal-series2 { background: color-mix(in oklab, var(--s2) 14%, transparent); color: color-mix(in oklab, var(--s2) var(--tone-ink), var(--tone-mix)); }
.chip.pal-series3 { background: color-mix(in oklab, var(--s3) 16%, transparent); color: color-mix(in oklab, var(--s3) var(--tone-ink), var(--tone-mix)); }
.chip.pal-grey { background: none; border: 1px solid var(--line-strong); color: var(--muted); }
.chip.pal-red { background: color-mix(in oklab, var(--pal-red) 16%, transparent); color: color-mix(in oklab, var(--pal-red) var(--tone-ink), var(--tone-mix)); }
.chip.pal-orange { background: color-mix(in oklab, var(--pal-orange) 16%, transparent); color: color-mix(in oklab, var(--pal-orange) var(--tone-ink), var(--tone-mix)); }
.chip.pal-yellow { background: color-mix(in oklab, var(--pal-yellow) 18%, transparent); color: color-mix(in oklab, var(--pal-yellow) var(--tone-ink), var(--tone-mix)); }
.chip.pal-green { background: color-mix(in oklab, var(--pal-green) 16%, transparent); color: color-mix(in oklab, var(--pal-green) var(--tone-ink), var(--tone-mix)); }
.chip.pal-teal { background: color-mix(in oklab, var(--pal-teal) 16%, transparent); color: color-mix(in oklab, var(--pal-teal) var(--tone-ink), var(--tone-mix)); }
.chip.pal-blue { background: color-mix(in oklab, var(--pal-blue) 16%, transparent); color: color-mix(in oklab, var(--pal-blue) var(--tone-ink), var(--tone-mix)); }
.chip.pal-purple { background: color-mix(in oklab, var(--pal-purple) 16%, transparent); color: color-mix(in oklab, var(--pal-purple) var(--tone-ink), var(--tone-mix)); }
.pal-series1 { --pal: var(--s1); } .pal-series2 { --pal: var(--s2); } .pal-series3 { --pal: var(--s3); } .pal-grey { --pal: var(--muted); }
.pal-red { --pal: var(--pal-red); } .pal-orange { --pal: var(--pal-orange); } .pal-yellow { --pal: var(--pal-yellow); } .pal-green { --pal: var(--pal-green); }
.pal-teal { --pal: var(--pal-teal); } .pal-blue { --pal: var(--pal-blue); } .pal-purple { --pal: var(--pal-purple); }
.dash-svg .bar-pal { fill: var(--pal); }
.dash-legend .sw-pal { background: var(--pal); }
.kind-pal { --kind: var(--pal); }

/* ---------- forms ---------- */
/* Every text-like input, select and textarea gets the bordered control look; inside a table it is compact. */
:where(input:not([type=checkbox], [type=radio], [type=color], [type=range], [type=file], [type=hidden]), select, textarea) {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: var(--r2);
  padding: 8px 12px; font-size: 14px; font-weight: 400; min-width: 0; transition: border-color 120ms, box-shadow 120ms;
}
:where(input:not([type=checkbox], [type=radio], [type=color], [type=range], [type=file], [type=hidden]), select, textarea):focus {
  outline: none; border-color: var(--accent); box-shadow: var(--focus-ring);
}
:where(input, select, textarea):disabled { background: var(--soft); color: var(--muted); cursor: not-allowed; }
:where(input:not([type=checkbox], [type=radio], [type=color], [type=range], [type=file], [type=hidden]), select) { height: 40px; }
:where(td, th) :where(input:not([type=checkbox], [type=radio]), select) { padding: 6px 10px; font-size: 13.5px; height: 34px; }
/* Bordered controls with the accent focus halo (border + 3px tint) rather than an outline. */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea,
.select, .cc-input, .search-row input[type="search"], .filters input[type=search], .wi-picker input {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: var(--r2);
  padding: 9px 12px; font-size: 14px; font-weight: 400; min-width: 0; transition: border-color 120ms, box-shadow 120ms;
}
.field input:not([type=checkbox]):not([type=radio]):focus, .field select:focus, .field textarea:focus,
.select:focus, .cc-input:focus, .search-row input[type="search"]:focus, .filters input[type=search]:focus, .wi-picker input:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--focus-ring);
}
.field input:not([type=checkbox]):not([type=radio]):is([readonly], :disabled), .field select:disabled, .field textarea:disabled { background: var(--soft); color: var(--muted); }
.field input[readonly]:focus { border-color: var(--line-strong); box-shadow: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.field-error, .validation-message { color: var(--crit); font-size: 12px; margin: 4px 0; }
.field-ok { color: var(--ok); font-size: 12px; }
.field-title { font-size: 13px; font-weight: 500; color: var(--text-2); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- ticket lists ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); }
/* Ticket search box above a list (UC-003) */
.search-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.search-row input[type="search"] { flex: 1 1 260px; max-width: 520px; }
.search-message { font-size: 12.5px; color: var(--muted); }
.search-filters { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
/* A list filter checkbox as a pill toggle (Unlinked only, Include resolved and closed); accent tint when on. */
.list-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; white-space: nowrap; }
.list-toggle:hover { background: var(--soft); color: var(--text); }
.list-toggle input { margin: 0; width: 15px; height: 15px; cursor: pointer; }
.list-toggle:has(input:checked) { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 45%, transparent); color: var(--accent-ink); }
.list-toggle:has(input:focus-visible) { border-color: var(--accent); box-shadow: var(--focus-ring); }
.list-toggle input:focus-visible { outline: none; }
/* Desk setup → Staff: the long Assignable and Sees chips wrap (corners, not a pill, once on two lines), so the row fits beside the
   section list at 1280px */
:is(td.staff-assignable, td.staff-sees) .chip { white-space: normal; border-radius: var(--r2); }
td.num a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
td.num a:hover { text-decoration-color: currentColor; }

/* Ticket page (UC-003), after the mockup's ticket view */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.t-head { display: flex; flex-direction: column; gap: 8px; }
.t-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0; overflow-wrap: anywhere; }
.t-head .back { align-self: flex-start; }
.t-meta { gap: 6px; flex-wrap: wrap; }
/* Ticket actions (UC-003 story 5 onwards): moving the ticket on at the left, housekeeping after a divider. */
.t-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.t-actions-flow, .t-actions-manage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.t-actions-flow:empty { display: none; }
/* UC-031 "Move to…": the desk's own statuses open under the button, one per destination, in the flow (keyboard: Tab and Enter). */
.t-move > summary { list-style: none; cursor: pointer; }
.t-move > summary::-webkit-details-marker { display: none; }
.t-move[open] { flex-basis: 100%; }
.t-move[open] > summary svg { transform: rotate(180deg); }
.t-move-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.t-actions-manage { padding-left: 16px; border-left: 1px solid var(--line-strong); }
.t-actions-flow:empty + .t-actions-manage { padding-left: 0; border-left: 0; }
.t-actions-manage .btn svg { color: var(--muted); }
.t-actions-manage .btn.crit svg { color: inherit; }
@media (max-width: 560px) { .t-actions-manage { padding-left: 0; border-left: 0; } }

/* Tooltip: data-tip on any element shows a dark bubble after a short hover, or at once on keyboard focus. w8hive.js draws the one
   bubble on the page's top layer and keeps it on screen, because a bubble drawn inside a table's scrolling .tbl-wrap gets cut off
   whatever its z-index. The same text goes in aria-description for screen readers. */
.w8hive-tip {
  position: fixed; inset: auto; margin: 0; border: 0; z-index: 1000; overflow: visible;
  width: max-content; max-width: min(300px, calc(100vw - 16px)); padding: 8px 10px; border-radius: var(--r2);
  background: var(--text); color: var(--surface); box-shadow: var(--shadow-3);
  font-size: 12.5px; font-weight: 400; line-height: 1.4; text-align: left; white-space: normal;
  pointer-events: none; animation: tip-in 120ms ease both;
}
@keyframes tip-in { from { opacity: 0; translate: 0 4px; } to { opacity: 1; translate: 0 0; } }
.t-section { padding: 16px 18px; }
.t-section h2, .side .card h2 { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
/* The ticket description: a fixed-height box that scrolls, so a long email doesn't push the conversation away. */
.t-desc-body { max-height: 16.5em; overflow-y: auto; padding-right: 6px; }
.t-desc-body:focus-visible { outline-offset: 4px; }
/* Foldable sections (Conversation, Activity): the summary row is the header and the toggle. */
.t-fold { padding: 0; }
.t-fold summary { display: flex; align-items: center; gap: 8px; padding: 14px 18px; cursor: pointer; list-style: none; border-radius: var(--r3); user-select: none; }
.t-fold summary::-webkit-details-marker { display: none; }
.t-fold summary:hover { background: var(--soft); }
.t-fold summary h2 { margin: 0; }
.t-fold summary svg { margin-left: auto; color: var(--muted); transition: transform .15s ease; }
.t-fold details:not([open]) summary svg { transform: rotate(-90deg); }
.t-fold details[open] summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.t-fold details > :not(summary) { margin-left: 18px; margin-right: 18px; }
.t-fold details > :last-child:not(summary) { margin-bottom: 16px; }
.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.side .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); padding: 14px 16px; }
.side .card.reason p { margin: 0; overflow-wrap: anywhere; }
/* The side cards sit in a Details fold (plan 002 D5): open with no summary on a wide screen, folded on a phone. */
.side-fold > summary { display: none; }
.side-fold > :not(summary) + :not(summary) { margin-top: 12px; }
.sort-phone { display: none; } /* the ticket lists' phone Sort by (plan 002 D6) */
.path { overflow-wrap: anywhere; }
.path i { font-style: normal; color: var(--muted); margin: 0 6px; }
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; margin: 8px 0 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
/* Conversation and composer (UC-004), after the mockup's thread */
.conversation { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.msg { border: 1px solid var(--line); border-radius: var(--r2); padding: 10px 12px; background: var(--surface); }
.msg.internal { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.msg-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.msg-h time { color: var(--muted); font-size: 12.5px; }
.msg-body { overflow-wrap: anywhere; line-height: 1.55; }
.msg-body p { margin: 0 0 6px; }
.msg-body ul, .msg-body ol { margin: 0 0 6px; padding-left: 22px; }
.composer { border: 1px solid var(--line-strong); border-radius: var(--r2); background: var(--surface); transition: border-color 120ms, box-shadow 120ms; }
.composer:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.composer.internal { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.composer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.composer-bar .seg { margin-right: 8px; }
.composer-bar .fmt { width: 30px; height: 30px; font-size: 14px; }
.composer textarea { display: block; width: 100%; min-height: 96px; border: 0; padding: 10px 12px; font: inherit; color: var(--text); background: transparent; resize: vertical; }
.composer textarea:focus { outline: none; box-shadow: none; }
.composer-preview { min-height: 96px; padding: 10px 12px; overflow-wrap: anywhere; }
.composer .field-error { padding: 0 12px; }
.composer-kind { margin: 0 0 8px; }
/* Reply to client (emailed: blue) and Internal note (staff only: honey, like the note tint). Each option carries a
   coloured dot; the chosen one takes its colour's tint. */
.composer-kind .kind-reply { --tone: var(--info); --tone-bg: var(--info-bg); }
.composer-kind .kind-note { --tone: var(--accent); --tone-bg: var(--accent-soft); }
.composer-kind button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; font-size: 13px; }
.composer-kind button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tone); opacity: .55; }
.composer-kind button[aria-selected="true"] { background: var(--tone-bg); color: color-mix(in oklab, var(--tone) var(--tone-ink), var(--tone-mix)); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--tone) 40%, transparent); }
.composer-kind button[aria-selected="true"]::before { opacity: 1; }
.recipients { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.cc-chip { gap: 4px; }
.chip-x { border: 0; background: none; padding: 0 2px; cursor: pointer; color: var(--muted); font-size: 14px; line-height: 1; }
.cc-input { min-width: 180px; padding: 5px 10px; font-size: 13px; height: 32px; }
.send-status { font-size: 12px; font-weight: 600; }
.send-status.ok { color: var(--ok); }
.send-status.warn { color: var(--warn); }
.send-status.crit { color: var(--crit); }
.push-device .pd-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.push-device .sub { margin: 8px 0 0; }
.reply-channels { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0 0 8px; padding: 0; border: 0; min-width: 0; font-size: 13px; }
.reply-channels legend { float: left; padding: 0; margin-right: 4px; color: var(--muted); }
.reply-channel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wait-on-client { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; }
.notify-client { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 13px; }
.resolution-categories { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.resolution-categories legend { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; width: 100%; }
.resolution-categories .radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.card.resolution .msg-body { margin: 6px 0; }
/* UC-006: a target's state chip beside its time, on the Targets card and in the Due column. */
/* Inner wrappers carry the flex layout: a flex <td> stops being a table cell and its row border drifts. */
.target-line, .due-line, .status-line { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* UC-006: Settings → Target policies and Holidays. */
.target-time { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.target-time input[type=number] { width: 5.5em; }
.policy-priority { display: inline-flex; align-items: center; gap: 8px; }
.policy-chip { font-weight: 600; }
.policy-default { font-size: 11.5px; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
.resolve-cell { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.no-resolve { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.targets-card th[scope=row] { text-transform: none; letter-spacing: 0; }
.holiday-years { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.holiday-year { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r2); padding: 14px; }
.holiday-year h3 { display: flex; align-items: baseline; gap: 8px; font-size: 15px; }
.holiday-year .hint { margin: 0; }
.holiday-list { list-style: none; margin: 0; padding: 0; align-self: stretch; max-height: 300px; overflow-y: auto; }
.holiday-list li { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.holiday-list li:last-child { border-bottom: 0; }
.holiday-list .num { min-width: 7.5em; color: var(--text-2); font-size: 13px; }
.holiday-list .holiday-name { flex: 1; font-size: 13.5px; }
.holiday-remove:hover { color: var(--crit); background: var(--crit-bg); }
/* Canned responses page: the client emails, then the canned responses, each a panel. The flex layout sits inside the
   actions cell (a flex <td> stops being a table cell and its row line drifts). */
.canned-section { margin-bottom: 16px; }
.canned-section .panel-title svg, .tr-section .panel-title svg { color: var(--muted); }
.panel > .canned-intro { margin: 0; padding: 12px 16px 2px; }
td.actions .row-actions { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.canned-table tr.retired td { color: var(--muted); }
.canned-table tr.retired .subj { color: var(--muted); font-weight: 500; }
.ph-list { display: flex; flex-wrap: wrap; gap: 4px; }
.chip.ph { font-family: var(--font-mono); font-size: 11.5px; font-weight: 400; padding: 2px 7px; }
.canned-help { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.dialog .composer textarea { min-height: 220px; }
.canned-btn { margin-left: auto; }
.canned-picker { border-bottom: 1px solid var(--line); padding: 6px 8px; max-height: 220px; overflow-y: auto; }
.canned-picker ul { list-style: none; margin: 0; padding: 0; }
.canned-option { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: var(--r2); padding: 6px 8px; font: inherit; color: var(--text); cursor: pointer; }
.canned-option:hover, .canned-option:focus-visible { background: var(--soft); }
.msg-cc { margin: -2px 0 6px; }
.composer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); }

/* Activity (UC-003 story 4): a timeline. Each entry has the actor's initials on a rail, tinted by what the save did
   (ActivityText.ActionTone), the who/what/when line, and any changed fields in a soft box: old value struck, new bold. */
.activity { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; }
.act { --tone: var(--info); --tone-bg: var(--info-bg); position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; }
.act.tone-ok { --tone: var(--ok); --tone-bg: var(--ok-bg); }
.act.tone-acc { --tone: var(--accent); --tone-bg: var(--accent-soft); }
.act.tone-warn { --tone: var(--warn); --tone-bg: var(--warn-bg); }
.act.tone-crit { --tone: var(--crit); --tone-bg: var(--crit-bg); }
.act::before { content: ""; position: absolute; left: 14px; top: 34px; bottom: 2px; width: 2px; border-radius: 1px; background: var(--line); }
.act:last-child { padding-bottom: 0; }
.act:last-child::before { display: none; }
.act-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; letter-spacing: .02em;
  background: var(--tone-bg); color: color-mix(in oklab, var(--tone) var(--tone-ink), var(--tone-mix)); box-shadow: 0 0 0 1px color-mix(in oklab, var(--tone) 35%, transparent); }
.act-body { min-width: 0; padding-top: 5px; }
.act-h { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.act-h b { font-weight: 600; }
.act-what { color: var(--text-2); }
.act-h time { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.act-changes { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 8px 0 0; padding: 10px 12px; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r2); }
.act-changes dt { color: var(--muted); font-weight: 500; }
.act-changes dd { margin: 0; overflow-wrap: anywhere; }
.act-old { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in oklab, var(--muted) 60%, transparent); }
.act-new { font-weight: 600; color: var(--text); }
.act-arrow { color: var(--muted-2); margin: 0 6px; }
/* Long text in an entry (a description) scrolls in a short box rather than filling the timeline. */
.act-changes .desc { max-height: 8.5em; overflow-y: auto; padding-right: 6px; }
.act-blocks { display: flex; flex-direction: column; gap: 8px; }
.act-block { border-left: 2px solid var(--line-strong); padding-left: 10px; }
.act-block-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
@media (max-width: 900px) { .detail { grid-template-columns: minmax(0, 1fr); } }
.subj { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
a.subj { text-decoration: none; }
a.subj:hover { text-decoration: underline; text-underline-offset: 3px; }
/* A panel's own heading row (e.g. a contact's tickets), ruled off from the table below it. */
.panel-title { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 16px; font-size: 15px; border-bottom: 1px solid var(--line); }
/* Contact page (UC-008 story 3) */
.contact-back { margin: 0 0 12px -8px; }
.contact-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.contact-title h1 { overflow-wrap: anywhere; }
.contact-avatar { width: 52px; height: 52px; font-size: 18px; }
/* Work item page (UC-009 story 6): laid out like the ticket page. */
.w-back { margin: 0 0 12px -8px; }
.w-head-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.w-head h1 { overflow-wrap: anywhere; }
.w-head .w-number { color: var(--muted); font-size: .8em; font-weight: 500; margin-right: 4px; }
.w-actions { gap: 8px; }
.w-layout { margin-top: 4px; }
.w-due-edit { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.w-due-edit input { height: 34px; width: 140px; padding: 5px 8px; font-size: 13.5px; }
.contact-details { margin-bottom: 16px; }
.contact-form { padding: 16px 16px 4px; }
.contact-form .field .hint { margin: 0; font-size: 12px; }
.contact-form .notice { margin: 0 0 12px; }
.contact-form-foot { display: flex; align-items: center; gap: 8px; padding: 2px 0 14px; }
.contact-kv { padding: 14px 16px; }
.sub { color: var(--muted); font-size: 12.5px; }
.reporter-email { overflow-wrap: anywhere; } /* a very long address wraps instead of widening the table */
.reporter-line { font-weight: 400; margin-top: 2px; }
td[data-col="reporter"] { min-width: 180px; }
th .sort { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
th .sort:hover, th[aria-sort] .sort { color: var(--text); }
th .sort .arrow { font-size: 10px; }
.tbl-foot, .pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
/* The search form at the top of a list panel (Contacts, Archived): padded, ruled off from the table like .search-row. */
.list-search { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.list-search input[type="search"] { flex: 1 1 260px; max-width: 520px; }
/* Messages and empty states that sit straight in a panel get the panel's inset. */
.panel > .hint, .panel > .notice { margin: 14px; }

/* ---------- dialogs ---------- */
.dialog { border: 1px solid var(--line); border-radius: var(--r4); padding: 0; width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-3); }
.dialog-narrow { width: min(480px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dialog-body { display: flex; flex-direction: column; padding: 22px 24px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dialog-head h2 { font-size: 18px; font-weight: 600; margin: 0; }
.dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; position: sticky; bottom: 0; padding-top: 16px; background: var(--surface); }
.dialog .form-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.notice { border-radius: var(--r2); padding: 10px 14px; margin: 0 0 12px; font-size: 13px; border: 1px solid transparent; }
.notice.ok { background: var(--ok-bg); color: color-mix(in oklab, var(--ok) var(--tone-ink), var(--tone-mix)); border-color: color-mix(in oklab, var(--ok) 30%, transparent); }
.notice.crit { background: var(--crit-bg); color: color-mix(in oklab, var(--crit) var(--tone-ink), var(--tone-mix)); border-color: color-mix(in oklab, var(--crit) 30%, transparent); }
.notice.info { background: var(--info-bg); color: color-mix(in oklab, var(--info) var(--tone-ink), var(--tone-mix)); border-color: color-mix(in oklab, var(--info) 30%, transparent); }
@media (max-width: 560px) {
  .dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .dialog-body { padding-inline: 16px; }
}

/* ---------- triage tabs and urgent rows ---------- */
tr.urgent td { background: color-mix(in srgb, var(--crit-bg) 55%, transparent); }
tr.urgent td:first-child { box-shadow: inset 3px 0 0 var(--crit); }

/* ---------- triage dialog ---------- */
.triage-summary { border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface-2); padding: 10px 12px; margin-bottom: 12px; }
.triage-summary p { margin: 0 0 6px; }
.triage-summary p:last-child { margin-bottom: 0; }
.triage-description { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9em; overflow-y: auto; color: var(--muted); }
.notice.warn { background: var(--warn-bg); color: color-mix(in oklab, var(--warn) var(--tone-ink), var(--tone-mix)); border-color: color-mix(in oklab, var(--warn) 30%, transparent); }
.choice-group { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.choice-group legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 4px; }
.choice { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 5px 12px; background: var(--surface); cursor: pointer; font-weight: 500; font-size: 13.5px; }
.choice:hover { background: var(--soft); }
.choice:has(input:checked) { border-color: color-mix(in oklab, var(--accent) 55%, transparent); background: var(--accent-soft); color: var(--accent-ink); }
.choice:has(input:focus-visible) { border-color: var(--accent); box-shadow: var(--focus-ring); }

.send-back { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.send-back > .btn { align-self: flex-start; }

/* ---------- reporter picker ---------- */
.reporter-picker .seg { align-self: flex-start; margin-bottom: 4px; }
.reporter-chosen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: var(--r2); padding: 9px 12px; background: var(--surface-2); }
.reporter-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.reporter-add { border: 1px solid var(--line); border-radius: var(--r2); padding: 14px; background: var(--surface-2); }
.reporter-actions { margin-top: 4px; }
.picker-results { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r2); box-shadow: var(--shadow-2); overflow: hidden; max-height: 260px; overflow-y: auto; background: var(--surface); }
.picker-results li + li { border-top: 1px solid var(--line); }
.picker-results button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; border: 0; background: none; padding: 8px 10px; text-align: left; overflow-wrap: anywhere; }
.picker-results button:hover, .picker-results button:focus-visible { background: var(--soft); }

/* ---------- tables, panels ---------- */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 500; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover > * { background: var(--surface-2); }
tbody tr:last-child > * { border-bottom: 0; }
td.actions { text-align: right; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { font-weight: 600; }
dl.kv dd { margin: 0; color: var(--muted); }

/* ---------- empty states ---------- */
.empty-state { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r3); padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-state h2 { font-size: 18px; }
.empty-state p { margin: 0; max-width: 56ch; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 4px; }
.empty { padding: 48px 24px; text-align: center; }
.empty h1 { font-size: 22px; margin-bottom: 6px; }
.empty p { color: var(--muted); }
.loading-wrap { display: grid; place-items: center; padding: 32px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--soft); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- settings + help ---------- */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 16px; }
.settings-group { display: flex; flex-direction: column; gap: 2px; }
.group-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); font-weight: 500; padding: 0 12px 4px; }
.settings-tab { display: flex; align-items: center; text-decoration: none; gap: 10px; padding: 10px 12px; border: 0; border-radius: var(--r2); background: none; color: var(--text-2); font-size: 14px; font-weight: 500; text-align: left; white-space: nowrap; }
.settings-tab:hover { background: var(--soft); color: var(--text); }
.settings-tab.active { background: var(--accent-soft); color: var(--accent-ink); }
.settings-picker { display: none; }
.settings-picker select { width: 100%; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); font-size: 14px; }
.settings-section { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.settings-content { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.settings-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); padding: var(--pad-card); }
.settings-card h2 { font-size: 15px; margin-bottom: 4px; }
.settings-card > p { margin: 0 0 14px; }
.settings-card h3 { font-size: 13.5px; font-weight: 600; margin: 0; }
.pane-head h2 { font-size: 18px; }
.pane-head p { margin: 4px 0 0; font-size: 13px; }
/* Tabs (W8Fuel's .tab-row): an accent underline on the chosen one. */
.tab-row { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--muted); white-space: nowrap; border-radius: var(--r1) var(--r1) 0 0; }
.tab:hover:not(.active) { color: var(--text-2); background: var(--soft); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab:focus-visible { outline-offset: -2px; }
.tab-panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* An add form under a list: labelled fields side by side, the button on their baseline, set off by a rule. */
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.inline-form-title { flex-basis: 100%; }
.inline-form .field { margin: 0; min-width: 160px; }
.inline-form .field.grow { flex: 1 1 220px; }
.inline-form .btn { padding-block: 8px; }
td.actions .btn + .btn { margin-left: 6px; }
.inline-form + .notice, .inline-form + .field-error { margin-top: 12px; }
.placeholder-list { margin: 0 0 12px; padding-left: 18px; color: var(--muted); }
.placeholder-list li { margin-bottom: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 26px; height: 26px; padding: 0; border-radius: 7px; background: var(--swatch); border: 1px solid color-mix(in oklab, var(--text) 14%, transparent); }
.swatch.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.help { display: flex; flex-direction: column; gap: 16px; max-width: 820px; }
.help ol { margin: 0 0 10px; padding-left: 20px; }
.help li { margin-bottom: 6px; }

/* ---------- auth ---------- */
.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.auth-shell { background: var(--bg); }
.auth-brand { background: var(--surface); border-right: 1px solid var(--line); padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.auth-brand-mark { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.auth-brand h2 { font-size: 28px; line-height: 1.2; letter-spacing: -.02em; max-width: 18ch; }
.auth-brand p { margin: 0; color: var(--muted); max-width: 44ch; }
.auth-main { display: grid; place-items: center; grid-template-columns: minmax(0, 1fr); padding: 32px 20px; } /* the column fits the screen, so the card can't push it wider at 360px */
/* The brand panel stays dark in both themes (the estate's panel, in BlackBee's amber on ink), so its text is always white. */
.auth-shell .auth-brand {
  position: relative; overflow: hidden; border-right: 0; color: #fff; padding: 40px; justify-content: space-between; gap: 32px;
  background: linear-gradient(155deg, color-mix(in oklab, var(--accent) 34%, #0a0f1a) 0%, #0a0f1a 100%);
}
.auth-shell .auth-brand::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle at 80% 20%, rgba(255,255,255,.12), transparent 45%), radial-gradient(circle at 10% 90%, rgba(0,0,0,.18), transparent 50%);
}
.auth-shell .auth-brand::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 48px 48px; background-position: -1px -1px;
  mask-image: linear-gradient(180deg, transparent, black 30%, black 70%, transparent);
}
.auth-shell .auth-brand > * { position: relative; z-index: 1; }
.auth-brand-copy h2 { font-size: 38px; line-height: 1.1; font-weight: 600; max-width: 460px; letter-spacing: -.02em; }
.auth-brand-copy p { margin: 16px 0 0; max-width: 460px; font-size: 15px; line-height: 1.55; color: #fff; opacity: .85; }
.auth-brand-meta { font-size: 13px; opacity: .9; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r4);
  padding: 36px; box-shadow: var(--shadow-2);
}
.auth-card-mark { display: none; align-items: center; gap: 10px; margin-bottom: 20px; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.auth-head { margin-bottom: 24px; }
.auth-head h1 { font-size: 24px; margin-bottom: 6px; }
.auth-head p { margin: 0; color: var(--muted); font-size: 14px; }
.auth-error, .auth-sent { margin: 0 0 14px; }
.auth-submit { padding-top: 11px; padding-bottom: 11px; font-size: 15px; }
.auth-foot { margin: 16px 0 0; text-align: center; font-size: 14px; }
.auth-foot a { color: var(--accent-ink); text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }
/* An input with an icon inside its border, and the password's show or hide button. */
.field-input {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r2); padding: 10px 12px; color: var(--muted); transition: border-color 120ms, box-shadow 120ms;
}
.field-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent); }
.field .field-input input:not([type=checkbox]):not([type=radio]),
.field .field-input input:not([type=checkbox]):not([type=radio]):focus {
  flex: 1; min-width: 0; width: auto; border: 0; border-radius: 0; outline: 0; box-shadow: none; padding: 0; background: transparent; color: var(--text); font-size: 14.5px;
}
.field-input input:-webkit-autofill, .field-input input:-webkit-autofill:hover, .field-input input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important; -webkit-box-shadow: 0 0 0 1000px var(--surface) inset !important; caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}
.field-eye {
  flex: none; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; color: var(--muted);
  cursor: pointer; border-radius: var(--r1); padding: 8px; margin: -8px -6px -8px 0;
}
.field-eye:hover { color: var(--text); }
.field-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Blazor host bits ---------- */
#blazor-error-ui { background: var(--crit-bg); color: var(--crit); bottom: 0; box-shadow: var(--shadow); display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.loading-progress { position: absolute; display: block; width: 6rem; height: 6rem; inset: 30vh 0 auto 0; margin: 0 auto; }
.loading-progress circle { fill: none; stroke: var(--line); stroke-width: .5rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: var(--accent); stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%; transition: stroke-dasharray .05s ease-in-out; }
.loading-progress-text { position: absolute; text-align: center; font-weight: 600; inset: calc(30vh + 3.25rem) 0 auto .2rem; color: var(--muted); }
.loading-progress-text::after { content: var(--blazor-load-percentage-text, "Loading"); }

/* ---------- responsive ---------- */
@media (max-width: 768px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(var(--sidebar-w), 86vw); transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .icon-btn.sidebar-close, .icon-btn.mobile-menu { display: grid; }
  .topbar { padding: 0 12px; gap: 8px; }
  .content { padding: 16px 16px calc(var(--bottom-nav-h) + 20px); }
  .bottom-nav { display: flex; position: fixed; inset: auto 0 0 0; height: var(--bottom-nav-h); background: var(--surface); border-top: 1px solid var(--line); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
  .bnav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; }
  .bnav-item.active { color: var(--accent-ink); }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(10,11,14,.45); z-index: 25; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { display: none; }
  .settings-picker { display: block; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-shell .auth-brand { display: none; }
  .auth-card { box-shadow: none; border: 0; padding: 24px; max-width: 460px; }
  .auth-card-mark { display: flex; }
}

@media (max-width: 720px) {
  .scope-pill .scope-label { display: none; }
}

@media (max-width: 480px) {
  .breadcrumb a { display: none; }
  .breadcrumb svg { display: none; }
}

/* Boards list (UC-009 story 1): a tile per board, the whole tile a link. Internal first, products after; a product
   no longer active is dimmed. */
.board-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.board-tile { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "badge text go" "count count count"; gap: 14px 12px; align-items: center;
  height: 100%; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); color: var(--text); text-decoration: none;
  transition: border-color 120ms, box-shadow 120ms, transform 120ms; }
.board-tile:hover { border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.board-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.board-badge { grid-area: badge; width: 44px; height: 44px; border-radius: var(--r2); display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: .02em;
  background: var(--accent-soft); color: var(--accent-ink); }
/* A product mark (an SVG tile asset) is its own badge: no tint behind it. */
.board-badge.has-mark { background: none; border-radius: 11px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.board-badge.has-mark img { display: block; }
.board-tile.inactive .board-badge.has-mark { filter: grayscale(1); opacity: .55; }
.board-tile.internal .board-badge { background: var(--info-bg); color: color-mix(in oklab, var(--info) var(--tone-ink), var(--tone-mix)); }
.board-text { grid-area: text; display: flex; flex-direction: column; min-width: 0; }
.board-name { font-weight: 600; font-size: 15.5px; overflow-wrap: anywhere; }
.board-go { grid-area: go; color: var(--muted-2); transition: transform 120ms, color 120ms; }
.board-tile:hover .board-go { color: var(--accent-ink); transform: translateX(2px); }
.board-count { grid-area: count; display: flex; align-items: baseline; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.board-count b { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.board-inactive { position: absolute; top: 12px; right: 12px; }
.board-tile.inactive { background: var(--surface-2); }
.board-tile.inactive .board-badge { background: var(--soft); color: var(--muted); }
.board-tile.inactive .board-name, .board-tile.inactive .board-count b { color: var(--muted); }
.board-tile.inactive .board-go { display: none; }

/* boards (UC-009; mockup: .board, .col, .wi) */
/* A board's header: its product mark beside the name; switcher and actions on the right. */
.board-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.board-mark { flex: none; width: 44px; height: 44px; border-radius: 11px; display: block; box-shadow: 0 0 0 1px var(--line); }
.board-actions { gap: 8px; align-items: center; }
.board-actions select { min-width: 180px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filters input[type=search] { min-width: 220px; }
.select { padding: 6px 10px; font-size: 13px; height: 34px; }
/* The board: columns share the width (scrolling sideways only when there are many) and stretch to one tall height,
   so every column is a big drop target. */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px;
  align-items: stretch; min-height: max(420px, calc(100dvh - var(--topbar-h) - 300px)); }
.col { background: var(--soft); border: 1px solid transparent; border-radius: var(--r3); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; transition: border-color 120ms, background 120ms; }
.col.drop-target { border-color: color-mix(in oklab, var(--accent) 45%, transparent); background: color-mix(in oklab, var(--accent) 6%, var(--soft)); }
.col-h { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 2px 4px 4px; }
.col-h h2 { font-size: 13.5px; font-weight: 600; margin: 0; }
.col-h .col-total { background: var(--surface); color: var(--text-2); }
.col-h .col-maps { flex-basis: 100%; }
.wi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow-1); padding: 10px 11px; display: flex; flex-direction: column; gap: 8px; cursor: grab; transition: border-color 120ms, box-shadow 120ms, transform 120ms; }
.wi:hover { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.wi:active { cursor: grabbing; }
.wi.dragging { opacity: .5; }
.wi-top { display: flex; gap: 6px; align-items: center; }
.wi-top .mono { color: var(--muted); font-size: 11.5px; text-decoration: none; }
.wi-title { font-weight: 600; line-height: 1.35; color: var(--text); text-decoration: none; }
.wi-title:hover { text-decoration: underline; }
.wi-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
/* Move: an icon button in the card's top corner, quiet until the card is hovered or it has focus. */
.wi-top .move { margin-left: auto; padding: 3px 5px; color: var(--muted); opacity: .55; }
.wi:hover .wi-top .move, .wi-top .move:focus-visible, .wi-top .move[aria-expanded="true"] { opacity: 1; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
/* The keyboard Move menu, stacked to fit a narrow card: label, column picker, then Top / Bottom / Cancel. */
.move-menu { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; cursor: default; }
.move-menu label { flex-basis: 100%; font-size: 12px; font-weight: 500; color: var(--text-2); }
.move-menu select { flex: 1 1 100%; height: 34px; padding: 5px 10px; font-size: 13px; }
.col .show-more { align-self: flex-start; }
/* Add: a full-width dashed button at the foot of the cards. */
.col .add-item { width: 100%; justify-content: flex-start; padding: 7px 10px; border: 1px dashed var(--line-strong); color: var(--muted); }
.col .add-item:hover { border-color: color-mix(in oklab, var(--accent) 55%, transparent); color: var(--accent-ink); background: var(--surface); }
/* Columns dialog: a row per column (name, Rename, move left/right, what it does to tickets, Remove). */
.mc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mc-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mc-row:last-child { border-bottom: 0; }
.mc-row > input { flex: 1 1 160px; height: 34px; padding: 5px 10px; font-size: 13.5px; }
.mc-row > select.mc-map { flex: 1 1 220px; height: 34px; padding: 5px 10px; font-size: 13px; }
.mc-remove-confirm { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex-basis: 100%; margin-top: 6px; padding: 10px 12px; border-radius: var(--r2);
  background: var(--crit-bg); border: 1px solid color-mix(in oklab, var(--crit) 30%, transparent); }
.mc-remove-confirm label { flex-basis: 100%; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.mc-remove-confirm select { flex: 1 1 auto; min-width: 180px; height: 34px; padding: 5px 10px; font-size: 13px; }
/* Assignees and labels in the work item dialogs: wrapping tick-pills, the ticked ones honey (like the triage choices). */
.label-picker, .ew-assignees, .nw-assignees { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.label-picker legend, .ew-assignees legend, .nw-assignees legend { font-size: 13px; font-weight: 500; color: var(--text-2); padding: 0; margin-bottom: 6px; }
.label-picker > .sub { margin: 0; }
.check-row { display: inline-flex; gap: 7px; align-items: center; font-weight: 400; font-size: 13.5px; padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--surface); cursor: pointer; transition: background 120ms, border-color 120ms; }
.check-row:hover { background: var(--soft); }
.check-row:has(input:checked) { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 55%, transparent); }
.check-row:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.check-row input { margin: 0; }
.link-contact { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; font-size: 13.5px; color: var(--text-2); }
.link-contact input { margin-top: 3px; }

/* UC-010: work items on a ticket, tickets on a work item, merge, mapped columns */
.wi-links, .wt-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.wi-links li, .wt-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.wi-link-actions { gap: 6px; margin-top: 4px; }
.wi-picker { margin-top: 8px; display: grid; gap: 6px; }
.wi-picker input { width: 100%; }
.wi-picker [role=listbox] { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: var(--r2); }
.wi-picker [role=listbox]:empty { display: none; }
.wp-opt { padding: 6px 8px; cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.wp-opt.active, .wp-opt:hover { background: var(--soft); }
/* A work item's client tickets: one row each, then the link form. */
.w-tickets .wt-list, .w-links-panel .wt-list { gap: 0; margin: 0; }
.w-tickets .wt-list li, .w-links-panel .wt-list li { align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.w-tickets .wt-list li:last-child, .w-links-panel .wt-list li:last-child { border-bottom: 0; }
.w-tickets .wt-list .subj, .w-links-panel .wt-list .subj { flex: 1 1 200px; min-width: 0; }
.w-tickets .wt-list .unlink, .w-links-panel .wt-list .unlink { margin-left: auto; }
.w-links-panel .wl-intro { margin: 0 0 8px; }
.w-links-panel .wl-h { font-size: 13px; margin: 14px 0 4px; color: var(--muted); font-weight: 600; }
.epic-take-out-links .row { gap: 8px; margin-top: 8px; }
.wt-link { gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.wt-link input { flex: 0 1 180px; }
.merged-banner, .resolved-email { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.col-maps { font-size: 12px; white-space: nowrap; }
.wi-tickets { font-size: 12px; margin-left: auto; }
.mc-map { max-width: 100%; }

/* UC-011: My work, labels, checklists */
.mw-tabs { display: flex; gap: 12px; margin-bottom: 8px; }
.mw-tabs { border-bottom: 1px solid var(--line); gap: 4px; }
.mw-tabs a { padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.mw-tabs a:hover { color: var(--text-2); }
.mw-tabs a[aria-current=page] { color: var(--text); border-bottom-color: var(--accent); }
/* My work groups: a coloured dot per group (Overdue red, Today honey, Next 7 days blue, later ones grey). An empty
   group shrinks to one line so the full ones stand out. */
.mw-group { --tone: var(--muted-2); margin-bottom: 12px; }
.mw-overdue { --tone: var(--crit); }
.mw-today { --tone: var(--accent); }
.mw-next7 { --tone: var(--info); }
.mw-overdue:not(.empty) { border-color: color-mix(in oklab, var(--crit) 35%, var(--line)); }
.mw-group h2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 15px; padding: 14px 16px 10px; }
.mw-group h2::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--tone); flex: none; }
.mw-group > .mw-empty { margin: 0; padding: 0 16px 14px; }
/* A group with rows folds: the header row is the toggle, the chevron turns when folded. */
.mw-fold summary { display: flex; align-items: center; gap: 8px; padding-right: 16px; cursor: pointer; list-style: none; border-radius: var(--r3); user-select: none; }
.mw-fold summary::-webkit-details-marker { display: none; }
.mw-fold summary:hover { background: var(--surface-2); }
.mw-fold summary h2 { flex: 1; padding-bottom: 14px; }
.mw-fold summary svg { color: var(--muted); transition: transform .15s ease; flex: none; }
.mw-fold:not([open]) summary svg { transform: rotate(-90deg); }
.mw-fold[open] summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.mw-group.empty { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 10px 16px; margin-bottom: 8px; background: var(--surface-2); }
.mw-group.empty h2 { padding: 0; font-size: 14px; color: var(--text-2); }
.mw-group.empty > .mw-empty { padding: 0; font-size: 12.5px; }
.mw-group.empty .mw-rows { display: none; }
/* My work filter bar: search, then the label filter, in one strip. */
.mw-filters, .filter-bar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); padding: 12px 14px; margin-bottom: 16px; gap: 10px; }
.mw-filters input[type=search], .filter-bar input[type=search] { flex: 1 1 260px; max-width: 420px; }
/* A filter's label and its dropdown stay together when the bar wraps. */
.filter-field { display: inline-flex; align-items: center; gap: 8px; }
.mw-filter-label, .filter-label { font-size: 13px; font-weight: 500; color: var(--text-2); margin-left: 6px; }
.mw-actions { gap: 10px; }
.mw-actions select { min-width: 160px; }
.mw-group > .show-more { margin: 4px 16px 14px; }
.mw-rows { list-style: none; margin: 0; padding: 0; }
/* Fixed columns: tick, number, title, labels, kind, date, so every row lines up. */
.mw-row { display: grid; grid-template-columns: 20px 64px minmax(0, 1fr) minmax(0, max-content) 92px 170px; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
.mw-labels { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.mw-kind { display: flex; justify-content: flex-start; }
.mw-row .mw-date { text-align: right; }
@media (max-width: 720px) {
  .mw-row { grid-template-columns: 20px minmax(0, 1fr) auto; grid-template-areas: "tick num date" "tick text text" "tick labels labels"; row-gap: 4px; }
  .mw-row > :first-child { grid-area: tick; align-self: start; margin-top: 2px; }
  .mw-row > .mono { grid-area: num; }
  .mw-row > .mw-text { grid-area: text; }
  .mw-row > .mw-labels { grid-area: labels; justify-content: flex-start; }
  .mw-row > .mw-kind { display: none; }
  .mw-row > .mw-date { grid-area: date; }
}
.mw-row:hover { background: var(--surface-2); }
.mw-row:last-child { border-bottom-left-radius: var(--r3); border-bottom-right-radius: var(--r3); }
/* Mark done: a round tick target (an empty circle); on hover or focus it fills green with a check. */
.mw-tick { flex: none; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); color: transparent; display: grid; place-items: center; transition: border-color 120ms, background 120ms, color 120ms; }
.mw-tick:hover, .mw-tick:focus-visible { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.mw-tick:active { background: var(--ok); color: #fff; }
.mw-tick:disabled { opacity: .5; cursor: not-allowed; }
.mw-tick-space { flex: none; width: 20px; }
.mw-date { font-size: 13px; white-space: nowrap; }
.mw-date.crit { color: var(--crit); font-weight: 500; }
.mw-text { flex: 1 1 220px; min-width: 0; }
/* Plan 010: My work items. Quick filters with counts, the filter strip with Group by, then a group per date, board or status with rows in fixed columns. */
.mwi-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.mwi-title h1 { margin: 0; }
.mwi-total { padding: 2px 10px; border-radius: var(--r-pill); background: var(--soft); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.mwi-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mwi-qf { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 6px 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface);
    color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.mwi-qf:hover { border-color: var(--line-strong); }
.mwi-qf:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.mwi-qf-count { min-width: 24px; height: 24px; padding: 0 7px; box-sizing: border-box; border-radius: var(--r-pill); background: var(--soft); color: var(--text-2); font-size: 12px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.mwi-qf.crit .mwi-qf-count { background: var(--crit-bg); color: color-mix(in oklab, var(--crit) var(--tone-ink), var(--tone-mix)); }
.mwi-qf[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }
.mwi-qf[aria-pressed="true"] .mwi-qf-count { background: var(--accent); color: var(--accent-text); }
.mwi-filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); padding: 12px 14px; margin-bottom: 16px; gap: 10px; }
.mwi-filters input[type=search] { flex: 1 1 260px; max-width: 420px; }
.mwi-group-by { margin-left: auto; align-items: center; }
.mwi-group-label { font-size: 12.5px; color: var(--muted); padding: 0 6px 0 8px; }
.mwi-group-by button { min-height: 30px; }
.mwi-empty { margin: 0; padding: 28px 16px; text-align: center; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r3); color: var(--muted); }
.mwi-group { margin-bottom: 14px; overflow: hidden; }
.mwi-group-head { margin: 0; font-size: inherit; }
.mwi-group-head button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; color: var(--text); }
.mwi-group-head button:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
.mwi-group-head button > svg { margin-left: auto; color: var(--muted); transition: transform 120ms; }
.mwi-group-head button[aria-expanded="false"] > svg { transform: rotate(-90deg); }
.mwi-group-name { font-size: 15px; font-weight: 600; }
.mwi-group-count { padding: 1px 8px; border-radius: var(--r-pill); background: var(--soft); font-size: 12.5px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.mwi-group-est { font-size: 13px; color: var(--muted); }
.mwi-dot { width: 9px; height: 9px; border-radius: var(--r-pill); flex: none; background: var(--accent); }
.mwi-tone-overdue { background: var(--crit); }
.mwi-tone-today, .mwi-tone-board { background: var(--accent); }
.mwi-tone-next7, .mwi-tone-started { background: var(--info); }
.mwi-tone-later { background: var(--pal-purple); }
.mwi-tone-nodate, .mwi-tone-waiting { background: var(--muted-2); }
.mwi-tone-finished { background: var(--ok); }
.mwi-cols, .mwi-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) 180px 150px 130px 80px; gap: 12px; align-items: center; }
.mwi-cols { padding: 8px 16px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.mwi-rows { list-style: none; margin: 0; padding: 0; }
.mwi-row { padding: 11px 16px; border-top: 1px solid var(--line); }
.mwi-row:hover { background: var(--surface-2); }
.mwi-tick-cell { display: flex; }
.mwi-row .mw-tick { width: 24px; height: 24px; }
.mwi-done { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; }
.mwi-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mwi-link { display: flex; align-items: baseline; gap: 8px; min-width: 0; color: var(--text); text-decoration: none; }
.mwi-link .mono { flex: none; font-size: 12.5px; color: var(--muted); }
.mwi-link .subj { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mwi-link:hover .subj { text-decoration: underline; }
.mwi-row.finished .mwi-link .subj { color: var(--muted); text-decoration: line-through; }
.mwi-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.mwi-tenant { font-size: 12px; color: var(--muted); }
.mwi-where { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; font-size: 13px; }
.mwi-board { color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mwi-dates { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--text-2); }
.mwi-due.crit { color: var(--crit); font-weight: 600; }
.mwi-due.acc { color: var(--accent-ink); font-weight: 600; }
.mwi-start { font-size: 12px; color: var(--muted); }
.mwi-time { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.mwi-bar { display: block; width: 90px; height: 5px; border-radius: var(--r-pill); background: var(--soft); overflow: hidden; }
.mwi-bar > span { display: block; height: 100%; background: var(--ok); }
.mwi-bar.over > span { background: var(--warn); }
.mwi-steps { font-size: 13px; color: var(--text-2); }
/* Tablets and phones: each row a card (tick, then the item over its board, status, dates and time). */
@media (max-width: 900px) {
    .mwi-cols { display: none; }
    .mwi-row { grid-template-columns: 32px minmax(0, 1fr); grid-template-areas: "tick main" "tick where" "tick meta"; row-gap: 6px; align-items: start; }
    .mwi-tick-cell { grid-area: tick; padding-top: 1px; }
    .mwi-main { grid-area: main; }
    .mwi-link .subj { white-space: normal; }
    .mwi-where { grid-area: where; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
    .mwi-dates, .mwi-time, .mwi-steps { grid-row: 3; grid-column: 2; }
    .mwi-dates { flex-direction: row; flex-wrap: wrap; gap: 4px 10px; }
    .mwi-time, .mwi-steps { display: none; }
    .mwi-group-by { margin-left: 0; }
}
@media (max-width: 640px) {
    .mw-actions { width: 100%; flex-wrap: wrap; }
    .mw-actions select { flex: 1 1 160px; min-width: 0; max-width: 100%; }
    .mwi-quick { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
    .mwi-qf { min-height: 44px; }
    .mwi-done { width: 28px; height: 28px; }
    /* Touch targets of 44 px that look as before: the tick's circle is drawn inside a larger button, the title's link is padded. */
    .mwi-row .mw-tick { position: relative; width: 44px; height: 44px; margin: -8px; border: 0; background: none; }
    .mwi-row .mw-tick::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); transition: border-color 120ms, background 120ms; }
    .mwi-row .mw-tick:hover::before, .mwi-row .mw-tick:focus-visible::before { border-color: var(--ok); background: var(--ok-bg); }
    .mwi-row .mw-tick:active::before { background: var(--ok); }
    .mwi-row .mw-tick > svg { position: relative; }
    .mwi-row .mw-tick:hover, .mwi-row .mw-tick:focus-visible, .mwi-row .mw-tick:active { background: none; }
    .mwi-link { padding: 11px 0; margin: -11px 0; }
    .mwi-row { grid-template-columns: 40px minmax(0, 1fr); }
}
.label-chip { color: #fff; }
.label-grey { background: #5f6368; } .label-red { background: #b3261e; } .label-orange { background: #a14a00; } .label-yellow { background: #7a5c00; }
.label-green { background: #1e7a34; } .label-teal { background: #00696b; } .label-blue { background: #1a57b5; } .label-purple { background: #6b3fa0; }
.wi-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
/* A work item's checklist: a progress bar, then a row per step (actions quiet until the row is hovered). */
.cl-bar { height: 6px; border-radius: var(--r-pill); background: var(--soft); overflow: hidden; margin: 0 0 12px; }
.cl-bar span { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width .2s ease; }
.cl-progress { font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: 6px; }
.cl-steps { list-style: none; margin: 0; padding: 0; display: grid; }
.cl-step { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: var(--r1); }
.cl-step:hover { background: var(--surface-2); }
.cl-step > input[type=checkbox] { width: 16px; height: 16px; margin: 0; flex: none; }
.cl-step > label { flex: 1 1 200px; min-width: 0; cursor: pointer; }
.cl-step > input:not([type=checkbox]) { flex: 1 1 200px; height: 34px; padding: 5px 10px; font-size: 13.5px; }
.cl-done { text-decoration: line-through; color: var(--muted); }
.cl-actions { gap: 2px; opacity: .55; transition: opacity 120ms; }
.cl-step:hover .cl-actions, .cl-actions:focus-within { opacity: 1; }
.cl-actions .btn { padding: 3px 7px; }
.cl-actions .cl-remove:hover { color: var(--crit); background: var(--crit-bg); }
.cl-add { gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cl-add input { flex: 1 1 240px; }
.label-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.label-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.label-row:last-child { border-bottom: 0; }
.label-row .label-used { margin-right: auto; }
.label-row input { flex: 1 1 200px; padding: 6px 10px; font-size: 13.5px; height: 34px; }

/* Desk setup lists (UC-032): a card's head with its add button, the table's order buttons, swatches, the edit dialogs. */
.vl-head { display: flex; align-items: flex-start; gap: 16px; }
.vl-head > div { flex: 1 1 auto; min-width: 0; }
.vl-head .vl-add { flex: none; }
.vl-table { width: 100%; }
.vl-order { white-space: nowrap; width: 76px; }
.vl-order .btn { min-width: 30px; padding-inline: 6px; }
.vl-table tr.vl-inactive { background: var(--surface-2); }
.vl-hidden { font-style: italic; }
.vl-rename { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.vl-rename input { flex: 0 1 260px; height: 40px; }
.vl-foot { max-width: 760px; }
.vl-changed { margin-left: 6px; }
.vl-word-standard { justify-self: start; }
.vl-word-preview { border: 1px solid var(--line); border-radius: var(--r2); padding: 10px 14px; background: var(--surface-2); }
.vl-word-preview .sub { margin: 0 0 6px; }
.vl-word-preview ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.bd-default { margin-left: 8px; } /* UC-033: the default board's chip */
.bd-follows { font-size: 13px; }
.vl-swatches { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.vl-swatches > legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 8px; }
.vl-swatch-row { display: flex; flex-wrap: wrap; gap: 10px; }
.vl-swatch { width: 44px; height: 44px; border-radius: var(--r2); border: 1px solid var(--line-strong); background: color-mix(in oklab, var(--pal) 28%, var(--surface)); cursor: pointer; }
.vl-swatch[aria-pressed="true"] { border: 3px solid var(--text); }
.vl-client { border: 0; border-top: 1px solid var(--line); padding: 16px 0 0; margin: 0; display: grid; gap: 10px; }
.vl-client > legend { font-size: 13px; font-weight: 600; padding: 16px 0 0; float: left; width: 100%; }
.vl-behaviour { border: 1px solid var(--line); border-radius: var(--r2); padding: 0 14px; font-size: 13px; }
.vl-behaviour > summary { cursor: pointer; font-weight: 600; padding: 12px 0; line-height: 20px; } /* 44 px tall: a touch target; display stays list-item for the marker */
.vl-behaviour ul { margin: 0 0 10px; padding-left: 18px; color: var(--muted); line-height: 1.6; }
.vl-dialog .dialog-body { display: grid; gap: 16px; }
.vl-dialog-move { display: none; gap: 8px; }
@media (max-width: 640px) {
  .vl-head { flex-direction: column; }
  .vl-head .vl-add { width: 100%; justify-content: center; min-height: 44px; }
  .vl-dialog-move { display: flex; }
  .vl-dialog-move .btn { min-height: 44px; flex: 1 1 0; }
  .vl-table td[data-label]:empty { display: none; } /* an empty cell's label would sit over the next line */
  .vl-rename input { flex: 1 1 100%; }
  .vl-rename .sub { flex-basis: 100%; }
}
.label-row select { padding: 6px 10px; font-size: 13.5px; height: 34px; }
.lb-preview { align-self: flex-end; margin-bottom: 9px; }


/* ---------- Time tracking (UC-012) ---------- */
.header-timer { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; color: var(--text-2); max-width: 100%; }
.header-timer .ht-item { color: var(--text); font-weight: 600; text-decoration: none; }
.header-timer .ht-item:hover { text-decoration: underline; }
.header-timer .ht-elapsed { font-variant-numeric: tabular-nums; color: var(--text); }
.header-timer.running { border-color: color-mix(in oklab, var(--accent) 45%, transparent); }
.header-timer.amber { background: var(--warn-bg); border-color: color-mix(in oklab, var(--warn) 45%, transparent); color: var(--warn); }
.header-timer.amber .ht-elapsed, .header-timer.amber .ht-item { color: var(--warn); }
.header-timer.waiting { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 45%, transparent); }
.header-timer .ht-amber { font-size: 12px; font-weight: 500; }
.ht-notice { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60; margin: 0; box-shadow: var(--shadow-2); max-width: min(420px, calc(100vw - 32px)); }
.header-timer, .header-timer .ht-item { white-space: nowrap; }
@media (max-width: 768px) {
  /* Phones: the top bar is full, so the timer floats as a pill just above the bottom nav (number, time or Log time, Stop). */
  .header-timer { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-nav-h) + 10px + env(safe-area-inset-bottom, 0px));
                  z-index: 25; box-shadow: var(--shadow-2); gap: 6px; padding-left: 10px; }
  .header-timer .ht-amber, .header-timer .ht-text { display: none; }
  .ht-notice { bottom: calc(var(--bottom-nav-h) + 64px + env(safe-area-inset-bottom, 0px)); }
}

.time-card .time-total { margin: 0 0 10px; font-size: 13.5px; color: var(--text-2); }
.time-card .time-total b { color: var(--text); }
.time-actions { margin-bottom: 10px; }
.time-entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.time-entry { padding: 8px 0; border-top: 1px solid var(--line); min-width: 0; }
.time-entry:first-child { border-top: 0; }
.time-entry-head { gap: 6px 10px; }
.time-entry-head .mono { font-size: 12.5px; }
.time-entry-actions { margin-left: auto; gap: 2px; }
.time-note { margin: 4px 0 0; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; white-space: pre-line; }
.time-more { margin-top: 6px; }
.ticket-time-item .ts-title { flex: 1; }
.ticket-time-minutes { font-variant-numeric: tabular-nums; }
.ticket-time-item.archived { opacity: .6; }
.time-billable-toggle { cursor: pointer; border: 1px dashed var(--line-strong); }
.time-billable-toggle[aria-pressed=true] { border-style: solid; }
.bp-range { flex-wrap: wrap; align-items: end; }
.bp-notes { margin: 8px 16px 0; display: flex; flex-direction: column; gap: 2px; }
.bp-notes .hint { margin: 0; }
.bp-actions { margin: 12px 16px 16px; }
.bp-confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; }
.bp-exports .voided > :is(th, td) { color: var(--muted); }
.bp-voided { display: block; }
.tr-tabs { margin-bottom: 14px; }
.bp-table tbody th[scope=row], .bp-exports tbody th[scope=row] { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); }
.time-no-item { margin: 0 0 8px; }
.item-pick .ip-items { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.item-pick .ip-item { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); color: var(--text); font-size: 13.5px; }
.item-pick .ip-item:hover:not(:disabled), .item-pick .ip-item:focus-visible { background: var(--soft); }
.item-pick .ip-item:disabled { opacity: .55; cursor: not-allowed; }
.item-pick .ip-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.item-pick .ip-item .sub { flex-basis: 100%; }
.dialog-foot .ip-new { margin-right: auto; }
.quick-item .qi-no-tenant { margin: -8px 0 14px; }
.log-time .lt-new-item { align-self: flex-start; }

.log-time .lt-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.log-time .lt-item { gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface-2); }
.log-time .lt-change-item { margin-left: auto; }
.log-time .lt-tenant { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.log-time .lt-tenant-name { color: var(--text); font-weight: 500; }
.log-time .lt-tenant .hint { flex-basis: 100%; }
.lt-discard-ask { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-right: auto; font-size: 13px; }
.dialog-foot .lt-discard { margin-right: auto; }

.time-picker { display: flex; flex-direction: column; gap: 6px; }
.time-picker label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.time-picker-results { list-style: none; margin: 0; padding: 4px; border: 1px solid var(--line); border-radius: var(--r2); max-height: 240px; overflow: auto; background: var(--surface); }
.time-pick { display: flex; gap: 8px; align-items: baseline; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: var(--r1); color: var(--text); font-size: 13px; }
.time-pick:hover, .time-pick:focus-visible { background: var(--soft); }
.time-pick .time-pick-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time-picker-none { margin: 0; }

.ts-weeks { margin-bottom: 14px; padding: 8px 12px; }
.ts-days { display: flex; flex-direction: column; gap: 10px; }
.ts-day { padding: 10px 16px; }
.ts-day h2 { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin: 0; }
.ts-day .ts-day-total { font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 500; }
.ts-day.today { border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); }
.ts-day .time-entries { margin-top: 6px; }
.ts-title { min-width: 0; overflow-wrap: anywhere; }

.tr-range { margin-bottom: 16px; }
.tr-section { margin-bottom: 14px; }
.tr-section > .tr-note { margin: 12px 16px 4px; }
.tr-section > .tr-none { margin: 12px 16px 14px; }
.tr-table th[scope=row] { text-align: left; font-weight: 500; }
.tr-table .tr-open { padding-inline: 4px; text-align: left; white-space: normal; }
.tr-table tfoot th, .tr-table tfoot td { border-top: 1px solid var(--line-strong); }
.tr-entries-row > td { background: var(--surface-2); }
.tr-table .tr-child th[scope=row] { padding-left: 28px; font-weight: 400; }
.tr-table .tr-child > :is(td, th) { background: color-mix(in oklab, var(--surface-2) 50%, transparent); }
.wi-time { font-variant-numeric: tabular-nums; }

/* Releases and installations (UC-013) */
.section-head { justify-content: space-between; align-items: center; gap: 8px; }
.section-head h2 { margin: 0; }
.confirm-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.releases .mono, .installations .mono { font-variant-numeric: tabular-nums; }
.installations td.actions .row-actions { flex-wrap: nowrap; white-space: nowrap; }
.product-name { display: inline-flex; align-items: center; gap: 8px; }
.product-mark { flex: none; width: 20px; height: 20px; border-radius: 5px; display: block; box-shadow: 0 0 0 1px var(--line); }
.product-initials { display: grid; place-items: center; font-size: 9px; font-weight: 700; background: var(--soft); color: var(--text-2); }
.installations td:nth-child(6), .release-installed td:last-child { white-space: nowrap; }
.installation-history-row > td { background: var(--surface-2); }
.installation-history-list { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.release-date-warning { color: var(--warn); }
.fixed-in-release a, .resolved-by-release a { font-weight: 500; }

/* Live updates (UC-014) */
.ne-choices { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.viewers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; }
.viewers .avatar.viewer { width: 24px; height: 24px; font-size: 10.5px; }
.live-paused { white-space: nowrap; }
.new-marker { margin-left: 4px; }

/* ---------- Notifications (UC-015): the bell, its panel, the page, mentions ---------- */
.nb { position: relative; }
.bell-count { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--r-pill); background: var(--crit); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.nb-backdrop { position: fixed; inset: 0; z-index: 30; }
.nb-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 31; width: min(400px, 92vw); max-height: min(560px, 75vh); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); box-shadow: var(--shadow); outline: none; }
.nb-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.nb-head h2 { font-size: 15px; margin: 0; flex: 1; }
.nb-close { display: none; }
.nb-empty { padding: 18px 14px; margin: 0; }
.nb-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.nb-item { display: flex; align-items: flex-start; gap: 4px; border-bottom: 1px solid var(--line); }
.nb-item:last-child { border-bottom: 0; }
.nb-open { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px 6px 10px 14px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.nb-open:hover, .nb-open:focus-visible { background: var(--soft); }
.nb-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.nb-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nb-title { font-weight: 600; }
.nb-detail { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-ago { color: var(--muted); font-size: 12px; }
.nb-item.read .nb-title { font-weight: 500; color: var(--text-2); }
.nb-item.read .nb-open { padding-left: 32px; }
.nb-dismiss { flex: none; margin: 6px 6px 0 0; width: 30px; height: 30px; }
.nb-foot { padding: 10px 14px; border-top: 1px solid var(--line); text-align: center; }
.np-list { border: 1px solid var(--line); border-radius: var(--r2); }
.mention { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; border-radius: var(--r1); padding: 0 3px; }
.mention-wrap { position: relative; }
.mention-list { position: absolute; left: 0; top: calc(100% + 2px); z-index: 5; min-width: 240px; max-height: 260px; overflow-y: auto; list-style: none; margin: 0; padding: 4px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow); }
.mention-option { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; }
.mention-option.active, .mention-option:hover { background: var(--soft); }
.notification-email .ne-choices { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
/* The priority list (UC-025 story 2) */
.epic-views { margin: 0 0 12px; }
.epic-priority tr[draggable="true"] { cursor: grab; }
.epic-priority tr.drop-target td { box-shadow: inset 0 2px 0 var(--accent); }
.epic-priority .priority-rank { width: 3em; font-variant-numeric: tabular-nums; }
.epic-priority .actions { white-space: nowrap; }
.epic-priority .gl-grip { margin-right: 8px; color: var(--muted); letter-spacing: -2px; }

/* Capacity and away periods (UC-025 story 1) */
.capacity-week { border: 0; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.capacity-week legend { grid-column: 1 / -1; font-weight: 600; margin-bottom: 4px; }
.capacity-week .field { margin: 0; }
.capacity-week input { width: 100%; }
.capacity-hours { width: 100%; max-width: 420px; border-collapse: collapse; margin: 8px 0; }
.capacity-hours th, .capacity-hours td { padding: 4px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.capacity-hours th[scope="row"] { text-align: left; font-weight: 500; }
.away-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.away-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.away-actions { margin-left: auto; display: flex; gap: 6px; }
.away-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; align-items: end; }
.away-form .field { margin: 0; }
.away-form-actions { display: flex; gap: 6px; }
@media (max-width: 640px) {
    .capacity-week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .away-form { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .topbar-actions .theme-toggle { display: none; } /* room for the bell; Settings → Appearance has the theme */
  .nb-backdrop { background: rgba(10,11,14,.45); }
  /* The top bar is its own stacking layer, under the bottom nav: keep the sheet's end clear of it. */
  .nb-panel { position: fixed; inset: 0; width: auto; max-height: none; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top);
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
  .nb-close { display: grid; }
}

/* ---------- Dashboard (UC-016): the mockup's layout (D33: content and flow), estate tokens ---------- */
.dash-head { align-items: flex-start; margin-bottom: 12px; }
.dash-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dash-filters input[type=date] { width: auto; }
.dash-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.dash-card { padding: 10px 14px; display: flex; flex-direction: column; gap: 1px; min-width: 0; border-radius: var(--r2); }
.dash-card-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.dash-card-value { font-size: 26px; font-weight: 700; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
a.dash-card-value { color: inherit; text-decoration: none; }
a.dash-card-value:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.dash-card[data-card="open"] .dash-card-value { font-size: 21px; margin-top: 5px; }
.dash-card-sub { font-size: 12px; color: var(--muted); }
.dash-card-trend { font-size: 12px; color: var(--muted); }
.dash-card-trend.up { color: var(--ok); }
.dash-card-trend.down { color: var(--crit); }
.dash-card[data-card="new"] .dash-card-trend.up, .dash-card[data-card="new"] .dash-card-trend.down { color: var(--text-2); }
.dash-arrow { margin-right: 4px; font-size: 10px; }
/* Two independent columns (no row alignment, so no dead space under the shorter card): the charts and team on the left,
   breakdowns, targets and hours on the right. */
.dash-columns { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dash-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); padding: 12px 14px; min-width: 0; }
.dash-box h2 { font-size: 14px; font-weight: 600; margin: 0; }
.dash-box-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.dash-lead { margin: 2px 0 0; }
.dash-note, .dash-box > .notice { margin: 4px 0 8px; }
.dash-pick { margin: 6px 0 4px; }
.dash-pick button { padding: 3px 10px; }
.dash-off { display: none; }
.dash-bars-title { display: none; font-size: 12px; font-weight: 500; color: var(--text-2); margin: 8px 0 4px; }
.dash-bars ol { list-style: none; margin: 0; padding: 0; }
.dash-bars li { display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 3px 0; font-size: 13px; }
.dash-bars li:has(.bar-note) { grid-template-columns: minmax(0, 7rem) minmax(0, 1fr) 3.2rem auto; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; border-radius: var(--r-pill); background: var(--soft); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.bar-fill.muted { background: var(--muted-2); }
.bar-fill.ok { background: var(--ok); }
.bar-fill.warn { background: var(--warn); }
.bar-fill.crit { background: var(--crit); }
.bar-value { font-variant-numeric: tabular-nums; text-align: right; font-weight: 500; }
.bar-note { font-size: 12px; color: var(--muted); white-space: nowrap; }
.dash-bars a, .dash-table td a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.dash-bars a:hover, .dash-table td a:hover { text-decoration-color: currentColor; }
.dash-table th[scope=row] { text-align: left; font-weight: 500; font-size: 13.5px; text-transform: none; letter-spacing: 0; color: var(--text); white-space: normal; }
.dash-table th.num, .dash-table td.num { text-align: right; }
.dash-table td.num { white-space: nowrap; }
.dash-table th, .dash-table td { padding: 6px 8px; }
.dash-table th { white-space: normal; } /* "Resolved · avg" on two lines keeps Team workload within its box at 1280px */
.dash-table thead th { padding-top: 4px; }
.dash-table td a.chip { text-decoration: none; }
.dash-person { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.dash-chips { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 6px; } /* "3 overdue" and "2 at risk" stack in a narrow box, so Resolved stays on screen */
.dash-chips .chip { padding: 1px 7px; }
.dash-avg-sub { color: var(--muted); font-size: 12px; }
.dash-person .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.dash-avatar { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-ink); }
.dash-none, .dash-more { margin: 4px 0 8px; }
.dash-hours-note { margin: 4px 0; }
.dash-chart { margin-top: 6px; }
.dash-chart-title { font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.dash-plot { position: relative; }
.dash-svg { width: 100%; height: 130px; display: block; overflow: visible; }
.targets-chart .dash-svg { height: 90px; }
.dash-svg .axis { stroke: var(--line-strong); }
.dash-svg .grid { stroke: var(--line); stroke-dasharray: 3 3; }
.dash-svg .bar-bug { fill: var(--s1); }
.dash-svg .bar-query { fill: var(--s2); }
.dash-svg .bar-feature { fill: var(--s3); }
.dash-svg .hit { fill: transparent; }
.dash-svg .hit:hover { fill: color-mix(in oklab, var(--text) 6%, transparent); }
.dash-svg .line-resolved { fill: none; stroke: var(--text-2); stroke-width: 2; stroke-dasharray: 5 3; }
.dash-svg .line-met { fill: none; stroke: var(--ok); stroke-width: 2; }
.dash-tick { position: absolute; transform: translate(-50%, -50%); font-size: 11px; color: var(--muted); white-space: nowrap; pointer-events: none; }
.dash-tick.end { transform: translate(-100%, -50%); }
.dash-tick.start { transform: translate(0, -50%); }
.dash-dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); transform: translate(-50%, -50%); }
.dash-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin: 2px 0 4px; }
.dash-legend .sw { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; border-radius: 3px; }
.dash-legend .sw-bug { background: var(--s1); }
.dash-legend .sw-query { background: var(--s2); }
.dash-legend .sw-feature { background: var(--s3); }
.dash-legend .sw-resolved { height: 0; border-top: 2px dashed var(--text-2); border-radius: 0; vertical-align: 3px; }
.dash-data { margin-top: 4px; font-size: 12.5px; }
.dash-data summary { cursor: pointer; color: var(--muted); }
.dash-data table { margin-top: 6px; }
.dash-how summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.dash-how dl { margin: 10px 0 4px; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; }
.dash-how dt { font-weight: 500; }
.dash-how dd { margin: 0; color: var(--text-2); }
.dash-error .dash-retry { margin-left: 10px; }
.dash-banner .dash-clear { margin-left: 10px; }
.dash-print-head { display: none; }
@media (max-width: 1100px) {
  .dash-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .dash-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-card-value { font-size: 24px; }
  .dash-card[data-card="open"] .dash-card-value { font-size: 19px; }
  .dash-how dl { grid-template-columns: 1fr; }
  .dash-filters { width: 100%; }
}
@media print {
  @page { size: A4 portrait; margin: 14mm 12mm; }
  html, body, .app-shell, .app-main, .content { height: auto !important; min-height: 0 !important; overflow: visible !important; }
  .app-shell { display: block; }
  .content { padding: 0; }
  .sidebar, .topbar, .bottom-nav, .dash-filters, .dash-csv, .dash-retry, .dash-pick, .dash-data, .dash-how, .dash-features, .dash-subtitle { display: none !important; }
  /* Two A4 pages for a typical month (story 8): four cards to a row (the phone rules would apply at A4 width), every
     breakdown shown with its title, tighter rows, and only cards, charts and lists kept whole. */
  .page-head { margin-bottom: 6px; }
  .dash-print-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; font-size: 12px; }
  .dash-summary { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px; margin-bottom: 8px; }
  .dash-card { padding: 8px 10px; }
  .dash-card-value { font-size: 18px !important; }
  .dash-columns { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) !important; gap: 8px; }
  .dash-col { gap: 8px; }
  .dash-box { padding: 8px 10px; break-inside: auto; }
  .dash-off { display: block; }
  .dash-bars-title { display: block; }
  .dash-bars li { padding: 2px 0; font-size: 11px; }
  .dash-bars, .dash-chart, .dash-card, .dash-table { break-inside: avoid; }
  .dash-table table th, .dash-table table td { padding: 3px 6px; font-size: 11px; }
  .dash-svg { height: 110px; }
  .dash-bars a, .dash-table td a, a.dash-card-value { color: inherit; text-decoration: none; }
  .tbl-wrap { overflow: visible; }
}

/* Calendar (UC-017) */
.cal-head { align-items: center; }
.cal-range { font-variant-numeric: tabular-nums; }
.cal-filters { align-items: center; }
.cal-people { position: relative; }
.cal-people-toggle svg { margin-left: 4px; }
.cal-people-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 240px; max-height: 320px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3);
  box-shadow: var(--shadow-3); }
.cal-people-menu .row { gap: 6px; margin-bottom: 4px; }
.cal-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); }
.cal-week { width: 100%; min-width: 760px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.cal-week th, .cal-week td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; }
.cal-week th:last-child, .cal-week td:last-child { border-right: 0; }
.cal-week tbody tr:last-child > * { border-bottom: 0; }
.cal-week thead th { padding: 10px 8px; font-size: 12px; font-weight: 600; text-align: left; color: var(--text-2); background: var(--surface-2); }
.cal-week .cal-person-h, .cal-week .cal-person { width: 132px; }
.cal-week tbody th.cal-person { padding: 10px 8px; font-size: 13px; font-weight: 500; text-align: left; text-transform: none; letter-spacing: 0;
  color: var(--text); overflow-wrap: anywhere; }
.cal-person .avatar { display: inline-grid; width: 24px; height: 24px; font-size: 10.5px; margin-right: 6px; vertical-align: middle; }
.cal-week tbody tr.cal-unassigned th.cal-person { color: var(--muted); font-style: italic; }
.cal-cell { padding: 6px; min-height: 64px; }
.cal-today { background: color-mix(in oklab, var(--accent) 5%, transparent); }
.cal-week thead th.cal-today { background: color-mix(in oklab, var(--accent) 12%, var(--surface-2)); }
.cal-today-chip { display: block; width: fit-content; margin-top: 3px; }
.cal-load { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.cal-load.cal-over { color: var(--warn); font-weight: 600; }
.cal-card { display: flex; flex-direction: column; gap: 3px; padding: 6px 7px; margin-bottom: 5px; border: 1px solid var(--line); border-radius: var(--r2);
  background: var(--surface); font-size: 12.5px; line-height: 1.35; }
.cal-card:hover { border-color: var(--line-strong); }
.cal-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; } /* a narrow day wraps the chips rather than pushing Move to off the card */
.cal-card-top .chip { font-size: 10.5px; padding: 1px 6px; }
.cal-card-end { margin-left: auto; display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 2px; min-width: 0; }
.cal-est { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-est.cal-est-over { color: var(--warn); font-weight: 600; } /* logged past the estimate */
.cal-logged { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.cal-logged.cal-est-over { color: var(--warn); font-weight: 600; }
.cal-bar-time { flex: 0 5 auto; overflow: hidden; text-overflow: ellipsis; min-width: 0; } /* gives way to the title first */
.cal-card-link { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.cal-card-link:hover { text-decoration: underline; }
.cal-card-link .mono { color: var(--muted); font-size: 11.5px; }
.cal-card.done { opacity: .6; }
.cal-card.done .cal-card-link { text-decoration: line-through; text-decoration-color: color-mix(in oklab, var(--muted) 60%, transparent); }
.cal-done { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); }
.cal-card.overdue { border-color: color-mix(in oklab, var(--crit) 40%, var(--line)); }
.cal-overdue { color: var(--crit); font-size: 11.5px; font-weight: 600; }
.cal-more { width: 100%; justify-content: center; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.cal-main { min-width: 0; }
.cal-views { margin-right: 6px; }
.cal-drop { outline: 2px dashed color-mix(in oklab, var(--accent) 55%, transparent); outline-offset: -3px; }
.cal-cell { position: relative; }
.cal-cell:has(.cal-add) { padding-bottom: 32px; } /* the "+" gets its own lane below the cards */
.cal-add { display: inline-grid; opacity: 0; position: absolute; right: 4px; bottom: 4px; width: 22px; height: 22px; place-items: center; border: 1px dashed var(--line-strong);
  border-radius: var(--r1); background: var(--surface); color: var(--muted); cursor: pointer; }
.cal-cell:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
@media (hover: none) { .cal-add { opacity: 1; } }
.cal-card.movable { cursor: grab; }
.cal-card .cal-move-to { width: 20px; height: 20px; color: var(--muted); }
.cal-nodate { position: sticky; top: 12px; max-height: calc(100vh - 160px); overflow-y: auto; }
.cal-nodate .panel-title .chip { margin-left: auto; }
.cal-nodate-list { list-style: none; margin: 0; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cal-nodate-row { display: flex; flex-direction: column; gap: 3px; padding: 7px 8px; border: 1px solid var(--line); border-radius: var(--r2); font-size: 12.5px; }
.cal-nodate-row[draggable="true"] { cursor: grab; }
.cal-nodate-top { display: flex; align-items: flex-start; gap: 6px; }
.cal-nodate-top a { color: var(--text); text-decoration: none; overflow-wrap: anywhere; flex: 1; }
.cal-nodate-top a .mono { color: var(--muted); font-size: 11.5px; }
.cal-nodate-row .chip { align-self: flex-start; }
.cal-nodate-more { margin: 0 8px 10px; }
.cal-nodate > .hint { margin: 14px; }
.cal-month { width: 100%; min-width: 760px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.cal-month th { padding: 8px; font-size: 12px; font-weight: 600; text-align: left; color: var(--text-2); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-month td { height: 112px; padding: 6px; vertical-align: top; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.cal-month td:last-child { border-right: 0; }
.cal-month tbody tr:last-child td { border-bottom: 0; }
.cal-outside { background: color-mix(in oklab, var(--surface-2) 60%, transparent); }
.cal-outside .cal-mday-num { color: var(--muted-2); }
.cal-mday-num { border: 0; background: none; padding: 0 4px; border-radius: var(--r1); font-weight: 600; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.cal-mday-num:hover { background: var(--soft); }
.cal-today .cal-mday-num { background: var(--accent); color: #1a1300; }
.cal-mcount { float: right; font-size: 11px; color: var(--muted); }
.cal-mlist { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; }
.cal-mlist li { display: flex; gap: 4px; align-items: baseline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-mlist a { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.cal-mlist .mono { color: var(--muted); }
.cal-mlist li.done { opacity: .6; text-decoration: line-through; }
.cal-mlist li.overdue a { color: var(--crit); }
.cal-minit { flex: none; font-size: 10px; font-weight: 700; color: var(--muted); }
.cal-dots { display: none; gap: 3px; margin-top: 4px; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--info); }
.cal-dot.overdue { background: var(--crit); }
.cal-dot.done { background: var(--ok); }
.cal-mday-open { padding: 0 4px; font-size: 11px; color: var(--muted); }
/* Spans (UC-018): lanes of bars above a person's cells, strips in the month, a range on cards */
.cal-week tr.cal-lane > td { border-bottom: 0; padding: 4px 4px 0; height: 32px; }
.cal-bar { position: relative; display: flex; align-items: center; gap: 5px; min-height: 26px; padding: 2px 6px; border: 1px solid var(--line-strong);
  border-radius: var(--r2); background: color-mix(in oklab, var(--info) 12%, var(--surface)); font-size: 12px; line-height: 1.3; }
/* Layers (UC-018 plan B2): the face is read, the day segments on top take the mouse, the handles and Move to… sit above them. */
.cal-bar-face { display: flex; align-items: center; gap: 5px; flex: 1 1 auto; min-width: 0; overflow: hidden; pointer-events: none; }
.cal-bar-days { position: absolute; inset: 0; display: flex; z-index: 1; }
.cal-bar-day { flex: 1; cursor: pointer; }
.cal-bar.movable .cal-bar-day { cursor: grab; }
.cal-bar .cal-move-to { position: relative; z-index: 2; }
.cal-edge { position: absolute; top: -1px; bottom: -1px; width: 24px; z-index: 2; cursor: ew-resize; } /* 24 px target (WCAG 2.5.8) */
.cal-edge.start { left: -12px; }
.cal-edge.end { right: -12px; }
.cal-edge::after { content: ""; position: absolute; top: 5px; bottom: 5px; left: 10px; width: 4px; border-radius: 2px; background: var(--line-strong); opacity: 0; }
.cal-bar:hover .cal-edge::after, .cal-edge:hover::after { opacity: 1; }
.cal-bar.cut-left { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-style: dashed; }
.cal-bar.cut-right { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-style: dashed; }
.cal-bar-label { color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 4.5em; flex: 1 1 auto; }
.cal-bar-label:hover { text-decoration: underline; }
.cal-bar-label .mono { color: var(--muted); font-size: 11px; }
.cal-bar .cal-overdue { display: flex; white-space: nowrap; font-size: 11px; flex: 0 4 auto; min-width: 4.3em; } /* shrinks to the word */
.cal-overdue-word { flex: none; } /* "Overdue" stays whole */
.cal-overdue-when { overflow: hidden; text-overflow: ellipsis; min-width: 0; } /* the date gives way to the title */
.cal-bar .cal-move-to { width: 20px; height: 20px; color: var(--muted); flex: none; }
.cal-bar.overdue { border-color: color-mix(in oklab, var(--crit) 55%, var(--line)); background: color-mix(in oklab, var(--crit) 8%, var(--surface)); }
.cal-bar.done { opacity: .6; background: var(--surface-2); }
.cal-bar.done .cal-bar-label { text-decoration: line-through; text-decoration-color: color-mix(in oklab, var(--muted) 60%, transparent); }
.cal-continues { flex: none; color: var(--muted); font-weight: 700; }
.cal-card-range { display: inline-flex; gap: 4px; align-items: center; }
.cal-mspan, .cal-mspan-gap { height: 16px; margin: 2px -6px 0; }
.cal-mspan { display: flex; align-items: center; gap: 4px; padding: 0 6px; font-size: 11px; white-space: nowrap; overflow: hidden;
  background: color-mix(in oklab, var(--info) 14%, var(--surface)); }
.cal-mspan.first { margin-left: 0; border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.cal-mspan.last { margin-right: 0; border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.cal-mspan a { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.cal-mspan .mono { color: var(--muted); }
.cal-mspan.overdue { background: color-mix(in oklab, var(--crit) 14%, var(--surface)); }
.cal-mspan.overdue a { color: var(--crit); }
.cal-mspan.done { opacity: .6; }
/* Kind tints (2026-10-20), as the kind chips: bugs blue, features green, tasks grey; tickets amber. Red stays "overdue". */
.kind-bug { --kind: var(--s1); }
.kind-feature { --kind: var(--s3); }
.kind-task { --kind: var(--muted); }
.kind-ticket { --kind: var(--warn); }
.cal-card[class*="kind-"], .cal-bar[class*="kind-"] { background: color-mix(in oklab, var(--kind) 20%, var(--surface)); border-left: 4px solid var(--kind); }
.cal-mlist li[class*="kind-"] { padding: 1px 5px; border-radius: 4px; border-left: 3px solid var(--kind); background: color-mix(in oklab, var(--kind) 24%, var(--surface)); }
.cal-mspan[class*="kind-"] { background: color-mix(in oklab, var(--kind) 28%, var(--surface)); }
.cal-mspan.first[class*="kind-"] { border-left: 3px solid var(--kind); }
.cal-day-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 0 6px; }
.cal-day-dialog .dialog-body { max-height: 80vh; overflow-y: auto; }
@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .cal-nodate { position: static; max-height: none; }
}
.cal-daynav { align-items: center; gap: 6px; }
.cal-day-label { font-weight: 600; font-size: 13px; min-width: 92px; text-align: center; }
.nw-done { align-self: flex-start; margin-bottom: 10px; }
@media (max-width: 640px) {
  .cal-week { min-width: 0; }
  .cal-week .cal-person-h, .cal-week .cal-person { width: 38%; }
  .cal-nav { flex-wrap: wrap; }
  .cal-month { min-width: 0; }
  .cal-month td { height: 64px; padding: 4px; }
  .cal-mlist, .cal-mday-open, .cal-month .cal-more { display: none; }
  .cal-dots { display: flex; }
  .cal-mspan, .cal-mspan-gap { display: none; }
  .cal-mday { cursor: pointer; }
  .cal-add { opacity: 1; }
}

/* ---------- Client pages (UC-019): Report, My tickets, the ticket page ---------- */
.mixed-access { max-width: 520px; margin: 12vh auto; }
.client-panel { padding: 18px 20px; max-width: 760px; }
.client-panel .field > legend, .client-panel .field > .label { font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; padding: 0; }
.client-panel fieldset.field { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.client-fixed { font-size: 14px; padding: 6px 0; }
.client-panel .counter { align-self: flex-end; font-variant-numeric: tabular-nums; }
.client-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.client-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--r2); cursor: pointer; background: var(--surface); }
.client-card:hover { background: var(--soft); }
.client-card.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.client-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.client-card:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.client-card span { font-size: 12.5px; color: var(--muted); }
.client-severity .radio { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 13.5px; }
.client-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.client-sent h2 { margin: 0 0 6px; font-size: 18px; }
.client-views { margin: 14px 14px 0; flex-wrap: wrap; }
.client-company { margin: 12px 14px 0; max-width: 320px; }
.client-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.client-filters .check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; }
.panel > .client-views + .notice, .panel > .notice { margin: 12px 14px; }
.client-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.client-row a { display: grid; gap: 4px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.client-row a:hover { background: var(--soft); }
.client-row a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.client-row-head { display: flex; align-items: center; gap: 10px; }
.client-row-subject { font-weight: 500; overflow-wrap: anywhere; }
.client-row-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) {
  .client-panel { padding: 14px; }
  .client-cards { grid-template-columns: 1fr; }
}
.client-ticket { display: grid; gap: 14px; max-width: 760px; }
.client-ticket-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.client-status-line { margin: 4px 0 0; }
.client-ticket .kv { margin: 0; }
.client-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.client-outcome h2, .client-conversation h2 { font-size: 15px; margin: 0 0 10px; }
.client-messages { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.client-message { padding: 10px 14px; border-radius: var(--r2); border: 1px solid var(--line); background: var(--surface); max-width: 92%; }
.client-message.from-client { justify-self: end; background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 30%, transparent); }
.client-message-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 12.5px; margin-bottom: 4px; }
.client-message-head time { color: var(--muted); }
.client-link + .client-link { margin-left: 8px; }
.client-followup { display: grid; gap: 8px; justify-items: start; }
.client-dialog p { margin: 0 0 12px; }
.contact-link-body { padding: 0 16px 16px; display: grid; gap: 10px; justify-items: start; }
.contact-link-body p { margin: 0; }
.contact-link-users { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 520px; }
.contact-link-users li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* UC-020: an on/off switch (role="switch", aria-checked) */
.switch { display: inline-flex; align-items: center; gap: 6px; min-width: 64px; padding: 3px 10px 3px 4px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--soft); color: var(--text-2); font-size: 12.5px; cursor: pointer; }
.switch::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s; }
.switch.on { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in oklab, var(--ok) 40%, transparent); }
.switch.on::before { background: var(--ok); }
.switch:disabled { cursor: not-allowed; opacity: .6; }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch::before { transition: none; } }
.ej-mailbox-state { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ej-cards { display: flex; flex-direction: column; gap: 16px; }

/* UC-020 Desk setup: the "?" help, field heads, the status line and the switch list. */
.help-tip { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: help; vertical-align: middle; flex: none; }
.help-tip:hover, .help-tip:focus-visible { color: var(--accent-ink); background: var(--accent-soft); }
.help-tip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-head { display: flex; align-items: center; gap: 4px; }
.th-help { display: inline-flex; align-items: center; gap: 4px; }
.ej-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 16px; margin-bottom: 8px; }
.ej-card-head p.muted { margin: 0; }
.ej-mailbox-state { margin: 0; }
.settings-card h3.ej-section { margin: 16px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.settings-card .ej-mailbox-form h3.ej-section:first-of-type, .ej-mailbox fieldset > h3.ej-section:first-child { border-top: 0; padding-top: 0; margin-top: 8px; }
.ej-thread .check-row { margin-top: 6px; }
.ej-actions { margin-top: 4px; }
.ej-test-note { flex-basis: 100%; margin: -6px 0 0; }
.ej-test-result { flex-basis: 100%; margin: 0; }
.inline-form-title { display: flex; align-items: center; gap: 4px; }
.ej-status { list-style: none; margin: 0; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 10px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); }
.ej-status li { display: flex; align-items: center; gap: 8px; }
.ej-status-label { font-size: 12.5px; color: var(--muted); }
.ej-switch-list { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ej-switch-list li { display: flex; align-items: flex-start; gap: 12px; }
.ej-switch-list .switch { margin-top: 2px; flex: none; }
.ej-switch-title { font-weight: 500; color: var(--text); }
.ej-switch-help { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.ej-switch-help p { margin: 0; }
.ej-switch-help b { font-weight: 500; color: var(--text-2); }
.ej-switch-list .hint { margin: 2px 0 0; max-width: 60ch; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.ej-cards fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
/* Desk setup → Time and billing (UC-022) */
.tb-card fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.tb-card .field { margin-bottom: 12px; }
.tb-confirm { gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
/* Who a work item is for (UC-022 story 2) */
.tenancy-billable { margin: 0 0 4px; }
.tenancy-billable + .hint, .tenancy-billable:last-child { display: block; margin-bottom: 12px; }
.w-tenant .chip, .w-tenant .btn { margin-left: 6px; }
.w-tenant-hint { display: block; margin-top: 4px; }
/* The jobs table: a job's name and note read as text (not as a column header); the note wraps; run details stay compact. */
.ej-jobs tbody th { text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 500; color: var(--text); white-space: normal; min-width: 240px; max-width: 360px; }
.ej-jobs tbody th .sub { font-weight: 400; text-transform: none; letter-spacing: 0; margin-top: 4px; }
.ej-jobs td.ej-last-run { min-width: 160px; }
.ej-jobs td.ej-last-run .chip { margin-right: 4px; }
.ej-jobs select { max-width: 160px; }
.ej-job-name { font-weight: 600; }
.ej-job-off { color: var(--muted); }
.ej-job-off b { font-weight: 500; color: var(--text-2); }
.ej-job-control { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 110px; font-size: 12.5px; }
.ej-jobs .ej-run { margin-top: 6px; display: block; }

/* PWA banners (blackbee-pwa-install-update): one fixed stack bottom centre, clear of a phone's home bar. pointer-events:none on
   the stack so the gap between banners doesn't swallow taps on the page beneath. */
.app-banners {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 1070; width: calc(100% - 32px); max-width: 460px;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.install-banner {
  position: relative; width: 100%; pointer-events: auto;
  display: flex; align-items: center; gap: 12px; padding: 12px 40px 12px 14px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r2); box-shadow: var(--shadow-3);
}
.install-badge { flex: none; width: 40px; height: 40px; border-radius: 10px; background: url('../img/app-icon.png') center / cover no-repeat; }
.update-badge { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.install-copy { flex: 1; min-width: 0; }
.install-title { font-weight: 600; font-size: 14px; }
.install-sub { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.install-sub strong { color: var(--text); font-weight: 600; }
.install-sub svg { vertical-align: -3px; }
.install-actions { flex: none; }
.install-actions .btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.install-close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; background: transparent; border: none; border-radius: 50%; color: var(--muted); cursor: pointer; }
.install-close:hover, .install-close:focus-visible { color: var(--text); background: var(--soft); }

/* ---------- phone and touch (plan 002) ----------
   Two breakpoints for phone layout rules: phone max-width 640px, tablet max-width 900px. Sizing for fingers keys off
   pointer: coarse, so a narrow desktop window keeps desktop density and a tablet gets touch sizes. */
@media (pointer: coarse) {
  /* iOS Safari zooms into a focused control under 16px and stays zoomed. The one !important outside print: every
     component that sets its own control size must lose to this, or that control brings the zoom back. */
  input:not([type=checkbox], [type=radio], [type=color], [type=range], [type=file], [type=hidden]), select, textarea {
    font-size: 16px !important;
  }
  :where(input:not([type=checkbox], [type=radio], [type=color], [type=range], [type=file], [type=hidden]), select) { min-height: 40px; }

  /* Tap targets: 40px for buttons, 36px for the small and in-table ones. */
  .btn { min-height: 40px; padding-inline: 14px; }
  .btn.small { min-height: 36px; min-width: 36px; padding: 6px 12px; font-size: 13px; }
  .field-eye { min-width: 40px; min-height: 40px; margin: -10px -10px -10px 0; } /* show password: a full tap target */
  .icon-btn, .icon-btn.fmt { width: 40px; height: 40px; min-width: 40px; }
  .seg button { min-height: 36px; padding-inline: 14px; font-size: 13px; }
  .topbar .avatar { width: 36px; height: 36px; font-size: 13px; }
  .scope-pill { min-height: 38px; padding-block: 0; }
  .scope-select select { min-height: 36px; } /* fills the pill, so the whole pill opens the list */
  .check-row { min-height: 40px; padding: 8px 14px; }
  /* A label around a checkbox or radio is the target. Only plain labels get this layout; a styled one (.client-card,
     .choice, .check-row) keeps its own and gets the height alone. */
  :where(label:has(> input[type=checkbox], > input[type=radio])) { min-height: 36px; }
  :where(label:not([class]):has(> input[type=checkbox], > input[type=radio]), label.radio) { display: inline-flex; align-items: center; gap: 8px; }
  .client-severity .radio, .resolution-categories .radio { min-height: 36px; }
  input[type=checkbox], input[type=radio] { width: 18px; height: 18px; }
  .mw-tick, .mw-tick-space { width: 36px; height: 36px; }
  .canned-option { min-height: 40px; }
  /* A link inside a line of text (an item's number, a dashboard figure, a calendar card): a 36px tap area that doesn't move
     the line, the padding taken back by the margin. */
  .mw-row a.mono, .time-entry a.mono, .wi-top a.mono, .wi a.wi-title, .cal-card-link, .cal-nodate-top a, dl.kv dd a,
  .dash-table td a:not(.chip), a.dash-card-value {
    display: inline-block; min-width: 36px; padding-block: 10px; margin-block: -10px;
  }
  .cal-card-link { display: block; }
  .cal-card .cal-move-to, .cal-bar .cal-move-to { width: 36px; height: 36px; margin: -8px; }
  .cal-add { width: 36px; height: 36px; }
  a.chip { min-height: 36px; padding-inline: 12px; }
  .dash-data summary, .dash-how summary { padding-block: 9px; }
  .help-tip { width: 36px; height: 36px; margin: -9px; } /* the "?" stays in its line; the tap area is 36px */
  .ej-job-control a { display: inline-flex; align-items: center; min-height: 36px; }
  .swatch { width: 36px; height: 36px; }
  .switch { min-height: 36px; padding: 6px 12px 6px 6px; }
  .switch::before { width: 22px; height: 22px; }
  th .sort { min-height: 36px; }
}

@media (max-width: 640px) {
  :root { --pad-screen: 16px; }
  /* Header: menu, Back, the client filter across the middle, bell, avatar. The page's h1 names the page, so the
     breadcrumb goes where the filter needs the room (clients have no filter and keep it); Help is in the drawer.
     The touch-sized buttons fit 360px with tighter gaps (each stays 36-40px). */
  .topbar { gap: 4px; }
  .topbar-actions { gap: 2px; }
  .topbar:has(.scope-bar) .breadcrumb { display: none; }
  .topbar .topbar-back { display: grid; flex: none; }
  .topbar .topbar-help { display: none; }
  .scope-bar { flex: 1; min-width: 0; margin-right: 0; }
  .scope-select { flex: 1; min-width: 0; justify-content: space-between; }
  .scope-select select { flex: 1; min-width: 0; max-width: none; }
  /* Back is in the header, so a detail page's own Back button would only repeat it. */
  .app-main:has(.topbar-back) .content .back { display: none; }
  .sidebar .nav-item.drawer-only { display: flex; margin: 0 10px 10px; }


  /* Ticket page (plan 002 D5): a summary line, More for housekeeping, the side cards folded under Details, sticky Reply. */
  .t-summary { margin: 4px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--text-2); font-size: 14px; }
  .t-summary-target { display: inline-flex; align-items: center; gap: 6px; }
  .t-actions { gap: 8px; }
  .t-more > summary { list-style: none; cursor: pointer; }
  .t-more > summary::-webkit-details-marker { display: none; }
  .t-more[open] { flex-basis: 100%; }
  .t-more[open] > summary svg { transform: rotate(180deg); }
  .t-more .t-actions-manage { margin-top: 8px; padding-left: 0; border-left: 0; }
  .side-fold > summary { display: flex; align-items: center; gap: 8px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); cursor: pointer; list-style: none; }
  .side-fold > summary::-webkit-details-marker { display: none; }
  .side-fold > summary h2 { margin: 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .side-fold > summary .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .side-fold > summary svg { margin-left: auto; flex: none; color: var(--muted); transition: transform .15s ease; }
  .side-fold:not([open]) > summary svg { transform: rotate(-90deg); }
  .side-fold[open] > summary { margin-bottom: 12px; }
  .t-reply-fab { position: fixed; right: 16px; bottom: calc(var(--bottom-nav-h) + 12px + env(safe-area-inset-bottom, 0px)); z-index: 15;
    border-radius: var(--r-pill); padding-inline: 20px; min-height: 44px; box-shadow: var(--shadow-3); }
  .content:has(.t-reply-fab) { padding-bottom: calc(var(--bottom-nav-h) + 80px); }

  /* Wide tables as cards (plan 002 §3.3): opt in with class="cards" and a data-label on each cell (its column head).
     Each row is a card of label · value lines; the row's name (td.card-title, or a row-header th) heads it, buttons
     (td.card-actions or td.actions) sit at its foot, an a.card-link in the title opens the row from anywhere on the card,
     a td.card-hide is left out, and a cell with no label (a full-width detail row) spans the card. */
  table.cards > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  table.cards, table.cards > tbody, table.cards > tfoot { display: block; }
  table.cards tr { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  table.cards :is(td, th) { display: block; position: relative; padding: 0 0 0 38%; border: 0; min-height: 20px; min-width: 0; max-width: none; font-size: 14px; }
  table.cards :is(td, th).num { text-align: left; white-space: normal; }
  table.cards td[data-label]::before { content: attr(data-label); position: absolute; left: 0; top: 1px; width: 34%; color: var(--muted); font-family: var(--font-sans); font-size: 13px; font-weight: 400; overflow-wrap: anywhere; }
  table.cards :is(td.card-title, th[scope=row]) { order: -1; position: static; padding-left: 0; font-size: 15px; font-weight: 600; color: var(--text); text-align: left; text-transform: none; letter-spacing: 0; }
  table.cards :is(td.card-actions, td.actions) { order: 99; padding: 6px 0 0; text-align: left; z-index: 1; }
  table.cards td:not([data-label]) { padding-left: 0; }
  table.cards :is(td.card-actions, td.actions):not(:has(*)), table.cards td.card-hide { display: none; } /* no buttons for this person */
  table.cards a.card-link::after { content: ""; position: absolute; inset: 0; }
  table.cards td.actions .row-actions { flex-wrap: wrap; white-space: normal; justify-content: flex-start; }
  table.cards td.actions .btn + .btn { margin-left: 0; }
  table.cards td.ej-last-run { min-width: 0; }
  table.cards > tfoot tr { border-bottom: 0; background: var(--surface-2); }

  /* Filters (plan 002 §3.5): beside a page's search, the rest fold behind "Filters (n)". */
  .filter-fold { flex-basis: 100%; }
  .filter-fold > summary { display: inline-flex; list-style: none; cursor: pointer; }
  .filter-fold > summary::-webkit-details-marker { display: none; }
  .filter-fold[open] > summary { margin-bottom: 10px; }
  .filter-fold-body { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .filter-fold-body > .seg, .filter-fold-body > .cal-people { align-self: flex-start; }
  .filters input[type=search], .list-search input[type="search"] { flex: 1 1 100%; min-width: 0; max-width: none; }
  .dash-print { display: none; }

  /* Board: a column a swipe, snapping into place; the tabs above jump to one. */
  .col-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
  .col-tabs::-webkit-scrollbar { display: none; }
  .col-tab { flex: none; }
  .board { grid-auto-columns: 85vw; scroll-snap-type: x mandatory; min-height: 0; }
  .col { scroll-snap-align: start; }

  /* Timesheet: the week arrows lose their words so the three fit one row. */
  .ts-weeks { flex-wrap: nowrap; justify-content: space-between; }
  .ts-word { display: none; }

  /* Calendar and Dashboard: nothing under 12px. */
  .cal-card-top .chip, .cal-card-link .mono, .cal-overdue, .cal-load, .cal-est, .cal-logged, .cal-bar-label .mono, .cal-bar .cal-overdue,
  .cal-mspan, .cal-mlist, .cal-mcount, .cal-mday-open, .cal-minit, .cal-nodate-top a .mono, .dash-arrow, .dash-tick { font-size: 12px; }
  .mono { font-size: max(.92em, 12px); } /* a number set in a 13px line (.92em) would fall under 12px */
  /* A grid that reads across (a chart's "Show as table") scrolls sideways instead, with a shadow at the right edge while
     there is more: the surface-coloured cover scrolls with the content and hides the shadow once the end is reached. */
  .dash-data .tbl-wrap {
    background: linear-gradient(to left, var(--surface) 40%, transparent) right center / 28px 100% no-repeat local,
                radial-gradient(farthest-side at 100% 50%, rgba(15, 22, 32, .16), transparent) right center / 14px 100% no-repeat scroll;
  }

  /* A label beside a select: the select takes the rest of the line rather than its own width. */
  .filter-field { display: flex; width: 100%; }
  .filter-field > select, .filter-label + select, .mw-filter-label + select { flex: 1 1 calc(100% - 96px); min-width: 0; }
  .filter-label, .mw-filter-label { margin-left: 0; min-width: 72px; }

  /* Nothing under 12px (avatars' initials and count badges are marks, not text). */
  .t-section h2, .side .card h2, .act-block-label, .dash-card-label { font-size: 12px; }
  th, .group-label, .policy-default, .wi-top .mono, .chip.ph { font-size: 12px; }
  th .sort .arrow { font-size: 12px; }
  .bnav-item { font-size: 12px; }
}

/* Installed on a phone: clear the status bar and the home indicator (viewport-fit=cover in index.html). */
@media (max-width: 768px) {
  .topbar { height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); }
  .dialog-foot { padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 560px) {
  .dialog { padding-top: env(safe-area-inset-top, 0px); }
}

/* ---------- Projects (UC-021): the Projects timeline, a project page and its Gantt; estate tokens (D33) ---------- */
.mw-tabs button.mw-tab { padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.mw-tabs button.mw-tab:hover { color: var(--text-2); }
.mw-tabs button.mw-tab[aria-current=page] { color: var(--text); border-bottom-color: var(--accent); }
.spacer { flex: 1 1 auto; }
.select.sm { padding: 4px 8px; font-size: 13px; height: 30px; }
.pick-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; }
.pick-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.open-items { margin: 0 0 12px; padding-left: 20px; max-height: 200px; overflow-y: auto; }
.act-note { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.project-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pj-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.project-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 12px; }
.pj-title { min-width: 0; flex: 1 1 360px; }
.pj-title h1 { margin: 4px 0 8px; }
.pj-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--text-2); font-size: 13px; margin: 0; }
.pj-figure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); padding: 10px 14px; min-width: 160px; display: flex; flex-direction: column; gap: 3px; }
.pj-figure-label { font-size: 12px; color: var(--muted); }
.pj-figure-value { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pj-figure-of { font-size: 13px; font-weight: 400; color: var(--muted); }
.pj-figure-sub { font-size: 12px; color: var(--muted); }
.pj-figure .chip { white-space: normal; align-self: flex-start; } /* "On track · 9 working days to spare" wraps in a narrow card */
.pj-health { align-self: flex-start; font-size: 13px; }
.project-actions { flex-wrap: wrap; gap: 6px; }
.pj-figures { display: flex; flex-wrap: wrap; gap: 12px; }
.breakdown-titles { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.breakdown-titles .row { gap: 6px; }
.breakdown-titles input { flex: 1 1 auto; }

/* The Projects board: the list and its timeline side by side, a row each (64 px), as in the mockup. */
.pj-summary { margin: 0; padding: 10px 14px 12px; } /* in line with the filter bar above it */
.pj-board { display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); overflow: hidden; }
.pj-list { border-right: 1px solid var(--line); min-width: 0; }
.pj-list table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pj-list thead th { height: 48px; padding: 0 12px; vertical-align: bottom; padding-bottom: 8px; text-align: left; border-bottom: 1px solid var(--line); }
.pj-list thead th:nth-child(2) { width: 96px; }
.pj-list thead th:nth-child(3) { width: 112px; }
.pj-list tbody td { height: 64px; padding: 0 12px; border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent); vertical-align: middle; }
.pj-list .card-title a { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-row-meta { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-done { display: block; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pj-done-bar { display: block; width: 72px; height: 6px; margin-top: 4px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.pj-done-bar span { display: block; height: 100%; background: var(--info); }
.pj-tl { overflow-x: auto; min-width: 0; }
.pj-tl-canvas { position: relative; }
.pj-tl-head, .pj-tl-weeks { position: relative; height: 24px; font-size: 12px; color: var(--muted); }
.pj-tl-weeks { border-bottom: 1px solid var(--line); font-size: 11px; }
.pj-tl-head span, .pj-tl-weeks span { position: absolute; top: 4px; padding-left: 6px; border-left: 1px solid var(--line); height: 20px; white-space: nowrap; overflow: hidden; }
.pj-tl-head span { font-weight: 600; color: var(--text-2); }
.pj-tl-body { position: relative; background-image: repeating-linear-gradient(to bottom, transparent 0 63px, color-mix(in oklab, var(--line) 60%, transparent) 63px 64px); }
.pj-tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); opacity: .8; z-index: 2; }
.pj-tl-bar { position: absolute; height: 20px; border-radius: 5px; box-sizing: border-box; overflow: hidden; }
.pj-tl-bar::after { content: ""; position: absolute; inset: 0; background: color-mix(in oklab, var(--surface) 55%, transparent); left: var(--done, 0%); } /* the part not done yet, faded towards the page in either theme */
.pj-tl-bar.planning { background: transparent !important; border: 2px dashed var(--line-strong); }
.pj-tl-bar.planning::after { display: none; }
.pj-tl-bar.onhold { opacity: .45; }
.pj-tl-ms { position: absolute; width: 14px; height: 14px; transform: rotate(45deg); background: var(--text-2); border: 2px solid var(--surface); box-sizing: border-box; z-index: 3; }
.pj-tl-ms.release { background: var(--honey); }
.pj-tl-tag { position: absolute; width: 84px; text-align: center; font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The Gantt: labels on the left, the scrolling chart on the right. */
.gantt-toolbar { flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.plan-message { min-height: 28px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.plan-selection { margin: 6px 0 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface-2); }
.plan-selection .row { flex-wrap: wrap; gap: 6px; align-items: center; }
.plan-selection .sub { margin: 0; }
.sel { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; }
.sel-text { display: flex; flex-direction: column; gap: 2px; min-width: 240px; flex: 1 1 320px; }
.sel-text b { font-size: 15px; }
.sel-line { font-size: 13px; color: var(--text-2); }
.sel-deps { font-size: 12px; color: var(--muted); }
.pj-below { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.pj-key-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; font-size: 13px; color: var(--text-2); }
.pj-key-list li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.key-mark { flex: none; width: 28px; height: 14px; border-radius: 4px; position: relative; }
.key-done { background: var(--line-strong); }
.key-clash { background: var(--warn-bg); box-shadow: inset 0 0 0 2px var(--warn); }
.key-epic { height: 6px; border-radius: 3px; background: var(--text-2); }
.key-release, .key-milestone { width: 12px; height: 12px; margin: 0 8px; border-radius: 2px; transform: rotate(45deg); background: var(--text-2); }
.key-release { background: var(--honey); }
.key-proj { border: 2px dashed var(--warn); background: transparent; }
.key-pinned::before { content: ""; position: absolute; left: -3px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--text); border: 1px solid var(--surface); }
.key-late::after { content: ""; position: absolute; right: -2px; top: -3px; bottom: -3px; width: 3px; border-radius: 2px; background: var(--crit); }
.key-base { height: 3px; background: var(--muted); }
.key-target { width: 0; height: 16px; margin: 0 14px; border-left: 2px dashed var(--warn); border-radius: 0; }
.key-today { background: color-mix(in oklab, var(--accent) 22%, transparent); }
.key-over { background: var(--warn-bg); }
.gantt { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
.gantt-labels { border-right: 1px solid var(--line); min-width: 0; }
.gantt-label-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 0 10px 6px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.gantt-label { display: flex; align-items: center; gap: 6px; padding: 0 10px; font-size: 13px; border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent); cursor: default; min-width: 0; }
.gantt-label.selected { background: var(--accent-soft); }
.gantt-label .gl-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-label .gl-who, .gantt-label .gl-len { color: var(--muted); font-size: 12px; white-space: nowrap; }
.gantt-label .mono { white-space: nowrap; flex: none; }
.gantt-label .gl-slip { color: var(--warn); font-size: 12px; white-space: nowrap; }
.gl-epic { background: var(--surface-2); font-weight: 600; }
/* UC-024: an epic row's number, status and "2 of 5 done"; a planner drags its label to reorder */
.gl-epic .gl-epic-name { flex: 1 1 auto; min-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-text .chip { align-self: flex-start; }
.gl-epic .gl-status { flex: none; font-weight: 500; }
.gl-epic .gl-progress { flex: none; color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
.gl-epic .gl-grip { flex: none; color: var(--muted); cursor: grab; letter-spacing: -2px; }
.gl-epic[draggable="true"] { cursor: grab; }
.gl-epic.drop-on { box-shadow: inset 0 3px 0 var(--accent); }
.gl-epic.cancelled, .gantt-epic.cancelled .gantt-epic-bar { opacity: .55; }
.gl-epic.cancelled .gl-epic-name { text-decoration: line-through; }
.gl-unscheduled, .gl-load.unassigned { color: var(--muted); font-style: italic; }
.gl-diamond { width: 10px; height: 10px; transform: rotate(45deg); background: var(--text-2); flex: none; }
.gl-diamond.release { background: var(--honey); }
.gl-load { font-size: 12.5px; }
.load-head { border-top: 1px solid var(--line); }
.gantt-scroll { overflow-x: auto; min-width: 0; }
.gantt-canvas { position: relative; }
.gantt-head { position: relative; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.gantt-months, .gantt-ticks { position: relative; height: 22px; }
.gantt-months span, .gantt-ticks span { position: absolute; top: 3px; padding-left: 4px; border-left: 1px solid var(--line); height: 19px; white-space: nowrap; overflow: hidden; }
.gantt-months span { font-weight: 600; color: var(--text-2); }
.gantt-ticks span { text-align: center; padding-left: 0; }
.gantt-ticks span.today { color: var(--accent-text); font-weight: 700; background: color-mix(in oklab, var(--accent) 35%, transparent); }
.gantt-body { position: relative; }
.gantt-shade { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--soft) 0 4px, transparent 4px 8px); }
.gantt-week-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); pointer-events: none; }
.gantt-epic-line { position: absolute; left: 0; right: 0; height: 34px; background: var(--surface-2); }
.gantt-today { position: absolute; top: 0; bottom: 0; background: color-mix(in oklab, var(--accent) 14%, transparent); pointer-events: none; }
.gantt-target { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--warn); z-index: 2; pointer-events: none; }
.gantt-target-tag { position: absolute; top: 4px; font-size: 11px; font-weight: 600; color: var(--warn); z-index: 2; pointer-events: none; }
.gantt-bar-text { display: block; padding: 0 6px; font-size: 11px; font-weight: 600; line-height: 20px; color: #fff; white-space: nowrap; overflow: hidden; pointer-events: none; }
.gantt-ms-tag { position: absolute; font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap; pointer-events: none; z-index: 3; background: var(--surface); padding: 0 4px; border-radius: 3px; }
.gantt-bar.clash { background: var(--warn-bg) !important; box-shadow: inset 0 0 0 2px var(--warn); }
.gantt-bar.clash .gantt-bar-text { color: var(--warn); }
.gantt-arrows { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: visible; }
.gantt-arrows path { fill: none; stroke: var(--text-2); stroke-width: 1.4; }
.gantt-arrows path.clash { stroke: var(--warn); stroke-width: 2; }
.gantt-arrows #ga-head path { fill: var(--text-2); stroke: none; }
.gantt-arrows #ga-head-clash path { fill: var(--warn); stroke: none; }
.gantt-node { position: absolute; z-index: 3; }
.gantt-node:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gantt-epic { height: 34px; background: transparent; }
.gantt-group { position: absolute; height: 34px; } /* UC-024: the Milestones group heading, not a node */
.gantt-epic-bar { position: absolute; top: 14px; height: 6px; border-radius: 3px; background: var(--text-2); }
.gantt-bar { height: 20px; border-radius: 5px; box-shadow: 0 1px 0 rgba(0, 0, 0, .12); cursor: default; }
.gantt-bar.selected, .gantt-diamond.selected, .gantt-undated.selected, .gantt-epic.selected .gantt-epic-bar { box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 45%, transparent); }
.gantt-bar.finished { background: var(--line-strong) !important; }
.gantt-bar.finished .gantt-bar-text { color: var(--text-2); }
.gantt-bar.archived { background: var(--line-strong) !important; opacity: .5; }
.gantt-bar.overdue { outline: 2px solid var(--crit); outline-offset: 1px; }
/* UC-025 story 8: a pin (dot at the start) and Late (red tick at the finish). */
.gantt-pin { position: absolute; left: -3px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--text); border: 1px solid var(--surface); pointer-events: none; }
.gantt-late { position: absolute; right: -2px; top: -3px; bottom: -3px; width: 3px; border-radius: 2px; background: var(--crit); pointer-events: none; }
.gantt-undated-why { font-weight: 400; }
.plan-scheduler { margin: 4px 0 0; font-size: 13px; }
.w-plan .w-plan-pins { margin: 6px 0; padding-left: 18px; }
.w-plan p { margin: 4px 0; }
.w-plan .w-planning { margin-top: 6px; }
.planning-dialog .pd-mode { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0 0 10px; }
.planning-dialog .pd-indent { margin-left: 24px; }
.planning-dialog .pd-fixed { gap: 10px; flex-wrap: wrap; }
.cal-load.cal-away { color: var(--text-2); font-style: italic; }
.gantt-projected { position: absolute; height: 22px; border: 2px dashed var(--warn); border-radius: 5px; z-index: 2; pointer-events: none; }
.gantt-baseline { position: absolute; height: 3px; border-radius: 2px; background: var(--muted); opacity: .6; z-index: 2; }
.gantt-diamond { width: 16px; height: 16px; transform: rotate(45deg); background: var(--text-2); border-radius: 2px; }
.gantt-diamond.release { background: var(--honey); }
.gantt-diamond.projected { position: absolute; background: transparent; border: 2px dashed var(--warn); z-index: 2; }
.gantt-unscheduled { position: absolute; left: 0; right: 0; height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 8px; z-index: 3; }
.gantt-unscheduled .gantt-node { position: static; }
.gantt-bar.movable, .gantt-diamond.movable { cursor: grab; touch-action: none; }
.gantt-body { user-select: none; -webkit-user-select: none; }
.gantt.dragging, .gantt.dragging .gantt-bar.movable { cursor: grabbing; user-select: none; }
.gantt-bar.previewed, .gantt-diamond.previewed { outline: 2px dashed var(--accent-ink); outline-offset: 2px; }
.gantt-handle { position: absolute; top: -2px; width: 24px; height: 24px; cursor: ew-resize; touch-action: none; }
.gantt-handle.start { left: -12px; }
.gantt-handle.end { right: -12px; }
.gantt-handle::after { content: ""; position: absolute; top: 6px; left: 10px; width: 4px; height: 12px; border-radius: 2px; background: rgba(255, 255, 255, .8); opacity: 0; }
.gantt-bar:hover .gantt-handle::after, .gantt-bar:focus-visible .gantt-handle::after { opacity: 1; }
.gantt-link { position: absolute; width: 24px; height: 24px; border-radius: 50%; z-index: 4; cursor: crosshair; touch-action: none; opacity: 0; }
.gantt-link::after { content: ""; position: absolute; top: 7px; left: 7px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--text-2); background: var(--surface); }
.gantt-body:hover .gantt-link, .gantt.dragging .gantt-link { opacity: 1; }
.gantt-arrows path.linking { stroke: var(--accent-ink); stroke-dasharray: 4 3; stroke-width: 2; }
.project-chip { gap: 4px; text-decoration: none; color: var(--text-2); }
.project-chip .pj-dot { width: 8px; height: 8px; margin-right: 0; }
a.project-chip:hover { text-decoration: underline; }
/* UC-024: epics */
.epic-chip { gap: 4px; text-decoration: none; color: var(--text-2); }
.epic-chip .epic-mark { width: 6px; height: 6px; background: var(--accent-ink); transform: rotate(45deg); flex: none; }
.epic-chip.hidden { font-style: italic; }
a.epic-chip:hover { text-decoration: underline; }
.epic-filters select { min-height: 36px; }
.epic-description { margin: 0 0 12px; white-space: pre-line; color: var(--text-2); max-width: 70ch; }
.epic-item-table tr.archived td { color: var(--muted); }
.epic-item-table tr.stub td { color: var(--muted); }
.epic-item-table .chip { margin-left: 6px; }
.epic-pick { border: 0; margin: 8px 0 12px; padding: 0; display: grid; gap: 6px; max-height: 280px; overflow-y: auto; }
.epic-dependency-warning .row { gap: 8px; margin-top: 8px; }
.eb-item { gap: 6px; margin-bottom: 6px; }
.eb-item input { flex: 1 1 auto; min-width: 0; }
.ticket-epic { margin: 8px 0 0; }
.w-epic { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cal-lock { display: inline-flex; align-items: center; color: var(--muted); }
.w-planned, .ew-planned { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.load-strip { position: relative; border-top: 1px solid var(--line); }
.load-row { position: relative; border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent); }
.load-cell { position: absolute; top: 0; bottom: 0; font-size: 11px; line-height: 28px; text-align: center; border-left: 1px solid color-mix(in oklab, var(--line) 60%, transparent); }
.load-cell.light { background: color-mix(in oklab, var(--info) 10%, transparent); color: var(--text-2); }
.load-cell.full { background: color-mix(in oklab, var(--info) 24%, transparent); color: var(--text); }
.load-cell.over { background: var(--warn-bg); color: var(--warn); font-weight: 700; }
.gl-load-note { font-size: 12px; color: var(--muted); white-space: nowrap; }
.gl-load-note.over { color: var(--warn); font-weight: 600; }

@media (max-width: 900px) {
  .pj-board { grid-template-columns: minmax(0, 1fr); }
  .pj-list { border-right: 0; }
  .pj-tl { display: none; } /* the list's cards carry everything on a narrow screen */
}
@media (max-width: 640px) {
  .pj-figure { flex: 1 1 140px; min-width: 0; }
  .pj-list .card-title a { display: inline-flex; align-items: center; min-height: 40px; }
  .pj-list .card-title a { display: flex; gap: 6px; } /* a flex link drops the space between number and name */
  /* the desktop row's fixed height and padding would beat the phone card's (table.cards): put the card's back */
  .pj-list tbody td { height: auto; padding: 0 0 0 38%; border-bottom: 0; }
  .pj-list tbody td.card-title { padding-left: 0; }
  .gantt-target-tag, .gantt-bar-text, .gantt-ms-tag, .gl-load-note { font-size: 12px; }
  .pj-key-list { grid-template-columns: minmax(0, 1fr); }
  .gantt { grid-template-columns: 120px minmax(0, 1fr); }
  .gantt-label .gl-who, .gantt-label .gl-len, .gantt-label .gl-slip { display: none; }
  .load-cell { font-size: 12px; }
}

/* UC-025 story 9: Desk setup → Scheduler */
.sched-card .sched-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 12px; }
.sched-card .sched-planned { margin-left: auto; }
.sched-card .sched-actions { gap: 8px; margin-bottom: 12px; }
.sched-card .sched-confirm .row { gap: 8px; margin-top: 8px; }
.sched-card .sched-preview-table { border-collapse: collapse; margin: 4px 0 12px; min-width: min(100%, 360px); }
.sched-card .sched-preview-table caption { text-align: left; font-weight: 600; padding-bottom: 6px; }
.sched-card .sched-preview-table th { text-align: left; font-weight: 400; padding: 4px 16px 4px 0; border-bottom: 1px solid var(--line);
    text-transform: none; letter-spacing: normal; font-size: inherit; color: inherit; }
.sched-card .sched-preview-table td { text-align: right; padding: 4px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.sched-card .sched-reserve { gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.sched-card .sched-reserve input { width: 80px; }

/* UC-027: feature requests */
/* Plan 009: Feature requests' stage cards with counts, and the List / Board views */
.fr-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.fr-title h1 { margin: 0; }
.fr-total { padding: 2px 10px; border-radius: var(--r-pill); background: var(--soft); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.fr-views button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 12px; font-size: 13px; }
.list-search.fr-filters { padding: 0; border-bottom: 0; margin-bottom: 16px; }
.fr-show-declined { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.fr-awaiting { --fr-tone: var(--accent); }
.fr-review { --fr-tone: var(--info); }
.fr-planned { --fr-tone: var(--pal-purple); }
.fr-shipped { --fr-tone: var(--ok); }
.fr-declined { --fr-tone: var(--muted-2); }
.fr-dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--fr-tone); flex: none; }
.fr-stages { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.fr-flow { flex: 4 1 600px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fr-ended { flex: 1 1 160px; display: grid; padding-left: 12px; border-left: 1px dashed var(--line-strong); }
.fr-stage { position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px 16px; min-height: 104px; border: 1px solid var(--line);
    border-radius: var(--r3); background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); cursor: pointer; font: inherit; }
.fr-stage:hover { border-color: var(--line-strong); }
.fr-stage[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-2); background: color-mix(in oklab, var(--accent) 7%, var(--surface)); }
.fr-stage:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.fr-flow .fr-stage:not(:last-child)::after { content: ""; position: absolute; right: -11px; top: 50%; width: 7px; height: 7px; border-top: 2px solid var(--muted-2);
    border-right: 2px solid var(--muted-2); transform: translateY(-50%) rotate(45deg); } /* the way a request goes */
.fr-stage-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.fr-stage-count { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fr-stage-sub { font-size: 12.5px; color: var(--muted); }
.fr-list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.fr-list-head h2 { margin: 0; font-size: 15px; }
.fr-list-count { color: var(--muted); font-weight: 500; }
.fr-list-order { font-size: 12.5px; color: var(--muted); }
.fr-work { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.fr-bar { display: inline-block; width: 64px; height: 6px; border-radius: var(--r-pill); background: var(--soft); overflow: hidden; }
.fr-bar > span { display: block; height: 100%; background: var(--ok); }
.fr-board-wrap { overflow-x: auto; padding-bottom: 4px; }
.fr-board { display: grid; grid-template-columns: repeat(var(--fr-cols, 4), minmax(210px, 1fr)); gap: 14px; align-items: start; }
.fr-col { background: var(--soft); border: 1px solid var(--line); border-radius: var(--r3); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fr-col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 0; }
.fr-col-head h2 { margin: 0; font-size: 14px; }
.fr-col-count { margin-left: auto; min-width: 26px; height: 24px; padding: 0 8px; box-sizing: border-box; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-strong);
    font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.fr-col-sub { margin: 0 4px; font-size: 12.5px; color: var(--muted); }
.fr-col-empty { margin: 4px; }
.fr-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fr-card { display: flex; flex-direction: column; gap: 6px; padding: 11px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); color: var(--text);
    text-decoration: none; box-shadow: var(--shadow-1); }
.fr-card:hover { border-color: var(--line-strong); }
.fr-card-top { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.fr-card-clients { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--text); }
.fr-card-subj { font-size: 13.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.fr-card .chip { align-self: flex-start; }
.fr-card .fr-work { display: flex; }
.fr-card .fr-bar { flex: 1; width: auto; }
.fr-card-meta { font-size: 12px; color: var(--muted); }
.fr-show-all { align-self: flex-start; }
/* Tablets: the five cards wrap as a grid, without the arrows. */
@media (max-width: 900px) {
    .fr-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .fr-flow, .fr-ended { display: contents; }
    .fr-flow .fr-stage:not(:last-child)::after { display: none; }
}
/* Phones (plan 009 F5): the stages as a row of chips with their counts. */
@media (max-width: 640px) {
    .fr-stages { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; margin-bottom: 12px; padding-bottom: 4px; }
    .fr-flow, .fr-ended { display: contents; }
    .fr-stage { flex: none; flex-direction: row; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px 0 14px; border-radius: var(--r-pill); box-shadow: none; }
    .fr-flow .fr-stage:not(:last-child)::after { display: none; }
    .fr-stage-name { white-space: nowrap; color: inherit; font-size: 13.5px; }
    .fr-stage-name .fr-dot, .fr-stage-sub { display: none; }
    .fr-stage-count { min-width: 24px; height: 24px; padding: 0 7px; box-sizing: border-box; border-radius: var(--r-pill); background: var(--soft); color: var(--text-2);
        font-size: 12px; display: inline-flex; align-items: center; justify-content: center; letter-spacing: 0; }
    .fr-stage[aria-pressed="true"] { background: var(--text); color: var(--surface); border-color: var(--text); box-shadow: none; }
    .fr-stage[aria-pressed="true"] .fr-stage-count { background: var(--accent); color: var(--accent-text); }
}
.feature-demand { margin: 4px 0; font-weight: 600; }
.feature-actions { margin-bottom: 8px; }
.dash-stages { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0; }
.dash-stages a { display: inline-flex; align-items: center; min-height: 36px; }

/* Ticket lists as cards up to tablet width (2026-11-09: at 641–900px the nine-column table squeezed the subject to a few letters a line). */
@media (max-width: 900px) {
  /* Ticket lists (plan 002 D6): each row a card like the client's My tickets. Number and chips, the subject, then
     client · assignee · type · age; the number's link covers the card, Triage's buttons sit above it at the foot. */
  .sort-phone { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .sort-phone label { font-size: 13px; font-weight: 500; color: var(--text-2); }
  .sort-phone select { flex: 1; min-width: 0; }
  .ticket-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .ticket-table, .ticket-table tbody { display: block; }
  .ticket-table tr { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .ticket-table td { display: block; padding: 0; border: 0; background: none; font-size: 13px; color: var(--muted); }
  .ticket-table td[data-col=number] { order: 1; font-size: 13px; }
  .ticket-table td[data-col=number] a { color: var(--text); font-weight: 600; text-decoration: none; }
  .ticket-table td[data-col=number] a::after { content: ""; position: absolute; inset: 0; }
  .ticket-table td[data-col=status] { order: 2; }
  .ticket-table td[data-col=priority] { order: 3; }
  .ticket-table td[data-col=due] { order: 4; }
  .ticket-table td[data-col=due] .due-line > span:not(.chip), .ticket-table td[data-col=due] > .sub { display: none; }
  .ticket-table td[data-col=subject] { order: 5; flex-basis: 100%; color: var(--text); }
  .ticket-table td[data-col=subject] .subj { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ticket-table td[data-col=tenant] { order: 6; }
  .ticket-table td[data-col=assignee], .ticket-table td[data-col=reporter] { order: 7; }
  .ticket-table td[data-col=type] { order: 8; }
  .ticket-table td[data-col=logged] { order: 9; }
  .ticket-table td:is([data-col=tenant], [data-col=assignee], [data-col=reporter], [data-col=type], [data-col=logged]) { margin-right: 6px; }
  .ticket-table td.actions { order: 10; flex-basis: 100%; position: relative; z-index: 1; padding-top: 4px; }
  .ticket-table td.actions .row { justify-content: flex-start !important; }
  .ticket-table tr.urgent { background: color-mix(in srgb, var(--crit-bg) 55%, transparent); box-shadow: inset 3px 0 0 var(--crit); }
  .ticket-table tr.urgent td, .ticket-table tr.urgent td:first-child { background: none; box-shadow: none; }
}

/* The reply box on a phone (2026-11-09): the toolbar wrapped wherever it ran out of room, and the second Send via box sat out of line. */
@media (max-width: 640px) {
  .composer-bar .seg { order: 0; }
  .composer-bar .canned-btn { order: 1; margin-left: auto; } /* Write / Preview and Canned response on the first row */
  .composer-bar .fmt { order: 2; }                           /* the five formatting buttons together on the second */
  .composer-bar .seg + .fmt, .composer-bar .canned-btn + .fmt { margin-left: 0; }
  .composer-bar::after { content: ""; order: 1; flex-basis: 100%; height: 0; } /* the break between the rows */
  .reply-channels { flex-direction: column; align-items: flex-start; gap: 6px; }
  .reply-channels legend { float: none; margin: 0 0 2px; }
}

/* A tablet's header links are tap targets (2026-11-09: 22px tall). Phones hide them: the header has Back instead. */
@media (pointer: coarse) and (min-width: 641px) {
  .breadcrumb a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 4px; margin: 0 -4px; }
}

/* ---------- Clickable list rows (owner, 2026-11-09) ----------
   A row whose title holds an a.card-link opens that item from anywhere on the row, on every screen (phones already did it
   as cards): the link stretches over the row, the row tints and shows a pointer on hover or keyboard focus, and td.row-go
   ends it with a chevron, as the Boards cards. Buttons, other links and fields in the row sit above the stretched link. */
table tbody tr:has(a.card-link) { position: relative; cursor: pointer; }
table tbody tr a.card-link { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
table tbody tr a.card-link .mono { color: inherit; font-weight: 500; }
table tbody tr a.card-link .subj { color: inherit; } /* Feature requests: the subject is part of the link */
table tbody tr a.card-link::after { content: ""; position: absolute; inset: 0; }
table tbody tr:has(a.card-link) :is(button, a:not(.card-link), input, select, textarea, label, summary, details) { position: relative; z-index: 1; }
table tbody tr:has(a.card-link):is(:hover, :focus-within) > td { background-color: color-mix(in oklab, var(--accent) 7%, var(--surface)); }
table tbody tr:has(a.card-link):hover a.card-link, table tbody tr a.card-link:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
table tbody tr a.card-link:focus-visible { outline: none; } /* the row's tint and underline show focus */
td.row-go, th.row-go { width: 28px; padding-left: 0; padding-right: 10px; text-align: right; color: var(--muted-2); }
table tbody tr:has(a.card-link):is(:hover, :focus-within) td.row-go { color: var(--accent-ink); }
/* The ticket lists: the number is the link; the subject reads as part of it. */
.ticket-table tbody tr:has(a.card-link) .subj { color: var(--accent-ink); }
.ticket-table tbody tr:has(a.card-link):hover .subj { text-decoration: underline; text-underline-offset: 3px; }
/* Installations open no page of their own: the version is a plain link to its release, in the link colour. */
table.installations td a { color: var(--accent-ink); font-weight: 500; }
/* As cards the whole card opens it: no chevron (ticket lists up to 900px, the other lists up to 640px). */
@media (max-width: 900px) { .ticket-table :is(td, th).row-go { display: none; } }
@media (max-width: 640px) { table.cards :is(td, th).row-go { display: none; } }

/* ============================================================
   My work Overview (UC-028): the estate widget engine (blackbee-dashboard-widgets, from W8File's dashboard CSS, PART 2), with
   every class renamed dash- → wd- (the manager Dashboard owns dash-) and the chart rules left out (the load bars are plain HTML).
   12 columns, 40 px rows, 12 px gap: keep in step with DashboardCatalog and w8hive_dashboardDrag. No scroll bars inside a widget:
   lists show what fits. Tokens only.
   ============================================================ */
:root { --wd-accent-strong: var(--accent-ink); } /* W8File leaves its link colour undeclared; W8Hive's links use the accent ink */
.wd-head { align-items: center; margin-bottom: 12px; }
.wd-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.wd-status { font-size: 12.5px; color: var(--muted); }
.wd-customise { display: inline-flex; align-items: center; gap: 6px; }
.wd-edit-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: var(--r3); background: var(--accent-soft); }
.wd-edit-main { flex: 1 1 380px; min-width: 0; }
.wd-edit-guide { font-weight: 600; font-size: 13.5px; }
.wd-edit-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.wd-edit-add-label { font-size: 12.5px; color: var(--text-2); }
.wd-add-chip { font: inherit; font-size: 12.5px; padding: 3px 10px; border: 1px dashed var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--text-2); cursor: pointer; white-space: nowrap; }
.wd-add-chip:hover { border-color: var(--accent); color: var(--wd-accent-strong); }
.wd-edit-actions { display: flex; align-items: center; gap: 8px; }
.wd-link { background: none; border: none; padding: 0; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--wd-accent-strong); cursor: pointer; white-space: nowrap; text-decoration: none; }
.wd-link:hover { text-decoration: underline; }
.wd-board { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 40px; grid-auto-flow: dense; gap: 12px; position: relative; }
.wd-board-empty { grid-column: 1 / -1; grid-row: span 3; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); color: var(--muted); }
.wd-widget { position: relative; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
.wd-widget.editing { border-style: dashed; border-color: var(--line-strong); cursor: grab; }
.wd-widget.editing:hover { border-color: var(--accent); }
.wd-widget.dragging { opacity: 0.45; }
.wd-widget.drop-target { outline: 2px solid var(--accent); outline-offset: 1px; }
.wd-widget-inner { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 11px 14px; }
.wd-widget.editing .wd-widget-inner { pointer-events: none; user-select: none; }
.wd-widget-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 24px; margin-bottom: 6px; }
.wd-widget-title { margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-widget-body { flex: 1; min-height: 0; overflow: hidden; }
.wd-empty { display: flex; align-items: center; justify-content: center; height: 100%; padding: 0 12px; border-top: 1px solid var(--line); text-align: center; font-size: 13px; color: var(--muted); }
.wd-empty--plain { border-top: none; }
.wd-error { flex: none; padding-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wd-tools { position: absolute; top: 5px; right: 5px; z-index: 6; display: flex; align-items: center; gap: 1px; padding: 1px; border: 1px solid var(--line-strong); border-radius: var(--r1); background: var(--surface); box-shadow: var(--shadow-2); }
.wd-tool { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: var(--r1); background: transparent; color: var(--text-2); font: inherit; font-size: 14px; line-height: 1; cursor: pointer; }
.wd-tool:hover:not(:disabled) { background: var(--accent-soft); color: var(--wd-accent-strong); }
.wd-tool:disabled { opacity: 0.3; cursor: default; }
.wd-tool--remove:hover:not(:disabled) { background: var(--crit-bg); color: var(--crit); }
.wd-row { position: relative; display: flex; align-items: center; gap: 8px; min-height: 44px; border-top: 1px solid var(--line); }
.wd-row:hover { background: var(--surface-2); }
.wd-row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 5px 2px; border: none; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.wd-row-main:hover .wd-row-name { color: var(--wd-accent-strong); }
.wd-row-text { min-width: 0; display: flex; flex-direction: column; }
.wd-row-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-row-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-icon-btn { flex: none; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: var(--r1); background: transparent; color: var(--muted); cursor: pointer; }
.wd-icon-btn:hover:not(:disabled) { background: var(--accent-soft); color: var(--wd-accent-strong); }
.wd-text-btn { padding: 5px 6px; border: none; border-radius: var(--r1); background: transparent; font: inherit; font-size: 12px; font-weight: 500; color: var(--wd-accent-strong); cursor: pointer; white-space: nowrap; }
.wd-text-btn:hover:not(:disabled) { background: var(--accent-soft); }
.wd-pill { flex: none; display: inline-flex; align-items: center; padding: 1px 8px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.wd-pill--soft { background: var(--soft); color: var(--text-2); }
.wd-pill--warn { background: var(--warn-bg); color: color-mix(in oklab, var(--warn) var(--tone-ink), var(--tone-mix)); }
.wd-pill--crit { background: var(--crit-bg); color: color-mix(in oklab, var(--crit) var(--tone-ink), var(--tone-mix)); }
.wd-pill--info { background: var(--info-bg); color: color-mix(in oklab, var(--info) var(--tone-ink), var(--tone-mix)); }
.wd-ends { flex: none; width: 92px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.wd-track { display: block; width: 100%; height: 4px; overflow: hidden; border-radius: var(--r-pill); background: var(--soft); }
.wd-fill { display: block; height: 100%; border-radius: var(--r-pill); }
.wd-fill--soft { background: var(--accent); }
.wd-fill--ok { background: var(--ok); }
.wd-fill--crit { background: var(--crit); }
@media (max-width: 760px) { .wd-widget { grid-column: 1 / -1 !important; } }
.wd-widget-intro { flex: none; margin: 0 0 4px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-tile { display: flex; flex-direction: column; height: 100%; min-height: 0; gap: 4px; }
.wd-tile-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.wd-tile-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.wd-tile-value { font-size: 20px; font-weight: 600; line-height: 1.25; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wd-tile-sub { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-feed-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line); }
.wd-feed-kind { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r1); background: var(--soft); color: var(--text-2); }
.wd-feed-text { min-width: 0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; color: inherit; }
@media (max-width: 768px) { .wd-head { align-items: stretch; } .wd-head-actions { justify-content: space-between; } }
.wd-resize { position: absolute; right: 0; bottom: 0; z-index: 6; width: 26px; height: 26px; padding: 0; border: none; background: transparent; cursor: nwse-resize; touch-action: none; }
.wd-resize::after { content: ""; position: absolute; right: 6px; bottom: 6px; width: 11px; height: 11px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); border-bottom-right-radius: 3px; }
.wd-resize:hover::after, .wd-resize:focus-visible::after { border-color: var(--accent); }
.wd-resize:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r1); }
.wd-resize-ghost { position: absolute; z-index: 8; border: 2px solid var(--accent); border-radius: var(--r2); background: color-mix(in oklab, var(--accent) 12%, transparent); pointer-events: none; }
.wd-ghost-tag { position: absolute; right: 6px; bottom: 6px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-text); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .wd-resize { width: 44px; height: 44px; cursor: ns-resize; }
  .wd-resize::after { right: 10px; bottom: 10px; width: 14px; height: 14px; }
}
@media (min-width: 769px) { .wd-head { align-items: flex-end; margin-bottom: 16px; } }
.wd-head-actions { flex-wrap: nowrap; align-items: stretch; }
.wd-head-actions .wd-status { align-self: center; }
/* A list row that does not fit whole wraps into a column nobody sees, so no row is ever cut by the bottom of its widget. */
.wd-widget-body:has(> .wd-row), .wd-widget-body:has(> .wd-feed-row), .wd-list { display: flex; flex-flow: column wrap; align-content: flex-start; }
.wd-widget-body > .wd-row, .wd-widget-body > .wd-feed-row, .wd-list > .wd-row, .wd-list > .wd-feed-row { width: 100%; flex: none; }
/* W8Hive additions (tokens only): figures above a list (small and large views), and a large view's figures + list column. */
.wd-stats { flex: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 6px; }
.wd-stat { display: flex; flex-direction: column; }
.wd-stat b { font-size: 20px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.wd-stat span { font-size: 12px; color: var(--muted); }
.wd-stat.crit b { color: var(--crit); }
.wd-stat.warn b { color: color-mix(in oklab, var(--warn) var(--tone-ink), var(--tone-mix)); }
.wd-col { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.wd-col > .wd-list { flex: 1; min-height: 0; overflow: hidden; }
/* UC-028 widgets: the row tick, ▶, the date at a row's end, a one-line result. */
.wd-tick { flex: none; margin-left: 2px; }
.wd-tick-space { flex: none; width: 22px; } /* rows line up when only some can be ticked (as By date's .mw-tick-space) */
.wd-when { flex: none; font-size: 12px; white-space: nowrap; color: var(--muted); padding-right: 2px; font-variant-numeric: tabular-nums; }
.wd-when.crit { color: var(--crit); font-weight: 500; }
.wd-day { width: 44px; }
.wd-note { flex: none; font-size: 12px; color: color-mix(in oklab, var(--ok) var(--tone-ink), var(--tone-mix)); margin: -2px 0 4px; }
/* UC-028 My week's time: the week's columns and the timer strip. */
.wd-time-head { flex: none; }
.wd-time-bar { flex: none; margin: 4px 0 6px; }
.wd-week { flex: 1 1 auto; min-height: 44px; max-height: 110px; display: flex; gap: 6px; margin-bottom: 6px; }
.wd-day { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); text-align: center; }
.wd-day-col { flex: 1; min-height: 20px; background: var(--soft); border-radius: 4px; position: relative; overflow: hidden; }
.wd-day-col i { position: absolute; inset: auto 0 0 0; background: var(--accent); }
.wd-day-col i.full { background: color-mix(in oklab, var(--ok) 75%, var(--surface)); }
.wd-day.today { color: var(--text); font-weight: 600; }
.wd-day.short .wd-day-col { outline: 1.5px dashed color-mix(in oklab, var(--warn) 70%, transparent); outline-offset: -1.5px; }
.wd-timer { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r1); background: var(--soft); font-size: 12px; min-width: 0; }
.wd-timer.on { background: var(--accent-soft); }
.wd-timer-what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; color: inherit; }
.wd-timer-clock { flex: none; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
/* UC-028 My load: one bar per working day against the plannable day (the Calendar's own load). */
.wd-bars { flex: 1; min-height: 60px; display: flex; gap: 4px; align-items: stretch; }
.wd-bar { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wd-bar-col { flex: 1; position: relative; background: var(--soft); border-radius: 4px; overflow: hidden; }
.wd-bar-col i { position: absolute; inset: auto 0 0 0; background: var(--accent); border-radius: 4px 4px 0 0; }
.wd-bar.over .wd-bar-col i { background: var(--warn); }
.wd-bar.away .wd-bar-col i { background: repeating-linear-gradient(45deg, var(--line-strong) 0 2px, transparent 2px 6px); }
.wd-bar-limit { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed var(--muted); }
.wd-bar-day { font-size: 10.5px; line-height: 1.2; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.wd-bar.today .wd-bar-day { color: var(--text); font-weight: 600; }
.wd-legend { flex: none; display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 11.5px; color: var(--text-2); }
.wd-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; background: var(--accent); }
.wd-legend i.over { background: var(--warn); }
.wd-legend i.away { background: repeating-linear-gradient(45deg, var(--line-strong) 0 2px, transparent 2px 5px); }
.wd-legend i.limit { height: 0; width: 12px; border-top: 1.5px dashed var(--muted); background: none; border-radius: 0; vertical-align: 3px; }
.wd-feed-row.gone .wd-feed-text { color: var(--muted); }
