/* Action Centre — InsideOut London.
   Per the iol-interface-guidelines skill: this is a SCREEN, not a document.
   Dark is the default ground; light is the same markup with the tokens
   swapped. Nothing below the two :root blocks names a colour directly.

   Mobile-first: PMs use this on site, one-handed, in daylight.

   ============================================================================
   WHY DARK FIRST, AND WHAT IT CHANGED
   ============================================================================
   The old stylesheet was a cream document brought to a screen. It worked, and
   it carried two compromises that the dark ground removes outright:

   1. The split tokens are gone. Cream needed --sig-high (the stripe) and
      --sig-high-ink (the word), because the same hue could not be both a 3:1
      graphic and a 4.5:1 piece of 10px type on a light ground. On #17191B the
      light-side hues clear 4.5:1 as TEXT and still read as stripes, so one
      token does both jobs. --sig-done-ink and --bronze-ink collapse the same
      way. In the LIGHT theme the single value is the old ink value
      (#94570A, #2F6E42, #96552C) — so the light stripe is a shade darker than
      it used to be, and the light word is unchanged. That is the trade, taken
      deliberately: one token per meaning beats a stripe that is a hair
      brighter.

   2. The argument the split was defending still holds and is still enforced:
      A STRIPE IS A GRAPHIC AND CLEARS AT 3:1. A 10px TRACKED WORD IS TEXT AND
      HAS TO CLEAR 4.5:1. Every hue below is quoted at its measured ratio
      against --surface-base in its own theme, and every one of them is used
      for small type somewhere, so every one of them clears 4.5:1. The floor
      is --ink-quiet at 4.9:1. Nothing lighter than that carries a word.

   COLOUR MEANS SOMETHING OR IT IS NOT HERE. Five signal hues, one brand
   affordance per screen, and low priority gets no colour at all — nothing to
   flag is the signal. Every state carries a second, non-colour cue: done is
   green AND struck through AND ticked; on the go is blue AND labelled;
   blocked is red AND tinted AND carries a written reason. Assume the reader
   is colour-blind, in sunlight, or both. */

/* ========================================================================== */
/* TOKENS — DARK (default)                                                    */
/* ========================================================================== */
:root[data-theme="dark"] {
  /* ---- Surfaces ---- */
  --surface-base:   #17191B;  /* the page ground                             */
  --surface-raised: #1E2124;  /* cards, panels, rows, inputs                 */
  --surface-accent: #23262A;  /* active nav item, selected row               */
  --surface-rail:   #121416;  /* the desktop rail AND the phone tab bar —
                                  the same surface doing the same job on two
                                  edges of the screen                        */

  /* ---- Rules ---- */
  --line-hair:   #2C3034;     /* every default rule                          */
  --line-strong: #3A3F44;     /* focused/selected borders, secondary buttons */

  /* ---- Ink. Ratios measured against --surface-base. ---- */
  --ink-primary:   #F2EDE4;   /* 15.3:1 — titles, read first                 */
  --ink-secondary: #C4BEB5;   /* 10.1:1 — secondary labels, tabs at rest     */
  --ink-muted:     #A8A29A;   /*  7.1:1 — body copy                          */
  --ink-quiet:     #8B857C;   /*  4.9:1 — mono facts, tracked labels. FLOOR. */
  --ink-disabled:  #6F6A62;   /*  3.3:1 — UI ONLY. Unset stars, empty ticks.
                                  Never a word. A control has to be findable
                                  at 3:1; a word has to be readable at 4.5:1,
                                  and this is not that.                      */

  /* ---- Brand. One affordance per screen: the running tracked label, the
          primary link, the FAB. Not decoration. ---- */
  --brand: #D08B52;           /*  6.4:1                                      */

  /* ---- Signals. The complete set is five. If a status needs nuance, the
          nuance goes in prose, not in a sixth hue. ---- */
  --sig-urgent:   #E8695C;    /*  5.6:1 — urgent, overdue, blocked, over cap */
  --sig-high:     #E0993C;    /*  7.5:1 — high, over estimate, NO ESTIMATE   */
  --sig-progress: #6FA8DC;    /*  7.1:1 — on the go, focus ring, links       */
  --sig-done:     #6FBF87;    /*  8.2:1 — done, on or under estimate         */
  /* Chase has its own hue, and this is the one decision worth restating.
     Chase used to wear High's orange, on the argument that a filled pill with
     a bell and the word "Chase" on it could not be mistaken for a 4px bar on
     a row's edge. On a busy row both read as "orange thing wants me", and you
     should not have to work out which. So: a fifth hue, dark enough in light
     and light enough in dark to carry 10px type, and separable from urgent
     red for a colour-blind reader — which is the check that eliminated the
     other candidates, not taste. It appears in exactly one place, the Chase
     pill, so it never has to work as a thin mark. */
  --sig-chase:    #BE85CE;    /*  6.4:1                                      */
  --on-signal:    #17191B;    /* text sitting ON a filled signal colour      */

  /* ---- Tints. Flat, not gradients: the guidelines ban gradient washes, and
          a wash cannot be a token. Blocked is the only row state that tints
          the row itself, because it is the only one where the task cannot
          move without somebody else. ---- */
  --tint-blocked:  #2A1D1C;
  --tint-selected: #202A33;

  /* ---- Overlay furniture ---- */
  --scrim: rgba(0, 0, 0, 0.62);
  --shadow-overlay: 0 14px 34px rgba(0, 0, 0, 0.45);   /* the ONE shadow     */

  /* appearance:none takes the native select arrow with it, so we draw one.
     The stroke colour lives here rather than inline in the rule, because an
     inline data URI is a hardcoded colour wearing a disguise. */
  --select-caret: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23A8A29A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  /* ---- Type. Three faces, each with one job. Loaded by index.php. ---- */
  --sans:  'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Bodoni Moda', Georgia, serif;   /* the screen's own name, once   */
  --mono:  'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* ---- Metrics ---- */
  --gutter: 16px;          /* one gutter; .app widens its own padding at 720 */
  --radius: 4px;           /* chips and buttons                              */
  --radius-md: 6px;        /* cards                                          */
  --radius-pill: 20px;     /* pill-shaped controls only                      */
  --side-panel: 400px;     /* the desktop detail pane                        */
  --rail: 232px;           /* the desktop rail                               */
  --logo-gate: 232px;      /* the sign-in lockup — the same 232px as the rail,
                              which is not a coincidence: the gate is the
                              console's first screen.                        */
  /* --topbar-h is set on <html> by measureTopbar() in app.js, not here. It
     is measured rather than guessed because the bar is a different element
     at each size — .conhead from 720px up, .topbar below it — and every
     sticky heading and the side pane hang off it. Whichever bar is actually
     on screen is the one that must be measured. */
}

/* ========================================================================== */
/* TOKENS — LIGHT (the same design, swapped)                                  */
/* ========================================================================== */
/* Nothing is repositioned here. If a change needed a second layout to work in
   light, the change would be wrong. Ratios are measured against #EFEAE0. */
:root[data-theme="light"] {
  --surface-base:   #EFEAE0;
  --surface-raised: #F5F0E8;
  --surface-accent: #E4DED2;
  --surface-rail:   #E7E1D5;

  --line-hair:   #D5CCBF;
  --line-strong: #C9B7B0;

  --ink-primary:   #1A1A1A;
  --ink-secondary: #3A3D40;
  --ink-muted:     #6A655D;
  --ink-quiet:     #877F75;   /* 4.9:1 — same floor, same job               */
  --ink-disabled:  #9A948B;   /* 3.3:1 — UI only, never a word              */

  /* Print bronze #B66A3B is 3.4:1 on cream: fine for a 2px rule, short of
     what a 10px tracked label needs. It stays in brand v2 for documents.
     Screens use this, the same family carried down to 4.8:1. */
  --brand: #96552C;

  --sig-urgent:   #8B2A23;
  --sig-high:     #94570A;
  --sig-progress: #1F63A8;
  --sig-done:     #2F6E42;
  --sig-chase:    #6A2E7A;
  --on-signal:    #EFEAE0;

  --tint-blocked:  #E9DCD6;
  --tint-selected: #DFE5EC;

  --scrim: rgba(26, 26, 26, 0.45);
  --shadow-overlay: 0 14px 34px rgba(0, 0, 0, 0.45);

  --select-caret: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%236A655D' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --sans:  'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Bodoni Moda', Georgia, serif;
  --mono:  'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --gutter: 16px;
  --radius: 4px;
  --radius-md: 6px;
  --radius-pill: 20px;
  --side-panel: 400px;
  --rail: 232px;
  --logo-gate: 232px;
}

/* ========================================================================== */
/* DENSITY — COMFORTABLE (default) AND COMPACT                                */
/* ========================================================================== */
/* The same trick as the light theme, on a second axis. Density is a block of
   values on the root, swapped by data-density; nothing below names a size
   that density owns. The two are independent: dark compact, light comfortable
   and every other pairing are all one markup.

   THE ROW IS WHERE THIS IS WON, AND NOT WHERE YOU WOULD THINK.
   A row's height is max(tick, title line) plus padding. The tick is 17px
   drawn and the title at 12.5/1.25 is 15.6px, so THE TICK SETS THE FLOOR —
   shrinking the type alone buys nothing. Every pixel of row height is bought
   from padding and spent on padding. 66px to 36px, nine rows to seventeen in
   the same 620px.

   THREE THINGS DO NOT SHRINK. Tracked labels stay 10px/0.2em, status chips
   stay 9.5px — below that a wide-tracked word stops being a word. And the
   44px hit area is untouched: the tick and star shrink as drawn circles and
   keep their reach, which is what .task-check::before is for.

   ONE THING GETS LOUDER. At 10px the mono facts step UP from --ink-quiet to
   --ink-muted. Smaller type needs more contrast to read the same, the token
   above it is already measured, and it costs nothing. */
:root {
  --d-row-pad-y:    12px;
  --d-row-gap:      12px;
  --d-row-title:    15px;
  --d-row-lead:     1.35;
  --d-fact-size:    11px;
  --d-fact-ink:     var(--ink-quiet);
  --d-tick:         22px;
  --d-tick-mt:      1px;

  --d-sec-mb:       34px;
  --d-sec-rule:     8px 0 14px;
  --d-sec-title:    19px;

  --d-card-pad:     12px 13px;
  --d-card-title:   13px;

  --d-hero-pad:     20px 18px 18px;
  --d-hero-title:   25px;
  --d-hero-lead:    1.22;
  --d-hero-facts-mb: 18px;
  --d-hero-btn:     50px;

  --d-app-pad:      20px var(--gutter) 64px;
  --d-app-pad-wide: 28px 28px 110px;
  --d-body:         13.5px;

  --control-h:      46px;
}

