/* ============ THE STRIDE SETTINGS DESIGN SYSTEM ============
   The one `.stg-*` language for Team settings and My Settings (`_docs/_system/sys_stride-settings-design.md`
   §1-§5, §8): one canonical implementation, names frozen. Keep byte-identical across the
   `stride-configure-team-redesign` and `stride-my-settings-redesign` branches. */

.stg-shell{
  /* §1a. Brand constants: fixed and unthemed. These hexes match the dark-theme `--accent`/
     `--accent-2`/`--green` but stay literal, since a team's custom theme
     (JS/core/theme-custom.js) overrides those tokens and the ribbon must look the same on every
     team. Don't convert to a role reference. */
  --stg-ribbon-from:#2f82ff;
  --stg-ribbon-via:#28a9e8;
  --stg-ribbon-to:#13b981;
  --stg-ribbon:linear-gradient(135deg,var(--stg-ribbon-from) 0%,var(--stg-ribbon-via) 40%,var(--stg-ribbon-to) 100%);
  --stg-ribbon-soft:linear-gradient(135deg,rgba(47,130,255,.22),rgba(19,185,129,.13));
  /* The eyebrow's teal, a brand constant per base — 8.65:1 on the dark header gradient. The
     light value is restated below: this one measured 1.35:1 there (2026-10-10). */
  --stg-eyebrow:#6ed7c5;

  /* §1b. Structural roles, reused from the canonical --a-* ramp — settings-only NAMES pointing
     at roles alt-tokens.css already derived, so light theme and a custom team palette come free. */
  --stg-surface:var(--a-panel);
  --stg-surface-2:var(--a-raised);
  --stg-line:var(--a-line-soft);
  --stg-line-strong:var(--a-line-strong);
  --stg-text:var(--a-text);
  --stg-dim:var(--a-dim);
  --stg-faint:var(--a-faint);
  --stg-r:var(--a-r);
  --stg-r-lg:var(--a-r-lg);
  --stg-shadow:var(--a-shadow-sm);
  /* Larger than `.a-panel-ico`'s 22px because it's the section's primary identifier, not a
     supporting glyph beside an already-larger title. */
  --stg-tile-size:44px;
  --stg-tile-glyph:var(--a-glyph-lg);

  /* §1c. Focus — reuse, not a second focus treatment for settings controls. */
  --stg-ring:var(--a-ring);

  /* §2. Concern colours: four families (sys_stride-settings-design.md §2): BLUE team, PURPLE
     taxonomy, CYAN view, GOLD email. The families and colour-distance floor are the contract
     (settings-concern-colour-probe.py; blue/purple is weakest). Older names stay as aliases so
     `data-concern` stays valid; a new concern is a new alias, never a new hue. */

  /* The four canonical family colours — only these four carry a literal hex. */
  --stg-c-team:#69a8ff;
  --stg-c-taxonomy:#b99aff;
  /* Cyan replaced `view`/`links`/`workspace`; the old values were too close to neighbouring
     families (old `view` equalled team blue in light). */
  --stg-c-view:#2cc8dd;
  --stg-c-email:#ffc45d;

  /* Aliases: a concern name maps to a family and never carries its own hue.
     `people`/`okr`/`board`/`lock` are blue ("who is here"; a board is a container people belong
     to). `taxonomy` is its own canonical purple, not an alias of `board`. */
  --stg-c-people:var(--stg-c-team);
  --stg-c-okr:var(--stg-c-team);
  --stg-c-board:var(--stg-c-team);
  /* `lock` was undefined and silently fell back to team blue via the tile's own
     `var(--stg-c, var(--stg-c-team))`; it is now blue on purpose. JS/alt/alt-settings.js still
     spells it `lock`, so keep this alias until that changes. */
  --stg-c-lock:var(--stg-c-team);

  /* `import`/`ai`/`data` -> GOLD: all three cross the boundary the mail rows cross — content
     leaving the product, or being removed from it. AI is the substantive one: the reader's key
     and content go to a third party, the trust boundary sys_ai.md already draws. */
  --stg-c-import:var(--stg-c-email);
  --stg-c-ai:var(--stg-c-email);
  --stg-c-data:var(--stg-c-email);

  /* `time`/`links`/`workspace` -> CYAN. `time` was never about time: swimlane length, how long
     a finished task stays visible, the heavy-day alert, time zones and weather are all a
     display window or a widget — what this surface SHOWS, never something it sends anywhere. */
  --stg-c-time:var(--stg-c-view);
  --stg-c-links:var(--stg-c-view);
  --stg-c-workspace:var(--stg-c-view);

  /* "Locked" (no permission) is a status OVERRIDE, not one of the thirteen concerns — it
     REPLACES a concern's hue rather than competing with it, hence its own three-part token.
     Dark values are the kit's own `.wf-note.lock`; light values reuse the already-measured
     slate roles (--text-dim/--border/--panel-2) rather than inventing three unmeasured hexes. */
  --stg-c-locked:#95a8bb;
  --stg-c-locked-line:#334c66;
  --stg-c-locked-bg:#101d2a;
}

