/* ================= THE ALTERNATE UX — RESPONSIVE =================
   Four shapes, not one shrunk: >=1500 three columns; >=1180 tighter rails; >=900 two columns with
   utility drawer; >=640 one column, details drawer, icon-only nav; <640 phone chrome (compact bar,
   full-height sheets, bigger targets). */

/* The bar gives in the order the shell states it must, before it runs out — measured at 1600px
   with everything shown: brand 68 + nav 762 + search 274 + identity 526, ~60px over budget.
   Captions and the account name go first (least load-bearing text); the nav labels go last, all
   together, by measured fit (altNavFit()). */
@media (max-width:1699px){
  /* `.a-focus-l b` COMES BACK below 640px — see the phone block at the bottom of this file for
     why, and note that it depends on that block staying BELOW this one in source order. */
  .a-focus-l b{ display:none; }
  /* `.a-account .nm` has no name to cap any more — the control is avatar-only, named via the
     button's `title`/`aria-label`, which is why the hides below are accessibility-safe. */
}
@media (max-width:1499px){
  .alt-app{ --a-left:300px; --a-right:280px; }
}
/* THE NAV'S LABELS ARE NOT A BREAKPOINT ANY MORE. They used to drop per item at 1699 / 1499 and
   all at 1365; the bar now shows every label or none, by measured fit — see altNavFit() in
   JS/alt/alt-shell.js and `.a-nav.icons-only` in CSS/alt/alt-shell.css. A width written here
   would be a second, disagreeing answer. */
/* The search-always-second-row rule lives in CSS/alt/alt-shell.css now (`.a-top`/`.a-top-search`
   base rules) — it became an unconditional style, not a responsive adjustment, so it moved to
   the file that owns those classes' definitions. */

/* The universal search stays in the second row at every width. CSS alone can't inline it:
   `.a-top-search` follows `.a-top-right` in DOM order and `margin-left:auto` resolves after
   line-packing. `order` was rejected (splits visual from tab order). `search-second-row.test.js`
   pins `.a-top-search`/`.a-top-row2` byte for byte. */
@media (max-width:1179px){
  .alt-app{ --a-left:280px; --a-right:264px; }
}

/* ---------- the rails become drawers ---------- */
@media (max-width:1023px){
  .a-main{ grid-template-columns:minmax(0,1fr) !important; }
  /* The top bar's wrap is declared once at 1179 now (not here) — the reason this band still
     matters: a horizontal scrollbar on the whole document is the worst layout failure, in
     exactly the band a small laptop or split-screen window sits in. */
  .a-dock-close{ align-self:flex-end; }
  .a-docked-only{ display:inline-flex !important; }
}
@media (min-width:1024px){
  .a-docked-only{ display:none !important; }
  .a-dock-close{ display:none !important; }
}
/* ---------- tablet portrait and below ---------- */
@media (max-width:820px){
  .a-nav{ overflow-x:auto; scrollbar-width:none; }
  .a-nav::-webkit-scrollbar{ display:none; }
  .a-band,.a-main,.a-quick{ padding-left:var(--a-3); padding-right:var(--a-3); }
  .a-analytics{ gap:var(--a-2); }
  .a-stats{ flex-wrap:wrap; }
  .a-stat{ min-width:calc(50% - var(--a-2)); flex:1 1 calc(50% - var(--a-2)); }
  .a-quicklinks{ max-width:none; flex:1 1 100%; }
  .a-two,.a-three{ grid-template-columns:1fr; }
  .a-week{ grid-template-columns:repeat(3,minmax(160px,1fr)); overflow-x:auto; }
}

/* ================= 24px pointer floor, at every width =================
   Outside any media query: sys_design-system.md §18 (mobile.html has its own 44px rule). Loads
   after every component sheet, so it raises targets without editing them: grow the box where
   space is free, else grow only the hit area via a transparent `::after`. Splitters excluded. */

/* ---------- (a) the box grows ---------- */
/* These sit in fixed tracks beside a 45px `.a-row-main`, so extra height falls into empty
   column space. The star needs `flex-basis` and `min-width` stated explicitly (24/32) rather
   than relying on `min-width:auto`. */
.a-star{ flex-basis:var(--a-ctl-sm); min-height:var(--a-ctl-sm); }
/* `.a-more` is 26px wide only as a flex item — on a note card (no flex parent) it measured
   23x19. A min-width covers the non-flex case without touching the flex one (24 < 26). */