:root[data-density="compact"] {
  --d-row-pad-y:    9px;
  --d-row-gap:      9px;
  --d-row-title:    12.5px;
  --d-row-lead:     1.25;   /* not 1.2 — at 12.5px the descenders sit on the
                               row edge, and the tick sets the height anyway,
                               so the leading is free */
  --d-fact-size:    10px;
  --d-fact-ink:     var(--ink-muted);
  --d-tick:         17px;
  --d-tick-mt:      0px;

  --d-sec-mb:       20px;
  --d-sec-rule:     6px 0 10px;
  --d-sec-title:    17px;

  --d-card-pad:     9px 11px;
  --d-card-title:   12.5px;

  --d-hero-pad:     11px 14px;
  --d-hero-title:   18px;
  --d-hero-lead:    1.3;
  --d-hero-facts-mb: 0px;
  --d-hero-btn:     40px;

  --d-app-pad:      14px var(--gutter) 48px;
  --d-app-pad-wide: 20px 28px 96px;   /* the side gutter is a layout constant,
                                         not a density value — 28px in both */
  --d-body:         12.5px;

  --control-h:      40px;
}

/* ========================================================================== */
/* BASE                                                                       */
/* ========================================================================== */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface-base);
  color: var(--ink-primary);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
html { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

body.screen-login,
body.screen-set_password { background: var(--surface-base); }
body.screen-app { background: var(--surface-base); }

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--sig-progress); }

/* Focus is visible, everywhere, and never removed. 2px progress blue at 2px
   offset — the guidelines pick one ring and this is it. */
:focus-visible { outline: 2px solid var(--sig-progress); outline-offset: 2px; }
input:focus-visible, select:focus-visible,
textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--sig-progress);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.inline { display: inline; }

/* ---- Tracked labels: the system's signature ----
   10px uppercase mono at 0.2em. Bronze for the one running label per screen,
   --ink-quiet for section heads. This is the single habit carried over
   unchanged from the document system, and it is what makes a screen ours. */
.tracked {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  margin: 0;
}
.topbar .tracked, .gate .tracked { color: var(--brand); }

/* ---- Logo ----
   The complete lockup, hex mark included, in both places — never a cropped
   variant, never recoloured, and one file for both themes: the bronze clears
   6:1 on the dark ground and reads as it always has on cream. Below 90px the
   rules either side of LONDON close up, which is why nothing here goes
   smaller than 94px. */
.topbar-logo { display: block; width: 124px; height: auto; }
.gate-logo {
  display: block;
  width: var(--logo-gate);      /* 232px on the sign-in screen */
  max-width: 62%;
  height: auto;
  margin: 0 0 30px;
}

/* ========================================================================== */
/* SIGN-IN GATE                                                               */
/* ========================================================================== */
.gate {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px var(--gutter);
  background: var(--surface-base);
}
.gate-card { width: 100%; max-width: 380px; }
.gate-title {
  font-family: var(--serif);       /* the screen's own name, once */
  font-size: 30px;
  font-weight: 400;
  color: var(--ink-primary);
  margin: 4px 0 14px;
  line-height: 1.05;
}
.gate-blurb { color: var(--ink-muted); margin: 0 0 24px; font-size: 13.5px; }
.gate-foot {
  margin-top: 22px;
  font-size: 13px;
  color: var(--ink-muted);
  border-top: 1px solid var(--line-hair);
  padding-top: 14px;
}
.gate-form { display: flex; flex-direction: column; gap: 6px; }
.gate-form label { margin-top: 12px; color: var(--ink-secondary); font-size: 13.5px; }

/* ---- The split gate (new) ----
   Below 900px this is one column and the gate is exactly what it was: the
   card, centred, nothing else on screen. The aside is extra, never load-
   bearing — you can sign in without ever seeing it, which is the only reason
   it is allowed to disappear.

   .gate-main holds the existing .gate-card unchanged. It is given the card's
   own maximum width as well, so the pair behaves the same whether the two
   classes sit on one element or the card is nested inside a wrapper. */
.gate-split { width: 100%; }
.gate-main { width: 100%; max-width: 380px; min-width: 0; }
.gate-aside { display: none; }

@media (min-width: 900px) {
  .gate-split {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 54px;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
  }
  /* A hairline between the two halves, not a panel behind one of them: the
     aside is the same ground as the gate, a step to the right. */
  .gate-aside {
    display: block;
    min-width: 0;
    padding-left: 54px;
    border-left: 1px solid var(--line-hair);
  }
}

/* The gate already spends its one bronze label on "Task management" above the
   title. The aside's date line is a second tracked label on the same screen,
   so it takes --ink-quiet — one brand affordance per screen, and this is not
   it. */
.gate-aside .tracked { color: var(--ink-quiet); }
/* ---- The weekly line ----
   The quotation is doing the job the screen title does everywhere else:
   telling you where you have landed and setting the tone before you are in.
   Serif, one size down from a screen title, with the attribution in mono
   beneath it so it reads as a source rather than as more of the sentence. */
.gate-quote {
  margin: 14px 0 0;
  padding: 0;
}
.gate-quote-say {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink-primary);
}
.gate-quote-who {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

/* ---- The glance ----
   Hidden until the number in the form is recognised. THREE COUNTS AND A NAME,
   and nothing else is ever to be added here: no task titles, no project codes,
   no client addresses. This is the only thing the app shows about a named
   person before a password has been checked, and every word of it is visible
   to anyone holding that person's mobile number. lib/auth.php, in
   auth_glance_person(), has the reasoning and the limits.

   It appears rather than reserving space, so the screen does not carry an
   empty box for the ninety-nine per cent of loads where nobody types. */
.gate-glance {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line-hair);
}
.gate-glance-hello {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
}
.gate-glance-line {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-muted);
}
.gate-glance-figures { display: flex; gap: 26px; flex-wrap: wrap; }
.gate-glance-figure { display: flex; align-items: baseline; gap: 7px; }
.gate-glance-num {
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1;
  color: var(--ink-primary);
}
/* Late is the one figure here that earns a colour, because it is the only one
   that is asking for something. */
.gate-glance-figure.is-late .gate-glance-num { color: var(--sig-urgent); }
.gate-glance-word {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

/* ========================================================================== */
/* FORM CONTROLS                                                              */
/* ========================================================================== */
/* Every control is the same box and the same height. `number` was missing
   from this list once and the duration inputs rendered as bare native boxes,
   30px tall against 46px everywhere else. It stays in the list. */
input[type="tel"], input[type="text"], input[type="password"],
input[type="date"], input[type="number"], input[type="url"],
input[type="search"], select, textarea {
  width: 100%;
  background: var(--surface-raised);
  color: var(--ink-primary);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius);
  outline-offset: 2px;
  -webkit-appearance: none;
  appearance: none;
}
input[type="tel"], input[type="text"], input[type="password"],
input[type="date"], input[type="number"], input[type="url"],
input[type="search"], select {
  height: var(--control-h);
  padding: 0 12px;
  line-height: normal;
}
input::placeholder, textarea::placeholder { color: var(--ink-quiet); }

select {
  padding-right: 34px;
  background-image: var(--select-caret);
  background-repeat: no-repeat;
  background-position: right 12px center;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.75;
  cursor: pointer;
  filter: invert(1);
}
:root[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: none;
}
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

textarea { min-height: 80px; padding: 11px 12px; resize: vertical; line-height: 1.5; }

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--sig-progress);
  cursor: pointer;
}

.notice {
  background: var(--surface-raised);
  border-left: 3px solid var(--sig-urgent);
  color: var(--ink-primary);
  padding: 10px 12px;
  font-size: 13.5px;
  margin: 0 0 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---- Buttons ----
   Real <button>s. Minimum 44px of hit area on anything a thumb has to find,
   however small the glyph — this app is used one-handed on a landing. */
.btn {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-primary);
  padding: 10px 16px;
  min-height: 44px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
}
.btn:hover { background: var(--surface-accent); border-color: var(--ink-quiet); }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-signal);
  margin-top: 20px;
  min-height: var(--control-h);
  padding: 13px 16px;
  font-weight: 700;
}
.btn-primary:hover { background: var(--sig-high); border-color: var(--sig-high); }
.btn-quiet {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  padding: 6px 2px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
}
.btn-quiet:hover { background: transparent; color: var(--ink-primary); }
.btn-small { padding: 6px 11px; min-height: 36px; font-size: 13px; }
.btn-danger { border-color: var(--sig-urgent); color: var(--sig-urgent); }
.btn-danger:hover { background: var(--tint-blocked); border-color: var(--sig-urgent); }

/* ========================================================================== */
/* APP SHELL                                                                  */
/* ========================================================================== */
/* TWO SHELLS LIVE IN THE MARKUP AND THE CSS PICKS ONE.
   .topbar + .tabs are the phone; .rail + .conhead are the console. Below
   720px the rail and the console header are display:none and everything here
   is exactly as it shipped — the phone layout is signed off and nothing in
   this pass moves it. From 720px up the topbar and the tab bar go instead,
   and the rail takes over. Whichever bar is on screen is the one
   measureTopbar() measures into --topbar-h. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface-base);
  border-bottom: 1px solid var(--line-hair);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px var(--gutter);
  max-width: 1180px;
  margin: 0 auto;
}
.topbar-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* A hairline between the company and the app it is running: the logo says who
   this is from, the title says what it is, and they should not read as one
   phrase. */
.topbar-rule {
  flex: 0 0 auto;
  width: 1px;
  height: 18px;
  background: var(--line-hair);
}
/* The app's name in the SANS, not the serif. Beside the lockup, a second
   serif wordmark put the app above the company, which is backwards. The logo
   owns the serif; the app name is a product name in a header bar. */
.topbar-app {
  flex: 0 1 auto;
  min-width: 0;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-name {
  font-size: 13px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Theme toggle (new) ----
   Icon-only, so it carries an aria-label from index.php. 44px of hit area
   around an 18px glyph. It is a control, not a signal, so it does not spend
   a colour: --ink-secondary at rest, primary on hover. */
.theme-btn,
.density-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-secondary);
  cursor: pointer;
}
.theme-btn:hover,
.density-btn:hover { color: var(--ink-primary); border-color: var(--line-hair); background: var(--surface-raised); }
.theme-btn svg,
.density-btn svg { width: 18px; height: 18px; display: block; }

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 var(--gutter);
  max-width: 1180px;
  margin: 0 auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
/* Icon and label together, never the icon alone: a pictogram is a reminder of
   a word you already know, not a replacement for it. At the top they sit side
   by side; at the bottom of a phone the icon goes above, which is where a
   thumb-height bar wants it. */
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 9px 2px;
  min-height: 44px;
  margin-right: 16px;
  color: var(--ink-secondary);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
/* No opacity on any glyph. At 0.75 these once measured 3.01:1 — legal by a
   hundredth, and nothing in the repo could have told you, because the audit
   only walked text nodes. An icon inherits its label's colour, and that
   colour already clears the floor with room to spare. */
.tab-icon { flex: 0 0 auto; width: 17px; height: 17px; }
.tab-label { display: inline-block; }
.tab:hover { color: var(--ink-primary); }
.tab.is-active { color: var(--ink-primary); border-bottom-color: var(--brand); }
.tab.is-active .tab-icon { color: var(--brand); }

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--d-app-pad);
}
/* ---- Per-view width ----
   900px above is a READING measure, and it is right for the views that are
   mostly text: Day, the task list, Projects, Goals. A task title stretched
   across a 1700px screen with its facts marooned at the far edge is harder
   to read, not easier.

   The grids are the other case. The week planner is an aside plus five day
   columns; at 900px those columns come out at 115px, which is not a column.
   The register is a table and Lanes is a board. Those get a ceiling of their
   own, set by the view name app.js writes onto #app.

   1440px, not the whole work area: it stays centred with a margin either
   side, so the screen keeps a shape on a very wide monitor instead of
   smearing to both edges. */