:root.theme-light .stg-shell,
:root.theme-light.stg-shell,
body.theme-light .stg-shell,
body.theme-light.stg-shell{
  /* The ribbon does not invert by theme — a brand mark doesn't change hue because the page did
     — but the soft wash needs less alpha on a white ground or it reads as a grey smear. */
  --stg-ribbon-soft:linear-gradient(135deg,rgba(47,130,255,.14),rgba(19,185,129,.08));
  /* 6.34:1 on --panel-2 and 7.35:1 on --panel (the header gradient's two ends) — enough margin
     that a custom light palette's lighter surfaces still clear 4.5:1. */
  --stg-eyebrow:#0b5a50;

  /* Only the four canonical hues are restated — every alias resolves through its family and so
     follows for free, which is what the suite's light/dark split check polices. Measured
     minimum pair dE here: 24.4 (blue/purple), against 0.0 before this change. */
  --stg-c-team:#1c5fb8;
  --stg-c-taxonomy:#6b4894;
  /* dE 45.4 from blue, 51.2 from purple, 67.3 from gold. White-glyph contrast on the tile's
     gradient is 6.11:1 at the start stop, 9.28:1 at the end — over the 3:1 WCAG 1.4.11 floor a
     control foreground needs, and over 4.5:1 besides. */
  --stg-c-view:#116b80;
  --stg-c-email:#6d4e00;

  /* The ten aliases are NOT repeated here, deliberately — each is `var(--stg-c-<family>)` in the
     dark block, re-resolving against whichever family value is in scope. Restating them would
     be a second place for light to disagree with dark. */

  /* Reused measured slate, not a fourth palette — see the dark block's own comment above. */
  --stg-c-locked:var(--a-dim);
  --stg-c-locked-line:var(--a-line);
  --stg-c-locked-bg:var(--a-raised);
}

/* ================= §5. The shell header, shared by both dialogs =================
   Team settings: eyebrow "STRIDE · TEAM SETTINGS", the team's name as title (sys_branding.md
   product/team split), subtitle "<role> · <team>". My Settings: no eyebrow, mark and wordmark
   inline, no subtitle. The mark is always stride-mark.svg, never a team's upload. */

.stg-head{
  position:relative;
  display:flex;
  align-items:center;
  gap:var(--a-3);
  padding:var(--a-sp-12) var(--a-pad-body);
  border-bottom:1px solid var(--stg-line-strong);
  background:linear-gradient(180deg, var(--stg-surface-2), var(--stg-surface));
}
/* The one ribbon strip both dialogs share, 3px, full width — `.stg-head` must be the FIRST
   child inside the dialog card for this to read as the card's edge, not a rule under a gap. */
.stg-head::before{
  content:"";
  position:absolute; left:0; right:0; top:0; height:3px;
  background:var(--stg-ribbon);
}

/* The `[S]` mark, `stride-mark.svg`, 30×28 — see the file header on why never a team's mark. */
.stg-head-mark{
  flex:0 0 auto;
  display:block;
  width:30px; height:28px;
}
/* The wordmark (My Settings only), separate from `.stg-eyebrow` (a small-caps label).
   Live text, not an image: there is no `stride-wordmark.svg`. Mirrors `index.html`'s
   `.stride-lockup-word`; text themes and scales, a raster doesn't. Don't add a wordmark asset. */
.stg-head-word{
  flex:0 0 auto;
  font-family:var(--a-display); font-weight:700; font-size:var(--a-fs-14);
  letter-spacing:.01em; color:var(--stg-text);
  line-height:var(--a-lh-tight);
}

/* The text stack — eyebrow (optional) / title / subtitle (optional) — the flexible member that
   pushes a trailing close button right by growing, not by margin on the button. */
.stg-head-copy{
  min-width:0;
  flex:1 1 auto;
}

/* `STRIDE · TEAM SETTINGS` — Team settings only. A brand constant, same rule as §1a: fixed,
   unthemed, never a concern colour. Reads as a THIRD colour distinct from the ribbon because it
   sits on dark chrome where the ribbon's own colours are already at full saturation above it. */
.stg-eyebrow{
  display:block;
  margin-bottom:var(--a-sp-2);
  font-size:var(--a-fs-11);
  font-weight:700;
  line-height:var(--a-lh-tight);
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--stg-eyebrow);
}

/* The overlay title (DS-14, DS-76): the same 16px/600 display face every dialog and pane wears. */
.stg-head-t{
  margin:0;
  font:600 var(--a-fs-16)/var(--a-lh-tight) var(--a-display);
  color:var(--stg-text);
}

.stg-head-sub{
  margin-top:1px;
  font-size:var(--a-fs-12);
  line-height:var(--a-lh-ui);
  color:var(--stg-dim);
}

/* ================= §3. THE SECTION CARD COMPONENT =================
   Collapsible-section rule of `sys_design-system.md` §6 applied to settings: `section.a-card.stg-sec`
   > `button.stg-sec-h` + `div.stg-sec-body[hidden]`. `aria-expanded` is the source of truth
   (spec §7); `.is-open` only mirrors it for engines without `:has()`. */

.stg-sec{
  /* `.a-card` already supplies background/border/radius — this adds the accent edge's room, the
     stacking context under it, and the gap between cards. */
  position:relative;
  overflow:hidden;
  /* Never shrink. `.admin-pane.active` is a flex column and `overflow:hidden` removes a flex
     item's automatic minimum, so with `flex-shrink:1` the cards collapse to slivers and the
     pane never overflows, hence never scrolls. */
  flex-shrink:0;
  margin-bottom:10px;
  box-shadow:var(--stg-shadow);
  transition:border-color var(--a-quick) var(--a-ease);
}
/* The container owns the gap. `margin-bottom` on `.stg-sec` left non-card siblings (Team
   Insights launcher, Import dropzone) flush, and `margin-top` would double every gap since flex
   items don't collapse margins. My Settings does the same (`.a-drawer-b`'s `row-gap:12px`). */
.alt-app #adminModal .admin-pane.active{ row-gap:10px; }
.alt-app #adminModal .admin-pane.active > .stg-sec{ margin-bottom:0; }
/* A little more than the card gap under the pane head — zeroing it entirely left Expand
   all/Collapse all the same 10px off the first card as two cards sit off each other, reading as
   though the controls belong to the card below rather than the pane. 6px on top of the
   container's row-gap gives 16px. */
.alt-app #adminModal .admin-pane.active > .stg-pane-head{ margin-bottom:6px; }

/* ================= My Settings pane head: same classes, different scope =====
   alt-team.css scopes `.stg-pane-head`/`.stg-pane-actions`/`.stg-fold-mount` to `#adminModal`;
   My Settings (altRenderSettings(), JS/alt/alt-settings.js) draws them inside `#altSettings`. The
   head sits outside `.a-drawer-b`'s scroll region (sys_stride-settings-design.md §3 rule 5). */