.a-more{ min-width:var(--a-ctl-sm); min-height:var(--a-ctl-sm); }
button.a-row-due{ min-height:24px; }
.a-note-line{ height:auto; min-height:24px; }
.a-dist-more{ min-height:24px; }
/* A chip is only a target when it's pressable — `.a-chip` is also a read-only label (a tag, a
   count), so only the BUTTON gets the floor; raising every chip would inflate read-only pills
   for no accessibility gain. */
button.a-chip{ height:auto; min-height:24px; }
/* The label IS the target — a checkbox's own box is 13px in every browser and cannot be the
   thing a person aims at. Declared here rather than in alt-shell.css, which this sheet does not
   own; the phone block below still takes it to 32. */
.a-check-l{ min-height:24px; }
/* The per-day "+" was 23px — one pixel under, which is exactly the kind of miss an estimate
   makes and a measurement does not. */
.a-cal-add{ min-height:24px; }
.a-cal-more{ min-height:24px; }

/* ---------- (b) the hit area grows, the drawing does not ---------- */
/* The check is a 19px circle and stays one — the pseudo-element is 24x24, centred, transparent,
   part of the button, so `elementFromPoint` at every edge of the 24px box answers `.a-check`. */
.a-check{ position:relative; }
.a-check::after{
  content:''; position:absolute; top:50%; left:50%; width:24px; height:24px;
  transform:translate(-50%,-50%);
}
/* The widget disclosure header may be 24px tall, the 14px chevron may not — vertical-only band,
   bounded by `left:0;right:0` so it never reaches the drag handle or overflow beside it. Costs
   nothing: a `min-height` here would have grown the rail by 50px over five cards at 1440. */
.a-w-fold{ position:relative; }
.a-w-fold::after{
  content:''; position:absolute; left:0; right:0; top:50%; height:24px; transform:translateY(-50%);
}
/* The task title is the one control whose column sets the row height — a `min-height` here
   would cost real space (67 rows × 4px on the densest surface). Its own `overflow:hidden`
   would clip a pseudo-element of its own, so the containing block moves one level out to
   `.a-row-main`, whose ancestor status escapes that clip. */
.a-row-main{ position:relative; }
.a-row-main > button.a-row-t::after{
  content:''; position:absolute; left:0; right:0; top:-2px; height:24px;
}
/* `.a-group-more` is drawn by alt-notes.css, which this sheet does not own. A 24px button on a
   note section header, on the one page where the alternative is a hover-only drag handle. */
.a-group-more{ position:relative; }
.a-group-more::after{
  content:''; position:absolute; top:50%; left:50%; width:24px; height:24px;
  transform:translate(-50%,-50%);
}
/* Minimalist's row drag handle (alt-minimal.css) is a 16x14 drawing, deliberately subtle next
   to a 32px row's title — so it owns no size here, only the target. Measured:
   `elementFromPoint` at the edges of a 24px box missed the drawing before this rule existed.
   No clipping ancestor between it and `.a-row`, so it needs no containing-block trick. */
.a-minimal-row-grab{ position:relative; }
.a-minimal-row-grab::after{
  content:''; position:absolute; top:50%; left:50%; width:24px; height:24px;
  transform:translate(-50%,-50%);
}

/* ---------- the identity corner gives way in a fixed order ----------
   [S] STRIDE | [team mark] Team name → [S] STRIDE | [team mark] → [S] | [team mark]
   The product outlasts the team name, and the team mark is never dropped. All of this goes
   before any navigation destination does (order of sacrifice: sys_branding.md). */
@media (max-width:1099px){
  .a-team-name{ display:none; }
}
@media (max-width:839px){
  .a-brand b{ display:none; }
}

