/* ═══════════════════════════════════════════════════════════════════════════
   Weektally — shell and shared components
   ═══════════════════════════════════════════════════════════════════════════
   Colour, type and spacing come from tokens.css. Nothing here hardcodes a
   colour: swapping identity must be a token change, never a CSS rewrite.

   Responsive is structural, not bolted on. There is exactly ONE
   implementation of every surface — a separate mobile timesheet drifts
   from the desktop one, and avoiding that duplication is a core goal.
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { margin: 0; font-weight: var(--fw-heavy); letter-spacing: -.015em; line-height: var(--lh-tight); }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
/* Fields take the theme's surface rather than the browser's own white
   (review UX-1). :where() keeps this at zero specificity, so every
   component that styles its own field — the transparent hour cells, the
   picker search — still wins. */
:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"]), select, textarea) {
  background-color: var(--surface);
}
[hidden] { display: none !important; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
/* The router focuses <main> after every route so screen readers land on the
   new view. Browsers treat that programmatic focus as keyboard focus when
   nothing has been clicked yet, so the whole content column lit up with the
   focus ring on first load (Peter, 2026-11-12). The region needs no ring:
   it is not a control. */
#main:focus-visible { box-shadow: none; }

/* A small ⓘ beside a heading whose "how this works" paragraph moved into its
   title attribute (Peter, 2026-11-12: the paragraphs were clutter). */
.info-tip { font-size: var(--fs-sm); font-weight: 400; color: var(--dim); cursor: help; }

.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;
}

/* Skip link — first tab stop, invisible until focused. */
.skip-link {
  position: absolute; left: var(--sp-3); top: -60px; z-index: 100;
  background: var(--surface); color: var(--accent); padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md); font-weight: var(--fw-bold); box-shadow: var(--elev-3);
  transition: top .15s;
}
.skip-link:focus { top: var(--sp-3); }

/* ── App frame ────────────────────────────────────────────────────────────*/
.app { display: flex; flex-direction: column; min-height: 100dvh; }

.topbar {
  display: flex; align-items: center; gap: var(--sp-3);
  height: var(--topbar-h); flex: 0 0 auto;
  padding: 0 var(--sp-4);
  background: var(--topbar); color: var(--on-topbar);
}
.topbar__spacer { flex: 1; }

.brand { display: flex; align-items: center; gap: var(--sp-2); text-decoration: none; color: inherit; }
.brand__mark { width: 31px; height: 26px; flex: 0 0 auto; }
.brand__name { font-size: var(--fs-brand); font-weight: var(--fw-heavy); letter-spacing: -.02em; }
.brand__name .lite { font-weight: var(--fw-medium); opacity: .72; }


/* Company name (backlog #79). Quiet text on the dark bar: it answers
   "where am I", it is not a control. */
.company {
  font-size: var(--fs-sm); font-weight: var(--fw-bold);
  color: var(--on-topbar); opacity: .78;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  max-width: 28ch; padding-right: var(--sp-3);
  border-right: 1px solid rgba(255,255,255,.22);
}
.rail__company { display: none; }
.menu__company { font-weight: var(--fw-semi); padding: 0 var(--sp-3); margin-top: var(--sp-1); }

/* Hamburger — only below the rail breakpoint */
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  color: inherit; padding: var(--sp-2); margin-left: calc(var(--sp-2) * -1);
  border-radius: var(--r-md); line-height: 0;
}
.nav-toggle:hover { background: rgba(255,255,255,.1); }

/* ── Account menu ─────────────────────────────────────────────────────────*/
.account { position: relative; }
.account__btn {
  display: flex; align-items: center; gap: var(--sp-2);
  background: none; border: 0; cursor: pointer; color: var(--on-topbar);
  padding: var(--sp-1) var(--sp-2); border-radius: var(--r-md);
  font-size: var(--fs-md); font-weight: var(--fw-semi);
}
.account__btn:hover { background: rgba(255,255,255,.1); }
.avatar {
  width: 31px; height: 31px; border-radius: var(--r-pill); flex: 0 0 auto;
  display: grid; place-items: center;
  background: rgba(255,255,255,.16); color: var(--on-topbar);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .02em;
}
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 216px; padding: var(--sp-2);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--elev-3);
}
.menu__label {
  padding: var(--sp-2) var(--sp-3) var(--sp-1);
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
  letter-spacing: .07em; text-transform: uppercase; color: var(--dim);
}
.menu__item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md);
  font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--ink);
}
.menu__item:hover { background: var(--sunken); }
.menu__item[aria-checked="true"]::after { content: "✓"; color: var(--accent); font-weight: var(--fw-bold); }
.menu__sep { height: 1px; background: var(--line); margin: var(--sp-2) var(--sp-1); }
.menu__meta { padding: var(--sp-1) var(--sp-3) var(--sp-2); font-size: var(--fs-sm); color: var(--dim); }

/* ── Body: rail + content ─────────────────────────────────────────────────*/
.body { display: flex; flex: 1; min-height: 0; }

.rail {
  flex: 0 0 var(--rail-w); width: var(--rail-w);
  background: var(--surface); border-right: 1px solid var(--line);
  padding: var(--sp-3) var(--sp-3) var(--sp-6);
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.rail__link {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px var(--sp-3); border-radius: var(--r-md);
  font-size: var(--fs-nav); font-weight: var(--fw-bold);
  color: var(--ink-2); text-decoration: none;
}
.rail__link:hover { background: var(--sunken); color: var(--ink); }
.rail__link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
/* Quiet line icons (js/components/icons.js): a step dimmer than the label at
   rest, the label's colour on hover, teal only on the current page. */
.rail__icon { flex: 0 0 22px; width: 22px; height: 22px; color: var(--dim); }
.rail__link:hover .rail__icon { color: var(--ink-2); }
.rail__link[aria-current="page"] .rail__icon { color: var(--accent); }

/* ── Rail icon motion ──────────────────────────────────────────────────────
   Each icon's own small hover motion, after Claude's sidebar (Peter,
   2026-11-04). The moving parts are classed in js/components/icons.js, with
   their pivots and stagger delays inline. Once per hover or keyboard focus;
   none at all for anyone who asked their system for reduced motion. */
.rail__icon * { transform-box: view-box; transform-origin: 12px 12px; }
.rail__icon .road { stroke-dasharray: 1; }
.rail__icon .sway { transform-origin: 12px 14.2px; }
.rail__icon .folder { transform-origin: 4px 19px; }
.rail__icon .bar { transform-origin: 12px 20px; }
.rail__link:is(:hover, :focus-visible) .rail__icon .rays   { animation: ri-rays .6s cubic-bezier(.3, .7, .4, 1); }
.rail__link:is(:hover, :focus-visible) .rail__icon .sq     { animation: ri-pop .45s ease-out both; }
.rail__link:is(:hover, :focus-visible) .rail__icon .folder { animation: ri-lift .5s ease-in-out; }
.rail__link:is(:hover, :focus-visible) .rail__icon .back   { animation: ri-nudge .5s ease-in-out; }
.rail__link:is(:hover, :focus-visible) .rail__icon .bar    { animation: ri-grow .55s ease-out both; }
.rail__link:is(:hover, :focus-visible) .rail__icon .knob-l { animation: ri-slide-l .55s ease-in-out; }
.rail__link:is(:hover, :focus-visible) .rail__icon .knob-r { animation: ri-slide-r .55s ease-in-out; }
.rail__link:is(:hover, :focus-visible) .rail__icon .day    { animation: ri-blink .5s ease-in-out both; }
.rail__link:is(:hover, :focus-visible) .rail__icon .road   { animation: ri-draw .7s ease-out; }
.rail__link:is(:hover, :focus-visible) .rail__icon .sway   { animation: ri-sway .7s ease-in-out; }
.rail__link:is(:hover, :focus-visible) .rail__icon .hand   { animation: ri-spin .8s cubic-bezier(.4, 0, .2, 1); }
@keyframes ri-rays    { to { transform: rotate(45deg); } }
@keyframes ri-pop     { 0% { transform: scale(1); } 40% { transform: scale(.6); } 100% { transform: scale(1); } }
@keyframes ri-lift    { 0%, 100% { transform: none; } 45% { transform: translateY(-1.5px) rotate(-7deg); } }
@keyframes ri-nudge   { 0%, 100% { transform: none; } 50% { transform: translateX(1.5px); } }
@keyframes ri-grow    { 0% { transform: scaleY(1); } 35% { transform: scaleY(.35); } 100% { transform: scaleY(1); } }
@keyframes ri-slide-l { 0%, 100% { transform: none; } 50% { transform: translateX(-3px); } }
@keyframes ri-slide-r { 0%, 100% { transform: none; } 50% { transform: translateX(3px); } }
@keyframes ri-blink   { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes ri-draw    { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ri-spin    { to { transform: rotate(360deg); } }
@keyframes ri-sway    { 0%, 100% { transform: none; } 30% { transform: rotate(-9deg); } 65% { transform: rotate(5deg); } }
@media (prefers-reduced-motion: reduce) {
  .rail__icon * { animation: none !important; }
}
.rail__sep { height: 1px; background: var(--line); margin: var(--sp-3) var(--sp-2); }
.rail__heading {
  padding: var(--sp-2) var(--sp-3) var(--sp-1);
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
  letter-spacing: .07em; text-transform: uppercase; color: var(--dim);
}

.content { flex: 1; min-width: 0; padding: var(--sp-5); overflow-x: auto; }
/* The router's per-navigation wrapper (router.js): present so an abandoned
   view's late paint lands in a detached node, absent from layout. */
.view-slot { display: contents; }
/* One height whether or not the view has actions, and before they arrive:
   the row is as tall as a primary button, so the title sits at the same y on
   every view (Today's date line vs Plan's button used to differ by ~8px,
   and Plan/Projects jumped when their button painted — Peter, 2026-11-11). */
.view-head { margin-bottom: var(--sp-4); min-height: 44px; align-items: center; }
.view-head h1 { font-size: var(--fs-2xl); }
.view-head__aside { gap: 10px; align-items: center; flex-wrap: wrap; }
/* The filtered count. Mono so the digits don't reflow as they change. */
.view-head__count {
  font-family: var(--mono); font-size: var(--fs-sm);
  font-weight: var(--fw-semi); color: var(--ink-2);
}

/* Scrim behind the mobile drawer */
.scrim {
  position: fixed; inset: 0; z-index: 40; background: var(--overlay);
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }

/* ── Modal ────────────────────────────────────────────────────────────────
   .mo = overlay/backdrop, .md = the dialog card (components/modal.js is
   written against that vocabulary). */
.mo {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4);
  background: var(--overlay);
}
.md {
  /* Column layout with a capped height, found necessary 2026-08-18: a tall
     body (the People form's manager-links section, the holiday preview
     list) was overflowing BOTH edges of the viewport with nothing to
     scroll it — the Save button sat below the fold with no way to reach
     it. .md-body is the one part allowed to scroll; the title stays put
     above it and the actions stay put below, so Save is always visible. */
  width: 100%; max-width: 440px;
  max-height: calc(100vh - var(--sp-4) * 2);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl);
  border-top: 4px solid var(--accent);
  box-shadow: var(--elev-4);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
}
.md-ttl { font-size: var(--fs-xl); font-weight: 800; margin-bottom: var(--sp-3); flex: none; }
.md-body {
  font-size: var(--fs-md); color: var(--ink-2); line-height: var(--lh-loose);
  overflow-y: auto; min-height: 0;   /* min-height:0 — a flex child otherwise refuses to shrink below its content */
}
.md-acts { display: flex; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-5); flex: none; }

/* ── Mobile: rail becomes a drawer ────────────────────────────────────────
   Same markup, same links, same code — only the presentation changes. */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .rail {
    position: fixed; z-index: 50; inset: var(--topbar-h) auto 0 0;
    width: 264px; max-width: 84vw;
    transform: translateX(-100%);
    /* Hidden, not just off-screen, while closed: an off-canvas drawer kept
       its ~10 links in the Tab order, so a keyboard user tabbed through
       invisible links (review UX-5). visibility flips only after the slide
       has finished, so closing still animates. */
    visibility: hidden;
    transition: transform .2s ease, visibility 0s linear .2s;
    box-shadow: var(--elev-3);
  }
  .rail.is-open { transform: translateX(0); visibility: visible; transition: transform .2s ease, visibility 0s; }
  .content { padding: var(--sp-4) var(--sp-3); }
  .brand__name { font-size: var(--fs-lg); }
}
/* Phones: no room in the bar, so the name moves to the drawer's top. */
@media (max-width: 640px) {
  .company { display: none; }
  .rail__company {
    display: block; padding: var(--sp-2) var(--sp-3) var(--sp-3);
    margin-bottom: var(--sp-2); border-bottom: 1px solid var(--line);
    font-size: var(--fs-sm); font-weight: var(--fw-semi); color: var(--ink-2);
  }
}

/* ── Buttons ──────────────────────────────────────────────────────────────*/
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 9px 16px; border-radius: var(--r-md); border: 1.5px solid transparent;
  font-size: var(--fs-md); font-weight: var(--fw-bold); cursor: pointer;
  background: var(--sunken); color: var(--ink); text-decoration: none;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--line); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.btn--ghost:hover { background: var(--sunken); color: var(--ink); }
.btn--danger { background: var(--bad-soft); color: var(--bad); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn--lg { padding: 12px 22px; font-size: var(--fs-base); }

/* ── Cards, chips, tables ─────────────────────────────────────────────────*/
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--elev-1);
  padding: var(--sp-4);
}
.card + .card { margin-top: var(--sp-3); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
  background: var(--sunken); color: var(--ink-2);
}
.chip--ok   { background: var(--ok-soft);   color: var(--ok); }
.chip--warn { background: var(--warn-soft); color: var(--warn); }
.chip--bad  { background: var(--bad-soft);  color: var(--bad); }
.chip--accent { background: var(--accent-soft); color: var(--accent); }

/* ── Filter bar ───────────────────────────────────────────────────────────
   DECISIONS.md §11a direction 2a. Four facet dropdowns on one line, chips
   below them, both above the view's content. */