#altSettings .stg-pane-head{
  display:flex; align-items:center; justify-content:flex-end;
  padding:10px 12px 0;
}
#altSettings .stg-pane-actions{ display:flex; gap:8px; flex:0 0 auto; }
/* Generates no box, identically to `#adminModal .stg-fold-mount` — the mount is deliberately
   ABSENT (not merely empty) when the active tab has no foldable card, and `display:contents` is
   what keeps an empty mount from holding an 8px gap open around nothing. */
#altSettings .stg-fold-mount{ display:contents; }

/* ================= Workspace and Tasks tabs: two columns =================
   `[data-stg-tab]` is stamped on `#altSettingsBody` by altRenderSettings(). Reuses Configure Team's
   two-column pane (alt-team.css) and its crush fix: `.stg-sec`'s `overflow:hidden` removes a grid
   item's minimum size, so `min-height:min-content` and `grid-auto-rows:min-content` are required. */
#altSettings #altSettingsBody[data-stg-tab="workspace"],
#altSettings #altSettingsBody[data-stg-tab="tasks"]{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  grid-auto-rows:min-content;
  align-items:stretch;
  /* `column-gap` only: `.a-drawer-b`'s `gap` (alt-tasks.css) keeps supplying `row-gap`, since
     this id rule only wins the property it sets. 14px matches the team pane's column gap. */
  column-gap:14px;
}
/* Kept at zero cost in case `align-items` changes again: with `stretch` the height comes from
   the row's track size, not `height:auto`, but `start` depended on that mechanism. */
#altSettings #altSettingsBody[data-stg-tab="workspace"] .stg-sec,
#altSettings #altSettingsBody[data-stg-tab="tasks"] .stg-sec{
  min-height:min-content;
}
/* Full-width span: one class and one shared JS rule for both tabs. Named cards always span the
   full row alone; every other card pairs in DOM order, and a lone leftover spans full width.
   `stgSettingsGridRepaint(host, fullIds)` (JS/alt/alt-settings.js) applies it. These panes
   rebuild their body on every render, so no stale class can survive. */
#altSettings #altSettingsBody[data-stg-tab="workspace"] .stg-grid-solo,
#altSettings #altSettingsBody[data-stg-tab="tasks"] .stg-grid-solo{
  grid-column:1 / -1;
}
/* Below 880px — this codebase's established breakpoint for every other settings-pane grid
   (alt-team.css's People/Topics grids, and its own copy of this rule) — both panes stack to
   one column. */
@media (max-width: 880px){
#altSettings #altSettingsBody[data-stg-tab="workspace"],
#altSettings #altSettingsBody[data-stg-tab="tasks"]{
  grid-template-columns:1fr;
}
}

/* Tab panels sit one level deeper than the container gap reaches (`#importControls` and the
   "How import works" card are siblings inside `#importSubTasks`), so `margin-top` sets the
   14px gap. Scoped to the adjacency, not the card: `#importReferenceSec` also renders when the
   block above is hidden, and a card-only rule would leave a stray gap at the panel's top. */
.alt-app #adminModal #importControls + .stg-sec{ margin-top:14px; }

.stg-sec:hover{ border-color:var(--stg-line-strong); }

/* The accent edge — a 2px left border, filled with the brand ribbon, appears only while open.
   The one place the brand gradient marks user content rather than chrome, reserved so it keeps
   meaning "you opened this." A pseudo-element rather than `border-left` so it sits flush
   against `.stg-sec`'s `overflow:hidden` and is clipped at the corners for free. */
.stg-sec::before{
  content:"";
  position:absolute; left:0; top:0; bottom:0; width:2px;
  background:transparent;
}
.stg-sec:has(.stg-sec-h[aria-expanded="true"])::before,
.stg-sec.is-open::before{
  background:var(--stg-ribbon);
}
.stg-sec:has(.stg-sec-h[aria-expanded="true"]),
.stg-sec.is-open{
  border-color:var(--stg-line-strong);
}

/* The header is a real <button>, never a <div> with a click handler: native keyboard
   activation and `:focus-visible` (§3 rule 2: the whole row is the hit target). The rules below
   undo default button chrome, so the tag must stay a `<button>`. */
.stg-sec-h{
  all:unset;
  box-sizing:border-box;
  /* The spec's four tracks: chevron / icon tile / copy / state. Grid, not flex: the chevron is
     optional, and under flex a missing child shifts the rest left so tiles stop lining up.
     Each child is placed explicitly (below) so a missing chevron leaves its track empty. */
  display:grid;
  grid-template-columns:20px var(--stg-tile-size) minmax(0, 1fr) auto;
  align-items:center;
  gap:14px;
  min-height:66px;
  width:100%;
  padding:var(--a-sp-12) var(--a-sp-16);
  background:var(--stg-surface-2);
  border-bottom:1px solid var(--stg-line);
  cursor:pointer;
  text-align:left;
  font:inherit;
  color:inherit;
  -webkit-appearance:none;
  appearance:none;
  border:0;
  background:transparent;
  border-radius:var(--stg-r-lg);
  transition:background var(--a-quick) var(--a-ease);
}
/* Explicit tracks — naming the column for each child makes the row's shape independent of
   which children exist. */
.stg-sec-h > .stg-chev{ grid-column:1; }
.stg-sec-h > .stg-sec-ico{ grid-column:2; }
.stg-sec-h > .stg-sec-copy{ grid-column:3; }
.stg-sec-h > .stg-sec-state{ grid-column:4; }

.stg-sec-h:hover{ background:var(--stg-surface-2); }
.stg-sec-h:focus-visible{ outline:var(--a-focus); outline-offset:var(--a-focus-inset); }   /* inset: .stg-sec clips (DS-36) */
.stg-sec-h[aria-expanded="true"]{
  background:var(--stg-surface-2);
  border-bottom:1px solid var(--stg-line-strong);
}