/* ---------- phone ---------- */
/* The view row gives way in a stated order (below 1440 the words go, below 640 the tabs take a line of their own): CSS/alt/alt-page-top.css. */
@media (max-width:639px){
  /* DS-04: every ladder step grows 2px, through the tokens, so nothing is left out. */
  .alt-app{ --a-row:48px; --a-ctl-sm:28px; --a-ctl:34px; --a-ctl-lg:38px; --a-chip-h:26px; }
  /* The phone keeps its 48px touch floor under every size level. */
  #altList .a-row{ min-height:max(48px, var(--z-row)); }
  body.a-compact #altList .a-row, body.a-minimal.a-compact #altList .a-row{ min-height:max(48px, var(--z-row1)); }
  /* `.a-brand b` is already hidden from 839px up; restated here so this block reads as the
     complete phone picture on its own. */
  .a-brand b{ display:none; }
  .a-team{ margin-left:7px; padding-left:8px; }
  /* Focus keeps its two-line readout, since a control may compact to an
     icon but never to a bare chevron and Focus has no glyph. Width is bounded by
     `.a-focus{max-width:210px}` and the 150px ellipsis on `.a-focus-l span` (alt-shell.css). */
  /* This beats the 1699px block's `.a-focus-l b{display:none}` on SOURCE ORDER alone — same
     specificity, later block. If these two blocks were ever reordered the caption would
     silently vanish again; shell-identity.test.js resolves the cascade rather than grepping
     for either rule, for exactly that reason. */
  .a-focus-l b{ display:block; }
  .a-focus{ padding:0 8px; }
  /* `.a-account .nm{display:none}` is gone with the span it hid — worth knowing why it mattered:
     it once left the account button with accessible name "" on every suite page, because the
     label lived only in that text node. */
  /* The cluster wraps — its six children are all `flex:0 0 auto` to keep identity in the
     corner at every width the bar is one row, which added to 312px inside a 285px box at 320px.
     `.a-top{flex-wrap:wrap}` restating here is dead: the base rule (alt-shell.css) already sets
     it unconditionally. */
  .a-top-right{ margin-left:0; flex:1 1 100%; flex-wrap:wrap; gap:6px; justify-content:flex-start; }
  /* Create keeps its icon and loses its word — it is the blue button, which is identification
     enough, and its aria-label carries the name. */
  .a-top-right #altCreateBtn{ gap:0; padding:0 9px; }
  .a-top-right #altCreateBtn .a-lbl{ display:none; }   /* the word sits in a `.a-lbl` span (alt-shell.js); the button keeps its own 13px/600 */
  .a-top-right #altCreateBtn svg{ width:17px; height:17px; }
  .a-top-right #altCreateBtn svg:last-child{ display:none; }
  /* ---------- The `Focused` toggle folds to its reticle ----------
     Unlike `.a-focus-l`, this button has a glyph (`altIcon('focusReticle')`), so folding the word
     is allowed. Clipped, not `display:none`: the buttons have no `aria-label`, so the span keeps
     the accessible name. */
  .a-btn.a-focus-btn{ position:relative; }
  .a-btn.a-focus-btn .a-focus-btn-t{
    position:absolute; width:1px; height:1px; padding:0; margin:-1px;
    overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0;
  }
  .a-row{ flex-wrap:wrap; row-gap:6px; }
  .a-row-t{ flex:1 1 100%; white-space:normal; }
  .a-row-meta{ flex:1 1 100%; justify-content:flex-end; }
  .a-row-due{ min-width:0; }
  /* Touch targets — what a thumb gets ON TOP of the unconditional floor above (not instead of
     it): 32px where 24 is the minimum, the whole checkbox ROW rather than the label's line box,
     and a disclosure sized for a header with no hover-revealed drag handle beside it. */
  /* The circle stays 19px; on a phone the HIT AREA grows with the ladder (DS-29, DS-04). */
  .a-check::after{ width:var(--a-ctl-sm); height:var(--a-ctl-sm); }
  /* `flex-basis` beside `width` — both are flex items in a task row and the basis decides the
     main size. The floor above replaces the automatic `min-width:auto` minimum this rule relied
     on before, so the intended width is now stated rather than inferred. */
  .a-star,.a-more{ width:var(--a-ctl-sm); height:var(--a-ctl-sm); padding:0; flex-basis:var(--a-ctl-sm); }
  /* `button.a-chip` by name: the floor above is `(0,1,1)` and would otherwise out-specify this
     rule and pull a pressable chip back DOWN to 24 on the one device that most needs 26. */
  .a-chip,button.a-chip,.a-note-line{ min-height:26px; display:inline-flex; align-items:center; }
  .a-dist-more{ min-height:26px; }
  .a-row-t,button.a-row-t{ min-height:var(--a-ctl-sm); display:flex; align-items:center; }
  .a-w-fold{ min-height:var(--a-ctl); }
  .a-group-more{ width:var(--a-ctl); height:var(--a-ctl); opacity:1; }
  .a-w-grab{ display:none; }          /* dragging a widget is a pointer gesture; the menu moves it */
  /* The note group grip goes for the same reason, and the header's first-child indent goes with it
     so the empty cell does not leave every group name indented past nothing. Reordering a group
     here is the row menu's Move up / Move down, which calls the identical altNudgeGroup(). */
  .a-group-grab{ display:none; }
  .a-note-sec-h > .a-group-h:first-child{ margin-left:0; }
  .a-ncl-item .a-w-grab{ display:none; }
  .a-note-card .a-more,.a-ncl-item .a-more{ opacity:1; }
  /* No `.tcl-a` rule here on purpose: CSS/checklist.css already has an unprefixed
     `@media (max-width:640px)` reveal rule that covers every checklist host (`#panel` in
     task-editor-markup.js, JS/alt/alt-team-task.js). */
  /* A checkbox's own box is 13px in every browser; the LABEL is the target, so the whole row
     gets the height and the box sits in the middle of it. */
  .a-check-l{ min-height:var(--a-ctl); }
  .a-check-l input[type="checkbox"]{ width:18px; height:18px; flex:0 0 auto; }
  .a-quick{ overflow-x:auto; flex-wrap:nowrap; }
  .a-quick .a-btn{ flex:0 0 auto; }
  .a-week{ grid-template-columns:repeat(2,minmax(150px,1fr)); }
  /* The per-day "+" is a thumb target on a phone, not a hairline. */
  .a-cal-add{ min-height:var(--a-ctl); }
  .a-month{ font-size:var(--a-fs-11); }
  .a-list-foot{ flex-wrap:wrap; }
}