.filterbar { margin-bottom: var(--sp-3); }
.filterbar__row {
  display: flex; align-items: center; gap: var(--sp-2);
  flex-wrap: wrap; margin-bottom: var(--sp-2);
}
.filterbar__chips {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-bottom: var(--sp-3);
}

/* ── Saved views (direction 2d) ───────────────────────────────────────────
   Underline tabs on a hairline, the active one sitting ON the rule. Scrolls
   rather than wraps: a wrapping strip shoves the table down by an
   unpredictable amount every time you save one. */
.filterviews {
  display: flex; align-items: center; gap: var(--sp-1);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--sp-3); overflow-x: auto;
}
.filterviews__tab {
  flex: 0 0 auto; cursor: pointer; background: none; border: 0;
  border-bottom: 2px solid transparent; padding: 7px 10px; margin-bottom: -1px;
  font-size: var(--fs-md); font-weight: var(--fw-semi); color: var(--ink-2);
}
.filterviews__tab:hover { color: var(--ink); }
.filterviews__tab--active {
  border-bottom-color: var(--accent); font-weight: var(--fw-bold); color: var(--accent);
}
.filterviews__tab:focus-visible { outline: none; box-shadow: var(--focus); }
.filterviews__more {
  flex: 0 0 auto; background: none; border: 0; cursor: pointer;
  color: var(--ink-2); padding: 4px 6px; border-radius: var(--r-sm);
  font-size: var(--fs-md); line-height: 1;
}
.filterviews__more:hover { background: var(--sunken); color: var(--ink); }
.filterviews__dirty { flex: 0 0 auto; margin-left: var(--sp-2); }
.filterviews__acts {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-left: auto; padding-bottom: 6px; flex: 0 0 auto;
}

.facet { position: relative; }
.facet__btn {
  cursor: pointer; border-radius: var(--r-md); padding: 6px 12px;
  font-size: var(--fs-md); font-weight: var(--fw-semi);
  border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2);
}
.facet__btn:hover { border-color: var(--accent); }
.facet__btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
/* Three states, and the fill is the third: idle, open, and SELECTED. */
.facet__btn--active {
  border-color: var(--accent); color: var(--accent); background: var(--accent-tint);
}
.facet__btn:focus-visible { outline: none; box-shadow: var(--focus); }

/* A filter chip is a chip plus a facet-name prefix and a remove button.
   The prefix is what makes "SE" legible without the dropdown open. */
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; }
.filter-chip__facet { opacity: .65; font-weight: var(--fw-semi); }
/* A chip for a facet this view doesn't honour. It stays, and it says so —
   the wording carries it, never the colour alone (DECISIONS.md §1). */
.filter-chip--inactive { background: var(--sunken); color: var(--dim); }
.chip__x {
  background: none; border: 0; color: inherit; cursor: pointer;
  font: inherit; padding: 0 2px; line-height: 1;
}
.chip__x:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }

/* Bare text button — Clear all, the empty state's clear, saved-views Reset. */
.linkbtn {
  background: none; border: 0; padding: 6px 4px; cursor: pointer;
  font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-bold);
  color: var(--accent); text-decoration: underline;
}
.linkbtn--neutral { color: var(--ink-2); }
.linkbtn:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }

/* §11's first consequence: a filter that hides everything needs a real empty
   state with a one-click clear, not a blank table. Below the content, so the
   table header stays put and you can see what you filtered. */
.filter-empty { margin: var(--sp-4) 0 0; font-size: var(--fs-md); color: var(--dim); }

/* ── Popover ──────────────────────────────────────────────────────────────
   z-index 30 is deliberate: BELOW .menu (60) and the modal (80). A facet
   panel must never cover the account menu or a dialog. */
.popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  width: var(--popover-w); padding: var(--sp-2);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--elev-3);
}
.popover--right { left: auto; right: 0; }
.popover__search {
  width: 100%; box-sizing: border-box; margin-bottom: 6px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  padding: 6px 10px; font: inherit; font-size: var(--fs-sm); color: var(--ink);
  background: var(--surface);
}
.popover__search:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--accent); }
.popover__list { max-height: var(--popover-max-h); overflow: auto; }
.popover__opt {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: var(--r-md);
  cursor: pointer; font-size: var(--fs-md);
}
.popover__opt:hover { background: var(--bg); }
.popover__opt:focus-visible { outline: none; box-shadow: var(--focus); }
.popover__opt-label { flex: 1; min-width: 0; }
.popover__opt-note { font-size: var(--fs-xs); color: var(--dim); }
.popover__box {
  width: 15px; height: 15px; flex: 0 0 auto; border-radius: var(--r-xs);
  border: 1.5px solid var(--line-strong); background: var(--surface);
  color: transparent; font-size: 10px; line-height: 13px; text-align: center;
}
.popover__opt[aria-selected="true"] .popover__box {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
.popover__empty { margin: 0; padding: 6px 8px; font-size: var(--fs-sm); color: var(--dim); }

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.table th {
  text-align: left; padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
  letter-spacing: .05em; text-transform: uppercase; color: var(--dim);
  border-bottom: 2px solid var(--line); white-space: nowrap;
}
.table td { padding: var(--sp-3); border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table .num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }

/* ── Week grid ────────────────────────────────────────────────────────────
   Additive modifier on top of .table, scoped to the Week view's timesheet
   grid only — My Plan's table (variable month count, sticky first column)
   is a different shape and stays on plain .table. Fixes a real alignment
   bug found in production (2026-08-04): without table-layout:fixed + a
   colgroup, mixing colspan-merged project-header rows with normal 10-cell
   data rows in the same table let the browser compute different column
   widths per row, so day headers drifted out of line with the cells below
   them. */
.grid-table { table-layout: fixed; }
.grid-table th, .grid-table td { border-right: 1px solid var(--line); }
.grid-table th:last-child, .grid-table td:last-child { border-right: none; }

.grid-table .day-hdr { text-align: center; }
.grid-table .day-hdr-name { display: block; }
.grid-table .day-hdr-num {
  display: block; font-size: var(--fs-lg); font-weight: var(--fw-heavy);
  color: var(--ink); margin-top: 1px;
}

/* Hour-entry cells: no box of their own — the grid's own vertical dividers
   already draw the cell boundary, so a bordered input on top of that read
   as a "cell within a cell" (found 2026-08-04). Border-free and full-width
   instead; a background tint on focus
   stands in for the border as the "you're editing this" signal. Padding
   moves from the <td> onto the input itself (only the hour cell, via
   .hour-cell — every other cell in the grid keeps the normal .table
   padding), so the input can fill its cell exactly. */
.grid-table td.hour-cell { padding: 0; }
.grid-input {
  width: 100%; border: none; background: transparent;
  padding: var(--sp-3);
  -moz-appearance: textfield;
}
/* type="number"'s spin-button arrows reserve space on the right even
   when not shown, so centered text sat visibly left of true-center
   (still off after the first centering fix). Removing the spinner
   entirely — not just hiding it visually — is what actually frees that
   space back up. */
.grid-input::-webkit-outer-spin-button,
.grid-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* Beats .table .num's text-align:right (higher specificity, two classes)
   — the hour inputs also carry .num for the monospace/tabular-nums
   styling, but Peter wants the value centered in its cell, not right-
   aligned like the Total column. */
.grid-table .grid-input { text-align: center; }
/* Focus was a background tint alone, 1.16–1.23:1 against the idle cell
   (review UX-4). Same 2px inset ring as a Plan cell. */
.grid-input:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.grid-input:disabled { color: var(--dim); }
.grid-table .day-hdr.tod { background: var(--bad-soft); }
.grid-table td.tod { background: color-mix(in srgb, var(--bad-soft) 30%, transparent); }
/* Weekend columns (backlog #1): shown only when used, and tinted so they
   read as outside the planned week — weekend hours are work above plan.
   Lower specificity than the .tod rules above, so "today" still wins when
   today is a Saturday or Sunday. */
.grid-table .wkend { background: var(--sunken); }
/* Weekend toggles (Settings → Weekend work = explicit_days): a small "+" in
   the top-right corner of the Friday header opens Sat/Sun; a "×" in the
   Sunday header closes them while nothing is recorded there. Positioned in
   the corner so they cost no column width (Peter, 2026-09-26). */
.grid-table .day-hdr { position: relative; }
.grid-table .wkend-toggle {
  /* Bare symbol, no circle: a glyph never sits optically centred in a small
     ring (Peter, 2026-09-26), and weight reads as "clickable" on its own.
     The text-stroke thickens it past Manrope's heaviest weight. */
  position: absolute; top: 1px; right: 3px;
  padding: 0 2px; margin: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 17px; font-weight: 800; line-height: 1;
  -webkit-text-stroke: 0.6px currentColor;
  color: var(--accent);
}
.grid-table .wkend-toggle:hover, .grid-table .wkend-toggle:focus-visible {
  color: var(--accent-strong, var(--accent)); outline: none;
  background: var(--accent-soft); border-radius: var(--r-sm);
}
.grid-table .wkend-close { color: var(--dim); font-size: 15px; }
/* Make room for the corner toggle: the day label shifts left rather than
   sitting under it (measured 2 px overlap on a 54 px column otherwise). */
.grid-table .day-hdr { padding-left: 4px; padding-right: 4px; }   /* centred labels need no 12px sides */
.grid-table .day-hdr.has-toggle { padding-right: 17px; }

/* ── Toast ────────────────────────────────────────────────────────────────*/
.toast-stack {
  position: fixed; z-index: 90; right: var(--sp-4); bottom: var(--sp-4);
  display: flex; flex-direction: column-reverse; gap: var(--sp-2);
  max-width: min(420px, calc(100vw - var(--sp-6)));
}
.toast {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--ink); color: var(--surface);
  border-radius: var(--r-md); box-shadow: var(--elev-3);
  font-size: var(--fs-md); font-weight: var(--fw-semi);
  border-left: 4px solid var(--accent);
  animation: toast-in .2s ease;
}
.toast__action {
  flex: none; margin: -4px -6px -4px var(--sp-2); padding: 4px 8px;
  background: none; border: 1px solid currentColor; border-radius: var(--r-sm);
  color: inherit; font: inherit; cursor: pointer;
}
.toast__action:hover { background: color-mix(in srgb, currentColor 16%, transparent); }
.toast--success { border-left-color: var(--reward); }
.toast--warning { border-left-color: var(--warn); }
.toast--error   { border-left-color: var(--bad); }
.toast.is-leaving { animation: toast-out .25s ease forwards; }
@keyframes toast-in  { from { opacity:0; transform: translateY(14px); } }
@keyframes toast-out { to   { opacity:0; transform: translateY(14px); } }

/* ── Login ────────────────────────────────────────────────────────────────*/
.login {
  min-height: 100dvh; display: grid; place-items: center;
  padding: var(--sp-5); background: var(--bg);
}
.login__card {
  width: 100%; max-width: 396px; text-align: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--elev-2);
  padding: var(--sp-8) var(--sp-6) var(--sp-6);
}
.login__mark { width: 62px; height: 51px; color: var(--accent); }
.login__title { font-size: var(--fs-2xl); margin-top: var(--sp-4); }
.login__title .lite { font-weight: var(--fw-medium); opacity: .72; }
.login__tagline { color: var(--dim); font-size: var(--fs-md); margin-top: var(--sp-1); }
.login__actions { margin-top: var(--sp-6); }
.login__vendor { margin-top: var(--sp-6); font-size: var(--fs-sm); color: var(--dim); }
.login__msg {
  margin-top: var(--sp-4); padding: var(--sp-3);
  border-radius: var(--r-md); font-size: var(--fs-md); font-weight: var(--fw-semi);
}
.login__msg--error { background: var(--bad-soft); color: var(--bad); }
.login__msg--info  { background: var(--accent-soft); color: var(--accent); }

/* ── The reward stroke ────────────────────────────────────────────────────
   The identity's payoff: on submit, the mark's fifth stroke draws itself
   across, so the logo completing IS the week completing. Used in Phase D.
   Applied to the diagonal line only (the 5th <line> in the mark). */
.mark--tallying line:nth-child(5) {
  stroke-dasharray: 32; stroke-dashoffset: 32;
  animation: tally-stroke .5s cubic-bezier(.65,0,.35,1) forwards;
}
@keyframes tally-stroke { to { stroke-dashoffset: 0; } }

/* ── Boot loader (index.html, inside #root) ───────────────────────────────
   Peter, 2026-09-28: from Australia the first load showed an empty screen
   long enough to worry about. The mark draws itself on a loop: the four
   upright strokes left to right, then the fifth across, a short hold, fade,
   repeat — the tally-stroke language above, extended. Fades in only after
   300 ms, so a fast load never flashes it. Each stroke hides with a dash
   2 units longer than itself: with round caps, an offset of exactly the
   length still paints a dot at the start. */
.boot {
  min-height: 100vh; display: grid; place-items: center;
  background: var(--bg); color: var(--accent);
  opacity: 0; animation: boot-in .3s ease-out .3s forwards;
}
.boot__mark { width: 64px; height: auto; overflow: visible; }
/* Added by index.html's inline script after 4 s on the loader (API wake-up). */
.boot { align-content: center; gap: var(--sp-4); }
.boot__note { max-width: 32ch; padding: 0 var(--sp-4); text-align: center; color: var(--dim); font-size: var(--fs-sm); }
/* `.tally-loader` is the animation; the boot mark and the in-view loading
   card (components/loading.js) both carry it, so there is one wait language. */