.app[data-view="week"]            { max-width: 1440px; }
.app[data-view="management"]      { max-width: 1280px; }
.app[data-arrangement="register"] { max-width: 1440px; }
.app[data-arrangement="board"]    { max-width: 1280px; }

/* Tables want the extra width that prose does not. */
.app .table-wrap { max-width: none; }
.loading { color: var(--ink-muted); font-size: var(--d-body); padding: 8px 0; }
.empty { color: var(--ink-muted); font-size: var(--d-body); padding: 6px 0 2px; }
/* The "Nothing matches" line carries a way out of the filter, on the same
   line, because a dead end with no door is how a lens becomes a bug report. */
.empty .btn-quiet { margin-left: 10px; }

/* ========================================================================== */
/* CONSOLE SHELL — rail, work area, console header (new)                      */
/* ========================================================================== */
/* Hidden by default, shown from 720px up. Declaring them off here rather than
   inside a max-width query is what guarantees the phone is untouched: a rule
   that never fires cannot move a pixel. */
.rail, .conhead { display: none; }
.shell { min-width: 0; }
.workarea { min-width: 0; }

/* ---- The rail ----
   --surface-rail, one step back from the page, with a --line-hair right
   edge: the content column should read as the lit part of the screen.

   Sticky rather than fixed. Fixed would take it out of the grid entirely and
   leave the 232px column as a number we had to keep in step by hand; sticky
   keeps it an honest grid item that happens never to move. Its own height is
   the viewport, so the rail does not scroll — the work area does, which is
   the whole point of a console. */
.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100svh;
  flex-direction: column;
  gap: 18px;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--surface-rail);
  border-right: 1px solid var(--line-hair);
  overflow: hidden;
}
/* The full lockup at 124px, and it does not shrink to a mark on scroll: the
   rail never scrolls, so the problem that pattern solves does not exist
   here. One file for both themes, never recoloured. */
.rail-logo { display: block; width: 124px; height: auto; }
/* The hairline under the lockup, whether it is drawn as an <hr> or as an
   element carrying the rail's own rule class. Structure here is hairlines
   and whitespace; there are no boxes in the rail. */
.rail > hr,
.rail-rule {
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line-hair);
}
/* The running label. The rail gets the screen's one bronze affordance, which
   is why LIVE JOBS below it stays --ink-quiet. */
.rail > .tracked { color: var(--brand); }

.rail-nav { display: flex; flex-direction: column; gap: 2px; }
/* Icon and label together, never the icon alone — the same rule the tab bar
   follows, for the same reason. */
.rail-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.rail-link:hover { color: var(--ink-primary); background: var(--surface-base); }
/* Active is a filled ground, a bronze edge, full-strength ink AND the icon in
   bronze. Four cues, and aria-current="page" says it to a screen reader — the
   colour is the last of them, not the message. The transparent edge is on
   every link so nothing shifts when one becomes active. */
.rail-link.is-active,
.rail-link[aria-current="page"] {
  background: var(--surface-accent);
  border-left-color: var(--brand);
  color: var(--ink-primary);
}
.rail-link.is-active .rail-ico,
.rail-link[aria-current="page"] .rail-ico { color: var(--brand); }
.rail-ico { flex: 0 0 auto; width: 18px; height: 18px; }
/* The Tasks count. Mono, because it is a fact, and quiet, because it is not
   an alarm — it is how much there is. */
.rail-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-quiet);
}
.rail-link.is-active .rail-count { color: var(--ink-secondary); }

/* ---- Live jobs ----
   The rail does not scroll, but a director with a dozen live jobs would
   otherwise push the person off the bottom of it. The list is capped at eight
   in the markup; this is the belt to that braces — the jobs block is the only
   thing here allowed to give, and the foot stays put. */
.rail-jobs {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.rail-jobs::-webkit-scrollbar { display: none; }
.rail-jobs .tracked { margin-bottom: 6px; }
.rail-job {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 4px 10px 4px 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--sans);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.rail-job:hover { background: var(--surface-base); color: var(--ink-primary); }
/* 5px, and NEVER the only cue: the open count sits beside it in mono and the
   job's state is legible from that count and the job's own row in Tasks. A
   dot on its own is a decoration with a rumour attached. */
.rail-job-dot {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-disabled);
}
.rail-job-dot.is-late { background: var(--sig-urgent); }
.rail-job-dot.is-warn { background: var(--sig-high); }
.rail-job-dot.is-ok   { background: var(--sig-done); }
.rail-job-code {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-job-count {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-quiet);
}
.rail-job-more {
  display: block;
  margin-top: 4px;
  padding: 4px 10px 4px 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

/* ---- The foot: who you are, the theme, the way out ---- */
.rail-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 9px;
  padding-top: 14px;
  border-top: 1px solid var(--line-hair);
}
/* Initials, not a photograph — we do not hold photographs of site teams. */
/* Sign out sits inside its own POST form (it carries the CSRF token), so the
   form is the flex child, not the button. Give it the whole second row. */
.rail-foot .inline {
  flex: 0 0 100%;
  margin: 0;
}
.rail-foot .inline .btn-quiet { width: 100%; text-align: left; padding-left: 0; }

.rail-avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-accent);
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-secondary);
}
.rail-foot .person-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: var(--ink-secondary);
}
.rail-foot .theme-btn { margin-left: auto; }

/* ---- Display, in the rail foot ----
   This was an icon-only button and it read as a stray menu glyph: nothing on
   it said what it did, and nothing said which setting was on. A two-segment
   control with the words in it answers both without being clicked, which is
   the whole job of a setting you touch twice a year.

   It takes the full width of the foot, above Sign out. The phone keeps the
   icon button — there is no room for two words in a top bar, and on a phone
   density is spacing only. */
.rail-display {
  flex: 0 0 100%;
  margin-top: 10px;
}
.rail-display-head {
  margin: 0 0 6px;
  color: var(--ink-quiet);
}
.seg-display { display: flex; width: 100%; }
/* The two segments share the width equally so the control reads as one object
   rather than two buttons that happen to touch. This is also the class app.js
   selects on, so it is the one that carries the rule. */
.density-seg {
  flex: 1 1 0;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-foot .btn-quiet { flex: 0 0 100%; text-align: left; padding: 0; }

/* ---- The console header ----
   Sticky at the top of the work area, so the screen's name, the search field
   and the Day|Week toggle are where they were when you scrolled. This is what
   --topbar-h measures from 720px up, and every sticky section heading below
   hangs off that number. */
.conhead {
  position: sticky;
  top: 0;
  z-index: 20;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding: 20px 28px 13px;
  background: var(--surface-base);
  border-bottom: 1px solid var(--line-hair);
}
/* The screen's own name, in the serif, once per screen. This is the same job
   .day-head does on a phone, which is why .day-head stands down at 720px.

   THE HEADER IS NOT ON THE DENSITY AXIS, deliberately. It was, briefly, and it
   was wrong: this bar is the landmark you navigate by, and a landmark that
   moves when you change a display setting stops being one. Density tightens
   the content below it; the bar holds still. The same goes for its padding. */
.conhead-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.08;
  color: var(--ink-primary);
}
.conhead-sub {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.conhead-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-left: auto;
}

/* ========================================================================== */
/* SEARCH (new)                                                               */
/* ========================================================================== */
/* THE ONLY PILL-SHAPED INPUT IN THE SYSTEM. Everything else in the app is
   --radius. That shape is the whole accessibility argument for a field with
   no visible label: you find it by outline, from across the screen, before
   you have read anything. The accessible name comes from a visually-hidden
   <label>, not from the placeholder.

   --radius-pill is 20px, which is a true pill on a 40px control. This box is
   44px because a field is something you tap, and 44px is the floor — so the
   radius is the token plus the 2px that keeps the ends properly round rather
   than a rounded rectangle pretending. */
.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(320px, 100%);
  min-width: 0;
  height: 44px;
  padding: 0 6px 0 13px;
  background: var(--surface-raised);
  border: 1px solid var(--line-hair);
  border-radius: calc(var(--radius-pill) + 2px);
}
.search:hover { border-color: var(--line-strong); }
/* The ring goes on the pill, once, rather than on the bare input inside it —
   otherwise a 2px outline appears in the middle of the field. */
.search:focus-within {
  border-color: var(--line-strong);
  outline: 2px solid var(--sig-progress);
  outline-offset: 2px;
}
.search-ico { flex: 0 0 auto; width: 15px; height: 15px; color: var(--ink-quiet); }
input.search-input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink-primary);
}
input.search-input:focus-visible { outline: none; }
/* The native clear cross is a different shape in every browser and sits where
   our own button goes. Ours is a real <button> with an aria-label. */
input.search-input::-webkit-search-cancel-button,
input.search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search-clear {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  position: relative;
}
/* 36px of circle, 44px of target — the pill is only 44px tall, so the hit
   area is allowed to overhang it the way the task tick overhangs its row. */
.search-clear::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
.search-clear:hover { color: var(--ink-primary); background: var(--surface-accent); }
.search-clear[hidden] { display: none; }
/* The keyboard hint. A key cap, not a button — it says how to get here, and
   it gets out of the way the moment you are here. */
.search-kbd {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-right: 6px;
  padding: 0 5px;
  border: 1px solid var(--line-hair);
  border-radius: var(--radius);
  background: var(--surface-accent);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-quiet);
}
.search:focus-within .search-kbd { display: none; }

/* ========================================================================== */
/* SECTIONS                                                                   */
/* ========================================================================== */
/* The heading and its rule travel together and stick under the top bar, so on
   a long list you always know which lane you are reading. */
.section { margin-bottom: var(--d-sec-mb); }
.section-sticky {
  position: sticky;
  top: var(--topbar-h, 0px);
  z-index: 5;
  background: var(--surface-base);
  padding-top: 8px;
}
.section-draft .section-sticky { background: var(--surface-raised); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.section-title {
  font-size: var(--d-sec-title);
  font-weight: 700;
  color: var(--ink-primary);
  margin: 2px 0 0;
}
.section-rule { border: 0; border-top: 1px solid var(--line-strong); margin: var(--d-sec-rule); }
.section-note {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-quiet);
  letter-spacing: 0.08em;
}
.section-toggle {
  border: none;
  background: none;
  padding: 0;
  min-height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  color: var(--ink-primary);
}
.section-toggle .section-title { margin: 0; }
.section-caret {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-quiet);
  transition: transform 140ms ease;
}
.section-toggle[aria-expanded="true"] .section-caret { transform: rotate(90deg); }

/* Kind modifiers. Completed work is struck, sunk and quiet; late is the one
   section head that spends a signal colour, because it is the one that is
   telling you something. */