/* ---------- Notes: Find and the navigator at each width ----------
   The strip's own give-way (figures scroll, tools wrap) is the shared component's (CSS/alt/alt-page-top.css). Find is 280 at 1680, 240 at 1280
   and below, and a full row at 390. */
@media (min-width:1500px){
  #altNotesFindHost{ flex-basis:280px; }
}
@media (max-width:1279px){
  #altNotesFindHost{ flex-basis:240px; }
}
/* One column here: Only is drawn at every width this narrow, hover or not. */
@media (max-width:1023px){
  .a-group-only{ opacity:1; }
}
@media (max-width:639px){
  #altNotesFindHost{ flex:1 1 100%; }
  /* The popover takes the field's own width here, so it cannot reach past the screen's edge. */
  .a-notes-find-pop{ width:auto; max-width:none; }
  .a-note-sec-h > .a-group-h{ min-height:var(--a-ctl); }
}
/* A Notes row for a finger: 44px, the menu in flow as a 32px target beside the date (the hover overlay in alt-notes.css
   is for a mouse at 640px and wider and is never drawn here, so nothing sits over the date). Compact keeps the
   44px: the row's height is the target, not the density. */
@media (pointer:coarse), (max-width:639px){
  .a-note-card, body.a-compact .a-note-card{ min-height:44px; }
  .a-note-card .a-more, .a-note-card.starred .a-note-star{ width:var(--a-ctl); height:var(--a-ctl); padding:0; }
  /* The lingering-work chips stay 18px and give a finger a 32px target through their own hit area (alt-notes.css). ::after
     insets from the PADDING edge, inside the 1px border: (18 - 2) + 2 x 8 = 32px tall (fine pointer: 16 + 2 x 4 = 24). */
  .a-note-card .a-note-chip::after{ inset:-8px -3px; }
  /* The hit areas reach (3px inset - 1px border) = 2px past each side, so the 8px gap leaves 4px clear: two targets that never overlap. */
  .a-note-card .a-note-sig{ gap:8px; }
}

/* ---------- checklist columns stack below 560px (container, not window) ----------
   Title, then the description across the row beneath it; the trailing group stays on the title
   line at the right. */
@container a-ncl (max-width:559px){
  .a-ncl-item{ grid-template-columns:14px 18px minmax(0,1fr) auto var(--a-ctl); }
  .a-ncl-item > .a-check{ grid-column:2; }
  .a-ncl-item > .a-ncl-tc{ grid-column:3; }
  .a-ncl-item > .a-ncl-dc{ grid-column:3 / -1; grid-row:2; }
  .a-ncl-item > .a-ncl-end{ grid-column:4; grid-row:1; }
  /* The flag moves to the row's trailing edge at a finger's size, drawn at rest so it can be found (spec 2.3). */
  .a-ncl-item > .a-ncl-pf{ grid-column:5; grid-row:1; width:var(--a-ctl); height:var(--a-ctl); padding:0; margin-top:-5px; opacity:1; }
}