.tally-loader line { animation: 2.4s cubic-bezier(.65,0,.35,1) infinite; }
.tally-loader line:nth-child(-n+4) { stroke-dasharray: 22; stroke-dashoffset: 22; }
.tally-loader line:nth-child(1) { animation-name: boot-s1; }
.tally-loader line:nth-child(2) { animation-name: boot-s2; }
.tally-loader line:nth-child(3) { animation-name: boot-s3; }
.tally-loader line:nth-child(4) { animation-name: boot-s4; }
.tally-loader line:nth-child(5) { stroke-dasharray: 34; stroke-dashoffset: 34; animation-name: boot-s5; }
@keyframes boot-in { to { opacity: 1; } }
/* Per stroke: hidden, drawn in its slot, held, then all fade together. */
@keyframes boot-s1 { 0%   { stroke-dashoffset: 22; opacity: 1; } 10%, 82% { stroke-dashoffset: 0; opacity: 1; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes boot-s2 { 0%, 10% { stroke-dashoffset: 22; opacity: 1; } 20%, 82% { stroke-dashoffset: 0; opacity: 1; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes boot-s3 { 0%, 20% { stroke-dashoffset: 22; opacity: 1; } 30%, 82% { stroke-dashoffset: 0; opacity: 1; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes boot-s4 { 0%, 30% { stroke-dashoffset: 22; opacity: 1; } 40%, 82% { stroke-dashoffset: 0; opacity: 1; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes boot-s5 { 0%, 46% { stroke-dashoffset: 34; opacity: 1; } 62%, 82% { stroke-dashoffset: 0; opacity: 1; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }
/* Reduced motion: the whole mark, breathing gently instead of drawing. */
@media (prefers-reduced-motion: reduce) {
  .tally-loader line { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
  .tally-loader { animation: boot-breathe 2.4s ease-in-out infinite; }
  @keyframes boot-breathe { 50% { opacity: .45; } }
}

/* ── In-view loading (components/loading.js) ──────────────────────────────
   The boot mark, smaller, in a card. Hidden for the first 250 ms so a view
   that paints at once never flashes it. */
.loading {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  padding: var(--sp-7) var(--sp-4); color: var(--accent);
  opacity: 0; animation: boot-in .25s ease-out .25s forwards;
}
.loading__mark { width: 40px; height: auto; overflow: visible; }
.loading__text { margin: 0; font-size: var(--fs-sm); text-align: center; max-width: 36ch; }
/* Inline, inside a table cell. */
td .loading__mark { width: 28px; vertical-align: middle; margin-right: var(--sp-2); color: var(--accent); }

/* ── Utilities ────────────────────────────────────────────────────────────*/
.stack   { display: flex; flex-direction: column; gap: var(--sp-3); }
.row     { display: flex; align-items: center; gap: var(--sp-3); }
.row--between { justify-content: space-between; }
.wrap    { flex-wrap: wrap; }
.muted   { color: var(--dim); }
.mono    { font-family: var(--mono); }
.grow    { flex: 1; }

.btn--sm { padding: 5px 11px; font-size: var(--fs-sm); }

/* ── People view (Phase E) ───────────────────────────────────────────────
   Scoped under .people-view, same discipline Week's .grid-table modifier
   used — nothing here can leak into another view's styles. */
.people-view .people-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-3); margin-bottom: var(--sp-5);
}
.people-view .person-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-2);
}
.people-view .person-card--inactive { opacity: .65; }
.people-view .person-card-hdr { display: flex; align-items: center; gap: var(--sp-2); }
.people-view .person-avatar {
  width: 32px; height: 32px; border-radius: var(--r-pill); flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--sunken); color: var(--ink-2);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .02em;
}
.people-view .person-name { font-weight: var(--fw-bold); }
.people-view .person-badges,
.people-view .person-skills,
.people-view .person-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.people-view .person-skills:empty { display: none; }
.people-view .people-section-heading {
  font-size: var(--fs-sm); font-weight: var(--fw-bold); text-transform: uppercase;
  letter-spacing: .05em; color: var(--dim); margin: var(--sp-5) 0 var(--sp-2);
}
/* My team (2026-11-19): the first section sits right under the filter bar. */
.people-view > .people-section:first-child > .people-section-heading { margin-top: 0; }
/* A manager-of-managers' sub-teams: collapsed by default, under My team. */
.people-view .people-subteam { margin-top: var(--sp-3); }
.people-view .people-subteam > summary {
  cursor: pointer; font-weight: var(--fw-semi); color: var(--ink-2);
  padding: var(--sp-2) 0; width: fit-content;
}
.people-view .people-subteam[open] > summary { margin-bottom: var(--sp-2); }

/* ── My Plan ──────────────────────────────────────────────────────────────
   Everything here exists to stop the Months ⇄ Weeks toggle moving the page.
   Both zooms render different text at every level — the selects' option
   labels, the hint sentence, and the column headers (weeks carry a second
   date line) — so left alone, toggling reflowed the toolbar horizontally and
   the table vertically. Sizes are fixed to the WIDER/TALLER of the two
   variants so neither zoom is the one that looks cramped. */
.myplan-sel {
  padding: var(--sp-1) var(--sp-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface); color: inherit;
  /* Sized for "12 months" / "0 months back" — the longer of each pair. */
  min-width: 8.5rem;
}
.myplan-sel--wide { min-width: 11rem; }

/* Reserves the taller sentence's height so the table below never jumps. */

/* Column widths come from the colgroup, not from the text, so 'AUG-26' and
   'W32'/'3 AUG' can't resize the grid between zooms. */
.myplan-grid { table-layout: fixed; }

/* One header height for both zooms, with the label vertically centred inside
   it — so a single-line month label sits in the middle rather than riding at
   the top of a two-line box. Weeks fill the same box with their date line. */
.myplan-grid thead th { height: 3.25rem; vertical-align: middle; }

.myplan-sub { font-weight: var(--fw-normal); display: block; }

/* The ✎ on the Leave row — the only editable row on this screen. */
.myplan-edit-hint {
  color: var(--accent); font-size: var(--fs-sm); font-weight: var(--fw-bold);
  cursor: help;
}

/* ── Plan board ───────────────────────────────────────────────────────────
   Rows = project→task, columns = people, time is a stepping selector.
   Everything scoped; nothing here leaks to another view. */
.plan-toolbar { gap: var(--sp-4); align-items: center; margin-bottom: var(--sp-2); }
.plan-period { gap: var(--sp-2); align-items: center; }
.plan-period-label { font-weight: var(--fw-bold); min-width: 11rem; text-align: center; }

/* The person selector occupies the period label's slot when the orientation
   pivots, so it takes the same width — the toolbar must not reflow just
   because the stepper now steps through people. */
.plan-person-sel {
  min-width: 11rem; font-weight: var(--fw-bold); text-align: center;
  padding: var(--sp-1) var(--sp-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface); color: inherit;
}
.plan-range-sel {
  padding: var(--sp-1) var(--sp-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface); color: inherit;
  min-width: 8.5rem;
}
/* A button, not a span, since it now opens Review · Balance — the chip's own
   look is kept, only the affordance is added. */
.plan-org { margin-left: auto; cursor: pointer; font: inherit; }
.plan-org:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Always present, so filling it in never moves the grid. C3's "ambient
   headroom, never a popup" — a strip rather than a panel anchored to the
   cell, which inside a sticky scrolling table either clips or needs
   repositioning on every scroll. */
.plan-headroom {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  min-height: 2.75rem; padding: 0 var(--sp-3); margin-bottom: var(--sp-2);
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--sunken); font-size: var(--fs-sm);
}
.plan-headroom--over { border-color: var(--bad); background: var(--bad-soft); }
.plan-headroom-arrow { color: var(--dim); }

.plan-scroll { padding: 0; overflow: auto; max-height: 70vh; }

/* Fixed layout so column widths come from the colgroup rather than from
   whatever names happen to be in the header — the same reason week.js and
   My Plan need it. */
.plan-grid { table-layout: fixed; }
.plan-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.plan-grid .plan-rowhdr {
  position: sticky; left: 0; z-index: 1; background: var(--surface);
  text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plan-grid thead .plan-rowhdr { z-index: 3; }

/* A column header is a person OR a period, depending on orientation — hence
   `col` rather than `person`. The avatar is the only person-specific part and
   simply isn't rendered for a period column. */
.plan-col-hdr { text-align: center; vertical-align: middle; height: 4rem; }
.plan-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent);
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
}
.plan-col-name {
  display: block; font-weight: var(--fw-medium); font-size: var(--fs-xs);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plan-col-sub  { font-size: var(--fs-xs); }
.plan-col-load { display: block; font-size: var(--fs-xs); font-weight: var(--fw-bold); }
.plan-col-hdr--over  { background: var(--bad-soft); }
.plan-col-hdr--under { background: var(--warn-soft); }
.plan-col-hdr--well  { background: var(--ok-soft); }

.plan-proj-row { cursor: pointer; }
.plan-proj-cell { font-weight: var(--fw-bold); background: var(--sunken); }
.plan-proj-filler { background: var(--sunken); }
.plan-caret { color: var(--dim); }
.plan-proj-count { font-weight: var(--fw-normal); font-size: var(--fs-xs); margin-left: var(--sp-1); }
.plan-task-cell { padding-left: var(--sp-5); }

.plan-cell {
  position: relative; text-align: center; cursor: cell;
  padding: 0; height: 2.5rem; color: var(--dim);
}
.plan-cell--has { color: inherit; font-weight: var(--fw-medium); }
/* Not mine to plan (migration 0010 / #297's rule): read-only, no editor. */
.plan-cell-ro {
  text-align: center; padding: 0; height: 2.5rem; color: var(--dim);
  background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--line) 45%, transparent) 6px 7px);
  cursor: not-allowed;
}
/* ── Time off (backlog #90): people × days ─────────────────────────────────
   Narrow fixed day columns, so six weeks fit a laptop and a phone scrolls
   sideways under a pinned name column. Colour is never the only signal:
   every marked cell carries a title and screen-reader text, and "part of
   the week" is hatched where "the whole day" is solid. */
.timeoff-grid { table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.timeoff-grid th, .timeoff-grid td { padding: 0; height: 2rem; text-align: center; }
.timeoff-grid th { text-transform: none; letter-spacing: normal; color: var(--ink); }
.timeoff-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.timeoff-grid thead tr + tr th { top: 2rem; }
.timeoff-grid .plan-rowhdr {
  position: sticky; left: 0; z-index: 1; background: var(--surface);
  text-align: left; padding: 0 var(--sp-3); font-weight: var(--fw-normal);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-right: 1px solid var(--line-strong);
}
.timeoff-grid thead .plan-rowhdr { z-index: 3; font-weight: var(--fw-bold); }
.timeoff-grid tfoot th, .timeoff-grid tfoot td {
  position: sticky; bottom: 0; background: var(--surface);
  border-top: 1px solid var(--line-strong); font-size: var(--fs-xs); color: var(--dim);
}
.timeoff-grid tfoot .plan-rowhdr { z-index: 2; }
.timeoff-where { font-size: var(--fs-xs); margin-left: var(--sp-1); }
.timeoff-week { font-size: var(--fs-xs); font-weight: var(--fw-normal); color: var(--dim); text-align: left !important; padding-left: var(--sp-1) !important; border-left: 1px solid var(--line-strong); white-space: nowrap; overflow: hidden; }
.timeoff-week__no { font-weight: var(--fw-bold); color: var(--ink); }
.timeoff-day { font-size: var(--fs-xs); font-weight: var(--fw-normal); line-height: 1.1; }
.timeoff-day__letter { display: block; color: var(--dim); font-size: .65rem; }
.timeoff-day--weekend { color: var(--dim); background: var(--sunken) !important; }
.timeoff-day--today { box-shadow: inset 0 -3px 0 var(--accent); font-weight: var(--fw-bold); }
.timeoff-day--mon { border-left: 1px solid var(--line-strong); }
.timeoff-cell { border-bottom: 1px solid var(--line); font-size: var(--fs-xs); font-weight: var(--fw-bold); }
.timeoff-cell--weekend { background: var(--sunken) !important; }
.timeoff-cell--holiday { background: var(--warn-soft); box-shadow: inset 0 0 0 1px var(--warn); }
.timeoff-cell--leave { background: var(--accent); }
/* A day a manager can book (js/views/time-off.js bookFor): the whole cell. */
.timeoff-cell:has(.timeoff-cellbtn) { padding: 0; }
.timeoff-cellbtn { display: block; width: 100%; height: 100%; min-height: 1.6rem; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.timeoff-cellbtn:hover, .timeoff-cellbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.timeoff-booking-on { justify-content: space-between; gap: var(--sp-3); border-left: 4px solid var(--accent); background: var(--accent-soft); margin-bottom: var(--sp-3); }
.timeoff-book { margin-left: var(--sp-2); width: 1.4rem; height: 1.4rem; padding: 0; line-height: 1; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--accent); font-weight: var(--fw-bold); cursor: pointer; }
.timeoff-book:hover, .timeoff-book:focus-visible { background: var(--accent-soft); outline: none; border-color: var(--accent); }
/* Half a day: half the cell. Which half is not recorded. */
.timeoff-cell--half { background: linear-gradient(135deg, var(--accent) 0 50%, transparent 50%); }
.timeoff-cell--partial {
  color: var(--accent);
  background: repeating-linear-gradient(135deg, var(--accent-soft) 0 5px, var(--surface) 5px 10px);
}
.timeoff-cell--unknown {
  background: repeating-linear-gradient(90deg, var(--sunken) 0 2px, transparent 2px 6px);
}
.timeoff-sum { font-size: var(--fs-xs); color: var(--dim); text-align: left !important; padding: 0 var(--sp-2) !important; white-space: nowrap; border-left: 1px solid var(--line-strong); }
.timeoff-legend { gap: var(--sp-4); margin-left: auto; font-size: var(--fs-sm); color: var(--dim); }
.timeoff-legend span { display: inline-flex; align-items: center; gap: var(--sp-2); }
.timeoff-key { display: inline-block; width: 1rem; height: 1rem; border-radius: 3px; }
/* The Load lens (#91): a column per week, Plan's own load tints. */
.availability-week { font-size: var(--fs-xs); font-weight: var(--fw-normal); line-height: 1.15; border-left: 1px solid var(--line); }
.availability-week__date { display: block; color: var(--dim); }
.availability-grid thead th { height: 2.75rem; }
.availability-cell { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); font-size: var(--fs-sm); white-space: nowrap; }
.availability-glyph { font-size: var(--fs-xs); opacity: .75; }
.availability-mean { border-left: 1px solid var(--line-strong); font-weight: var(--fw-bold); }
.availability-name {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left;
}
.availability-name:hover, .availability-name:focus-visible { color: var(--accent); text-decoration: underline; }
/* Richer rows and project bars (DECISIONS §29). A load cell is two lines:
   how full, and the hours over or still free. */
.availability-grid .availability-person > th, .availability-grid .availability-person > td { height: 2.6rem; }
.availability-load { display: block; line-height: 1.2; }
.availability-delta { display: block; font-size: .68rem; line-height: 1.1; color: var(--dim); font-weight: var(--fw-normal); }
.availability-caret { display: inline-block; width: 1.1em; color: var(--dim); }
.availability-person--open > th { font-weight: var(--fw-bold); }
.availability-weekend { border-bottom: 1px solid var(--line); }
/* A project's row: a quiet name with the project's colour on its edge, and a
   bar where it is planned. Bars in neighbouring periods touch, so a run of
   weeks reads as one bar; the ends are rounded where the run ends. */
.availability-proj > th, .availability-proj > td { height: 1.75rem; background: var(--bg); }
.availability-grid .availability-proj__name {
  background: var(--bg); font-size: var(--fs-xs); color: var(--ink-2, var(--dim));
  padding-left: var(--sp-4); font-weight: var(--fw-normal); text-align: left;
}
/* My plan: the tasks under the project's name (a tooltip is no use on a
   phone), a link on the Leave row, and a first row that is a label. */
.availability-proj__tasks { display: block; font-size: 0.6875rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.availability-proj__link { color: inherit; }
.availability-name--self { cursor: default; padding-left: var(--sp-3); }
.availability-barcell { padding: 0 !important; border-left: 1px solid transparent; border-bottom: 1px solid var(--line); position: relative; }
.availability-bar {
  display: flex; align-items: center; height: 1.15rem; margin: 0; overflow: visible; white-space: nowrap;
  /* --bar is set per bar, as a variable, so a theme change reaches it at
     once. The top and bottom edge is the bar's own colour, darkened: the
     bright set is too pale to be its own edge on a light surface. */
  background: var(--bar, var(--dim));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--bar, var(--dim)) 62%, var(--ink)),
              inset 0 -1px 0 color-mix(in srgb, var(--bar, var(--dim)) 62%, var(--ink));
}
.availability-bar--first { border-top-left-radius: 4px; border-bottom-left-radius: 4px; margin-left: 2px; }
.availability-bar--last { border-top-right-radius: 4px; border-bottom-right-radius: 4px; margin-right: 2px; }
/* The label sits on a chip of the surface colour, so it reads on any bar
   colour in any theme without picking a text colour per project. */