.section-done .section-title,
.section-done .task-title { color: var(--ink-muted); }
.section-late .section-title { color: var(--sig-urgent); }
.section-project .section-title { font-family: var(--serif); font-weight: 600; font-size: 20px; }
.section-then { margin-top: 24px; margin-bottom: 18px; }
/* ---- Drafts ----
   THE DASH IS GONE, and not only because a 3px dashed edge was heavier than
   any rule in the app. Dashed already carries two meanings here — a private
   task's chip, and the drop target on the week planner — and a third makes
   all three mean less.

   Three quieter signals in its place. The block sits on --surface-rail, one
   step BACK from the page: unpublished work is behind the screen rather than
   raised off it, and it is the same ground the navigation uses, so nothing
   new was invented. And the state itself rides on each goal as a chip,
   because "not shared yet" is a fact about the goal, not about the region it
   happens to sit in — scroll the heading away and the chip is still there.

   There was a hairline down the left edge too, briefly. Recessed ground AND a
   rule is two statements of one fact, and the ground already says it. */
.section-draft {
  background: var(--surface-rail);
  padding: 16px;
  border: 0;
  border-radius: var(--radius-md);
}
/* With no fill behind it the sticky head takes the page ground, or the rows
   scroll through the words. */
.section-draft .section-sticky { background: var(--surface-rail); }
.section-draft .section-rule { border-top: 1px solid var(--line-hair); }
/* DRAFTS · DIRECTORS ONLY is the tracked head; the sentence under it —
   "Nobody else sees these until you share them" — is prose, and reads as
   prose. A privacy promise set as a 10px tracked label is read as
   decoration, and this one has to be believed. .section-note keeps its mono
   in here, because in every other section that slot holds the count and the
   two should not look like different things. */
.section-draft > p {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* ========================================================================== */
/* TASK ROWS                                                                  */
/* ========================================================================== */
/* The 12px left padding is on EVERY row, priority or not, so the tick circles
   sit on one vertical line down the whole list. The stripe lives inside that
   gutter; the row's border still runs the full width, flush with the rule
   above it. Hairlines, not boxes: a list does not get a border per row. */
.task-list { list-style: none; margin: 0; padding: 0; }
.task {
  position: relative;
  display: flex;
  gap: var(--d-row-gap);
  align-items: flex-start;
  padding: var(--d-row-pad-y) 0 var(--d-row-pad-y) 12px;
  border-bottom: 1px solid var(--line-hair);
}
.task-check {
  flex: 0 0 auto;
  width: var(--d-tick);
  height: var(--d-tick);
  margin-top: var(--d-tick-mt);
  border: 1.5px solid var(--ink-disabled);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
}
/* The circle stays 22px so the row reads calmly, but the thing you actually
   hit is 44px — the floor for a thumb. The row's own gap and padding absorb
   the overhang. */
.task-check::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
.task-check:hover { border-color: var(--sig-done); }
.task.is-done .task-check { background: var(--sig-done); border-color: var(--sig-done); }
.task.is-done .task-check::after {
  content: '';
  position: absolute;
  left: 7px; top: 3px;
  width: 5px; height: 10px;
  border: solid var(--on-signal);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.task-body { flex: 1 1 auto; min-width: 0; }
.task-title {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  font-family: var(--sans);
  font-size: var(--d-row-title);
  font-weight: 600;
  color: var(--ink-primary);
  cursor: pointer;
  width: 100%;
  line-height: var(--d-row-lead);
}
/* Done is green AND ticked AND struck through AND sunk to muted. Four cues;
   hue is the last of them. */
.task.is-done .task-title { color: var(--ink-muted); text-decoration: line-through; }

/* Two lines at most: chips, then facts. The facts line never wraps — it runs
   out of room and clips, and it is ordered so the first thing to go is the
   least useful (owner), never the deadline or the priority. */
.task-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: var(--d-fact-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--d-fact-ink);
  min-width: 0;
}
.meta-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.meta-facts {
  display: flex;
  align-items: baseline;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.meta-facts > * { flex: 0 0 auto; }
.meta-facts > * + * { margin-left: 11px; }
/* Each fact wears its own glyph, so you can tell an estimate from a deadline
   from a project code without reading any of them. The word is always there
   too — the glyph narrows the guess, it does not carry the meaning. */
.meta-fact { display: inline-flex; align-items: center; gap: 4px; }
.meta-ico { flex: 0 0 auto; width: 11px; height: 11px; }
.meta-plain { color: var(--ink-quiet); }
.meta-flag { color: var(--sig-urgent); font-weight: 600; }
/* The priority word in the same colour as the row's stripe. It is the written
   half of that signal — what a colour-blind reader, or a printout, reads. */
.meta-prio { font-weight: 600; }
.prio-urgent { color: var(--sig-urgent); }
.prio-high   { color: var(--sig-high); }

/* Declared, not currently emitted by app.js — kept because the markup
   contract may start emitting them and a missing rule is a broken screen.
   (CONTRACT.md §1, warning 7.) */
.task-meta .is-overdue { color: var(--sig-urgent); font-weight: 600; }
.task-meta .is-blocked { color: var(--sig-urgent); font-weight: 600; }
.task-meta .is-private { color: var(--ink-quiet); font-style: italic; }

.task-star {
  flex: 0 0 auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
  /* An unset star at --line-hair was 1.33:1: not quiet, invisible. A control
     has to clear 3:1 to be identifiable, and --ink-disabled is 3.3:1 —
     visible without competing with the body text beside it. It is a glyph,
     never a word, which is the only reason it may sit below 4.5:1. */
  color: var(--ink-disabled);
  position: relative;
}
.task-star::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
.task-star.is-on { color: var(--sig-high); }
.task-blocker {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--ink-primary);
  border-left: 2px solid var(--sig-urgent);
  padding-left: 10px;
}

/* ---- Priority: a left stripe, and it answers ONE question ----
   The stripe means "this is above normal", and nothing else. Two levels draw
   one: Urgent in red at 5px, High in orange at 4px. Colour names the level and
   the width repeats it, so the order survives a colour-blind reader, a
   photocopy and bright daylight on a phone.

   Medium used to draw a 3px blue stripe. Medium is the default on the add
   form, so most rows carried one and the left edge was answering "does this
   task exist?" rather than "does this need me?". Dropping it also frees blue
   to mean one thing in the body — on the go, and the things you can press.
   Low draws nothing, as before: if everything is flagged, nothing is. */
.task.p-urgent::before,
.task.p-high::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  border-radius: 2px;
}
.task.p-urgent::before { width: 5px; background: var(--sig-urgent); }
.task.p-high::before   { width: 4px; background: var(--sig-high); }

/* Blocked is the one row state that tints the row itself. Flat, not a
   gradient wash — the tint is a token, so it swaps with the theme, and the
   row still carries the word and the written reason. */
.task.is-blocked { padding-left: 12px; background: var(--tint-blocked); }

/* ========================================================================== */
/* CHIPS                                                                      */
/* ========================================================================== */
/* THREE KINDS OF PILL, AND THEY DO NOT LOOK ALIKE.
   The old row put state, chase, duration and private through one shape, so
   the only way to tell an estimate from a blocker was to read it. Shape now
   answers "what kind of thing is this?" before colour answers "how bad?":

     · a FILLED pill is asking you for something     — Blocked, Chase
     · an OUTLINED pill is the state it is in        — On the go, Start
     · a DASHED pill is a boundary, not a state      — Private
     · a plain glyph + word is a fact about the task — due, estimate,
       project, owner, priority. Facts are not pills at all.

   Every pill says its state in words and carries a glyph, so colour is the
   third cue rather than the first. */
.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: var(--radius);
  border: 1px solid var(--line-hair);
  color: var(--ink-quiet);
  background: transparent;
  white-space: nowrap;
}
.chip-ico { width: 10px; height: 10px; margin-right: 4px; flex: 0 0 auto; }

.chip-blocked  { border-color: var(--sig-urgent);   background: var(--sig-urgent);   color: var(--on-signal); font-weight: 600; }
.chip-chase    { border-color: var(--sig-chase);    background: var(--sig-chase);    color: var(--on-signal); font-weight: 600; }
.chip-progress { border-color: var(--sig-progress); color: var(--sig-progress); font-weight: 500; }
/* Private is dashed because it is the one pill that is not about progress at
   all — it marks who can see the row, and it must never be mistaken for a
   state or clipped off the end of a line. */
.chip-private  { border-style: dashed; border-color: var(--ink-disabled); color: var(--ink-quiet); }

/* A chip you can press is the same shape as one you cannot, because it says
   the same thing — it just also moves the task on. It gets the 44px target. */
button.chip {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  position: relative;
}
button.chip::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  min-width: 100%;
  min-height: 44px;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
}
.chip-start { border-color: var(--line-strong); color: var(--ink-quiet); border-style: dashed; }
.chip-start:hover { border-color: var(--sig-progress); color: var(--sig-progress); border-style: solid; }

/* Priority as a filled chip, only where it is the headline (the hero). */
.chip-prio-fill-urgent {
  border-color: var(--sig-urgent);
  background: var(--sig-urgent);
  color: var(--on-signal);
  font-weight: 600;
}
.chip-prio-fill-high {
  border-color: var(--sig-high);
  background: var(--sig-high);
  color: var(--on-signal);
  font-weight: 600;
}

/* Time is a fact, not a state, so it reads as one: a clock and a number.
   Only the comparison against the estimate earns a colour, because only that
   is telling you something you did not already know. */
.fact-ontime, .fact-under { color: var(--sig-done); }
.fact-over { color: var(--sig-high); font-weight: 600; }

/* ========================================================================== */
/* GOALS                                                                      */
/* ========================================================================== */
/* The artboard's proportions: the title and the percentage share one
   baseline, the meter sits under both, the meta line is mono beneath that,
   and the children are indented with a hairline over each. Reading down a
   goal you get the claim, the measure, the arithmetic, then the work. */
.goal { padding: 16px 0; border-bottom: 1px solid var(--line-hair); }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.goal-title { font-size: 16.5px; font-weight: 700; color: var(--ink-primary); margin: 0; line-height: 1.3; }
.goal-title .task-title:disabled { cursor: default; color: var(--ink-primary); }
/* The percentage is a fact, so it is mono, and it holds the same baseline as
   the title rather than floating above it. tabular-nums keeps 9% and 100%
   the same width, so a column of goals does not jitter. */