.stg-chev{
  flex:0 0 auto;
  display:inline-flex; align-items:center; justify-content:center;
  color:var(--stg-faint);
  transition:transform var(--a-quick) var(--a-ease), color var(--a-quick) var(--a-ease);
}
.stg-chev svg{ width:var(--a-glyph); height:var(--a-glyph); }
/* A turning chevron, not a swapped glyph (sys_design-system.md §6b). `chev` is a down glyph, so
   the resting state is rotated: collapsed points right (-90deg), expanded points down (0deg). */
.stg-chev{ transform:rotate(-90deg); }
.stg-sec-h[aria-expanded="true"] .stg-chev{
  transform:rotate(0deg);
  color:var(--stg-dim);
}

/* ---- The icon tile ---- */
/* A FILLED TILE, NOT AN OUTLINED ONE — the approved sheet draws every section badge as a solid
   rounded square carrying its concern colour as a GRADIENT with a WHITE glyph; the tile is the
   strongest identifying mark on the panel. The first build inverted this (dark fill, coloured
   glyph, 1px border) and read as an outline of the design rather than the design. */
.stg-sec-ico{
  position:relative;
  width:var(--stg-tile-size); height:var(--stg-tile-size);
  flex:0 0 auto;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:var(--a-r);
  /* The concern colour with the theme's scrim darkening toward the far corner (a token, not a literal navy): the glyph is
     white, and the bright dark-theme concern colours need the darker end for contrast. */
  background:var(--stg-c, var(--stg-c-team));
  background-image:linear-gradient(150deg, transparent 0%, var(--a-scrim) 100%);
  color:var(--a-on-fill);
  border:0;
  box-shadow:var(--a-shadow-sm);
  overflow:hidden;
}
/* The ribbon wash behind every glyph reuses the already-themed `--stg-ribbon-soft` token
   rather than a second literal gradient, so it survives light theme for free. */
.stg-sec-ico::before{
  content:"";
  position:absolute; inset:0;
  background:var(--stg-ribbon-soft);
  opacity:.95;
}
/* The diagonal ribbon sliver, at the kit's own 38% opacity — the one other place (besides the
   accent edge) the full-strength brand gradient appears inside a page rather than the shell
   header. */
.stg-sec-ico::after{
  content:"";
  position:absolute; left:-8px; bottom:3px;
  width:30px; height:5px;
  border-radius:var(--a-r-pill);
  background:var(--stg-ribbon);
  transform:rotate(-28deg);
  opacity:.38;
}
.stg-sec-ico svg{
  position:relative; z-index:1;
  width:var(--stg-tile-glyph); height:var(--stg-tile-glyph);
  stroke-width:1.9;
}

/* Every concern is the same colour everywhere it appears (§3 rule 7) — one attribute selector
   per concern, never a generic tinted chip with no semantic meaning. The concern feeds the
   FILL, not the glyph: each rule sets `--stg-c`, which the tile's gradient reads; the glyph is
   white on every concern, clearing contrast on all thirteen with no per-concern pass. */
.stg-sec-ico[data-concern="team"]{ --stg-c:var(--stg-c-team); }
.stg-sec-ico[data-concern="board"]{ --stg-c:var(--stg-c-board); }
.stg-sec-ico[data-concern="people"]{ --stg-c:var(--stg-c-people); }
.stg-sec-ico[data-concern="okr"]{ --stg-c:var(--stg-c-okr); }
.stg-sec-ico[data-concern="email"]{ --stg-c:var(--stg-c-email); }
.stg-sec-ico[data-concern="taxonomy"]{ --stg-c:var(--stg-c-taxonomy); }
.stg-sec-ico[data-concern="import"]{ --stg-c:var(--stg-c-import); }
.stg-sec-ico[data-concern="view"]{ --stg-c:var(--stg-c-view); }
.stg-sec-ico[data-concern="time"]{ --stg-c:var(--stg-c-time); }
.stg-sec-ico[data-concern="links"]{ --stg-c:var(--stg-c-links); }
.stg-sec-ico[data-concern="ai"]{ --stg-c:var(--stg-c-ai); }
.stg-sec-ico[data-concern="data"]{ --stg-c:var(--stg-c-data); }
.stg-sec-ico[data-concern="workspace"]{ --stg-c:var(--stg-c-workspace); }
/* `lock` — the Account tab's two rows. Had no rule or token until this pass, so it fell through
   the tile's own fallback and painted team blue with no error of any kind. Blue ON PURPOSE now
   (credentials are the reader's own access) — the JS spelling is the remaining half, reported
   not fixed here. */
.stg-sec-ico[data-concern="lock"]{ --stg-c:var(--stg-c-lock); }

/* ---- Status overrides — apply AFTER a concern colour, never instead of the icon glyph ---- */
/* Disabled/quiet: a real utility, not a token, layered on top of whichever concern is present
   (kit's own `.wf-sec-ico.quiet`). */
.stg-sec-ico.quiet{ filter:saturate(.45); opacity:.72; }
/* Warning/danger reuse the canonical status roles rather than inventing settings-only ones. */
.stg-sec-ico.warn  { color:var(--a-amber); border-color:var(--a-amber); background:var(--a-amber-soft); }
.stg-sec-ico.danger{ color:var(--a-red);   border-color:var(--a-red);   background:var(--a-red-soft); }

/* The one context exception (§3): a solid ribbon fill with a white glyph, overriding whichever
   concern colour the tile would otherwise carry — at most one tile per pane. Same specificity
   as the `[data-concern]` rules, so it must come AFTER them to win on source order. A
   highlight, never a substitute for `aria-expanded`/`.is-open` — independent of open/closed. */
.stg-sec-ico.is-context{
  background:var(--stg-ribbon);
  color:var(--a-on-fill);
  box-shadow:var(--a-shadow-sm);
}
.stg-sec-ico.is-context::before{ opacity:0; }

/* A column, not two inline spans: `.stg-sec-t`/`.stg-sec-d` are inline <span>s, so truncation
   and margin rules on them were inert and the text ran together. A flex column blockifies both
   children. */