.availability-bar__label {
  position: relative; z-index: 1; margin-left: 3px; padding: 0 4px; border-radius: 3px;
  background: var(--surface); color: var(--ink); font-size: .68rem; font-weight: var(--fw-bold); line-height: 1.5;
}
.availability-proj__sum { font-size: var(--fs-xs); font-weight: var(--fw-normal); color: var(--dim); background: var(--bg); }
.availability-proj--foot > td { text-align: left !important; height: 1.9rem; border-bottom: 2px solid var(--line-strong); }
.availability-edit { font: inherit; font-size: var(--fs-xs); color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.availability-edit:hover, .availability-edit:focus-visible { text-decoration: underline; }
/* A project's Team tab: a task row, then its people. */
.availability-task__head { display: flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-bold); }
.availability-task__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.availability-task__add { flex: none; width: 22px; height: 22px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink-2); font: inherit; line-height: 1; cursor: pointer; }
.availability-task__add:hover, .availability-task__add:focus-visible { border-color: var(--accent); color: var(--accent); }
.availability-member { display: flex; align-items: center; gap: var(--sp-2); }
.availability-member__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.availability-member__load { flex: none; font-size: .68rem; font-variant-numeric: tabular-nums; color: var(--dim); }
.availability-member__load--over { color: var(--bad); font-weight: var(--fw-bold); }
/* A row you may plan on: its cells take a click or a drag (§29 step 3b). */
.availability-proj--bookable td[data-slot] { cursor: cell; }
.availability-proj--bookable td[data-slot]:hover { background: var(--accent-tint); }
.availability-barcell--picking { background: var(--accent-soft) !important; box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
/* A bar you may change is a button (§29 step 3). */
.availability-bar--edit { width: 100%; border: 0; padding: 0; font: inherit; cursor: pointer; }
.availability-bar--edit:hover { filter: brightness(1.12); }
.availability-bar--edit:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.availability-proj--foot .availability-add { margin-right: var(--sp-3); }
.availability-proj--foot > td { height: 2.5rem; }
/* The booking dialog's "who has room" list, where the person is picked. */
.booking-room { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); max-height: 13.5rem; overflow: auto; background: var(--surface); }
.booking-room__row { display: grid; grid-template-columns: 1fr auto 3rem 1.2rem; align-items: center; gap: var(--sp-2); padding: 5px var(--sp-3); border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; font-size: var(--fs-sm); text-align: left; color: var(--ink); cursor: pointer; }
.booking-room__row:last-child { border-bottom: 0; }
.booking-room__row:hover:not(:disabled), .booking-room__row:focus-visible { background: var(--sunken); }
.booking-room__row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.booking-room__row--chosen { background: var(--accent-soft); font-weight: var(--fw-semi); }
.booking-room__row:disabled { cursor: default; color: var(--dim); }
.booking-room__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking-room__free, .booking-room__load { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.booking-room__load { color: var(--dim); font-size: var(--fs-xs); }
.booking-room__fit { text-align: center; }
.booking-room__row--all .booking-room__fit { color: var(--ok); }
.booking-room__row--part .booking-room__fit { color: var(--warn); }
.booking-room__row--none .booking-room__fit, .booking-room__row--none .booking-room__free { color: var(--bad); }
.booking-room__none { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); color: var(--dim); border-bottom: 1px solid var(--line); }
.booking-room__more { padding: 5px var(--sp-3); border: 0; background: none; font: inherit; font-size: var(--fs-xs); color: var(--accent); text-align: left; cursor: pointer; }
.booking-room__more:hover, .booking-room__more:focus-visible { text-decoration: underline; }
/* The booking dialog's summary and week-by-week preview. */
.booking-summary { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3); background: var(--sunken); font-size: var(--fs-sm); }
.booking-summary__grid { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--sp-4); margin: var(--sp-2) 0 0; }
.booking-summary__grid dt { color: var(--dim); }
.booking-summary__grid dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.booking-over { color: var(--bad); font-weight: var(--fw-bold); margin-top: var(--sp-2); }
.booking-past { color: var(--warn); margin-top: var(--sp-2); }
.booking-weeks { display: flex; flex-wrap: wrap; gap: 4px; max-height: 9rem; overflow: auto; }
.booking-week { display: inline-flex; flex-direction: column; align-items: center; padding: 2px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--fs-xs); background: var(--ok-soft); }
.booking-week__no { color: var(--dim); font-size: .65rem; }
.booking-week--over { background: var(--bad-soft); border-color: var(--bad); }
.booking-week--cleared { background: var(--surface); border-style: dashed; }
.booking-removes { margin-right: auto; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.booking-removes .btn { white-space: nowrap; }
/* On a phone the two removes take a row of their own, above Cancel and Save. */
@media (max-width: 560px) {
  .md-acts:has(.booking-removes) { flex-wrap: wrap; }
  .booking-removes { flex: 1 0 100%; margin-right: 0; }
}
.booking-remove { color: var(--bad); }
/* My plan: leave as a list of bookings (design/LEAVE-DATES.md). */
.leave-list { list-style: none; margin: var(--sp-2) 0 0; padding: 0; }
.leave-item { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); padding: var(--sp-2) 0; border-top: 1px solid var(--line); }
.leave-item__when { font-weight: var(--fw-semi); min-width: 9.5rem; }
.leave-item__what { color: var(--ink-2); flex: 1 1 10rem; }
.leave-item__acts { margin-left: auto; }
/* My time off (js/views/my-time-off.js). */
.mto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--sp-3); align-items: start; }
/* Two cards side by side must start level: the rule that spaces stacked
   cards gave the second a top margin here (Peter's feedback, 2026-11-29). */
.mto-grid > .card { margin-top: 0; }
.mto-count { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-1) var(--sp-4); margin: var(--sp-2) 0 0; }
.mto-count dt { color: var(--ink-2); }
.mto-count dd { margin: 0; font-weight: var(--fw-semi); }
.mto-earlier { margin-top: var(--sp-3); }
.mto-balance { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) var(--sp-5); margin-top: var(--sp-2); }
.mto-balance__left { display: flex; flex-direction: column; align-items: center; min-width: 6.5rem; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); }
.mto-balance__left--over { background: var(--bad-soft); color: var(--bad); }
.mto-balance__n { font-size: 2rem; line-height: 1.1; font-weight: var(--fw-bold); }
.mto-balance__l { font-size: var(--fs-sm); }
.mto-balance .mto-count { margin-top: 0; }
.mto-earlier summary { cursor: pointer; color: var(--ink-2); }
/* A day you can press: the same box the team calendar's links fill. */
.cal-day .cal-day__btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; border-radius: var(--r-sm); }
.cal-day button.cal-day__btn { cursor: pointer; }
.cal-day button.cal-day__btn:hover, .cal-day button.cal-day__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
/* Half a day of your own leave: half the box. */
.cal-day--half { background: linear-gradient(135deg, var(--accent) 0 50%, transparent 50%); font-weight: var(--fw-bold); }
/* Time off · Calendar (DECISIONS §31): a year of small months. */
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: var(--sp-3); }
.cal-year { align-items: start; }
/* The shared `.card + .card` margin pushed every month but January down by
   12px (feedback 2026-11-30). Fourth card row this has caught — see
   .review-stats. */
.cal-year > .card { margin: 0; }
.cal-card { padding: var(--sp-3); }
.cal-card__name { font-size: var(--fs-md, 1rem); font-weight: var(--fw-bold); margin: 0 2px var(--sp-2); }
.cal-month { border-collapse: separate; border-spacing: 2px; width: 100%; table-layout: fixed; }
.cal-month th { font-size: .68rem; font-weight: var(--fw-normal); color: var(--dim); text-align: center; padding: 0 0 2px; text-transform: none; letter-spacing: normal; }
.cal-day { padding: 0; height: 1.9rem; text-align: center; border-radius: var(--r-sm); font-size: var(--fs-sm); }
.cal-day a { position: relative; display: flex; align-items: center; justify-content: center; height: 100%; color: inherit; text-decoration: none; border-radius: var(--r-sm); }
.cal-day a:hover, .cal-day a:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.cal-day--weekend { color: var(--dim); background: var(--sunken); }
.cal-day--partial { background: repeating-linear-gradient(135deg, var(--accent-soft) 0 5px, var(--surface) 5px 10px); color: var(--accent); }
.cal-day--holiday { background: var(--warn-soft); box-shadow: inset 0 0 0 1px var(--warn); }
.cal-day--leave { background: var(--accent); color: var(--on-accent); font-weight: var(--fw-bold); }
/* Shaded by how many of the people shown are away (calendar.js heatLevel).
   The two light steps carry the page's ink, not white: white on them
   measured 2.4–3.1:1 in the light themes, well under legible. Steps 3 and 4
   are 4.2:1 or better with the accent's own text colour in every theme. */
.cal-day--heat1 { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--ink); }
.cal-day--heat2 { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); color: var(--ink); }
.cal-day--heat3 { background: color-mix(in srgb, var(--accent) 80%, var(--surface)); color: var(--on-accent); }
.cal-day--heat4 { background: var(--accent); color: var(--on-accent); }
/* The timeline's "People off" row wears the same four steps in its OWN
   colour, terracotta (Peter, 2026-11-28: "a distinct colour other than the
   teal", then his pick from five): the row is a count of people, and teal
   on this screen means leave. Spelled
   out per step because `.timeoff-grid tfoot td` sets the footer's own
   background and would win. Light steps carry the page's ink, as on the
   calendar; white on them is not legible. */
.timeoff-grid tfoot td.cal-day--heat1 { background: color-mix(in srgb, var(--heat) 20%, var(--surface)); color: var(--ink); }
.timeoff-grid tfoot td.cal-day--heat2 { background: color-mix(in srgb, var(--heat) 42%, var(--surface)); color: var(--ink); }
.timeoff-grid tfoot td.cal-day--heat3 { background: color-mix(in srgb, var(--heat) 88%, var(--surface)); color: var(--on-heat); }   /* 88, not 80: white on 80% terracotta is 4.0:1 */
.timeoff-grid tfoot td.cal-day--heat4 { background: var(--heat); color: var(--on-heat); }
.timeoff-grid tfoot td[class*="cal-day--heat"] { font-weight: var(--fw-bold); text-align: center; }
/* Both on one day: leave's fill, the holiday's edge. */
.cal-day--leave.cal-day--holiday { box-shadow: inset 0 0 0 2px var(--warn); }
.cal-day--today a { box-shadow: inset 0 -3px 0 var(--gold); font-weight: var(--fw-bold); }
.cal-day__n { position: absolute; top: 0; right: 2px; font-size: .58rem; line-height: 1.3; font-weight: var(--fw-bold); opacity: .85; }
.timeoff-col-name { width: 190px; }
/* A phone shows names and about a week; real names (Elin Ahlström, Saoirse
   Nolan) truncate with an ellipsis and keep the full name in the title. The
   country code goes, since the Country filter says it. */
@media (max-width: 640px) {
  .timeoff-col-name { width: 112px; }
  .timeoff-grid .plan-rowhdr { padding: 0 var(--sp-2); }
  .timeoff-where { display: none; }
  .timeoff-legend { margin-left: 0; gap: var(--sp-3); }
  .timeoff-period .plan-period-label { min-width: 0; flex: 1; }
  .timeoff-period { width: 100%; }
}