.goal-pct {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--ink-primary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.goal-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.goal-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
/* The children used to be dead text and had their own list rules here:
   .goal-children li set padding, a border and a colour. They are ORDINARY
   TASK ROWS now, and those rules outranked .task — an element-plus-class
   selector beats a class — so they zeroed the row's 12px left padding and
   dropped the tick circle straight onto the priority stripe. Deleted rather
   than adjusted: a row should be styled by .task and nothing else, or the
   next person gets the same collision somewhere new. The wrapper rule that
   remains lives at the foot of this file. */
/* Nothing on the card itself. The chip in the title says it, the meter says
   it, and the ground under the whole block says it. A fourth statement of the
   same fact is noise. */
.chip-draft { border-color: var(--ink-disabled); color: var(--ink-quiet); }

/* A draft's meter is a rule, not a signal. The percentage is real arithmetic
   over real child tasks, but it is progress against something nobody outside
   this block has agreed to yet. */
.meter-fill.is-draft { background: var(--line-strong); }

/* A meter is a graphic, so the fill clears at 3:1 — but it is never the only
   statement: the percentage sits beside it in mono. */
.meter {
  height: 5px;
  background: var(--surface-accent);
  border: 1px solid var(--line-hair);
  margin: 10px 0 8px;
  border-radius: 2px;
  overflow: hidden;
}
.meter-fill { height: 100%; background: var(--sig-progress); }
.meter-fill.is-complete { background: var(--sig-done); }

/* ---- Add row (the goal-draft field) ---- */
.add { margin-bottom: 26px; }
.add-goal { margin-top: 16px; }
.add-row { display: flex; gap: 8px; }
.add-input { flex: 1 1 auto; }
.add-row .btn { margin-top: 0; height: var(--control-h); padding: 0 18px; white-space: nowrap; }
.add-hint { font-size: 12.5px; color: var(--ink-muted); margin: 8px 0 0; }
select.add-select { width: 100%; min-width: 0; }

/* ========================================================================== */
/* TABLES (management)                                                        */
/* ========================================================================== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  padding: 0 12px 7px 0;
  border-bottom: 2px solid var(--line-strong);
  white-space: nowrap;
}
td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line-hair); color: var(--ink-secondary); }
td.num { font-family: var(--mono); text-align: right; padding-right: 18px; }
td.num.flag { color: var(--sig-urgent); font-weight: 600; }

.privacy-note {
  margin: 18px 0 0;
  padding: 12px 14px;
  background: var(--surface-raised);
  border-left: 3px solid var(--sig-done);
  font-size: 13.5px;
  color: var(--ink-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ========================================================================== */
/* DETAIL SHEET                                                               */
/* ========================================================================== */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--scrim); }
.sheet-panel {
  container: sheet / inline-size;
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 92svh;
  overflow-y: auto;
  background: var(--surface-raised);
  color: var(--ink-primary);
  border-top: 3px solid var(--brand);
  padding: 20px var(--gutter) calc(28px + env(safe-area-inset-bottom));
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.field { margin-bottom: 14px; min-width: 0; }
/* The label reserves a line whether or not its text wraps, so the controls
   underneath start on the same baseline across a row. */
.field label {
  display: block;
  margin-bottom: 5px;
  min-height: 15px;
  color: var(--ink-secondary);
  font-size: 13px;
}
/* Grid, not flex. Flex sized each column to its content — a date input has a
   wider intrinsic minimum than a select — so the three two-up rows split at
   three different places. A grid splits them all at the same place. */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
  align-items: start;
}
.field-row > .field { margin-bottom: 14px; }
/* Two duration pickers sit side by side once there is room for two
   four-column preset grids; below that they stack. Measured against the
   PANEL, not the window — as a side pane the panel is a fixed 400px however
   wide the screen is, and two grids will not fit. */
.field-row-wrap { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.field-row-wrap > .field { margin-bottom: 18px; }
@container sheet (min-width: 500px) {
  .field-row-wrap { grid-template-columns: 1fr 1fr; }
}
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.sheet-actions .btn-danger { margin-left: auto; }
.source-link { font-size: 13.5px; }
.source-link a { color: var(--sig-progress); }

/* ---- Duration presets ----
   A fixed four-column grid rather than a wrapping row: seven pills always
   make two tidy rows, so Estimated and Actually took are the same height and
   their inputs line up whatever the label says. */
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 7px; }
.preset {
  border: 1px solid var(--line-hair);
  background: var(--surface-accent);
  color: var(--ink-muted);
  padding: 7px 4px;
  min-height: 36px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 12.5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preset:hover { border-color: var(--ink-quiet); color: var(--ink-primary); }
.preset.is-on {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: var(--on-signal);
  font-weight: 600;
}
.preset-clear { border-style: dashed; }
.duration-input { width: 100%; }

/* ========================================================================== */
/* TOAST, CONFETTI                                                            */
/* ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink-primary);
  color: var(--on-signal);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  z-index: 60;
  max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-overlay);
}
.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 70;
}

/* ========================================================================== */
/* MY WORK — the day view                                                     */
/* ========================================================================== */
/* One date, in one voice. "Sunday" at 27px serif beside "20 SEPTEMBER" at
   11px tracked mono changed size, face AND case at once, so it read as a
   heading with a label stapled to it rather than as a date. Same face, same
   size; only the colour separates the day you are in from the date it
   happens to be. This is the screen's one use of the serif. */
.day-head {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink-primary);
}
.day-weekday { color: var(--ink-primary); }
.day-date { color: var(--ink-muted); }

/* The hero is the whole point of the page: one task, big enough to read at
   arm's length, with the two things you might do to it. */
.hero {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-md);
  padding: var(--d-hero-pad);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}
.hero.p-urgent::before { background: var(--sig-urgent); }
.hero.p-high::before   { background: var(--sig-high); }
.hero.is-blocked { background: var(--tint-blocked); }
.hero-clear { text-align: left; }
.hero-chips { margin-bottom: 12px; }
.hero-title {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-family: var(--sans);
  font-size: var(--d-hero-title);
  line-height: var(--d-hero-lead);
  letter-spacing: -0.01em;
  font-weight: 700;
  color: var(--ink-primary);
  cursor: pointer;
}
.hero-note { margin: 8px 0 0; color: var(--ink-muted); font-size: var(--d-body); }
.hero-facts {
  margin: 0 0 var(--d-hero-facts-mb);
  font-family: var(--mono);
  font-size: var(--d-fact-size);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.hero-facts > * + * { margin-left: 13px; }
.hero-facts .meta-ico { width: 12px; height: 12px; }
.hero-facts.is-late { color: var(--sig-urgent); font-weight: 600; }
.hero-blocker { margin-bottom: 18px; }
.hero-actions { display: flex; gap: 8px; }
.hero-done {
  flex-grow: 1;
  height: var(--d-hero-btn);
  margin-top: 0;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.hero-later { height: var(--d-hero-btn); padding: 0 16px; border-color: var(--line-strong); }

/* The undo line. Quiet enough not to compete with the hero it sits under, and
   the title clips rather than wrapping so the line stays one line. */
.skip-undo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  /* The add button is fixed to the bottom-right corner and lands on this line
     on a phone. Reserving its column keeps Undo tappable at every scroll
     position rather than only most of them. */
  margin: 10px 74px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}
.skip-undo-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skip-undo-btn {
  flex: 0 0 auto;
  padding: 2px 0;
  border: 0;
  background: none;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--sig-progress);
  text-decoration: underline;
  cursor: pointer;
}
.skip-undo-btn:hover { color: var(--ink-primary); }
.skip-again { margin-top: 16px; }

/* The one way off the page, carrying just enough to decide whether to take it. */
.day-door {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: 18px;
  padding: 15px 16px;
  min-height: 44px;
  border: 1px solid var(--line-hair);
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
}
.day-door:hover { border-color: var(--line-strong); }
.day-door-text { display: block; min-width: 0; }
.day-door-head { display: block; font-size: 14.5px; font-weight: 700; color: var(--ink-primary); }
.day-door-sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-muted); }
.day-door-arrow {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 20px;
  color: var(--brand);
  line-height: 1;
}

/* ========================================================================== */
/* ON THE GO BAND (new)                                                       */
/* ========================================================================== */
/* "On the go" is the only name for this state, on the chip, the lane, the
   table cell and the filter. The data still says "In progress"; the screen
   never does.

   The band exists because started-and-unfinished work is invisible in a list
   sorted by due date — it has no deadline pressure and it is already half
   done, so it sinks. It sits above the hero, and when there are more than
   three it says so in a sentence. A count is not a warning; a sentence is. */
.ontg-band {
  margin: 0 0 20px;
  padding: 14px 15px;
  background: var(--surface-raised);
  border: 1px solid var(--line-hair);
  border-left: 3px solid var(--sig-progress);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.ontg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sig-progress);
}
/* The sentence beside the tracked label drops the tracking and the case: it
   is prose, not a label, and it should read as prose. */
.ontg-head span { font-family: var(--sans); font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--ink-muted); font-weight: 400; }
.ontg-list { list-style: none; margin: 0; padding: 0; }
/* Built from taskRow() so behaviour is shared: the rows keep their ticks,
   stars, chips and 44px targets. The band only removes the last hairline, so
   the list does not sit on a rule that has nothing under it. */
.ontg-card:last-child .task,
.ontg-card:last-child.task { border-bottom: 0; padding-bottom: 0; }
.ontg-warn {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--sig-high);
  font-weight: 600;
}

/* ========================================================================== */
/* WEEK BAND (the starred drawer)                                             */
/* ========================================================================== */
/* Pinned above every arrangement, because it is the thing you said you would
   do — it should not depend on how you are looking at the list. */
.week-band {
  margin: 0 calc(-1 * var(--gutter)) 18px;
  padding: 0 var(--gutter) 12px;
  background: var(--surface-raised);
  border-top: 2px solid var(--brand);
  border-bottom: 1px solid var(--line-hair);
  position: sticky;
  top: var(--topbar-h, 0px);
  z-index: 6;
}
.week-band.is-shut { padding-bottom: 0; }
.week-head {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 0 8px;
  min-height: 44px;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}
.week-caret {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-secondary);
  transition: transform 140ms ease;
}
.week-head[aria-expanded="true"] .week-caret { transform: rotate(90deg); }
.week-title { color: var(--ink-primary); }
.week-note {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.week-body { padding-bottom: 2px; }
.week-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 0;
  min-height: 44px;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}
.week-mark { flex-shrink: 0; font-size: 14px; line-height: 1; color: var(--sig-high); }
.week-mark.is-done { color: var(--sig-done); }
.week-name {
  flex-grow: 1;
  min-width: 0;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.week-row.is-done .week-name {
  color: var(--ink-muted);
  font-weight: 500;
  text-decoration: line-through;
}
.week-tail { flex-shrink: 0; font-family: var(--mono); font-size: 11px; color: var(--ink-quiet); }
.week-tail.is-late { color: var(--sig-urgent); font-weight: 500; }
.week-empty { margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-muted); }
/* The trailing link out of the drawer and into the week grid. Bronze, because
   it is the primary link on this band, and it is the one brand affordance the
   drawer gets. */
.week-week {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 0;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: 0;
}
.week-week:hover { text-decoration: underline; }

/* ========================================================================== */
/* WORK TOGGLE — Day | Week                                                   */
/* ========================================================================== */
/* Segmented control: pill, active segment filled --ink-primary with
   --on-signal text, per the component spec. Same shape as .seg so the two
   never read as different kinds of control. */
.work-toggle {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  flex: 0 0 auto;
}
.work-toggle-btn {
  height: 38px;
  min-width: 62px;
  padding: 0 15px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.work-toggle-btn:hover { color: var(--ink-primary); }
.work-toggle-btn.is-on {
  background: var(--ink-primary);
  color: var(--on-signal);
  font-weight: 700;
}

/* ========================================================================== */
/* WEEK GRID (new)                                                            */
/* ========================================================================== */
/* Monday to Friday, planned against a real capacity. The whole component only
   works if the estimates are real, so where they are missing it says so in
   --sig-high rather than planning them as zero. */
.week-total { margin: 0 0 16px; }
.week-total > p,
.week-total .tracked { margin: 0 0 8px; }
.week-total-bar {
  display: flex;
  height: 7px;
  margin: 8px 0 6px;
  background: var(--line-hair);
  border-radius: 2px;
  overflow: hidden;
}
/* Three segments, and each one is also named in the mono figure beside the
   bar. A bar on its own is a decoration. */
.week-total-seg { height: 100%; }
.week-total-seg.seg-done    { background: var(--sig-done); }
.week-total-seg.seg-late    { background: var(--sig-urgent); }
.week-total-seg.seg-planned { background: var(--sig-progress); }
.week-noest {
  margin: 6px 0 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--sig-high);
  font-weight: 600;
}