.stg-sec-copy{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width:0;
}
.stg-sec-copy > *{ min-width:0; }
.stg-sec-t{
  font-size:var(--a-fs-14); font-weight:700; color:var(--stg-text);
  line-height:var(--a-lh-tight);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
/* Truncates to one line under width pressure rather than wrapping and pushing the state
   summary off-baseline — the spec's own instruction for `.stg-sec-copy` under narrowing. */
/* THE DESCRIPTION WRAPS TO TWO LINES RATHER THAN TRUNCATING — these are full sentences, and an
   ellipsis on the first line hides the half that explains the setting. The header is 66px tall
   with no fixed height, so a second line costs nothing. */
.stg-sec-d{
  margin-top:3px; font-size:var(--a-fs-12); color:var(--stg-faint); line-height:var(--a-lh-ui);
  /* No clamp — a two-line clamp was cutting real sentences mid-clause, reading as broken
     rather than tidy. */
  white-space:normal;
}

/* No `flex:0 0 auto; margin-left:auto` here any more — leftover from when this header was a
   flex row; in a grid they actively broke the narrow-width rule (an auto left margin shrinks a
   grid item to its content), so the summary sat at the column's right edge instead of starting
   under the title. Track 4 is already `auto`-sized, so nothing is lost dropping them. */
.stg-sec-state{
  padding-left:12px;
  font-size:var(--a-fs-11); color:var(--stg-dim); white-space:nowrap; text-align:right;
}
/* Sub-modifiers for the collapsed-state summary, mirroring the kit's own `.wf-sec-state
   .muted/.warn/.none` — "every shut card states its current value" (§3 rule 1) can say more
   than one thing: a plain count, a warning, or "off". */
.stg-sec-state .muted, .stg-sec-state.muted{ color:var(--stg-faint); }
.stg-sec-state .warn,  .stg-sec-state.warn { color:var(--a-amber); }
.stg-sec-state .none,  .stg-sec-state.none { color:var(--stg-faint); }
.stg-sec-state .good,  .stg-sec-state.good { color:var(--a-green); }

/* ================= §4. SUPPORTING COMPONENTS — genuinely new only =================
   Everything reusable (`.pref-row`, `.pref-switch`, `.a-check-l`, `.a-btn`, `.empty-state`,
   `.add-row`, `.role-badge`, `.a-chip`, the drag-handle pattern, the admin grid header row) is
   NOT here — existing vocabulary, used unchanged inside `.stg-sec-body`. */

/* ---- Note block: info / warn / lock / danger ---- */
.stg-note{
  display:flex; align-items:flex-start; gap:10px;
  padding:10px 12px;
  border-radius:var(--a-r);
  border:1px solid var(--stg-line);
  background:var(--stg-surface-2);
  color:var(--stg-dim);
  font-size:var(--a-fs-12); line-height:var(--a-lh-ui);
}
.stg-note-ico{
  display:inline-flex; flex:0 0 24px; width:24px; height:24px;
  align-items:center; justify-content:center;
  border-radius:var(--a-r-sm);
  background:var(--stg-surface);
  color:var(--a-blue-text);
}
.stg-note-ico svg{ width:var(--a-glyph); height:var(--a-glyph); }

/* Space only when something follows: `.stg-sec-body` has no flex gap, so children stack flush.
   12px is this dialog's sibling rhythm (alt-team.css add-row rule); `:not(:last-child)` avoids
   dangling space under a note that ends its section. */
.stg-note:not(:last-child){ margin-bottom:12px; }

.stg-note.info{ border-color:var(--a-blue); background:var(--a-blue-soft); }
.stg-note.info .stg-note-ico{ color:var(--a-blue-text); }

.stg-note.warn{ border-color:var(--a-amber); background:var(--a-amber-soft); color:var(--stg-text); }
.stg-note.warn .stg-note-ico{ background:var(--a-amber-soft); color:var(--a-amber); }

.stg-note.danger{ border-color:var(--a-red); background:var(--a-red-soft); color:var(--stg-text); }
.stg-note.danger .stg-note-ico{ background:var(--a-red-soft); color:var(--a-red); }

/* Desaturated, not tinted, per §2's Locked status override — a locked tile (or note) must never
   read as "some other concern," it must read as "off limits." */
.stg-note.lock{
  border-color:var(--stg-c-locked-line);
  background:var(--stg-c-locked-bg);
  color:var(--stg-c-locked);
}
.stg-note.lock .stg-note-ico{ background:var(--stg-c-locked-line); color:var(--stg-c-locked); }

/* ---- Swatch — small colour square, e.g. a tag's colour dot ----
   Checked before adding: no generic swatch class existed yet in this codebase, so this is
   genuinely new rather than a duplicate of something reusable. */
.stg-swatch{
  display:inline-block;
  width:18px; height:18px;
  border-radius:var(--a-r-sm);
  border:1px solid var(--a-line-strong);
  flex:0 0 auto;
}

/* ================= §8. RESPONSIVE SPEC =================
   Scoped to what this file owns — the section-card header grid. Dialog framing (width, height,
   tab-strip overflow) belongs to each host's own shell chrome. Breakpoint matches the
   wireframe kit's own `@media(max-width:900px)`. */
@media (max-width:900px){
  .stg-sec-h{
    grid-template-columns:18px 34px minmax(0,1fr);
  }
  /* The state summary drops to its own line under the title rather than being clipped, per the
     spec. Written as `.stg-sec-h > .stg-sec-state` to match the explicit placement above — a
     media query adds no specificity, so a bare `.stg-sec-state` here would lose to §3's child
     rule and the summary would stay in a column-4 this three-track grid doesn't have. */
  .stg-sec-h > .stg-sec-state{
    grid-column:3;
    text-align:left;
    padding-left:0;
    padding-top:2px;
    white-space:normal;
  }
}

/* No separate prefers-reduced-motion block — every transition above is
   `<property> var(--a-quick) var(--a-ease)`, and alt-tokens.css already zeroes `--a-quick` on
   `.alt-app` (which every page mounting `.stg-shell` also wears) under that media query. A
   second override here would just set the same custom property to the same value again. */


/* ============================================================================================
   §3b. The panel body and its rows.
   A row is label and description on the left, control on the right. Rows are separated by a
   hairline, not margin, with none on the last row (it would double the panel's bottom edge). */
/* Body padding is the one body padding (DS-45, --a-pad-body). A smaller end padding hit every body, including
   prose and notes, so the stacking with `.stg-row`'s own 12px is cancelled at the first and last
   row instead. */
.stg-sec-body{ padding:var(--a-pad-body); }
/* A body with no chrome of its own (a full-bleed table, e.g. People's roster) uses this instead of fighting the padding. */
.stg-sec-body.flush{ padding:0; }
.stg-sec-body > .stg-row:first-child{ padding-top:4px; }
.stg-sec-body > .stg-row:last-child{ padding-bottom:4px; }

/* "Add a group" is a row's neighbour, not its continuation — the Notes Groups card draws the
   list then this button with nothing between, reading as a fourth group rather than the action
   that makes one. */
.stg-shell #sNoteGroupAdd{ margin-top:12px; }

/* "Back to the default set" is a bare button an `{html:...}` row hands to altRows() as one blob;
   the row-spacing rules only see `.stg-row` siblings, so it sat flush on both sides. 12px is
   the dialog's sibling rhythm, applied on both edges. */
.stg-shell #sQuickReset{ margin:12px 0; }

.stg-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,auto);
  align-items:center;
  gap:16px;
  padding:var(--a-sp-12) 0;
  border-bottom:1px solid var(--stg-line);
}
.stg-row:last-child{ border-bottom:0; }
/* The same bug as `.stg-sec-copy`, one component away: a <span> is inline until told otherwise,
   so `.stg-row-t`/`.stg-row-d` ran together and `.stg-row-d`'s `margin-top` was inert. */