.plan-loadonly { margin-bottom: var(--sp-3); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-sm); }
.plan-cell:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.plan-cell--over  { background: var(--bad-soft); }
.plan-cell--under { background: var(--warn-soft); }
.plan-cell--well  { background: var(--ok-soft); }
.plan-cell--dragover { outline: 2px dashed var(--accent); outline-offset: -2px; }
.plan-mixed { font-size: var(--fs-xs); color: var(--dim); }

/* An archived project that still carries allocation this period: present so
   committed time stays visible, dimmed and cursor-default so it reads as
   information rather than as somewhere to type. Matches the dimming the
   people list already uses for inactive rows (.person-card--inactive). */
.plan-proj-row--archived, .plan-row--archived { opacity: .65; }
.plan-proj-row--archived .plan-proj-cell { font-style: italic; }
.plan-ro {
  text-align: center; padding: 0; height: 2.5rem;
  color: var(--dim); cursor: default;
}

/* Borderless and full-bleed: a bordered input inside a bordered cell reads as
   a cell within a cell, and a fixed pixel width overflows a fixed-layout
   column. Both lessons already paid for in week.js's .grid-input. */
.plan-input {
  width: 100%; height: 100%; border: 0; padding: 0; text-align: center;
  font: inherit; color: inherit; background: var(--accent-soft);
}
.plan-input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.plan-input::-webkit-outer-spin-button,
.plan-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Revealed on hover/focus so the grid isn't peppered with grips at rest. */
.plan-handle {
  position: absolute; right: 0; bottom: 0; width: 8px; height: 8px;
  background: var(--accent); cursor: crosshair; opacity: 0;
  touch-action: none;
}
.plan-cell:hover .plan-handle, .plan-cell:focus .plan-handle { opacity: 1; }

.plan-sum-hdr, .plan-sum { text-align: center; font-weight: var(--fw-bold); }
.plan-footrow td { position: sticky; bottom: 0; background: var(--surface); font-weight: var(--fw-bold); }
.plan-foot-cell { text-align: center; }
/* The overbooked week inside a month whose average looks fine. */
.plan-foot-note { display: block; font-size: var(--fs-xs); font-weight: var(--fw-semi); white-space: nowrap; }
.availability-delta--over { color: var(--bad); font-weight: var(--fw-semi); }
.plan-over  { color: var(--bad); }
.plan-under { color: var(--warn); }
.plan-well  { color: var(--ok); }
.plan-empty { color: var(--dim); }

/* ── Projects — master-detail per wireframes.html §6 ──────────────────────
   Narrow list column left, per-project detail right. The first build's card
   grid (.projects-grid/.project-card) was deleted in the wireframe rework. */
.projects-layout {
  display: grid; grid-template-columns: 300px 1fr; gap: var(--sp-4);
  align-items: start;
}
/* Grid items default to min-width:auto, so the wide schedule/needs tables
   stretched the column instead of scrolling inside their own container —
   pushing the detail's tab strip off-screen. min-width:0 is what lets
   overflow:auto actually do its job here. */
.projects-layout > * { min-width: 0; }
@media (max-width: 900px) {
  .projects-layout { grid-template-columns: 1fr; }
}

.projects-master { display: flex; flex-direction: column; gap: var(--sp-2); }
.proj-list-bar { align-items: center; padding: 0 var(--sp-1); }
.proj-items { display: flex; flex-direction: column; gap: var(--sp-2); }

.proj-item {
  padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer;
}
.proj-item:hover { border-color: var(--accent); }
.proj-item:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.proj-item--selected { border-color: var(--accent); background: var(--accent-soft); }
/* The wireframe's archived card: no fill, struck name, no metadata line. */
.proj-item--archived { background: transparent; opacity: .75; }
.proj-item-name { font-weight: var(--fw-bold); }
.proj-item-name--struck { text-decoration: line-through; color: var(--dim); }
.proj-item-meta { font-size: var(--fs-sm); margin-top: 2px; }
.proj-item-norollup { font-size: var(--fs-xs); white-space: nowrap; }
.proj-archived-toggle { padding: 0 var(--sp-1); }

/* Detail topbar: name left, text-tab strip + actions right. Tabs are the
   wireframe's dim-with-active-bold text style, not buttons. */
.proj-detail-bar { align-items: center; margin-bottom: var(--sp-2); }
.proj-detail-name { font-size: var(--fs-lg); }
.proj-tabs { display: flex; gap: var(--sp-2); align-items: center; }
.proj-tab {
  border: 0; background: none; padding: 2px 4px; cursor: pointer;
  font: inherit; color: var(--dim);
}
.proj-tab--active { color: inherit; font-weight: var(--fw-bold); }
.proj-tab:focus-visible { outline: 2px solid var(--accent); border-radius: var(--r-sm); }

/* Resource needs — same fixed-layout + sticky-header discipline as the Plan
   board and My Plan, for the same reason: column widths and header height
   must not depend on the text inside them. */
.needs-scroll { padding: 0; overflow: auto; max-height: 70vh; }
.needs-grid { table-layout: fixed; }
.needs-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.needs-grid .plan-rowhdr { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; }
.needs-grid thead .plan-rowhdr { z-index: 3; }

.needs-cell {
  position: relative; text-align: center; cursor: cell;
  padding: 0; height: 2.25rem;
}
.needs-cell:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
/* The row you type in looks like it: each month is a small field, and an
   empty one offers a +. The assigned row beneath is flat and sunken. */
.needs-cell { cursor: text; }
.needs-val { display: inline-block; min-width: 3.2rem; padding: 2px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-variant-numeric: tabular-nums; }
.needs-val--empty { border-style: dashed; }
.needs-cell:hover .needs-val { border-color: var(--accent); }
.needs-task-hdr > div { display: flex; align-items: center; gap: var(--sp-2); }
.needs-task-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.needs-kind { flex: none; font-size: .65rem; font-weight: var(--fw-bold); letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.needs-kind--req { color: var(--accent); }
.needs-row-assigned > .needs-acell:not(.needs-acell--short):not(.needs-acell--staffed):not(.needs-acell--over) { background: var(--sunken); }
.needs-row-assigned .plan-rowhdr { background: var(--sunken); text-align: right; }
.needs-cell--dragover { outline: 2px dashed var(--accent); outline-offset: -2px; }

/* §6b's row pair: the need row is the editable one; `assigned` sits under it,
   dim and indented, carrying the gap. Tints only on assigned cells — the
   mock carries meaning by weight alone, but this app's rule is hue+glyph
   never hue alone, and never hue on the row you type into. */
.needs-row-assigned .plan-rowhdr { font-weight: var(--fw-normal); }
.needs-assigned-hdr { color: var(--dim); padding-left: var(--sp-5) !important; font-size: var(--fs-sm); }
/* nowrap: "1.6 gap .4" is one phrase and wrapping it mid-way reads as two
   separate numbers. The column width below is sized to hold it. */
.needs-acell {
  text-align: center; color: var(--dim); font-size: var(--fs-xs);
  height: 1.9rem; padding: 0; white-space: nowrap;
}
.needs-acell--staffed { background: var(--ok-soft); color: var(--ok); }
.needs-acell--short   { background: var(--bad-soft); color: var(--bad); }
.needs-acell--over    { background: var(--warn-soft); color: var(--warn); }

.needs-handle {
  position: absolute; right: 0; bottom: 0; width: 8px; height: 8px;
  background: var(--accent); cursor: crosshair; opacity: 0; touch-action: none;
}
.needs-cell:hover .needs-handle, .needs-cell:focus .needs-handle { opacity: 1; }

/* Schedule — month-span bars as the mock draws them: cell spans, tree
   indent + └ on children (lighter bar), ◆ milestone rows in the same table. */
.sched-grid { table-layout: fixed; }
.sched-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.sched-grid .plan-rowhdr { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; }
.sched-grid thead .plan-rowhdr { z-index: 3; }
/* Rows are as low as the name allows (Peter, 2026-11-29: the bars were a
   full row thick, and a realistic plan has many tasks). */
.sched-grid tbody td { padding-top: 0; padding-bottom: 0; height: 1.9rem; }
.sched-rowhdr { display: flex; align-items: center; gap: var(--sp-2); height: 1.9rem; white-space: nowrap; }
.sched-col-name { width: 320px; }
/* A phone: the name column must leave room for the time it is beside, so
   the dates give way; they are in each bar's tooltip and the task's dialog. */
@media (max-width: 640px) {
  .sched-col-name { width: 150px; }
  .sched-dates { display: none; }
  .proj-tab { white-space: nowrap; }
}
.sched-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sched-dates { flex: none; font-size: .68rem; color: var(--dim); font-weight: var(--fw-normal); font-variant-numeric: tabular-nums; }
.sched-dates--none { font-style: italic; }
.sched-cell { padding-left: 0 !important; padding-right: 0 !important; border-left: 1px solid var(--line); }
.sched-grid--day .sched-cell { border-left-color: transparent; }
.sched-grid--day .sched-cell--mon { border-left: 1px solid var(--line-strong); }
.sched-cell--weekend { background: var(--sunken); }
.sched-cell--today { background: color-mix(in srgb, var(--accent) 9%, transparent); }
/* A bar in the plan's bar colours and at its thickness (Peter, 2026-11-29,
   after a first cut at half that) (--bar is set per row). Sub-tasks
   are a paler shade of their parent's; the project's own span is neutral. */
.sched-bar {
  display: block; height: 1.15rem; background: var(--bar, var(--dim));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--bar, var(--dim)) 62%, var(--ink)),
              inset 0 -1px 0 color-mix(in srgb, var(--bar, var(--dim)) 62%, var(--ink));
}
/* A piece overlaps the cell's left rule, so a bar reads as one stroke. */
.sched-bar:not(.sched-bar--first) { margin-left: -1px; }
.sched-bar--first { border-top-left-radius: 4px; border-bottom-left-radius: 4px; margin-left: 2px; }
.sched-bar--last { border-top-right-radius: 4px; border-bottom-right-radius: 4px; margin-right: 2px; }
/* The request over a whole task, in the dialog its bar opens. */
.task-ask { margin-top: var(--sp-4); padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--sunken); font-size: var(--fs-sm); }
.task-ask:empty { display: none; }
.task-ask__title { font-weight: var(--fw-semi); }
.task-ask__spread { margin-top: var(--sp-3); }
.task-ask__note { margin-top: var(--sp-2); font-size: var(--fs-xs); min-height: 1.2em; }

/* ── The staffing rows under a task's bar (projects/staffing-rows.js) ────── */
/* The caret that opens them. */
.sched-caret { flex: none; width: 1.1rem; margin-right: 2px; padding: 0; border: 0; background: none; color: var(--dim); font: inherit; font-size: .7rem; cursor: pointer; }
.sched-caret:hover, .sched-caret:focus-visible { color: var(--accent); }
.sched-caret--none { display: inline-block; cursor: default; }
/* The strip in the bar's own row: is the request for that period met? */
.sched-cell { position: relative; }
.sched-staff { position: absolute; left: 0; right: 0; bottom: 1px; height: 3px; }
.sched-staff--short { background: var(--bad); }
.sched-staff--staffed { background: var(--ok); }
.sched-staff--over { background: var(--warn); }
/* Figure rows: requested, assigned, a person. Lower and quieter than a bar row. */
.sched-fig > td { height: 1.75rem; padding-top: 0; padding-bottom: 0; background: var(--bg); }
.sched-fig__hdr > div { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); padding-left: 1.6rem; }
.sched-fig__hdr--person > div { justify-content: space-between; }
.sched-fig__hdr--person .availability-member__name { font-size: var(--fs-sm); color: var(--ink-2); }
.sched-grid .sched-fig .plan-rowhdr { background: var(--bg); }
.sched-fig__cell { text-align: center; padding-left: 0 !important; padding-right: 0 !important; border-left: 1px solid var(--line); font-size: var(--fs-xs); white-space: nowrap; }
.sched-req { cursor: text; }
.sched-req .needs-val { min-width: 2.6rem; padding: 0 5px; font-size: var(--fs-xs); line-height: 1.5; }
.sched-req:hover .needs-val, .sched-req:focus .needs-val { border-color: var(--accent); }
.sched-req:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.sched-req .plan-input { width: 3.4rem; height: 1.45rem; }
.sched-req .needs-badge { display: block; font-size: .6rem; line-height: 1; }
.sched-fig--assigned .needs-acell { height: 1.75rem; }
.sched-fig--person .availability-bar { height: 1rem; }
.sched-person-cell { cursor: cell; }
.sched-person-cell:hover { background: var(--accent-soft) !important; }
.sched-fig--person:last-of-type > td { border-bottom-color: var(--line-strong); }

/* A bar you may drag: the middle moves it, a grip at each end stretches it. */
.sched-bar[data-drag] { position: relative; cursor: grab; }
.sched-bar[data-drag]:hover { filter: brightness(1.08); }
.sched-grip { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.sched-grip--start { left: 0; }
.sched-grip--end { right: 0; }
.sched-grip::after { content: ''; position: absolute; top: 25%; bottom: 25%; left: 3px; width: 1px; background: color-mix(in srgb, var(--bar, var(--dim)) 45%, var(--ink)); opacity: 0; }
.sched-bar[data-drag]:hover .sched-grip::after { opacity: 1; }
.sched-row--dragging .sched-bar { filter: brightness(1.08); }
.sched-row--dragging .sched-dates { color: var(--accent); font-weight: var(--fw-bold); }
body.sched-dragging-move, body.sched-dragging-move * { cursor: grabbing !important; user-select: none; }
body.sched-dragging-size, body.sched-dragging-size * { cursor: ew-resize !important; user-select: none; }
/* A summary of sub-tasks: a bracket in the branch's colour, darkened, with
   a foot at each end. Not draggable: its dates are its sub-tasks'. */
.sched-bar--summary { position: relative; height: .4rem; background: color-mix(in srgb, var(--bar, var(--dim)) 55%, var(--ink)); box-shadow: none; border-radius: 0 !important; }
.sched-bar--summary.sched-bar--first::before, .sched-bar--summary.sched-bar--last::after {
  content: ''; position: absolute; top: 0; width: 3px; height: .85rem; background: inherit; border-radius: 0 0 2px 2px;
}
.sched-bar--summary.sched-bar--first::before { left: 0; }
.sched-bar--summary.sched-bar--last::after { right: 0; }
.sched-bar--child { height: .8rem; background: color-mix(in srgb, var(--bar, var(--dim)) 55%, var(--surface)); }
.sched-bar--proj { height: .4rem; background: var(--ink-2); box-shadow: none; }
.sched-ms { color: var(--dim); font-size: var(--fs-sm); }
.sched-ms-cell { text-align: center; color: var(--accent); font-weight: var(--fw-bold); font-size: .7rem; line-height: 1; }

/* ── Today — everyone's landing ───────────────────────────────────────────
   The org section is exception cards only (wireframes §4 note ①): a class
   with nothing wrong renders nothing at all, so there is no "healthy" styling
   to define. The briefing's styles follow .today-empty below. */
.today-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--sp-3); margin-bottom: var(--sp-3);
}
/* An adjacent-sibling margin from the shared card styles was landing on every
   card but the first, pushing them 12px down so the row's tops didn't line up
   and grid stretch couldn't equalise the heights. The grid's own `gap` owns
   the spacing here. */