.weekgrid {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.weekgrid-aside { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.weekgrid-days {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

/* ---- The Six ---- */
.six-card {
  background: var(--surface-raised);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-md);
  padding: 13px 14px;
}
.six-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.six-head .six-mark { color: var(--sig-high); letter-spacing: 0; }
.six-head span:last-child { margin-left: auto; color: var(--ink-secondary); }
.six-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 0;
  border-top: 1px solid var(--line-hair);
}
.six-row:first-of-type { border-top: 0; }
/* The tick is a real button with a 22px mark and a 44px target, the same
   object as the task row's — a star drawer should not invent a second way to
   finish something. */
.six-mark {
  position: relative;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1.5px solid var(--ink-disabled);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-disabled);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.six-mark::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
.six-mark.is-done {
  background: var(--sig-done);
  border-color: var(--sig-done);
  color: var(--on-signal);
}
.six-body { flex: 1 1 auto; min-width: 0; }
.six-title {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-primary);
  cursor: pointer;
}
.six-row.is-done .six-title { color: var(--ink-muted); text-decoration: line-through; }
.six-meta {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
/* A director can star work for someone. That star is identical to the
   person's own, so the row has to name who set it — otherwise the week fills
   up and nobody knows who filled it. Bronze, beneath the facts. */
.six-by {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--brand);
}

/* ---- The tray: open work with no day against it ---- */
.tray {
  background: var(--surface-raised);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-md);
  padding: 13px 14px;
}
.tray.is-dropping,
.daycol-body.is-dropping { outline: 2px dashed var(--sig-progress); outline-offset: 3px; }
.tray-head {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.tray-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  min-height: 44px;
  border-top: 1px solid var(--line-hair);
  cursor: grab;
}
.tray-row:first-of-type { border-top: 0; }
.tray-row:active { cursor: grabbing; }
/* The grip is a glyph, not a word, so --ink-disabled at 3.3:1 is the right
   floor: findable as a control, quiet enough not to compete with the name. */
.tray-grip {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  color: var(--ink-disabled);
}
.tray-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tray-est { flex: 0 0 auto; font-family: var(--mono); font-size: 11px; color: var(--ink-quiet); }
/* NO EST is the one thing in the tray that earns a colour, because a missing
   estimate is what makes every bar on this screen optimistic. */
.tray-est.is-missing { color: var(--sig-high); font-weight: 600; }
.tray-foot { margin-top: 10px; }
.tray-foot .btn { width: 100%; }

/* ---- Day columns ---- */
.daycol {
  min-width: 0;
  background: var(--surface-raised);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-md);
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
}
/* Today is marked by a filled ground and a bronze top edge — two cues, and
   neither of them is a signal hue, because "today" is not a state. */
.daycol.is-today { background: var(--surface-accent); border-top: 2px solid var(--brand); }
.daycol-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 7px; }
.daycol-name {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}
.daycol-num { font-family: var(--mono); font-size: 11px; color: var(--ink-quiet); }
.daycol-load {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-quiet);
}
.daycol-load.is-over { color: var(--sig-urgent); font-weight: 600; }
.daycol-bar {
  height: 5px;
  background: var(--line-hair);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 9px;
}
.daycol-fill { height: 100%; background: var(--sig-progress); }
.daycol-fill.is-over { background: var(--sig-urgent); }
.daycol-body { flex: 1 1 auto; min-height: 56px; display: flex; flex-direction: column; gap: 6px; }
/* WHEN SOMETHING IS OVER CAPACITY, SAY SO IN WORDS. A full red bar with no
   sentence is the exact failure this component exists to prevent — and it is
   also the only version of it a colour-blind reader can use. */
.daycol-warn {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--sig-urgent);
  font-weight: 600;
}
.daycol-drop {
  margin-top: 8px;
  padding: 12px 8px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-quiet);
}

.daychip {
  position: relative;
  padding: 8px 9px 8px 11px;
  background: var(--surface-base);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius);
  cursor: grab;
}
.daychip:active { cursor: grabbing; }
/* Same stripe grammar as a task row: 4px urgent, 3px high, nothing below. */
.daychip.p-urgent { border-left: 4px solid var(--sig-urgent); padding-left: 8px; }
.daychip.p-high   { border-left: 3px solid var(--sig-high); padding-left: 9px; }
/* On the go: an outlined blue edge AND the word in the meta line. */
.daychip.is-progress { border-color: var(--sig-progress); }
.daychip-title {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-primary);
  cursor: pointer;
}
.daychip-meta {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

/* ---- Phone weekstrip: no columns, six day buttons ---- */
.weekstrip { display: flex; gap: 6px; }
.weekstrip-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 56px;
  padding: 7px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line-hair);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--ink-secondary);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.weekstrip-btn.is-today { border-color: var(--brand); color: var(--ink-primary); }
.weekstrip-btn.is-on { background: var(--surface-accent); border-color: var(--line-strong); color: var(--ink-primary); }
/* The load dot is a graphic at 3:1 and it is never alone: the button also
   carries the day and the count in words. */
.weekstrip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-disabled);
}
.weekstrip-dot.is-planned { background: var(--sig-progress); }
.weekstrip-dot.is-over    { background: var(--sig-urgent); }

/* The hours figure inside a strip button. The dot shows shape, this shows fact —
   neither is left to carry the day on its own. */
.weekstrip-load {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-quiet);
  line-height: 1;
}
.weekstrip-load.is-over { color: var(--sig-urgent); font-weight: 500; }

/* ========================================================================== */
/* TASKS — controls and arrangements                                          */
/* ========================================================================== */
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.tasks-body { min-width: 0; }

.seg {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
}
.seg-icons { margin-left: auto; }
.seg-btn {
  height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.seg-btn:hover { color: var(--ink-primary); }
.seg-btn.is-on { background: var(--ink-primary); color: var(--on-signal); font-weight: 700; }
.seg-icon {
  width: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---- The board ---- */
.board {
  display: flex;
  gap: 12px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* Without this the snapport starts at the padding edge, so the first lane
     snaps flush to the screen and loses the page's gutter. */
  scroll-padding-left: var(--gutter);
  scrollbar-width: none;
}
.board::-webkit-scrollbar { display: none; }
.lane { flex: 0 0 auto; width: min(318px, 82vw); scroll-snap-align: start; }
.lane-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lane-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink-primary); }
.lane-count { font-family: var(--mono); font-size: 13px; color: var(--ink-quiet); }
/* The lane rule is the lane's state cue — 2px, a graphic, so 3:1 is the
   floor. The lane also says its name in words directly above it, which is
   what makes the colour a shortcut rather than the message. Class names come
   from the Airtable value ('lane-' + status), so lane-in-progress keeps its
   name even though the heading above it reads On the go. */
.lane-rule { border: 0; border-top: 2px solid var(--line-hair); margin: 7px 0 12px; }
.lane-rule.lane-in-progress { border-top-color: var(--sig-progress); }
.lane-rule.lane-to-do       { border-top-color: var(--line-strong); }
.lane-rule.lane-blocked     { border-top-color: var(--sig-urgent); }
.lane-note {
  margin: 10px 0 0;
  padding: 13px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-muted);
}

.card {
  position: relative;
  margin-bottom: 10px;
  padding: var(--d-card-pad);
  background: var(--surface-raised);
  border: 1px solid var(--line-hair);
  border-left: 1px solid var(--line-hair);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.card.p-urgent { border-left: 4px solid var(--sig-urgent); }
.card.p-high   { border-left: 4px solid var(--sig-high); }
/* Declared but never emitted — priorityClass() does not return p-medium. Kept
   deliberately (CONTRACT.md §1) so the rule exists if it ever does; the
   3px width keeps the stripe order intact if all three appear together. */
.card.p-medium { border-left: 3px solid var(--sig-progress); }
.card-title {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-family: var(--sans);
  font-size: var(--d-card-title);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-primary);
  cursor: pointer;
}
.card-facts {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--d-fact-size);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.card-facts > * + * { margin-left: 10px; }
.card-facts.is-late { color: var(--sig-urgent); font-weight: 600; }
.card-blocker { margin-top: 9px; font-size: 13px; }
.card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-hair);
}
.card-act { height: 38px; min-height: 38px; padding: 0 13px; border-radius: var(--radius-pill); font-size: 12.5px; }
.card-finish { border-color: var(--sig-done); color: var(--sig-done); font-weight: 700; }
.card-star { margin-left: auto; font-size: 15px; }

.show-more {
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--ink-muted);
  width: 100%;
  padding: 9px 12px;
  min-height: 44px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
}
.show-more:hover { border-color: var(--ink-quiet); color: var(--ink-primary); }

/* ========================================================================== */
/* TASKS — REGISTER (new)                                                     */
/* ========================================================================== */
/* The fourth arrangement. A board is for one person's week; a register is for
   forty rows at once, sorted, selected and acted on in a batch. It is a real
   <table>, its sort controls are real <button>s inside the <th>, and its
   checkboxes are real <input>s with a label naming the task — none of which
   is optional, because a div with a click handler is a row Tab skips. */
.reg-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.reg-table th {
  padding: 0 10px 7px 0;
  border-bottom: 2px solid var(--line-strong);
  vertical-align: bottom;
}
.reg-table td {
  padding: 9px 10px 9px 0;
  border-bottom: 1px solid var(--line-hair);
  color: var(--ink-secondary);
  vertical-align: top;
}
/* REF is mono and quiet: it is the thing you quote on the phone, not the
   thing you read down the page. */
.reg-ref { font-family: var(--mono); font-size: 11px; color: var(--ink-quiet); white-space: nowrap; }
.reg-th {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 0;
  min-height: 44px;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.reg-th:hover { color: var(--ink-primary); }
/* The active sort is named by an arrow AND by the only column whose head is
   full-strength ink. Direction is never carried by colour alone. */
.reg-th.is-sorted { color: var(--ink-primary); }
.reg-tr.is-done td { color: var(--ink-muted); text-decoration: line-through; }
.reg-tr.is-selected td { background: var(--tint-selected); }
.reg-tr:hover td { background: var(--surface-raised); }
.reg-check {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--sig-progress);
  cursor: pointer;
}
.reg-table td:first-child, .reg-table th:first-child { width: 34px; padding-right: 6px; }

/* The bulk bar. It appears only when something is selected, and it says how
   many in words before it offers a single button. */
.reg-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--surface-accent);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
}
.reg-bulk-count {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand);
  margin-right: 4px;
}
.reg-bulk .btn { min-height: 38px; padding: 7px 12px; font-size: 13px; }
.reg-bulk .btn-export { margin-left: auto; }

/* Phone: no table. Date group heads and two-line rows, with the sort key
   right-aligned so the column you sorted by is the one you can scan. */