.stg-row-copy{
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width:0;
}
.stg-row-copy > *{ min-width:0; }
.stg-row-t{
  font-size:var(--a-fs-13); font-weight:600; color:var(--stg-text); line-height:var(--a-lh-ui);
}
.stg-row-d{
  margin-top:3px; font-size:var(--a-fs-12); color:var(--stg-faint); line-height:var(--a-lh-ui);
}
/* A row that does not apply to the view on screen (Group by in Week): dimmed, its description saying why. */
.stg-row.is-disabled .stg-row-t{ color:var(--stg-faint); }
/* The control column is CAPPED, not content-sized — a <select> whose longest option is "STRIDE
   Default — modern" would otherwise set the column and shove every other row's control out of
   alignment; the sheet draws every control in one right-hand column of equal width. */
.stg-row-ctl{
  min-width:0;
  flex:0 0 auto;
  display:flex; align-items:center; justify-content:flex-end; gap:8px;
}
.stg-row-ctl > select,
.stg-row-ctl > input[type="text"],
.stg-row-ctl > input[type="number"]{ min-width:0; width:clamp(140px,22vw,240px); }

/* A row whose control belongs under its copy rather than beside it — a checkbox group, a list,
   a drag-ordered set. The sheet draws these as a full-width inset well below the label. */
.stg-row.stacked{ grid-template-columns:minmax(0,1fr); }
.stg-row.stacked .stg-row-ctl{ justify-content:flex-start; margin-top:10px; }
/* A stacked textarea (Email signature) fills the row, like the well beside it. */
.stg-row.stacked .stg-row-ctl > textarea{ width:100%; min-width:0; box-sizing:border-box; }

/* ================= Your tags: four columns, every track fixed =================
   sys_design-system.md §7: an admin list with per-row controls is a grid with fixed tracks.
   `.a-tagrow` (alt-shell.css) only pins the swatch, so counts drifted per row. Scoped to
   `#sTagList` because `.a-tagrow` renders other shapes too. Notes Groups draws `.stg-row`. */
.stg-shell #sTagList.a-tagrow,
.stg-shell #sTagList .a-tagrow{
  display:grid;
  grid-template-columns:44px minmax(0,1fr) 92px auto;
}
/* The count text's own COLUMN, not its own width — "on 999 items" and "unused" both fit inside
   92px; the fixed track is what keeps the text starting at the same x on every row. */
.stg-shell #sTagList .a-tagrow .use{ text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* Buttons in a grid cell must be told not to stretch to fill their track (sys_design-system.md
   §7) — `justify-items` defaults to `stretch`, which would draw Delete as a full-width bar. */
.stg-shell #sTagList .a-tagrow .danger{ justify-self:start; }

/* ================= Account -> Address book (JS/alt/alt-settings-address-book.js) =================
   Rows are the `.stg-row` record row inside the `.stg-well` group; only what those two do not cover is declared here. */