.today-cards > .card { margin: 0; }
/* Plain uniform card, matching .person-card — no coloured left strip. A
   strip would be redundant here: severity
   is already carried by the glyph and by the chips on the count and pills,
   which is what satisfies the hue+glyph rule. */
.today-card { display: flex; flex-direction: column; gap: var(--sp-2); }
.today-card-head { display: flex; align-items: center; gap: var(--sp-2); }
.today-glyph { font-size: var(--fs-lg); }
.today-card--bad  .today-glyph { color: var(--bad); }
.today-card--warn .today-glyph { color: var(--warn); }
/* The cards sit in one stretching row, so their internal blocks have to line
   up or the row reads as broken. Reserving two rows of pills means the action
   and note sit at the same height on every card whether it has one item or
   four — and `align-content:start` keeps a single row hugging the top rather
   than floating in the middle of the reserved space. */
.today-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
  min-height: 3.75rem; align-content: start;
}
.today-more { font-size: var(--fs-sm); align-self: center; }
.today-action { margin-top: auto; }
/* Reserved for the same reason as the pills: a card without a second line of
   note text would otherwise pull its button up out of line with its
   neighbours. */

.today-empty { display: flex; align-items: center; gap: var(--sp-4); }
.today-empty-glyph {
  font-size: var(--fs-3xl); color: var(--ok);
  width: 3rem; height: 3rem; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill); background: var(--ok-soft);
}
.today-empty p { margin: 4px 0 0; }

/* The briefing (DECISIONS §24, relaid 2026-11-11) — one card, two columns
   from 1100px: the week on the left, the gauge, status and the "needs you"
   list on the right. Its type runs a step larger than the rest of the app:
   this is the page read at a glance on arrival, not a table. Reuses
   .today-glyph for the nudge glyphs so the severity colours are the ones the
   cards already use. */
.today-brief {
  display: grid; grid-template-columns: 1fr; gap: var(--sp-5);
  margin-bottom: var(--sp-3);
}
@media (min-width: 1100px) {
  .today-brief { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}
.today-brief-main, .today-brief-aside { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.today-brief-week { font-weight: var(--fw-bold); font-size: var(--fs-xl); }
.today-brief-gauge { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.today-brief-plan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-lg); }
.today-brief-plan li { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.today-brief-plan .num { margin-left: auto; }
.today-brief-empty, .today-brief-note, .today-brief-next, .today-brief-streak { margin: 0; font-size: var(--fs-base); }
.today-brief-streak__glyph { color: var(--ok); font-weight: var(--fw-bold); }
.today-brief-actions { margin-top: var(--sp-1); }

/* The day strip: one cell per day the grid shows. Today is outlined in the
   accent; a day off is sunken; a past working day with nothing logged is
   outlined in the warn colour — the one state the reader must notice; days
   ahead are dimmed. Each cell is a button to My week. */
.today-days { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--sp-2); }
.today-day {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 10px 12px; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: inherit; cursor: pointer; font: inherit; text-align: left;
}
.today-day:hover { background: var(--sunken); }
.today-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.today-day-name { font-size: var(--fs-sm); color: var(--dim); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .04em; }
.today-day-hours { font-family: var(--mono); font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.today-day-hours small { font-family: inherit; font-size: var(--fs-sm); font-weight: var(--fw-normal); color: var(--dim); margin-left: 1px; }
.today-day--today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.today-day--today .today-day-name { color: var(--accent); }
.today-day--off { background: var(--sunken); color: var(--dim); }
.today-day--off .today-day-hours { font-size: var(--fs-md); font-weight: var(--fw-normal); }
.today-day--ahead .today-day-hours { color: var(--dim); font-weight: var(--fw-normal); }
.today-day--missing { border-color: var(--warn); }
.today-day--missing .today-day-hours { color: var(--warn); }

.today-nudges {
  border-top: 1px solid var(--line); padding-top: var(--sp-3);
  display: flex; flex-direction: column; gap: var(--sp-2);
  font-size: var(--fs-base);
}
.today-nudges-title {
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
  letter-spacing: .05em; text-transform: uppercase; color: var(--dim);
}
.today-nudge { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.today-nudge--bad    .today-glyph { color: var(--bad); }
.today-nudge--warn   .today-glyph { color: var(--warn); }
.today-nudge--accent .today-glyph { color: var(--accent); }
.today-nudge-link { margin-left: auto; white-space: nowrap; }
.today-allclear { margin: 0; display: flex; align-items: center; gap: var(--sp-2); color: var(--dim); }
.today-allclear .today-glyph { color: var(--ok); }
/* The nudge text shrinks before it wraps, so the glyph never sits alone on a
   line above it; the link drops to its own line on a phone. */
.today-nudge > span:not(.today-glyph) { flex: 1 1 12ch; min-width: 0; }
@media (max-width: 640px) {
  .today-days { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); grid-auto-columns: auto; }
  /* Five cells across a 360 px phone leave each about 40 px of text. "8.0h"
     at the large size did not fit and showed as "8.…" (Peter's feedback on
     Kestrel, 2026-11-21). The number must always be whole: smaller digits,
     no unit (the HOURS total below carries it), tighter gaps. */
  .today-days { gap: var(--sp-1); }
  .today-day { padding: 8px 3px; }
  .today-day-name { font-size: var(--fs-xs); letter-spacing: 0; white-space: nowrap; }
  .today-day-hours { font-size: var(--fs-md); }
  .today-day-unit { display: none; }
  .today-brief-plan { font-size: var(--fs-base); }
  .today-nudge-link { margin-left: 0; flex-basis: 100%; }
}

/* ── Review — variance / compliance / balance ─────────────────────────────
   Same text-tab strip as the Projects detail pane (.proj-tab): a heavier
   segmented control here would compete with the toolbars inside each view. */
.review-tabs { display: flex; gap: var(--sp-4); margin-bottom: var(--sp-3); }
.review-tab {
  background: none; border: 0; padding: 0 0 var(--sp-1);
  color: var(--dim); cursor: pointer; font: inherit;
  border-bottom: 2px solid transparent;
}
/* Plan's tabs are links (each is its own view), drawn as Review's tabs. */
.plan-tabs .review-tab { text-decoration: none; }
.review-tab--active { color: inherit; font-weight: var(--fw-bold); border-bottom-color: var(--accent); }
.review-tab:focus-visible { outline: 2px solid var(--accent); border-radius: var(--r-sm); }

.review-toolbar { align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.review-table td, .review-table th { vertical-align: middle; }
.review-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* `.table th` sets text-align:left at a higher specificity than a lone class,
   so a numeric HEADER needs this or it stays left (seen live, 2026-11-11). */
.table th.review-num { text-align: right; }
.review-rowhead { text-align: left; }
.review-caret { color: var(--dim); }
.review-row { cursor: pointer; }
.review-row:hover { background: var(--sunken); }
.review-child td { color: var(--dim); font-size: var(--fs-sm); }

/* Hue AND glyph, never hue alone (DECISIONS.md §1) — the ✓/⚠/✗ beside every
   percentage is what carries the state for a reader who can't separate the
   greens from the reds. */
.review-ok   { color: var(--ok); }
.review-warn { color: var(--warn); }
.review-bad  { color: var(--bad); }
.review-none { color: var(--dim); }


/* Variance chart: label · bars · figure. The bar column is the flexible one,
   so rows stay aligned however long the project names are. */
.review-chart-row {
  display: grid; grid-template-columns: 180px 1fr 150px;
  gap: var(--sp-3); align-items: center; padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line);
}
.review-chart-row:last-child { border-bottom: 0; }
.review-chart-row--drillable { cursor: pointer; }
.review-chart-row--drillable:hover { background: var(--sunken); }
.review-chart-row--drillable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.review-chart-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-chart-bars { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
/* Same height, same radius, same left edge — the two bars are one comparison,
   so anything that differs between them should be carrying meaning. What
   differs is outline vs fill: the pairing has to survive greyscale, and there
   are no --chart-N-light tokens to lighten with.
   Both are width-sized to their own value (see the note in variance.js), so
   the pill radius lands on the real ends of the bar. */
.review-bar-planned,
.review-bar-actual { height: 12px; border-radius: var(--r-pill); min-width: 3px; }
.review-bar-planned { border: 1px solid var(--dim); background: transparent; }
.review-bar-actual { display: flex; overflow: hidden; }
/* Same colours and the same darker edge as the Plan's bars: the bright set
   is too pale to be its own edge on a light surface. */
.review-seg {
  display: block; min-width: 1px; background: var(--bar, var(--accent));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--bar, var(--accent)) 62%, var(--ink)),
              inset 0 -1px 0 color-mix(in srgb, var(--bar, var(--accent)) 62%, var(--ink));
}
.review-chart-figure { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Compliance: stat cards double as filters, so they have to look pressable. */
.review-stats { gap: var(--sp-3); margin-bottom: var(--sp-3); align-items: stretch; }
/* The shared `.card + .card` margin lands on every card after the first, so
   under align-items:stretch cards 2 and 3 gave up 12px of height to their own
   margin and came out shorter than card 1. Third time this has caught a card
   row (see .today-cards) — any horizontal row of .card needs this. */
.review-stats > .card { margin: 0; }
/* Fixed width, not content width. These are three readings of one measure and
   they sit side by side, so letting "Under 30 h" make its card wider than
   "Missing" reads as a difference in importance rather than in label length. */
.review-stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  cursor: pointer; text-align: left; margin: 0;
  flex: 0 0 auto; width: 150px;
}
.review-stat--active { border-color: var(--accent); background: var(--accent-soft); }
.review-stat-num { font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: 1.1; }

.compliance-grid { table-layout: fixed; }
/* Without this the button wraps to two lines and each row grows to ~90px,
   which turns an 8-week grid into a scroll. */
.compliance-grid .btn-nudge { white-space: nowrap; }
.compliance-wk { text-align: center; font-size: var(--fs-xs); }
.compliance-cell { text-align: center; font-weight: var(--fw-bold); }
.compliance-cell--ok   { color: var(--ok);   background: var(--ok-soft); }
.compliance-cell--warn { color: var(--warn); background: var(--warn-soft); }
.compliance-cell--bad  { color: var(--bad);  background: var(--bad-soft); }
/* Approval (#57): the cell itself is the control for whoever may act on it. */
.compliance-approval { font-weight: var(--fw-normal); }
.compliance-act {
  all: unset; cursor: pointer; display: block; width: 100%;
  text-align: center; font: inherit; color: inherit; border-radius: 4px;
}
.compliance-act:hover { text-decoration: underline; }
.compliance-act:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ── The week viewer (review/weeksheet.js, DECISIONS §25) ───────────────── */
.md--wide { max-width: 920px; }
.weeksheet-ttl { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.weeksheet-head { margin-bottom: var(--sp-3); gap: var(--sp-3); }
.weeksheet-card { padding: 0; overflow-x: auto; }
.weeksheet { min-width: 640px; }
.weeksheet td, .weeksheet th { white-space: nowrap; }
.weeksheet-col-day { width: 72px; }
.weeksheet-col-total { width: 80px; }
.weeksheet td:first-child { white-space: normal; overflow-wrap: anywhere; }
.weeksheet .weeksheet-notes { white-space: normal; max-width: 220px; font-size: var(--fs-sm); color: var(--ink-2); }
.weeksheet-empty, .weeksheet-note { margin: 0 0 var(--sp-3); }
.weeksheet-reopen { width: 100%; }
/* A chip that is also a button (Today's approval pills) */
.chip--btn { border: 0; cursor: pointer; font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-bold); }
.chip--btn:hover { filter: brightness(.95); text-decoration: underline; }
.chip--btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Balance: shape only, one neutral accent. No good/bad colouring anywhere —
   see the no-judgement note in review/balance.js. */
.balance-chart { display: flex; gap: var(--sp-3); align-items: flex-end; height: 180px; }
.balance-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.balance-track {
  flex: 1; width: 100%; display: flex; align-items: flex-end;
  background: var(--sunken); border-radius: var(--r-sm); overflow: hidden;
}
.balance-fill { width: 100%; background: var(--accent); border-radius: var(--r-sm) var(--r-sm) 0 0; }
.balance-col--beyond .balance-fill { opacity: .45; }
.balance-figure { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.balance-label { font-size: var(--fs-xs); }
.balance-beyond td { color: var(--dim); }

/* ── First run — setup strip (Today) and coach card (My week) ─────────────
   From the "Nudge" design handoff, 2026-08-09. Both surfaces are temporary
   by design: they derive from data and delete themselves once the work they
   describe is done, so nothing here should read as permanent chrome. */

.setup-strip { margin-bottom: var(--sp-3); }
.setup-strip-head { align-items: center; gap: var(--sp-3); }
.setup-strip-title { font-size: var(--fs-lg); font-weight: var(--fw-heavy); }
.setup-strip-sub { font-size: var(--fs-md); margin: 2px 0 0; }
/* Mono, like every other counter in the app — it changes 0→1→2→3 in place
   and a proportional font makes that shuffle sideways. */
.setup-progress-label {
  font-family: var(--mono); font-size: var(--fs-sm);
  font-weight: var(--fw-semi); color: var(--ink-2); white-space: nowrap;
}

.setup-progress {
  height: 5px; background: var(--sunken);
  border-radius: var(--r-pill); overflow: hidden; margin: var(--sp-3) 0 14px;
}
.setup-progress-fill { height: 100%; background: var(--accent); transition: width .25s; }

.setup-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.setup-step {
  border: 1px solid var(--line-strong); background: var(--bg);
  border-radius: var(--r-md); padding: var(--sp-3);
  display: flex; flex-direction: column; gap: 6px;
}
/* A done step recedes rather than celebrating: hairline border, plain
   surface. The work it points at is finished, so it should stop asking. */
.setup-step--done { border-color: var(--line); background: var(--surface); }

.setup-badge {
  width: 22px; height: 22px; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
  background: var(--sunken); color: var(--ink-2);
}
.setup-step--done .setup-badge { background: var(--ok-soft); color: var(--ok); }
.setup-step-title { font-size: var(--fs-md); }
/* Reserved height so the three action buttons sit on one line regardless of
   how long each body runs. */
.setup-step-body { font-size: var(--fs-sm); margin: 0; min-height: 3em; }
.setup-step-btn { align-self: flex-start; }

.today-empty-glyph--setup { color: var(--dim); background: var(--sunken); }

/* Coach card — accent-tinted so it reads as guidance rather than as another
   card of content, and bordered in the accent so it survives greyscale. */
.coach-card {
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-4);
}
.coach-title { color: var(--accent); }
.coach-steps {
  display: flex; flex-wrap: wrap; gap: 18px; margin-top: 6px;
  font-size: var(--fs-sm); color: var(--ink-2);
}
.coach-steps b { font-weight: var(--fw-bold); }
.coach-dismiss {
  flex: 0 0 auto; align-self: flex-start;
  background: transparent; border: 1.5px solid var(--accent); color: var(--accent);
}

/* Submit nudge — only rendered for a first-timer with a full unsubmitted
   week, so it never becomes the weekly wallpaper an always-on pulse would. */
.submit-hint {
  font-size: var(--fs-sm); font-weight: var(--fw-bold);
  color: var(--accent); align-self: center;
}
/* "Submit week" and "Recall" are two-word labels in a tight row; letting them
   break mid-label makes a working button look broken. */
.week-actions .btn { white-space: nowrap; }
/* color-mix rather than a literal rgba: this pulsed Fjord's teal regardless of
   theme, so a Graphite or dark user got a teal halo around a button that has
   no teal anywhere near it. The alpha has to be mixed in because a box-shadow
   spread cannot fade a solid colour on its own. */
@keyframes fr-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  50%      { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent); }
}
.submit-pulse { animation: fr-pulse 1.6s ease-in-out infinite; }
/* An indefinite pulse is exactly what this media query exists for. The hint
   text carries the same message without motion, so nothing is lost. */