.reg-group { margin-bottom: 16px; }
.reg-group-head {
  position: sticky;
  top: var(--topbar-h, 0px);
  z-index: 4;
  padding: 7px 0 5px;
  background: var(--surface-base);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  border-bottom: 1px solid var(--line-hair);
}

/* ---- Assign popover ---- */
/* The one shadow in the system, and this is what it is for. */
.assign-pop {
  position: absolute;
  z-index: 50;
  width: min(320px, calc(100vw - 32px));
  max-height: 60vh;
  overflow-y: auto;
  padding: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-overlay);
}
.assign-pop[hidden] { display: none; }
.assign-pop-head {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.assign-pop-person {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 8px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-primary);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.assign-pop-person:hover { background: var(--surface-accent); }
.assign-pop-person.is-selected { background: var(--surface-accent); box-shadow: inset 2px 0 0 0 var(--brand); }
/* Their current load, in mono, so you are not assigning blind. */
.assign-pop-load {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-quiet);
  white-space: nowrap;
}
.assign-pop-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-hair);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.assign-pop-foot label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 13.5px;
  color: var(--ink-secondary);
  cursor: pointer;
}
.assign-pop-foot .btn-primary { margin-top: 0; }
/* WARN, NEVER BLOCK. Starring somebody past their six is often the right
   call — the app's job is to say the resulting number out loud and let them
   unstar what they cannot reach. --sig-high, with the figure in the sentence,
   never a bare amber outline. */
.assign-warn {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--sig-high);
}

/* ========================================================================== */
/* MANAGE — OVERVIEW                                                          */
/* ========================================================================== */
/* Two columns from 1024px up: company goal progress on the left, blockers on
   the right, the load tables full width beneath. The pairing is the point —
   what we said we would do, next to what is stopping us — and it only works
   side by side, so below 1024 it stacks in that same order instead.

   .mg-overview is the wrapper the two sections sit in; anything outside it
   (the load tables) is already full width. Without the wrapper every section
   simply stacks, which is today's layout, so this degrades to what shipped. */
.mg-overview { min-width: 0; }
.mg-overview > .section { min-width: 0; }

/* A blocker without its reason is the thing this screen exists to prevent, so
   the reason wraps in full — it is never truncated to keep a row tidy. The
   3px urgent edge is on the row itself here, on top of the tint the row
   already carries, because in a list of nothing but blockers the tint alone
   stops distinguishing anything. */
.mg-overview .task.is-blocked,
.section-blocked .task.is-blocked {
  border-left: 3px solid var(--sig-urgent);
  padding-left: 12px;
}
.mg-overview .task-blocker,
.section-blocked .task-blocker { white-space: normal; overflow: visible; }

/* ========================================================================== */
/* MANAGE — PEOPLE (new)                                                      */
/* ========================================================================== */
/* Counts come from shared rows only. Private work never leaks into somebody
   else's view of a person, and that is a data rule the layout must not
   quietly undo — there is no "all work" toggle here on purpose. */
/* Manage · People: the list and the Unassigned block on the left, the selected
   person on the right. One column below the desktop breakpoint — the panel is
   the point of the screen, so it follows the list rather than sitting beside a
   squeezed one. */
.mg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
/* 1256, not 1024: the rail takes 232px off the work area, and this rule is
   about having room for a 400px panel AND a list of 232px person cards
   beside it. 1256 is the width at which the work area is the 1024 this was
   written for. */
@media (min-width: 1256px) {
  .mg-grid { grid-template-columns: minmax(0, 1fr) var(--side-panel); }
}

.mg-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.mg-person {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 2px 10px;
  width: 100%;
  padding: 11px 12px;
  min-height: 44px;
  text-align: left;
  background: var(--surface-raised);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-md);
  color: var(--ink-primary);
  cursor: pointer;
  font-family: var(--sans);
}
.mg-person:hover { border-color: var(--line-strong); }
.mg-person.is-selected {
  background: var(--surface-accent);
  border-color: var(--brand);
}
/* Initials, not a photograph: we do not hold photographs of site teams, and a
   coloured circle with a letter in it is a graphic, so it sits on
   --surface-accent rather than spending a signal hue. */
.mg-person-ini,
.mg-avatar {
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-accent);
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
}
.mg-person-name { font-size: 14px; font-weight: 600; line-height: 1.25; }
.mg-person-role {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.mg-person-counts {
  grid-column: 1 / -1;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.mg-person-counts .is-late { color: var(--sig-urgent); font-weight: 600; }
.mg-person-counts .is-starred { color: var(--sig-high); font-weight: 600; }
.mg-person-bar {
  grid-column: 1 / -1;
  height: 5px;
  margin-top: 8px;
  background: var(--line-hair);
  border-radius: 2px;
  overflow: hidden;
}
.mg-person-bar > span { display: block; height: 100%; background: var(--sig-progress); }
.mg-person-bar > span.is-over { background: var(--sig-urgent); }

.mg-unassigned { margin-bottom: 20px; }
.mg-unassigned-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  min-height: 44px;
  border-bottom: 1px solid var(--line-hair);
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.mg-panel {
  background: var(--surface-raised);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-md);
  padding: 15px 16px;
}
.mg-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-hair);
}
.mg-panel-head h3 { margin: 0; font-size: 19px; font-weight: 700; color: var(--ink-primary); }
.mg-panel-head .tracked { margin-left: auto; }
.mg-six { list-style: none; margin: 0 0 14px; padding: 0; }
.mg-six li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  min-height: 44px;
  border-bottom: 1px solid var(--line-hair);
  font-size: 13.5px;
  color: var(--ink-primary);
}
.mg-six .btn-quiet { margin-left: auto; flex: 0 0 auto; }
/* ---- The four blocks of the person panel ----
   Add, their week, everything else, hand over. One rule for the block and one
   for its head, so the four read as a sequence rather than four inventions.
   Hairlines between them, not boxes inside a box. */
.mg-block { padding-top: 14px; border-top: 1px solid var(--line-hair); }
.mg-block:first-of-type { padding-top: 0; border-top: 0; }
.mg-block-head { margin: 0 0 9px; color: var(--ink-quiet); }
.mg-block-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.mg-block-head-row .mg-block-head { margin-bottom: 9px; }

/* ---- New task for them ----
   Fewer fields than the FAB's form on purpose: the owner is whichever card is
   selected, and a private to-do cannot be made for somebody else at all, so
   neither control exists here to be got wrong. */
.mg-add { padding-bottom: 4px; }
.mg-add-form { display: flex; flex-direction: column; gap: 10px; }
.mg-add-title {
  width: 100%;
  height: var(--control-h);
  padding: 0 12px;
  background: var(--surface-base);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-primary);
  font-family: var(--sans);
  font-size: 14px;
}
.mg-add-title::placeholder { color: var(--ink-quiet); }
.mg-add-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mg-add-label { flex: 0 0 68px; color: var(--ink-quiet); }
/* The segments carry short words, so they can be shorter than the standard
   control without dropping under the 44px reach — the row's own gap and the
   group's padding make up the difference. */
.seg-small { flex-wrap: wrap; }
.seg-small .seg-btn { height: 34px; padding: 0 11px; font-size: 12.5px; }
.mg-add-star {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}
.mg-add-star label { cursor: pointer; }

.mg-assign {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.mg-assign label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 13.5px;
  color: var(--ink-secondary);
  cursor: pointer;
}
.mg-assign .btn-primary { margin-top: 0; }

/* ========================================================================== */
/* ADD — one button, one module                                               */
/* ========================================================================== */
.fab {
  position: fixed;
  right: var(--gutter);
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 25;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-signal);
  box-shadow: var(--shadow-overlay);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fab:hover { background: var(--sig-high); }
body.sheet-open .fab { display: none; }