.stg-ab-find{ margin:12px 0 10px; }
.stg-ab-find .a-input{ width:100%; box-sizing:border-box; }
/* Up to ~7 rows, then the list scrolls; the page never grows with the book (500 rows at most). */
.stg-ab-list{ max-height:320px; overflow-y:auto; }
.stg-ab-list .stg-row{ padding:10px 13px; }
.stg-ab-blocked{ margin-bottom:4px; }
.stg-ab-addr{ overflow:visible; white-space:normal; overflow-wrap:anywhere; }  /* the address is never cut; only the meta line below ellipsizes */
.stg-ab-row .stg-row-d{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.stg-ab .a-empty{ padding:22px 16px; }
.stg-ab .a-err{ margin:12px 0; }
.stg-ab .stg-note{ margin:10px 0 0; }
/* Never remembered: a disclosure in the card's own chevron language, closed until asked for. */
.stg-ab-fold{
  display:flex; align-items:center; gap:8px; margin:12px 0 8px; padding:4px 2px;
  background:none; border:0; color:var(--stg-dim); font:inherit; font-size:var(--a-fs-12); font-weight:600; cursor:pointer;
}
.stg-ab-fold:hover{ color:var(--stg-text); }
.stg-ab-fold:focus-visible{ outline:var(--a-focus); outline-offset:var(--a-focus-offset); border-radius:var(--a-r-sm); }
.stg-ab-fold[aria-expanded="true"] .stg-chev{ transform:rotate(0deg); color:var(--stg-dim); }
.stg-ab-foot{ margin-top:14px; }
/* Loading: three rows the size of real ones, so nothing jumps when the book arrives. */
.stg-ab-skel{ display:flex; flex-direction:column; gap:7px; padding:13px; }
.stg-ab-skel-bar{ display:block; height:11px; width:55%; border-radius:var(--a-r-sm); background:var(--stg-surface-2); animation:stg-ab-pulse 1.4s ease-in-out infinite; }
.stg-ab-skel-bar.short{ width:30%; height:9px; }
@keyframes stg-ab-pulse{ 50%{ opacity:.45; } }
@media (prefers-reduced-motion:reduce){ .stg-ab-skel-bar{ animation:none; } }

/* ================= Account -> Developer access (JS/features/api-tokens-card.js) =================
   Records are `.stg-row` in `.stg-well`, notes `.stg-note`, buttons and fields the shared ones. Only what those do not cover:
   a mono chip (`.a-code` lives on the Admin Console's sheet, which these pages do not load), the full-width block, the form stack. */
.stg-api > .stg-row:first-child{ padding-top:4px; }
.stg-api > .stg-row:last-child{ padding-bottom:4px; }
.stg-api-block{ width:100%; min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:10px; }
.stg-api-block > .stg-well,
.stg-api-block > .a-empty{ align-self:stretch; }
.stg-api-block > .stg-ab-fold{ margin:0; }
.stg-api-code{
  padding:1px 5px; border-radius:var(--a-r-sm); background:var(--stg-surface-2); color:var(--stg-text);
  font-size:var(--a-fs-12); font-weight:400; overflow-wrap:anywhere;
}
.stg-api .a-empty{ padding:22px 16px; }
.stg-api .stg-well > .stg-row{ padding:10px 13px; }
.stg-api-form .a-field > .a-seg-ctl{ align-self:flex-start; }
.stg-api-tags{ display:inline-flex; flex-wrap:wrap; gap:6px; margin-left:8px; vertical-align:middle; }
.stg-api-row .stg-row-ctl{ flex-wrap:wrap; }
.stg-api-form{ display:flex; flex-direction:column; gap:10px; align-self:stretch; }
.stg-well > .stg-api-form{ padding:12px 13px; }
.stg-api-form > .stg-note{ margin-bottom:0; }
@media (max-width:560px){
  .stg-api-row{ grid-template-columns:minmax(0,1fr); gap:8px; }
  .stg-api-row .stg-row-ctl{ justify-content:flex-start; }
}

/* An inset well — the bordered group the sheet draws around checkbox lists (the four widget
   ticks, the event switches). A container, not a card: no icon, no header, one hairline
   between items, sits INSIDE a panel body. */
.stg-well{
  border:1px solid var(--stg-line);
  border-radius:var(--a-r);
  background:var(--stg-surface);
  overflow:hidden;
}
.stg-well > *{ border-bottom:1px solid var(--stg-line); }
.stg-well > *:last-child{ border-bottom:0; }
.stg-well .a-check-l,
.stg-well .stg-well-row{
  display:flex; align-items:center; gap:11px;
  padding:11px 13px; margin:0; font-size:var(--a-fs-13);
}

/* A static panel header. `.stg-sec-h` is a <button> when the panel discloses; one that never
   folds uses a <div> with the same class, so the geometry is declared once — `all:unset` is
   inert on a div, and the cursor/hover belong only to the interactive form. */
div.stg-sec-h{ cursor:default; }
div.stg-sec-h:hover{ background:var(--stg-surface-2); }
.stg-sec-h:not(button) .stg-chev{ display:none; }
/* No second column recipe: the header is flex, so an absent chevron simply takes no space. */


/* ================= §3c. Every icon inside a button is sized =================
   `altIcon()` emits an `<svg viewBox="0 0 24 24">` with no width/height, so an unsized one
   stretches to its container. Scoped to the two settings surfaces and to `> svg`, so it cannot
   reach `.stg-sec-ico` (44px) or `.stg-chev`, which size their own child. */
.stg-shell button > svg,
.stg-shell a.a-btn > svg,
.stg-shell a.btn > svg,
.alt-app #adminModal button > svg,
.alt-app #adminModal a.btn > svg,
.alt-app #adminModal a.a-btn > svg{
  width:var(--a-glyph); height:var(--a-glyph); flex:0 0 auto;
}
/* Icons outside a button: the Import-people dropzone draws its upload arrow into a plain <div>,
   which the button-scoped rule doesn't reach. Larger than a button icon on purpose, since the
   glyph is the target. */
.alt-app #adminModal .import-dropzone > svg,
.stg-shell .import-dropzone > svg,
.alt-app #adminModal .a-dropzone > svg,
.stg-shell .a-dropzone > svg{ width:34px; height:34px; flex:0 0 auto; }

/* An icon-only control keeps the slightly larger glyph its own rules already give it. */
.stg-shell button.icon-only > svg,
.alt-app #adminModal button.btn.icon-only > svg,
.alt-app #adminModal a.btn.icon-only > svg{ width:var(--a-glyph); height:var(--a-glyph); }

/* ================= Outlook calendar card (JS/features/outlook-calendar-settings.js) =================
   Genuinely new: no settings-sheet component drew a numbered guide, a status line with a dot, or a
   connect field row. Notes reuse `.stg-note`, buttons `.a-btn`, the field `.a-input`, copy `.stg-row-t/-d`;
   the guide's disclosure follows `.org-logo-more` (summary, focus ring), the steps are numbered with CSS. */