@media (prefers-reduced-motion: reduce) {
  .submit-pulse { animation: none; }
  .setup-progress-fill { transition: none; }
}

/* Handoff §Responsive: below ~900px the steps stack and the header wraps,
   matching how the Today cards already behave. */
@media (max-width: 900px) {
  .setup-steps { grid-template-columns: 1fr; }
  .setup-step-body { min-height: 0; }
  .coach-card { align-items: flex-start; }
}

/* Narrow: the hint takes its own line above the buttons rather than being
   squeezed between Recall and Submit, where all three labels wrapped. It
   still reads as belonging to Submit because it sits directly above it and
   both are right-aligned. */
@media (max-width: 640px) {
  .week-actions { flex-wrap: wrap; justify-content: flex-end; }
  /* order:-1 puts the hint on the first line so Recall and Submit stay
     together on the second. Without it the full-width hint splits the two
     buttons onto separate lines and the row runs to three. */
  .submit-hint { flex: 1 0 100%; text-align: right; order: -1; }
}

/* ── My time ───────────────────────────────────────────────────────────────
   Its own classes rather than borrowing Review's: the two views answer
   different questions, and Review's bar carries a planned reference bar this
   one has no equivalent of. Sharing the markup would have coupled a personal
   summary to a manager's analysis for the sake of ~15 lines. */
.mytime-summary {
  display: flex; flex-wrap: wrap; gap: var(--sp-5);
  align-items: baseline; margin-bottom: 12px;
}
.mytime-total { display: flex; flex-direction: column; gap: 2px; }
.mytime-total-value { font-size: var(--fs-2xl); font-weight: var(--fw-bold); }
.mytime-splits { display: flex; flex-wrap: wrap; gap: var(--sp-5); }
.mytime-split { display: flex; flex-direction: column; gap: 2px; }
.mytime-split-value { font-weight: var(--fw-bold); }

.mytime-h { margin: 0 0 2px; font-size: var(--fs-md); }

.mytime-group { margin-bottom: var(--sp-2); }
.mytime-group:last-child { margin-bottom: 0; }

/* The project row is a real <button> so the disclosure is keyboard-operable
   and announces its state; these rules undo the button chrome so it still
   reads as a row of the table it sits in. */
.mytime-row--project {
  width: 100%; background: none; border: 0; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
  border-radius: var(--r-md); padding: var(--sp-2) var(--sp-2);
}
.mytime-row--project:hover { background: var(--sunken); }
.mytime-row--project .mytime-label { font-weight: var(--fw-bold); }
.mytime-row--project .mytime-bar { height: 14px; }

/* Indented under their project, and dimmer, so the eye reads the project
   level first and the tasks as detail belonging to it. */
.mytime-row--task .mytime-label { padding-left: var(--sp-5); }
.mytime-row--task { padding-left: var(--sp-2); padding-right: var(--sp-2); }

.mytime-count { font-weight: var(--fw-normal); font-size: var(--fs-xs); margin-left: var(--sp-1); }

/* Label | bar | figure. The label column is fixed so every bar starts at the
   same x — bars that begin at different offsets can't be compared by eye,
   which is the entire job of this page. */
.mytime-row {
  display: grid; grid-template-columns: 12rem 1fr 7rem;
  align-items: center; gap: var(--sp-3); padding: 3px 0;
}
.mytime-label {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-sm);
}
.mytime-track { min-width: 0; }
.mytime-bar {
  display: block; height: 12px; border-radius: var(--r-pill); min-width: 3px;
}
.mytime-figure {
  text-align: right; font-family: var(--mono);
  font-size: var(--fs-sm); white-space: nowrap;
}
/* ── Month by month: columns ───────────────────────────────────────────────
   Axis | plot over months. The plot is a fixed height so three months and
   twelve read on the same scale; a column's stack is a % of it. */
.mytime-cols {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: 190px auto;
  column-gap: var(--sp-2); row-gap: var(--sp-2);
  /* Room for a figure above a column that reaches the top of the scale —
     every column does on Share — plus air under the buttons. */
  margin-top: calc(var(--sp-5) + 1.75rem);
}
.mytime-cols { --bar: var(--accent); }
.mytime-cols__axis { position: relative; min-width: 2.2rem; }
.mytime-cols__axis span {
  position: absolute; right: 0; transform: translateY(50%);
  font-family: var(--mono); font-size: var(--fs-xs); color: var(--dim);
}
.mytime-cols__plot {
  position: relative; display: flex; align-items: flex-end; gap: clamp(4px, 2.5%, 28px);
  padding: 0 clamp(2px, 1.5%, 16px); border-bottom: 1px solid var(--line);
}
.mytime-cols__line {
  position: absolute; left: 0; right: 0; height: 0;
  border-top: 1px dashed var(--line); opacity: .7;
}
.mytime-cols__line:first-child { display: none; }      /* the baseline is the border */
.mytime-col {
  position: relative; flex: 1 1 0; min-width: 0; height: 100%;
  display: flex; align-items: flex-end; justify-content: center;
}
.mytime-col__stack {
  position: relative; width: 100%; max-width: 96px; min-height: 0;
}
.mytime-col__bar {
  display: block; height: 100%; min-height: 3px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bar) 78%, white) 0%, var(--bar) 55%);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 35%, transparent);
  transform-origin: bottom;
  animation: mytime-rise .7s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i) * 55ms);
  transition: filter .15s, transform .15s;
}
.mytime-col__value {
  position: absolute; left: 50%; transform: translateX(-50%);
  padding-bottom: 5px; white-space: nowrap;
  font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted);
  animation: mytime-fade .35s ease both;
  animation-delay: calc(var(--i) * 55ms + .45s);
}
.mytime-col:hover .mytime-col__bar { filter: brightness(1.12) saturate(1.1); }
.mytime-col:hover .mytime-col__value { color: var(--ink); font-weight: var(--fw-bold); }
.mytime-cols__plot:hover .mytime-col:not(:hover) .mytime-col__bar { filter: saturate(.55) opacity(.6); }
/* This month is not finished: hatched, so a short column is not read as a
   bad month. */
.mytime-col--now .mytime-col__bar {
  background:
    repeating-linear-gradient(135deg, transparent 0 6px,
      color-mix(in srgb, var(--surface, white) 45%, transparent) 6px 9px),
    linear-gradient(180deg, color-mix(in srgb, var(--bar) 78%, white) 0%, var(--bar) 55%);
}
.mytime-cols__months {
  grid-column: 2; display: flex; gap: clamp(4px, 2.5%, 28px);
  padding: 0 clamp(2px, 1.5%, 16px);
}
.mytime-cols__months span {
  flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap;
  font-size: var(--fs-sm); color: var(--dim);
}
.mytime-cols__months .mytime-cols__now { color: var(--ink); font-weight: var(--fw-bold); }
.mytime-cols__note { margin: var(--sp-2) 0 0; font-size: var(--fs-xs); text-align: right; }
.mytime-cols--dense .mytime-cols__months span { font-size: var(--fs-xs); }
/* Stacked: the column becomes a clipped stack of slices, bottom first. The
   column still rises as one piece. */
.mytime-cols__head { justify-content: space-between; align-items: center; gap: var(--sp-3); }
.mytime-cols, .mytime-legend {
  --mytime-holiday: color-mix(in srgb, var(--warn) 70%, var(--surface));
}
.mytime-cols--stacked .mytime-col__bar {
  display: flex; flex-direction: column-reverse; overflow: hidden;
  background: none; box-shadow: none;
}
.mytime-cols--stacked .mytime-cols__plot:hover .mytime-col:not(:hover) .mytime-col__bar,
.mytime-cols--stacked .mytime-col:hover .mytime-col__bar { filter: none; }
.mytime-seg {
  display: block; flex: 1 1 0; min-height: 2px;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--surface) 70%, transparent);
  transition: opacity .15s, filter .15s;
}
.mytime-col--now .mytime-seg {
  background-image: repeating-linear-gradient(135deg, transparent 0 6px,
    color-mix(in srgb, var(--surface, white) 45%, transparent) 6px 9px);
}
.mytime-has-hot .mytime-seg:not(.is-hot) { opacity: .28; }
.mytime-has-hot .mytime-seg.is-hot { filter: brightness(1.08) saturate(1.1); }
.mytime-legend {
  list-style: none; margin: var(--sp-3) 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4);
  font-size: var(--fs-sm);
}
.mytime-legend li { display: flex; align-items: center; gap: 6px; cursor: default; transition: opacity .15s; }
.mytime-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.mytime-has-hot .mytime-legend li:not(.is-hot) { opacity: .45; }
/* The contracted-hours mark: a short dark line across the column, a little
   wider than the bar so it shows whether the bar stops under it or passes. */
.mytime-col__target {
  position: absolute; left: 50%; width: min(100%, 112px); transform: translate(-50%, 50%);
  height: 2px; border-radius: 1px; background: var(--ink); opacity: .78; z-index: 1;
  animation: mytime-fade .35s ease both; animation-delay: calc(var(--i) * 55ms + .45s);
}
.mytime-legend .mytime-legend__target { height: 2px; width: 14px; border-radius: 1px; background: var(--ink); }
@keyframes mytime-rise { from { transform: scaleY(0); } to { transform: none; } }
@keyframes mytime-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .mytime-col__bar, .mytime-col__value, .mytime-col__target { animation: none; }
}
@media (max-width: 640px) {
  .mytime-cols { grid-template-rows: 160px auto; }
  .mytime-col__value { font-size: .62rem; }
  .mytime-cols__months span { font-size: var(--fs-xs); }
  .mytime-cols__rest { display: none; }
  /* More than a year on a phone: the columns are too narrow for a figure
     each; the scale and the tooltips carry the hours. */
  .mytime-cols--many .mytime-col__value { display: none; }
  .mytime-cols--many .mytime-cols__months span { font-size: .6rem; }
  .mytime-cols--dense .mytime-cols__plot,
  .mytime-cols--dense .mytime-cols__months { gap: 3px; padding: 0 2px; }
}

/* 7rem: "1,234h · 65%" in the mono face. At 4.5rem the share wrapped under
   the hours and the row grew by a line (Peter, 2026-11-11). */

/* One column on a phone: a 12rem label plus a bar plus a figure cannot all
   survive 375px, and the bar is the part worth keeping full width. */
@media (max-width: 640px) {
  .mytime-row { grid-template-columns: 1fr 7rem; }
  .mytime-label { grid-column: 1 / -1; }
}

/* A schedule task row is now a control — it opens the date editor. Cursor and
   hover say so, and the focus ring matters because the row is reachable by Tab
   (milestone and project rows deliberately are not). */