.sheet-add .sheet-head { align-items: center; margin-bottom: 14px; }
.add-form { display: block; }
.add-title {
  height: 52px;
  margin-bottom: 14px;
  font-size: 16.5px;
  font-weight: 600;
  border-width: 2px;
  border-color: var(--sig-progress);
}
.add-label {
  display: block;
  margin: 0 0 7px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.add-grid { display: grid; gap: 6px; margin-bottom: 14px; }
.add-grid-2 { grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.add-grid-4 { grid-template-columns: repeat(4, 1fr); }
.add-grid-5 { grid-template-columns: repeat(5, 1fr); }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 4px;
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-pill);
  background: var(--surface-accent);
  color: var(--ink-muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.pill:hover { border-color: var(--ink-quiet); color: var(--ink-primary); }
.pill.is-on {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: var(--on-signal);
  font-weight: 700;
}
/* The date pill wraps a real date input so the native picker still opens. */
.pill-date { position: relative; border-style: dashed; }
.pill-date:focus-within { outline: 2px solid var(--sig-progress); outline-offset: 2px; }
.add-date-hidden {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
}
.add-switches { display: flex; gap: 8px; margin-bottom: 18px; }
.pill-wide { flex: 1 1 0; height: var(--control-h); font-size: 13.5px; }
/* Starred for this week is not a filled state — it keeps its ground and takes
   an amber edge, because it is a commitment, not a completion. */
.pill-week.is-on { background: var(--surface-accent); border-color: var(--sig-high); color: var(--ink-primary); }
.pill-star { color: var(--sig-high); font-size: 15px; line-height: 1; }
.pill-private { border-style: dashed; }
.pill-private.is-on { border-style: solid; }
.add-submit { width: 100%; height: 54px; margin-top: 0; font-size: 16px; }
.add-foot { text-align: center; margin-top: 10px; }
.add-select { width: 100%; }

/* ========================================================================== */
/* BREAKPOINTS                                                                */
/* ========================================================================== */

/* ---- ≥720px: desktop padding, centred modal sheet, wider gutter ---- */
/* The gutter token stays 16px everywhere — the desktop breathing room comes
   from the content column's own padding, not from moving a token, so the
   negative-margin bleeds (.week-band, .board) keep lining up. */
@media (min-width: 720px) {
  .app { padding: var(--d-app-pad-wide); }
  .gate-title { font-size: 44px; }
  .sheet { align-items: center; }
  .sheet-panel {
    border: 1px solid var(--line-hair);
    border-top: 3px solid var(--brand);
    border-radius: var(--radius-md);
  }

  /* ---- The shells swap ----
     The phone's top bar and bottom tabs go; the rail and the console header
     arrive. This is the only place the swap happens, in both directions, so
     there is one line to read to know which shell a width gets. */
  .topbar, .tabs { display: none; }
  .shell {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    align-items: start;
    min-height: 100svh;
  }
  .rail { display: flex; }
  .conhead { display: flex; }

  /* The console header carries the screen's name in the serif, so the day
     view's own serif date line would be the second one on the page. The date
     itself does not go — it moves to .conhead-sub, which is the tracked line
     under the title. */
  .conhead ~ .app .day-head { display: none; }
}

/* ================= Reach: the tab bar goes to the thumb ==================
   On a phone the top of the screen is the hardest place to reach one-handed,
   which is exactly how this app is used — standing on site, holding something
   else. Below 720px the tabs leave the header and sit at the bottom, on the
   rail surface, and the FAB lifts clear of them. */
@media (max-width: 719px) {
  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    gap: 0;
    padding: 0 8px env(safe-area-inset-bottom);
    background: var(--surface-rail);
    border-top: 1px solid var(--line-hair);
    overflow: visible;
  }
  .tab {
    flex: 1 1 0;
    flex-direction: column;
    gap: 3px;
    margin-right: 0;
    padding: 8px 2px 9px;
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.01em;
    border-bottom: none;
    border-top: 2px solid transparent;
  }
  .tab-icon { width: 21px; height: 21px; }
  .tab.is-active { border-top-color: var(--brand); border-bottom-color: transparent; }
  /* Clear the tab bar AND the add button, so the last row of a list can
     always be scrolled out from under both. */
  .app { padding-bottom: calc(152px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .fab { bottom: calc(80px + env(safe-area-inset-bottom)); }

  /* Three things do not fit across a phone. The name is the one that can go:
     you know who you are, and it is still in the sheet and on Sign out. */
  .person-name { display: none; }
  .topbar-app { font-size: 14px; }
  .topbar-logo { width: 94px; }

  /* The week grid collapses to the phone layout: aside content full width,
     no day columns. The six, then the weekstrip, then the tray — which is
     the same order top to bottom that the desktop aside has. */
  .weekgrid { display: block; }
  .weekgrid-aside { display: block; }
  .weekgrid-aside > * + * { margin-top: 16px; }
  .weekgrid-days { display: none; }
  .week-total-bar { height: 8px; }

  /* The register drops to grouped rows. The table itself is hidden rather
     than reflowed: a nine-column table on a 360px screen is not a table. */
  .reg-table { display: none; }
  .reg-bulk { position: sticky; top: var(--topbar-h, 0px); z-index: 7; }
  .reg-bulk .btn-export { margin-left: 0; }

  /* Manage · People: one column, panel beneath the list. */
  .mg-people { grid-template-columns: 1fr; }

  .assign-pop { width: calc(100vw - 32px); }
}

/* Above the phone breakpoint the grouped-row fallback is not used. */
@media (min-width: 720px) {
  .reg-group, .reg-group-head { display: none; }
  .weekstrip { display: none; }
}

/* ---- ≥900px: the board lanes stop scrolling and share the width ---- */
/* Unchanged. With the rail the three lanes share ~610px here rather than the
   ~840px they used to, which is tighter than it was but is still three lanes
   you can see at once — and a card that clips its facts line is the
   behaviour that line was written for. */
@media (min-width: 900px) {
  .lane { width: auto; flex: 1 1 0; }
  .board { overflow-x: visible; }
}

/* ---- The week grid's aside waits for the width the rail took ----
   252px of aside plus five day columns needs more room than a 720px screen
   has once the rail has 232px of it: the columns came out at 36px, which is
   not a column. Below 1100 the aside sits above the grid instead of beside
   it, which gives the days the same width they had before the rail. */
@media (min-width: 720px) and (max-width: 1099px) {
  .weekgrid { grid-template-columns: minmax(0, 1fr); }
}

/* ================= Two panes on a laptop =================
   The detail sheet stops being a modal and becomes a 400px side pane, and the
   list moves over to make room rather than hiding under it — so you can read
   the task you are editing in its context. */
@media (min-width: 1024px) {
  .sheet {
    justify-content: flex-end;
    align-items: stretch;
    pointer-events: none;
  }
  .sheet-backdrop { display: none; }
  .sheet-panel {
    pointer-events: auto;
    width: var(--side-panel);
    max-width: var(--side-panel);
    height: 100%;
    max-height: none;
    border: 0;
    border-left: 1px solid var(--line-hair);
    border-radius: 0;
    box-shadow: var(--shadow-overlay);
    padding-top: calc(var(--topbar-h, 0px) + 20px);
  }
  /* ---- The pane takes its room off the WORK AREA, not off .app ----
     It used to set margin-right on .app, which has margin: 0 auto. Overriding
     one side of that leaves the other side auto, so the left margin ate all
     the slack and pushed the whole screen against the pane — the content did
     not narrow, it just slid right and stopped being centred.

     Padding on .workarea narrows the box everything inside it lives in, so
     .app's auto margins centre it again in what is left, and .conhead — which
     is inside .workarea — moves over with it and needs no rule of its own.
     One reservation, in one place, and both children obey it. */
  body.sheet-open .workarea { padding-right: var(--side-panel); }

  /* With the pane open the week grid has 400px less to work with, so the
     aside gives way first — the day columns are the thing you came for. */
  body.sheet-open .weekgrid { grid-template-columns: 200px minmax(0, 1fr); gap: 14px; }
  body.sheet-open .mg-people { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

  /* Manage · Overview: the goal progress and the blockers side by side. */
  .mg-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 28px;
    align-items: start;
  }
}

/* ================= The rail's 232px comes out of the pane's band =========
   The two-pane layout switches on at 1024px, and app.js reads the same
   number, so the breakpoint stays where it is. What changed is the
   arithmetic behind it: the work area is 232px narrower than the page used
   to be, so between 1024 and 1279 a pane leaves roughly a phone's width of
   content beside it. Mobile-first pays off here — a 336px column is a layout
   this app already has — but the multi-column pieces inside it do not fit in
   one, so in that band they fall back to their narrow arrangements while the
   pane is open. Above 1280 everything is as it was. */
@media (min-width: 1024px) and (max-width: 1279px) {
  body.sheet-open .app { padding-left: 20px; padding-right: 20px; }
  body.sheet-open .weekgrid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  body.sheet-open .weekgrid-days { gap: 6px; }
  body.sheet-open .mg-grid { grid-template-columns: minmax(0, 1fr); }
  body.sheet-open .mg-overview { grid-template-columns: minmax(0, 1fr); }
  /* Three lanes in 336px is not three lanes. They go back to scrolling. */
  body.sheet-open .board { overflow-x: auto; }
  body.sheet-open .lane { flex: 0 0 auto; width: min(318px, 74vw); }
}

/* ---- Manage · People gets its side panel once there is room for two ---- */
@media (min-width: 1100px) {
  .mg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
}

/* ========================================================================== */
/* MOTION                                                                     */
/* ========================================================================== */
/* Two carets rotate and nothing else moves. Both are listed here once. */
@media (prefers-reduced-motion: reduce) {
  .section-caret, .week-caret { transition: none; }
  .confetti { display: none; }
}

/* ========================================================================== */
/* COMPACT — THE TWO LAYOUT CHANGES                                           */
/* ========================================================================== */
/* Everything above this point is density by token: same layout, smaller
   numbers. These two rules change where things sit, and they are desktop
   only. Below 720px the row stays two lines and the hero stays stacked —
   a phone was never the screen you were trying to fit more onto, and the
   one-handed row needs its height.

   Both are pure CSS. app.js emits the same markup in both densities, which
   is the whole reason this is a setting and not a fork. */

/* Phone compact is gentler than desktop compact. The spacing tightens; the
   type barely moves, because 12.5px in daylight on a building site is not a
   size, it is an apology. */
@media (max-width: 719px) {
  :root[data-density="compact"] {
    --d-row-title:  13.5px;
    --d-fact-size:  10.5px;
    --d-hero-title: 21px;
  }
}

@media (min-width: 720px) {
  /* ---- 1. The row's facts move onto the title's line ----
     Two thirds of the row's saving comes from here, not from the type. The
     title takes what is left and clips; the facts never wrap, because they
     are ordered so the first thing to go is the least useful. A blocker
     reason still gets its own line — it is the one piece of text on a row
     that has to be read, not scanned. */
  :root[data-density="compact"] .task { align-items: center; }
  :root[data-density="compact"] .task-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: var(--d-row-gap);
    row-gap: 4px;
  }
  :root[data-density="compact"] .task-body > .task-title {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  :root[data-density="compact"] .task-body > .task-meta {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 0;
  }
  :root[data-density="compact"] .task-body > .task-blocker {
    flex: 1 1 100%;
    margin-top: 0;
  }

  /* ---- 2. Next up: the title and the four actions share a line ----
     161px to 95px. The chips and facts keep a row of their own, because late,
     urgent, hours and the job code have to land at once; then the title takes
     the width that is left and STILL WRAPS IN FULL. Nothing clips here. This
     is the one title on the screen you actually have to read, which is the
     whole reason the one-line version was not taken.

     Grid, not flex, so the four children reorder without app.js knowing. The
     empty and all-skipped states carry .hero-clear and keep the block flow —
     they have no actions to share a line with. */
  :root[data-density="compact"] .hero:not(.hero-clear) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 16px;
    row-gap: 7px;
    align-items: center;
  }
  :root[data-density="compact"] .hero:not(.hero-clear) .hero-chips {
    grid-row: 1; grid-column: 1; margin-bottom: 0;
  }
  :root[data-density="compact"] .hero:not(.hero-clear) .hero-facts {
    grid-row: 1; grid-column: 2; margin: 0; justify-self: end;
  }
  :root[data-density="compact"] .hero:not(.hero-clear) .hero-title {
    grid-row: 2; grid-column: 1; margin: 0;
  }
  :root[data-density="compact"] .hero:not(.hero-clear) .hero-actions {
    grid-row: 2; grid-column: 2;
  }
  :root[data-density="compact"] .hero:not(.hero-clear) .hero-blocker {
    grid-row: 3; grid-column: 1 / -1; margin-bottom: 0;
  }
}

/* ========================================================================== */
/* GOALS — the target, the children and the add row                           */
/* ========================================================================== */
/* The target used to be reachable only by clicking a goal's title, which
   nothing said was a button, and it was called Deadline in the sheet and
   Target on the card. One name, and it is now edited where it is read. */
.goal-target {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.goal-target-label { flex: 0 0 auto; color: var(--ink-quiet); }
.goal-target-input {
  height: 34px;
  padding: 0 10px;
  background: var(--surface-base);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-primary);
  font-family: var(--mono);
  font-size: 12px;
}
.goal-target-none { font-size: 12.5px; color: var(--ink-quiet); }

/* The children are ordinary task rows now, so they need no list styling of
   their own — only the indent that says they belong to the goal above. */
.goal-children { margin-top: 12px; padding-left: 16px; }

/* Add a task to the goal. Owner, due and priority sit on one line under the
   title so the row stays a row rather than becoming a form. */
.goal-add { margin-top: 12px; padding-left: 16px; }
.goal-add-form { display: flex; flex-direction: column; gap: 8px; }
.goal-add-title {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background: var(--surface-base);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-primary);
  font-family: var(--sans);
  font-size: 13.5px;
}
.goal-add-title::placeholder { color: var(--ink-quiet); }
.goal-add-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.goal-add-select,
.goal-add-date {
  height: 34px;
  min-width: 0;
  padding: 0 8px;
  background: var(--surface-base);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-primary);
  font-family: var(--sans);
  font-size: 12.5px;
}
.goal-add-select { flex: 1 1 130px; }
.goal-add-date { flex: 0 0 auto; font-family: var(--mono); font-size: 12px; }
.goal-add-btn { flex: 0 0 auto; margin-top: 0; }

/* The line under the add panel that says what just went in. Quiet — it is a
   receipt, not an announcement, and it sits where the next task is about to
   be typed. */
.add-added {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line-hair);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--sig-done);
}