.stg-oc{ display:flex; flex-direction:column; gap:12px; min-width:0; }
.stg-oc > *{ min-width:0; }
.stg-oc .stg-oc-hint{ margin:0; }
.stg-oc-status{ display:flex; align-items:center; flex-wrap:wrap; gap:4px 8px; font-size:var(--a-fs-13); color:var(--stg-text); }
.stg-oc-muted{ color:var(--stg-dim); font-size:var(--a-fs-12); overflow-wrap:anywhere; }
.stg-oc-dot{ width:9px; height:9px; border-radius:50%; flex:0 0 auto; background:var(--a-green); }
.stg-oc-dot.warn{ background:var(--a-amber); }
.stg-oc-dot.err{ background:var(--a-red); }
.stg-oc-dot.off{ background:var(--stg-faint); }
.stg-oc-actions, .stg-oc-field, .stg-oc-confirm-btns{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.stg-oc-field .a-input{ flex:1 1 220px; min-width:0; }   /* the feed link is a standard field (DS-66), not a mono one */
.stg-oc-confirm-btns{ margin-left:auto; }
.stg-oc-note-t{ min-width:0; overflow-wrap:anywhere; flex:1 1 auto; }
.stg-oc .stg-note{ margin-bottom:0; align-items:center; }
.stg-oc-bico{ display:inline-flex; }
.stg-oc-bico svg{ width:var(--a-glyph); height:var(--a-glyph); }
.stg-oc-busy .stg-oc-bico svg{ animation:refresh-spin var(--dur-progress, 1s) linear infinite; }
@media (prefers-reduced-motion:reduce){ .stg-oc-busy .stg-oc-bico svg{ animation:none; } }

.stg-guide{ border:1px solid var(--stg-line); border-radius:var(--stg-r, 9px); background:var(--stg-surface); }
.stg-guide > summary{ cursor:pointer; padding:9px 12px; font-size:var(--a-fs-13); font-weight:600; color:var(--stg-text); border-radius:var(--stg-r, 9px); }
.stg-guide > summary:focus-visible, .stg-guide-alt > summary:focus-visible{ outline:var(--a-focus); outline-offset:var(--a-focus-offset); }
.stg-guide[open] > summary{ border-bottom:1px solid var(--stg-line); border-bottom-left-radius:0; border-bottom-right-radius:0; }
.stg-guide-body{ padding:10px 12px 12px; font-size:var(--a-fs-12); line-height:var(--a-lh-ui); color:var(--stg-dim); }
.stg-guide-p{ margin:0 0 6px; }
.stg-guide-p strong, .stg-guide-list strong{ color:var(--stg-text); }
.stg-guide-p code, .stg-guide-list code{ font-family:var(--a-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size:var(--a-fs-12); color:var(--stg-text); overflow-wrap:anywhere; }
.stg-guide-steps{ list-style:none; margin:10px 0; padding:0; display:flex; flex-direction:column; gap:14px; counter-reset:stgg; }
.stg-guide-steps > li{ position:relative; padding-left:34px; counter-increment:stgg; min-width:0; }
.stg-guide-steps > li::before{
  content:counter(stgg); position:absolute; left:0; top:0; width:22px; height:22px; border-radius:50%;
  display:grid; place-items:center; font-size:var(--a-fs-12); font-weight:700; color:var(--a-on-fill); background:var(--a-blue-fill);
}
.stg-guide-t{ font-size:var(--a-fs-13); font-weight:700; color:var(--stg-text); margin-bottom:3px; }
.stg-guide-list{ margin:2px 0 6px 18px; padding:0; }
.stg-guide-list li{ margin:2px 0; overflow-wrap:anywhere; }
.stg-guide-alt{ margin-top:6px; }
.stg-guide-alt > summary{ cursor:pointer; font-weight:600; color:var(--stg-text); border-radius:var(--stg-r, 9px); padding:2px 0; }
.stg-guide-alt[open] > summary{ margin-bottom:6px; }
.stg-guide-foot{ margin:0; }

/* ---------- altRows() range and list rows: used by Customize and by My Settings on every host (events.html loads this sheet, not alt-customize.css) ---------- */
.stg-range{ display:flex; align-items:center; gap:var(--a-2); width:100%; min-width:0; }
.stg-range-in{ flex:1 1 auto; min-width:0; height:28px; margin:0; accent-color:var(--a-blue); cursor:pointer; }
.stg-range-in:disabled{ cursor:not-allowed; opacity:.5; }
.stg-range-out{ flex:0 0 auto; min-width:84px; font-size:var(--a-fs-13); font-weight:600; color:var(--a-text); text-align:right; }
.stg-row.stacked .stg-row-ctl > .stg-range{ width:100%; }

.stg-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:3px; width:100%; }
.stg-list-i{ display:flex; align-items:flex-start; gap:8px; min-height:32px; padding:3px 4px 3px 8px;
  border:1px solid var(--a-line-soft); border-radius:var(--a-r); background:var(--a-panel); font-size:var(--a-fs-13); }
.stg-list-i.is-off .stg-list-n{ color:var(--a-faint); }
.stg-list-lab{ flex:1 1 auto; min-width:0; display:flex; align-items:flex-start; gap:8px; padding-top:4px; cursor:pointer; }
/* The name on line 1 and its description under it, both wrapping: a label is never clipped, and the switch and the
   move buttons stay level with the first line. */
.stg-list-t{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:1px; }
.stg-list-n{ min-width:0; line-height:var(--a-lh-ui); overflow-wrap:anywhere; color:var(--a-text); }
.stg-list-note{ min-width:0; font-size:var(--a-fs-11); line-height:var(--a-lh-ui); overflow-wrap:anywhere; color:var(--a-faint); }
.stg-list-mv{ flex:0 0 auto; }
.stg-list-mv svg{ width:var(--a-glyph); height:var(--a-glyph); }
.stg-list-mv[data-dir="-1"] svg{ transform:rotate(180deg); }