/* A gap you may fill: a button that opens the booking dialog. */
.needs-gap { font: inherit; font-weight: var(--fw-bold); color: inherit; background: none; border: 0; padding: 0 2px; border-radius: var(--r-sm); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.needs-gap:hover { text-decoration-style: solid; }
.needs-gap:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sched-row--editable { cursor: pointer; }
.sched-row--editable:hover .sched-rowhdr { background: var(--sunken); }
.sched-row--editable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ── Import preview ────────────────────────────────────────────────────────
   The list can run to hundreds of rows on a real plan, so it scrolls inside
   the dialog rather than pushing the Import button off-screen — the button
   must stay reachable without scrolling past everything it is about to do. */
.import-preview { margin-top: var(--sp-2); }
.import-list {
  max-height: 34vh; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--sunken);
}
.import-row {
  display: grid; grid-template-columns: 20px 1fr auto; gap: var(--sp-2);
  align-items: baseline; padding: 5px var(--sp-3);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.import-row:last-child { border-bottom: 0; }
.import-glyph { font-weight: var(--fw-bold); text-align: center; }
.import-glyph--add  { color: var(--ok); }
.import-glyph--upd  { color: var(--accent); }
/* Dimmer on purpose: these rows are the ones NOT being touched, and the eye
   should skip them on the way to what is. */
.import-glyph--keep { color: var(--warn); }
.import-row:has(.import-glyph--keep) { opacity: .6; }
.import-name { overflow: hidden; text-overflow: ellipsis; }
.import-detail { font-size: var(--fs-xs); white-space: nowrap; }
.import-bookable { margin-left: var(--sp-2); font-size: var(--fs-xs); }

/* Column mapping — CSV imports only. Two columns on desktop so six pickers
   don't push the preview below the fold; one on narrow screens. */
.import-map {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-3); margin-bottom: var(--sp-4);
  background: var(--sunken); border-radius: var(--r-md);
}
.import-map-head {
  grid-column: 1 / -1; display: flex; justify-content: space-between;
  align-items: baseline; font-weight: var(--fw-bold); font-size: var(--fs-sm);
}
.import-map-head .muted { font-weight: var(--fw-normal); font-size: var(--fs-xs); }
.import-map-field { margin: 0; }
.import-map-note { grid-column: 1 / -1; font-size: var(--fs-xs); margin: 0; }
/* Only when the format could not be inferred — then it really is a guess. */
.import-map-note.import-map-warn { color: var(--warn); font-weight: var(--fw-bold); }
.import-map .md-err { grid-column: 1 / -1; }
@media (max-width: 560px) { .import-map { grid-template-columns: 1fr; } }

/* A compliance cell for someone who is not measured at all — an ad-hoc
   consultant. Deliberately neutral rather than green: "there is no bar" is a
   different fact from "met the bar", and colouring it as a pass would make the
   grid claim something it does not know. */
.compliance-cell--none { color: var(--dim); background: var(--sunken); }

/* The scope toggle — a lens, not a lock (Phase 1, DECISIONS §18). Chip-shaped
   like the org-load chip, because it is the same kind of thing: a compact
   statement of what you are looking at that you can act on. */
.scope-toggle { cursor: pointer; font: inherit; background: var(--accent-soft); color: var(--accent); }
/* The three-way scope switch (components/viewhead.js). */
.scope-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.scope-switch__btn { padding: 4px 10px; border: 0; border-left: 1px solid var(--line-strong); background: none; color: var(--ink-2); font: inherit; font-size: var(--fs-sm); cursor: pointer; white-space: nowrap; }
.scope-switch__btn:first-child { border-left: 0; }
.scope-switch__btn:hover { background: var(--sunken); }
.scope-switch__btn.is-on { background: var(--accent-soft); color: var(--accent); font-weight: var(--fw-semi); }
.scope-switch__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.scope-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Resource-need cell badges (Phase 3). Small and quiet: most cells carry no
   badge at all, and the ones that do are saying something short — who was
   asked for, or where the ask stands. */
.needs-badge { display:block; font-size:var(--fs-xs); line-height:1.2; margin-top:2px;
               white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; }
.needs-badge--muted { color: var(--ink-3); }
.needs-badge--warn  { color: var(--warn); }
.needs-badge--ok    { color: var(--ok); }

/* ── The tour (DECISIONS §19) ─────────────────────────────────────────────
   The ring is pointer-events:none and its giant box-shadow provides the page
   dim — deliberately NOT a modal scrim: the page stays clickable, including
   the thing being pointed at. The card is the only interactive element. */
.tour { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.tour-ring {
  position: fixed; display: none;
  border: 2px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: 0 0 0 100vmax var(--overlay);
  transition: top .18s ease, left .18s ease, width .18s ease, height .18s ease;
}
.tour-card {
  position: fixed; display: none;
  width: min(340px, calc(100vw - 24px));
  pointer-events: auto;
  background: var(--surface);
  border-radius: var(--r-lg);
  border-top: 3px solid var(--accent);
  box-shadow: var(--elev-4);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
}
.tour-card__title { font-weight: 800; margin-bottom: var(--sp-1); }
.tour-card__body { color: var(--ink-2); font-size: var(--fs-sm); line-height: var(--lh-loose); margin: 0 0 var(--sp-3); }
.tour-card__row { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); }
.tour-card__btns { display: flex; gap: var(--sp-2); }
.tour-card__close {
  position: absolute; top: 6px; right: 8px;
  background: none; border: 0; cursor: pointer;
  color: var(--ink-3); font-size: var(--fs-sm); padding: 4px;
}
.tour-card__close:hover { color: var(--ink-1); }

/* The topbar ? — same visual family as the account button. */
/* Its own positioned host, matching .account — openPopover() appends into
   this element and needs it non-static or the menu positions against the
   page instead of the button. Found live 2026-08-19: the button opened the
   menu (aria-expanded flipped, the DOM node existed) but rendered nowhere
   near the ?, indistinguishable from the button doing nothing at all. */
.topbar__help-wrap { position: relative; margin-right: var(--sp-3); }
.topbar__help {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-weight: 700; cursor: pointer;
}
.topbar__help:hover { color: var(--ink-1); border-color: var(--ink-3); }

/* ── Feedback (DECISIONS §26) ─────────────────────────────────────────────
   The topbar button exists only on a demo or trial instance. Same family as
   the ? beside it, and the same size: an icon alone at every width. It
   carried the word "Feedback" on a desktop until Peter's own first report
   through it (2026-11-21): the icon says it. */
.topbar__feedback {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; margin-right: var(--sp-2);
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); cursor: pointer; flex: none;
}
.topbar__feedback:hover { color: var(--ink-1); border-color: var(--ink-3); }
@media (max-width: 640px) {
  .topbar__feedback { margin-right: 0; }
  /* The bar must fit a 360 px phone with the feedback button in it. Found
     live 2026-11-21 on Kestrel: the bar was wider than the screen, so the
     whole page scrolled sideways. The name goes; the initials stay, and the
     account menu opens with the name. */
  .topbar { gap: var(--sp-2); padding: 0 var(--sp-3); }
  .topbar__help-wrap { margin-right: 0; }
  .account__name { display: none; }
  .account__btn { padding: var(--sp-1); }
}
.menu__name { display: none; font-weight: var(--fw-bold); padding: 0 var(--sp-3); }
@media (max-width: 640px) { .menu__name { display: block; } }
.fb-note {
  width: 100%; min-height: 8rem; resize: vertical;
  padding: var(--sp-3); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink-1); font: inherit; line-height: var(--lh-loose);
}
.fb-note:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* A dialog with a picture in it needs the width; a note alone does not. */
.md.md--wide { max-width: min(920px, 100%); }
/* With a picture the note gives up some height, or the picture is below the fold. */
.md--wide .fb-note { min-height: 4.5rem; height: 4.5rem; }
.fb-pic-empty, .fb-pic-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.fb-pic-bar { margin-bottom: var(--sp-2); }
.fb-pic-hint { flex: 1; min-width: 12rem; font-size: var(--fs-sm); }
.fb-pic-paste { font-size: var(--fs-sm); }
.fb-pic-tools { display: inline-flex; gap: 4px; }
.fb-pic-tools [aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
/* Sized by its own pixels, shrunk to fit: both caps and no fixed side keep
   the picture's shape. touch-action none, or a finger drag scrolls the
   dialog instead of drawing. */
.fb-pic-canvas {
  display: block; max-width: 100%; max-height: 52vh; margin: 0 auto;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none;
}
@media (pointer: coarse) { .fb-pic-paste { display: none; } }
.fb-count { min-height: 1.2em; font-size: var(--fs-sm); text-align: right; }
.fb-privacy { font-size: var(--fs-sm); margin: 0; }
/* The dialog's quiet third action ("What you've sent", Delete): a text
   link, so three full buttons never have to fit a phone's width. */
.fb-link {
  border: 0; background: none; padding: 0; font: inherit; color: var(--accent);
  text-decoration: underline; cursor: pointer;
}
.fb-link--danger { color: var(--bad); margin-right: auto; }
.fb-item { padding: var(--sp-3) 0; border-top: 1px solid var(--line); }
.fb-item:first-child { border-top: 0; padding-top: 0; }
.fb-item-head { font-size: var(--fs-sm); }
/* pre-wrap keeps the sender's own line breaks; anywhere stops one long
   unbroken string (a pasted URL) from widening the dialog. */
.fb-note-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: var(--sp-2) 0 0; color: var(--ink-1); }
.fb-picture-slot { margin-top: var(--sp-2); }
.fb-picture { display: block; max-width: 100%; height: auto; margin-bottom: var(--sp-1); border: 1px solid var(--line); border-radius: var(--r-md); }
.fb-context {
  display: grid; grid-template-columns: max-content 1fr; gap: 2px var(--sp-3);
  margin: 0; padding-top: var(--sp-3); border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.fb-context dt { color: var(--dim); }
.fb-context dd { margin: 0; overflow-wrap: anywhere; }
.fb-error { display: block; padding: 8px; }
.fb-list { list-style: none; margin: var(--sp-3) 0 0; padding: 0 0 var(--sp-2); }
.fb-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line);
}
.fb-row--handled { opacity: .6; }
/* The whole entry is the control: a real button, reachable by keyboard. */
.fb-open {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
  border: 0; background: none; padding: 0; font: inherit; color: inherit;
  text-align: left; cursor: pointer;
}
.fb-open-note { color: var(--ink-1); font-weight: var(--fw-semi); overflow-wrap: anywhere; }
.fb-open:hover .fb-open-note { text-decoration: underline; }
.fb-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fb-open-meta { font-size: var(--fs-sm); }

/* ── Copy last week (Week) ────────────────────────────────────────────────
   A plain list: the reader is checking "is that the right set", not
   editing. Rows already on this week stay in the list, dimmed and labelled,
   so what will NOT be added is as visible as what will. */
.copy-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 40vh; overflow-y: auto; }
.copy-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-1) var(--sp-2); border-radius: var(--r-sm); }
.copy-row__name { flex: 1; min-width: 0; }
.copy-row--here { color: var(--dim); }
.copy-row .num { margin-left: auto; white-space: nowrap; }

/* ── "Saved" hint (Week) ──────────────────────────────────────────────────
   Fades in and out on its own; the element is re-rendered with every
   paint after a save, so the animation restarts per write. */
.saved-hint {
  font-size: var(--fs-sm); color: var(--dim); white-space: nowrap;
  animation: saved-fade 2.4s ease forwards;
}
@keyframes saved-fade { 0% { opacity: 0; } 12% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .saved-hint { animation: none; } }

/* ── Keyboard shortcut sheet ──────────────────────────────────────────────*/
kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 6px; text-align: center;
  font-family: var(--mono); font-size: var(--fs-xs); line-height: 1.5;
  color: var(--ink-2); background: var(--sunken);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--r-xs);
}
.menu__item kbd { margin-left: auto; }
.shortcut-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-5) var(--sp-6); }
.shortcut-group__title {
  font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .07em;
  text-transform: uppercase; color: var(--dim); margin-bottom: var(--sp-2);
}
.shortcut-list { margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.shortcut { display: flex; align-items: baseline; gap: var(--sp-3); }
.shortcut dt { flex: 0 0 auto; white-space: nowrap; }
.shortcut dd { margin: 0; color: var(--ink-2); }
.shortcut__plus { margin: 0 3px; color: var(--dim); font-size: var(--fs-xs); }

/* ── Time-entry picker (Week · Add to timesheet) ──────────────────────────
   Search on top, one scrolling list of groups below; options are buttons so
   they are focusable and ↑/↓ can walk them (week.js openPicker). */
.picker { display: flex; flex-direction: column; gap: var(--sp-3); }
.picker__search {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  padding: 8px 12px; font: inherit; font-size: var(--fs-md); color: var(--ink);
  background: var(--surface);
}
.picker__search:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--accent); }
.picker__list { max-height: min(52vh, 420px); overflow-y: auto; margin: 0 calc(var(--sp-2) * -1); padding: 0 var(--sp-2); }
.picker__group + .picker__group { margin-top: var(--sp-2); }
.picker__group-title {
  padding: var(--sp-2) var(--sp-2) var(--sp-1);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .07em;
  text-transform: uppercase; color: var(--dim);
}
.picker__opt {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; text-align: left;
  background: none; border: 0; cursor: pointer; color: var(--ink);
  padding: 7px var(--sp-2); border-radius: var(--r-md); font: inherit; font-size: var(--fs-md);
}
.picker__opt:hover { background: var(--sunken); }
.picker__opt:focus-visible { outline: none; box-shadow: var(--focus); }
.picker__opt-label { flex: 1; min-width: 0; }
.picker__opt-note { font-size: var(--fs-xs); color: var(--dim); white-space: nowrap; }
.picker__opt--other { color: var(--ink-2); }
.picker__empty { margin: 0; padding: var(--sp-2); font-size: var(--fs-sm); }

/* ── Row toggles and cell buttons (review UX-5, 2026-11-11) ───────────────
   A project header that collapses, a Variance row that expands, and a My
   plan leave cell were clickable rows and cells with nothing a keyboard
   could reach. Each now holds a real <button>; these make it look exactly
   like the text it wraps, so nothing changes for a mouse user. The global
   :focus-visible ring still applies — that is the point. */
.rowtoggle, .cellbtn {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: inherit; cursor: pointer;
}
.rowtoggle { display: inline; font-weight: inherit; }
.cellbtn { display: block; width: 100%; min-height: 1.6em; }
